User Guides | FlexCel Studio for the .NET Framework documentation

User Guides

In this section we cover the concepts that you need to know in order to use FlexCel effectively.

The documents here are not a full reference for every type and method in FlexCel: If you are looking for the reference documentation in the methods and classes, you can find it in the API Documentation tab.

In this section:

Installation Guide

Because before using FlexCel you need to install it.

Getting started

An introduction to start using FlexCel quickly.

API Developer Guide

How to use the FlexCel API to read and write Excel files.

Reports Developer Guide

How to create Excel files by replacing tags in a template.

Reports Designer Guide

How to design a template to be used with FlexCelReport.

Reports Tag Reference

A list with all the tags available in a report.

Performance Guide

How to get the most of FlexCel performance wise.

PDF Exporting Guide

How to use FlexCel to export Excel files to PDF.

HTML Exporting Guide

How to use FlexCel to export Excel files to HTML.

iOS Guide

Special considerations when working in iOS.

Android Guide

Special considerations when working in Android.

Windows Phone, Store and Universal apps Guide

How to use FlexCel inside Universal apps, and the limitations on it.

Mono Guide

How to use FlexCel with Mono.

.NET Core

Using FlexCel with .NET Core.

In This Article
Back to top FlexCel Studio for the .NET Framework v7.21.0.0
© 2002 - 2024 tmssoftware.com


FlexCel Installation Guide | FlexCel Studio for the .NET Framework documentation

FlexCel Installation Guide

Choosing how to install FlexCel

You can install FlexCel in 2 different ways:

  1. If installing in Windows, you can just run the setup.exe downloaded from our website. It will install all the examples, the dlls, the NuGet packages and the docs.
  2. If installing in macOS, we don't have an automatic setup, but you can download the NuGet packages from our website, register them, and use them. You should still install the full FlexCel with setup.exe in a Windows machine to be able to see and run all the examples.

Registering the FlexCel NuGet packages

If you installed FlexCel via setup.exe, then you don't need to do anything else: Setup should have registered the FlexCel NuGet packages for you. If you downloaded the NuGet packages directly, then you need to put them in a private NuGet repository.

Important

Because FlexCel is not open source, the FlexCel NuGet packages must be put inside a private repository that only people with a license can access it. Please don't put them in a public repository like nuget.org.

There are many ways to put FlexCel in a private repository, and depending on your needs you might find some better than others. You can read about it here: https://docs.microsoft.com/en-us/nuget/hosting-packages/overview

However, the simplest way is just to add the folder where the FlexCel NuGet packages are to the NuGet feeds. Even when https://docs.microsoft.com/en-us/nuget/hosting-packages/overview mentions putting them in a network share, there is no need to share the folder. You can use a simple not shared folder, and this is what the FlexCel Setup does. To do it manually when you are not using Setup.exe follow the steps below:

  1. If you want to install from inside Visual Studio, go to Menu->Tools->NuGet Package Manager->Package Manager Console. If you don't have Visual Studio, you can install NuGet following the instructions in https://docs.microsoft.com/en-us/nuget/guides/install-nuget

  2. Either from the Package Manager console, a command line prompt or a terminal, type:

nuget sources Add -name flexcel.tmssoftware.com -Source <path-to-where-the-flexcel-package-is>

So if for example the FlexCel package is at C:\Users\adrian\Documents\TMSSoftware\FlexCelNET\nuget your screen should look as follows: package manager add sources

Note

You can also visually manage your package sources by going to Menu->Tools->NuGet Package Manager->Package Manager Options: package manager options

But in this guide we preferred to focus on the command line way, because it allows you to register nuget sources even if Visual Studio is not available.

For uninstalling the source, just go to the package manager options and remove it, or type:

nuget sources Remove -name flexcel.tmssoftware.com

Referencing the FlexCel NuGet packages

Once you have the nuget sources set up, either because you used setup.exe or because you set them up manually, you need to reference them from your project. To do that, right-click your project, and select Manage NuGet Packages:

manage nuget packages

Once in the package manager, follow the steps: nuget reference flexcel

  1. Select Browse
  2. Select All as the package source.
  3. Search for FlexCel
  4. Select the TMS.FlexCel package.
  5. Press Install.
Note

In step 2, you could have selected "flexcel.tmssoftware.com" as source instead of "All", to be able to find FlexCel faster. But if you selected flexcel.tmssoftware.com it wouldn't be able to resolve dependencies to other packages in nuget.org.

So to be safe, make sure to select All and search for FlexCel, instead of selecting the flexcel.tmssoftware.com feed

Note

Normally the only package you need to install is TMS.FlexCel. This package includes almost all the functionality in FlexCel. But when doing WinForms apps, there is an Excel previewer available in the TMS.FlexCel.WinForms package that you might also want to use. For WebForm apps, there is also a viewer which is available in the TMS.FlexCel.WebForms package.

The extra packages only work in Windows and in WinForms or WebForms apps. For all other kinds of apps, the only package that you need and can install is TMS.FlexCel.

Manually Referencing FlexCel

If you prefer not to work with nuget packages, FlexCel setup also installs the dlls directly. Instead of adding the NuGet package, you can just right click in the "References" entry in your project, select "Add Reference" and manually add the FlexCel.dll that is needed for your platform and framework type.

Note

In FlexCel for .NET Core you can't manually reference the assemblies and the only choice is via NuGet.

In This Article


Getting Started with FlexCel Studio for the .NET Framework | FlexCel Studio for the .NET Framework documentation

Getting Started with FlexCel Studio for the .NET Framework

0. Before starting: Choosing how to install and reference FlexCel

When installing FlexCel, there are 2 options:

  1. Download the exe setup. This is the preferred way to install FlexCel in Windows, since it will install the NuGet package, the libraries, the examples and docs.

  2. Download the NuGet packages. This includes only the NuGet packages (which are also included in the exe setup), but doesn't include example code or docs, and won't register the NuGet source in your machine. This is the preferred way to install FlexCel in platforms different from Windows, and you can find more information on how to install it on the installation guide.

Once you have FlexCel installed, you need to decide how to reference it. There are 2 ways you can reference FlexCel:

  1. Install via NuGet packages. This is a standard installation same as any other NuGet installation, but with the difference that FlexCel is not stored in nuget.org How to install via NuGet is detailed step by step in the installation guide

  2. Install by manually referencing the assemblies. This is possible in all platforms except in .NET Core, where the only option is via NuGet.

How you decide to reference the assemblies is up to you: .NET is moving from a monolithic framework to a framework "on demand" via NuGet, and so we would recommend you to use NuGet too. But if you prefer to reference the assemblies directly, you can do that too.

Tip

If you are unsure, just install the exe setup and use the FlexCel NuGet packages.

1. Creating an Excel file with code

The simplest way to use FlexCel is to use the XlsFile class to manipulate files.

To get started, create an empty Console application and save it. Add the TMS.FlexCel NuGet package to your application or add a manual reference to FlexCel.dll

Then replace all the text in the file by the following:

using System;
using FlexCel.Core;
using FlexCel.XlsAdapter;

namespace Samples
{
    class MainClass
    {
        public static void Main(string[] args)
        {
            //Create a new empty Excel file, with default formatting as if it was created by Excel 2019.
            //Different Excel versions can have different formatting when they create
            //an empty file, so for example
            //Excel 2003 will have a default font of Arial, and 2019 will use Calibri.
            //This format is anyway the starting format, you can change it all later.
            XlsFile xls = new XlsFile(1, TExcelFileFormat.v2019, true);

            //Enters a string into A1.
            xls.SetCellValue(1, 1, "Hello from FlexCel!");

            //Enters a number into A2.
            //Note that xls.SetCellValue(2, 1, "7") would enter a string.
            xls.SetCellValue(2, 1, 7);

            //Enter another floating point number.
            //All numbers in Excel are floating point,
            //so even if you enter an integer, it will be stored as double.
            xls.SetCellValue(3, 1, 11.3);

            //Enters a formula into A4.
            xls.SetCellValue(4, 1, new TFormula("=Sum(A2:A3)"));

            //Saves the file to the "Documents" folder.
            xls.Save(System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Personal), "test.xlsx"));
        }
    }
}

And that is it. You have just made an application that creates an Excel file. Of course we are just scratching the surface: we will see more advanced uses later in this guide.

Note

This sample deduces the file format from the file name. If you saved as "test.xls", the file format would be xls, not xlsx. You can specify the file format in a parameter to the "Save" method if needed; for example when saving to streams.

2. Creating a more complex file with code

While creating a simple file is simple (as it should), the functionality in Excel is quite big, and it can be hard to find out the exact method to do something. FlexCel comes with a tool that makes this simpler:

2.1 Open APIMate

When you install FlexCel, it will install a tool named APIMate. You can access it by going to the Start Menu and searching for APIMate.

You can also download APIMate for your operating system from the following locations:

  • APIMate for Windows
  • APIMate for macOS

Or you can compile it from source (sources are included when you install FlexCel).

2.2. Create a file in Excel with the functionality you want.

To get the best results, keep the file simple. Say you want to find out how to add an autofilter, create an empty file in FlexCel and add an autofilter. If you want to find out how to format a cell with a gradient, create a different file and format one cell with a gradient.

Using simple files will make it much easier to find the relevant code in APIMate

2.3. Open the file with APIMate

APIMate will tell you the code you need to recreate the file you created in Excel with FlexCel. You can see the code as C# or VB.NET.

You can keep the xls/x file open in both Excel and APIMate, modify the file in Excel, save, press "Refresh" in APIMate to see the changes.

Imagine you have this file, with a cell formatted in blue:

excel for apimate

When you open it in apimate, you should see this code which is the code you need to write in FlexCel to generate the same file:

Note that there is a language button in the toolbar where you can choose which language you want the code to be.

3. Reading a file

There is a complete example on Reading files in the documentation. But for simple reading, you can do as follows:

Create a new Console application, and write the following code:

using System;
using FlexCel.Core;
using FlexCel.XlsAdapter;

namespace FileReader
{
    class MainClass
    {
        public static void Main(string[] args)
        {
            XlsFile xls = new XlsFile(System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Personal), "test.xlsx"));

            xls.ActiveSheetByName = "Sheet1";  //we'll read sheet1. We could loop over the existing sheets by using xls.SheetCount and xls.ActiveSheet
            for (int row = 1; row <= xls.RowCount; row++)
            {
                for (int colIndex = 1; colIndex <= xls.ColCountInRow(row); colIndex++) //Don't use xls.ColCount as it is slow: https://doc.tmssoftware.com/flexcel/net/guides/performance-guide.html#avoid-calling-colcount
                {
                    int XF = -1;
                    object cell = xls.GetCellValueIndexed(row, colIndex, ref XF);

                    TCellAddress addr = new TCellAddress(row, xls.ColFromIndex(row, colIndex));
                    Console.Write("Cell " + addr.CellRef + " ");
                    if (cell == null) Console.WriteLine("is empty.");
                    else if (cell is TRichString) Console.WriteLine("has a rich string.");
                    else if (cell is string) Console.WriteLine("has a string.");
                    else if (cell is Double) Console.WriteLine("has a number.");
                    else if (cell is bool) Console.WriteLine("has a bool.");
                    else if (cell is TFlxFormulaErrorValue) Console.WriteLine("has an error.");
                    else if (cell is TFormula) Console.WriteLine("has a formula.");
                    else Console.WriteLine("Error: Unknown cell type");
                }
            }
        }
    }
}

4. Manipulating files

APIMate will tell you about a huge number of things, like how to paint a cell in red, or how to insert an autofilter. But there are some methods that APIMate can't tell you about, and from those the most important are the manipulating methods:

  • Use ExcelFile.InsertAndCopyRange for inserting rows or column or ranges of cells. Also for copying ranges or cells or full rows or full columns. Or for inserting and copying cells/columns/rows in one operation (like pressing "Copy/Insert copied cells" in Excel). It can also copy the cells from one sheet to the same sheet, to another sheet, or to another sheet in another file. InsertAndCopyRange is a heavily overloaded method, and it can do many things depending on the parameters you pass to it.

  • Use ExcelFile.DeleteRange to delete ranges of cells, full rows or full columns.

  • Use ExcelFile.MoveRange to move a range, full rows or full columns from one place to another.

  • Use ExcelFile.InsertAndCopySheets to insert a sheet, to copy a sheet, or to insert and copy a sheet in the same operation.

  • Use ExcelFile.DeleteSheet to delete a sheet.

5. Creating Reports

You can create Excel files with code as shown above, but FlexCel also includes a reporting engine which uses Excel as the report designer. When using reports you create a template in Excel, write some tags on it, and run the report. FlexCel will replace those tags by the values from a database or memory.

  1. Create an empty file in Excel

  2. In cell A1 of the first sheet, write <#Customer.Name>. In cell B1 write <#Customer.Address>

  3. In the ribbon, go to "Formulas" tab, and press "Name manager" (In Excel for macOS or Excel 2003, go to Menu->Insert->Name->Define)

  4. Create a name "Customer" that refers to "=Sheet1!$A$1". The name is case insensitive, you can write it in any mix of upper and lower case letters. It needs to start with two underscores ("_") and end with two underscores too. We could use a single underscore for bands that don't take the full row or "I_" or "I__" for column reports instead, but this is for more advanced uses.

  5. Save the file as "report.template.xlsx" in the "Documents" folder

  6. Create a new Console app, save it as "CustomerReport", and paste the following code:

using System;
using System.Collections.Generic;
using FlexCel.Core;
using FlexCel.Report;

namespace Samples
{
    class MainClass
    {
        public static void Main(string[] args)
        {
            var Customers = new List<Customer>();
            Customers.Add(new Customer { Name = "Bill", Address = "555 demo line" });
            Customers.Add(new Customer { Name = "Joe", Address = "556 demo line" });

            using (FlexCelReport fr = new FlexCelReport(true))
            {
                fr.AddTable("Customer", Customers);
                fr.Run(
                    System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Personal), "report.template.xlsx"),
                    System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Personal), "result.xlsx")
                );
            }
        }
    }

    class Customer
    {
        public string Name { get; set; }
        public string Address { get; set; }
    }
}
Note

If creating a macOS Console application, you will need to add a reference to System.Data, System.Xml and XamMac or MonoMac to the app. You might also need to copy XamMac.dll or MonoMac.dll to your output folder. And in a console application, you will need to initialize the Cocoa framework by calling MonoMac.AppKit.NSApplication.Init() For normal macOS applications you will not need to do anything: This applies only to Console macOS apps.

6. Exporting a file to pdf

FlexCel offers a lot of options to export to pdf, like PDF/A, exporting font subsets, signing the generated pdf documents, etc. This is all shown in the examples and documentation. But for a simple conversion between xls/x and pdf you can use the following code:

    public static void ExportToPdf(string inFile, string outFile)
    {
        XlsFile xls = new XlsFile(inFile);

        using (var pdf = new FlexCel.Render.FlexCelPdfExport(xls, true))
        {
            pdf.Export(outFile);
        }
    }

7. Exporting a file to html

As usual, there are too many options when exporting to html to show here: Exporting as HTML 3.2, HTML 4 or HTML 5, embedding images or css, exporting each sheet as a tab and a big long list of etc. And as usual, you can find all the options in the documentation and examples.

For this getting started guide, we will show how to do an export with the default options of the active sheet.

    public static void ExportToHtml(string inFile, string outFile)
    {
        XlsFile xls = new XlsFile(inFile);

        using (var html = new FlexCel.Render.FlexCelHtmlExport(xls, true))
        {
            html.Export(outFile, null);
        }

    }

8. Browsing through the Examples

FlexCel comes with more than 50 examples of how to do specific things. You can open each demo as a standalone project, but you can also use the included "Demo Browser" (this is MainDemo.csproj) to look at them all in a single place.

You can search for specific keywords at the top right of the main screen, to locate the demos that deal with specific features. So for example if you are looking for demos which show encryption, you will write "encrypt" in the search box:

9. This ends this small guide, but there is much more.

Make sure to take a look at all the other documents available here. You can use the tabs at the top of this site to read the different sections.


FlexCel API Developer Guide | FlexCel Studio for the .NET Framework documentation

FlexCel API Developer Guide

Introduction

The FlexCel API (Application Programmer Interface) is what you use to read or write Excel files in a low-level way. By “low-level” we mean that this API is designed to work really “close to the metal” and there aren’t many layers between you and the xls/xlsx file being created. For example, FlexCel API doesn’t know about datasets, because datasets are a higher level concept. If you want to dump a dataset into an Excel file using the API, you need to loop in all records and enter the contents into the cells.

In addition to the FlexCel API we provide a higher level abstraction, FlexCelReport, that knows about datasets and in general works at a more functional level; a declarative approach instead of an imperative approach. What is best for you depends on your needs.

Basic Concepts

Before starting writing code, there are some basic concepts you should be familiar with. Mastering them will make things much easier down the road.

Arrays and Cells

To maintain our syntax compatible with Excel OLE automation, most FlexCel indexes/arrays are 1-based.

That is, cell A1 is (1,1) and not (0,0). To set the first sheet as ActiveSheet, you would write ActiveSheet = 1 and not ActiveSheet = 0.

So, in C# and C++ loops should read: for (int i = 1; i <= Count; i++), and in VB.NET they should read for i = 1 to Count.

The two exceptions to this rule are XF and Font indexes, which are 0 based because they are so in Excel.

Cell Formats

All formats (colors, fonts, borders, etc.) on an Excel workbook are stored into a list, and referred by number. This number is known as the XF (eXtended Format) index. A simple example follows:

Here Cell B3 has XF = 0 and the XF definition for the background color is green. Row 6 has XF = 2, so all the empty cells on row 6 are orange. Column C has XF = 1, so all the empty cells on column C that do not have a Row Format are blue.

The priority goes, from higher to lower: Cell format->Row format->Column format. This means that if column A has a column format red and Row 1 has row format green, the cell A1 will be green. If you apply a cell format to cell A1, it will be used instead of either row or column formats as it has the highest priority.

Note

Sometimes when you work in Excel, it might look like Excel is handling priority differently. For example if you format a row green and after that a column red, you will see that the intersection between the column and row is red.

What is happening under the hood is that when you format the column red, Excel applies a column format red to the column, and after that a cell format red to the cell in the intersection. This way it can look like the column format is taking priority over the row, but it is actually the cell format applied to the cell at the intersection which has the priority.

Most formatting methods at FlexCel return an XF index, and then you have to look at the XF list (using the ExcelFile.GetFormat method) to get a class encapsulating the real format. There is a helper method: ExcelFile.GetCellVisibleFormatDef that obtain the XF index and return the format class in one step.

To create new formats, you have to use the ExcelFile.AddFormat method. Once you get the Id of the new XF, you can use it as you wish.

Note

You don't have to worry also on inserting a format 2 times: If it already exists AddFormat will return the existing id and not add a new XF entry.

Cell and Style Formats

XF formats can be of two types, “Cell” or “Style”. Cell formats are applied directly to a cell and can have a “ParentStyle” which must be a style format. Style formats cannot have ParentStyle and cannot be applied to cells, but they can be used as the base for defining different Cell formats. You can know if a TFlxFormat contains a “Style” or “Cell” format by looking at its “IsStyle” property. Also, a cell style can link only parts of its format to its parent style, for example have the font linked so when you change the font in the style it changes the font in the cell, but not the cell borders. In order to set which properties are linked to the main style, you need to change the “LinkedStyle” property in TFlxFormat.

You can create new Style formats with ExcelFile.SetStyle, and new Cell formats with ExcelFile.AddFormat. Once you create a new style and give it a name, you can get its definition as a TFlxFormat, change its TFlxFormat.IsStyle property to true, define which properties you want to link with the TFlxFormat.LinkedStyle property, and add that format using AddFormat to get the cell format. Once you have the cell style, you can just apply it to a cell.

Note

The TLinkedStyle class has a member, TLinkedStyle.AutomaticChoose, which if left to true (the default) will compare your new format with the style and only link those properties that are the same.

For example, let’s imagine you create a style “MyHyperlink”, with font blue and underlined. Then you create a Cell format that uses “MyHyperLink” as parent style, but also has a red background, and apply it to cell A1. If you leave AutomaticChoose true, FlexCel will detect that the cell format is equal in everything to its parent style except in the background, so it will not link the background of the cell to the style. If you later change the background of MyHyperlink, cell A1 will continue to be red.

This allows for having “partial styles” as in the example above: a “hyperlink” style defines that text should be blue and underlined, but it doesn’t care about the cell background. If you want to manually set which properties you want to have linked instead of FlexCel calculating that for you, you need to set TLinkedStyle.AutomaticChoose to false and set the “Linked….” Properties in TLinkedStyle to the values you want.

Font Indexes

The same way we have an XF list where we store the formats for global use, there is a Font list where fonts are stored to be used by XFs. You normally don't need to worry about the FONT list because inserting on this list is automatically handled for you when you define an XF format. But, if you want to, you can for example change Font number 7 to be 15 points, and all XFs referencing Font 7 will automatically change to 15 points.

Colors

While colors in Excel up to 2003 were indexes to a palette of 56 colors, Excel 2007 introduces true colors, and FlexCel implements it too since version 5.0. One thing that is nice about the new colors is that they can be retrofitted in the xls file format, so while you won’t be able to see true color in Excel 2003 (Excel 2003 just doesn't know about them), the data is there in the xls file anyway. So if you open the xls file with FlexCel 5 or later Excel 2007 and later you will see the true colors, even if the xls file format originally didn't know about them.

There are four kinds of colors that you can use in Excel:

  • RGB: This is just a standard color specified by its Red, Green and Blue values.

  • Theme: There are 12 theme colors, and each of them can have a different tint (brightness) applied. Theme colors are the default in newer Excel versions and you are likely using them even if not aware.

    Given the importance of theme colors in newer Excel, and that they aren't trivial to describe, we will cover them in a separate section below.

  • Indexed Colors. This is kept for background compatibility with Excel 2003, but we strongly recommend you forget about them.

  • Automatic Color. An automatic color changes depending on whether the color is used as a background or as a foreground. For foreground colors (like a font color) the Automatic color is black. For background colors (like a cell back color) the automatic color is white

You can access any of these variants with the struct TExcelColor.

TExcelColor also automatically converts from a Sytem.Drawing.Color, so you can just specify something like:

MyObject.Color = Color.Blue;

If you want to use a theme color, you will have to use:

MyObject.Color = TExcelColor.FromTheme(…);

The “NearestColorIndex” used in older version of FlexCel has been deprecated and you shouldn’t use it.

Theme colors

Theme colors are an interesting topic well worth its own section in this manual. Excel uses theme colors by default, which means that most spreadsheets you see around are using them, even if the people who created the files didn't know what a "theme" color was.

The first thing to notice is that Excel has 12 theme colors, which FlexCel maps inside the TThemeColor enumeration. Each one of those 12 colors can be made lighter or darker by changing its TExcelColor.Tint leading to millions of possible colors derived from those basic 12 colors.

When you open a color dialog in Excel, the colors that are shown in the main square are different variations of the 12 theme colors:

excel 2007 color palette

Each one of the 12 theme colors takes one column in the grid, and in the rows of the grid you can see variations of those colors with different tints.

Note

We kind of lied here: If you tried to count the columns in the image, you would see that there are 10 columns instead of 12. This is because even when Excel has 12 defined theme colors, only 10 of them are visible. The other 2 are the color for a hyperlink and a visited hyperlink, and they don't show in the Excel UI as usable colors.

The selected color you see in the image above is a color of the theme Accent1 (all colors in column 4 are of theme Accent1). It also has applied a tint which makes it 40% lighter than the standard Accent1 color, as shown in the Excel tooltip.

Themes are a nice way to specify colors, since you can change the theme later, and all colors will change to match. This means that you can go to the theme selector in the Excel ribbon (in the Page Layout tab) and change what Accent1 (and all the other theme colors) mean:

excel 2007 theme selector

If you select for example the "Ion Boardroom" theme as shown in the image, you will see the color palette changes to:

excel 2007 color palette ion

Note how the color Accent1 is now Plum instead of Blue. When you change the theme of your spreadsheet, all cells which had Accent1 theme colors will change from blue to plum, while cells which had a Blue RGB color set will continue to be blue.

When setting colors in a file you are creating, it is a nice thing to use theme colors instead of RGB colors, so your users will be able to change the theme. FlexCel has full support of theme colors, and you can easily find out how to use them in your code with APIMate.

You can find more information about Excel 2007 colors at

http://tmssoftware.com/site/blog.asp?post=135

Date Cells

As you might already know, there is no DATE datatype in Excel.

Dates are saved as a double floating number where the integer part is the number of days that have passed from 1/1/1900, and the fractional part is the corresponding fraction of the day. For example, the number 2.75 stands for "02/01/1900 06:00:00 p.m." You can see this easily at Excel by entering a number on a cell and then changing the cell format to a date, or changing the cell format of a date back to a number.

The good news is that you can set a cell value to a DateTimeValue, and FlexCel will automatically convert the value to a double, keeping in count “1904” date settings (see below). That is, if you enter

XlsFile.SetCellValue(1, 1, DateTime.Now), and the cell (1,1) has date format, you will write the actual value of "now" to the sheet.

The bad news is that you have no way to know if a cell has a number or a date just by looking at its value. If you enter a date value into a cell and then read it back, you will get a double. So you have to look at the format of the cell. There is a helper function, FormatValue that can return if the cell has a date or not by looking at the format.

This would be the correct way to find out if a cell contains a date:

    var fmt = xls.GetCellVisibleFormatDef(row, col);
    if (TFlxNumberFormat.HasDateOrTime(fmt.Format))
    {
        LogMessage("Cell " + new TCellAddress(row, col).CellRef + " contains a Date and Time");
    }
    if (TFlxNumberFormat.HasDate(fmt.Format))
    {
        LogMessage("Cell " + new TCellAddress(row, col).CellRef + " contains a Date");
    }
    if (TFlxNumberFormat.HasTime(fmt.Format))
    {
        LogMessage("Cell " + new TCellAddress(row, col).CellRef + " contains a Time");
    }

Note how the actual value of the cell doesn't matter, only the format of the cell.

Note

Excel also has a “1904” date mode, where dates begin at 1904 and not 1900. This mode was used on Excel for mac before OSX: today both OSX and Windows use a 1900 date system. But you can change this option in Excel for OSX or Windows today too, so you might come across some file using the 1904 date system. FlexCel completely supports 1900 and 1904 dates, but you need to be careful when converting dates to numbers and back.

You can read more information here: https://support.microsoft.com/en-us/help/214330/differences-between-the-1900-and-the-1904-date-system-in-excel

Note

There is a bug in how Excel handles the 1900 year. It considers it to be a leap year but 1900 was a normal year and February 29 1900 never happened. This means that the serial number used to represent the date gets one day out of sync with the serial number used by C#. The serial number 0 will show in Excel as "January 0, 1900" (even if there was never a January 0 either)

excel january 0 1900

While in C# it will show as December 30, 1899

tool january 0 1900

Note that even if Excel cared to display correctly the 0 as December 31, 1899 instead of January 0, 1900 it would still be off by a day with the dates as used in C#, which displays December 30.

FlexCel will try to do the best to replicate the Excel bug so you get the same values as Excel (ironically, Excel has the bug only because it was replicating a bug in Lotus 1-2-3). This means that for example FlxDateTime.FromOADate(0, false) will return a DateTime of January 31, 1899 which is the closest we can get to the value Excel shows. (we can't return a DateTime with a value of January 0, that is not possible). But whatever we do, the reality is that dates in Excel before March 1, 1900 are wrong. Avoid using them.

You can read more information on this bug here. https://support.microsoft.com/en-us/help/214326/excel-incorrectly-assumes-that-the-year-1900-is-a-leap-year

Copying and pasting native Excel data

ExcelFile has a group of methods that allow you to copy/paste from/to FlexCel to/from Excel in native Excel format (Biff8). You can copy data to the clipboard in Biff8, Tabbed Text, and HTML formats. You can paste from the clipboard in BIFF8 and Tabbed-Text format.

Normally copying in Biff8 is good for pasting the data in Excel, Html is good if you later want to paste in Word or PowerPoint, and text works for pasting into applications that don’t understand Biff8 or HTML.

Copying and pasting in native BIFF8 format is a great advance over copying/pasting on plain text only. It allows you to keep cell formats/colors/rounding decimals/merged cells/etc. But it has its limitations too:

  • It can't copy/paste images

  • It can't copy/paste strings longer than 255 characters

  • It can't copy the data on multiple sheets.

We would like to say that these limitations are not FlexCel's fault. The BIFF8 specification is correctly implemented; those are limitations on Excel's part.

Of course, Excel can copy and paste everything without problems, but this is because Excel doesn't use the clipboard to do the operation. If you close all instances of Excel, open a Worksheet, copy some cells to the clipboard, close Excel and open it again you will run into the same limitations. Copy/paste limitations on Excel don't show when it is kept in memory.

Reading and Writing Files

The native FlexCel engine is encapsulated on the class XlsFile.

This class stores an Excel file in memory, and has methods allowing loading a new file into it, modifying it, or saving its contents to a file or a stream.

Note

ExcelFile is the abstract class that provides the interface that XlsFile implements. In this documentation, we use ExcelFile and XlsFile interchangeably, because both implement the same methods and properties. The first is an abstract class which specifies the functionality, and the second is the actual code.

Important

Even when a FlexCel object is fully managed and you don't need to dispose it, keep in mind that it stores a full spreadsheet in memory. Do not leave global XlsFile objects hanging around when you don't need them because they can use a lot of memory. Use local XlsFile instances or set them to null as soon as you are done using them.

Opening and saving files

A simple code to process an Excel file would be:

    private static void ProcessFile(string sourceFileName, string destFileName)
    {
        XlsFile xls = new XlsFile(true);
        xls.Open(sourceFileName);

        //... process the file
        xls.Save(destFileName);
    }

Here we can note:

  1. By default, FlexCel never overwrites an existing file. So, before saving you always have to call File.Delete, or set ExcelFile.AllowOverWritingFiles property = true. On this example, we set AllowOverWritingFiles = true when we construct the object in the line: XlsFile xls = new XlsFile(true);.

  2. While you can explicitly specify the file format when saving, normally you don’t need to do it. FlexCel is smart enough to know that files with extension “xlsx” or “xlsm” must be saved in xlsx file format, and that files with extension “xls” must be saved as xls. When saving to a stream, then you need to specify the file format, or it will be xls by default.

Modifying files

Once you have loaded a document with ExcelFile.Open or created a new empty file with ExcelFile.NewFile you can proceed to modify it. Add cells, formats, images, insert sheets, delete ranges, merge cells or copy ranges from one place to another. It is not on the scope of this document to show each and every thing you can do because there are hundreds of commands and that would take another book. To learn about specific methods, take a look at the examples and use the APIMate tool as described here in the Getting Started guide.

Inserting, Copying and Moving Cells / Rows / Columns and Sheets

While APIMate will cover much of the API, there is a whole category of commands that can’t be shown there, and that are very important while manipulating files. Those commands are the ones used to insert/copy/move cells/sheets, etc. One of FlexCel strongest points is the big support offered for all those operations. Since those methods are used everywhere in FlexCel Reporting engine, they are at the core of the engine, not inserted as an afterthought. They perform very well, and they are deeply tested.

Now, something that might be nonintuitive if you are not aware of it, is that FlexCel provides that functionality in a few very powerful and overloaded methods, instead of a million standalone methods. That is, instead of having “InsertRow” “InsertColumns”, “InsertCells” “CopyColumns”, “CopyCells” “CopyRows”, “InsertAndCopyRows” “InsertAndCopyColumns”, etc., FlexCel just provides a single “InsertAndCopyRange” method that does all of this and more (like copying rows from one file and inserting it into another)

The reason we kept it this way (few powerful methods instead of many specialized and simpler methods) is that fewer methods are easier to remember. From the editor, you just need to remember to start typing “InsertAnd…” and intellisense will show most options. No need to guess if the method to add a new sheet was named “AddSheet” or “InsertSheet”.

Naming probably isn’t the best either, this is for historical reasons (because original implementations did only insert and copy, and then, as we added more functionality it was added to those methods), but also because a better naming isn’t easy either. Calling a method InsertAndOrCopyCellsOrColumnsOrRanges() isn’t much better. So just remember that whatever you want to do, you can probably do it with one of the following methods:

  • InsertAndCopyRange: Probably the most important of the manipulating methods. Inserts or copies or inserts and copies a range of cells or rows or columns from one sheet to the same sheet, or to a different sheet, or to a different file. It works exactly as Excel does, if you copy a formula “=A1” down to row 2, it will change to be “=A2”. Images and objects might or might not be copied too depending in the parameters to this method.

  • MoveRange: Moves a range of cells, or a column or a row inside a sheet.

  • DeleteRange: Deletes a range of cells, a row or a column in a sheet, moving the other cells left or up as needed. If InsertMode is NoneDown or NoneRight, cells will be cleared, but other cells won’t move.

  • InsertAndCopySheets: Inserts and or copies a sheet. Use this method to add a new empty sheet.

  • DeleteSheet: Deletes a number of sheets from the file.

  • ClearSheet: Clears all content in a sheet, but leaves it in place.

Note

InsertAndCopy operations could be theoretically implemented as “Insert” then “Copy”, but that would be much slower. In many cases we want to insert and copy at the same time, and doing it all at once is much faster. Also in some border cases where the inserted cells are inside the range of the copied cells, inserting and then copying can give the wrong results.

Considerations about Excel 2007 support

FlexCel 5.0 introduced support for Excel 2007 file format (xlsx), and also for the new features in it, like 1 million rows or true color.

While most changes are under the hood, and we made our best effort to keep the API unchanged, some little things did change and could bring issues when updating:

  • The number of rows by default in FlexCel is now 1048576, and the number of columns is 16384. This can have some subtle effects:

    • Named ranges that were valid before might become invalid. For example, the name LAB1 would be a valid cell reference in 2007 mode, (Just like A1). In Excel 2003 you can have up to column “IV”, but in Excel 2007 you can have up to column “XFD”, so almost any combination of 3 characters and a number is going to be a valid cell reference, and thus can’t be a name. If you have issues with this and can’t change the names, you will have to use the “Compatibility mode” by setting the static variable:

      ExcelFile.ExcelVersion

    • “Full Ranges” might become partial. Full ranges have the property that they don’t shrink when you delete rows. That is, if for example you set the print area to be A1:C65536 in Excel 2003, and you delete or insert rows the range will stay the same. If you open this file with FlexCel 5 or Excel 2007, and delete the row 1, the range will shrink to A1:C65535, as it is not full anymore. To prevent this, FlexCel automatically converts ranges that go to the last row or column in an xls file to go to the last row or column in an xlsx file. If you don’t want FlexCel to autoexpand the ranges, you can change this setting with the static variable:

      ExcelFile.KeepMaxRowsAndColumnsWhenUpdating

      Also, when using XlsFile, use references like “=Sum(a:b)” to sum in a column instead of “=Sum(a1:b65536)”

    • Conditional Formats might become invalid. This is a limitation on how Conditional Formats are stored in an xls file. They are stored as a complement-2 of 2 bytes for the rows and one byte for the column. For example, if you have a formula in a conditional format that references the cell in the row above, this will be stored as “0xFFFF”, which is the same s “-1” if you are using signed math.

      And as you have exactly 2 bytes of rows and 1 byte of columns they are also the same. It is the same to add 65535 rows (wrapping) or to subtract one, you will always arrive to the cell above. Now, with more columns and rows this is not true anymore. And you can’t know by reading a file if the value was supposed to mean “-1” or “+65535”. So both Excel and FlexCel might interpret a CF formula wrong when the cells are separated by too many rows or columns.

      Again the solution if you have this issue is to turn ExcelFile.ExcelVersion back to 2003.

  • Colors are now true color, not indexed.

    • In order to support true color, we needed to change all “Object.ColorIndex” properties to “Object.Color”, so old FlexCel code won’t compile right away. You need to do a search and replace for “ColorIndex” properties. See the section about colors in this document for more information about colors and themes.

    • If you relied on changing the palette to change cell colors, this code might break. Before, you had only indexed colors, so if you changed the palette color 3 from red to blue, all red cells would turn blue. Now, the color will only change if the cell has indexed color. You might have a cell with the exact same red but with the color specified as RGB, and this won’t change when you change the palette. It is recommended that you use themes now in situations like this.

  • Default File Format for Saving: In FlexCel 4 finding the default file format for saving was simple; it saved everything xls. Now, it isn’t so simple. By default, if you do a simple xls.Save(filename) without specifying a file format we will use the file extension to determine it. When it is not possible (for example if you are saving to a stream) we will use the format the file was originally in when you loaded it. If you prefer to change the default, you can change the static property

    ExcelFile.DefaultFileFormat

  • Headers and footer changes: Now headers and footers can be set differently for odd and even pages, or for the first page. While the properties PageHeader and PageFooter still exist in XlsFile, you are advised to use GetPageHeaderAndFooter and SetPageHeaderAndFooter instead for better control. Also the method to change the images in the headers and footers changed to accept these different possibilities. Look at APIMate to see how to use these new methods.

Autofitting Rows and Columns

FlexCel offers support for “autofitting” a row or a column, so it expands or shrinks depending on the data on the cells.

But autofitting is not done automatically, and we have good reasons for it to be this way.

To explain this better, let's try a simple example:

  1. Imagine that we create a new Excel File, write “Hello world” on cell A1, and go to “Format->Column->AutoFit Selection”. We will get something like this:

    autofit excel 100

  2. As you see, column “A” was resized so “Hello World” fits inside. Easy, isn't it? Well, not as much as we would like it to be. Let's now change the zoom to 50%:

    autofit excel 50

  3. Now the text “Hello world” is using part of column “B”. We didn't change anything except the zoom and now text does not fit anymore, in fact, you can autofit it again and column “A” will get bigger.

What happened here? The easy answer is that Excel is resolution dependent. Fonts scale in “steps”, and they look different at different resolutions. What is worse, printing also changes depending on the printer, and as a thumb rule, it is not similar at what you see on the screen.

So, what should a FlexCel autofit do? Make column A the width needed to show “Hello world” at 100% zoom, 96 dpi screen resolution? Resize column A so “Hello world” shows fine when printing? On a dot matrix printer? On a laser printer? Any answer we choose will lead us to a different column width, and there is no “correct” answer.

And it gets better. FlexCel uses GDI+, not GDI for rendering and calculating metrics, and GDI+ is resolution independent. But GDI and GDI+ font metrics are different: for example the space between letters on GDI+ for a font might be less than the space GDI gives to them. You will need less column width to fit “Hello world” on GDI+ than in GDI for that font, so the width calculated by FlexCel(GDI+) will be less than the width calculated by Excel(GDI).

As you can imagine, if we used all this space to describe the problem, is because there is not a real solution. Autofit on FlexCel will try to adapt row heights and column widths so the text prints fine from Excel on a 600 dpi laser printer, but text might not fit exactly on the screen. Autofit methods on FlexCel also provide an “Adjustment” parameter that you can use to make a bigger fit. For example, using 1.1 as adjustment, most text will display inside the cells in Excel at normal screen resolution, but when printing you might find whitespace at the border, since columns or rows are bigger than what they need to be.

Of course, autofit on FlexCel will work fine when printing from FlexCel, since FlexCel is resolution independent and it should always be the same. The problem arises when opening the files in Excel.

And this was the reason we do not automatically autofit rows (as Excel does). Because of the mentioned differences between GDI+ and GDI (and also between GDI at different resolutions), we cannot calculate exactly what Excel would calculate. If we calculated the row height must be “149” and Excel calculated “155”, as all rows are by default autoheight, just opening an Excel file on FlexCel would change all row heights, and probably move page breaks. Due to the error accumulation, maybe in FlexCel you can enter one more row per page, and the header of the new page could land at the bottom of the previous.

The lesson, do the autofit yourself when you need to and on the rows that really need autofit(most don't). If you are using XlsFile, you have XlsFile.Autofit... methods that you can use for that. If you are using FlexCelReport, use the <#Row Height(Autofit)> and <#Column Width(Autofit)> tags to autofit the rows or columns you want.

By default, Excel autofits all rows. So, when opening the file in Excel, it will recalculate row heights and show them fine. But when printing from FlexCel, make sure you autofit the rows you need, since FlexCel will not automatically do that.

Autofitting Merged Cells

Merged cells can be difficult to autofit, for two basic reasons:

  1. If you are autofitting a row, and a merged cell spans over more than one row, which row should be expanded to autofit the cell? Imagine we have the following:

    autofit merged cells

    We could make the text fit by enlarging for example row 1, or row 5:

    autofit merged cells row 1 and 5

    We could also enlarge all rows by the same amount instead of changing only one row.

    FlexCel by default will use the last row of the merged cell to autofit, since in our experience this is what you will normally need. But you can change this behavior by changing the parameter “autofitMerged” when you call the “Autofit” methods, or, if you are using reports, you can use the <#Autofit settings> tag to do so.

  2. The second issue is that probably because of issue 1, Excel will never autofit merged cells. Even in cases where there would be no problem doing so, for example you are autofitting a row and the merged cell has only one row (but 2 columns). In all of those cases, Excel will just make the row the standard height. So, if you apply FlexCel autofitting but leave the autofit on, when you open the file in Excel, Excel will try to re-autofit the merged cell, and you will end up with a single-size row always. So, when autofitting rows with merged cells in FlexCel make sure you set autofitting off for Excel. You don’t need to do this for columns, since they don’t autofit automatically in Excel.

Note

All the above was done in rows for simplicity, but it applies the same to columns and merged cells over more than one column.

Preparing for Printing

After creating a spreadsheet, one thing that can be problematic is to make it look good when printing or exporting to PDF.

Making the sheet fit in one page of width

This is probably the first thing you should do when preparing most documents for printing. Go to the “Page Layout” tab in the ribbon, and look at the “Width” and “Height” boxes

fit auto height

Make the “Height” box “Automatic, to allow your document have as many pages as it needs. You can do this directly in Excel when using Templates to create your documents, or you can do this in FlexCel API by setting ExcelFile.PrintToFit = true, ExcelFile.PrintNumberOfHorizontalPages = 1, and ExcelFile.PrintNumberOfVerticalPages = 0.

Repeating Rows and Columns at the top

Another useful thing you can do is press the “Print Titles” button to access the “Page Setup” dialog. There you can set up some rows and columns to be repeated on every page.

rows to repeat at top

This way your tables can keep their headers in every page. By the way, while you are in the “Sheet” tab, you might want to look at the option to print the gridlines or the column and row headings (The “A”, “B”, etc. at the top and “1”, “2”, etc. numbers at the left of the sheet)

You can do this directly in Excel when using Templates to create your documents, or you can do this in FlexCel API by writing something like this:

    xls.SetNamedRange(new TXlsNamedRange(TXlsNamedRange.GetInternalName(InternalNameRange.Print_Titles), SheetIndex, 0, "=1:2,A:B"));

to set up the rows and columns to repeat, or set ExcelFile.PrintGridLines = true and ExcelFile.PrintHeadings = true to set up printing of gridlines and headings.

Using Page Headers/Footers

Besides repeating rows and columns, you can also add headers and footers from the page setup dialog. One interesting feature in Excel XP or newer is the ability to include images in the page headers or footers. As those images can be transparent, you can have a lot of creative ways to repeat information on every sheet.

From FlexCel API, use the ExcelFile.PageHeader and ExcelFile.PageFooter properties to set the header and footer text. If using a template, you can just set those things in the template.

Cell indentation

The problem

Cell indentation in Excel doesn't work the way most of us would expect it, and in this section we will cover what is wrong and how we tried to fix it.

To understand the problem, let's create a new blank document in Excel, and write the word "HELLO" in cells A1 and A2:

cell indent step1

Now, let's give the cell A2 an indentation of 3. You can do this by clicking the indent button in the ribbon 3 times:

cell indent increase indent

Or by right-clicking the cell, selecting "Format Cells..." and in the "Alignment" tab setting the indent to 3:

cell indent increase indent2

No matter how you did it, now the file should look like this:

cell indent step2

Now let's try to do a print preview. Go to File->Print and it should look like this:

cell indent preview100

As you can see, the image looks similar (if not exactly the same) to what was shown on the screen, with the "H" in cell A2 roughly below the "O" in cell A1. We are used to small differences between what you see and what is printed, so up to now, everything is fine.

But now, let's change the Print Scale to 50%. Go to the page setup dialog, and change the print scale:

cell indent page setup

And now we get:

cell indent preview50

Now, the "H" in cell A2 is way more to the right from the "O" in A1 than before. What happened? We just changed the print scaling, and the layout of the document changed. This is not how we generally expect scaling to work. Going a little more in depth, what happened was that Excel reduced all element sizes, fonts, etc. by 50%, but left the indentation the same. We can see it more clear if we superimpose the 50% and 100% print preview images and zoom in:

cell indent preview50 and 100

The absolute value of the indentation remained the same, and didn't reduce by 50% like everything else. This causes the layout to break.

Note

When "Print Headings" is selected:

Then Excel behaves differently and it scales the indentation proportional to the print scale:

cell indent preview50 cell headings

But printing with "print headings" on isn't common, so for most cases, we can say that the indentation doesn't scale with the print scale.

The solution

Up to version 6.23, FlexCel copied the Excel behavior and didn't scale the cell indentation together with the rest of page elements (it wasn't the exact Excel behavior as FlexCel didn't scale either even if print page headings was selected, but printing with page headings is rare).

This original FlexCel behavior matched Excel (and FlexCel has always been about matching Excel even with Excel bugs), but it caused a lot of issues. The most evident one, of course, was that the layout would break when changing the page scaling, and text that was aligned at 100% scaling would become unaligned at 75%.

But there were more subtle issues too: For example FlexCel autofitting runs at 100% scaling (because you can't know at autofitting time which will be the final page scaling). So if you autofitted a column in a page designed to be printed at 75% scaling, it might happen that the exported pdf file couldn't fit the text anymore and had to be printed in 2 lines. Because the autofit was done at 100% and the exporting at 75%, and the indentation is not proportional to the scale like everything else, the free space in the cell is smaller at 75%.

So starting with FlexCel 6.24, we introduced a new Property named ExcelFile.CellIndentationRendering which you can now use to tell FlexCel how to deal with cell indentation and scaling. It offers 3 options:

  • The new default behavior: Always scale indentation with page scale.
  • The old FlexCel behavior: Never scale indentation with page scale.
  • The Excel behavior: Scale indentation only if printing headings, don't scale otherwise.
Important

This is a breaking change in FlexCel 6.24, in that it might break "pixel-perfect" layouts of files with small zoom and cell indentations. It isn't likely to affect you because the new indentations are smaller at smaller zooms, and so more text will fit than before. But if you want to revert to the old behavior, just change ExcelFile.CellIndentationRendering

Conclusion

What we can get from this section is: If you can control the files you are creating, try to avoid using cell indentation in Excel. Cell indentation in Excel is simply broken, and we can fix it on our side, but we can't fix Excel.

Cell indentation also doesn't work all all with Google docs (at the time of this writing), and in Libre/OpenOffice it scales with the print scaling. So using cell indentation will also reduce the portability of your files to other Spreadsheet apps.

If you can't avoid cell indentation, review which value of ExcelFile.CellIndentationRendering is better for you.

Intelligent Page Breaks

Excel offers the ability to include page breaks, but it has no support for any kind of “smart” page breaks that will only break if there is a need for it.

Let's look at an example:

dumb page break

Here, the image in page 1 is being cut in the middle by a page break, so part of it appears on page 1 and part on page 2. While this is no problem when looking at the spreadsheet in Excel, it is clearly not what we want when printing or exporting to PDF. We want to place a page break before that image, so it prints completely in page 2. However, we don't want to put a break before every image, since we can print many in page 2. We need page breaks that only apply when the image does not fit in the current page.

FlexCel offers a way to deal with this. In short, you need to say which rows or columns you would like to keep together by calling ExcelFile.KeepRowsTogether or ExcelFile.KeepColsTogether, and once you have finished creating your file, call ExcelFile.AutoPageBreaks to paginate your whole document and create page breaks in a way your rows and columns are kept together as much as possible.

Note

The call to AutoPageBreaks must be the last before saving your file, so the document is in its final state. If you insert rows or autofit things after calling AutoPageBreaks then the page breaks will be moved out of place. Remember that this is not an Excel feature, so it is simulated by dumb page breaks in Excel, and once set, those page breaks will remain at where they were.

The Widow / Orphan problem

When paginating a document there are actually two similar but different things: widow and orphan lines. In the example above we saw orphan lines, that is, rows that have their “parents” in the previous sheet. But there are also widow lines, and those are rows that are alone in a sheet because the lines below are in a different group, as shown in the following image:

In this example, sheet 4 is almost empty, because there are only two lines from the current group on it, and the next group starts at the next page.

When there is so little written on one page, you will normally want to start the next group on the same page instead of having an empty sheet.

And you can control this in FlexCel with the “PercentOfUsedSheet” parameter when you call AutoPageBreaks. PercentOfUsedSheet defaults at 20, which means that in order to add a page break, the page must be filled in at least 20%.

In the example above, no page break would be made on page 4, since the 20% of the sheet has not been used yet, and so the next group would start on page 4 too. If you set the PercentOfUsedSheet parameter to 0% there will be no widow control, and the next group will start on page 5 no matter if page 4 has one single line.

Setting PercentOfUsedSheet at 100% means no widow or orphan control at all, since in order to set a page break the 100% of the page must have been used, so FlexCel has no margin to add the page breaks. It will not be able to set the page break somewhere before the 100% of the page, so all page breaks will be set at the last row, and it will not be able to keep any rows together. You are advised to keep the PercentOfUsedSheet parameter around 20%

The different printers problem

As explained in the Autofitting Rows and Columns section, Excel prints different things to different printers, and even with the same paper size, some printers have different printing sizes. Printers can have "hard margins" which are places of the sheet where they can't physically print (for example because that part of the sheet is what the printer uses to grab the paper) and this can reduce the effective printing size of the page.

This can be problematic, since a document calculated to have breaks every 30 cm, will have a lot of widow lines if printed in a page with an effective 29.5 cm printing area:

printer page size

As you can see in the images above, reducing a little the page height might cause the last row not to enter on that page and be printed in the next. As FlexCel added an automatic page break after that row (so it would break correctly with the 30 cm it used for the calculation), you end up with an empty page with only one row.

To solve this issue, the second parameter to AutoPageBreaks is the percentage of the page that will be used by FlexCel to calculate the page breaks. It defaults at 95%, which means that it will consider a page 30 cm tall to be 30*0.95 = 28.5 cm, and calculate the page breaks for that sheet. So it will print correctly in a 29.5 cm sheet.

When calculating the page breaks to directly export to PDF you can keep this parameter at 100%, since FlexCel is resolution independent, and it will not have this issues. But when calculating the page breaks to print from Excel, you need to have a smaller value here so it can fit in all the printers where you might print this sheet. Normally if targeting only laser printers you can have a larger value like 99%, but when other kinds of printers can be used it might be wise to lower this value.

Using different levels of “Keep together”

Normally just marking the rows you want to keep together and then calling AutoPageBreaks should be enough for most cases. But sometimes you might have more than one “keep together” level to keep, and you can set this as one of the parameters in KeepRows/ColsTogether.

Imagine you have a master-detail report with a list of stores, then the customers of each store and the orders for each customer. You might want to keep all customers of a store together on one page, but if that is not possible, at least keep the orders together. You can do this by assigning a level of “2” to the orders, and a level of “1” to the customers. The actual numbers don't matter, you could use a level of “10” for orders and “5” for customers. The only important thing is that one level is bigger than the other.

When you assign different levels to different rows, FlexCel will try to keep lower levels first, but if not possible, it will try to fit at least the higher ones.

Inserting and copying Rows with a “keep together” level

Inserting and copying rows works as expected, when you copy a group of rows with a level of 2 and insert them in another place, the “2” level will be copied. It also works when copying across different files, but you need to copy full rows in any case. When copying ranges that are not the complete rows, those values will not be copied, as expected.

Debugging Intelligent Page Breaks

Intelligent page breaks are a tested technology: They work well and we aren't aware of bugs on its implementation. But sometimes, they might produce results that look wrong at first sight. And when they aren't working as you expect them to, it helps to understand a little more in depth what is going on under the hood.

Note

For simplicity in this section we are going to speak always about row breaks, but the column breaks work in a similar fashion.

The first thing to notice is that intelligent page breaks work by marking the rows (or columns) to be kept together with a level. So let's imagine we have this file: A master-detail report with the best selling albums in each decade and some of their songs:

albums and songs

We want to keep together every decade on its own page, or if not possible, at least keep together every full album. For this we can define the following keep together ranges:

  1. Rows 1 to 15, level 1
  2. Rows 16 to 22, level 1
  3. Rows 2 to 8, level 2
  4. Rows 9 to 15, level 2
  5. Rows 17 to 22, level 2

Or with code:

    xls.KeepRowsTogether(1, 15, 1, false);
    xls.KeepRowsTogether(16, 22, 1, false);
    xls.KeepRowsTogether(2, 8, 2, false);
    xls.KeepRowsTogether(9, 15, 2, false);
    xls.KeepRowsTogether(17, 22, 2, false);
Tip

Of course the code above is not how you will set the intelligent page breaks in normal use. In real code you will be using some kind of loop, or inserting and copying rows, or setting keep together ranges in reports. But the effect once that is done is similar to manually calling ExcelFile.KeepRowsTogether with the values above.

To better understand what is happening, let's see now how FlexCel translates those ExcelFile.KeepRowsTogether commands into its data model. Conceptually it is simple: When you call ExcelFile.KeepRowsTogether for rows 1 to 15 to be level 1 (as in the first line of the example above), FlexCel will mark rows 1 to 14 to be level 1. There was no typo in the previous line: Marking rows 1 to 15 to be level 1 makes FlexCel mark rows 1 to 14 to be level 1. If we add a small column to visualize the marked rows after marking rows 1 to 15, the file should look like this:

albums and songs levels 1

So why is FlexCel marking one less row than what you marked? This should become clear when we call the second KeepTogether line to keep rows 16 to 22. After that call, the file will look like this:

albums and songs levels 2

Note how there is a 0 at row 15. If the first call to KeepRowsTogether had marked rows 1 to 15 instead of 14, then row 15 would also have a 1 there. And the full rows 1 to 22 would be marked as level 1, the same as if we had just caller KeepRowsTogether from row 1 to 22. But we didn't make a single call from rows 1 to 22. We marked rows 1 to 15 and 16 to 22. We want FlexCel to know that it can break the page at row 15 if it needs to. When running the actual page break algorithm, FlexCel will take into account that missing row, and still know that row 15 belongs together with row 14 even if internally row 15 is marked with level 0.

Marking one less row than the rows you mark allows you to mark 2 consecutive ranges like 1:5 and 5:10 and have them still be separated ranges instead of becoming a single 1:10 range

Important

You might be wondering why we spent so much time explaining an implementation detail like how FlexCel maps your calls to KeepRowsTogether to its internal data model. After all, it shouldn't really matter how FlexCel internally models your commands. And in most cases, it won't actually matter.

But this section is about debugging page breaks, and you will need to debug them when something went wrong. There are 2 reasons why it helps to understand the internal representation FlexCel does from your commands:

  1. The fact that when you mark rows 1 to 2 only row 1 is marked is the most common cause of discrepancies between what you think FlexCel should do and what FlexCel actually does. In most cases, it will work just as you expect it to work and you don't need to think in the internals. Just mark the block you want to keep together and know they will be kept together. But if it is not working as it should, then it likely is caused by this.

  2. As we will see shortly, when debugging reports you will be able to see this internal FlexCel representation, so you will need to understand how it is implemented.

Ok, now let's run the full code and add the lines that call KeepRowsTogether with level 2. This is how the file will end up marked: albums and songs final

When FlexCel runs the intelligent page breaks in this page it will:

  1. Try to fit all level 1+ rows on one page, adding an extra row because the rows marked are one less. So, the first block of levels >=1 go from 1 to 14. Adding the extra row, FlexCel will try to fit the block 1 to 15 in a single page.
  2. If it can't fit rows 1 to 15 in a single page, it will try with level 2+. The first block of level 2+ goes from rows 2 to 7. So it will try to fit the rows 1 to 8 in a single page. And so on.

After diving in the technical details, we can see it is doing what we told it to do. It first tries to fit rows 1 to 15 (the first KeepRowsTogether call), then 2 to 8 (the third KeepRowsTogether call) and then the others.

Now, wouldn't it be nice to be able to directly see FlexCel's internal representation for those cases where the page breaks aren't working as they should? Without having to do it manually as we did here?

The good news is that yes, it is possible. FlexCel has commands for both the API and reports that let you see the levels that FlexCel sees. To understand those levels, you just need to remember that the last line of each keep together block isn't marked, but considered anyway to belong to the group.

When using the API, FlexCel has 2 commands: ExcelFile.DumpKeepRowsTogetherLevels and ExcelFile.DumpKeepColsTogetherLevels. The first one will write all row levels in the column you specify, and the second will do the same for columns. Looking at the actual numbers should help understanding how FlexCel sees your blocks.

When using reports you have two ways to enter intelligent page breaks debug mode, similar to Report Debug mode and Errors in result file modes:

  1. You can set FlexCelReport.DebugIntelligentPageBreaks to true in the code.
  2. You can write a tag <#Debug Intelligent Page Breaks> anywhere in the Expressions column of the config sheet.

As with the debug mode and Errors in Result File mode, the second way to enter Debug Intelligent Page Breaks mode is better when you are editing a template and want to do a debug without modifying the code, while the first way is better if you are automating testing and do not want to modify the templates.

Note

When inserting and deleting rows, FlexCel doesn't just insert or delete them, but adapts the levels so they still behave as you would expect. This can cause issues understanding why a row ended up with a level. For example, if in our last screenshot we removed row 8, a naive implementation would just remove that row, and the group that ends at row 8 (Eagles) would be joined with the group that starts at row 9 (Pink Floyd). But when you remove that row, FlexCel is smart enough to make row 7 level 1, so the file still behaves as it should and you still have one group for the Eagles and one for Pink Floyd. The fact that you removed a song from the Eagles group is no reason for it to become one big group with Pink Floyd.

While FlexCel always tries to do "the right thing", sometimes the right thing might not be what you expected, or it might not be the right thing for a specific situation. This is why being able to see the actual values of levels added by FlexCel can be so helpful.

Using Excel's User-defined Functions (UDF)

Introduction

User-defined functions in Excel are macros that return a value, and can be used along with internal functions in cell formulas. Those macros must be defined inside VBA Modules, and can be in the same file or in an external file or addin.

While we are not going to describe UDFs in detail here, we will cover the basic information you need to handle them with FlexCel. If you need a more in-depth documentation in UDFs in Excel, there is a lot of information on them everywhere.

So let's start by defining a simple UDF that will return true if a number is bigger than 100, false otherwise.

We need to open the VBA editor from Excel (Alt-F11), create a new module, and define a macro inside that module:

Function NumIsBiggerThan100(Num As Single) As Boolean
    NumIsBiggerThan100 = Num > 100
End Function

And then write “=NumIsBiggerThan100(120)” inside a cell. If everything went according to the plan, the cell should read “True”

Now, when recalculating this sheet FlexCel is not going to understand the “NumIsBiggerThan100” function, and so it will write #Name? in the cell instead. Also, if you want to enter “=NumIsBiggerThan100(5)” say in cell A2, FlexCel will complain that this is not a valid function name and raise an Exception.

In order to have full access to UDFs in FlexCel, you need to define them as a class in .NET and then add them to the recalculation engine.

Step 1: Defining the Function in C#

To create a function, you need to derive a class from TUserDefinedFunction, and override the Evaluate method. For the example above, we would create:

    public class NumIsBiggerThan100 : TUserDefinedFunction
    {
        public NumIsBiggerThan100() : base("NumIsBiggerThan100")
        {
        }

        //Do not define any global variable here.
        public override object Evaluate(TUdfEventArgs arguments,
                         object[] parameters)
        {
            //Check we have only one parameter
            TFlxFormulaErrorValue Err;
            if (!CheckParameters(parameters, 1, out Err))
                return Err;

            //The parameter should be a double.
            double Number;
            if (!TryGetDouble(arguments.Xls, parameters[0],
                out Number, out Err)) return Err;

            return Number > 100;
        }
    }

As you can see, it is relatively simple. Some things worth noting:

  1. Don't use global variables inside Evaluate: Remember, the Evaluate() method might be called more than once if the function is written in more than one cell, and you cannot know the order in which they will be called. Also if this function is registered to be used globally, more than a thread at the same time might be calling the same Evaluate method for different sheets. The function must be stateless, and must always return the same value for the same arguments.

  2. As you can see in the help for the TUserDefinedFunction.Evaluate method, the evaluate method has two arguments. The first one provides you with utility objects you might need in your function (like the XlsFile where the formula is), and the second one is a list of parameters, as an array of objects.

    Each object in the parameters array might be a null, a Boolean, a String, a Double, a TXls3DRange, a TFlxFormulaErrorValue, or a 2 dimensional array of objects, where each object is itself of one of the types mentioned above.

    While you could manually check for each one of the possible types by manually checking all possible types for each parameter, this gets tiring fast. So the TUserDefinedFunction class provides helper methods in the form of “TryGetXXX” like the TUserDefinedFunction.TryGetDouble method used in the example.

  3. There is the convention in Excel that when you receive a parameter that is an error, you should return that parameter to the calling function. Again, this can be tiring to do each time, so the TUserDefinedFunction class provides a TUserDefinedFunction.CheckParameters method that will do it for you.

    The only time you will not call TUserDefinedFunction.CheckParameters as the first line of your UDF is when you are creating a function that deals with errors, like “IsError(param)”, that will return true when the parameter is an error.

  4. Do not throw Exceptions. Exceptions you throw in your function might not be trapped by FlexCel, and will end in the recalculation aborting. Catch all expected exceptions inside your method, and return the corresponding TFlxFormulaErrorValue when there is an error.

Step 2: Registering the UDF in FlexCel

Once you have defined the UDF, you need to tell FlexCel to use it. You do this by calling ExcelFile.AddUserDefinedFunction in a ExcelFile object. Once again, some points worth noting:

  1. You need to define the scope of your function. If you want it to be globally accessible to all the ExcelFile instances in your application, call ExcelFile.AddUserDefinedFunction with a “Global” TUserDefinedFunctionScope. If you want the function to be available only to the ExcelFile instance you are adding it to, specify “Local”. Global scope is easier if you have the same functions for all the files, but can cause problems if you have different functions in different files. Local scope is safer, but you need to add the functions each time you create a ExcelFile object that needs them. If you are unsure, probably local scope is better.

  2. You also need to tell FlexCel if the function will be defined inside the same file or if it will be in an external file. This is not really needed for recalculating, but FlexCel needs to know it to enter formulas with custom functions into cells.

There are four things you can do with formulas that contain UDFs, and there are different things you need to do for each one of them:

  1. Retrieve the formula in the cell: You do not need to do anything for this. FlexCel will always return the correct formula text even if you do not define any udf. If the file was calculated when saved in Excel (the default), then FlexCel will also return the correct value of the formula.

  2. Copy a cell from one place to another. Again, there is no need to do anything or define any UDF object. FlexCel will always copy the right formula, even if copying to another file.

  3. Calculate a formula containing UDFs. For this one you need to define a UDF class describing the function and register it. You do not need to specify if the formula is contained in the sheet or stored in an external addin.

  4. Enter a formula containing a UDF into a sheet. In order to do this, you need to define and register the UDF, and you must specify if the function is stored internally or externally.

For more examples on how to define your own UDFs, please take a look at the Excel User Defined Functions API demo.

Note

Even when they look similar, UDFs are a completely different thing from Excel Built-in functions. Everything said in this section applies only to UDFs, you cannot use this functionality to redefine a standard Excel function like “Sum”. If recalculating some built-in function is not supported by FlexCel just let us know and we will try to add the support, but you cannot define them with this.

Returning Arrays from UDFs

If you are using array formulas, you might need to return an array from your user-defined function. It is no really different from the standard UDFs, but you need to return a 2-dimensional array of objects from the Evaluate method.

So if we wanted to define a simple UDF that returns an array with 4 fixed numbers, we could define a function like the following:

    public class HelloFlexCelImpl : TUserDefinedFunction
    {
        public HelloFlexCelImpl() : base("hello_flexcel")
        {
        }

        //Do not define any global variable here.
        public override object Evaluate(TUdfEventArgs arguments, object[] parameters)
        {
            //Check we have no parameters
            TFlxFormulaErrorValue Err;
            if (!CheckParameters(parameters, 0, out Err))
                return Err;

            // Note that we return a 2-dimensional array of objects,
            // even if the array is 1-dimensional.
            return new object[,] { { 8, 9, 10, 11 } };

        }
    }

And then, in FlexCel we could use the following code to enter formulas that use the UDF:

    xls.AddUserDefinedFunction(TUserDefinedFunctionScope.Global, TUserDefinedFunctionLocation.External, new HelloFlexCelImpl());
    xls.SetCellValue(2, 1, new TFormula("{=HELLO_FLEXCEL()}", null, new TFormulaSpan(1, 4, true)));

Recalculating Linked Files

FlexCel offers full support for recalculating linked files, but you need to add some extra code to make it work. Everything we will discuss here is about ExcelFile objects, but you can also use this on reports. Just run the reports with FlexCelReport.Run(xls).

The main issue with linked files is telling FlexCel where to find them.

Normally, if your files are on a disk, there should be not much problem to find a linked file. After all, that information is inside the formula itself, for example if FlexCel finds the formula:

='..\Data\[linked.xls]Sheet1'!$A$3 * 2

inside a cell, it could automatically find “..\Data\linked.xls”, open it, and continue with the recalculation.

In fact, there are two problems with that approach:

  1. Files might not be in a filesystem. FlexCel allows you to transparently work with streams instead of physical files, and so you might have for example the files stored in a database. In this case, trying to find “..\Data\linked.xls” makes no sense, and FlexCel would fail to recalculate.

  2. Much more important than problem 1, this approach could imply an important security risk.

    Blindly following links in an unknown xls file is not a smart idea. Let's imagine that you have a web service where your user submits an xls file, you use FlexCel to convert it to PDF, and send back the converted PDF to him. If that user knows the location of an xls file in your server, he could just submit a hand-crafted xls file filled with formulas like:

       ='c:\Confidential\[BusinessPlan.xls\]Sheet1'!A1,
   ='c:\Confidential\[BusinessPlan.xls\]Sheet1'!A2,
   ...

    On return you would supply him with a PDF with the full contents of your business plan. What is even worse, since FlexCel can read plain text files, he might also be able to access any text file in your server. (Imagine you are running on Linux and formulas pointing to /etc/passwd)

Note

You might argue that in a well-secured server your application should not have rights on those files anyway, but on security, the more barriers and checks you add the better. So you should have a way to verify the links inside an arbitrary file instead of having FlexCel opening them automagically.

Because of reasons 1) and 2), FlexCel by default will not recalculate any linked formula, and just return “#NA!” for them. Note that in most cases you will want to leave this that way, since most spreadsheets don't have linked formulas anyway, and there is no need to add extra security risks just because.

But if you do need to support linked files, adding that support is easy.

The first thing you need to do is to create a TWorkspace object. Workspaces are collections of XlsFile objects, and when you recalculate any of the files in a Workspace, all the others will be used in the recalculation (and be recalculated) too.

So the simplest and more secure way to recalculate linked files is to create a Workspace, add the needed XlsFile objects inside, and just recalculate any of the files as usual. For example:

    XlsFile xls1 = new XlsFile("File1.xlsx");
    XlsFile xls2 = new XlsFile("File2.xlsx");
    XlsFile xls3 = new XlsFile("File3.xlsx");

    TWorkspace work = new TWorkspace();
    work.Add("xls1", xls1);
    work.Add("xls2", xls2);
    work.Add("xls3", xls3);

    //Either work.Recalc, xls1.Recalc, xls2.Recalc or xls3.Recalc will recalculate all the files in the workspace.
    work.Recalc(true);

In the example above, we opened two files and added them to a workspace, giving each one a name to be used in the recalculation process. Note that here we don't have issues 1) or 2) at all. We could have opened those files from a stream and it would be the same, since the name “file1.xls” needed to calculate is actually given in the “work.Add()” method. The actual name and location (if any) of the file “file1.xls” is irrelevant. And also we don't have the security concern of FlexCel opening files by itself, since we opened the files we wanted, and FlexCel will not open any more files.

Now, in some cases you don't know a priori which files you are going to need in order to recalculate the file, and so you cannot use the approach above. In those cases, you still use the Workspace object, but you assign an event where you load those files when FlexCel asks for them. The code would be something like:

    XlsFile xls1 = new XlsFile();
    xls1.Open(FileName);

    //Create a workspace
    TWorkspace Work = new TWorkspace();

    //Add the original file to it
    Work.Add(Path.GetFileName(FileName), xls1);

    //Set up an event to load the linked files.
    Work.LoadLinkedFile += new
               LoadLinkedFileEventHandler(LoadLinkedFile);

    //Recalc will recalculate xls1 and all the other files used in the recalculation.
    //At the end of the recalculation, all the linked files will be loaded in the workspace,
    //and you can use the methods in it to access them.
    Work.Recalc(true);

In the LoadLinkedFile event you can load the needed files, checking that they are not trying to access folders they shouldn't be looking to. For example, remove all path information and only load files from the same folder the original file is. Or only allow paths that are children of the path of the main file, or maybe paths from an allowed list of paths. The choice is yours.

The LoadLinkedFile event would be declared like this:

    private static void LoadLinkedFile(object sender, LoadLinkedFileEventArgs e)
    {
        //Load the file here checking it is a allowed file.
        //In this example we will just load the linked file
        //Without checking it, but this is only to keep the example simple.
        e.Xls = new XlsFile(e.FileName);
    }

You can take a look at the Validate Recalc demo to see a real implementation of this. In that example there is no validation of the loaded filenames, but just because it is an application designed to run locally with full trust.

Important

If XlsFile objects can consume lots of memory, Workspace objects can consume much more, since they are a collection of XlsFiles themselves. So same as with XlsFile objects, don't leave global Workspace objects hanging around. Set them to null as soon as possible if they are global variables, or use local objects which are freed when going out of scope.

Take also a look at the example Recalculation of linked files for more information.

Miscellanea

Using .NET languages different from C#

While FlexCel.NET runs in any .NET language, and we try to provide most demos and documentation for most languages, you will sooner or later find code snippets, newsgroups posts, etc. available only in C#, since FlexCel itself is written in C#. This will probably be no big problem since all languages under .NET behave in similar ways, but we will try in this section to help a little with it.

Even if you do not have exposure to any C-based language, C# examples are not so difficult to read. But there are some basic concepts that might help you understand them, based on the feedback we get from our users, and we will explain them there. If you already are fluent at C#, just skip this section.

Operators

C-based languages are a little less verbose than others when specifying operators, and this might be a little cryptic when you are not used to them. For example, to specify an “if” statement in C# that evaluates to true if either a and b are true or c is true you would write:

if ((a && b) || c)

while in VB.NET it would be:

if (a and b) or c then

A small list of operators you might find while reading the source code is here:

Logical Operators
Operator | Meaning | Example
! | Not | if (!a) means “If not a”
|| | Or | if (a || b) means “if a or b”
&& | And | if (a && b) means “if a and b”
Bitwise Operators
Operator | Meaning | Example
~ | Not | ~ 1 means “not 1”
| | Or | 2 | 1 means “2 or 1” ( this is 3)
& | And | 2 & 1 means “2 and 1” ( this is 0)
^ | Xor | 1 ^ 1 means 1 xor 1 (this is 0)

We will not make a detailed explanation of the operators here, as the only idea here is to help you read the examples, but you can read the full documentation at: http://msdn2.microsoft.com/en-us/library/6a71f45d(VS.71).aspx

Automatic conversion

Many times, the easiest way to understand a code snippet in C# is just to use an automatic translator to translate it to your language. You can find many online translators just by searching, but we will mention one of them here: For VB.NET: http://www.developerfusion.co.uk/utilities/convertcsharptovb.aspx

Streaming Excel and Pdf files to the browser

A simple code snippet that you are likely to use, is the one to send the generated files to the browser without creating temporary files.

You can find it in the ASP.NET demos, but just in case you need a quick reference, here is the code to stream an Excel file:

    static void StreamToBrowser(ExcelFile xls, string fileName)
    {
        using (MemoryStream ms = new MemoryStream())
        {
            // Deduce how to save the file from the filename.
            bool IsXls = Path.GetExtension(fileName).Equals(".xls", StringComparison.OrdinalIgnoreCase);
            // Xlsx files can have multiple extensions: xlsx, xlsm, etc.
            // We will assume that if it is not xls, then is xlsx.

            TFileFormats fileFormat;
            if (IsXls) fileFormat = TFileFormats.Xls;
            else fileFormat = TFileFormats.Xlsx;

            xls.Save(ms, fileFormat);
            ms.Position = 0;
            Response.Clear();
            Response.AddHeader("Content-Disposition", "attachment;" + "filename=" + fileName);
            Response.AddHeader("Content-Length", ms.Length.ToString());

            if (IsXls) Response.ContentType = StandardMimeType.Xls;
            else Response.ContentType = StandardMimeType.Xlsx;

            Response.BinaryWrite(ms.ToArray());
            Response.End();
        }
    }

For PDF files, you would use similar code, but using StandardMimeType.Pdf instead.

Warning

Make sure to use ms.ToArray() and not ms.GetBuffer(), since GetBuffer is not guaranteed to return everything.

Avoiding the “Want to save your changes?” dialog on close.

By default, FlexCel will not identify the xls/x files it generates as having been recalculated by any Excel version. This will cause Excel to recalculate the file on open, and when closing the file, it will show the following dialog:

save changes dialog

This will always happen when you save a file with formulas. We choose this as the default mode because we can’t know which formulas your file has, and while we support over 300 Excel functions, you might be using something we don’t support, or some VBA macro function that you didn’t re-implement in FlexCel, or some linked files without setting up FlexCel to recalculate linked files. So the safest default is to leave Excel to recalculate files on open, and this has the side effect of this dialog popping up when you try to close the file.

If you know the formulas you are using are all supported, and you would like to get rid of this dialog, you can tell FlexCel to identify the file as having been saved by a specific Excel version.

So you can for example do:

ExcelFile.RecalcVersion = TRecalcVersion.Excel2019;

or if using reports:

FlexCelReport.RecalcVersion = TRecalcVersion.Excel2019;

Once you do this, any Excel version equal to or older than Excel 2019 will not recalculate the file on open, trusting the recalculation FlexCel did, and it won’t show the dialog on close.

Newer Excel versions will still recalculate and ask for save on close.

Note

If you want to use the always use the latest version supported by FlexCel, you can specify TRecalcVersion.LatestKnownExcelVersion. This value is set to the latest Excel version FlexCel knows about, so when you update FlexCel it will update automatically without you having to modify your code.

The other special value is TRecalcVersion.SameAsInputFile. This value means to use the value in the file you are using as a template. Let's imagine that you have an old FlexCel version which supports up to Excel 2013, and you had a file saved in Excel 2016. With this value, FlexCel will identify the file as saved as Excel 2016, even if it doesn't know about it. It will just copy the value from the input file which was in Excel 2016.

Closing Words

We hope that after reading this document you got a better idea on the basic concepts of using the FlexCel API. Concepts mentioned here (like XF format indexes) are basic to use FlexCel, so it is important that you get them right.

And one last thing. Remember that FlexCel API's main strength is that it modifies existing files; it doesn't use the traditional approach of one API for reading the file and another for writing. In fact, FlexCel doesn't even know how to create an empty file. When you call ExcelFile.NewFile, you are really reading an empty xls file embedded as a resource. You are always modifying things.

Take advantage of this. For example, let's say you want to save a macro on your final file. There is no support on FlexCel for writing macros. But you can create the macro on Excel and save it to a template file, and then open the template with FlexCel instead of creating a new file with NewFile.

Use Excel and not FlexCel to create the basic skeleton for your file. Once you have all of this on place, modify it with FlexCel to add and delete the things you need. This is what FlexCel does best. And of course, remember that you can use FlexCelReport for creating files, designing your files in Excel in a visual way.


FlexCel Reports Developer Guide | FlexCel Studio for the .NET Framework documentation

FlexCel Reports Developer Guide

Introduction

This document is a part of a 2-part description on how to create Excel files by “reporting” instead of with code. In this part we will look at how to set up the coded needed to create the files, and in the next part FlexCel Reports Designer Guide we will look at how to modify the Excel file used as a template to create the reports.

About Excel Reporting

FlexCel gives you two ways to create an Excel file:

  • With the API using the class XlsFile
  • With a templating system using the class FlexCelReport .

Each method has its good and bad things, and it is good to know the advantages and drawbacks of each.

Creating a report using XlsFile is a low-level approach. As with most lower level approaches, it will be very fast to run (if coded right!), and you will have access to the entire API, so you can do whatever you can do with FlexCelReport and more. After all, FlexCelReport uses XlsFile internally to work its magic.

Whatever you can do in FlexCelReport, you can do it with the API.

But you need to take a lot of care when coding directly in the API: XlsFile reports can be a nightmare to maintain if not coded correctly. When you reach enough number of lines like:

    xls.SetCellValue(3, 4, "Title");
    var fmt = xls.GetFormat(xls.GetCellFormat(3, 4));
    fmt.Font.Name = "Helvetica";
    fmt.Font.Size20 = 14 * 20;

    int XF = xls.AddFormat(fmt);

    xls.SetCellFormat(3, 4, XF);

changing the report can become quite difficult. Imagine the user wants to insert a column with the expenses (and don't ask why, users always want to insert a column).

Now you should change the line:

    xls.SetCellFormat(3, 4, XF);

to

    xls.SetCellFormat(3, 5, XF);

But wait! You need to change also all references to column 5 to 6, from 6 to 7... If the report is complex enough, (for example you have a master-detail) this will be no fun at all.

But there is something much worse with using XlsFile directly. And this is that only the author can change the report. If your user wants to change the logo to a new one, or maybe make column C a little wider, he needs to call you and you need to recompile the application and send him a new executable.

FlexCelReport is a higher level approach. The design is cleanly separated on three different layers, data layer, interface layer and presentation layer, and most of the work is done on the presentation layer, with Excel. You design the report visually on Excel, and you mess as little as possible with the data layer. If the user wants to change the logo, he can just open the template and change the logo. If he wants to insert a column, he can just open the template and insert a column. And the application does not even need to be recompiled.

As with any higher level approach, it is slower than using the API directly, and there are some things where it is more limited. But all in all, reports are really fast too and the things you cannot do are in many cases not worth doing anyway.

So, the option is yours.

Organization of a FlexCel Report

A FlexCel report can be seen as three different modules working together to create the Excel file. Different from a “Coded” report where there is not a clear separation between data access and presentation, here each part has its own place, and can be developed separately by different people with different skills.

Data Layer

This is the layer that contains the data model of the information we want to send out. The data might be stored at a database, or in lists of objects in memory.

Interface Layer

This layer works as the glue between the data and the presentation layers. It has to prepare the data in a way that the presentation layer can easily consume.

Presentation Layer

This is the most complex and changing layer of the three. Here is where you design all the visual aspects of the report, like data position, fonts, colors, etc.

The big advantage of this “layering” is that they are somehow independent, so you can work on them at the same time. Also, Data and Interface layers are small and do not change much on the lifetime of the application. Presentation does change a lot, but it is done completely in Excel, so there is no need to recompile the application each time a cell color or a position changes.

Note

The data flow goes from the Presentation layer to the Data layer and back. It is the presentation that asks FlexCel for the data it needs, and FlexCel that in turn asks for the data. It is not the application that tells FlexCel the data it needs (As in SetCellValue(xx) ), but FlexCel that will ask for the data to the application when it needs it.

On this document we are going to speak about Data and Interface layers. The Presentation layer is discussed on a different document, FlexCel Reports Designer Guide because it is complex enough to deserve it, and because it might be changed by someone who only understands Excel, not .NET. And we don't want to force him to read this document too.

Data Layer

The objective of the data Layer is to have all the data ready for the report when it needs it. Currently, there are six ways to provide the data:

  1. Via Report Variables. Report variables are added to FlexCel by using FlexCelReport.SetValue”. You can define as many as you want, and they are useful for passing constant data to the report, like the date, etc. On the presentation side you will write <#ReportVarName> each time you want to access a report variable.

  2. Via User defined functions: User defined functions are classes you define on your code that allow for specific needs on the presentation layer that it can't handle alone. For example, you might define a user function named “NumberToString(int number) that will return “One” when number=1, “Two” when number =2 and so on. On the presentation layer you would write <#NumberToString(2)> to obtain the string “Two”

  3. Via DataSets: .NET DataSets are a collection of memory tables that can be sorted, filtered or manipulated. Whatever format your data is, you can use it to fill a DataTable and then use that data on FlexCel.

  4. Via IEnumerable: If you have business objects that implement IEnumerable (or even better IQueryable) and you are in .NET 3.5 or up, you can use them directly with FlexCel. Just call FlexCelReport.AddTable(“name”, YourCollection) and you are ready to go.

  5. Via Direct SQL in the template. For maximum flexibility, you can set up the data layer on the template too. In this case, you need to add a database connection to FlexCel, and all the rest is done on the template. This allows the users to completely edit the reports, even the data layer from the template, but also it allows users to do things they might not be intended to. Use it with care.

  6. Via Virtual Datasets: If your business objects don’t implement IQueryable, and the overhead of copying your existing objects to datasets is too much, you can implement your own wrapper objects to provide this data to FlexCel without copying it. But please take this option with care, as it might be simpler and more performing to just dump your objects into a DataSet and use that. FlexCel has an optimized implementation of a virtual dataset for DataSets, and if you create your own virtual datasets you will have to implement a similar level of performance (and functionality). Please read the Appendix II for a more detailed description of virtual datasets.

Linq based DataSources

With FlexCel you can use any object that implements IEnumerable<T> as a datasource for a report (in .NET 3.5 or newer). Internally, FlexCel will use Linq to query the objects and read the results.

To use Linq, you just need a collection of objects. For every object in the collection, you can use all the public properties as fields in the report. So if for example you have the following class:

    class MyObject
    {
        public string FirstName { get; set; }
        public string LastName { get; set; }
    }

And the list of MyObject:

    var MyObjectList = new List<MyObject>();

You can add this collection as a datasource for the report with the line: FlexCelReport.AddTable("MyName", Objs)

And then in the template write <#MyName.FirstName> and < #MyName.LastName>inside a “__MyName__” range to export the collection.

You can also use Entity Framework collections or any other of collection that implements IEnumerable as datasource.

Note

Record count: When FlexCel runs a report from an IEnumerable datasource, it needs to know the count of objects in advance, so it can insert the rows before filling the data. For normal collections like List<Object> this isn’t a problem since they provide a “Count” method that will be used by Linq and it is very fast.

For Entity Framework collections, two different SQLs will be sent to the server, once to get the record count and the second to actually fetch the records. Other collections could have no way to know the record count in advance, and in those cases Linq will loop over all objects in the collection to get the count. In this third case, it will be faster if you provide the record count yourself. Look at the Performance guide to see how you can supply the record count.

Note

Transactions: When you are running a report that access the database (like a report from Entity Framework objects) you must be sure that the database isn’t updated while the report is running.

As said in the note above, in database reports FlexCel sends two SQLs to the server for every table, the first to get the count and the second to get the data. If when you run the second SQL the number of records changed, you will see weird things in the report as the number of rows inserted won’t be the same as the number of records written to the report. Also for master-detail and even a single table, you must make sure that data doesn’t change while it is being fetched. To ensure this, the report should be run inside a “Snapshot” or “Serializable” transaction.

Snapshot transactions are preferred if supported because they don’t block other users from modifying the tables while the report runs. Please take a look at the Performance guide and the Entity Framework demo for more information about transactions.

Dataset based DataSources

Besides Linq, FlexCel also allows using .NET DataSets as datasources. DataSets are less flexible than LINQ datasources and can use more memory, but on the other hand, they can be faster than Linq in many cases. Also, you might have already your data in DataSets, and in this case nothing will be faster than a direct report from it.

The reason why it uses more memory is that it has to fill the dataset before running the report, loading all the data into memory. The reason it can be faster many times is that it loads all the data just once from the database, and then works from memory, avoiding further access to the database which can be slow.

To use a DataSet in a report, just add the dataset or the tables with:

FlexCelReport.AddTable(DataSet);

Or any of the similar AddTable overloads.

As with LINQ, if there is a chance that the data can be modified while you are filling the datasets, those datasets must be filled inside a “Snapshot” or “Serializable” transaction. An advantage of datasets here is that those transactions will complete faster. Once the data is loaded in the dataset, you can run the report without worries about other users changing the data, as it is all loaded in memory.

Data Relationships

FlexCel supports Master-Detail reports, where you have a “master” datasource and a “detail” datasource where for every master record you have different detail records. You could have an “employee” table and for every employee, the orders they sold.

For these kinds of reports, you must tell FlexCel which is the master and which is the detail. Also, you must tell FlexCel how those two tables are related; for example, both tables could be related by an “EmployeeId” field that is used to know which orders correspond to which employee.

You can specify those relationships in two ways:

Implicit Relationships

When the individual objects inside a collection of objects contain a public property that is itself a collection of objects, the second collection is implicitly a detail of the first. For example, if you have the class:

    class Employee
    {
        public string FirstName { get; set; }
        public string LastName { get; set; }
        public List<Order> Orders { get; set; }
    }

Then “Orders” is an implicit detail of “Employee” and when you create a Master-Detail report, FlexCel will output the correct orders for every employee.

Implicit relationships are used in
Entity Framework, and are a simple way to provide master-detail relationships if you have your objects organized this way.

Explicit Relationships

Sometimes (as it happens with DataSets) you don’t have implicit relationships in your data. You might have two different Lists of objects:

    List<Employee2> Employees;
    List<Order2> Orders;

Where the objects are defined as:

    class Employee2
    {
        public int EmployeeId { get; set; }
        public string FirstName { get; set; }
        public string LastName { get; set; }
    }

    class Order2
    {
        public int EmployeeId { get; set; }
        public int OrderId { get; set; }
        public string OrderName { get; set; }
    }

And related by an Id (in this case EmployeeId). If you were to create a report out of those two lists, you would get the full list of orders for every Employee. You need to tell FlexCel that the “Employees” collection is related to the “Orders” collection by the EmployeeId.

You can add explicit relationships with

FlexCelReport.AddRelationship(...)

But you will almost never need to do so. FlexCel automatically loads all existing Data Relationships in datasets, so if the tables on your dataset are related, then you don’t need to do anything else.

For other objects different from datasets you will probably want to use implicit relationships. But there might be cases where you need explicit ones. Explicit relationships are more powerful than implicit, in the sense that you can have the same tables related in different ways. For example, The “Orders” collection could have also an explicit relationship with a “Date” table. If you run the report “Orders by Date” then that relationship will be used. If you run the report “Orders by Employee” then the employee relation will be used. If you had implicit relationships, then both “Date” and “Employee” collections would need an “Orders” field, and that could lead to repeated data.

Explicit data relationships can be defined with any objects, even between DataSets and and LINQ collections. Whenever FlexCel finds an explicit Data Relationship, it will filter the detail table to show the correct records for the master.

Tip

You might also define the relationships directly in the template instead of by code. This is useful when using Direct SQL, since the tables are defined directly in the Excel template and you can’t set up the relationships in code. Also, you can add custom relationships not related to datasets, when using virtual datasets.

Interface Layer

This is the simplest of the three, as all work is done internally. To set up the interface layer, you only need to tell FlexCel which datasets, tables and user functions it has available from the data layer. For this, you use “SetValue”, “SetUserFunction”, “AddTable” and “AddConnection” methods on FlexCelReport. Once you have told FlexCel what it can use, just call FlexCelReport.Run and this is all.

Note

It is worth spending some time thinking about what tables, functions and variables from the data layer you want to make available for the final user. Limiting it too much might mean cutting the power of the user to customize his report. And just adding everything might be too inefficient, since you are loading thousands of rows the user is not going to use, and might also have some security issues, as the user might get access to tables he is not expected to. You can also use SQL on the templates to allow maximum flexibility, but then you need to be extra careful about security.

Appendix: Virtual DataSets

This is an advanced topic, targeted to experienced developers with really specific needs.

As explained earlier, the easiest way to provide data to FlexCel is via IQueryable collections or DataSets. Both methods are fast, optimized, with lots of added functionality, like data relationships, filtering or sorting, and if you are experiencing issues with them, you are probably better using them.

But you might want to use your own objects directly, and they might not be stored in any of those containers.

You can do this by writing wrapper objects around your data, implementing the abstract classes **** and ****. In fact, standard IQueryable collections and Datasets also interoperate with FlexCel by implementing those classes.

Note

If you are curious and have FlexCel source code, you can search for TLinqDataTable, TLinqDataTableState, TAdoDotNetDataTable and TAdoDotNetDataTableState to see how they are implemented.

We have two classes to implement:

  1. On one side we have . It is a “stateless” container, much like a dataset. Each virtual dataset corresponds with a table on the data layer that you would add with “FlexCelReport.AddTable”, or create by filtering existing datasets on the config sheet.

  2. On the other side we have . Each VirtualDataTableState corresponds with a band on the presentation layer, and if 2 bands share the same data source they will have 2 different VirtualDataTableState objects associated (but a single shared VirtualDataTable).

This is probably easier to visualize with an example. Let's imagine we have the following report:

virtual datasets template

And this code:

FlexCelReport.AddTable(Customers);
FlexCelReport.AddTable(Company);
FlexCelReport.Run();

There are two VirtualDataTables here (Company and Customers), and three VirtualDataTableStates (One for the Company Band, one for the first Customers Band and one for the second Customers Band)

Warning

Take note that the same VirtualDataTable is used by two different VirtualDataTableStates, and might be used by other VirtualDataTableStates in other threads.

This is why you cannot save any “state” information on the VirtualDataTable, and if you write to any private variable inside of it (for example to keep a cache) you should use locks to avoid threading issues.

Always assume that some other class might be reading your data.

VirtualDataTableState on the other hand is a simple class that will not be accessed by more than one class at the time, and you can do whatever you want inside it without worries of other threads trying to access it.

Creating a VirtualDataTable descendant

The first step into creating our own data access is to create a VirtualDataTable descendant and override its methods. You do not need to implement every method to make it work, just the ones that provide the functionality you want to give to your end users.

VirtualDataTable Required Methods:

On every DataTable you define, you need to implement at least the following methods:

  • GetColumn, GetColumnCaption, GetColumnName and ColumnCount:

    Those methods define the “columns” of your dataset, and the fields you can write on the <#dataset.field> tags on the template.

  • CreateState: It allows FlexCel to create VirtualDataTableState instances of this DataTable for each band. You will not create VirtualDataTableState instances directly on your user code, FlexCel will create them using this method.

VirtualDataTable Optional Methods:

Now, depending on the functionality you want to provide to the end user, you might want to implement the following methods:

  • FilterData: Will return a new VirtualDataTable with the filtered data.

    You need to implement this method if you want to provide the user with the ability to create new datasets by filtering existing ones on the config sheet. If you do not implement it, any attempt to create a filtered dataset on the config sheet will raise an exception.

    Also when FlexCel needs to create a dataset that is a copy of the existing one (for example for sorting it) it will call FilterData with rowFilter null. So even if you don’t implement filtering, it is normally a good idea to at least implement the case for “rowFilter” = null and return a clone of the datatable.

    Note that this only applies to standard filters. For <#Distinct()> or <#Split> filters you do not need to implement this.

  • GetDistinct: Will return a new VirtualDataTable with only unique records.

    Implement this method if you want to let your user write <#Distinct()> filters on the config sheet.

  • LookUp: Will look for a record on the dataset, and return the corresponding value. This method allows the user to use <#Lookup()> tags on their reports.

  • GetRelationWith: Use this method to return implicit relationships between your data tables. For example the VirtualDataTable implementation of Datasets uses this method to return the ADO.NET DataRelations between datasets. The Linq implementation returns as related any nested dataset.

Creating a VirtualDataTableState descendant:

Again, you do not need to implement every method in this class, and the methods you don't implement will just reduce functionality.

VirtualDataTableState Required Methods:

  • RowCount: Here you will tell FlexCel how many records this dataset has on its current state. Remember that this might not be the total record count. If for example you are on a master-detail relationship, and the master is on record 'A', you need to return the count of records that correspond with 'A'. Make sure this method is fast, since it is called a lot of times.

  • GetValue: Here you will finally tell FlexCel what is the value of the data at a given row and column. You can know the row by reading the “Position” property, and the column is a parameter to the method.

    As with RowCount, this method should return the records on a specific state, not all the records on the datatable. If you are in a master-detail relationship and only two records of detail correspond the master position, GetValue(position = 0) should return the first record, and GetValue(Position = 1) should return the second. It doesn't matter if the total number of records is 5000.

VirtualDataTableState Optional Methods:

  • MoveMasterRecord: This method is called each time the master changes its position when you are on a master-detail relationship. You should use it to “filter” the data and cache the records that you will need to return on RowCount and GetValue. For example, when the master table moves to record “B”, you should find out here all the records that apply to “B”, and cache them somewhere where RowCount and GetValue can read them.

    You should probably create indexes on the data on the constructor of this class, so MoveMasterRecord can be fast finding the information it needs.

    You do not need to implement this method if the VirtualDataTable is not going to be used on Master-Detail relationships or Split relationships.

  • FilteredRowCount: This method returns the total count of records for the current state (similar to RowCount), but, without considering Split conditions.

    If the dataset has 200 records, of which only 20 apply for the current master record, and you have a Split of 5 records, RowCount will return 5 and FilteredRowCount will return 20.

    This method is used by the Master Split table to know how much records it should have. In the last example, with a FilteredRowCount of 20 and a split every 5 records, you need 4 master records. You do not need to implement this method if you do not want to provide “Split” functionality.

  • MoveFirst/MoveNext: Implement these methods if you want to do something in your data when FlexCel moves the active record. For example, the LINQ implementation uses those methods to move the IEnumerator. The dataset implementation does nothing as it doesn’t need to track the changes in position.

EOF: Return true if the dataset is at the last record. If you don’t implement this method, the default implementation is to check Position == RecordCount. But RecordCount might be expensive to calculate, and in this case, if you explicitly implement this method, it will work faster.

Finally

When you have defined both classes, you need to create instances of your VirtualDataTable, and add them to FlexCel with FlexCelReport.AddTable.

For examples of how the whole process is done, please take a look at the Virtual DataSet demo.


FlexCel Reports Designer Guide | FlexCel Studio for the .NET Framework documentation

FlexCel Reports Designer Guide

Introduction

This document has two different target audiences, developers using FlexCel and final power users that want to customize their reports. It covers how to design an Excel template, but not the code parts needed to run a report. Read the Reports Developer Guide for the code part.

Report Elements

There are three concepts you should understand to create or modify a report: Tags, Named ranges and the Configuration sheet. We will be covering all of them in the sections below.

Tags

A tag is text that you write in a cell and that will be replaced by a different value on the generated report. All tags are on the form <#TagName> when they don't have any parameters, and <#TagName(param1;param2...)> when they have parameters.

Note

Notice that the parameter separator is “;” not “,” as it is on expressions. This was done so it is simpler to mix formulas in tags.

Tags are case insensitive, so you can write <#tag>, <#TAG> or <#Tag> as you prefer. The convention we usually use is all lowercase, but it is up to you.

You can write multiple tags on the same place, and the result will be the concatenated string. You may also apply different formats to different tags. For example, writing “<#value1> and <#value2>” inside a cell will be replaced by something similar to “1 and 2”

Tags will be replaced on Cells, Comments, Sheet names, Images, Hyperlinks, AutoShapes, Headers and Footers.

Tag Reference

The complete list of tags you can use and their descriptions is on the Reports Tag Reference.

Evaluating Expressions

Expressions can be used inside <#If> and <#Evaluate> tags. They behave like standard Excel formulas, and you can use any formula that FlexCel can calculate. But, different from formulas, you can also enter tags inside expressions.

For example, you could write:

<#Evaluate(A1 + Min(A2, <#Value>))>
Note

As you might recall from the previous note, the parameter separator inside tags is ";". But, the parameter separator in Expressions is “,” , not “;” This is to keep the expressions syntactically compatible with Excel, and also to allow you to mix tag parameters with expression parameters without issues.

The supported list of things you can write inside an expression is detailed on the following table:

Element | Syntax | Description | Example
Tag | <#Tag> | You can enter any tag inside an expression, and it will be evaluated. The tag might contain nested expressions too. | 1+<#Value>; will return the report variable “Value” plus 1.
References | A1, $A1, Sheet1!A2, A1:A2, Sheet1:Sheet2!A1:B20, etc | Standard Excel cell references. You can use relative and absolute references too. | A1 + A2 will return the sum of what is on cell A1 and A2. As the references are not absolute, when copied down this expression will refer to A3, A4, etc.
Parenthesis | () | Changes operator precedence. Standard operator precedence on expressions is the same as in Excel, that is “1 + 2 * 3” = 1 + (2 * 3) = 7 and not (1 + 2) * 3 = 9 | (1 + 2) * 3 ^2 will be evaluated different than 1 + 2 * 3 ^2
Arithmetic Operators | +, -, *, /, %, ^ (power) | Standard arithmetic operators. | 1 + 2 *3 ^2 will evaluate to 19. 5% will evaluate to 0.05
Equality Operators | <, >, =, >=, <=, <> | Standard equality operators. | 1>=2 will evaluate to false.
Functions | function(parameters) | You can use any formula function that FlexCel can recalculate inside an expression. For a list of supported functions, take a look at the list of supported Excel functions |

Named Ranges

While Tags allow you to replace complex expressions inside a sheet, with them alone we can only create “Fill in the blanks” type reports. That is, reports that are static, like a form, and where cells with tags will be replaced with their corresponding values.

Now we are going to introduce the concept of “Band” A Band is just a range of cells that is repeated for each record of a table. Imagine that you define a Band on the cell range A2:C2, and associate it with the table “Customer”. Then, on cells A2:C2 you will have the first customer, on cells A3:C3 the second and so on. All cells that were previously on A3:C3 will be moved down after the last record of the dataset.

If table customer has six registers, and you have a template as follows:

report band template

After running the report you will get something like this:

report band result

On FlexCel we use Named Ranges to indicate the bands. If you are not used to Excel Named Ranges, take some time to familiarize with them, as they are one of the things that can be a little confusing when starting with FlexCel. Different from tags, that you can immediately see when you open a workbook, named ranges are a little more hidden.

To create a Band on A1:C1, we would go to the “Formulas” tab, then choose “Name Manager”:

excel name manager

Once there, we can define a Band __Customer__ on cells A1:C1. And once the name is defined, we can easily see it on the Names combo:

excel name box

Note the “__” at the beginning and at the end of the range name. We use this to indicate FlexCel that this is a horizontal range that inserts full rows down.

The rest of the name (Customer) should be the name of an existing data source (table, array of data, etc), or a custom table defined on the config sheet.

Range Types

You can define four different kinds of bands on FlexCel:

  • “__” Range: This range moves down and inserts full rows. For example, to define a band that inserts full rows down for each record of the dataset “Customer” you would use a name __Customer__

  • “_” Range: This range is similar to “__” but cells outside of the range won't move down. To define a band that inserts only a range of cells down for each record of the dataset “Customer” you would use a name _Customer_

  • “II_” Range: This range moves to the right and inserts full columns. Note that the first character is the letter i, not a pipe (|). To define a band that inserts full columns for each record of the dataset “Customer” you would use a name II_Customer_II

  • “I_” Range: This range is similar to “II_” but cells outside of the range won't move right. To define a band that inserts cells to the right for each record of the dataset “Customer” you would use a name I_Customer_I

A “__” range is the same as a “_” range defined on the full rows, and the same is valid for “II_” and “I_” ranges for columns.

On the following example, if you name A1:D7 as “_Customer_” Cell E8 won't move when inserting down. If you name it as “__Customer__” Cell E8 will move to the last inserted cell, because a “__Customer__” range is equivalent to a “_Customer_” range on A1:XFD7.

band moves down

Master-detail

Named ranges can be placed inside others, and a master-detail relationship will be automatically created. For example, if you define a range “__Customer__” and inside it a range “__Orders__” and there is a relationship created on the application between “Customer” and “Order” tables, it will automatically group your orders by customer.

On the following example, the yellow cells are the range “__Customer__” and the blue ones are the range “__Orders__”

master detail template

After running this report, you will get something similar to:

master detail result

As you can see, Orders are filtered for each customer, based on the Data Relationships defined on the application, and on the nesting on the ranges. In general, any range that is inside another is filtered by all of its parents. You can have as many levels of master-detail relationships as you wish, and each master band filters all of its children.

For example, if we wanted to group the customers by country we could define a __Countries__ named range on A1:F6, and it would automatically filter the data on its child and grandchild. (Customer and Order)

Multiple-sheet Master-detail

There is a special Table that if present filters all the others on the sheet, acting as a parent of all the named ranges on the sheet. This is the table that you define on the name of the sheet, when doing a multiple sheet report.

You can see the Multiple sheet report demo for an example: On it every table on each sheet is filtered by category.

Ignoring Ranges

Sometimes, you might want to ignore processing in a range of cells or sheets. So for example if you have a sheet with <#tags> but which aren't real FlexCel tags, you might want to exclude that sheet from the report.

  • To exclude full sheets, start the name of the sheet with a dot ("."): The dot will be removed in the final report. So for example if you name a sheet ".Totals", that sheet won't be used in the report, just left "as-is". In the final result, the sheet will be renamed to "Totals".

  • To exclude just some cells from a sheet, you can create a band and name it starting with a dot ".". Ranges starting with a dot (".", "_.", "I_." and "II_.") are ignored by FlexCel, so you could define a name ".ignore." and it won't be processed.

You can see an example of ignoring ranges of cells in the Pivot Tables demo.

Bidirectional Bands

As a general rule, bands in FlexCel can’t intersect. You can have separated bands:

And they will each expand separately. You can also have one band completely inside another:

And the inside band will be a detail of the outside band. But if the bands intersect:

It is not really possible to do a report with this data. There is no master and no detail here, and if we run those two bands separately, one band would overwrite the results of the other. It is not possible to know if cell C3 should have data from Band 1 or Band 2.

So in general, FlexCel will raise an error if you try to do a report with bands that intersect: This is most likely a mistake in the template.

But there is one special case where FlexCel allows you to have two bands that intersect: If the bands form a cross, and the vertical leg of the cross is a column range, while the horizontal leg is a row range:

This will create a bidirectional band, that grows both to the right and to the bottom at the same time. The conditions for creating a bidirectional band are:

  1. One band must grow horizontally and the other vertically.

  2. The bands must form a cross. This means that the top of Band 2 must be smaller or equal than the top of Band 1, the bottom of Band 2 must be bigger or equal than the bottom of Band 1, the left of Band 1 must be smaller or equal than the left of Band 2, and the right of Band 1 must be bigger or equal than the right of Band 2. You will normally make Band 1 a full row range and Band 2 a full column range.

If both conditions are met, FlexCel will create a master-detail report where Band 1 is the master and Band 2 the detail. For bidirectional bands, FlexCel will always make the horizontal band the master and the vertical band the detail.

As the vertical band is the detail, you can have multiple vertical bands for the same horizontal band master. That is, you can have something like this:

And both Band 2 and Band 3 will be details of the master Band 1.

What you can’t currently have is two row bands intersecting the same column band:

In this case, as FlexCel will always make the vertical bands the detail, Band 2 should be the detail of both Band 1 and Band 3. And while a master band can have many details, a detail band can have only one master.

A workaround if you really need such a thing would be to use <#Includes>. You could have two subreports: one with Band2 and Band1, and the other with Band3 and Band2. Then in your master report, you <#Include> both subreports one below the other. The effect will be as if you had run multiple horizontal bands with Band2, but there won’t be multiple masters.

For more information on Bidirectional Reports, you can look at the Bidirectional Reports example.

X ranges

One issue that might appear when defining named ranges is how formulas on other ranges change when inserting the new cells.

Let's imagine we want to make a simple report on a list of items and their prices.

So, we create a new template, define a title row, and insert a named range on A2:B2 to propagate the data. But we also want to know all the total cost of all items, so we add a formula on B3:

When you run this report, rows will be inserted between row 2 and 3, but the formula Sum(B2:B2) won't change. Nothing has been inserted between B2 and B2, so the sum range will remain constant.

So, we need to have a Sum range that can expand. We will define:

Now, when rows are inserted between row 2 and 3, the formula will be updated to reflect the new rows.

In this particular case, this solution might be enough. Just leave an empty row after the range so formulas expand, and then you can hide the extra row or just leave it there.

But, if we were for example creating a chart, this extra row will be on the chart too. If you are an old FlexCel VCL user, you know about the “...delete row...” thing just to avoid those cases.

Well, delete row does not work anymore on FlexCel 5.0 and up, because the row would be deleted before the range is expanded, and the formula will then point to B2:B2 again.

This is why we introduced the “X” ranges. X ranges are normal named ranges with an “X” at the end. On this case, instead of “__Item__”, we would call the range “__Item__X” It will behave exactly the same as a normal range, but once it is expanded it will erase the row immediately after the range (or column if it is a column range). So if we try the last example with “__Item__X”, row 5 on the last screenshot will be deleted, and the formula would be “=SUM(B2:B4)”. Just what we were looking for. See the Charts demo for more information on using X ranges.

Important

Don't include the row you want to delete inside the range you are creating!

The row (or column) deleted will be the one after the range, not the last row in the range. So if you define a range "__MyBand__X" in rows 2 and 3:

x band row deleted

FlexCel will repeat the 2-row range for each record, and then delete the row after the range, as seen below:

x band row deleted result

This is not likely what you want. To have one row per record, the __MyBand__X name must have one row only, and then the row after the band will be deleted.

Fixed Bands

By default, FlexCel will always insert cells when expanding ranges, and this is what you would normally want. If you have a template:

A1:Title

A2:<#data>

A3:Footer

You would expect that the generated report will have the Footer for example on cell A33 (if we had 30 data records), but not on A3.

But there is a situation where this is not what you expect, and this is on Fixed Form reports. Let's imagine that you want to fill out a form with FlexCel. Most fields will be just simple expressions, not related to datasets, but we might have a table too:

Here, no matter if the dataset has 1 record, two or 10 (it should not have more than 10) you want the “Total” line to be at row 23. You cannot do this with normal ranges, since you would be inserting rows. For this you can define a “__TopOrders__FIXED” named range, which will not insert any records.

FlexCel will treat any range that ends with the word "FIXED" as a fixed range, as long as the characters before the range mean the end of a range. That is, II_Range_IIFIXED will be a fixed range, since "_II" is the end of a vertical range. But __OrdersFixed__ is not a fixed range.

Note

The word "FIXED", as most stuff in Excel, is case insensitive. Both __Range__FIXED and __Range__fixed are ok. But in our docs and own templates, we use UPPERCASE modifiers so they stand out and are easier to spot.

Warning

You can't use FIXED bands in master-detail reports. The problem is that master-detail works by inserting the rows of the details between rows of the master. As FIXED bands don't insert rows, you will end up with the master overwriting cells of the details or vice-versa.

To do a fixed master-detail report, you can just run the report with normal (not FIXED) names in a separate subreport, and then <#include> that subreport into the main report using a FIXED include so it doesn't insert rows or columns.

See the Fixed Forms With Datasets demo for more information.

Fixed N Bands

Sometimes, you might want the records to overwrite the first n cells (like in a “fixed” band), but after those rows are overwritten, insert the rest of the records (like in a normal report).

You can get this by using a “FixedN” range, where “N” is the number of rows or columns you want fixed. For example “__data__FIXED2” will overwrite the first 2 rows, and insert (data.RecordCount – 2) rows for the rest.

You can see an example of FixedN bands at the Balanced Columns demo.

Alias Bands

In some rare cases, you might want to use the same dataset twice in the same sheet. One way to do it is to define an alias in the config sheet, so you have, for example:

  • DataSet1
  • NewDataSet1 -> Alias to DataSet1

And then, in the report, you define a DataSet1 and a NewDataSet1 range.

But in some cases, like, for example, when you are creating a report from a list of objects and there are nested objects, you can't rename those nested objects. If a Customer object has a Orders nested object, then you can't rename Orders in the config sheet. You would need to define two Orders names, but only one is allowed by Excel.

To solve this, you can use the ..Alias.. postfix. Just write the word ..ALIAS.. (case insensitive) after the name, and then write whatever you want.

You could define the names as Orders..ALIAS..First and Orders..ALIAS.._Second.

Alias are always defined at the end, and everything after the ..ALIAS.. word is ignored. So if you want to define say a fixed name, it would be defined as Orders__FIXED..ALIAS..MyOrders, and not as __Orders..ALIAS..MyOrdersFIXED.

Note

Alias just allow you to define different named ranges in Excel pointing to the same dataset by writing arbitrary text after the name. They don't change the name of the dataset, and in the example above, you would still write <#Orders.Name> in the template, not <#First.Name>.

Note

When this feature was introduced in FlexCel 7.1, it used a different syntax: You would write something like "__MyOrders__Alias_MyAlias". The problem with this syntax is that you couldn't define something like __MyOrders__XAlias_MyAlias, since the "X" wouldn't be separated from the "Alias" definition.

To make it simpler, we changed the alias to use 2 dots (..) before and after the name. The old syntax still works for simple cases, but it is deprecated. We encourage you to use the new syntax for new developments.

Excel-Table Bands

Besides using names for the bands, FlexCel also allows the use of Excel tables as bands. To use an Excel table as a band, you need to follow the steps in this image:

excel table band 1

  1. Insert a table with two data rows. You need an extra empty row after the row with the data so when the report runs the table will grow with the inserted records. Bands defined from tables behave like X Ranges and they erase the empty row after the report is completed.

  2. With the cursor inside a cell of the table, go to the "Design" tab to edit the name of the table.

  3. Name the table "__Data__" as you would with any other "__" name. You can also name it as "_Data_" and FlexCel will not copy the full rows, just as it does with "_Names_". "I_" and "II_" names are allowed too but make no sense in tables, since tables are always organized to have the data in rows and the columns to hold different fields. You might also name the table "__Data__X" but as explained in point 1. table datasources are always "X" so there is no need to write the extra "X" at the end.

Excel-Table bands are exactly the same as an "X" named-range band defined over the data part of the table, so everything you can do with name bands you can do also with table bands. You can for example store a table inside a name to create a master-detail report, or anything you can do with normal name bands.

Customizing Excel-Table Bands

There are two configuration options that apply to Excel-Table bands:

  1. To make FlexCel completely ignore table bands, you can set the property FlexCelReport.UseExcelTablesAsBands to false. If you turn off this property you won't lose any functionality, but you will have to design the report with __Named_Ranges__ instead.

  2. Table bands will normally rename themselves by removing the "__" part of the name. If your template table is named "__Customer__" the table in the result file will be named "Customer". To avoid this behavior you can change the property FlexCelReport.RenameExcelTablesUsedAsBands to false

There is a working example on reports using tables at the demo Tables As Datasources

Balanced Columns

Sometimes you might want to create a report that once generated looks like the following:

balanced bands 1

But if you try to do this by creating a _Block1_ and _Block2_ parallel ranges, you will actually end up with something like this:

balanced bands 2

Because when _Block1_ and _Block2_ grow down, the cells are inserted only in the columns that are used by those ranges.

But there is a case where FlexCel doesn’t work this way, and that is in master-detail. When you are doing a detail, cells are inserted in all the columns so they end at the same place, and the next master record won’t be broken. So the solution in this case is to create a dummy “master” dataset with a single row, and use it as a master for both _Block1_ and _Block2_ ranges.

The last cell in every column of the “master” dataset will be copied down so all columns inside the master insert the same number of cells.

You can use the “ROWS” function in the config sheet to create a single row datasource.

Please take a look at the Balanced Columns demo for more information on how this is done.

Intelligent Page Breaks

Other kinds of ranges you might want to create are “KeepTogether” ranges.

FlexCel will try to keep rows or columns on those ranges together when printing by inserting page breaks at the needed places.

To create a “Row” KeepTogether range, you need to name it:

KEEPROWS_<Level>_<Whatever>

Where <Level> is the level of “keep together” of the group, and “Whatever” is anything, you can use it to have more than one “keeptogether” range in the same sheet.

For example, you might have the ranges:

KeepRows_1_customers

and

KeepRows_1_orders

in the same sheet, to tell FlexCel to group the rows in both ranges together when printing. You might also have different levels of “Keep together”, and you will normally use higher levels for details in master-detail reports.

Once you have created the ranges, you need to write an <#auto page breaks> tag somewhere in the sheet, and FlexCel will add page breaks when it ends the report trying to keep those ranges together. You can customize the <#auto page breaks> to influence the way page breaks are created.

We are not covering in detail Intelligent page breaks here, since they are described in the API guide, and it makes no sense to repeat that information here. We only cover here what is different for reports, and this is the “KeepTogether” ranges.

Make sure you read the section Preparing for Printing in the API guide, since most of the concepts apply also to reports. And of course take a look at the Intelligent Page Breaks in Reports demo.

Intelligent Page Breaks in Included Reports

You can use intelligent page breaks inside an <#included> report, but you must be aware of some differences.

The most important difference is that the final pagination must be done in the master report, not in the included one. Let's look at an example:

included page breaks

In this example, we can have “KeepRows_” and “KeepColumns_” ranges in the included report, but we should not create the actual page breaks in it. If we did it, those page breaks would be in the wrong position when inserted in the master. (unless the report is included at cell A1). As you can see in the drawing, the included report is copied into the master at a lower location. So if the report goes down, the page breaks will go down too, ending up in the wrong places. Excel needs to insert its own page break (marked with a red dotted line) in order to have the master page no bigger than the paper size, and the old page break will create a small page that we don't want.

So, in order to have intelligent page breaks in the included report, you must follow the next simple rules:

  • Create the “KeepRows_” and “KeepColumns_” ranges in the included report, as you would normally do it.

  • Do not write an <#auto page breaks> tag in the included report. This will ensure FlexCel does not add the page breaks in the included report before copying it to the master.

  • Make sure you include full rows (by using “__” or “II_” as parameter in the include tag). This way, the KeepRows and KeepColumns ranges will be copied to the master.

  • Write an <auto page breaks> tag into the master. This way, when the master report is finished, FlexCel will paginate the master, keeping together the rows you marked in the included report. Pagination must be done on the master, never in the included report.

Creating charts with dynamic series

Series and data points

When dealing with charts, a rule of thumb is that you want as few series as possible. That's what Excel does when you select a range of cells and create a chart from it. So, for example, if we have the following table with four rows and two columns, Excel will use the columns to define the series.

swap series chart

As you can see in the image, only one series was created, which goes from B2 to B5. If we added 100 extra rows to this table, the chart would still be a single series going from B2 to B105.

That makes sense, and you usually want the smaller dimension to have the series. So, for example, if the report had more columns than rows, you would like to have the series by rows, not by columns. But that's not always the case, and Excel provides a handy button: "Switch Row/Column" that you can use to decide if you want the series using the rows or the columns.

swap series button before

If you press that button, you will get the following:

swap series button after

Now you have four series and one data point instead of one series and four data points.

Series in reports

When doing a report that has charts, the typical case works just fine. Your series are in columns, like in the first image, and data points grow down as you insert records. So, for example, if the chart in your template had two series with two data points, and you insert 100 records, you will end up with two series and 102 data points.

But what if you wanted the series in rows? You should end up with 100 series and 2 data points. But that's not how inserting rows work in Excel. When you insert rows in the chart, and you have each series in a row, you will end up with a series at the first row, then a lot of ignored rows, then series at the end:

swap series inserted series

Here, you can see that even as we inserted rows between "Microwave" and "Computer", we still have only four series. And we can check it out by looking at the ranges:

swap series inserted series ranges

As you can see at the top, the single range was split in two: One taking $A$2:$B$3 and the other taking A$9:$B$10. So we still have four series, and this is not what we wanted. We wanted to have nine series now.

As reports work by inserting rows, you will have the same problem here if you try to do one. So how do we create a report where each inserted row is a new series?

The <#swap series> tag

The "swap series" tag behaves a little like the "Switch Row/Column" button at the top of this section. It will run after the full report is completed, and if your chart has the series in columns, it will swap them to be in rows. If they are in rows, they will switch to columns.

Important

Usually, you don't want to use the "swap series" tag. We provide them for the exceptional cases where you want the series in rows instead of in columns as it would be expected.

Also, note that the maximum number of series in a chart is 255, so you can't do a chart with many rows and one series per row.

We provide this long explanation for a tag you will likely never use just because the topic is complex, and we want it to be well documented in case you need it. But don't assume that because the functionality exists, you have to use it!

To create a chart that has one series per row, you need to follow the steps:

Create a chart that has one series per column. If it is a chart sheet, name the sheet with some name, and append <#swap series> string at the end of the sheet name. If it is an embedded chart, name the chart as you wish, and append <#swap series> at the end of the chart name.

Note

To name a chart object, select it, then type its name in the "Name box": swap series name chart

When the report runs, it will create a "standard" chart with series in columns, but after it ends, the tag will recreate the series using one row per series. If this was a range expanding to the right instead of down, everything applies but reversed: You would create a standard chart with series in rows, and then "swap series" would swap the series to be in columns.

See the example Charts With Dynamic Series to see how it works.

A deeper explanation of <#Swap series>

The <#Swap series> concept is simple: If you have your series in columns (which you need so the ranges expand down when inserting rows), it will switch them to rows. But in this section, we will dig deeper into what that really means.

When you select a range and create a chart, Excel decides where to apply the range parts depending on your data. If the range has more rows than columns, it will put the series in the columns. Otherwise, it will use the rows.

For a chart with series in rows, if the first row has strings, but the other rows have numbers, it will use that first row for the x-axis. The other rows will have one series each. If the chart is X-Y scatter, it will use the first row for the x-axis, and each of the remaining rows will hold a series.

swap series xaxis

Again for a chart with series in rows, if the first column has strings, it will use it for the series name.

swap series name and series

Everything applies mirrored for a chart with series in columns.

Putting it all together, you have the following:

swap series all

Note that whether you have strings or numbers in the first row and column determines if there is a series name or an x-axis. If all the cells had numbers, the series name and x-axis would be empty, and the full range would be used for the series values.

The exact algorithm used by Excel can vary and could change in new Excel releases. So the algorithm FlexCel uses in <#swap series> is simpler: Swap series won't try to guess how to use the range from the data at all. Instead, it will use whatever you used in the original chart.

So, if you want to use the chart range only to fill the series, leave the x-axis and series name empty in the original chart in the template. FlexCel will then use the full range for the data points. If you set any value in the x-axis, FlexCel will use the first row for the x-axis. If you set the series name in the template, FlexCel will use the first column for the series name. FlexCel will never try to guess what to do depending on the data types of the first row or column.

Note

Remember that when setting the data for a <#Swap series> chart, you will set the series in columns, so if there is an x-axis, it will be the first column. But when <#swap series> changes the series to be in rows, it will use the first row for the x-axis.

Don't worry about the switch between rows and columns: If you want an x-axis, you need to set a column for the x-axis in the template, even if it will be a row in the final result. The same applies to the series name but reversing rows and columns.

Configuration Sheet

The configuration sheet is a repository where you can configure different things on your report, define commonly used expressions and so on. It is not required, you can create a report without a configuration sheet, but it is recommended that you have one except for very simple reports.

Once the report is run, the configuration sheet will be deleted.

Note

If there are any macros assigned to the configuration sheet, FlexCel will be unable to delete it and will just clear and “Very hide” the sheet. (Very hidden sheets are similar to hidden sheets but the user needs to write a macro to see them, they are not listed when you select to unhide a sheet from Excel). If you get a macro by mistake on the config sheet and you are unable to delete it in Excel, use the “MacroCleaner” tool included in the “Tools” folder.

The layout of the config sheet is free as long as you keep the positions, you can write the captions you want or change any format you need. Just one advice: keep it simple. The config sheet will be deleted from the final report, so the final user won't see it. And deleting a sheet with comments, images formulas and so on is slower than deleting a simple sheet.

An example of a config sheet is shown here:

We can note that:

  1. For a sheet to be the configuration sheet it must be named “<#Config>” or any expression that evaluates to the string “<#Config>”. You could conditionally make a sheet the configuration sheet depending on some parameter.

  2. Cells A10 to C10 and all rows below (A11:C11... etc) are used to define new custom tables. You use a master table defined by the application (B10), and define a new name for it (A10). Then you can write a filter (Look at the “Filtering Data” section in this document). And also sort the table by some columns. Different search columns are separated by “,”, and you can also define an “ASC(ending)” or “DESC(ending)” order. For example: “State, ZipCode DESC” Again, any Sort expression valid for a DataView is valid here. In some places you can use tags. For example, if you write on C10 “<#mytag>” instead of “ProductId=7” the value of mytag will be used as a filter.

  3. You can leave empty rows. For example, you can define a new table on row 10 and another on row 12 without writing anything on row 11. This allows you to better separate your tables.

  4. On columns H and I you define custom formats. The name of the format goes on column H, and the definition on column I. Then you can use those cell formats on <#format> tags.

  5. You can write whatever you want on column I, the text is not important and you can use it to know how the format will look like.

  6. Column K is used to list the report variables. It is not used at all by FlexCel and you don't really need to fill it, but it is used by FlexCel designer to list the available report variables. If you do not write them here, FlexCel designer will not show them.

  7. Columns M and N are probably the most important on the config sheet and are used to create reusable expressions.

About Expressions

It is recommended that whenever you have complex chains of tags, instead of writing them directly on the cell, you create an expression and then refer to it.

On the screenshot, we defined a <#order> tag that itself calls other report expressions to calculate its value. Then, if you want to write the result of order on cell A1, instead of writing the full chain of tags, you just write <#order> On some places, like for example the name of the sheet or an image name this might be the only choice, as the name length is limited to 32 characters. You can use also parameters on Expressions, and for Example define <#order(row)> For more details on how to do this, see the Expression parameters demo.

Defining Custom Formats

Custom formats are normally straightforward to use.

For example, you might format I10 with a blue background, name it “Header” in cell H10, and then use the format inside a <#format cell(Header)> in the template. But this will apply the full format in cell H10 to the new cell. This means that besides the blue background, all other properties will be copied too. The new cell will also have the same font, same alignment, same numeric format than H10.

Now let's imagine we have a full row that we want to be blue if some condition applies. If we write <#format row(header)> in a cell on the template, then all other attributes besides the background will be applied to the row. This might mean that all the cells will be aligned to the left (if cell I10 was aligned to the left), and this is not what we want. We want to apply only the background color on I10, keeping everything else as it is defined on the template.

To do this, you can define partial formats. You define a partial format by adding one or more attributes to the name of the format. For example, if you name the format Header(background;font.color) only the font color and the background color of cell I10 will be applied, not the full format.

You can add as many properties as you want to be applied for the format separating them by semicolons (“;”). Also, you can use negative properties by preceding them with a “-” sign. For example, the following definition: Header(All; -Border; -Font) will apply all attributes in cell I10 except the border and the font.

The list of properties you can write in a cell is the following:

Name | Description
All Applies the all the formats in the cell. Defining a format named “header” is the same as defining one named “header(All)”. <br/ >
You will normally use the All format when excluding formats. For example, “header(All, -Border)” will apply all the formats except the border. <br/ >
“header(-Border)” would not apply any format.
Border | Applies the four borders. “header(Border)” is the same as “header(Border.Left;Border.Right;Border.Top;Border.Bottom)”
Border.Left | Applies the left border.
Border.Right | Applies the Right border.
Border.Top | Applies the Top border.
Border.Bottom | Applies the Bottom border.
Border.Exterior This is a special setting, used to apply the borders only on the outer bounds of the range. For example, if fmt is defined as “fmt(border; border.exterior)”, and you write <#format range(a1:c5;fmt)> then the top row of the range (row 1) will be formatted with the top border format of the cell, the left column or the range (column a) will be formatted with the left border format of the cell, and so on. Inner cells in the a1:a5 range will not have any border applied. <br/ >
This tag alone has no effect; you always need to use it together with other border tags. For example “fmt(border.exterior)” will not do anything, you need to write “fmt(border; border.exterior)”, “fmt(border.top; border.bottom; border.exterior)” or something similar.

Other properties (like background) are not affected by border.exterior, they will still apply to the whole range.

Note that this tag only applies to the <#format range> tag. It makes no sense in <#format cell>, and you cannot use it in <#format row/column> since format for columns and rows does not support this.
Font | Applies all the font properties. “header(Font)” is the same as “header(Font.Family;Font.Size;Font.Color;Font.Style;Font.Underline)”
Font.Family | Applies the font name.
Font.Size | Applies the font size.
Font.Color | Applies the font color.
Font.Style | Applies the font style (bold and italics) Underline is not included in Font.Style.
Font.Underline | Applies the underline.
NumericFormat | Applies the numeric format of the cell.
Background | Applies the background color of the cell. “header(Background)” is the same as “header(Background.Pattern;Background.Color)”
Background.Pattern | Applies the fill pattern for the cell.
Background.Color | Applies the fill color for the cell.
TextAlign | Applies the horizontal and vertical alignment in the cell. “header(TextAlign)” is the same as “header(TextAlign.Horiz;TextAlign.Vert)”
TextAlign.Horiz | Applies the horizontal alignment in the cell.
TextAlign.Vert | Applies the vertical alignment in the cell.
Locked | Applies the “Locked” attribute in the cell.
Hidden | Applies the “Hidden” attribute in the cell.
TextWrap | Applies the Word Wrap setting for the cell.
ShrinkToFit | Applies the Shrink to fit setting.
Rotation | Applies the Rotation.
TextIndent | Applies the indent.
Important

You need to specify what the format applies to in the format definition, but not when calling the format. You might define a format as header(border), but you need to call it with <#Format Cell(header)>, not <#Format Cell(header(border))> The second way will not work.

With partial formats you can apply the different formats as “layers” in your document, one independent from the other. You can apply as many <#format cell> and <#format range> tags as you want in a cell, as long as the applied formats are different all of them will be applied.

Warning

A last word of caution: As powerful as custom formats are, remember that they are only useful if you want to conditionally format cells. If the format is static, just format the cell as you want it. We have seen too many customers “over-engineering” reports with lots of format cell tags, when the simplest solution would be to format the cells directly in the template with Excel and not use any tag.

Also remember that you can use Excel's conditional formatting in almost every case you could need custom formats. But Excel's conditional formats are much simpler to use an maintain. So for example, if you wanted to paint a cell red when it is bigger than 100, you could define a custom format Warning(Background) and then use a <#if(<#cell> > 100;<#format cell(Warning)>)> or you could just set a conditional format in the cell in the template making it red when it is bigger than 100.

FlexCel fully supports Excel conditional formatting, and you should always prefer to use that if possible.

You can see an example of how to use custom formats to have alternating rows in the Multiple Sheet Report demo.

Note

As an alternative to defining the formats in the config sheet, you could also define them as User Defined Formats and add them with FlexCelReport.SetUserFormat. For an example of using user defined formats, look at the User Defined Formats demo.

Filtering Data

You can filter the data you are going to use directly in the template by writing a filter in the config sheet:

config sheet filter

Here you must be aware that generally filtering is done locally: that is, we fetch the full table from the database, and then apply the filter to discard the unwanted data. This makes Filters inefficient except for small tables. In general, you will want to filter in the SQL, not in the config filter column as a way to avoid fetching all records from the database. But sometimes when you can’t modify the data, and there aren’t too many rows, filtering in the config sheet can be an option.

Note

When using LINQ to SQL as datasources then filtering is done in the server, not in the client. The data fetched from the server will only be the data we need, not the full dataset. This is because LINQ delays sending the SQL to the server to after the filters have been applied, and so it sends the correct filtered SQL.

This makes filtering with LINQ to SQL very efficient, and not different from filtering directly in the server by changing the SQL.

Filter Syntax

The exact syntax of the expression you have to write in the “Filter” cell depends on the technology you are using:

  1. DataSets: You can write any filter expression available on a DataView, for more info search at the DataView.Filter documentation on the .NET framework documentation.

  2. LINQ: When using LINQ, FlexCel provides two different syntaxes for the filters:

    • Simple built-in parser: By default, any expression you write in the “filter” cell will be parsed by a simple built-in parser in FlexCel. The syntax of the built-in parser is described in the section Built-in parser syntax below.

    • Linq “Where” filter: If you are using Entity Framework or any other technology that includes “Where(string)” extension methods that allow sending direct SQL “where” strings to the server, you can write those strings in the filter, by adding an “@” before the string. For example: “@it.Field1 like '%test%'” When using this filter style, you need to prefix all fields with the table name. By default, Entity Framework uses “it” for all table names, and that’s why we used “it.Field1” in the example.

Built-in parser syntax.

The filter expression consists of operators, tokens and functions.

  • The operators you can use in a simple filter are, by order of precedence (lower to greater):

    • “AND”, “OR”: As in “Field > 1 AND Field < 2”

    • “<”, “>”, “<=”, “>=”, “<>”, “=”: As in “Field = 1”

    • “NOT”: As in “NOT (Field = 3)”

    • “+” , “-”: As in “Field1 + 1 = Field2 – 1”

    • “*”, “/”: As in “Field1 / 2 = Field2 * 2”

    • “(”, “)”: As in “(Field1 + 1) * 2 = 4”

  • The allowed Tokens are:

    • FieldName, or [Field Name]: Use the square brackets when there are spaces in the name.

    • ‘Strings’: Use single quotes for strings. To enter a single quote inside the string, repeat it twice, as in “Field1 = 'I''am me'”

    • Numbers: You should use “.” for floating point numbers, no matter what your locale is. For example: “Field1 >= 1.5”

    • SQL92 Date Literals: You can use either DATE 'yyyy-MM-dd', TIME 'HH:mm:ss', TIMESTAMP 'yyyy-MM-dd HH:mm:ss'. For example, Birthday = DATE '1972-09-08'

    • OLE Date Literals: Ole date literals use the syntax: {d 'yyyy-MM-dd'}, {t 'HH:mm:ss'}, {ts 'yyyy-MM-dd HH:mm:ss'}. For example, Birthday = {d '1972-09-08'}

    • Booleans: You can use the constants “true” and “false”, as in “Married = true”

    • null: This is used for null values, and it uses the .NET definition of a null (where null == null), not the SQL definition (where null <> null). This means that different from SQL, you can use this filter: “Field <> null” and it will work as expected.

  • The allowed Functions are:

    • ISNULL: Returns true if a field is null, and in this implementation it is similar to comparing the field to null. IsNull(field1) is the same as field1 = null

    • YEAR: Returns the year of a date. For example you could have a filter: Year(field1) = 1999

    • MONTH: Month from a date.

    • DAY: Day from a date.

    • STREQUALS: Syntax is StrEquals(str1, str2, ignorecase) or StrEquals(str1, str2, samecase). Returns true if both str1 and str2 are the same.

Relating Tables in the Template

Data Relationships are typically defined in code, but FlexCel also allows to define them in the template. You use the filter section of the config sheet to do that:

data relationships template

  • In column A (Table Name), you have to write the word "RELATIONSHIP". The case is unimportant, but we use a convention of all upper-case.

  • In column B (Source Name), you write the Master and the Detail tables that form the relationship, separating them with an arrow. The Master goes first, then the arrow, and finally the Detail: ** Master -> Detail**.

  • In column C (Filter), you write the fields in the Master that relate to the fields in the Detail. If there is a single field that relates the Master and the Detail (the most common case), you would just write MasterField->DetailField. If there are multiple fields in the relation, you separate each with a semicolon: MasterField1->DetailField1;MasterField2->DetailField2

The example Master detail on one table.

Grouping Tables

Sometimes you might have the data for a master-detail report into one table, and you want to create two different tables based on the value of a key field.

You can use the DISTINCT filter on the config sheet together with the RELATIONSHIP tag to get this effect. Look at the Master detail on one table demo for more information on how this is done.

Note

Whenever possible, do not use this grouping as the normal way to get data. While it simplifies the data layer, it also fetches a lot of repeated information from the database.

For example: If you

select * from table1 join table2 on (table1.key = table2.key)

you will get results like this:

key | field-from-table1 | field-from-table2 | field-from-table2
table1.value1 | table1.value2 | table2.value1 | table2.value2
table1.value1 | table1.value2 | table2.value3 | table2.value4
table1.value1 | table1.value2 | table2.value5 | table2.value6

In this simple case, you fetched 12 values from the database. If you had made 2 different selects, you would have fetched only 8 values (table1.value1 and table1.value2 for the first table, and table2.valueN for the second). Depending on the amount of data, there might be a lot of repeated fields on the join.

Splitting Tables

The same way sometimes you might want to group tables, other times you might want to split them into groups of n records. For example, you might want to create a 5 column report, and you need to split the master dataset into groups of 5 records in order to fill the columns.

This is where the Split(source, number of records) tag can be useful. In short, you write this tag on the “Source Name” column in the config sheet, specifying the table to split on the “source” parameter, and how many records you want on each group on the “number of records” parameter. This will create a new table that you will name on the “Table Name” column of the config sheet. You can then use this new table as the master on a master-detail relationship with the original table. The generated master has no columns, but you can use the pseudocolumns (#RowPos or #RowCount) just fine. Each record of the master is related to “number of records” records on the detail.

Note that the generated master table is a “pseudo table” n the sense that it has no columns or data, but it has (DetailRecords.Count – 1) / NumberOfRecords + 1 rows. Also the relationship between the master and the detail is not on real columns, since there are no columns on the master. This creates a limitation on how you can use those tables, and it is that the master should have the detail as a direct child. You cannot have other __ range__ between them, or FlexCel will complain.

Take a look at the Split Datasets demo for more information.

Retrieving TOP N Records from a table

You normally should filter the data when retrieving it from the database (for example with the SQL “Select top 10 * from customers”). But if this is not possible, you can use the Top(source; number of records) tag to filter this from the template.

Warning

Be careful with this tag. If your table has 10,000 records and you only need 10, fetching them all from the db in order to use only 10 is not a smart idea. Take a look at the Fixed Forms With Datasets demo for more information.

Ensuring a table has at least N records.

Sometimes you want to ensure that at least one record of a table exists, and if it doesn’t, provide a default value for the missing fields.

You might do this with the AtLeast(source; minimum number of records; [default value]; [multiple of]) tag. In a way, this is the opposite of the TOP(…) tag discussed above.

For example, you might define the following in the config sheet:

In this example, the table detail_1 will have at least 1 record. If detail is empty, as we didn’t specify a default value, it will return a record with all null values. The table detail_5 will have at least 5 records, and if detail has less, all records after the detail record count will return "---" in all their fields.

Note

You can’t specify a default value for every field; it will be the same for all of them. But you can use some <#if(detail_5.field="---";something;else)> tag in the template to provide different values.

Ensuring the record count in a table is a multiple of a value.

There might be cases where you want to ensure that a dataset has for example 20 records, or 40 or 60, etc. This way, you can ensure that all pages in a master-detail report have the same number of rows. You can achieve this using the AtLeast(source; minimum number of records; [default value]; [multiple of]) tag, and specifying the number in the "multiple of" parameter.

There is an example of this use at the Fixed Footer demo

Creating empty datasets with N rows.

Sometimes you might need a simple table with no columns and one or more rows to use as datasource of the report. For example, if you want to repeat a range n times, you could create an empty dataset with 3 rows, and put the range inside a __dataset__ name. You can do that directly from the config sheet, by defining a datasource to be ROWS(N). A dataset with a single row could be defined in the config sheet as Dual = Rows(1). For an example on how this is done, please look at the Balanced Columns demo, the table “master” in the config sheet.

Joining Tables

When you have a “full row” report like the one in the image below, we insert a row for each record in the table.

report joining tables 1

As you would expect, if you have a merged cell (in green) below the range being inserted (in blue), the merged cell will move down too:

report joining tables 2

And the same will happens with ranges of cells like Print_Area or others. We are inserting full rows, so everything moves down.

But now, let’s imagine we have 2 independent ranges we want to grow in parallel. We can do it with “-“ ranges instead of “__” ranges:

report joining tables 3

In this case, when the blue range runs, the cells will only be inserted in columns A and B.

report joining tables 4

But as a side effect of this, the merged cell will be broken (as you can see in the image above). After the blue range runs, the orange range will run and the cells will move down in column C too:

report joining tables 5

And now the merged cell is all green again (as expected), but it isn’t a full merged cell anymore: It is a merged cell in A:B and a different cell in C. Something similar happens with names, when the blue band grows it can’t grow a name which goes from column A to C, because not all cells in that range have moved. And when the orange range grows, the name can’t grow either since now columns A and B aren’t moving.

There is no real solution to this: Due to the order the bands run, having two parallel _ ranges isn’t the same of one big __ range. Merged cells might break and ranges might not update if they span over the two _ ranges running.

One solution is of course not to put any merged cell below the _ ranges which are not fully inside the columns of one of the _ ranges. And do the same with names.

But there is another solution, which is to “Join” the datasets inside “some range” and “some other range” so they form a bigger dataset with the columns of both, and then run a single full row report in the bigger range.

Say for example that you want to run two parallel reports on the tables:

Customer

Name | CustomerID
... | ...

And

Employee

Name | EmployeeID
... | ...

In the config sheet, you could define a new table “CustomerAndEmployee” as JOIN(Customer;Employee)

This will define a new table with 4 columns:

CustomerAndEmployee

Customer.Name | Customer.CustomerID | Employee.Name | Employee.EmployeeID
... | ... | ... | ...

And you can use this new CustomerAndEmployee table to run the report.

Things to note:

  1. The table “CustomerAndEmployee” has as many rows as the maximum of “Customer” and “Employee”. Say for example that you have 3 customers and 5 employees, then CustomerAndEmployee will have 5 records. The last 2 records of CustomerAndEmployee will have Customer.Name and Customer.CustomerID null.

  2. If “Customer” and “Employee” have columns with the same name, you will need to prefix them with the table name in order to show them. In our example, both Customer and Employee have a “Name” column. So you can’t just write “<#CustomerAndEmployee.Name> inside a cell, because you wouldn’t know which Name it is referring to (Customer.Name or Employee.Name). For this case, you need to write <#CustomerAndEmployee.Customer.Name> and <#CustomerAndEmployee.Employee.Name>

  3. Even if the prefix is only necessary for the case when there are repeated columns, it might be good practice to always prefix the table names in joined tables. This way you know you are always accessing the right column at the right table.

  4. JOIN joins unrelated tables adding the columns of each one after the other, but it doesn’t do any master-detail or relationships. It will just show record1 or table1 together with record1 of table2, and record2 of table1 with record2 of table2 and so on. When one of the tables runs out of records, the next records for the columns in that table will be null.

  5. While this command doesn’t use any extra memory (joined tables aren’t copied in memory) and has no performance penalty, if you are doing SQL it will be simpler to just use SQL to construct the joined table.

Union of Tables

While “JOIN” in the section above creates a table with the columns of a list of datasets, UNION creates a table with the rows of a list of datasets. It works in a similar way as the union command in SQL.

In general union is not really needed: You could just write the 2 ranges one after the other for the two tables. But conceptually, sometimes it feels better to join the data of similar tables into a big one and have a single named range for that table.

Note

The “Union” table will have all the columns of all the tables used to create it. Normally you will use tables with the same columns, but if a column is present in one table but not in another, union will show the values of the column for the table that has it, and null for the other.

You can look at the “Join and Union” example for an example on how to use JOIN and UNION tags.

Direct SQL in templates

Depending on your needs, you might want to write SQL commands directly on the templates and avoid having a Data module on your code. This allows the users to modify the data they need by modifying the xls file, and without recompiling the executable.

Important

Be aware that allowing your users to directly write the SQL commands can mean a big security risk.

For example, a user could use the connection you give him to execute the SQL: “drop table users” instead of a normal select. While FlexCel does a little validation on the SQL written by the user (for example, it cannot contain “;” or “--”, it has to start with “Select” etc) SQL is a very powerful language and there can always be a way to execute a command on the server. And, even if the user does not manage to execute a command, he might always do a “Select user, password from users” or similar command, and get dbadmin access to the database.

You must supply a readonly connection, and with rights limited to the tables you want the user to see.

The steps for allowing Direct SQL on the templates are:

  1. Provide a connection to the report, by using FlexCelReport.AddConnection()

  2. On the config sheet, “Source Name” column, add a string like “SQL(Select * from clients”). Give this table a name, and you can use it as any other table on the report.

Note that also for security reasons, you can't replace expressions inside the SQL string. For example, you can't write “SQL(select * from customers where cust_id = <#custId>)” This would open another security hole and allow for SQL injection attacks.

SQL Parameters

You need to specify database parameters to be able to actually pass information to the SQL.

.NET can use both positional (“?”) and named (“@name” or “:name”) parameters, and some data providers will accept one or the other. As we want to keep the template database independent (so you can replace the db backend without changing templates) all parameters on the template are named with a preceding “@” (“@name”). When using a db that needs positional parameters (like ADODB) or has another syntax for named parameters (like Oracle that uses “:name”) the SQL will be automatically converted by FlexCel into the needed one before sending it to the db. FlexCel includes support for the most common cases, and when it does not know which db it is, it will “guess” that the db uses named “@” parameters.

When you use a db FlexCel does not recognize, you need to let FlexCel know which kind of parameters your db needs.

For this you use the SqlParameterReplace and SqlParametersType properties on FlexCelReport.

You can see a demo on how to do it on the Direct SQL example; more information is also available there.

User Tables defined on the Template

Sometimes Direct SQL is not an option, because you have your own data layer that you want to use, or because it is too big a security risk to let your users run arbitrary SQL commands. But you would like the advantages of Direct SQL. That is, to specify the data directly on the template, so everything is self-contained on the template file and you can change your reports without recompiling the application.

You can use the USER TABLE(Params) tag to achieve this.

User table(Params) is a very simple tag, but it allows a lot of things. You write it on the Source Table column in the config sheet, and you can add an additional parameter on the Table Name column. You can leave the “Sort” and “Filter” columns empty or with values, their values do not matter.

For every “User Table(Params)” on the template, the event UserTable will be called on the report. Anything you write in “Params” will be passed as arguments to the event, without any further processing by FlexCel. Also, the value you write on the Table Name column will be passed to the event. You will normally want to use this second parameter to tell FlexCel how you want to name the table you are creating. Note that the name you write on the “Table name” column is not guaranteed to be created; this all depends on what you write on the event handler. Also, note that you must write something on the tablename column even if you will not use it on the event, or the row will be ignored.

So, how do you use it? Imagine you write a tag: User Table(CUSTOMER), and define the event UserTable so each time it gets the parameter “Customer” it loads the customer table from the database and adds it to the report. This way you are actually telling FlexCel which tables it needs to use on the template, allowing you to add new ones (from a list of available tables on the application) or remove existing tables without changing the code.

Another way to use this tag could be if you have your own API to access the database, with your defined commands, permissions and validations. You could pass the API command as a parameter on the <#User Table> tag, and use this parameter inside the event to execute the API and add the generated table to the report. You would write something like <#User Table(get table customer on customerId < 100)> on the template, and on the UserTable event on the report, execute the parameter against your API, and add the resulting dataset.

Warning

When using the “User table” tag to pass arbitrary API commands to the application, please remember to validate permissions on the UserTable event to see if the user is allowed or not to run the query. Forgetting to do so could generate a big security hole on your application, the same way as the SQL tag could.

For more information on this tag, see the User Tables demo.

Debugging Reports

Introduction

Whenever you hit enough complexity in your reports, you will get expressions that do not behave as you expect, and you will need tools to investigate what is really happening under the hood. This chapter speaks about those tools.

FlexCel Reports are declarative instead of imperative. This means you describe what you want using report tags, but you do not write code to tell the computer how to do it. In a way, FlexCel Reports are similar to SQL, and different from normal code.

An “imperative” report could be done with XlsFile, with some code like this:

    XlsFile xls = new XlsFile();
    xls.NewFile();
    xls.SetCellValue(1, 1, "Table");
    if (Table["field"] == null) xls.SetCellValue(1, 1, "error"); else xls.SetCellValue(1, 1, Table["field"]);

A “declarative” report would be a template with the text “Table” in cell A1 and the tag

<#if(Table.field =;error;<#Table.field>)>

in cell A2.

Declarative reports can sometimes be more “resistant” to bugs because they are simpler and so it is easier to see what is wrong. But on the other hand, they are also more difficult to debug when there is a bug, because there is no code you can step into with a debugger.

In the XlsFile example above, you could set a breakpoint in the last line and evaluate the values of the variables before execution. In the FlexCel Report there is no way to set a breakpoint, since there is no code to execute. But you can still find out what is going on, and this is what we will explain here.

There are two main causes of errors in FlexCel reports; syntax errors and logical errors. They are covered below.

Dealing with Syntax Errors

Those are the easiest to deal with. The same way a “Code” report will not compile if there is a syntax error, a FlexCel report will raise an Exception when “compiling” the template if it finds anything it cannot understand. The error message will normally tell you what is happening and where, and there should be no big problem in fixing it.

If for example you write “<#tag” in a cell, you will get an error telling you that there is a closing tag “>” marker missing.

Note

When dealing with syntax errors, FlexCel leans over the "pedantic" side. This means that it will not let pass anything that is ambiguous or not syntactically correct and report every little error.

We believe that by checking the errors when compiling the templates as much as possible, we minimize the runtime errors that are harder to catch and can have worse consequences.

We also made a big effort to try to have all error messages as helpful as possible: For example instead of a generic invalid parameter error, you should get a longer sentence indicating what parameter is invalid and why.

But this is not always possible. Sometimes FlexCel just forwards the error of a lower layer, and if the lower layer doesn't provide more information, neither can FlexCel. In this particular example, some ADO database providers might return invalid parameter when they fail to establish a connection, and in this case FlexCel will just forward that exception to you.

Now, in some situations it might be useful to see all syntax errors at once, and for this FlexCel offers a “ErrorsInResultFile” mode. In this mode, all errors related to tags will be written to the cell where the tag is, instead of raising exceptions, and the report will continue to generate. Errors will have a yellow background and red text.

So if you have the template:

errors in result file template

And "Invallid" is not defined, then instead of an exception when running the report it will complete successfully. In the result file you will see:

errors in result file result

This mode does not cover all errors (for example a named range for a non-existing table will still raise an error), but it covers the most common issues. The others still need to raise an exception, since if for example you have a range named “__table__” and no “Table” in the report, there is no place where FlexCel could write this error inside the xls file. The error must be in a cell for this mode to work.

There are two ways to enter ErrorsInResultFile mode. The first one is to change it in the code before running the report, by changing the FlexCelReport.ErrorsInResultFile property in FlexCelReport.

For example:

    using (FlexCelReport report = new FlexCelReport())
    {
        report.ErrorsInResultFile = true;
        report.Run("template_file.xlsx", "result_file.xlsx");
    }

The second way is to write it directly in the template, inside the config sheet.

For example:

errors in result file config

The <#ErrorsInResultFile> tag can be anywhere in the Expressions column, and you do not need to write anything in the Expression definition.

This second way to enter ErrorsInResultFile mode is better when you are editing a template and want to do a debug without modifying the code, while the first way is better if you are automating testing and do not want to modify the templates.

Warning

Remember that this mode is a debugging mode, and you should turn it off for production. You do not want to ship a file containing error messages in cells to your customers.

Dealing with Logical Errors:

These kinds of errors are harder to deal with, are more subtle, and can pass without notice since they do not raise any error on FlexCel side.

For example, imagine that you have this expression:

<#if(<#tagval>=<#refval>;OK;Error)>

This is a valid tag, and the report will compile and run without issues. Let's imagine now that tagval is the number 1, and refval is “l” (lowercase L). So, when tagval is 1, the condition will evaluate to false, and you will get the “Error” label instead of “OK”.

With this font in particular this can be a hard to spot problem, because as we said before, you cannot really put a breakpoint in the expression and see what is inside tagval or refval.

Here is where the “Debug” mode can help.

As with the “ErrorsInResultFile” mode, there are two ways to activate debug mode. The first is by code, by setting the “FlexCelReport.DebugExpressions” property in the FlexCelReport to true. Again, setting it in code is useful when automating tests because you do not have to change the template.

And the second way is to write “<#Debug>” in the configuration sheet, the same way as in ErrorsInResultFile. This second way is preferred in most cases, f.i. if you do not want to modify the code, for example when testing a template.

The same remarks mentioned for the <#ErrorsInResultFile> apply to the <#Debug> tag.

In this mode, tags will not write their value to the cell, but they will rather write the whole chain of calculations made to arrive to the value.

For example, for our problematic expression:

<#if(<#tagval>=<#refval>;OK;Error)>

We will get this result in the cell:

debug expressions result

The format of the lines is as follows:

Each line has an expression in bold and a value in italics. Under that line and indented to the right we find the subexpressions used in the main expression and their values.

In this case, we can easily see that <#tagval> is “1”, <#refval> is “1”, and <#tagval> = <#refval> evaluates to false, so there is something wrong in the test. Having the full stack and all the intermediate values used to compute the main expression can be a valuable tool to find out what is going wrong, by allowing us to easily locate the exact point where the expression is not evaluating as it should.

Note

In order to correctly visualize the stack in the cell, you will have to set “Wrap Text” to true in the cell properties. If Wrap text is false, all lines will show in one line and it will be more difficult to read.

Understanding the stack can be a little difficult at the first time, but once you get used to it, it can be a great help. To end up this chapter, we will present a more complex expression and its corresponding stack explained. You can see it yourself at the Debugging Reports demo.

The original expression is this:

debug complex expression template

And the result we get when running this template in “debug” mode is:

debug complex expression result

You can see we have 4 main expressions here (they show without indentation). The first one is the constant text “Test value is”, the second is the tag “<#test>” that evaluates to 3, the third is other constant text “and here we will format it: ” and the fourth is an expression “Format(<#test>;<#round(1)>)” that evaluates to 3. So the result in “normal” mode of this cell will be “Test value is 3 and here we will format it: 3”. As there is a “format cell(red)” tag in the evaluation stack, the result will be formatted in red format.

All tags shown below the “format” line are subexpressions used to compute it.

Debugging Intelligent Page Breaks

Sometimes intelligent page breaks won't give the results you expect, and you might need to debug them. You can enter intelligent page breaks debug mode similar to Report Debug mode and Errors in result file mode:

  1. You can set FlexCelReport.DebugIntelligentPageBreaks to true in the code.
  2. You can write a tag <#Debug Intelligent Page Breaks> anywhere in the Expressions column of the config sheet.

The details on how to debug are explained in the Debugging Intelligent Page Breaks section of the API Guide


FlexCel Reports Tag Reference. | FlexCel Studio for the .NET Framework documentation

FlexCel Reports Tag Reference.

This document lists all the built-in tags in the report engine. You can use any of the tags included here, or define your own.

Tag syntax

Tags are special commands that go inside <#...> delimiter. Those will be replaced by FlexCel when running the report.

Tags cannot be escaped, but you can always insert literal <# or ; characters by defining report expressions an values. Say for example that you wanted to enter the following formula:

<#if(<#tag2>="";<#tag1>;<#tag1>;<#tag2>)>

In the following expression, if tag 2 is empty you will just output tag1, else you will output tag1;tag2. The problem with the formula above is that the ";" between <#tag1> and <#tag2> will be interpreted as a parameter separator, and the formula isn't valid. For this particular case, you can write the full string inside double quotes ("). <#tag1> and <#tag2> will still be replaced inside the double quotes, but FlexCel won't be misled into thinking the ; is a parameter separator. This formula will work fine:

<#if(<#tag2>="";<#tag1>;"<#tag1>;<#tag2>")>

As a more general approach for other cases (including if you want to enter a literal "<#"" into a formula) the solution is just to define report expressions or report variables with the text. So in the example above we could define a report expression:

Semicolon = ";"

and then write:

<#if(<#tag2>="";<#tag1>;<#tag1><#semicolon><#tag2>)>

Using expressions or variables you can escape any text you might need to, and it is the more general solution.

Constant

Syntax

Any text

Description

Any text that is not inside <#... > symbols.

Example

On the string “<#tag1>Hello<#tag2>” “Hello” is a constant.

Report Variable

Syntax

  1. <#Value>
  2. <#Value;default>

Description

A variable set in code before running the report. You can specify a default value (second syntax) that will be used if the variable does not exist. If no default value is provided and the variable does not exist, an exception will be raised.

Example

If you have a line of code FlexCelReport.SetValue("Date", DateTime.Now) before FlexCelReport.Run, the tag <#Date> will be replaced by the current date. If you have <#Date> in the template but do not do the SetValue command, a runtime error will happen. If you write <#Date;No date supplied> in the template, this tag will be replaced with the date if you set it on code with SetValue, or with the string "No date supplied" if not. There will never be a runtime error.

Note

Report Variables, User-defined Expressions and User-defined Functions use the same syntax, so it is impossible to differentiate between them. If you define a Report Variable with the same name as a User-defined Expression and/or User-defined function, they will be used on the following order: 1) User-defined Expression. 2) Report Variable. 3)User-defined function.

User-Defined Expression

Syntax

  1. <#Expr>
  2. <#Expr(param1;param2...)>

Description

Text on the Column “User defined Expressions” on the config sheet. When using parameters, you can use the <#param1> name inside the expression definition.

Example

If you define an Expression CompleteName = <#LastName>, <#FirstName> on the config sheet, the tag <#CompleteName> will be replaced by the expression.

Note

Report Variables, User-defined Expressions and User-defined Functions use the same syntax, so it is impossible to differentiate between them. If you define a Report Variable with the same name as a User-defined Expression and/or User-defined function, they will be used on the following order: 1) User-defined Expression. 2) Report Variable. 3)User-defined function.

User-Defined Function

Syntax

  1. <#UDF>
  2. <#UDF(param1;param2;...)>

Description

A user-defined function on the code. See the User Defined Functions demo for details.

Example

If you define a function Proper(name) on the report code, <#Proper(test)> on the template will be replaced by the results of the function.

Note

Report Variables, User-defined Expressions and User-defined Functions use the same syntax, so it is impossible to differentiate between them. If you define a Report Variable with the same name as a User-defined Expression and/or User-defined function, they will be used on the following order: 1) User-defined Expression. 2) Report Variable. 3)User-defined function.

Dataset

Syntax

  1. <#DataSet.Field>
  2. <#DataSet.Field;default>

Description

The value of Field on the current row of Dataset. If a default value is provided, it will be used when the field does not exist in the table or the table does not exist. You will normally want to provide default values when using metatemplates, together with the defined and preprocess tag. If you do not provide a default value and the field does not exist, a runtime error will happen.

There are two defined “pseudocolumns” that you can use on any dataset:

  1. <#DataSet.#RowCount> will return the number of rows on a dataset.
  2. <#DataSet.#RowPos> will return the current position on the dataset (the first record is 0).
Note

Normally you can write any character in the column name, including a column named similar to "Data(Max)". But in some cases, like when for example there is a simple parenthesis, or if you have the character ">" inside the column name, you might need to quote the name. For example, if your column name is "a(" you will have to write the tag as <#"DataSet.a(">. When quoting a name, you can include a quote inside by writing 2 quotes. For example, the column a"b can be written as <#"DataSet.a""b">

Note

FlexCel always searches for the first dot in the string to separate the table name from the field name. So if you have for example <#one.two.three>, FlexCel will understand that the table is "one" and the field is "two.three". If you wanted the table name to be "one.two" and the field to be three, you would have to use square brackets to keep together the table name: <#[one.two].three>

You can see square brackets in action in the Advanced LINQ demo.

Examples

If you have a table "Customers" with a column named "LastName", <#Customers.LastName> will replace the value on the report.

<#if(<#Customers.#RowCount> = 0;<#delete row>;)> will delete a row if the dataset has no records. You can use it to delete the detail captions on master-detail reports when the master has no details.

<#Customers.LastName;No customer> will enter the value of the field LastName if such field exists in the database, or the string "No customer" otherwise.

<#Customers.LastName;> will enter an empty value if the field LastName does not exist.

<#Customers.ByName.LastName> will refer to the table "Customers" and the field "ByName.LastName". On the other hand, <#[Customers.ByName].LastName> will refer to the table "Customers.ByName" and the field "LastName"

Full Dataset

Syntax

<#Dataset.*>

Description

The whole current row of the dataset. Cells to the right will be overwritten. You can write other <#Dataset.*> and <#Dataset.**> tags inside the same cell, and they will have the value of the first one.

Note

It is recommended that you don't use <#column width(autofit)> in a <#Dataset.*> tag, since the <#autofit> tag will be copied to every row and applied for every one. If you want to use it, it is best to put the autofit tag in the Full dataset captions tag (<#Dataset.**>)

Example

If the cell A1=”<#DataSet.*>, after the report column A will have the first column of the dataset, Column B the second column, etc. Any text previously on Column B will be overwritten. If you write "<#DataSet.*> <#if(<#DataSet.**>="Date";<#Format Cell(blue)>;>) in a cell, all columns written will have autofit, and when the column is named "Date" it will be formatted in blue

Full Dataset Captions

Syntax

<#DataSet.**>

Description

The whole row of column captions for a dataset. You normally use this tag before a <#dataset.*> and outside any named range.

Example

If you write <#Dataset.**> on cell A1, cell A1 will have the first column name on the dataset, B1, the second, etc. Text previously on B1 will be overwritten. If you write "<#Dataset.**> <#ColumnWidth(autofit)>" in a cell, it will autofit all the columns in the range

DbValue

Syntax

  1. <#dbvalue(table;row expression; column expression)>
  2. <#dbvalue(table;row expression; column expression; default value)>

Parameters

  • table: Datatable with the data, without quotes
  • row expression: An Excel expression (any valid Excel formula that can include other <#tags>) that must return a number or be empty. If empty, the record number will the current record. If a number, then that number is the record you want to retrieve. (starting at record 0)
  • column expression: An Excel expression (any valid Excel formula that can include other <#tags>) that must return a number or a string. If a number, this means the position of the column in the datatable (with the first column being column 0). If a string, this is the name of a column in the table.
Note

As this is an expression, not a string, if you want to enter a constant string here (like "customer") it must be between double quotes. The expression ="customer" with quotes evaluates to customer (without quotes). If you write just customer, it will be an invalid expression.

  • default value: A default value that will be used if the row or column doesn't exist. If you don't specify a default value and try to access an invalid row or column, an exception will be thrown.

Description

Returns any value of a table, letting you specify the record and column for the value. Note: This is an advanced tag, and you most likely don't want to use it. The most common application for it is when you want to do something depending on the value of the previous record (For example merge the cell if the value is the same as previous). Don't use it as a general tool. <#db.field> tags, ranges and aggregates should be enough for most needs, and they are a much cleaner and "functional" abstraction.

Examples

<#dbvalue(customers;<#customers.#rowpos> - 1;"customerId";)> will return the value of the previous value in customers.customerid. Note that "CustomerId" is in quotes as it should be an expression that returns a string, not a string. Also note that we defined an empty default value, so no exception is thrown when we are at the beginning of the table.

<#if(<#dbvalue(customers;<#customers.#rowpos> - 1;"customerId";)> = <#dbvalue(customers;<#customers.#rowpos>;"customerId";)>;<#Merge range(a3:a4)>;<#customers.name>)> will merge the cell if the value is the same as the previous one, or write the new value is values are the same.

Aggregate

Syntax

  1. <#aggregate(agg function; dataset name and column)>
  2. <#aggregate(agg function; dataset name; agg expression; filter)>

Parameters

  • agg function: It might be SUM for adding the values, COUNT for counting the values, AVG for finding the average, MAX to find the maximum value and MIN to find the minimum value.

  • dataset name (and column): Name of the dataset in which we want to aggregate the values. Note that this dataset doesn't need to be inside any named range, since we will use all of its records anyway. If "agg expression" is present, you don't need to include the column name, as the columns to aggregate will be taken from the expression. If not present, you need to include the column in which you want to aggregate.

  • agg expression: This parameter is optional. An expression that will be applied to every record in the dataset.(any Excel function is valid here, and you can use any combination of Excel functions) Null values will be ignored, but will count to the total records when calculating the average. If not present, the values of the column specified in "dataset name and column" will be used. Note that when aggregating on COUNT, this parameter is ignored.

  • filter: This parameter is optional. If present, it should be an expression that returns true or false. Again, any Excel formula is valid here. Only those records where the filter value is true will be used in the aggregate. When calculating the average, filtered records will not be used in the count.

Description

Aggregates a dataset and returns a unique value for all its records. You can use this tag to find for example the sum on a column in a dataset. Note that this tag can have a bad performance, as you need to load all data in memory in order to calculate the aggregate. If possible, it is preferred to do the aggregate directly in the database, for example using a "Group by" clause in the select SQL. This tag can be of use when you can't modify the datasets and you already have the data loaded, so you need to do the aggregation from the template.

Examples

<#Aggregate(sum;orders.orderid)> will sum all the values in the column order id of the table orders

<#Aggregate(avg;orders;<#orders.quantity>*<#orders.orderprice>)> will calculate the average of the quantity multiplied by the order price in table orders

<#Aggregate(min;orders;<#orders.tag>;<#orders.tag>> 0)> will calculate the minimum tag in orders that is bigger than 0

List

Syntax

  1. <#List(dataset name and column)>
  2. <#List(dataset name; list separator; agg expression; filter)>

Parameters

  • dataset name (and column): Name of the dataset in which we want to get the values as a list. Note that this dataset doesn't need to be inside any named range, since we will use all of its records anyway. If "agg expression" is present, you don't need to include the column name, as the columns to aggregate will be taken from the expression. If not present, you need to include the column in which you want to aggregate.
  • list separator: This parameter is optional. If not present it will default to a single space. This is the character that will separate the elements in the list. Note that if you want to use a semicolon here (;) you will have to write it in quotes (";") so it is not considered a parameter separator
  • agg expression: This parameter is optional. An expression that will be applied to every record in the dataset.(any Excel function is valid here, and you can use any combination of Excel functions) Null values will be ignored and not added to the list. If not present, the values of the column specified in "dataset name and column" will be used
  • filter: This parameter is optional. If present, it should be an expression that returns true or false. Again, any Excel formula is valid here. Only those records where the filter value is true will be used in the aggregate.

Description

Returns a string with all the values of a table one after the other, and separated by a delimiter. If the table has only one record, you can use <#List(table.field)> to get the value of the only record without having to define any __table__ named range.

Examples

<#List(Employees.Lastname)> will return a string like "Smith Brown Perez", when the dataset has 3 records with the lastnames of Simth, Brown and Perez. As we didn't specify a separator, a single space will be used. In cases where you know Employees has only one record, you could have used this to avoid defining a __employees__ named range.

<#list(employees.lastname;, )> will return a string like "Smith, Brown, Perez".

<#list(employees;"; "; <#employees.firstname> & " " & <#employees.lastname>)> will return a string like "John Smith; Carl Brown; Jorge Perez". Note that as we wanted to use ";" as the list separator, we had to write it inside quotes.

If

Syntax

<#if(Condition; IfTrue; IfFalse)>

Description

A conditional statement. When “condition” is true, “IfTrue” expression will be evaluated, if not “IfFalse” will. For a description of the “Condition” format, see Evaluating Expressions in the Reports Designer Guide

Example

<if(<#value>=1;One;Not One)> will write “One” if the report variable “Value” is 1, and “Not One” if not.

Ifs

Syntax

<#ifs(Condition1; value1; Condition2; value2...)>

Description

An "if-chain" of different conditions. If condition1 is true then this tag will return value1, if it is false it will evaluate condition2 and if condition3 is true return value2, and so on. If no condition evaluates to true, then this tag will return #N/A!. If you want to provide a default condition, make sure that the last condition is the value "true"

Note

If the condition always compares against the same value, you might use <#switch> instead. The examples below are simpler using <#switch>

Examples

<#ifs(<#value>=1;One;<#value>=2;Two)> will write “One” if the report variable “Value” is 1, "Two" if value is 2, and #N/A! if the value isn't 1 or 2

<#ifs(<#value>=1;One;<#value>=2;Two;true;Something else)> will write “One” if the report variable “Value” is 1, "Two" if value is 2, and "Something else" if the value isn't 1 or 2

Switch

Syntax

<#switch(SwitchValue; value1; result1; value2; result2...[default])>

Description

This tag will compare "SwitchValue" against value1, value2, etc in order. If SwitchValue is equal to any of the value_n, then result_n will be returned. You can provide a default value as the last parameter. If no value matches SwitchValue and you have a default parameter, then the default will be returned. The default is inferred from the number of arguments: When the number of arguments is odd (3, 5, 7...) there is no default value. If the number of arguments is even, then the last parameter is the default.

Examples

<#switch(<#value>;1;One;2;Two)> will write “One” if the report variable “Value” is 1, "Two" if value is 2, and #N/A! if the value isn't 1 or 2

<switch(<#value>;1;One;2;Two;Something else)> will write “One” if the report variable “Value” is 1, "Two" if value is 2, and "Something else" if the value isn't 1 or 2

Evaluate

Syntax

  1. <#evaluate(expression)>
  2. <#evaluate(expression;loop count)>

Parameters

expression: An expression to evaluate. For a list of possible expressions, see Evaluating Expressions in the Reports Designer Guide. loop count: How many times to evaluate expression. If this parameter is not used, expression will be evaluated one time.

Description

This tag will evaluate an expression and output the final result. You can see it as a “static” formula. Different than <#=()> tag, expression will be evaluated each time a value is needed, so you can have relative addresses.

A loop count bigger than 1 is useful if you store tags in the database itself. For example, if you have a field in the database "db" named "Expression" with value "<#other tag>", then <#evaluate(<#db.expression>;2>)> will evaluate first the value of expression, find out it is <#other tag>, then evaluate again <#other tag> and write the value of other tag in the cell.

Example

<#evaluate(A1+$A$2*2 & left(a3,2))> will output a string consisting on A1+A2*2 concatenated with the 2 first characters of a3.

If a report variable customer has the value "<#FirstName> & <#LastName>", then evaluate(<#customer>;2) will first evaluate <#customer> and return the string "<#FirstName> & <#LastName>". Then, as loop count is 2, it will evaluate the string "<#FirstName> & <#LastName>" and return the first and last name concatenated.

Equal

Syntax

<#=(“Cell”)>

Description

Replaces the tag with the referred cell content. “Cell” might be a reference to another sheet. Note that “Cell” will be evaluated at compile time, so it won't change when you copy the range. (It always behaves like an absolute reference, on the style $A$1). If you want to have a cell reference that is dynamically evaluated at fill time, use <evaluate(“Cell”)> tag. Note: Almost the only place where this tag makes sense is on sheet names. For other expressions it is better to define an expression on the config sheet and use it instead of a cell reference. When using a sheet name you can not always know which one is the config sheet, so it is not safe to use expressions, and you need the “=” tag.

Example

If you name a sheet <#=(Sheet2!A1)> the sheet name will be replaced by whatever you write on cell A1 on Sheet2. On cells, define a named expression on the config sheet and use it instead of this tag.

Include

Syntax

  1. <include(file; named range; shift type)>
  2. <include(file; named range; shift type;static/dynamic)>
  3. <include(file; named range; shift type;static/dynamic;CopyRowsOrCols)>

Parameters

  • file: Filename to include. The path is relative to where the current template is. If you are inserting from a stream (for example from a database) you need to assign the GetInclude event. See Templates On The Exe demo for more info.

  • named range: Named range on the included file that determines which cells will be included. If you leave this parameter empty, the full used range in the active sheet will be included.

  • shift type: How the existing cells will be shifted to insert the new ones. There are five possibilities: “__”, “_”, “I_”, “II_” and “FIXED”, to move existing cells the full row down, only down, full column right, only right or not insert anything respectively.

  • static/dynamic: This can be the string "Dynamic" or "Static" (without quotes), or omitted, in which case it is assumed to be "Dynamic". Dynamic includes will run inside the main report when inserted; this is the normal behavior. Static includes will just insert the child file inside the main report without running it. Static can be used if you want to include a previously generated report, to make sure FlexCel does not try to run it again.

  • CopyRowsOrCols: this parameter can be "R", "C" or "RC" (without quotes). By default, included reports will get the column widths and row heights of the parent report (unless you are inserting a full column or row). If you specify "R" here, row heights and format from the included report will be copied to the parent, modifying the parent rows. If you specify "C", column widths will be copied, modifying the parent columns. If you specify "RC", both columns and rows will be copied.

Description

Includes a subreport inside the current one. An included file can include other files itself. The subreport is precompiled and runs on its own sandbox, so it cannot access cells on the parent. For example, a <#delete range> tag will never erase something outside the include. The subreport does have access to all report variables, expressions and user-defined functions of the parents, as it has to the parent databases.

Example

On the following include, cells will be moved the whole row down.

report include 1

The generated file will be:

report include 2

Note how cells C2 and D2 are overwritten on the final report. As a general rule, do not write anything at the right of the file being included, except if you know for sure the include won't overwrite the cells. When inserting columns (II_ and I_ ), cells on the same column as the include will be overwritten.

Configuration Sheet

Syntax

<#config>

Description

This tag will identify the current sheet as the configuration sheet. It will only have an effect when written on a sheet name.

Example

Just name the sheet <#config>

You can also conditionally define a sheet as the configuration sheet. If you write <#if(<#value>=1;<#delete sheet>;<#config>)> as the name of one sheet and <#if(<#value><>1;<#delete sheet>;<#config>)> as the name of another, the configuration sheet will be the first or the second one depending on the value of <#value>.

Delete Range

Syntax

<#delete range(range address; shift type>

Parameters

  • range address: The range of the cells to delete. This might be a string like "A1:B5" or a named range like "myrange"

    Note

    Whenever possible, use named ranges instead of strings in the range definitions. If you define a named range "myrange" in cells A2:A3 and use it as a parameter for this tag, when you insert a row in A1 the range will move to A3:A4. If you had written the string "A2:A3" as the parameter for this tag, it would still point to A2:A3 after inserting the row.

  • shift type: How the existing cells will be shifted when deleting. There are four possibilities: “__”, “_”, “I_” and “II_”, to move existing cells the full row up, only up, full column left and only left respectively.

Description

Use it to delete a range of cells. The range will be deleted after all the cells on the band have been replaced.

Example

<#if(<#value>=1;<#delete range(a1:a5;__)>;)> will delete the first five rows on the band when <#value>=1 and shift rows up.

<#if(<#value>=1;<#delete range(myrange;I__)>;)> will delete the named range myrange when <#value>=1 and shift columns ot the left.

Delete Row

Syntax

  1. <#delete row>
  2. <#delete row(full)>
  3. <#delete row(relative)>

Parameters

  • no parameters: When called with no parameters, the full row will be deleted.

  • full: This is the same as calling it without parameters, the full row will be deleted

  • relative: Only the cells inside the range being processed will be deleted, not the full row. Use this call if for example you have 2 side by side reports, and wish to delete the row in one of the reports but not in the other. Older FlexCel versions used this mode by default

Description

Use it to delete the current row. If you are a FlexCel 2.x user, note that <#delete row> behaves differently from the old ...delete row... Now <#delete row> is processed at the same time as the ranges, so you can't use it to expand ranges. Use “X” ranges instead.

Example

<#if(<#value>=””;<#delete row>;)> will delete the current row when value is empty.

Delete Column

Syntax

<#delete column>

Parameters

  • no parameters: When called with no parameters, the full column will be deleted.

  • full: This is the same as calling it without parameters, the full column will be deleted

  • relative: Only the cells inside the range being processed will be deleted, not the full column. Use this call if for example you have 2 reports one above the other, and wish to delete the column in one of the reports but not in the other. Older FlexCel versions used this mode by default

Description

Use it to delete the current column.

Example

<#if(<#value>=””;<#delete column>;)> will delete the current column when value is empty.

Delete Sheet

Syntax

<#delete sheet>

Description

This tag will delete the current sheet. It will only have an effect when written on a sheet name.

Example

If you write <#if(<#value>=1;<#delete sheet>;Food)> as the name of a sheet, this sheet will have the name Food when the report variable value is not one, and will be deleted when value=1

Note

As the maximum sheet name size is 31 characters, you will probably need to write the expression including the <#delete sheet> tag on the config sheet, and name the sheet as <#=(<#Config>!A1)> or similar, as shown in the picture:

config reference from other sheet

Sheet Visible

Syntax

  1. <#sheet visible(show)>
  2. <#sheet visible(hide)>
  3. <#sheet visible(very hide)>

Description

This tag will hide or show the current sheet. It can be written in any cell. The very hide option corresponds with Excel's very hidden sheets.

Example

If you write in a cell <#if(<#value>=1;<#sheet visible(very hide>)> then the sheet will be hidden when value is 1.

Note

If you have multiple <#sheet visible> tags in a file, then it is not determined which one will be last used and have the final effect. It depends on the order of evaluation of the cells inside the sheet. Try to have a single tag per sheet, and not inside any range that could be copied.

Format Cell

Syntax

<#format cell(format name; [user format parameter 1; user format parameter 2;...])>

Parameters

  • format name: The name of a format defined on the config sheet, or a User-defined Format defined with FlexCelReport.SetUserFormat.
  • user format parameters: This is a list of optional parameters and they are only used if format name is a User-defined format. It is a list of parameters that will be passed to the user-defined format function.

Description

Use it to format a cell with a defined format. You define all format settings (fonts, borders, patterns, etc) on the config sheet, and then you can freely use them. Note that you can define "partial formats" that will only apply part of the format. (for example the cell background, but keeping the font of the destination cell). Look at the Reports Designer Guide for more information on partial formats

Examples

<#if(mod(row(a1),2)=0;<#format cell(Yellow)>;)> will format the cell as yellow for odd rows.

You need to define a “Yellow” format on the config sheet:

config yellow background

Note

In this example we defined a Yellow(Background) partial format, so it only applies the background color of the cell and not other attributes like the font size or color.

You could also use a User-defined Format added with FlexCelReport.SetUserFormat. For example: <#format cell(MyUserFunction;<#category.color>)> will call a function registered as MyUserFunction with FlexCelReport.SetUserFormat and pass the value of <#category.color> to the function. The function will return the format for the cell.

Format Row

Syntax

<#format row(format name; [user format parameter 1; user format parameter 2;...])>

Parameters

  • format name: The name of a format defined on the config sheet, or a User-defined Format defined with FlexCelReport.SetUserFormat.
  • user format parameters: This is a list of optional parameters and they are only used if format name is a User-defined format. It is a list of parameters that will be passed to the user-defined format function.

Description

Use format row to format the current row with a defined format. Note that the order on that the <#format> tags will be applied is:

  1. format row / format col
  2. format range
  3. format cells

So, if you format row 1 as “Red”, and cell A1 as “Blue”, the cell format will have priority over the row format and A1 will be Blue. B1:XFD1 will be Red.

Example

<#format row(blue)> will format the current row with the user-defined format “blue”.

Format Column

Syntax

<#format column(format name; [user format parameter 1; user format parameter 2;...])>

Parameters

  • format name: The name of a format defined on the config sheet, or a User-defined format defined with FlexCelReport.SetUserFormat.
  • user format parameters: This is a list of optional parameters and they are only used if format name is a User-defined format. It is a list of parameters that will be passed to the user-defined format function.

Description

Use format column to format the current column with a defined format. Note that the order on that the <#format> tags will be applied is:

  1. format row / format column
  2. format range
  3. format cells

So, if you format column A as “Red”, and cell A1 as “Blue”, the cell format will have priority over the column format and A1 will be Blue. A2:A1048576 will be Red.

Example

<#format column(blue)> will format the current column with the user-defined format “blue”.

Format Range

Syntax

<#format range(range address; format name; [user format parameter 1; user format parameter 2;...])>

Parameters

  • range address: The range of the cells to format. This might be a string like "A1:B5" or a named range like "myrange"

    Note

    Whenever possible, use named ranges instead of strings in the range definitions. If you define a named range "myrange" in cells A2:A3 and use it as a parameter for this tag, when you insert a row in A1 the range will move to A3:A4. If you had written the string "A2:A3" as the parameter for this tag, it would still point to A2:A3 after inserting the row.

  • format name: The name of a format defined on the config sheet, or a User-defined format defined with FlexCelReport.SetUserFormat.

  • user format parameters: This is a list of optional parameters and they are only used if format name is a User-defined format. It is a list of parameters that will be passed to the user-defined format function.

Description

Use format range to format a range of cells with a defined format. Note that the order on that the <#format> tags will be applied is:

  1. format row / format col
  2. format range
  3. format cells

So, if you format range A1:B2 as “Red”, and cell A1 as “Blue”, the cell format will have priority over the range format and A1 will be Blue. All other cells on A1:B2 will be Red.

Example

<#format range(a1:b2;blue)> will format the range a1:b2 with the user-defined format “blue”.

<#format range(myrange;blue)> will format the named range "myrange" with the user-defined format “blue”.

Merge Range

Syntax

<#merge range(range address)>

Parameters

  • range address: The range of the cells to merge. This might be a string like "A1:B5" or a named range like "myrange"
Note

Whenever possible, use named ranges instead of strings in the range definitions. If you define a named range "myrange" in cells A2:A3 and use it as a parameter for this tag, when you insert a row in A1 the range will move to A3:A4. If you had written the string "A2:A3" as the parameter for this tag, it would still point to A2:A3 after inserting the row.

Description

Use merge range to dynamically merge a range of cells when generating the report. The range will grow/shrink when copying the tag, depending on the count of records on the current band.

Important

This tag is only for when you need to merge cells depending on a condition. For normal merged cells, just merge them in the template.

Example

<#merge range(a1:a2)> when written inside a band on A1:Z2 will merge the cells on column A once per band.

Row Page Break

Syntax

<#page break>

Description

<#page break> tags are useful for inserting page breaks on the report. “Normal” page breaks are fixed, they won't be copied each time a band is expanded. So you need to add this tag to get a page break for each value of the band. Note that manual page breaks on a sheet have a maximum of 1026, so any page break above this will not be inserted and will be silently ignored. There is a property FlexCelReport.ErrorActions that you can set to throw an exception instead on ignoring them when the limit is reached.

Example

<#page break> will insert a page break on the current row.

Column Page Break

Syntax

<#column page break>

Description

<#column page break> tags are useful for inserting page breaks on the report. “Normal” page breaks are fixed, they won't be copied each time a band is expanded. So you need to add this tag to get a page break for each value of the band. Note that manual page breaks on a sheet have a maximum of 1026, so any page break above this limit will not be inserted and will be silently ignored. There is a property FlexCelReport.ErrorActions that you can set to throw an exception instead on ignoring them when the limit is reached.

Example

<#column page break> will insert a page break on the current column.

Automatic Page Breaks

Syntax

  1. <#auto page breaks>
  2. <#auto page breaks(PercentOfPageUsed; PageScale)>

Parameters

  • PercentOfPageUsed: This value must be between 0 and 100 and specifies the minimum percent of the sheet that can be empty when adding the page breaks.
  • PageScale: This parameter must be between 50 and 100, and it specifies how smaller to consider the sheet when calculating the page break, in order to avoid rounding errors.

Calling this tag without parameters is equivalent to calling <#auto page breaks(20;95)>

Description

When you write an <#auto page breaks> tag in a sheet, FlexCel will try to keep together all named ranges starting with "keeprows_" and "keepcolumns_". For an in-depth explanation on how this works, take a look at the Reports Designer Guide and API Developer Guide

Example

<#auto page breaks> will tell FlexCel to add manual page breaks in all the sheet so all "keep..." ranges are kept together.

Row Height

Syntax

  1. <#Row Height(Value)>
  2. <#Row Height(show)>
  3. <#Row Height(hide)>
  4. <#Row Height(autofit; Adjustment;AdjustmentFixed;MinHeight;MaxHeight)>

Parameters

  • Value: If it is a number, it means the height of the row. If it is “show” or “hide” means to show or hide the row. If it is “autofit”, it means to autofit the row to the cell contents.

  • Adjustment: This value is optional and only has meaning if “value” is autofit. It is a percent to make the row higher.

  • AdjustmentFixed: This value is optional and only has meaning if "value" is autofit. It is a fixed amount to make the row bigger than the calculated value. The final height of the row might be calculated as: FinalHeight = CalculatedHeight * Adjustment + AdjustmentFixed

  • MinHeight: This value is optional and only has meaning if value is autofit. It might be:

    • Dont Shrink: Means autofit, but never make the row smaller than the original size.

    • Dont Grow: Means autofit, but never make the row bigger than the original size.

    • A number: Specifies the minimum size of the row.

  • MaxHeight: This value is optional and only has meaning if value is autofit. It might be:

    • Dont Shrink: Means autofit, but never make the row smaller than the original size.

    • Dont Grow: Means autofit, but never make the row bigger than the original size.

    • A number: Specifies the maximum size of the row.

Description

Use this tag to change the heights of rows. See the Autofit demo for more information.

Example

<#Row Height(30)> will set the row height to 30.

<#Row Height(hide)> will hide the row.

<#Row Height(Autofit)> will mark the row to be autofitted by FlexCel.

<#Row Height(Autofit;100;0;dont shrink)> will mark the row to be autofitted by FlexCel, with standard adjustment, and with a row size of at least the original row size.

Column Width

Syntax

  1. <#Column Width(Value)>
  2. <#Column Width(show)>
  3. <#Column Width(hide)>
  4. <#Column Width(autofit; Adjustment;AdjustmentFixed;MinWidth;MaxWidth)>

Parameters

  • Value: If it is a number, it means the width of the column. If it is “show” or “hide” means to show or hide the column. If it is “autofit”, it means to autofit the column to the cell contents.

  • Adjustment: This value is optional and only has meaning if “value” is autofit. It is a percent to make the column wider.

  • AdjustmentFixed: This value is optional and only has meaning if "value" is autofit. It is a fixed amount to make the column bigger than the calculated value. The final width of the column will be calculated as: FinalWidth = CalculatedWidth * Adjustment + AdjustmentFixed

  • MinWidth: This value is optional and only has meaning if value is autofit. It might be:

    • Dont Shrink: Means autofit, but never make the column smaller than the original size.

    • Dont Grow: Means autofit, but never make the column bigger than the original size.

    • A number: Specifies the minimum size of the column.

  • MaxWidth: This value is optional and only has meaning if value is autofit. It might be:

    • Dont Shrink: Means autofit, but never make the column smaller than the original size.

    • Dont Grow: Means autofit, but never make the column bigger than the original size.

    • A number: Specifies the maximum size of the column.

Description

Use this tag to change the widths of columns. See the Autofit demo for more information.

Example

<#Column Width(Autofit)> will mark the column to be autofitted by FlexCel.

Autofit Settings

Syntax

<#Autofit Settings(Global; KeepAutofit; Adjustment; AdjustmentFixed; MergedCellsMode)>

Parameters

  • Global: It can be either the string All or Selected (without quotes). All means automatically autofit every row on the workbook, regardless of if the row has been marked for autofit (with <#row height(autofit)>) or not. Selected means only autofit rows that are marked. The default is Selected and we recommend this setting, since autofitting all the rows on the sheet could change heights of rows you do not want to change. If you want to use All, make sure you make rows that you do not want to change of fixed height on the Excel template.

  • KeepAutofit: Might be keep or fixed. If keep, rows that were marked as autofit on the original template will be kept autofit. This means when you open the file in Excel it will recalculate the row heights and they might change a little, but you will never get cropped text. The default is true. If this setting is fixed, row height will be fixed at the size calculated by FlexCel, and Excel will not recalculate them. While this will make both Excel and FlexCel look the same, when seeing the file in Excel it might crop some text. If you want to use this option, we recommend you ser Adjustment of about 150 to avoid text crop.

  • Adjustment: It is a percent to make the columns wider or rows higher on all the sheets. The default is 100, but you can enter a bigger number here. Also, you can override global adjustments with the <#row height(autofit, localadjustment)> and <column width(autofit, localadjustment)>. If you do not specify localadjustment on those tags, the value specified here will be used.

  • AdjustmentFixed: It is a fixed amount to make the columns wider or rows higher on all the sheets. The default is 0, but you can enter a bigger number here.

  • MergedCellsMode: Sets how to fit a cell that spans over multiple rows when autofitting rows, or a cell that spans multiple columns when autofitting a column. The possible values for this parameter are None, First, Last and Balanced (without quotes).

If you omit this parameter, Last will be assumed.

  • None means that the cell will be ignored when autofitting.

  • First means that the first row/column of the merged cell will be changed to autofit the full cell.

  • Last means that it will change the last row/column of the cell.

  • Balanced means that it will increase the height of all the rows in the merged cell by the same amount.

    First might be followed by a "+" and a number between 0 and 4. For example, "First+1" means use the second row of the merged cell to do the autofit. Similarly, "Last" might be followed by a "-" and a number between 0 and 4. For example "Last-2" means use the row that is 2 rows before the last.

Description

This tag commands the autofit settings on a sheet. You need to have only one of those tags in each sheet, and it will affect the autofit of all rows and columns. If you do not specify this tag on a sheet, the default used is <#Autofit Settings(Selected;keep;100;0)>

Example

<#Autofit Settings(All, keep, 100)> will autofit all non-fixed rows on the sheet, and you will not need to specify individual rows to autofit with <#row height> tag.

<#Autofit Settings(Selected; Fixed; ; ;Last-1)> will autofit only rows that have an autofit tag, and keep the size fixed. The adjustments are left to the default, and in case of merged cells, the row or column before the last in the merged cell will be used. Note that when autofitting merged cells, you might want to keep autofit "Fixed", because Excel doesn't autofit merged cells, so when you open the file, it will revert to a single line.

Comment

Syntax

<#//(...)>

Description

Everything inside a // tag will be ignored. You can use it to temporarily disable tags.

Example

<#//(This is a comment)> will not do anything and is equivalent to an empty string.

Image Size

Syntax

  1. <#imgsize>
  2. <#imgsize(zoom; aspect ratio)>

Parameters

When called with no parameters, this tag will resize the image to "Best Fit" inside the original image template rectangle maintaining the aspect ratio. That is, if the image in the template is 50px wide x 40px tall, the new image will be resized to be either 40 px tall or 50 px wide, in a way the aspect ratio is maintained and the new image is no bigger than the image in the template.

  • zoom: Percent of zoom to resize the image. 0 means leave size untouched.

  • aspect ratio: Aspect ratio of the image. 0 means "leave size untouched". Negative values mean "keep height fixed and resize the width to match", and positive values mean "keep width fixed and resize the height to match".

Description

This tag will only work when written on the name of an image. You shouldn't use both parameters at the same time, always leave zoom = 0 or aspect ratio = 0.

Example

The most common way to use this tag is just to name an image <#Data><#imgsize>. If you do so, the inserted image will be as big as possible without being bigger than the original, and maintaining the aspect ratio. If you name an image <#Data><#imgsize(0;-1)> the image will retain its designed height and resize its width so it is not distorted. You can see a lot of different uses of this tag on the Images demo.

Image Position

Syntax

<#imgpos(RowAlign;ColAlign;RowOffset;ColOffset)>

Parameters

All parameters are optional.

  • RowAlign: It might be "Top", "Center" "Bottom" or omitted. If omitted vertical image position won't change.

  • ColAlign: It might be "Left", "Center" or "Right" or omitted. If omitted the horizontal image position won't change.

  • RowOffset: It is a number specifying how many pixels from the calculated position the image will be moved down. If negative, image will be moved up from the calculated position. If omitted it is assumed to be 0.

  • ColOffset: It is a number specifying how many pixels from the calculated position the image will be moved right. If negative, image will be moved left from the calculated position. If omitted it is assumed to be 0.

Description

This tag must be written as part of an image name, not in a cell. Use this tag to dynamically move an image. You will normally need to use it when dealing with images of different sizes.

Example

If you name an image <#Data><#imgpos(center;center;-10)> the image will be centered in the column, and 10 pixels to the right of being centered in the row.

Image Fit

Syntax

<#imgfit(FitInRows;FitInCols;RowMargin;ColMargin)>

Parameters

All parameters are optional.

  • FitInRows: It might be "InRow", "Dont Shrink", "Dont Grow" (all without quotes) or omitted. If omitted the row will not change. If you use InRow, the row size will always change to fit the image. Dont Shrink and Dont Grow work the same as InRow, but row size will only change if the new height is larger/smaller than the current size.

  • FitInCols: It might be "InColumn", "Dont Shrink", "Dont Grow" or omitted. If omitted the column will not change. If you use InCol, the column size will always change to fit the image. Dont Shrink and Dont Grow work the same as InColumn, but column size will only change if the new width is larger/smaller than the current size.

  • RowMargin: It is a number specifying how many pixels to add to the row as a margin around the image.

  • ColMargin: It is a number specifying how many pixels to add to the column as a margin around the image.

Description

This tag must be written as part of an image name, not in a cell. Use this tag to resize a row or a column so they are big enough to hold an image. You will typically want to use this tag when image size changes dynamically, so the images fit inside their cells.

Example

If you name an image <#Data><#imgfit(inrow;;-10)> the row will be made as big as the image plus 10 pixels.

Image Delete

Syntax

<#imgdelete>

Description

This tag must be written as part of an image name, not in a cell. Use this tag to delete an image.

Example

If you name an image <#Data><#if(<#Data="";<#imgdelete>;)> image will be deleted when there is no data.

Lookup

Syntax

<#lookup(table name; search key names; search key values ;result field)>

Parameters

  • table name: Master table where we will look for the value.

  • search key names: A list of columns containing the search key on the master table. It will normally be just one column, but if you need to search by more than one, you can separate column names with a comma (“,”)

  • search key values: A list of values containing the search values on the master table. The number of search key values should match the number of search key names. If you have more than one search key value, you need to use an <#array> tag.

  • result field: the field of “Table name” you want to display.

Description

Use <#lookup> to search for a field description on another table.

Example

If you keep an CustomerId on table Orders and the Customer data on a table Customers, to output the real customer name for an order you can use:

<#lookup(Customers;CustomerId;<#Orders.CustomerId>;CustomerName)>

For more examples on the use of lookup, see the Lookups demo.

Array

Syntax

<#array(value_1; value_2;.... ;value_n)>

Description

Use <#array> to output an array of values. Currently, the only use of <#array> tag is to provide an array of search keys for the <#lookup> tag, but it could have more independent uses on the future.

Example

To lookup a field by two different keys, you should use:

<#lookup(Table;Column1,Column2;<#array(value1;value2)>;result column)>

Regular Expressions

Syntax

<#regex(IgnoreCase; Expression; Match; [Replace])>

Parameters

  • IgnoreCase: 0 to do a case-sensitive search, 1 to do a case-insensitive search.

  • Expression: Regular Expression we want to evaluate.

  • Match: String where we will apply the regular expression.

  • Replace: This is an optional parameter, and if present, it is the string that we will replace into the matching parts of Match.

Description

There are 2 ways to use this tag, depending if you include the Replace parameter or not. If you don't include it, this function will return the parts of the string Match that match the regular expression. When you specify a Replace parameter, this function will return the original “Match” string with the parts that match the expression replaced by the Replace parameter.

Examples

<#regex(0;x.*e;flexcel)> will return xce

<#regex(0;x.*e;flexcel;***)> will return fle***l

<#regex(0;x*.e;flexcel;o)> will return fool

<#regex(0;x*.e;flexcel;)> will return fl

Formula

Syntax

<#Formula>

Description

You can use this tag to make FlexCel enter the text on the cell as a formula instead of a string. Note that the text on the cell must be a valid formula, and start with an “=” sign. If the expression is not a valid Excel formula, an Exception will be raised. You only need to enter this tag once in a cell, generally at the beginning. Note that for entering cell references, you will need to use the <#ref> tag.

Example

If you enter on a cell:

B5: <#Formula>= <#ref(0;-1)> + <#Db.Field>

when the report is generated, on the cell you will have formulas like:

B5: “=A5 + 4”
B6: “=A6 + 3”
etc.

We used the <#ref> tag here to make the reference “A5” grow down when the cell is copied. Also, using <#ref> instead of writing the cell reference directly, allows you to insert for example a row at the beginning of the template, and not break the report.

Warning

In the real world, there is little use for the <#formula> tag, to the point that is difficult to find examples where it can be useful. Of course those cases exist, but if you are thinking about using this tag, first think if a simple Excel formula without any tags wouldn't be better.

In the example above, you could write <#Db.Field> in column C, and have a simple = A5 + C5 formula in B5. Whenever possible, prefer simple Excel formulas instead of using this tag.

Ref

Syntax

  1. <#Ref(NamedRange)>
  2. <#Ref(RowOffset; ColOffset)>
  3. <#Ref(NamedRange; RowAbsolute; ColAbsolute)>

Parameters

  • NamedRange: The name of a named range with the cell address you want to use.

  • RowOffset: How many rows below or above this cell is the reference. Use negative values to indicate rows above the cell.

  • ColOffset: How many columns at the left or the right of this cell is the reference. Use negative values to indicate rows at the left of the cells.

  • RowAbsolute: If true, the row will not move down when copying. This is analog to a A$1 reference.

  • ColAbsolute: If true, the column will not move to the right when copying. This is analog to a $A1 reference.

Description

This tag will normally be used together with a <#formula> tag, in order to add relative references to a hand-written formula. Even if the values are absolute, it is a good idea to always use <#ref> tags on formulas, since if you don't, whenever you insert rows on the sheet the references will not be updated

Example

<#ref(-1;-2)> means the cell that is 1 row above and 2 columns to the left

<#ref(Potatoes;true;true)> means a reference to the name "potatoes" on the sheet that will not move when copying cells.

HTML

Syntax

<#HTML(Enable)>

Parameters

  • Enable: Enable can be “TRUE” or “FALSE”. When true, the text on the cell will be entered as HTML, when false it will be entered as normal text. For more information about HTML tags supported, see the FlexCelReport.HtmlMode property.

Description

This tag overrides the global property FlexCelReport.HtmlMode on a cell by cell basis. If you set HtmlMode = true on a report, you can exclude individual cells of being HTML formatted with the tag <#HTML(false)>. Similarly, when HtmlMode = false, you can make individual cells HTML formatted with the tag <#HTML(true)>. You only need to write one HTML tag into a cell, and its position does not matter.

Example

<#HTML(true)><#Text> will enter the value of <#Text> as an Html string when HtmlMode = false.

Preprocess

Syntax

<#Preprocess>

Description

The preprocess tag enters a "preprocessor" mode where you can modify the template before actually running the report. You only need to write one Preprocess tag into a cell, and its position does not matter.

When this tag is present in any cell of the template, FlexCel will make 2 passes on it. On the first pass, FlexCel will process all the cells with "Preprocess" tag, and in the second it will load the modified template. You can use the first pass to delete rows and columns, and customize the final template before the report.

You can get dynamic templates this way, that are customized depending on the data.

Example

<#Preprocess><#if(<#defined(customer.date)>;;<#delete column>)> will delete the column from the template before running the report when customer.date is no defined.

<#Preprocess><#if(<#includecustomer>)>;;<#delete column>)> will delete the column if the variable includecustomer is false

Defined

Syntax

  1. <#defined(field_or_variable)>
  2. <#defined(field_or_variable;global>
  3. <#defined(field_or_variable;local>

Parameters

  • field_or_variable: Field we want to find out if it is defined. "Defined" will return if the variable or database field exists in a global scope.

  • global: This is the same as calling it with just 1 parameter.

  • local: When the second parameter is the string "local", "defined" will return true only if the field is accessible to the current range. For example, if you had a master range __master__ and included inside a detail range __detail__; defined(detail.field;local) would return true only if the cell was inside the __detail__ range, but not if it was inside the __master__ range. defined(detail.field;global) or simply defined(detail.field) will return true no matter the cell where the expression is in.

Description

Use this tag to know if a field variable is defined or not. This is normally useful when doing metatemplates (see meta templates demo) together with the Preprocess tag. This way you can have dynamic SQLs, and delete columns from the report if those columns were not selected in the SQL.

Example

<#Preprocess><#if(<#defined(customer.date)>;;<#delete column>)> will delete the column from the template if the field "date" does not exist in the table customers

Note

When using the "defined" tag, you will probably need to use default values in the database fields too. For example, the expression "<#if(<#defined(db.field)>;<#db.field>;no data)>" will raise an error if db.field does not exits. This is because FlexCel precompiles the whole expression before evaluating it, and it can't compile it if <#db.field> does not exist. The defined tag will be evaluated later, (many times, this is why FlexCel precompiles the expression), but at precompile time this expression will raise an error.

The correct expression in this case is "<#if(<#defined(db.field)>;<#db.field;no data>;no data)>", or more simple just "<#db.field;no data>"

In general, when using fields that might be defined or not, you should always specify a default value for them.

Defined Format

Syntax

<#defined format(expression)>

Parameters

  • expression: An expression that should resolve to a string

Description

Use this tag to know if a custom format is defined in the config sheet.

Example

<#if(<#defined format(<#fmt>)>;<#format cell(<#fmt>)>;)> will format the cell with the style specified by the variable <#fmt> if it is defined, or do nothing otherwise.

Swap Series

Syntax

<#Swap Series>

Description

The Swap Series tag has no parameters and has only effect in two places:

  • If you write it as a part of the name of a chart.
  • If you write it as a part of the sheet name in a chart sheet.

In both cases you can write the tag anywhere, the position doesn't matter.

This tag allows you to swap the column and rows in a chart, allowing you to create charts that have a series for each row of data. This tag runs after all the report has been generated. See Creating charts with dynamic series for more information on how the tag works.

Example

If you name a chart sheet as "Product Chart<#swap series>" then the chart sheet will swap rows and columns after the report is generated. Same applies if you name a chart object "Product Chart<#swap series>". Note that the final name of the object or the chart sheet will be "Product Chart" as the <#swap series> part will be removed from the name.


FlexCel Performance Guide | FlexCel Studio for the .NET Framework documentation

FlexCel Performance Guide

Introduction

Performance is a complex but very important characteristic of any application. One of our design goals with FlexCel is to be as fast as possible, and we are always finding ways to improve a little the performance from version to version. The idea is that for most of the cases, FlexCel should be “fast enough” and you shouldn’t have to care about performance when using it, as we took care of it for you. But for cases where you need the absolute maximum of performance, you can help FlexCel perform better by writing code that uses it in an optimal way. To know how to code for maximum performance, you need to understand how FlexCel works from a performance viewpoint, and that’s what this document is about.

Warning

Before doing anything else, let us make this clear: Don’t over optimize. In many cases code clarity and performance are not compatible goals and the more performing the code, the more difficult it is to maintain, change, or adapt. In most cases FlexCel is incredibly fast, and you shouldn’t have to depend on dirty tricks to create or read files instantly.

Memory

If there is one thing that can make your applications slower, that thing is using too much memory and starting paging to disk. And sadly, because of the way Excel files are created, and also because of how a spreadsheet works, FlexCel needs to keep the full spreadsheet loaded in memory.

Even when in many cases we use Excel files as databases they aren’t. It is impossible to randomly read or write cells from an xls/xlsx file, and due to the way formulas work, a single change in a cell might affect the full file. For example, imagine that we have a spreadsheet with cell A1 = 1, and in the second sheet, Sheet2!E4 has the formula “=Sheet1!A1 + 1” When we change the value at cell A1 from 1 to 2 we need to change the formula result in Sheet2!E4 from 2 to 3. Also, if we insert a row before A1, we will need to change the cell Sheet2!E4 from “= Sheet1!A1 + 1” to “=Sheet1!A2 + 1”. This makes it very difficult to work with just a part of the file in memory, and neither we nor Excel do it. We both load the full file into memory and do all of our work there.

The main issue with running out of memory is that performance degradation is not linear. That is, you might use 1 second to write a million cells, but 1 minute to write 2 million, and 1 hour to write 3 million. This is one of the reasons we don’t normally quote silly benchmark numbers like “n cells written per second”; they are meaningless. If you take n seconds to write m cells, it doesn’t mean that to write 2*m cells you will need 2*n seconds. Performance degrades exponentially when you run out of memory.

So we make a lot of effort to try to not use too much memory, for example, repeated strings in cells will be stored only once in memory, or cell styles will be shared between many cells. But no matter what, we are a fully managed .NET library, and we can’t escape the limitations of the platform. .NET applications do use a lot of memory, and the Garbage Collector might not release everything you need either. This is not necessarily a bad thing, using the memory you have is good not bad, but for huge files it can become problematic.

There are 2 ways you can get around the memory problem: using FlexCel in “Virtual Mode”, or going to 64-bits. We will expand on this in the sections below.

Warning

Before continuing, we would like to give one last warning about memory.

Measuring memory consumption can be very complex, especially in .NET. You need to measure how many objects you have in Generations 0, 1 and 2, you need to distinguish between private and public bytes, and you need a memory measurement tool. Task manager isn’t such tool.

Virtual Mode

Sometimes you don’t really need all the complexity that a spreadsheet allows; you just want to read values from cells or dump a big database into a file. In those cases, it might not make sense to have the full file into memory, you could read a cell value, load it in your application, and discard the value as the file is being loaded. There is no need to wait until the entire file has been read to discard all the cells.

For this, FlexCel provides what we know as “Virtual Mode”, a special mode where cells are read on demand. Not all features are supported in this mode, but normally for the huge files where Virtual mode makes sense, those features aren’t needed either.

The normal way you open a file is as follows:

normal mode model

You call ExcelFile.Open, and FlexCel reads the file and loads it into memory.

In virtual mode, it works as follows:

virtual mode model

You call ExcelFile.Open, and the file is read. But for every cell read, the VirtualCellRead event is called, and the cell is not loaded into the memory model. You will end up with an ExcelFile object that has no cells (but has charts, drawings, comments, etc.).Cells can be used by your application as they are being read. You can get the rest of the things (comments, merged cells, etc.) from the memory model after the file has been opened.

There is a simple example on how to use virtual mode in the ExcelFile.VirtualMode documentation. A more complete example is at the Virtual Mode api demo.

64-bits

Sometimes, if you have a memory problem and the application runs server-side, the cheapest solution might be to install more memory in the server. But in 32-bit mode, no matter how much memory you have, FlexCel will never use more than 2 Gb.

If you want to use more memory than that you should use FlexCel in 64-bit mode. Note that FlexCel.dll is compiled as “Any CPU”, and that means that it will work in 32-bit mode if your application is compiled as a 32-bit application and 64-bit mode if it is compiled as 64-bit. You don’t need a different assembly.

But we should go into warning mode again:

Warning

Going 64-bits might not only not improve performance, it might decrease it. In our tests in a 4Gb machine, 64-bit version is consistently slower than the 32-bit one (both versions running in a 64-bit Operating System).

It kind of makes sense, since by going 64-bits now every pointer is 8 bytes instead of 4, so there is a lot of memory used in those bigger pointers, that are mostly 0 anyway. For 64-bit to improve things, you need a lot of memory installed.

By the way, .NET 4.0 is much better than 3.5 in our tests for 64-bits, getting almost the speed of 32-bits, while in 3.5 64-bit is really bad. So if you are thinking about going 64-bit, consider at least .NET 4.0.

Server side

One of the most common uses for FlexCel is server-side. You install an app using FlexCel on a server, preferably with lots of cores, and people access it through a web page or web service.

If your CPU has 32 cores and life was perfect, opening 32 files in 32 parallel threads would take the same time as opening one file. But, life isn't perfect, and you might see noticeable performance degradation when opening many files in parallel.

FlexCel itself doesn't have any locks or shared memory when opening files, so all threads should be independent in theory. But still, you will see the degradation as the number of threads increases. There are multiple reasons for this: One is that the server might have 32 cores, but it still has one memory and one SSD, and all threads have to compete for memory. Also, the CPU might throttle the speed when using too many cores to keep it thermally safe.

But once again, the main problem is memory. Or, more precisely, memory allocations. The problem is worse when opening files because, in that stage, FlexCel allocates a lot of memory as it reads and creates an in-memory model of the file.

The garbage collector for .NET apps is optimized for client-side use. It tries to minimize latency, not the total time used. For client applications, this is what you want, but for a server, configuring the GC to be Server-GC can improve the throughput a lot.

You can get information on Server-GC here: https://docs.microsoft.com/en-us/dotnet/standard/garbage-collection/workstation-server-gc https://devblogs.microsoft.com/premier-developer/understanding-different-gc-modes-with-concurrency-visualizer/

To make your application use Server-GC, you can add the following lines to the csproj:

<PropertyGroup>
  <ServerGarbageCollection>true</ServerGarbageCollection>
</PropertyGroup>

then you can add the following line to your app to verify that you are really using Server-GC (it can be tricky to get it working):

Console.WriteLine(GCSettings.IsServerGC);

Server-GC can make a big difference in a server serving lots of requests in parallel.

Note

Another way to attack the multithreading problems is to use multiple processes, one per user, instead of multiple threads. If you chose this option, make sure to use workstation-GC, since there will be a single thread in each process.

Loops

Don’t fear loops

From time to time we get emails from people migrating from OLE Automation solutions, asking us for a way to load all values into an array, and then write the full array into FlexCel in one single method call.

This is because in OLE Automation, one of the “performance tips” is to do exactly that. Set the cell values into an array, and then copy that array into Excel. But this is because in OLE Automation method calls are very expensive.

And this concept is worth expanding: Excel itself isn’t slow; it is coded in optimized C/C++ by some of the best coders in the world. So how is it possible that third-party libraries written in high-level languages like FlexCel can be so much faster? This is in part because Excel is optimized for interactive use, but more important, because while Excel itself is fast, calling Excel from OLE Automation is not.

So any good OLE Automation programmer knows that to maximize the speed, he needs to minimize the Excel calls. The more you can do in a single call the better, and if you can set a thousand cells in one call that is much better than doing a thousand calls setting each value individually.

But FlexCel is not OLE Automation and the rules that apply are different. In our case, if you were to fill an array with values so you can pass them to FlexCel, it would actually be slower. You would use the double of memory since you need to have the cells both in the array and in FlexCel, you would lose time filling the array, and when you finally call the imaginary “ExcelFile.SetRangeOfValues(array)” method it would loop over all the array and cells to copy them from the Array to FlexCel since that is the only way to do it.

So just lopping and filling in FlexCel directly is faster; filling an array before setting the values only would add overhead.

Beware of the ending condition in “for” loops in C#

When you are coding in C#, you need to be aware that the ending condition of the loops is called for every iteration. So in the code:

for (int i = 0; i < VeryExpensiveFunction(); i++)
{
    DoSomething();
}

VeryExpensiveFunction() is called for every time DoSomething() is called.

This can be from a non-issue when VeryExpensiveFunction isn’t too expensive (for example it is List.Count) to a disaster if VeryExpensiveFunction is actually expensive and the iteration runs for millions of times (as it can be the case when using “ExcelFile.ColCount”).

The solutions to this problem normally can be:

  1. Cache the value of VeryExpensiveFunction before entering the loop:
int Count = VeryExpensiveFunction();
for (int i = 0; i < Count; i++)
{
    DoSomething();
}
  1. If the order in which the loop executes doesn’t matter, you might simply reverse the loop:
for (int i = VeryExpensiveFunction() - 1; i >= 0; i--)
{
    DoSomething();
}

This way VeryExpensiveFunction will be called only once at the start, and the comparison is against “ i >= 0” which is very fast.

Avoid calling ColCount

ExcelFile.ColCount is a very slow method in FlexCel, and it is mostly useless. To find out how many columns there are in the whole sheet, FlexCel needs to loop over all rows and find which row has the biggest column. You normally just need to know the columns in the row you are working in, not the maximum column count in the whole sheet.

Note

Note that RowCount is very fast, the issue is with ColCount, because FlexCel stores cells in row collections.

Loop only over existing cells

A spreadsheet can have many empty cells in it, and normally you don’t care about them. FlexCel offers methods to retrieve only the cells with some kind of data in them (be it actual values or formats), and ignore cells that have never been modified. Use those methods whenever possible. Look at the example below to see how this can be done.

Evil loop Example

Here we will show an innocent looking example of all the problems studied in this “Loops” section. Even when it might look harmless, it can bring the performance of your application to its knees.

XlsFile xls = new XlsFile("somefile.xls");
for (int row = 1; row <= xls.RowCount; row++)
{
    for (int col = 1; col <= xls.ColCount; col++)
    {
        DoSomething(row, col, xls.GetCellValue(row, col));
    }
}

Let’s study this by our rules. First of all, let’s see the ending conditions of the loops. As explained, xls.RowCount and xls.ColCount are called for every iteration in the loop. This is not too bad for RowCount since RowCount is fast and it is the outer loop, but it is a huge problem for Xls.ColCount, which is not only slow as mentioned earlier, but also runs in the inner loop.

So if the file has 50,000 rows and the maximum used column is column 30, you are iterating 50,000 x 30 = 1,500,000 times. xls.RowCount is called 50,000 times (since it is in the outer loop) and xls.ColCount is called 1,500,000 times. And every time ColCount is called, FlexCel needs to loop over all the 50,000 rows to find out which row has the biggest column.

Using this example is the surest way to kill performance.

So, how do we improve it? The first way could be, as explained, to cache the results of RowCount and ColCount:

XlsFile xls = new XlsFile("somefile.xls");
int RowCount = xls.RowCount;

for (int row = 1; row <= RowCount; row++)
{
    int ColCount = xls.ColCount;
    for (int col = 1; col <= ColCount; col++)
    {
        DoSomething(row, col, xls.GetCellValue(row, col));
    }
}

But while this was a huge improvement, it is not enough. By our second rule, xls.ColCount is slow, and we are calling it 50,000 times anyway. This is better than calling it 1,500,000 times, but still 50,000 times worse than what it could be. The column count is not going to change while we loop, so we can cache it outside the row loop:

XlsFile xls = new XlsFile("somefile.xls");
int RowCount = xls.RowCount;
int ColCount = xls.ColCount;

for (int row = 1; row <= RowCount; row++)
{
    for (int col = 1; col <= ColCount; col++)
    {
        DoSomething(row, col, xls.GetCellValue(row, col));
    }
}

So, for now we have fixed this code to rules 1) and 2). We cache the end conditions in the loop, and we avoid calling ColCount much. (A single call to ColCount isn’t a problem). But still, this code can be incredibly inefficient, and this is where rule 3) comes to play.

In this example, where our spreadsheet has 50,000 rows and 30 columns, we are looping 1,500,000 times. But do we really have 1,500,000 cells? In most cases, we don’t. Remember that ColCount returns the maximum used column in the sheet. So, if we have 5 columns, but we also have some helper cells in column 30 (AD), ColCount will return 30:

But the loop will run as if every row had 30 columns, looping through millions of empty cells. If as in this example we only have 5 columns except for row 1, then we have 5*50,000 + 1 cells = 250,001 cells. But we are looping 1,500,000 times. Whenever you use ColCount for the limits of the loop, you are doing a square with all the rows multiplied by all the used columns, and this will include a lot of empty cells.

We can do much better:

XlsFile xls = new XlsFile("somefile.xls");

int RowCount = xls.RowCount;
for (int row = 1; row <= RowCount; row++)
{
    int ColCountInRow = xls.ColCountInRow(row);
    for (int cIndex = 1; cIndex <= ColCountInRow; cIndex++)
    {
        int col = xls.ColFromIndex(row, cIndex);
        DoSomething(row, col, xls.GetCellValue(row, col));
    }
}

Note that even when ColCountInRow(r) is fast, we still cache it in the ColCountInRowVariable, as it doesn’t make sense to call it in every column loop just because. And as the used columns in every row will be different, we need to call it inside the row loop.

This last version will run millions of ways faster than the first, naïve version.

Note

If you want to read a range of cells, not the full file, you could use this code:

    // Loop at most until the last used row in the sheet.
    // If LastRow is for example 1.000.000, but there are only
    // 3 used rows, it makes no sense to loop over all the empty rows after row 3.
    int LastUsedRow = Math.Min(LastRow, xls.RowCount);

    for (int row = FirstRow; row <= LastUsedRow; row++)
    {
        int LastCIndex = xls.ColToIndex(row, LastColumn);
        int LastColFromIndex = xls.ColFromIndex(row, LastCIndex);
        if (LastColFromIndex > LastColumn || LastColFromIndex == 0) // LastColumn does not exist.
        {
            LastCIndex--;
        }
        if (LastCIndex == 0) continue; // This row is empty. Move to the next row.

        int XF = -1;
        for (int cIndex = xls.ColToIndex(row, FirstColumn); cIndex <= LastCIndex; cIndex++)
        {
            DoSomething(row, xls.ColFromIndex(row, cIndex), xls.GetCellValueIndexed(row, cIndex, ref XF));
        }
    }

Or, if you prefer a one-liner, just call ExcelFile.LoopOverUsedRange which will do the same as what is in the code above.

Reading Files

Ignore formula texts if possible

By default, when you are reading a cell with “ExcelFile.GetCellValue” and the cell contains a formula, FlexCel returns a TFormula class that includes the formula value and text. But returning the formula text isn’t too fast, because FlexCel needs to convert the internal representation into text for each cell.

If you don’t care about the formula texts (“=A1 + 5”), but only about the formula results (“7”), and you are reading huge files with thousands of formulas, setting:

ExcelFile.IgnoreFormulaText = true

before starting to read the file can improve the performance a little.

Note

This particular tip won’t improve performance a lot, and it can make the things more complex if you ever start needing the formula texts. Make sure that the speed increase you get from it is worth it.

Reading CSV files

When reading a CSV (comma separated values) file, FlexCel needs to parse each cell and figure out if it is a number, a date, a boolean, a formula, or maybe just a plain string. If you have millions of cells, this can be a very time-consuming process.

Here we will see some tips to make FlexCel's job easier.

Import the full file as text.

If you don't care about converting strings, you can import everything as text. Importing everything as text is the fastest way to read a CSV file, and it might be a good option even if you care about some cell values, but not all of them. You can always read the full file as text and manually convert the cells you care about.

The code needed to import the full file is as follows:

    ColumnImportType[] ColTypes = new ColumnImportType[FlxConsts.MaxColCount];
    for (int i = 0; i < ColTypes.Length; i++)
    {
        ColTypes[i] = ColumnImportType.Text;
    }

    ExcelFile xls = new XlsFile(true); //Create a new file.
    xls.Open("csv.csv", TFileFormats.Text, ',', 1, 1, ColTypes, Encoding.UTF8, false); //Import the csv text.

And if you later need to convert some cell values to whatever they represent, you can use the code:

    int XF = -1;
    TRichString cellValue = xls.GetCellValue(1, 1) as TRichString;

    //Remember that if you know the date formats, you can pass
    //them as third parameter to ConvertString.
    object value = xls.ConvertString(cellValue, ref XF);
Note

If you want every cell string converted to the corresponding value, don't use this method! It will be slower than just opening the file normally. You should import everything as plain text only if you don't care about the values being all strings, or care only about some cells.

Explicitly define which date formats your file uses.

One of the slowest parts of CSV parsing is figuring out dates. Dates (and times) can be written in many ways and combinations. So, for example, you might have "08/09/1972" in one cell, and you might have "1972-09-08" in another and maybe "08/09/1972 10:00" in a third. This is not a typical case, and you usually will use a single date format, max two, in a file. But FlexCel still has to check, for every cell it reads, if it is a date, and what date that particular cell it is.

So if you know in advance the date and times formats used in the file, passing those to FlexCel will speed up the process significantly. You can use code as below:

    //File formats used in the file:
    string[] dateFormats = { "yyyy-MM-dd", "yyyy-MM-dd hh:mm", "hh:mm" };

    ExcelFile xls = new XlsFile(true); //Create a new file.
    xls.Open("csv.csv", TFileFormats.Text, ',', 1, 1, null, dateFormats, Encoding.UTF8, false); //Import the csv text.

Reports

Reports are by design a little slower than the API, because they must read a template before, parse it and compile before filling the cells. So if you need ultimate performance, don’t use reports, use the API directly. But remember; this advice is similar to “If you need absolute performance use assembler and not C#”. Yes, you will get the most performance in assembler or the API than in C# or Reports. But it might not be worth what you lose in flexibility and ease of use.

Avoid too many master-detail levels

In most cases, the FlexCelReport overhead is virtually zero, as the code in FlexCel was designed from the start to be very efficient when running reports. But there is a case where you can see visible performance degradation and that is when you have many nested master-detail reports.

The problem here is that FlexCel works by inserting ranges of cells. If you have a template with a single range, it will insert the rows needed for every record in the database at the beginning, and then fill those rows. A single insert of n rows, this is very fast.

But if you have a master-detail report, it will first insert all the rows needed for the master, and then, for every record in the master, it will insert all the rows needed for the corresponding detail. If that detail itself has other detail then the inserts grow a lot.

Normally, for more than 3 levels of master-detail, you shouldn’t have very big reports. Most of the times this is ok, since when you have huge reports they are normally just the records of a database. Those will be used for analyzing the data because nobody is going to print or read a million row report anyway. Complex reports designed to be printed or read normally are smaller, and for small reports you don’t really need to care about performance.

Decide whether to use LINQ or Datasets as data sources

FlexCel provides two different ways to access the data: IQueryable<T> objects and datasets. In theory, IQueryable objects can be a little faster because they don’t load all the data in memory, fetching it as it is needed. But in practice, there is normally not a real performance difference unless you are really memory bounded. In fact, datasets can be faster than IQueryable objects because all the data is just fetched once from the database, and once that is done you don’t hit the database anymore. And datasets are extremely efficient at fetching tables from databases.

As always, the best way to know what is faster in your cases might be testing. You might expect LINQ datatables to be a little faster with huge datasets with no master-details, and datasets to be faster in small reports with lots of nested master-detail levels.

Load tables on demand when using Datasets

When using DataSets in the common way, you need to know in advance what tables are needed for the report, and load them before the report is run. Something like this:

FlexCelReport.AddTable(LoadTable(table1));
FlexCelReport.AddTable(LoadTable(table2));
FlexCelReport.Run();

This is ok if you are going to need both table1 and table2 in the report, but in more complicated cases where you don’t know in advance which tables might be used it can be a waste of resources. You might be loading table2 from the database, and only using table1 because the user checked a checkbox in the application for a “short” report that doesn’t need table2.

If you are using LINQ this isn’t a real problem; you can AddTable() as many tables as you think you might need, and the data will be fetched from the database only when that data is actually requested. But with datasets, all data is preloaded before running, so all tables will be queried from the database.

To solve this problem, FlexCel offers “on demand” loading of datasets through the LoadTable event. Instead of using AddTable, you can assign the “LoadTable” event in the report and only load the tables when they are actually requested by the report. For example you could call:

FlexCelReport fr = NewFlexCelReport();
fr.LoadTable += new LoadTableEventHandler(fr_LoadTable);
fr.Run(...);

and define the event "fr_LoadTable" as:

void fr_LoadTable(object sender, LoadTableEventArgs e)
{
    ((FlexCelReport)sender).AddTable(e.TableName,
      GetTable(e.TableName), TDisposeMode.DisposeAfterRun);
}

You could also use DirectSQL or User Tables to avoid preloading the datasets.

Warning

Let us repeat: This only applies to datasets. When using LINQ, data is always fetched from the server when (and if) it is needed.

Profile the SQL sent to the server when using Entity Framework

When using IQueryable<T> datasets as datasources for the reports, SQL is generated on the fly and sent to the database. While this is good because you are not loading the datasets fully in memory, if you don’t have the correct indexes in the database or if the queries are not correctly made, you might have a big performance impact. Sometimes the full table might be loaded from the database and then filtered locally. Make sure the SQLs sent have the correct “Where” part.

If you are using SQL Server, a simple way to check this is to run the SQL profiler in the server while running the report.

You should see two queries for every band, the first to query for the number of records in the band, and the second to retrieve the values. FlexCel needs the first query to know how many rows to insert in advance, since inserting rows in Excel is a costly operation.

The following example shows a typical log from a single table:

server profiler log

You can see the “Select count” statement highlighted in the screenshot above.

Make sure that the SQL sent to the server makes sense. For some tables that have the same data repeated over and over again it might make sense to cache the results.

Provide the Record Count if possible when using LINQ Datasets

FlexCel does its reports by inserting rows and columns. As inserting a row or column isn’t a cheap operation, it tries to minimize the number of inserts. So, if you have a table with 1000 rows, FlexCel won’t do 1000 inserts of one row each; it will ask for the row count to the database, and insert 1000 rows in a single pass.

For datasets this isn’t an issue, as the dataset has all data in memory: the row count is a very fast operation just returning the length of the internal array that holds the data in memory. But when using LINQ datasets, this is not always the case. It is ok for List<…> collections since again “Count” will be called and that is fast. But in Entity Framework an SQL “Select count * from…” will be sent to the server, and in the worst case LINQ might need to iterate through all values in the IEnumerable to get the count.

If the collection that holds your objects is slow to compute the count, and you know the count anyway, you can tell FlexCel the record count by having a field “__FlexCelCount” in your business object. For example:

Class MyBusinessObject { ... public int __FlexCelCount{get;} }

If FlexCel finds a column named “__FlexCelCount” in your collection, it will assume this is the value of the row count, and it won’t call “Count()” in the collection.

Please note that this is a last resort optimization. Count should be fast anyway for most cases, and by adding a “__FlexCelCount” field to your business objects, you will probably just making them more complex without any real gain. We provide this for really special situations, but this optimization isn’t something that should normally be done.

Avoid Microsoft Distributed Transaction Coordinator (MSDTC) when using Entity Framework

When using Entity Framework as data sources, you normally need to run the report inside a “Snapshot” transaction to avoid data being modified while the report is running. If you don’t open the database connection before running the report, transactions might be promoted to distributed transactions, as the connection will be opened and closed many times while running the report. When the connection is opened a second time inside the transaction, it will be promoted to distributed.

See

http://www.digitallycreated.net/Blog/48/entity-framework-transactionscope-and-msdtc

for more information.

Prefer snapshot transactions to serializable transactions

When reading the data for a report, there are two transaction levels that can be used to avoid inconsistent data: snapshot or serializable. While both will provide consistent data, “serializable” provides it by locking the rows that are being used, therefore blocking other applications to modify the data while the report is running. “Snapshot” transactions on the other side operate in a copy of the data, allowing the other applications to continue working in the data while the report is running.

If your database supports snapshot transactions, and your reports take a while to run, and other users might want to modify the data while the report is running, snapshot transactions are a better choice.


FlexCel PDF Exporting Guide | FlexCel Studio for the .NET Framework documentation

FlexCel PDF Exporting Guide

Introduction

FlexCel comes with a full PDF writer that allows you to natively export Excel files to PDF, without needing to have Acrobat or Excel installed. While the output will not be exactly the same as Excel, a lot of effort has been done to make it as similar as possible.

Creating PDF files

FlexCel provides two ways to create a PDF file. At a higher level, you can use FlexCelPdfExport component to convert an Excel file into a PDF file. At the lower level, you have the PdfWriter class, that provides a primitive API to create PDF files.

Using PdfWriter

PdfWriter is a lower level option, and it was really not designed to be used directly, but to provide the methods FlexCelPdfExport needs to do its job.

But it can be used standalone to create a PDF file for scratch, or most likely to modify the output from FlexCelPdfExport using one of the FlexCelPdfExport.BeforeGeneratePage or FlexCelPdfExport.AfterGeneratePage events.

We will not cover it in detail here since methods are documented in PdfWriter, but it is worth mentioning that there is also an example to get you started in the API Demos.

Using FlexCelPdfExport

This is a higher level option, and the one you would normally use. The simplest skeleton to export a file to pdf would be:

    using (FlexCelPdfExport pdf = new FlexCelPdfExport(xls, true))
    {
        pdf.Export("result.pdf");
    }

While the above snippet of code should be enough in many cases, you can add to it in the following ways:

  1. You can set the FlexCelPdfExport properties. You will find there are not a lot of properties (things like margins, printing gridlines or not, etc) and this is because all this information is read from the Excel file. If you need to change them, change the associated properties on the attached XlsFile object.

For example, to change the page margins you can use the ExcelFile.SetPrintMargins method.

Tip

As always, you can use ApiMate to find out how to change the printer settings in the XlsFile object.

But while all the document-specific settings are stored in the XlsFile object, that doesn't mean there aren't properties specific to the PDF output. You can change things like the PdfType or Kerning used in the PDF export. Make sure to take a look at the available properties in the documentation for FlexCelPdfExport

  1. You can export multiple Excel files to the same PDF file. To do that, you use FlexCelPdfExport.BeginExport, then FlexCelPdfExport.ExportSheet or FlexCelPdfExport.ExportAllVisibleSheets, and finish the exporting by calling FlexCelPdfExport.EndExport

An example of multiple files would be:

    using (FlexCelPdfExport pdf = new FlexCelPdfExport())
    {
        pdf.AllowOverwritingFiles = true;

        using (FileStream pdfstream = new FileStream("result.pdf", FileMode.Create))
        {
            pdf.BeginExport(pdfstream);
            pdf.Workbook = xls1;
            pdf.ExportAllVisibleSheets(false, "First file");
            pdf.Workbook = xls2;
            pdf.ExportAllVisibleSheets(false, "Second file");
            pdf.EndExport();
        }
    }

Font Management

The font handling when creating pdf files can be problematic, so here we discuss some concepts related to them.

Selecting which fonts to use

First of all, you need to know that there are two different kinds of fonts supported by FlexCel's PdfWriter.

  1. PDF internal fonts. PDF defines 14 standard fonts that must be available to any PDF viewer, so you don't need to embed the fonts on the PDF document. They will always be supported by the PDF viewer.

    Those fonts include a Serif (Times New Roman-like), a Monospace (Courier-like) and a Sans Serif (Arial-like) alternatives, on four variants each (regular, bold, italic and bold italic) and two Symbol fonts.

    What those fonts don't include is Unicode characters outside the ASCII range, so if you are using those, you can't use internal fonts. FlexCel will automatically change the fonts to be true type if your document contains characters outside the ASCII range.

  2. True Type fonts. Those are standard Windows fonts.

When exporting to PDF, you can choose between three different ways to handle fonts, depending on the value you set on the FlexCelPdfExport.FontMapping or PdfWriter.FontMapping property:

  1. ReplaceAllFonts. This will replace all fonts on the xls file to the most similar ones on the 14 standard fonts. This way you get the minimum file size and the maximum portability, but the exported PDF file might not look exactly the same, as you will lose all fancy fonts.

  2. ReplaceStandardFonts. This is a compromise solution. It will only replace Arial, Times New Roman and Courier for the standard fonts, and use True type for all the others. You will get a bigger PDF file (if you embed the true type fonts), but it will look the same as the Excel file.

  3. DoNotReplaceFonts. This will only use true type fonts. It will be the one that better matches the xls file, but it will be a lot larger (if you embed the true type fonts) or might not look good when the user does not have the fonts you used installed (if you don't embed them)

Note

Besides choosing how the fonts will be replaced when creating the PDF, you can also choose whether to embed the True Type fonts or not. If you embed them, the file will be bigger, but also will render well when the user does not have the fonts on his machine. To avoid issues, it is normally recommended that you embed all fonts.

Important

If you use Unicode characters, the fonts will always be embedded no matter which embed option you choose. This is needed to ensure that the Unicode mapping will remain correct.

Note

With the rise of Android and iOS devices you can't just assume that the final user will have any fonts (not even Arial) installed on the device where he is reading the file.

If you add the fact that the size increase by embedding the fonts isn't that much given the size of even a small webpage, we can only recommend you that you just embed all fonts.

FlexCel used to default to not embedding fonts, but since version 6.5 it defaults to embedding all fonts.

Font Subsetting

When embedding fonts you can choose if to embed the full font, or just the characters that were actually used in the document. You can control this with the property FlexCelPdfExport.FontSubset

If you embed just the subset of characters used, the file will be as you might expect smaller. For big fonts with thousands of characters the subsetting can make a big difference in size.

But on the other hand, if you embed only the subsets, the final users might not be able to edit the PDF document to add text, since the characters they might want to add might not be in the embedded subset.

You might see the issue that users won't be able to so easily edit the PDF documents as a feature, since PDF files are not normally generated for editing. And this is the reason FlexCel defaults to subsetting all fonts.

But if you care about the users being able to edit the PDF files you create, remember to set FlexCelPdfExport.FontSubset = true.

Accessing True Type data.

In order to embed fonts and get many font metrics that we need to create the pdf file, FlexCel needs to access the raw *.ttf files directly. FlexCel uses different ways to access the font data depending on the platform you are using (Windows, iOS, Android, etc):

  1. On Linux (using SKIA, not Linux in Mono), iOS and macOS FlexCel asks the operating system for the font data directly, and there is nothing that you need to do.
  2. On the rest of platforms (Windows , Windows Store and Android) FlexCel looks for the font folder, and reads the files directly from there.

When reading the ttf files from disk, FlexCel will try to locate the files in the following folders:

  • OS default font folders.

  • if the OS default font folder is empty, then we assume we are running on Linux (under Mono WinForms), and we will try “/usr/X11R6/lib/X11/fonts/truetype”. Note that when running in Linux with SKIA we will read the fonts directly from the OS, so we won't be looking for them in any folder. This applies only to Linux with Mono.

  • if the folders above don't exist, FlexCel will search on “<folder where FlexCel.dll is>/Fonts”.

  • If still failing to find the font folder, FlexCel provides a FlexCelPdfExport.GetFontFolder event that allows you to specify where fonts are stored on your system. Here you can tell FlexCel where the fonts are.

Note

Avoid using the GetFontFolder event if you can, since when you use it your code will not transparently run on different platforms. A Symbolic link from the FlexCel installation folder to the fonts should be a more elegant solution.

  • Finally, if you have your true type fonts not available as files, but maybe as resources or entries in a database, you can use the FlexCelPdfExport.GetFontData event to provide the font data directly instead of a folder where FlexCel will look for the files.
Note

If you don't mind using p/invokes, you can use the FlexCelPdfExport.GetFontData event to call GetFontData on the GDI API, and return the font information to FlexCel. This way you will avoid scanning the font folder completely, and it can speed up a little PDF export.

While we do not recommend that you go unmanaged for this since scanning the font folder is fast anyway, you have all options. Do what you prefer.

For a demo on using the GetFontData event, see the ExportPdf demo.

Fonts in Windows

Since Windows 10 version 1809, Windows has two different default font folders. The classic "c:\Windows\Fonts" (or similar) for all users, and a new folder for the current user only, located at %localappdata%\Microsoft\Windows\Fonts

FlexCel 7.6 or newer will search in both folders by default. If you are in an older FlexCel version, you might want to use the FlexCelPdfExport.GetFontData event to specify both folders. You will need to check if the %localappdata%\Microsoft\Windows\Fonts folder exists (because FlexCel versions older than 7.6 will raise an exception if any of the folders you pass to the GetFontFolder event don't exist). If the folder exists, you will need to pass both the global-font-folder and the user-font-folder to the event, separating them with a semicolon (;)

Note

Newer versions of Office 365 have Cloud Fonts which are fonts that are not available to Windows, only to Office.

Those fonts are installed in a private folder (which at the time of writing seems to be %localappdata%\Microsoft\FontCache\4\CloudFonts in Windows and ~/Library/Group Containers/UBF8T346G9.Office/FontCache/4/CloudFonts in macOS, but those folders might change)

FlexCel (and Windows itself) won't see those fonts, unless you add them to the Fonts search folder using the FlexCelPdfExport.GetFontData event. If you want to use those fonts in your document and with FlexCel, we would recommend that you install them in the Windows Fonts folder. But always check the font license to see if you are allowed to do so.

See also this Cloud Fonts tip

Important

It is strongly recommended that you install the fonts in the operating system itself. If you just change the font path with the FlexCelPdfExport.GetFontData event, FlexCel will be able to find the font, but the OS itself will not. FlexCel uses OS functionality for example to measure the fonts, so if the OS can't see the fonts, it will likely report invalid data, unless there is a very similar substitute font.

Finding where a font is installed

As explained above, a font might be installed in different folders, and new "default" font folders might appear in the future. If you see a font installed in Windows and want to know where the font actually is, you can follow the steps below:

  1. In the start menu, search for "Font Settings"

  2. In the font dialog, search for the font you want, and double-click it. windows font dialog

  3. Once in the font, click in "Metadata" (1) and select the variant you want. Note that different font variants might be installed in different files, and even in different folders. Once selected, you should see the filename of the actual font file below (2) windows font detail

Fonts in iOS and macOS

On iOS and macOS, FlexCel can access the true type directly from the Cocoa framework, so exporting to pdf should work without issues and without any extra step in those platforms. Note that in any case, the fonts available might be different from the fonts available in a Windows machine. You can get a list of fonts available in macOS here: http://en.wikipedia.org/wiki/List_of_typefaces_included_with_Mac_OS_X and in iOS here: http://iosfonts.com

Fonts in Android

At the time of this writing, in Android there are only 4 predefined fonts available for every app (Droid Sans, Droid Serif, Droid Mono and Roboto). This means that unless you want to use the internal pdf fonts, your application will have to provide its own fonts.

As in Android you will normally deploy your fonts as assets, FlexCel comes with prebuilt functionality for handling Assets. You can read more about it at the Fonts section of the Android Guide

Fonts in Excel 2007 and newer

Excel 2007 changed the default font in a new file to be “Calibri” instead of “Arial”. This might bring you problems if you develop in a machine that has Excel 2007 installed, but you deploy in a server that doesn't. There are two solutions to this:

  1. You can copy the Excel 2007 fonts to the server, and make sure you embed the fonts in the PDF file. Note that if you do not embed the fonts, any user who does not have office installed might not be able to see your PDF file correctly.

  2. If you want maximum portability, make sure you change all fonts to Arial or Times New Roman in your template before exporting.

Setting the “Normal” font

Especially important when changing the fonts is to make sure the “Normal” format uses a known font. You can see/change the normal font this way:

  1. In Excel 97-2003: Go to “Menu->Format->Style...”

  2. In Excel 2007 or newer: In the home tab in the Ribbon, select Cell Styles, right click in “Normal” and choose "Modify". Note that depending on your screen resolution, “Cell Styles” might show as a button or just display the “Normal” box directly in the ribbon.

    modify normal format

In both cases you should get a dialog similar to this:

Make sure the normal style uses a font you have in your server.

The “Normal” style is used not only for empty cells, but to set the column widths. For example, this is how an empty sheet looks with “Normal” style using Calibri with 11 points:

And this is how it looks using everybody's favorite font, Comic Sans with 28 points:

empty excel comic sans

As you can see, the font used in the “Normal” style is used to draw the headings “A”, “B”, “1”, etc., and even more important, it is used to calculate the column width. Column with is measured as a percentage of the “0” character width in the normal font. If you change the normal font, column widths will change.

If you do not have the “Normal” font installed in your server, Windows will replace it with a substitute, and it will probably have a different width for the “0” character, leading to a wrong column width. So it is important that you have the normal font installed in your server.

Dealing with missing fonts and glyphs

There are three main font-related problems you might find when converting an Excel file to PDF, and we are going to cover them in this section. The errors are non-fatal, and that means that the file will be generated anyway, but it will not look as good as it could.

You can control what to do when any of these errors happen by hooking an event to the FlexCelTrace static class. From this event, you could write to a log file when any of these errors happen, warn the user, or just raise an exception if you want to abort file generation.

Problem 1: Missing fonts

This is normally the easiest one to solve, and normally happens when deploying an application to a server. As explained in the section above, this often happens with “Calibri” font that gets installed by Excel, and probably will not be installed in the server. As FlexCel needs the font to be present in order to create the pdf file, it will substitute it with a “similar” font, normally Arial or Microsoft sans serif.

This might not be an issue if there are any fonts in the system that are similar to the one being replaced, but it can be a big issue with Calibri, since that font has very different metrics from the font it gets replaced (Arial). As an example, here you can see an Excel file using Calibri exported to PDF in a machine that has Calibri installed an in other that doesn't:

With Calibri installed in the fonts folder:

pdf export with calibri

Without Calibri installed (Replaced by Arial):

pdf export without calibri

As you can see in the images, Calibri is much narrower than Arial, so the text in cell B2 “This Text is in Calibri” is cut in the second screenshot. If you are seeing lots of cut text in the server while the files are exported fine in your development machines, this is probably the cause.

Tip

You can get a Calibri clone in Linux by installing the Carlito font:

sudo apt-get install fonts-crosextra-carlito

You can also get a Cambria substitute:

sudo apt-get install fonts-crosextra-caladea

And to get the "classic" fonts like Arial or Times New Roman, you can either use the Google Crosscore fonts, the Liberation fonts or install the Microsoft core fonts for the web.:

sudo apt-get install ttf-mscorefonts-installer

The solution to this problem is easy; make sure you have all the fonts you use installed in your system. If you want to get notified whenever this automatic font replacement happens, you can catch the FlexCelError.PdfFontNotFound errors in FlexCelTrace, and use it to notify the user he should install the missing fonts.

Note

To change all fonts of a given type to a different type in the Excel file instead of the pdf, take a look at Replacing a font by another in an Excel file.

Problem 2: Missing Glyphs

This problem happens when you are using a font that doesn't contain the character you want to display. If you for example write

“日本 に行きたい。”

inside a cell and keep the font “Arial”, you will see the correct characters in Excel, but when exporting you might see blank squares like this:

□□ □□□□□□

The reason for this is that “Arial” doesn't actually contain Japanese characters, and Excel is “under the hood” using another font (normally MS Mincho) to display the characters. To emulate this behavior, FlexCel provides a FlexCelPdfExport.FallbackFonts property, where you can enter a list of fonts to try if the font that was supposed to be used doesn't have the character. If no font in the FallbackFont chain contains the glyph, you will see a blank square.

The solution in this case is to use fonts that actually have the characters you want to display, or ensure that some fonts in the FallbackFonts properties have them. By default FlexCel uses “Arial Unicode MS;Segoe UI Symbol;Yu Mincho;Yu Gothic;Ms Mincho;Ms Gothic” as fallback fonts, but you can add as many others as you need.

Tip

Windows 10 changed which fonts are available in a default Windows installation. So for example while in Windows 8 or older Arial Unicode would be a font installed by default, in Windows 10 it isn't.

It also replaced "Ms Mincho" by "Yu Mincho" and "Ms Gothic" by "Yu gothic".

This is the reason the default Fallback fonts in FlexCel include so many fonts: We can't know in which OS you are going to run it, so we try both the default fonts for Windows 10 and for older.

Tip

Usually setting the fallback font is enough to deal with missing glyphs. But some fonts, especially for non-Latin characters, might not come with bold or italic variants. So when the fallback font is used, the bold or italics won't show, or show as faux-bold/faux-italics (See Problem 3 below).

As always, the best solution here is to use fallback fonts that have italics and bold variants. But if you can't find a font that has them, you might need to specify different fallbacks for bold or italics.

Let's see a little example: Imagine that you have Font1 which has only non-bold characters, and Font2 which only has bold. If you set the FallbackFonts to Font1, then FlexCel won't use Font2 for the bold, and if you set Font2 in the fallbacks, then FlexCel will use the bold font even for non-bold characters.

To deal with this, you can use the properties FlexCelPdfExport.FallbackFontsBold, FlexCelPdfExport.FallbackFontsItalic and FlexCelPdfExport.FallbackFontsBoldItalic to specify different fallback fonts for bold, italics or bold and italics variants. So you can set Font1 ad the main FallbacksFont, but specify Font2 as FallbackFontsBold. When a font is bold, FlexCel will first look at FallbackFontsBold, and only if it can't find a suitable font there, then go and search for the default FallbackFonts.

If you want to get notified when a fallback font replacement happens so you can warn the user to change the fonts, you can catch the FlexCelError.PdfGlyphNotInFont and FlexCelError.PdfUsedFallbackFont errors in FlexCelTrace.

Problem 3: Faux Italics and Bolds

The last problem is related to fonts that don't have a specific “Italic” or “Bold” variant. Normally, a quality font comes with at least four files including four more common variants of the font: Bold, Italic and BoldItalic. And they can include even more variants. If you look in your font folder, you will see things like this:

That is, a different file for each font variant. If the font comes with only one “Normal” file, the italics can be faked by the system by slanting the characters, and bold can be faked by adding some weight to the characters. But of course this leads to low-quality results, and should be avoided whenever possible.

The solution to this problem is to use fonts that include the variants you need.

Normally this is not a problem, since all quality fonts designed to be used with Italics and Bold already come with files for those variants.

Note

There is a property named FlexCelPdfExport.UseFauxStyles which you can set to false if you don't want FlexCel trying to simulate bolds or italics for the fonts that don't have those styles.

To be notified whenever FlexCel finds a “fake” style, you can use the FlexCelError.PdfFauxBoldOrItalics notifications in FlexCelTrace.

Accessibility of the generated files

Setting a natural language

It is important to set a natural language for the document if you know what language the document is written in. This way a screen reader or a text-to-speech engine will be able to correctly read the text out loud.

To set up the language in FlexCel to for example Spanish, use code like this:

pdf.Properties.Language = "es-ES";

Tagging the files

FlexCel allows to create Tagged PDFs, which contain extra information about the document structure (like for example what are the cells in the table). This information allows a screen reader to know the correct order to read the text.

As it is an important accessibility feature, since FlexCel 6.5 files are tagged by default. You must explicitly turn tagging off with FlexCelPdfExport.TagMode in order to get untagged pdfs.

Important

Tagged pdfs can be much bigger than normal ones, so this might be a reason to turn tagging off. If your files are big, try saving with and without tagging to compare the sizes; then decide if tagging is worth. For small documents, tagging should be kept on.

Creating PDF/A files

PDF/A files are files designed specifically for archiving. FlexCel has full support for the variations of the standard: PDF/A1a, PDF/A1b, PDF/A2a, PDF/A2b, PDF/A3a and PDF/A3b.

If you need to choose a version, we would recommend PDF/A2 or PDF/A3. PDF/A1 is a little too restrictive, and lacks some features that FlexCel could use to generate better files: It doesn’t support transparency and it doesn’t allow compressing the tags in the document. Due to the lack of transparency, if you have any transparent image in your file it might look wrong. Due to the lack of tag compression, files will be much bigger than PDF/A2.

In order to create PDFA files, you need to set PdfWriter or FlexCelPdfExport property FlexCelPdfExport.PdfType to the correct version. For example:

pdf.PdfType = TPdfType.PDFA1

Then you need to choose if you want to generate “a” (PDF/A1a, PDF/A2a, PDF/A3a) or “b” (PDF/A1b, PDF/A2b, PDF/A3b) files. “a” files are the most complete, and they require you to tag the file. "b" files don't require tagging, so they can be smaller if the documents have a lot of pages.

When using FlexCelPdfExport, you would just set the correct option by changing the FlexCelPdfExport.TagMode property:

pdf.TagMode = TTagMode.None; //Generates “b” files

As the TagMode is Full by default, FlexCel by default generates “a” files.

When using PdfWriter, you need to manually tag the files, as FlexCel can’t know the structure from the drawing commands. You need to use the methods PdfWriter.TagContentBegin and PdfWriter.TagContentEnd to specify the blocks of text you want to tag, and then set the TagActions property to specify how that tagged content relates to the structure of the file. Tagging in PdfWriter is an advanced topic outside the scope of this document. Due to the way PdfWriter is designed, it won’t keep tags in memory and you need to write them directly to the file as you are creating it.

Signing PDF Files

FlexCel allows you to sign your PDF files with a certificate, so any change to the file will invalidate it. This is how a signature looks like in Acrobat DC:

acrobat sign panel

Important

FlexCel signing algorithm is supported only in Acrobat 7 or newer, it will not work in Acrobat 6 or 5 since those versions do not have the required support. Furthermore, SHA512 is only supported in Acrobat 8 or newer, and SHA1 is known to have vulnerabilities and it is not recommended to use. Because of these reasons, the header in the generated PDF file will automatically switch to say that the file is “Adobe 8 or newer” compatible when you include a signature in your files. If there are no signatures, the default header specifies the file is “Acrobat 5 or newer” compatible.

It is also worth noting that users will still be able to see the generated files in Acrobat 5, 6 or 7, but they will get a warning when opening them and the signature will not validate.

Concepts of signing are outside the scope of this document, but you can find a lot of information in signing in the Acrobat documentation or just in Internet. A good place to start might be:

http://msdn.microsoft.com/msdnmag/issues/07/03/NETSecurity

And you can look at the Signing Pdfs example to see how to sign a PDF with FlexCel.

Customizing the Signing Engine

FlexCel comes with a built-in signing implementation, but it allows you to change it by your own in case you have a better signer implementation. There is mainly one reason you might want to do that:

The built-in engine is not optimal. It uses the standard .NET PKCS classes, and those classes do not allow for incremental signing. This means that the whole PDF document must be kept in memory so we can pass all the contents as a byte array to the signing method in .NET. If you have a library that supports incremental signing, that is, each time a small group of bytes is written you recalculate the hash instead of calculating the whole hash at the end, you can save memory by creating your own engine. Just make sure you need the extra performance before doing so, because normally the built-in implementation is good enough, and has the advantage of being 100% managed and built-in in the framework.

If you decide to create your own Signer class, you need to implement two simple abstract classes:

1. TPdfSigner

This is the class that implements the signing. You need to override three methods:

TPdfSigner.Write, TPdfSigner.GetSignature and TPdfSigner.EstimateLength. The first method is called each time some bytes are written to the file. You should use them to calculate a PKCS7 signature with them. If you can't calculate the signature incrementally you will need to buffer them and calculate it when GetSignature is called. The second method, GetSignature, is called only once at the end of the pdf file and it should return the PKCS encoded signature as an array of bytes. The third method must return the length of the byte array that will be returned by GetSignature or a bigger number, but never smaller. Note that this third method will be called before the signature is computed so you might need to estimate the length.

2. TPdfSignerFactory

This class is really simple, and it just should return an instance of the particular TPdfSigner child you created in 1).

When creating your own classes, it might be helpful to look at the TBuiltInSigner implementation on file Signatures.cs. Also look at ExportPdf demo.

Export to PDF and FlexCel recalculation

When you create a report with FlexCel most formulas are recalculated, but some are not. This is not an issue when opening the file with Excel, as Excel will recalculate the whole file again, but will be an issue when exporting the Excel file directly to PDF.

FlexCel implements over 300 Excel functions, and most used formulas are there so you should not experience big issues. But you need to make sure you do not use any not implemented function to get a properly recalculated sheet.

Other reason why recalculation might now work is because you are using User defined functions and you haven't defined those functions in FlexCel.

And the last common cause why FlexCel could fail to recalculate is if you have linked files and you haven't set a TWorkspace object to calculate those links.

FlexCel comes with a little utility, the demo “Validate Recalc” that will allow you to check if all the formulas on an Excel file are ok to use. And of course you can use the code on this demo inside your own application to tell your users when they use a not supported formula.


FlexCel HTML Exporting guide | FlexCel Studio for the .NET Framework documentation

FlexCel HTML Exporting guide

Introduction

One of the things FlexCel allows you to do is to export your xls/x files to HTML. We do our best to create the HTML files as closely as possible to the original xls/x file, but there are some restrictions in HTML that make it not as good as a PDF export. HTML is a “Flow” format, as opposed to PDF (which is a “Fixed Page” format), and this means the browser can resize and reposition elements depending on the output medium.

With this limitation in mind, we will study now how this is done.

Creating HTML files

There are two ways to create an HTML file from inside FlexCel:

  1. Using the FlexCelHtmlExport component.

    This is the most flexible way to create an HTML file.

  2. Using the FlexCelAspViewer Component.

    This is a component that allows for “drag and drop” display on a web page of an Excel file, using ASP.NET Webforms. Internally it uses FlexCelHtmlExport, and provides some extra functionality to avoid repetitive tasks.

Creating a file using FlexCelHtmlExport

FlexCelHtmlExport is a straightforward class. You would normally set its FlexCelHtmlExport.Workbook property to the Excel file you want to export, and then call Export, ExportAllVisibleSheetsAsTabs or ExportAllVisibleSheetsAsOneHtmlFile depending on what you want to export.

As always, we will not cover those methods or the properties on FlexCelHtmlExport in detail, since they are described in the reference and it makes no sense to repeat the information here. This document is about the conceptual part of creating HTML files.

Naming the created files

The first thing we need to note is that creating an HTML file is different from creating a PDF or other types of files in the sense that you actually create many files for a single xls/x file.

Exporting “workbook.xlsx” to PDF will return in just one file: “workbook.pdf”, but it might result in 3 files when exporting to HTML: “workbook.htm”, “workbook_image1.png” and “workbook.css”

So we need a way to name the different generated files. By default FlexCelHtmlExport will take the name of the main HTML file as a parameter to the export, and generate the name of the images with the following pattern:

<ImagesFolder>\<htmlfilenamewithoutextension>_image<imagenumber>.<imageext>

You can change this pattern, but all in all it gives a good default for images being created. You might use a GUID too as name for the generated images, by changing the FlexCelHtmlExport.ImageNaming property.

Now, you might want or need more control than this over the filenames created, and FlexCelHtmlExport gives you that with the GetImageInformation event, where you can specify exactly which filename you want for each image or even a stream for each one if you are saving for example the file to a database and not to a file system.

Remember that GetImageInformation will be called for every image in the Excel file, even if they are not real images. For example, a chart will be rendered as an image, and so it will throw an OnGetImageInformation event. Also, if you have vertical text and the FlexCelHtmlExport.VerticalTextAsImages property is true, then this event will also be called when creating the images with the vertical text.

Tip

When exporting to HTML5, you might choose to embed the images inside the files so there are no extra files generated.

This is not a good idea for big images, but it can help to avoid the naming issues if your images are light.

You can export to HTML5 by setting the FlexCelHtmlExport.HtmlVersion property to THtmlVersion.Html_5 and you can control which images to embed with the FlexCelHtmlExport.EmbedImages property.

Tip

If you prefer not to use HTML 5 but still would like to embed the images, for example to send the file by email, FlexCel can also export to MHTML which is a format that supports embedding the images.

CSS files are another place where you might create extra files. The HTML standard allows embedding the CSS files inside the generated HTML or using an external stylesheet, and so does FlexCelHtmlExport. If you decide to go for an external stylesheet, you need to tell FlexCelHtmlExport where to place it, by providing a TCssInformation class or a CSS filename to the export methods.

Embedding the generated HTML inside your own pages

Another thing you that is different in generating HTML from other file formats, is that you might want only a part of the html file and not all of it. For example, imagine you want to embed an Excel file inside your existing company page. You will not want the whole html file (since embedding <html> tags inside other <html> tags is not valid HTML), but only the part between the <body> tags. And you will want to have the <head> part of the file in a separated place, so you can merge it with the <head> tags in your site.

With FlexCelHtmlExport, you can use the PartialExportAdd method and the TPartialExportState class for this.

You start by creating a new TPartialExportState instance, where FlexCel will store all the information it needs to create your files.

Then, you call FlexCelHtmlExport.PartialExportAdd for each sheet or file you want to add to the HTML file, using the same TPartialExportState instance as parameter.

Once you have added all the sheets and files you want, you can use the methods in TPartialExportState to get the individual parts of the HTML file.

Creating a file using FlexCelAspViewer component.

The FlexCelAspViewer component is a component for WebForms, that allows a smooth integration of the xls/x file with your ASP.NET site. Internally it uses FlexCelHtmlExport, and as explained in the section above, it uses the PartialExportAdd method and TPartialExportState class to inject the different parts of the HTML file inside the ASP.NET file you are designing.

While normally really straightforward to use (just drop it and set its properties), there is one thing to take into account, and this is images.

FlexCelAspViewer needs a way to feed the images back to the browser. While it can send the HTML text back to the main stream when the browser requests an ASP.NET page, it has no way to send the images to the browser, when the browser requests them after reading the HTML file. Remember the browser will make many requests, the first for an aspx file, and then for the individual png/jpg/gif files, as shown below:

In this example we need a way to provide “image1.png” from the ASP.NET server. On the request for the page (test.aspx) we can create the report and send back the HTML, but we need to persist all images here, so when the browser asks for them we know how to get them.

We provide three operating modes for images so they can be sent to the browser, and they are controlled by the ImageExportMode property:

TImageExportMode.TemporaryFiles

This is the simplest mode, and when using it, FlexCel will output all the images to a temporary folder when the browser asks for the page. The image links in the main HTML file will link to this folder, and so the browser will be able to get them when it needs them.

Images will be named with a GUID, so even if two different browsers ask for the same report at the same time, they will get different images.

When working in this mode you will need to implement a “Garbage collection” of images older than a given timespan, in order to avoid infinite grow of temporary images. You can do this with some scripts on the server, or use the ImageTimeout property in FlexCelAspViewer.

TImageExportMode.UniqueTemporaryFiles

This mode is not actually suited for wide use, but can be used in controlled environments, where you can test that the browsers work fine. Not all the browsers will work in this mode. Older browsers might ask for the image twice, and will not get it the second time

On this mode, as in the first one, images will be saved to a temporary folder when the main page is requested by the browser. But, instead of links to the image, the generated HTML will contain links to HTTPHandlers, as shown below:

asp net request handler

The advantage over the first method is that images will be deleted by the HTTP handler once they are served. This provides a more scalable solution, since you do not rely so heavily on the garbage collection, but on the other hand if a browser re-asks for the same image it will not find it.

Important

It is critical to realize that while this method minimizes the need for garbage collection on temporary images, it does not eliminate it. You will still need to periodically delete the images from the images folder!

The reason why there could still be images left even when they are deleted by the HTTP handler is simple, and it is that the HTTP handler might never be called. Let's imagine the following “broken flow”:

As in the picture above, the browser requests an html file from the ASP.NET server. And as above, the ASP.NET server returns the html file with links to the handlers for the images.

But before the browser actually requests the handlers in the HTML file, the user loads another web page. In this case, the “flexcelviewer.ashx” will never be called, and the image will never be deleted.

Now let's imagine a malicious user, trying a “denial of service” attack to your server. He could make a script that asks for a page in your server, but never calls the handlers, creating lots of temporary files that will never be deleted. In fact, just refreshing his browser manually hundreds of times will get this effect. In each refresh a new html page is generated (along with all the corresponding temporary images), but as he presses refresh again before the page is loaded, the image handlers will not be called and the images will not be deleted.

So, while this method provides a better mode for regular use (where the user requests the page and waits for the images), it is no better to prevent malicious attacks. FlexCelAspViewer provides a property, MaxTemporaryImages, that can be used to mitigate this effect, by deleting older files once you have too much temporary files in the disk. It is recommended that you set MaxTemporaryImages to a reasonable value.

TImageExportMode.CustomStorage

This is a more advanced method that allows you complete control over how the images will be delivered to the browser. It works by creating links to ASP.NET HttpHandlers and allowing you to customize those HttpHandlers to your needs.

It is in some ways similar to the UniqueTemporaryFiles method in that the generated HTML file will have links to HTTP Handlers instead of images, but it is your job now to implement it.

There are two things you need to implement here:

  1. You need to specify the image links for the HTML file, providing the parameters you need in order to get the images when the http handler is called.

  2. You need to implement the HTTP handler that will return the images to the browser. It could use temporary files as the second mode, or it could cache them in memory, a database or wherever you want.

In order to specify the image links you need to assign the event ImageLink in the FlexCelAspViewer component.

You have complete freedom in how to implement your HttpHandler as long as you implement the IhttpHandler interface, but you can derive your class from FlexCelHtmlImageHandler to avoid writing the basic code. The code in FlexCelHtmlImageHandler has been adapted from the article:

http://www.hanselman.com/blog/PermaLink,guid,5c59d662-b250-4eb2-96e4-f274295bd52e.aspx

and it provides the basic boilerplate common to all Http Handlers. We would like to thank Scott Hanselman for it.

You might also take a look at the implementation of

UniqueTemporaryFilesImageHandler class in the code in order to get an idea of how a real implementation might look like.

When implementing the handler, you will need to use the SaveImage event in FlexCelAspViewer in order to get the images you will need to serve later.

Important

Even when it is mentioned in the FlexCel reference, we think this is important enough to repeat here: Take a lot of care when creating your own custom handler. A naive implementation might provide a malicious user access to any file in the server, if you fail to validate the parameters correctly.

Improving the image handling in TemporaryImages mode

While TemporaryFiles is probably the best mode for general use, it has the drawback that can create too many images in heavy loaded sites. Each time a user requests a file, there will be an image created for each of the images in the xls file, and named with a unique name so it doesn't crash with the other users. This means that if you have 7 users asking for the same document at the same time, and the document has 8 images, this mode will generate 7x8 = 56 different images. If of all those images only one is dynamic (for example a chart), and the other 7 are static (for example the company logo) you can minimize the number of images created by supplying a FlexCelHtmlExport.GetImageInformation event, and setting the ImageFile parameter to null (so no image is created) and the ImageLink pointing to a place where you have the static images.

For example, you could have this event handler:

private void htm_GetImageInformationOverwrite2(object sender, ImageInformationEventArgs e)
{
    string ShapeName = e.ShapeProps.ShapeName;
    if (ShapeName == "logo")
    {
        e.ImageFile = null;
        e.ImageLink = "images/logo.gif";
    }
}

And manually place logo.gif in the images folder, so it does not have to be generated each time.

You can do even more things. If you set the ImageFile parameter to an absolute value (for example “c:\www\images\logo.png”), and the link to point there (for example “/images/logo.png”) each time you create a file those images will be recreated so you do not have to care about manually updating them.

The only issue here is that when two users ask for the same image at the same time, one will get a sharing violation because the image is being created by the other thread.

FlexCelHtmlExport has a property “IgnoreSharingViolations” that is true by default and fixes this issue. When a file is locked by another thread, FlexCelHtmlExport will assume this is because there was another thread writing the same image, so it will simply not write it.

In the example, if two threads try to write to “c:\www\images\logo.png” at the same time, the first one will succeed and the other will silently fail and continue with the rest of the file. When the browsers then ask for “/images/logo.png” both browsers will be served with the same image that was written by the first thread.

Customizing the generated HTML

General Customization

Customization is a very important part of creating HTML files, since differently from xls/x or pdf files, HTML files usually have to be integrated with an existing site. This means the style of the generated pages must match the general look and feel of the whole website, and we tried not to cut any corners in letting you do so.

Customizing the raw HTML

There is one property, FlexCelHtmlExport.ExtraInfo where you can add extra HTML in different parts of the document. For example, you can use this property to add META tags to your file including the keywords for searching.

Customizing the Sheet Selector

When exporting a workbook to different HTML files we offer three ways in which you can customize the tabs that represent each sheet:

  1. You can get basic customization of colors and properties by changing the TStandardSheetSelector.CssTags property in the TStandardSheetSelector class.

    TStandardSheetSelector.CssTags is a collection of macros that will be replaced in the style definition of the Selector, allowing to change the width of the selector (when placed at the right or at the top, the background color, etc). There is detailed information on the available properties you can change in the TStandardSheetSelector.CssTags reference.

  2. If the basic customization is not enough, you can completely redefine the css properties in a TStandardSheetSelector class. There is a general property for the styles that apply to all the position in the selector (TStandardSheetSelector.CssGeneral) and then customized properties for all the other positions.

    For example, you could set border black for all TStandardSheetSelector.CssTags with CssGeneral style, and then redefine the border as blue when the tab is on the left by using the TStandardSheetSelector.CssWhenLeft property.

    You can use the built-in macros when defining your CSS properties and you can even define your own. For example, you could define:

    TStandardSheetSelector.CssWhenLeft.Main = "float: left; width: <#width>";

    And then set

    TStandardSheetSelector.CssTags ["width"] = "100px"

    As explained, you can even define your own macros. For example you could use

    TStandardSheetSelector.CssWhenLeft.Main = "float: <#floatpos>;"";

    And then add “floatpos” to the CssTags array. This way you will later be able to change your own styles by replacing the macro values. The syntax for using a macro in a CSS definition is “<#macroname>”, and then you need to add it to the CssTags array.

  3. Normally methods 1. and 2. should be enough to handle most needs, but if you need a completely new way to display your tags, you can just define your own SheetSelector by deriving it from the class TSheetSelector. You will need to override the abstract methods in this class to provide the behavior you need. In fact, this is the way TStandardSheetSelector is defined, and you can look at its code when creating your own SheetSelector class.

Customizing the Fonts

Fonts used in the HTML file are the same that the ones used in the xls/x file, and this might bring some compatibility issues if you expect your file to be shown in a website where it can be opened by people all over the world.

So it is recommended that you stick to standard fonts, like Arial or Times New Roman on the xls/x files you want to export. But if the files already exist and have non standard fonts, you can use the FlexCelHtmlExport.HtmlFont event to convert the fonts to standard typefaces. You can search for an example on this in the Export HTML demo.

Important

The quote character FlexCel uses in style tags is the single quote ('). So, if you need to quote your font names because they have spaces, use a double quote (") so the style declaration is not affected.

For example, a style declaration in FlexCel might be: style = 'font-decoration: "my font"; '

You need to use double quotes around "my font" so it does not end the style declaration.

Export to HTML and FlexCel recalculation

Look at the notes in the PdfExportingGuide on the recalculating issues, this applies to HTML too.

Using Relative Hyperlinks

You can create links in Excel, both inside cells or on images, and they will be exported to html. But there is a small issue in that in Excel you can only enter absolute URLs. For example, you can enter:

“https://www.tmssoftware.com/site/flexcelnet.asp”, but you cannot enter just site/flexcelnet.asp. If you want your websites to be “site independent”, you need to replace those URLs with relative ones.

You can do this using the FlexCelHtmlExport.BaseUrl property. If for example you define”BaseUrl” to be "https://www.tmssoftware.com/", whenever a link starts with that text, the text will be removed. In our example, the link:

"https://www.tmssoftware.com/site/flexcelnet.asp" will be converted to

"site/flexcelnet.asp"

Exporting the images as SVG

When using HTML5, FlexCel offers the option to export the images in the file as SVG instead of png/jpeg. This won't change much for standard images, but other objects like charts or autoshapes can be exported in a vectorial format instead of rasterizing them to pngs. SVG objects can also be smaller if embedded in the page.

SVG is well understood by all modern browsers, so it might be a good idea to turn SVG exporting of images on. To do it, change the FlexCelHtmlExport.SavedImagesFormat property to THtmlImageFormat.Svg.


FlexCel iOS Guide | FlexCel Studio for the .NET Framework documentation

FlexCel iOS Guide

Introduction

The FlexCel code you have to write for iOS itself is very similar to normal FlexCel for Windows code.

This is for example the code needed to create a file in Windows:

    static void CreateFile()
    {
        XlsFile xls = new XlsFile(1, true);
        xls.SetCellValue(1, 1, "FlexCel says hello!");
        xls.Save("result.xlsx");
    }

And this is the code needed to create the same file in iOS:

    static void CreateFile()
    {
        XlsFile xls = new XlsFile(1, true);
        xls.SetCellValue(1, 1, "FlexCel says hello!");
        xls.Save("result.xlsx");
    }

There are really not many differences, and this applies to most FlexCel code you can write: It is exactly the same. So why are we covering iOS in a separate document? What else can we say that is not covered in the other documents?

Well, while most FlexCel code will be the same, there is a fundamental difference between iOS and Windows: Files in iOS are in a sandbox. You can’t just open a file in “My Documents” and save it in another place in the disk. Actually, you can’t access any file outside the folder where your application is installed. How to deal with the file sandbox is what we are going to cover on the rest of this file.

The document Sandbox

When working in Windows, applications can access almost any file in the hard drive. Which is a nice thing from a usability point of view, but a complete nightmare from a security point of view. Imagine you download an application from the internet, how do you prevent it from encrypting all the documents in your hard drive and then asking for some ransom money in order to decrypt them again?

For this reason, in iOS your application can only read and write to the folder where it is installed or its subfolders. This gives you the added advantage that when you uninstall the app it is gone completely, as it can’t leave garbage all over your hard disk. But on the other side, how do you work with a restriction like this? How do you create a file in Excel, open it with FlexCel, modify its values and give it back to Excel, if FlexCel and Excel can’t see each other at all?

The first way to share things is for special files: Apps can access certain other files such as address book data and photos, but only through APIs specifically designed for that purpose. But this isn’t a general solution, and while it might work for images, it won’t work for xls/x or PDF files.

The solution for more general files comes in 2 parts:

  1. In order to do anything useful with the xls/x, pdf, or html files FlexCel can generate, you need to Export them to other apps.

  2. To be able to read files from other apps like Dropbox or the email, you need to Import the files from the other apps.

With this Import/Export system, your application can’t open any file that wasn’t given to it. In order to open a file, the user needs to export it to your app.

A look at some of the available folders for your application

Before we continue, and having established that you can’t write to any folder in the device, let’s look at the folders where you can read or write:

  • <Application_Home>/Documents/ This is where you normally will put your files. Backed up by iTunes.

  • <Application_Home>/Documents/Inbox This is where other apps will put the files they want to share when exporting to your app. Read only. Backed up by iTunes.

  • <Application_Home>/Library/ This is for the files that ship with your app, but not for user files. You could for example put xls/x templates here.

  • <Application_Home>/tmp/ The files you write here might be deleted when your app is not running. Not backed up by iTunes.

Those are at a glance the most important folders you need to know about. You can get a more complete description of the available folders in the Apple documentation.

Importing files from other apps

Registering your app with iOS

In order to be able to interact with files from other applications, you need to register your application as a program that can handle the required file extensions. To do so, you need to modify the file Info.plist in your app bundle.

For handling xls or xlsx files, you would need to add the following to your Info.plist:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDocumentTypes</key>
<array>
    <dict>
        <key>CFBundleTypeName</key>
        <string>Excel document</string>
        <key>CFBundleTypeRole</key>
        <string>Editor</string>
        <key>LSHandlerRank</key>
        <string>Owner</string>
        <key>LSItemContentTypes</key>
        <array>
            <string>com.microsoft.excel.xls</string>
            <string>com.tms.flexcel.xlsx</string>
            <string>org.openxmlformats.spreadsheetml.sheet</string>
        </array>
    </dict>
</array>

<key>UTExportedTypeDeclarations</key>
 <array>
<dict>
    <key>UTTypeDescription</key>
    <string>Excel xlsx document</string>
    <key>UTTypeTagSpecification</key>
    <dict>
        <key>public.filename-extension</key>
        <string>xlsx</string>
        <key>public.mime-type</key>
        <string>application/vnd.openxmlformats-officedocument.spreadsheetml.sheet</string>
    </dict>
    <key>UTTypeConformsTo</key>
    <array>
        <string>public.data</string>
    </array>
    <key>UTTypeIdentifier</key>
    <string>com.tms.flexcel.xlsx</string>
</dict>
</array>
</dict>
</plist>

You can either do this manually by entering the xml in a code editor (info.plist is just an xml file), or add this from Visual Studio, by clicking in info.plist:

visual studio info plist

You can find step-by-step information on how to register your app in the iOS tutorial.

When you configure everything, your app will appear in the “Open in” dialog from other applications on your phone:

Answering to an “Open in” event

Once you’ve registered your application as an app that can handle xls/x files, it will appear in the other application’s “Open in” dialogs. When the user clicks in your app icon, iOS will copy the file to <Your app folder>/Documents/Inbox (See “A look at some of the available folders for your application” above).

After that iOS will start your app, and send it an application:OpenUrl: message so you can actually open the file. So in order to do something useful, you will need to listen to application:OpenUrl: event.

Luckily this is straightforward; just open the file AppDelegate.cs in your project and add the following lines:

public override bool OpenUrl(UIApplication application, NSUrl url, string sourceApplication, NSObject annotation)
{
     DoSomething(url);
}
Note

OpenURL would get the URL of the file (something like “file://localhost/folder...”) instead of a filename. The FlexCelView example shows how to convert the URL into a path, and how to handle an OpenUrl event.

Exporting files to other apps

Exporting files to other apps is the reverse of what we’ve seen in the previous section: Now we want to show a dialog where we show the user all the applications that can open the file we generated.

You can export a file with the following code:

partial void ShareClick(MonoTouch.UIKit.UIBarButtonItem sender)
{
    if (PdfPath == null) return;
    UIDocumentInteractionController docController =
        new UIDocumentInteractionController();
    docController.Url = NSUrl.FromFilename(PdfPath);
    docController.PresentOptionsMenu(ShareButton, true);

}

Printing from iOS

To print an xls or xlsx file created by FlexCel, you need to export it to PDF first (using FlexCelPdfExport). Once the file is in pdf format and saved in your hard drive, just export it to the user as in the sample above.

And the “Print” button will appear among the other options inside the share sheet.

Backing up files

A note about the files you use with FlexCel. Not all of them might need to be backed up, and Apple considers it a reason for App Store rejection if your application is backing up static files (as this will increase backup times and sizes for all users).

If you are using xls or xlsx files as templates for your app, but they aren’t actual data and shouldn’t be backed up, you should use the NSURLIsExcludedFromBackupKey or kCFURLIsExcludedFromBackupKey properties to exclude them from backup.

You can find more information about this topic at: https://developer.apple.com/library/ios/#qa/qa1719/_index.html

Other ways to share files

Besides exporting and importing files, there are two other ways in how you can get files from and to your application:

iTunes file sharing

Your application can offer “Share in iTunes” functionality. To allow it, you need to add the key:

<key>UIFileSharingEnabled</key>
    <true/>

To your Info.plist file. Once you add this entry, your app will appear in iTunes and the user will be able to read and write documents from the “Documents” folder of it. The interface is kind of primitive, but it gets the work done.

Note

Again as in the case of registering the application to consume some file types, the Delphi IDE doesn’t allow you to do it directly. You need to add a Boolean key, and Delphi will only add string keys. So, again you will have to create a different Info.plist and merge it, as we did in “Registering your app with iOS”. If you are already doing so to registering files to import, then you can use that same file to add this entry.

Warning

If you decide to enable iTunes sharing for your app, make sure that the documents in the “Documents” folder are actual documents the user cares about, and put the others somewhere else, like in “Library”. Failing to do so can result in a rejection from the App store. (as you can see here: http://stackoverflow.com/questions/10767517/rejected-by-uifilesharingenabled-key-set-to-true )

Copying files on startup

The last way to put files in your app is to copy them from your app bundle to the “Documents” folder when your app starts

Note that you can only put files inside your app bundle, you can’t put a file directly in the “Documents” folder. Because you will not be uploading the Documents folder to the app store; you will upload only the app bundle.

If your application is called “MyApp” and the folders look something like this:

ios document model

Then you can only put files in the green folders in the diagram. This is because “MyApp.app” is what will be distributed to the App store, and what your users will download when they download your app.

So, how do we put a file on the blue folders in our distribution package? The usual technique is iOS is to copy them to some folder inside MyApp.app, and on startup of your application, copy those files to “/Documents” or “/Library”

A note about Encodings

When you create a Xamarin iOS or Android application, by default it will come with a limited number of encodings. This is to keep application size small. Those encodings include for example ASCII and Unicode, but no Win1252 (encoding used in western Windows machines) or IBM 437 (encoding used in zip files).

FlexCel will work in most cases with the reduced number of encodings, but there are some rare cases where we need the full list of encodings. An example is when reading an Excel 95 file, and there are a couple of other cases more.

So in order to not have problems with non-existing encodings, it might be a good idea to click in your project properties and add "west" encodings.

  • In iOS: Go to Build->iOS Build and select the "Advanced" tab. There in the "Internationalization" section choose "west".
  • In Android: Go to Build->Android Build and select the "Linker" tab. There in the "Internationalization" section choose "west".

If you are worried about the extra size you can skip this step. FlexCel will still work in most of the cases without the extra encodings.


FlexCel Android Guide | FlexCel Studio for the .NET Framework documentation

FlexCel Android Guide

Introduction

As it is the case with iOS and most of the platforms we support, the FlexCel code you have to write for Android itself is very similar to the code for normal "Full-Framework" .NET apps in Windows. We’ve reused most of the code from FlexCel in our Android implementation, and you can still use APIMate, the Demos, everything that you could in Windows when coding for Android.

Fonts

The biggest difference with Windows apps is that Android by default has a single font: “Roboto”. When exporting documents to PDF the lack of extra fonts can be a problem.

There are multiple ways to workaround this:

1. Replacing all fonts in the document by internal fonts.

If you are only using ANSI Windows-1252 characters and a single font, and you don’t care about the exact font used, you can use the code:

FlexCelPdfExport.FontMapping = TFontMapping.ReplaceAllFonts;

before exporting to PDF.

A PDF viewer is required to understand 3 basic fonts: A Sans-Serif (Arial or Helvetica like), a Serif (Times or Times New Roman like), and a proportional font (Courier or Courier New like).

So if you don’t embed any font and are fine with using the internal fonts, you can get a smaller file and forget about other issues by replacing the fonts by internal ones. However, note that this will only work if you are not using characters outside of the ANSI Windows-1252 range: The internal fonts don’t support Unicode, so if you have Unicode characters, you need to provide a font that has the needed characters.

2. Deploying the fonts with your app.

You can provide FlexCel the fonts you need in the place where FlexCel expects them. The simplest way to do that is to deploy the font files needed as internal assets in your application.

To do it, in the project manager of Visual Studio, right click in the Assets folder and create a “fonts” folder behind it:

visual studio android asset manager

Warning

The path is case sensitive: “Fonts” instead of “fonts” will not work.

Important

At the time of this writing there is a bug in Visual Studio 2017 which will raise an error * MSB3025: The source file Assets/fonts is actually a directory* when you add a folder to the assets.

If you are getting this error, you need to manually edit the csproj after adding the fonts folder to the Assets, and remove the line:

  <AndroidAsset Include="Assets\fonts\" />

For more information take a look at https://forums.xamarin.com/discussion/87052/compiling-error-when-assets-folder-containing-subfolder

Note

If you are using .NET Maui, there is no need to setup the Assets. You can copy the fonts directly in Resources/Fonts:

net maui fonts

And FlexCel will pick them from there. This way you can use the fonts in both FlexCel and your app.

Also note that all assets should have their “Build action” set to “AndroidAsset”:

visual studio assets build action

Important

Make sure you have the rights to distribute the fonts that you deploy.

3. Providing the font data via an event.

If you deploy your fonts to a “fonts” folder inside your app assets as explained in the point above, then you have nothing more to do.

But if your app already deploys the fonts to some other folder, you can use the FlexCelPdfExport.GetFontFolder event to change where FlexCel will look for the fonts. For example, if your fonts happen to be inside a folder in your assets named Shared Fonts, you could use the following code:

    using (FlexCelPdfExport pdf = new FlexCelPdfExport(xls, true))
    {
        pdf.GetFontFolder += (sender, e) =>
        {
            e.FontPath = "@Shared Fonts";
        };

        pdf.Export("result.pdf");
    }

Take a look at the “@” sign the code above. To use fonts that you included as assets, you need to return a string starting with a “@” sign in the GetFontFolder event.

So for example to specify that the fonts are in the "fonts" folder asset, you would return "@fonts" on the OnGetFontFolder event. (“@fonts” is the default used by FlexCel and covered in point 2 of this document).

Tip

Of course you can specify any folder in the Android device, not only assets. If the fonts are not in assets, just specify the full folder without a starting @.

A note about Encodings

When you create a Xamarin iOS or Android application, by default it will come with a limited number of encodings. This is to keep application size small. Those encodings include for example ASCII and Unicode, but no Win1252 (encoding used in western Windows machines) or IBM 437 (encoding used in zip files).

FlexCel will work in most cases with the reduced number of encodings, but there are some rare cases where we need the full list of encodings. An example is when reading an Excel 95 file, and there are a couple of other cases more.

So in order to not have problems with non-existing encodings, it might be a good idea to click in your project properties and add "west" encodings.

  • In iOS: Go to Build->iOS Build and select the "Advanced" tab. There in the "Internationalization" section choose "west".
  • In Android: Go to Build->Android Build and select the "Linker" tab. There in the "Internationalization" section choose "west".

If you are worried about the extra size you can skip this step. FlexCel will still work in most of the cases without the additional encodings.

Saving files

Android has 2 types of storage: "Internal storage" and "External storage". While historically internal storage might have been in the device and external outside it, today there is normally no such difference. What makes internal different from external is the permissions: Your app has full permissions to the internal storage, and those files belong to your app. If you uninstall the app, the files on its internal storage will be deleted with it. On the other side, you need permissions for external storage, and those files are available for other apps too.

Internal storage

For internal storage there is not much more to say: You can create, modify and delete those files as you like. To get the path to the internal storage from your code, you can use

System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal)

If using Xamarin Essentials, you can also use Xamarin.Essentials.FileSystem.AppDataDirectory

Note

Xamarin Essentials and the .NET API shown above are cross-platform, so they can also be used in for example iOS and they will point to similar folders there. On the other hand, there are Android-specific APIs like Application.Context.FilesDir or Android.Content.Context.GetExternalFilesDir(string type) which will only work in Android.

External storage

External storage can on its own be divided into 2 different types: Private and Public external storage. Both are publicly available for the rest of the apps, but conceptually private files are expected to be used by your app, while public files are to be freely shared.

To save a file in external storage, you can use

  • For private external storage: Android.Content.Context.GetExternalFilesDir(string type)

  • For public external storage: Android.OS.Environment.GetExternalStoragePublicDirectory(string directoryType)

Note

The APIs for external storage are not cross-platform, likely due to the fact that external storage is an Android-only concept.

You can find a good description of external storage here : https://docs.microsoft.com/en-us/xamarin/android/platform/files/external-storage

Also, you can check https://developer.android.com/training/data-storage/files for more information about the kind of folders where you can save the data.

Getting permissions to external storage

In order to read or save a file into external storage, you first need to get permissions from Android. In older Android versions, adding those permissions to the manifest was enough. But if you target Android 6 or newer, you also need to dynamically ask for the permissions when you want to use them.

You can find the code needed to ask for the permissions here:

https://docs.microsoft.com/en-us/xamarin/android/app-fundamentals/permissions

Sharing files

A tale of two APIs

A long, long time ago, the way to share files in Android was to store the file in external storage and then call an intent to share the file. This had multiple problems, one of those being that both the app sharing the file and the app consuming it should have permissions to read/write external storage.

To fix this, Android introduced the FileProvider class which was made available via a support library to Android 4 (Ice Cream Sandwich) and later.

But there was little reason to change the FileProvider API, since the old API was still working despite its problems. That changed with Android 7 (Nougat), which deprecated the old way to share files: https://developer.android.com/about/versions/nougat/android-7.0-changes#perm

And still, there was no need to change the old ways: you could still target an older Android version and have it run in Android 7 without issues. The new behavior only happened if you explicitly targeted Android 7.

Note

The versions in Android can be a little confusing, and it makes sense that we clarify them a little before continuing.

The target version in Android is not the minimum Android version your app will run. The minimum version is given by minSdkVersion. The target version instead is the version your app is optimized for. You can target Android 7 and still have a minimum version of Android 4, but if you target Android 7, the Android 7 rules will apply to your code so the old way to share files won't work. If you target Android 4 (and have a minimum version of Android 4 too), then the Android 4 rules will apply, even if you are running in Android 7.

This all means that if you target Android 4 and have a minimum SDK of Android 4, you don't have to care about the new Android 7 rules, and your app will still work in Android 7. If you target Android 7, even if your minimum supported version is still 4, you have to use the new way to share files.

You can read more about Android versioning here: https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels

Now, going back to our story: in August 2018 this all changed again. Google started to ask for a target version of 8.0 or newer to be able to publish in the Play store. When you set a target version of 8.0 (no matter if your minimum version is lower), then the old-style way to share files won't work anymore in devices running Nougat or later. Old tricks won't work anymore, and it is time to change to the new system.

Important

Since Android 9, the support library is also deprecated, and now FileProvider is at https://developer.android.com/reference/androidx/core/content/FileProvider

So you need to decide what to use: If the not-deprecated androidx which only supports Android 9 or newer, or the old support library which isn't updated anymore but supports older devices.

In the examples bundled with FlexCel we will show AndroidX, but note the differences with Support Library. If you want a working example with Support Library, you can find it in GitHub: https://github.com/tmssoftware/TMS-FlexCel.NET-demos/releases/tag/v7.1.2.1

Converting to AndroidX

To convert your application to AndroidX, you need to install the AndroidX nuget package

You can find more information here: https://docs.microsoft.com/en-us/xamarin/android/platform/androidx

Once you've done that, you need to adapt the FileProvider from android.support.v4.content.FileProvider to androidx.core.content.FileProvider as shown below.

Using FileProvider to share files

To share files in the new way, you need to define a FileProvider.

You can read about the concepts here: https://developer.android.com/training/secure-file-sharing/

And in the rest of this section we will discuss how to share a simple file created by FlexCel. You can find a finished working example here: LangWars

Step 1. Install Xamarin Essentials.

In order to have access to the functionality we need, you will have to install Xamarin Essentials from nuget.

Step 2. Declare the file provider.

You can do this in two different ways:

  • You can manually edit your properties/AndroidManifest.xml file, and add the following <provider> below the <application> tag:

       <application ...>
    ...
    <provider android:name="androidx.core.content.FileProvider"
       android:grantUriPermissions="true"
       android:exported="false"
       android:authorities="${applicationId}.fileprovider">
       <meta-data android:name="android.support.FILE_PROVIDER_PATHS"
          android:resource="@xml/file_provider_paths" />
    </provider>
 </application>
Note

To use support library instead of AndroidX, set the provider to be:

<provider android:name="android.support.v4.content.FileProvider"

Also note that it is always "android.support.FILE_PROVIDER_PATHS", even in AndroidX

  • If you don't want to manually edit AndroidManifest.xml, you can use the ContentProviderAttribute instead. You need to define a class that inherits from AndroidX.Core.Content.FileProvider and add an attribute like:

       [ContentProvider(
      new[] { FileProviderAuthority },
    Name = "langwars.custom.FileProvider",
    GrantUriPermissions = true,
    Exported = false
    ),
  MetaData(
    name: "android.support.FILE_PROVIDER_PATHS",
    Resource = "@xml/file_provider_paths"
    )
  ]
  public class LangWarsCustomFileProvider: AndroidX.Core.Content.FileProvider
  {

  }

> [!Note]
> To use support library instead of AndroidX, set the class to derive from:

  > public class LangWarsCustomFileProvider: Android.Support.V4.Content.FileProvider

Where you would have to replace "FileProviderAuthority" with a constant that uniquely identifies your provider among all installed applications. Normally you use "your_app_id.fileprovider" here, and whatever name you use, it is the name you will have to use below in step 4. In method 2.1, we used "${applicationId}.fileprovider" as value for the authority.

The second approach can be cleaner in that it doesn't require to manually modify the app manifest, but on the other hand it needs to define a new custom provider when you could just use the built-in FileProvider. In our demo, we choose to simply modify the manifest.

Step 3. Declare the paths that the FileProvider can use.

In step 2 we defined a resource:

Resource = "@xml/file_provider_paths"

Now we need to create this resource, where we will tell Android which are the paths that the provider will use. To do so, we create an "xml" folder under the "Resources" folder, and inside that folder, we create a file named file_provider_paths.xml

file provider paths

For our example, we are going to store the file in the root data folder in the internal memory, so we will add this to the provider paths. The file file_provider_paths.xml will be:

  <?xml version="1.0" encoding="utf-8" ?>
  <paths>
    <files-path name="files" path="." />
  </paths>

If you need to share a file in external storage or on a different path, you should change this file accordingly. For more information about what you can write in this file, please read https://developer.android.com/reference/androidx/core/content/FileProvider#SpecifyFiles

Step 4. Write the code.

Once the provider is correctly declared, the last step is to write the code to share the file. The code we used in the example is as follows:

   Intent Sender = new Intent(Intent.ActionSend);
   Sender.SetType(StandardMimeType.Xls);
   Java.IO.File xlsFile = new Java.IO.File(TempXlsPath);
   var contentUri = AndroidX.Core.Content.FileProvider.GetUriForFile(
      this,
      ApplicationContext.PackageName + ".fileprovider",
      xlsFile);

   Sender.PutExtra(Intent.ExtraStream, contentUri);
   Sender.SetFlags(ActivityFlags.GrantReadUriPermission);
   StartActivity(Intent.CreateChooser(Sender, "Select application"));

The authority we used for GetUriForFile (ApplicationContext.PackageName + ".fileprovider") is the same as the authority we defined in step 2.

Note

If you get a Java.Lang.NullPointerException error when trying your app, you most likely didn't define the provider right. Make sure that the name of the provider in the xml definition is the same as the name you use in your code, and that the provider is correctly embedded in the manifest.


Using FlexCel with Windows Phone, Store and Universal | FlexCel Studio for the .NET Framework documentation

Using FlexCel with Windows Phone, Store and Universal

There are currently two ways to use FlexCel with Universal apps:

  1. Using the nuget package or the library at lib\uwp10. This requires Windows 10, and doesn't suport the Universal style in windows 8.
  2. Using .NET Core.

Same as with iOS and Android, the code needed to use FlexCel in Windows Phone or Universal Windows Platform (UWP) apps is very similar to the code needed to use FlexCel in Desktop .NET.

1. FlexCel for UWP 10

FlexCel for UWP 10 requires Windows 10 and won't run in Windows 8.1.

There isn't much to add about FlexCel for UWP 10. It works the same as always and you can reuse the code you wrote for other platforms.

2. FlexCel for .NET Core

.NET Core is another platform which is positioning itself as a better option for cross-platform development. The main advantage (and disadvantage) of using FlexCel for .NET core over FlexCel for UWP is that FlexCel for .NET Core uses the SKIA library for graphics instead of the built-in graphics. This is an advantage because SKIA is more complete than the native graphics available in UWP, and it is a disadvantage because you need to ship SKIA together with your app, and this will add tens of megabytes to the distribution.

About the Assembly to reference

The assemblies you need to reference are available in different places depending on which platform you choose to use:

  1. FlexCel for UWP 10 is available in the folder lib\uwp10, or available in the FlexCel NuGet package.
  2. FlexCel for .NET Core only available in the FlexCel NuGet package.

Encodings

Depending on the exact platform you are using, you might get an error of missing encoding when calling FlexCel.

With the FlexCel NuGet package encodings are automatically added through NuGet, so you should see no issues.

If you are manually referencing the portable dll you should do the following to avoid Encoding issues:

  1. Add a reference to the System.Text.Encoding.CodePages NuGet package in your app at: https://www.nuget.org/packages/System.Text.Encoding.CodePages/
  2. Somewhere in the initialization of your app, register the encodings by calling: Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);


Using FlexCel with Mono | FlexCel Studio for the .NET Framework documentation

Using FlexCel with Mono

FlexCel is fully managed code without any external dependencies, and this makes it possible to run in different platforms besides Windows and .NET. It can be used via Mono or .NET Core in a Linux server, or on macOS, iOS and Android via Xamarin. In general, code should be 100% compatible between .NET and Mono, but there are some points worth noting.

Installing

For developing for Linux under MonoDevelop, you will have to manually copy FlexCel.dll to your development machine and add a reference to the assembly. Or if you prefer to develop in Visual Studio, then you don’t need to do anything. Just compile your app in Windows under Visual Studio, and copy the files to the Linux server. There is no need to recompile under Mono, as Mono can read the dlls that Visual Studio generates.

Fonts

Probably one of the biggest problems you might get when using FlexCel in anything but Windows or macOS is the lack of fonts. Most of the default fonts in Excel are only present in Windows, and when you want to create a PDF file with them you will get a file that looks wrong. FlexCel needs to read the fonts to know the metrics, where the next character will go, where the line breaks are, etc.

We discuss how to deal with fonts when exporting in the Font Management section of the Pdf exporting guide; make sure you read it if you are thinking in deploying to Mono.

Bugs

In a perfect world we wouldn’t have to write this section. But this is not a perfect world, and while Mono is a high quality piece of work, it has bugs, as does .Net or FlexCel itself. The problem being, that while .NET has bugs, you have probably tested in .NET, and workarounded them. But Mono has a different set of bugs, and the only way to know which, if any, affect you, is to test in Mono. We do regular testing in Mono, and most tests pass ok. But you might find issues, so test heavily.

.NET Core

.NET Core is positioning more and more as the best way to move your applications to Linux. But right now it lacks some features you might need in a full featured app, and it is not as mature.

Depending on your needs, mono might still be a better choice today.


Using FlexCel with .NET Core and .NET 5 or newer | FlexCel Studio for the .NET Framework documentation

Using FlexCel with .NET Core and .NET 5 or newer

.NET Core is the next iteration of the .NET framework, and the latest release dropped the "Core" part, to become ".NET5". In this document, we will refer to ".NET5" and newer versions of the framework as ".NET Core" too, since they have the same root. FlexCel comes with full support for .NET Core. Being cross-platform, you can use FlexCel for .NET Core instead of the individual versions of FlexCel for iOS, FlexCel for Windows Universal, etc.

Selecting the graphics engine

By default FlexCel for .NET Core uses the Native OS graphics framework when available, or SkiaSharp otherwise. But you can change the behavior by changing the property FlexCelConfig.GraphicFramework

When deciding to use Native or SkiaSharp frameworks, you need to consider the following points. When using SkiaSharp:

  1. Your app will have a dependency with the SKIA dll in SkiaSharp. This will make your application larger.
  2. The rendered files will be a little different from the files generated using the OS.
  3. For Android this is quite similar since the native graphics engine in Android is SKIA, but still, you won't be using the engine bundled with android. You will use the one in the SKIA dll from SkiaSharp.
  4. For iOS and macOS, it is probably better to use the iOS/macOS FlexCel dlls directly, since they use CoreGraphics which is a very capable framework and there is no need to use SKIA.
  5. For Windows, it is hard to say. The current implementation of FlexCel using System.Graphics (which uses GDI+) has better support for some things, like right to left languages, or EMF/WMF images. But on the other side, GDI+ is not officially supported in a server even when it works. So the choice is yours.
  6. For Universal Windows Apps, it is probably better to use SKIA, even if it will make your applications larger. The graphics stack in UWA lacks a lot of functionality, and the SKIA implementation is more complete.
  7. Your application won't be fully managed since it will call the native skia dll. This might have security implications.
  8. Your application will work the same everywhere since it will use the exact graphics framework everywhere. The native components might have tiny differences in how they render the text or graphics depending on the underlying graphics engine.
  9. Linux support can be problematic due to all the different distributions. See Installing in Linux
  10. The native graphics engine of the OS will likely be always up to date, while if you ship SKIA with your app, it won't get updates until you update your app. As you can see, it is not a clear winner between using SKIA or the native framework in each platform. SKIA has the advantage of producing the same results anywhere, but the native engines might be more complete and you don't have to ship the SKIA framework with your application.

You can choose what you prefer.

Migrating from .NET 4 to .NET 5 or newer

While it is just a version number of difference, .NET 4 is based in the old .NET framework, and .NET 5 is based in .NET Core. This means that to move to .NET 5 from .NET 4, you need to use the NuGet package with .NET 5. By default, FlexCel will keep using the native OS graphic engines. But if you decide to use SkiaSharp, it can have some unexpected consequences in your app. Especially if you were using WMF/EMF images, which the SKIA framework can't render. So, if you want to keep your application running as similar as possible as the way it worked in .NET 4, the most important thing is to keep FlexCelConfig.GraphicFramework using the native framework. That should make the migration to .NET 5 seamless. But there is another big change in .NET 5 which affected the FlexCel codebase, and it might make sense to review that it doesn't affect yours. This is the fact that .NET moved from using NLS in Windows to use ICU (see https://docs.microsoft.com/en-us/dotnet/standard/globalization-localization/globalization-icu ) This change can lead to subtle bugs, like this one: https://github.com/dotnet/runtime/issues/43736 In our particular case, our main issue is that now this code:

static void Main(string[] args)
{
    int cmp = String.Compare("\u0007", "\u0008", StringComparison.CurrentCultureIgnoreCase);
    Console.WriteLine(cmp);
}

returns 0, when in .NET 4 it would return -1. Now, all "invisible" characters are considered the same when comparing strings using linguistic order.

Installing in Linux

To run in Linux, with SKIA, you need to provide a native libSkiaSharp.so that works in your Linux distribution. For most usual cases, you just need to add a nuget dependency to https://www.nuget.org/packages/SkiaSharp.NativeAssets.Linux.NoDependencies/ to your project. See also https://github.com/mono/SkiaSharp/issues/312

If your distribution isn't supported, then you need to manually compile Skia. The instructions to do so are here: https://github.com/mono/SkiaSharp/wiki/Building-on-Linux

Installing in a Docker container

Besides the section Installing in Linux above, make sure to read Running FlexCel inside Docker containers


Tutorials | FlexCel Studio for the .NET Framework documentation

Tutorials

In this section there is a list of tutorials to help you get started.

In this section:

Creating an iOS application


iOS Tutorial | FlexCel Studio for the .NET Framework documentation

iOS Tutorial

Overview

In this tutorial we will create a small xls/x document viewer. The app isn't particularly useful or flashy, but it is designed to show most concepts you need to know in order to work with files in iOS

Note

The complete source for this tutorial is available as FlexView demo in the FlexCel distribution.

Step 1. Setting up the Application

Lets start by creating a new iOS Universal app:

new ios app menu

new ios app dialog

  • Select Installed (1), Templates (2), iOS (3) and then Universal (4)
  • Select Single View Application (5)
  • Give it a name (6). In this tutorial we will use FlexView.

Then you can go to the application properties, and set icons and the application name.

You might now try running the application, it should show as an empty form in the simulator or the device.

Step 2. Creating the User Interface

We want to display an Excel file into our application. For this, we will convert the file to pdf using FlexCel, and show the pdf output in a web browser.

Double click in the file Main.storyboard. Depending on your version of Xamarin or Visual Studio and on your preferences, the file might open in XCode or the Xamarin designer. We’ll be showing the Xamarin Designer here, but the XCode steps are similar.

In the designer, drop a WebView and a Toolbar. Adjust the anchors so the WebView resizes with the window:

ios tutorial storyboard

Name the WebView Viewer: ios tutorial webview name

Note

If using XCode, create an Outlet for the webview named “Viewer” by ctrl-dragging the webview to the assistant view.

And finally, set Scales Page To Fit = true in the web properties to enable pinch to zoom: webview scales page to fit

Step 3. Registering the application

The next step is to tell iOS that our application can handle xls and xlsx files. This way, when another app like for example mail wants to share an xls or xlsx file, our application will show in the list of available options:

To register our app, we need to change the file Info.plist.

This can be done directly from the Xamarin Studio Info.plist editor, but for this example we’ll just open the new generated Info.plist with a text editor, and paste the following text before the last </dict> entry:

<key>CFBundleDocumentTypes</key>
<array>
    <dict>
        <key>CFBundleTypeName</key>
        <string>Excel document</string>
        <key>CFBundleTypeRole</key>
        <string>Editor</string>
        <key>LSHandlerRank</key>
        <string>Owner</string>
        <key>LSItemContentTypes</key>
        <array>
            <string>com.microsoft.excel.xls</string>
            <string>com.tms.flexcel.xlsx</string>
            <string>org.openxmlformats.spreadsheetml.sheet</string>
        </array>
    </dict>
</array>

<key>UTExportedTypeDeclarations</key>
 <array>
<dict>
    <key>UTTypeDescription</key>
    <string>Excel xlsx document</string>
    <key>UTTypeTagSpecification</key>
    <dict>
        <key>public.filename-extension</key>
        <string>xlsx</string>
        <key>public.mime-type</key>
        <string>application/vnd.openxmlformats-officedocument.spreadsheetml.sheet</string>
    </dict>
    <key>UTTypeConformsTo</key>
    <array>
        <string>public.data</string>
    </array>
    <key>UTTypeIdentifier</key>
    <string>com.tms.flexcel.xlsx</string>
</dict>
</array>

Once you have done this, if you run the application and have for example an email with an xls or xlsx file, you should see “FlexView” in the list of possible applications where to send the file when you press "Share".

Step 4. Reading the file sent by another application

If you tried the application after the last step, and pressed the “Open in FlexView” button, you will notice that FlexView starts, but the previewer is still empty. It won’t show the file that the other application sent.

What happens when you press the “Open in FlexView” button is that iOS will copy the file in the “Documents/Inbox” private folder of FlexView, and send an OpenURL event to our app. We need to handle this event, and use it to load the file in the preview.

Open AppDelegate.cs in Visual Studio, and write the following code:

public override bool OpenUrl(UIApplication application, NSUrl url,
    string sourceApplication, NSObject annotation)
{
      return FlexViewViewController.Open(url);
}
Tip

You might just write “override” inside the AppDelegate class, and Visual Studio will show you a list of possible methods to override.

Note

In iOS, we are going to get the URL of the file, not the filename. For example, the URL could be:

'file://localhost/private/var/mobile/Applications/9D16227A-CB01-465D-B8F4-AC43D70C8461/Documents/Inbox/test.xlsx'

And the actual filename would be: ‘/private/var/mobile/Applications/9D16227A-CB01-465D-B8F4-AC43D70C8461/Documents/Inbox/test.xlsx’

But while iOS methods can normally use an URL or a path, C# FileStream expects a path. This is why we need to convert the URL to a path, using the url.Path.

So now it is the time to do the actual work. We need to write the FlexCelViewViewController.Open(url) method, that will convert the file to pdf and display it on the browser.

For this, open the file FlexCelViewViewController.cs, and write the following uses at the start:

using System;
using System.Drawing;
using MonoTouch.Foundation;
using MonoTouch.UIKit;
using FlexCel.Render;
using FlexCel.XlsAdapter;
using System.IO;

And then type the following code inside the class:

NSUrl XlsUrl;
string PdfPath;

public bool Open(NSUrl url)
{
    XlsUrl = url;
    return Refresh();
}
private bool Refresh()
{
    try
    {
        XlsFile xls = new XlsFile(XlsUrl.Path);
        PdfPath = Path.Combine(             Environment.GetFolderPath(Environment.SpecialFolder.InternetCache),                     Path.ChangeExtension(Path.GetFileName(XlsUrl.Path), ".pdf"));

        using (FlexCelPdfExport pdf
                     = new FlexCelPdfExport(xls, true))
        {
            using (FileStream fs = new FileStream(PdfPath,
                   FileMode.Create))
            {
                pdf.Export(fs);
            }
        }
         Viewer.LoadRequest(new
             NSUrlRequest(NSUrl.FromFilename(PdfPath)));
    }
    catch (Exception ex)
    {
        Viewer.LoadHtmlString("<html>Error opening " +
            System.Security.SecurityElement.Escape(
                Path.GetFileName(XlsUrl.Path))
            + "<br><br>"
            + System.Security.SecurityElement.Escape(
               ex.Message)
            + "</html>", null);

            return false;
    }
    return true;
}

If you run the application now and press “Open in FlexView” from another application, FlexView should start and display the file. You should be able to scroll and pinch to zoom.

Notes on temporary files and memory usage

Normally when coding for a PC, you want to avoid temporary files. In the code above, we could have directly exported the xls file to a memory stream, and then use that memory stream to create an NSData object and load it directly to the web browser.

But when coding for a phone, things are different. In this case, the memory of the device is limited, and the flash storage is fast and huge (it has to be able to store music and videos).

So, if memory is our constraint, it makes more sense to create a temporary file and read from there. While FlexCel will keep the spreadsheet in memory when opening, it won’t keep the pdf file, which is generated on the fly. So saving this pdf file to a temp place can reduce the memory usage a lot.

Another thing to notice is that we should not write this temporary file to the /Documents folder, because this isn’t user data, and it shouldn’t be backed up by iTunes. That’s why we write it to Library/Caches

And the last thing we are missing here, is to remove the file once the WebView loaded it. While this isn’t strictly necessary (iOS will remove files in this cache when it needs space), it is a good practice.

We could remove the file in the Viewer.LoadFinished event, but since we plan to share the file with other apps in the next steps, we will keep it longer. So we will delete the old file before writing a new one.

In FlexCelViewViewController.cs, add the following method:

       private void RemoveOldPdf()
        {
            if (PdfPath != null)
            {
                try
                {
                    File.Delete(PdfPath);
                }
                catch
                {
                    //do nothing, this was just a
                    //cache that will get deleted anyway.
                }
                PdfPath = null;
            }
        }

And call RemoveOldPdf() as the first line in the Refresh() method we wrote above. Note that we could have also saved always to the same filename, so we wouldn’t need to worry about deleting files at all. But when sharing the file, the filename would be lost.

Note

While we won’t cover this here, another advantage of using a temporary file is that if your app gets killed by the OS, you can restore the state from the temporary file when restarted.

Step 5. Modifying the file

For this step, we will be replacing all numbers in the file with random numbers and recalculating the file. While this doesn’t make a lot of sense, it shows how you can modify a file.

In this particular case, the only difficulty is that we can’t overwrite the original file at Documents/Inbox. It is read-only. So we will save it to the Caches folder as tmpFlexCel.xls or tmpFlexCel.xlsx depending on the file format.

Saving it with the same name allows us to not care about deleting the temporary file because it will always be the same. But on the other hand, we need to store the original name of the file so the generated pdf file has the right filename.

So we’ll introduce a new variable:

string XlsPath;

And we’ll replace the old XlsUrl for XlsPath in all places where it isn’t dealing with the pdf file.

Finally, we’ll add a button and write this on the event handler:

partial void RandomizeClick(MonoTouch.UIKit.UIBarButtonItem sender)
{
    if (XlsUrl == null) return;

    XlsFile xls = new XlsFile(XlsPath, true);
    //We'll go through all the numeric cells and make them random
    Random rnd = new Random();

    for (int row = 1; row <= xls.RowCount; row++)
    {
        for (int colIndex = 1;
             colIndex < xls.ColCountInRow(row);
             colIndex++)
        {
            int XF = -1;
            object val = xls.GetCellValueIndexed(row, colIndex, ref XF);
            if (val is double) xls.SetCellValue(row,
                      xls.ColFromIndex(row, colIndex), rnd.Next());
        }
    }

    //We can't save to the original file, we don't have permissions.
    XlsPath = Path.Combine(
        Environment.GetFolderPath(
        Environment.SpecialFolder.InternetCache),
        "tmpFlexCel" + Path.GetExtension(XlsUrl.Path));

    xls.Save(XlsPath);
    Refresh();
}

This code should do the replacement.

Step 6. Sending the file to other applications

In step 4 we saw how to import a file from another application. In this step we are going to see how to do the opposite: How to export the file and make it available to other applications that handle xls or xlsx files. We will also see how to print the file.

Luckily, this isn’t complex to do.

Go to the UI designer, locate the “item” button in the toolbar, rename it “Share”, and add the following code in the button event handler:

partial void ShareClick(MonoTouch.UIKit.UIBarButtonItem sender)
{
     if (PdfPath == null) return;
     UIDocumentInteractionController docController =
            new UIDocumentInteractionController();
     docController.Url = NSUrl.FromFilename(PdfPath);
     docController.PresentOpenInMenu(ShareButton, true);
}

This should show a dialog in your app to share the file with other apps. And it might be what we want in many cases. But this dialog doesn’t include the options to “Print”, or “Mail”, which might be interesting to show too.

To show the extended options, change the last line in the code above from PresentOpenInMenu to PresentOptionsMenu:

docController.PresentOptionsMenu(ShareButton, true);
Note

Exporting to pdf will show a “Print” option when sharing the file, allowing us to print it.

Step 7. Final touches

In this small tutorial we’ve gone from zero to a fully working Excel preview / pdf converter application. But for simplicity, we’ve conveniently “forgotten” about an interesting fact: Excel files can have more than one sheet.

Modifying the app so it allows you to change sheets isn’t complex, on the FlexCel side you just need to use ExcelFile.SheetCount and ExcelFile.GetSheetName(sheetIndex) to get an array of the sheets, then use ExcelFile.ActiveSheetByName to set the sheet you want to display.

But while not complex, there is a lot of plumbing needed for that: we need to define a new view in the storyboard, we need to populate a table view with the items, and select the correct one when the user selects a new sheet. Sadly this is a lot of code, and would mean making this tutorial twice as big with little FlexCel code and a lot of UI code that you can get tutorials everywhere, and so we won’t be showing how to do it here. It would make the tutorial much more complex and add very little to it.


API Documentation | FlexCel Studio for the .NET Framework documentation

API Documentation

In this section you can find a list of all the classes, methods and properties available in FlexCel.

Below is a list of all the namespaces that you can use. Each namespace contains a list of the classes it contains, and each class contains a list of its members.

In this section:

FlexCel.Core

The core classes and general utilities for using FlexCel.

FlexCel.Draw

This namespace encapsulates native drawing routines for each platform FlexCel supports, in a cross platform way.

FlexCel.Pdf

Classes for native PDF support. This namespace implements a small PDF export API that can be used on its own or to convert an xls/x file to PDF.

FlexCel.Render

Classes related to rendering an Excel sheet so you can display it on the screen, print it or export it to other file formats.

FlexCel.Report

Components for creating Excel reports based on a template.

FlexCel.AddinFunctions

This is a namespace with commonly used Excel Addin functions that will be used by FlexCel when recalculating. While the functions defined here are not part of the Excel 2003 internal functions, they are often used as they are included in the default "addin packs" in Excel. They also might be built-in in newer Excel releases.

FlexCel.XlsAdapter

Native API for reading/writing Excel files.

FlexCel.Winforms

This namespace is composed by bonus components not included on the main FlexCel assembly. FlexCel.dll is by nature not dependent on Winforms or ASP.NET, so it has no references to them. Classes on this assembly are specific to Winforms.

FlexCel.AspNet

Classes for using FlexCel directly in ASP.NET as WebForms components.

Note

Every public type and method is documented, so if you are looking for a method and can't find it here, it is likely a method for internal use only.


FlexCel.Core Namespace | FlexCel Studio for the .NET Framework documentation

FlexCel.Core Namespace

The core classes and general utilities for using FlexCel.

Classes

Name | Description
CellValue Represents a cell, including the row, column and sheet where it was read.
ChartBubbleSeries Returns the the bubble values for a bubble chart.
ChartFillOptions Fill options for a chart element.
ChartLineOptions Line style options for an element of a chart.
ChartSeries The definition for a series, and the values of it.
ChartSeriesFill​Options Fill options for a series or a point inside a series.
ChartSeriesLine​Options Line style options for a series or a point inside a series.
ChartSeriesMarker​Options Marker options for the whole series or a point in the series when the chart is line or scatter.
ChartSeriesMisc​Options Misc options for the whole series or a point in the series that do no enter in any other category.
ChartSeriesOptions Options for the whole series or for a data point inside it.
ChartSeriesPie​Options Pie options for a series or a slice of the series when the chart is a pie chart.
ChartWallOptions Fill and Line options for the walls and floor of a 3D chart.
Colors A list of standard colors.
CultureCreating​Event​Args Event when creating a culture.
ExcelChart Information for a chart inside a sheet or an object.
ExcelFile Interface a FlexCel engine has to implement to be used with FlexCelReport.
ExcelFont Utility methods to create normal fonts from Excel ones.
ExcelMetrics Returns Information to convert between standard units and Excel units.
FlexCelConfig A central point of for configuring FlexCel parameters.
FlexCelCoreException Exception thrown when an exception on the core engine happens.
FlexCelDataFormats | Excel formats to copy/paste to/from the clipboard
FlexCelException Exception thrown when a specific FlexCel error happens. Base of all FlexCel hierarchy list.
FlexCelTrace This class reports al FlexCel non-fatal errors. Use it to diagnose when something is going wrong.
FlxConsts Utility methods and constants usable anywhere.
FlxDateTime Use this class to convert between a Date expressed on Excel format (a double) and a TDateTime.
FlxMessages FlexCel Native string Constants. It reads the resources from the active locale, and returns the correct string.
If your language is not supported and you feel like translating the messages, please send us a copy. We will include it on the next FlexCel version.

To add a new language:...[more]
FontCreatedEventArgs Arguments passed in FontCreated events.
FontCreating​Event​Args Arguments passed in FontCreating events.
FontCreation​Event​Args Base class for font creation events.
HtmlFontEventArgs Arguments passed on FlexCel.​Render.​FlexCel​Html​Export.​OnHtml​Font.
ImageUtils Utilities for manipulating images.
LoadLinkedFile​Event​Args | Arguments passed on TWorkspace.​Load​Linked​File
OnPasswordEventArgs Use this class to supply a password to open an encrypted file.
OnSheetNameEventArgs Arguments passed on a OnSheetName event.
TAdaptativeFormats Information about characters in a numeric format that need to be adapted when rendering. For example, if the cell A1 has value 1 and format "*_0" it will print as "______1" when the cell is wide, and as "_1" when the cell is shorter.
TAlphaModFix​Blip​Transform Represents a transform that changes the opacity of the image.
TAreaChartOptions Options specific for an Area chart.
TAreaLineChart​Options Options specific for a Line or Area chart.
TAxisLineOptions Line options for an Axis.
TAxisRangeOptions Properties for the ranges of an axis.
TAxisTickOptions Properties for the ticks and labels of an axis.
TBarChartOptions Options for a Bar or Column chart.
TBaseAxis Common ancestor for all Axis types.
TBaseImageProperties Image information, for headers and footers, normal images or objects in general.
TBlip Picture and properties used in a Blip fill.
TBlipFill Shapes are filled with an image.
TBlipFillMode This class is designed to store tiling or stretching fill mode information.
You need to use any of its descendants, TBlipFillStretch or TBlipFillTile
TBlipFillStretch This element specifies that a BLIP should be stretched to fill the target rectangle. The other option is a tile where a BLIP is tiled to fill the available area.
TBlipFillTile This element specifies that a BLIP should be tiled to fill the available space. This element defines a "tile" rectangle within the bounding box. The image is encompassed within the tile rectangle, and the tile rectangle is tiled across the bounding box to fill the entire area.
TBlipTransform Represents a simple transformation applied to an image. You should use the descendants of this class, not this class directly.
TBlipTransformList A list with TBlipTransforms.
TBlurEffect A blur effect applied to the whole shape.
TCategoryAxis | Information about an Axis of categories. (normally the x axis)
TCellAddress Small class that can convert between a string reference ("A1") into row and col integers (1,1).
TCellAddressRange A class with 2 TCellAddress objects marking the start and end of a cell range.
TChart3DOptions Holds the 3D properties of the chart.
TChartAxis | A class encapsulating the information of an axis
TChartDropBars Information about a Drop Bar.
TChartErrorBars Information about an Error Bar.
TChartFrameOptions Description of a box, its coordinates, fill style and line style.
TChartLegend Description of the chart's legend box.
TChartOneDropBar Information about one specific drop bar.
TChartOptions Base class for options specific to the type of chart.
TChartPlotArea Line and fill styles for the Plot Area.
TChartTextOptions Options for text inside the chart.
TChartTitle Represents the title of the chart.
TChartTrendline This class holds a definition for a trendline.
TChartTrendlineLabel Properties for a label in a trendline.
TChildAnchor A class to hold the offsets relative to the parent on grouped shapes.
TClientAnchor Image Anchor information.
TColorChange​Blip​Transform Represents a color transformation from one color to another. This transform can be used to make a color transparent.
TColumnBlock This class represents a block of columns with the same formatting, options and width.
TCommentProperties Holds the properties for a comment. This class is a descendant of TObjectProperties, and it adds specific behavior for a comment.
TConditional​Above​Average​Rule A conditional format rule which highlights cells which are below or above the average value of the group of cells.
TConditional​Base​Text​Rule A base conditional format rule which highlights cells which contain specific text. This class is not used directly, you use the descendants.
TConditional​Begins​With​Text​Rule A conditional format rule which highlights cells which start with some text.
TConditional​Cell​IsRule A conditional format rule specified by the value on a cell (less than, equal, etc).
TConditional​Color​Scale​Rule A conditional format rule specified as a color scale.
TConditional​Contains​Blanks​Rule A conditional format rule which highlights blank cells.
TConditional​Contains​Errors​Rule A conditional format rule which highlights cells with errors.
TConditional​Contains​Text​Rule A conditional format rule which highlights cells which contain some text.
TConditional​Data​BarRule A conditional format rule specified as a Data Bar.
TConditional​Duplicate​Values​Rule A conditional format rule which highlights duplicated values.
TConditional​Ends​With​Text​Rule A conditional format rule which highlights cells which end with some text.
TConditional​Expression​Rule A conditional format rule specified by a formula.
TConditionalFormat This class encapsulates a list of conditional formats for a range of cells.
TConditional​Format​Color​List A list of conditional value colors.
TConditional​FormatDef The format to apply when a TConditional​Format​Rule is applied.
TConditional​Format​DefColor​Scale Defines a format of the color scales in a conditional format.
TConditional​Format​DefDataBar Defines a format of the databars in a conditional format.
TConditional​Format​DefIconSet Defines a format of the color scales in a conditional format.
TConditional​Format​DefStandard Defines a format to apply for cells when a rule evaluates to true.
TConditional​Format​Rule A rule specifying a conditional format. You cannot create instances of this class, only of their children.
TConditional​Format​Standard​DefRule A conditional format rule which modifies the cell format (color, font, etc). This is different from other rules as databars or iconsets.
TConditional​Format​Value​AndColor​List A list of conditional value objects with their corresponding colors.
TConditional​Format​Value​List A list of conditional value objects.
TConditional​Format​Value​Object Describes an interpolation point in a gradient scale.
TConditional​Format​Values​Rule An abstract class which has common properties for a Databars, IconSet or ColorScale rule.
TConditional​Icon​SetRule A conditional format rule specified as an icon Set.
TConditional​NotContains​Blanks​Rule A conditional format rule which highlights not blank cells.
TConditional​NotContains​Errors​Rule A conditional format rule which highlights cells without errors.
TConditional​NotContains​Text​Rule A conditional format rule which highlights cells which don't contain some text.
TConditional​Time​Period​Rule A conditional format rule which highlights cells which are in a specific time period. Note that it will also apply to number intervals, since dates are formatted numbers.
TConditionalTopNRule A conditional format rule specified by the top-N or bottom-N values.
TConditional​Unique​Values​Rule A conditional format rule which highlights unique values.
TCropArea Defines a cropping area for an image. If the values are not zero, only a part of the image will display on Excel.
TCustomTableStyle Represents a custom table style.
TCustomTable​Style​Section Represents the format of a table section (header, totals, etc).
TCustomXmlPart | Implements a custom XML part as described in https:​//​msdn.​microsoft.​com/​en-​us/​library/​bb608618.​aspx
TDataBarColors Colors which define the databar.
TDataConnection This class represents one data connection on the workbook.
TDataConnection​DbProperties This element stores all properties associated with an ODBC or OLE DB external data connection.
TDataConnection​Olap​Properties This element contains all the properties needed for an OLAP data connection. OLAP connections contain both the TDataConnection​DbProperties and TDataConnection​Olap​Properties child elements.
TDataConnection​Parameter This element stores properties about any parameters used with external data connections. Parameters are used to change the query executed externally and cause different data to be retrieved into the workbook.The type of parameter used determines whether the user is prompted for a value before data is refreshed, or the value is pulled from a cell in the workbook, or whether the same value should be used until explicitly changed in the data connection. Parameters are permitted for ODBC and web queries.
TDataConnection​Parameters A list of TDataConnection​Parameter.
TDataConnections Collection of data connections in a file.
TDataConnectionTable Specifies the HTML table to import.
TDataConnection​Tables Collection of HTML tables in a web query connection.
TDataConnection​Text​Field This element specifies field settings for text import.
TDataConnection​Text​Fields Collection of fields in the Text connection.
TDataConnection​Text​Import​Properties This element contains all of the text import settings.
TDataConnection​WebQuery​Properties This element specifies the properties for a web query source. A web query will retrieve data from HTML tables, and can also supply HTTP "Get" parameters to be processed by the web server in generating the HTML by including the parameters and parameter elements.
TDataLabel Represents one data label on the chart.
TDataLabelOptions Options for a data label.
TDataValidationInfo Contains the information to define a data validation in a range of cells.
TDefaultShapeOptions Helper class to know which shape options default to true when not specified.
TDocumentProperties Properties for an Excel sheet.
TDrawingConditional​Format This class contains the data needed to draw a "complex" conditional format like a databar or iconset.
It is used for exporting xls/x files to drawings or pdf.
TDrawingEffect | Base class for all drawing effects, like TBlurEffect or TGlowEffect
TDrawingGradientDef A base class for storing gradient definitions, be them Linear or Path gradients.
TDrawingHyperlink Specifies an hyperlink in a drawing. While this class is similar to THyperlink for links in cells, it has some differences.
TDrawingLinear​Gradient This class holds a linear gradient definition.
TDrawingPathGradient Holds a Path gradient definition.
TDrawingRichString A rich string used in drawings. It is similar to TRichString but it has more properties like for example wordart properties. Similar to a string, this class is immutable.
TDrawingUnderline Specifies the Fill style and line style of underlined text, when it is underlined.
TEffectContainer This class encapsulates a node of the effect DAC.
TEffectList This class holds a list of effects that are applied to a drawing.
TEffectProperties A class encapsulating an effect that can be used for subtle, intense or moderate types. This class can contain either a standard list of effects (which you can access with TEffectProperties.​EffectLst) or a Directed Acyclic Graph (DAG).
One of TEffectProperties.​EffectLst or TEffectProperties.​EffectDag will always be null.
TEffectStyle A class encapsulating a style including 3D styles.
TEffectStyleList A list with all the effects for subtle, moderate and intense formatting types.
TExcelGradient | Represents a gradient fill for a background cell. This class is abstract, you need to use its children: TExcelLinearGradient and TExcelRectangular​Gradient
TExcelLinearGradient A linear gradient used for filling a background.
TExcelObjectList | A list that contains the Ids and positions of the Excel objects
TExcelRectangular​Gradient A rectangular gradient used for filling a background.
TExcelTypes Manages converting from/to objects/Native excel types.
TFillOverlayEffect A fill overlay effect.
TFillStyle | Base definition for a Drawing fill style. This class is abstract, and you should use its descendants like TSolidFill or TGradientFill
TFillStyleList Represents the fill style characteristics for an autoshape.
TFlexCelErrorInfo This class contains generic information about a non fatal error that happened in FlexCel.
Children classes might contain more information specific to the error type.
TFlxApplyBorders Border style for a cell.
TFlxApplyFont Encapsulation of an Excel Font.
TFlxApplyFormat Defines which attributes of a TFlxFormat will be applied for one cell.
Whatever member is set to false, it will not apply this member property to the cell.
TFlxBorders Border style for a cell.
TFlxChartFont A TFlxFont with Scaling factor. Scaling factor might be different than 1 if the chart has Autosize Fonts. To get the real value of the font, you need to multiply by the factor.
TFlxFont Encapsulation of an Excel Font.
TFlxFormat Format for one cell or named style.
Cell formats are used to format cells, Named styles to create styles. A Cell format can have a parent style format, even when normally this is null (parent is normal format).
Named styles will have a non-null Style property. Cell formats will have style = null.
TFlxNumberFormat Static class to convert cells to formatted strings. It uses format strings from Excel, that are different to those on .net, so we have to try to reconcile the diffs.
TFormula An Excel formula. Use this class to pass a formula to an Excel sheet.
TFormulaMessages Tokens that can be used on a formula.
TGlowEffect A glow effect.
TGradientFill Shapes are filled with a gradient.
TGroupFill Shape is part of a group and filled with its parent fill style.
THeaderOrFooter​Anchor Image information for an image inside a header or footer.
THeaderOrFooter​Image​Properties Image information for an image embedded inside a header or footer.
THtmlColors Converts between Color structs and HTML values.
THtmlDataUri Provides functionality to create a data uri from data.
THtmlEntities | Contains a list of HTML entities and their values
THtmlParsedString An Html string parsed into a C# string and tags.
THtmlSaveSharing​Violation​Error This class has information for a FlexCelError.​Html​Save​Sharing​Violation error. Look at FlexCelError.​Html​Save​Sharing​Violation for more information.
THtmlTag Contains an HTML tag and its position on the string.
THtmlTagCreator Creates html tags for different actions, and depending on the HTML style.
THyperLink An encapsulation of an Excel hyperlink.
TImageProperties Image information for a normal image.
TImplementedFunction Data of an implemented formula function.
TImplemented​Function​List Holds a list of currently implemented formula functions on FlexCel.
TInnerShadowEffect An inner shadow effect.
TLegendEntryOptions Description of one particular entry on the Legend box.
TLegendOptionsList A list of options for the legend on the whole series and for specific data points inside these series.
TLineChartOptions Options specific for a Line chart.
TLineStyle Definition for a Drawing line style.
TLineStyleList Represents the line style characteristics.
TLinkedStyle This class is used as a part of a TFlxFormat class, and stores how a cell format is linked to a style.
TMalformedUrlError This class has information for a FlexCelError.​MalformedUrl error. Look at FlexCelError.​MalformedUrl for more information.
TMimeWriter A simple class used to create MIME formatted messages. While it does not provide much functionality, it gives enough to create simple multipart archives.
TNoFill There is no fill associated with the shapes.
TObjectProperties Holds the properties for an object.
TObjectTextProperties Specifies properties for the text in an autoshape or object.
TOuterShadowEffect An outer shadow effect.
TPaperDimensions | Dimensions of an Excel paper
TPatternFill Shapes are filled with a texture.
TPdfCorruptFont​InFont​Folder​Error This class has information for a FlexCelError.​Pdf​Corrupt​Font​InFont​Folder error. Look at FlexCelError.​Pdf​Corrupt​Font​InFont​Folder for more information.
TPdfFauxBold​OrItalics​Error This class has information for a FlexCelError.​Pdf​Faux​Bold​OrItalics error. Look at FlexCelError.​Pdf​Faux​Bold​OrItalics for more information.
TPdfFontLicense​Doesnt​Allow​Embedding​Error This class has information for a FlexCelError.​Pdf​Font​License​Doesnt​Allow​Embedding error. Look at FlexCelError.​Pdf​Font​License​Doesnt​Allow​Embedding for more information.
TPdfFontNotFound​Error This class has information for a FlexCelError.​Pdf​Font​NotFound error. Look at FlexCelError.​Pdf​Font​NotFound for more information.
TPdfGlyphNot​InFont​Error This class has information for a FlexCelError.​Pdf​Glyph​NotIn​Font error. Look at FlexCelError.​Pdf​Glyph​NotIn​Font for more information.
TPdfUsedFallback​Font​Error This class has information for a FlexCelError.​Pdf​Used​Fallback​Font error. Look at FlexCelError.​Pdf​Used​Fallback​Font for more information.
TPieChartOptions Options specific for a Pie chart.
TPresetShadowEffect Applies a preset shadow effect.
TPrinterDriver​Settings Printer specific settings. It is a byte array with a Win32 DEVMODE struct.
TProtectedRange Specifies a protected range in a sheet. You can define those ranges in Excel 2007 by going to "Review" tab and selecting "Allow Users to Edit Ranges" In Excel 2003, they are available under "Menu-​>Tools-​>Protection"​.​
TProtection Encryption data for an Excel sheet.
TRadarChartOptions Options specific for a Radar chart.
TRecoveryInvalid​Format This error happens when in recovery mode and a format has invalid data.
TRecoveryInvalid​Formula​Tokens This error happens when in recovery mode and a formula has invalid data.
TRecoveryInvalid​Name​Error This error happens when in recovery mode and a name has to be ignored because it can't be read.
TReflectionEffect Applies a reflection effect.
TRenderCorrupt​Image​Error This class has information for a FlexCelError.​Render​Corrupt​Image error. Look at FlexCelError.​Render​Corrupt​Image for more information.
TRenderError​Drawing​Image​Error This class has information for a FlexCelError.​Render​Error​Drawing​Image error. Look at FlexCelError.​Render​Error​Drawing​Image for more information.
TRenderGeneric​Preview​Error This class has information for a FlexCelError.​Render​Generic​Preview error. Look at FlexCelError.​Render​Generic​Preview for more information.
TRenderMetafileError This class has information for a FlexCelError.​Render​Metafile error. Look at FlexCelError.​Render​Metafile for more information.
TReplaceAction Specifies actions to do in every replacement.
TRichString A string cell value with its rich text information.
RTFRuns is an array of TRTFRun structures, where each struct identifies a font style for a portion of text.
For example, if you have: Value = "Hello" RTFRuns = {FirstChar:1 FontIndex:1, FirstChar:3, FontIndex:2}
"H" (char 0) will be formatted with the specific cell format.

"el" (chars 1 and 2) will have font number 1
"lo" (chars 3 and 4) will have font number 2
TScatterChartOptions Options specific for a Scatter/Bubble chart.
TSeriesOptionsList A list of options for the whole series and for specific data points inside these series.
TShapeEffects Contains information for the basic effects of an autoshape (subtle, none or moderate).
TShapeFill Contains the information for the fill of an autoshape.
TShapeFont Contains information for the font of an autoshape.
TShapeLine Contains the information for the line style for an autoshape.
TShapeOptionList This class holds a list of key/values pairs specifying the options for a shape.
To Get a value from it, use: ShapeOptionList[​TShape​Option.​xxx]​;
TShapeProperties A class describing an Excel graphics object.
TSharedWorkbook​Protection​Options Options for protecting the change list in a shared workbook. In Excel you can change this settings in Protection->Protect Shared Workbook.
TSheetProtection​Options Options for protecting a sheet.
TSheetView This class has the different "Page View" modes that you can choose in Excel, ad properties of each mode.
TSoftEdgesEffect Applies a soft edges effect.
TSolidFill Shapes are filled with a solid color.
TSpinProperties Spin properties of a scrollbar, spinner, listbox or combobox.
TTableDefinition Contains the definition of an Excel table.
TTableFormat Defines a custom format for a table.
TTheme Contains a complete definition for an Office Theme.
TThemeColorScheme A color scheme for a theme.
TThemeElements Definitions of the elements in a theme (colors, fonts, formats). This is the main part of a theme.
TThemeFont Represents either a major or a minor font for the theme.
TThemeFontScheme Represents the fonts for a theme.
TThemeFormatScheme Represents the drawing formats (fill styles, line styles, effects) for a theme.
TToken This class and all its descendants represent a token in a formula. You can use these classes to modify formulas without having to parse the text in them, which can be a difficult task.
TTokenCellAddress A single cell address in the same sheet or to other sheet. See also TTokenCellRange, TTokenRelative​Cell​Address, TTokenRelative​Cell​Range for other tokens that can contain addresses.
TTokenCellRange A range of cells. See TTokenCellAddress for single cell references.
TTokenData | Constant data, like "Hello" and 1 in the formula: "=IF(A1 = 1,,"Hello")"
TTokenDataArray | Array of Constant data, like "Hello" and 1 in the formula: "=IF(A1 = 1,,"Hello")"
TTokenFunction | A function like "Sum" or "If"
TTokenLambdaCallName This token is used when you call a name like "=MyName(5)" and MyName has a lambda function.
Note that if a cell has the expression like "=Lambda(x,x)" then you will just get a simple TTokenFunction with a name of "Lambda". This token only appears when using a name as a user-defined function.
TTokenLambda​Parameter​Definition | A parameter definition in the expression of a =LET or =LAMBDA function, like the first x in the formula: "=LET(x,3,x+3)"
TTokenLambda​Parameter​Reference | A parameter reference in the expression of a =LET or =LAMBDA function, like the second x in the formula: "=LET(x,3,x+3)"
TTokenList A list of tokens which create a formula.
TTokenMissing​Argument | A missing argument for a function. For example the second parameter in the formula: "=IF(A1 = 1,,"Hello")"
TTokenName A named range. Might refer to a name in a different file.
TTokenOperator | An operator like "+" or "-"
TTokenParenthesis A parenthesis surrounding the last token. Note that this token is not used in the formula (since RPN doesn't need parenthesis) but it is there so Excel can display them.
TTokenRangeOp An operator that operates in ranges, like union or intersection.
TTokenReferenceError | This token represents an error like #REF!
TTokenRelative​Cell​Address A single cell address in the same sheet or to other sheet. It handles a reference relative to the current cell. So a reference in Cell A4 of RowOffset = -1 and ColOffset = 3 would mean the cell D3.
TTokenRelative​Cell​Range A range of cells with relative references. This is used mostly in named ranges.
TTokenStructured​Reference | A reference for a cell in a table. For example the reference in the formula =SUM(​Table1[​[​#​All]​,[​Some​Column]​]​)
TTokenUnsupported This token is not supported by FlexCel.
TTokenWhitespace Whitespace like " ". This is not used in calculation, but it is use by Excel to show the formula as it was entered.
TUdfEventArgs Encapsulates the parameters to send to a user Defined Function for evaluation.
TUIBrush A base brush for painting.
TUIColorBlend | Defines a complex gradient by using an array of TUIGradientStop
TUIFont Represents a font used for drawing in a pdf/gdi+/wpf/winrt canvas. This class might hold resources which need disposing.
TUIGraphics This class represents a native canvas for drawing.
TUIHatchBrush A class representing a platform independent hatch brush.
TUIImage A platform independent image.
TUIImageAttributes Platform independent image attributes.
TUILinearGradient​Brush Represents a platform independent linear gradient.
TUIMultiPageSaver This class is used to carry information when saving multi page images, like for example a multipage tiff.
TUIPathGradientBrush A platform-​independent Path gradient implementation.
TUIPen A pen used to draw into a canvas.
TUISolidBrush A solid brush with a single color.
TUITextureBrush A brush using an image as a pattern.
TUnknownBlip​Transform Represents a color transform that FlexCel currently doesn't know about.
TUnknownChartOptions Options for an unknown chart. This class does not have any information except the charttype.
TUnsupportedFormula An unsupported formula, the cell it is in, and the reason why it is not supported.
TUnsupported​Formula​List A list of unsupported formulas on a sheet.
TUserDefinedFunction Inherit from this class to create your own user defined functions. Make sure you read 'Using Excel's user defined functions (UDF)' in the Api Developer Guide to get more information on what user defined functions are and how they are created.
TValueAxis | Information about an Axis of values. (normally the y axis)
TWorkbookProtection​Options Options for protecting the workbook.
TWorkspace This class links together a group of spreadsheets, so you can recalculate among linked spreadsheets.
In order to use it, just define an object of this class and add all the files you need for the linked recalculation.
If you don't know in advance which files you will need, you can use the TWorkspace.​Load​Linked​File event.

Note that whenever you recalculate any file in the workspace, all files will be recalculated, so you don't need to calculate them twice.
TXls3DRange A 3d Excel range.
TXlsCellRange An Excel Cell range, 1-based.
TXlsMargins Sheet margin for printing, in inches.
TXlsNamedRange An Excel named range.
TXlsTooManyPage​Breaks​Error This class has information for a FlexCelError.​Xls​TooMany​Page​Breaks error. Look at FlexCelError.​Xls​TooMany​Page​Breaks for more information.
TXlsxInvalid​Name​Error This class has information for a FlexCelError.​Xlsx​Invalid​Name error. Look at FlexCelError.​Xlsx​Invalid​Name for more information.
TXlsxMissing​Part​Error This class has information for a FlexCelError.​Xlsx​Missing​Part error. Look at FlexCelError.​Xlsx​Missing​Part for more information.
TXmlMap Encapsulates the XML Maps in a file.
TXmlMapDataBinding Specifies how the XML binding works.
TXmlMapMap Defines the XML Map.
TXmlMapSchema Stores the schemas for a particular XML map object. There can be multiple Schema elements in a workbook, one for each XML map.
TZippyReader Simple class for reading the contents of a zip file. It can read from multiple files at the same time, but not multithreaded.
TZippyWriter Simple class for writing to a zip file. It can compress on the fly as you are generating the file.
VirtualCellEnd​Reading​Event​Args Arguments passed in the event.
VirtualCellRead​Event​Args Arguments passed in the event.
VirtualCellStart​Reading​Event​Args Arguments passed in the event.

Structures

Name | Description
ChartStyle | This structure defines the default style of a chart. Excel defines 48 default styles.
StandardMimeType | Mime types for common file types.
TCachedFontWidth | A font size cached for speed.
TCellAddress​With​File​Name | Encapsulates a cell address and the file where the cell is stored.
TCellMergedState | This struct is used in ExcelFile.​Cell​Merged​Next to keep track of the next merged cell that will be iterated.
TCharAndPos | A simple structure containing a position and a character.
TChartPlotArea​Position | Defines the rectangle where a chart element is positioned.
TChartRelative​Rectangle | A rectangle used in charts that is relative to a parent rectangle. The coordinates of the rectangle go between 0 and 1 where 0 means 0% of the coordinate of the parent, and 1 means 100%.
TColorTransform | Specifies a color transformation to be applied to a color.
TCondFmtApplyBorders | Determines which parts of the borders will be applied in the conditional format.
TCondFmtApplyFill | Determines which parts of the pattern will be applied in the conditional format.
TCondFmtApplyFont | Determines which parts of the font will be applied in the conditional format.
TCondFmtBorders | Determines which parts of the borders will be applied in the conditional format.
TCondFmtFont | Determines which parts of the font will be applied in the conditional format.
TConditional​Format​Custom​IconDef | This structure holds a single icon from a specific icon set.
TDataLabelsRange | Encapsulates the data for a range of text used in labels
TDocumentCustom​Property | Encapsulates a custom property of an Excel file.
TDrawingColor | Represents a Color for a drawing or a theme. Different from TExcelColor, this structure is defined in terms of DrawingML, not SpreadsheetML.
TDrawingConditional​Format​DataBar | Defines the characteristics of a conditional format data bar which is going to be rendered on the screen or to a file. It is used for exporting xls/x files to drawings or pdf.
TDrawingConditional​Format​IconSet | Defines the characteristics of a conditional format icon which is going to be rendered on the screen or to a file. It is used for exporting xls/x files to drawings or pdf.
TDrawingCoordinate | A coordinate in a drawing.
TDrawingGradientStop | Represents one of the points in a Gradient definition for a drawing (autoshapes, charts, etc). Note that Excel cells use a different Gradient definition: TGradientStop
TDrawingParagraph​Properties | Properties of a text paragraph inside a drawing.
TDrawingPoint | A point with x and y coordinates.
TDrawingRelativeRect | A rectangle with coordinates used in a drawing.
TDrawingText​Attributes | Group of simple attributes for text properties.
TDrawingText​Paragraph | A paragraph in the text inside a drawing. This struct is immutable.
TDrawingText​Properties | Properties of a text run inside a drawing.
TDrawingTextRun | A rich formatting run used in text inside of a drawing. This struct is immutable.
TExcelColor | Represents an Excel color. Colors in Excel can be defined in four ways: Automatic Colors, Indexed Colors (for compatibility with Excel 2003 or older), Palette colors, and RGB colors. This Structure is immutable, once you create it you cannot change its members. You need to create a new struct to modify it.
TFlxApplyFillPattern | Fill pattern and color for the background of a cell.
TFlxFillPattern | Fill pattern and color for the background of a cell.
TFlxOneBorder | Border style and color for one of the 4 sides of a cell.
TFlxPartialFormat | This structure holds together the format definition for a cell, and which parts of that format definition should be applied. With this you can apply only parts of the format to a cell.
TFormulaSpan | This structure is used in formulas that span more than one cell, like some array formulas, or "what-if" table formulas.
TGradientStop | Represents one of the points in a Gradient definition for an Excel cell. Note that drawings (autoshapes, charts, etc) use a different Gradient definition: TDrawingGradientStop
THeaderAndFooter | Contains all information about headers and footers in an Excel sheet.
THSLColor | Implements a simple representation of a color in Hue/Saturation/Lum colorspace.
THtmlFixes | Defines special fixes to the generated files to workaround browser bugs.
TLabColor | Implements a simple representation of a color in CIE-L*a*b* colorspace. This colorspace is mostly used for finding distances between colors.
TLineArrow | Describes an arrow at the end of a line. This struct is immutable.
TLoopOverUsed​Range​Parameters | This structure contains the parameters passed in ExcelFile.​Loop​Over​Used​Range
TPoint | Represents a point on X,Y coordinates. We used instead of System.​Drawing.​Point because we do not want references to System.Drawing (because .NET 3.0 applications do not need GDI+)
TPointF | Platform independent point
TRTFRun | One RTF run for the text in a cell. FirstChar is the first (base 0) character to apply the format, and FontIndex is the font index for the text
TScRGBColor | Implements a simple representation of a color in scRGB colorspace. Components are doubles going from 0 to 1.
TShapeConnector | Used to link two different shapes with a connector.
TSVGAttribute | Represents an attribute for using in SVG.
TSVGBlip | Contains the data of an SVG image, when the blip is of SVG type.
TTableApplyBorders | Determines which parts of the borders will be applied in the Table.
TTableApplyFill | Determines which parts of the pattern will be applied in the table.
TTableApplyFont | Determines which parts of the font will be applied in the Table.
TTableBorders | Determines which parts of the borders will be applied in the Table.
TTableColumn​Definition | Contains the definition for a column in an Excel table. This is mostly useful if the table doesn't have headers, since when the table has headers the columns are inferred from the cells where the header is.
TTableFont | Determines which parts of the font will be applied in the Table.
TTableFormula | Contains the formula for a table total or calculated formula.
TTableStyle | Defines a table style.
TThemeTextFont | The characteristics that define a font.
TUIColor | Represents a color used to draw in a canvas (gdi+, wpf, etc) in a way that is independent of the drawing framework.
TUIGradientStop | A structure describing a gradient point, with its color and position in the gradient.
TUIInterpolationMode | Interpolation mode. See System.​Drawing.​Interpolation​Mode for details.
TUIRectangle | A platform independent rectangle. Coordinates are floating point numbers.
TUISize | A platform independent Size structure. Width and Height are floating point numbers.
TUISmoothingMode | Smoothing mode. See System.​Drawing.​Drawing2D.​Smoothing​Mode.​
TUITextDecoration | Defines appearance of decorative lines used in text, like underline or strikeout.
TXlsChartLabel​Position | Stores a label position in the format used in xls files. The numbers can have many different meanings depending on where they are applied.
TZippyFileInfo | Stores information for a single file inside the zip file.

Interfaces

Name | Description
IEmbeddedObjects | Use this interface to read or write Embedded drawing objects inside other object.
IFlexCelFontList | Interface for passing font information. Internal use.
IFlexCelPalette | Interface for passing palette and theme information. XlsFile implements IFlexCelPalette, so you can pass any XlsFile object whenever you need to use this interface.
IHtmlFontEvent | Provides a method to customize the fonts used in the HTML methods.
IRowColSize | Interface for row heights and columns widths. XlsFile implements this interface, so you can pass an XlsFile object anytime you need to pass this interface.
IStackedOptions | Interface for charts that can be stacked.
IUserDefined​Function​Aggregator | This interface is passed to methods that will process the workbook. Implement your own custom decendant to create new functions.

Enumerations

Name | Description
ColumnImportType | Handles how to convert a column from text when importing a text file.
CondFmtError | Errors that might happen in a conditional format.
FlexCelClipboard​Format | The file fomats that FlexCel can natively put in the clipboard.
FlexCelError | An enumeration of all possible FlexCel non fatal errors that can be logged.
FlexCelGraphic​Framework | Defines the Graphics Framework that FlexCel will use to render files to images or PDF. Only works in .NET 5+. You can change it by setting the property FlexCelConfig.​Graphic​Framework
FlxErr | Error Codes used in Exceptions.
FlxMessage | Some custom strings.
FlxParam | Parameter names that can go into an "invalid params" error message.
ImageColorDepth | Number of colors for the exported images.
ImageExportType | Defines how you want to export the sheet.
InternalNameRange | List of internal range names. On Excel, internal range names like "Print_Area" are stored as a 1 character string. This is the list of the names and their value. You can convert an InternalNameRange into a string by casting it to a char, or by calling TXlsNamedRange.​Get​Internal​Name
TArrowLen | The length of an arrow head.
TArrowStyle | Style of an arrow.
TArrowWidth | Preset width for an arrow.
TAutofitMerged | Specifies how a merged cell will be autofitted. For example, if you have a merged cell from row 1 to 4, You might want to increase the size of the first row, the second, the last, or every row a little.
TAutomaticColor | A list of special colors that depend on the user settings in windows.
TAxisLabelPosition | Position of the labels on the axis.
TAxisType | Type of axis.
TBackgroundMode | How to draw backgrounds of text.
TBlipCompression | This type specifies the amount of compression that has been used for a particular picture.
TBlipTransformType | The type of transform applied to an image.
TBubbleSizeType | What the bubble size means.
TBuiltInStyle | Enumerator with all built-in styles in Excel.
TCategoryAxisOptions | Options for a Category Axis.
TCellIndentation​Rendering | Defines how FlexCel renders cell indentation when exporting to pdf or printing.
TCellType | Values we can write on a cell
TCfvoType | Type of a Value-Object for a conditional format.
TChartAxisPos | Axis postion.
TChartErrorBar​BarType | Specifies the possible ways to draw an error bar.
TChartErrorBar​Direction | Direction of an Error bar in a chart.
TChartErrorBar​Error​Type | Error amount type for the error bar.
TChartLabelPosition​Mode | How coordinates are stored for a label when it is manually positioned.
TChartLayoutMode | Specifies how the coordinates of a chart rectangle apply.
TChartLayoutTarget | Defines if the coordinates of the enclosing rectangle include the axis marks and labels.
TChartLegend​Placement | Position of the legend inside the chart.
TChartLineStyle | Line styles for a chart object.
TChartLineWeight | Different widths for chart lines. Since Excel 2007 this isn't used anymore, as you can use arbitrary line widths.
TChartMarkerType | Kind of marker.
TChartRadarStyle | Style for the radar chart.
TChartTrendlineType | Defines the type of trendline.
TChartType | Chart style.
TCheckboxState | Possible values of a checkbox in a sheet.
TClippingStyle | Can be used to clip into a region instead of drawing on it.
TCollapseChildren​Mode | Determines how the children of the node of an outline will be when the node is collapsed or expanded.
TColorTransformType | List of transformations that can be done to a color.
TColorType | Defines which one of the values stored in a TExcelColor structure is the one that must be used.
TCompoundLineType | Type of line.
TCompressionMode | How the fields inside the zip file will be compressed. Zippy supports only both most used methods, Store and Deflate.
TCondFmtIconSet | Different icon sets used in conditional formatting.
TConditional​Format​Kind | Defines which kind of conditional formatting the rule contains.
TConditionType | A list of conditional operators that you can apply in a Conditional format.
TContentTransfer​Encoding | Defines how a part of a MIME message will be coded.
TDataBarAxisPosition | Axis position for the databar.
TDataBarDirection | The direction of the databar.
TDataBindingLoadMode | Specifies the loading mode of an XML Map databinding.
TDataConnection​Credential​Method | Credentials method used for server access.
TDataConnection​Field​Type | These are the possible data types to use when importing text into the SpreadsheetML document. Strings are converted to these data types in the worksheet.
TDataConnection​File​Type | The file type being used for text import.
TDataConnection​Html​Format | How to handle formatting from the HTML source.
TDataConnection​Parameter​Type | Specifies how a parameter is refreshed.
TDataConnection​Qualifier | Qualifier to use to denote string data types in when text is imported from an external file.
TDataConnection​Reconnection​Method | How to reconnect when a connection fails.
TDataConnectionType | Represents a connection type. This enumeration lists the documented values, but there could be other values peresent in the file.
TDataLabelPosition | Defines where a label is displayed on a chart.
TDataValidation​Condition​Type | Defines the condition used in the data validation box.
TDataValidation​Data​Type | Possible types of data validation.
TDataValidationIcon | Icon to be displayed in the error box of a data validation action. Note that this not only affects the icon used, but the possible values. An information icon will allow you to enter an invalid value in a cell, a stop icon will not.
TDataValidation​ImeMode | The IME (input method editor) mode enforced by a data validation.
TDateUnits | Date units for a date axis.
TDocumentCustom​Property​Type | Defines which kind of property is a custom property.
TDrawingAlignment | Specifies the alignment types for text in a drawing.
TDrawingColorType | Defines the kind of colors that might be stored inside a color definition in a drawing or a theme.
TDrawingFontAlign | Different types of font alignment.
TDrawingPattern | Different types of patterns for filling an Excel 2007 object. This is different from the patterns to fill a cell.
TDrawingRectAlign | How to position two rectangles relative to each other.
TDrawingText​Capitalization | how text is capitalized when rendered.
TDrawingTextStrike | How the text is stroke out.
TDrawingUnderline​Style | Possible underline types in a drawing.
TEncryptionAlgorithm | Encryption algorithms supported in xlsx encrypted files.
TEncryptionType | How the file is encrypted. This applies only to xls files. Xlsx files are encrypted using the Agile xlsx encryption.
TEnterStyle | Defines how characters will be converted when encoding a string as Html.
TEscherConnectorType | The type of connector.
TExcelFileError​Actions | Enumerates what to do on different FlexCel error situations.
TExcelFileFormat | Different Excel versions create different empty xls/xlsx files. For example an empty xls file created by Excel 2003 will have "Arial" as its default font, and one created by Excel 2007 will have "Calibri". By default, when you call ExcelFile.NewFile FlexCel will create a file that is similar to what Excel 2003 would create. This is fine, but if you want to start for example from an empty Excel 2007 file, you can do so by calling NewFile() with this enumeration.
TExcelVersion | Defines which Excel version FlexCel is targeting. Note that while on v2007 you still can make xls 97 spreadsheets.
TExcludedRecords | A list of records that might not be saved into a file when using ExcelFile.​Save​ForHashing(​​Stream)
TFileFormats | Supported file formats to read and write files.
TFillStyleType | Stores the different kind of fill styles for an autoshape or drawing.
TFillType | Type of fill for an autoshape. (In xls files)
TFlexCelImage​Horiz​Align | Sets how an image is aligned inside a box.
TFlexCelImage​Vert​Align | How an image is aligned inside a box.
TFlipMode | How an image will be flipped when filling a pattern.
TFlxAnchorType | How an image behaves when inserting/copying rows/columns
TFlxBorderStyle | Cell border style.
TFlxDiagonalBorder | Diagonal border style.
TFlxFontStyles | Font style. You can "or" on "and" it to get the actual styles. For example, to set style to bold+italic, you should use TFlxFontStyles.Bold | TFlxFontStyles.​Italic.​ to check if style includes italic, use ((Style & TFlxFontStyles.​Italic)​!​=0)
TFlxFormulaError​Value | Error codes for cells on excel
TFlxInsertMode | Inserting mode. Important: This enumeration is also used when deleting ranges. When deleting, Down means Up and Right means Left.
TFlxPatternStyle | Pattern style.
TFlxReadingOrder | Reading order for a cell.
TFlxUnderline | Underline type.
TFmReturnType | Formula return types... A value, an array or a reference.
TFontCharSet | Character set for a font as defined in the DrawingML standard.
TFontScheme | Specifies the scheme to which a font belongs in the theme. This attribute is only valid in Excel 2007 or newer.
TFormattingType | The elements here are different types of fill/effects/etc that can be applied to an object. Currently Excel only defines 3 types, but more can be added in future specifications. Newer types can be accessed by casting an int to TFormattingType. (for example "(​TFormatting​Type)​5" would refer to a now non existing formatting type)
TFormulaToken | Known token on a formula. They are not supposed to be localized, but they can be by editing formulamsg.resx
TFullRecalcOn​Load​Mode | Defines how FlexCel will save the files so they will be recalculated or not when you open them in Excel.
TFunctionGroup | Specifies the function group index if the defined name refers to a function. The function group defines the general category for the function. This attribute is used when there is an add-in or other code project associated with the file.
TGradientType | The type of gradient stored inside a TExcelGradient object.
THeaderAndFooterKind | Different kinds of headers and footers depending on which pages they apply.
THeaderAndFooterPos | Different sections on a header or footer.
THFlxAlignment | Horizontal Alignment on a cell.
THidePrintObjects | Enumeration defining which objects should not be printed or exported to pdf. You can 'or' more than one option together. For example, to not print images and not comments, you should specify: THidePrintObjects.​Images | THidePrintOption.​Comments
THtmlFileFormat | How the html page will be saved.
THtmlStyle | Defines the way html is generated.
THtmlVersion | Defines the HTML version that will be used when exporting.
THyperLinkType | Possible types of cell hyperlinks.
TIgnoredErrors | Specifies what kind of errors Excel will ignore for ranges of cells. "Errors" in a spreadsheet are the green triangles that appear in the top left corner of the cell, like "Number stored as text".
TImageNaming | Defines how images will be automatically named by FlexCel, when you do not supply a better name.
TJpegOrientation | Specifies the rotation of a JPEG image.
TLabelDataValue | Defines what information a DataLabel should show.
TLineCap | How the line ends.
TLineDashing | Line style (dashes, solid, etc).
TLineJoin | How a line joins with the next
TLinkOption | Specifies to which object the label is linked to.
TListBoxSelection​Type | Types of selection allowed in a listbox.
TMultipartType | Different ways to define a multipart archive.
TObjectType | A type of object. Do not confuse this with a type of shape ( TShapeType ) This does not describe the shape form (like if it is a rectangle or a circle) but the shape kind (for example if it is a comment, an image or an autoshape)
TOperator | Operators that can be found inside a formula
TOverlayBlendMode | Overlay blend modes.
TPanePosition | Position on a pane when window is split
TPaperSize | Pre-defined Page sizes. For Printer specific page-sizes, see TPrinterDriver​Settings Note that a printer specific page size might have a value that is not on this enumeration.
TPathShadeType | Enumerates the different gradient modes for a Path gradient.
TPenAlignment | Specifies the alignment to be used for the underline stroke.
TPitchFamily | Pitch family for a font.
TPlotEmptyCells | Defines how empty cells will be plotted in the chart.
TPresetColor | Preset colors.
TPresetShadow​Effect​Type | Types of preset shadow.
TPrimaryThemeColor | Specifies one of the 12 theme colors. Does not include semantic colors, which are in TThemeColor
TPrintComments | Determines how the comments will be displayed when printing.
TPrintErrors | Determines how to print the errors when printing or exporting a sheet.
TPrintOptions | How the sheet should be printed. You can mix value together by and'ing and or'ing the flags. See the example to see how to set or clear one specific value of the enumeration.
TPropertyId | Standard properties of an ole file. There are two different sets of properties, the standard ones (properties that exist for any file) and the extended ones (properties that exist for Ms Office documents)
TProtectionType | Indicates how a sheet will be protected.
TQEncodeMetaInfo | Defines how a string returned by Q-Encode will be handled.
TRangeCopyMode | What we do with the cells when we call InsertAndCopy​Range.​
TRangeOp | Operation between ranges.
TRecalcMode | Sets how the excel file will be recalculated. Normally FlexCel calculates a file only before saving and when you explicitly call ExcelFile.​Recalc(​​Boolean). With this enum you can change that behavior.
TRecalcVersion | Identifies how FlexCel will identify itself in the generated file, in order to recalculate.
TReferenceStyle | Use this enumerator in the property ExcelFile.​Formula​Reference​Style to specify the reference mode that FlexCel will use when you enter formulas as text or when it returns the formula text.
TShapeOption | Many different configuration options for a shape.
TShapeOptionType | Returns the type of option type.
TShapePreset​Guide​Type | Internal use.
TShapeType | Enumeration with the different shapes.
TSheetCalcMode | How the file will be calculated by Excel. This enum doesn't affect FlexCel recalculation.
TSheetOptions | General options for a sheet. In Excel, this settings are located in Tools-​>Options-​>View in the "Window options" box. Most of this options can be set with dedicated methods in ExcelFile, but this type allows to set them all at once, or copy them from other file. This options apply only to the active sheet. For options that apply to all the sheets see TSheetWindowOptions
TSheetType | Sheet types
TSheetViewType | The page mode of a sheet. You select this in Excel by changing the icons at the bottom right, or from the ribbon, in the "View" tab.
TSheetWindowOptions | General options for how sheets display. In Excel, this settings are located in Tools-​>Options-​>View in the "Window options" box. This options apply only to all the sheets. For options that apply only to the active sheet see TSheetOptions
TSortFormulaMode | Defines how FlexCel will sort a range of cells, when you call XlsFile.Sort. You will normally want to specify "MoveFormulas", but for huge amounts of data where you know formulas won't matter, you might choose the "ExcelLike" mode. Note that Excel itself doesn't adapt correctly the formulas when sorting, and it works like the ExcelLike mode.
TSortOrder | The sort order for a sort operation.
TStackedMode | Way the series stack one to the other. This does not apply to all chart types.
TStructRefSection | This enum contains the possible values that can go into a structured reference. You can combine multiple values, but not all combinations make sense. For example #Data + #Headers it fine, but #All + #Headers is just #All.
TStyleCategory | Category to which a cell style belongs. This is only valid for Excel 2007 or newer.
TSVGExportType | Customized what data will be included in an svg file.
TSystemColor | System colors.
TTableStyleType | Defines the part of the table for which a tablestyle applies.
TTextHorzOverflow | How the text in a shape will overflow horizontally once there is no more room for it.
TTextRotation | Text direction for objects like comments, that allow rotation, but only in 90 degrees.
TTextVertOverflow | How the text in a shape will overflow vertically once there is no more room for it. Note that from the Excel UI, you can only set both Vert overflow and Horizontal overflow at the same time.
TThemeColor | Specifies one of the 12 theme colors, or one of the 4 semantic colors. In cells, Excel doesn't use semantic colors, but in drawings they can be used, even if the Excel UI only allows one type of color.
TTickType | Ticks for an axis.
TTimePeriod | A time period for conditional format.
TTokenType | Enumerates the different kind of tokens you can find in a formula
TTokenWhitespace​Character | Character used in the whitespace.
TTokenWhitespace​Position | Specifies where the whitespace is added in relation to the next token.
TTotalsRowFunction | Type of function used to summarize a table column.
TUIDashStyle | Platform independent line style.
TUIFontStyle | The different styles a font can have.
TUIHatchStyle | Specifies the different patterns available.
TUIStrikeout | Defines if the text is stroke out. Currently there is only an style of strike out, which is a single strikeout.
TUIUnderline | Type of underline in the text.
TUnsupported​Formula​Error​Type | Types of error that might happen while recalculating.
TUserDefined​Function​Location | Defines where the custom function is located, if inside a macro in the same file, or inside a macro in an external file.
TUserDefined​Function​Scope | Defines how custom functions are added to the recalculation engine. If a function is defined in both Global and Local scope, Local scope will be used.
TValueAxisOptions | Options for a Value Axis.
TVFlxAlignment | Vertical Alignment on a cell.
TXlsBiffVersion | The specific Excel version that FlexCel will emulate when reading and saving files.
TXlsImgType | Possible image types on an excel sheet.
TXlsSheetVisible | Sheet visibility.

Delegates

Name | Description
CultureCreating​Event​Handler | Delegate for CultureCreating events. Return null to use the culture that would have been used had this event not be assigned.
FlexCelError​Event​Handler | Delegate for ErrorInfo events.
FontCreatedEvent​Handler | Delegate for FontCreated events.
FontCreating​Event​Handler | Delegate for FontCreating events.
HtmlFontEventHandler | Delegate used to specify which fonts to use on a page.
LoadLinkedFile​Event​Handler | Delegate for LoadLinkedFile event.
OnPasswordEvent​Handler | This event fires when opening an encrypted file and no password has been supplied.
OnSheetNameEvent​Handler | Delegate used to specify which name to use for every sheet when exporting multiple sheets to multiple files.
VirtualCellEnd​Reading​Event​Handler | Delegate for virtual cell reads. This delegate is called after the full file has been read.
VirtualCellRead​Event​Handler | Delegate for virtual cell reads.
VirtualCellStart​Reading​Event​Handler | Delegate for virtual cell reads. It is called before we start reading the file, but after sheet names are known.


CellValue Class | FlexCel Studio for the .NET Framework documentation

CellValue Class

Represents a cell, including the row, column and sheet where it was read.

Syntax

Namespace: FlexCel.Core

public sealed class CellValue

Constructors

Name | Description
CellValue | Creates a new CellValue instance.

Properties

Name | Description
Sheet | Sheet where the cell was read. (1 based)
Row | Row where the cell was read. (1 based)
Col | Column where the cell was read. (1 based)
Value | Value of the cell. The possible objects here are the same as the returned by ExcelFile.​Get​Cell​Value(​​Int32, Int32, Int32)
XF | Format of the cell.


CellValue.CellValue Constructor | FlexCel Studio for the .NET Framework documentation

CellValue.CellValue Constructor

Creates a new CellValue instance.

Syntax

Namespace: FlexCel.Core

public CellValue(Int32 aSheet, Int32 aRow, Int32 aCol, Object aValue, Int32 aXF)

Parameters

<-> | Parameter | Type | Description
 | aSheet | Int32 |
 | aRow | Int32 |
 | aCol | Int32 |
 | aValue | Object |
 | aXF | Int32 |

See also

  • CellValue


CellValue.Sheet Property | FlexCel Studio for the .NET Framework documentation

CellValue.Sheet Property

Sheet where the cell was read. (1 based)

Syntax

Namespace: FlexCel.Core

public Int32 Sheet { get; set; }

See also

  • CellValue


CellValue.Row Property | FlexCel Studio for the .NET Framework documentation

CellValue.Row Property

Row where the cell was read. (1 based)

Syntax

Namespace: FlexCel.Core

public Int32 Row { get; set; }

See also

  • CellValue


CellValue.Col Property | FlexCel Studio for the .NET Framework documentation

CellValue.Col Property

Column where the cell was read. (1 based)

Syntax

Namespace: FlexCel.Core

public Int32 Col { get; set; }

See also

  • CellValue


CellValue.Value Property | FlexCel Studio for the .NET Framework documentation

CellValue.Value Property

Value of the cell. The possible objects here are the same as the returned by ExcelFile.GetCellValue(Int32, Int32, Int32)

Syntax

Namespace: FlexCel.Core

public Object Value { get; set; }

See also

  • CellValue


CellValue.XF Property | FlexCel Studio for the .NET Framework documentation

CellValue.XF Property

Format of the cell.

Syntax

Namespace: FlexCel.Core

public Int32 XF { get; set; }

See also

  • CellValue


ChartBubbleSeries Class | FlexCel Studio for the .NET Framework documentation

ChartBubbleSeries Class

Returns the the bubble values for a bubble chart.

Syntax

Namespace: FlexCel.Core

public class ChartBubbleSeries

Constructors

Name | Description
ChartBubbleSeries | Overloaded ChartBubbleSeries ChartBubbleSeries(String) ChartBubbleSeries(String, Object[])

Properties

Name | Description
DataValues | Actual values for the bubbles.
DataDefinition | Formula defining the bubbles.


ChartBubbleSeries.ChartBubbleSeries Constructor | FlexCel Studio for the .NET Framework documentation

ChartBubbleSeries.ChartBubbleSeries Constructor

Overloads

  • ChartBubbleSeries.ChartBubbleSeries
  • ChartBubbleSeries.ChartBubbleSeries(String)
  • ChartBubbleSeries.ChartBubbleSeries(String, Object[])

ChartBubbleSeries.ChartBubbleSeries

Creates an empty ChartBubbleSeries

Syntax

Namespace: FlexCel.Core

public ChartBubbleSeries()

See also

  • ChartBubbleSeries

ChartBubbleSeries.ChartBubbleSeries(String)

Creates a new ChartBubbleSeries with a data definition.

Syntax

Namespace: FlexCel.Core

public ChartBubbleSeries(String aDataDefinition)

Parameters

<-> | Parameter | Type | Description
 | aDataDefinition | String | Definition for the bubbles.

See also

  • ChartBubbleSeries

ChartBubbleSeries.ChartBubbleSeries(String, Object[])

Creates a new ChartBubbleSeries with data values. The values will be ignored unless the DataDefinition is empty.

Syntax

Namespace: FlexCel.Core

public ChartBubbleSeries(String aDataDefinition, Object[] aDataValues)

Parameters

<-> | Parameter | Type | Description
 | aDataDefinition | String | Definition for the bubbles.
 | aDataValues | Object[] | Definition for the values. This parameter will be ignored if you specify a DataDefinition.

See also

  • ChartBubbleSeries


ChartBubbleSeries.DataValues Property | FlexCel Studio for the .NET Framework documentation

ChartBubbleSeries.DataValues Property

Actual values for the bubbles.

Syntax

Namespace: FlexCel.Core

public Object[] DataValues { get; set; }

See also

  • ChartBubbleSeries


ChartBubbleSeries.DataDefinition Property | FlexCel Studio for the .NET Framework documentation

ChartBubbleSeries.DataDefinition Property

Formula defining the bubbles.

Syntax

Namespace: FlexCel.Core

public String DataDefinition { get; set; }

See also

  • ChartBubbleSeries


ChartFillOptions Class | FlexCel Studio for the .NET Framework documentation

ChartFillOptions Class

Fill options for a chart element.

Syntax

Namespace: FlexCel.Core

public class ChartFillOptions: ICloneable

Constructors

Name | Description
ChartFillOptions | Overloaded ChartFillOptions(TShapeFill) ChartFillOptions(TDrawingColor)

Methods

Name | Description
Clone | Creates a deep copy of this object.
CloneFill | Clones the fill if not null, else it will return null.

Properties

Name | Description
Fill | Fill style.


ChartFillOptions.ChartFillOptions Constructor | FlexCel Studio for the .NET Framework documentation

ChartFillOptions.ChartFillOptions Constructor

Overloads

  • ChartFillOptions.ChartFillOptions(TShapeFill)
  • ChartFillOptions.ChartFillOptions(TDrawingColor)

ChartFillOptions.ChartFillOptions(TShapeFill)

Creates a new instance of this object.

Syntax

Namespace: FlexCel.Core

public ChartFillOptions(TShapeFill aFill)

Parameters

<-> | Parameter | Type | Description
 | aFill | TShapeFill | Fill style.

See also

  • ChartFillOptions

ChartFillOptions.ChartFillOptions(TDrawingColor)

This is a convenience constructor to create the most common fill which is just a solid fill with a color.

Syntax

Namespace: FlexCel.Core

public ChartFillOptions(TDrawingColor aColor)

Parameters

<-> | Parameter | Type | Description
 | aColor | TDrawingColor | Color for the solid fill.

See also

  • ChartFillOptions


ChartFillOptions.Clone Method | FlexCel Studio for the .NET Framework documentation

ChartFillOptions.Clone Method

Creates a deep copy of this object.

Syntax

Namespace: FlexCel.Core

public virtual Object Clone()

See also

  • ChartFillOptions


ChartFillOptions.CloneFill Method | FlexCel Studio for the .NET Framework documentation

ChartFillOptions.CloneFill Method

Clones the fill if not null, else it will return null.

Syntax

Namespace: FlexCel.Core

protected TShapeFill CloneFill()

See also

  • ChartFillOptions


ChartFillOptions.Fill Property | FlexCel Studio for the .NET Framework documentation

ChartFillOptions.Fill Property

Fill style.

Syntax

Namespace: FlexCel.Core

public TShapeFill Fill { get; }

See also

  • ChartFillOptions


ChartLineOptions Class | FlexCel Studio for the .NET Framework documentation

ChartLineOptions Class

Line style options for an element of a chart.

Syntax

Namespace: FlexCel.Core

public class ChartLineOptions: ICloneable

Constructors

Name | Description
ChartLineOptions | Overloaded ChartLineOptions(TShapeLine) ChartLineOptions(TDrawingColor, Nullable<Int32>)

Methods

Name | Description
Clone | Returns a deep copy of this object.

Properties

Name | Description
Line | Line fill.


ChartLineOptions.ChartLineOptions Constructor | FlexCel Studio for the .NET Framework documentation

ChartLineOptions.ChartLineOptions Constructor

Overloads

  • ChartLineOptions.ChartLineOptions(TShapeLine)
  • ChartLineOptions.ChartLineOptions(TDrawingColor, Nullable<Int32>)

ChartLineOptions.ChartLineOptions(TShapeLine)

Creates a new ChartSeriesLineOptions instance.

Syntax

Namespace: FlexCel.Core

public ChartLineOptions(TShapeLine aShapeLine)

Parameters

<-> | Parameter | Type | Description
 | aShapeLine | TShapeLine | Line fill definition.

See also

  • ChartLineOptions

ChartLineOptions.ChartLineOptions(TDrawingColor, Nullable<Int32>)

This is a convenience constructor to create the most common line which is just a solid line with a color and width.

Syntax

Namespace: FlexCel.Core

public ChartLineOptions(TDrawingColor aColor, Nullable<Int32> aWidth)

Parameters

<-> | Parameter | Type | Description
 | aColor | TDrawingColor | Color of the line.
 | aWidth | Nullable<Int32> | Width of the line in EMUs (1 pt = 12700 EMUs). If null, width of the theme will be used.

See also

  • ChartLineOptions


ChartLineOptions.Clone Method | FlexCel Studio for the .NET Framework documentation

ChartLineOptions.Clone Method

Returns a deep copy of this object.

Syntax

Namespace: FlexCel.Core

public virtual Object Clone()

See also

  • ChartLineOptions


ChartLineOptions.Line Property | FlexCel Studio for the .NET Framework documentation

ChartLineOptions.Line Property

Line fill.

Syntax

Namespace: FlexCel.Core

public TShapeLine Line { get; }

See also

  • ChartLineOptions


ChartSeries Class | FlexCel Studio for the .NET Framework documentation

ChartSeries Class

The definition for a series, and the values of it.

Syntax

Namespace: FlexCel.Core

public class ChartSeries

Constructors

Name | Description
ChartSeries | Overloaded ChartSeries ChartSeries(String, String, String) ChartSeries(String, String, String, Object, Object[], Object[], String[], String[], Int32, Int32, Int32)

Properties

Name | Description
TitleDefinition | Formula or text defining the Series caption. Start with an "=" sign to enter a formula.
DataDefinition | Formula defining the series. For example, "=A1:A5". Start with an "=" sign to enter a formula. Note that if the Series doesn't have a formula and only values (for example {1,2,3}), this property will be null and the result will be in DataValues
CategoriesDefinition | Formula defining the Series Categories (normally the x Axis). Start with an "=" sign to enter a formula. Note that if the Series doesn't have a formula and only values, this property will be null and the result will be in CategoriesValues
TitleValue | Evaluated text of the title.
DataValues | Actual values for the series.
DataValuesHidden | True if all the DataValues are from hidden cells. When this is true, the length of DataValues is 0.
CategoriesValues | Actual values for the Series Categories (normally the x Axis). Note that category axis can contain multi-level labels. In those cases, CategoriesValues will just report all levels separated by carriage returns. To see the different levels as an array, use CategoriesValues​Array
CategoriesValues​Array | Actual values for the Series Categories (normally the x Axis). This property is similar to CategoriesValues but if the labels have multiple levels, it will return a bi-dimensional array with one row per level.
DataFormats | Format on the cell where the data is. So for example if you are charting a range A1:A3, this property will return an array with the numeric format strings for A1, A2 and A3. This format is applied to the data if the data format for the axis or the label is null. Each value in the array holds the format for one data point in the chart.
CategoriesFormats | Format on the cell where the data is. So for example if you are charting a range A1:A3, this property will return an array with the numeric format strings for A1, A2 and A3. This format is applied to the data if the data format for the axis or the label is null. Each value in the array holds the format for one data point in the chart.
CategoriesFormats​Array | Format on the cell where the data is. So for example if you are charting a range A1:A3, this property will return an array with the numeric format strings for A1, A2 and A3. This format is applied to the data if the data format for the axis or the label is null. Each value in the array holds the format for one data point in the chart.
ChartOptionsIndex | Index to the ChartOptions object that applies to this series. Note that in xlsx charts, this is the number of subchart where the series is. So when setting series, you don't need to specify the ChartOptionIndex: FlexCel will use the number of subchart no matter what you specify here.
SeriesIndex | Index of this series on the file.
SeriesNumber | Series number as shown on the Legend box. This might be different from the SeriesIndex if the order of the series is changed.
Options | Options for this series and their data points. -1 means the whole series, and n is options for the n-point.
LegendOptions | Options for the legend entry associated with this series. (when legend is showing series), or with a point on the series. (when legend is showing all the entries on series[0], for example on pie charts)
HorizontalErrorBars | Returns the horizontal error bar options, if the chart has error bars. If the chart doesn't have them, then null will be returned.
VerticalErrorBars | Returns the vertical error bar options, if the chart has error bars. If the chart doesn't have them, then null will be returned.


ChartSeries.ChartSeries Constructor | FlexCel Studio for the .NET Framework documentation

ChartSeries.ChartSeries Constructor

Overloads

  • ChartSeries.ChartSeries
  • ChartSeries.ChartSeries(String, String, String)
  • ChartSeries.ChartSeries(String, String, String, Object, Object[], Object[], String[], String[], Int32, Int32, Int32)

ChartSeries.ChartSeries

Creates a new empty instance.

Syntax

Namespace: FlexCel.Core

public ChartSeries()

See also

  • ChartSeries

ChartSeries.ChartSeries(String, String, String)

Creates a new instance with the needed values when adding a new series.

Syntax

Namespace: FlexCel.Core

public ChartSeries(String aTitleDefinition, String aDataDefinition, String aCategoriesDefinition)

Parameters

<-> | Parameter | Type | Description
 | aTitleDefinition | String | Title of the series.
 | aDataDefinition | String | Formula defining the Data for the series.
 | aCategoriesDefinition | String | Formula defining the Categories for the series.

See also

  • ChartSeries

ChartSeries.ChartSeries(String, String, String, Object, Object[], Object[], String[], String[], Int32, Int32, Int32)

Creates a new instance and fills it with default values.

Syntax

Namespace: FlexCel.Core

public ChartSeries(String aTitleDefinition, String aDataDefinition, String aCategoriesDefinition, Object aTitleValue, Object[] aDataValues, Object[] aCategoriesValues, String[] aDataFormats, String[] aCategoriesFormats, Int32 aChartOptionsIndex, Int32 aSeriesIndex, Int32 aSeriesNumber)

Parameters

<-> | Parameter | Type | Description
 | aTitleDefinition | String | Title of the series.
 | aDataDefinition | String | Formula defining the Data for the series.
 | aCategoriesDefinition | String | Formula defining the Categories for the series.
 | aTitleValue | Object | Evaluated value of the series title.
 | aDataValues | Object[] | Actual values for the categories.
 | aCategoriesValues | Object[] | Actual values for the series.
 | aDataFormats | String[] | See DataFormats
 | aCategoriesFormats | String[] | See CategoriesFormats
 | aChartOptionsIndex | Int32 | Index to the ChartOptions object that applies to this series.
 | aSeriesIndex | Int32 | Index of this series on the file.
 | aSeriesNumber | Int32 | Series number as shown on the Legend box. This might be different from the SeriesIndex if the order of the series is changed.

See also

  • ChartSeries


ChartSeries.TitleDefinition Property | FlexCel Studio for the .NET Framework documentation

ChartSeries.TitleDefinition Property

Formula or text defining the Series caption. Start with an "=" sign to enter a formula.

Syntax

Namespace: FlexCel.Core

public String TitleDefinition { get; set; }

See also

  • ChartSeries


ChartSeries.DataDefinition Property | FlexCel Studio for the .NET Framework documentation

ChartSeries.DataDefinition Property

Formula defining the series. For example, "=A1:A5". Start with an "=" sign to enter a formula. Note that if the Series doesn't have a formula and only values (for example {1,2,3}), this property will be null and the result will be in DataValues

Syntax

Namespace: FlexCel.Core

public String DataDefinition { get; set; }

See also

  • ChartSeries


ChartSeries.CategoriesDefinition Property | FlexCel Studio for the .NET Framework documentation

ChartSeries.CategoriesDefinition Property

Formula defining the Series Categories (normally the x Axis). Start with an "=" sign to enter a formula. Note that if the Series doesn't have a formula and only values, this property will be null and the result will be in CategoriesValues

Syntax

Namespace: FlexCel.Core

public String CategoriesDefinition { get; set; }

See also

  • ChartSeries


ChartSeries.TitleValue Property | FlexCel Studio for the .NET Framework documentation

ChartSeries.TitleValue Property

Evaluated text of the title.

Syntax

Namespace: FlexCel.Core

public Object TitleValue { get; set; }

See also

  • ChartSeries


ChartSeries.DataValues Property | FlexCel Studio for the .NET Framework documentation

ChartSeries.DataValues Property

Actual values for the series.

Syntax

Namespace: FlexCel.Core

public Object[] DataValues { get; set; }

See also

  • ChartSeries


ChartSeries.DataValuesHidden Property | FlexCel Studio for the .NET Framework documentation

ChartSeries.DataValuesHidden Property

True if all the DataValues are from hidden cells. When this is true, the length of DataValues is 0.

Syntax

Namespace: FlexCel.Core

public Boolean DataValuesHidden { get; set; }

See also

  • ChartSeries


ChartSeries.CategoriesValues Property | FlexCel Studio for the .NET Framework documentation

ChartSeries.CategoriesValues Property

Actual values for the Series Categories (normally the x Axis). Note that category axis can contain multi-level labels. In those cases, CategoriesValues will just report all levels separated by carriage returns. To see the different levels as an array, use CategoriesValuesArray

Syntax

Namespace: FlexCel.Core

public Object[] CategoriesValues { get; set; }

See also

  • ChartSeries


ChartSeries.CategoriesValuesArray Property | FlexCel Studio for the .NET Framework documentation

ChartSeries.CategoriesValuesArray Property

Actual values for the Series Categories (normally the x Axis). This property is similar to CategoriesValues but if the labels have multiple levels, it will return a bi-dimensional array with one row per level.

Syntax

Namespace: FlexCel.Core

public Object[, ] CategoriesValuesArray { get; set; }

See also

  • ChartSeries


ChartSeries.DataFormats Property | FlexCel Studio for the .NET Framework documentation

ChartSeries.DataFormats Property

Format on the cell where the data is. So for example if you are charting a range A1:A3, this property will return an array with the numeric format strings for A1, A2 and A3.

This format is applied to the data if the data format for the axis or the label is null.

Each value in the array holds the format for one data point in the chart.

Remarks

You can't change this value, since it is the cell format. To change it, change the cell formats for the data instead.

Syntax

Namespace: FlexCel.Core

public String[] DataFormats { get; set; }

See also

  • ChartSeries


ChartSeries.CategoriesFormats Property | FlexCel Studio for the .NET Framework documentation

ChartSeries.CategoriesFormats Property

Format on the cell where the data is. So for example if you are charting a range A1:A3, this property will return an array with the numeric format strings for A1, A2 and A3.

This format is applied to the data if the data format for the axis or the label is null.

Each value in the array holds the format for one data point in the chart.

Remarks

You can't change this value, since it is the cell format. To change it, change the cell formats for the data instead. If the category axis has more than one level of labels, this property will return all levels concatenated by carriage returns. To get each level as a row in an array, use CategoriesFormatsArray

Syntax

Namespace: FlexCel.Core

public String[] CategoriesFormats { get; set; }

See also

  • ChartSeries


ChartSeries.CategoriesFormatsArray Property | FlexCel Studio for the .NET Framework documentation

ChartSeries.CategoriesFormatsArray Property

Format on the cell where the data is. So for example if you are charting a range A1:A3, this property will return an array with the numeric format strings for A1, A2 and A3.

This format is applied to the data if the data format for the axis or the label is null.

Each value in the array holds the format for one data point in the chart.

Remarks

You can't change this value, since it is the cell format. To change it, change the cell formats for the data instead. If the category axis has more than one level of labels, this property will return each level as a row in an array. To get all levels concatenated by carriage returns, use CategoriesFormats

Syntax

Namespace: FlexCel.Core

public String[, ] CategoriesFormatsArray { get; set; }

See also

  • ChartSeries


ChartSeries.ChartOptionsIndex Property | FlexCel Studio for the .NET Framework documentation

ChartSeries.ChartOptionsIndex Property

Index to the ChartOptions object that applies to this series. Note that in xlsx charts, this is the number of subchart where the series is. So when setting series, you don't need to specify the ChartOptionIndex: FlexCel will use the number of subchart no matter what you specify here.

Syntax

Namespace: FlexCel.Core

public Int32 ChartOptionsIndex { get; set; }

See also

  • ChartSeries


ChartSeries.SeriesIndex Property | FlexCel Studio for the .NET Framework documentation

ChartSeries.SeriesIndex Property

Index of this series on the file.

Syntax

Namespace: FlexCel.Core

public Int32 SeriesIndex { get; set; }

See also

  • ChartSeries


ChartSeries.SeriesNumber Property | FlexCel Studio for the .NET Framework documentation

ChartSeries.SeriesNumber Property

Series number as shown on the Legend box. This might be different from the SeriesIndex if the order of the series is changed.

Syntax

Namespace: FlexCel.Core

public Int32 SeriesNumber { get; set; }

See also

  • ChartSeries


ChartSeries.Options Property | FlexCel Studio for the .NET Framework documentation

ChartSeries.Options Property

Options for this series and their data points. -1 means the whole series, and n is options for the n-point.

Syntax

Namespace: FlexCel.Core

public TSeriesOptionsList Options { get; }

See also

  • ChartSeries


ChartSeries.LegendOptions Property | FlexCel Studio for the .NET Framework documentation

ChartSeries.LegendOptions Property

Options for the legend entry associated with this series. (when legend is showing series), or with a point on the series. (when legend is showing all the entries on series[0], for example on pie charts)

Syntax

Namespace: FlexCel.Core

public TLegendOptionsList LegendOptions { get; set; }

See also

  • ChartSeries


ChartSeries.HorizontalErrorBars Property | FlexCel Studio for the .NET Framework documentation

ChartSeries.HorizontalErrorBars Property

Returns the horizontal error bar options, if the chart has error bars. If the chart doesn't have them, then null will be returned.

Syntax

Namespace: FlexCel.Core

public TChartErrorBars HorizontalErrorBars { get; set; }

See also

  • ChartSeries


ChartSeries.VerticalErrorBars Property | FlexCel Studio for the .NET Framework documentation

ChartSeries.VerticalErrorBars Property

Returns the vertical error bar options, if the chart has error bars. If the chart doesn't have them, then null will be returned.

Syntax

Namespace: FlexCel.Core

public TChartErrorBars VerticalErrorBars { get; set; }

See also

  • ChartSeries


ChartSeriesFillOptions Class | FlexCel Studio for the .NET Framework documentation

ChartSeriesFillOptions Class

Fill options for a series or a point inside a series.

Syntax

Namespace: FlexCel.Core

public class ChartSeriesFillOptions: ChartFillOptions

Constructors

Name | Description
ChartSeriesFill​Options | Creates a new instance of this object.

Methods

Name | Description
Clone | Returns a deep copy of this object.
CloneInvertedFill | Clones the inverted fill if not null, else it will return null.

Properties

Name | Description
AutomaticColors | When true, fill colors are assigned automatically.
InvertNegativeValues | When true and values of the series are negative, foreground and background colors are reversed.
InvertedFill | Fill style for the negative bars in bar charts, when "invert if negative" is checked.


ChartSeriesFillOptions.ChartSeriesFillOptions Constructor | FlexCel Studio for the .NET Framework documentation

ChartSeriesFillOptions.ChartSeriesFillOptions Constructor

Creates a new instance of this object.

Syntax

Namespace: FlexCel.Core

public ChartSeriesFillOptions(TShapeFill aFill, TShapeFill aInvertedFill, Boolean aAutomaticColors, Boolean aInvertNegativeValues)

Parameters

<-> | Parameter | Type | Description
 | aFill | TShapeFill | Fill for the series.
 | aInvertedFill | TShapeFill | Fill style for the negative bars in bar charts, when "invert if negative" is checked.
 | aAutomaticColors | Boolean | When true, fill colors are assigned automatically.
 | aInvertNegativeValues | Boolean | When true and values of the series are negative, foreground and background colors are reversed.

See also

  • ChartSeriesFillOptions


ChartSeriesFillOptions.Clone Method | FlexCel Studio for the .NET Framework documentation

ChartSeriesFillOptions.Clone Method

Returns a deep copy of this object.

Syntax

Namespace: FlexCel.Core

public override Object Clone()

See also

  • ChartSeriesFillOptions


ChartSeriesFillOptions.CloneInvertedFill Method | FlexCel Studio for the .NET Framework documentation

ChartSeriesFillOptions.CloneInvertedFill Method

Clones the inverted fill if not null, else it will return null.

Syntax

Namespace: FlexCel.Core

protected TShapeFill CloneInvertedFill()

See also

  • ChartSeriesFillOptions


ChartSeriesFillOptions.AutomaticColors Property | FlexCel Studio for the .NET Framework documentation

ChartSeriesFillOptions.AutomaticColors Property

When true, fill colors are assigned automatically.

Syntax

Namespace: FlexCel.Core

public Boolean AutomaticColors { get; set; }

See also

  • ChartSeriesFillOptions


ChartSeriesFillOptions.InvertNegativeValues Property | FlexCel Studio for the .NET Framework documentation

ChartSeriesFillOptions.InvertNegativeValues Property

When true and values of the series are negative, foreground and background colors are reversed.

Syntax

Namespace: FlexCel.Core

public Boolean InvertNegativeValues { get; set; }

See also

  • ChartSeriesFillOptions


ChartSeriesFillOptions.InvertedFill Property | FlexCel Studio for the .NET Framework documentation

ChartSeriesFillOptions.InvertedFill Property

Fill style for the negative bars in bar charts, when "invert if negative" is checked.

Syntax

Namespace: FlexCel.Core

public TShapeFill InvertedFill { get; }

See also

  • ChartSeriesFillOptions


ChartSeriesLineOptions Class | FlexCel Studio for the .NET Framework documentation

ChartSeriesLineOptions Class

Line style options for a series or a point inside a series.

Syntax

Namespace: FlexCel.Core

public class ChartSeriesLineOptions: ChartLineOptions

Constructors

Name | Description
ChartSeriesLine​Options | Creates a new ChartSeriesLine​Options instance.

Methods

Name | Description
Clone | Returns a deep copy of this object.

Properties

Name | Description
AutomaticColors | When true, line colors are assigned automatically.


ChartSeriesLineOptions.ChartSeriesLineOptions Constructor | FlexCel Studio for the .NET Framework documentation

ChartSeriesLineOptions.ChartSeriesLineOptions Constructor

Creates a new ChartSeriesLineOptions instance.

Syntax

Namespace: FlexCel.Core

public ChartSeriesLineOptions(TShapeLine aShapeLine, Boolean aAutomaticColors)

Parameters

<-> | Parameter | Type | Description
 | aShapeLine | TShapeLine | Line drawing options.
 | aAutomaticColors | Boolean | When true, line colors are assigned automatically.

See also

  • ChartSeriesLineOptions


ChartSeriesLineOptions.Clone Method | FlexCel Studio for the .NET Framework documentation

ChartSeriesLineOptions.Clone Method

Returns a deep copy of this object.

Syntax

Namespace: FlexCel.Core

public override Object Clone()

See also

  • ChartSeriesLineOptions


ChartSeriesLineOptions.AutomaticColors Property | FlexCel Studio for the .NET Framework documentation

ChartSeriesLineOptions.AutomaticColors Property

When true, line colors are assigned automatically.

Syntax

Namespace: FlexCel.Core

public Boolean AutomaticColors { get; set; }

See also

  • ChartSeriesLineOptions


ChartSeriesMarkerOptions Class | FlexCel Studio for the .NET Framework documentation

ChartSeriesMarkerOptions Class

Marker options for the whole series or a point in the series when the chart is line or scatter.

Syntax

Namespace: FlexCel.Core

public class ChartSeriesMarkerOptions: ICloneable

Constructors

Name | Description
ChartSeriesMarker​Options | Creates a new ChartSeriesMarker​Options instance.

Methods

Name | Description
Clone | Returns a deep copy of this object.

Properties

Name | Description
LineFormat | Format of the marker lines.
Fill | Color of the marker fill.
MarkerType | Type of marker.
AutomaticFillColors | When true, marker colors are assigned automatically.
AutomaticLineColors | When true, marker colors are assigned automatically.
MarkerSize | Size of the marker in twips (1/20 of a point).
MarkerImageSize | Size fo the image for the marker, if the marker is an image and the markertype is image.
AutomaticShape | When true, marker shapes are assigned automatically.


ChartSeriesMarkerOptions.ChartSeriesMarkerOptions Constructor | FlexCel Studio for the .NET Framework documentation

ChartSeriesMarkerOptions.ChartSeriesMarkerOptions Constructor

Creates a new ChartSeriesMarkerOptions instance.

Syntax

Namespace: FlexCel.Core

public ChartSeriesMarkerOptions(ChartLineOptions aLineFormat, TFillStyle aFill, TChartMarkerType aMarkerType, Boolean aAutomaticFillColors, Boolean aAutomaticLineColors, Int32 aMarkerSize, TUISize aMarkerImageSize, Boolean aAutomaticShape)

Parameters

<-> | Parameter | Type | Description
 | aLineFormat | ChartLineOptions | Format of the marker lines.
 | aFill | TFillStyle | Color of the marker fill.
 | aMarkerType | TChartMarkerType | Type of marker.
 | aAutomaticFillColors | Boolean | When true, marker brush colors are assigned automatically.
 | aAutomaticLineColors | Boolean | When true, marker line colors are assigned automatically.
 | aMarkerSize | Int32 | Marker size.
 | aMarkerImageSize | TUISize | Image size for the marker when the type is Image.
 | aAutomaticShape | Boolean | When true, marker shape changes automatically.

See also

  • ChartSeriesMarkerOptions


ChartSeriesMarkerOptions.Clone Method | FlexCel Studio for the .NET Framework documentation

ChartSeriesMarkerOptions.Clone Method

Returns a deep copy of this object.

Syntax

Namespace: FlexCel.Core

public Object Clone()

See also

  • ChartSeriesMarkerOptions


ChartSeriesMarkerOptions.LineFormat Property | FlexCel Studio for the .NET Framework documentation

ChartSeriesMarkerOptions.LineFormat Property

Format of the marker lines.

Syntax

Namespace: FlexCel.Core

public ChartLineOptions LineFormat { get; set; }

See also

  • ChartSeriesMarkerOptions


ChartSeriesMarkerOptions.Fill Property | FlexCel Studio for the .NET Framework documentation

ChartSeriesMarkerOptions.Fill Property

Color of the marker fill.

Syntax

Namespace: FlexCel.Core

public TFillStyle Fill { get; set; }

See also

  • ChartSeriesMarkerOptions


ChartSeriesMarkerOptions.MarkerType Property | FlexCel Studio for the .NET Framework documentation

ChartSeriesMarkerOptions.MarkerType Property

Type of marker.

Syntax

Namespace: FlexCel.Core

public TChartMarkerType MarkerType { get; set; }

See also

  • ChartSeriesMarkerOptions


ChartSeriesMarkerOptions.AutomaticFillColors Property | FlexCel Studio for the .NET Framework documentation

ChartSeriesMarkerOptions.AutomaticFillColors Property

When true, marker colors are assigned automatically.

Syntax

Namespace: FlexCel.Core

public Boolean AutomaticFillColors { get; set; }

See also

  • ChartSeriesMarkerOptions


ChartSeriesMarkerOptions.AutomaticLineColors Property | FlexCel Studio for the .NET Framework documentation

ChartSeriesMarkerOptions.AutomaticLineColors Property

When true, marker colors are assigned automatically.

Syntax

Namespace: FlexCel.Core

public Boolean AutomaticLineColors { get; set; }

See also

  • ChartSeriesMarkerOptions


ChartSeriesMarkerOptions.MarkerSize Property | FlexCel Studio for the .NET Framework documentation

ChartSeriesMarkerOptions.MarkerSize Property

Size of the marker in twips (1/20 of a point).

Syntax

Namespace: FlexCel.Core

public Int32 MarkerSize { get; set; }

See also

  • ChartSeriesMarkerOptions


ChartSeriesMarkerOptions.MarkerImageSize Property | FlexCel Studio for the .NET Framework documentation

ChartSeriesMarkerOptions.MarkerImageSize Property

Size fo the image for the marker, if the marker is an image and the markertype is image.

Syntax

Namespace: FlexCel.Core

public TUISize MarkerImageSize { get; set; }

See also

  • ChartSeriesMarkerOptions


ChartSeriesMarkerOptions.AutomaticShape Property | FlexCel Studio for the .NET Framework documentation

ChartSeriesMarkerOptions.AutomaticShape Property

When true, marker shapes are assigned automatically.

Syntax

Namespace: FlexCel.Core

public Boolean AutomaticShape { get; set; }

See also

  • ChartSeriesMarkerOptions


ChartSeriesMiscOptions Class | FlexCel Studio for the .NET Framework documentation

ChartSeriesMiscOptions Class

Misc options for the whole series or a point in the series that do no enter in any other category.

Syntax

Namespace: FlexCel.Core

public class ChartSeriesMiscOptions: ICloneable

Constructors

Name | Description
ChartSeriesMisc​Options | Creates a new ChartSeriesMisc​Options instance.

Methods

Name | Description
Clone | Returns a deep copy of this object.

Properties

Name | Description
SmoothedLines | Lines should be smoothed (line and scatter charts).
Bubbles3D | Draw bubbles with 3D effects.
HasShadow | Series has shadow.


ChartSeriesMiscOptions.ChartSeriesMiscOptions Constructor | FlexCel Studio for the .NET Framework documentation

ChartSeriesMiscOptions.ChartSeriesMiscOptions Constructor

Creates a new ChartSeriesMiscOptions instance.

Syntax

Namespace: FlexCel.Core

public ChartSeriesMiscOptions(Boolean aSmoothedLines, Boolean aBubbles3D, Boolean aHasShadow)

Parameters

<-> | Parameter | Type | Description
 | aSmoothedLines | Boolean | Lines should be smoothed (line and scatter charts).
 | aBubbles3D | Boolean | Draw bubbles with 3D effects.
 | aHasShadow | Boolean | Series has shadow.

See also

  • ChartSeriesMiscOptions


ChartSeriesMiscOptions.Clone Method | FlexCel Studio for the .NET Framework documentation

ChartSeriesMiscOptions.Clone Method

Returns a deep copy of this object.

Syntax

Namespace: FlexCel.Core

public Object Clone()

See also

  • ChartSeriesMiscOptions


ChartSeriesMiscOptions.SmoothedLines Property | FlexCel Studio for the .NET Framework documentation

ChartSeriesMiscOptions.SmoothedLines Property

Lines should be smoothed (line and scatter charts).

Syntax

Namespace: FlexCel.Core

public Boolean SmoothedLines { get; set; }

See also

  • ChartSeriesMiscOptions


ChartSeriesMiscOptions.Bubbles3D Property | FlexCel Studio for the .NET Framework documentation

ChartSeriesMiscOptions.Bubbles3D Property

Draw bubbles with 3D effects.

Syntax

Namespace: FlexCel.Core

public Boolean Bubbles3D { get; set; }

See also

  • ChartSeriesMiscOptions


ChartSeriesMiscOptions.HasShadow Property | FlexCel Studio for the .NET Framework documentation

ChartSeriesMiscOptions.HasShadow Property

Series has shadow.

Syntax

Namespace: FlexCel.Core

public Boolean HasShadow { get; set; }

See also

  • ChartSeriesMiscOptions


ChartSeriesOptions Class | FlexCel Studio for the .NET Framework documentation

ChartSeriesOptions Class

Options for the whole series or for a data point inside it.

Syntax

Namespace: FlexCel.Core

public class ChartSeriesOptions: ICloneable

Constructors

Name | Description
ChartSeriesOptions | Creates a new instance of ChartSeriesOptions. Objects will be cloned, so you can change their values later and they will not change the value on this class.

Methods

Name | Description
Clone | Returns a deep copy of this object.

Properties

Name | Description
PointNumber | Point number where this options apply. -1 means that the options apply for the whole series.
FillOptions | Fill options for the series or point.
LineOptions | Line options for the series or point.
PieOptions | If the chart type is pie, options for the pie. If it is not a pie chart, this value has no meaning.
MarkerOptions | Color and shape of the markers on Line and Scatter charts.
MiscOptions | Other options not related to the specific parts.
XlsxMode | If true, the chart was created by an xlsx-capable Excel version (2007 or newer) and so has different defaults. For example, it will have different automatic colors for the series.


ChartSeriesOptions.ChartSeriesOptions Constructor | FlexCel Studio for the .NET Framework documentation

ChartSeriesOptions.ChartSeriesOptions Constructor

Creates a new instance of ChartSeriesOptions. Objects will be cloned, so you can change their values later and they will not change the value on this class.

Syntax

Namespace: FlexCel.Core

public ChartSeriesOptions(Int32 aPointNumber, ChartSeriesFillOptions aFillOptions, ChartSeriesLineOptions aLineOptions, ChartSeriesPieOptions aPieOptions, ChartSeriesMarkerOptions aMarkerOptions, ChartSeriesMiscOptions aMiscOptions, Boolean aXlsMode)

Parameters

<-> | Parameter | Type | Description
 | aPointNumber | Int32 | Point number where this options apply. -1 means that the options apply for the whole series.
 | aFillOptions | ChartSeriesFill​Options | Fill options for the series or point.
 | aLineOptions | ChartSeriesLine​Options | Line options for the series or point.
 | aPieOptions | ChartSeriesPie​Options | If the chart type is pie, options for the pie. If it is not a pie chart, this value has no meaning.
 | aMarkerOptions | ChartSeriesMarker​Options | Color and shape of the markers on Line and Scatter charts.
 | aMiscOptions | ChartSeriesMisc​Options | Misc Options.
 | aXlsMode | Boolean | If true, this is a xlsx chart, which has different automatic colors, etc.

See also

  • ChartSeriesOptions


ChartSeriesOptions.Clone Method | FlexCel Studio for the .NET Framework documentation

ChartSeriesOptions.Clone Method

Returns a deep copy of this object.

Syntax

Namespace: FlexCel.Core

public Object Clone()

See also

  • ChartSeriesOptions


ChartSeriesOptions.PointNumber Property | FlexCel Studio for the .NET Framework documentation

ChartSeriesOptions.PointNumber Property

Point number where this options apply. -1 means that the options apply for the whole series.

Syntax

Namespace: FlexCel.Core

public Int32 PointNumber { get; set; }

See also

  • ChartSeriesOptions


ChartSeriesOptions.FillOptions Property | FlexCel Studio for the .NET Framework documentation

ChartSeriesOptions.FillOptions Property

Fill options for the series or point.

Syntax

Namespace: FlexCel.Core

public ChartSeriesFillOptions FillOptions { get; set; }

See also

  • ChartSeriesOptions


ChartSeriesOptions.LineOptions Property | FlexCel Studio for the .NET Framework documentation

ChartSeriesOptions.LineOptions Property

Line options for the series or point.

Syntax

Namespace: FlexCel.Core

public ChartSeriesLineOptions LineOptions { get; set; }

See also

  • ChartSeriesOptions


ChartSeriesOptions.PieOptions Property | FlexCel Studio for the .NET Framework documentation

ChartSeriesOptions.PieOptions Property

If the chart type is pie, options for the pie. If it is not a pie chart, this value has no meaning.

Syntax

Namespace: FlexCel.Core

public ChartSeriesPieOptions PieOptions { get; set; }

See also

  • ChartSeriesOptions


ChartSeriesOptions.MarkerOptions Property | FlexCel Studio for the .NET Framework documentation

ChartSeriesOptions.MarkerOptions Property

Color and shape of the markers on Line and Scatter charts.

Syntax

Namespace: FlexCel.Core

public ChartSeriesMarkerOptions MarkerOptions { get; set; }

See also

  • ChartSeriesOptions


ChartSeriesOptions.MiscOptions Property | FlexCel Studio for the .NET Framework documentation

ChartSeriesOptions.MiscOptions Property

Other options not related to the specific parts.

Syntax

Namespace: FlexCel.Core

public ChartSeriesMiscOptions MiscOptions { get; set; }

See also

  • ChartSeriesOptions


ChartSeriesOptions.XlsxMode Property | FlexCel Studio for the .NET Framework documentation

ChartSeriesOptions.XlsxMode Property

If true, the chart was created by an xlsx-capable Excel version (2007 or newer) and so has different defaults. For example, it will have different automatic colors for the series.

Syntax

Namespace: FlexCel.Core

public Boolean XlsxMode { get; set; }

See also

  • ChartSeriesOptions


ChartSeriesPieOptions Class | FlexCel Studio for the .NET Framework documentation

ChartSeriesPieOptions Class

Pie options for a series or a slice of the series when the chart is a pie chart.

Syntax

Namespace: FlexCel.Core

public class ChartSeriesPieOptions: ICloneable

Constructors

Name | Description
ChartSeriesPie​Options | Creates a new ChartSeriesPie​Options instance.

Methods

Name | Description
Clone | Returns a deep copy of this object.

Properties

Name | Description
SliceDistance | Distance of the pie slice from the center on percent of the pie diameter.


ChartSeriesPieOptions.ChartSeriesPieOptions Constructor | FlexCel Studio for the .NET Framework documentation

ChartSeriesPieOptions.ChartSeriesPieOptions Constructor

Creates a new ChartSeriesPieOptions instance.

Syntax

Namespace: FlexCel.Core

public ChartSeriesPieOptions(Int32 aSliceDistance)

Parameters

<-> | Parameter | Type | Description
 | aSliceDistance | Int32 | Distance of the pie slice from the center on percent of the pie diameter.

See also

  • ChartSeriesPieOptions


ChartSeriesPieOptions.Clone Method | FlexCel Studio for the .NET Framework documentation

ChartSeriesPieOptions.Clone Method

Returns a deep copy of this object.

Syntax

Namespace: FlexCel.Core

public Object Clone()

See also

  • ChartSeriesPieOptions


ChartSeriesPieOptions.SliceDistance Property | FlexCel Studio for the .NET Framework documentation

ChartSeriesPieOptions.SliceDistance Property

Distance of the pie slice from the center on percent of the pie diameter.

Syntax

Namespace: FlexCel.Core

public Int32 SliceDistance { get; set; }

See also

  • ChartSeriesPieOptions


ChartWallOptions Class | FlexCel Studio for the .NET Framework documentation

ChartWallOptions Class

Fill and Line options for the walls and floor of a 3D chart.

Syntax

Namespace: FlexCel.Core

public class ChartWallOptions

Constructors

Name | Description
ChartWallOptions | Creates a new ChartWallOptions object.

Methods

Name | Description
Clone | Creates a deep copy of the object.

Properties

Name | Description
FillOptions | Fill colors for the walls.
LineOptions | Line colors and style for the walls.


ChartWallOptions.ChartWallOptions Constructor | FlexCel Studio for the .NET Framework documentation

ChartWallOptions.ChartWallOptions Constructor

Creates a new ChartWallOptions object.

Syntax

Namespace: FlexCel.Core

public ChartWallOptions(ChartFillOptions aFillOptions, ChartLineOptions aLineOptions)

Parameters

<-> | Parameter | Type | Description
 | aFillOptions | ChartFillOptions | See FillOptions.
 | aLineOptions | ChartLineOptions | See LineOptions.

See also

  • ChartWallOptions


ChartWallOptions.Clone Method | FlexCel Studio for the .NET Framework documentation

ChartWallOptions.Clone Method

Creates a deep copy of the object.

Syntax

Namespace: FlexCel.Core

public ChartWallOptions Clone()

See also

  • ChartWallOptions


ChartWallOptions.FillOptions Property | FlexCel Studio for the .NET Framework documentation

ChartWallOptions.FillOptions Property

Fill colors for the walls.

Syntax

Namespace: FlexCel.Core

public ChartFillOptions FillOptions { get; set; }

See also

  • ChartWallOptions


ChartWallOptions.LineOptions Property | FlexCel Studio for the .NET Framework documentation

ChartWallOptions.LineOptions Property

Line colors and style for the walls.

Syntax

Namespace: FlexCel.Core

public ChartLineOptions LineOptions { get; set; }

See also

  • ChartWallOptions


Colors Class | FlexCel Studio for the .NET Framework documentation

Colors Class

A list of standard colors.

Syntax

Namespace: FlexCel.Core

public static class Colors

Fields

Name | Description
Transparent | Transparent color.
AliceBlue | AliceBlue color.
AntiqueWhite | AntiqueWhite color.
Aqua | Aqua color.
Aquamarine | Aquamarine color.
Azure | Azure color.
Beige | Beige color.
Bisque | Bisque color.
Black | Black color.
BlanchedAlmond | BlanchedAlmond color.
Blue | Blue color.
BlueViolet | BlueViolet color.
Brown | Brown color.
BurlyWood | BurlyWood color.
CadetBlue | CadetBlue color.
Chartreuse | Chartreuse color.
Chocolate | Chocolate color.
Coral | Coral color.
CornflowerBlue | CornflowerBlue color.
Cornsilk | Cornsilk color.
Crimson | Crimson color.
Cyan | Cyan color.
DarkBlue | DarkBlue color.
DarkCyan | DarkCyan color.
DarkGoldenrod | DarkGoldenrod color.
DarkGray | DarkGray color.
DarkGreen | DarkGreen color.
DarkKhaki | DarkKhaki color.
DarkMagenta | DarkMagenta color.
DarkOliveGreen | DarkOliveGreen color.
DarkOrange | DarkOrange color.
DarkOrchid | DarkOrchid color.
DarkRed | DarkRed color.
DarkSalmon | DarkSalmon color.
DarkSeaGreen | DarkSeaGreen color.
DarkSlateBlue | DarkSlateBlue color.
DarkSlateGray | DarkSlateGray color.
DarkTurquoise | DarkTurquoise color.
DarkViolet | DarkViolet color.
DeepPink | DeepPink color.
DeepSkyBlue | DeepSkyBlue color.
DimGray | DimGray color.
DodgerBlue | DodgerBlue color.
Firebrick | Firebrick color.
FloralWhite | FloralWhite color.
ForestGreen | ForestGreen color.
Fuchsia | Fuchsia color.
Gainsboro | Gainsboro color.
GhostWhite | GhostWhite color.
Gold | Gold color.
Goldenrod | Goldenrod color.
Gray | Gray color.
Green | Green color.
GreenYellow | GreenYellow color.
Honeydew | Honeydew color.
HotPink | HotPink color.
IndianRed | IndianRed color.
Indigo | Indigo color.
Ivory | Ivory color.
Khaki | Khaki color.
Lavender | Lavender color.
LavenderBlush | LavenderBlush color.
LawnGreen | LawnGreen color.
LemonChiffon | LemonChiffon color.
LightBlue | LightBlue color.
LightCoral | LightCoral color.
LightCyan | LightCyan color.
LightGoldenrodYellow | LightGoldenrodYellow color.
LightGray | LightGray color.
LightGreen | LightGreen color.
LightPink | LightPink color.
LightSalmon | LightSalmon color.
LightSeaGreen | LightSeaGreen color.
LightSkyBlue | LightSkyBlue color.
LightSlateGray | LightSlateGray color.
LightSteelBlue | LightSteelBlue color.
LightYellow | LightYellow color.
Lime | Lime color.
LimeGreen | LimeGreen color.
Linen | Linen color.
Magenta | Magenta color.
Maroon | Maroon color.
MediumAquamarine | MediumAquamarine color.
MediumBlue | MediumBlue color.
MediumOrchid | MediumOrchid color.
MediumPurple | MediumPurple color.
MediumSeaGreen | MediumSeaGreen color.
MediumSlateBlue | MediumSlateBlue color.
MediumSpringGreen | MediumSpringGreen color.
MediumTurquoise | MediumTurquoise color.
MediumVioletRed | MediumVioletRed color.
MidnightBlue | MidnightBlue color.
MintCream | MintCream color.
MistyRose | MistyRose color.
Moccasin | Moccasin color.
NavajoWhite | NavajoWhite color.
Navy | Navy color.
OldLace | OldLace color.
Olive | Olive color.
OliveDrab | OliveDrab color.
Orange | Orange color.
OrangeRed | OrangeRed color.
Orchid | Orchid color.
PaleGoldenrod | PaleGoldenrod color.
PaleGreen | PaleGreen color.
PaleTurquoise | PaleTurquoise color.
PaleVioletRed | PaleVioletRed color.
PapayaWhip | PapayaWhip color.
PeachPuff | PeachPuff color.
Peru | Peru color.
Pink | Pink color.
Plum | Plum color.
PowderBlue | PowderBlue color.
Purple | Purple color.
Red | Red color.
RosyBrown | RosyBrown color.
RoyalBlue | RoyalBlue color.
SaddleBrown | SaddleBrown color.
Salmon | Salmon color.
SandyBrown | SandyBrown color.
SeaGreen | SeaGreen color.
SeaShell | SeaShell color.
Sienna | Sienna color.
Silver | Silver color.
SkyBlue | SkyBlue color.
SlateBlue | SlateBlue color.
SlateGray | SlateGray color.
Snow | Snow color.
SpringGreen | SpringGreen color.
SteelBlue | SteelBlue color.
Tan | Tan color.
Teal | Teal color.
Thistle | Thistle color.
Tomato | Tomato color.
Turquoise | Turquoise color.
Violet | Violet color.
Wheat | Wheat color.
White | White color.
WhiteSmoke | WhiteSmoke color.
Yellow | Yellow color.
YellowGreen | YellowGreen color.


Colors.Transparent Field | FlexCel Studio for the .NET Framework documentation

Colors.Transparent Field

Transparent color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor Transparent

See also

  • Colors


Colors.AliceBlue Field | FlexCel Studio for the .NET Framework documentation

Colors.AliceBlue Field

AliceBlue color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor AliceBlue

See also

  • Colors


Colors.AntiqueWhite Field | FlexCel Studio for the .NET Framework documentation

Colors.AntiqueWhite Field

AntiqueWhite color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor AntiqueWhite

See also

  • Colors


Colors.Aqua Field | FlexCel Studio for the .NET Framework documentation

Colors.Aqua Field

Aqua color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor Aqua

See also

  • Colors


Colors.Aquamarine Field | FlexCel Studio for the .NET Framework documentation

Colors.Aquamarine Field

Aquamarine color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor Aquamarine

See also

  • Colors


Colors.Azure Field | FlexCel Studio for the .NET Framework documentation

Colors.Azure Field

Azure color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor Azure

See also

  • Colors


Colors.Beige Field | FlexCel Studio for the .NET Framework documentation

Colors.Beige Field

Beige color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor Beige

See also

  • Colors


Colors.Bisque Field | FlexCel Studio for the .NET Framework documentation

Colors.Bisque Field

Bisque color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor Bisque

See also

  • Colors


Colors.Black Field | FlexCel Studio for the .NET Framework documentation

Colors.Black Field

Black color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor Black

See also

  • Colors


Colors.BlanchedAlmond Field | FlexCel Studio for the .NET Framework documentation

Colors.BlanchedAlmond Field

BlanchedAlmond color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor BlanchedAlmond

See also

  • Colors


Colors.Blue Field | FlexCel Studio for the .NET Framework documentation

Colors.Blue Field

Blue color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor Blue

See also

  • Colors


Colors.BlueViolet Field | FlexCel Studio for the .NET Framework documentation

Colors.BlueViolet Field

BlueViolet color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor BlueViolet

See also

  • Colors


Colors.Brown Field | FlexCel Studio for the .NET Framework documentation

Colors.Brown Field

Brown color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor Brown

See also

  • Colors


Colors.BurlyWood Field | FlexCel Studio for the .NET Framework documentation

Colors.BurlyWood Field

BurlyWood color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor BurlyWood

See also

  • Colors


Colors.CadetBlue Field | FlexCel Studio for the .NET Framework documentation

Colors.CadetBlue Field

CadetBlue color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor CadetBlue

See also

  • Colors


Colors.Chartreuse Field | FlexCel Studio for the .NET Framework documentation

Colors.Chartreuse Field

Chartreuse color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor Chartreuse

See also

  • Colors


Colors.Chocolate Field | FlexCel Studio for the .NET Framework documentation

Colors.Chocolate Field

Chocolate color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor Chocolate

See also

  • Colors


Colors.Coral Field | FlexCel Studio for the .NET Framework documentation

Colors.Coral Field

Coral color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor Coral

See also

  • Colors


Colors.CornflowerBlue Field | FlexCel Studio for the .NET Framework documentation

Colors.CornflowerBlue Field

CornflowerBlue color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor CornflowerBlue

See also

  • Colors


Colors.Cornsilk Field | FlexCel Studio for the .NET Framework documentation

Colors.Cornsilk Field

Cornsilk color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor Cornsilk

See also

  • Colors


Colors.Crimson Field | FlexCel Studio for the .NET Framework documentation

Colors.Crimson Field

Crimson color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor Crimson

See also

  • Colors


Colors.Cyan Field | FlexCel Studio for the .NET Framework documentation

Colors.Cyan Field

Cyan color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor Cyan

See also

  • Colors


Colors.DarkBlue Field | FlexCel Studio for the .NET Framework documentation

Colors.DarkBlue Field

DarkBlue color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor DarkBlue

See also

  • Colors


Colors.DarkCyan Field | FlexCel Studio for the .NET Framework documentation

Colors.DarkCyan Field

DarkCyan color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor DarkCyan

See also

  • Colors


Colors.DarkGoldenrod Field | FlexCel Studio for the .NET Framework documentation

Colors.DarkGoldenrod Field

DarkGoldenrod color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor DarkGoldenrod

See also

  • Colors


Colors.DarkGray Field | FlexCel Studio for the .NET Framework documentation

Colors.DarkGray Field

DarkGray color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor DarkGray

See also

  • Colors


Colors.DarkGreen Field | FlexCel Studio for the .NET Framework documentation

Colors.DarkGreen Field

DarkGreen color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor DarkGreen

See also

  • Colors


Colors.DarkKhaki Field | FlexCel Studio for the .NET Framework documentation

Colors.DarkKhaki Field

DarkKhaki color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor DarkKhaki

See also

  • Colors


Colors.DarkMagenta Field | FlexCel Studio for the .NET Framework documentation

Colors.DarkMagenta Field

DarkMagenta color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor DarkMagenta

See also

  • Colors


Colors.DarkOliveGreen Field | FlexCel Studio for the .NET Framework documentation

Colors.DarkOliveGreen Field

DarkOliveGreen color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor DarkOliveGreen

See also

  • Colors


Colors.DarkOrange Field | FlexCel Studio for the .NET Framework documentation

Colors.DarkOrange Field

DarkOrange color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor DarkOrange

See also

  • Colors


Colors.DarkOrchid Field | FlexCel Studio for the .NET Framework documentation

Colors.DarkOrchid Field

DarkOrchid color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor DarkOrchid

See also

  • Colors


Colors.DarkRed Field | FlexCel Studio for the .NET Framework documentation

Colors.DarkRed Field

DarkRed color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor DarkRed

See also

  • Colors


Colors.DarkSalmon Field | FlexCel Studio for the .NET Framework documentation

Colors.DarkSalmon Field

DarkSalmon color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor DarkSalmon

See also

  • Colors


Colors.DarkSeaGreen Field | FlexCel Studio for the .NET Framework documentation

Colors.DarkSeaGreen Field

DarkSeaGreen color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor DarkSeaGreen

See also

  • Colors


Colors.DarkSlateBlue Field | FlexCel Studio for the .NET Framework documentation

Colors.DarkSlateBlue Field

DarkSlateBlue color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor DarkSlateBlue

See also

  • Colors


Colors.DarkSlateGray Field | FlexCel Studio for the .NET Framework documentation

Colors.DarkSlateGray Field

DarkSlateGray color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor DarkSlateGray

See also

  • Colors


Colors.DarkTurquoise Field | FlexCel Studio for the .NET Framework documentation

Colors.DarkTurquoise Field

DarkTurquoise color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor DarkTurquoise

See also

  • Colors


Colors.DarkViolet Field | FlexCel Studio for the .NET Framework documentation

Colors.DarkViolet Field

DarkViolet color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor DarkViolet

See also

  • Colors


Colors.DeepPink Field | FlexCel Studio for the .NET Framework documentation

Colors.DeepPink Field

DeepPink color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor DeepPink

See also

  • Colors


Colors.DeepSkyBlue Field | FlexCel Studio for the .NET Framework documentation

Colors.DeepSkyBlue Field

DeepSkyBlue color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor DeepSkyBlue

See also

  • Colors


Colors.DimGray Field | FlexCel Studio for the .NET Framework documentation

Colors.DimGray Field

DimGray color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor DimGray

See also

  • Colors


Colors.DodgerBlue Field | FlexCel Studio for the .NET Framework documentation

Colors.DodgerBlue Field

DodgerBlue color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor DodgerBlue

See also

  • Colors


Colors.Firebrick Field | FlexCel Studio for the .NET Framework documentation

Colors.Firebrick Field

Firebrick color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor Firebrick

See also

  • Colors


Colors.FloralWhite Field | FlexCel Studio for the .NET Framework documentation

Colors.FloralWhite Field

FloralWhite color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor FloralWhite

See also

  • Colors


Colors.ForestGreen Field | FlexCel Studio for the .NET Framework documentation

Colors.ForestGreen Field

ForestGreen color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor ForestGreen

See also

  • Colors


Colors.Fuchsia Field | FlexCel Studio for the .NET Framework documentation

Colors.Fuchsia Field

Fuchsia color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor Fuchsia

See also

  • Colors


Colors.Gainsboro Field | FlexCel Studio for the .NET Framework documentation

Colors.Gainsboro Field

Gainsboro color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor Gainsboro

See also

  • Colors


Colors.GhostWhite Field | FlexCel Studio for the .NET Framework documentation

Colors.GhostWhite Field

GhostWhite color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor GhostWhite

See also

  • Colors


Colors.Gold Field | FlexCel Studio for the .NET Framework documentation

Colors.Gold Field

Gold color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor Gold

See also

  • Colors


Colors.Goldenrod Field | FlexCel Studio for the .NET Framework documentation

Colors.Goldenrod Field

Goldenrod color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor Goldenrod

See also

  • Colors


Colors.Gray Field | FlexCel Studio for the .NET Framework documentation

Colors.Gray Field

Gray color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor Gray

See also

  • Colors


Colors.Green Field | FlexCel Studio for the .NET Framework documentation

Colors.Green Field

Green color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor Green

See also

  • Colors


Colors.GreenYellow Field | FlexCel Studio for the .NET Framework documentation

Colors.GreenYellow Field

GreenYellow color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor GreenYellow

See also

  • Colors


Colors.Honeydew Field | FlexCel Studio for the .NET Framework documentation

Colors.Honeydew Field

Honeydew color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor Honeydew

See also

  • Colors


Colors.HotPink Field | FlexCel Studio for the .NET Framework documentation

Colors.HotPink Field

HotPink color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor HotPink

See also

  • Colors


Colors.IndianRed Field | FlexCel Studio for the .NET Framework documentation

Colors.IndianRed Field

IndianRed color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor IndianRed

See also

  • Colors


Colors.Indigo Field | FlexCel Studio for the .NET Framework documentation

Colors.Indigo Field

Indigo color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor Indigo

See also

  • Colors


Colors.Ivory Field | FlexCel Studio for the .NET Framework documentation

Colors.Ivory Field

Ivory color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor Ivory

See also

  • Colors


Colors.Khaki Field | FlexCel Studio for the .NET Framework documentation

Colors.Khaki Field

Khaki color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor Khaki

See also

  • Colors


Colors.Lavender Field | FlexCel Studio for the .NET Framework documentation

Colors.Lavender Field

Lavender color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor Lavender

See also

  • Colors


Colors.LavenderBlush Field | FlexCel Studio for the .NET Framework documentation

Colors.LavenderBlush Field

LavenderBlush color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor LavenderBlush

See also

  • Colors


Colors.LawnGreen Field | FlexCel Studio for the .NET Framework documentation

Colors.LawnGreen Field

LawnGreen color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor LawnGreen

See also

  • Colors


Colors.LemonChiffon Field | FlexCel Studio for the .NET Framework documentation

Colors.LemonChiffon Field

LemonChiffon color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor LemonChiffon

See also

  • Colors


Colors.LightBlue Field | FlexCel Studio for the .NET Framework documentation

Colors.LightBlue Field

LightBlue color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor LightBlue

See also

  • Colors


Colors.LightCoral Field | FlexCel Studio for the .NET Framework documentation

Colors.LightCoral Field

LightCoral color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor LightCoral

See also

  • Colors


Colors.LightCyan Field | FlexCel Studio for the .NET Framework documentation

Colors.LightCyan Field

LightCyan color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor LightCyan

See also

  • Colors


Colors.LightGoldenrodYellow Field | FlexCel Studio for the .NET Framework documentation

Colors.LightGoldenrodYellow Field

LightGoldenrodYellow color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor LightGoldenrodYellow

See also

  • Colors


Colors.LightGray Field | FlexCel Studio for the .NET Framework documentation

Colors.LightGray Field

LightGray color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor LightGray

See also

  • Colors


Colors.LightGreen Field | FlexCel Studio for the .NET Framework documentation

Colors.LightGreen Field

LightGreen color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor LightGreen

See also

  • Colors


Colors.LightPink Field | FlexCel Studio for the .NET Framework documentation

Colors.LightPink Field

LightPink color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor LightPink

See also

  • Colors


Colors.LightSalmon Field | FlexCel Studio for the .NET Framework documentation

Colors.LightSalmon Field

LightSalmon color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor LightSalmon

See also

  • Colors


Colors.LightSeaGreen Field | FlexCel Studio for the .NET Framework documentation

Colors.LightSeaGreen Field

LightSeaGreen color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor LightSeaGreen

See also

  • Colors


Colors.LightSkyBlue Field | FlexCel Studio for the .NET Framework documentation

Colors.LightSkyBlue Field

LightSkyBlue color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor LightSkyBlue

See also

  • Colors


Colors.LightSlateGray Field | FlexCel Studio for the .NET Framework documentation

Colors.LightSlateGray Field

LightSlateGray color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor LightSlateGray

See also

  • Colors


Colors.LightSteelBlue Field | FlexCel Studio for the .NET Framework documentation

Colors.LightSteelBlue Field

LightSteelBlue color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor LightSteelBlue

See also

  • Colors


Colors.LightYellow Field | FlexCel Studio for the .NET Framework documentation

Colors.LightYellow Field

LightYellow color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor LightYellow

See also

  • Colors


Colors.Lime Field | FlexCel Studio for the .NET Framework documentation

Colors.Lime Field

Lime color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor Lime

See also

  • Colors


Colors.LimeGreen Field | FlexCel Studio for the .NET Framework documentation

Colors.LimeGreen Field

LimeGreen color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor LimeGreen

See also

  • Colors


Colors.Linen Field | FlexCel Studio for the .NET Framework documentation

Colors.Linen Field

Linen color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor Linen

See also

  • Colors


Colors.Magenta Field | FlexCel Studio for the .NET Framework documentation

Colors.Magenta Field

Magenta color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor Magenta

See also

  • Colors


Colors.Maroon Field | FlexCel Studio for the .NET Framework documentation

Colors.Maroon Field

Maroon color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor Maroon

See also

  • Colors


Colors.MediumAquamarine Field | FlexCel Studio for the .NET Framework documentation

Colors.MediumAquamarine Field

MediumAquamarine color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor MediumAquamarine

See also

  • Colors


Colors.MediumBlue Field | FlexCel Studio for the .NET Framework documentation

Colors.MediumBlue Field

MediumBlue color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor MediumBlue

See also

  • Colors


Colors.MediumOrchid Field | FlexCel Studio for the .NET Framework documentation

Colors.MediumOrchid Field

MediumOrchid color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor MediumOrchid

See also

  • Colors


Colors.MediumPurple Field | FlexCel Studio for the .NET Framework documentation

Colors.MediumPurple Field

MediumPurple color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor MediumPurple

See also

  • Colors


Colors.MediumSeaGreen Field | FlexCel Studio for the .NET Framework documentation

Colors.MediumSeaGreen Field

MediumSeaGreen color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor MediumSeaGreen

See also

  • Colors


Colors.MediumSlateBlue Field | FlexCel Studio for the .NET Framework documentation

Colors.MediumSlateBlue Field

MediumSlateBlue color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor MediumSlateBlue

See also

  • Colors


Colors.MediumSpringGreen Field | FlexCel Studio for the .NET Framework documentation

Colors.MediumSpringGreen Field

MediumSpringGreen color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor MediumSpringGreen

See also

  • Colors


Colors.MediumTurquoise Field | FlexCel Studio for the .NET Framework documentation

Colors.MediumTurquoise Field

MediumTurquoise color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor MediumTurquoise

See also

  • Colors


Colors.MediumVioletRed Field | FlexCel Studio for the .NET Framework documentation

Colors.MediumVioletRed Field

MediumVioletRed color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor MediumVioletRed

See also

  • Colors


Colors.MidnightBlue Field | FlexCel Studio for the .NET Framework documentation

Colors.MidnightBlue Field

MidnightBlue color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor MidnightBlue

See also

  • Colors


Colors.MintCream Field | FlexCel Studio for the .NET Framework documentation

Colors.MintCream Field

MintCream color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor MintCream

See also

  • Colors


Colors.MistyRose Field | FlexCel Studio for the .NET Framework documentation

Colors.MistyRose Field

MistyRose color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor MistyRose

See also

  • Colors


Colors.Moccasin Field | FlexCel Studio for the .NET Framework documentation

Colors.Moccasin Field

Moccasin color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor Moccasin

See also

  • Colors


Colors.NavajoWhite Field | FlexCel Studio for the .NET Framework documentation

Colors.NavajoWhite Field

NavajoWhite color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor NavajoWhite

See also

  • Colors


Colors.Navy Field | FlexCel Studio for the .NET Framework documentation

Colors.Navy Field

Navy color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor Navy

See also

  • Colors


Colors.OldLace Field | FlexCel Studio for the .NET Framework documentation

Colors.OldLace Field

OldLace color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor OldLace

See also

  • Colors


Colors.Olive Field | FlexCel Studio for the .NET Framework documentation

Colors.Olive Field

Olive color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor Olive

See also

  • Colors


Colors.OliveDrab Field | FlexCel Studio for the .NET Framework documentation

Colors.OliveDrab Field

OliveDrab color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor OliveDrab

See also

  • Colors


Colors.Orange Field | FlexCel Studio for the .NET Framework documentation

Colors.Orange Field

Orange color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor Orange

See also

  • Colors


Colors.OrangeRed Field | FlexCel Studio for the .NET Framework documentation

Colors.OrangeRed Field

OrangeRed color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor OrangeRed

See also

  • Colors


Colors.Orchid Field | FlexCel Studio for the .NET Framework documentation

Colors.Orchid Field

Orchid color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor Orchid

See also

  • Colors


Colors.PaleGoldenrod Field | FlexCel Studio for the .NET Framework documentation

Colors.PaleGoldenrod Field

PaleGoldenrod color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor PaleGoldenrod

See also

  • Colors


Colors.PaleGreen Field | FlexCel Studio for the .NET Framework documentation

Colors.PaleGreen Field

PaleGreen color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor PaleGreen

See also

  • Colors


Colors.PaleTurquoise Field | FlexCel Studio for the .NET Framework documentation

Colors.PaleTurquoise Field

PaleTurquoise color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor PaleTurquoise

See also

  • Colors


Colors.PaleVioletRed Field | FlexCel Studio for the .NET Framework documentation

Colors.PaleVioletRed Field

PaleVioletRed color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor PaleVioletRed

See also

  • Colors


Colors.PapayaWhip Field | FlexCel Studio for the .NET Framework documentation

Colors.PapayaWhip Field

PapayaWhip color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor PapayaWhip

See also

  • Colors


Colors.PeachPuff Field | FlexCel Studio for the .NET Framework documentation

Colors.PeachPuff Field

PeachPuff color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor PeachPuff

See also

  • Colors


Colors.Peru Field | FlexCel Studio for the .NET Framework documentation

Colors.Peru Field

Peru color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor Peru

See also

  • Colors


Colors.Pink Field | FlexCel Studio for the .NET Framework documentation

Colors.Pink Field

Pink color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor Pink

See also

  • Colors


Colors.Plum Field | FlexCel Studio for the .NET Framework documentation

Colors.Plum Field

Plum color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor Plum

See also

  • Colors


Colors.PowderBlue Field | FlexCel Studio for the .NET Framework documentation

Colors.PowderBlue Field

PowderBlue color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor PowderBlue

See also

  • Colors


Colors.Purple Field | FlexCel Studio for the .NET Framework documentation

Colors.Purple Field

Purple color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor Purple

See also

  • Colors


Colors.Red Field | FlexCel Studio for the .NET Framework documentation

Colors.Red Field

Red color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor Red

See also

  • Colors


Colors.RosyBrown Field | FlexCel Studio for the .NET Framework documentation

Colors.RosyBrown Field

RosyBrown color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor RosyBrown

See also

  • Colors


Colors.RoyalBlue Field | FlexCel Studio for the .NET Framework documentation

Colors.RoyalBlue Field

RoyalBlue color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor RoyalBlue

See also

  • Colors


Colors.SaddleBrown Field | FlexCel Studio for the .NET Framework documentation

Colors.SaddleBrown Field

SaddleBrown color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor SaddleBrown

See also

  • Colors


Colors.Salmon Field | FlexCel Studio for the .NET Framework documentation

Colors.Salmon Field

Salmon color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor Salmon

See also

  • Colors


Colors.SandyBrown Field | FlexCel Studio for the .NET Framework documentation

Colors.SandyBrown Field

SandyBrown color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor SandyBrown

See also

  • Colors


Colors.SeaGreen Field | FlexCel Studio for the .NET Framework documentation

Colors.SeaGreen Field

SeaGreen color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor SeaGreen

See also

  • Colors


Colors.SeaShell Field | FlexCel Studio for the .NET Framework documentation

Colors.SeaShell Field

SeaShell color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor SeaShell

See also

  • Colors


Colors.Sienna Field | FlexCel Studio for the .NET Framework documentation

Colors.Sienna Field

Sienna color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor Sienna

See also

  • Colors


Colors.Silver Field | FlexCel Studio for the .NET Framework documentation

Colors.Silver Field

Silver color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor Silver

See also

  • Colors


Colors.SkyBlue Field | FlexCel Studio for the .NET Framework documentation

Colors.SkyBlue Field

SkyBlue color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor SkyBlue

See also

  • Colors


Colors.SlateBlue Field | FlexCel Studio for the .NET Framework documentation

Colors.SlateBlue Field

SlateBlue color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor SlateBlue

See also

  • Colors


Colors.SlateGray Field | FlexCel Studio for the .NET Framework documentation

Colors.SlateGray Field

SlateGray color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor SlateGray

See also

  • Colors


Colors.Snow Field | FlexCel Studio for the .NET Framework documentation

Colors.Snow Field

Snow color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor Snow

See also

  • Colors


Colors.SpringGreen Field | FlexCel Studio for the .NET Framework documentation

Colors.SpringGreen Field

SpringGreen color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor SpringGreen

See also

  • Colors


Colors.SteelBlue Field | FlexCel Studio for the .NET Framework documentation

Colors.SteelBlue Field

SteelBlue color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor SteelBlue

See also

  • Colors


Colors.Tan Field | FlexCel Studio for the .NET Framework documentation

Colors.Tan Field

Tan color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor Tan

See also

  • Colors


Colors.Teal Field | FlexCel Studio for the .NET Framework documentation

Colors.Teal Field

Teal color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor Teal

See also

  • Colors


Colors.Thistle Field | FlexCel Studio for the .NET Framework documentation

Colors.Thistle Field

Thistle color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor Thistle

See also

  • Colors


Colors.Tomato Field | FlexCel Studio for the .NET Framework documentation

Colors.Tomato Field

Tomato color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor Tomato

See also

  • Colors


Colors.Turquoise Field | FlexCel Studio for the .NET Framework documentation

Colors.Turquoise Field

Turquoise color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor Turquoise

See also

  • Colors


Colors.Violet Field | FlexCel Studio for the .NET Framework documentation

Colors.Violet Field

Violet color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor Violet

See also

  • Colors


Colors.Wheat Field | FlexCel Studio for the .NET Framework documentation

Colors.Wheat Field

Wheat color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor Wheat

See also

  • Colors


Colors.White Field | FlexCel Studio for the .NET Framework documentation

Colors.White Field

White color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor White

See also

  • Colors


Colors.WhiteSmoke Field | FlexCel Studio for the .NET Framework documentation

Colors.WhiteSmoke Field

WhiteSmoke color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor WhiteSmoke

See also

  • Colors


Colors.Yellow Field | FlexCel Studio for the .NET Framework documentation

Colors.Yellow Field

Yellow color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor Yellow

See also

  • Colors


Colors.YellowGreen Field | FlexCel Studio for the .NET Framework documentation

Colors.YellowGreen Field

YellowGreen color.

Syntax

Namespace: FlexCel.Core

public static readonly TUIColor YellowGreen

See also

  • Colors


CultureCreatingEventArgs Class | FlexCel Studio for the .NET Framework documentation

CultureCreatingEventArgs Class

Event when creating a culture.

Syntax

Namespace: FlexCel.Core

public class CultureCreatingEventArgs

Constructors

Name | Description
CultureCreating​Event​Args | Creates a new instance of the event arguments with the specified parameters.

Properties

Name | Description
LanguageCode | Language code for the culture we want to create.
Culture | This is the culture that will be used for the language code. This property is initialized with the culture FlexCel would set if no event was assigned. You can change the properties of this Culture or completely replace it by a cached one.


CultureCreatingEventArgs.CultureCreatingEventArgs Constructor | FlexCel Studio for the .NET Framework documentation

CultureCreatingEventArgs.CultureCreatingEventArgs Constructor

Creates a new instance of the event arguments with the specified parameters.

Syntax

Namespace: FlexCel.Core

public CultureCreatingEventArgs(Int32 aLanguageCode, CultureInfo aCulture)

Parameters

<-> | Parameter | Type | Description
 | aLanguageCode | Int32 | Language code for the culture we want to create.
 | aCulture | CultureInfo | This is the culture that will be used for the language code. This property is initialized with the culture FlexCel would set if no event was assigned. You can change the properties of this Culture or completely replace it by a cached one.

See also

  • CultureCreatingEventArgs


CultureCreatingEventArgs.LanguageCode Property | FlexCel Studio for the .NET Framework documentation

CultureCreatingEventArgs.LanguageCode Property

Language code for the culture we want to create.

Syntax

Namespace: FlexCel.Core

public Int32 LanguageCode { get; }

See also

  • CultureCreatingEventArgs


CultureCreatingEventArgs.Culture Property | FlexCel Studio for the .NET Framework documentation

CultureCreatingEventArgs.Culture Property

This is the culture that will be used for the language code. This property is initialized with the culture FlexCel would set if no event was assigned. You can change the properties of this Culture or completely replace it by a cached one.

Remarks

If FlexCel couldn't create the culture, it will be null when the event is called. So always check the culture is not null before modifying it.

Syntax

Namespace: FlexCel.Core

public CultureInfo Culture { get; set; }

See also

  • CultureCreatingEventArgs


ExcelChart Class | FlexCel Studio for the .NET Framework documentation

ExcelChart Class

Information for a chart inside a sheet or an object.

Syntax

Namespace: FlexCel.Core

public abstract class ExcelChart: IEmbeddedObjects

Methods

Name | Description
SeriesInSubchart Returns the number of series on each subchart. Note that this property only works in xlsx files: In xls files it will always return 0.
AddSubchart Adds a new subchart to the existing chart. Note that if the current active subchart is empty, this method will not add a new subchart, but replace the empty one. In that case, SubchartCount won't change.

This method only works in xlsx files, not xls.
SetChartOptions Sets the chart options of a specific subchart inside the chart. Note that while a chart can have multiple subcharts inside (for example one pie subchart and one line subchart), normally there is only one subchart and so the SubchartPos parameter is normally 1.
GetSeries Returns a series definition.
GetSeriesInSubchart Returns a series definition for a given subchart. Note: This method only works in xlsx files.
SetSeries Sets a Series value. Note that for xlsx charts, this will change the **data range** and the **options** of the series. If you only want to change the data range, pass null options to the method.
SetSeriesInSubchart Sets a Series value. Note that for xlsx charts, this will change the **data range** and the **options** of the series. If you only want to change the data range, pass null options to the method.
AddSeries Adds a series to the chart.
DeleteSeries Deletes the series at position index.
GetBubbleSeries Returns the bubble definition for a series when in a bubble chart.
SetBubbleSeries Sets a Series value. Note that for xlsx charts, this will change the **data range** and the **options** of the series. If you only want to change the data range, pass null options to the method.
GetChartAxis Returns the axis information for this chart. Note that this might be more than one, if the chart has a secondary axis.
SetChartAxis Sets the options for either the primary or secondary pair of axis.
GetChartLegend Information about the Legend of the chart.
SetChartLegend Sets the legend properties.
RemoveChartLegend Removes the Legend from the chart.
GetTitle Returns the title of the chart.
SetTitle Sets the title of the chart. This method is only implemented for xlsx charts.
GetDataLabels Returns all the labels for the chart. Note that Axis have their labels defined inside their own definition.
SetDataLabels Changes the labels for the chart. You should always get the values with GetDataLabels, modify them, and change them back with this method.
GetDataLabelsRange Returns the range of cells for a "Label Contains: " "Value from Cells" option in the labels.
Note that for this to work, you also need to use the string [CELLRANGE] in the label definition.
SetDataLabelsRange Sets the range of cells for a "Label Contains: " "Value from Cells" option in the labels.
Note that for this to work, you also need to use the string [CELLRANGE] in the label definition.
GetTrendline Gets a trendline for a chart. This method is only implemented for xlsx charts.
SetTrendline Gets a trendline for a chart. This method is only implemented for xlsx charts.
GetObjectProperties An object embedded inside a chart.
SetObjectText Overloaded
 SetObjectText(Int32, String, String)
SetObjectText(Int32, String, TRichString)
SetObjectText(Int32, String, TDrawingRichString)
DeleteObject Overloaded
 DeleteObject(Int32)
DeleteObject(Int32, String)
GetImage Returns an image and its type.
Note that for SVG images, xlsx files store both a PNG and SVG image. In those cases, for backward compatibility reasons, this method will return the PNG image. To get the SVG, call GetImageAlternate
GetImageAlternate Returns an image and its type. Currently this method is the same as GetImage for all images except SVG.
For SVG images, xlsx files store both a PNG and SVG image. In those cases, this method will return the SVG image. To get the PNG, call GetImage
HasImageAlternate | Returns true if the image has an alternate representation. This currently happens only with SVG images, which have a PNG base and an SVG alternate. If the image has an alternate, you can get the data with GetImageAlternate
GetImageProperties Overloaded
 GetImageProperties(Int32)
GetImageProperties(Int32, Boolean, String)
AddImage Overloaded
 AddImage(TUIImage, TImageProperties)
AddImage(Byte[], TImageProperties)
AddImage(Stream, TImageProperties)
AddImage(String, TImageProperties)
AddImage(Byte[], TXlsImgType, TImageProperties)
AddImage(Stream, TXlsImgType, TImageProperties)
AddImageAlternate Adds an image to the active sheet.
Currently this method is only needed for SVG images, since SVG images are stored as both PNG and SVG inside the xlsx file. This method allows you to supply both images.
DeleteImage Overloaded
 DeleteImage(Int32)
DeleteImage(Int32, Boolean, String)
ClearImage Overloaded
 ClearImage(Int32)
ClearImage(Int32, Boolean, String)
AddAutoShape Adds an autoshape to an existing embedded chart. Note that the coordinates for the shape are in chart coords, meaning that only row1, row2, col1 and col2 are used, and they represent the percentage in 1/4000 of the coordinate.
So 0 means the top and left of the parent chart, and 4000 means the bottom and right of the parent chart.
GetShapeLinkedCell Returns the cell that is linked to the shape or image. If the object isn't linked, this method will return null.
Note that when you change the value in the cell linked to this object, the value of the object will change.
Also note that this method applies to shapes like a rectangle or circle, or an image. Objects like a combobox won't be reported by this method.
SetShapeLinkedCell Links the shape or image to a cell, if the shape can be linked. To unlink the cell, make linkedCell null.
Note that this method applies to shapes like a rectangle or a circle, or an image, not to the link of a forms object like a combobox or a radiobutton.
ImageIndexTo​Object​Path Returns the absolute object path for an image, given an image index. Note that this method can be slow if there are many objects in the file.
Whenever possible, prefer the methods that take directly an imageIndex instead of converting the imageIndex to an objectPath.

Properties

Name | Description
IsXlsxChart | Returns true if the chart is defined inside an xlsx file instead of xls. While both charts in xls and xlsx files are mostly compatible, some behaviors can change depending on what type of chart this is. For example, if the first series in an xls chart is pie, it won't draw gridlines even if the second isn't. In xlsx charts, if another series is not pie, Excel will draw the gridlines.
Background | Returns the chart background if there is one defined, or null if there is none.
DefaultFont | Returns the default font for all text in the chart that do not have a font defined.
DefaultLabelFont | Returns the default font for all labels in the chart that do not have a font defined.
DefaultAxisFont | Returns the default font for Axis in the chart that do not have a font defined.
DefaultAxisTitleFont | Returns the default font for Axis title in the chart that do not have a font defined.
DefaultTitleFont | Returns the default font for Title in the chart that do not have a font defined.
Style | This is a number between 1 and 48 which defines many standard properties for the chart, like the default line width for the series or the legend. The default style is 2.
SubchartCount | A chart can have multiple subcharts inside: For example one bar chart and one pie chart. This method returns how many subcharts you have inside the main chart. Note that this property only works in xlsx files: In xls files it will always return 1.
ChartOptions | Returns the type of chart and the options specific for that kind of chart. There might be more than one ChartOptions returned, since you can mix more than one type of chart on a simple chart. (One for each series). You need to look at the series ChartOptionsIndex to know to which one it refers.
PlotArea | Returns or sets the plot area definition for the chart. Note: Setting the plot area only works in xlsx files.
PlotEmptyCells | Defines how null cells will be plotted on the chart.
ShowDataInHidden​Rows​AndCols | Defines if hidden rows and columns will be used when plotting values.
SeriesCount | Returns the count of series on this chart.
ObjectCount | The number of objects that are embedded inside this chart.
ImageCount | The number of images in the chart.
Chart3DOptions | Returns the 3D options for the chart, or null if the chart isn't 3D.
SideWall | The wall next to the y-axis in a 3D-chart.
BackWall | The wall at the back of a 3D-chart
Floor | The floor in a 3D-chart.


ExcelChart.SeriesInSubchart Method | FlexCel Studio for the .NET Framework documentation

ExcelChart.SeriesInSubchart Method

Returns the number of series on each subchart. Note that this property only works in xlsx files: In xls files it will always return 0.

Syntax

Namespace: FlexCel.Core

public abstract Int32 SeriesInSubchart(Int32 subchartPos)

Parameters

<-> | Parameter | Type | Description
 | subchartPos | Int32 | Number of the subchart. (1 based)

See also

  • ExcelChart


ExcelChart.AddSubchart Method | FlexCel Studio for the .NET Framework documentation

ExcelChart.AddSubchart Method

Adds a new subchart to the existing chart. Note that if the current active subchart is empty, this method will not add a new subchart, but replace the empty one. In that case, SubchartCount won't change.

This method only works in xlsx files, not xls.

Syntax

Namespace: FlexCel.Core

public abstract void AddSubchart(TChartType chartType, Int32 axisIndex)

Parameters

<-> | Parameter | Type | Description
 | chartType | TChartType | Type of subchart added. If it is the same as the current chart type, it won't be added.
 | axisIndex | Int32 | It can be 0 if the axis of this subchart will be the primary pair of axis, or 1 if they are the secondary pair.

See also

  • ExcelChart


ExcelChart.SetChartOptions Method | FlexCel Studio for the .NET Framework documentation

ExcelChart.SetChartOptions Method

Sets the chart options of a specific subchart inside the chart. Note that while a chart can have multiple subcharts inside (for example one pie subchart and one line subchart), normally there is only one subchart and so the SubchartPos parameter is normally 1.

Syntax

Namespace: FlexCel.Core

public abstract void SetChartOptions(Int32 subchartPos, TChartOptions options)

Parameters

<-> | Parameter | Type | Description
 | subchartPos | Int32 | Position of the subchart (1 based)
 | options | TChartOptions | Options to set in the subchart.

See also

  • ExcelChart


ExcelChart.GetSeries Method | FlexCel Studio for the .NET Framework documentation

ExcelChart.GetSeries Method

Returns a series definition.

Syntax

Namespace: FlexCel.Core

public abstract ChartSeries GetSeries(Int32 index, Boolean getDefinitions, Boolean getValues, Boolean getOptions)

Parameters

<-> | Parameter | Type | Description
 | index | Int32 | Index of the series you want to return. (1 based)
 | getDefinitions | Boolean | If false, this method will not return the series formulas, so it will be a little faster.
 | getValues | Boolean | If false, this method will not return the series values, so it will be a little faster and use less memory.
 | getOptions | Boolean | If false, this method will not return the series options.

Returns

series description.

See also

  • ExcelChart


ExcelChart.GetSeriesInSubchart Method | FlexCel Studio for the .NET Framework documentation

ExcelChart.GetSeriesInSubchart Method

Returns a series definition for a given subchart. Note: This method only works in xlsx files.

Syntax

Namespace: FlexCel.Core

public abstract ChartSeries GetSeriesInSubchart(Int32 subchart, Int32 indexInSubchart, Boolean getDefinitions, Boolean getValues, Boolean getOptions)

Parameters

<-> | Parameter | Type | Description
 | subchart | Int32 | Subchart where we want to get the series from. (1 based)
 | indexInSubchart | Int32 | Index of the series you want to return in the given subchart. (1 based)
 | getDefinitions | Boolean | If false, this method will not return the series formulas, so it will be a little faster.
 | getValues | Boolean | If false, this method will not return the series values, so it will be a little faster and use less memory.
 | getOptions | Boolean | If false, this method will not return the series options.

Returns

series description.

See also

  • ExcelChart


ExcelChart.SetSeries Method | FlexCel Studio for the .NET Framework documentation

ExcelChart.SetSeries Method

Sets a Series value. Note that for xlsx charts, this will change the **data range** and the **options** of the series. If you only want to change the data range, pass null options to the method.

Syntax

Namespace: FlexCel.Core

public abstract void SetSeries(Int32 index, ChartSeries value)

Parameters

<-> | Parameter | Type | Description
 | index | Int32 | Index of the series to set.(1 based)
 | value | ChartSeries | Series definition.

See also

  • ExcelChart


ExcelChart.SetSeriesInSubchart Method | FlexCel Studio for the .NET Framework documentation

ExcelChart.SetSeriesInSubchart Method

Sets a Series value. Note that for xlsx charts, this will change the **data range** and the **options** of the series. If you only want to change the data range, pass null options to the method.

Syntax

Namespace: FlexCel.Core

public abstract void SetSeriesInSubchart(Int32 subchart, Int32 indexInSubchart, ChartSeries value)

Parameters

<-> | Parameter | Type | Description
 | subchart | Int32 | Subchart where we want to set the series. (1 based)
 | indexInSubchart | Int32 | Index of the series to set inside the subchart.(1 based)
 | value | ChartSeries | Series definition.

See also

  • ExcelChart


ExcelChart.AddSeries Method | FlexCel Studio for the .NET Framework documentation

ExcelChart.AddSeries Method

Adds a series to the chart.

Syntax

Namespace: FlexCel.Core

public abstract Int32 AddSeries(ChartSeries value)

Parameters

<-> | Parameter | Type | Description
 | value | ChartSeries | Definition of the new series

Returns

Index of the newly added series.

See also

  • ExcelChart


ExcelChart.DeleteSeries Method | FlexCel Studio for the .NET Framework documentation

ExcelChart.DeleteSeries Method

Deletes the series at position index.

Syntax

Namespace: FlexCel.Core

public abstract void DeleteSeries(Int32 index)

Parameters

<-> | Parameter | Type | Description
 | index | Int32 |

See also

  • ExcelChart


ExcelChart.GetBubbleSeries Method | FlexCel Studio for the .NET Framework documentation

ExcelChart.GetBubbleSeries Method

Returns the bubble definition for a series when in a bubble chart.

Syntax

Namespace: FlexCel.Core

public abstract ChartBubbleSeries GetBubbleSeries(Int32 index, Boolean getDefinitions, Boolean getValues)

Parameters

<-> | Parameter | Type | Description
 | index | Int32 | Index of the series with the bubbles you want to return. (1 based)
 | getDefinitions | Boolean | If false, this method will not return the bubble formulas, so it will be a little faster.
 | getValues | Boolean | If false, this method will not return the bubble values, so it will be a little faster and use less memory.

Returns

Bubble descriptions.

See also

  • ExcelChart


ExcelChart.SetBubbleSeries Method | FlexCel Studio for the .NET Framework documentation

ExcelChart.SetBubbleSeries Method

Sets a Series value. Note that for xlsx charts, this will change the **data range** and the **options** of the series. If you only want to change the data range, pass null options to the method.

Syntax

Namespace: FlexCel.Core

public abstract void SetBubbleSeries(Int32 index, ChartBubbleSeries bubbleSeries)

Parameters

<-> | Parameter | Type | Description
 | index | Int32 | Index of the series with the bubbles you want to set. (1 based)
 | bubbleSeries | ChartBubbleSeries | The bubble series definition.

See also

  • ExcelChart


ExcelChart.GetChartAxis Method | FlexCel Studio for the .NET Framework documentation

ExcelChart.GetChartAxis Method

Returns the axis information for this chart. Note that this might be more than one, if the chart has a secondary axis.

Syntax

Namespace: FlexCel.Core

public abstract TChartAxis[] GetChartAxis()

See also

  • ExcelChart


ExcelChart.SetChartAxis Method | FlexCel Studio for the .NET Framework documentation

ExcelChart.SetChartAxis Method

Sets the options for either the primary or secondary pair of axis.

Syntax

Namespace: FlexCel.Core

public abstract void SetChartAxis(TChartAxis axis)

Parameters

<-> | Parameter | Type | Description
 | axis | TChartAxis | Pair of axis we want to set the options.

See also

  • ExcelChart


ExcelChart.GetChartLegend Method | FlexCel Studio for the .NET Framework documentation

ExcelChart.GetChartLegend Method

Information about the Legend of the chart.

Syntax

Namespace: FlexCel.Core

public abstract TChartLegend GetChartLegend()

See also

  • ExcelChart


ExcelChart.SetChartLegend Method | FlexCel Studio for the .NET Framework documentation

ExcelChart.SetChartLegend Method

Sets the legend properties.

Syntax

Namespace: FlexCel.Core

public abstract void SetChartLegend(TChartLegend value)

Parameters

<-> | Parameter | Type | Description
 | value | TChartLegend |

See also

  • ExcelChart


ExcelChart.RemoveChartLegend Method | FlexCel Studio for the .NET Framework documentation

ExcelChart.RemoveChartLegend Method

Removes the Legend from the chart.

Syntax

Namespace: FlexCel.Core

public abstract void RemoveChartLegend()

See also

  • ExcelChart


ExcelChart.GetTitle Method | FlexCel Studio for the .NET Framework documentation

ExcelChart.GetTitle Method

Returns the title of the chart.

Syntax

Namespace: FlexCel.Core

public abstract TDataLabel GetTitle()

See also

  • ExcelChart


ExcelChart.SetTitle Method | FlexCel Studio for the .NET Framework documentation

ExcelChart.SetTitle Method

Sets the title of the chart. This method is only implemented for xlsx charts.

Syntax

Namespace: FlexCel.Core

public abstract void SetTitle(TDataLabel value)

Parameters

<-> | Parameter | Type | Description
 | value | TDataLabel |

See also

  • ExcelChart


ExcelChart.GetDataLabels Method | FlexCel Studio for the .NET Framework documentation

ExcelChart.GetDataLabels Method

Returns all the labels for the chart. Note that Axis have their labels defined inside their own definition.

Syntax

Namespace: FlexCel.Core

public abstract TDataLabel[] GetDataLabels()

See also

  • ExcelChart


ExcelChart.SetDataLabels Method | FlexCel Studio for the .NET Framework documentation

ExcelChart.SetDataLabels Method

Changes the labels for the chart. You should always get the values with GetDataLabels, modify them, and change them back with this method.

Syntax

Namespace: FlexCel.Core

public abstract void SetDataLabels(TDataLabel[] labels)

Parameters

<-> | Parameter | Type | Description
 | labels | TDataLabel[] | New labels for the chart.

See also

  • ExcelChart


ExcelChart.GetDataLabelsRange Method | FlexCel Studio for the .NET Framework documentation

ExcelChart.GetDataLabelsRange Method

Returns the range of cells for a "Label Contains: " "Value from Cells" option in the labels. Note that for this to work, you also need to use the string [CELLRANGE] in the label definition.

Syntax

Namespace: FlexCel.Core

public abstract TDataLabelsRange GetDataLabelsRange(Int32 chartIndex, Int32 seriesIndex)

Parameters

<-> | Parameter | Type | Description
 | chartIndex | Int32 | Index of the chart (1 based). Must be bigger than 0 and less-or-equal than SubchartCount
 | seriesIndex | Int32 | Index of the series in the chart (1 based). Must be bigger than 0 and less-or-equal than SeriesInSubchart

See also

  • ExcelChart


ExcelChart.SetDataLabelsRange Method | FlexCel Studio for the .NET Framework documentation

ExcelChart.SetDataLabelsRange Method

Sets the range of cells for a "Label Contains: " "Value from Cells" option in the labels. Note that for this to work, you also need to use the string [CELLRANGE] in the label definition.

Syntax

Namespace: FlexCel.Core

public abstract void SetDataLabelsRange(Int32 chartIndex, Int32 seriesIndex, TDataLabelsRange value)

Parameters

<-> | Parameter | Type | Description
 | chartIndex | Int32 | Index of the chart (1 based). Must be bigger than 0 and less-or-equal than SubchartCount
 | seriesIndex | Int32 | Index of the series in the chart (1 based). Must be bigger than 0 and less-or-equal than SeriesInSubchart
 | value | TDataLabelsRange | Value of the range for the series.

See also

  • ExcelChart


ExcelChart.GetTrendline Method | FlexCel Studio for the .NET Framework documentation

ExcelChart.GetTrendline Method

Gets a trendline for a chart. This method is only implemented for xlsx charts.

Syntax

Namespace: FlexCel.Core

public abstract TChartTrendline GetTrendline(Int32 chartIndex, Int32 seriesIndex)

Parameters

<-> | Parameter | Type | Description
 | chartIndex | Int32 | Index of the chart (1 based). Must be bigger than 0 and less-or-equal than SubchartCount
 | seriesIndex | Int32 | Index of the series in the chart (1 based). Must be bigger than 0 and less-or-equal than SeriesInSubchart

Returns

The trendline definition if there is one, null otherwise. For xls charts this method will always return null.

See also

  • ExcelChart


ExcelChart.SetTrendline Method | FlexCel Studio for the .NET Framework documentation

ExcelChart.SetTrendline Method

Gets a trendline for a chart. This method is only implemented for xlsx charts.

Syntax

Namespace: FlexCel.Core

public abstract void SetTrendline(Int32 chartIndex, Int32 seriesIndex, TChartTrendline trendline)

Parameters

<-> | Parameter | Type | Description
 | chartIndex | Int32 | Index of the chart (1 based). Must be bigger than 0 and less-or-equal than SubchartCount
 | seriesIndex | Int32 | Index of the series in the chart (1 based). Must be bigger than 0 and less-or-equal than SeriesInSubchart
 | trendline | TChartTrendline | Trendline definition.

See also

  • ExcelChart


ExcelChart.GetObjectProperties Method | FlexCel Studio for the .NET Framework documentation

ExcelChart.GetObjectProperties Method

An object embedded inside a chart.

Syntax

Namespace: FlexCel.Core

public abstract TShapeProperties GetObjectProperties(Int32 objectIndex, Boolean GetShapeOptions)

Parameters

<-> | Parameter | Type | Description
 | objectIndex | Int32 | Index of the object, between 1 and ObjectCount
 | GetShapeOptions | Boolean | When true, shape options will be retrieved. As this can be a slow operation, only specify true when you really need those options.

Returns

The properties for the embedded object.

See also

  • ExcelChart


ExcelChart.SetObjectText Method | FlexCel Studio for the .NET Framework documentation

ExcelChart.SetObjectText Method

Overloads

  • ExcelChart.SetObjectText(Int32, String, String)
  • ExcelChart.SetObjectText(Int32, String, TRichString)
  • ExcelChart.SetObjectText(Int32, String, TDrawingRichString)

ExcelChart.SetObjectText(Int32, String, String)

Sets the text for an autoshape. If the object does not accept text, this method will do nothing. This version of the method will only modify the text of the object, and preserve the existing formatting in the object if there was one.

Syntax

Namespace: FlexCel.Core

public abstract void SetObjectText(Int32 objectIndex, String objectPath, String text)

Parameters

<-> | Parameter | Type | Description
 | objectIndex | Int32 | Index of the object (1-based)
 | objectPath | String | Index to the child object you want to change the text. If it is a simple object, you can use String.Empty here, if not you need to get the ObjectPath from GetObjectProperties If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"
 | text | String | Text you want to use. Use null to delete text from an AutoShape.

See also

  • ExcelChart

ExcelChart.SetObjectText(Int32, String, TRichString)

Sets the text for an autoshape. If the object does not accept text, this method will do nothing. This version of the method will only modify the rich string properties of the object text, and preserve those things not available in a TRichString like wordArt effects.

Syntax

Namespace: FlexCel.Core

public abstract void SetObjectText(Int32 objectIndex, String objectPath, TRichString text)

Parameters

<-> | Parameter | Type | Description
 | objectIndex | Int32 | Index of the object (1-based)
 | objectPath | String | Index to the child object you want to change the text. If it is a simple object, you can use String.Empty here, if not you need to get the ObjectPath from GetObjectProperties If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"
 | text | TRichString | Text you want to use. Use null to delete text from an AutoShape.

See also

  • ExcelChart

ExcelChart.SetObjectText(Int32, String, TDrawingRichString)

Changes the text inside an object of the chart.

Syntax

Namespace: FlexCel.Core

public abstract void SetObjectText(Int32 objectIndex, String objectPath, TDrawingRichString text)

Parameters

<-> | Parameter | Type | Description
 | objectIndex | Int32 | Index of the object, between 1 and ObjectCount
 | objectPath | String | Index to the child object you want to change the text. If it is a simple object, you can use String.Empty here, if not you need to get the ObjectPath from GetObjectProperties If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"
 | text | TDrawingRichString | Text you want to use. Use null to delete text from an AutoShape.

See also

  • ExcelChart


ExcelChart.DeleteObject Method | FlexCel Studio for the .NET Framework documentation

ExcelChart.DeleteObject Method

Overloads

  • ExcelChart.DeleteObject(Int32)
  • ExcelChart.DeleteObject(Int32, String)

ExcelChart.DeleteObject(Int32)

Deletes the graphic object at objectIndex. Use it with care, there are some graphics objects you don't want to remove (like comment boxes when you don't delete the associated comment.)

Syntax

Namespace: FlexCel.Core

public abstract void DeleteObject(Int32 objectIndex)

Parameters

<-> | Parameter | Type | Description
 | objectIndex | Int32 | Index of the object (1 based).

See also

  • ExcelChart

ExcelChart.DeleteObject(Int32, String)

Deletes the graphic object at objectIndex. Use it with care, there are some graphics objects you don't want to remove (like comment boxes when you don't delete the associated comment.)

Syntax

Namespace: FlexCel.Core

public abstract void DeleteObject(Int32 objectIndex, String objectPath)

Parameters

<-> | Parameter | Type | Description
 | objectIndex | Int32 | Index of the object (1 based).
 | objectPath | String | Index to the child object you want to change the property. If it is a simple object, you can use String.Empty here, if not you need to get the ObjectPath from GetObjectProperties If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"

See also

  • ExcelChart


ExcelChart.GetImage Method | FlexCel Studio for the .NET Framework documentation

ExcelChart.GetImage Method

Returns an image and its type. Note that for SVG images, xlsx files store both a PNG and SVG image. In those cases, for backward compatibility reasons, this method will return the PNG image. To get the SVG, call GetImageAlternate

Syntax

Namespace: FlexCel.Core

public abstract void GetImage(Int32 imageIndex, String objectPath, ref TXlsImgType imageType, Stream outStream, Boolean usesObjectIndex)

Parameters

<-> | Parameter | Type | Description
 | imageIndex | Int32 | Index of the image. (1 based)
 | objectPath | String | Object path to the image when it is a grouped image. For toplevel images you can use String.Empty. In other case, you need to use the value returned by GetObjectProperties If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"
ref | imageType | TXlsImgType | Returns the image type for the data returned. (If it is a bmp, jpg or other)
 | outStream | Stream | Stream where the image data will be copied.
 | usesObjectIndex | Boolean | If false (the default) then imageIndex is an index to the list of images. When true imageIndex is an index to the list of all objects in the sheet. When you have the object id, you can avoid calling ObjectIndexToImageIndex which is a slow method, by setting this parameter to true.

See also

  • ExcelChart


ExcelChart.GetImageAlternate Method | FlexCel Studio for the .NET Framework documentation

ExcelChart.GetImageAlternate Method

Returns an image and its type. Currently this method is the same as GetImage for all images except SVG. For SVG images, xlsx files store both a PNG and SVG image. In those cases, this method will return the SVG image. To get the PNG, call GetImage

Syntax

Namespace: FlexCel.Core

public abstract void GetImageAlternate(Int32 imageIndex, String objectPath, out TXlsImgType imageType, Stream outStream, Boolean usesObjectIndex)

Parameters

<-> | Parameter | Type | Description
 | imageIndex | Int32 | Index of the image. (1 based)
 | objectPath | String | Object path to the image when it is a grouped image. For toplevel images you can use String.Empty. In other case, you need to use the value returned by GetObjectProperties If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"
out | imageType | TXlsImgType | Returns the image type for the data returned. (If it is a bmp, jpg or other)
 | outStream | Stream | Stream where the image data will be copied.
 | usesObjectIndex | Boolean | If false (the default) then imageIndex is an index to the list of images. When true imageIndex is an index to the list of all objects in the sheet. When you have the object id, you can avoid calling ObjectIndexToImageIndex which is a slow method, by setting this parameter to true.

See also

  • ExcelChart


ExcelChart.HasImageAlternate Method | FlexCel Studio for the .NET Framework documentation

ExcelChart.HasImageAlternate Method

Returns true if the image has an alternate representation. This currently happens only with SVG images, which have a PNG base and an SVG alternate. If the image has an alternate, you can get the data with GetImageAlternate

Syntax

Namespace: FlexCel.Core

public abstract Boolean HasImageAlternate(Int32 imageIndex, String objectPath, Boolean usesObjectIndex)

Parameters

<-> | Parameter | Type | Description
 | imageIndex | Int32 | Index of the image. (1 based)
 | objectPath | String | Object path to the image when it is a grouped image. For toplevel images you can use String.Empty. In other case, you need to use the value returned by GetObjectProperties Important: ObjectPath is ignored if usesObjectIndex is false. If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3" You might also use the name of the image as object path, like in xls.GetImage(-1, "@myimage", ref imageType, ImageStream, true)
 | usesObjectIndex | Boolean | If false then imageIndex is an index to the list of images. When true imageIndex is an index to the list of all objects in the sheet.

See also

  • ExcelChart


ExcelChart.GetImageProperties Method | FlexCel Studio for the .NET Framework documentation

ExcelChart.GetImageProperties Method

Overloads

  • ExcelChart.GetImageProperties(Int32)
  • ExcelChart.GetImageProperties(Int32, Boolean, String)

ExcelChart.GetImageProperties(Int32)

Returns image position and size.

Syntax

Namespace: FlexCel.Core

public TImageProperties GetImageProperties(Int32 imageIndex)

Parameters

<-> | Parameter | Type | Description
 | imageIndex | Int32 | Index of the image (1 based)

Returns

Image position and size.

See also

  • ExcelChart

ExcelChart.GetImageProperties(Int32, Boolean, String)

Returns image position and size.

Syntax

Namespace: FlexCel.Core

public abstract TImageProperties GetImageProperties(Int32 imageIndex, Boolean usesObjectIndex, String objectPath)

Parameters

<-> | Parameter | Type | Description
 | imageIndex | Int32 | Index of the image (1 based)
 | usesObjectIndex | Boolean | If false (the default) then imageIndex is an index to the list of images. When true imageIndex is an index to the list of all objects in the sheet.
 | objectPath | String | Path to the object, when the object is grouped with others. This parameter only has meaning if usesObjectIndex is true. If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"

Returns

Image position and size.

See also

  • ExcelChart


ExcelChart.AddImage Method | FlexCel Studio for the .NET Framework documentation

ExcelChart.AddImage Method

Overloads

  • ExcelChart.AddImage(TUIImage, TImageProperties)
  • ExcelChart.AddImage(Byte[], TImageProperties)
  • ExcelChart.AddImage(Stream, TImageProperties)
  • ExcelChart.AddImage(String, TImageProperties)
  • ExcelChart.AddImage(Byte[], TXlsImgType, TImageProperties)
  • ExcelChart.AddImage(Stream, TXlsImgType, TImageProperties)

ExcelChart.AddImage(TUIImage, TImageProperties)

Adds a new image to the active sheet. If you don't have the image already created, prefer using AddImage(Stream, TImageProperties), as it is faster. Note that for SVG images, xlsx files store both a PNG and SVG image. To enter an SVG image, use AddImageAlternate

Remarks

Saving a WMF or EMF Image is not currently supported by the .NET framework. If you pass a MetaFile to this method, it will be saved as png. For inserting a REAL wmf into excel use AddImage(Stream, TImageProperties)

Syntax

Namespace: FlexCel.Core

public void AddImage(TUIImage img, TImageProperties imageProperties)

Parameters

<-> | Parameter | Type | Description
 | img | TUIImage | Image to insert.
 | imageProperties | TImageProperties | Image size/position

See also

  • ExcelChart

ExcelChart.AddImage(Byte[], TImageProperties)

Adds an image to the active sheet. It will try to automatically guess/convert the image type of the data to the better fit. Note that for SVG images, xlsx files store both a PNG and SVG image. To enter an SVG image, use AddImageAlternate

Syntax

Namespace: FlexCel.Core

public void AddImage(Byte[] data, TImageProperties imageProperties)

Parameters

<-> | Parameter | Type | Description
 | data | Byte[] | Image data.
 | imageProperties | TImageProperties | Image Properties.

See also

  • ExcelChart

ExcelChart.AddImage(Stream, TImageProperties)

Adds an image to the active sheet. Note that for SVG images, xlsx files store both a PNG and SVG image. To enter an SVG image, use AddImageAlternate

Syntax

Namespace: FlexCel.Core

public void AddImage(Stream aStream, TImageProperties imageProperties)

Parameters

<-> | Parameter | Type | Description
 | aStream | Stream | Stream containing the image data.
 | imageProperties | TImageProperties | Placement and other properties of the image.

See also

  • ExcelChart

ExcelChart.AddImage(String, TImageProperties)

Adds an image to the active sheet. Note that for SVG images, xlsx files store both a PNG and SVG image. To enter an SVG image, use AddImageAlternate

Syntax

Namespace: FlexCel.Core

public void AddImage(String fileName, TImageProperties imageProperties)

Parameters

<-> | Parameter | Type | Description
 | fileName | String | Name of the file in disk containing the image data.
 | imageProperties | TImageProperties | Placement and other properties of the image.

See also

  • ExcelChart

ExcelChart.AddImage(Byte[], TXlsImgType, TImageProperties)

Adds an image to the active sheet. Note that for SVG images, xlsx files store both a PNG and SVG image. To enter an SVG image, use AddImageAlternate

Syntax

Namespace: FlexCel.Core

public abstract void AddImage(Byte[] data, TXlsImgType imageType, TImageProperties imageProperties)

Parameters

<-> | Parameter | Type | Description
 | data | Byte[] | byte array with the image data.
 | imageType | TXlsImgType | Type of image you are inserting (bmp, jpg, etc).
 | imageProperties | TImageProperties | Placement and other properties of the image.

See also

  • ExcelChart

ExcelChart.AddImage(Stream, TXlsImgType, TImageProperties)

Adds an image to the active sheet. Note that for SVG images, xlsx files store both a PNG and SVG image. To enter an SVG image, use AddImageAlternate

Syntax

Namespace: FlexCel.Core

public void AddImage(Stream aStream, TXlsImgType imageType, TImageProperties imageProperties)

Parameters

<-> | Parameter | Type | Description
 | aStream | Stream | Stream containing the image data.
 | imageType | TXlsImgType | Type of image you are inserting (bmp, jpg, etc).
 | imageProperties | TImageProperties | Placement and other properties of the image.

See also

  • ExcelChart


ExcelChart.AddImageAlternate Method | FlexCel Studio for the .NET Framework documentation

ExcelChart.AddImageAlternate Method

Adds an image to the active sheet. Currently this method is only needed for SVG images, since SVG images are stored as both PNG and SVG inside the xlsx file. This method allows you to supply both images.

Syntax

Namespace: FlexCel.Core

public abstract void AddImageAlternate(Byte[] PNGData, TImageProperties imageProperties, TSVGBlip aSVGBlip)

Parameters

<-> | Parameter | Type | Description
 | PNGData | Byte[] | Image data for the PNG file that will be used as a backup for the SVG. This data must be in PNG file format.
 | imageProperties | TImageProperties | Image Properties.
 | aSVGBlip | TSVGBlip | Data for the SVG image to be added.

See also

  • ExcelChart


ExcelChart.DeleteImage Method | FlexCel Studio for the .NET Framework documentation

ExcelChart.DeleteImage Method

Overloads

  • ExcelChart.DeleteImage(Int32)
  • ExcelChart.DeleteImage(Int32, Boolean, String)

ExcelChart.DeleteImage(Int32)

Deletes the image at position imageIndex.

Syntax

Namespace: FlexCel.Core

public void DeleteImage(Int32 imageIndex)

Parameters

<-> | Parameter | Type | Description
 | imageIndex | Int32 | Index of the image to delete. (1 based)

See also

  • ExcelChart

ExcelChart.DeleteImage(Int32, Boolean, String)

Deletes the image at position imageIndex. Note that if the image is grouped, this will remove the full group. To remove a particular image inside a group, use DeleteObject(Int32, String).

Syntax

Namespace: FlexCel.Core

public abstract void DeleteImage(Int32 imageIndex, Boolean usesObjectIndex, String objectPath)

Parameters

<-> | Parameter | Type | Description
 | imageIndex | Int32 | Index of the image to delete. (1 based)
 | usesObjectIndex | Boolean | If false (the default) then imageIndex is an index to the list of images. When true imageIndex is an index to the list of all objects in the sheet.
 | objectPath | String | Path to the object, when the object is grouped with others. This parameter only has meaning if usesObjectIndex is true. If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"

See also

  • ExcelChart


ExcelChart.ClearImage Method | FlexCel Studio for the .NET Framework documentation

ExcelChart.ClearImage Method

Overloads

  • ExcelChart.ClearImage(Int32)
  • ExcelChart.ClearImage(Int32, Boolean, String)

ExcelChart.ClearImage(Int32)

Clears the image at position imageIndex, leaving an empty white box.

Syntax

Namespace: FlexCel.Core

public void ClearImage(Int32 imageIndex)

Parameters

<-> | Parameter | Type | Description
 | imageIndex | Int32 | Index of the image to clear. (1 based)

See also

  • ExcelChart

ExcelChart.ClearImage(Int32, Boolean, String)

Clears the image at position imageIndex, leaving an empty white box.

Syntax

Namespace: FlexCel.Core

public abstract void ClearImage(Int32 imageIndex, Boolean usesObjectIndex, String objectPath)

Parameters

<-> | Parameter | Type | Description
 | imageIndex | Int32 | Index of the image to clear. (1 based)
 | usesObjectIndex | Boolean | If false (the default) then imageIndex is an index to the list of images. When true imageIndex is an index to the list of all objects in the sheet.
 | objectPath | String | Path to the object, when the object is grouped with others. This parameter only has meaning if usesObjectIndex is true. If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"

See also

  • ExcelChart


ExcelChart.AddAutoShape Method | FlexCel Studio for the .NET Framework documentation

ExcelChart.AddAutoShape Method

Adds an autoshape to an existing embedded chart. Note that the coordinates for the shape are in chart coords, meaning that only row1, row2, col1 and col2 are used, and they represent the percentage in 1/4000 of the coordinate. So 0 means the top and left of the parent chart, and 4000 means the bottom and right of the parent chart.

Syntax

Namespace: FlexCel.Core

public abstract Int32 AddAutoShape(TShapeProperties shapeOptions)

Parameters

<-> | Parameter | Type | Description
 | shapeOptions | TShapeProperties |

Returns

The object index of the new shape.

See also

  • ExcelChart


ExcelChart.GetShapeLinkedCell Method | FlexCel Studio for the .NET Framework documentation

ExcelChart.GetShapeLinkedCell Method

Returns the cell that is linked to the shape or image. If the object isn't linked, this method will return null. Note that when you change the value in the cell linked to this object, the value of the object will change. Also note that this method applies to shapes like a rectangle or circle, or an image. Objects like a combobox won't be reported by this method.

Remarks

Images behave differently from shapes: A linked shape will change its text with the value of the cells. A linked image will change its image, to be an screenshot of the selected range. Finally, a linked object like a combobox will modify the selected item depending on the linked cell.

Syntax

Namespace: FlexCel.Core

public abstract String GetShapeLinkedCell(Int32 objectIndex, String objectPath)

Parameters

<-> | Parameter | Type | Description
 | objectIndex | Int32 | Index of the object (1 based)
 | objectPath | String | Index to the child object you want to change the property. If it is a simple object, you can use String.Empty here, if not you need to get the ObjectPath from GetObjectProperties If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"

Returns

The cell address or name which this shape is linked to, or null if it isn't linked.

See also

  • ExcelChart


ExcelChart.SetShapeLinkedCell Method | FlexCel Studio for the .NET Framework documentation

ExcelChart.SetShapeLinkedCell Method

Links the shape or image to a cell, if the shape can be linked. To unlink the cell, make linkedCell null. Note that this method applies to shapes like a rectangle or a circle, or an image, not to the link of a forms object like a combobox or a radiobutton.

Remarks

Images behave differently from shapes: A linked shape will change its text with the value of the cells. A linked image will change its image, to be an screenshot of the selected range. Finally, a linked object like a combobox will modify the selected item depending on the linked cell.

Syntax

Namespace: FlexCel.Core

public abstract void SetShapeLinkedCell(Int32 objectIndex, String objectPath, String linkedCell)

Parameters

<-> | Parameter | Type | Description
 | objectIndex | Int32 | Index of the object (1 based)
 | objectPath | String | Index to the child object you want to change the property. If it is a simple object, you can use String.Empty here, if not you need to get the ObjectPath from GetObjectProperties If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"
 | linkedCell | String | Cell that will be linked to the shape. To unlink the shape, make this parameter null. Note that this can be a single cell like "A3" or a name like "myName". You can't use a complex formula here like "A1&A2"

See also

  • ExcelChart


ExcelChart.ImageIndexToObjectPath Method | FlexCel Studio for the .NET Framework documentation

ExcelChart.ImageIndexToObjectPath Method

Returns the absolute object path for an image, given an image index. Note that this method can be slow if there are many objects in the file. Whenever possible, prefer the methods that take directly an imageIndex instead of converting the imageIndex to an objectPath.

Syntax

Namespace: FlexCel.Core

public abstract String ImageIndexToObjectPath(Int32 imageIndex)

Parameters

<-> | Parameter | Type | Description
 | imageIndex | Int32 | Image index on the image array.

Returns

Image index on the total objects array.

See also

  • ExcelChart


ExcelChart.IsXlsxChart Property | FlexCel Studio for the .NET Framework documentation

ExcelChart.IsXlsxChart Property

Returns true if the chart is defined inside an xlsx file instead of xls. While both charts in xls and xlsx files are mostly compatible, some behaviors can change depending on what type of chart this is. For example, if the first series in an xls chart is pie, it won't draw gridlines even if the second isn't. In xlsx charts, if another series is not pie, Excel will draw the gridlines.

Syntax

Namespace: FlexCel.Core

public abstract Boolean IsXlsxChart { get; }

See also

  • ExcelChart


ExcelChart.Background Property | FlexCel Studio for the .NET Framework documentation

ExcelChart.Background Property

Returns the chart background if there is one defined, or null if there is none.

Syntax

Namespace: FlexCel.Core

public abstract TChartFrameOptions Background { get; set; }

See also

  • ExcelChart


ExcelChart.DefaultFont Property | FlexCel Studio for the .NET Framework documentation

ExcelChart.DefaultFont Property

Returns the default font for all text in the chart that do not have a font defined.

Syntax

Namespace: FlexCel.Core

public abstract TFlxChartFont DefaultFont { get; set; }

See also

  • ExcelChart


ExcelChart.DefaultLabelFont Property | FlexCel Studio for the .NET Framework documentation

ExcelChart.DefaultLabelFont Property

Returns the default font for all labels in the chart that do not have a font defined.

Syntax

Namespace: FlexCel.Core

public abstract TFlxChartFont DefaultLabelFont { get; }

See also

  • ExcelChart


ExcelChart.DefaultAxisFont Property | FlexCel Studio for the .NET Framework documentation

ExcelChart.DefaultAxisFont Property

Returns the default font for Axis in the chart that do not have a font defined.

Syntax

Namespace: FlexCel.Core

public abstract TFlxChartFont DefaultAxisFont { get; }

See also

  • ExcelChart


ExcelChart.DefaultAxisTitleFont Property | FlexCel Studio for the .NET Framework documentation

ExcelChart.DefaultAxisTitleFont Property

Returns the default font for Axis title in the chart that do not have a font defined.

Syntax

Namespace: FlexCel.Core

public abstract TFlxChartFont DefaultAxisTitleFont { get; }

See also

  • ExcelChart


ExcelChart.DefaultTitleFont Property | FlexCel Studio for the .NET Framework documentation

ExcelChart.DefaultTitleFont Property

Returns the default font for Title in the chart that do not have a font defined.

Syntax

Namespace: FlexCel.Core

public abstract TFlxChartFont DefaultTitleFont { get; }

See also

  • ExcelChart


ExcelChart.Style Property | FlexCel Studio for the .NET Framework documentation

ExcelChart.Style Property

This is a number between 1 and 48 which defines many standard properties for the chart, like the default line width for the series or the legend. The default style is 2.

Syntax

Namespace: FlexCel.Core

public abstract ChartStyle Style { get; set; }

See also

  • ExcelChart


ExcelChart.SubchartCount Property | FlexCel Studio for the .NET Framework documentation

ExcelChart.SubchartCount Property

A chart can have multiple subcharts inside: For example one bar chart and one pie chart. This method returns how many subcharts you have inside the main chart. Note that this property only works in xlsx files: In xls files it will always return 1.

Syntax

Namespace: FlexCel.Core

public abstract Int32 SubchartCount { get; }

See also

  • ExcelChart


ExcelChart.ChartOptions Property | FlexCel Studio for the .NET Framework documentation

ExcelChart.ChartOptions Property

Returns the type of chart and the options specific for that kind of chart. There might be more than one ChartOptions returned, since you can mix more than one type of chart on a simple chart. (One for each series). You need to look at the series ChartOptionsIndex to know to which one it refers.

Syntax

Namespace: FlexCel.Core

public abstract TChartOptions[] ChartOptions { get; }

See also

  • ExcelChart


ExcelChart.PlotArea Property | FlexCel Studio for the .NET Framework documentation

ExcelChart.PlotArea Property

Returns or sets the plot area definition for the chart. Note: Setting the plot area only works in xlsx files.

Syntax

Namespace: FlexCel.Core

public abstract TChartPlotArea PlotArea { get; set; }

See also

  • ExcelChart


ExcelChart.PlotEmptyCells Property | FlexCel Studio for the .NET Framework documentation

ExcelChart.PlotEmptyCells Property

Defines how null cells will be plotted on the chart.

Syntax

Namespace: FlexCel.Core

public abstract TPlotEmptyCells PlotEmptyCells { get; set; }

See also

  • ExcelChart


ExcelChart.ShowDataInHiddenRowsAndCols Property | FlexCel Studio for the .NET Framework documentation

ExcelChart.ShowDataInHiddenRowsAndCols Property

Defines if hidden rows and columns will be used when plotting values.

Syntax

Namespace: FlexCel.Core

public abstract Boolean ShowDataInHiddenRowsAndCols { get; set; }

See also

  • ExcelChart


ExcelChart.SeriesCount Property | FlexCel Studio for the .NET Framework documentation

ExcelChart.SeriesCount Property

Returns the count of series on this chart.

Syntax

Namespace: FlexCel.Core

public abstract Int32 SeriesCount { get; }

See also

  • ExcelChart


ExcelChart.ObjectCount Property | FlexCel Studio for the .NET Framework documentation

ExcelChart.ObjectCount Property

The number of objects that are embedded inside this chart.

Syntax

Namespace: FlexCel.Core

public abstract Int32 ObjectCount { get; }

See also

  • ExcelChart


ExcelChart.ImageCount Property | FlexCel Studio for the .NET Framework documentation

ExcelChart.ImageCount Property

The number of images in the chart.

Syntax

Namespace: FlexCel.Core

public abstract Int32 ImageCount { get; }

See also

  • ExcelChart


ExcelChart.Chart3DOptions Property | FlexCel Studio for the .NET Framework documentation

ExcelChart.Chart3DOptions Property

Returns the 3D options for the chart, or null if the chart isn't 3D.

Syntax

Namespace: FlexCel.Core

public abstract TChart3DOptions Chart3DOptions { get; }

See also

  • ExcelChart


ExcelChart.SideWall Property | FlexCel Studio for the .NET Framework documentation

ExcelChart.SideWall Property

The wall next to the y-axis in a 3D-chart.

Syntax

Namespace: FlexCel.Core

public abstract ChartWallOptions SideWall { get; }

See also

  • ExcelChart


ExcelChart.BackWall Property | FlexCel Studio for the .NET Framework documentation

ExcelChart.BackWall Property

The wall at the back of a 3D-chart

Syntax

Namespace: FlexCel.Core

public abstract ChartWallOptions BackWall { get; }

See also

  • ExcelChart


ExcelChart.Floor Property | FlexCel Studio for the .NET Framework documentation

ExcelChart.Floor Property

The floor in a 3D-chart.

Syntax

Namespace: FlexCel.Core

public abstract ChartWallOptions Floor { get; }

See also

  • ExcelChart


ExcelFile Class | FlexCel Studio for the .NET Framework documentation

ExcelFile Class

Interface a FlexCel engine has to implement to be used with FlexCelReport.

Remarks

This is an abstract class encapsulating the FlexCel API. Any implementation on the API must derive from this class.

FlexCel provides an implementation of this interface on the class XlsFile.

Syntax

Namespace: FlexCel.Core

public abstract class ExcelFile: IFlexCelFontList, IEmbeddedObjects, IFlexCelPalette, IRowColSize, IEnumerable<CellValue>

Fields

Name | Description
FIsLightClone | If true, this class was created by cloning another. This field is only used when creating a descendant of this class. For normal cases use IsLightClone
SupportsXlsx | This property lets you know if the version of FlexCel.dll you are using supports XLSX file format. Currently XLSX is supported in all versions.

Constructors

Name | Description
ExcelFile | Initializes ExcelFile fields.

Methods

Name | Description
EncodingNotNull Returns UTF8 if the parameter is null.
CheckRangeObj​Path​OrImage​Index Checks that a range or path are between bounds. Internal use.
AddWindow Adds a new window to the file. Note that this isn't a new sheet, but another view of the workbook. Most Excel documents have only one window.
DeleteWindow Deletes a window from the file. Note that this isn't a sheet, but another view of the workbook. Most Excel documents have only one window.
OnVirtualCellRead Replace this method if you want to override this event in a derived class.
OnVirtualCell​Start​Reading Replace this method if you want to override this event in a derived class.
OnVirtualCell​EndReading Replace this method if you want to override this event in a derived class.
NewFile Overloaded
 NewFile
NewFile(Int32)
NewFile(Int32, TExcelFileFormat)
Open Overloaded
 Open(String)
Open(Stream)
Open(String, TFileFormats, Char, Int32, Int32, ColumnImportType[])
Open(Stream, TFileFormats, Char, Int32, Int32, ColumnImportType[])
Open(Stream, TFileFormats, Char, Int32, Int32, ColumnImportType[], Boolean)
Open(String, TFileFormats, Char, Int32, Int32, ColumnImportType[], Encoding, Boolean)
Open(Stream, TFileFormats, Char, Int32, Int32, ColumnImportType[], Encoding, Boolean)
Open(String, TFileFormats, Char, Int32, Int32, ColumnImportType[], String[], Encoding, Boolean)
Open(Stream, TFileFormats, Char, Int32, Int32, ColumnImportType[], String[], Encoding, Boolean)
Import Overloaded
 Import(TextReader, Int32, Int32, Int32[], ColumnImportType[])
Import(TextReader, Int32, Int32, Int32[], ColumnImportType[], String[])
Import(String, Int32, Int32, Char, ColumnImportType[], Encoding, Boolean)
Import(Stream, Int32, Int32, Char, ColumnImportType[], Encoding, Boolean)
Import(TextReader, Int32, Int32, Char, Char, ColumnImportType[], String[])
Import(String, Int32, Int32, Int32[], ColumnImportType[], Encoding, Boolean)
Import(Stream, Int32, Int32, Int32[], ColumnImportType[], Encoding, Boolean)
Import(String, Int32, Int32, Char, ColumnImportType[], String[], Encoding, Boolean)
Import(Stream, Int32, Int32, Char, ColumnImportType[], String[], Encoding, Boolean)
Import(String, Int32, Int32, Int32[], ColumnImportType[], String[], Encoding, Boolean)
Import(Stream, Int32, Int32, Int32[], ColumnImportType[], String[], Encoding, Boolean)
Import(String, Int32, Int32, Char, Char, ColumnImportType[], String[], Encoding, Boolean)
Import(Stream, Int32, Int32, Char, Char, ColumnImportType[], String[], Encoding, Boolean)
Save Overloaded
 Save(String)
Save(Stream)
Save(String, TFileFormats)
Save(Stream, TFileFormats)
Save(String, TFileFormats, Char)
Save(Stream, TFileFormats, Char)
Save(String, TFileFormats, Char, Encoding)
Save(Stream, TFileFormats, Char, Encoding)
Export Overloaded
 Export(TextWriter, TXlsCellRange, Char, Boolean)
Export(String, TXlsCellRange, Char, Boolean, Encoding)
Export(Stream, TXlsCellRange, Char, Boolean, Encoding)
Export(TextWriter, TXlsCellRange, Char, Boolean, String)
Export(TextWriter, TXlsCellRange, Int32, Int32[], Boolean)
Export(String, TXlsCellRange, Int32, Int32[], Boolean, Encoding)
Export(Stream, TXlsCellRange, Int32, Int32[], Boolean, Encoding)
Export(TextWriter, TXlsCellRange, Int32, Int32[], Boolean, Boolean)
Export(String, TXlsCellRange, Int32, Int32[], Boolean, Encoding, Boolean)
Export(Stream, TXlsCellRange, Int32, Int32[], Boolean, Encoding, Boolean)
Export(TextWriter, TXlsCellRange, Int32, Int32[], Boolean, Boolean, String)
SaveForHashing Overloaded
 SaveForHashing(Stream)
SaveForHashing(Stream, TExcludedRecords)
GetSheetIndex Overloaded
 GetSheetIndex(String)
GetSheetIndex(String, Boolean)
GetSheetName Returns the sheet name for a given index.
To change the active sheet by the name, use ActiveSheetByName. See also GetSheetIndex(​​String)
GetSheetIndexFromID Returns the ActiveSheet for a stored SheetID.
You can use this method together with SheetID to save and restore an ActiveSheet when you are adding or removing sheets.

If the sheet ID doesn't exist, this method will return 0.
GetSheetVisible Returns if a given sheet is visible.
AddSheet Inserts an empty sheet at the end of the file. This is equivalent to calling InsertAndCopy​Sheets(​0, SheetCount + 1, 1).
If you need to insert more than one sheet, or insert it at the middle of existing sheets, use InsertAndCopy​Sheets(​​Int32, Int32, Int32) instead.
AddChartSheet Adds a chart sheet to the file. You can then add series and customize the returned ExcelChart object.
Note that as this is a chart sheet, the anchor is ignored.
The ActiveSheet after adding the chart will be set to the newly inserted chart.

Important: This method only works in xlsx files.
InsertAndCopySheets Overloaded
 InsertAndCopySheets(Int32, Int32, Int32)
InsertAndCopySheets(Int32[], Int32, ExcelFile)
InsertAndCopySheets(Int32, Int32, Int32, ExcelFile)
ClearSheet Clears all data on the active sheet, but does not delete it.
DeleteSheet Overloaded
 DeleteSheet(Int32)
DeleteSheet(String)
DeleteSheet(Int32, Int32)
GetSheetSelected Returns true if a sheet is selected, false otherwise. Note that you might select many sheets in Excel by shift or ctrl-clicking the sheet tabs. Also note that when changing the ActiveSheet, the sheet selected will be reset to the active sheet.
So if you want to find out which sheets are selected in a file, you should call this method after opening the file but before changing the active sheet.
This property can work in different windows depending on the value of ActiveWindow ...[more]
SetSheetSelected This method will set a sheet tab as selected. Note that this is different from ActiveSheet in that you might have only a single active sheet, but you might select many tabs by ctrl-clicking them. Also note that whenever you change the ActiveSheet, the selected sheets will be reset to the active sheet only. So if you want to save a file with more than one selected sheet, you should call this method after the last call to activesheet.
This property can work in different windows depending on the value of...[more]
GetSheetType Returns the sheet type for a given sheet.
HasHPageBreak True if the sheet has a Manual Horizontal page break on the row.
HasVPageBreak True if the sheet has a Manual Vertical page break on the column.
InsertHPageBreak Overloaded
 InsertHPageBreak(Int32)
InsertHPageBreak(Int32, Boolean)
InsertVPageBreak Overloaded
 InsertVPageBreak(Int32)
InsertVPageBreak(Int32, Boolean)
DeleteHPageBreak Deletes all manual page breaks at row. If there is no manual page break on row, this method will do nothing.
DeleteVPageBreak Deletes all manual page breaks at col. If there is no manual page break on col, this method will do nothing.
ClearPageBreaks Deletes all manual page breaks on the active sheet.
KeepRowsTogether Tells FlexCel that it must try to keep together the rows between row1 and row2 (inclusive) when printing.
This method does nothing to the resulting Excel file since this is not an Excel feature. To actually do something, you need to call AutoPageBreaks after calling this method.
KeepColsTogether Tells FlexCel that it must try to keep together the columns between col1 and col2 (inclusive) when printing.
This method does nothing to the resulting Excel file since this is not an Excel feature. To actually do something, you need to call AutoPageBreaks after calling this method.
ClearKeepRows​AndCols​Together Clears all the "KeepTogether" links in the current page.
GetKeepRowsTogether Returns the value of level for a row as set in KeepRowsTogether. Note that the last value of a "keep together" range is 0.
For example, if you set KeepRowsTogether(1, 3, 8, true); GetKeepRowsTogether will return 8 for rows 1 and 2, and 0 for row 3.
GetKeepColsTogether Returns the value of level for a column as set in KeepColsTogether. Note that the last value of a "keep together" range is 0.
For example, if you set KeepColsTogether(1, 3, 8, true); GetKeepColsTogether will return 8 for columns 1 and 2, and 0 for column 3.
HasKeepRowsTogether Returns true if there is any row marked as keeptogether in the sheet.
This method traverses every row to find out, so it can be somehow slow and you should not call it too often.
HasKeepColsTogether Returns true if there is any column marked as keeptogether in the sheet.
This method traverses every column to find out, so it can be somehow slow and you should not call it too often.
DumpKeepRows​Together​Levels This method is used for debugging intelligent page breaks (see 'Intelligent page breaks' in the Api Developer Guide.
It will read the keep-together level for every row ad write it at the column "col". Note that the contents of col will be overwritten.
DumpKeepCols​Together​Levels This method is used for debugging intelligent page breaks (see 'Intelligent page breaks' in the Api Developer Guide.
It will read the keep-together level for every column and writer it the row "row". Note that the contents of row will be overwritten.
AutoPageBreaks Overloaded
 AutoPageBreaks
AutoPageBreaks(Int32, Int32)
AutoPageBreaks(Int32, TUIRectangle)
GetCellValue Overloaded
 GetCellValue(String)
GetCellValue(Int32, Int32)
GetCellValue(Int32, Int32, Int32)
GetCellValue(Int32, Int32, Int32, Int32)
GetCellValueIndexed Overloaded
 GetCellValueIndexed(Int32, Int32, Int32)
GetCellValueIndexed(Int32, Int32, Int32, Int32)
SetCellValue Overloaded
 SetCellValue(String, Object)
SetCellValue(Int32, Int32, Object)
SetCellValue(Int32, Int32, Object, Int32)
SetCellValue(Int32, Int32, Int32, Object, Int32)
ConvertString Overloaded
 ConvertString(TRichString, Int32)
ConvertString(TRichString, Int32, String[])
SetCellFromString Overloaded
 SetCellFromString(Int32, Int32, String)
SetCellFromString(Int32, Int32, TRichString)
SetCellFromString(String, String, String[])
SetCellFromString(Int32, Int32, String, String[])
SetCellFromString(Int32, Int32, TRichString, String[])
SetCellFromString(Int32, Int32, String, Int32)
SetCellFromString(Int32, Int32, TRichString, Int32)
SetCellFromString(Int32, Int32, String, Int32, String[])
SetCellFromString(Int32, Int32, TRichString, Int32, String[])
SetCellFromString(Int32, Int32, Int32, TRichString, Int32, String[])
GetStringFromCell Overloaded
 GetStringFromCell(String)
GetStringFromCell(Int32, Int32)
GetStringFromCell(Int32, Int32, Boolean)
GetStringFromCell(Int32, Int32, Int32, TUIColor)
GetStringFromCell(Int32, Int32, Int32, Int32, TUIColor)
GetStringFromCell(Int32, Int32, Int32, Int32, TUIColor, Boolean)
SetCellFromHtml Overloaded
 SetCellFromHtml(Int32, Int32, String)
SetCellFromHtml(Int32, Int32, String, Int32)
GetHtmlFromCell Overloaded
 GetHtmlFromCell(Int32, Int32, THtmlVersion, THtmlStyle, Encoding)
GetHtmlFromCell(Int32, Int32, THtmlVersion, THtmlStyle, Encoding, Boolean)
CopyCell Copies one cell from one workbook to another. If the cell has a formula, it will be offset so it matches the new destination.
Note: You will normally not need this method. To copy a range of cells from a workbook to another use InsertAndCopy​Range(​​TXls​Cell​Range, Int32, Int32, Int32, TFlxInsertMode, TRangeCopyMode, ExcelFile, Int32) ...[more]
GetFormat | Returns the format definition for a given format index. Note that this method will only return Cell formats. If you want to read a Style format, use GetStyle(​​Int32)
AddFormat Adds a new format to the Excel format list. If it already exists, it doesn't add a new one, so you can use this method for searching too.
SetFormat Sets the font definition for a given format index. Normally it is of not use, (you should use AddFont or AddFormat instead) but could be used to change the default format. (using SetFormat(0, fmt); ). This method will change style XFs and CellXfs, depending if aFormat is a StyleXF or a CellXF.
GetFont Returns the font definition for a given font index.
SetFont | Sets the font definition for a given font index. Normally it is of not use, (you should use AddFont or AddFormat instead) but could be used to change the default font format. (using SetFont(0, font); )
AddFont Adds a new font to the excel font list. If it already exists, it doesn't add a new one, so you can use this method for searching too.
SetCellFormat Overloaded
 SetCellFormat(Int32, Int32, Int32)
SetCellFormat(Int32, Int32, Int32, Int32, Int32)
SetCellFormat(Int32, Int32, Int32, Int32, TFlxFormat, TFlxApplyFormat)
SetCellFormat(Int32, Int32, Int32, Int32, TFlxFormat, TFlxApplyFormat, Boolean)
DrawBorders This method draws a border around a range of cells.
GetCellFormat Overloaded
 GetCellFormat(Int32, Int32)
GetCellFormat(Int32, Int32, Int32)
GetCellVisibleFormat Overloaded
 GetCellVisibleFormat(Int32, Int32)
GetCellVisibleFormat(Int32, Int32, Int32)
GetCellVisible​FormatDef Overloaded
 GetCellVisibleFormatDef(Int32, Int32)
GetCellVisibleFormatDef(Int32, Int32, Int32)
Conditionally​Modify​Format Overloaded
 ConditionallyModifyFormat(TFlxFormat, Int32, Int32, TDrawingConditionalFormat)
ConditionallyModifyFormat(TFlxFormat, Int32, Int32, Boolean, TDrawingConditionalFormat)
AddConditionalFormat Adds a conditional format for a range of cells.
SetConditionalFormat Modifies one of the conditional format rules in the sheet.
GetConditionalFormat One of the entries on the conditional format list of this file.
RemoveConditional​Format Removes the conditional format at position index.
ClearConditional​Formats​InSheet Removes all conditional formats in the active sheet.
GetStyleName Gets the name of the style at position index. (1 based).
GetStyle Overloaded
 GetStyle(Int32)
GetStyle(String)
GetStyle(String, Boolean)
RenameStyle Renames an existing style. Note that this might be a user-defined style, you can't rename built-in styles.
SetStyle Modifies an existing style if name already exists, or creates a new style if it doesn't.
DeleteStyle Returns a named style for the workbook.
GetBuiltInStyleName Returns the name for a built-in style.
TryGetBuiltIn​Style​Type Tries to convert a string into an built-in style identifier. Will return true if styleName can be converted, false otherwise.
CellMergedBounds Merged Range where the cell is.
MergeCells Merges a number of cells into one.
UnMergeCells Unmerges the range of cells. The coordinates have to be exact, if there is no merged cell with the exact coordinates, nothing will be done. If you want to unmerge all cells inside a range, use UnMergeAllCells​InRange instead.
UnMergeAllCells​InRange This method will unmerge all the cells that are inside a range of cells.
CellMergedList The Merged cell at position index on the mergedcell list.
CellMergedNext Use this method to enumerate all merged cells in a sheet.
GetRowCount Number of rows actually used on a given sheet.
GetColCount Overloaded
 GetColCount(Int32)
GetColCount(Int32, Boolean)
IsEmptyRow True if the specified row does not have any cells, nor any format on it.
In short, this row has never been used.
IsNotFormattedCol True if the specified column does not have any format applied on it.
GetRowFormat Overloaded
 GetRowFormat(Int32)
GetRowFormat(Int32, Int32)
SetRowFormat Overloaded
 SetRowFormat(Int32, Int32)
SetRowFormat(Int32, Int32, Boolean)
SetRowFormat(Int32, TFlxFormat, TFlxApplyFormat, Boolean)
GetColFormat Overloaded
 GetColFormat(Int32)
GetColFormat(Int32, Int32)
SetColFormat Overloaded
 SetColFormat(Int32, Int32)
SetColFormat(Int32, Int32, Boolean)
SetColFormat(Int32, Int32, Int32)
SetColFormat(Int32, Int32, Int32, Boolean)
SetColFormat(Int32, TFlxFormat, TFlxApplyFormat, Boolean)
GetRowOptions Returns all Row options at once (if the row is autosize, if it is hidden, etc).
SetRowOptions Sets all Row options at once (if the row is autosize, if it is hidden, etc).
GetColOptions Returns all Column options at once (if the column is hidden, etc).
SetColOptions Sets all Column options at once (if the column is hidden, etc).
GetRowHeight Overloaded
 GetRowHeight(Int32)
GetRowHeight(Int32, Boolean)
GetRowHeight(Int32, Int32, Boolean)
SetRowHeight Sets the current Row height, in Excel internal units. (1/20th of a point) See Excel Internal Units for more information in Excel internal units.
GetColWidth Overloaded
 GetColWidth(Int32)
GetColWidth(Int32, Boolean)
GetColWidth(Int32, Int32, Boolean)
SetColWidth Overloaded
 SetColWidth(Int32, Int32)
SetColWidth(Int32, Int32, Int32)
DefaultRowHeight​Visual The default height for empty rows, in Excel internal units. (1/20th of a point). Different from DefaultRowHeight this property returns the actual row height as Excel will show it, considering DefaultRowHidden and DefaultRowHeight​Automatic.
See Excel Internal Units for more information in Excel internal units.
GetRowHidden Overloaded
 GetRowHidden(Int32)
GetRowHidden(Int32, Int32)
SetRowHidden Hides or shows a specific row.
GetColHidden Returns true if the column is hidden.
SetColHidden Overloaded
 SetColHidden(Int32, Boolean)
SetColHidden(Int32, Int32, Boolean)
GetAutoRowHeight Returns if the row is adjusting its size to the cell (the default) or if it has a fixed height.
SetAutoRowHeight Sets the current row to automatically autosize to the biggest cell or not.
AutofitRow Overloaded
 AutofitRow(Int32, Boolean, Double)
AutofitRow(Int32, Int32, Boolean, Boolean, Double)
AutofitRow(Int32, Int32, Boolean, Boolean, Double, Int32, Int32, Int32)
AutofitRow(Int32, Int32, Boolean, Boolean, Double, Int32, Int32, Int32, TAutofitMerged)
AutofitRow(Int32, Int32, Int32, Int32, Boolean, Boolean, Double, Int32, Int32, Int32, TAutofitMerged)
AutofitCol Overloaded
 AutofitCol(Int32, Boolean, Double)
AutofitCol(Int32, Int32, Boolean, Double)
AutofitCol(Int32, Int32, Boolean, Double, Int32, Int32, Int32)
AutofitCol(Int32, Int32, Boolean, Double, Int32, Int32, Int32, TAutofitMerged)
AutofitCol(Int32, Int32, Int32, Int32, Boolean, Double, Int32, Int32, Int32, TAutofitMerged)
AutofitRowsOn​Workbook Overloaded
 AutofitRowsOnWorkbook(Boolean, Boolean, Double)
AutofitRowsOnWorkbook(Boolean, Boolean, Double, Int32, Int32, Int32)
AutofitRowsOnWorkbook(Boolean, Boolean, Double, Int32, Int32, Int32, TAutofitMerged)
MarkRowForAutofit Overloaded
 MarkRowForAutofit(Int32, Boolean, Double)
MarkRowForAutofit(Int32, Boolean, Double, Int32, Int32, Int32, Boolean)
MarkColForAutofit Overloaded
 MarkColForAutofit(Int32, Boolean, Double)
MarkColForAutofit(Int32, Boolean, Double, Int32, Int32, Int32, Boolean)
IsRowMarkedFor​Autofit Returns true is a row is marked for autofit.
IsColMarkedFor​Autofit Returns true is a column is marked for autofit.
AutofitMarked​Rows​AndCols Overloaded
 AutofitMarkedRowsAndCols(Boolean, Boolean, Double)
AutofitMarkedRowsAndCols(Boolean, Boolean, Double, Int32, Int32, Int32, Int32, Int32)
AutofitMarkedRowsAndCols(Boolean, Boolean, Double, Int32, Int32, Int32, Int32, Int32, TAutofitMerged)
AutofitComment Will return the resized anchor so the size of the comment is enough to fit all the text inside.
ColCountInRow Overloaded
 ColCountInRow(Int32)
ColCountInRow(Int32, Int32)
ColFromIndex Overloaded
 ColFromIndex(Int32, Int32)
ColFromIndex(Int32, Int32, Int32)
ColToIndex Overloaded
 ColToIndex(Int32, Int32)
ColToIndex(Int32, Int32, Int32)
LoopOverUsedRange This method loops over a range of cells, and calls an action for every cell that has data.
CopyColFormats Copies the column definitions, that is formats, widths, hidden/visible, etc from one workbook or sheet to another.
GetColumnBlocks This method returns a list of blocks of column information, grouped by columns that have the same properties.
Since an xlsx file can have 16384 columns, querying every one of them might be slow. With this method, if columns from 5 to 16384 are hidden, you will get a single block with firstCol = 5 and lastCol = 16384 that is hidden. If you used GetColHidden instead you would have to call it 16384 times to get the same information.
SetColorPalette Changes a color on the Excel color palette.
GetColorPalette Overloaded
 GetColorPalette(Int32)
GetColorPalette(Int32, TUIColor)
NearestColorIndex Overloaded
 NearestColorIndex(TUIColor)
NearestColorIndex(TUIColor, Boolean[])
PaletteContainsColor Returns true if the internal color palette contains the exact specified color. Note that Excel 2007 doesn't use the color palette, so this method is not needed there.
OptimizeColorPalette Changes the colors in the color palette so they can represent better the colors in use. This method will change the colors not used in the palette by colors used in the sheet. If there are more unique colors in the sheet than the 56 available in the palette, only the first colors will be changed.

When FlexCel saves an xls file, it saves the color information twice: The real color for Excel 2007 and newer, and the indexed color for older Excel versions. This method optimizes the palette of indexed colors so they look better in Excel 2003 or older. It doesn't effect Excel 2007 or newer at all.
GetColorPalette​Version Internal use. Every time the palette changes, the number returned is incremented.
SetColorTheme Overloaded
 SetColorTheme(TThemeColor, TDrawingColor)
SetColorTheme(TPrimaryThemeColor, TDrawingColor)
GetColorTheme Overloaded
 GetColorTheme(TThemeColor)
GetColorTheme(TPrimaryThemeColor)
NearestColorTheme Returns the most similar entry on the theme palette for a given color.
GetThemeFont Gets the major of minor font scheme in the theme.
SetThemeFont Sets either the minor or the major font for the theme.
GetTheme | This is an advanced method, that allows you to get the full theme in use. Normally you will just want to replace colors, and you can do this with SetColorTheme(​​TPrimary​Theme​Color, TDrawingColor) and GetColorTheme(​​TPrimary​Theme​Color) methods. Much of the functionality in a theme applies to PowerPoint, not Excel....[more]
GetThemeNoClone Internal use. This won't clone the internal structure for more performance.
SetTheme This is an advanced method, that allows you to set the full theme in use. Normally you will just want to replace colors, and you can do this with SetColorTheme(​​TPrimary​Theme​Color, TDrawingColor) and GetColorTheme(​​TPrimary​Theme​Color) methods.
GetNamedRange Overloaded
 GetNamedRange(Int32)
GetNamedRange(String, Int32)
GetNamedRange(String, Int32, Int32)
FindNamedRange Returns the index (1 based) on the list of named ranges for a given name and local sheet. If the range is not found, this method will return -1 You could use GetNamedRange(​​Int32) to get the name definition, or directly call GetNamedRange(​​String, Int32, Int32) to get a named range knowing its name and sheet position.
SetNamedRange Overloaded
 SetNamedRange(TXlsNamedRange)
SetNamedRange(Int32, TXlsNamedRange)
DeleteNamedRange Deletes the name at the specified position. Important: If the name you are trying to delete is referenced by any formula/​chart/​whatever in your file, the name will not actually be deleted but hidden.

You won't see the name in Excel or in the formula, but it will be there and you can see it from FlexCel.
You can use GetUsedNamedRanges to learn if a range might be deleted.

Also, note that if you later delete the formulas that reference those ranges FlexCel will remove those hanging ranges when saving. ...[more]
GetUsedNamedRanges Returns an array of booleans where each value indicates if the name at position "i-1" is used by any formula, chart, or object in the file. If the name is in use, it can't be deleted. Note that the index here is Zero-based, different from all other Name indexes in FlexCel, because arrays in C# are always 0-based. So UsedRange[0] corresponds to GetNamedRange(1) and so on.
CopyToClipboard Overloaded
 CopyToClipboard(StringBuilder, Stream)
CopyToClipboard(FlexCelClipboardFormat, Stream)
CopyToClipboard​Format Overloaded
 CopyToClipboardFormat(TXlsCellRange, StringBuilder, Stream)
CopyToClipboardFormat(FlexCelClipboardFormat, TXlsCellRange, Stream)
PasteFromXls​Clipboard​Format Overloaded
 PasteFromXlsClipboardFormat(Int32, Int32, TFlxInsertMode, Stream)
PasteFromXlsClipboardFormat(Int32, Int32, TFlxInsertMode, Stream, Boolean)
PasteFromText​Clipboard​Format Pastes the clipboard contents beginning on cells row, col.
GetPageHeader​AndFooter This method will return all the headers and footers in a sheet.
SetPageHeader​AndFooter | This method will set all the headers and footers in a sheet. If you want a simple header or footer for all the pages, you might want to use PageHeader and PageFooter
FillPageHeader​OrFooter Given a Page Header or footer string including macros (like [FileName] or [PageNo]), this method will return the strings that go into the left, right and middle sections.
GetPageHeader​OrFooter​AsHtml Converts a section of a page header or footer into an HTML string.
GetHeaderOrFooter​Image Overloaded
 GetHeaderOrFooterImage(THeaderAndFooterKind, THeaderAndFooterPos, TXlsImgType, Stream)
GetHeaderOrFooterImage(THeaderAndFooterKind, THeaderAndFooterPos, TXlsImgType)
GetHeaderOrFooter​Image​Properties Returns the image position and size.
SetHeaderOrFooter​Image Overloaded
 SetHeaderOrFooterImage(THeaderAndFooterKind, THeaderAndFooterPos, Byte[], THeaderOrFooterImageProperties)
SetHeaderOrFooterImage(THeaderAndFooterKind, THeaderAndFooterPos, Byte[], TXlsImgType, THeaderOrFooterImageProperties)
GetPrintMargins Gets the Margins on the active sheet.
SetPrintMargins Sets the Margins on the active sheet.
GetPrinterDriver​Settings Returns printer driver settings. This method is not intended to be used alone, but together with SetPrinterDriver​Settings to copy printer driver information from a file to another.
SetPrinterDriver​Settings Sets printer driver information. This method is not intended to be used alone, but together with GetPrinterDriver​Settings to copy printer driver information from a file to another.
SetImage Overloaded
 SetImage(Int32, Byte[])
SetImage(Int32, TUIImage)
SetImage(Int32, Byte[], TXlsImgType)
SetImage(Int32, Byte[], Boolean, String)
SetImage(Int32, TUIImage, Boolean, String)
SetImage(Int32, Byte[], TXlsImgType, Boolean, String)
SetImageAlternate Sets the image data and / or image properties of an existing image.
Currently this method is only needed for SVG images, since SVG images are stored as both PNG and SVG inside the xlsx file. This method allows you to supply both images.
SetImageProperties Overloaded
 SetImageProperties(Int32, TImageProperties)
SetImageProperties(Int32, TImageProperties, Boolean, String)
GetImageName Overloaded
 GetImageName(Int32)
GetImageName(Int32, Boolean, String)
GetImage Overloaded
 GetImage(Int32, TXlsImgType)
GetImage(Int32, TXlsImgType, Stream)
GetImage(Int32, String, TXlsImgType, Stream, Boolean)
GetImageAlternate Returns an image and its type. Currently this method is the same as GetImage(​​Int32, String, TXlsImgType, Stream, Boolean) for all images except SVG.
For SVG images, xlsx files store both a PNG and SVG image. In those cases, this method will return the SVG image. To get the PNG, call GetImage(​​Int32, String, TXlsImgType, Stream, Boolean) ...[more]
HasImageAlternate | Returns true if the image has an alternate representation. This currently happens only with SVG images, which have a PNG base and an SVG alternate. If the image has an alternate, you can get the data with GetImageAlternate
GetImageProperties Overloaded
 GetImageProperties(Int32)
GetImageProperties(Int32, Boolean, String)
AddImage Overloaded
 AddImage(TUIImage, TImageProperties)
AddImage(Byte[], TImageProperties)
AddImage(Stream, TImageProperties)
AddImage(String, TImageProperties)
AddImage(Byte[], TXlsImgType, TImageProperties)
AddImage(Stream, TXlsImgType, TImageProperties)
AddImage(Int32, Int32, TUIImage)
AddImageAlternate Adds an image to the active sheet.
Currently this method is only needed for SVG images, since SVG images are stored as both PNG and SVG inside the xlsx file. This method allows you to supply both images.
DeleteImage Overloaded
 DeleteImage(Int32)
DeleteImage(Int32, Boolean, String)
ClearImage Overloaded
 ClearImage(Int32)
ClearImage(Int32, Boolean, String)
SetSheetBackground Sets the sheet background for the active sheet. Set it to null to remove the background.
GetSheetBackground Gets the sheet background for the active sheet. It will return null if there isn't any background in the sheet.
ImageIndexTo​Object​Index Returns the general index on the object list for an image. You can use then this index on SendToBack, for example.
Note that if the image is in a group, this method will return the first object index for the group that contains the image.
If you want to get the object path to the image instead, look at ImageIndexTo​Object​Path
ObjectIndexTo​Image​Index Returns the index on the image collection of an object. Note that this method is slow when there are many images, so use it sparingly.
ImageIndexTo​Object​Path Returns the absolute object path for an image, given an image index. Note that this method can be slow if there are many objects in the file.
Whenever possible, prefer the methods that take directly an imageIndex instead of converting the imageIndex to an objectPath.
ObjectPathTo​Image​Index Returns the index on the image collection of an object. Note that this method is slow when there are many images, so use it sparingly.
Whenever possible, prefer the methods that take directly an objectPath instead of converting the objectPath to an imageIndex.
GetObjectName Returns the name of the object at objectIndex position.
GetObjectShapeId Returns the shape id of the object at objectIndex position. Shape Ids are internal identifiers for the shape, that you can use to uniquely identify a shape.
Note that the shape id can change when you load the file, once it is loaded, it will remain the same for the shape lifetime.
FindObject Returns the object index for an existing name. Whenever possible you should prefer to use FindObjectPath instead of this method, since it is faster and finds also objects that are not in the root branch.
FindObjectPath Finds an object by its name, and returns the ObjectPath you need to use this object.
Note that if there is more than an object with the same name in the sheet, this method will return null.
FindObjectByShapeId Finds an object given its internal shape id, and returns the object index you need to access the same object in FlexCel.
IsValidObject​Path​ObjName Returns true if the object name exists and it is unique in the sheet.
You can use FindObjectPath to find the object path you need for this object name.
GetObjectAnchor Overloaded
 GetObjectAnchor(Int32)
GetObjectAnchor(Int32, String)
SetObjectAnchor Overloaded
 SetObjectAnchor(Int32, TClientAnchor)
SetObjectAnchor(Int32, String, TClientAnchor)
GetObjectProperties Overloaded
 GetObjectProperties(Int32, Boolean)
GetObjectProperties(Int32, String, Boolean)
GetObjectProperties​ByShapeId Returns information on an object and all of its children and parents.

Note: This method always returns a top level object. If you ask for a shape id of a shape that is contained inside other group, this method will return the first level group containing other groups that contain the shape.

Note 2:This method is mostly for internal use. Shape ids are not guaranteed to be preserved when saving and reloading a file, so this method should only be used while editing the file with shape ids retrieved from the XlsFile object, not hardcoded shape ids. To get the object properties for a known shape in a file, give it a name and call...[more]
SetObjectText Overloaded
 SetObjectText(Int32, String, String)
SetObjectText(Int32, String, TRichString)
SetObjectText(Int32, String, TDrawingRichString)
SetObjectName Sets the name for an autoshape.
SetObjectProperty Overloaded
 SetObjectProperty(Int32, String, TShapeOption, String)
SetObjectProperty(Int32, String, TShapeOption, Int64)
SetObjectProperty(Int32, String, TShapeOption, Double)
SetObjectProperty(Int32, String, TShapeOption, Boolean)
SetObjectProperty(Int32, String, TShapeOption, TDrawingHyperlink)
SetObjectProperty(Int32, String, TShapeOption, Int32, Boolean)
SetObjectProperties Sets all the properties of the shape. This allows for more complete control than SetObjectProperty(​​Int32, String, TShapeOption, String) beause it can specify for example a xlsx fill using a theme color, instead of simple RGB fills.
AddAutoShape Adds an autoshape to the sheet. You can add shapes to a worksheet, or to a chart sheet.
For an example on how to add a shape, please create a shape in Excel, then open the file with APIMate and look at the generated code.
DeleteObject Overloaded
 DeleteObject(Int32)
DeleteObject(Int32, String)
GetObjectsInRange Returns a list with all the objects that are completely inside a range of cells.
GetObjectLinkedCell Returns the cell that is linked to the object. If the object isn't an object that can be linked or it isn't linked, this method will return null.
Note that when you change the value in the cell linked to this object, the value of the object will change.

The sheet returned in the TCellAddress might be null, in which case the reference is to a cell in the same sheet, or it might contain another sheet name.

Also note that this applies to form objects. To get the link of a shape like a circle or rectangle, use...[more]
SetObjectLinkedCell Links the object to a cell, if the object can be linked. If the object is a radio button then all the other radio buttons in the group will be linked to the same cell, so when the cell changes the radio buttons too, and vice-versa. To unlink the cell, make linkedCell null.
GetShapeLinkedCell Returns the cell that is linked to the shape or image. If the object isn't linked, this method will return null.
Note that when you change the value in the cell linked to this object, the value of the object will change.
Also note that this method applies to shapes like a rectangle or circle, or an image. To get the link of a forms object like a combobox or a radiobutton use GetObjectLinkedCell instead.
SetShapeLinkedCell Links the shape or image to a cell, if the shape can be linked. To unlink the cell, make linkedCell null.
Note that this method applies to shapes like a rectangle or circle, or images. To change the link of a forms object like a combobox or a radiobutton use SetObjectLinkedCell instead.
GetObjectInputRange Returns the input range for the object.
If the object isn't a combobox or listbox, or it doesn't have an input range, this method will return null.
Note that when you change the value in the cell linked to this object, the value of the object will change.

The sheet in the TCellAddresses returned might be null, in which case the reference is to a cell in the same sheet, or it might contain another sheet name.
SetObjectInputRange Sets the input range for a ListBox or a ComboBox. When applied to other objects, this method does nothing.
GetObjectMacro Returns the macro associated with an object, or null if there is no macro associated.
SetObjectMacro Associates an object with a macro. While this will normally be used in buttons, you can associate macros to almost any object.
GetCheckboxState Gets the value of a checkbox in the active sheet. Note that this only works for checkboxes added through the Forms toolbar. It won't return the values of ActiveX checkboxes.
SetCheckboxState Sets the value of a checkbox in the active sheet. Note that this only works for checkboxes added through the Forms toolbar. It won't return the values of ActiveX checkboxes.
GetCheckboxLinked​Cell OBSOLETE: Use GetObjectLinkedCell instead.

Returns the cell that is linked to the checkbox. If the object isn't a checkbox or it isn't linked, this method will return null. Note that when you change the value in the cell linked to this checkbox, the value of the checkbox will change.

The sheet returned in the TCellAddress might be null, in which case the reference is to a cell in the same sheet, or it might contain another sheet name.
SetCheckboxLinked​Cell OBSOLETE: Use SetObjectLinkedCell instead.

Links the checkbox to a cell, so when the cell changes the checkbox changes too, and vice-versa. To unlink the cell, make linkedCell null.
AddCheckbox Overloaded
 AddCheckbox(TClientAnchor, TRichString, TCheckboxState, TCellAddress)
AddCheckbox(TClientAnchor, TRichString, TCheckboxState, TCellAddress, String)
GetRadioButtonState Gets if a radio button in the active sheet is selected or not. Note that this only works for radio buttons added through the Forms toolbar. It won't return the values of ActiveX radio buttons.
SetRadioButtonState | Sets the value of a radio button in the active sheet. Note that this only works for radio buttons added through the Forms toolbar. It won't return the values of ActiveX radio buttons
AddRadioButton Overloaded
 AddRadioButton(TClientAnchor, TRichString)
AddRadioButton(TClientAnchor, TRichString, String)
AddGroupBox Overloaded
 AddGroupBox(TClientAnchor, TRichString)
AddGroupBox(TClientAnchor, TRichString, String)
GetObjectSelection Gets the selected item in an object from the "Forms" palette. It can be a combobox or a listbox.
0 means no selection, 1 the first item in the list. Note that this only works for objects added through the Forms toolbar. It won't return the values of ActiveX objects.
SetObjectSelection Sets the selected item of an object from the "Forms" palette. It can be a combobox, a listbox, a spinbox or a scrollbar. Note that this only works for objects added through the Forms toolbar. It won't return the values of ActiveX objects.
GetObjectSpin​Properties Returns maximum, minimum and increment in any control that has a spin or dropdown, like a listbox, combobox, spinner or scrollbar.
SetObjectSpin​Properties Sets the spin properties of an object. You should apply this only to scrollbars and spinners.
GetObjectSpinValue Returns the current selected value of a scrollbar.
SetObjectSpinValue Sets the position in a scrollbar object. If the object is linked to a cell, the cell will be updated.
AddComboBox Adds a ComboBox to the active sheet.
AddListBox Adds a ListBox to the active sheet.
AddButton Adds a button to the sheet, with the associated macro.
AddLabel Adds a Label to the active sheet.
AddSpinner Adds a Spinner to the active sheet.
AddScrollBar Adds a ScrollBar to the active sheet.
RenderObject Overloaded
 RenderObject(Int32)
RenderObject(Int32, String)
RenderObject(Int32, Double, TShapeProperties, TUISmoothingMode, TUIInterpolationMode, Boolean, Boolean, TPointF, TUIRectangle, TUISize)
RenderObject(Int32, Double, TShapeProperties, TUISmoothingMode, TUIInterpolationMode, Boolean, Boolean, TUIColor, TPointF, TUIRectangle, TUISize)
RenderObject(Int32, Double, TShapeProperties, TUISmoothingMode, TUIInterpolationMode, Boolean, Boolean, TUIColor, Double, TPointF, TUIRectangle, TUISize)
RenderCells Overloaded
 RenderCells(Int32, Int32, Int32, Int32, Boolean)
RenderCells(Int32, Int32, Int32, Int32, Boolean, Double, TUISmoothingMode, TUIInterpolationMode, Boolean)
RenderCells(Int32, Int32, Int32, Int32, Boolean, Double, TUISmoothingMode, TUIInterpolationMode, Boolean, Double)
RenderCells(Int32, Int32, Int32, Int32, Boolean, Double, TUISmoothingMode, TUIInterpolationMode, Boolean, Double, Boolean, Boolean)
CellRangeDimensions Returns the height and width that would be used by a range of cells (in Points, or 1/72 inches).
RenderObjectAsSVG Overloaded
 RenderObjectAsSVG(Int32, String, String, Encoding)
RenderObjectAsSVG(Stream, Int32, String, String, Encoding)
RenderObjectAsSVG(Int32, String, String, String, Encoding)
RenderObjectAsSVG(Stream, Int32, String, String, String, Encoding)
RenderObjectAsSVG(Int32, TShapeProperties, TUIColor, TSVGExportType, String, String, String, IEnumerable<TSVGAttribute>, Encoding, TPointF, TUIRectangle)
RenderObjectAsSVG(Stream, Int32, TShapeProperties, TUIColor, TSVGExportType, String, String, String, IEnumerable<TSVGAttribute>, Encoding, TPointF, TUIRectangle)
RenderObjectAsSVG(Int32, Double, TShapeProperties, TUIColor, TSVGExportType, String, String, String, IEnumerable<TSVGAttribute>, Encoding, TPointF, TUIRectangle)
RenderObjectAsSVG(Stream, Int32, Double, TShapeProperties, TUIColor, TSVGExportType, String, String, String, IEnumerable<TSVGAttribute>, Encoding, TPointF, TUIRectangle)
RenderObjectAsSVG(Int32, Double, TShapeProperties, TUIColor, TSVGExportType, String, String, String, IEnumerable<TSVGAttribute>, Encoding, Boolean, TPointF, TUIRectangle)
RenderObjectAsSVG(Stream, Int32, Double, TShapeProperties, TUIColor, TSVGExportType, String, String, String, IEnumerable<TSVGAttribute>, Encoding, Boolean, TPointF, TUIRectangle)
SendToBack Sends the graphical object to the bottom layer on the display (z-order) position. It will show below and will be covered by all other objects on the sheet.
BringToFront Sends the graphical object to the top layer on the display (z-order) position. It will show above and will cover all other objects on the sheet.
SendForward Sends the graphical object one layer up on the display (z-order) position. It will show above and will cover the image at objectIndex+1.
SendBack Sends the graphical object one layer down. It will show below and will be covered by image at objectIndex-1.
CommentRowCount Maximum row index including comments.
CommentCountRow Number of comments on a given row.
GetCommentRow Returns the comment at position commentIndex on the specified row.
GetCommentRowCol | Returns the column for comment at position commentIndex
GetComment Returns the comment at the specified row and column, or an empty string if there is no comment on that cell.
SetCommentRow Overloaded
 SetCommentRow(Int32, Int32, TRichString, TImageProperties)
SetCommentRow(Int32, Int32, String, TImageProperties)
SetComment Overloaded
 SetComment(Int32, Int32, String)
SetComment(Int32, Int32, TRichString)
SetComment(Int32, Int32, TRichString, String, TImageProperties)
SetComment(Int32, Int32, String, String, TImageProperties)
GetCommentPropertiesRow | Returns the comment properties for the popup at position commentIndex
GetCommentProperties Gets the popup placement for an existing comment. If there is not a comment on cell (row,col), this will return null.
SetCommentPropertiesRow Sets the comment properties at the specified index.
SetCommentProperties Sets the popup placement for an existing comment. If there is not a comment on cell (row,col), this will create an empty one.
LightClone Returns a copy of this ExcelFile object with the same backing data, so the cells in both objects are the same.
Using a light clone allows you to read from a single ExcelFile in two different threads, since while the data is the same (so you don't use twice the memory as a real clone would), you can have separate activesheets in both. So one thread can be reading from the "original" file with ActiveSheet = 1, and the other thread could be reading from the light clone with activeSheet = 3.
InsertAndCopyRange Overloaded
 InsertAndCopyRange(TXlsCellRange, Int32, Int32, Int32, TFlxInsertMode)
InsertAndCopyRange(TXlsCellRange, Int32, Int32, Int32, TFlxInsertMode, TRangeCopyMode)
InsertAndCopyRange(TXlsCellRange, Int32, Int32, Int32, TFlxInsertMode, TRangeCopyMode, ExcelFile, Int32)
InsertAndCopyRange(TXlsCellRange, Int32, Int32, Int32, TFlxInsertMode, TRangeCopyMode, ExcelFile, Int32, TExcelObjectList)
DeleteRange Overloaded
 DeleteRange(TXlsCellRange, TFlxInsertMode)
DeleteRange(Int32, Int32, TXlsCellRange, TFlxInsertMode)
DeleteRange(Int32, Int32, TXlsCellRange, TFlxInsertMode, Boolean)
MoveRange Overloaded
 MoveRange(TXlsCellRange, Int32, Int32, TFlxInsertMode)
MoveRange(TXlsCellRange, Int32, Int32, TFlxInsertMode, Boolean)
ClearDataValidation Overloaded
 ClearDataValidation
ClearDataValidation(TXlsCellRange)
AddDataValidation Adds a new Data Validation to a specified range.
GetDataValidation Overloaded
 GetDataValidation(Int32, Int32)
GetDataValidation(Int32, Int32, TXlsCellRange)
GetDataValidation​Info Returns the data validation information for an entry of the index.
There are 2 ways you can access the data validation information on a sheet:...[more]
GetDataValidation​Ranges Returns a list of ranges for which a data validation definition applies.
There are 2 ways you can access the data validation information on a sheet:...[more]
CheckDataValidation Overloaded
 CheckDataValidation(Int32, Int32)
CheckDataValidation(Int32, Int32, Object, Boolean)
CheckDataValidations​InSheet Checks if all the cells in the active sheet inside data validations have values that are valid according to the data validation specifications.
CheckDataValidations​InWorkbook Checks if all the cells in the file inside data validations have values that are valid according to the data validation specifications.
GetHyperLink Returns the hyperlink at position index on the list.
SetHyperLink Modifies an existing Hyperlink. Use AddHyperLink to add a new one.
GetHyperLink​Cell​Range Returns the cell range a hyperlink refers to.
SetHyperLink​Cell​Range Changes the cells an hyperlink is linked to.
AddHyperLink Adds a new hyperlink to the Active sheet. Use SetHyperLink to modify an existing one.
DeleteHyperLink Deletes an existing hyperlink.
LoopHyperLinks Loops over the list of existing hyperlinks in the active sheet which are at least partially contained in range, and executes action for each one of those links. This can be faster than looping over all hyperlinks in a page if you have thousands, since this method uses spatial indexing.
GetRowOutlineLevel Returns the Outline level for a row.
SetRowOutlineLevel Overloaded
 SetRowOutlineLevel(Int32, Int32)
SetRowOutlineLevel(Int32, Int32, Int32)
GetColOutlineLevel Returns the Outline level for a column.
SetColOutlineLevel Overloaded
 SetColOutlineLevel(Int32, Int32)
SetColOutlineLevel(Int32, Int32, Int32)
CollapseOutlineRows Overloaded
 CollapseOutlineRows(Int32, TCollapseChildrenMode)
CollapseOutlineRows(Int32, TCollapseChildrenMode, Int32, Int32)
CollapseOutlineCols Overloaded
 CollapseOutlineCols(Int32, TCollapseChildrenMode)
CollapseOutlineCols(Int32, TCollapseChildrenMode, Int32, Int32)
IsOutlineNodeRow Returns true when the row is the one that is used for collapsing an outline. (it has a "+" at the left).
IsOutlineNodeCol Returns true when the column is the one that is used for collapsing an outline. (it has a "+" at the top).
IsOutlineNode​CollapsedRow Returns true when the row is an outline node (it has a "+" at the left) and it is closed (all children are hidden).
IsOutlineNode​CollapsedCol Returns true when the column is an outline node (it has a "+" at the top) and it is closed (all children are hidden).
CollapseOutline​NodeRow Use this method to collapse a node of the outline. If the row is not a node (IsOutlineNodeRow is false) this method does nothing.
While this method allows a better control of the rows expanded and collapsed, you will normally use CollapseOutline​Rows(​​Int32, TCollapseChildren​Mode) to collapse or expand all rows in a sheet.
CollapseOutline​NodeCol Use this method to collapse a node of the outline. If the column is not a node (IsOutlineNodeCol is false) this method does nothing.
While this method allows a better control of the columns expanded and collapsed, you will normally use CollapseOutline​Cols(​​Int32, TCollapseChildren​Mode) to collapse or expand all columns in a sheet.
SubtotalDefault​English​String Returns the english string that Excel uses to refer to Sums, averages, et. when you use the Subtotal command. You can use the result of this method together with Subtotal to specify the text for totals.
Subtotal This method works like the "Subtotal" command in Excel in the "Data" tab of the ribbon. It will take a number of cells and group them by similar values, adding a subtotal formula every new different value and a grand total at the end.
It will also add outlines at the right.
SelectCell | Selects a single cell. To select multiple cells, use SelectCells
SelectCells | Selects a group of cells on a given pane. If you just want to select just one cell, you can use the simpler method SelectCell This property can work in different windows depending on the value of ActiveWindow
GetSelectedCells Returns the selected ranges on a sheet.
This property can work in different windows depending on the value of ActiveWindow
ScrollWindow Overloaded
 ScrollWindow(Int32, Int32)
ScrollWindow(TPanePosition, Int32, Int32)
GetWindowScroll Overloaded
 GetWindowScroll
GetWindowScroll(TPanePosition)
FreezePanes | This command is equivalent to Menu-​>Window-​>Freeze Panes. It will freeze the rows and columns above and to the left from cell. Note that because Excel works this way, when you SplitWindow the panes are suppressed and vice-versa See also GetFrozenPanes This property can work in different windows depending on the value of ActiveWindow
GetFrozenPanes Returns the cell that is freezing the window, "A1" if no panes are frozen.
See also FreezePanes This property can work in different windows depending on the value of ActiveWindow
SplitWindow | This command is equivalent to Menu-​>Window-​>Split. It will split the window in 4 regions. Note that because Excel works this way, when you FreezePanes the windows are unsplitted and vice-versa See also GetSplitWindow This property can work in different windows depending on the value of ActiveWindow
GetSplitWindow Returns the horizontal and vertical offsets for the split windows. Zero means no split.
See also SplitWindow This property can work in different windows depending on the value of ActiveWindow
GetDataConnections Returns the data connections in the file. Use SetDataConnections to change the connections in the file.
SetDataConnections Sets the data connections in the file.
GetChart Returns a chart from an object position and path. If the object does not contain a chart, it returns null.
Note that charts can be first-level objects (in chart sheets), or they can be embedded inside other objects, that can be themselves embedded inside other objects. So you need to recursively look inside all objects to see if there are charts anywhere.

Look at the example in this topic to see how to get all charts in a sheet.
AddChart This method will add a chart to the active sheet. You can then add series and customize the returned ExcelChart object.

Important: This method only works in xlsx files.
Find Finds a value inside a cell and returns the position for the cell, or null if nothing was found.
Replace Overloaded
 Replace(Object, Object, TXlsCellRange, Boolean, Boolean, Boolean)
Replace(Object, Object, TXlsCellRange, Boolean, Boolean, Boolean, Action<TReplaceAction>)
Sort Overloaded
 Sort(TXlsCellRange, Boolean, Int32[], TSortOrder[], IComparer)
Sort(TXlsCellRange, Boolean, Int32[], TSortOrder[], IComparer, TSortFormulaMode)
SetAutoFilter Overloaded
 SetAutoFilter(TXlsCellRange)
SetAutoFilter(TXlsCellRange, Boolean)
SetAutoFilter(Int32, Int32, Int32)
SetAutoFilter(Int32, Int32, Int32, Int32)
RemoveAutoFilter Removes the AutoFilter from the active sheet. If there is no AutoFilter in the sheet, this method does nothing.
HasAutoFilter Overloaded
 HasAutoFilter
HasAutoFilter(Int32, Int32)
GetAutoFilterRange Returns the range of cells with AutoFilter in the Active sheet, or null if there is not AutoFilter.
Recalc Overloaded
 Recalc
Recalc(Boolean)
RecalcCell This method will recalculate a single cell and all of it's dependencies, but not the whole workbook.

USE THIS METHOD WITH CARE! You will normally want to simply call Recalc or just save the file and let FlexCel calculate the workbook for you.
This method is for rare situations where you are making thousands of recalculations and the speed of Recalc is not enough, and you have a big part of the spreadsheet that you know that didn't change.

Note: If you are recalculating many cells without changing data, you can speed up calculations by calling...[more]
StartBatchRecalc​Cells This method tells FlexCel that you are going to call multiple times RecalcCell without changing any data in the spreadsheet. This way, FlexCel won't keep recalculating the same supporting cells each time you call RecalcCells.

Always match this call with a call to EndBatchRecalcCells.
EndBatchRecalcCells This method ends the batch started by StartBatchRecalc​Cells and goes back to normal mode.
RecalcExpression Overloaded
 RecalcExpression(String)
RecalcExpression(String, Boolean)
RecalcRange This method recalculates a formula that returns a range, and returns the cells that compose it. Note that normally ranges are a single rectangle (like in "=A1:B2"), and in this case this method will return a single element in the array.
But you might have a formula like "=A1:A10, C6:C7" which will return two different ranges. In this case, the returned array will have more than one TCellAddressRange.
If the formula doesn't resolve to a range or group of ranges, this method will return null.
OffsetRelative​Formula Use this method to know the actual formula that applies to a cell when the formula is relative.
In some places, mostly data validations and names, Excel returns relative formulas.

So for example you might have a name with a definition of "=Sheet1!A2" when you are positioned at cell A1. If you now move the cursor to cell A2 in Excel, the name definition will be "=Sheet1!A3" since the reference is relative to the cell where the cursor is. If you retrieve the name formula with FlexCel, as FlexCel doesn't have a cursor, it will always return the canonical formula as if you were positioned at A1. If you want to know the real formula when you are positioned at A2, you need to call this method with cellRow =3, cellCol = 1 and expression = "=Sheet1!A2". It will return "=Sheet1!A3".
RecalcRelative​Formula Use this method to know the value of a formula that applies to a cell when the formula is relative.
In some places, mostly data validations and names, Excel returns relative formulas.

So for example you might have a name with a definition of "=Sheet1!A2" when you are positioned at cell A1. If you now move the cursor to cell A2 in Excel, the name definition will be "=Sheet1!A3" since the reference is relative to the cell where the cursor is. If you use RecalcExpression(​​String) ...[more]
RecalcAndVerify Use this method to validate a file. FlexCel does not support all the range of functions from Excel when recalculating, so unknown functions will return "#NAME?" errors. Using this function you can validate your user worksheets and see if all the formulas they use are supported.
GetWhatIfTableList Returns a list of the upper cells of the What-if tables in the page. You can then use GetWhatIfTable to get the definition of each one.
GetWhatIfTable Returns the range of cells that make the what-if table that starts at aRow and aCol.
If there is no What-if table at aRow, aCol, this method returns null.

If both the returned rowInputCell and colInputCell are null, this means this table points to deleted references.
SetWhatIfTable Creates an Excel What-if table in the range of cells specified by Range. Calling this method is the same as setting a cell value with a TFormula where TFormula.Span has more than one cell, and TFormula.Text is something like "{​=TABLE(​,A4)​}​". The parameters for the =TABLE function are rowInputCell and colInputCell, and they look the same a Excel will show them.
GetLink Gets the external link at position i.
SetLink Changes the external link at position i for a new value. Note that you can't add new links with this method, external links are added automatically when you add formulas that reference other worksheets. This method is only to change existing links to point to other place. All formulas pointing to the old link will point to the new.

Note that the replacing filename should have the same sheets as the original, or the formulas might break.
ConvertFormulas​ToValues Overloaded
 ConvertFormulasToValues(Boolean)
ConvertFormulasToValues(Boolean, Boolean)
ConvertExternal​Names​ToRef​Errors Overloaded
 ConvertExternalNamesToRefErrors
ConvertExternalNamesToRefErrors(Boolean)
GetCachedFont0 This method is used by FlexCel itself, you shouldn't call it directly.
SetCachedFont0 This method is used by FlexCel itself, you shouldn't call it directly.
AddUserDefined​Function Adds a custom formula function to the FlexCel recalculation engine. Note that this formulas are only valid for Excel custom formulas, not for internal ones.
For example, you could define "EDATE" since it is a custom formula defined in the Analysis Addin, but you cannot redefine "SUM".
Note that if a custom formula with the name already exists, it will be replaced. Names are Case insensitive ("Date" is the same as "DATE").

Also note that some user defined functions come already built in FlexCel, so you might not need to define them.
For more information on adding Custom Formulas make sure you read...[more]
EvaluateUser​Defined​Function Evaluates a custom function you have added earlier with AddUserDefined​Function. You will not normally need to call this method, but it could be used for testing.
If the function has not been added with AddUserDefined​Function, this method will return TFlxFormulaError​Value.​Err​Name.
ClearUserDefined​Functions Removes all the custom formula functions from the FlexCel recalculation engine.
RemoveUserDefined​Function Removes a single function from the FlexCel recalculation engine. If the function doesn't exist, this method will return false.
IsDefinedFunction Overloaded
 IsDefinedFunction(String)
IsDefinedFunction(String, TUserDefinedFunctionLocation)
GetFormulaTokens Overloaded
 GetFormulaTokens(Int32, Int32)
GetFormulaTokens(Int32, Int32, Int32)
GetTokens Returns the tokens for a formula in text form. See GetFormulaTokens(​​Int32, Int32) for more information.
SetFormulaTokens Overloaded
 SetFormulaTokens(Int32, Int32, TTokenList)
SetFormulaTokens(Int32, Int32, Int32, TTokenList)
SetTokens | This method converts a list of tokens in the corresponding string. Normally you get the tokens from GetTokens or GetFormulaTokens(​​Int32, Int32)
RemoveMacros If the file has macros, this method will remove them.
HasMacros Returns true if the file has any macros.
UnshareWorkbook Removes the "track changes" information of the workbook and unshares the workbook. This is only needed for xls files, as FlexCel doesn't save tracking changes in xlsx files, and the feature is deprecated in Excel.
IsSharedWorkbook Returns true is this is a shared workbook. This method only will return true for xls files, since FlexCel doesn't load tracking changes in xlsx files.
HasWebAddinTaskPanes Returns true if the file has any task pane web add-in. Note that this only applies to task pane addins. The content addins are just objects in the sheet.
RemoveWebAddin​Task​Panes | Removes all task pane web add-ins from the file. Note that this will only remove the task pane addins. You can remove the content addins by removing the corresponding objects in the sheet with DeleteObject(​​Int32)
GetCustomTableStyle Overloaded
 GetCustomTableStyle(String)
GetCustomTableStyle(Int32)
HasCustomTableStyle Returns true if the workbook has a custom table style with name "name".
SetCustomTableStyle Adds a new or replaces an existing table style.
RenameCustom​Table​Style Renames an existing custom table style. Note that this method won't change the table styles from existing tables from oldName to newName. So after renaming a table style, you should loop in all the tables in the workbook which use that table style, and manually rename their custom table styles too.
DeleteCustom​Table​Style Overloaded
 DeleteCustomTableStyle(Int32)
DeleteCustomTableStyle(String)
DeleteAllCustom​Table​Styles​InWorkbook Deletes all custom table styles in the workbook.
GetTable Overloaded
 GetTable(String)
GetTable(Int32)
GetTable(String, Boolean)
GetTableSheet Returns the sheet number of the table, or raises an exception if the table doesn't exist.
HasTable Returns true if the table exists in the file.
GetTableName If there is a table in the cell at (row, col) then this method will return the name of the table. If not it will return an empty string.
GetTableAtCell If there is a table in the cell at (row, col) then this method will return the table definition. If not it will return null.
AddTable Adds a table to the active sheet.
SetTable Changes an existing table. The table to change is given by the table name in aTable.
Note that this method won't change the name of the table. To do so, you need to call RenameTable
RenameTable Renames an existing table to a new name, renaming also all references to that table. Note that the final name of the table might not be the name you specified in newName, if newName already existed. You need to check the result of this method to know the actual name which the table was renamed to.
DeleteTable Deletes a table from the workbook, based on its name. Note that the table might not be in the active sheet.
Note also that this will only delete the table itself, but not the data inside.
DeleteAllTables​InSheet Removes all the tables in the active sheet. The contents are not removed, only the table itself.
PivotTableCount​InSheet Returns the number of pivot tables in the active sheet.
AddCustomXmlPart | Adds a custom XML part to the file, as described in https:​//​msdn.​microsoft.​com/​en-​us/​library/​bb608618.​aspx
RemoveCustomXmlPart | Deletes the part at the given position. ( 1 based)
GetCustomXmlPart | Returns the part at the given position. (1 based)
SetXmlMap Sets the XML Maps in the file. This is equivalent to going to the "Developer" tab in Excel and then clicking in Source in the XML section.

Set it to null to remove the XML Maps in the file.
GetXmlMap | Returns the XML Maps in the file if it has any, or null if there are no XML Maps. Note that the map returned is a copy, so modifying it won't modify the map in the file. To modify the map in the file you need to get it with GetXmlMap, modify it, then set it with SetXmlMap
GetEnumerator Returns an enumerator that allows you to loop on all cells in the active worksheet. Once you start the foreach loop, you might change the active sheet and it won't change inside the enumerator.

Properties

Name | Description
ActiveWindow | Gets or sets the active windows to which some sheet and workbook options like zoom will apply. (1 based) Note that spreadsheets normally have a single Window, so this value will most likely be 1 and should stay that way. If you are working with multiple spreadsheet windows, you can change this property to change the sheet options of a particular window. The properties that apply to a specific window and are affected by this property mention it on their docs.
WindowCount | Returns the number of windows in the file. Note that this isn't the sheet count, but the number of views of the workbook. Most Excel documents have only one window.
ActiveSheetFor​Active​Window | Gets or sets the active sheet for the ActiveWindow. Note that this won't change the active sheet for FlexCel when you enter a value, you still need to call ActiveSheet for that. This property will only change the sheet that is active in that window when you open the file in Excel. Setting this property will also unselect the other sheets. If you want to select multiple sheets, make sure to select them *after* setting the ActiveSheetFor​Active​Window.​
VirtualMode | Set this value to true to turn Virtual Mode on. Look at 'Virtual mode' in the Performance Guide for more information.
DefaultFileFormat | Determines the default file format used by Excel when saving a file without specifying one, and when the file format can't be determined from the extension of the file. If set to Automatic (The default) the file will be saved in the same format it was opened. That is, if you opened an xlsx file it will be saved as xlsx. If you opened an xls file (or created it with XlsFile.​New​File(​)​) it will be saved as xls. When this property is automatic, text files will be saved as xls.
ExcelVersion | Defines the Excel mode used in this thread. Note that while on v2007 (the default) you still can make xls 97 spreadsheets, so the only reason to change this setting is if you have any compatibility issues (for example your formulas depend on a sheet having 65536 rows). IMPORTANT: Do NOT change this value after reading a workbook. Also, remember that the value is changed for all the reports in all threads.
XlsBiffVersion | Xls files created by Excel 2007 have additional records that allow the generated file to store characteristics not available in Excel 2003 or older. (Like for example True color for cells instead of 54 colors). When opening an xls file created by Excel 2007 in Excel 2007, Excel will be able to read those values back. By default FlexCel will read those extra records and when reading, and identify the file it creates as created by Excel 2007 when writing, so when you open it in Excel 2007 it will read those additional records. If for any reason you prefer FlexCel to behave as Excel 2003, saving the files as if they were created by Excel 2003 (So Excel 2007 will ignore the additional characteristics), and also stop FlexCel from reading those extra records, just change the value of this property.
ExcelFileFormat | Empty files created by different versions of Excel can have different characteristics. For example, the default font in an Excel 2003 file is Arial, while the default in 2007 is Calibri, and in 2023 it is Aptos. This property returns the version of file that is loaded into FlexCel. When calling NewFile(​​Int32, TExcelFileFormat) or when opening a new file, FlexCel will update the value of this property.
XlsxExtraCompatibility | By default, FlexCel creates xlsx files that conform to the published xlsx spec, but are not necessarily the same as a file Excel would create. FlexCel might use different prefixes, etc, as the ones Excel choose to use. While this is ok, some third party tools might have problems opening the xlsx files if they are not exactly as Excel would create them. If you are having issues with third party tools and the xlsx files created by FlexCel, you can try setting this property to true. Note: setting this property to true might result in files that contain invalid Ids, because the Ids are used by FlexCel and Excel. This is a very unlikely possibility, but the risk is there. If possible, it is best to keep this property false.
XlsxCompatibility​Convert​Indexed​Colors​ToRGB | By default, if an xls or xlsx file has indexed colors or if you set an indexed color with the FlexCelAPI, FlexCel will save those colors as indexed in the final file. This is correct and the default, but LibreOffice/​Open​Office at the time of this writing (version 6.2) won't understand indexed colors in xlsx files. So if you have xlsx files with indexed colors that you want to display correctly in Libre/OpenOffice, you must turn this property on.
StrictOpenXml | Read this file to know if the xlsx file loaded by FlexCel is a normal xlsx file or a "Strict Open XML file". Set this property to make FlexCel save as strict or normal open xlsx file. This property has no effect in xls files, only in xlsx. If you are not sure about what a strict open xml file is, just keep this property false and FlexCel will output normal xlsx files. IMPORTANT:FlexCel works by preserving a lot of stuff it doesn't know about, and that stuff might be valid in normal files and invalid in strict files or vice-versa. So if you open an strict file and save it as normal, or open a normal file and save it as strict, it might happen that FlexCel preserves some records or namespaces that are not allowed in the new format. Given this, you shouldn't use this property to change the type of existing files, except for simple files or files that you created yourself with...[more]
KeepMaxRowsAnd​Columns​When​Updating | Defines what FlexCel will do when it finds a reference to the last row or column in an Excel 97-2003 spreadsheet, and it is upgrading to Excel 2007. If false (the default) row 65536 will be updated to row 1048576, and column 256 to column 16384. If true, references will stay the same. Note: This is a static global property, so it affects all threads running.
ActiveFileName | The file we are working on. When we save the file with another name, it changes. When we open a stream, it is set to "". This value is also used to get the text of Headers and Footers (when using the filename macro). When using the filename macro on headers/footers, make sure you set this value to what you want.
AllowOverwriting​Files | Determines if a call to "Save()" will automatically overwrite an existing file or not.
IsXltTemplate | Determines if the file is a template (xlt format instead of xls, xltx instead of xlsx, or xltm instead of xlsm). Both file formats are nearly identical, but there is an extra record needed so the file is a proper xlt template. Note that when saving to a file, FlexCel can detect if this is a template from the extension, and so if you save to *.xlt, *.xltx or *.xltm the file will be saved as template, even if this property is false. When saving to a stream, you need to set this property correctly because FlexCel can't guess it from the filename.
ActiveSheet | The Sheet where we are working on, 1-based(First sheet is 1, not 0). Always set this property before working on a file. You can read or write this value.
ActiveSheetByName | The sheet where we are working on, referred by name instead of by index. To change the active sheet name, use SheetName
SheetCount | The number of sheets on the file.
SheetCountVisible | Number of visible sheets in the file.
SheetName | Reads and changes the name of the active sheet. To switch to another sheet by its name, use ActiveSheetByName
SheetCodeName | Returns or sets the codename of a sheet, that is an unique identifier assigned to the sheet when it is created. Codenames are useful because they never change once the file is created, and they are what macros reference. Very important! We don't support changing codenames if the file has macros, because we can't modify the required macros to use the modified codename. Also, Excel 2003 or older will ignore the codename if the file doesn't have macros. Excel 2007 or newer will preserve the codenames even if the file doesn't have macros. ...[more]
SheetID | Returns an unique identifier for the active sheet. This is a value that is only used by FlexCel, and you can use it together with GetSheetIndexFromID to retrieve a sheet after deleting or adding sheets. While normally you can use ActiveSheet to store and retrieve a sheet, if you plan to delete or add sheets before restoring the active sheet, the stored ActiveSheet could become invalid. Note that this is a value internal for FlexCel, and not stored in the xls/x file. ...[more]
SheetVisible | Sets the visibility of the active sheet.
SheetZoom | Reads/Writes the zoom of the current sheet. Note that this property refers to the zoom in the current page view mode. If you are for example in Page Break Preview mode, this would be the zoom for Page Break Preview. You can change of page view mode and the zoom for all of the modes with SheetView This property can work in different windows depending on the value of ActiveWindow
FirstSheetVisible | This is the first sheet that will be visible in the bar of sheet tabs at the bottom. Normally you will want this to be 1. Note that every time you change ActiveSheet this value gets reset, because it makes no sense to preserve it. If you want to change it, change it before saving. The same way, to read it, read it just after opening the file. Please also note that if the first sheet you select is hidden, FlexCel will ignore this value and select a visible sheet. (otherwise Excel would crash) This property can work in different windows depending on the value of...[more]
SheetTabColor | Reads/Writes the color of the current sheet tab. TExcelColor.​Automatic to specify no color.
SheetView | Returns and sets the page view mode with their corresponding zooms. Note that changing the zoom here changes SheetZoom This property can work in different windows depending on the value of ActiveWindow
SheetIsRightToLeft | If true then the sheet goes from right to left, with A1 starting at the top right of the page. You can also set this option with SheetOptions
ShowGridLines | True if the gray grid lines are shown on the Active sheet. You can also set this option with SheetOptions This property can work in different windows depending on the value of ActiveWindow
ShowGridHeadings | True is the column headings ("A", "B", etc) and row headings ("1", "2", etc) are shown. You can also set this option with SheetOptions by changing TSheetOptions.​Show​RowAnd​Column​Headers This property can work in different windows depending on the value of ActiveWindow
ShowFormulaText | When true, the formula text will be displayed instead of the formula value. You can also set this option with SheetOptions This property can work in different windows depending on the value of ActiveWindow
GridLinesColor | Color of the grid separator lines. This property can work in different windows depending on the value of ActiveWindow
HideZeroValues | When true number 0 will be shown as empty. You can also set this option with SheetOptions This property can work in different windows depending on the value of ActiveWindow
SheetType | Use this property to know it the ActiveSheet is a worksheet, a chart sheet or other.
SheetOptions | This property groups a lot of properties of the sheet, like for example if it is showing formula texts or the results. Most of this properties can be changed directly from XlsFile, but this method allows you to change them all together, or to easily copy the options from one file to another. Look also at SheetWindowOptions for options that affect all sheets. This property can work in different windows depending on the value of ActiveWindow
SheetWindowOptions | This property groups a lot of properties of all the sheets in the workbook, like for example if the sheet tab bar at the bottom is visible. Look also at SheetOptions for options that affect only the active sheet. This property can work in different windows depending on the value of ActiveWindow
HPageBreakCount | The number of horizontal page breaks in the active sheet.
VPageBreakCount | The number of vertical page breaks in the active sheet.
AllowEntering​Empty​Strings | By default, FlexCel won't allow you to enter empty or null strings into a cell; it will create a blank record instead. If for any reason you need to enter actual empty strings (which might be confusing to the Excel user) set this property to true.
AllowEntering​Unknown​Functions​AndNames | Whenever you try to use an unknown function in a formula, like "=MYFUNCTION()", FlexCel will raise an Exception. Same happens with unknown names. This is normally the expected behavior, so you don't enter a misspelled name by mistake, and you can add used defined function to FlexCel so it understands it. But in some cases, you might want to allow any function to be entered, no matter if is known or not: Excel behaves this way. For those cases, set this property to true. The unknown functions will return #NAME? as formula result.
FormatCount | Number of custom formats defined in all the file. When calling GetFormat(XF), 0<​=XF<​Format​Count.​
GetDefaultFormat | Returns Excel standard format for an empty cell. (NORMAL format)
GetDefaultFormat​Normal​Style | Returns Excel standard format for the normal style. "Normal" style applies to the headers "A", "B" ... at the top of the columns and "1", "2"... at the left of the rows. This method is the same as calling xls.​Get​Style(​xls.​Get​Built​InStyle​Name(​TBuilt​InStyle.​Normal, 0)) You normally will want to use GetDefaultFormat instead of this method.
DefaultFormatId | Returns XF identifier for the style that applies to all empty cells. Note that this is different from the "Normal" style as defined inside Excel. This is a "Cell" format that can be applied to cells, while "Normal" is a "Style" format that is applied to this cell format.
FontCount | Number of fonts defined in all the sheet. When calling GetFont(​font​Index)​, 0<​=font​Index<​Format​Count.​
GetDefaultFont | Returns Excel standard font for an empty cell.
GetDefaultFont​Normal​Style | Returns Excel font for the "normal" style. This style is used to draw the row and column headings.
ConditionalFormat​Count | Returns the number of conditional format blocks on the list. You can use this value to loop on them and retrieve the individual ones with GetConditionalFormat
StyleCount | Returns the number of named styles in the file.
CellMergedListCount | For using with CellMergedList on a loop: for (int i=1;i <= CellMergedList​Count;​i+​+​) DoSomething(​Cell​Merged​List(​i)​)​.​.​.​
RowCount | Number of rows actually used on the sheet.
ColCount | Number of columns actually used on the active sheet, including formatted columns. You will normally want to use ColCountOnlyData instead. Note that this method is slow as it needs to loop over all the rows to find out the biggest used column. Never use it in a loop like "for (int col = 1; col <= xls.ColCount; col++)". Instead try to use ColCountInRow(​​Int32). If you *need* to use ColCount, cache its value first:...[more]
ColFormatCount | Returns the number of formatted columns in the file. Note that in xlsx files this number can be very big.
ColCountOnlyData | While ColCount will return the maximum column including both data and formatted columns, this method doesn't include formatted columns, only cells with data, and it is normally what you need to use. Important: This method includes blank formatted cells. See The Maximum Used Column On A Sheet
DefaultRowHeight | The default height for empty rows, in Excel internal units. (1/20th of a point). IMPORTANT: For this property to have any effect, you also need to set DefaultRowHeight​Automatic = false. To get the real default row height Excel will use when DefaultRowHeight​Automatic = true or DefaultRowHidden = true use DefaultRowHeight​Visual See Excel Internal Units ...[more]
DefaultRowHeight​Automatic | When this property is true, the row height for empty rows is calculated with the height of the "Normal" font and will change if you change the Normal style. When false, the value in DefaultRowHeight will be used.
DefaultRowHidden | When this property is true, rows with no data are hidden by default. Note that this property only affects the visibility of empty rows. If for example row 6 is empty and you have this property true, then row 6 will be hidden. But if you write any value in a cell in row 6, then the row won't be empty anymore, and it won't be hidden anymore either.
DefaultColWidth | The default width for empty columns, in Excel internal units. (Character width of font 0 / 256) See Excel Internal Units for more information in Excel internal units.
ColorPaletteCount | The number of entries on an Excel color palette. This is always 56.
GetUsedPaletteColors | Returns a list of the used colors on the palette. You can use it as an entry to NearestColor​Index(​​TUIColor) to modify the palette.
NamedRangeCount | The count of all named ranges on the file.
PageHeader | Page header on the active sheet. Note that this property sets the same header for the all the pages. In Excel 2007 or newer you can set a different header for the first page, or odd/even pages. If you want to control these options, see GetPageHeader​AndFooter and SetPageHeader​AndFooter. A page header is a string that contains the text for the 3 parts of the header. The Left section begins with &L, the Center section with &C and the Right with &R...[more]
PageFooter | Page footer on the active sheet. For a description on the format of the string, see PageHeader
PrintGridLines | True if the gray grid lines are printed when printing the spreadsheet.
PrintHeadings | When true the row and column labels (A,B...etc for columns, 1,2... for rows) will be printed.
PrintHCentered | When true the sheet will print horizontally centered on the page.
PrintVCentered | When true the sheet will print vertically centered on the page.
PrintToFit | If true, sheet will be configured to fit on PrintNumberOf​Horizontal​Pages x PrintNumberOf​Vertical​Pages.
PrintCopies | Number of copies to print.
PrintXResolution | Horizontal printer resolution on DPI.
PrintYResolution | Vertical printer resolution on DPI.
PrintOptions | All print options in a single place. You will normally want to set individual properties like PrintLandscape
PrintOptions​Initialized​From​Printer | If this property is false, then Excel has not read the printer options from the printer, and PrintLandscape, PrintPaperSize, PrintScale, PrintXResolution, PrintYResolution and PrintCopies will be ignored. This property will change automatically to true if you manually change any of the above properties.
PrintLandscape | If true, page will be printed landscape, else portrait. This property modifies PrintOptions
PrintBlackAndWhite | If true, page will be printed in "Excel Black and White". Important: This property doesn't mean that the file will be printed in black and white. Instead it means the option in the Page Setup dialog: https:​//​support.​microsoft.​com/​en-​us/​office/​page-​setup-​71c20d94-​b13e-​48fd-​9800-​cedd1fec6da3 Basically, when you select this option no background will be printed, and all foreground colors will be black. So if you have a cell with a black background and a white font, it will print as white background with a black font. ...[more]
PrintOverThenDown | If true, the pages will be printed to the right, then down. Otherwise pages will be printed down, then to the right. This property modifies PrintOptions
PrintDraftQuality | If true, the pages will be printed in draft quality. This property modifies PrintOptions
PrintScale | Percent to grow/shrink the sheet when printing. 100 means a page scale of 100%.
PrintFirstPageNumber | Page number that will be assigned to the first sheet when printing. (So it will show in page headers/footers). You might set this value to null to keep the page automatic. Also, the value returned here will be null it this value is not set (Set to Automatic)
PrintNumberOf​Horizontal​Pages | If set, the sheet will be printed on at most this number of horizontal pages. Use 0 to have unlimited horizontal pages while still limiting the vertical pages with PrintNumberOf​Vertical​Pages. (see 'Preparing for printing' in the Api Developer Guide)
PrintNumberOf​Vertical​Pages | If set, the sheet will be printed on at most this number of vertical pages. Use 0 to have unlimited vertical pages while still limiting the horizontal pages with PrintNumberOf​Horizontal​Pages. (see 'Preparing for printing' in the Api Developer Guide)
PrintPaperSize | Pre-defined standard paper size. If you want to set up a printer specific paper size, see SetPrinterDriver​Settings
PrintPaperDimensions | Returns the dimensions for the selected paper. See also PrintPaperSize.
PrintErrors | Determines how the errors will be printed.
PrintComments | Determines how the comments will be printed.
ImageCount | The number of images in the active sheet.
ObjectCount | Count of all graphical objects on the sheet. They can be charts, images, shapes, etc.
IsLightClone | Returns true if this object was created with a LightClone call. Light Cloned objects share the data with another file, and they don't switch the selected sheet in the Excel file when changing ActiveSheet
DataValidationCount | Returns the number of DataValidation structures in the active sheet. There are 2 ways you can access the data validation information on a sheet:...[more]
HyperLinkCount | The count of hyperlinks on the active sheet
OutlineSummary​Rows​Below​Detail | Determines whether the summary rows should be below or above details on outline.
OutlineSummary​Cols​Right​ToDetail | Determines whether the summary columns should be right to or left to the details on outline.
OutlineAutomatic​Styles | This handles the setting of Automatic Styles inside the outline options.
Protection | Protection data for the file. Modify its properties to open and read encrypted files.
DocumentProperties | Document properties for the file. With this object you can read the properties (Author, Title, etc.) of a file.
ChartCount | Returns the count of charts on this sheet. Please take note that this method will not return the number of embedded objects with charts inside in a sheet, but just the number of charts in the sheet. In simpler terms, this method will return 0 for all worksheets, and 1 for all chart sheets. This is not a very useful method, but it needs to be this way to be consistent with GetChart. So, looping like this:...[more]
OptionsDates1904 | Excel has 2 different date systems. On windows systems it uses 1900 based dates, and on old Macintosh systems it uses 1904 dates. You can change this on Excel under Options, and this property allows you to know and change which format is being used. See https:​//​support.​microsoft.​com/​en-​us/​help/​214330/​differences-​between-​the-​1900-​and-​the-​1904-​date-​system-​in-​excel
OptionsR1C1 | Use this property to change the reference system used in the file. Note that this option only changes how Excel and FlexCel will display the file. Internally, the formulas will always be stored in A1 format, and converted by Excel to and from R1C1 if this property is true. FlexCel will also use this property to render the file when it is set to print formulas. Also, this property doesn't change how FlexCel will parse or return the formula text in the cells or names. By default, even if this property is true, you will need to enter the formulas in FlexCel in A1 mode. To change the entry mode in FlexCel, please use...[more]
OptionsSaveExternal​Link​Values | This property has the value of the corresponding option on Excel options.
OptionsPrecision​AsDisplayed | This property has the value of the corresponding option on Excel options.
OptionsMultithread​Recalc | Number of threads that can be used at the same time by Excel when recalculating. Set it to 0 to disable multithread recalculation, and to -1 to let Excel decide the best number of threads to use. The maximum value for this property is 1024. This option only applies to Excel 2007 or newer.
OptionsForce​Full​Recalc | If true, Excel will do full recalculations of the spreadsheet when you change a cell. If false, only the cells that depend on the cell being changed will be recalculated. This option only applies to Excel 2007 or newer.
OptionsFullRecalc​OnLoad | This property tells you if the open file wasn't recalculated when saved. If true, the workbook doesn't have recalculated values and will be recalculated when open in Excel. This option only applies to xlsx files. Note that if you open a file which has FullRecalcOnLoad = true in FlexCel, recalculate it and save it, FlexCel will save the file with FullRecalcOnLoad = false. To change what FlexCel writes in FullRecalcOnLoad when saving, change OptionsFullRecalc​OnLoad​Mode ...[more]
OptionsFullRecalc​OnLoad​Mode | Defines how FlexCel will identify the files it creates to be calculated by Excel when it opens them.
OptionsRecalc​Circular​References | If true, Excel and FlexCel will do iterative calculating over cells with circular references, until OptionsRecalc​MaxIterations is reached or the difference is less than OptionsRecalc​MaxChange
OptionsRecalc​MaxIterations | Maximum number of iterations when calculating circular references (OptionsRecalc​Circular​References is true),
OptionsRecalc​MaxChange | Maximum difference between 2 iterations when calculating circular references (OptionsRecalc​Circular​References is true),
OptionsAutoCompress​Pictures | If true, Excel will try to compress the pictures to keep sizes down. This option only applies to Excel 2007 or newer.
OptionsCheck​Compatibility | Whether the "Check for compatibility" dialog will pop up when saving as xls in Excel 2007 or newer. This option only applies to Excel 2007 or newer. Important: When this option is true, Excel will refuse to enable "Autosave" and upload the files to OneDrive (Autosave is the first option in the title bar in Excel 2019). If true, you will get a message: "How do I turn on Autosave? Before Autosave can save your file, you need to fix the following: This file was created in an older file format. Please select File > Save As to update the file format."...[more]
OptionsForce​UseCheck​Compatibility | When the option OptionsCheck​Compatibility is true, Excel will refuse to austosave the file. To avoid a confusing situation where Excel refuses to autosave the file and shows a vague warning about an "older file format", OptionsCheck​Compatibility is ignored by FlexCel. In order to force FlexCel to save OptionsCheck​Compatibility to the file (thus disabling the "Autosave" function) you need to set this property to true besides...[more]
OptionsBackup | Defines whether to save a backup copy of the workbook or not.
OptionsRecalcMode | Reads and writes the recalculating options in the file. Note that this only affects the file and how Excel will recalculate, not how FlexCel does its recalculation. FlexCel ignores this setting and uses RecalcMode instead.
RecalcMode | Set this property to change how the file will be recalculated. Note that this affects only how FlexCel recalculates the file, but not how Excel will recalculate it. It doesn't change anything in the generated file. To change the options for the file, use OptionsRecalcMode instead.
CellStackTrace​MaxSize | Defines what is the maximum number of entries returned in the stack trace when calling RecalcAndVerify. In order to keep the stack trace not too big this number is limited, but if you need a bigger stack trace to see the full loop of cells you can increase this number. Note that if you want to calculate linked files, you need to set the property TWorkspace.​Cell​Stack​Trace​MaxSize instead and it will affect all workbooks.
RecalcVersion | Defines which version of Excel recalculation engine will be saved in the file. This affects how Excel will recalculate the file on open. If you set this property for example to Excel2007, then any Excel version newer than Excel 2007 will recalculate all formulas when you load the file, so it will modify the workbook and will ask for saving changes when closing. Even if you just open and close the file. Note that this will only happen if there are formulas on the sheet. If there are any formulas that FlexCel can't recalculate, you should set this property to AlwaysRecalc. For example, if you have the formula:...[more] ...[more]
NeedsRecalc | True if the file has been modified after loading.
FileNeedsRecalc | If true, the file has been modified and not recalculated after load.
Recalculating | Returns true if the workbook is being recalculated.
LinkCount | Returns the number of external links for the file. You can access those links with GetLink and SetLink
SemiAbsolute​References | When this property is false, inserting and copying ranges will behave the same as it does in Excel. When this property is true, absolute references to cells inside the block being copied will be treated as relative. For example, if you have:...[more]
FormulaReference​Style | Specifies which reference style to use when entering formulas: A1 or R1C1. Note that this property is different from OptionsR1C1. OptionsR1C1 modifies a property of the file, that handles how references will show in Excel. This property modifies how FlexCel parses or returns the formulas, and has no effect at all in the file generated. Also note that R1C1 and A1 modes are completely equivalent, and formulas are always stored as A1 inside the generated files. This property only affects the parsing of the formulas, the file generated will be exactly the same no matter the value of this property. And Excel will show it in A1 or R1C1 mode depending only in...[more]
ErrorActions | Determines if FlexCel will throw Exceptions or just ignore errors on specific situations. If you are trying to recover corrupt files, you might also want to check RecoveryMode
RecoveryMode | When this property is set to true, FlexCel will try to open corrupt files ignoring most of what can be ignored. Note that FlexCel is not a recovery tool and that this property might be able or not to open a corrupt file. Also, even if you are able to open the file with FlexCel, when you save the corrupt file, it might stay corrupt. FlexCel saves back as much as it can from the original file in order to preserve them, and this means it might save the corrupt parts too. Note that when opening a file in recovery mode, the value of...[more]
FileFormatWhenOpened | Returns the file format that the file had when it was opened. If the file was created with NewFile, the file format when opened is xls.
WidthCorrection | Factor to multiply default column widths. See remarks for a detailed explanation.
HeightCorrection | Factor to multiply default row heights. See remarks for a detailed explanation.
Linespacing | A Linespacing of 1 means use the standard GDI+ linespace when a cell has more than one line. A linespace of 2 would mean double linespacing, and 0.5 would mean half linespacing. Normally linespacing in Excel is a little bigger than linespacing in GDI+, so you can use this property to fine tune what you need. This property doesn't alter the Excel file in any way. It is only used when rendering.
CellMarginFactor | This property can be used to add a margin to the cells when rendering, so text is rendered smaller and can have more line breaks. The default value of 1.0 means normal cells. The bigger this value, the bigger the margins and the smaller the real cell width for rendering the text. You might want to make this value a little larger than 1 if autofitting and Excel is wrapping text that FlexCel fits into one line.
CellIndentation​Rendering | Excel doesn't adapt the cell indentation when changing the print scale. This means that if a cell indentation is 0.1 inches at 100% print scale, it will also be 0.1 inches at 50% print scale. This will break the layout of your files when changing the print scaling, and so by default FlexCel won't behave like Excel here and make the indentation half the size if printing at half the scale. If you want to mimic the exact Excel behavior, set this property to true. See 'Cell indentation' in the Api Developer Guide ...[more]
HeadingColWidth | Width that will be used by the added column with row numbers when PrintHeadings is true. The default value (0) means to use an automatic value which is fine if you don't have too many rows to print. A positive value will make the column wider or narrower. A negative value will auto-calculate the width depending in the number of rows and normal font of the spreadsheet.
HeadingRowHeight | Height that will be used by the added row with column headers when PrintHeadings is true. The default value (0) means to use an automatic value which is fine with normal fonts. A positive value will make the column wider or narrower.A negative value will auto-calculate the height depending in the normal font of the spreadsheet.
DpiForImages | Allows you to change the dpi for vector images (metafiles) when they are rasterized for converting to PDF / HTML / etc. Note that this is a static setting and will affect all files. This setting is the same as FlexCelConfig.​Dpi​ForImages.​
XlsxCompressionLevel | Zip compression level when creating xlsx files. Xlsx files are zip files, and you can compress more or less by trading speed for file size. The faster you can create the file, the bigger the xlsx files created will be. Excel by default uses "Fastest" compression level and we use "Default". Normally using compression levels more than default is not worth it, since the files will take a lot longer to be created, and the size reduction will be very small.
ScreenScaling | This property lets you specify the screen scaling that FlexCel will assume for reading xlsx files in percent. (default is 100 which means 100%). The values can be between 100 and 500. Column widths in xlsx files which don't have a fixed column width set will be different in different screen resolutions. So we need to know which resolution to emulate in order to read those files correctly. You will probably want to leave this property to the default value of 100, but you can change it if needed. ...[more]
IgnoreFormulaText | This is an optimization property. If you set it to true, methods like GetCellValue or GetNamedRange won't return the formula text, just the formula results. If you don't care about formula texts, setting this property to true can speed up the processing of huge files.
CustomTableStyle​Count | Returns the number of custom tables styles defined in the workbook.
TableCountInWorkbook | Returns the number of tables in the whole workbook. (Not just the active sheet)
TableCountInSheet | Returns the number of tables in the active sheet. Use GetTable(​​Int32) to retrieve the tables in the sheet.
CustomXmlPartCount | Returns the number of custom xml parts in the active document.

Events

Name | Description
VirtualCellRead | If you assign this event FlexCel will not load the file into memory when opening a file, allowing you to open very big files using little memory. This event will be called for every value read from the file, and then the value will be discarded, instead of loaded into memory. Look at 'Virtual mode' in the Performance Guide for more information.
VirtualCellStart​Reading | When in virtual mode (VirtualCellRead is assigned) this event will be called after the sheet names have been read, but before starting to read the cells. You can use this event to know how many sheets you are reading.
VirtualCellEnd​Reading | When in virtual mode (VirtualCellRead is assigned) this event will be called after the file has been processed. You can use it to do cleanup.


ExcelFile.FIsLightClone Field | FlexCel Studio for the .NET Framework documentation

ExcelFile.FIsLightClone Field

If true, this class was created by cloning another. This field is only used when creating a descendant of this class. For normal cases use IsLightClone

Syntax

Namespace: FlexCel.Core

protected Boolean FIsLightClone

See also

  • ExcelFile


ExcelFile.SupportsXlsx Field | FlexCel Studio for the .NET Framework documentation

ExcelFile.SupportsXlsx Field

This property lets you know if the version of FlexCel.dll you are using supports XLSX file format. Currently XLSX is supported in all versions.

Syntax

Namespace: FlexCel.Core

public static readonly Boolean SupportsXlsx

See also

  • ExcelFile


ExcelFile.ExcelFile Constructor | FlexCel Studio for the .NET Framework documentation

ExcelFile.ExcelFile Constructor

Initializes ExcelFile fields.

Syntax

Namespace: FlexCel.Core

protected ExcelFile()

See also

  • ExcelFile


ExcelFile.EncodingNotNull Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.EncodingNotNull Method

Returns UTF8 if the parameter is null.

Syntax

Namespace: FlexCel.Core

protected static Encoding EncodingNotNull(Encoding enc)

Parameters

<-> | Parameter | Type | Description
 | enc | Encoding |

See also

  • ExcelFile


ExcelFile.CheckRangeObjPathOrImageIndex Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.CheckRangeObjPathOrImageIndex Method

Checks that a range or path are between bounds. Internal use.

Syntax

Namespace: FlexCel.Core

protected void CheckRangeObjPathOrImageIndex(Int32 imageIndex, Boolean usesObjectIndex, String objectPath)

Parameters

<-> | Parameter | Type | Description
 | imageIndex | Int32 |
 | usesObjectIndex | Boolean |
 | objectPath | String |

See also

  • ExcelFile


ExcelFile.AddWindow Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.AddWindow Method

Adds a new window to the file. Note that this isn't a new sheet, but another view of the workbook. Most Excel documents have only one window.

Syntax

Namespace: FlexCel.Core

public abstract void AddWindow()

See also

  • ExcelFile


ExcelFile.DeleteWindow Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.DeleteWindow Method

Deletes a window from the file. Note that this isn't a sheet, but another view of the workbook. Most Excel documents have only one window.

Syntax

Namespace: FlexCel.Core

public abstract void DeleteWindow(Int32 windowIndex)

Parameters

<-> | Parameter | Type | Description
 | windowIndex | Int32 | Index of the window to delete (1-based)

See also

  • ExcelFile


ExcelFile.OnVirtualCellRead Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.OnVirtualCellRead Method

Replace this method if you want to override this event in a derived class.

Syntax

Namespace: FlexCel.Core

protected internal virtual void OnVirtualCellRead(ExcelFile xls, VirtualCellReadEventArgs e)

Parameters

<-> | Parameter | Type | Description
 | xls | ExcelFile |
 | e | VirtualCellRead​Event​Args |

See also

  • ExcelFile


ExcelFile.OnVirtualCellStartReading Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.OnVirtualCellStartReading Method

Replace this method if you want to override this event in a derived class.

Syntax

Namespace: FlexCel.Core

protected internal virtual void OnVirtualCellStartReading(ExcelFile xls, VirtualCellStartReadingEventArgs e)

Parameters

<-> | Parameter | Type | Description
 | xls | ExcelFile |
 | e | VirtualCellStart​Reading​Event​Args |

See also

  • ExcelFile


ExcelFile.OnVirtualCellEndReading Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.OnVirtualCellEndReading Method

Replace this method if you want to override this event in a derived class.

Syntax

Namespace: FlexCel.Core

protected internal virtual void OnVirtualCellEndReading(ExcelFile xls, VirtualCellEndReadingEventArgs e)

Parameters

<-> | Parameter | Type | Description
 | xls | ExcelFile |
 | e | VirtualCellEnd​Reading​Event​Args |

See also

  • ExcelFile


ExcelFile.NewFile Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.NewFile Method

Overloads

  • ExcelFile.NewFile
  • ExcelFile.NewFile(Int32)
  • ExcelFile.NewFile(Int32, TExcelFileFormat)

ExcelFile.NewFile

Creates a new empty file, with 3 empty sheets.

Remarks

The file created will have empty properties, (author, description, etc). If you want to create a more personalized file when you call NewFile (for example with a given Author, or the sheets names on your language), there are 2 options:

  1. Don't use NewFile, but open an existing file you can modify.
  2. Or, you can replace the file "EmptyWorkbook.xls" (on xlsadapter folder) with your own and recompile.

Syntax

Namespace: FlexCel.Core

public void NewFile()

See also

  • ExcelFile

ExcelFile.NewFile(Int32)

Creates a new empty file, with the specified number of sheets.

Remarks

The file created will have empty properties, (author, description, etc). If you want to create a more personalized file when you call NewFile (for example with a given Author, or the sheets names on your language), there are 2 options:

  1. Don't use NewFile, but open an existing file you can modify.
  2. Or, you can replace the files "EmptyWorkbook.xls", "EmptyWorkbook2007.xls" and "EmptyWorkbook2010.xls" (on xlsadapter folder) with your own and recompile.

Syntax

Namespace: FlexCel.Core

public void NewFile(Int32 aSheetCount)

Parameters

<-> | Parameter | Type | Description
 | aSheetCount | Int32 | Number of sheets for the new file.

See also

  • ExcelFile

ExcelFile.NewFile(Int32, TExcelFileFormat)

Creates a new empty file, with the specified number of sheets.

Remarks

The file created will have empty properties, (author, description, etc). If you want to create a more personalized file when you call NewFile (for example with a given Author, or the sheets names on your language), there are 2 options:

  1. Don't use NewFile, but open an existing file you can modify.
  2. Or, you can replace the files "EmptyWorkbook.xls", "EmptyWorkbook2007.xls" and "EmptyWorkbook2010.xls" (on xlsadapter folder) with your own and recompile.

Syntax

Namespace: FlexCel.Core

public abstract void NewFile(Int32 aSheetCount, TExcelFileFormat fileFormat)

Parameters

<-> | Parameter | Type | Description
 | aSheetCount | Int32 | Number of sheets for the new file.
 | fileFormat | TExcelFileFormat | Different Excel versions save different empty files. By default, FlexCel will create a new file that looks like a file created by Excel 2003, but you can change the version of the new file created with this parameter.

See also

  • ExcelFile


ExcelFile.Open Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.Open Method

Overloads

  • ExcelFile.Open(String)
  • ExcelFile.Open(Stream)
  • ExcelFile.Open(String, TFileFormats, Char, Int32, Int32, ColumnImportType[])
  • ExcelFile.Open(Stream, TFileFormats, Char, Int32, Int32, ColumnImportType[])
  • ExcelFile.Open(Stream, TFileFormats, Char, Int32, Int32, ColumnImportType[], Boolean)
  • ExcelFile.Open(String, TFileFormats, Char, Int32, Int32, ColumnImportType[], Encoding, Boolean)
  • ExcelFile.Open(Stream, TFileFormats, Char, Int32, Int32, ColumnImportType[], Encoding, Boolean)
  • ExcelFile.Open(String, TFileFormats, Char, Int32, Int32, ColumnImportType[], String[], Encoding, Boolean)
  • ExcelFile.Open(Stream, TFileFormats, Char, Int32, Int32, ColumnImportType[], String[], Encoding, Boolean)

ExcelFile.Open(String)

Loads a new Spreadsheet from disk.

Syntax

Namespace: FlexCel.Core

public void Open(String fileName)

Parameters

<-> | Parameter | Type | Description
 | fileName | String | File to open.

See also

  • ExcelFile

ExcelFile.Open(Stream)

Loads a new Spreadsheet from a stream.

Syntax

Namespace: FlexCel.Core

public void Open(Stream aStream)

Parameters

<-> | Parameter | Type | Description
 | aStream | Stream | Stream to Load, must be a seekable stream. Verify it is on the correct position.

See also

  • ExcelFile

ExcelFile.Open(String, TFileFormats, Char, Int32, Int32, ColumnImportType[])

Loads a new Spreadsheet from disk, on one of the specified formats.

Syntax

Namespace: FlexCel.Core

public void Open(String fileName, TFileFormats fileFormat, Char delimiter, Int32 firstRow, Int32 firstCol, ColumnImportType[] columnFormats)

Parameters

<-> | Parameter | Type | Description
 | fileName | String | File to open
 | fileFormat | TFileFormats | List with possible file formats to try
 | delimiter | Char | Delimiter used to separate columns, if the format is TFileFormats.Text
 | firstRow | Int32 | First row where we will copy the cells on the new sheet, for TFileFormats.Text
 | firstCol | Int32 | First column where we will copy the cells on the new sheet, for TFileFormats.Text
 | columnFormats | ColumnImportType[] | An array of ColumnImportType elements, telling how each column should be imported.

See also

  • ExcelFile

ExcelFile.Open(Stream, TFileFormats, Char, Int32, Int32, ColumnImportType[])

Loads a new Spreadsheet from a stream, on one of the specified formats.

Syntax

Namespace: FlexCel.Core

public void Open(Stream aStream, TFileFormats fileFormat, Char delimiter, Int32 firstRow, Int32 firstCol, ColumnImportType[] columnFormats)

Parameters

<-> | Parameter | Type | Description
 | aStream | Stream | Stream to open, must be a seekable stream. Verify it is on the correct position.
 | fileFormat | TFileFormats | List with possible file formats to try.
 | delimiter | Char | Delimiter used to separate columns, if the format is TFileFormats.Text
 | firstRow | Int32 | First row where we will copy the cells on the new sheet, for TFileFormats.Text
 | firstCol | Int32 | First column where we will copy the cells on the new sheet, for TFileFormats.Text
 | columnFormats | ColumnImportType[] | An array of ColumnImportType elements, telling how each column should be imported. See the example for more information on how to use it.

Examples

Imagine you have a file with 20 columns, and column 2 has numbers you want to be imported as text (like phone numbers), and you don't want to import column 10.

You can use the following code to do it:

    ColumnImportType[] ColTypes = new ColumnImportType[10]; //You just need to define 10 items, all other columns after 10 will be imported with default formatting.
    ColTypes[1] = ColumnImportType.Text; //Import whatever is in column 2 as text.
    ColTypes[9] = ColumnImportType.Skip; //don't import column 10.

    ExcelFile xls = new XlsFile(true); //Create a new file.
    xls.Open("csv.csv", TFileFormats.Text, ',', 1, 1, ColTypes); //Import the csv text.

See also

  • ExcelFile

ExcelFile.Open(Stream, TFileFormats, Char, Int32, Int32, ColumnImportType[], Boolean)

Loads a new Spreadsheet from a stream, on one of the specified formats.

Syntax

Namespace: FlexCel.Core

public void Open(Stream aStream, TFileFormats fileFormat, Char delimiter, Int32 firstRow, Int32 firstCol, ColumnImportType[] columnFormats, Boolean detectEncodingFromByteOrderMarks)

Parameters

<-> | Parameter | Type | Description
 | aStream | Stream | Stream to open, must be a seekable stream. Verify it is on the correct position.
 | fileFormat | TFileFormats | List with possible file formats to try.
 | delimiter | Char | Delimiter used to separate columns, if the format is TFileFormats.Text
 | firstRow | Int32 | First row where we will copy the cells on the new sheet, for TFileFormats.Text
 | firstCol | Int32 | First column where we will copy the cells on the new sheet, for TFileFormats.Text
 | columnFormats | ColumnImportType[] | An array of ColumnImportType elements, telling how each column should be imported. See the example for more information on how to use it.
 | detectEncodingFromByteOrderMarks | Boolean | This parameter only applies when reading Text files. It is the same on the constructor of a StreamReader, and it says if BOM must be used at the beginning of the file. It defaults to true.

Examples

Imagine you have a file with 20 columns, and column 2 has numbers you want to be imported as text (like phone numbers), and you don't want to import column 10.

You can use the following code to do it:

    ColumnImportType[] ColTypes = new ColumnImportType[10]; //You just need to define 10 items, all other columns after 10 will be imported with default formatting.
    ColTypes[1] = ColumnImportType.Text; //Import whatever is in column 2 as text.
    ColTypes[9] = ColumnImportType.Skip; //don't import column 10.

    ExcelFile xls = new XlsFile(true); //Create a new file.
    xls.Open("csv.csv", TFileFormats.Text, ',', 1, 1, ColTypes); //Import the csv text.

See also

  • ExcelFile

ExcelFile.Open(String, TFileFormats, Char, Int32, Int32, ColumnImportType[], Encoding, Boolean)

Loads a new Spreadsheet from disk, on one of the specified formats.

Syntax

Namespace: FlexCel.Core

public void Open(String fileName, TFileFormats fileFormat, Char delimiter, Int32 firstRow, Int32 firstCol, ColumnImportType[] columnFormats, Encoding fileEncoding, Boolean detectEncodingFromByteOrderMarks)

Parameters

<-> | Parameter | Type | Description
 | fileName | String | File to open
 | fileFormat | TFileFormats | List with possible file formats to try
 | delimiter | Char | Delimiter used to separate columns, if the format is TFileFormats.Text
 | firstRow | Int32 | First row where we will copy the cells on the new sheet, for TFileFormats.Text
 | firstCol | Int32 | First column where we will copy the cells on the new sheet, for TFileFormats.Text
 | columnFormats | ColumnImportType[] | An array of ColumnImportType elements, telling how each column should be imported.
 | fileEncoding | Encoding | Encoding used by the file we are reading, when opening a Text-delimited file (csv or txt). If you specify an encoding for xls95 files, it will overwrite the default encoding specified in the file, and this can be used to read buggy or corrupted xls95 files. But in general for xls95 you should keep this parameter null. This parameter has no effect on xls 97 files or xlsx. If null when reading text files, it is assumed to be Encoding.UTF8.
 | detectEncodingFromByteOrderMarks | Boolean | This parameter only applies when reading Text files. It is the same on the constructor of a StreamReader, and it says if BOM must be used at the beginning of the file. It defaults to true.

See also

  • ExcelFile

ExcelFile.Open(Stream, TFileFormats, Char, Int32, Int32, ColumnImportType[], Encoding, Boolean)

Loads a new Spreadsheet from a stream, on one of the specified formats.

Syntax

Namespace: FlexCel.Core

public void Open(Stream aStream, TFileFormats fileFormat, Char delimiter, Int32 firstRow, Int32 firstCol, ColumnImportType[] columnFormats, Encoding fileEncoding, Boolean detectEncodingFromByteOrderMarks)

Parameters

<-> | Parameter | Type | Description
 | aStream | Stream | Stream to open, must be a seekable stream. Verify it is on the correct position.
 | fileFormat | TFileFormats | List with possible file formats to try.
 | delimiter | Char | Delimiter used to separate columns, if the format is TFileFormats.Text
 | firstRow | Int32 | First row where we will copy the cells on the new sheet, for TFileFormats.Text
 | firstCol | Int32 | First column where we will copy the cells on the new sheet, for TFileFormats.Text
 | columnFormats | ColumnImportType[] | An array of ColumnImportType elements, telling how each column should be imported. See the example for more information on how to use it.
 | fileEncoding | Encoding | Encoding used by the file we are reading, when opening a Text-delimited file (csv or txt). If you specify an encoding for xls95 files, it will overwrite the default encoding specified in the file, and this can be used to read buggy or corrupted xls95 files. But in general for xls95 you should keep this parameter null. This parameter has no effect on xls 97 files or xlsx. If null when reading text files, it is assumed to be Encoding.UTF8.
 | detectEncodingFromByteOrderMarks | Boolean | This parameter only applies when reading Text files. It is the same on the constructor of a StreamReader, and it says if BOM must be used at the beginning of the file. It defaults to true.

Examples

Imagine you have a file with 20 columns, and column 2 has numbers you want to be imported as text (like phone numbers), and you don't want to import column 10.

You can use the following code to do it:

    ColumnImportType[] ColTypes = new ColumnImportType[10]; //You just need to define 10 items, all other columns after 10 will be imported with default formatting.
    ColTypes[1] = ColumnImportType.Text; //Import whatever is in column 2 as text.
    ColTypes[9] = ColumnImportType.Skip; //don't import column 10.

    ExcelFile xls = new XlsFile(true); //Create a new file.
    xls.Open("csv.csv", TFileFormats.Text, ',', 1, 1, ColTypes); //Import the csv text.

See also

  • ExcelFile

ExcelFile.Open(String, TFileFormats, Char, Int32, Int32, ColumnImportType[], String[], Encoding, Boolean)

Loads a new Spreadsheet from disk, on one of the specified formats.

Syntax

Namespace: FlexCel.Core

public abstract void Open(String fileName, TFileFormats fileFormat, Char delimiter, Int32 firstRow, Int32 firstCol, ColumnImportType[] columnFormats, String[] dateFormats, Encoding fileEncoding, Boolean detectEncodingFromByteOrderMarks)

Parameters

<-> | Parameter | Type | Description
 | fileName | String | File to open
 | fileFormat | TFileFormats | List with possible file formats to try
 | delimiter | Char | Delimiter used to separate columns, if the format is TFileFormats.Text
 | firstRow | Int32 | First row where we will copy the cells on the new sheet, for TFileFormats.Text
 | firstCol | Int32 | First column where we will copy the cells on the new sheet, for TFileFormats.Text
 | columnFormats | ColumnImportType[] | An array of ColumnImportType elements, telling how each column should be imported.
 | dateFormats | String[] | A list of formats allowed for dates and times, when opening text files. Windows is a little liberal in what it thinks can be a date, and it can convert things like "1.2" into dates. By setting this property, you can ensure the dates are only in the formats you expect. If you leave it null, we will trust "DateTime.TryParse" to guess the correct values. This value has no meaning in normal xls files, only text files.
 | fileEncoding | Encoding | Encoding used by the file we are reading, when opening a Text-delimited file (csv or txt). If you specify an encoding for xls95 files, it will overwrite the default encoding specified in the file, and this can be used to read buggy or corrupted xls95 files. But in general for xls95 you should keep this parameter null. This parameter has no effect on xls 97 files or xlsx. If null when reading text files, it is assumed to be Encoding.UTF8.
 | detectEncodingFromByteOrderMarks | Boolean | This parameter only applies when reading Text files. It is the same on the constructor of a StreamReader, and it says if BOM must be used at the beginning of the file. It defaults to true.

See also

  • ExcelFile

ExcelFile.Open(Stream, TFileFormats, Char, Int32, Int32, ColumnImportType[], String[], Encoding, Boolean)

Loads a new Spreadsheet from a stream, on one of the specified formats.

Syntax

Namespace: FlexCel.Core

public abstract void Open(Stream aStream, TFileFormats fileFormat, Char delimiter, Int32 firstRow, Int32 firstCol, ColumnImportType[] columnFormats, String[] dateFormats, Encoding fileEncoding, Boolean detectEncodingFromByteOrderMarks)

Parameters

<-> | Parameter | Type | Description
 | aStream | Stream | Stream to open, must be a seekable stream. Verify it is on the correct position.
 | fileFormat | TFileFormats | List with possible file formats to try.
 | delimiter | Char | Delimiter used to separate columns, if the format is TFileFormats.Text
 | firstRow | Int32 | First row where we will copy the cells on the new sheet, for TFileFormats.Text
 | firstCol | Int32 | First column where we will copy the cells on the new sheet, for TFileFormats.Text
 | columnFormats | ColumnImportType[] | An array of ColumnImportType elements, telling how each column should be imported. See the example for more information on how to use it.
 | dateFormats | String[] | A list of formats allowed for dates and times, when opening text files. Windows is a little liberal in what it thinks can be a date, and it can convert things like "1.2" into dates. By setting this property, you can ensure the dates are only in the formats you expect. If you leave it null, we will trust "DateTime.TryParse" to guess the correct values. This value has no meaning in normal xls files, only text files.
 | fileEncoding | Encoding | Encoding used by the file we are reading, when opening a Text-delimited file (csv or txt). If you specify an encoding for xls95 files, it will overwrite the default encoding specified in the file, and this can be used to read buggy or corrupted xls95 files. But in general for xls95 you should keep this parameter null. This parameter has no effect on xls 97 files or xlsx. If null when reading text files, it is assumed to be Encoding.UTF8.
 | detectEncodingFromByteOrderMarks | Boolean | This parameter only applies when reading Text files. It is the same on the constructor of a StreamReader, and it says if BOM must be used at the beginning of the file. It defaults to true.

Examples

Imagine you have a file with 20 columns, and column 2 has numbers you want to be imported as text (like phone numbers), and you don't want to import column 10.

You can use the following code to do it:

    ColumnImportType[] ColTypes = new ColumnImportType[10]; //You just need to define 10 items, all other columns after 10 will be imported with default formatting.
    ColTypes[1] = ColumnImportType.Text; //Import whatever is in column 2 as text.
    ColTypes[9] = ColumnImportType.Skip; //don't import column 10.

    ExcelFile xls = new XlsFile(true); //Create a new file.
    xls.Open("csv.csv", TFileFormats.Text, ',', 1, 1, ColTypes); //Import the csv text.

See also

  • ExcelFile


ExcelFile.Import Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.Import Method

Overloads

  • ExcelFile.Import(TextReader, Int32, Int32, Int32[], ColumnImportType[])
  • ExcelFile.Import(TextReader, Int32, Int32, Int32[], ColumnImportType[], String[])
  • ExcelFile.Import(String, Int32, Int32, Char, ColumnImportType[], Encoding, Boolean)
  • ExcelFile.Import(Stream, Int32, Int32, Char, ColumnImportType[], Encoding, Boolean)
  • ExcelFile.Import(TextReader, Int32, Int32, Char, Char, ColumnImportType[], String[])
  • ExcelFile.Import(String, Int32, Int32, Int32[], ColumnImportType[], Encoding, Boolean)
  • ExcelFile.Import(Stream, Int32, Int32, Int32[], ColumnImportType[], Encoding, Boolean)
  • ExcelFile.Import(String, Int32, Int32, Char, ColumnImportType[], String[], Encoding, Boolean)
  • ExcelFile.Import(Stream, Int32, Int32, Char, ColumnImportType[], String[], Encoding, Boolean)
  • ExcelFile.Import(String, Int32, Int32, Int32[], ColumnImportType[], String[], Encoding, Boolean)
  • ExcelFile.Import(Stream, Int32, Int32, Int32[], ColumnImportType[], String[], Encoding, Boolean)
  • ExcelFile.Import(String, Int32, Int32, Char, Char, ColumnImportType[], String[], Encoding, Boolean)
  • ExcelFile.Import(Stream, Int32, Int32, Char, Char, ColumnImportType[], String[], Encoding, Boolean)

ExcelFile.Import(TextReader, Int32, Int32, Int32[], ColumnImportType[])

Imports a text file (fixed length columns) into the current sheet. Note that this method won't clear any existing data.

Syntax

Namespace: FlexCel.Core

public void Import(TextReader aTextReader, Int32 firstRow, Int32 firstCol, Int32[] columnWidths, ColumnImportType[] columnFormats)

Parameters

<-> | Parameter | Type | Description
 | aTextReader | TextReader | StreamReader with the text to import.
 | firstRow | Int32 | Row in the Active sheet where we will start importing the text file.
 | firstCol | Int32 | Column in the Active sheet where we will start importing the text file.
 | columnWidths | Int32[] | An array with the column widths for every column you want to import.
 | columnFormats | ColumnImportType[] | An array of ColumnImportType elements, telling how each column should be imported. See the example in Open(Stream, TFileFormats, Char, Int32, Int32, ColumnImportType[]) for more information on how to use it.

See also

  • ExcelFile

ExcelFile.Import(TextReader, Int32, Int32, Int32[], ColumnImportType[], String[])

Imports a text file (fixed length columns) into the current sheet. Note that this method won't clear any existing data.

Syntax

Namespace: FlexCel.Core

public abstract void Import(TextReader aTextReader, Int32 firstRow, Int32 firstCol, Int32[] columnWidths, ColumnImportType[] columnFormats, String[] dateFormats)

Parameters

<-> | Parameter | Type | Description
 | aTextReader | TextReader | StreamReader with the text to import.
 | firstRow | Int32 | Row in the Active sheet where we will start importing the text file.
 | firstCol | Int32 | Column in the Active sheet where we will start importing the text file.
 | columnWidths | Int32[] | An array with the column widths for every column you want to import.
 | columnFormats | ColumnImportType[] | An array of ColumnImportType elements, telling how each column should be imported. See the example in Open(Stream, TFileFormats, Char, Int32, Int32, ColumnImportType[]) for more information on how to use it.
 | dateFormats | String[] | A list of formats allowed for dates and times, when opening text files. Windows is a little liberal in what it thinks can be a date, and it can convert things like "1.2" into dates. By setting this property, you can ensure the dates are only in the formats you expect. If you leave it null, we will trust "DateTime.TryParse" to guess the correct values. This value has no meaning in normal xls files, only text files.

See also

  • ExcelFile

ExcelFile.Import(String, Int32, Int32, Char, ColumnImportType[], Encoding, Boolean)

Imports a text file (character-delimited columns) into the current sheet. Note that this method won't clear any existing data.

Syntax

Namespace: FlexCel.Core

public void Import(String fileName, Int32 firstRow, Int32 firstCol, Char delimiter, ColumnImportType[] columnFormats, Encoding fileEncoding, Boolean detectEncodingFromByteOrderMarks)

Parameters

<-> | Parameter | Type | Description
 | fileName | String | File with the text to import.
 | firstRow | Int32 | Row in the Active sheet where we will start importing the text file.
 | firstCol | Int32 | Column in the Active sheet where we will start importing the text file.
 | delimiter | Char | Character used to separate columns.
 | columnFormats | ColumnImportType[] | An array of ColumnImportType elements, telling how each column should be imported. See the example in Open(Stream, TFileFormats, Char, Int32, Int32, ColumnImportType[]) for more information on how to use it.
 | fileEncoding | Encoding | Encoding used by the file we are reading. If omitted or null, it is assumed to be Encoding.UTF8.
 | detectEncodingFromByteOrderMarks | Boolean | It is the same on the constructor of a StreamReader, and it says if BOM must be used at the beginning of the file. It defaults to true.

See also

  • ExcelFile

ExcelFile.Import(Stream, Int32, Int32, Char, ColumnImportType[], Encoding, Boolean)

Imports a text file (character-delimited columns) into the current sheet. Note that this method won't clear any existing data.

Syntax

Namespace: FlexCel.Core

public void Import(Stream aStream, Int32 firstRow, Int32 firstCol, Char delimiter, ColumnImportType[] columnFormats, Encoding fileEncoding, Boolean detectEncodingFromByteOrderMarks)

Parameters

<-> | Parameter | Type | Description
 | aStream | Stream | Stream with the text to import.
 | firstRow | Int32 | Row in the Active sheet where we will start importing the text file.
 | firstCol | Int32 | Column in the Active sheet where we will start importing the text file.
 | delimiter | Char | Character used to separate columns.
 | columnFormats | ColumnImportType[] | An array of ColumnImportType elements, telling how each column should be imported. See the example in Open(Stream, TFileFormats, Char, Int32, Int32, ColumnImportType[]) for more information on how to use it.
 | fileEncoding | Encoding | Encoding used by the file we are reading. If omitted or null, it is assumed to be Encoding.UTF8.
 | detectEncodingFromByteOrderMarks | Boolean | It is the same on the constructor of a StreamReader, and it says if BOM must be used at the beginning of the file. It defaults to true.

See also

  • ExcelFile

ExcelFile.Import(TextReader, Int32, Int32, Char, Char, ColumnImportType[], String[])

Imports a text file (character-delimited columns) into the current sheet. Note that this method won't clear any existing data.

Syntax

Namespace: FlexCel.Core

public abstract void Import(TextReader aTextReader, Int32 firstRow, Int32 firstCol, Char delimiter, Char textQualifier, ColumnImportType[] columnFormats, String[] dateFormats)

Parameters

<-> | Parameter | Type | Description
 | aTextReader | TextReader | TextReader with the text to import.
 | firstRow | Int32 | Row in the Active sheet where we will start importing the text file.
 | firstCol | Int32 | Column in the Active sheet where we will start importing the text file.
 | delimiter | Char | Character used to separate columns.
 | textQualifier | Char | Character used to quote strings when they contain the delimiter. This is normally the double quote (") but you might change it by a single quote or any other character. Use a char 0 if the original file isn't quoted.
 | columnFormats | ColumnImportType[] | An array of ColumnImportType elements, telling how each column should be imported. See the example in Open(Stream, TFileFormats, Char, Int32, Int32, ColumnImportType[]) for more information on how to use it.
 | dateFormats | String[] | A list of formats allowed for dates and times, when opening text files. Windows is a little liberal in what it thinks can be a date, and it can convert things like "1.2" into dates. By setting this property, you can ensure the dates are only in the formats you expect. If you leave it null, we will trust "DateTime.TryParse" to guess the correct values. This value has no meaning in normal xls files, only text files.

See also

  • ExcelFile

ExcelFile.Import(String, Int32, Int32, Int32[], ColumnImportType[], Encoding, Boolean)

Imports a text file (fixed length columns) into the current sheet. Note that this method won't clear any existing data.

Syntax

Namespace: FlexCel.Core

public void Import(String fileName, Int32 firstRow, Int32 firstCol, Int32[] columnWidths, ColumnImportType[] columnFormats, Encoding fileEncoding, Boolean detectEncodingFromByteOrderMarks)

Parameters

<-> | Parameter | Type | Description
 | fileName | String | File with the text to import.
 | firstRow | Int32 | Row in the Active sheet where we will start importing the text file.
 | firstCol | Int32 | Column in the Active sheet where we will start importing the text file.
 | columnWidths | Int32[] | An array with the column widths for every column you want to import.
 | columnFormats | ColumnImportType[] | An array of ColumnImportType elements, telling how each column should be imported. See the example in Open(Stream, TFileFormats, Char, Int32, Int32, ColumnImportType[]) for more information on how to use it.
 | fileEncoding | Encoding | Encoding used by the file we are reading. If omitted or null, it is assumed to be Encoding.UTF8.
 | detectEncodingFromByteOrderMarks | Boolean | It is the same on the constructor of a StreamReader, and it says if BOM must be used at the beginning of the file. It defaults to true.

See also

  • ExcelFile

ExcelFile.Import(Stream, Int32, Int32, Int32[], ColumnImportType[], Encoding, Boolean)

Imports a text file (fixed length columns) into the current sheet. Note that this method won't clear any existing data.

Syntax

Namespace: FlexCel.Core

public void Import(Stream aStream, Int32 firstRow, Int32 firstCol, Int32[] columnWidths, ColumnImportType[] columnFormats, Encoding fileEncoding, Boolean detectEncodingFromByteOrderMarks)

Parameters

<-> | Parameter | Type | Description
 | aStream | Stream | Stream with the text to import.
 | firstRow | Int32 | Row in the Active sheet where we will start importing the text file.
 | firstCol | Int32 | Column in the Active sheet where we will start importing the text file.
 | columnWidths | Int32[] | An array with the column widths for every column you want to import.
 | columnFormats | ColumnImportType[] | An array of ColumnImportType elements, telling how each column should be imported. See the example in Open(Stream, TFileFormats, Char, Int32, Int32, ColumnImportType[]) for more information on how to use it.
 | fileEncoding | Encoding | Encoding used by the file we are reading. If omitted or null, it is assumed to be Encoding.UTF8.
 | detectEncodingFromByteOrderMarks | Boolean | It is the same on the constructor of a StreamReader, and it says if BOM must be used at the beginning of the file. It defaults to true.

See also

  • ExcelFile

ExcelFile.Import(String, Int32, Int32, Char, ColumnImportType[], String[], Encoding, Boolean)

Imports a text file (character-delimited columns) into the current sheet. Note that this method won't clear any existing data.

Syntax

Namespace: FlexCel.Core

public void Import(String fileName, Int32 firstRow, Int32 firstCol, Char delimiter, ColumnImportType[] columnFormats, String[] dateFormats, Encoding fileEncoding, Boolean detectEncodingFromByteOrderMarks)

Parameters

<-> | Parameter | Type | Description
 | fileName | String | File with the text to import.
 | firstRow | Int32 | Row in the Active sheet where we will start importing the text file.
 | firstCol | Int32 | Column in the Active sheet where we will start importing the text file.
 | delimiter | Char | Character used to separate columns.
 | columnFormats | ColumnImportType[] | An array of ColumnImportType elements, telling how each column should be imported. See the example in Open(Stream, TFileFormats, Char, Int32, Int32, ColumnImportType[]) for more information on how to use it.
 | dateFormats | String[] | A list of formats allowed for dates and times, when opening text files. Windows is a little liberal in what it thinks can be a date, and it can convert things like "1.2" into dates. By setting this property, you can ensure the dates are only in the formats you expect. If you leave it null, we will trust "DateTime.TryParse" to guess the correct values. This value has no meaning in normal xls files, only text files.
 | fileEncoding | Encoding | Encoding used by the file we are reading. If omitted or null, it is assumed to be Encoding.UTF8.
 | detectEncodingFromByteOrderMarks | Boolean | It is the same on the constructor of a StreamReader, and it says if BOM must be used at the beginning of the file. It defaults to true.

See also

  • ExcelFile

ExcelFile.Import(Stream, Int32, Int32, Char, ColumnImportType[], String[], Encoding, Boolean)

Imports a text file (character-delimited columns) into the current sheet. Note that this method won't clear any existing data.

Syntax

Namespace: FlexCel.Core

public void Import(Stream aStream, Int32 firstRow, Int32 firstCol, Char delimiter, ColumnImportType[] columnFormats, String[] dateFormats, Encoding fileEncoding, Boolean detectEncodingFromByteOrderMarks)

Parameters

<-> | Parameter | Type | Description
 | aStream | Stream | Stream with the text to import.
 | firstRow | Int32 | Row in the Active sheet where we will start importing the text file.
 | firstCol | Int32 | Column in the Active sheet where we will start importing the text file.
 | delimiter | Char | Character used to separate columns.
 | columnFormats | ColumnImportType[] | An array of ColumnImportType elements, telling how each column should be imported. See the example in Open(Stream, TFileFormats, Char, Int32, Int32, ColumnImportType[]) for more information on how to use it.
 | dateFormats | String[] | A list of formats allowed for dates and times, when opening text files. Windows is a little liberal in what it thinks can be a date, and it can convert things like "1.2" into dates. By setting this property, you can ensure the dates are only in the formats you expect. If you leave it null, we will trust "DateTime.TryParse" to guess the correct values. This value has no meaning in normal xls files, only text files.
 | fileEncoding | Encoding | Encoding used by the file we are reading. If omitted or null, it is assumed to be Encoding.UTF8.
 | detectEncodingFromByteOrderMarks | Boolean | It is the same on the constructor of a StreamReader, and it says if BOM must be used at the beginning of the file. It defaults to true.

See also

  • ExcelFile

ExcelFile.Import(String, Int32, Int32, Int32[], ColumnImportType[], String[], Encoding, Boolean)

Imports a text file (fixed length columns) into the current sheet. Note that this method won't clear any existing data.

Syntax

Namespace: FlexCel.Core

public void Import(String fileName, Int32 firstRow, Int32 firstCol, Int32[] columnWidths, ColumnImportType[] columnFormats, String[] dateFormats, Encoding fileEncoding, Boolean detectEncodingFromByteOrderMarks)

Parameters

<-> | Parameter | Type | Description
 | fileName | String | File with the text to import.
 | firstRow | Int32 | Row in the Active sheet where we will start importing the text file.
 | firstCol | Int32 | Column in the Active sheet where we will start importing the text file.
 | columnWidths | Int32[] | An array with the column widths for every column you want to import.
 | columnFormats | ColumnImportType[] | An array of ColumnImportType elements, telling how each column should be imported. See the example in Open(Stream, TFileFormats, Char, Int32, Int32, ColumnImportType[]) for more information on how to use it.
 | dateFormats | String[] | A list of formats allowed for dates and times, when opening text files. Windows is a little liberal in what it thinks can be a date, and it can convert things like "1.2" into dates. By setting this property, you can ensure the dates are only in the formats you expect. If you leave it null, we will trust "DateTime.TryParse" to guess the correct values. This value has no meaning in normal xls files, only text files.
 | fileEncoding | Encoding | Encoding used by the file we are reading. If omitted or null, it is assumed to be Encoding.UTF8.
 | detectEncodingFromByteOrderMarks | Boolean | It is the same on the constructor of a StreamReader, and it says if BOM must be used at the beginning of the file. It defaults to true.

See also

  • ExcelFile

ExcelFile.Import(Stream, Int32, Int32, Int32[], ColumnImportType[], String[], Encoding, Boolean)

Imports a text file (fixed length columns) into the current sheet. Note that this method won't clear any existing data.

Syntax

Namespace: FlexCel.Core

public void Import(Stream aStream, Int32 firstRow, Int32 firstCol, Int32[] columnWidths, ColumnImportType[] columnFormats, String[] dateFormats, Encoding fileEncoding, Boolean detectEncodingFromByteOrderMarks)

Parameters

<-> | Parameter | Type | Description
 | aStream | Stream | Stream with the text to import.
 | firstRow | Int32 | Row in the Active sheet where we will start importing the text file.
 | firstCol | Int32 | Column in the Active sheet where we will start importing the text file.
 | columnWidths | Int32[] | An array with the column widths for every column you want to import.
 | columnFormats | ColumnImportType[] | An array of ColumnImportType elements, telling how each column should be imported. See the example in Open(Stream, TFileFormats, Char, Int32, Int32, ColumnImportType[]) for more information on how to use it.
 | dateFormats | String[] | A list of formats allowed for dates and times, when opening text files. Windows is a little liberal in what it thinks can be a date, and it can convert things like "1.2" into dates. By setting this property, you can ensure the dates are only in the formats you expect. If you leave it null, we will trust "DateTime.TryParse" to guess the correct values. This value has no meaning in normal xls files, only text files.
 | fileEncoding | Encoding | Encoding used by the file we are reading. If omitted or null, it is assumed to be Encoding.UTF8.
 | detectEncodingFromByteOrderMarks | Boolean | It is the same on the constructor of a StreamReader, and it says if BOM must be used at the beginning of the file. It defaults to true.

See also

  • ExcelFile

ExcelFile.Import(String, Int32, Int32, Char, Char, ColumnImportType[], String[], Encoding, Boolean)

Imports a text file (character-delimited columns) into the current sheet. Note that this method won't clear any existing data.

Syntax

Namespace: FlexCel.Core

public void Import(String fileName, Int32 firstRow, Int32 firstCol, Char delimiter, Char textQualifier, ColumnImportType[] columnFormats, String[] dateFormats, Encoding fileEncoding, Boolean detectEncodingFromByteOrderMarks)

Parameters

<-> | Parameter | Type | Description
 | fileName | String | File with the text to import.
 | firstRow | Int32 | Row in the Active sheet where we will start importing the text file.
 | firstCol | Int32 | Column in the Active sheet where we will start importing the text file.
 | delimiter | Char | Character used to separate columns.
 | textQualifier | Char | Character used to quote strings when they contain the delimiter. This is normally the double quote (") but you might change it by a single quote or any other character. Use a char 0 if the original file isn't quoted.
 | columnFormats | ColumnImportType[] | An array of ColumnImportType elements, telling how each column should be imported. See the example in Open(Stream, TFileFormats, Char, Int32, Int32, ColumnImportType[]) for more information on how to use it.
 | dateFormats | String[] | A list of formats allowed for dates and times, when opening text files. Windows is a little liberal in what it thinks can be a date, and it can convert things like "1.2" into dates. By setting this property, you can ensure the dates are only in the formats you expect. If you leave it null, we will trust "DateTime.TryParse" to guess the correct values. This value has no meaning in normal xls files, only text files.
 | fileEncoding | Encoding | Encoding used by the file we are reading. If omitted or null, it is assumed to be Encoding.UTF8.
 | detectEncodingFromByteOrderMarks | Boolean | It is the same on the constructor of a StreamReader, and it says if BOM must be used at the beginning of the file. It defaults to true.

See also

  • ExcelFile

ExcelFile.Import(Stream, Int32, Int32, Char, Char, ColumnImportType[], String[], Encoding, Boolean)

Imports a text file (character-delimited columns) into the current sheet. Note that this method won't clear any existing data.

Syntax

Namespace: FlexCel.Core

public void Import(Stream aStream, Int32 firstRow, Int32 firstCol, Char delimiter, Char textQualifier, ColumnImportType[] columnFormats, String[] dateFormats, Encoding fileEncoding, Boolean detectEncodingFromByteOrderMarks)

Parameters

<-> | Parameter | Type | Description
 | aStream | Stream | Stream with the text to import.
 | firstRow | Int32 | Row in the Active sheet where we will start importing the text file.
 | firstCol | Int32 | Column in the Active sheet where we will start importing the text file.
 | delimiter | Char | Character used to separate columns.
 | textQualifier | Char | Character used to quote strings when they contain the delimiter. This is normally the double quote (") but you might change it by a single quote or any other character. Use a char 0 if the original file isn't quoted.
 | columnFormats | ColumnImportType[] | An array of ColumnImportType elements, telling how each column should be imported. See the example in Open(Stream, TFileFormats, Char, Int32, Int32, ColumnImportType[]) for more information on how to use it.
 | dateFormats | String[] | A list of formats allowed for dates and times, when opening text files. Windows is a little liberal in what it thinks can be a date, and it can convert things like "1.2" into dates. By setting this property, you can ensure the dates are only in the formats you expect. If you leave it null, we will trust "DateTime.TryParse" to guess the correct values. This value has no meaning in normal xls files, only text files.
 | fileEncoding | Encoding | Encoding used by the file we are reading. If omitted or null, it is assumed to be Encoding.UTF8.
 | detectEncodingFromByteOrderMarks | Boolean | It is the same on the constructor of a StreamReader, and it says if BOM must be used at the beginning of the file. It defaults to true.

See also

  • ExcelFile


ExcelFile.Save Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.Save Method

Overloads

  • ExcelFile.Save(String)
  • ExcelFile.Save(Stream)
  • ExcelFile.Save(String, TFileFormats)
  • ExcelFile.Save(Stream, TFileFormats)
  • ExcelFile.Save(String, TFileFormats, Char)
  • ExcelFile.Save(Stream, TFileFormats, Char)
  • ExcelFile.Save(String, TFileFormats, Char, Encoding)
  • ExcelFile.Save(Stream, TFileFormats, Char, Encoding)

ExcelFile.Save(String)

Saves the file to disk, on native format.

Syntax

Namespace: FlexCel.Core

public void Save(String fileName)

Parameters

<-> | Parameter | Type | Description
 | fileName | String | File to save. If AllowOverwritingFiles is false, then fileName MUST NOT exist.

See also

  • ExcelFile

ExcelFile.Save(Stream)

Saves the file to a stream, on native format.

Syntax

Namespace: FlexCel.Core

public void Save(Stream aStream)

Parameters

<-> | Parameter | Type | Description
 | aStream | Stream | Stream where to save the file. Must be a seekable stream.

See also

  • ExcelFile

ExcelFile.Save(String, TFileFormats)

Saves the file to a disk.

Syntax

Namespace: FlexCel.Core

public void Save(String fileName, TFileFormats fileFormat)

Parameters

<-> | Parameter | Type | Description
 | fileName | String | File to save. If AllowOverwritingFiles is false, then fileName MUST NOT exist.
 | fileFormat | TFileFormats | File format. If file format is text, a tab will be used as delimiter. Automatic will try to guess it from the filename, if present.

See also

  • ExcelFile

ExcelFile.Save(Stream, TFileFormats)

Saves the file to a stream.

Syntax

Namespace: FlexCel.Core

public void Save(Stream aStream, TFileFormats fileFormat)

Parameters

<-> | Parameter | Type | Description
 | aStream | Stream | Stream where to save the file. Must be a seekable stream.
 | fileFormat | TFileFormats | File format. If file format is text, a tab will be used as delimiter. Automatic will try to guess it from the filename, if present.

See also

  • ExcelFile

ExcelFile.Save(String, TFileFormats, Char)

Saves the file to a disk.

Syntax

Namespace: FlexCel.Core

public void Save(String fileName, TFileFormats fileFormat, Char delimiter)

Parameters

<-> | Parameter | Type | Description
 | fileName | String | File to save. If AllowOverwritingFiles is false, then fileName MUST NOT exist.
 | fileFormat | TFileFormats | File format. Automatic will try to guess it from the filename, if present.
 | delimiter | Char | Delimiter to use if FileFormat is TFileFormats.Text

See also

  • ExcelFile

ExcelFile.Save(Stream, TFileFormats, Char)

Saves the file to a stream.

Syntax

Namespace: FlexCel.Core

public void Save(Stream aStream, TFileFormats fileFormat, Char delimiter)

Parameters

<-> | Parameter | Type | Description
 | aStream | Stream | Stream where to save the file. Must be a seekable stream.
 | fileFormat | TFileFormats | File format. Automatic will try to guess it from the filename, if present.
 | delimiter | Char | Delimiter to use if FileFormat is TFileFormats.Text

See also

  • ExcelFile

ExcelFile.Save(String, TFileFormats, Char, Encoding)

Saves the file to a disk.

Syntax

Namespace: FlexCel.Core

public abstract void Save(String fileName, TFileFormats fileFormat, Char delimiter, Encoding fileEncoding)

Parameters

<-> | Parameter | Type | Description
 | fileName | String | File to save. If AllowOverwritingFiles is false, then fileName MUST NOT exist.
 | fileFormat | TFileFormats | File format. Automatic will try to guess it from the filename, if present.
 | delimiter | Char | Delimiter to use if FileFormat is TFileFormats.Text
 | fileEncoding | Encoding | Encoding for the generated file, when writing a Text-delimited file (csv or txt). This parameter has no effect on xls/x files. If omitted, new UTF8Encoding(false) will be used. Note that to create a file with BOM (byte order marker) you need to specify an encoding here, the same as you do with a StreamWriter.

See also

  • ExcelFile

ExcelFile.Save(Stream, TFileFormats, Char, Encoding)

Saves the file to a stream.

Syntax

Namespace: FlexCel.Core

public abstract void Save(Stream aStream, TFileFormats fileFormat, Char delimiter, Encoding fileEncoding)

Parameters

<-> | Parameter | Type | Description
 | aStream | Stream | Stream where to save the file. Must be a seekable stream.
 | fileFormat | TFileFormats | File format. Automatic will try to guess it from the filename, if present.
 | delimiter | Char | Delimiter to use if FileFormat is TFileFormats.Text
 | fileEncoding | Encoding | Encoding for the generated file, when writing a Text-delimited file (csv or txt). This parameter has no effect on xls files. If omitted, new UTF8Encoding(false) will be used. Note that to create a file with BOM (byte order marker) you need to specify an encoding here, the same as you do with a StreamWriter.

See also

  • ExcelFile


ExcelFile.Export Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.Export Method

Overloads

  • ExcelFile.Export(TextWriter, TXlsCellRange, Char, Boolean)
  • ExcelFile.Export(String, TXlsCellRange, Char, Boolean, Encoding)
  • ExcelFile.Export(Stream, TXlsCellRange, Char, Boolean, Encoding)
  • ExcelFile.Export(TextWriter, TXlsCellRange, Char, Boolean, String)
  • ExcelFile.Export(TextWriter, TXlsCellRange, Int32, Int32[], Boolean)
  • ExcelFile.Export(String, TXlsCellRange, Int32, Int32[], Boolean, Encoding)
  • ExcelFile.Export(Stream, TXlsCellRange, Int32, Int32[], Boolean, Encoding)
  • ExcelFile.Export(TextWriter, TXlsCellRange, Int32, Int32[], Boolean, Boolean)
  • ExcelFile.Export(String, TXlsCellRange, Int32, Int32[], Boolean, Encoding, Boolean)
  • ExcelFile.Export(Stream, TXlsCellRange, Int32, Int32[], Boolean, Encoding, Boolean)
  • ExcelFile.Export(TextWriter, TXlsCellRange, Int32, Int32[], Boolean, Boolean, String)

ExcelFile.Export(TextWriter, TXlsCellRange, Char, Boolean)

Exports a range of cells from the active sheet into a text file (character delimited columns).

Syntax

Namespace: FlexCel.Core

public void Export(TextWriter aTextWriter, TXlsCellRange range, Char delimiter, Boolean exportHiddenRowsOrColumns)

Parameters

<-> | Parameter | Type | Description
 | aTextWriter | TextWriter | TextWriter where we want to save the file.
 | range | TXlsCellRange | Range of cells to export. If you want to export the full sheet, set it to null.
 | delimiter | Char | Character used to delimit the fields in the exported file. You might normally use a comma (',') or a tab here.
 | exportHiddenRowsOrColumns | Boolean | If true, hidden rows and columns will be exported. If false, they will be ignored.

See also

  • ExcelFile

ExcelFile.Export(String, TXlsCellRange, Char, Boolean, Encoding)

Exports a range of cells from the active sheet into a text file (character delimited columns).

Syntax

Namespace: FlexCel.Core

public void Export(String fileName, TXlsCellRange range, Char delimiter, Boolean exportHiddenRowsOrColumns, Encoding fileEncoding)

Parameters

<-> | Parameter | Type | Description
 | fileName | String | File where we want to save the data.
 | range | TXlsCellRange | Range of cells to export. If you want to export the full sheet, set it to null.
 | delimiter | Char | Character used to delimit the fields in the exported file. You might normally use a comma (',') or a tab here.
 | exportHiddenRowsOrColumns | Boolean | If true, hidden rows and columns will be exported. If false, they will be ignored.
 | fileEncoding | Encoding | Encoding for the generated file. If you are unsure, you can use new UTF8Encoding(false) here. Note that to create a file with BOM (byte order marker) you need to specify an encoding here, the same as you do with a StreamWriter.

See also

  • ExcelFile

ExcelFile.Export(Stream, TXlsCellRange, Char, Boolean, Encoding)

Exports a range of cells from the active sheet into a text file (character delimited columns).

Syntax

Namespace: FlexCel.Core

public void Export(Stream aStream, TXlsCellRange range, Char delimiter, Boolean exportHiddenRowsOrColumns, Encoding fileEncoding)

Parameters

<-> | Parameter | Type | Description
 | aStream | Stream | Stream where we want to save the file.
 | range | TXlsCellRange | Range of cells to export. If you want to export the full sheet, set it to null.
 | delimiter | Char | Character used to delimit the fields in the exported file. You might normally use a comma (',') or a tab here.
 | exportHiddenRowsOrColumns | Boolean | If true, hidden rows and columns will be exported. If false, they will be ignored.
 | fileEncoding | Encoding | Encoding for the generated file. If you are unsure, you can use new UTF8Encoding(false) here. Note that to create a file with BOM (byte order marker) you need to specify an encoding here, the same as you do with a StreamWriter.

See also

  • ExcelFile

ExcelFile.Export(TextWriter, TXlsCellRange, Char, Boolean, String)

Exports a range of cells from the active sheet into a text file (character delimited columns).

Syntax

Namespace: FlexCel.Core

public abstract void Export(TextWriter aTextWriter, TXlsCellRange range, Char delimiter, Boolean exportHiddenRowsOrColumns, String newLine)

Parameters

<-> | Parameter | Type | Description
 | aTextWriter | TextWriter | TextWriter where we want to save the file.
 | range | TXlsCellRange | Range of cells to export. If you want to export the full sheet, set it to null.
 | delimiter | Char | Character used to delimit the fields in the exported file. You might normally use a comma (',') or a tab here.
 | exportHiddenRowsOrColumns | Boolean | If true, hidden rows and columns will be exported. If false, they will be ignored.
 | newLine | String | String used to separate lines. If not specified, this will be the string used in the OS.

See also

  • ExcelFile

ExcelFile.Export(TextWriter, TXlsCellRange, Int32, Int32[], Boolean)

Exports a range of cells from the active sheet into a text file (fixed length columns).

Syntax

Namespace: FlexCel.Core

public void Export(TextWriter aTextWriter, TXlsCellRange range, Int32 charactersForFirstColumn, Int32[] columnWidths, Boolean exportHiddenRowsOrColumns)

Parameters

<-> | Parameter | Type | Description
 | aTextWriter | TextWriter | TextWriter where we want to save the file.
 | range | TXlsCellRange | Range of cells to export. If you want to export the full sheet, set it to null.
 | charactersForFirstColumn | Int32 | This value only has effect if columnWidths is null. It will specify how many characters to use for the first column, and all other columns will be determined according to their ratio with the first. For example, if the first column is 150 pixels wide and you specify "8" for this parameter, the first column will be padded to 8 characters when exporting. If the second column is 300 pixels wide, then it will be padded to 16 characters and so on. As this might not be 100% exact and depend in pixel measurements, you might want to specify columnWidths parameter instead of using this one. Note: Setting this parameter to a negative value will assume the text in the columns is already padded, and won't attempt to do any padding. Use this value if your data is padded in the spreadsheet itself.
 | columnWidths | Int32[] | Array with the number of characters that will be assigned to every column when exporting. Supplying this array allows you to specify exactly how many characters you want for every field, and that might be really necessary to interop with other applications. But you can also leave this parameter null and specify "charactersForFirstColumn" to let FlexCel calculate how many characters to apply for every field.
 | exportHiddenRowsOrColumns | Boolean | If true, hidden rows and columns will be exported. If false, they will be ignored.

See also

  • ExcelFile

ExcelFile.Export(String, TXlsCellRange, Int32, Int32[], Boolean, Encoding)

Exports a range of cells from the active sheet into a text file (fixed length columns).

Syntax

Namespace: FlexCel.Core

public void Export(String fileName, TXlsCellRange range, Int32 charactersForFirstColumn, Int32[] columnWidths, Boolean exportHiddenRowsOrColumns, Encoding fileEncoding)

Parameters

<-> | Parameter | Type | Description
 | fileName | String | File where we want to save the data.
 | range | TXlsCellRange | Range of cells to export. If you want to export the full sheet, set it to null.
 | charactersForFirstColumn | Int32 | This value only has effect if columnWidths is null. It will specify how many characters to use for the first column, and all other columns will be determined according to their ratio with the first. For example, if the first column is 150 pixels wide and you specify "8" for this parameter, the first column will be padded to 8 characters when exporting. If the second column is 300 pixels wide, then it will be padded to 16 characters and so on. As this might not be 100% exact and depend in pixel measurements, you might want to specify columnWidths parameter instead of using this one. Note: Setting this parameter to a negative value will assume the text in the columns is already padded, and won't attempt to do any padding. Use this value if your data is padded in the spreadsheet itself.
 | columnWidths | Int32[] | Array with the number of characters that will be assigned to every column when exporting. Supplying this array allows you to specify exactly how many characters you want for every field, and that might be really necessary to interop with other applications. But you can also leave this parameter null and specify "charactersForFirstColumn" to let FlexCel calculate how many characters to apply for every field.
 | exportHiddenRowsOrColumns | Boolean | If true, hidden rows and columns will be exported. If false, they will be ignored.
 | fileEncoding | Encoding | Encoding for the generated file. If you are unsure, you can use new UTF8Encoding(false) here. Note that to create a file with BOM (byte order marker) you need to specify an encoding here, the same as you do with a StreamWriter.

See also

  • ExcelFile

ExcelFile.Export(Stream, TXlsCellRange, Int32, Int32[], Boolean, Encoding)

Exports a range of cells from the active sheet into a text file (fixed length columns).

Syntax

Namespace: FlexCel.Core

public void Export(Stream aStream, TXlsCellRange range, Int32 charactersForFirstColumn, Int32[] columnWidths, Boolean exportHiddenRowsOrColumns, Encoding fileEncoding)

Parameters

<-> | Parameter | Type | Description
 | aStream | Stream | Stream where we want to save the file.
 | range | TXlsCellRange | Range of cells to export. If you want to export the full sheet, set it to null.
 | charactersForFirstColumn | Int32 | This value only has effect if columnWidths is null. It will specify how many characters to use for the first column, and all other columns will be determined according to their ratio with the first. For example, if the first column is 150 pixels wide and you specify "8" for this parameter, the first column will be padded to 8 characters when exporting. If the second column is 300 pixels wide, then it will be padded to 16 characters and so on. As this might not be 100% exact and depend in pixel measurements, you might want to specify columnWidths parameter instead of using this one. Note: Setting this parameter to a negative value will assume the text in the columns is already padded, and won't attempt to do any padding. Use this value if your data is padded in the spreadsheet itself.
 | columnWidths | Int32[] | Array with the number of characters that will be assigned to every column when exporting. Supplying this array allows you to specify exactly how many characters you want for every field, and that might be really necessary to interop with other applications. But you can also leave this parameter null and specify "charactersForFirstColumn" to let FlexCel calculate how many characters to apply for every field.
 | exportHiddenRowsOrColumns | Boolean | If true, hidden rows and columns will be exported. If false, they will be ignored.
 | fileEncoding | Encoding | Encoding for the generated file. If you are unsure, you can use new UTF8Encoding(false) here. Note that to create a file with BOM (byte order marker) you need to specify an encoding here, the same as you do with a StreamWriter.

See also

  • ExcelFile

ExcelFile.Export(TextWriter, TXlsCellRange, Int32, Int32[], Boolean, Boolean)

Exports a range of cells from the active sheet into a text file (fixed length columns).

Syntax

Namespace: FlexCel.Core

public void Export(TextWriter aTextWriter, TXlsCellRange range, Int32 charactersForFirstColumn, Int32[] columnWidths, Boolean exportHiddenRowsOrColumns, Boolean exportTextOutsideCells)

Parameters

<-> | Parameter | Type | Description
 | aTextWriter | TextWriter | TextWriter where we want to save the file.
 | range | TXlsCellRange | Range of cells to export. If you want to export the full sheet, set it to null.
 | charactersForFirstColumn | Int32 | This value only has effect if columnWidths is null. It will specify how many characters to use for the first column, and all other columns will be determined according to their ratio with the first. For example, if the first column is 150 pixels wide and you specify "8" for this parameter, the first column will be padded to 8 characters when exporting. If the second column is 300 pixels wide, then it will be padded to 16 characters and so on. As this might not be 100% exact and depend in pixel measurements, you might want to specify columnWidths parameter instead of using this one. Note: Setting this parameter to a negative value will assume the text in the columns is already padded, and won't attempt to do any padding. Use this value if your data is padded in the spreadsheet itself.
 | columnWidths | Int32[] | Array with the number of characters that will be assigned to every column when exporting. Supplying this array allows you to specify exactly how many characters you want for every field, and that might be really necessary to interop with other applications. But you can also leave this parameter null and specify "charactersForFirstColumn" to let FlexCel calculate how many characters to apply for every field.
 | exportHiddenRowsOrColumns | Boolean | If true, hidden rows and columns will be exported. If false, they will be ignored.
 | exportTextOutsideCells | Boolean | If true and the cell text spans over more than one empty cell to the right, that text will be exported. When false (the default) only text that fits in the cell will be exported. When this value is true the printout will look better, but it will not be possible to reimport the data as the columns are lost.

See also

  • ExcelFile

ExcelFile.Export(String, TXlsCellRange, Int32, Int32[], Boolean, Encoding, Boolean)

Exports a range of cells from the active sheet into a text file (fixed length columns).

Syntax

Namespace: FlexCel.Core

public void Export(String fileName, TXlsCellRange range, Int32 charactersForFirstColumn, Int32[] columnWidths, Boolean exportHiddenRowsOrColumns, Encoding fileEncoding, Boolean exportTextOutsideCells)

Parameters

<-> | Parameter | Type | Description
 | fileName | String | File where we want to save the data.
 | range | TXlsCellRange | Range of cells to export. If you want to export the full sheet, set it to null.
 | charactersForFirstColumn | Int32 | This value only has effect if columnWidths is null. It will specify how many characters to use for the first column, and all other columns will be determined according to their ratio with the first. For example, if the first column is 150 pixels wide and you specify "8" for this parameter, the first column will be padded to 8 characters when exporting. If the second column is 300 pixels wide, then it will be padded to 16 characters and so on. As this might not be 100% exact and depend in pixel measurements, you might want to specify columnWidths parameter instead of using this one. Note: Setting this parameter to a negative value will assume the text in the columns is already padded, and won't attempt to do any padding. Use this value if your data is padded in the spreadsheet itself.
 | columnWidths | Int32[] | Array with the number of characters that will be assigned to every column when exporting. Supplying this array allows you to specify exactly how many characters you want for every field, and that might be really necessary to interop with other applications. But you can also leave this parameter null and specify "charactersForFirstColumn" to let FlexCel calculate how many characters to apply for every field.
 | exportHiddenRowsOrColumns | Boolean | If true, hidden rows and columns will be exported. If false, they will be ignored.
 | fileEncoding | Encoding | Encoding for the generated file. If you are unsure, you can use new UTF8Encoding(false) here. Note that to create a file with BOM (byte order marker) you need to specify an encoding here, the same as you do with a StreamWriter.
 | exportTextOutsideCells | Boolean | If true and the cell text spans over more than one empty cell to the right, that text will be exported. When false (the default) only text that fits in the cell will be exported. When this value is true the printout will look better, but it will not be possible to reimport the data as the columns are lost.

See also

  • ExcelFile

ExcelFile.Export(Stream, TXlsCellRange, Int32, Int32[], Boolean, Encoding, Boolean)

Exports a range of cells from the active sheet into a text file (fixed length columns).

Syntax

Namespace: FlexCel.Core

public void Export(Stream aStream, TXlsCellRange range, Int32 charactersForFirstColumn, Int32[] columnWidths, Boolean exportHiddenRowsOrColumns, Encoding fileEncoding, Boolean exportTextOutsideCells)

Parameters

<-> | Parameter | Type | Description
 | aStream | Stream | Stream where we want to save the file.
 | range | TXlsCellRange | Range of cells to export. If you want to export the full sheet, set it to null.
 | charactersForFirstColumn | Int32 | This value only has effect if columnWidths is null. It will specify how many characters to use for the first column, and all other columns will be determined according to their ratio with the first. For example, if the first column is 150 pixels wide and you specify "8" for this parameter, the first column will be padded to 8 characters when exporting. If the second column is 300 pixels wide, then it will be padded to 16 characters and so on. As this might not be 100% exact and depend in pixel measurements, you might want to specify columnWidths parameter instead of using this one. Note: Setting this parameter to a negative value will assume the text in the columns is already padded, and won't attempt to do any padding. Use this value if your data is padded in the spreadsheet itself.
 | columnWidths | Int32[] | Array with the number of characters that will be assigned to every column when exporting. Supplying this array allows you to specify exactly how many characters you want for every field, and that might be really necessary to interop with other applications. But you can also leave this parameter null and specify "charactersForFirstColumn" to let FlexCel calculate how many characters to apply for every field.
 | exportHiddenRowsOrColumns | Boolean | If true, hidden rows and columns will be exported. If false, they will be ignored.
 | fileEncoding | Encoding | Encoding for the generated file. If you are unsure, you can use new UTF8Encoding(false) here. Note that to create a file with BOM (byte order marker) you need to specify an encoding here, the same as you do with a StreamWriter.
 | exportTextOutsideCells | Boolean | If true and the cell text spans over more than one empty cell to the right, that text will be exported. When false (the default) only text that fits in the cell will be exported. When this value is true the printout will look better, but it will not be possible to reimport the data as the columns are lost.

See also

  • ExcelFile

ExcelFile.Export(TextWriter, TXlsCellRange, Int32, Int32[], Boolean, Boolean, String)

Exports a range of cells from the active sheet into a text file (fixed length columns).

Syntax

Namespace: FlexCel.Core

public abstract void Export(TextWriter aTextWriter, TXlsCellRange range, Int32 charactersForFirstColumn, Int32[] columnWidths, Boolean exportHiddenRowsOrColumns, Boolean exportTextOutsideCells, String newLine)

Parameters

<-> | Parameter | Type | Description
 | aTextWriter | TextWriter | TextWriter where we want to save the file.
 | range | TXlsCellRange | Range of cells to export. If you want to export the full sheet, set it to null.
 | charactersForFirstColumn | Int32 | This value only has effect if columnWidths is null. It will specify how many characters to use for the first column, and all other columns will be determined according to their ratio with the first. For example, if the first column is 150 pixels wide and you specify "8" for this parameter, the first column will be padded to 8 characters when exporting. If the second column is 300 pixels wide, then it will be padded to 16 characters and so on. As this might not be 100% exact and depend in pixel measurements, you might want to specify columnWidths parameter instead of using this one. Note: Setting this parameter to a negative value will assume the text in the columns is already padded, and won't attempt to do any padding. Use this value if your data is padded in the spreadsheet itself.
 | columnWidths | Int32[] | Array with the number of characters that will be assigned to every column when exporting. Supplying this array allows you to specify exactly how many characters you want for every field, and that might be really necessary to interop with other applications. But you can also leave this parameter null and specify "charactersForFirstColumn" to let FlexCel calculate how many characters to apply for every field.
 | exportHiddenRowsOrColumns | Boolean | If true, hidden rows and columns will be exported. If false, they will be ignored.
 | exportTextOutsideCells | Boolean | If true and the cell text spans over more than one empty cell to the right, that text will be exported. When false (the default) only text that fits in the cell will be exported. When this value is true the printout will look better, but it will not be possible to reimport the data as the columns are lost.
 | newLine | String | String used to separate lines in the output. If omitted, we will use the OS new line separator.

See also

  • ExcelFile


ExcelFile.SaveForHashing Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.SaveForHashing Method

Overloads

  • ExcelFile.SaveForHashing(Stream)
  • ExcelFile.SaveForHashing(Stream, TExcludedRecords)

ExcelFile.SaveForHashing(Stream)

This method will save the file in a format that will remain the same if the file is not modified. Normal xls files contain TimeStamp fields that might be modified when the file is downloaded or just copied.

While you will not be able to load the file saved, you might use this method to create a hash of a file and compare it to others to know if something changed.

This overload will not save cell selections or the active sheet, and it is equivalent to calling SaveForHashing(Stream, TExcludedRecords) with the excludedRecords parameter set to TExcludedRecords.All. Use SaveForHashing(Stream, TExcludedRecords) for more control on which records to exclude.

Remarks

This method will not save the file in any readable format, and the file format might change between FlexCel versions. The only thing it guarantees is that the hashes for 2 identical xls files will be the same, for the same FlexCel version. Once you upgrade version, hashes might have to be rebuilt.

Also note that this method is useful to detect changes when the file is not edited in Excel. If you open the file in Excel and save it again, Excel will change a lot of reserved bits, and the files will be too different for this method to have the same hashes. This is only to detect changes when copying or downloading an xls file. If you want to compare just cell contents, you might compare the files saved as CSV.

Syntax

Namespace: FlexCel.Core

public void SaveForHashing(Stream aStream)

Parameters

<-> | Parameter | Type | Description
 | aStream | Stream | Stream where the file will be saved. You will probably want to hash this stream to store the corresponding hash.

Examples

The following method will calculate the hash for an existing file:

    static byte[] GetHash(string FileName)
    {
        XlsFile xls = new XlsFile(FileName);
        using (System.Security.Cryptography.SHA256CryptoServiceProvider hasher = new System.Security.Cryptography.SHA256CryptoServiceProvider())
        {
            using (MemoryStream ms = new MemoryStream())
            {
                xls.SaveForHashing(ms); //Save the file in a format without timestamps
                                        //or other data that might change from save to save.
                                        //Note that the saved file is invalid, but we only care about its hash.
                ms.Position = 0;
                return hasher.ComputeHash(ms); //Compute the hash of the file.
            }
        }
    }

See also

  • ExcelFile

ExcelFile.SaveForHashing(Stream, TExcludedRecords)

This method will save the file in a format that will remain the same if the file is not modified. Normal xls files contain TimeStamp fields that might be modified when the file is downloaded or just copied.

While you will not be able to load the file saved, you might use this method to create a hash of a file and compare it to others to know if something changed.

Remarks

This method will not save the file in any readable format, and the file format might change between FlexCel versions. The only thing it guarantees is that the hashes for 2 identical xls files will be the same, for the same FlexCel version. Once you upgrade version, hashes might have to be rebuilt.

Also note that this method is useful to detect changes when the file is not edited in Excel. If you open the file in Excel and save it again, Excel will change a lot of reserved bits, and the files will be too different for this method to have the same hashes. This is only to detect changes when copying or downloading an xls file. If you want to compare just cell contents, you might compare the files saved as CSV.

Syntax

Namespace: FlexCel.Core

public abstract void SaveForHashing(Stream aStream, TExcludedRecords excludedRecords)

Parameters

<-> | Parameter | Type | Description
 | aStream | Stream | Stream where the file will be saved. You will probably want to hash this stream to store the corresponding hash.
 | excludedRecords | TExcludedRecords | A list with all the records you don't wish to include in the saved file (like for example cell selection). You will normally will want to specify TExcludedRecords.All here, but you can OR different members of the TExcludedRecords enumerations for more control on what is saved.

Examples

The following method will calculate the hash for an existing file:

    static byte[] GetHash(string FileName)
    {
        XlsFile xls = new XlsFile(FileName);
        using (System.Security.Cryptography.SHA256CryptoServiceProvider hasher = new System.Security.Cryptography.SHA256CryptoServiceProvider())
        {
            using (MemoryStream ms = new MemoryStream())
            {
                xls.SaveForHashing(ms); //Save the file in a format without timestamps
                                        //or other data that might change from save to save.
                                        //Note that the saved file is invalid, but we only care about its hash.
                ms.Position = 0;
                return hasher.ComputeHash(ms); //Compute the hash of the file.
            }
        }
    }

See also

  • ExcelFile


ExcelFile.GetSheetIndex Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.GetSheetIndex Method

Overloads

  • ExcelFile.GetSheetIndex(String)
  • ExcelFile.GetSheetIndex(String, Boolean)

ExcelFile.GetSheetIndex(String)

Finds a sheet name on the workbook and returns its index. If it doesn't find the sheet it will raise an exception. See GetSheetIndex(String, Boolean) for a method that will not throw an exception. To change the active sheet by the name, use ActiveSheetByName. See also GetSheetName

Syntax

Namespace: FlexCel.Core

public Int32 GetSheetIndex(String sheetName)

Parameters

<-> | Parameter | Type | Description
 | sheetName | String | Sheet you want to find.

Returns

The sheet index (1-based) if the sheet exists, or throws an Exception otherwise.

See also

  • ExcelFile

ExcelFile.GetSheetIndex(String, Boolean)

Finds a sheet name on the workbook and returns its index. Depending on the "throwException" parameter, this method will raise an exception or return -1 if the sheet does not exist. To change the active sheet by the name, use ActiveSheetByName. See also GetSheetName

Syntax

Namespace: FlexCel.Core

public abstract Int32 GetSheetIndex(String sheetName, Boolean throwException)

Parameters

<-> | Parameter | Type | Description
 | sheetName | String | Sheet you want to find.
 | throwException | Boolean | When sheetName does not exist, having throwException = true will raise an Exception. throwException = false will return -1 if the sheet is not found.

See also

  • ExcelFile


ExcelFile.GetSheetName Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.GetSheetName Method

Returns the sheet name for a given index. To change the active sheet by the name, use ActiveSheetByName. See also GetSheetIndex(String)

Syntax

Namespace: FlexCel.Core

public abstract String GetSheetName(Int32 sheetIndex)

Parameters

<-> | Parameter | Type | Description
 | sheetIndex | Int32 |

See also

  • ExcelFile


ExcelFile.GetSheetIndexFromID Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.GetSheetIndexFromID Method

Returns the ActiveSheet for a stored SheetID. You can use this method together with SheetID to save and restore an ActiveSheet when you are adding or removing sheets.

If the sheet ID doesn't exist, this method will return 0.

Syntax

Namespace: FlexCel.Core

public abstract Int32 GetSheetIndexFromID(Guid aSheetID)

Parameters

<-> | Parameter | Type | Description
 | aSheetID | Guid |

See also

  • ExcelFile


ExcelFile.GetSheetVisible Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.GetSheetVisible Method

Returns if a given sheet is visible.

Syntax

Namespace: FlexCel.Core

public abstract TXlsSheetVisible GetSheetVisible(Int32 sheet)

Parameters

<-> | Parameter | Type | Description
 | sheet | Int32 | Sheet index (1 based)

See also

  • ExcelFile


ExcelFile.AddSheet Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.AddSheet Method

Inserts an empty sheet at the end of the file. This is equivalent to calling InsertAndCopySheets(0, SheetCount + 1, 1). If you need to insert more than one sheet, or insert it at the middle of existing sheets, use InsertAndCopySheets(Int32, Int32, Int32) instead.

Syntax

Namespace: FlexCel.Core

public void AddSheet()

See also

  • ExcelFile


ExcelFile.AddChartSheet Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.AddChartSheet Method

Adds a chart sheet to the file. You can then add series and customize the returned ExcelChart object. Note that as this is a chart sheet, the anchor is ignored. The ActiveSheet after adding the chart will be set to the newly inserted chart.

Important: This method only works in xlsx files.

Syntax

Namespace: FlexCel.Core

public abstract ExcelChart AddChartSheet(Int32 insertBefore, TChartType chartType, ChartStyle aChartStyle, Boolean roundedCorners, Boolean print, Boolean isLocked)

Parameters

<-> | Parameter | Type | Description
 | insertBefore | Int32 | The sheet before which we will insert (1 based). This might be SheetCount + 1, to insert at the end of the Workbook.
 | chartType | TChartType | Kind of chart created. Note that you can have more than one type of chart in the same chart, so this just sets the base chart type. You can add other chart types over it.
 | aChartStyle | ChartStyle | Theme of the chart. This is a number between 1 and 48 which defines many standard properties for the chart, like the default line width for the series or the legend. The default style is 2.
 | roundedCorners | Boolean | If true, the chart will have rounded corners.
 | print | Boolean | True if the chart should be printed.
 | isLocked | Boolean | True if the chart is locked.

See also

  • ExcelFile


ExcelFile.InsertAndCopySheets Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.InsertAndCopySheets Method

Overloads

  • ExcelFile.InsertAndCopySheets(Int32, Int32, Int32)
  • ExcelFile.InsertAndCopySheets(Int32[], Int32, ExcelFile)
  • ExcelFile.InsertAndCopySheets(Int32, Int32, Int32, ExcelFile)

ExcelFile.InsertAndCopySheets(Int32, Int32, Int32)

Inserts and copies sheet "CopyFrom", SheetCount times before InsertBefore. To insert empty sheets, set CopyFrom = 0 (You might also call AddSheet).

Syntax

Namespace: FlexCel.Core

public void InsertAndCopySheets(Int32 copyFrom, Int32 insertBefore, Int32 aSheetCount)

Parameters

<-> | Parameter | Type | Description
 | copyFrom | Int32 | The sheet index of the sheet we are copying from (1 based). Set it to 0 to insert Empty sheets.
 | insertBefore | Int32 | The sheet before which we will insert (1 based). This might be SheetCount + 1, to insert at the end of the Workbook.
 | aSheetCount | Int32 | How many times the sheet copyFrom will be copied. Note that this is **not** the last sheet to be copied, but how many times a single sheet will be copied instead. This means that for example InsertAndCopySheets(3, 1, 7) will insert 7 copies of sheet 3, not copy sheets 3 to 10. To copy multiple sheets see InsertAndCopySheets(Int32[], Int32, ExcelFile)

See also

  • ExcelFile

ExcelFile.InsertAndCopySheets(Int32[], Int32, ExcelFile)

Inserts and copies all the sheets in the "CopyFrom" array, before InsertBefore into another workbook.

Remarks

When copying sheets from another file, the algorithm used is not so efficient as when copying from the same file.

Use this version of the method only when copying from 2 different files. If you have for example a formula "=Sheet2!A1" in Sheet1, and another formula "=Sheet1!A1" in Sheet2, you need to use this method to copy them, as Copying them one by one (with the standard InsertAndCopySheets(Int32, Int32, Int32, ExcelFile) method) will return an error of formula references not found.

You can also use ConvertFormulasToValues(Boolean) method to avoid formulas before copying between workbooks.

Syntax

Namespace: FlexCel.Core

public abstract void InsertAndCopySheets(Int32[] copyFrom, Int32 insertBefore, ExcelFile sourceWorkbook)

Parameters

<-> | Parameter | Type | Description
 | copyFrom | Int32[] | The sheet index of all the sheets we are copying from (1 based).
 | insertBefore | Int32 | The sheet before which we will insert (1 based). This might be SheetCount+1, to insert at the end of the Workbook.
 | sourceWorkbook | ExcelFile | Workbook from where the sheet will be copied from. On this overloaded version it cannot be null.

See also

  • ExcelFile

ExcelFile.InsertAndCopySheets(Int32, Int32, Int32, ExcelFile)

Inserts and copies sheet "CopyFrom", SheetCount times before InsertBefore. If sourceWorkbook is not null, sheets will be copied from another file. To insert empty sheets, set CopyFrom=0.

Remarks

When copying sheets from another file, the algorithm used is not so efficient as when copying from the same file. Whenever possible, don't copy from different files.

Syntax

Namespace: FlexCel.Core

public abstract void InsertAndCopySheets(Int32 copyFrom, Int32 insertBefore, Int32 aSheetCount, ExcelFile sourceWorkbook)

Parameters

<-> | Parameter | Type | Description
 | copyFrom | Int32 | The sheet index of the sheet we are copying from (1 based). Set it to 0 to insert Empty sheets.
 | insertBefore | Int32 | The sheet before which we will insert (1 based). This might be SheetCount+1, to insert at the end of the Workbook.
 | aSheetCount | Int32 | How many times the sheet copyFrom will be copied. Note that this is **not** the last sheet to be copied, but how many times a single sheet will be copied instead. This means that for example InsertAndCopySheets(3, 1, 7) will insert 7 copies of sheet 3, not copy sheets 3 to 10. To copy multiple sheets see InsertAndCopySheets(Int32[], Int32, ExcelFile)
 | sourceWorkbook | ExcelFile | Workbook from where the sheet will be copied from. Null to copy from the same file.

See also

  • ExcelFile


ExcelFile.ClearSheet Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.ClearSheet Method

Clears all data on the active sheet, but does not delete it.

Syntax

Namespace: FlexCel.Core

public abstract void ClearSheet()

See also

  • ExcelFile
  • DeleteSheet(Int32, Int32)


ExcelFile.DeleteSheet Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.DeleteSheet Method

Overloads

  • ExcelFile.DeleteSheet(Int32)
  • ExcelFile.DeleteSheet(String)
  • ExcelFile.DeleteSheet(Int32, Int32)

ExcelFile.DeleteSheet(Int32)

Deletes the active sheet and aSheetCount-1 sheets more to the right. It will change all formula references to that sheet to invalid, and might change the active sheet so it remains valid.

Syntax

Namespace: FlexCel.Core

public void DeleteSheet(Int32 aSheetCount)

Parameters

<-> | Parameter | Type | Description
 | aSheetCount | Int32 | The number of sheets to delete from the active sheet.

See also

  • ExcelFile
  • ClearSheet

ExcelFile.DeleteSheet(String)

Deletes the sheet with name aSheetName. It will change all formula references to that sheet to invalid, and might change the active sheet so it remains valid.

Syntax

Namespace: FlexCel.Core

public void DeleteSheet(String aSheetName)

Parameters

<-> | Parameter | Type | Description
 | aSheetName | String | The name of the sheet to delete.

See also

  • ExcelFile
  • ClearSheet

ExcelFile.DeleteSheet(Int32, Int32)

Deletes sheet aSheet and aSheetCount-1 sheets more to the right. It will change all formula references to that sheet to invalid, and might change the active sheet so it remains valid.

Syntax

Namespace: FlexCel.Core

public abstract void DeleteSheet(Int32 aSheet, Int32 aSheetCount)

Parameters

<-> | Parameter | Type | Description
 | aSheet | Int32 | First sheet to delete (1-based).
 | aSheetCount | Int32 | The number of sheets to delete.

See also

  • ExcelFile
  • ClearSheet


ExcelFile.GetSheetSelected Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.GetSheetSelected Method

Returns true if a sheet is selected, false otherwise. Note that you might select many sheets in Excel by shift or ctrl-clicking the sheet tabs. Also note that when changing the ActiveSheet, the sheet selected will be reset to the active sheet. So if you want to find out which sheets are selected in a file, you should call this method after opening the file but before changing the active sheet. This property can work in different windows depending on the value of ActiveWindow

Syntax

Namespace: FlexCel.Core

public abstract Boolean GetSheetSelected(Int32 sheetIndex)

Parameters

<-> | Parameter | Type | Description
 | sheetIndex | Int32 | Sheet index for the tab we want to know if it is selected. 1 based.

Returns

True is the sheet is selected, false otherwise.

See also

  • ExcelFile


ExcelFile.SetSheetSelected Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.SetSheetSelected Method

This method will set a sheet tab as selected. Note that this is different from ActiveSheet in that you might have only a single active sheet, but you might select many tabs by ctrl-clicking them. Also note that whenever you change the ActiveSheet, the selected sheets will be reset to the active sheet only. So if you want to save a file with more than one selected sheet, you should call this method after the last call to activesheet. This property can work in different windows depending on the value of ActiveWindow

Syntax

Namespace: FlexCel.Core

public abstract void SetSheetSelected(Int32 sheetIndex, Boolean selected)

Parameters

<-> | Parameter | Type | Description
 | sheetIndex | Int32 | Sheet index for the sheet we want to select or unselect.(1 based)
 | selected | Boolean | If true the sheet will be selected, otherwise it will be unselected.

See also

  • ExcelFile


ExcelFile.GetSheetType Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.GetSheetType Method

Returns the sheet type for a given sheet.

Syntax

Namespace: FlexCel.Core

public abstract TSheetType GetSheetType(Int32 sheet)

Parameters

<-> | Parameter | Type | Description
 | sheet | Int32 | Sheet 1 based.

See also

  • ExcelFile


ExcelFile.HasHPageBreak Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.HasHPageBreak Method

True if the sheet has a Manual Horizontal page break on the row.

Syntax

Namespace: FlexCel.Core

public abstract Boolean HasHPageBreak(Int32 row)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row to check. Note that row can be 0, and this would mean a page break before row 1. (which Excel will ignore)

See also

  • ExcelFile


ExcelFile.HasVPageBreak Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.HasVPageBreak Method

True if the sheet has a Manual Vertical page break on the column.

Syntax

Namespace: FlexCel.Core

public abstract Boolean HasVPageBreak(Int32 col)

Parameters

<-> | Parameter | Type | Description
 | col | Int32 | Column to check Note that column can be 0, and this would mean a page break before column 1. (which Excel will ignore)

See also

  • ExcelFile


ExcelFile.InsertHPageBreak Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.InsertHPageBreak Method

Overloads

  • ExcelFile.InsertHPageBreak(Int32)
  • ExcelFile.InsertHPageBreak(Int32, Boolean)

ExcelFile.InsertHPageBreak(Int32)

Inserts a Horizontal Page Break at the specified row. If there is one already, it will do nothing. If the number of pagebreaks is bigger than the maximum Excel can admit, it will add it anyway, but you might get an exception when saving the file as xls. Exporting as images or PDF will use those additional page breaks. To control what to do when there are too many page breaks, see ErrorActions

Syntax

Namespace: FlexCel.Core

public void InsertHPageBreak(Int32 row)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row where to insert the page break. All row numbers are 1-based, and the breaks occur after the row. Note that row can be 0, and this would mean a page break before row 1. (which Excel will ignore)

See also

  • ExcelFile

ExcelFile.InsertHPageBreak(Int32, Boolean)

Inserts a Horizontal Page Break at the specified row. If there is one already, it will do nothing. If the number of pagebreaks is bigger than the maximum Excel can admit, it will add it anyway, but you might get an exception when saving the file as xls. Exporting as images or PDF will use those additional page breaks. To control what to do when there are too many page breaks, see ErrorActions

Syntax

Namespace: FlexCel.Core

public abstract void InsertHPageBreak(Int32 row, Boolean aGoesAfter)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row where to insert the page break. All row numbers are 1-based, and the breaks occur after the row. Note that row can be 0, and this would mean a page break before row 1. (which Excel will ignore)
 | aGoesAfter | Boolean | This is used by FlexCelReport to add page breaks that behave as if they affected the next row, not the row at the top.

See also

  • ExcelFile


ExcelFile.InsertVPageBreak Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.InsertVPageBreak Method

Overloads

  • ExcelFile.InsertVPageBreak(Int32)
  • ExcelFile.InsertVPageBreak(Int32, Boolean)

ExcelFile.InsertVPageBreak(Int32)

Inserts a Vertical Page Break at the specified column. If there is one already, it will do nothing. If the number of pagebreaks is bigger than the maximum Excel can admit, it will add it anyway, but you might get an exception when saving the file as xls. Exporting as images or PDF will use those additional page breaks. To control what to do when there are too many page breaks, see ErrorActions

Syntax

Namespace: FlexCel.Core

public void InsertVPageBreak(Int32 col)

Parameters

<-> | Parameter | Type | Description
 | col | Int32 | Column where to insert the page break All column numbers are 1-based, and the breaks occur after the column. Note that col can be 0, and this would mean a page break before column 1. (which Excel will ignore)

See also

  • ExcelFile

ExcelFile.InsertVPageBreak(Int32, Boolean)

Inserts a Vertical Page Break at the specified column. If there is one already, it will do nothing. If the number of pagebreaks is bigger than the maximum Excel can admit, it will add it anyway, but you might get an exception when saving the file as xls. Exporting as images or PDF will use those additional page breaks. To control what to do when there are too many page breaks, see ErrorActions

Syntax

Namespace: FlexCel.Core

public abstract void InsertVPageBreak(Int32 col, Boolean aGoesAfter)

Parameters

<-> | Parameter | Type | Description
 | col | Int32 | Column where to insert the page break All column numbers are 1-based, and the breaks occur after the column. Note that col can be 0, and this would mean a page break before column 1. (which Excel will ignore)
 | aGoesAfter | Boolean | This is used by FlexCelReport to add page breaks that behave as if they affected the next column, not the column to the left.

See also

  • ExcelFile


ExcelFile.DeleteHPageBreak Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.DeleteHPageBreak Method

Deletes all manual page breaks at row. If there is no manual page break on row, this method will do nothing.

Syntax

Namespace: FlexCel.Core

public abstract void DeleteHPageBreak(Int32 row)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row where to delete the Page break. Note that row can be 0, and this would mean a page break before row 1. (which Excel will ignore)

See also

  • ExcelFile


ExcelFile.DeleteVPageBreak Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.DeleteVPageBreak Method

Deletes all manual page breaks at col. If there is no manual page break on col, this method will do nothing.

Syntax

Namespace: FlexCel.Core

public abstract void DeleteVPageBreak(Int32 col)

Parameters

<-> | Parameter | Type | Description
 | col | Int32 | Column where to delete the Page break. Note that col can be 0, and this would mean a page break before column 1. (which Excel will ignore)

See also

  • ExcelFile


ExcelFile.ClearPageBreaks Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.ClearPageBreaks Method

Deletes all manual page breaks on the active sheet.

Syntax

Namespace: FlexCel.Core

public abstract void ClearPageBreaks()

See also

  • ExcelFile


ExcelFile.KeepRowsTogether Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.KeepRowsTogether Method

Tells FlexCel that it must try to keep together the rows between row1 and row2 (inclusive) when printing. This method does nothing to the resulting Excel file since this is not an Excel feature. To actually do something, you need to call AutoPageBreaks after calling this method.

Syntax

Namespace: FlexCel.Core

public abstract void KeepRowsTogether(Int32 row1, Int32 row2, Int32 level, Boolean replaceBiggerLevels)

Parameters

<-> | Parameter | Type | Description
 | row1 | Int32 | First row of the group you want to keep together.
 | row2 | Int32 | Last row of the group you want to keep together.
 | level | Int32 | Set this parameter to 0 to remove the condition to keep rows together. Any bigger than zero value will mean that the rows must be kept together. You can use more than one level to tell FlexCel to try to keep different groups together. If all rows cannot be kept together in one page, FlexCel will try to keep as much rows with higher levels as possible. See the example for more information.
 | replaceBiggerLevels | Boolean | If true, all existing level values in the row range will be replaced. If false, the new level values will be written only if they are bigger than the existing ones. You can use the false setting to set many values in any order. For example, if you first call KeepRowsTogether(2, 3, 5, false) and then KeepRowsTogether(1, 10, 1, false), rows 2 and 3 will keep the level in 5. If you did so with this parameter true, the second call would replace the levels of rows 2 and 3 to level 1, making all row levels between 1 and 10 equal to 1.

Examples

If you call:

    xls.KeepColsTogether(1, 10, 1, true);
    xls.KeepColsTogether(3, 4, 2, true);

This will define two groups. FlexCel will try to keep rows 1 to 10 in one page. But if this is impossible, it will try to keep at least rows 3 and 4 together.

Values of the "level" parameter mean the strongness of the link. Rows with higher level values have a stronger link, and if it is impossible to keep all rows together, FlexCel will try to keep the higher level rows.

In this case, Rows 3 and 4 have a higher level, so if rows 1 to 10 cannot be kept together in one page, FlexCel will try to keep at least rows 3 and 4. Normally you will want to use higher level values completely inside groups with lower levels. If we called:

    xls.KeepRowsTogether(1, 10, 1, true);
    xls.KeepRowsTogether(3, 4, 1, true);

The second call would do nothing, since the level is the same, and rows 1 to 10 are already linked.

See also

  • ExcelFile


ExcelFile.KeepColsTogether Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.KeepColsTogether Method

Tells FlexCel that it must try to keep together the columns between col1 and col2 (inclusive) when printing. This method does nothing to the resulting Excel file since this is not an Excel feature. To actually do something, you need to call AutoPageBreaks after calling this method.

Syntax

Namespace: FlexCel.Core

public abstract void KeepColsTogether(Int32 col1, Int32 col2, Int32 level, Boolean replaceBiggerLevels)

Parameters

<-> | Parameter | Type | Description
 | col1 | Int32 | First column of the group you want to keep together.
 | col2 | Int32 | Last column of the group you want to keep together.
 | level | Int32 | Set this parameter to 0 to remove the condition to keep columns together. Any bigger than zero value will mean that the rows must be kept together. You can use more than one level to tell FlexCel to try to keep different groups together, If all columns cannot be kept together in one page, FlexCel will try to keep as much columns with higher levels as possible. See the example for more information.
 | replaceBiggerLevels | Boolean | If true, all existing level values in the column range will be replaced. If false, the new level values will be written only if they are bigger than the existing ones. You can use the false setting to set many values in any order. For example, if you first call KeepColsTogether(2, 3, 5, false) and then KeepColsTogether(1, 10, 1, false), columns 2 and 3 will keep the level in 5. If you did so with this parameter true, the second call would replace the levels of columns 2 and 3 to level 1, making all column levels between 1 and 10 equal to 1.

Examples

If you call:

    xls.KeepColsTogether(1, 10, 1, true);
    xls.KeepColsTogether(3, 4, 2, true);

This will define two groups. FlexCel will try to keep columns 1 to 10 in one page. But if this is impossible, it will try to keep at least columns 3 and 4 together.

Values of the "level" parameter mean the strongness of the link. Columns with higher level values have a stronger link, and if it is impossible to keep all columns together, FlexCel will try to keep the higher level columns.

In this case, Columns 3 and 4 have a higher level, so if columns 1 to 10 cannot be kept together in one page, FlexCel will try to keep at least columns 3 and 4. Normally you will want to use higher level values completely inside groups with lower levels. If we called:

    xls.KeepRowsTogether(1, 10, 1, true);
    xls.KeepRowsTogether(3, 4, 1, true);

The second call would do nothing, since the level is the same, and columns 1 to 10 are already linked.

See also

  • ExcelFile


ExcelFile.ClearKeepRowsAndColsTogether Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.ClearKeepRowsAndColsTogether Method

Clears all the "KeepTogether" links in the current page.

Syntax

Namespace: FlexCel.Core

public void ClearKeepRowsAndColsTogether()

See also

  • ExcelFile


ExcelFile.GetKeepRowsTogether Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.GetKeepRowsTogether Method

Returns the value of level for a row as set in KeepRowsTogether. Note that the last value of a "keep together" range is 0. For example, if you set KeepRowsTogether(1, 3, 8, true); GetKeepRowsTogether will return 8 for rows 1 and 2, and 0 for row 3.

Syntax

Namespace: FlexCel.Core

public abstract Int32 GetKeepRowsTogether(Int32 row)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row index. (1 based)

Returns

The Keep together level of the row.

See also

  • ExcelFile


ExcelFile.GetKeepColsTogether Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.GetKeepColsTogether Method

Returns the value of level for a column as set in KeepColsTogether. Note that the last value of a "keep together" range is 0. For example, if you set KeepColsTogether(1, 3, 8, true); GetKeepColsTogether will return 8 for columns 1 and 2, and 0 for column 3.

Syntax

Namespace: FlexCel.Core

public abstract Int32 GetKeepColsTogether(Int32 col)

Parameters

<-> | Parameter | Type | Description
 | col | Int32 | Column index. (1 based)

Returns

The Keep together level of the column.

See also

  • ExcelFile


ExcelFile.HasKeepRowsTogether Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.HasKeepRowsTogether Method

Returns true if there is any row marked as keeptogether in the sheet. This method traverses every row to find out, so it can be somehow slow and you should not call it too often.

Syntax

Namespace: FlexCel.Core

public abstract Boolean HasKeepRowsTogether()

See also

  • ExcelFile


ExcelFile.HasKeepColsTogether Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.HasKeepColsTogether Method

Returns true if there is any column marked as keeptogether in the sheet. This method traverses every column to find out, so it can be somehow slow and you should not call it too often.

Syntax

Namespace: FlexCel.Core

public abstract Boolean HasKeepColsTogether()

See also

  • ExcelFile


ExcelFile.DumpKeepRowsTogetherLevels Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.DumpKeepRowsTogetherLevels Method

This method is used for debugging intelligent page breaks (see 'Intelligent page breaks' in the Api Developer Guide. It will read the keep-together level for every row ad write it at the column "col". Note that the contents of col will be overwritten.

Syntax

Namespace: FlexCel.Core

public abstract void DumpKeepRowsTogetherLevels(Int32 col, Int32 XF)

Parameters

<-> | Parameter | Type | Description
 | col | Int32 | Column where the keep-together levels will be written (1 based). Existing data in the column will be overwritten.
 | XF | Int32 | Format for the cells that will be written.

See also

  • ExcelFile


ExcelFile.DumpKeepColsTogetherLevels Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.DumpKeepColsTogetherLevels Method

This method is used for debugging intelligent page breaks (see 'Intelligent page breaks' in the Api Developer Guide. It will read the keep-together level for every column and writer it the row "row". Note that the contents of row will be overwritten.

Syntax

Namespace: FlexCel.Core

public abstract void DumpKeepColsTogetherLevels(Int32 row, Int32 XF)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row where the keep-together levels will be written (1 based). Existing data in the row will be overwritten.
 | XF | Int32 | Format for the cells that will be written.

See also

  • ExcelFile


ExcelFile.AutoPageBreaks Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.AutoPageBreaks Method

Overloads

  • ExcelFile.AutoPageBreaks
  • ExcelFile.AutoPageBreaks(Int32, Int32)
  • ExcelFile.AutoPageBreaks(Int32, TUIRectangle)

ExcelFile.AutoPageBreaks

This method will create manual page breaks in the sheet to try to keep together the rows and columns marked with KeepRowsTogether and KeepColsTogether. It might be desirable to clear all manual page breaks (with ClearPageBreaks) before calling this method, so it has more freedom to place the new ones. If you call this method twice without removing the old page breaks, it will add the page breaks to the existing ones.

Remarks

This method is the same as calling AutoPageBreaks(20, 95)

Syntax

Namespace: FlexCel.Core

public void AutoPageBreaks()

See also

  • ExcelFile

ExcelFile.AutoPageBreaks(Int32, Int32)

This method will create manual page breaks in the sheet to try to keep together the rows and columns marked with KeepRowsTogether and KeepColsTogether. It might be desirable to clear all manual page breaks (with ClearPageBreaks) before calling this method, so it has more freedom to place the new ones. If you call this method twice without removing the old page breaks, it will add the page breaks to the existing ones.

Syntax

Namespace: FlexCel.Core

public abstract void AutoPageBreaks(Int32 PercentOfUsedSheet, Int32 PageScale)

Parameters

<-> | Parameter | Type | Description
 | PercentOfUsedSheet | Int32 | Percentage of the sheet that must be used in any page when fitting the rows and columns. A value of zero means that no part of the sheet must be used, so FlexCel might add a page break after a single row in a page, leaving it almost completely blank. A value of 50% means that half of the page must be used. This means that FlexCel will add a page break only if there is 50% of the current page already used. A value of 100% will do nothing, since the sheet must be completely used, and so FlexCel can never add a page break.
 | PageScale | Int32 | This parameter must be between 50 and 100, and means how much smaller page will be considered in order to calculate the page breaks. A value of 100 means that the size used in the calculation will be the real size of the page, and while this will always work fine when exporting to PDF or exporting to images, when printing from Excel might result in a page break that is placed a little after where it should go and an empty page for certain printers. (Page size in Excel is different for different printers) Normally a value around 95 is the recommended value for this parameter. If you need to do a finer grain adjustment, you can use AutoPageBreaks(Int32, TUIRectangle).

See also

  • ExcelFile

ExcelFile.AutoPageBreaks(Int32, TUIRectangle)

This method will create manual page breaks in the sheet to try to keep together the rows and columns marked with KeepRowsTogether and KeepColsTogether. It might be desirable to clear all manual page breaks (with ClearPageBreaks) before calling this method, so it has more freedom to place the new ones. If you call this method twice without removing the old page breaks, it will add the page breaks to the existing ones.

Syntax

Namespace: FlexCel.Core

public abstract void AutoPageBreaks(Int32 PercentOfUsedSheet, TUIRectangle PageBounds)

Parameters

<-> | Parameter | Type | Description
 | PercentOfUsedSheet | Int32 | Percentage of the sheet that must be used in any page when fitting the rows and columns. A value of zero means that no part of the sheet must be used, so FlexCel might add a page break after a single row in a page, leaving it almost completely blank. A value of 50% means that half of the page must be used. This means that FlexCel will add a page break only if there is 50% of the current page already used. A value of 100% will do nothing, since the sheet must be completely used, and so FlexCel can never add a page break.
 | PageBounds | TUIRectangle | You can customize a custom page size here. If width or height of this parameter is 0, the paper size specified in the file will be used. There is normally no need to set this parameter, unless you want to fine tune the results.

See also

  • ExcelFile


ExcelFile.GetCellValue Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.GetCellValue Method

Overloads

  • ExcelFile.GetCellValue(String)
  • ExcelFile.GetCellValue(Int32, Int32)
  • ExcelFile.GetCellValue(Int32, Int32, Int32)
  • ExcelFile.GetCellValue(Int32, Int32, Int32, Int32)

ExcelFile.GetCellValue(String)

Reads a cell value given a cell reference. While this is normally not needed because you can use TCellAddress to convert the cell reference to row and column and then use a standard GetCellValue call, it can be handy if you know the cell reference (like AX42) and want a fast way to get the value of the cell.

Syntax

Namespace: FlexCel.Core

public Object GetCellValue(String cellRef)

Parameters

<-> | Parameter | Type | Description
 | cellRef | String | Cell reference in A1 notation. Something like A3, or Sheet1!$B$5 can be used here.

See also

  • ExcelFile

ExcelFile.GetCellValue(Int32, Int32)

Reads a Cell Value.

Remarks

This method will return the real value stored on the cell. For example, if you have "1.3" formatted as "1.30", GetCellValue will return the number 1.3. To get a string with the formatted value, see GetStringFromCell(Int32, Int32)

Syntax

Namespace: FlexCel.Core

public Object GetCellValue(Int32 row, Int32 col)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row, 1 based.
 | col | Int32 | Column, 1 based.

Returns

Object with the value. It can be null, a double, a string, a boolean, a TFormula, a TFlxFormulaErrorValue or TRichString. Dates are returned as doubles. See the Reading Files demo to know how to use each type of the objects returned.

See also

  • ExcelFile

ExcelFile.GetCellValue(Int32, Int32, Int32)

Reads a Cell Value and Format.

Syntax

Namespace: FlexCel.Core

public abstract Object GetCellValue(Int32 row, Int32 col, ref Int32 XF)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row, 1 based.
 | col | Int32 | Column, 1 based.
ref | XF | Int32 | XF format.

Returns

Object with the value. It can be null, a double, a string, a boolean, a TFormula, a TFlxFormulaErrorValue or a TRichString. Dates are returned as doubles. See the Reading Files demo to know how to use each type of the objects returned.

See also

  • ExcelFile

ExcelFile.GetCellValue(Int32, Int32, Int32, Int32)

Reads a Cell Value and Format from a sheet that is not the active sheet.

Syntax

Namespace: FlexCel.Core

public abstract Object GetCellValue(Int32 sheet, Int32 row, Int32 col, ref Int32 XF)

Parameters

<-> | Parameter | Type | Description
 | sheet | Int32 | Sheet where is the cell you want to get the value.
 | row | Int32 | Row, 1 based.
 | col | Int32 | Column, 1 based.
ref | XF | Int32 | XF format.

Returns

Object with the value. It can be null, a double, a string, a boolean, a TFormula, a TFlxFormulaErrorValue or a TRichString. Dates are returned as doubles. See the Reading Files demo to know how to use each type of the objects returned.

See also

  • ExcelFile


ExcelFile.GetCellValueIndexed Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.GetCellValueIndexed Method

Overloads

  • ExcelFile.GetCellValueIndexed(Int32, Int32, Int32)
  • ExcelFile.GetCellValueIndexed(Int32, Int32, Int32, Int32)

ExcelFile.GetCellValueIndexed(Int32, Int32, Int32)

Reads a Cell Value and Format, using a column index for faster access. Normal GetCellValue(row, col) has to search for the column on a sorted list. If you are looping from 1 to ColCountInRow(Int32) this method is faster.

Syntax

Namespace: FlexCel.Core

public Object GetCellValueIndexed(Int32 row, Int32 colIndex, ref Int32 XF)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row, 1 based.
 | colIndex | Int32 | Column index, 1 based.
ref | XF | Int32 | XF format.

Returns

Object with the value. It can be null, a double, a string, a boolean, a TFormula, a TFlxFormulaErrorValue or a TRichString. Dates are returned as doubles. See the Reading Files demo to know how to use each type of the objects returned.

See also

  • ExcelFile

ExcelFile.GetCellValueIndexed(Int32, Int32, Int32, Int32)

Reads a Cell Value and Format, using a column index for faster access. Normal GetCellValue(row, col) has to search for the column on a sorted list. If you are looping from 1 to ColCountInRow(Int32) this method is faster.

Syntax

Namespace: FlexCel.Core

public abstract Object GetCellValueIndexed(Int32 sheet, Int32 row, Int32 colIndex, ref Int32 XF)

Parameters

<-> | Parameter | Type | Description
 | sheet | Int32 | Sheet where the cell is, 1 based.
 | row | Int32 | Row, 1 based.
 | colIndex | Int32 | Column index, 1 based.
ref | XF | Int32 | XF format.

Returns

Object with the value. It can be null, a double, a string, a boolean, a TFormula, a TFlxFormulaErrorValue or a TRichString. Dates are returned as doubles. See the Reading Files demo to know how to use each type of the objects returned.

See also

  • ExcelFile


ExcelFile.SetCellValue Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.SetCellValue Method

Overloads

  • ExcelFile.SetCellValue(String, Object)
  • ExcelFile.SetCellValue(Int32, Int32, Object)
  • ExcelFile.SetCellValue(Int32, Int32, Object, Int32)
  • ExcelFile.SetCellValue(Int32, Int32, Int32, Object, Int32)

ExcelFile.SetCellValue(String, Object)

Sets a cell value given a cell reference. While this is normally not needed because you can use TCellAddress to convert the cell reference to row and column and then use a standard SetCellValue call, it can be handy if you know the cell reference (like AX42) and want a fast way to set the value of the cell.

Syntax

Namespace: FlexCel.Core

public void SetCellValue(String cellRef, Object value)

Parameters

<-> | Parameter | Type | Description
 | cellRef | String | Cell reference in A1 notation. Something like A3, or Sheet1!$B$5 can be used here.
 | value | Object | Value to set.

See also

  • ExcelFile

ExcelFile.SetCellValue(Int32, Int32, Object)

Sets the value on a cell.

Remarks

This method will enter the datatype of the object you pass to it. For example, if you set value="1" the string "1" will be entered on the cell. To convert a string to the best representation (on this case a number), use SetCellFromString(Int32, Int32, TRichString, Int32). To enter a HTML formatted string, use SetCellFromHtml(Int32, Int32, String, Int32)

Syntax

Namespace: FlexCel.Core

public void SetCellValue(Int32 row, Int32 col, Object value)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row, 1 based.
 | col | Int32 | Column, 1 based.
 | value | Object | Value to set.

See also

  • ExcelFile

ExcelFile.SetCellValue(Int32, Int32, Object, Int32)

Sets the value and format on a cell.

Remarks

This method will enter the datatype of the object you pass to it. For example, if you set value="1" the string "1" will be entered on the cell. To convert a string to the best representation (on this case a number), use SetCellFromString(Int32, Int32, TRichString, Int32) To enter a HTML formatted string, use SetCellFromHtml(Int32, Int32, String, Int32)

Syntax

Namespace: FlexCel.Core

public abstract void SetCellValue(Int32 row, Int32 col, Object value, Int32 XF)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row, 1 based.
 | col | Int32 | Column, 1 based.
 | value | Object | Value to set.
 | XF | Int32 | Format to Set. You normally get this number with AddFormat function. Use -1 to keep format unchanged.

See also

  • ExcelFile

ExcelFile.SetCellValue(Int32, Int32, Int32, Object, Int32)

Sets the value on a cell.

Remarks

This method will enter the datatype of the object you pass to it. For example, if you set value="1" the string "1" will be entered on the cell. To convert a string to the best representation (on this case a number), use SetCellFromString(Int32, Int32, TRichString, Int32). To enter a HTML formatted string, use SetCellFromHtml(Int32, Int32, String, Int32)

Syntax

Namespace: FlexCel.Core

public abstract void SetCellValue(Int32 sheet, Int32 row, Int32 col, Object value, Int32 XF)

Parameters

<-> | Parameter | Type | Description
 | sheet | Int32 | Sheet number, 1 based
 | row | Int32 | Row, 1 based.
 | col | Int32 | Column, 1 based.
 | value | Object | Value to set.
 | XF | Int32 | Format to Set. You normally get this number with AddFormat function. Use -1 to keep format unchanged.

See also

  • ExcelFile


ExcelFile.ConvertString Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.ConvertString Method

Overloads

  • ExcelFile.ConvertString(TRichString, Int32)
  • ExcelFile.ConvertString(TRichString, Int32, String[])

ExcelFile.ConvertString(TRichString, Int32)

Converts a string into the best datatype (a boolean, a number, etc)

Remarks

See SetCellFromString(Int32, Int32, TRichString, Int32) for more information.

Syntax

Namespace: FlexCel.Core

public Object ConvertString(TRichString value, ref Int32 XF)

Parameters

<-> | Parameter | Type | Description
 | value | TRichString | RichString to convert.
ref | XF | Int32 | XF of the cell. It might be modified, for example, if you are entering a date.

Returns

value converted to the best datatype.

See also

  • ExcelFile

ExcelFile.ConvertString(TRichString, Int32, String[])

Converts a string into the best datatype (a boolean, a number, etc)

Remarks

See SetCellFromString(Int32, Int32, TRichString, Int32) for more information.

Syntax

Namespace: FlexCel.Core

public abstract Object ConvertString(TRichString value, ref Int32 XF, String[] dateFormats)

Parameters

<-> | Parameter | Type | Description
 | value | TRichString | RichString to convert.
ref | XF | Int32 | XF of the cell. It might be modified, for example, if you are entering a date.
 | dateFormats | String[] | A list of formats allowed for dates and times. Windows is a little liberal in what it thinks can be a date, and it can convert things like "1.2" into dates. By setting this property, you can ensure the dates are only in the formats you expect. If you leave it null, we will trust "DateTime.TryParse" to guess the correct values.

Returns

value converted to the best datatype.

See also

  • ExcelFile


ExcelFile.SetCellFromString Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.SetCellFromString Method

Overloads

  • ExcelFile.SetCellFromString(Int32, Int32, String)
  • ExcelFile.SetCellFromString(Int32, Int32, TRichString)
  • ExcelFile.SetCellFromString(String, String, String[])
  • ExcelFile.SetCellFromString(Int32, Int32, String, String[])
  • ExcelFile.SetCellFromString(Int32, Int32, TRichString, String[])
  • ExcelFile.SetCellFromString(Int32, Int32, String, Int32)
  • ExcelFile.SetCellFromString(Int32, Int32, TRichString, Int32)
  • ExcelFile.SetCellFromString(Int32, Int32, String, Int32, String[])
  • ExcelFile.SetCellFromString(Int32, Int32, TRichString, Int32, String[])
  • ExcelFile.SetCellFromString(Int32, Int32, Int32, TRichString, Int32, String[])

ExcelFile.SetCellFromString(Int32, Int32, String)

Converts a string to the best datatype, and the enters it into a cell.

Remarks

When using SetCellValue(Int32, Int32, Object) to set a cell value, you have to know the datatype you want to enter. That is, if you have a string s = "1/1/2002" and call SetCellValue(1, 1, s); the cell A1 will end up with a string "1/1/2002" and not with a date. The same if you have a string holding a number.

SetCellFromString tries to solve this problem. When you call SetCellFromString(1, 1, s) it will look:

  1. If s contains a valid number: If it does, it will enter the number into the cell, and not the string s
  2. If s contains a boolean: If s equals the words "TRUE" or "FALSE" (or whatever you define on the constants TxtTrue and TxtFalse) it will enter the boolean into the cell
  3. If s contains a date: If s is a valid date (according to your windows settings, or with a list of allowed date/time formats) it will enter a number into the cell and format the cell as a date. (see 'Date cells' in the Api Developer Guide)
  4. In any other case, it will enter the string s into the cell.

Syntax

Namespace: FlexCel.Core

public void SetCellFromString(Int32 row, Int32 col, String value)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Cell Row (1 based)
 | col | Int32 | Cell Column (1 based)
 | value | String | Value to enter into the cell.

See also

  • ExcelFile

ExcelFile.SetCellFromString(Int32, Int32, TRichString)

Converts a string to the best datatype, and the enters it into a cell.

Remarks

When using SetCellValue(Int32, Int32, Object) to set a cell value, you have to know the datatype you want to enter. That is, if you have a string s = "1/1/2002" and call SetCellValue(1, 1, s); the cell A1 will end up with a string "1/1/2002" and not with a date. The same if you have a string holding a number.

SetCellFromString tries to solve this problem. When you call SetCellFromString(1, 1, s) it will look:

  1. If s contains a valid number: If it does, it will enter the number into the cell, and not the string s
  2. If s contains a boolean: If s equals the words "TRUE" or "FALSE" (or whatever you define on the constants TxtTrue and TxtFalse) it will enter the boolean into the cell
  3. If s contains a date: If s is a valid date (according to your windows settings, or with a list of allowed date/time formats) it will enter a number into the cell and format the cell as a date. (see 'Date cells' in the Api Developer Guide)
  4. In any other case, it will enter the string s into the cell.

Syntax

Namespace: FlexCel.Core

public void SetCellFromString(Int32 row, Int32 col, TRichString value)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Cell Row (1 based)
 | col | Int32 | Cell Column (1 based)
 | value | TRichString | Value to enter into the cell.

See also

  • ExcelFile

ExcelFile.SetCellFromString(String, String, String[])

Converts a string into the best datatype (a boolean, a number, etc)

Remarks

See SetCellFromString(Int32, Int32, TRichString, Int32) for more information.

Syntax

Namespace: FlexCel.Core

public void SetCellFromString(String cellRef, String value, String[] dateFormats)

Parameters

<-> | Parameter | Type | Description
 | cellRef | String | Cell reference in A1 notation. Something like A3, or Sheet1!$B$5 can be used here.
 | value | String | RichString to convert.
 | dateFormats | String[] | A list of formats allowed for dates and times. Windows is a little liberal in what it thinks can be a date, and it can convert things like "1.2" into dates. By setting this property, you can ensure the dates are only in the formats you expect. If you leave it null, we will trust "DateTime.TryParse" to guess the correct values.

See also

  • ExcelFile

ExcelFile.SetCellFromString(Int32, Int32, String, String[])

Converts a string to the best datatype, and the enters it into a cell.

Remarks

When using SetCellValue(Int32, Int32, Object) to set a cell value, you have to know the datatype you want to enter. That is, if you have a string s = "1/1/2002" and call SetCellValue(1, 1, s); the cell A1 will end up with a string "1/1/2002" and not with a date. The same if you have a string holding a number.

SetCellFromString tries to solve this problem. When you call SetCellFromString(1, 1, s) it will look:

  1. If s contains a valid number: If it does, it will enter the number into the cell, and not the string s
  2. If s contains a boolean: If s equals the words "TRUE" or "FALSE" (or whatever you define on the constants TxtTrue and TxtFalse) it will enter the boolean into the cell
  3. If s contains a date: If s is a valid date (according to your windows settings, or with a list of allowed date/time formats) it will enter a number into the cell and format the cell as a date. (see 'Date cells' in the Api Developer Guide)
  4. In any other case, it will enter the string s into the cell.

Syntax

Namespace: FlexCel.Core

public void SetCellFromString(Int32 row, Int32 col, String value, String[] dateFormats)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Cell Row (1 based)
 | col | Int32 | Cell Column (1 based)
 | value | String | Value to enter into the cell.
 | dateFormats | String[] | A list of formats allowed for dates and times. Windows is a little liberal in what it thinks can be a date, and it can convert things like "1.2" into dates. By setting this property, you can ensure the dates are only in the formats you expect. If you leave it null, we will trust "DateTime.TryParse" to guess the correct values.

See also

  • ExcelFile

ExcelFile.SetCellFromString(Int32, Int32, TRichString, String[])

Converts a string to the best datatype, and the enters it into a cell.

Remarks

When using SetCellValue(Int32, Int32, Object) to set a cell value, you have to know the datatype you want to enter. That is, if you have a string s = "1/1/2002" and call SetCellValue(1, 1, s); the cell A1 will end up with a string "1/1/2002" and not with a date. The same if you have a string holding a number.

SetCellFromString tries to solve this problem. When you call SetCellFromString(1, 1, s) it will look:

  1. If s contains a valid number: If it does, it will enter the number into the cell, and not the string s
  2. If s contains a boolean: If s equals the words "TRUE" or "FALSE" (or whatever you define on the constants TxtTrue and TxtFalse) it will enter the boolean into the cell
  3. If s contains a date: If s is a valid date (according to your windows settings, or with a list of allowed date/time formats) it will enter a number into the cell and format the cell as a date. (see 'Date cells' in the Api Developer Guide)
  4. In any other case, it will enter the string s into the cell.

Syntax

Namespace: FlexCel.Core

public void SetCellFromString(Int32 row, Int32 col, TRichString value, String[] dateFormats)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Cell Row (1 based)
 | col | Int32 | Cell Column (1 based)
 | value | TRichString | Value to enter into the cell.
 | dateFormats | String[] | A list of formats allowed for dates and times. Windows is a little liberal in what it thinks can be a date, and it can convert things like "1.2" into dates. By setting this property, you can ensure the dates are only in the formats you expect. If you leave it null, we will trust "DateTime.TryParse" to guess the correct values.

See also

  • ExcelFile

ExcelFile.SetCellFromString(Int32, Int32, String, Int32)

Converts a string to the best datatype, and the enters it into a cell.

Remarks

When using SetCellValue(Int32, Int32, Object) to set a cell value, you have to know the datatype you want to enter. That is, if you have a string s = "1/1/2002" and call SetCellValue(1, 1, s); the cell A1 will end up with a string "1/1/2002" and not with a date. The same if you have a string holding a number.

SetCellFromString tries to solve this problem. When you call SetCellFromString(1, 1, s) it will look:

  1. If s contains a valid number: If it does, it will enter the number into the cell, and not the string s
  2. If s contains a boolean: If s equals the words "TRUE" or "FALSE" (or whatever you define on the constants TxtTrue and TxtFalse) it will enter the boolean into the cell
  3. If s contains a date: If s is a valid date (according to your windows settings, or with a list of allowed date/time formats) it will enter a number into the cell and format the cell as a date. (see 'Date cells' in the Api Developer Guide)
  4. In any other case, it will enter the string s into the cell.

Syntax

Namespace: FlexCel.Core

public void SetCellFromString(Int32 row, Int32 col, String value, Int32 XF)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Cell Row (1 based)
 | col | Int32 | Cell Column (1 based)
 | value | String | Value to enter into the cell.
 | XF | Int32 | New XF of the cell. It can be modified, i.e. if you enter a date, the XF will be converted to a Date XF.

See also

  • ExcelFile

ExcelFile.SetCellFromString(Int32, Int32, TRichString, Int32)

Converts a string to the best datatype, and the enters it into a cell.

Remarks

When using SetCellValue(Int32, Int32, Object) to set a cell value, you have to know the datatype you want to enter. That is, if you have a string s = "1/1/2002" and call SetCellValue(1, 1, s); the cell A1 will end up with a string "1/1/2002" and not with a date. The same if you have a string holding a number.

SetCellFromString tries to solve this problem. When you call SetCellFromString(1, 1, s) it will look:

  1. If s contains a valid number: If it does, it will enter the number into the cell, and not the string s
  2. If s contains a boolean: If s equals the words "TRUE" or "FALSE" (or whatever you define on the constants TxtTrue and TxtFalse) it will enter the boolean into the cell
  3. If s contains a date: If s is a valid date (according to your windows settings, or with a list of allowed date/time formats) it will enter a number into the cell and format the cell as a date. (see 'Date cells' in the Api Developer Guide)
  4. In any other case, it will enter the string s into the cell.

Syntax

Namespace: FlexCel.Core

public void SetCellFromString(Int32 row, Int32 col, TRichString value, Int32 XF)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Cell Row (1 based)
 | col | Int32 | Cell Column (1 based)
 | value | TRichString | Value to enter into the cell.
 | XF | Int32 | New XF of the cell. It can be modified, i.e. if you enter a date, the XF will be converted to a Date XF.

See also

  • ExcelFile

ExcelFile.SetCellFromString(Int32, Int32, String, Int32, String[])

Converts a string to the best datatype, and the enters it into a cell.

Remarks

When using SetCellValue(Int32, Int32, Object) to set a cell value, you have to know the datatype you want to enter. That is, if you have a string s = "1/1/2002" and call SetCellValue(1, 1, s); the cell A1 will end up with a string "1/1/2002" and not with a date. The same if you have a string holding a number.

SetCellFromString tries to solve this problem. When you call SetCellFromString(1, 1, s) it will look:

  1. If s contains a valid number: If it does, it will enter the number into the cell, and not the string s
  2. If s contains a boolean: If s equals the words "TRUE" or "FALSE" (or whatever you define on the constants TxtTrue and TxtFalse) it will enter the boolean into the cell
  3. If s contains a date: If s is a valid date (according to your windows settings, or with a list of allowed date/time formats) it will enter a number into the cell and format the cell as a date. (see 'Date cells' in the Api Developer Guide)
  4. In any other case, it will enter the string s into the cell.

Syntax

Namespace: FlexCel.Core

public void SetCellFromString(Int32 row, Int32 col, String value, Int32 XF, String[] dateFormats)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Cell Row (1 based)
 | col | Int32 | Cell Column (1 based)
 | value | String | Value to enter into the cell.
 | XF | Int32 | New XF of the cell. It can be modified, i.e. if you enter a date, the XF will be converted to a Date XF.
 | dateFormats | String[] | A list of formats allowed for dates and times. Windows is a little liberal in what it thinks can be a date, and it can convert things like "1.2" into dates. By setting this property, you can ensure the dates are only in the formats you expect. If you leave it null, we will trust "DateTime.TryParse" to guess the correct values.

See also

  • ExcelFile

ExcelFile.SetCellFromString(Int32, Int32, TRichString, Int32, String[])

Converts a string to the best datatype, and the enters it into a cell.

Remarks

When using SetCellValue(Int32, Int32, Object) to set a cell value, you have to know the datatype you want to enter. That is, if you have a string s = "1/1/2002" and call SetCellValue(1, 1, s); the cell A1 will end up with a string "1/1/2002" and not with a date. The same if you have a string holding a number.

SetCellFromString tries to solve this problem. When you call SetCellFromString(1, 1, s) it will look:

  1. If s contains a valid number: If it does, it will enter the number into the cell, and not the string s
  2. If s contains a boolean: If s equals the words "TRUE" or "FALSE" (or whatever you define on the constants TxtTrue and TxtFalse) it will enter the boolean into the cell
  3. If s contains a date: If s is a valid date (according to your windows settings, or with a list of allowed date/time formats) it will enter a number into the cell and format the cell as a date. (see 'Date cells' in the Api Developer Guide)
  4. In any other case, it will enter the string s into the cell.

Syntax

Namespace: FlexCel.Core

public void SetCellFromString(Int32 row, Int32 col, TRichString value, Int32 XF, String[] dateFormats)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Cell Row (1 based)
 | col | Int32 | Cell Column (1 based)
 | value | TRichString | Value to enter into the cell.
 | XF | Int32 | New XF of the cell. It can be modified, i.e. if you enter a date, the XF will be converted to a Date XF.
 | dateFormats | String[] | A list of formats allowed for dates and times. Windows is a little liberal in what it thinks can be a date, and it can convert things like "1.2" into dates. By setting this property, you can ensure the dates are only in the formats you expect. If you leave it null, we will trust "DateTime.TryParse" to guess the correct values.

See also

  • ExcelFile

ExcelFile.SetCellFromString(Int32, Int32, Int32, TRichString, Int32, String[])

Converts a string to the best datatype, and the enters it into a cell.

Remarks

When using SetCellValue(Int32, Int32, Object) to set a cell value, you have to know the datatype you want to enter. That is, if you have a string s = "1/1/2002" and call SetCellValue(1, 1, s); the cell A1 will end up with a string "1/1/2002" and not with a date. The same if you have a string holding a number.

SetCellFromString tries to solve this problem. When you call SetCellFromString(1, 1, s) it will look:

  1. If s contains a valid number: If it does, it will enter the number into the cell, and not the string s
  2. If s contains a boolean: If s equals the words "TRUE" or "FALSE" (or whatever you define on the constants TxtTrue and TxtFalse) it will enter the boolean into the cell
  3. If s contains a date: If s is a valid date (according to your windows settings, or with a list of allowed date/time formats) it will enter a number into the cell and format the cell as a date. (see 'Date cells' in the Api Developer Guide)
  4. In any other case, it will enter the string s into the cell.

Syntax

Namespace: FlexCel.Core

public abstract void SetCellFromString(Int32 sheet, Int32 row, Int32 col, TRichString value, Int32 XF, String[] dateFormats)

Parameters

<-> | Parameter | Type | Description
 | sheet | Int32 | Sheet where the cell is (1 based)
 | row | Int32 | Cell Row (1 based)
 | col | Int32 | Cell Column (1 based)
 | value | TRichString | Value to enter into the cell.
 | XF | Int32 | New XF of the cell. It can be modified, i.e. if you enter a date, the XF will be converted to a Date XF.
 | dateFormats | String[] | A list of formats allowed for dates and times. Windows is a little liberal in what it thinks can be a date, and it can convert things like "1.2" into dates. By setting this property, you can ensure the dates are only in the formats you expect. If you leave it null, we will trust "DateTime.TryParse" to guess the correct values.

See also

  • ExcelFile


ExcelFile.GetStringFromCell Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.GetStringFromCell Method

Overloads

  • ExcelFile.GetStringFromCell(String)
  • ExcelFile.GetStringFromCell(Int32, Int32)
  • ExcelFile.GetStringFromCell(Int32, Int32, Boolean)
  • ExcelFile.GetStringFromCell(Int32, Int32, Int32, TUIColor)
  • ExcelFile.GetStringFromCell(Int32, Int32, Int32, Int32, TUIColor)
  • ExcelFile.GetStringFromCell(Int32, Int32, Int32, Int32, TUIColor, Boolean)

ExcelFile.GetStringFromCell(String)

This method will return a rich string that is formatted similar to the way Excel shows it. For example, if you have "1.0" on a cell, and the cell is formatted as exponential, this method will return "1.0e+1" It might also change the color depending on the value and format. (for example, red for negative numbers)

Syntax

Namespace: FlexCel.Core

public TRichString GetStringFromCell(String cellRef)

Parameters

<-> | Parameter | Type | Description
 | cellRef | String | Cell reference in A1 notation. Something like A3, or Sheet1!$B$5 can be used here.

Returns

A rich string with the cell value.

See also

  • ExcelFile

ExcelFile.GetStringFromCell(Int32, Int32)

This method will return a rich string that is formatted similar to the way Excel shows it. For example, if you have "1.0" on a cell, and the cell is formatted as exponential, this method will return "1.0e+1" It might also change the color depending on the value and format. (for example, red for negative numbers) Conditional formats are not applied, you need to call ConditionallyModifyFormat(TFlxFormat, Int32, Int32, Boolean, TDrawingConditionalFormat) to the cell style for that.

Syntax

Namespace: FlexCel.Core

public TRichString GetStringFromCell(Int32 row, Int32 col)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Cell Row (1 based).
 | col | Int32 | Cell Column (1 based)

Returns

A rich string with the cell value.

See also

  • ExcelFile

ExcelFile.GetStringFromCell(Int32, Int32, Boolean)

This method will return a rich string that is formatted similar to the way Excel shows it. For example, if you have "1.0" on a cell, and the cell is formatted as exponential, this method will return "1.0e+1" It might also change the color depending on the value and format. (for example, red for negative numbers) Conditional formats are not applied, you need to call ConditionallyModifyFormat(TFlxFormat, Int32, Int32, Boolean, TDrawingConditionalFormat) to the cell style for that.

Syntax

Namespace: FlexCel.Core

public TRichString GetStringFromCell(Int32 row, Int32 col, Boolean ignorePrintErrors)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Cell Row (1 based).
 | col | Int32 | Cell Column (1 based)
 | ignorePrintErrors | Boolean | If true, the string for an error like #DIV/0 will always by #DIV/0 instead of using the value of PrintErrors. Set it to true when the value is not for printing it.

Returns

A rich string with the cell value.

See also

  • ExcelFile

ExcelFile.GetStringFromCell(Int32, Int32, Int32, TUIColor)

This method will return a rich string that is formatted similar to the way Excel shows it. For example, if you have "1.0" on a cell, and the cell is formatted as exponential, this method will return "1.0e+1" It might also change the color depending on the value and format. (for example, red for negative numbers) Conditional formats are not applied, you need to call ConditionallyModifyFormat(TFlxFormat, Int32, Int32, Boolean, TDrawingConditionalFormat) to the cell style for that.

Syntax

Namespace: FlexCel.Core

public TRichString GetStringFromCell(Int32 row, Int32 col, ref Int32 XF, ref TUIColor aColor)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Cell Row (1 based).
 | col | Int32 | Cell Column (1 based)
ref | XF | Int32 | The resulting XF for the cell.
ref | aColor | TUIColor | Resulting color of the string. If for example you define red for negative numbers, and the result is red, this will be returned on aColor. If there is not color info on the format, it will remain unchanged.

Returns

A rich string with the cell value.

See also

  • ExcelFile

ExcelFile.GetStringFromCell(Int32, Int32, Int32, Int32, TUIColor)

This method will return a rich string that is formatted similar to the way Excel shows it. For example, if you have "1.0" on a cell, and the cell is formatted as exponential, this method will return "1.0e+1" It might also change the color depending on the value and format. (for example, red for negative numbers) Conditional formats are not applied, you need to call ConditionallyModifyFormat(TFlxFormat, Int32, Int32, Boolean, TDrawingConditionalFormat) to the cell style for that.

Syntax

Namespace: FlexCel.Core

public TRichString GetStringFromCell(Int32 sheet, Int32 row, Int32 col, ref Int32 XF, ref TUIColor aColor)

Parameters

<-> | Parameter | Type | Description
 | sheet | Int32 | Sheet where the cell is (1 based).
 | row | Int32 | Cell Row (1 based).
 | col | Int32 | Cell Column (1 based)
ref | XF | Int32 | The resulting XF for the cell.
ref | aColor | TUIColor | Resulting color of the string. If for example you define red for negative numbers, and the result is red, this will be returned on aColor. If there is not color info on the format, it will remain unchanged.

Returns

A rich string with the cell value.

See also

  • ExcelFile

ExcelFile.GetStringFromCell(Int32, Int32, Int32, Int32, TUIColor, Boolean)

This method will return a rich string that is formatted similar to the way Excel shows it. For example, if you have "1.0" on a cell, and the cell is formatted as exponential, this method will return "1.0e+1" It might also change the color depending on the value and format. (for example, red for negative numbers) Conditional formats are not applied, you need to call ConditionallyModifyFormat(TFlxFormat, Int32, Int32, Boolean, TDrawingConditionalFormat) to the cell style for that.

Syntax

Namespace: FlexCel.Core

public abstract TRichString GetStringFromCell(Int32 sheet, Int32 row, Int32 col, ref Int32 XF, ref TUIColor aColor, Boolean ignorePrintErrors)

Parameters

<-> | Parameter | Type | Description
 | sheet | Int32 | Sheet where the cell is (1 based).
 | row | Int32 | Cell Row (1 based).
 | col | Int32 | Cell Column (1 based)
ref | XF | Int32 | The resulting XF for the cell.
ref | aColor | TUIColor | Resulting color of the string. If for example you define red for negative numbers, and the result is red, this will be returned on aColor. If there is not color info on the format, it will remain unchanged.
 | ignorePrintErrors | Boolean | If true, the string for an error like #DIV/0 will always by #DIV/0 instead of using the value of PrintErrors. Set it to true when the value is not for printing it.

Returns

A rich string with the cell value.

See also

  • ExcelFile


ExcelFile.SetCellFromHtml Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.SetCellFromHtml Method

Overloads

  • ExcelFile.SetCellFromHtml(Int32, Int32, String)
  • ExcelFile.SetCellFromHtml(Int32, Int32, String, Int32)

ExcelFile.SetCellFromHtml(Int32, Int32, String)

Enters an HTML formatted string into a cell, and tries to match the Excel formats with the HTML formatting tags. Note that the rich text inside Excel is more limited than xls (you are limited to only changing font attributes), so many tags from the HTML tags might be ignored. Whenever a tag is not understood or cannot be mapped into Excel, it will just be omitted. For a list of supported tags, see the Remarks section.

Remarks

Any tag (between brackets) will be stripped from the entered text. If you want to enter a < sign, you need to enter "&lt;". For a list of all "&" possible symbols consult any HTML reference. &[HexadecimalUnicodeCharacer] are supported too.

All tags are case insensitive.

Spaces will be eliminated from the string as in normal HTML. To enter a "hard" space you can enter "&nbsp;" (non breaking space). Also, if text is inside "pre" tags, spaces will be preserved.

The supported tags are:

  • b or strong - Bold.
  • i or em- Italics.
  • u - Underline.
  • s or strike- Strikeout.
  • sub - Subscript.
  • sup - Superscript.
  • tt - Use monospace font.
  • pre - Preserve spaces and returns. On normal mode, if you have 2 spaces on a string, only one will be kept.
  • font - Change the used font. This tag behaves as normal HTML, and you can specify color, face, point-size or size as attributes. Size might be between 1 and 7, and the size in points are 8, 9, 12, 14, 18, 24, 34 for each size. You can also specify relative sizes (for example -1)
  • h1..h6 - Header fonts.
  • small - Use a smaller font. This is equivalent to <font size = '-1'>
  • big - Use a bigger font. This is equivalent to <font size = '+1'>
  • ul - Unordered list.
  • ol - Ordered list.
  • li - List item.

Syntax

Namespace: FlexCel.Core

public void SetCellFromHtml(Int32 row, Int32 col, String htmlText)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Cell Row (1 based)
 | col | Int32 | Cell Column (1 based)
 | htmlText | String | Text with an HTML formatted string.

See also

  • ExcelFile

ExcelFile.SetCellFromHtml(Int32, Int32, String, Int32)

Enters an HTML formatted string into a cell, and tries to match the Excel formats with the HTML formatting tags. Note that the rich text inside Excel is more limited than xls (you are limited to only changing font attributes), so many tags from the HTML tags might be ignored. Whenever a tag is not understood or cannot be mapped into Excel, it will just be omitted. For a list of supported tags, see the Remarks section.

Remarks

Any tag (between brackets) will be stripped from the entered text. If you want to enter a < sign, you need to enter "&lt;". For a list of all "&" possible symbols consult any HTML reference. &[HexadecimalUnicodeCharacer] are supported too.

All tags are case insensitive.

Spaces will be eliminated from the string as in normal HTML. To enter a "hard" space you can enter "&nbsp;" (non breaking space). Also, if text is inside "pre" tags, spaces will be preserved.

The supported tags are:

  • b or strong - Bold.
  • i or em- Italics.
  • u - Underline.
  • s or strike- Strikeout.
  • sub - Subscript.
  • sup - Superscript.
  • tt - Use monospace font.
  • pre - Preserve spaces and returns. On normal mode, if you have 2 spaces on a string, only one will be kept.
  • font - Change the used font. This tag behaves as normal HTML, and you can specify color, face, point-size or size as attributes. Size might be between 1 and 7, and the size in points are 8, 9, 12, 14, 18, 24, 34 for each size. You can also specify relative sizes (for example -1)
  • h1..h6 - Header fonts.
  • small - Use a smaller font. This is equivalent to <font size = '-1'>
  • big - Use a bigger font. This is equivalent to <font size = '+1'>
  • ul - Unordered list.
  • ol - Ordered list.
  • li - List item.

Syntax

Namespace: FlexCel.Core

public abstract void SetCellFromHtml(Int32 row, Int32 col, String htmlText, Int32 XF)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Cell Row (1 based)
 | col | Int32 | Cell Column (1 based)
 | htmlText | String | Text with an HTML formatted string.
 | XF | Int32 | Format for the cell. It can be -1 to keep the existing format.

See also

  • ExcelFile


ExcelFile.GetHtmlFromCell Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.GetHtmlFromCell Method

Overloads

  • ExcelFile.GetHtmlFromCell(Int32, Int32, THtmlVersion, THtmlStyle, Encoding)
  • ExcelFile.GetHtmlFromCell(Int32, Int32, THtmlVersion, THtmlStyle, Encoding, Boolean)

ExcelFile.GetHtmlFromCell(Int32, Int32, THtmlVersion, THtmlStyle, Encoding)

Returns the contents of formatted cell as HTML. Conditional formats are not applied (unless includeCellFormatting is true): you need to call ConditionallyModifyFormat(TFlxFormat, Int32, Int32, Boolean, TDrawingConditionalFormat) to the cell style to get the cell with cf applied. If ShowFormulaText is true, it will return the formula text instead of the value. For a list of HTML tags that might be returned, see the Remarks section.

Remarks

Text will be returned as standard HTML, on the version specified. This means that for example a < sign will be returned as "&lt;". For a list of all "&" possible symbols consult any HTML reference. &[HexadecimalUnicodeCharacer] might be returned too.

Multiple spaces will be returned as "&nbsp;" (non breaking space) and line breaks will be returned as <br> tags.

The tags that might be returned by this method are: If htmlStyle is Simple:

  • b - Bold.
  • i - Italics.
  • u - Underline.
  • s - Strikeout.
  • sub - Subscript.
  • sup - Superscript.
  • font - Change the used font. This tag behaves as normal HTML, and you can specify color, face, point-size or size as attributes. Size might be between 1 and 7, and the size in points are 8, 9, 12, 14, 18, 24, 34 for each size. You can also specify relative sizes (for example -1)

If htmlStyle is CSS: The equivalent CSS style commands to the ones listed under htmlStyle = Simple.

Syntax

Namespace: FlexCel.Core

public String GetHtmlFromCell(Int32 row, Int32 col, THtmlVersion htmlVersion, THtmlStyle htmlStyle, Encoding encoding)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Cell Row (1 based)
 | col | Int32 | Cell Column (1 based)
 | htmlVersion | THtmlVersion | Version of the HTML returned. In XHTML, single tags have a "/" at the end, while in 4.0 they don't.
 | htmlStyle | THtmlStyle | Specifies if to use simple tags or CSS for the returned HTML.
 | encoding | Encoding | Encoding for the returned string. Use UTF-8 if in doubt.

Returns

An HTML formatted string with the cell contents.

See also

  • ExcelFile

ExcelFile.GetHtmlFromCell(Int32, Int32, THtmlVersion, THtmlStyle, Encoding, Boolean)

Returns the contents of formatted cell as HTML. Conditional formats are not applied (unless includeCellFormatting is true): you need to call ConditionallyModifyFormat(TFlxFormat, Int32, Int32, Boolean, TDrawingConditionalFormat) to the cell style to get the cell with cf applied. If ShowFormulaText is true, it will return the formula text instead of the value. For a list of HTML tags that might be returned, see the Remarks section.

Remarks

Text will be returned as standard HTML, on the version specified. This means that for example a < sign will be returned as "&lt;". For a list of all "&" possible symbols consult any HTML reference. &[HexadecimalUnicodeCharacer] might be returned too.

Multiple spaces will be returned as "&nbsp;" (non breaking space) and line breaks will be returned as <br> tags.

The tags that might be returned by this method are: If htmlStyle is Simple:

  • b - Bold.
  • i - Italics.
  • u - Underline.
  • s - Strikeout.
  • sub - Subscript.
  • sup - Superscript.
  • font - Change the used font. This tag behaves as normal HTML, and you can specify color, face, point-size or size as attributes. Size might be between 1 and 7, and the size in points are 8, 9, 12, 14, 18, 24, 34 for each size. You can also specify relative sizes (for example -1)

If htmlStyle is CSS: The equivalent CSS style commands to the ones listed under htmlStyle = Simple.

Syntax

Namespace: FlexCel.Core

public abstract String GetHtmlFromCell(Int32 row, Int32 col, THtmlVersion htmlVersion, THtmlStyle htmlStyle, Encoding encoding, Boolean includeCellFormatting)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Cell Row (1 based)
 | col | Int32 | Cell Column (1 based)
 | htmlVersion | THtmlVersion | Version of the HTML returned. In XHTML, single tags have a "/" at the end, while in 4.0 they don't.
 | htmlStyle | THtmlStyle | Specifies if to use simple tags or CSS for the returned HTML.
 | encoding | Encoding | Encoding for the returned string. Use UTF-8 if in doubt.
 | includeCellFormatting | Boolean | If true, the result will include the cell formatting in the formatting. So if for example a cell is formatted as bold, and the string inside doesn't have formatting, this method will return "<b>Text</b>" when includeCellFormatting is true, and just "Text" when it is false. If this parameter is true, it will also consider the conditional formatting of the cell.

Returns

An HTML formatted string with the cell contents.

See also

  • ExcelFile


ExcelFile.CopyCell Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.CopyCell Method

Copies one cell from one workbook to another. If the cell has a formula, it will be offset so it matches the new destination. Note: You will normally not need this method. To copy a range of cells from a workbook to another use InsertAndCopyRange(TXlsCellRange, Int32, Int32, Int32, TFlxInsertMode, TRangeCopyMode, ExcelFile, Int32) instead. To copy a full sheet from one file to another, use InsertAndCopySheets(Int32, Int32, Int32, ExcelFile).

Syntax

Namespace: FlexCel.Core

public abstract void CopyCell(ExcelFile sourceWorkbook, Int32 sourceSheet, Int32 destSheet, Int32 sourceRow, Int32 sourceCol, Int32 destRow, Int32 destCol, TRangeCopyMode copyMode)

Parameters

<-> | Parameter | Type | Description
 | sourceWorkbook | ExcelFile | File from where we want to copy the cell.
 | sourceSheet | Int32 | Sheet in sourceWorkbook where the data is.
 | destSheet | Int32 | Sheet in this file where we want to copy the data.
 | sourceRow | Int32 | Row on the source file of the cell (1 based)
 | sourceCol | Int32 | Column on the source file of the cell (1 based)
 | destRow | Int32 | Row on the destination file of the cell (1 based)
 | destCol | Int32 | Column on the destination file of the cell (1 based)
 | copyMode | TRangeCopyMode | How the cell will be copied.

See also

  • ExcelFile


ExcelFile.GetFormat Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.GetFormat Method

Returns the format definition for a given format index. Note that this method will only return Cell formats. If you want to read a Style format, use GetStyle(Int32)

Syntax

Namespace: FlexCel.Core

public abstract TFlxFormat GetFormat(Int32 XF)

Parameters

<-> | Parameter | Type | Description
 | XF | Int32 | Format index 0-Based

Returns

Format definition

See also

  • ExcelFile


ExcelFile.AddFormat Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.AddFormat Method

Adds a new format to the Excel format list. If it already exists, it doesn't add a new one, so you can use this method for searching too.

Syntax

Namespace: FlexCel.Core

public abstract Int32 AddFormat(TFlxFormat format)

Parameters

<-> | Parameter | Type | Description
 | format | TFlxFormat | Format to add to the list.

Returns

Position on the list for the format.

See also

  • ExcelFile


ExcelFile.SetFormat Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.SetFormat Method

Sets the font definition for a given format index. Normally it is of not use, (you should use AddFont or AddFormat instead) but could be used to change the default format. (using SetFormat(0, fmt); ). This method will change style XFs and CellXfs, depending if aFormat is a StyleXF or a CellXF.

Syntax

Namespace: FlexCel.Core

public abstract void SetFormat(Int32 formatIndex, TFlxFormat aFormat)

Parameters

<-> | Parameter | Type | Description
 | formatIndex | Int32 | Format index. 0-based
 | aFormat | TFlxFormat | Format definition

See also

  • ExcelFile


ExcelFile.GetFont Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.GetFont Method

Returns the font definition for a given font index.

Syntax

Namespace: FlexCel.Core

public abstract TFlxFont GetFont(Int32 fontIndex)

Parameters

<-> | Parameter | Type | Description
 | fontIndex | Int32 | Font index. 0-based

Returns

Font definition

See also

  • ExcelFile


ExcelFile.SetFont Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.SetFont Method

Sets the font definition for a given font index. Normally it is of not use, (you should use AddFont or AddFormat instead) but could be used to change the default font format. (using SetFont(0, font); )

Syntax

Namespace: FlexCel.Core

public abstract void SetFont(Int32 fontIndex, TFlxFont aFont)

Parameters

<-> | Parameter | Type | Description
 | fontIndex | Int32 | Font index. 0-based
 | aFont | TFlxFont | Font definition

See also

  • ExcelFile


ExcelFile.AddFont Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.AddFont Method

Adds a new font to the excel font list. If it already exists, it doesn't add a new one, so you can use this method for searching too.

Syntax

Namespace: FlexCel.Core

public abstract Int32 AddFont(TFlxFont font)

Parameters

<-> | Parameter | Type | Description
 | font | TFlxFont | Font to add to the list.

Returns

The position on the list for the added font.

See also

  • ExcelFile


ExcelFile.SetCellFormat Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.SetCellFormat Method

Overloads

  • ExcelFile.SetCellFormat(Int32, Int32, Int32)
  • ExcelFile.SetCellFormat(Int32, Int32, Int32, Int32, Int32)
  • ExcelFile.SetCellFormat(Int32, Int32, Int32, Int32, TFlxFormat, TFlxApplyFormat)
  • ExcelFile.SetCellFormat(Int32, Int32, Int32, Int32, TFlxFormat, TFlxApplyFormat, Boolean)

ExcelFile.SetCellFormat(Int32, Int32, Int32)

Sets the Cell format (XF) on a given cell. You can create new formats using the AddFormat function.

Syntax

Namespace: FlexCel.Core

public abstract void SetCellFormat(Int32 row, Int32 col, Int32 XF)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row index of the cell (1 based)
 | col | Int32 | Column index of the cell (1 based)
 | XF | Int32 | XF Format index. See 'Cell formats' in the Api Developer Guide.

See also

  • ExcelFile
  • GetCellFormat(Int32, Int32)
  • AddFormat

ExcelFile.SetCellFormat(Int32, Int32, Int32, Int32, Int32)

Sets the Cell format (XF) on a range of cells. You can create new formats using the AddFormat function.

Syntax

Namespace: FlexCel.Core

public abstract void SetCellFormat(Int32 row1, Int32 col1, Int32 row2, Int32 col2, Int32 XF)

Parameters

<-> | Parameter | Type | Description
 | row1 | Int32 | Row index of the top cell on the range (1 based)
 | col1 | Int32 | Column index of the left cell on the range (1 based)
 | row2 | Int32 | Row index of the bottom cell on the range (1 based)
 | col2 | Int32 | Column index of the right cell on the range (1 based)
 | XF | Int32 | XF Format index. See 'Cell formats' in the Api Developer Guide.

See also

  • ExcelFile
  • GetCellFormat(Int32, Int32)
  • AddFormat

ExcelFile.SetCellFormat(Int32, Int32, Int32, Int32, TFlxFormat, TFlxApplyFormat)

Changes part of the Cell format on a range of cells. WARNING! This method is slower than the other SetCellFormat versions, use it only if you do not care about maximum performance or if you just can't use the other SetCellFormat versions. This particular version of SetCellFormat has to read the format on each cell, modify it and write it back. While still very fast, it is not as fast as just setting the format on a cell.

Remarks

You can use this method for example to add a border on the top of a row of cells, keeping the existing font and pattern styles on the range.

Syntax

Namespace: FlexCel.Core

public void SetCellFormat(Int32 row1, Int32 col1, Int32 row2, Int32 col2, TFlxFormat newFormat, TFlxApplyFormat applyNewFormat)

Parameters

<-> | Parameter | Type | Description
 | row1 | Int32 | Row index of the top cell on the range (1 based)
 | col1 | Int32 | Column index of the left cell on the range (1 based)
 | row2 | Int32 | Row index of the bottom cell on the range (1 based)
 | col2 | Int32 | Column index of the right cell on the range (1 based)
 | newFormat | TFlxFormat | Format to apply to the cells.
 | applyNewFormat | TFlxApplyFormat | Indicates which properties of newFormat will be applied to the cells.

See also

  • ExcelFile

ExcelFile.SetCellFormat(Int32, Int32, Int32, Int32, TFlxFormat, TFlxApplyFormat, Boolean)

Changes part of the Cell format on a range of cells. WARNING! This method is slower than the other SetCellFormat versions, use it only if you do not care about maximum performance or if you just can't use the other SetCellFormat versions. This particular version of SetCellFormat has to read the format on each cell, modify it and write it back. While still very fast, it is not as fast as just setting the format on a cell.

Remarks

You can use this method for example to add a border on the top of a row of cells, keeping the existing font and pattern styles on the range.

Syntax

Namespace: FlexCel.Core

public abstract void SetCellFormat(Int32 row1, Int32 col1, Int32 row2, Int32 col2, TFlxFormat newFormat, TFlxApplyFormat applyNewFormat, Boolean exteriorBorders)

Parameters

<-> | Parameter | Type | Description
 | row1 | Int32 | Row index of the top cell on the range (1 based)
 | col1 | Int32 | Column index of the left cell on the range (1 based)
 | row2 | Int32 | Row index of the bottom cell on the range (1 based)
 | col2 | Int32 | Column index of the right cell on the range (1 based)
 | newFormat | TFlxFormat | Format to apply to the cells.
 | applyNewFormat | TFlxApplyFormat | Indicates which properties of newFormat will be applied to the cells.
 | exteriorBorders | Boolean | When true, the format for the border will be applied only to the outer cells in the range. This can be useful for example to draw a box around a range of cells, but not drawing borders inside the range. Other parameters, like the cell background, will still be applied to the full range.

See also

  • ExcelFile


ExcelFile.DrawBorders Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.DrawBorders Method

This method draws a border around a range of cells.

Remarks

This is just a shortcut for calling SetCellFormat(Int32, Int32, Int32, Int32, TFlxFormat, TFlxApplyFormat, Boolean)

Syntax

Namespace: FlexCel.Core

public void DrawBorders(Int32 row1, Int32 col1, Int32 row2, Int32 col2, TFlxBorderStyle borderStyle, TExcelColor borderColor, Boolean exteriorBorders)

Parameters

<-> | Parameter | Type | Description
 | row1 | Int32 | Row index of the top cell on the range (1 based)
 | col1 | Int32 | Column index of the left cell on the range (1 based)
 | row2 | Int32 | Row index of the bottom cell on the range (1 based)
 | col2 | Int32 | Column index of the right cell on the range (1 based)
 | borderStyle | TFlxBorderStyle | Style of the border to draw.
 | borderColor | TExcelColor | Color of the border to draw.
 | exteriorBorders | Boolean | When true, the format for the border will be applied only to the outer cells in the range. This can be useful for example to draw a box around a range of cells, but not drawing borders inside the range.

See also

  • ExcelFile


ExcelFile.GetCellFormat Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.GetCellFormat Method

Overloads

  • ExcelFile.GetCellFormat(Int32, Int32)
  • ExcelFile.GetCellFormat(Int32, Int32, Int32)

ExcelFile.GetCellFormat(Int32, Int32)

Cell Format for a given cell This method gets the Format number (XF) of a cell. You can create new formats using the AddFormat function.

Remarks

This method DOES NOT return the format for an empty cell, even if it has a column or a row format. For the visible format of the cell, see GetCellVisibleFormat(Int32, Int32)

Syntax

Namespace: FlexCel.Core

public abstract Int32 GetCellFormat(Int32 row, Int32 col)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row Index (1 based)
 | col | Int32 | Column Index (1 based)

Returns

XF for the cell.

Examples

To copy the format on cell A1 to B2 you should write:

    xls.SetCellFormat(2, 2, xls.GetCellFormat(1, 1));

See also

  • ExcelFile
  • AddFormat
  • SetCellFormat(Int32, Int32, Int32)
  • GetFormat
  • GetCellVisibleFormat(Int32, Int32)

ExcelFile.GetCellFormat(Int32, Int32, Int32)

Cell Format for a given cell This method gets the Format number (XF) of a cell. You can create new formats using the AddFormat function.

Remarks

This method DOES NOT return the format for an empty cell, even if it has a column or a row format. For the visible format of the cell, see GetCellVisibleFormat(Int32, Int32)

Syntax

Namespace: FlexCel.Core

public abstract Int32 GetCellFormat(Int32 sheet, Int32 row, Int32 col)

Parameters

<-> | Parameter | Type | Description
 | sheet | Int32 | Sheet index (1 based).
 | row | Int32 | Row Index (1 based)
 | col | Int32 | Column Index (1 based)

Returns

XF for the cell.

Examples

To copy the format on cell A1 to B2 you should write:

    xls.SetCellFormat(2, 2, xls.GetCellFormat(1, 1));

See also

  • ExcelFile
  • AddFormat
  • SetCellFormat(Int32, Int32, Int32)
  • GetFormat
  • GetCellVisibleFormat(Int32, Int32)


ExcelFile.GetCellVisibleFormat Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.GetCellVisibleFormat Method

Overloads

  • ExcelFile.GetCellVisibleFormat(Int32, Int32)
  • ExcelFile.GetCellVisibleFormat(Int32, Int32, Int32)

ExcelFile.GetCellVisibleFormat(Int32, Int32)

Cell Format for a given cell, including the format of the row and the column.

Remarks

This might return format even if the cell is empty, if the column or the row have format. For the real format of the cell, see GetCellFormat(Int32, Int32)

Syntax

Namespace: FlexCel.Core

public Int32 GetCellVisibleFormat(Int32 row, Int32 col)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row Index (1 based)
 | col | Int32 | Column Index (1 based)

Returns

XF for the cell

See also

  • ExcelFile
  • AddFormat
  • SetCellFormat(Int32, Int32, Int32)
  • GetFormat
  • GetCellFormat(Int32, Int32)
  • GetCellVisibleFormatDef(Int32, Int32)

ExcelFile.GetCellVisibleFormat(Int32, Int32, Int32)

Cell Format for a given cell, including the format of the row and the column.

Remarks

This might return format even if the cell is empty, if the column or the row have format. For the real format of the cell, see GetCellFormat(Int32, Int32)

Syntax

Namespace: FlexCel.Core

public Int32 GetCellVisibleFormat(Int32 sheet, Int32 row, Int32 col)

Parameters

<-> | Parameter | Type | Description
 | sheet | Int32 | Sheet index (1 based)
 | row | Int32 | Row Index (1 based)
 | col | Int32 | Column Index (1 based)

Returns

XF for the cell

See also

  • ExcelFile
  • AddFormat
  • SetCellFormat(Int32, Int32, Int32)
  • GetFormat
  • GetCellFormat(Int32, Int32)
  • GetCellVisibleFormatDef(Int32, Int32)


ExcelFile.GetCellVisibleFormatDef Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.GetCellVisibleFormatDef Method

Overloads

  • ExcelFile.GetCellVisibleFormatDef(Int32, Int32)
  • ExcelFile.GetCellVisibleFormatDef(Int32, Int32, Int32)

ExcelFile.GetCellVisibleFormatDef(Int32, Int32)

Cell Format for a given cell, including the format of the row and the column.

Remarks

This might return format even if the cell is empty, if the column or the row have format. For the real format of the cell, see GetCellFormat(Int32, Int32) This is a shortcut for GetCellVisibleFormat, returning the final Format struct.

Syntax

Namespace: FlexCel.Core

public TFlxFormat GetCellVisibleFormatDef(Int32 row, Int32 col)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row Index (1 based)
 | col | Int32 | Column Index (1 based)

Returns

Format for the cell

See also

  • ExcelFile
  • AddFormat
  • SetCellFormat(Int32, Int32, Int32)
  • GetFormat
  • GetCellFormat(Int32, Int32)
  • GetCellVisibleFormat(Int32, Int32)

ExcelFile.GetCellVisibleFormatDef(Int32, Int32, Int32)

Cell Format for a given cell, including the format of the row and the column.

Remarks

This might return format even if the cell is empty, if the column or the row have format. For the real format of the cell, see GetCellFormat(Int32, Int32) This is a shortcut for GetCellVisibleFormat, returning the final Format struct.

Syntax

Namespace: FlexCel.Core

public TFlxFormat GetCellVisibleFormatDef(Int32 sheet, Int32 row, Int32 col)

Parameters

<-> | Parameter | Type | Description
 | sheet | Int32 | Sheet index. (1 based)
 | row | Int32 | Row Index (1 based)
 | col | Int32 | Column Index (1 based)

Returns

Format for the cell

See also

  • ExcelFile
  • AddFormat
  • SetCellFormat(Int32, Int32, Int32)
  • GetFormat
  • GetCellFormat(Int32, Int32)
  • GetCellVisibleFormat(Int32, Int32)


ExcelFile.ConditionallyModifyFormat Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.ConditionallyModifyFormat Method

Overloads

  • ExcelFile.ConditionallyModifyFormat(TFlxFormat, Int32, Int32, TDrawingConditionalFormat)
  • ExcelFile.ConditionallyModifyFormat(TFlxFormat, Int32, Int32, Boolean, TDrawingConditionalFormat)

ExcelFile.ConditionallyModifyFormat(TFlxFormat, Int32, Int32, TDrawingConditionalFormat)

Modifies the format of the specified cell if it has a conditional format active. Returns a modified format with the applied conditional format if there was any change, null otherwise.

Syntax

Namespace: FlexCel.Core

public TFlxFormat ConditionallyModifyFormat(TFlxFormat format, Int32 row, Int32 col, out TDrawingConditionalFormat extraInfo)

Parameters

<-> | Parameter | Type | Description
 | format | TFlxFormat | Original format of the cell.
 | row | Int32 | Row of the cell (1 based)
 | col | Int32 | Column of the cell (1 based)
out | extraInfo | TDrawingConditional​Format | Extra information about the format of the cell, like if it has to draw an icon or a databar.

Returns

If the format is modified by a conditional format, it returns the new format. If there are no changes returns null, to avoid creating new instances of TFlxFormat.

See also

  • ExcelFile

ExcelFile.ConditionallyModifyFormat(TFlxFormat, Int32, Int32, Boolean, TDrawingConditionalFormat)

Modifies the format of the specified cell if it has a conditional format active. Returns a modified format with the applied conditional format if there was any change, null otherwise.

Syntax

Namespace: FlexCel.Core

public abstract TFlxFormat ConditionallyModifyFormat(TFlxFormat format, Int32 row, Int32 col, Boolean includeTables, out TDrawingConditionalFormat extraInfo)

Parameters

<-> | Parameter | Type | Description
 | format | TFlxFormat | Original format of the cell.
 | row | Int32 | Row of the cell (1 based)
 | col | Int32 | Column of the cell (1 based)
 | includeTables | Boolean | If true and the cell is inside a table, the format for the table will be also taken in account.
out | extraInfo | TDrawingConditional​Format | Extra information about the format of the cell, like if it has to draw an icon or a databar.

Returns

If the format is modified by a conditional format, it returns the new format. If there are no changes returns null, to avoid creating new instances of TFlxFormat.

See also

  • ExcelFile


ExcelFile.AddConditionalFormat Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.AddConditionalFormat Method

Adds a conditional format for a range of cells.

Syntax

Namespace: FlexCel.Core

public abstract void AddConditionalFormat(TConditionalFormat formatCondition)

Parameters

<-> | Parameter | Type | Description
 | formatCondition | TConditionalFormat | The conditional format rules to apply to a set of ranges in the active sheet.

See also

  • ExcelFile


ExcelFile.SetConditionalFormat Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.SetConditionalFormat Method

Modifies one of the conditional format rules in the sheet.

Syntax

Namespace: FlexCel.Core

public abstract void SetConditionalFormat(Int32 index, TConditionalFormat formatCondition)

Parameters

<-> | Parameter | Type | Description
 | index | Int32 | Index of the conditional format to modify. 1-based.
 | formatCondition | TConditionalFormat | The conditional format rules to apply to a set of ranges in the active sheet.

See also

  • ExcelFile


ExcelFile.GetConditionalFormat Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.GetConditionalFormat Method

One of the entries on the conditional format list of this file.

Syntax

Namespace: FlexCel.Core

public abstract TConditionalFormat GetConditionalFormat(Int32 index)

Parameters

<-> | Parameter | Type | Description
 | index | Int32 | Index to the conditional format list. (1 based)

Returns

The list of conditional format definitions for the index.

See also

  • ExcelFile


ExcelFile.RemoveConditionalFormat Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.RemoveConditionalFormat Method

Removes the conditional format at position index.

Syntax

Namespace: FlexCel.Core

public abstract void RemoveConditionalFormat(Int32 index)

Parameters

<-> | Parameter | Type | Description
 | index | Int32 | Index to the conditional format list. (1 based)

See also

  • ExcelFile


ExcelFile.ClearConditionalFormatsInSheet Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.ClearConditionalFormatsInSheet Method

Removes all conditional formats in the active sheet.

Syntax

Namespace: FlexCel.Core

public abstract void ClearConditionalFormatsInSheet()

See also

  • ExcelFile


ExcelFile.GetStyleName Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.GetStyleName Method

Gets the name of the style at position index. (1 based).

Syntax

Namespace: FlexCel.Core

public abstract String GetStyleName(Int32 index)

Parameters

<-> | Parameter | Type | Description
 | index | Int32 | Position in the list of styles (1 based).

Returns

The name of the style.

See also

  • ExcelFile


ExcelFile.GetStyle Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.GetStyle Method

Overloads

  • ExcelFile.GetStyle(Int32)
  • ExcelFile.GetStyle(String)
  • ExcelFile.GetStyle(String, Boolean)

ExcelFile.GetStyle(Int32)

Returns the named style at position index for the workbook

Syntax

Namespace: FlexCel.Core

public abstract TFlxFormat GetStyle(Int32 index)

Parameters

<-> | Parameter | Type | Description
 | index | Int32 | Position in the list of styles (1 based).

Returns

The named style definition.

See also

  • ExcelFile

ExcelFile.GetStyle(String)

Returns a named style for the workbook. You can also use this method to check if a style exists or not. The returned style will have the "IsStyle" property set to true, so you can't apply it directly to a cell. If you want to apply the result of this method to a cell, use GetStyle(String, Boolean).

Syntax

Namespace: FlexCel.Core

public TFlxFormat GetStyle(String name)

Parameters

<-> | Parameter | Type | Description
 | name | String | Name for the style. It might be a user defined name, or a built-in name. You can get a list of built-in names with GetBuiltInStyleName

Returns

The style definition, or null if the style doesn't exists.

See also

  • ExcelFile

ExcelFile.GetStyle(String, Boolean)

Returns a named style for the workbook. You can also use this method to check if a style exists or not.

Syntax

Namespace: FlexCel.Core

public abstract TFlxFormat GetStyle(String name, Boolean convertToCellStyle)

Parameters

<-> | Parameter | Type | Description
 | name | String | Name for the style. It might be a user defined name, or a built-in name. You can get a list of builtin names with GetBuiltInStyleName
 | convertToCellStyle | Boolean | If true, the returned style will have the "IsStyle" property set to false, so you can apply this TFlxFormat to a cell. If false IsStyle will be true and you can use the format definition in style definitions. Setting this parameter to true is exactly the same as setting it to false and setting "IsStyle" property in the result to false, and also setting the parent of the resulting cell format to the cell style.

Returns

The style definition, or null if the style doesn't exists.

See also

  • ExcelFile


ExcelFile.RenameStyle Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.RenameStyle Method

Renames an existing style. Note that this might be a user-defined style, you can't rename built-in styles.

Syntax

Namespace: FlexCel.Core

public abstract void RenameStyle(String oldName, String newName)

Parameters

<-> | Parameter | Type | Description
 | oldName | String | Name of the existing style in the workbook.
 | newName | String | New name for the style. It must not exist.

See also

  • ExcelFile


ExcelFile.SetStyle Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.SetStyle Method

Modifies an existing style if name already exists, or creates a new style if it doesn't.

Syntax

Namespace: FlexCel.Core

public abstract void SetStyle(String name, TFlxFormat fmt)

Parameters

<-> | Parameter | Type | Description
 | name | String | Name for the style. It might be a user defined name, or a built-in name. You can get a list of built-in names with GetBuiltInStyleName
 | fmt | TFlxFormat | The new style definition.

See also

  • ExcelFile


ExcelFile.DeleteStyle Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.DeleteStyle Method

Returns a named style for the workbook.

Syntax

Namespace: FlexCel.Core

public abstract void DeleteStyle(String name)

Parameters

<-> | Parameter | Type | Description
 | name | String | Name for the style. It must be a user defined name.

See also

  • ExcelFile


ExcelFile.GetBuiltInStyleName Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.GetBuiltInStyleName Method

Returns the name for a built-in style.

Syntax

Namespace: FlexCel.Core

public abstract String GetBuiltInStyleName(TBuiltInStyle style, Int32 level)

Parameters

<-> | Parameter | Type | Description
 | style | TBuiltInStyle | Style you want find out the name.
 | level | Int32 | Used only if style is TBuiltInStyle.RowLevel or TBuiltInStyle.ColLevel. It specifies the level of the outline, and must be a number between 1 and 7. Keep it 0 for all other styles.

Returns

The name for the Built in style.

See also

  • ExcelFile


ExcelFile.TryGetBuiltInStyleType Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.TryGetBuiltInStyleType Method

Tries to convert a string into an built-in style identifier. Will return true if styleName can be converted, false otherwise.

Syntax

Namespace: FlexCel.Core

public abstract Boolean TryGetBuiltInStyleType(String styleName, out TBuiltInStyle style, out Int32 level)

Parameters

<-> | Parameter | Type | Description
 | styleName | String | Style that we want to convert to built-in style.
out | style | TBuiltInStyle | Returns the built-in style. This value is only valid if this method returns true.
out | level | Int32 | Returns the level built-in style (1 based). This value is only valid if this method returns true, and only applies to outline styles. It will be 0 for non outline styles.

Returns

True is styleNameis a built-in style (and thus style and level are valid), false otherwise.

See also

  • ExcelFile


ExcelFile.CellMergedBounds Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.CellMergedBounds Method

Merged Range where the cell is.

Syntax

Namespace: FlexCel.Core

public abstract TXlsCellRange CellMergedBounds(Int32 row, Int32 col)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row Index (1 based)
 | col | Int32 | Column Index (1 based)

Returns

The range where the cell is

Examples

If you have a merged cell in range A1: B2, calling CellMergedBounds on any of the cells: A1, B1, A2, B2 will return A1:B2.

See also

  • ExcelFile
  • MergeCells
  • UnMergeCells
  • CellMergedListCount
  • CellMergedList


ExcelFile.MergeCells Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.MergeCells Method

Merges a number of cells into one.

Remarks

This method might return a bigger range than the one you specify. For example, if you have a merged cell (A1:C1), calling MergeCells(1,2,2,2) will merge the cell with the existing one, returning ONE merged cell (A1:C2), and not (B1:B2)

Other thing to consider, is that Excel honors individual linestyles inside a merged cell. That is, you can have only the first 2 columns of the merged cell with a line and the others without. Normally, after merging the cells, you will want to call SetCellFormat(Int32, Int32, Int32) on the range to make them all similar. FlexCel does not do it by default, to give the choice to you.

Syntax

Namespace: FlexCel.Core

public abstract void MergeCells(Int32 firstRow, Int32 firstCol, Int32 lastRow, Int32 lastCol)

Parameters

<-> | Parameter | Type | Description
 | firstRow | Int32 | First row of the merged cell.
 | firstCol | Int32 | First column of the merged cell.
 | lastRow | Int32 | Last row of the merged cell.
 | lastCol | Int32 | Last column of the merged cell.

See also

  • ExcelFile
  • CellMergedBounds
  • UnMergeCells
  • CellMergedListCount
  • CellMergedList


ExcelFile.UnMergeCells Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.UnMergeCells Method

Unmerges the range of cells. The coordinates have to be exact, if there is no merged cell with the exact coordinates, nothing will be done. If you want to unmerge all cells inside a range, use UnMergeAllCellsInRange instead.

Syntax

Namespace: FlexCel.Core

public abstract void UnMergeCells(Int32 firstRow, Int32 firstCol, Int32 lastRow, Int32 lastCol)

Parameters

<-> | Parameter | Type | Description
 | firstRow | Int32 | First row of the merged cell.
 | firstCol | Int32 | First column of the merged cell.
 | lastRow | Int32 | Last row of the merged cell.
 | lastCol | Int32 | Last column of the merged cell.

See also

  • ExcelFile
  • CellMergedBounds
  • MergeCells
  • CellMergedListCount
  • CellMergedList


ExcelFile.UnMergeAllCellsInRange Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.UnMergeAllCellsInRange Method

This method will unmerge all the cells that are inside a range of cells.

Syntax

Namespace: FlexCel.Core

public abstract void UnMergeAllCellsInRange(Int32 firstRow, Int32 firstCol, Int32 lastRow, Int32 lastCol, Boolean fullyInside)

Parameters

<-> | Parameter | Type | Description
 | firstRow | Int32 | First row of the range.
 | firstCol | Int32 | First column of the range.
 | lastRow | Int32 | Last row of the range.
 | lastCol | Int32 | Last column of the range.
 | fullyInside | Boolean | If true, the merged cells have to be completely inside the range to be deleted. For example, if the file has a merged cell A1:A5, and you call UnMergeAllCellsInRange(1, 1, 1, 1, true) A1:A5 won't be unmerged because it isn't completely inside the range. If false, all merged cells that have at least one cell inside the range will be deleted. In the example with the merged cell A1:A5, UnMergeAllCellsInRange(1, 1, 1, 1, false) would remove the merged cell, because it has the cell A1 inside the range.

See also

  • ExcelFile


ExcelFile.CellMergedList Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.CellMergedList Method

The Merged cell at position index on the mergedcell list.

Syntax

Namespace: FlexCel.Core

public abstract TXlsCellRange CellMergedList(Int32 index)

Parameters

<-> | Parameter | Type | Description
 | index | Int32 | index on the list (1 based)

Returns

The merged cell at position index.

See also

  • ExcelFile
  • CellMergedListCount


ExcelFile.CellMergedNext Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.CellMergedNext Method

Use this method to enumerate all merged cells in a sheet.

Syntax

Namespace: FlexCel.Core

public abstract TXlsCellRange CellMergedNext(ref TCellMergedState state)

Parameters

<-> | Parameter | Type | Description
ref | state | TCellMergedState | This struct holds the current merged cell being enumerated and is used by the method to return the next cell in the enumeration. To get the first value, create it with TCellMergedState.Init()

Returns

The next merged cell in the sheet.

See also

  • ExcelFile


ExcelFile.GetRowCount Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.GetRowCount Method

Number of rows actually used on a given sheet.

Syntax

Namespace: FlexCel.Core

public abstract Int32 GetRowCount(Int32 sheet)

Parameters

<-> | Parameter | Type | Description
 | sheet | Int32 |

See also

  • ExcelFile


ExcelFile.GetColCount Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.GetColCount Method

Overloads

  • ExcelFile.GetColCount(Int32)
  • ExcelFile.GetColCount(Int32, Boolean)

ExcelFile.GetColCount(Int32)

Number of columns actually used on a given sheet.

Syntax

Namespace: FlexCel.Core

public Int32 GetColCount(Int32 sheet)

Parameters

<-> | Parameter | Type | Description
 | sheet | Int32 | Sheet index where you want to find the columns (1 based)

See also

  • ExcelFile

ExcelFile.GetColCount(Int32, Boolean)

Number of columns actually used on a given sheet.

Syntax

Namespace: FlexCel.Core

public abstract Int32 GetColCount(Int32 sheet, Boolean includeFormattedColumns)

Parameters

<-> | Parameter | Type | Description
 | sheet | Int32 | Sheet index where you want to find the columns (1 based)
 | includeFormattedColumns | Boolean | If true (the default) formatted columns (for example a column you selected and painted yellow) will be included in the count, even if it doesn't have data.

See also

  • ExcelFile


ExcelFile.IsEmptyRow Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.IsEmptyRow Method

True if the specified row does not have any cells, nor any format on it. In short, this row has never been used.

Syntax

Namespace: FlexCel.Core

public abstract Boolean IsEmptyRow(Int32 row)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row to test (1-based)

See also

  • ExcelFile


ExcelFile.IsNotFormattedCol Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.IsNotFormattedCol Method

True if the specified column does not have any format applied on it.

Syntax

Namespace: FlexCel.Core

public abstract Boolean IsNotFormattedCol(Int32 col)

Parameters

<-> | Parameter | Type | Description
 | col | Int32 | Column to test (1-based)

See also

  • ExcelFile


ExcelFile.GetRowFormat Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.GetRowFormat Method

Overloads

  • ExcelFile.GetRowFormat(Int32)
  • ExcelFile.GetRowFormat(Int32, Int32)

ExcelFile.GetRowFormat(Int32)

Gets the XF format for the specified row, -1 if the row doesn't have format.

Syntax

Namespace: FlexCel.Core

public abstract Int32 GetRowFormat(Int32 row)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row index (1-based)

Returns

XF format.

See also

  • ExcelFile

ExcelFile.GetRowFormat(Int32, Int32)

Gets the XF format for the specified row, -1 if the row doesn't have format.

Syntax

Namespace: FlexCel.Core

public abstract Int32 GetRowFormat(Int32 sheet, Int32 row)

Parameters

<-> | Parameter | Type | Description
 | sheet | Int32 | Sheet index (1 based).
 | row | Int32 | Row index (1-based)

Returns

XF format.

See also

  • ExcelFile


ExcelFile.SetRowFormat Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.SetRowFormat Method

Overloads

  • ExcelFile.SetRowFormat(Int32, Int32)
  • ExcelFile.SetRowFormat(Int32, Int32, Boolean)
  • ExcelFile.SetRowFormat(Int32, TFlxFormat, TFlxApplyFormat, Boolean)

ExcelFile.SetRowFormat(Int32, Int32)

Sets the XF format for the entire row.

Syntax

Namespace: FlexCel.Core

public void SetRowFormat(Int32 row, Int32 XF)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row index (1-based)
 | XF | Int32 | XF format.

See also

  • ExcelFile

ExcelFile.SetRowFormat(Int32, Int32, Boolean)

Sets the XF format for the entire row.

Syntax

Namespace: FlexCel.Core

public abstract void SetRowFormat(Int32 row, Int32 XF, Boolean resetRow)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row index (1-based)
 | XF | Int32 | XF format.
 | resetRow | Boolean | When true, all existing cells on the row will be reset to this format. This is the standard Excel behavior and the recommended option. If you don't care about existing cells, you can speed up this method by setting it to false.

See also

  • ExcelFile

ExcelFile.SetRowFormat(Int32, TFlxFormat, TFlxApplyFormat, Boolean)

Sets the format characteristics specified in ApplyFormat for the entire row.

Syntax

Namespace: FlexCel.Core

public abstract void SetRowFormat(Int32 row, TFlxFormat newFormat, TFlxApplyFormat applyNewFormat, Boolean resetRow)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row index (1-based)
 | newFormat | TFlxFormat | Format to apply.
 | applyNewFormat | TFlxApplyFormat | Indicates which properties of newFormat will be applied to the cells.
 | resetRow | Boolean | When true, all existing cells on the row will be reset to this format. This is the standard Excel behavior and the recommended option. If you don't care about existing cells, you can speed up this method by setting it to false.

See also

  • ExcelFile


ExcelFile.GetColFormat Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.GetColFormat Method

Overloads

  • ExcelFile.GetColFormat(Int32)
  • ExcelFile.GetColFormat(Int32, Int32)

ExcelFile.GetColFormat(Int32)

Gets the XF format for the specified column, -1 if the column doesn't have format.

Syntax

Namespace: FlexCel.Core

public abstract Int32 GetColFormat(Int32 col)

Parameters

<-> | Parameter | Type | Description
 | col | Int32 | Column index (1-based)

Returns

XF format.

See also

  • ExcelFile

ExcelFile.GetColFormat(Int32, Int32)

Gets the XF format for the specified column, -1 if the column doesn't have format.

Syntax

Namespace: FlexCel.Core

public abstract Int32 GetColFormat(Int32 sheet, Int32 col)

Parameters

<-> | Parameter | Type | Description
 | sheet | Int32 | Sheet index (1 based).
 | col | Int32 | Column index (1-based)

Returns

XF format.

See also

  • ExcelFile


ExcelFile.SetColFormat Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.SetColFormat Method

Overloads

  • ExcelFile.SetColFormat(Int32, Int32)
  • ExcelFile.SetColFormat(Int32, Int32, Boolean)
  • ExcelFile.SetColFormat(Int32, Int32, Int32)
  • ExcelFile.SetColFormat(Int32, Int32, Int32, Boolean)
  • ExcelFile.SetColFormat(Int32, TFlxFormat, TFlxApplyFormat, Boolean)

ExcelFile.SetColFormat(Int32, Int32)

Sets the format for an entire column.

Syntax

Namespace: FlexCel.Core

public void SetColFormat(Int32 col, Int32 XF)

Parameters

<-> | Parameter | Type | Description
 | col | Int32 | Column to set.
 | XF | Int32 | XF Format index.

See also

  • ExcelFile

ExcelFile.SetColFormat(Int32, Int32, Boolean)

Sets the format for an entire column. If you want to set the format for more than one column, use SetColFormat(Int32, Int32, Int32, Boolean) instead.

Syntax

Namespace: FlexCel.Core

public abstract void SetColFormat(Int32 col, Int32 XF, Boolean resetColumn)

Parameters

<-> | Parameter | Type | Description
 | col | Int32 | Column to set.
 | XF | Int32 | XF Format index.
 | resetColumn | Boolean | When true, all existing cells on the column will be reset to this format. This is the standard Excel behavior and the recommended option. If you don't care about existing cells, you can speed up this method by setting it to false.

See also

  • ExcelFile

ExcelFile.SetColFormat(Int32, Int32, Int32)

Sets the format for a range of columns.

Syntax

Namespace: FlexCel.Core

public void SetColFormat(Int32 col1, Int32 col2, Int32 XF)

Parameters

<-> | Parameter | Type | Description
 | col1 | Int32 | First column in the range to set.
 | col2 | Int32 | Last column in the range to set.
 | XF | Int32 | XF Format index.

See also

  • ExcelFile

ExcelFile.SetColFormat(Int32, Int32, Int32, Boolean)

Sets the format for a range of columns.

Syntax

Namespace: FlexCel.Core

public abstract void SetColFormat(Int32 col1, Int32 col2, Int32 XF, Boolean resetColumn)

Parameters

<-> | Parameter | Type | Description
 | col1 | Int32 | First column in the range to set.
 | col2 | Int32 | Last column in the range to set.
 | XF | Int32 | XF Format index.
 | resetColumn | Boolean | When true, all existing cells on the column will be reset to this format. This is the standard Excel behavior and the recommended option. If you don't care about existing cells, you can speed up this method by setting it to false.

See also

  • ExcelFile

ExcelFile.SetColFormat(Int32, TFlxFormat, TFlxApplyFormat, Boolean)

Sets the format characteristics specified in ApplyFormat for the entire column.

Syntax

Namespace: FlexCel.Core

public abstract void SetColFormat(Int32 col, TFlxFormat newFormat, TFlxApplyFormat applyNewFormat, Boolean resetColumn)

Parameters

<-> | Parameter | Type | Description
 | col | Int32 | Column to set.
 | newFormat | TFlxFormat | Format to apply.
 | applyNewFormat | TFlxApplyFormat | Indicates which properties of newFormat will be applied to the cells.
 | resetColumn | Boolean | When true, all existing cells on the column will be reset to this format. This is the standard Excel behavior and the recommended option. If you don't care about existing cells, you can speed up this method by setting it to false.

See also

  • ExcelFile


ExcelFile.GetRowOptions Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.GetRowOptions Method

Returns all Row options at once (if the row is autosize, if it is hidden, etc).

Remarks

To get individual values, use the corresponding methods (i.e. GetAutoRowHeight) Use this method only to copy the options from one row to another.

Syntax

Namespace: FlexCel.Core

public abstract Int32 GetRowOptions(Int32 row)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row Index (1 based)

Returns

Row options

Examples

To copy all the row options from row 1 to 2, use

    xls.SetRowOptions(2, xls.GetRowOptions(1));

This is faster and simpler than assigning each option alone.

See also

  • ExcelFile


ExcelFile.SetRowOptions Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.SetRowOptions Method

Sets all Row options at once (if the row is autosize, if it is hidden, etc).

Remarks

To set individual values, use the corresponding methods (i.e. SetAutoRowHeight) Use this method only to copy the options from one row to another.

Syntax

Namespace: FlexCel.Core

public abstract void SetRowOptions(Int32 row, Int32 options)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row Index (1 based)
 | options | Int32 | A flag with all row options

Examples

To copy all the row options from row 1 to 2, use

    xls.SetRowOptions(2, xls.GetRowOptions(1));

This is faster and simpler than assigning each option one by one.

See also

  • ExcelFile


ExcelFile.GetColOptions Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.GetColOptions Method

Returns all Column options at once (if the column is hidden, etc).

Remarks

To get individual values, use the corresponding methods (i.e. GetColHidden) Use this method only to copy the options from one column to another.

Syntax

Namespace: FlexCel.Core

public abstract Int32 GetColOptions(Int32 col)

Parameters

<-> | Parameter | Type | Description
 | col | Int32 | Column Index (1 based)

Examples

To copy all the column options from column 1 to 2, use

    xls.SetColOptions(2, xls.GetColOptions(1));

This is faster and simpler than assigning each option alone.

See also

  • ExcelFile


ExcelFile.SetColOptions Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.SetColOptions Method

Sets all Column options at once (if the column is hidden, etc).

Remarks

To set individual values, use the corresponding methods (i.e. SetColHidden(Int32, Int32, Boolean)) Use this method only to copy the options from one column to another.

Syntax

Namespace: FlexCel.Core

public abstract void SetColOptions(Int32 col, Int32 options)

Parameters

<-> | Parameter | Type | Description
 | col | Int32 | Column Index (1 based)
 | options | Int32 | A flag with all column options.

Examples

To copy all the column options from column 1 to 2, use

    xls.SetColOptions(2, xls.GetColOptions(1));

This is faster and simpler than assigning each option alone.

See also

  • ExcelFile


ExcelFile.GetRowHeight Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.GetRowHeight Method

Overloads

  • ExcelFile.GetRowHeight(Int32)
  • ExcelFile.GetRowHeight(Int32, Boolean)
  • ExcelFile.GetRowHeight(Int32, Int32, Boolean)

ExcelFile.GetRowHeight(Int32)

Returns the current Row height, in Excel internal units. (1/20th of a point) See Excel Internal Units for more information in Excel internal units.

Remarks

Use FlxConsts.RowMult to convert the internal units to pixels.

Syntax

Namespace: FlexCel.Core

public abstract Int32 GetRowHeight(Int32 row)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row Index (1 based)

Returns

Row height in internal excel units.

Examples

    double RowHeightInPixels = xls.GetRowHeight(Row) / FlxConsts.RowMult;

See also

  • ExcelFile

ExcelFile.GetRowHeight(Int32, Boolean)

Returns the current Row height, in Excel internal units. (1/20th of a point) See Excel Internal Units for more information in Excel internal units.

Remarks

Use FlxConsts.RowMult to convert the internal units to pixels.

Syntax

Namespace: FlexCel.Core

public Int32 GetRowHeight(Int32 row, Boolean HiddenIsZero)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row Index (1 based)
 | HiddenIsZero | Boolean | If true, the height returned for a hidden row will be 0 and not its real height.

Returns

Row height in internal excel units.

Examples

    double RowHeightInPixels = xls.GetRowHeight(Row) / FlxConsts.RowMult;

See also

  • ExcelFile

ExcelFile.GetRowHeight(Int32, Int32, Boolean)

Returns the current Row height for a given sheet, in Excel internal units. (1/20th of a point) See Excel Internal Units for more information in Excel internal units.

Remarks

Use FlxConsts.RowMult to convert the internal units to pixels.

Syntax

Namespace: FlexCel.Core

public abstract Int32 GetRowHeight(Int32 sheet, Int32 row, Boolean HiddenIsZero)

Parameters

<-> | Parameter | Type | Description
 | sheet | Int32 | Sheet where to look for the height.
 | row | Int32 | Row Index (1 based)
 | HiddenIsZero | Boolean | If true, the height returned for a hidden row will be 0 and not its real height.

Returns

Row height in internal Excel units.(1/20th of a point)

Examples

    double RowHeightInPixels = xls.GetRowHeight(Row) / FlxConsts.RowMult;

See also

  • ExcelFile


ExcelFile.SetRowHeight Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.SetRowHeight Method

Sets the current Row height, in Excel internal units. (1/20th of a point) See Excel Internal Units for more information in Excel internal units.

Remarks

Use FlxConsts.RowMult to convert the internal units to pixels.

Syntax

Namespace: FlexCel.Core

public abstract void SetRowHeight(Int32 row, Int32 height)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row Index (1 based)
 | height | Int32 | Row height, in Excel internal units. (1/20th of a point). See FlxConsts.RowMult

Examples

    double RowHeightInPixels = xls.GetRowHeight(Row) / FlxConsts.RowMult;

See also

  • ExcelFile


ExcelFile.GetColWidth Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.GetColWidth Method

Overloads

  • ExcelFile.GetColWidth(Int32)
  • ExcelFile.GetColWidth(Int32, Boolean)
  • ExcelFile.GetColWidth(Int32, Int32, Boolean)

ExcelFile.GetColWidth(Int32)

Returns the current Column width, in Excel internal units. (Character width of "font 0" / 256) See Excel Internal Units for more information in Excel internal units.

Remarks

Use ExcelMetrics.ColMult to convert the internal units to pixels.

Syntax

Namespace: FlexCel.Core

public abstract Int32 GetColWidth(Int32 col)

Parameters

<-> | Parameter | Type | Description
 | col | Int32 | Column Index (1 based)

Returns

Column width in internal excel units.(Character width of "font 0" / 256)

Examples

    double ColWidthInPixels = xls.GetColWidth(Col) / ExcelMetrics.ColMult(xls);

See also

  • ExcelFile

ExcelFile.GetColWidth(Int32, Boolean)

Returns the current Column width, in Excel internal units. (Character width of font 0 / 256) See Excel Internal Units for more information in Excel internal units.

Remarks

Use ExcelMetrics.ColMult to convert the internal units to pixels.

Syntax

Namespace: FlexCel.Core

public abstract Int32 GetColWidth(Int32 col, Boolean HiddenIsZero)

Parameters

<-> | Parameter | Type | Description
 | col | Int32 | Column Index (1 based)
 | HiddenIsZero | Boolean | If true, the width returned for a hidden column will be 0 and not its real width.

Returns

Column width in internal excel units.(Character width of font 0 / 256)

Examples

    double ColWidthInPixels = xls.GetColWidth(Col) / ExcelMetrics.ColMult(xls);

See also

  • ExcelFile

ExcelFile.GetColWidth(Int32, Int32, Boolean)

Returns the current Column width for a given sheet, in Excel internal units. (Character width of font 0 / 256) See Excel Internal Units for more information in Excel internal units.

Remarks

Use ExcelMetrics.ColMult to convert the internal units to pixels.

Syntax

Namespace: FlexCel.Core

public abstract Int32 GetColWidth(Int32 sheet, Int32 col, Boolean HiddenIsZero)

Parameters

<-> | Parameter | Type | Description
 | sheet | Int32 | Sheet where to look for the width.
 | col | Int32 | Column Index (1 based)
 | HiddenIsZero | Boolean | If true, the width returned for a hidden column will be 0 and not its real width.

Returns

Column width in internal excel units.(Character width of font 0 / 256)

Examples

    double ColWidthInPixels = xls.GetColWidth(Col) / ExcelMetrics.ColMult(xls);

See also

  • ExcelFile


ExcelFile.SetColWidth Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.SetColWidth Method

Overloads

  • ExcelFile.SetColWidth(Int32, Int32)
  • ExcelFile.SetColWidth(Int32, Int32, Int32)

ExcelFile.SetColWidth(Int32, Int32)

Sets the current Column width, in Excel internal units. (Character width of font 0 / 256) Note: if possible, set many column widths at once by calling SetColWidth(Int32, Int32, Int32). It is faster. See Excel Internal Units for more information in Excel internal units.

Remarks

Use ExcelMetrics.ColMult to convert the internal units to pixels.

Syntax

Namespace: FlexCel.Core

public abstract void SetColWidth(Int32 col, Int32 width)

Parameters

<-> | Parameter | Type | Description
 | col | Int32 | Column index (1 based)
 | width | Int32 | Column width, in Excel internal units. (Character width of font 0 / 256). See ExcelMetrics.ColMult

Examples

    double ColWidthInPixels = xls.GetColWidth(Col) / ExcelMetrics.ColMult(xls);

See also

  • ExcelFile

ExcelFile.SetColWidth(Int32, Int32, Int32)

Sets the width of a range of columns, in Excel internal units. (Character width of font 0 / 256) See Excel Internal Units for more information in Excel internal units.

Remarks

Use ExcelMetrics.ColMult to convert the internal units to pixels.

Syntax

Namespace: FlexCel.Core

public abstract void SetColWidth(Int32 col1, Int32 col2, Int32 width)

Parameters

<-> | Parameter | Type | Description
 | col1 | Int32 | Column index of the first column in the range. (1 based)
 | col2 | Int32 | Column index of the last column in the range. (1 based)
 | width | Int32 | Column width, in Excel internal units. (Character width of font 0 / 256). See ExcelMetrics.ColMult

Examples

    double ColWidthInPixels = xls.GetColWidth(Col) / ExcelMetrics.ColMult(xls);

See also

  • ExcelFile


ExcelFile.DefaultRowHeightVisual Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.DefaultRowHeightVisual Method

The default height for empty rows, in Excel internal units. (1/20th of a point). Different from DefaultRowHeight this property returns the actual row height as Excel will show it, considering DefaultRowHidden and DefaultRowHeightAutomatic. See Excel Internal Units for more information in Excel internal units.

Remarks

Use FlxConsts.RowMult to convert the internal units to pixels.

Syntax

Namespace: FlexCel.Core

public abstract Int32 DefaultRowHeightVisual(Boolean useDefaultRowHeightAutomatic)

Parameters

<-> | Parameter | Type | Description
 | useDefaultRowHeightAutomatic | Boolean | If false, the property DefaultRowHeightAutomatic will be ignored and considered false. In many cases you will prefer to use the default row height stored in the file, even if DefaultRowHeightAutomatic is true.

Examples

    double RowHeightInPixels = xls.GetRowHeight(Row) / FlxConsts.RowMult;

See also

  • ExcelFile


ExcelFile.GetRowHidden Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.GetRowHidden Method

Overloads

  • ExcelFile.GetRowHidden(Int32)
  • ExcelFile.GetRowHidden(Int32, Int32)

ExcelFile.GetRowHidden(Int32)

Returns true if the row is hidden.

Syntax

Namespace: FlexCel.Core

public abstract Boolean GetRowHidden(Int32 row)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row index (1 based).

Returns

True if the row is hidden.

See also

  • ExcelFile

ExcelFile.GetRowHidden(Int32, Int32)

Returns true if the row is hidden. This method does not care about ActiveSheet.

Syntax

Namespace: FlexCel.Core

public abstract Boolean GetRowHidden(Int32 sheet, Int32 row)

Parameters

<-> | Parameter | Type | Description
 | sheet | Int32 | Sheet index (1 based) for the row.
 | row | Int32 | Row index (1 based).

Returns

True if the row is hidden.

See also

  • ExcelFile


ExcelFile.SetRowHidden Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.SetRowHidden Method

Hides or shows a specific row.

Syntax

Namespace: FlexCel.Core

public abstract void SetRowHidden(Int32 row, Boolean hide)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row index (1 based)
 | hide | Boolean | If true, row will be hidden, if false it will be visible.

See also

  • ExcelFile


ExcelFile.GetColHidden Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.GetColHidden Method

Returns true if the column is hidden.

Syntax

Namespace: FlexCel.Core

public abstract Boolean GetColHidden(Int32 col)

Parameters

<-> | Parameter | Type | Description
 | col | Int32 | Column index (1 based)

Returns

True if the column is hidden.

See also

  • ExcelFile


ExcelFile.SetColHidden Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.SetColHidden Method

Overloads

  • ExcelFile.SetColHidden(Int32, Boolean)
  • ExcelFile.SetColHidden(Int32, Int32, Boolean)

ExcelFile.SetColHidden(Int32, Boolean)

Hides or shows a specific column. Note: If you are hiding many columns at the same time, you can call SetColHidden(Int32, Int32, Boolean) as it is faster.

Syntax

Namespace: FlexCel.Core

public abstract void SetColHidden(Int32 col, Boolean hide)

Parameters

<-> | Parameter | Type | Description
 | col | Int32 | Column index (1 based).
 | hide | Boolean | If true, column will be hidden, if false it will be visible.

See also

  • ExcelFile

ExcelFile.SetColHidden(Int32, Int32, Boolean)

Hides or shows a range of columns.

Syntax

Namespace: FlexCel.Core

public abstract void SetColHidden(Int32 col1, Int32 col2, Boolean hide)

Parameters

<-> | Parameter | Type | Description
 | col1 | Int32 | Column index of the first column in the range. (1 based)
 | col2 | Int32 | Column index of the last column in the range. (1 based)
 | hide | Boolean | If true, column will be hidden, if false it will be visible.

See also

  • ExcelFile


ExcelFile.GetAutoRowHeight Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.GetAutoRowHeight Method

Returns if the row is adjusting its size to the cell (the default) or if it has a fixed height.

Remarks

By default, Excel rows auto adapt their size to the font size. If you set the row height manually, it will remain fixed to this size until you set AutoFit (Menu->Format->Row->AutoFit) back.

Syntax

Namespace: FlexCel.Core

public abstract Boolean GetAutoRowHeight(Int32 row)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row index (1-based)

Returns

True if AutoFit is on for the row, False if it has a fixed size

See also

  • ExcelFile


ExcelFile.SetAutoRowHeight Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.SetAutoRowHeight Method

Sets the current row to automatically autosize to the biggest cell or not.

Remarks

By default, Excel rows auto adapt their size to the font size. If you set the row height manually, it will remain fixed to this size until you set AutoFit (Menu->Format->Row->AutoFit) back.

Syntax

Namespace: FlexCel.Core

public abstract void SetAutoRowHeight(Int32 row, Boolean autoRowHeight)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row index (1-based)
 | autoRowHeight | Boolean | If true, row will have autofit.

See also

  • ExcelFile


ExcelFile.AutofitRow Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.AutofitRow Method

Overloads

  • ExcelFile.AutofitRow(Int32, Boolean, Double)
  • ExcelFile.AutofitRow(Int32, Int32, Boolean, Boolean, Double)
  • ExcelFile.AutofitRow(Int32, Int32, Boolean, Boolean, Double, Int32, Int32, Int32)
  • ExcelFile.AutofitRow(Int32, Int32, Boolean, Boolean, Double, Int32, Int32, Int32, TAutofitMerged)
  • ExcelFile.AutofitRow(Int32, Int32, Int32, Int32, Boolean, Boolean, Double, Int32, Int32, Int32, TAutofitMerged)

ExcelFile.AutofitRow(Int32, Boolean, Double)

Autofits a row so it adapts its height to show all the text inside. It does not matter if the row is set to Autofit or not in Excel. Note that due to GDI+ / GDI incompatibilities, the height calculated by FlexCel will not be exactly the same than the one calculated by Excel. So when you open this workbook in Excel, Excel will re calculate the row heights to what it believes is best. You can change this behavior specifying keepHeightAutomatic = false. See also Fine Tuning Row Autofitting

Syntax

Namespace: FlexCel.Core

public void AutofitRow(Int32 row, Boolean keepHeightAutomatic, Double adjustment)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row to Autofit.
 | keepHeightAutomatic | Boolean | If true, rows will be still autoheight when you open the file in Excel, so Excel will recalculate the values, probably changing the page breaks. If you set it to false, rows will be fixed in size, and when you open it on Excel they will remain so.
 | adjustment | Double | You will normally want to set this parameter to 1, which means that autofit will be made with standard measurements. If you set it to for example 1.1, then rows will be adjusted to 110% percent of what their calculated height was. Use this parameter to fine-tune autofiting, if for example rows are too small when opening the file in Excel.

See also

  • ExcelFile

ExcelFile.AutofitRow(Int32, Int32, Boolean, Boolean, Double)

Autofits a range of rows so they adapt their height to show all the text inside. Note that due to GDI+ / GDI incompatibilities, the height calculated by FlexCel will not be exactly the same than the one calculated by Excel. So when you open this workbook in Excel, Excel will re calculate the row heights to what it believes is best. You can change this behavior specifying keepHeightAutomatic = false. See also Fine Tuning Row Autofitting

Syntax

Namespace: FlexCel.Core

public void AutofitRow(Int32 row1, Int32 row2, Boolean autofitNotAutofittingRows, Boolean keepHeightAutomatic, Double adjustment)

Parameters

<-> | Parameter | Type | Description
 | row1 | Int32 | First row to autofit.
 | row2 | Int32 | Last row to autofit.
 | autofitNotAutofittingRows | Boolean | When you are autofitting a range of rows, some rows might not be set to Autofit in Excel. When this parameter is true, those rows will be autofitted anyway.
 | keepHeightAutomatic | Boolean | If true, rows will be still autoheight when you open the file in Excel, so Excel will recalculate the values, probably changing the page breaks. If you set it to false, rows will be fixed in size, and when you open it on Excel they will remain so.
 | adjustment | Double | You will normally want to set this parameter to 1, which means that autofit will be made with standard measurements. If you set it to for example 1.1, then rows will be adjusted to 110% percent of what their calculated height was. Use this parameter to fine-tune autofiting, if for example rows are too small when opening the file in Excel.

See also

  • ExcelFile

ExcelFile.AutofitRow(Int32, Int32, Boolean, Boolean, Double, Int32, Int32, Int32)

Autofits a range of rows so they adapt their height to show all the text inside. Note that due to GDI+ / GDI incompatibilities, the height calculated by FlexCel will not be exactly the same than the one calculated by Excel. So when you open this workbook in Excel, Excel will re calculate the row heights to what it believes is best. You can change this behavior specifying keepHeightAutomatic = false. See also Fine Tuning Row Autofitting

Syntax

Namespace: FlexCel.Core

public void AutofitRow(Int32 row1, Int32 row2, Boolean autofitNotAutofittingRows, Boolean keepHeightAutomatic, Double adjustment, Int32 adjustmentFixed, Int32 minHeight, Int32 maxHeight)

Parameters

<-> | Parameter | Type | Description
 | row1 | Int32 | First row to autofit.
 | row2 | Int32 | Last row to autofit.
 | autofitNotAutofittingRows | Boolean | When you are autofitting a range of rows, some rows might not be set to Autofit in Excel. When this parameter is true, those rows will be autofitted anyway.
 | keepHeightAutomatic | Boolean | If true, rows will be still autoheight when you open the file in Excel, so Excel will recalculate the values, probably changing the page breaks. If you set it to false, rows will be fixed in size, and when you open it on Excel they will remain so.
 | adjustment | Double | You will normally want to set this parameter to 1, which means that autofit will be made with standard measurements. If you set it to for example 1.1, then rows will be adjusted to 110% percent of what their calculated height was. Use this parameter to fine-tune autofitting, if for example rows are too small when opening the file in Excel.
 | adjustmentFixed | Int32 | You will normally set this parameter to 0, which means standard autofit. If you set it to a value, the row will be made larger by that amount from the calculated autofit. Different from the "adjustment" parameter, this parameter adds a fixed size to the row and not a percentage. The final size of the row will be: FinalSize = CalulatedAutoFit * adjustment + adjusmentFixed
 | minHeight | Int32 | Minimum final height for the row to autofit. If the calculated value is less than minHeight, row size will be set to minHeight. A negative value on minHeight means the row size will be no smaller than the original height.
 | maxHeight | Int32 | Maximum final height for the row to autofit. If the calculated value is more than maxHeight, row size will be set to maxHeight. maxHeight = 0 means no maxHeight. A negative value on maxHeight means the row size will be no bigger than the original height.

See also

  • ExcelFile

ExcelFile.AutofitRow(Int32, Int32, Boolean, Boolean, Double, Int32, Int32, Int32, TAutofitMerged)

Autofits a range of rows so they adapt their height to show all the text inside. Note that due to GDI+ / GDI incompatibilities, the height calculated by FlexCel will not be exactly the same than the one calculated by Excel. So when you open this workbook in Excel, Excel will re calculate the row heights to what it believes is best. You can change this behavior specifying keepHeightAutomatic = false. See also Fine Tuning Row Autofitting

Syntax

Namespace: FlexCel.Core

public void AutofitRow(Int32 row1, Int32 row2, Boolean autofitNotAutofittingRows, Boolean keepHeightAutomatic, Double adjustment, Int32 adjustmentFixed, Int32 minHeight, Int32 maxHeight, TAutofitMerged autofitMerged)

Parameters

<-> | Parameter | Type | Description
 | row1 | Int32 | First row to autofit.
 | row2 | Int32 | Last row to autofit.
 | autofitNotAutofittingRows | Boolean | When you are autofitting a range of rows, some rows might not be set to Autofit in Excel. When this parameter is true, those rows will be autofitted anyway.
 | keepHeightAutomatic | Boolean | If true, rows will be still autoheight when you open the file in Excel, so Excel will recalculate the values, probably changing the page breaks. If you set it to false, rows will be fixed in size, and when you open it on Excel they will remain so.
 | adjustment | Double | You will normally want to set this parameter to 1, which means that autofit will be made with standard measurements. If you set it to for example 1.1, then rows will be adjusted to 110% percent of what their calculated height was. Use this parameter to fine-tune autofiting, if for example rows are too small when opening the file in Excel.
 | adjustmentFixed | Int32 | You will normally set this parameter to 0, which means standard autofit. If you set it to a value, the row will be made larger by that amount from the calculated autofit. Different from the "adjustment" parameter, this parameter adds a fixed size to the row and not a percentage. The final size of the row will be: FinalSize = CalulatedAutoFit * adjustment + adjusmentFixed
 | minHeight | Int32 | Minimum final height for the row to autofit. If the calculated value is less than minHeight, row size will be set to minHeight. A negative value on minHeight means the row size will be no smaller than the original height.
 | maxHeight | Int32 | Maximum final height for the row to autofit. If the calculated value is more than maxHeight, row size will be set to maxHeight. maxHeight = 0 means no maxHeight. A negative value on maxHeight means the row size will be no bigger than the original height.
 | autofitMerged | TAutofitMerged | Specifies which row in a merged cell using more than one row will be used to autofit the merged cell. If you don't specify this parameter, it will be the last row.

See also

  • ExcelFile

ExcelFile.AutofitRow(Int32, Int32, Int32, Int32, Boolean, Boolean, Double, Int32, Int32, Int32, TAutofitMerged)

Autofits a range of rows so they adapt their height to show all the text inside. Note that due to GDI+ / GDI incompatibilities, the height calculated by FlexCel will not be exactly the same than the one calculated by Excel. So when you open this workbook in Excel, Excel will re calculate the row heights to what it believes is best. You can change this behavior specifying keepHeightAutomatic = false. See also Fine Tuning Row Autofitting

Syntax

Namespace: FlexCel.Core

public abstract void AutofitRow(Int32 row1, Int32 row2, Int32 minCol, Int32 maxCol, Boolean autofitNotAutofittingRows, Boolean keepHeightAutomatic, Double adjustment, Int32 adjustmentFixed, Int32 minHeight, Int32 maxHeight, TAutofitMerged autofitMerged)

Parameters

<-> | Parameter | Type | Description
 | row1 | Int32 | First row to autofit.
 | row2 | Int32 | Last row to autofit.
 | minCol | Int32 | First column that will be used to calculate the height of the row. If for example you wanted to calculate the row height based in the contents of the columns 3 to 9, you would specify 3 here.
 | maxCol | Int32 | Last column that will be used to calculate the height of the row. If for example you wanted to calculate the row height based in the contents of the columns 3 to 9, you would specify 9 here. Specify any value <=0 here to use all columns for the autofit.
 | autofitNotAutofittingRows | Boolean | When you are autofitting a range of rows, some rows might not be set to Autofit in Excel. When this parameter is true, those rows will be autofitted anyway.
 | keepHeightAutomatic | Boolean | If true, rows will be still autoheight when you open the file in Excel, so Excel will recalculate the values, probably changing the page breaks. If you set it to false, rows will be fixed in size, and when you open it on Excel they will remain so.
 | adjustment | Double | You will normally want to set this parameter to 1, which means that autofit will be made with standard measurements. If you set it to for example 1.1, then rows will be adjusted to 110% percent of what their calculated height was. Use this parameter to fine-tune autofiting, if for example rows are too small when opening the file in Excel.
 | adjustmentFixed | Int32 | You will normally set this parameter to 0, which means standard autofit. If you set it to a value, the row will be made larger by that amount from the calculated autofit. Different from the "adjustment" parameter, this parameter adds a fixed size to the row and not a percentage. The final size of the row will be: FinalSize = CalulatedAutoFit * adjustment + adjusmentFixed
 | minHeight | Int32 | Minimum final height for the row to autofit. If the calculated value is less than minHeight, row size will be set to minHeight. A negative value on minHeight means the row size will be no smaller than the original height.
 | maxHeight | Int32 | Maximum final height for the row to autofit. If the calculated value is more than maxHeight, row size will be set to maxHeight. maxHeight = 0 means no maxHeight. A negative value on maxHeight means the row size will be no bigger than the original height.
 | autofitMerged | TAutofitMerged | Specifies which row in a merged cell using more than one row will be used to autofit the merged cell. If you don't specify this parameter, it will be the last row.

See also

  • ExcelFile


ExcelFile.AutofitCol Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.AutofitCol Method

Overloads

  • ExcelFile.AutofitCol(Int32, Boolean, Double)
  • ExcelFile.AutofitCol(Int32, Int32, Boolean, Double)
  • ExcelFile.AutofitCol(Int32, Int32, Boolean, Double, Int32, Int32, Int32)
  • ExcelFile.AutofitCol(Int32, Int32, Boolean, Double, Int32, Int32, Int32, TAutofitMerged)
  • ExcelFile.AutofitCol(Int32, Int32, Int32, Int32, Boolean, Double, Int32, Int32, Int32, TAutofitMerged)

ExcelFile.AutofitCol(Int32, Boolean, Double)

Autofits a column so it adapts its width to show all the text inside.

Syntax

Namespace: FlexCel.Core

public void AutofitCol(Int32 col, Boolean ignoreStrings, Double adjustment)

Parameters

<-> | Parameter | Type | Description
 | col | Int32 | Column to Autofit.
 | ignoreStrings | Boolean | When true, strings will not be considered for the autofit. Only numbers will.
 | adjustment | Double | You will normally want to set this parameter to 1, which means that autofit will be made with standard measurements. If you set it to for example 1.1, then columns will be adjusted to 110% percent of what their calculated width was. Use this parameter to fine-tune autofiting, if for example columns are too small when opening the file in Excel.

See also

  • ExcelFile

ExcelFile.AutofitCol(Int32, Int32, Boolean, Double)

Autofits a range of columns so they adapt their width to show all the text inside.

Syntax

Namespace: FlexCel.Core

public void AutofitCol(Int32 col1, Int32 col2, Boolean ignoreStrings, Double adjustment)

Parameters

<-> | Parameter | Type | Description
 | col1 | Int32 | First column to Autofit.
 | col2 | Int32 | Last column to Autofit.
 | ignoreStrings | Boolean | When true, strings will not be considered for the autofit. Only numbers will.
 | adjustment | Double | You will normally want to set this parameter to 1, which means that autofit will be made with standard measurements. If you set it to for example 1.1, then columns will be adjusted to 110% percent of what their calculated width was. Use this parameter to fine-tune autofiting, if for example columns are too small when opening the file in Excel.

See also

  • ExcelFile

ExcelFile.AutofitCol(Int32, Int32, Boolean, Double, Int32, Int32, Int32)

Autofits a range of columns so they adapt their width to show all the text inside.

Syntax

Namespace: FlexCel.Core

public void AutofitCol(Int32 col1, Int32 col2, Boolean ignoreStrings, Double adjustment, Int32 adjustmentFixed, Int32 minWidth, Int32 maxWidth)

Parameters

<-> | Parameter | Type | Description
 | col1 | Int32 | First column to Autofit.
 | col2 | Int32 | Last column to Autofit.
 | ignoreStrings | Boolean | When true, strings will not be considered for the autofit. Only numbers will.
 | adjustment | Double | You will normally want to set this parameter to 1, which means that autofit will be made with standard measurements. If you set it to for example 1.1, then columns will be adjusted to 110% percent of what their calculated width was. Use this parameter to fine-tune autofiting, if for example columns are too small when opening the file in Excel.
 | adjustmentFixed | Int32 | You will normally set this parameter to 0, which means standard autofit. If you set it to a value, the column will be made larger by that amount from the calculated autofit. Different from the "adjustment" parameter, this parameter adds a fixed size to the column and not a percentage. The final size of the column will be: FinalSize = CalulatedAutoFit * adjustment + adjusmentFixed
 | minWidth | Int32 | Minimum final width for the column to autofit. If the calculated value is less than minWidth, column size will be set to minWidth. A negative value on minWidth means the column size will be no smaller than the original width.
 | maxWidth | Int32 | Maximum final width for the column to autofit. If the calculated value is more than maxWidth, column size will be set to maxWidth. maxWidth = 0 means no maxWidth. A negative value on maxWidth means the column size will be no bigger than the original width.

See also

  • ExcelFile

ExcelFile.AutofitCol(Int32, Int32, Boolean, Double, Int32, Int32, Int32, TAutofitMerged)

Autofits a range of columns so they adapt their width to show all the text inside.

Syntax

Namespace: FlexCel.Core

public void AutofitCol(Int32 col1, Int32 col2, Boolean ignoreStrings, Double adjustment, Int32 adjustmentFixed, Int32 minWidth, Int32 maxWidth, TAutofitMerged autofitMerged)

Parameters

<-> | Parameter | Type | Description
 | col1 | Int32 | First column to Autofit.
 | col2 | Int32 | Last column to Autofit.
 | ignoreStrings | Boolean | When true, strings will not be considered for the autofit. Only numbers will.
 | adjustment | Double | You will normally want to set this parameter to 1, which means that autofit will be made with standard measurements. If you set it to for example 1.1, then columns will be adjusted to 110% percent of what their calculated width was. Use this parameter to fine-tune autofiting, if for example columns are too small when opening the file in Excel.
 | adjustmentFixed | Int32 | You will normally set this parameter to 0, which means standard autofit. If you set it to a value, the column will be made larger by that amount from the calculated autofit. Different from the "adjustment" parameter, this parameter adds a fixed size to the column and not a percentage. The final size of the column will be: FinalSize = CalulatedAutoFit * adjustment + adjusmentFixed
 | minWidth | Int32 | Minimum final width for the column to autofit. If the calculated value is less than minWidth, column size will be set to minWidth. A negative value on minWidth means the column size will be no smaller than the original width.
 | maxWidth | Int32 | Maximum final width for the column to autofit. If the calculated value is more than maxWidth, column size will be set to maxWidth. maxWidth = 0 means no maxWidth. A negative value on maxWidth means the column size will be no bigger than the original width.
 | autofitMerged | TAutofitMerged | Specifies which column in a merged cell using more than one column will be used to autofit the merged cell. If you don't specify this parameter, it will be the last column.

See also

  • ExcelFile

ExcelFile.AutofitCol(Int32, Int32, Int32, Int32, Boolean, Double, Int32, Int32, Int32, TAutofitMerged)

Autofits a range of columns so they adapt their width to show all the text inside.

Syntax

Namespace: FlexCel.Core

public abstract void AutofitCol(Int32 col1, Int32 col2, Int32 minRow, Int32 maxRow, Boolean ignoreStrings, Double adjustment, Int32 adjustmentFixed, Int32 minWidth, Int32 maxWidth, TAutofitMerged autofitMerged)

Parameters

<-> | Parameter | Type | Description
 | col1 | Int32 | First column to Autofit.
 | col2 | Int32 | Last column to Autofit.
 | minRow | Int32 | First row that will be used to autofit the column. If you want for example to autofit a column based only in the cells from row 3 to 10, you would use 3 as minRow.
 | maxRow | Int32 | Last row that will be used to autofit the column. If you want for example to autofit a column based only in the cells from row 3 to 10, you would use 10 as maxRow. Specify any value <=0 here to use all rows for the autofit.
 | ignoreStrings | Boolean | When true, strings will not be considered for the autofit. Only numbers will.
 | adjustment | Double | You will normally want to set this parameter to 1, which means that autofit will be made with standard measurements. If you set it to for example 1.1, then columns will be adjusted to 110% percent of what their calculated width was. Use this parameter to fine-tune autofiting, if for example columns are too small when opening the file in Excel.
 | adjustmentFixed | Int32 | You will normally set this parameter to 0, which means standard autofit. If you set it to a value, the column will be made larger by that amount from the calculated autofit. Different from the "adjustment" parameter, this parameter adds a fixed size to the column and not a percentage. The final size of the column will be: FinalSize = CalulatedAutoFit * adjustment + adjusmentFixed
 | minWidth | Int32 | Minimum final width for the column to autofit. If the calculated value is less than minWidth, column size will be set to minWidth. A negative value on minWidth means the column size will be no smaller than the original width.
 | maxWidth | Int32 | Maximum final width for the column to autofit. If the calculated value is more than maxWidth, column size will be set to maxWidth. maxWidth = 0 means no maxWidth. A negative value on maxWidth means the column size will be no bigger than the original width.
 | autofitMerged | TAutofitMerged | Specifies which column in a merged cell using more than one column will be used to autofit the merged cell. If you don't specify this parameter, it will be the last column.

See also

  • ExcelFile


ExcelFile.AutofitRowsOnWorkbook Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.AutofitRowsOnWorkbook Method

Overloads

  • ExcelFile.AutofitRowsOnWorkbook(Boolean, Boolean, Double)
  • ExcelFile.AutofitRowsOnWorkbook(Boolean, Boolean, Double, Int32, Int32, Int32)
  • ExcelFile.AutofitRowsOnWorkbook(Boolean, Boolean, Double, Int32, Int32, Int32, TAutofitMerged)

ExcelFile.AutofitRowsOnWorkbook(Boolean, Boolean, Double)

Autofits all the rows on all sheets on a workbook that are set to autofit so they adapt their height to show all the text inside. Note that due to GDI+ / GDI incompatibilities, the heights calculated by FlexCel will not be exactly the same than the ones calculated by Excel. So when you open this workbook in Excel, Excel might re calculate the row heights to what it believes is best. You can change this behavior specifying keepSizesAutomatic = false. See also Fine Tuning Row Autofitting

Syntax

Namespace: FlexCel.Core

public void AutofitRowsOnWorkbook(Boolean autofitNotAutofittingRows, Boolean keepSizesAutomatic, Double adjustment)

Parameters

<-> | Parameter | Type | Description
 | autofitNotAutofittingRows | Boolean | When you are autofitting a range of rows, some rows might not be set to Autofit in Excel. When this parameter is true, those rows will be autofitted anyway.
 | keepSizesAutomatic | Boolean | When true, no modifications will be done to the "autofit" status of the rows. When false, all rows will be marked as "no autofit", so when you open this file in Excel it will not be resized by Excel, and the printing/export to PDF from Excel will be the same as FlexCel.
 | adjustment | Double | You will normally want to set this parameter to 1, which means that autofit will be made with standard measurements. If you set it to for example 1.1, then rows will be adjusted to 110% percent of what their calculated height was. Use this parameter to fine-tune autofiting, if for example rows are too small when opening the file in Excel.

See also

  • ExcelFile

ExcelFile.AutofitRowsOnWorkbook(Boolean, Boolean, Double, Int32, Int32, Int32)

Autofits all the rows on all sheets on a workbook that are set to autofit so they adapt their height to show all the text inside. Note that due to GDI+ / GDI incompatibilities, the heights calculated by FlexCel will not be exactly the same than the ones calculated by Excel. So when you open this workbook in Excel, Excel might re calculate the row heights to what it believes is best. You can change this behavior specifying keepSizesAutomatic = false. See also Fine Tuning Row Autofitting

Syntax

Namespace: FlexCel.Core

public void AutofitRowsOnWorkbook(Boolean autofitNotAutofittingRows, Boolean keepSizesAutomatic, Double adjustment, Int32 adjustmentFixed, Int32 minHeight, Int32 maxHeight)

Parameters

<-> | Parameter | Type | Description
 | autofitNotAutofittingRows | Boolean | When you are autofitting a range of rows, some rows might not be set to Autofit in Excel. When this parameter is true, those rows will be autofitted anyway.
 | keepSizesAutomatic | Boolean | When true, no modifications will be done to the "autofit" status of the rows. When false, all rows will be marked as "no autofit", so when you open this file in Excel it will not be resized by Excel, and the printing/export to PDF from Excel will be the same as FlexCel.
 | adjustment | Double | You will normally want to set this parameter to 1, which means that autofit will be made with standard measurements. If you set it to for example 1.1, then rows will be adjusted to 110% percent of what their calculated height was. Use this parameter to fine-tune autofiting, if for example rows are too small when opening the file in Excel.
 | adjustmentFixed | Int32 | You will normally set this parameter to 0, which means standard autofit. If you set it to a value, the row will be made larger by that amount from the calculated autofit. Different from the "adjustment" parameter, this parameter adds a fixed size to the row and not a percentage. The final size of the row will be: FinalSize = CalulatedAutoFit * adjustment + adjusmentFixed
 | minHeight | Int32 | Minimum final height for the row to autofit. If the calculated value is less than minHeight, row size will be set to minHeight. A negative value on minHeight means the row size will be no smaller than the original height.
 | maxHeight | Int32 | Maximum final height for the row to autofit. If the calculated value is more than maxHeight, row size will be set to maxHeight. maxHeight = 0 means no maxHeight. A negative value on maxHeight means the row size will be no bigger than the original height.

See also

  • ExcelFile

ExcelFile.AutofitRowsOnWorkbook(Boolean, Boolean, Double, Int32, Int32, Int32, TAutofitMerged)

Autofits all the rows on all sheets on a workbook that are set to autofit so they adapt their height to show all the text inside. Note that due to GDI+ / GDI incompatibilities, the heights calculated by FlexCel will not be exactly the same than the ones calculated by Excel. So when you open this workbook in Excel, Excel might re calculate the row heights to what it believes is best. You can change this behavior specifying keepSizesAutomatic = false. See also Fine Tuning Row Autofitting

Syntax

Namespace: FlexCel.Core

public abstract void AutofitRowsOnWorkbook(Boolean autofitNotAutofittingRows, Boolean keepSizesAutomatic, Double adjustment, Int32 adjustmentFixed, Int32 minHeight, Int32 maxHeight, TAutofitMerged autofitMerged)

Parameters

<-> | Parameter | Type | Description
 | autofitNotAutofittingRows | Boolean | When you are autofitting a range of rows, some rows might not be set to Autofit in Excel. When this parameter is true, those rows will be autofitted anyway.
 | keepSizesAutomatic | Boolean | When true, no modifications will be done to the "autofit" status of the rows. When false, all rows will be marked as "no autofit", so when you open this file in Excel it will not be resized by Excel, and the printing/export to PDF from Excel will be the same as FlexCel.
 | adjustment | Double | You will normally want to set this parameter to 1, which means that autofit will be made with standard measurements. If you set it to for example 1.1, then rows will be adjusted to 110% percent of what their calculated height was. Use this parameter to fine-tune autofiting, if for example rows are too small when opening the file in Excel.
 | adjustmentFixed | Int32 | You will normally set this parameter to 0, which means standard autofit. If you set it to a value, the row will be made larger by that amount from the calculated autofit. Different from the "adjustment" parameter, this parameter adds a fixed size to the row and not a percentage. The final size of the row will be: FinalSize = CalulatedAutoFit * adjustment + adjusmentFixed
 | minHeight | Int32 | Minimum final height for the row to autofit. If the calculated value is less than minHeight, row size will be set to minHeight. A negative value on minHeight means the row size will be no smaller than the original height.
 | maxHeight | Int32 | Maximum final height for the row to autofit. If the calculated value is more than maxHeight, row size will be set to maxHeight. maxHeight = 0 means no maxHeight. A negative value on maxHeight means the row size will be no bigger than the original height.
 | autofitMerged | TAutofitMerged | Specifies which row in a merged cell using more than one row will be used to autofit the merged cell. If you don't specify this parameter, it will be the last row.

See also

  • ExcelFile


ExcelFile.MarkRowForAutofit Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.MarkRowForAutofit Method

Overloads

  • ExcelFile.MarkRowForAutofit(Int32, Boolean, Double)
  • ExcelFile.MarkRowForAutofit(Int32, Boolean, Double, Int32, Int32, Int32, Boolean)

ExcelFile.MarkRowForAutofit(Int32, Boolean, Double)

Marks a row as candidate for future autofit. Note that this method will NOT change anything on the file. It just "marks" the row so you can use it later with AutofitMarkedRowsAndCols(Boolean, Boolean, Double). To change the actual autofit status on the xls file, use SetAutoRowHeight NOTE: This method will not mark empty rows.

Remarks

You can use this method for "delay-marking" rows that you will want to autofit later, but that you cannot autofit yet since they are not filled with data. There is normally no need to use this method, but it is used on report generation to "mark" <#row height(autofit)> tags so those rows and columns can be autofitted once the data on the sheet has been filled.

Syntax

Namespace: FlexCel.Core

public void MarkRowForAutofit(Int32 row, Boolean autofit, Double adjustment)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row index (1 based)
 | autofit | Boolean | Set this to true to mark the row for autofitting, false for removing the row from autofitting list.
 | adjustment | Double | You will normally want to set this parameter to 1, which means that autofit will be made with standard measurements. If you set it to for example 1.1, then rows will be adjusted to 110% percent of what their calculated height was. Use this parameter to fine-tune autofiting, if for example rows are too small when opening the file in Excel.

See also

  • ExcelFile

ExcelFile.MarkRowForAutofit(Int32, Boolean, Double, Int32, Int32, Int32, Boolean)

Marks a row as candidate for future autofit. Note that this method will NOT change anything on the file. It just "marks" the row so you can use it later with AutofitMarkedRowsAndCols(Boolean, Boolean, Double). To change the actual autofit status on the xls file, use SetAutoRowHeight NOTE: This method will not mark empty rows.

Remarks

You can use this method for "delay-marking" rows that you will want to autofit later, but that you cannot autofit yet since they are not filled with data. There is normally no need to use this method, but it is used on report generation to "mark" <#row height(autofit)> tags so those rows and columns can be autofitted once the data on the sheet has been filled.

Syntax

Namespace: FlexCel.Core

public abstract void MarkRowForAutofit(Int32 row, Boolean autofit, Double adjustment, Int32 adjustmentFixed, Int32 minHeight, Int32 maxHeight, Boolean isMerged)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row index (1 based)
 | autofit | Boolean | Set this to true to mark the row for autofitting, false for removing the row from autofitting list.
 | adjustment | Double | You will normally want to set this parameter to 1, which means that autofit will be made with standard measurements. If you set it to for example 1.1, then rows will be adjusted to 110% percent of what their calculated height was. Use this parameter to fine-tune autofiting, if for example rows are too small when opening the file in Excel.
 | adjustmentFixed | Int32 | You will normally set this parameter to 0, which means standard autofit. If you set it to a value, the row will be made larger by that amount from the calculated autofit. Different from the "adjustment" parameter, this parameter adds a fixed size to the row and not a percentage. The final size of the row will be: FinalSize = CalulatedAutoFit * adjustment + adjusmentFixed
 | minHeight | Int32 | Minimum final height for the row to autofit. If the calculated value is less than minHeight, row size will be set to minHeight. A negative value on minHeight means the row size will be no smaller than the original height.
 | maxHeight | Int32 | Maximum final height for the row to autofit. If the calculated value is more than maxHeight, row size will be set to maxHeight. maxHeight = 0 means no maxHeight. A negative value on maxHeight means the row size will be no bigger than the original height.
 | isMerged | Boolean | If true, only the cell will be autofitted, not the whole row.

See also

  • ExcelFile


ExcelFile.MarkColForAutofit Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.MarkColForAutofit Method

Overloads

  • ExcelFile.MarkColForAutofit(Int32, Boolean, Double)
  • ExcelFile.MarkColForAutofit(Int32, Boolean, Double, Int32, Int32, Int32, Boolean)

ExcelFile.MarkColForAutofit(Int32, Boolean, Double)

Marks a column as candidate for future autofit. Note that this method will NOT change anything on the file. It just "marks" the column so you can use it later with AutofitMarkedRowsAndCols(Boolean, Boolean, Double).

Remarks

You can use this method for "delay-marking" columns that you will want to autofit later, but that you cannot autofit yet since they are not filled with data.There is normally no need to use this method, but it is used on report generation to "mark" <#col width(autofit)> tags so those rows and columns can be autofitted once the data on the sheet has been filled.

Syntax

Namespace: FlexCel.Core

public void MarkColForAutofit(Int32 col, Boolean autofit, Double adjustment)

Parameters

<-> | Parameter | Type | Description
 | col | Int32 | Column index (1 based)
 | autofit | Boolean | Set this to true to mark the column for autofitting, false for removing the column from autofitting list.
 | adjustment | Double | You will normally want to set this parameter to 1, which means that autofit will be made with standard measurements. If you set it to for example 1.1, then columns will be adjusted to 110% percent of what their calculated width was. Use this parameter to fine-tune autofiting, if for example columns are too small when opening the file in Excel.

See also

  • ExcelFile

ExcelFile.MarkColForAutofit(Int32, Boolean, Double, Int32, Int32, Int32, Boolean)

Marks a column as candidate for future autofit. Note that this method will NOT change anything on the file. It just "marks" the column so you can use it later with AutofitMarkedRowsAndCols(Boolean, Boolean, Double).

Remarks

You can use this method for "delay-marking" columns that you will want to autofit later, but that you cannot autofit yet since they are not filled with data.There is normally no need to use this method, but it is used on report generation to "mark" <#col width(autofit)> tags so those rows and columns can be autofitted once the data on the sheet has been filled.

Syntax

Namespace: FlexCel.Core

public abstract void MarkColForAutofit(Int32 col, Boolean autofit, Double adjustment, Int32 adjustmentFixed, Int32 minWidth, Int32 maxWidth, Boolean isMerged)

Parameters

<-> | Parameter | Type | Description
 | col | Int32 | Column index (1 based)
 | autofit | Boolean | Set this to true to mark the column for autofitting, false for removing the column from autofitting list.
 | adjustment | Double | You will normally want to set this parameter to 1, which means that autofit will be made with standard measurements. If you set it to for example 1.1, then columns will be adjusted to 110% percent of what their calculated width was. Use this parameter to fine-tune autofiting, if for example columns are too small when opening the file in Excel.
 | adjustmentFixed | Int32 | You will normally set this parameter to 0, which means standard autofit. If you set it to a value, the row will be made larger by that amount from the calculated autofit. Different from the "adjustment" parameter, this parameter adds a fixed size to the column and not a percentage. The final size of the column will be: FinalSize = CalulatedAutoFit * adjustment + adjusmentFixed
 | minWidth | Int32 | Minimum final width for the column to autofit. If the calculated value is less than minWidth, column size will be set to minWidth. A negative value on minWidth means the column size will be no smaller than the original width.
 | maxWidth | Int32 | Maximum final width for the column to autofit. If the calculated value is more than maxWidth, column size will be set to maxWidth. maxWidth = 0 means no maxWidth. A negative value on maxWidth means the column size will be no bigger than the original width.
 | isMerged | Boolean | If true, only the cell will be autofitted, not the whole column.

See also

  • ExcelFile


ExcelFile.IsRowMarkedForAutofit Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.IsRowMarkedForAutofit Method

Returns true is a row is marked for autofit.

Syntax

Namespace: FlexCel.Core

public abstract Boolean IsRowMarkedForAutofit(Int32 row)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row number(1 based)

See also

  • ExcelFile


ExcelFile.IsColMarkedForAutofit Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.IsColMarkedForAutofit Method

Returns true is a column is marked for autofit.

Syntax

Namespace: FlexCel.Core

public abstract Boolean IsColMarkedForAutofit(Int32 col)

Parameters

<-> | Parameter | Type | Description
 | col | Int32 | Column number(1 based)

See also

  • ExcelFile


ExcelFile.AutofitMarkedRowsAndCols Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.AutofitMarkedRowsAndCols Method

Overloads

  • ExcelFile.AutofitMarkedRowsAndCols(Boolean, Boolean, Double)
  • ExcelFile.AutofitMarkedRowsAndCols(Boolean, Boolean, Double, Int32, Int32, Int32, Int32, Int32)
  • ExcelFile.AutofitMarkedRowsAndCols(Boolean, Boolean, Double, Int32, Int32, Int32, Int32, Int32, TAutofitMerged)

ExcelFile.AutofitMarkedRowsAndCols(Boolean, Boolean, Double)

Autofits all the rows and columns on a sheet that have been previously marked with the MarkRowForAutofit(Int32, Boolean, Double) and MarkColForAutofit(Int32, Boolean, Double) methods.

Syntax

Namespace: FlexCel.Core

public void AutofitMarkedRowsAndCols(Boolean keepSizesAutomatic, Boolean ignoreStringsOnColumnFit, Double adjustment)

Parameters

<-> | Parameter | Type | Description
 | keepSizesAutomatic | Boolean | When true, no modifications will be done to the "autofit" status of the rows. When false, all rows will be marked as "no autofit", so when you open this file in Excel it will not be resized by Excel, and the sizes when printing/export to PDF from Excel will be the same as FlexCel, even when some cells might appear "cut" when printing on Excel.
 | ignoreStringsOnColumnFit | Boolean | When true, cells containing strings will not be autofitted.
 | adjustment | Double | You will normally want to set this parameter to 1, which means that autofit will be made with standard measurements. If you set it to for example 1.1, then columns and rows will be adjusted to 110% percent of what their calculated width and height was. Use this parameter to fine-tune autofiting, if for example columns are too small when opening the file in Excel.

See also

  • ExcelFile

ExcelFile.AutofitMarkedRowsAndCols(Boolean, Boolean, Double, Int32, Int32, Int32, Int32, Int32)

Autofits all the rows and columns on a sheet that have been previously marked with the MarkRowForAutofit(Int32, Boolean, Double) and MarkColForAutofit(Int32, Boolean, Double) methods.

Syntax

Namespace: FlexCel.Core

public void AutofitMarkedRowsAndCols(Boolean keepSizesAutomatic, Boolean ignoreStringsOnColumnFit, Double adjustment, Int32 adjustmentFixed, Int32 minHeight, Int32 maxHeight, Int32 minWidth, Int32 maxWidth)

Parameters

<-> | Parameter | Type | Description
 | keepSizesAutomatic | Boolean | When true, no modifications will be done to the "autofit" status of the rows. When false, all rows will be marked as "no autofit", so when you open this file in Excel it will not be resized by Excel, and the sizes when printing/export to PDF from Excel will be the same as FlexCel, even when some cells might appear "cut" when printing on Excel.
 | ignoreStringsOnColumnFit | Boolean | When true, cells containing strings will not be autofitted.
 | adjustment | Double | You will normally want to set this parameter to 1, which means that autofit will be made with standard measurements. If you set it to for example 1.1, then columns and rows will be adjusted to 110% percent of what their calculated width and height was. Use this parameter to fine-tune autofiting, if for example columns are too small when opening the file in Excel.
 | adjustmentFixed | Int32 | You will normally set this parameter to 0, which means standard autofit. If you set it to a value, the row will be made larger by that amount from the calculated autofit. Different from the "adjustment" parameter, this parameter adds a fixed size to the row and not a percentage. The final size of the row will be: FinalSize = CalulatedAutoFit * adjustment + adjusmentFixed
 | minHeight | Int32 | Minimum final height for the row to autofit. If the calculated value is less than minHeight, row size will be set to minHeight. A negative value on minHeight means the row size will be no smaller than the original height.
 | maxHeight | Int32 | Maximum final height for the row to autofit. If the calculated value is more than maxHeight, row size will be set to maxHeight. maxHeight = 0 means no maxHeight. A negative value on maxHeight means the row size will be no bigger than the original height.
 | minWidth | Int32 | Minimum final width for the column to autofit. If the calculated value is less than minWidth, column size will be set to minWidth. A negative value on minWidth means the column size will be no smaller than the original width.
 | maxWidth | Int32 | Maximum final width for the column to autofit. If the calculated value is more than maxWidth, column size will be set to maxWidth. maxWidth = 0 means no maxWidth. A negative value on maxWidth means the column size will be no bigger than the original width.

See also

  • ExcelFile

ExcelFile.AutofitMarkedRowsAndCols(Boolean, Boolean, Double, Int32, Int32, Int32, Int32, Int32, TAutofitMerged)

Autofits all the rows and columns on a sheet that have been previously marked with the MarkRowForAutofit(Int32, Boolean, Double) and MarkColForAutofit(Int32, Boolean, Double) methods.

Syntax

Namespace: FlexCel.Core

public abstract void AutofitMarkedRowsAndCols(Boolean keepSizesAutomatic, Boolean ignoreStringsOnColumnFit, Double adjustment, Int32 adjustmentFixed, Int32 minHeight, Int32 maxHeight, Int32 minWidth, Int32 maxWidth, TAutofitMerged autofitMerged)

Parameters

<-> | Parameter | Type | Description
 | keepSizesAutomatic | Boolean | When true, no modifications will be done to the "autofit" status of the rows. When false, all rows will be marked as "no autofit", so when you open this file in Excel it will not be resized by Excel, and the sizes when printing/export to PDF from Excel will be the same as FlexCel, even when some cells might appear "cut" when printing on Excel.
 | ignoreStringsOnColumnFit | Boolean | When true, cells containing strings will not be autofitted.
 | adjustment | Double | You will normally want to set this parameter to 1, which means that autofit will be made with standard measurements. If you set it to for example 1.1, then columns and rows will be adjusted to 110% percent of what their calculated width and height was. Use this parameter to fine-tune autofiting, if for example columns are too small when opening the file in Excel.
 | adjustmentFixed | Int32 | You will normally set this parameter to 0, which means standard autofit. If you set it to a value, the row will be made larger by that amount from the calculated autofit. Different from the "adjustment" parameter, this parameter adds a fixed size to the row and not a percentage. The final size of the row will be: FinalSize = CalulatedAutoFit * adjustment + adjusmentFixed
 | minHeight | Int32 | Minimum final height for the row to autofit. If the calculated value is less than minHeight, row size will be set to minHeight. A negative value on minHeight means the row size will be no smaller than the original height.
 | maxHeight | Int32 | Maximum final height for the row to autofit. If the calculated value is more than maxHeight, row size will be set to maxHeight. maxHeight = 0 means no maxHeight. A negative value on maxHeight means the row size will be no bigger than the original height.
 | minWidth | Int32 | Minimum final width for the column to autofit. If the calculated value is less than minWidth, column size will be set to minWidth. A negative value on minWidth means the column size will be no smaller than the original width.
 | maxWidth | Int32 | Maximum final width for the column to autofit. If the calculated value is more than maxWidth, column size will be set to maxWidth. maxWidth = 0 means no maxWidth. A negative value on maxWidth means the column size will be no bigger than the original width.
 | autofitMerged | TAutofitMerged | Specifies which row in a merged cell using more than one row, or which column in a merged cell with more than one column will be used to autofit the merged cell. If you don't specify this parameter, it will be the last row or column in the merged range.

See also

  • ExcelFile


ExcelFile.AutofitComment Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.AutofitComment Method

Will return the resized anchor so the size of the comment is enough to fit all the text inside.

Syntax

Namespace: FlexCel.Core

public abstract TClientAnchor AutofitComment(TRichString text, Double aspectRatio, Boolean dontShrink, Double adjustment, Double adjustmentFixed, TClientAnchor Anchor)

Parameters

<-> | Parameter | Type | Description
 | text | TRichString | Text for the comment.
 | aspectRatio | Double | If you pass 0 as aspect ratio, FlexCel will only resize the height of the comment, keeping the same width as it already had. If you pass another number like 4.0/3.0 or 16.0/10.0, FlexCel will try to create a comment box with that approximate aspect ratio. Note that the ratio won't be the exact aspect ratio, just approximate.
 | dontShrink | Boolean | If true, the box will grow if the text needs more space, but it won't be made smaller if the text fits in a smaller height than the existing anchor.
 | adjustment | Double | The final height will be multiplied by this number. Because of small differences between how FlexCel and Excel render the text, it might happen that the size calculated by FlexCel is smaller than what it needs to be to display correctly in Excel. By setting this number bigger than 1, you can add a margin for those errors.
 | adjustmentFixed | Double | This number will be added to the final calculated height. Use it to add some margin around the comment box.
 | Anchor | TClientAnchor | Here you pass the original dimensions for the comment.

Returns

The new anchor so the size of the box fits the text.

Examples

This code will add a comment and resize the box so it fits:

    static void AddCommentAndResize(XlsFile xls, double aspectRatio, int row, int col, TRichString text)
    {
        TCommentProperties comProps = TCommentProperties.CreateStandard(row, col, xls); //Create a standard comment box.
        comProps.Anchor = xls.AutofitComment(text, aspectRatio, true, 1.1, 10, comProps.Anchor); //Resize it so it fits the text.
        xls.SetComment(row, col, text, "", comProps); //Add the comment.
    }

    public static void CreateFileWithComment()
    {
        XlsFile xls = new XlsFile(1, TExcelFileFormat.v2021, true);
        AddCommentAndResize(xls, 1.6, 3, 1, "This is a long comment so it won't fit in a standard comment box. " +
          " But by using AutoFitComment, we will resize the box to hold all the text, and have an 1.6 aspect ratio between width and height");
        xls.Save("test.xlsx");
    }

See also

  • ExcelFile


ExcelFile.ColCountInRow Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.ColCountInRow Method

Overloads

  • ExcelFile.ColCountInRow(Int32)
  • ExcelFile.ColCountInRow(Int32, Int32)

ExcelFile.ColCountInRow(Int32)

This method returns the NOT EMPTY cells on ONE ROW.

Note that this is not the full column count, but only the count of those columns that have any data on them for the given row. So for example if in row 2 you have a value in A2 and another in E2, ColCountInRow(2) will return 2 (cells A2 and E2), not 5 (columns from A to E).

You can use this together with ColFromIndex(Int32, Int32) and ColToIndex(Int32, Int32) to iterate faster on a block, skipping all empty cells.

Syntax

Namespace: FlexCel.Core

public abstract Int32 ColCountInRow(Int32 row)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row index. (1-based)

Returns

The number of existing columns on one row.

Examples

Instead of writing:

    int RowCount = xls.RowCount;
    int ColCount = xls.ColCount;
    for (int row = 1; row <= RowCount; row++)
    {
        for (int col = 1; col <= ColCount; col++) //It would be faster to use ColCountInRow. See https://doc.tmssoftware.com/flexcel/net/guides/performance-guide.html#avoid-calling-colcount
        {
            DoSomething(row, col);
        }
    }

You can use:

    int RowCount = xls.RowCount;
    for (int row = 1; row <= RowCount; row++)
    {
        int ColCountInRow = xls.ColCountInRow(row);
        for (int colIndex = 1; colIndex <= ColCountInRow; colIndex++)
        {
            DoSomething(row, xls.ColFromIndex(row, colIndex));
        }
    }

See also

  • ExcelFile
  • ColFromIndex(Int32, Int32)
  • ColToIndex(Int32, Int32)
  • LoopOverUsedRange

ExcelFile.ColCountInRow(Int32, Int32)

This method returns the NOT EMPTY cells on ONE ROW, for a given sheet.

Note that this is not the full column count, but only the count of those columns that have any data on them for the given row. So for example if in row 2 you have a value in A2 and another in E2, ColCountInRow(2) will return 2 (cells A2 and E2), not 5 (columns from A to E).

You can use this together with ColFromIndex(Int32, Int32) and ColToIndex(Int32, Int32) to iterate faster on a block, skipping all empty cells. Or you can call LoopOverUsedRange for a method that does the looping for you using those methods.

Syntax

Namespace: FlexCel.Core

public abstract Int32 ColCountInRow(Int32 sheet, Int32 row)

Parameters

<-> | Parameter | Type | Description
 | sheet | Int32 | Sheet where we are working. It might be different from ActiveSheet.
 | row | Int32 | Row index. (1-based)

Returns

The number of existing columns on one row.

Examples

Instead of writing:

    int RowCount = xls.RowCount;
    int ColCount = xls.ColCount;
    for (int row = 1; row <= RowCount; row++)
    {
        for (int col = 1; col <= ColCount; col++) //It would be faster to use ColCountInRow. See https://doc.tmssoftware.com/flexcel/net/guides/performance-guide.html#avoid-calling-colcount
        {
            DoSomething(row, col);
        }
    }

You can use:

    int RowCount = xls.RowCount;
    for (int row = 1; row <= RowCount; row++)
    {
        int ColCountInRow = xls.ColCountInRow(row);
        for (int colIndex = 1; colIndex <= ColCountInRow; colIndex++)
        {
            DoSomething(row, xls.ColFromIndex(row, colIndex));
        }
    }

See also

  • ExcelFile
  • ColFromIndex(Int32, Int32)
  • ColToIndex(Int32, Int32)
  • LoopOverUsedRange


ExcelFile.ColFromIndex Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.ColFromIndex Method

Overloads

  • ExcelFile.ColFromIndex(Int32, Int32)
  • ExcelFile.ColFromIndex(Int32, Int32, Int32)

ExcelFile.ColFromIndex(Int32, Int32)

This is the column (1 based) for a given ColIndex. You can use this together with ColCountInRow(Int32) and ColToIndex(Int32, Int32) to iterate faster on a block. Or you can call LoopOverUsedRange for a method that does the looping for you using those methods.

Syntax

Namespace: FlexCel.Core

public abstract Int32 ColFromIndex(Int32 row, Int32 colIndex)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row (1 based)
 | colIndex | Int32 | The index on the column list for the row. (1 based)

Returns

The column (1 based) corresponding to the index when the index is inside the bounds. If the index is <= 0 or the index is > ColCountInRow(Int32), it will return 0.

Examples

Instead of writing:

    int RowCount = xls.RowCount;
    int ColCount = xls.ColCount;
    for (int row = 1; row <= RowCount; row++)
    {
        for (int col = 1; col <= ColCount; col++) //It would be faster to use ColCountInRow. See https://doc.tmssoftware.com/flexcel/net/guides/performance-guide.html#avoid-calling-colcount
        {
            DoSomething(row, col);
        }
    }

You can use:

    int RowCount = xls.RowCount;
    for (int row = 1; row <= RowCount; row++)
    {
        int ColCountInRow = xls.ColCountInRow(row);
        for (int colIndex = 1; colIndex <= ColCountInRow; colIndex++)
        {
            DoSomething(row, xls.ColFromIndex(row, colIndex));
        }
    }

To loop on all the existing cells on a range you can use:

    // Loop at most until the last used row in the sheet.
    // If LastRow is for example 1.000.000, but there are only
    // 3 used rows, it makes no sense to loop over all the empty rows after row 3.
    int LastUsedRow = Math.Min(LastRow, xls.RowCount);

    for (int row = FirstRow; row <= LastUsedRow; row++)
    {
        int LastCIndex = xls.ColToIndex(row, LastColumn);
        int LastColFromIndex = xls.ColFromIndex(row, LastCIndex);
        if (LastColFromIndex > LastColumn || LastColFromIndex == 0) // LastColumn does not exist.
        {
            LastCIndex--;
        }
        if (LastCIndex == 0) continue; // This row is empty. Move to the next row.

        int XF = -1;
        for (int cIndex = xls.ColToIndex(row, FirstColumn); cIndex <= LastCIndex; cIndex++)
        {
            DoSomething(row, xls.ColFromIndex(row, cIndex), xls.GetCellValueIndexed(row, cIndex, ref XF));
        }
    }

Note that this example is the implementation of LoopOverUsedRange, so you might want to directly call LoopOverUsedRange instead of pasting this example in your code.

See also

  • ExcelFile
  • ColCountInRow(Int32)
  • ColToIndex(Int32, Int32)
  • LoopOverUsedRange

ExcelFile.ColFromIndex(Int32, Int32, Int32)

This is the column (1 based) for a given ColIndex and sheet. You can use this together with ColCountInRow(Int32) and ColToIndex(Int32, Int32) to iterate faster on a block. Or you can call LoopOverUsedRange for a method that does the looping for you using those methods.

Syntax

Namespace: FlexCel.Core

public abstract Int32 ColFromIndex(Int32 sheet, Int32 row, Int32 colIndex)

Parameters

<-> | Parameter | Type | Description
 | sheet | Int32 | Sheet where we are working. It might be different from ActiveSheet.
 | row | Int32 | Row (1 based)
 | colIndex | Int32 | The index on the column list for the row. (1 based)

Returns

The column (1 based) corresponding to the index when the index is inside the bounds. If the index is <= 0 or the index is > ColCountInRow(Int32), it will return 0.

Examples

Instead of writing:

    int RowCount = xls.RowCount;
    int ColCount = xls.ColCount;
    for (int row = 1; row <= RowCount; row++)
    {
        for (int col = 1; col <= ColCount; col++) //It would be faster to use ColCountInRow. See https://doc.tmssoftware.com/flexcel/net/guides/performance-guide.html#avoid-calling-colcount
        {
            DoSomething(row, col);
        }
    }

You can use:

    int RowCount = xls.RowCount;
    for (int row = 1; row <= RowCount; row++)
    {
        int ColCountInRow = xls.ColCountInRow(row);
        for (int colIndex = 1; colIndex <= ColCountInRow; colIndex++)
        {
            DoSomething(row, xls.ColFromIndex(row, colIndex));
        }
    }

To loop on all the existing cells on a range you can use:

    // Loop at most until the last used row in the sheet.
    // If LastRow is for example 1.000.000, but there are only
    // 3 used rows, it makes no sense to loop over all the empty rows after row 3.
    int LastUsedRow = Math.Min(LastRow, xls.RowCount);

    for (int row = FirstRow; row <= LastUsedRow; row++)
    {
        int LastCIndex = xls.ColToIndex(row, LastColumn);
        int LastColFromIndex = xls.ColFromIndex(row, LastCIndex);
        if (LastColFromIndex > LastColumn || LastColFromIndex == 0) // LastColumn does not exist.
        {
            LastCIndex--;
        }
        if (LastCIndex == 0) continue; // This row is empty. Move to the next row.

        int XF = -1;
        for (int cIndex = xls.ColToIndex(row, FirstColumn); cIndex <= LastCIndex; cIndex++)
        {
            DoSomething(row, xls.ColFromIndex(row, cIndex), xls.GetCellValueIndexed(row, cIndex, ref XF));
        }
    }

Note that this example is the implementation of LoopOverUsedRange, so you might want to directly call LoopOverUsedRange instead of pasting this example in your code.

See also

  • ExcelFile
  • ColCountInRow(Int32)
  • ColToIndex(Int32, Int32)
  • LoopOverUsedRange


ExcelFile.ColToIndex Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.ColToIndex Method

Overloads

  • ExcelFile.ColToIndex(Int32, Int32)
  • ExcelFile.ColToIndex(Int32, Int32, Int32)

ExcelFile.ColToIndex(Int32, Int32)

This is the inverse of ColFromIndex(Int32, Int32). It will return the index on the internal column array from the row for an existing column. If the column doesn't exist, it will return the index of the "LAST existing column less than col", plus 1. You can use this together with ColCountInRow(Int32) and ColFromIndex(Int32, Int32) to iterate faster on a block. Or you can call LoopOverUsedRange for a method that does the looping for you using those methods.

Syntax

Namespace: FlexCel.Core

public abstract Int32 ColToIndex(Int32 row, Int32 col)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row (1 based)
 | col | Int32 | Column (1 based)

Returns

The index on the column list for the row. (1 based)

Examples

To loop on all the existing cells range you can use:

    // Loop at most until the last used row in the sheet.
    // If LastRow is for example 1.000.000, but there are only
    // 3 used rows, it makes no sense to loop over all the empty rows after row 3.
    int LastUsedRow = Math.Min(LastRow, xls.RowCount);

    for (int row = FirstRow; row <= LastUsedRow; row++)
    {
        int LastCIndex = xls.ColToIndex(row, LastColumn);
        int LastColFromIndex = xls.ColFromIndex(row, LastCIndex);
        if (LastColFromIndex > LastColumn || LastColFromIndex == 0) // LastColumn does not exist.
        {
            LastCIndex--;
        }
        if (LastCIndex == 0) continue; // This row is empty. Move to the next row.

        int XF = -1;
        for (int cIndex = xls.ColToIndex(row, FirstColumn); cIndex <= LastCIndex; cIndex++)
        {
            DoSomething(row, xls.ColFromIndex(row, cIndex), xls.GetCellValueIndexed(row, cIndex, ref XF));
        }
    }

Note that this example is the implementation of LoopOverUsedRange, so you might want to directly call LoopOverUsedRange instead of pasting this example in your code.

See also

  • ExcelFile
  • ColCountInRow(Int32)
  • ColFromIndex(Int32, Int32)
  • LoopOverUsedRange

ExcelFile.ColToIndex(Int32, Int32, Int32)

This is the inverse of ColFromIndex(Int32, Int32). It will return the index on the internal column array from the row for an existing column. If the column doesn't exist, it will return the index of the "LAST existing column less than col", plus 1. You can use this together with ColCountInRow(Int32) and ColFromIndex(Int32, Int32) to iterate faster on a block. Or you can call LoopOverUsedRange for a method that does the looping for you using those methods.

Syntax

Namespace: FlexCel.Core

public abstract Int32 ColToIndex(Int32 sheet, Int32 row, Int32 col)

Parameters

<-> | Parameter | Type | Description
 | sheet | Int32 | Sheet where we are working. It might be different from ActiveSheet.
 | row | Int32 | Row (1 based)
 | col | Int32 | Column (1 based)

Returns

The index on the column list for the row. (1 based)

Examples

To loop on all the existing cells on a range you can use:

    // Loop at most until the last used row in the sheet.
    // If LastRow is for example 1.000.000, but there are only
    // 3 used rows, it makes no sense to loop over all the empty rows after row 3.
    int LastUsedRow = Math.Min(LastRow, xls.RowCount);

    for (int row = FirstRow; row <= LastUsedRow; row++)
    {
        int LastCIndex = xls.ColToIndex(row, LastColumn);
        int LastColFromIndex = xls.ColFromIndex(row, LastCIndex);
        if (LastColFromIndex > LastColumn || LastColFromIndex == 0) // LastColumn does not exist.
        {
            LastCIndex--;
        }
        if (LastCIndex == 0) continue; // This row is empty. Move to the next row.

        int XF = -1;
        for (int cIndex = xls.ColToIndex(row, FirstColumn); cIndex <= LastCIndex; cIndex++)
        {
            DoSomething(row, xls.ColFromIndex(row, cIndex), xls.GetCellValueIndexed(row, cIndex, ref XF));
        }
    }

Note that this example is the implementation of LoopOverUsedRange, so you might want to directly call LoopOverUsedRange instead of pasting this example in your code.

See also

  • ExcelFile
  • ColCountInRow(Int32)
  • ColFromIndex(Int32, Int32)
  • LoopOverUsedRange


ExcelFile.LoopOverUsedRange Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.LoopOverUsedRange Method

This method loops over a range of cells, and calls an action for every cell that has data.

Syntax

Namespace: FlexCel.Core

public void LoopOverUsedRange(TXlsCellRange aRange, Action<TLoopOverUsedRangeParameters> reader)

Parameters

<-> | Parameter | Type | Description
 | aRange | TXlsCellRange | Range where we want to extract the cell values.
 | reader | Action<TLoopOverUsed​Range​Parameters> | Anonymous method that will be called once for each cell with a value inside the range.

Examples

To fill an array with all the cells in a range, you could use:

    object[,] GetRangeAsArray(ExcelFile xls, TXlsCellRange range)
    {
        object[,] Result = new object[range.RowCount, range.ColCount];
        xls.LoopOverUsedRange(range, (x) =>
        {
            Result[x.Row - range.Top, x.Col - range.Left] = x.Value;
        });
        return Result;
    }

See also

  • ExcelFile
  • ColCountInRow(Int32)
  • ColFromIndex(Int32, Int32)
  • ColToIndex(Int32, Int32)


ExcelFile.CopyColFormats Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.CopyColFormats Method

Copies the column definitions, that is formats, widths, hidden/visible, etc from one workbook or sheet to another.

Syntax

Namespace: FlexCel.Core

public abstract void CopyColFormats(ExcelFile sourceWorkbook, Int32 sourceSheet, Int32 sourceCol, Int32 destCol, Int32 colCount)

Parameters

<-> | Parameter | Type | Description
 | sourceWorkbook | ExcelFile | The workbook from where the column formats will be copied. If you set this to null, the column formats will be copied from the same file.
 | sourceSheet | Int32 | Sheet in the source workbook from where we will copy the column formats.
 | sourceCol | Int32 | First column format to copy
 | destCol | Int32 | First column where the format will be copied.
 | colCount | Int32 | Number of columns to copy.

See also

  • ExcelFile


ExcelFile.GetColumnBlocks Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.GetColumnBlocks Method

This method returns a list of blocks of column information, grouped by columns that have the same properties. Since an xlsx file can have 16384 columns, querying every one of them might be slow. With this method, if columns from 5 to 16384 are hidden, you will get a single block with firstCol = 5 and lastCol = 16384 that is hidden. If you used GetColHidden instead you would have to call it 16384 times to get the same information.

Syntax

Namespace: FlexCel.Core

public abstract TColumnBlock[] GetColumnBlocks(Int32 sourceSheet, Int32 firstCol, Int32 lastCol)

Parameters

<-> | Parameter | Type | Description
 | sourceSheet | Int32 | Sheet where we want to read the columns. Pass ActiveSheet if you want to read the current sheet.
 | firstCol | Int32 | First column of the range where we want to get information. The first block returned might have a firstCol smaller than this value, if the block actually starts before in the file.
 | lastCol | Int32 | Last column of the range where we want to get information. The last block returned might have a lastCol bigger than this value, if the block in the file continues after this column.

Returns

A list of blocks of columns that include all the columns between firstCol and lastCol. The blocks might include more columns outside the range too, and null columns inside the range will not be returned. All blocks are sorted in ascending order.

See also

  • ExcelFile


ExcelFile.SetColorPalette Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.SetColorPalette Method

Changes a color on the Excel color palette.

Syntax

Namespace: FlexCel.Core

public abstract void SetColorPalette(Int32 index, TUIColor value)

Parameters

<-> | Parameter | Type | Description
 | index | Int32 | Index of the entry to change. Must be 1<=indexlt;=ColorPaletteCount
 | value | TUIColor | Color to set.

See also

  • ExcelFile


ExcelFile.GetColorPalette Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.GetColorPalette Method

Overloads

  • ExcelFile.GetColorPalette(Int32)
  • ExcelFile.GetColorPalette(Int32, TUIColor)

ExcelFile.GetColorPalette(Int32)

Returns a color from the color palette. This method will throw an exception if its "index" parameter is bigger than ColorPaletteCount, (for example, for an automatic color). To get the real color, use GetColorPalette(Int32, TUIColor)

Syntax

Namespace: FlexCel.Core

public abstract TUIColor GetColorPalette(Int32 index)

Parameters

<-> | Parameter | Type | Description
 | index | Int32 | Index of the entry to return. Must be 1<=index<=ColorPaletteCount

Returns

Color at position index.

See also

  • ExcelFile

ExcelFile.GetColorPalette(Int32, TUIColor)

Returns a color from the color palette. If the index is not into the range 1<=index<=ColorPaletteCount this method will return the automaticColor.

Remarks

ColorIndexes returned by FlexCel might be <=0 or >ColorPaletteCount if the color is set to Automatic.

Automatic color is white for backgrounds, black for foregrounds and gray for gridlines.

Syntax

Namespace: FlexCel.Core

public TUIColor GetColorPalette(Int32 index, TUIColor automaticColor)

Parameters

<-> | Parameter | Type | Description
 | index | Int32 |
 | automaticColor | TUIColor |

See also

  • ExcelFile


ExcelFile.NearestColorIndex Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.NearestColorIndex Method

Overloads

  • ExcelFile.NearestColorIndex(TUIColor)
  • ExcelFile.NearestColorIndex(TUIColor, Boolean[])

ExcelFile.NearestColorIndex(TUIColor)

Returns the most similar entry on the excel palette for a given color.

Syntax

Namespace: FlexCel.Core

public abstract Int32 NearestColorIndex(TUIColor value)

Parameters

<-> | Parameter | Type | Description
 | value | TUIColor | Color we want to use.

Returns

Most similar color on the Excel palette.

See also

  • ExcelFile

ExcelFile.NearestColorIndex(TUIColor, Boolean[])

IMPORTANT: Since FlexCel 5.1, using OptimizeColorPalette before saving should normally be used instead of this method to get an optimized palette. Just enter the true colors in FlexCel, and call OptimizeColorPalette before saving.

Returns the most similar entry on the excel palette for a given color. If UsedColors is not null, it will try to modify the Excel color palette to get a better match on the color, modifying among the not used colors. Note that modifying the standard palette might result on a file that is not easy to edit on Excel later, since it does not have the standard Excel colors.

Syntax

Namespace: FlexCel.Core

public abstract Int32 NearestColorIndex(TUIColor value, Boolean[] UsedColors)

Parameters

<-> | Parameter | Type | Description
 | value | TUIColor | Color we want to use.
 | UsedColors | Boolean[] | If null, this behaves like the standard NearestColorIndex. To get a list of used colors for the first call, use GetUsedPaletteColors. After the first call, keep using the same UsedColors structure and do not call GetUsedPaletteColors again, to avoid overwriting colors that are not yet inserted into the xls file with new ones. You can call GetUsedPaletteColors only after you added the format with AddFormat

Returns

Most similar color on the Excel palette.

See also

  • ExcelFile


ExcelFile.PaletteContainsColor Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.PaletteContainsColor Method

Returns true if the internal color palette contains the exact specified color. Note that Excel 2007 doesn't use the color palette, so this method is not needed there.

Syntax

Namespace: FlexCel.Core

public abstract Boolean PaletteContainsColor(TExcelColor value)

Parameters

<-> | Parameter | Type | Description
 | value | TExcelColor | Color to check.

Returns

True if color is defined.

See also

  • ExcelFile


ExcelFile.OptimizeColorPalette Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.OptimizeColorPalette Method

Changes the colors in the color palette so they can represent better the colors in use. This method will change the colors not used in the palette by colors used in the sheet. If there are more unique colors in the sheet than the 56 available in the palette, only the first colors will be changed.

When FlexCel saves an xls file, it saves the color information twice: The real color for Excel 2007 and newer, and the indexed color for older Excel versions. This method optimizes the palette of indexed colors so they look better in Excel 2003 or older. It doesn't effect Excel 2007 or newer at all.

Syntax

Namespace: FlexCel.Core

public abstract void OptimizeColorPalette()

See also

  • ExcelFile


ExcelFile.GetColorPaletteVersion Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.GetColorPaletteVersion Method

Internal use. Every time the palette changes, the number returned is incremented.

Syntax

Namespace: FlexCel.Core

public abstract Int32 GetColorPaletteVersion()

See also

  • ExcelFile


ExcelFile.SetColorTheme Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.SetColorTheme Method

Overloads

  • ExcelFile.SetColorTheme(TThemeColor, TDrawingColor)
  • ExcelFile.SetColorTheme(TPrimaryThemeColor, TDrawingColor)

ExcelFile.SetColorTheme(TThemeColor, TDrawingColor)

Changes a color on the Excel theme. Only has effect in Excel 2007.

This method is provided to not break compatibility with older FlexCel versions. In newer code, you should use SetColorTheme(TPrimaryThemeColor, TDrawingColor) instead. If you want to change the full theme, use GetTheme and SetTheme

Syntax

Namespace: FlexCel.Core

public abstract void SetColorTheme(TThemeColor themeColor, TDrawingColor value)

Parameters

<-> | Parameter | Type | Description
 | themeColor | TThemeColor | Color of the theme to change. The only values that make sense are those included in TPrimaryThemeColor. Colors outside that range will be mapped to the nearest color: For example Background1 will be mapped to Light1 and ForeGround1 will be mapped to Dark1.
 | value | TDrawingColor | Color to set.

See also

  • ExcelFile

ExcelFile.SetColorTheme(TPrimaryThemeColor, TDrawingColor)

Changes a color on the Excel theme. Only has effect in Excel 2007.

If you want to change the full theme, use GetTheme and SetTheme

Syntax

Namespace: FlexCel.Core

public abstract void SetColorTheme(TPrimaryThemeColor themeColor, TDrawingColor value)

Parameters

<-> | Parameter | Type | Description
 | themeColor | TPrimaryThemeColor | Color of the theme to change.
 | value | TDrawingColor | Color to set.

See also

  • ExcelFile


ExcelFile.GetColorTheme Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.GetColorTheme Method

Overloads

  • ExcelFile.GetColorTheme(TThemeColor)
  • ExcelFile.GetColorTheme(TPrimaryThemeColor)

ExcelFile.GetColorTheme(TThemeColor)

Returns a color from the active theme palette, including semantic colors. Only has effect in Excel 2007.

To get the full theme, look at GetTheme

Syntax

Namespace: FlexCel.Core

public abstract TDrawingColor GetColorTheme(TThemeColor themeColor)

Parameters

<-> | Parameter | Type | Description
 | themeColor | TThemeColor | Color of the theme to get.

Returns

Color for the given theme.

See also

  • ExcelFile

ExcelFile.GetColorTheme(TPrimaryThemeColor)

Returns a color from the active theme palette, without including semantic colors. Only has effect in Excel 2007.

To get the full theme, look at GetTheme

Syntax

Namespace: FlexCel.Core

public abstract TDrawingColor GetColorTheme(TPrimaryThemeColor themeColor)

Parameters

<-> | Parameter | Type | Description
 | themeColor | TPrimaryThemeColor | Color of the theme to get.

Returns

Color for the given theme.

See also

  • ExcelFile


ExcelFile.NearestColorTheme Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.NearestColorTheme Method

Returns the most similar entry on the theme palette for a given color.

Syntax

Namespace: FlexCel.Core

public abstract TThemeColor NearestColorTheme(TUIColor value, out Double tint)

Parameters

<-> | Parameter | Type | Description
 | value | TUIColor | Color we want to use.
out | tint | Double | Returns the tint to apply to the theme color.

Returns

Most similar color on the theme palette.

See also

  • ExcelFile


ExcelFile.GetThemeFont Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.GetThemeFont Method

Gets the major of minor font scheme in the theme.

Syntax

Namespace: FlexCel.Core

public abstract TThemeFont GetThemeFont(TFontScheme fontScheme)

Parameters

<-> | Parameter | Type | Description
 | fontScheme | TFontScheme | Font Scheme we want to get (either minor or major). Using "none" here will return null.

Returns

Font definition.

See also

  • ExcelFile


ExcelFile.SetThemeFont Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.SetThemeFont Method

Sets either the minor or the major font for the theme.

Syntax

Namespace: FlexCel.Core

public abstract void SetThemeFont(TFontScheme fontScheme, TThemeFont font)

Parameters

<-> | Parameter | Type | Description
 | fontScheme | TFontScheme | Font Scheme we want to set (either minor or major). Using "none" here will do nothing.
 | font | TThemeFont | Font definition.

See also

  • ExcelFile


ExcelFile.GetTheme Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.GetTheme Method

This is an advanced method, that allows you to get the full theme in use. Normally you will just want to replace colors, and you can do this with SetColorTheme(TPrimaryThemeColor, TDrawingColor) and GetColorTheme(TPrimaryThemeColor) methods. Much of the functionality in a theme applies to PowerPoint, not Excel.

Syntax

Namespace: FlexCel.Core

public abstract TTheme GetTheme()

See also

  • ExcelFile


ExcelFile.GetThemeNoClone Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.GetThemeNoClone Method

Internal use. This won't clone the internal structure for more performance.

Syntax

Namespace: FlexCel.Core

public abstract TTheme GetThemeNoClone()

See also

  • ExcelFile


ExcelFile.SetTheme Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.SetTheme Method

This is an advanced method, that allows you to set the full theme in use. Normally you will just want to replace colors, and you can do this with SetColorTheme(TPrimaryThemeColor, TDrawingColor) and GetColorTheme(TPrimaryThemeColor) methods.

Syntax

Namespace: FlexCel.Core

public abstract void SetTheme(TTheme aTheme)

Parameters

<-> | Parameter | Type | Description
 | aTheme | TTheme | Theme to set. You would normally use the result from GetTheme here, or you might load a method from a ".tmx" file. There are many standard tmx files available in an Office installation under the "Document Themes Version" folder

See also

  • ExcelFile


ExcelFile.GetNamedRange Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.GetNamedRange Method

Overloads

  • ExcelFile.GetNamedRange(Int32)
  • ExcelFile.GetNamedRange(String, Int32)
  • ExcelFile.GetNamedRange(String, Int32, Int32)

ExcelFile.GetNamedRange(Int32)

Returns the Named Range Definition. If the range is not user defined (like "Print_Area") it will have a one-char name, and the value is on the enum InternalNameRange

Syntax

Namespace: FlexCel.Core

public abstract TXlsNamedRange GetNamedRange(Int32 index)

Parameters

<-> | Parameter | Type | Description
 | index | Int32 | Index of the named range.

Returns

Named Range

See also

  • ExcelFile
  • InternalNameRange

ExcelFile.GetNamedRange(String, Int32)

Returns the Named Range Definition. If the range is not user defined (like "Print_Area") it will have a one-char name, and the value is on the enum InternalNameRange

Syntax

Namespace: FlexCel.Core

public abstract TXlsNamedRange GetNamedRange(String Name, Int32 refersToSheetIndex)

Parameters

<-> | Parameter | Type | Description
 | Name | String | Name of the range we are looking for. Case insensitive.
 | refersToSheetIndex | Int32 | Sheet where the range refers to. A range with the same name might be defined on more than one sheet. To get the first range with the name, make refersToSheetIndex<=0 Note that a name can be stored in one sheet and refer to a different sheet. Or it might not refer to any sheet at all. (for example, the name "=name1+1" doesn't refer to any sheet.) And you could have a name "=Sheet1!a1" defined in sheet2. This name will "refer to" sheet1, but be defined in sheet2. While names are normally all defined globally (sheet 0), if you need to get the names that are stored in a specific sheet, use GetNamedRange(String, Int32, Int32) instead.

Returns

Named Range or null if the range does not exist.

See also

  • ExcelFile
  • InternalNameRange

ExcelFile.GetNamedRange(String, Int32, Int32)

Returns the Named Range Definition. If the range is not user defined (like "Print_Area") it will have a one-char name, and the value is on the enum InternalNameRange

Syntax

Namespace: FlexCel.Core

public abstract TXlsNamedRange GetNamedRange(String Name, Int32 refersToSheetIndex, Int32 localSheetIndex)

Parameters

<-> | Parameter | Type | Description
 | Name | String | Name of the range we are looking for. Case insensitive.
 | refersToSheetIndex | Int32 | Sheet where the range refers to. Note that this is not where the name is stored. Normally names are all stored globally (in sheet 0), but they refer to a specific sheet. For example, if you define the name "=Sheet2!a1" globally, it will be stored in sheet 0, but will refer to sheet2. A name like "=Sheet1:Sheet2!A1 doesn't refer to any sheet.
 | localSheetIndex | Int32 | Sheet where the range is stored. A range might be stored local to a sheet, or global (Excel default). To get a global range, make localSheetIndex = 0

Returns

Named Range or null if the range does not exist.

See also

  • ExcelFile
  • InternalNameRange


ExcelFile.FindNamedRange Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.FindNamedRange Method

Returns the index (1 based) on the list of named ranges for a given name and local sheet. If the range is not found, this method will return -1 You could use GetNamedRange(Int32) to get the name definition, or directly call GetNamedRange(String, Int32, Int32) to get a named range knowing its name and sheet position.

Syntax

Namespace: FlexCel.Core

public abstract Int32 FindNamedRange(String Name, Int32 localSheetIndex)

Parameters

<-> | Parameter | Type | Description
 | Name | String | Name of the range we are looking for. Case insensitive.
 | localSheetIndex | Int32 | Sheet where the range is stored. A range might be stored local to a sheet, or global (Excel default). To get a global range, make localSheetIndex=0

Returns

The index (1 based) in the list of named ranges, or -1 if the range is not found.

See also

  • ExcelFile


ExcelFile.SetNamedRange Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.SetNamedRange Method

Overloads

  • ExcelFile.SetNamedRange(TXlsNamedRange)
  • ExcelFile.SetNamedRange(Int32, TXlsNamedRange)

ExcelFile.SetNamedRange(TXlsNamedRange)

Modifies or adds a Named Range. If the named range exists, it will be modified, else it will be added. If the range is not user defined (like "Print_Area") it will have a one-char name, and the value is on the enum InternalNameRange Look at the example for more information.

Syntax

Namespace: FlexCel.Core

public abstract Int32 SetNamedRange(TXlsNamedRange rangeData)

Parameters

<-> | Parameter | Type | Description
 | rangeData | TXlsNamedRange | Data of the named range. You don't need to specify the RPN Array.

Returns

The name index of the inserted or modified range (1 based).

Examples

This will create a range for repeating the first 2 columns and rows on each printed page (on sheet 1):

    xls.SetNamedRange(new TXlsNamedRange(TXlsNamedRange.GetInternalName(InternalNameRange.Print_Titles), SheetIndex, 0, "=1:2,A:B"));

Note that in this example in particular (Print_Titles), the range has to have full rows/columns, as this is what Excel expects. You should also use "A:B" notation instead of the full "A1:B65536" name, so it will work in Excel 2007 too.

See also

  • ExcelFile

ExcelFile.SetNamedRange(Int32, TXlsNamedRange)

Modifies a Named Range in the specified position. You could normally use SetNamedRange(TXlsNamedRange) to do this, but if you want to modify the name of the named range, then you need to use this overloaded version. SetNamedRange(TXlsNamedRange) would add a new range instead of modifying the existing one if you change the name. Look at the example for more information on how to use it.

Syntax

Namespace: FlexCel.Core

public abstract void SetNamedRange(Int32 index, TXlsNamedRange rangeData)

Parameters

<-> | Parameter | Type | Description
 | index | Int32 | Index of the named range we are trying to modify.
 | rangeData | TXlsNamedRange | Data of the named range. You don't need to specify the RPN Array.

Examples

This will modify the name of the named range "MyName":

    int nameIndex = xls.FindNamedRange("MyName", -1);  //Find the name index from the name.
    TXlsNamedRange range = xls.GetNamedRange(nameIndex); //Load the name definition for the name index.
    range.Name = "MyNewName";  //Modify the name definition.
    xls.SetNamedRange(nameIndex, range);  //Set the new name definition into the file.

See also

  • ExcelFile


ExcelFile.DeleteNamedRange Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.DeleteNamedRange Method

Deletes the name at the specified position. Important: If the name you are trying to delete is referenced by any formula/chart/whatever in your file, the name will not actually be deleted but hidden.

You won't see the name in Excel or in the formula, but it will be there and you can see it from FlexCel. You can use GetUsedNamedRanges to learn if a range might be deleted.

Also, note that if you later delete the formulas that reference those ranges FlexCel will remove those hanging ranges when saving. The only hidden ranges that will be present in the final file will be those that have active formulas referencing them.

Important:If the name wasn't deleted, NamedRangeCount will not change. This means that you can't have code like this:

    while (xls.NamedRangeCount > 0) //WRONG! This loop might never end.
    {
        xls.DeleteNamedRange(1);  //Might not be deleted, and NamedRangeCount will never be 0.
    }

The correct code in this case would be:

    for (int i = xls.NamedRangeCount; i > 0; i--) xls.DeleteNamedRange(i);

Syntax

Namespace: FlexCel.Core

public abstract void DeleteNamedRange(Int32 index)

Parameters

<-> | Parameter | Type | Description
 | index | Int32 | Index of the name to delete (1 based).

See also

  • ExcelFile


ExcelFile.GetUsedNamedRanges Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.GetUsedNamedRanges Method

Returns an array of booleans where each value indicates if the name at position "i-1" is used by any formula, chart, or object in the file. If the name is in use, it can't be deleted. Note that the index here is Zero-based, different from all other Name indexes in FlexCel, because arrays in C# are always 0-based. So UsedRange[0] corresponds to GetNamedRange(1) and so on.

Syntax

Namespace: FlexCel.Core

public abstract Boolean[] GetUsedNamedRanges()

See also

  • ExcelFile


ExcelFile.CopyToClipboard Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.CopyToClipboard Method

Overloads

  • ExcelFile.CopyToClipboard(StringBuilder, Stream)
  • ExcelFile.CopyToClipboard(FlexCelClipboardFormat, Stream)

ExcelFile.CopyToClipboard(StringBuilder, Stream)

Copies the active sheet to a clipboard stream, on native and text formats.

Remarks

See the copy and paste demo.

Syntax

Namespace: FlexCel.Core

public void CopyToClipboard(StringBuilder textString, Stream xlsStream)

Parameters

<-> | Parameter | Type | Description
 | textString | StringBuilder | StringBuilder where the text will be copied. Leave it null to not copy to text.
 | xlsStream | Stream | Stream where the xls native info will be copied. Make it null to not copy to xls native.

See also

  • ExcelFile

ExcelFile.CopyToClipboard(FlexCelClipboardFormat, Stream)

Copies the active sheet to a clipboard stream, on the format you specify.

Remarks

See the copy and paste demo.

Syntax

Namespace: FlexCel.Core

public void CopyToClipboard(FlexCelClipboardFormat clipboardFormat, Stream outStream)

Parameters

<-> | Parameter | Type | Description
 | clipboardFormat | FlexCelClipboard​Format | Format you want to copy into outStream.
 | outStream | Stream | Stream were the information will be copied. If null nothing will be done.

See also

  • ExcelFile


ExcelFile.CopyToClipboardFormat Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.CopyToClipboardFormat Method

Overloads

  • ExcelFile.CopyToClipboardFormat(TXlsCellRange, StringBuilder, Stream)
  • ExcelFile.CopyToClipboardFormat(FlexCelClipboardFormat, TXlsCellRange, Stream)

ExcelFile.CopyToClipboardFormat(TXlsCellRange, StringBuilder, Stream)

Copies a range on the active sheet to a clipboard stream, on native and text formats.

Remarks

See the copy and paste demo.

Syntax

Namespace: FlexCel.Core

public void CopyToClipboardFormat(TXlsCellRange range, StringBuilder textString, Stream xlsStream)

Parameters

<-> | Parameter | Type | Description
 | range | TXlsCellRange | Range with the cells to copy.
 | textString | StringBuilder | StringBuilder where the text will be copied. Leave it null to not copy to text.
 | xlsStream | Stream | Stream where the xls native info will be copied. If null no native data will be copied.

See also

  • ExcelFile

ExcelFile.CopyToClipboardFormat(FlexCelClipboardFormat, TXlsCellRange, Stream)

Copies a range on the active sheet to a clipboard stream, on the specified format.

Remarks

See the copy and paste demo.

Syntax

Namespace: FlexCel.Core

public abstract void CopyToClipboardFormat(FlexCelClipboardFormat clipboardFormat, TXlsCellRange range, Stream outStream)

Parameters

<-> | Parameter | Type | Description
 | clipboardFormat | FlexCelClipboard​Format | Format you want to copy into outStream.
 | range | TXlsCellRange | Range with the cells to copy.
 | outStream | Stream | Stream where the clipboard info will be copied. If null, nothing will be copied.

See also

  • ExcelFile


ExcelFile.PasteFromXlsClipboardFormat Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.PasteFromXlsClipboardFormat Method

Overloads

  • ExcelFile.PasteFromXlsClipboardFormat(Int32, Int32, TFlxInsertMode, Stream)
  • ExcelFile.PasteFromXlsClipboardFormat(Int32, Int32, TFlxInsertMode, Stream, Boolean)

ExcelFile.PasteFromXlsClipboardFormat(Int32, Int32, TFlxInsertMode, Stream)

Pastes the clipboard contents beginning on cells row, col.

Remarks

See the copy and paste demo.

Syntax

Namespace: FlexCel.Core

public void PasteFromXlsClipboardFormat(Int32 row, Int32 col, TFlxInsertMode insertMode, Stream data)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | First row where to paste.
 | col | Int32 | First column where to paste.
 | insertMode | TFlxInsertMode | How the pasted cells will be inserted on the file.
 | data | Stream | A stream containing a Native xls format.

See also

  • ExcelFile

ExcelFile.PasteFromXlsClipboardFormat(Int32, Int32, TFlxInsertMode, Stream, Boolean)

Pastes the clipboard contents beginning on cells row, col, with the option to convert formulas to their values.

Remarks

See the copy and paste demo.

Syntax

Namespace: FlexCel.Core

public abstract void PasteFromXlsClipboardFormat(Int32 row, Int32 col, TFlxInsertMode insertMode, Stream data, Boolean convertFormulasToValues)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | First row where to paste.
 | col | Int32 | First column where to paste.
 | insertMode | TFlxInsertMode | How the pasted cells will be inserted on the file.
 | data | Stream | A stream containing a Native xls format.
 | convertFormulasToValues | Boolean | If true, the formulas will be converted to values.

See also

  • ExcelFile


ExcelFile.PasteFromTextClipboardFormat Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.PasteFromTextClipboardFormat Method

Pastes the clipboard contents beginning on cells row, col.

Remarks

See the copy and paste demo.

Syntax

Namespace: FlexCel.Core

public abstract void PasteFromTextClipboardFormat(Int32 row, Int32 col, TFlxInsertMode insertMode, String data)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | First row where to paste.
 | col | Int32 | First column where to paste.
 | insertMode | TFlxInsertMode | How the pasted cells will be inserted on the file.
 | data | String | A string containing a tab separated text format.

See also

  • ExcelFile


ExcelFile.GetPageHeaderAndFooter Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.GetPageHeaderAndFooter Method

This method will return all the headers and footers in a sheet.

Syntax

Namespace: FlexCel.Core

public abstract THeaderAndFooter GetPageHeaderAndFooter()

See also

  • ExcelFile


ExcelFile.SetPageHeaderAndFooter Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.SetPageHeaderAndFooter Method

This method will set all the headers and footers in a sheet. If you want a simple header or footer for all the pages, you might want to use PageHeader and PageFooter

Syntax

Namespace: FlexCel.Core

public abstract void SetPageHeaderAndFooter(THeaderAndFooter headerAndFooter)

Parameters

<-> | Parameter | Type | Description
 | headerAndFooter | THeaderAndFooter | Structure with the headers and footers definition.

See also

  • ExcelFile


ExcelFile.FillPageHeaderOrFooter Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.FillPageHeaderOrFooter Method

Given a Page Header or footer string including macros (like [FileName] or [PageNo]), this method will return the strings that go into the left, right and middle sections.

Syntax

Namespace: FlexCel.Core

public abstract void FillPageHeaderOrFooter(String fullText, ref String leftText, ref String centerText, ref String rightText)

Parameters

<-> | Parameter | Type | Description
 | fullText | String | Header or footer text.
ref | leftText | String | Text that should be left justified.
ref | centerText | String | Text that should be centered.
ref | rightText | String | Text that should be right justified.

See also

  • ExcelFile


ExcelFile.GetPageHeaderOrFooterAsHtml Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.GetPageHeaderOrFooterAsHtml Method

Converts a section of a page header or footer into an HTML string.

Syntax

Namespace: FlexCel.Core

public abstract String GetPageHeaderOrFooterAsHtml(String section, String imageTag, Int32 pageNumber, Int32 pageCount, THtmlVersion htmlVersion, Encoding encoding, IHtmlFontEvent onFont)

Parameters

<-> | Parameter | Type | Description
 | section | String | Text to convert. You will normally get this parameter calling FillPageHeaderOrFooter
 | imageTag | String | Tag to call an image for the section. It must be in the form: "<img src=...>" and you can get the image with GetHeaderOrFooterImage(THeaderAndFooterKind, THeaderAndFooterPos, TXlsImgType) . If null or empty, no img tag will be present in the resulting HTML, even if the section includes an image.
 | pageNumber | Int32 | Page we are printing. This parameter will be used if you have text like "Page 1 of 3" in the header. If you are exporting to HTML, this value should be 1, since there are no page breaks in an HTML doc.
 | pageCount | Int32 | Number of pages in the document. This parameter will be used if you have text like "Page 1 of 3" in the header. If you are exporting to HTML, this value should be 1, since there are no page breaks in an HTML doc
 | htmlVersion | THtmlVersion | Version of HTML we are targeting. In HTML 4 <br> is valid and <br/> is not. In XHtml the inverse is true.
 | encoding | Encoding | Code page used to encode the string. Normally this is UTF-8
 | onFont | IHtmlFontEvent | Method that can customize the fonts used in the resulting string. It can be null if you don't want to do any modification to the fonts.

Returns

An HTML string with the section.

See also

  • ExcelFile


ExcelFile.GetHeaderOrFooterImage Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.GetHeaderOrFooterImage Method

Overloads

  • ExcelFile.GetHeaderOrFooterImage(THeaderAndFooterKind, THeaderAndFooterPos, TXlsImgType, Stream)
  • ExcelFile.GetHeaderOrFooterImage(THeaderAndFooterKind, THeaderAndFooterPos, TXlsImgType)

ExcelFile.GetHeaderOrFooterImage(THeaderAndFooterKind, THeaderAndFooterPos, TXlsImgType, Stream)

This method returns the images associated to a given section of the header or footer. There can be only one image per section, and you refer it from the header string (see PageHeader and PageFooter) by writing &G. NOTE THAT YOU CAN ONLY USE HEADER AND FOOTER GRAPHICS ON EXCEL XP AND NEWER. Excel 2000 and 97 will still open the file, but they will show no graphics.

Syntax

Namespace: FlexCel.Core

public abstract void GetHeaderOrFooterImage(THeaderAndFooterKind headerAndFooterKind, THeaderAndFooterPos section, ref TXlsImgType imageType, Stream outStream)

Parameters

<-> | Parameter | Type | Description
 | headerAndFooterKind | THeaderAndFooterKind | Type of page for which we want to retrieve the image. You will normally get this value from THeaderAndFooter.GetHeaderAndFooterKind.
 | section | THeaderAndFooterPos | Section of the header or footer for which we want to retrieve the image.
ref | imageType | TXlsImgType | Returns the image type for the data returned. (If it is a bmp, jpg or other)
 | outStream | Stream | Stream where the image data will be copied.

See also

  • ExcelFile

ExcelFile.GetHeaderOrFooterImage(THeaderAndFooterKind, THeaderAndFooterPos, TXlsImgType)

This method returns the images associated to a given section of the header or footer. There can be only one image per section, and you refer it from the header string (see PageHeader and PageFooter) by writing &G. NOTE THAT YOU CAN ONLY USE HEADER AND FOOTER GRAPHICS ON EXCEL XP AND NEWER. Excel 2000 and 97 will still open the file, but they will show no graphics.

Syntax

Namespace: FlexCel.Core

public Byte[] GetHeaderOrFooterImage(THeaderAndFooterKind headerAndFooterKind, THeaderAndFooterPos section, ref TXlsImgType imageType)

Parameters

<-> | Parameter | Type | Description
 | headerAndFooterKind | THeaderAndFooterKind | Type of page for which we want to retrieve the image. You will normally get this value from THeaderAndFooter.GetHeaderAndFooterKind.
 | section | THeaderAndFooterPos | Section of the header or footer for which we want to retrieve the image.
ref | imageType | TXlsImgType | Returns the image type for the data returned. (If it is a bmp, jpg or other)

Returns

Bytes for the image. Null if there is no image on this position.

See also

  • ExcelFile


ExcelFile.GetHeaderOrFooterImageProperties Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.GetHeaderOrFooterImageProperties Method

Returns the image position and size.

Syntax

Namespace: FlexCel.Core

public abstract THeaderOrFooterImageProperties GetHeaderOrFooterImageProperties(THeaderAndFooterKind headerAndFooterKind, THeaderAndFooterPos section)

Parameters

<-> | Parameter | Type | Description
 | headerAndFooterKind | THeaderAndFooterKind | Type of page for which we want to retrieve the image. You will normally get this value from THeaderAndFooter.GetHeaderAndFooterKind.
 | section | THeaderAndFooterPos | Section of the header or footer for which we want to retrieve the image properties.

Returns

Image properties. Null if there is no image on this section.

See also

  • ExcelFile


ExcelFile.SetHeaderOrFooterImage Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.SetHeaderOrFooterImage Method

Overloads

  • ExcelFile.SetHeaderOrFooterImage(THeaderAndFooterKind, THeaderAndFooterPos, Byte[], THeaderOrFooterImageProperties)
  • ExcelFile.SetHeaderOrFooterImage(THeaderAndFooterKind, THeaderAndFooterPos, Byte[], TXlsImgType, THeaderOrFooterImageProperties)

ExcelFile.SetHeaderOrFooterImage(THeaderAndFooterKind, THeaderAndFooterPos, Byte[], THeaderOrFooterImageProperties)

This method sets the image associated to a given section of the header or footer. There can be only one image per section, and you refer it from the header string (see PageHeader and PageFooter) by writing &G. NOTE THAT YOU CAN ONLY USE HEADER AND FOOTER GRAPHICS ON EXCEL XP AND NEWER. Excel 2000 and 97 will still open the file, but they will show no graphics. ALSO, NOTE that only setting the image will not display it. You need to write &G in the corresponding PageHeader or PageFooter This methods will try to automatically guess/convert the image type of the data to the better fit.

Syntax

Namespace: FlexCel.Core

public void SetHeaderOrFooterImage(THeaderAndFooterKind headerAndFooterKind, THeaderAndFooterPos section, Byte[] data, THeaderOrFooterImageProperties properties)

Parameters

<-> | Parameter | Type | Description
 | headerAndFooterKind | THeaderAndFooterKind | Type of page for which we want to set the image. You will normally get this value from THeaderAndFooter.GetHeaderAndFooterKind.
 | section | THeaderAndFooterPos | Section of the header or footer for which we want to set the image.
 | data | Byte[] | Image data.
 | properties | THeaderOrFooter​Image​Properties | Image Size.

See also

  • ExcelFile

ExcelFile.SetHeaderOrFooterImage(THeaderAndFooterKind, THeaderAndFooterPos, Byte[], TXlsImgType, THeaderOrFooterImageProperties)

This method sets the image associated to a given section of the header or footer. There can be only one image per section, and you refer it from the header string (see PageHeader and PageFooter) by writing &G. NOTE THAT YOU CAN ONLY USE HEADER AND FOOTER GRAPHICS ON EXCEL XP AND NEWER. Excel 2000 and 97 will still open the file, but they will show no graphics. ALSO, NOTE that only setting the image will not display it. You need to write &G in the corresponding PageHeader or PageFooter

Syntax

Namespace: FlexCel.Core

public abstract void SetHeaderOrFooterImage(THeaderAndFooterKind headerAndFooterKind, THeaderAndFooterPos section, Byte[] data, TXlsImgType imageType, THeaderOrFooterImageProperties properties)

Parameters

<-> | Parameter | Type | Description
 | headerAndFooterKind | THeaderAndFooterKind | Type of page for which we want to set the image. You will normally get this value from THeaderAndFooter.GetHeaderAndFooterKind.
 | section | THeaderAndFooterPos | Section of the header or footer for which we want to set the image.
 | data | Byte[] | Image data.
 | imageType | TXlsImgType | The image type for the data sent. (If it is a bmp, jpg or other)
 | properties | THeaderOrFooter​Image​Properties | Image size.

See also

  • ExcelFile


ExcelFile.GetPrintMargins Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.GetPrintMargins Method

Gets the Margins on the active sheet.

Syntax

Namespace: FlexCel.Core

public abstract TXlsMargins GetPrintMargins()

See also

  • ExcelFile


ExcelFile.SetPrintMargins Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.SetPrintMargins Method

Sets the Margins on the active sheet.

Syntax

Namespace: FlexCel.Core

public abstract void SetPrintMargins(TXlsMargins value)

Parameters

<-> | Parameter | Type | Description
 | value | TXlsMargins |

See also

  • ExcelFile


ExcelFile.GetPrinterDriverSettings Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.GetPrinterDriverSettings Method

Returns printer driver settings. This method is not intended to be used alone, but together with SetPrinterDriverSettings to copy printer driver information from a file to another.

Remarks

Excel stores printer settings in two places

  1. Standard printer settings: You can set/read this with PrintPaperSize, PrintScale, PrintLandscape, PrintXResolution, PrintYResolution and PrintCopies
  2. Printer driver settings: You can access this with GetPrinterDriverSettings and SetPrinterDriverSettings.

NOTE THAT THOSE PLACES STORE DUPLICATED INFORMATION. For example, Excel stores the PageSize on both Standard printer settings and Printer driver settings.

Always that a value is stored on both places, (1) Standard printer settings takes preference.

If you set PaperSize = A4 on standard settings and PaperSize = A5 on driver settings, A4 will be used.

Syntax

Namespace: FlexCel.Core

public abstract TPrinterDriverSettings GetPrinterDriverSettings()

Examples

To copy the printer driver information from an empty template to the working file, use:

    xlsWorkingCopy.SetPrinterDriverSettings(xlsTemplate.GetPrinterDriverSettings());

If you have defined a printer specific paper size, and you want to use it, you should call

    xlsWorkingCopy.PrintPaperSize = xlsTemplate.PrintPaperSize;

after copying the driver settings.

See also

  • ExcelFile


ExcelFile.SetPrinterDriverSettings Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.SetPrinterDriverSettings Method

Sets printer driver information. This method is not intended to be used alone, but together with GetPrinterDriverSettings to copy printer driver information from a file to another.

Remarks

Excel stores printer settings in two places

  1. Standard printer settings: You can set/read this with PrintPaperSize, PrintScale, PrintLandscape, PrintXResolution, PrintYResolution and PrintCopies
  2. Printer driver settings: You can access this with GetPrinterDriverSettings and SetPrinterDriverSettings.

NOTE THAT THOSE PLACES STORE DUPLICATED INFORMATION. For example, Excel stores the PageSize on both Standard printer settings and Printer driver settings.

Always that a value is stored on both places, (1) Standard printer settings takes preference.

If you set PaperSize=A4 on standard settings and PaperSize=A5 on driver settings, A4 will be used.

Syntax

Namespace: FlexCel.Core

public abstract void SetPrinterDriverSettings(TPrinterDriverSettings settings)

Parameters

<-> | Parameter | Type | Description
 | settings | TPrinterDriver​Settings | Printer driver information obtained with GetPrinterDriverSettings. Use null to remove the printer settings.

Examples

To copy the printer driver information from an empty template to the working file, use:

    xlsWorkingCopy.SetPrinterDriverSettings(xlsTemplate.GetPrinterDriverSettings());

If you have defined a printer specific paper size, and you want to use it, you should call

    xlsWorkingCopy.PrintPaperSize = xlsTemplate.PrintPaperSize;

after copying the driver settings.

See also

  • ExcelFile


ExcelFile.SetImage Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.SetImage Method

Overloads

  • ExcelFile.SetImage(Int32, Byte[])
  • ExcelFile.SetImage(Int32, TUIImage)
  • ExcelFile.SetImage(Int32, Byte[], TXlsImgType)
  • ExcelFile.SetImage(Int32, Byte[], Boolean, String)
  • ExcelFile.SetImage(Int32, TUIImage, Boolean, String)
  • ExcelFile.SetImage(Int32, Byte[], TXlsImgType, Boolean, String)

ExcelFile.SetImage(Int32, Byte[])

Sets the image data for an existing image. It will try to automatically guess/convert the image type of the data to the better fit. Note that for SVG images, xlsx files store both a PNG and SVG image. To enter an SVG image, use SetImageAlternate

Syntax

Namespace: FlexCel.Core

public void SetImage(Int32 imageIndex, Byte[] data)

Parameters

<-> | Parameter | Type | Description
 | imageIndex | Int32 | Index of the image on the sheet array (1-based)
 | data | Byte[] | Image data.

See also

  • ExcelFile

ExcelFile.SetImage(Int32, TUIImage)

Sets the image data for an existing image. Note that for SVG images, xlsx files store both a PNG and SVG image. To enter an SVG image, use SetImageAlternate

Remarks

Saving a WMF or EMF Image is not currently supported by the .NET framework. If you pass a MetaFile to this method, it will be saved as PNG. For inserting a REAL wmf into excel use AddImage(Stream, TXlsImgType, TImageProperties)

Syntax

Namespace: FlexCel.Core

public void SetImage(Int32 imageIndex, TUIImage Img)

Parameters

<-> | Parameter | Type | Description
 | imageIndex | Int32 | Image Index. 1-Based.
 | Img | TUIImage | Image to replace.

See also

  • ExcelFile

ExcelFile.SetImage(Int32, Byte[], TXlsImgType)

Sets the image data and / or image properties of an existing image. Note that for SVG images, xlsx files store both a PNG and SVG image. To enter an SVG image, use SetImageAlternate

Syntax

Namespace: FlexCel.Core

public void SetImage(Int32 imageIndex, Byte[] data, TXlsImgType imageType)

Parameters

<-> | Parameter | Type | Description
 | imageIndex | Int32 | Index of the image on the sheet array (1-based)
 | data | Byte[] | Image data.
 | imageType | TXlsImgType | Image type of the new data.

See also

  • ExcelFile

ExcelFile.SetImage(Int32, Byte[], Boolean, String)

Sets the image data for an existing image. It will try to automatically guess/convert the image type of the data to the better fit. Note that for SVG images, xlsx files store both a PNG and SVG image. To enter an SVG image, use SetImageAlternate

Syntax

Namespace: FlexCel.Core

public void SetImage(Int32 imageIndex, Byte[] data, Boolean usesObjectIndex, String objectPath)

Parameters

<-> | Parameter | Type | Description
 | imageIndex | Int32 | Index of the image on the sheet array (1-based)
 | data | Byte[] | Image data.
 | usesObjectIndex | Boolean | If false (the default) then imageIndex is an index to the list of images. When true imageIndex is an index to the list of all objects in the sheet. When you have the object id, you can avoid calling ObjectIndexToImageIndex which is a slow method, by setting this parameter to true.
 | objectPath | String | Path to the object, when the object is grouped with others. This parameter only has meaning if usesObjectIndex is true. If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"

See also

  • ExcelFile

ExcelFile.SetImage(Int32, TUIImage, Boolean, String)

Sets the image data for an existing image. Note that for SVG images, xlsx files store both a PNG and SVG image. To enter an SVG image, use SetImageAlternate

Remarks

Saving a WMF or EMF Image is not currently supported by the .NET framework. If you pass a MetaFile to this method, it will be saved as png. For inserting a REAL wmf into excel use AddImage(Stream, TXlsImgType, TImageProperties)

Syntax

Namespace: FlexCel.Core

public void SetImage(Int32 imageIndex, TUIImage Img, Boolean usesObjectIndex, String objectPath)

Parameters

<-> | Parameter | Type | Description
 | imageIndex | Int32 | Image Index. 1-Based.
 | Img | TUIImage | Image to replace.
 | usesObjectIndex | Boolean | If false (the default) then imageIndex is an index to the list of images. When true imageIndex is an index to the list of all objects in the sheet. When you have the object id, you can avoid calling ObjectIndexToImageIndex which is a slow method, by setting this parameter to true.
 | objectPath | String | Path to the object, when the object is grouped with others. This parameter only has meaning if usesObjectIndex is true. If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"

See also

  • ExcelFile

ExcelFile.SetImage(Int32, Byte[], TXlsImgType, Boolean, String)

Sets the image data and / or image properties of an existing image. Note that for SVG images, xlsx files store both a PNG and SVG image. To enter an SVG image, use SetImageAlternate

Syntax

Namespace: FlexCel.Core

public abstract void SetImage(Int32 imageIndex, Byte[] data, TXlsImgType imageType, Boolean usesObjectIndex, String objectPath)

Parameters

<-> | Parameter | Type | Description
 | imageIndex | Int32 | Index of the image on the sheet array (1-based)
 | data | Byte[] | Image data.
 | imageType | TXlsImgType | Image type of the new data.
 | usesObjectIndex | Boolean | If false (the default) then imageIndex is an index to the list of images. When true imageIndex is an index to the list of all objects in the sheet. When you have the object id, you can avoid calling ObjectIndexToImageIndex which is a slow method, by setting this parameter to true.
 | objectPath | String | Path to the object, when the object is grouped with others. This parameter only has meaning if usesObjectIndex is true. If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"

See also

  • ExcelFile


ExcelFile.SetImageAlternate Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.SetImageAlternate Method

Sets the image data and / or image properties of an existing image. Currently this method is only needed for SVG images, since SVG images are stored as both PNG and SVG inside the xlsx file. This method allows you to supply both images.

Syntax

Namespace: FlexCel.Core

public abstract void SetImageAlternate(Int32 imageIndex, Byte[] PNGData, Boolean usesObjectIndex, String objectPath, TSVGBlip aSVGBlip)

Parameters

<-> | Parameter | Type | Description
 | imageIndex | Int32 | Index of the image on the sheet array (1-based)
 | PNGData | Byte[] | Image data for the PNG image that is used as a backup for the SVG image. This data must be in PNG file format.
 | usesObjectIndex | Boolean | If false (the default) then imageIndex is an index to the list of images. When true imageIndex is an index to the list of all objects in the sheet. When you have the object id, you can avoid calling ObjectIndexToImageIndex which is a slow method, by setting this parameter to true.
 | objectPath | String | Path to the object, when the object is grouped with others. This parameter only has meaning if usesObjectIndex is true. If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"
 | aSVGBlip | TSVGBlip | Image data for the SVG image

See also

  • ExcelFile


ExcelFile.SetImageProperties Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.SetImageProperties Method

Overloads

  • ExcelFile.SetImageProperties(Int32, TImageProperties)
  • ExcelFile.SetImageProperties(Int32, TImageProperties, Boolean, String)

ExcelFile.SetImageProperties(Int32, TImageProperties)

Sets the image properties of an existing image.

Syntax

Namespace: FlexCel.Core

public void SetImageProperties(Int32 imageIndex, TImageProperties imageProperties)

Parameters

<-> | Parameter | Type | Description
 | imageIndex | Int32 | Index of the image on the sheet array (1-based)
 | imageProperties | TImageProperties | Image size, placement, etc.

See also

  • ExcelFile

ExcelFile.SetImageProperties(Int32, TImageProperties, Boolean, String)

Sets the image properties of an existing image.

Syntax

Namespace: FlexCel.Core

public abstract void SetImageProperties(Int32 imageIndex, TImageProperties imageProperties, Boolean usesObjectIndex, String objectPath)

Parameters

<-> | Parameter | Type | Description
 | imageIndex | Int32 | Index of the image on the sheet array (1-based)
 | imageProperties | TImageProperties | Image size, placement, etc.
 | usesObjectIndex | Boolean | If false (the default) then imageIndex is an index to the list of images. When true imageIndex is an index to the list of all objects in the sheet. When you have the object id, you can avoid calling ObjectIndexToImageIndex which is a slow method, by setting this parameter to true.
 | objectPath | String | Path to the object, when the object is grouped with others. This parameter only has meaning if usesObjectIndex is true. If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"

See also

  • ExcelFile


ExcelFile.GetImageName Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.GetImageName Method

Overloads

  • ExcelFile.GetImageName(Int32)
  • ExcelFile.GetImageName(Int32, Boolean, String)

ExcelFile.GetImageName(Int32)

Returns the image name at position imageIndex.

Remarks

Normally image names are automatically assigned by Excel, and are on the form "picture1", "picture2", etc. But you can name an image on Excel by selecting and then typing its name on the name combo box. (the combobox at the upper left corner on Excel). After that, you can use its name to identify it here.

Syntax

Namespace: FlexCel.Core

public String GetImageName(Int32 imageIndex)

Parameters

<-> | Parameter | Type | Description
 | imageIndex | Int32 | Index of the image (1 based)

Returns

Image name.

See also

  • ExcelFile

ExcelFile.GetImageName(Int32, Boolean, String)

Returns the image name at position imageIndex.

Remarks

Normally image names are automatically assigned by Excel, and are on the form "picture1", "picture2", etc. But you can name an image on Excel by selecting and then typing its name on the name combo box. (the combobox at the upper left corner on Excel). After that, you can use its name to identify it here.

Syntax

Namespace: FlexCel.Core

public abstract String GetImageName(Int32 imageIndex, Boolean usesObjectIndex, String objectPath)

Parameters

<-> | Parameter | Type | Description
 | imageIndex | Int32 | Index of the image (1 based)
 | usesObjectIndex | Boolean | If false (the default) then imageIndex is an index to the list of images. When true imageIndex is an index to the list of all objects in the sheet. When you have the object id, you can avoid calling ObjectIndexToImageIndex which is a slow method, by setting this parameter to true.
 | objectPath | String | Path to the object, when the object is grouped with others. This parameter only has meaning if usesObjectIndex is true. If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"

Returns

Image name.

See also

  • ExcelFile


ExcelFile.GetImage Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.GetImage Method

Overloads

  • ExcelFile.GetImage(Int32, TXlsImgType)
  • ExcelFile.GetImage(Int32, TXlsImgType, Stream)
  • ExcelFile.GetImage(Int32, String, TXlsImgType, Stream, Boolean)

ExcelFile.GetImage(Int32, TXlsImgType)

Returns an image bytes and type. Note that for SVG images, xlsx files store both a PNG and SVG image. In those cases, for backward compatibility reasons, this method will return the PNG image. To get the SVG, call GetImageAlternate

Syntax

Namespace: FlexCel.Core

public Byte[] GetImage(Int32 imageIndex, ref TXlsImgType imageType)

Parameters

<-> | Parameter | Type | Description
 | imageIndex | Int32 | Index of the image. (1 based)
ref | imageType | TXlsImgType | Returns the image type for the data returned. (If it is a bmp, jpg or other)

Returns

Image data. Use the returned imageType to find out the format of the stored image.

See also

  • ExcelFile

ExcelFile.GetImage(Int32, TXlsImgType, Stream)

Returns an image and its type. Note that for SVG images, xlsx files store both a PNG and SVG image. In those cases, for backward compatibility reasons, this method will return the PNG image. To get the SVG, call GetImageAlternate

Syntax

Namespace: FlexCel.Core

public void GetImage(Int32 imageIndex, ref TXlsImgType imageType, Stream outStream)

Parameters

<-> | Parameter | Type | Description
 | imageIndex | Int32 | Index of the image. (1 based)
ref | imageType | TXlsImgType | Returns the image type for the data returned. (If it is a bmp, jpg or other)
 | outStream | Stream | Stream where the image data will be copied.

Examples

The method "GetImageFromName" in the code below will extract an image in the active sheet if you know the name of the image. Note that the name must be a real name that was manually added to the image. Image names like "Image 1" might or might not work depending in the Excel version.

The method "GetAllImagesInSheet" will loop over all the existing images in the active sheet and save them.

    static string GetExtension(TXlsImgType ImgType)
    {
        switch (ImgType)
        {
            case TXlsImgType.Bmp: return ".bmp";
            case TXlsImgType.Emf: return ".emf";
            case TXlsImgType.Jpeg: return ".jpg";
            case TXlsImgType.Wmf: return ".wmf";
            case TXlsImgType.Tiff: return ".tif";
            case TXlsImgType.Gif: return ".gif";
            case TXlsImgType.Png: return ".png";
            default: return "";
        }

    }

    public static void GetImageFromName()
    {
        var xls = new XlsFile("myfile.xlsx");

        //Get an image named "myimage" and save it
        //as myimage.png, myimage.jpeg, etc depending in the
        //image type.

        string filename = "myimage";
        TXlsImgType imageType = TXlsImgType.Unknown;
        using (var ImageStream = new FileStream(filename, FileMode.Create))
        {
            xls.GetImage(-1, "@myimage", ref imageType, ImageStream, true); //For this to work, last parameter must be true.
        }
        File.Move(filename, Path.ChangeExtension(filename, GetExtension(imageType)));

    }

    public static void GetAllImagesInSheet()
    {
        var xls = new XlsFile("myfile.xlsx");

        //Get all the images in the active sheet and save them
        //as myimage1.png, myimage2.jpeg, etc depending in the
        //image type.

        TXlsImgType imageType = TXlsImgType.Unknown;
        for (int i = 1; i <= xls.ImageCount; i++)
        {
            string filename = "myimage" + i.ToString();

            using (var ImageStream = new FileStream(filename, FileMode.Create))
            {
                xls.GetImage(i, ref imageType, ImageStream);
            }
            File.Move(filename, Path.ChangeExtension(filename, GetExtension(imageType)));
        }

    }

See also

  • ExcelFile

ExcelFile.GetImage(Int32, String, TXlsImgType, Stream, Boolean)

Returns an image and its type. Note that for SVG images, xlsx files store both a PNG and SVG image. In those cases, for backward compatibility reasons, this method will return the PNG image. To get the SVG, call GetImageAlternate

Syntax

Namespace: FlexCel.Core

public void GetImage(Int32 imageIndex, String objectPath, ref TXlsImgType imageType, Stream outStream, Boolean usesObjectIndex)

Parameters

<-> Parameter Type Description
imageIndex | Int32 | Index of the image. (1 based)
objectPath String Object path to the image when it is a grouped image. For toplevel images you can use String.Empty.
In other case, you need to use the value returned by GetObjectProperties(Int32, Boolean)
Important: ObjectPath is ignored if usesObjectIndex is false.

If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"
You might also use the name of the image as object path, like in xls.GetImage(-1, "@myimage", ref imageType, ImageStream, true)
ref | imageType | TXlsImgType | Returns the image type for the data returned. (If it is a bmp, jpg or other)
outStream | Stream | Stream where the image data will be copied.
usesObjectIndex Boolean If false (the default) then imageIndex is an index to the list of images.
When true imageIndex is an index to the list of all objects in the sheet. When you have the object id, you can avoid calling ObjectIndexToImageIndex which is a slow method, by setting this parameter to true.

Examples

The method "GetImageFromName" in the code below will extract an image in the active sheet if you know the name of the image. Note that the name must be a real name that was manually added to the image. Image names like "Image 1" might or might not work depending in the Excel version.

The method "GetAllImagesInSheet" will loop over all the existing images in the active sheet and save them.

    static string GetExtension(TXlsImgType ImgType)
    {
        switch (ImgType)
        {
            case TXlsImgType.Bmp: return ".bmp";
            case TXlsImgType.Emf: return ".emf";
            case TXlsImgType.Jpeg: return ".jpg";
            case TXlsImgType.Wmf: return ".wmf";
            case TXlsImgType.Tiff: return ".tif";
            case TXlsImgType.Gif: return ".gif";
            case TXlsImgType.Png: return ".png";
            default: return "";
        }

    }

    public static void GetImageFromName()
    {
        var xls = new XlsFile("myfile.xlsx");

        //Get an image named "myimage" and save it
        //as myimage.png, myimage.jpeg, etc depending in the
        //image type.

        string filename = "myimage";
        TXlsImgType imageType = TXlsImgType.Unknown;
        using (var ImageStream = new FileStream(filename, FileMode.Create))
        {
            xls.GetImage(-1, "@myimage", ref imageType, ImageStream, true); //For this to work, last parameter must be true.
        }
        File.Move(filename, Path.ChangeExtension(filename, GetExtension(imageType)));

    }

    public static void GetAllImagesInSheet()
    {
        var xls = new XlsFile("myfile.xlsx");

        //Get all the images in the active sheet and save them
        //as myimage1.png, myimage2.jpeg, etc depending in the
        //image type.

        TXlsImgType imageType = TXlsImgType.Unknown;
        for (int i = 1; i <= xls.ImageCount; i++)
        {
            string filename = "myimage" + i.ToString();

            using (var ImageStream = new FileStream(filename, FileMode.Create))
            {
                xls.GetImage(i, ref imageType, ImageStream);
            }
            File.Move(filename, Path.ChangeExtension(filename, GetExtension(imageType)));
        }

    }

See also

  • ExcelFile


ExcelFile.GetImageAlternate Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.GetImageAlternate Method

Returns an image and its type. Currently this method is the same as GetImage(Int32, String, TXlsImgType, Stream, Boolean) for all images except SVG. For SVG images, xlsx files store both a PNG and SVG image. In those cases, this method will return the SVG image. To get the PNG, call GetImage(Int32, String, TXlsImgType, Stream, Boolean)

Syntax

Namespace: FlexCel.Core

public void GetImageAlternate(Int32 imageIndex, String objectPath, out TXlsImgType imageType, Stream outStream, Boolean usesObjectIndex)

Parameters

<-> Parameter Type Description
imageIndex | Int32 | Index of the image. (1 based)
objectPath String Object path to the image when it is a grouped image. For toplevel images you can use String.Empty.
In other case, you need to use the value returned by GetObjectProperties(Int32, Boolean)
Important: ObjectPath is ignored if usesObjectIndex is false.

If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"
You might also use the name of the image as object path, like in xls.GetImage(-1, "@myimage", ref imageType, ImageStream, true)
out | imageType | TXlsImgType | Returns the image type for the data returned. (If it is a bmp, jpg or other)
outStream | Stream | Stream where the image data will be copied.
usesObjectIndex Boolean If false (the default) then imageIndex is an index to the list of images.
When true imageIndex is an index to the list of all objects in the sheet. When you have the object id, you can avoid calling ObjectIndexToImageIndex which is a slow method, by setting this parameter to true.

Examples

The method "GetImageFromName" in the code below will extract an image in the active sheet if you know the name of the image. Note that the name must be a real name that was manually added to the image. Image names like "Image 1" might or might not work depending in the Excel version.

The method "GetAllImagesInSheet" will loop over all the existing images in the active sheet and save them.

    static string GetExtension(TXlsImgType ImgType)
    {
        switch (ImgType)
        {
            case TXlsImgType.Bmp: return ".bmp";
            case TXlsImgType.Emf: return ".emf";
            case TXlsImgType.Jpeg: return ".jpg";
            case TXlsImgType.Wmf: return ".wmf";
            case TXlsImgType.Tiff: return ".tif";
            case TXlsImgType.Gif: return ".gif";
            case TXlsImgType.Png: return ".png";
            default: return "";
        }

    }

    public static void GetImageFromName()
    {
        var xls = new XlsFile("myfile.xlsx");

        //Get an image named "myimage" and save it
        //as myimage.png, myimage.jpeg, etc depending in the
        //image type.

        string filename = "myimage";
        TXlsImgType imageType = TXlsImgType.Unknown;
        using (var ImageStream = new FileStream(filename, FileMode.Create))
        {
            xls.GetImage(-1, "@myimage", ref imageType, ImageStream, true); //For this to work, last parameter must be true.
        }
        File.Move(filename, Path.ChangeExtension(filename, GetExtension(imageType)));

    }

    public static void GetAllImagesInSheet()
    {
        var xls = new XlsFile("myfile.xlsx");

        //Get all the images in the active sheet and save them
        //as myimage1.png, myimage2.jpeg, etc depending in the
        //image type.

        TXlsImgType imageType = TXlsImgType.Unknown;
        for (int i = 1; i <= xls.ImageCount; i++)
        {
            string filename = "myimage" + i.ToString();

            using (var ImageStream = new FileStream(filename, FileMode.Create))
            {
                xls.GetImage(i, ref imageType, ImageStream);
            }
            File.Move(filename, Path.ChangeExtension(filename, GetExtension(imageType)));
        }

    }

See also

  • ExcelFile


ExcelFile.HasImageAlternate Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.HasImageAlternate Method

Returns true if the image has an alternate representation. This currently happens only with SVG images, which have a PNG base and an SVG alternate. If the image has an alternate, you can get the data with GetImageAlternate

Syntax

Namespace: FlexCel.Core

public abstract Boolean HasImageAlternate(Int32 imageIndex, String objectPath, Boolean usesObjectIndex)

Parameters

<-> Parameter Type Description
imageIndex Int32 Index of the image. (1 based)
objectPath String Object path to the image when it is a grouped image. For toplevel images you can use String.Empty.
In other case, you need to use the value returned by GetObjectProperties(Int32, Boolean)
Important: ObjectPath is ignored if usesObjectIndex is false.

If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"
You might also use the name of the image as object path, like in xls.GetImage(-1, "@myimage", ref imageType, ImageStream, true)
usesObjectIndex Boolean If false then imageIndex is an index to the list of images.
When true imageIndex is an index to the list of all objects in the sheet. When you have the object id, you can avoid calling ObjectIndexToImageIndex which is a slow method, by setting this parameter to true.

See also

  • ExcelFile


ExcelFile.GetImageProperties Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.GetImageProperties Method

Overloads

  • ExcelFile.GetImageProperties(Int32)
  • ExcelFile.GetImageProperties(Int32, Boolean, String)

ExcelFile.GetImageProperties(Int32)

Returns image position and size.

Syntax

Namespace: FlexCel.Core

public TImageProperties GetImageProperties(Int32 imageIndex)

Parameters

<-> | Parameter | Type | Description
 | imageIndex | Int32 | Index of the image (1 based)

Returns

Image position and size.

See also

  • ExcelFile

ExcelFile.GetImageProperties(Int32, Boolean, String)

Returns image position and size.

Syntax

Namespace: FlexCel.Core

public abstract TImageProperties GetImageProperties(Int32 imageIndex, Boolean usesObjectIndex, String objectPath)

Parameters

<-> | Parameter | Type | Description
 | imageIndex | Int32 | Index of the image (1 based)
 | usesObjectIndex | Boolean | If false (the default) then imageIndex is an index to the list of images. When true imageIndex is an index to the list of all objects in the sheet. When you have the object id, you can avoid calling ObjectIndexToImageIndex which is a slow method, by setting this parameter to true.
 | objectPath | String | Path to the object, when the object is grouped with others. This parameter only has meaning if usesObjectIndex is true. If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"

Returns

Image position and size.

See also

  • ExcelFile


ExcelFile.AddImage Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.AddImage Method

Overloads

  • ExcelFile.AddImage(TUIImage, TImageProperties)
  • ExcelFile.AddImage(Byte[], TImageProperties)
  • ExcelFile.AddImage(Stream, TImageProperties)
  • ExcelFile.AddImage(String, TImageProperties)
  • ExcelFile.AddImage(Byte[], TXlsImgType, TImageProperties)
  • ExcelFile.AddImage(Stream, TXlsImgType, TImageProperties)
  • ExcelFile.AddImage(Int32, Int32, TUIImage)

ExcelFile.AddImage(TUIImage, TImageProperties)

Adds a new image to the active sheet. If you don't have the image already created, prefer using AddImage(Stream, TImageProperties), as it is faster. Note that for SVG images, xlsx files store both a PNG and SVG image. To enter an SVG image, use AddImageAlternate

Remarks

Saving a WMF or EMF Image is not currently supported by the .NET framework. If you pass a MetaFile to this method, it will be saved as png. For inserting a REAL wmf into excel use AddImage(Stream, TImageProperties)

Syntax

Namespace: FlexCel.Core

public void AddImage(TUIImage img, TImageProperties imageProperties)

Parameters

<-> | Parameter | Type | Description
 | img | TUIImage | Image to insert.
 | imageProperties | TImageProperties | Image size/position

See also

  • ExcelFile

ExcelFile.AddImage(Byte[], TImageProperties)

Adds an image to the active sheet. It will try to automatically guess/convert the image type of the data to the better fit. Note that for SVG images, xlsx files store both a PNG and SVG image. To enter an SVG image, use AddImageAlternate

Syntax

Namespace: FlexCel.Core

public void AddImage(Byte[] data, TImageProperties imageProperties)

Parameters

<-> | Parameter | Type | Description
 | data | Byte[] | Image data.
 | imageProperties | TImageProperties | Image Properties.

See also

  • ExcelFile

ExcelFile.AddImage(Stream, TImageProperties)

Adds an image to the active sheet. Note that for SVG images, xlsx files store both a PNG and SVG image. To enter an SVG image, use AddImageAlternate

Syntax

Namespace: FlexCel.Core

public void AddImage(Stream aStream, TImageProperties imageProperties)

Parameters

<-> | Parameter | Type | Description
 | aStream | Stream | Stream containing the image data.
 | imageProperties | TImageProperties | Placement and other properties of the image.

See also

  • ExcelFile

ExcelFile.AddImage(String, TImageProperties)

Adds an image to the active sheet. Note that for SVG images, xlsx files store both a PNG and SVG image. To enter an SVG image, use AddImageAlternate

Syntax

Namespace: FlexCel.Core

public void AddImage(String fileName, TImageProperties imageProperties)

Parameters

<-> | Parameter | Type | Description
 | fileName | String | Name of the file in disk containing the image data.
 | imageProperties | TImageProperties | Placement and other properties of the image.

See also

  • ExcelFile

ExcelFile.AddImage(Byte[], TXlsImgType, TImageProperties)

Adds an image to the active sheet. Note that for SVG images, xlsx files store both a PNG and SVG image. To enter an SVG image, use AddImageAlternate

Syntax

Namespace: FlexCel.Core

public abstract void AddImage(Byte[] data, TXlsImgType imageType, TImageProperties imageProperties)

Parameters

<-> | Parameter | Type | Description
 | data | Byte[] | byte array with the image data.
 | imageType | TXlsImgType | Type of image you are inserting (bmp, jpg, etc).
 | imageProperties | TImageProperties | Placement and other properties of the image.

See also

  • ExcelFile

ExcelFile.AddImage(Stream, TXlsImgType, TImageProperties)

Adds an image to the active sheet. Note that for SVG images, xlsx files store both a PNG and SVG image. To enter an SVG image, use AddImageAlternate

Syntax

Namespace: FlexCel.Core

public void AddImage(Stream aStream, TXlsImgType imageType, TImageProperties imageProperties)

Parameters

<-> | Parameter | Type | Description
 | aStream | Stream | Stream containing the image data.
 | imageType | TXlsImgType | Type of image you are inserting (bmp, jpg, etc).
 | imageProperties | TImageProperties | Placement and other properties of the image.

See also

  • ExcelFile

ExcelFile.AddImage(Int32, Int32, TUIImage)

Adds a new image to the active sheet. If you don't have the image already created, prefer using AddImage(Stream, TImageProperties), as it is faster. Note that for SVG images, xlsx files store both a PNG and SVG image. To enter an SVG image, use AddImageAlternate

Remarks

Saving a WMF or EMF Image is not currently supported by the .NET framework. If you pass a MetaFile to this method, it will be saved as png. For inserting a REAL wmf into excel use AddImage(Stream, TImageProperties)

Syntax

Namespace: FlexCel.Core

public void AddImage(Int32 row, Int32 col, TUIImage img)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row Index (1 based)
 | col | Int32 | Column Index (1 based)
 | img | TUIImage | Image to insert.

See also

  • ExcelFile


ExcelFile.AddImageAlternate Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.AddImageAlternate Method

Adds an image to the active sheet. Currently this method is only needed for SVG images, since SVG images are stored as both PNG and SVG inside the xlsx file. This method allows you to supply both images.

Syntax

Namespace: FlexCel.Core

public abstract void AddImageAlternate(Byte[] PNGData, TImageProperties imageProperties, TSVGBlip aSVGBlip)

Parameters

<-> | Parameter | Type | Description
 | PNGData | Byte[] | Image data for the PNG file that will be used as a backup for the SVG. This data must be in PNG file format.
 | imageProperties | TImageProperties | Image Properties.
 | aSVGBlip | TSVGBlip | Data for the SVG image to be added.

See also

  • ExcelFile


ExcelFile.DeleteImage Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.DeleteImage Method

Overloads

  • ExcelFile.DeleteImage(Int32)
  • ExcelFile.DeleteImage(Int32, Boolean, String)

ExcelFile.DeleteImage(Int32)

Deletes the image at position imageIndex.

Syntax

Namespace: FlexCel.Core

public void DeleteImage(Int32 imageIndex)

Parameters

<-> | Parameter | Type | Description
 | imageIndex | Int32 | Index of the image to delete. (1 based)

See also

  • ExcelFile

ExcelFile.DeleteImage(Int32, Boolean, String)

Deletes the image at position imageIndex. Note that if the image is grouped, this will remove the full group. To remove a particular image inside a group, use DeleteObject(Int32, String).

Syntax

Namespace: FlexCel.Core

public abstract void DeleteImage(Int32 imageIndex, Boolean usesObjectIndex, String objectPath)

Parameters

<-> | Parameter | Type | Description
 | imageIndex | Int32 | Index of the image to delete. (1 based)
 | usesObjectIndex | Boolean | If false (the default) then imageIndex is an index to the list of images. When true imageIndex is an index to the list of all objects in the sheet. When you have the object id, you can avoid calling ObjectIndexToImageIndex which is a slow method, by setting this parameter to true.
 | objectPath | String | Path to the object, when the object is grouped with others. This parameter only has meaning if usesObjectIndex is true. If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"

See also

  • ExcelFile


ExcelFile.ClearImage Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.ClearImage Method

Overloads

  • ExcelFile.ClearImage(Int32)
  • ExcelFile.ClearImage(Int32, Boolean, String)

ExcelFile.ClearImage(Int32)

Clears the image at position imageIndex, leaving an empty white box.

Syntax

Namespace: FlexCel.Core

public void ClearImage(Int32 imageIndex)

Parameters

<-> | Parameter | Type | Description
 | imageIndex | Int32 | Index of the image to clear. (1 based)

See also

  • ExcelFile

ExcelFile.ClearImage(Int32, Boolean, String)

Clears the image at position imageIndex, leaving an empty white box.

Syntax

Namespace: FlexCel.Core

public abstract void ClearImage(Int32 imageIndex, Boolean usesObjectIndex, String objectPath)

Parameters

<-> | Parameter | Type | Description
 | imageIndex | Int32 | Index of the image to clear. (1 based)
 | usesObjectIndex | Boolean | If false (the default) then imageIndex is an index to the list of images. When true imageIndex is an index to the list of all objects in the sheet. When you have the object id, you can avoid calling ObjectIndexToImageIndex which is a slow method, by setting this parameter to true.
 | objectPath | String | Path to the object, when the object is grouped with others. This parameter only has meaning if usesObjectIndex is true. If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"

See also

  • ExcelFile


ExcelFile.SetSheetBackground Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.SetSheetBackground Method

Sets the sheet background for the active sheet. Set it to null to remove the background.

Syntax

Namespace: FlexCel.Core

public abstract void SetSheetBackground(Byte[] imgData)

Parameters

<-> | Parameter | Type | Description
 | imgData | Byte[] | Bytes with the image data.

See also

  • ExcelFile


ExcelFile.GetSheetBackground Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.GetSheetBackground Method

Gets the sheet background for the active sheet. It will return null if there isn't any background in the sheet.

Syntax

Namespace: FlexCel.Core

public abstract Byte[] GetSheetBackground(out TXlsImgType imageType)

Parameters

<-> | Parameter | Type | Description
out | imageType | TXlsImgType | Returns the image type of the bytes returned.

Returns

The image data as a byte array.

See also

  • ExcelFile


ExcelFile.ImageIndexToObjectIndex Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.ImageIndexToObjectIndex Method

Returns the general index on the object list for an image. You can use then this index on SendToBack, for example. Note that if the image is in a group, this method will return the first object index for the group that contains the image. If you want to get the object path to the image instead, look at ImageIndexToObjectPath

Syntax

Namespace: FlexCel.Core

public abstract Int32 ImageIndexToObjectIndex(Int32 imageIndex)

Parameters

<-> | Parameter | Type | Description
 | imageIndex | Int32 | Image index on the image array.

Returns

Image index on the total objects array.

See also

  • ExcelFile


ExcelFile.ObjectIndexToImageIndex Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.ObjectIndexToImageIndex Method

Returns the index on the image collection of an object. Note that this method is slow when there are many images, so use it sparingly.

Syntax

Namespace: FlexCel.Core

public abstract Int32 ObjectIndexToImageIndex(Int32 objectIndex)

Parameters

<-> | Parameter | Type | Description
 | objectIndex | Int32 | General index of the image on the Object collection.

Returns

-1 if the object is not an image, else the index on the image collection.

See also

  • ExcelFile


ExcelFile.ImageIndexToObjectPath Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.ImageIndexToObjectPath Method

Returns the absolute object path for an image, given an image index. Note that this method can be slow if there are many objects in the file. Whenever possible, prefer the methods that take directly an imageIndex instead of converting the imageIndex to an objectPath.

Syntax

Namespace: FlexCel.Core

public abstract String ImageIndexToObjectPath(Int32 imageIndex)

Parameters

<-> | Parameter | Type | Description
 | imageIndex | Int32 | Image index on the image array.

Returns

Image index on the total objects array.

See also

  • ExcelFile


ExcelFile.ObjectPathToImageIndex Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.ObjectPathToImageIndex Method

Returns the index on the image collection of an object. Note that this method is slow when there are many images, so use it sparingly. Whenever possible, prefer the methods that take directly an objectPath instead of converting the objectPath to an imageIndex.

Syntax

Namespace: FlexCel.Core

public abstract Int32 ObjectPathToImageIndex(Int32 objectIndex, String objectPath)

Parameters

<-> Parameter Type Description
objectIndex Int32 Index of the object.
objectPath String Index to the child object you want find.
If it is a simple object, you can use String.Empty here, if not you need to get the ObjectPath from GetObjectProperties(Int32, Boolean)
If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3".
You might also use the name of the object as objectpath, like ObjectPathToImageIndex(-1, "@myobjectname");

Returns

-1 if the object is not an image, else the index on the image collection.

See also

  • ExcelFile


ExcelFile.GetObjectName Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.GetObjectName Method

Returns the name of the object at objectIndex position.

Syntax

Namespace: FlexCel.Core

public abstract String GetObjectName(Int32 objectIndex)

Parameters

<-> | Parameter | Type | Description
 | objectIndex | Int32 | Object index. (1-based)

See also

  • ExcelFile


ExcelFile.GetObjectShapeId Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.GetObjectShapeId Method

Returns the shape id of the object at objectIndex position. Shape Ids are internal identifiers for the shape, that you can use to uniquely identify a shape. Note that the shape id can change when you load the file, once it is loaded, it will remain the same for the shape lifetime.

Syntax

Namespace: FlexCel.Core

public abstract Int64 GetObjectShapeId(Int32 objectIndex)

Parameters

<-> | Parameter | Type | Description
 | objectIndex | Int32 | Object index. (1-based)

See also

  • ExcelFile


ExcelFile.FindObject Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.FindObject Method

Returns the object index for an existing name. Whenever possible you should prefer to use FindObjectPath instead of this method, since it is faster and finds also objects that are not in the root branch.

Syntax

Namespace: FlexCel.Core

public Int32 FindObject(String objectName)

Parameters

<-> | Parameter | Type | Description
 | objectName | String | Object name to search for. This is case insensitive.

Returns

-1 if the object is not found, or the object index otherwise.

See also

  • ExcelFile


ExcelFile.FindObjectPath Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.FindObjectPath Method

Finds an object by its name, and returns the ObjectPath you need to use this object. Note that if there is more than an object with the same name in the sheet, this method will return null.

Syntax

Namespace: FlexCel.Core

public abstract String FindObjectPath(String objectName)

Parameters

<-> | Parameter | Type | Description
 | objectName | String | Name of the object we are looking for.

See also

  • ExcelFile


ExcelFile.FindObjectByShapeId Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.FindObjectByShapeId Method

Finds an object given its internal shape id, and returns the object index you need to access the same object in FlexCel.

Syntax

Namespace: FlexCel.Core

public abstract Int32 FindObjectByShapeId(Int64 ShapeId)

Parameters

<-> | Parameter | Type | Description
 | ShapeId | Int64 | Shape id of the object.

See also

  • ExcelFile


ExcelFile.IsValidObjectPathObjName Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.IsValidObjectPathObjName Method

Returns true if the object name exists and it is unique in the sheet. You can use FindObjectPath to find the object path you need for this object name.

Syntax

Namespace: FlexCel.Core

public Boolean IsValidObjectPathObjName(String objectName)

Parameters

<-> | Parameter | Type | Description
 | objectName | String |

See also

  • ExcelFile


ExcelFile.GetObjectAnchor Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.GetObjectAnchor Method

Overloads

  • ExcelFile.GetObjectAnchor(Int32)
  • ExcelFile.GetObjectAnchor(Int32, String)

ExcelFile.GetObjectAnchor(Int32)

Returns the placement of the object.

Syntax

Namespace: FlexCel.Core

public TClientAnchor GetObjectAnchor(Int32 objectIndex)

Parameters

<-> | Parameter | Type | Description
 | objectIndex | Int32 | Index of the object (1-based)

Returns

Coordinates of the object.

See also

  • ExcelFile

ExcelFile.GetObjectAnchor(Int32, String)

Returns the placement of the object.

Syntax

Namespace: FlexCel.Core

public abstract TClientAnchor GetObjectAnchor(Int32 objectIndex, String objectPath)

Parameters

<-> Parameter Type Description
objectIndex Int32 Index of the object (1-based)
objectPath String Index to the child object you want to change the text.
If it is a simple object, you can use String.Empty here, if not you need to get the ObjectPath from GetObjectProperties(Int32, Boolean)
If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3".
You might also use the name of the object as objectpath, like GetObjectAnchor(-1, "@myobjectname");

Returns

Coordinates of the object.

See also

  • ExcelFile


ExcelFile.SetObjectAnchor Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.SetObjectAnchor Method

Overloads

  • ExcelFile.SetObjectAnchor(Int32, TClientAnchor)
  • ExcelFile.SetObjectAnchor(Int32, String, TClientAnchor)

ExcelFile.SetObjectAnchor(Int32, TClientAnchor)

Sets the object placement.

Syntax

Namespace: FlexCel.Core

public void SetObjectAnchor(Int32 objectIndex, TClientAnchor objectAnchor)

Parameters

<-> | Parameter | Type | Description
 | objectIndex | Int32 | Index of the object (1-based)
 | objectAnchor | TClientAnchor | Coordinates of the object.

See also

  • ExcelFile

ExcelFile.SetObjectAnchor(Int32, String, TClientAnchor)

Sets the object placement.

Syntax

Namespace: FlexCel.Core

public abstract void SetObjectAnchor(Int32 objectIndex, String objectPath, TClientAnchor objectAnchor)

Parameters

<-> | Parameter | Type | Description
 | objectIndex | Int32 | Index of the object (1-based)
 | objectPath | String | Object path for the shape if this is a grouped shape.
 | objectAnchor | TClientAnchor | Coordinates of the object.

See also

  • ExcelFile


ExcelFile.GetObjectProperties Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.GetObjectProperties Method

Overloads

  • ExcelFile.GetObjectProperties(Int32, Boolean)
  • ExcelFile.GetObjectProperties(Int32, String, Boolean)

ExcelFile.GetObjectProperties(Int32, Boolean)

Returns information on an object and all of its children. If the shape doesn't exist, this method returns null.

Syntax

Namespace: FlexCel.Core

public TShapeProperties GetObjectProperties(Int32 objectIndex, Boolean getShapeOptions)

Parameters

<-> | Parameter | Type | Description
 | objectIndex | Int32 | Index of the object (1-based)
 | getShapeOptions | Boolean | When true, shape options will be retrieved. As this can be a slow operation, only specify true when you really need those options.

See also

  • ExcelFile

ExcelFile.GetObjectProperties(Int32, String, Boolean)

Returns information on an object and all of its children. If the shape doesn't exist, this method returns null.

Syntax

Namespace: FlexCel.Core

public abstract TShapeProperties GetObjectProperties(Int32 objectIndex, String objectPath, Boolean getShapeOptions)

Parameters

<-> Parameter Type Description
objectIndex | Int32 | Index of the object (1-based)
objectPath String Index to the child object you want to change the text.
If it is a simple object, you can use String.Empty here, if not you need to get the ObjectPath from GetObjectProperties(Int32, Boolean)
If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3".
You might also use the name of the object as objectpath by writing "@" at the start of the name, like in GetObjectProperties\(\-1, "@myobjectname", true);
getShapeOptions | Boolean | When true, shape options will be retrieved. As this can be a slow operation, only specify true when you really need those options.

See also

  • ExcelFile


ExcelFile.GetObjectPropertiesByShapeId Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.GetObjectPropertiesByShapeId Method

Returns information on an object and all of its children and parents.

Note: This method always returns a top level object. If you ask for a shape id of a shape that is contained inside other group, this method will return the first level group containing other groups that contain the shape.

Note 2:This method is mostly for internal use. Shape ids are not guaranteed to be preserved when saving and reloading a file, so this method should only be used while editing the file with shape ids retrieved from the XlsFile object, not hardcoded shape ids. To get the object properties for a known shape in a file, give it a name and call GetObjectProperties(Int32, String, Boolean) with an objectPath of "@name\-of\-the\-shape".

Syntax

Namespace: FlexCel.Core

public abstract TShapeProperties GetObjectPropertiesByShapeId(Int64 shapeId, Boolean getShapeOptions)

Parameters

<-> | Parameter | Type | Description
 | shapeId | Int64 | Identifier of the shape.
 | getShapeOptions | Boolean | When true, shape options will be retrieved. As this can be a slow operation, only specify true when you really need those options.

See also

  • ExcelFile


ExcelFile.SetObjectText Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.SetObjectText Method

Overloads

  • ExcelFile.SetObjectText(Int32, String, String)
  • ExcelFile.SetObjectText(Int32, String, TRichString)
  • ExcelFile.SetObjectText(Int32, String, TDrawingRichString)

ExcelFile.SetObjectText(Int32, String, String)

Sets the text for an autoshape. If the object does not accept text, this method will do nothing. This version of the method will only modify the text of the object, and preserve the existing formatting in the object if there was one.

Syntax

Namespace: FlexCel.Core

public abstract void SetObjectText(Int32 objectIndex, String objectPath, String text)

Parameters

<-> Parameter Type Description
objectIndex | Int32 | Index of the object (1-based)
objectPath String Index to the child object you want to change the text.
If it is a simple object, you can use String.Empty here, if not you need to get the ObjectPath from GetObjectProperties(Int32, Boolean)
If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"
text | String | Text you want to use. Use null to delete text from an AutoShape.

See also

  • ExcelFile

ExcelFile.SetObjectText(Int32, String, TRichString)

Sets the text for an autoshape. If the object does not accept text, this method will do nothing. This version of the method will only modify the rich string properties of the object text, and preserve those things not available in a TRichString like wordArt effects.

Syntax

Namespace: FlexCel.Core

public abstract void SetObjectText(Int32 objectIndex, String objectPath, TRichString text)

Parameters

<-> Parameter Type Description
objectIndex | Int32 | Index of the object (1-based)
objectPath String Index to the child object you want to change the text.
If it is a simple object, you can use String.Empty here, if not you need to get the ObjectPath from GetObjectProperties(Int32, Boolean)
If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"
text | TRichString | Text you want to use. Use null to delete text from an AutoShape.

See also

  • ExcelFile

ExcelFile.SetObjectText(Int32, String, TDrawingRichString)

Sets the text for an autoshape. If the object does not accept text, this method will do nothing.

Syntax

Namespace: FlexCel.Core

public abstract void SetObjectText(Int32 objectIndex, String objectPath, TDrawingRichString text)

Parameters

<-> Parameter Type Description
objectIndex | Int32 | Index of the object (1-based)
objectPath String Index to the child object you want to change the text.
If it is a simple object, you can use String.Empty here, if not you need to get the ObjectPath from GetObjectProperties(Int32, Boolean)
If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"
text | TDrawingRichString | Text you want to use. Use null to delete text from an AutoShape.

See also

  • ExcelFile


ExcelFile.SetObjectName Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.SetObjectName Method

Sets the name for an autoshape.

Syntax

Namespace: FlexCel.Core

public abstract void SetObjectName(Int32 objectIndex, String objectPath, String name)

Parameters

<-> Parameter Type Description
objectIndex | Int32 | Index of the object (1-based)
objectPath String Index to the child object you want to change the text.
If it is a simple object, you can use String.Empty here, if not you need to get the ObjectPath from GetObjectProperties(Int32, Boolean)
If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"
name | String | Name for the autoshape. Use null to remove the name from an AutoShape.

See also

  • ExcelFile


ExcelFile.SetObjectProperty Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.SetObjectProperty Method

Overloads

  • ExcelFile.SetObjectProperty(Int32, String, TShapeOption, String)
  • ExcelFile.SetObjectProperty(Int32, String, TShapeOption, Int64)
  • ExcelFile.SetObjectProperty(Int32, String, TShapeOption, Double)
  • ExcelFile.SetObjectProperty(Int32, String, TShapeOption, Boolean)
  • ExcelFile.SetObjectProperty(Int32, String, TShapeOption, TDrawingHyperlink)
  • ExcelFile.SetObjectProperty(Int32, String, TShapeOption, Int32, Boolean)

ExcelFile.SetObjectProperty(Int32, String, TShapeOption, String)

Sets a STRING property for an autoshape. Verify the property expects a STRING. This is an advanced method and should be used with care. For normal use, you should use one of the standard methods. (like SetObjectText)

Syntax

Namespace: FlexCel.Core

public abstract void SetObjectProperty(Int32 objectIndex, String objectPath, TShapeOption shapeProperty, String text)

Parameters

<-> Parameter Type Description
objectIndex | Int32 | Index of the object (1-based)
objectPath String Index to the child object you want to change the property.
If it is a simple object, you can use String.Empty here, if not you need to get the ObjectPath from GetObjectProperties(Int32, Boolean)
If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"
shapeProperty | TShapeOption | Property you want to change.
text | String | Text you want to use.

See also

  • ExcelFile

ExcelFile.SetObjectProperty(Int32, String, TShapeOption, Int64)

Sets a LONG property for an autoshape. Verify the property expects a LONG. This is an advanced method and should be used with care. For normal use, you should use one of the standard methods.

Syntax

Namespace: FlexCel.Core

public abstract void SetObjectProperty(Int32 objectIndex, String objectPath, TShapeOption shapeProperty, Int64 value)

Parameters

<-> Parameter Type Description
objectIndex | Int32 | Index of the object (1-based)
objectPath String Index to the child object you want to change the property.
If it is a simple object, you can use String.Empty here, if not you need to get the ObjectPath from GetObjectProperties(Int32, Boolean)
If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"
shapeProperty | TShapeOption | Property you want to change.
value | Int64 | Value you want to use.

See also

  • ExcelFile

ExcelFile.SetObjectProperty(Int32, String, TShapeOption, Double)

Sets a DOUBLE (Encoded as 16.16) property for an autoshape. Verify the property expects a DOUBLE. This is an advanced method and should be used with care. For normal use, you should use one of the standard methods.

Syntax

Namespace: FlexCel.Core

public abstract void SetObjectProperty(Int32 objectIndex, String objectPath, TShapeOption shapeProperty, Double value)

Parameters

<-> Parameter Type Description
objectIndex | Int32 | Index of the object (1-based)
objectPath String Index to the child object you want to change the property.
If it is a simple object, you can use String.Empty here, if not you need to get the ObjectPath from GetObjectProperties(Int32, Boolean)
If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"
shapeProperty | TShapeOption | Property you want to change.
value | Double | Value you want to use.

See also

  • ExcelFile

ExcelFile.SetObjectProperty(Int32, String, TShapeOption, Boolean)

Sets a BOOLEAN property for an autoshape. Verify the property expects a BOOLEAN. This is an advanced method and should be used with care. For normal use, you should use one of the standard methods.

Syntax

Namespace: FlexCel.Core

public abstract void SetObjectProperty(Int32 objectIndex, String objectPath, TShapeOption shapeProperty, Boolean value)

Parameters

<-> Parameter Type Description
objectIndex | Int32 | Index of the object (1-based)
objectPath String Index to the child object you want to change the property.
If it is a simple object, you can use String.Empty here, if not you need to get the ObjectPath from GetObjectProperties(Int32, Boolean)
If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"
shapeProperty | TShapeOption | Property you want to change.
value | Boolean | Value you want to use.

See also

  • ExcelFile

ExcelFile.SetObjectProperty(Int32, String, TShapeOption, TDrawingHyperlink)

Sets an Hyperlink property for an autoshape. Verify the property expects a Hyperlink, currently only TShapeOption.pihlShape expects hyperlinks. This is an advanced method and should be used with care. For normal use, you should use one of the standard methods.

Syntax

Namespace: FlexCel.Core

public abstract void SetObjectProperty(Int32 objectIndex, String objectPath, TShapeOption shapeProperty, TDrawingHyperlink value)

Parameters

<-> Parameter Type Description
objectIndex | Int32 | Index of the object (1-based)
objectPath String Index to the child object you want to change the property.
If it is a simple object, you can use String.Empty here, if not you need to get the ObjectPath from GetObjectProperties(Int32, Boolean)
If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"
shapeProperty | TShapeOption | Property you want to change. For hyperlinks it should be TShapeOption.pihlShape
value | TDrawingHyperlink | Value you want to use.

See also

  • ExcelFile

ExcelFile.SetObjectProperty(Int32, String, TShapeOption, Int32, Boolean)

Sets a BOOLEAN property for an autoshape. Verify the property expects a BOOLEAN.

This is an advanced method, you probably want to use SetObjectProperty(Int32, String, TShapeOption, Boolean) instead. This is an advanced method and should be used with care. For normal use, you should use one of the standard methods. Note that boolean properties are all stored in the same byte of the last property in the set.

Syntax

Namespace: FlexCel.Core

public abstract void SetObjectProperty(Int32 objectIndex, String objectPath, TShapeOption shapeProperty, Int32 positionInSet, Boolean value)

Parameters

<-> Parameter Type Description
objectIndex | Int32 | Index of the object (1-based)
objectPath String Index to the child object you want to change the property.
If it is a simple object, you can use String.Empty here, if not you need to get the ObjectPath from GetObjectProperties(Int32, Boolean)
If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"
shapeProperty | TShapeOption | Property you want to change. MAKE SURE it is the LAST property in the set.
positionInSet | Int32 | Boolean properties are grouped so all properties on one set are in only one value. So, the last bool property on the set is the first bit, and so on. ONLY THE LAST PROPERTY ON THE SET IS PRESENT.
value | Boolean | Value you want to use.

See also

  • ExcelFile


ExcelFile.SetObjectProperties Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.SetObjectProperties Method

Sets all the properties of the shape. This allows for more complete control than SetObjectProperty(Int32, String, TShapeOption, String) beause it can specify for example a xlsx fill using a theme color, instead of simple RGB fills.

Syntax

Namespace: FlexCel.Core

public abstract void SetObjectProperties(Int32 objectIndex, String objectPath, TShapeProperties shapeProperties, Boolean applyAnchor)

Parameters

<-> Parameter Type Description
objectIndex | Int32 | Index of the object (1-based)
objectPath String Index to the child object you want to change the property.
If it is a simple object, you can use String.Empty here, if not you need to get the ObjectPath from GetObjectProperties(Int32, Boolean)
If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"
shapeProperties | TShapeProperties | All the properties of the object. You will normally get this value from GetObjectProperties(Int32, Boolean) and then replace the values you want.
applyAnchor Boolean If true, the anchor of the shape properties will be copied too. If false, the anchor won't change.
False can be used when you want to copy the properties from one object to another, but keep the positions.

See also

  • ExcelFile


ExcelFile.AddAutoShape Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.AddAutoShape Method

Adds an autoshape to the sheet. You can add shapes to a worksheet, or to a chart sheet. For an example on how to add a shape, please create a shape in Excel, then open the file with APIMate and look at the generated code.

Syntax

Namespace: FlexCel.Core

public abstract Int32 AddAutoShape(TShapeProperties shapeProperties)

Parameters

<-> | Parameter | Type | Description
 | shapeProperties | TShapeProperties | Properties of the shape we want to add.

Returns

The object index of the new shape.

See also

  • ExcelFile


ExcelFile.DeleteObject Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.DeleteObject Method

Overloads

  • ExcelFile.DeleteObject(Int32)
  • ExcelFile.DeleteObject(Int32, String)

ExcelFile.DeleteObject(Int32)

Deletes the graphic object at objectIndex. Use it with care, there are some graphics objects you don't want to remove (like comment boxes when you don't delete the associated comment.)

Syntax

Namespace: FlexCel.Core

public void DeleteObject(Int32 objectIndex)

Parameters

<-> | Parameter | Type | Description
 | objectIndex | Int32 | Index of the object (1 based).

See also

  • ExcelFile

ExcelFile.DeleteObject(Int32, String)

Deletes the graphic object at objectIndex. Use it with care, there are some graphics objects you don't want to remove (like comment boxes when you don't delete the associated comment.)

Syntax

Namespace: FlexCel.Core

public abstract void DeleteObject(Int32 objectIndex, String objectPath)

Parameters

<-> Parameter Type Description
objectIndex Int32 Index of the object (1 based).
objectPath String Index to the child object you want to change the property.
If it is a simple object, you can use String.Empty here, if not you need to get the ObjectPath from GetObjectProperties(Int32, Boolean)
If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"

See also

  • ExcelFile


ExcelFile.GetObjectsInRange Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.GetObjectsInRange Method

Returns a list with all the objects that are completely inside a range of cells.

Syntax

Namespace: FlexCel.Core

public abstract void GetObjectsInRange(TXlsCellRange range, TExcelObjectList objectsInRange)

Parameters

<-> | Parameter | Type | Description
 | range | TXlsCellRange | Range of cells where we want to find the objects.
 | objectsInRange | TExcelObjectList | In this list we will add all the objects found. Note that the objects will be added to the list, so if you want just the objects in this range, make sure you clear the list before calling this method.

See also

  • ExcelFile


ExcelFile.GetObjectLinkedCell Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.GetObjectLinkedCell Method

Returns the cell that is linked to the object. If the object isn't an object that can be linked or it isn't linked, this method will return null. Note that when you change the value in the cell linked to this object, the value of the object will change.

The sheet returned in the TCellAddress might be null, in which case the reference is to a cell in the same sheet, or it might contain another sheet name.

Also note that this applies to form objects. To get the link of a shape like a circle or rectangle, use GetShapeLinkedCell instead.

Syntax

Namespace: FlexCel.Core

public abstract TCellAddress GetObjectLinkedCell(Int32 objectIndex, String objectPath)

Parameters

<-> Parameter Type Description
objectIndex Int32 Index of the object (1 based)
objectPath String Index to the child object you want to change the property.
If it is a simple object, you can use String.Empty here, if not you need to get the ObjectPath from GetObjectProperties(Int32, Boolean)
If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"

Returns

The cell address this object is linked to, or null if it isn't linked.

See also

  • ExcelFile


ExcelFile.SetObjectLinkedCell Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.SetObjectLinkedCell Method

Links the object to a cell, if the object can be linked. If the object is a radio button then all the other radio buttons in the group will be linked to the same cell, so when the cell changes the radio buttons too, and vice-versa. To unlink the cell, make linkedCell null.

Remarks

Note that when the object is a radio button, this affects all radio buttons in the same group, not just the first. Also this method applies only to "objects" from the "Developer" tab like a button or a radio button. For shapes, see SetShapeLinkedCell

Syntax

Namespace: FlexCel.Core

public abstract void SetObjectLinkedCell(Int32 objectIndex, String objectPath, TCellAddress linkedCell)

Parameters

<-> Parameter Type Description
objectIndex | Int32 | Index of the object (1 based)
objectPath String Index to the child object you want to change the property.
If it is a simple object, you can use String.Empty here, if not you need to get the ObjectPath from GetObjectProperties(Int32, Boolean)
If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"
linkedCell | TCellAddress | Cell that will be linked to the object. To unlink the object, make this parameter null.

See also

  • ExcelFile


ExcelFile.GetShapeLinkedCell Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.GetShapeLinkedCell Method

Returns the cell that is linked to the shape or image. If the object isn't linked, this method will return null. Note that when you change the value in the cell linked to this object, the value of the object will change. Also note that this method applies to shapes like a rectangle or circle, or an image. To get the link of a forms object like a combobox or a radiobutton use GetObjectLinkedCell instead.

Remarks

Images behave differently from shapes: A linked shape will change its text with the value of the cells. A linked image will change its image, to be an screenshot of the selected range. Finally, a linked object like a combobox you can get with GetObjectLinkedCell will modify the selected item depending on the linked cell.

Syntax

Namespace: FlexCel.Core

public abstract String GetShapeLinkedCell(Int32 objectIndex, String objectPath)

Parameters

<-> Parameter Type Description
objectIndex Int32 Index of the object (1 based)
objectPath String Index to the child object you want to change the property.
If it is a simple object, you can use String.Empty here, if not you need to get the ObjectPath from GetObjectProperties(Int32, Boolean)
If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"

Returns

The cell address or name which this shape is linked to, or null if it isn't linked.

See also

  • ExcelFile


ExcelFile.SetShapeLinkedCell Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.SetShapeLinkedCell Method

Links the shape or image to a cell, if the shape can be linked. To unlink the cell, make linkedCell null. Note that this method applies to shapes like a rectangle or circle, or images. To change the link of a forms object like a combobox or a radiobutton use SetObjectLinkedCell instead.

Remarks

Images behave differently from shapes: A linked shape will change its text with the value of the cells. A linked image will change its image, to be an screenshot of the selected range. Finally, a linked object like a combobox you can get with GetObjectLinkedCell will modify the selected item depending on the linked cell.

Syntax

Namespace: FlexCel.Core

public abstract void SetShapeLinkedCell(Int32 objectIndex, String objectPath, String linkedCell)

Parameters

<-> Parameter Type Description
objectIndex | Int32 | Index of the object (1 based)
objectPath String Index to the child object you want to change the property.
If it is a simple object, you can use String.Empty here, if not you need to get the ObjectPath from GetObjectProperties(Int32, Boolean)
If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"
linkedCell | String | Cell that will be linked to the shape. To unlink the shape, make this parameter null. Note that this can be a single cell like "A3", a simple rectangular range like A1:B4, or a name like "myName". You can't use a complex formula here like "A1&A2"

See also

  • ExcelFile


ExcelFile.GetObjectInputRange Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.GetObjectInputRange Method

Returns the input range for the object. If the object isn't a combobox or listbox, or it doesn't have an input range, this method will return null. Note that when you change the value in the cell linked to this object, the value of the object will change.

The sheet in the TCellAddresses returned might be null, in which case the reference is to a cell in the same sheet, or it might contain another sheet name.

Syntax

Namespace: FlexCel.Core

public abstract TCellAddressRange GetObjectInputRange(Int32 objectIndex, String objectPath)

Parameters

<-> Parameter Type Description
objectIndex Int32 Index of the object (1 based)
objectPath String Index to the child object you want to change the property.
If it is a simple object, you can use String.Empty here, if not you need to get the ObjectPath from GetObjectProperties(Int32, Boolean)
If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"

Returns

The input range, or null if the object doesn't have an input range.

See also

  • ExcelFile


ExcelFile.SetObjectInputRange Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.SetObjectInputRange Method

Sets the input range for a ListBox or a ComboBox. When applied to other objects, this method does nothing.

Syntax

Namespace: FlexCel.Core

public abstract void SetObjectInputRange(Int32 objectIndex, String objectPath, TCellAddressRange inputRange)

Parameters

<-> Parameter Type Description
objectIndex | Int32 | Index of the object (1 based)
objectPath String Index to the child object you want to change the property.
If it is a simple object, you can use String.Empty here, if not you need to get the ObjectPath from GetObjectProperties(Int32, Boolean)
If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"
inputRange | TCellAddressRange | Input range for the object.

See also

  • ExcelFile


ExcelFile.GetObjectMacro Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.GetObjectMacro Method

Returns the macro associated with an object, or null if there is no macro associated.

Syntax

Namespace: FlexCel.Core

public abstract String GetObjectMacro(Int32 objectIndex, String objectPath)

Parameters

<-> Parameter Type Description
objectIndex Int32 Index of the object (1 based)
objectPath String Index to the child object you want to change the property.
If it is a simple object, you can use String.Empty here, if not you need to get the ObjectPath from GetObjectProperties(Int32, Boolean)
If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"

Returns

The macro associated with the object, or null if there isn't any macro associated.

See also

  • ExcelFile


ExcelFile.SetObjectMacro Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.SetObjectMacro Method

Associates an object with a macro. While this will normally be used in buttons, you can associate macros to almost any object.

Syntax

Namespace: FlexCel.Core

public abstract void SetObjectMacro(Int32 objectIndex, String objectPath, String macro)

Parameters

<-> Parameter Type Description
objectIndex | Int32 | Index of the object (1 based)
objectPath String Index to the child object you want to change the property.
If it is a simple object, you can use String.Empty here, if not you need to get the ObjectPath from GetObjectProperties(Int32, Boolean)
If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"
macro | String | Macro that will be associated with the object. Look at ApiMate to know the exact name you have to enter here.

See also

  • ExcelFile


ExcelFile.GetCheckboxState Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.GetCheckboxState Method

Gets the value of a checkbox in the active sheet. Note that this only works for checkboxes added through the Forms toolbar. It won't return the values of ActiveX checkboxes.

Remarks

Note that if the checkbox is linked to a cell and you changed the cell value, this method will return the cell value.

Syntax

Namespace: FlexCel.Core

public abstract TCheckboxState GetCheckboxState(Int32 objectIndex, String objectPath)

Parameters

<-> Parameter Type Description
objectIndex Int32 Index of the object (1 based)
objectPath String Index to the child object you want to change the property.
If it is a simple object, you can use String.Empty here, if not you need to get the ObjectPath from GetObjectProperties(Int32, Boolean)
If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"

Returns

If the checkbox is checked or not.

Examples

To get all the checkboxes in the active sheet, you can use this code:

    XlsFile xls = new XlsFile("checkboxes.xls"); //Open the file we want to read.
    for (int i = 1; i <= xls.ObjectCount; i++) //Loop over all objects.
    {
        TShapeProperties shp = xls.GetObjectProperties(i, false);
        if (shp.ObjectType == TObjectType.CheckBox) //Is it a checkbox?
        {
            LogMessage(shp.Text + " :" + xls.GetCheckboxState(i, null).ToString()); //Log the state of the checkbox
        }
    }

See also

  • ExcelFile


ExcelFile.SetCheckboxState Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.SetCheckboxState Method

Sets the value of a checkbox in the active sheet. Note that this only works for checkboxes added through the Forms toolbar. It won't return the values of ActiveX checkboxes.

Remarks

If the checkbox is linked to a cell, this method will change both the checkbox and the cell.

Syntax

Namespace: FlexCel.Core

public abstract void SetCheckboxState(Int32 objectIndex, String objectPath, TCheckboxState value)

Parameters

<-> Parameter Type Description
objectIndex | Int32 | Index of the object (1 based)
objectPath String Index to the child object you want to change the property.
If it is a simple object, you can use String.Empty here, if not you need to get the ObjectPath from GetObjectProperties(Int32, Boolean)
If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"
value | TCheckboxState | Value to set.

Examples

To set a checkbox given its text, use the code:

    XlsFile xls = new XlsFile("checkboxes.xls");
    for (int i = 1; i <= xls.ObjectCount; i++)
    {
        TShapeProperties shp = xls.GetObjectProperties(i, false);
        if (shp.ObjectType == TObjectType.CheckBox && shp.Text == "MyText")
        {
            xls.SetCheckboxState(i, null, TCheckboxState.Checked);
        }
    }

To change a checkbox given its name instead of its text, replace shp.Text == "MyText" by shp.Name == "MyName" in the code above.

See also

  • ExcelFile


ExcelFile.GetCheckboxLinkedCell Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.GetCheckboxLinkedCell Method

Important

This Method is obsolete.

Use GetObjectLinkedCell instead.

OBSOLETE: Use GetObjectLinkedCell instead.

Returns the cell that is linked to the checkbox. If the object isn't a checkbox or it isn't linked, this method will return null. Note that when you change the value in the cell linked to this checkbox, the value of the checkbox will change.

The sheet returned in the TCellAddress might be null, in which case the reference is to a cell in the same sheet, or it might contain another sheet name.

Syntax

Namespace: FlexCel.Core

public abstract TCellAddress GetCheckboxLinkedCell(Int32 objectIndex, String objectPath)

Parameters

<-> Parameter Type Description
objectIndex Int32 Index of the object (1 based)
objectPath String Index to the child object you want to change the property.
If it is a simple object, you can use String.Empty here, if not you need to get the ObjectPath from GetObjectProperties(Int32, Boolean)
If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"

Returns

The cell address this checkbox is linked to, or null if it isn't linked.

See also

  • ExcelFile


ExcelFile.SetCheckboxLinkedCell Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.SetCheckboxLinkedCell Method

Important

This Method is obsolete.

Use SetObjectLinkedCell instead.

OBSOLETE: Use SetObjectLinkedCell instead.

Links the checkbox to a cell, so when the cell changes the checkbox changes too, and vice-versa. To unlink the cell, make linkedCell null.

Syntax

Namespace: FlexCel.Core

public abstract void SetCheckboxLinkedCell(Int32 objectIndex, String objectPath, TCellAddress linkedCell)

Parameters

<-> Parameter Type Description
objectIndex | Int32 | Index of the object (1 based)
objectPath String Index to the child object you want to change the property.
If it is a simple object, you can use String.Empty here, if not you need to get the ObjectPath from GetObjectProperties(Int32, Boolean)
If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"
linkedCell | TCellAddress | Cell that will be linked to the checkbox. To unlink the checkbox, make this parameter null.

See also

  • ExcelFile


ExcelFile.AddCheckbox Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.AddCheckbox Method

Overloads

  • ExcelFile.AddCheckbox(TClientAnchor, TRichString, TCheckboxState, TCellAddress)
  • ExcelFile.AddCheckbox(TClientAnchor, TRichString, TCheckboxState, TCellAddress, String)

ExcelFile.AddCheckbox(TClientAnchor, TRichString, TCheckboxState, TCellAddress)

Adds a checkbox to the active sheet.

Remarks

Excel supports 2 types of checkboxes: ActiveX and internal (In Excel you would add them from the "ActiveX" and "Forms" toolbars respectively) The checkboxes added by this method are of type internal. ActiveX checkboxes are not supported.

Syntax

Namespace: FlexCel.Core

public Int32 AddCheckbox(TClientAnchor anchor, TRichString text, TCheckboxState value, TCellAddress linkedCell)

Parameters

<-> | Parameter | Type | Description
 | anchor | TClientAnchor | Position for the checkbox.
 | text | TRichString | Text for the checkbox.
 | value | TCheckboxState | Value of the checkbox.
 | linkedCell | TCellAddress | Cell that will be linked to the checkbox. If you don't want to link the checkbox to a cell, make this parameter null.

Returns

Object Index of the inserted checkbox (1 based).

See also

  • ExcelFile

ExcelFile.AddCheckbox(TClientAnchor, TRichString, TCheckboxState, TCellAddress, String)

Adds a checkbox to the active sheet.

Remarks

Excel supports 2 types of checkboxes: ActiveX and internal (In Excel you would add them from the "ActiveX" and "Forms" toolbars respectively) The checkboxes added by this method are of type internal. ActiveX checkboxes are not supported.

Syntax

Namespace: FlexCel.Core

public abstract Int32 AddCheckbox(TClientAnchor anchor, TRichString text, TCheckboxState value, TCellAddress linkedCell, String name)

Parameters

<-> | Parameter | Type | Description
 | anchor | TClientAnchor | Position for the checkbox.
 | text | TRichString | Text for the checkbox.
 | value | TCheckboxState | Value of the checkbox.
 | linkedCell | TCellAddress | Cell that will be linked to the checkbox. If you don't want to link the checkbox to a cell, make this parameter null.
 | name | String | Name that will be given to the checkbox.

Returns

Object Index of the inserted checkbox (1 based).

See also

  • ExcelFile


ExcelFile.GetRadioButtonState Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.GetRadioButtonState Method

Gets if a radio button in the active sheet is selected or not. Note that this only works for radio buttons added through the Forms toolbar. It won't return the values of ActiveX radio buttons.

Remarks

Note that if the radio button is linked to a cell and you changed the cell value, this method will return the cell value.

Syntax

Namespace: FlexCel.Core

public abstract Boolean GetRadioButtonState(Int32 objectIndex, String objectPath)

Parameters

<-> Parameter Type Description
objectIndex Int32 Index of the object (1 based)
objectPath String Index to the child object you want to change the property.
If it is a simple object, you can use String.Empty here, if not you need to get the ObjectPath from GetObjectProperties(Int32, Boolean)
If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"

Returns

If the radio button is selected or not.

Examples

To get all the radio buttons in the active sheet, you can use this code:

    XlsFile xls = new XlsFile("radiobuttons.xls"); //Open the file we want to read.
    for (int i = 1; i <= xls.ObjectCount; i++) //Loop over all objects.
    {
        TShapeProperties shp = xls.GetObjectProperties(i, false);
        if (shp.ObjectType == TObjectType.OptionButton) //Is it a radio button?
        {
            LogMessage(shp.Text + " :" + xls.GetRadioButtonState(i, null).ToString()); //Log the state of the radio button.
        }
    }

See also

  • ExcelFile


ExcelFile.SetRadioButtonState Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.SetRadioButtonState Method

Sets the value of a radio button in the active sheet. Note that this only works for radio buttons added through the Forms toolbar. It won't return the values of ActiveX radio buttons

Remarks

If the radio button is linked to a cell, this method will change both the radio button and the cell.

Syntax

Namespace: FlexCel.Core

public abstract void SetRadioButtonState(Int32 objectIndex, String objectPath, Boolean selected)

Parameters

<-> Parameter Type Description
objectIndex Int32 Index of the object (1 based)
objectPath String Index to the child object you want to change the property.
If it is a simple object, you can use String.Empty here, if not you need to get the ObjectPath from GetObjectProperties(Int32, Boolean)
If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"
selected Boolean If true, the option button will be set, and all other buttons in the range will be deselected.
When false the radio button will be deselected.

Examples

To set a radio button given its text, use the code:

    XlsFile xls = new XlsFile("radiobuttons.xls");
    for (int i = 1; i <= xls.ObjectCount; i++)
    {
        TShapeProperties shp = xls.GetObjectProperties(i, false);
        if (shp.ObjectType == TObjectType.OptionButton && shp.Text == "MyText")
        {
            xls.SetRadioButtonState(i, null, true);
        }
    }

To change a radio button given its name instead of its text, replace shp.Text == "MyText" by shp.Name == "MyName" in the code above.

See also

  • ExcelFile


ExcelFile.AddRadioButton Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.AddRadioButton Method

Overloads

  • ExcelFile.AddRadioButton(TClientAnchor, TRichString)
  • ExcelFile.AddRadioButton(TClientAnchor, TRichString, String)

ExcelFile.AddRadioButton(TClientAnchor, TRichString)

Adds a radio button to the active sheet. Call AddGroupBox(TClientAnchor, TRichString) to insert a group box for grouping the radio buttons.

Remarks

Excel supports 2 types of radio buttons: ActiveX and internal (In Excel you would add them from the "ActiveX" and "Forms" toolbars respectively) The radio buttons added by this method are of type internal. ActiveX radio buttons are not supported.

Syntax

Namespace: FlexCel.Core

public Int32 AddRadioButton(TClientAnchor anchor, TRichString text)

Parameters

<-> | Parameter | Type | Description
 | anchor | TClientAnchor | Position for the radio button.
 | text | TRichString | Text for the radio button.

Returns

Object Index of the inserted radio button (1 based).

See also

  • ExcelFile

ExcelFile.AddRadioButton(TClientAnchor, TRichString, String)

Adds a radio button to the active sheet. Call AddGroupBox(TClientAnchor, TRichString) to insert a group box for grouping the radio buttons.

Remarks

Excel supports 2 types of radio buttons: ActiveX and internal (In Excel you would add them from the "ActiveX" and "Forms" toolbars respectively) The radio buttons added by this method are of type internal. ActiveX radio buttons are not supported.

Syntax

Namespace: FlexCel.Core

public abstract Int32 AddRadioButton(TClientAnchor anchor, TRichString text, String name)

Parameters

<-> | Parameter | Type | Description
 | anchor | TClientAnchor | Position for the radio button.
 | text | TRichString | Text for the radio button.
 | name | String | Name of the inserted radio button.

Returns

Object Index of the inserted radio button (1 based).

See also

  • ExcelFile


ExcelFile.AddGroupBox Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.AddGroupBox Method

Overloads

  • ExcelFile.AddGroupBox(TClientAnchor, TRichString)
  • ExcelFile.AddGroupBox(TClientAnchor, TRichString, String)

ExcelFile.AddGroupBox(TClientAnchor, TRichString)

Adds a Group box to the active sheet. Call AddRadioButton(TClientAnchor, TRichString) to insert radio buttons inside the group box.

Remarks

Excel determines if a radio button is inside a group box by looking at the coordinates of both objects. To include a radio button inside the group box, just make sure it is entirely inside the group box. Object hierarchy doesn't matter here, only the positions of the group box and the radio button.

Syntax

Namespace: FlexCel.Core

public Int32 AddGroupBox(TClientAnchor anchor, TRichString text)

Parameters

<-> | Parameter | Type | Description
 | anchor | TClientAnchor | Position for the group box.
 | text | TRichString | Text for the group box.

Returns

Object Index of the inserted group box (1 based).

See also

  • ExcelFile

ExcelFile.AddGroupBox(TClientAnchor, TRichString, String)

Adds a Group box to the active sheet. Call AddRadioButton(TClientAnchor, TRichString) to insert radio buttons inside the group box.

Remarks

Excel determines if a radio button is inside a group box by looking at the coordinates of both objects. To include a radio button inside the group box, just make sure it is entirely inside the group box. Object hierarchy doesn't matter here, only the positions of the group box and the radio button.

Syntax

Namespace: FlexCel.Core

public abstract Int32 AddGroupBox(TClientAnchor anchor, TRichString text, String name)

Parameters

<-> | Parameter | Type | Description
 | anchor | TClientAnchor | Position for the group box.
 | text | TRichString | Text for the group box.
 | name | String | Name for the inserted Group box

Returns

Object Index of the inserted group box (1 based).

See also

  • ExcelFile


ExcelFile.GetObjectSelection Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.GetObjectSelection Method

Gets the selected item in an object from the "Forms" palette. It can be a combobox or a listbox. 0 means no selection, 1 the first item in the list. Note that this only works for objects added through the Forms toolbar. It won't return the values of ActiveX objects.

Remarks

Note that if the object is linked to a cell and you changed the cell value, this method will return the cell value.

Syntax

Namespace: FlexCel.Core

public abstract Int32 GetObjectSelection(Int32 objectIndex, String objectPath)

Parameters

<-> Parameter Type Description
objectIndex Int32 Index of the object (1 based)
objectPath String Index to the child object you want to change the property.
If it is a simple object, you can use String.Empty here, if not you need to get the ObjectPath from GetObjectProperties(Int32, Boolean)
If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"

Returns

The position of the selected item in the object. 0 means no selection, 1 the first item is selected.

Examples

To get all the comboboxes in the active sheet, you can use this code:

    XlsFile xls = new XlsFile("comboboxes.xls"); //Open the file we want to read.
    for (int i = 1; i <= xls.ObjectCount; i++) //Loop over all objects.
    {
        TShapeProperties shp = xls.GetObjectProperties(i, false);
        if (shp.ObjectType == TObjectType.ComboBox) //Is it a combobox?
        {
            LogMessage(shp.Text + " :" + xls.GetObjectSelection(i, null).ToString()); //Log the state of the combobox
        }
    }

See also

  • ExcelFile


ExcelFile.SetObjectSelection Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.SetObjectSelection Method

Sets the selected item of an object from the "Forms" palette. It can be a combobox, a listbox, a spinbox or a scrollbar. Note that this only works for objects added through the Forms toolbar. It won't return the values of ActiveX objects.

Remarks

If the object is linked to a cell, this method will change both the object and the cell.

Syntax

Namespace: FlexCel.Core

public abstract void SetObjectSelection(Int32 objectIndex, String objectPath, Int32 selectedItem)

Parameters

<-> Parameter Type Description
objectIndex | Int32 | Index of the object (1 based)
objectPath String Index to the child object you want to change the property.
If it is a simple object, you can use String.Empty here, if not you need to get the ObjectPath from GetObjectProperties(Int32, Boolean)
If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"
selectedItem | Int32 | Position of the selected item in the object. 0 means no selection, 1 means that the first item is selected.

Examples

To set a combobox selection to be the 5th item, use the code:

    XlsFile xls = new XlsFile("comboboxes.xls");
    for (int i = 1; i <= xls.ObjectCount; i++)
    {
        TShapeProperties shp = xls.GetObjectProperties(i, false);
        if (shp.ObjectType == TObjectType.ComboBox && shp.Text == "MyText")
        {
            xls.SetObjectSelection(i, null, 5);
        }
    }

To change a combo given its name instead of its text, replace shp.Text == "MyText" by shp.Name == "MyName" in the code above.

See also

  • ExcelFile


ExcelFile.GetObjectSpinProperties Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.GetObjectSpinProperties Method

Returns maximum, minimum and increment in any control that has a spin or dropdown, like a listbox, combobox, spinner or scrollbar.

Syntax

Namespace: FlexCel.Core

public abstract TSpinProperties GetObjectSpinProperties(Int32 objectIndex, String objectPath)

Parameters

<-> Parameter Type Description
objectIndex Int32 Index of the object (1 based)
objectPath String Index to the child object you want to change the property.
If it is a simple object, you can use String.Empty here, if not you need to get the ObjectPath from GetObjectProperties(Int32, Boolean)
If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"

Returns

The spin properties.

See also

  • ExcelFile


ExcelFile.SetObjectSpinProperties Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.SetObjectSpinProperties Method

Sets the spin properties of an object. You should apply this only to scrollbars and spinners.

Syntax

Namespace: FlexCel.Core

public abstract void SetObjectSpinProperties(Int32 objectIndex, String objectPath, TSpinProperties spinProps)

Parameters

<-> Parameter Type Description
objectIndex | Int32 | Index of the object (1 based)
objectPath String Index to the child object you want to change the property.
If it is a simple object, you can use String.Empty here, if not you need to get the ObjectPath from GetObjectProperties(Int32, Boolean)
If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"
spinProps | TSpinProperties | Properties of the spinner.

See also

  • ExcelFile


ExcelFile.GetObjectSpinValue Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.GetObjectSpinValue Method

Returns the current selected value of a scrollbar.

Syntax

Namespace: FlexCel.Core

public abstract Int32 GetObjectSpinValue(Int32 objectIndex, String objectPath)

Parameters

<-> Parameter Type Description
objectIndex Int32 Index of the object (1 based)
objectPath String Index to the child object you want to change the property.
If it is a simple object, you can use String.Empty here, if not you need to get the ObjectPath from GetObjectProperties(Int32, Boolean)
If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"

Returns

The spin position.

See also

  • ExcelFile


ExcelFile.SetObjectSpinValue Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.SetObjectSpinValue Method

Sets the position in a scrollbar object. If the object is linked to a cell, the cell will be updated.

Syntax

Namespace: FlexCel.Core

public abstract void SetObjectSpinValue(Int32 objectIndex, String objectPath, Int32 value)

Parameters

<-> Parameter Type Description
objectIndex | Int32 | Index of the object (1 based)
objectPath String Index to the child object you want to change the property.
If it is a simple object, you can use String.Empty here, if not you need to get the ObjectPath from GetObjectProperties(Int32, Boolean)
If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"
value | Int32 | Position for the scrollbar.

See also

  • ExcelFile


ExcelFile.AddComboBox Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.AddComboBox Method

Adds a ComboBox to the active sheet.

Remarks

Excel supports 2 types of comboboxes: ActiveX and internal (In Excel you would add them from the "ActiveX" and "Forms" toolbars respectively) The comboboxes added by this method are of type internal. ActiveX comboboxes are not supported.

Syntax

Namespace: FlexCel.Core

public abstract Int32 AddComboBox(TClientAnchor anchor, String name, TCellAddress linkedCell, TCellAddressRange inputRange, Int32 selectedItem)

Parameters

<-> | Parameter | Type | Description
 | anchor | TClientAnchor | Position for the combobox.
 | name | String | Name of the inserted combobox.
 | linkedCell | TCellAddress | Cell that will be linked to the combobox. Set this to null to not link any cell.
 | inputRange | TCellAddressRange | Range of cells with the values that the combobox will display.
 | selectedItem | Int32 | Item that will be selected, starting at 1. 0 means no selected item.

Returns

Object Index of the inserted combobox (1 based).

See also

  • ExcelFile


ExcelFile.AddListBox Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.AddListBox Method

Adds a ListBox to the active sheet.

Remarks

Excel supports 2 types of listboxes: ActiveX and internal (In Excel you would add them from the "ActiveX" and "Forms" toolbars respectively) The listboxes added by this method are of type internal. ActiveX listboxes are not supported.

Syntax

Namespace: FlexCel.Core

public abstract Int32 AddListBox(TClientAnchor anchor, String name, TCellAddress linkedCell, TCellAddressRange inputRange, TListBoxSelectionType selectionType, Int32 selectedItem)

Parameters

<-> | Parameter | Type | Description
 | anchor | TClientAnchor | Position for the listbox.
 | name | String | Name of the inserted listbox.
 | linkedCell | TCellAddress | Cell that will be linked to the listbox. Set this to null to not link any cell.
 | inputRange | TCellAddressRange | Range of cells with the values that the listbox will display.
 | selectionType | TListBoxSelection​Type | How items are selected in the listbox.
 | selectedItem | Int32 | Item that will be selected, starting at 1. 0 means no selected item.

Returns

Object Index of the inserted listbox (1 based).

See also

  • ExcelFile


ExcelFile.AddButton Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.AddButton Method

Adds a button to the sheet, with the associated macro.

Syntax

Namespace: FlexCel.Core

public abstract Int32 AddButton(TClientAnchor anchor, TRichString text, String name, String macro)

Parameters

<-> | Parameter | Type | Description
 | anchor | TClientAnchor | Position for the button.
 | text | TRichString | Text that will be shown in the button.
 | name | String | Name for the inserted button.
 | macro | String | Macro associated with the button.

See also

  • ExcelFile


ExcelFile.AddLabel Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.AddLabel Method

Adds a Label to the active sheet.

Remarks

Excel supports 2 types of labels: ActiveX and internal (In Excel you would add them from the "ActiveX" and "Forms" toolbars respectively) The labels added by this method are of type internal. ActiveX labels are not supported.

Syntax

Namespace: FlexCel.Core

public abstract Int32 AddLabel(TClientAnchor anchor, TRichString text, String name)

Parameters

<-> | Parameter | Type | Description
 | anchor | TClientAnchor | Position for the label.
 | text | TRichString | Text for the label.
 | name | String | Name of the inserted label.

Returns

Object Index of the inserted listbox (1 based).

See also

  • ExcelFile


ExcelFile.AddSpinner Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.AddSpinner Method

Adds a Spinner to the active sheet.

Remarks

Excel supports 2 types of spinners: ActiveX and internal (In Excel you would add them from the "ActiveX" and "Forms" toolbars respectively) The spinners added by this method are of type internal. ActiveX spinners are not supported.

Syntax

Namespace: FlexCel.Core

public abstract Int32 AddSpinner(TClientAnchor anchor, String name, TCellAddress linkedCell, TSpinProperties spinProps)

Parameters

<-> | Parameter | Type | Description
 | anchor | TClientAnchor | Position for the spinner.
 | name | String | Name of the inserted spinner.
 | linkedCell | TCellAddress | Cell that will be linked to the spinner. Set this to null to not link any cell.
 | spinProps | TSpinProperties | Properties for the spinner.

Returns

Object Index of the inserted spinner (1 based).

See also

  • ExcelFile


ExcelFile.AddScrollBar Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.AddScrollBar Method

Adds a ScrollBar to the active sheet.

Remarks

Excel supports 2 types of ScrollBars: ActiveX and internal (In Excel you would add them from the "ActiveX" and "Forms" toolbars respectively) The ScrollBars added by this method are of type internal. ActiveX ScrollBars are not supported.

Syntax

Namespace: FlexCel.Core

public abstract Int32 AddScrollBar(TClientAnchor anchor, String name, TCellAddress linkedCell, TSpinProperties spinProps)

Parameters

<-> | Parameter | Type | Description
 | anchor | TClientAnchor | Position for the ScrollBar.
 | name | String | Name of the inserted ScrollBar.
 | linkedCell | TCellAddress | Cell that will be linked to the ScrollBar. Set this to null to not link any cell.
 | spinProps | TSpinProperties | Properties for the ScrollBar.

Returns

Object Index of the inserted ScrollBar (1 based).

See also

  • ExcelFile


ExcelFile.RenderObject Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.RenderObject Method

Overloads

  • ExcelFile.RenderObject(Int32)
  • ExcelFile.RenderObject(Int32, String)
  • ExcelFile.RenderObject(Int32, Double, TShapeProperties, TUISmoothingMode, TUIInterpolationMode, Boolean, Boolean, TPointF, TUIRectangle, TUISize)
  • ExcelFile.RenderObject(Int32, Double, TShapeProperties, TUISmoothingMode, TUIInterpolationMode, Boolean, Boolean, TUIColor, TPointF, TUIRectangle, TUISize)
  • ExcelFile.RenderObject(Int32, Double, TShapeProperties, TUISmoothingMode, TUIInterpolationMode, Boolean, Boolean, TUIColor, Double, TPointF, TUIRectangle, TUISize)

ExcelFile.RenderObject(Int32)

This method renders any object (chart, image, autoshape, etc) into an image, and returns it.

Background of the image will be transparent.

Syntax

Namespace: FlexCel.Core

public TUIImage RenderObject(Int32 objectIndex)

Parameters

<-> | Parameter | Type | Description
 | objectIndex | Int32 | Index of the object (1 based).

Returns

Might return null if the image is not visible.

See also

  • ExcelFile

ExcelFile.RenderObject(Int32, String)

This method renders any object (chart, image, autoshape, etc) into an image, and returns it.

Background of the image will be transparent.

Remarks

This method uses DpiForImages to determine the dpi of the returned image, and sets all other values in other overload of RenderObject to their defaults. If you need more control over the parameters passed to RenderObject, you can use any overload which takes a TShapeProperties parameter, and pass a shapeProperties from the object you want to render. While those overloads take an objectIndex and no objectPath, what is used for rendering is the shapeProperties. The objectIndex is only used to determine the position of the object in the z axis.

Syntax

Namespace: FlexCel.Core

public TUIImage RenderObject(Int32 objectIndex, String objectPath)

Parameters

<-> | Parameter | Type | Description
 | objectIndex | Int32 | Index of the object (1 based).
 | objectPath | String | Path to the object to render. Look at GetObjectProperties(Int32, String, Boolean) for a description of the possible values.

Returns

Might return null if the image is not visible.

Examples

To save the image of a chart named "my_pie_chart" to disk as a png image, you can use the code:

    using (TUIImage img = xls.RenderObject(-1, "@my_pie_chart"))
    {
        img.Save("myfilename.png", TXlsImgType.Png);
    }

See also

  • ExcelFile

ExcelFile.RenderObject(Int32, Double, TShapeProperties, TUISmoothingMode, TUIInterpolationMode, Boolean, Boolean, TPointF, TUIRectangle, TUISize)

This method renders any object (chart, image, autoshape, etc) into an image, and returns it.

Syntax

Namespace: FlexCel.Core

public TUIImage RenderObject(Int32 objectIndex, Double dpi, TShapeProperties shapeProperties, TUISmoothingMode aSmoothingMode, TUIInterpolationMode aInterpolationMode, Boolean antiAliased, Boolean returnImage, out TPointF origin, out TUIRectangle imageDimensions, out TUISize imageSizePixels)

Parameters

<-> | Parameter | Type | Description
 | objectIndex | Int32 | Index of the object (1 based). Note: This object index is not used to get the object to render, which is given by the shapeProperties parameter. The object index is only used to determine the z-order of the object. If shapeProperties refers to a grouped object, pass the object index of the main group here.
 | dpi | Double | Resolution of the image to create in dots per inch. If creating the image for a low-resolution screen, use 96 dpi.
 | shapeProperties | TShapeProperties | Properties of the shape you are about to render. You can get them by calling GetObjectProperties(Int32, Boolean).
 | aSmoothingMode | TUISmoothingMode | Smoothing mode used to render the object. For more information, see "System.Drawing.Drawing2D.SmoothingMode"
 | aInterpolationMode | TUIInterpolationMode | Interpolation mode used to render the object. For more information, see "System.Drawing.Drawing2D.InterpolationMode"
 | antiAliased | Boolean | If true text will be antialiased when rendering for example a chart.
 | returnImage | Boolean | If false, this method will return null. Use it if you need to know the image dimensions, but do not care about the real image since it is faster and uses less resources.
out | origin | TPointF | Top-left coordinates of the image in points. While this is normally the same as the image coordinates you get in the properties, if there is a shadow to the right or to the top it might change. Use it to properly position the image where you want it.
out | imageDimensions | TUIRectangle | Returns the image dimension of the rendered object in points. Note that this can be different from the image size reported by GetImageProperties(Int32) because shadows or rotation of the image. You can get the image size in pixels just by looking at the image returned.
out | imageSizePixels | TUISize | Size of the returned image in pixels. You only need to use this if returnImage is false, since the returned bitmap will be null. Otherwise, you can just read the bitmap size.

Returns

Might return null if the image is not visible.

See also

  • ExcelFile

ExcelFile.RenderObject(Int32, Double, TShapeProperties, TUISmoothingMode, TUIInterpolationMode, Boolean, Boolean, TUIColor, TPointF, TUIRectangle, TUISize)

This method renders any object (chart, image, autoshape, etc) into an image, and returns it.

Syntax

Namespace: FlexCel.Core

public TUIImage RenderObject(Int32 objectIndex, Double dpi, TShapeProperties shapeProperties, TUISmoothingMode aSmoothingMode, TUIInterpolationMode aInterpolationMode, Boolean antiAliased, Boolean returnImage, TUIColor BackgroundColor, out TPointF origin, out TUIRectangle imageDimensions, out TUISize imageSizePixels)

Parameters

<-> | Parameter | Type | Description
 | objectIndex | Int32 | Index of the object (1 based). Note: This object index is not used to get the object to render, which is given by the shapeProperties parameter. The object index is only used to determine the z-order of the object. If shapeProperties refers to a grouped object, pass the object index of the main group here.
 | dpi | Double | Resolution of the image to create in dots per inch. If creating the image for the screen, use 96 dpi.
 | shapeProperties | TShapeProperties | Properties of the shape you are about to render. You can get them by calling GetObjectProperties(Int32, Boolean).
 | aSmoothingMode | TUISmoothingMode | Smoothing mode used to render the object. For more information, see "System.Drawing.Drawing2D.SmoothingMode"
 | aInterpolationMode | TUIInterpolationMode | Interpolation mode used to render the object. For more information, see "System.Drawing.Drawing2D.InterpolationMode"
 | antiAliased | Boolean | If true text will be antialiased when rendering for example a chart.
 | returnImage | Boolean | If false, this method will return null. Use it if you need to know the image dimensions, but do not care about the real image since it is faster and uses less resources.
 | BackgroundColor | TUIColor | Color for the background of the image. For a transparent background, use TUIColor.Empty.
out | origin | TPointF | Top-left coordinates of the image in points. While this is normally the same as the image coordinates you get in the properties, if there is a shadow to the right or to the top it might change. Use it to properly position the image where you want it.
out | imageDimensions | TUIRectangle | Returns the image dimension of the rendered object in points. Note that this can be different from the image size reported by GetImageProperties(Int32) because shadows or rotation of the image. You can get the image size in pixels just by looking at the image returned.
out | imageSizePixels | TUISize | Size of the returned image in pixels. You only need to use this if returnImage is false, since the returned bitmap will be null. Otherwise, you can just read the bitmap size.

Returns

Might return null if the image is not visible.

See also

  • ExcelFile

ExcelFile.RenderObject(Int32, Double, TShapeProperties, TUISmoothingMode, TUIInterpolationMode, Boolean, Boolean, TUIColor, Double, TPointF, TUIRectangle, TUISize)

This method renders any object (chart, image, autoshape, etc) into an image, and returns it.

Syntax

Namespace: FlexCel.Core

public abstract TUIImage RenderObject(Int32 objectIndex, Double dpi, TShapeProperties shapeProperties, TUISmoothingMode aSmoothingMode, TUIInterpolationMode aInterpolationMode, Boolean antiAliased, Boolean returnImage, TUIColor BackgroundColor, Double aPageScale, out TPointF origin, out TUIRectangle imageDimensions, out TUISize imageSizePixels)

Parameters

<-> | Parameter | Type | Description
 | objectIndex | Int32 | Index of the object (1 based). Note: This object index is not used to get the object to render, which is given by the shapeProperties parameter. The object index is only used to determine the z-order of the object. If shapeProperties refers to a grouped object, pass the object index of the main group here.
 | dpi | Double | Resolution of the image to create in dots per inch. If creating the image for the screen, use 96 dpi.
 | shapeProperties | TShapeProperties | Properties of the shape you are about to render. You can get them by calling GetObjectProperties(Int32, Boolean).
 | aSmoothingMode | TUISmoothingMode | Smoothing mode used to render the object. For more information, see "System.Drawing.Drawing2D.SmoothingMode"
 | aInterpolationMode | TUIInterpolationMode | Interpolation mode used to render the object. For more information, see "System.Drawing.Drawing2D.InterpolationMode"
 | antiAliased | Boolean | If true text will be antialiased when rendering for example a chart.
 | returnImage | Boolean | If false, this method will return null. Use it if you need to know the image dimensions, but do not care about the real image since it is faster and uses less resources.
 | BackgroundColor | TUIColor | Color for the background of the image. For a transparent background, use TUIColor.Empty.
 | aPageScale | Double | Page scale. Use 1 for 100%
out | origin | TPointF | Top-left coordinates of the image in points. While this is normally the same as the image coordinates you get in the properties, if there is a shadow to the right or to the top it might change. Use it to properly position the image where you want it.
out | imageDimensions | TUIRectangle | Returns the image dimension of the rendered object in points. Note that this can be different from the image size reported by GetImageProperties(Int32) because shadows or rotation of the image. You can get the image size in pixels just by looking at the image returned.
out | imageSizePixels | TUISize | Size of the returned image in pixels. You only need to use this if returnImage is false, since the returned bitmap will be null. Otherwise, you can just read the bitmap size.

Returns

Might return null if the image is not visible.

See also

  • ExcelFile


ExcelFile.RenderCells Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.RenderCells Method

Overloads

  • ExcelFile.RenderCells(Int32, Int32, Int32, Int32, Boolean)
  • ExcelFile.RenderCells(Int32, Int32, Int32, Int32, Boolean, Double, TUISmoothingMode, TUIInterpolationMode, Boolean)
  • ExcelFile.RenderCells(Int32, Int32, Int32, Int32, Boolean, Double, TUISmoothingMode, TUIInterpolationMode, Boolean, Double)
  • ExcelFile.RenderCells(Int32, Int32, Int32, Int32, Boolean, Double, TUISmoothingMode, TUIInterpolationMode, Boolean, Double, Boolean, Boolean)

ExcelFile.RenderCells(Int32, Int32, Int32, Int32, Boolean)

This method renders a range of cells into an image, and returns it.

No objects will be drawn on the cells, you can use RenderObject(Int32) to draw those.

Important note: By default this method will only render the text inside the cell, not the borders or cell fills or anything else. If you want to export an xls file to images, you need to set the parameter "exportObjects" to true, or use FlexCelImgExport

Syntax

Namespace: FlexCel.Core

public TUIImage RenderCells(Int32 row1, Int32 col1, Int32 row2, Int32 col2, Boolean drawBackground)

Parameters

<-> | Parameter | Type | Description
 | row1 | Int32 | Index of the first row to render. (1 based).
 | col1 | Int32 | Index of the first column to render (1 based).
 | row2 | Int32 | Index of the last row to render. (1 based).
 | col2 | Int32 | Index of the last column to render (1 based).
 | drawBackground | Boolean | If true, the image will have a solid background with the color of the cells. If false, the image will have a transparent background.

Returns

An image with the rendered cells.

See also

  • ExcelFile

ExcelFile.RenderCells(Int32, Int32, Int32, Int32, Boolean, Double, TUISmoothingMode, TUIInterpolationMode, Boolean)

This method renders a range of cells into an image, and returns it.

No objects will be drawn on the cells, you can use RenderObject(Int32) to draw those.

Important note: By default this method will only render the text inside the cell, not the borders or cell fills or anything else. If you want to export an xls file to images, you need to set the parameter "exportObjects" to true, or use FlexCelImgExport

Syntax

Namespace: FlexCel.Core

public TUIImage RenderCells(Int32 row1, Int32 col1, Int32 row2, Int32 col2, Boolean drawBackground, Double dpi, TUISmoothingMode aSmoothingMode, TUIInterpolationMode aInterpolationMode, Boolean antiAliased)

Parameters

<-> | Parameter | Type | Description
 | row1 | Int32 | Index of the first row to render. (1 based).
 | col1 | Int32 | Index of the first column to render (1 based).
 | row2 | Int32 | Index of the last row to render. (1 based).
 | col2 | Int32 | Index of the last column to render (1 based).
 | drawBackground | Boolean | If true, the image will have a solid background with the color of the cells. If false, the image will have a transparent background.
 | dpi | Double | Resolution of the image to create in dots per inch. If creating the image for the screen, use 96 dpi.
 | aSmoothingMode | TUISmoothingMode | Smoothing mode used to render the object. For more information, see "System.Drawing.Drawing2D.SmoothingMode"
 | aInterpolationMode | TUIInterpolationMode | Interpolation mode used to render the object. For more information, see "System.Drawing.Drawing2D.InterpolationMode"
 | antiAliased | Boolean | If true text will be antialiased when rendering.

Returns

An image with the rendered cells.

See also

  • ExcelFile

ExcelFile.RenderCells(Int32, Int32, Int32, Int32, Boolean, Double, TUISmoothingMode, TUIInterpolationMode, Boolean, Double)

This method renders a range of cells into an image, and returns it.

No objects will be drawn on the cells, you can use RenderObject(Int32) to draw those.

Important note: By default this method will only render the text inside the cell, not the borders or cell fills or anything else. If you want to export an xls file to images, you need to set the parameter "exportObjects" to true, or use FlexCelImgExport

Syntax

Namespace: FlexCel.Core

public TUIImage RenderCells(Int32 row1, Int32 col1, Int32 row2, Int32 col2, Boolean drawBackground, Double dpi, TUISmoothingMode aSmoothingMode, TUIInterpolationMode aInterpolationMode, Boolean antiAliased, Double aPageScale)

Parameters

<-> | Parameter | Type | Description
 | row1 | Int32 | Index of the first row to render. (1 based).
 | col1 | Int32 | Index of the first column to render (1 based).
 | row2 | Int32 | Index of the last row to render. (1 based).
 | col2 | Int32 | Index of the last column to render (1 based).
 | drawBackground | Boolean | If true, the image will have a solid background with the color of the cells. If false, the image will have a transparent background.
 | dpi | Double | Resolution of the image to create in dots per inch. If creating the image for the screen, use 96 dpi.
 | aSmoothingMode | TUISmoothingMode | Smoothing mode used to render the object. For more information, see "System.Drawing.Drawing2D.SmoothingMode"
 | aInterpolationMode | TUIInterpolationMode | Interpolation mode used to render the object. For more information, see "System.Drawing.Drawing2D.InterpolationMode"
 | antiAliased | Boolean | If true text will be antialiased when rendering.
 | aPageScale | Double | Page scale. Use 1 for 100%

Returns

An image with the rendered cells.

See also

  • ExcelFile

ExcelFile.RenderCells(Int32, Int32, Int32, Int32, Boolean, Double, TUISmoothingMode, TUIInterpolationMode, Boolean, Double, Boolean, Boolean)

This method renders a range of cells into an image, and returns it.

No objects will be drawn on the cells, you can use RenderObject(Int32) to draw those.

Important note: By default this method will only render the text inside the cell, not the borders or cell fills or anything else. If you want to export an xls file to images, you need to set the parameter "exportObjects" to true, or use FlexCelImgExport

Syntax

Namespace: FlexCel.Core

public abstract TUIImage RenderCells(Int32 row1, Int32 col1, Int32 row2, Int32 col2, Boolean drawBackground, Double dpi, TUISmoothingMode aSmoothingMode, TUIInterpolationMode aInterpolationMode, Boolean antiAliased, Double aPageScale, Boolean forceBackgroundTransparent, Boolean exportObjects)

Parameters

<-> | Parameter | Type | Description
 | row1 | Int32 | Index of the first row to render. (1 based).
 | col1 | Int32 | Index of the first column to render (1 based).
 | row2 | Int32 | Index of the last row to render. (1 based).
 | col2 | Int32 | Index of the last column to render (1 based).
 | drawBackground | Boolean | If true, the image will have a solid background with the color of the cells. If false, the image will have a transparent background.
 | dpi | Double | Resolution of the image to create in dots per inch. If creating the image for the screen, use 96 dpi.
 | aSmoothingMode | TUISmoothingMode | Smoothing mode used to render the object. For more information, see "System.Drawing.Drawing2D.SmoothingMode"
 | aInterpolationMode | TUIInterpolationMode | Interpolation mode used to render the object. For more information, see "System.Drawing.Drawing2D.InterpolationMode"
 | antiAliased | Boolean | If true text will be antialiased when rendering.
 | aPageScale | Double | Page scale. Use 1 for 100%
 | forceBackgroundTransparent | Boolean | If true the background of the image will be transparent for the cells that don't have fill, even if drawBackground is true.
 | exportObjects | Boolean | If false, only the cells themselves will be rendered, with no borders, images, etc. If true, objects will be rendered too.

Returns

An image with the rendered cells.

See also

  • ExcelFile


ExcelFile.CellRangeDimensions Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.CellRangeDimensions Method

Returns the height and width that would be used by a range of cells (in Points, or 1/72 inches).

Syntax

Namespace: FlexCel.Core

public abstract TUIRectangle CellRangeDimensions(Int32 row1, Int32 col1, Int32 row2, Int32 col2, Boolean includeMargins)

Parameters

<-> | Parameter | Type | Description
 | row1 | Int32 | First row (1 based). If you use a value less or equal than 0 here, this method will return the full sheet dimensions.
 | col1 | Int32 | First column (1 based). If you use a value less or equal than 0 here, this method will return the full sheet dimensions.
 | row2 | Int32 | Last row (1 based). If you use a value less or equal than 0 here, this method will return the full sheet dimensions.
 | col2 | Int32 | Last column (1 based). If you use a value less or equal than 0 here, this method will return the full sheet dimensions.
 | includeMargins | Boolean | If true, the dimensions reported will include all margins in the sheet.

See also

  • ExcelFile


ExcelFile.RenderObjectAsSVG Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.RenderObjectAsSVG Method

Overloads

  • ExcelFile.RenderObjectAsSVG(Int32, String, String, Encoding)
  • ExcelFile.RenderObjectAsSVG(Stream, Int32, String, String, Encoding)
  • ExcelFile.RenderObjectAsSVG(Int32, String, String, String, Encoding)
  • ExcelFile.RenderObjectAsSVG(Stream, Int32, String, String, String, Encoding)
  • ExcelFile.RenderObjectAsSVG(Int32, TShapeProperties, TUIColor, TSVGExportType, String, String, String, IEnumerable<TSVGAttribute>, Encoding, TPointF, TUIRectangle)
  • ExcelFile.RenderObjectAsSVG(Stream, Int32, TShapeProperties, TUIColor, TSVGExportType, String, String, String, IEnumerable<TSVGAttribute>, Encoding, TPointF, TUIRectangle)
  • ExcelFile.RenderObjectAsSVG(Int32, Double, TShapeProperties, TUIColor, TSVGExportType, String, String, String, IEnumerable<TSVGAttribute>, Encoding, TPointF, TUIRectangle)
  • ExcelFile.RenderObjectAsSVG(Stream, Int32, Double, TShapeProperties, TUIColor, TSVGExportType, String, String, String, IEnumerable<TSVGAttribute>, Encoding, TPointF, TUIRectangle)
  • ExcelFile.RenderObjectAsSVG(Int32, Double, TShapeProperties, TUIColor, TSVGExportType, String, String, String, IEnumerable<TSVGAttribute>, Encoding, Boolean, TPointF, TUIRectangle)
  • ExcelFile.RenderObjectAsSVG(Stream, Int32, Double, TShapeProperties, TUIColor, TSVGExportType, String, String, String, IEnumerable<TSVGAttribute>, Encoding, Boolean, TPointF, TUIRectangle)

ExcelFile.RenderObjectAsSVG(Int32, String, String, Encoding)

This method renders any object (chart, image, autoshape, etc) into an SVG image, and returns the XML for the image.

Syntax

Namespace: FlexCel.Core

public String RenderObjectAsSVG(Int32 objectIndex, String title, String description, Encoding encoding)

Parameters

<-> | Parameter | Type | Description
 | objectIndex | Int32 | Index of the object (1 based).
 | title | String | Title for the image. It will be saved inside the SVG file.
 | description | String | Description for the image. It will be saved inside the SVG file.
 | encoding | Encoding | Encoding that will be declared for the xml file if ExportType is all. Note that the result string will always be UTF16 encoded, but if you want to save it to an UTF8 file, you will have to set encoding = utf8. Also note that this parameter is only used if the ExportType parameter is All. It only affects the xml declaration. If null, utf-8 will be used.

Returns

Might return null if the image is not visible.

See also

  • ExcelFile

ExcelFile.RenderObjectAsSVG(Stream, Int32, String, String, Encoding)

This method saves any object (chart, image, autoshape, etc) into an SVG image inside a stream.

Syntax

Namespace: FlexCel.Core

public void RenderObjectAsSVG(Stream resultStream, Int32 objectIndex, String title, String description, Encoding encoding)

Parameters

<-> | Parameter | Type | Description
 | resultStream | Stream | Stream where the file will be saved.
 | objectIndex | Int32 | Index of the object (1 based).
 | title | String | Title for the image. It will be saved inside the SVG file.
 | description | String | Description for the image. It will be saved inside the SVG file.
 | encoding | Encoding | Encoding that will be used for the xml. If null, utf-8 will be used.

See also

  • ExcelFile

ExcelFile.RenderObjectAsSVG(Int32, String, String, String, Encoding)

This method renders any object (chart, image, autoshape, etc) into an SVG image, and returns the XML for the image.

Remarks

This method sets some values in other overloads of RenderObjectasSVG to their defaults. If you need more control over the parameters passed to RenderObjectAsSVG, you can use any overload which takes a TShapeProperties parameter, and pass a shapeProperties from the object you want to render. While those overloads take an objectIndex and no objectPath, what is used for rendering is the shapeProperties. The objectIndex is only used to determine the position of the object in the z axis.

Syntax

Namespace: FlexCel.Core

public String RenderObjectAsSVG(Int32 objectIndex, String objectPath, String title, String description, Encoding encoding)

Parameters

<-> | Parameter | Type | Description
 | objectIndex | Int32 | Index of the object (1 based).
 | objectPath | String | Path to the object ot render. Look at GetObjectProperties(Int32, String, Boolean) for a description of the possible values.
 | title | String | Title for the image. It will be saved inside the SVG file.
 | description | String | Description for the image. It will be saved inside the SVG file.
 | encoding | Encoding | Encoding that will be declared for the xml file if ExportType is all. Note that the result string will always be UTF16 encoded, but if you want to save it to an UTF8 file, you will have to set encoding = utf8. Also note that this parameter is only used if the ExportType parameter is All. It only affects the xml declaration. If null, utf-8 will be used.

Returns

Might return null if the image is not visible.

Examples

To save the image of a chart named "my_pie_chart" to disk as an SVG image, you can use the code:

    var svg = xls.RenderObjectAsSVG(-1, "@my_pie_chart", "This is a chart", "This chart was rendered with RenderObjectAsSVG", Encoding.UTF8);
    {
        File.WriteAllText("myfilename.svg", svg);
    }

See also

  • ExcelFile

ExcelFile.RenderObjectAsSVG(Stream, Int32, String, String, String, Encoding)

This method saves any object (chart, image, autoshape, etc) into an SVG image inside a stream.

Remarks

This method sets some values in other overloads of RenderObjectasSVG to their defaults. If you need more control over the parameters passed to RenderObjectAsSVG, you can use any overload which takes a TShapeProperties parameter, and pass a shapeProperties from the object you want to render. While those overloads take an objectIndex and no objectPath, what is used for rendering is the shapeProperties. The objectIndex is only used to determine the position of the object in the z axis.

Syntax

Namespace: FlexCel.Core

public void RenderObjectAsSVG(Stream resultStream, Int32 objectIndex, String objectPath, String title, String description, Encoding encoding)

Parameters

<-> | Parameter | Type | Description
 | resultStream | Stream | Stream where the file will be saved.
 | objectIndex | Int32 | Index of the object (1 based).
 | objectPath | String | Path to the object to render. Look at GetObjectProperties(Int32, String, Boolean) for a description of the possible values.
 | title | String | Title for the image. It will be saved inside the SVG file.
 | description | String | Description for the image. It will be saved inside the SVG file.
 | encoding | Encoding | Encoding that will be used for the xml. If null, utf-8 will be used.

Examples

To save the image of a chart named "my_pie_chart" to disk as an SVG image, you can use the code:

    using (FileStream SvgStream = new FileStream("myfilename.svg", FileMode.Create))
    {
        xls.RenderObjectAsSVG(SvgStream, -1, "@my_pie_chart", "This is a chart", "This chart was rendered with RenderObjectAsSVG", Encoding.UTF8);
    }

See also

  • ExcelFile

ExcelFile.RenderObjectAsSVG(Int32, TShapeProperties, TUIColor, TSVGExportType, String, String, String, IEnumerable<TSVGAttribute>, Encoding, TPointF, TUIRectangle)

This method renders any object (chart, image, autoshape, etc) into an SVG image, and returns the XML for the image.

Syntax

Namespace: FlexCel.Core

public String RenderObjectAsSVG(Int32 objectIndex, TShapeProperties shapeProperties, TUIColor BackgroundColor, TSVGExportType exportType, String idPrefix, String title, String description, IEnumerable<TSVGAttribute> extraSVGAttributes, Encoding encoding, out TPointF origin, out TUIRectangle imageDimensions)

Parameters

<-> | Parameter | Type | Description
 | objectIndex | Int32 | Index of the object (1 based). Note: This object index is not used to get the object to render, which is given by the shapeProperties parameter. The object index is only used to determine the z-order of the object. If shapeProperties refers to a grouped object, pass the object index of the main group here.
 | shapeProperties | TShapeProperties | Properties of the shape you are about to render. You can get them by calling GetObjectProperties(Int32, Boolean).
 | BackgroundColor | TUIColor | Color for the background of the image. For a transparent background, use TUIColor.Empty.
 | exportType | TSVGExportType | How much of the SVG will be exported.
 | idPrefix | String | Prefix to be used in all definitions inside the svg file. For normal SVG files you can leave this null, but if you are embedding the files inside an html file, you need to ensure every image has unique identifiers. All SVG identifiers from different images inside an html file must be unique.
 | title | String | Title for the image. It will be saved inside the SVG file.
 | description | String | Description for the image. It will be saved inside the SVG file.
 | extraSVGAttributes | IEnumerable<TSVGAttribute> | Extra attributes to be added to the svg tag.
 | encoding | Encoding | Encoding that will be declared for the xml file if exportType is All. Note that the result string will always be UTF16 encoded, but if you want to save it to an UTF8 file, you will have to set encoding = utf8. Also note that this parameter is only used if the exportType parameter is All. It only affects the xml declaration. If null, utf-8 will be used.
out | origin | TPointF | Top-left coordinates of the image in points. While this is normally the same as the image coordinates you get in the properties, if there is a shadow to the right or to the top it might change. Use it to properly position the image where you want it.
out | imageDimensions | TUIRectangle | Returns the image dimension of the rendered object in points. Note that this can be different from the image size reported by GetImageProperties(Int32) because shadows or rotation of the image.

Returns

Might return null if the image is not visible.

See also

  • ExcelFile

ExcelFile.RenderObjectAsSVG(Stream, Int32, TShapeProperties, TUIColor, TSVGExportType, String, String, String, IEnumerable<TSVGAttribute>, Encoding, TPointF, TUIRectangle)

This method saves any object (chart, image, autoshape, etc) into an SVG image inside a stream.

Syntax

Namespace: FlexCel.Core

public void RenderObjectAsSVG(Stream resultStream, Int32 objectIndex, TShapeProperties shapeProperties, TUIColor BackgroundColor, TSVGExportType exportType, String idPrefix, String title, String description, IEnumerable<TSVGAttribute> extraSVGAttributes, Encoding encoding, out TPointF origin, out TUIRectangle imageDimensions)

Parameters

<-> | Parameter | Type | Description
 | resultStream | Stream | Stream where the data will be saved.
 | objectIndex | Int32 | Index of the object (1 based). Note: This object index is not used to get the object to render, which is given by the shapeProperties parameter. The object index is only used to determine the z-order of the object. If shapeProperties refers to a grouped object, pass the object index of the main group here.
 | shapeProperties | TShapeProperties | Properties of the shape you are about to render. You can get them by calling GetObjectProperties(Int32, Boolean).
 | BackgroundColor | TUIColor | Color for the background of the image. For a transparent background, use TUIColor.Empty.
 | exportType | TSVGExportType | How much of the SVG will be exported.
 | idPrefix | String | Prefix to be used in all definitions inside the svg file. For normal SVG files you can leave this null, but if you are embedding the files inside an html file, you need to ensure every image has unique identifiers. All SVG identifiers from different images inside an html file must be unique.
 | title | String | Title for the image. It will be saved inside the SVG file.
 | description | String | Description for the image. It will be saved inside the SVG file.
 | extraSVGAttributes | IEnumerable<TSVGAttribute> | Extra attributes to be added to the svg tag.
 | encoding | Encoding | Encoding that will be used for the xml. If null, utf-8 will be used.
out | origin | TPointF | Top-left coordinates of the image in points. While this is normally the same as the image coordinates you get in the properties, if there is a shadow to the right or to the top it might change. Use it to properly position the image where you want it.
out | imageDimensions | TUIRectangle | Returns the image dimension of the rendered object in points. Note that this can be different from the image size reported by GetImageProperties(Int32) because shadows or rotation of the image.

See also

  • ExcelFile

ExcelFile.RenderObjectAsSVG(Int32, Double, TShapeProperties, TUIColor, TSVGExportType, String, String, String, IEnumerable<TSVGAttribute>, Encoding, TPointF, TUIRectangle)

This method renders any object (chart, image, autoshape, etc) into an SVG image, and returns the XML for the image.

Syntax

Namespace: FlexCel.Core

public String RenderObjectAsSVG(Int32 objectIndex, Double aPageScale, TShapeProperties shapeProperties, TUIColor BackgroundColor, TSVGExportType exportType, String idPrefix, String title, String description, IEnumerable<TSVGAttribute> extraSVGAttributes, Encoding encoding, out TPointF origin, out TUIRectangle imageDimensions)

Parameters

<-> | Parameter | Type | Description
 | objectIndex | Int32 | Index of the object (1 based). Note: This object index is not used to get the object to render, which is given by the shapeProperties parameter. The object index is only used to determine the z-order of the object. If shapeProperties refers to a grouped object, pass the object index of the main group here.
 | aPageScale | Double | Page scale. Use 1 for 100%
 | shapeProperties | TShapeProperties | Properties of the shape you are about to render. You can get them by calling GetObjectProperties(Int32, Boolean).
 | BackgroundColor | TUIColor | Color for the background of the image. For a transparent background, use TUIColor.Empty.
 | exportType | TSVGExportType | How much of the SVG will be exported.
 | idPrefix | String | Prefix to be used in all definitions inside the svg file. For normal SVG files you can leave this null, but if you are embedding the files inside an html file, you need to ensure every image has unique identifiers. All SVG identifiers from different images inside an html file must be unique.
 | title | String | Title for the image. It will be saved inside the SVG file.
 | description | String | Description for the image. It will be saved inside the SVG file.
 | extraSVGAttributes | IEnumerable<TSVGAttribute> | Extra attributes to be added to the svg tag.
 | encoding | Encoding | Encoding that will be declared for the xml file if exportType is All. Note that the result string will always be UTF16 encoded, but if you want to save it to an UTF8 file, you will have to set encoding = utf8. Also note that this parameter is only used if the exportType parameter is All. It only affects the xml declaration. If null, utf-8 will be used.
out | origin | TPointF | Top-left coordinates of the image in points. While this is normally the same as the image coordinates you get in the properties, if there is a shadow to the right or to the top it might change. Use it to properly position the image where you want it.
out | imageDimensions | TUIRectangle | Returns the image dimension of the rendered object in points. Note that this can be different from the image size reported by GetImageProperties(Int32) because shadows or rotation of the image.

Returns

Might return null if the image is not visible.

See also

  • ExcelFile

ExcelFile.RenderObjectAsSVG(Stream, Int32, Double, TShapeProperties, TUIColor, TSVGExportType, String, String, String, IEnumerable<TSVGAttribute>, Encoding, TPointF, TUIRectangle)

This method saves any object (chart, image, autoshape, etc) into an SVG image inside a stream.

Syntax

Namespace: FlexCel.Core

public void RenderObjectAsSVG(Stream resultStream, Int32 objectIndex, Double aPageScale, TShapeProperties shapeProperties, TUIColor BackgroundColor, TSVGExportType exportType, String idPrefix, String title, String description, IEnumerable<TSVGAttribute> extraSVGAttributes, Encoding encoding, out TPointF origin, out TUIRectangle imageDimensions)

Parameters

<-> | Parameter | Type | Description
 | resultStream | Stream | Stream where the data will be saved.
 | objectIndex | Int32 | Index of the object (1 based). Note: This object index is not used to get the object to render, which is given by the shapeProperties parameter. The object index is only used to determine the z-order of the object. If shapeProperties refers to a grouped object, pass the object index of the main group here.
 | aPageScale | Double | Page scale. Use 1 for 100%
 | shapeProperties | TShapeProperties | Properties of the shape you are about to render. You can get them by calling GetObjectProperties(Int32, Boolean).
 | BackgroundColor | TUIColor | Color for the background of the image. For a transparent background, use TUIColor.Empty.
 | exportType | TSVGExportType | How much of the SVG will be exported.
 | idPrefix | String | Prefix to be used in all definitions inside the svg file. For normal SVG files you can leave this null, but if you are embedding the files inside an html file, you need to ensure every image has unique identifiers. All SVG identifiers from different images inside an html file must be unique.
 | title | String | Title for the image. It will be saved inside the SVG file.
 | description | String | Description for the image. It will be saved inside the SVG file.
 | extraSVGAttributes | IEnumerable<TSVGAttribute> | Extra attributes to be added to the svg tag.
 | encoding | Encoding | Encoding that will be used for the xml. If null, utf-8 will be used.
out | origin | TPointF | Top-left coordinates of the image in points. While this is normally the same as the image coordinates you get in the properties, if there is a shadow to the right or to the top it might change. Use it to properly position the image where you want it.
out | imageDimensions | TUIRectangle | Returns the image dimension of the rendered object in points. Note that this can be different from the image size reported by GetImageProperties(Int32) because shadows or rotation of the image.

See also

  • ExcelFile

ExcelFile.RenderObjectAsSVG(Int32, Double, TShapeProperties, TUIColor, TSVGExportType, String, String, String, IEnumerable<TSVGAttribute>, Encoding, Boolean, TPointF, TUIRectangle)

This method renders any object (chart, image, autoshape, etc) into an SVG image, and returns the XML for the image.

Syntax

Namespace: FlexCel.Core

public abstract String RenderObjectAsSVG(Int32 objectIndex, Double aPageScale, TShapeProperties shapeProperties, TUIColor BackgroundColor, TSVGExportType exportType, String idPrefix, String title, String description, IEnumerable<TSVGAttribute> extraSVGAttributes, Encoding encoding, Boolean rasterizeSVGImages, out TPointF origin, out TUIRectangle imageDimensions)

Parameters

<-> | Parameter | Type | Description
 | objectIndex | Int32 | Index of the object (1 based). Note: This object index is not used to get the object to render, which is given by the shapeProperties parameter. The object index is only used to determine the z-order of the object. If shapeProperties refers to a grouped object, pass the object index of the main group here.
 | aPageScale | Double | Page scale. Use 1 for 100%
 | shapeProperties | TShapeProperties | Properties of the shape you are about to render. You can get them by calling GetObjectProperties(Int32, Boolean).
 | BackgroundColor | TUIColor | Color for the background of the image. For a transparent background, use TUIColor.Empty.
 | exportType | TSVGExportType | How much of the SVG will be exported.
 | idPrefix | String | Prefix to be used in all definitions inside the svg file. For normal SVG files you can leave this null, but if you are embedding the files inside an html file, you need to ensure every image has unique identifiers. All SVG identifiers from different images inside an html file must be unique.
 | title | String | Title for the image. It will be saved inside the SVG file.
 | description | String | Description for the image. It will be saved inside the SVG file.
 | extraSVGAttributes | IEnumerable<TSVGAttribute> | Extra attributes to be added to the svg tag.
 | encoding | Encoding | Encoding that will be declared for the xml file if exportType is All. Note that the result string will always be UTF16 encoded, but if you want to save it to an UTF8 file, you will have to set encoding = utf8. Also note that this parameter is only used if the exportType parameter is All. It only affects the xml declaration. If null, utf-8 will be used.
 | rasterizeSVGImages | Boolean | If true, FlexCel will rasterize all SVG images in the Excel file to png before exporting them. See S V G Files Inside Xlsx Files for more information.
out | origin | TPointF | Top-left coordinates of the image in points. While this is normally the same as the image coordinates you get in the properties, if there is a shadow to the right or to the top it might change. Use it to properly position the image where you want it.
out | imageDimensions | TUIRectangle | Returns the image dimension of the rendered object in points. Note that this can be different from the image size reported by GetImageProperties(Int32) because shadows or rotation of the image.

Returns

Might return null if the image is not visible.

See also

  • ExcelFile

ExcelFile.RenderObjectAsSVG(Stream, Int32, Double, TShapeProperties, TUIColor, TSVGExportType, String, String, String, IEnumerable<TSVGAttribute>, Encoding, Boolean, TPointF, TUIRectangle)

This method saves any object (chart, image, autoshape, etc) into an SVG image inside a stream.

Syntax

Namespace: FlexCel.Core

public abstract void RenderObjectAsSVG(Stream resultStream, Int32 objectIndex, Double aPageScale, TShapeProperties shapeProperties, TUIColor BackgroundColor, TSVGExportType exportType, String idPrefix, String title, String description, IEnumerable<TSVGAttribute> extraSVGAttributes, Encoding encoding, Boolean rasterizeSVGImages, out TPointF origin, out TUIRectangle imageDimensions)

Parameters

<-> | Parameter | Type | Description
 | resultStream | Stream | Stream where the data will be saved.
 | objectIndex | Int32 | Index of the object (1 based). Note: This object index is not used to get the object to render, which is given by the shapeProperties parameter. The object index is only used to determine the z-order of the object. If shapeProperties refers to a grouped object, pass the object index of the main group here.
 | aPageScale | Double | Page scale. Use 1 for 100%
 | shapeProperties | TShapeProperties | Properties of the shape you are about to render. You can get them by calling GetObjectProperties(Int32, Boolean).
 | BackgroundColor | TUIColor | Color for the background of the image. For a transparent background, use TUIColor.Empty.
 | exportType | TSVGExportType | How much of the SVG will be exported.
 | idPrefix | String | Prefix to be used in all definitions inside the svg file. For normal SVG files you can leave this null, but if you are embedding the files inside an html file, you need to ensure every image has unique identifiers. All SVG identifiers from different images inside an html file must be unique.
 | title | String | Title for the image. It will be saved inside the SVG file.
 | description | String | Description for the image. It will be saved inside the SVG file.
 | extraSVGAttributes | IEnumerable<TSVGAttribute> | Extra attributes to be added to the svg tag.
 | encoding | Encoding | Encoding that will be used for the xml. If null, utf-8 will be used.
 | rasterizeSVGImages | Boolean | If true, FlexCel will rasterize all SVG images in the Excel file to png before exporting them. See S V G Files Inside Xlsx Files for more information.
out | origin | TPointF | Top-left coordinates of the image in points. While this is normally the same as the image coordinates you get in the properties, if there is a shadow to the right or to the top it might change. Use it to properly position the image where you want it.
out | imageDimensions | TUIRectangle | Returns the image dimension of the rendered object in points. Note that this can be different from the image size reported by GetImageProperties(Int32) because shadows or rotation of the image.

See also

  • ExcelFile


ExcelFile.SendToBack Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.SendToBack Method

Sends the graphical object to the bottom layer on the display (z-order) position. It will show below and will be covered by all other objects on the sheet.

Remarks

This will change the order of the array, so after calling SendToBack(i), position i will have a new object.

Syntax

Namespace: FlexCel.Core

public abstract void SendToBack(Int32 objectIndex)

Parameters

<-> | Parameter | Type | Description
 | objectIndex | Int32 | Index of the object to move. (1 based)

See also

  • ExcelFile
  • SendBack
  • SendForward
  • BringToFront


ExcelFile.BringToFront Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.BringToFront Method

Sends the graphical object to the top layer on the display (z-order) position. It will show above and will cover all other objects on the sheet.

Remarks

This will change the order of the array, so after calling BringToFront(i), position i will have a new object.

Syntax

Namespace: FlexCel.Core

public abstract void BringToFront(Int32 objectIndex)

Parameters

<-> | Parameter | Type | Description
 | objectIndex | Int32 | Index of the object to move. (1 based)

See also

  • ExcelFile
  • SendToBack
  • SendForward
  • SendBack


ExcelFile.SendForward Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.SendForward Method

Sends the graphical object one layer up on the display (z-order) position. It will show above and will cover the image at objectIndex+1.

Remarks

This will change the order of the array, so after calling SendForward(i), position i will have a new object. To move an object 2 steps down the correct code is:

    xls.SendForward(i);
    xls.SendForward(i + 1);

and not

    xls.SendForward(i);
    xls.SendForward(i);

The second code would actually leave the array unmodified.

Syntax

Namespace: FlexCel.Core

public abstract void SendForward(Int32 objectIndex)

Parameters

<-> | Parameter | Type | Description
 | objectIndex | Int32 | Index of the object to move. (1 based)

See also

  • ExcelFile
  • SendToBack
  • SendBack
  • BringToFront


ExcelFile.SendBack Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.SendBack Method

Sends the graphical object one layer down. It will show below and will be covered by image at objectIndex-1.

Remarks

This will change the order of the array, so after calling SendToBack(i), position i will have a new object. To move an object 2 steps down the correct code is:

    xls.SendBack(i);
    xls.SendBack(i - 1);

and not

    xls.SendBack(i);
    xls.SendBack(i);

The second code would actually leave the array unmodified.

Syntax

Namespace: FlexCel.Core

public abstract void SendBack(Int32 objectIndex)

Parameters

<-> | Parameter | Type | Description
 | objectIndex | Int32 | Index of the object to move. (1 based)

See also

  • ExcelFile
  • SendToBack
  • SendForward
  • BringToFront


ExcelFile.CommentRowCount Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.CommentRowCount Method

Maximum row index including comments.

Remarks

There are 2 groups of Comment related methods. One is used when you want to find out on a loop all existing comments on a range, and the other is used to get/set comments at a specified position (row and col). To loop among all existing comments, you can use CommentRowCount together with CommentCountRow. Do not confuse them, even when they have similar names. CommentRowCount returns the maximum row with a comment, and CommentCountRow returns the number of comments in a given row.

Syntax

Namespace: FlexCel.Core

public abstract Int32 CommentRowCount()

Examples

You can loop on all the comments on a sheet with the following code:

    for (int row = 1; row <= xls.CommentRowCount(); row++)
    {
        for (int commentIndex = 1; commentIndex <= xls.CommentCountRow(row); commentIndex++)
        {
            DoSomething(xls.GetCommentRow(row, commentIndex));
        }
    }

See also

  • ExcelFile
  • CommentCountRow
  • GetCommentRow
  • GetCommentRowCol
  • GetComment
  • SetCommentRow(Int32, Int32, String, TImageProperties)
  • SetComment(Int32, Int32, TRichString)
  • GetCommentPropertiesRow
  • SetCommentPropertiesRow
  • SetCommentProperties


ExcelFile.CommentCountRow Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.CommentCountRow Method

Number of comments on a given row.

Remarks

There are 2 groups of Comment related methods. One is used when you want to find out on a loop all existing comments on a range, and the other is used to get/set comments at a specified position (row and col). To loop among all existing comments, you can use CommentRowCount together with CommentCountRow. Do not confuse them, even when they have similar names. CommentRowCount returns the maximum row with a comment, and CommentCountRow returns the number of comments in a given row.

Syntax

Namespace: FlexCel.Core

public abstract Int32 CommentCountRow(Int32 row)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row index (1 based)

Returns

The number of comments on a given row.

Examples

You can loop on all the comments on a sheet with the following code:

    for (int row = 1; row <= xls.CommentRowCount(); row++)
    {
        for (int commentIndex = 1; commentIndex <= xls.CommentCountRow(row); commentIndex++)
        {
            DoSomething(xls.GetCommentRow(row, commentIndex));
        }
    }

See also

  • ExcelFile
  • CommentRowCount
  • GetCommentRow
  • GetCommentRowCol
  • GetComment
  • SetCommentRow(Int32, Int32, String, TImageProperties)
  • SetComment(Int32, Int32, TRichString)
  • GetCommentPropertiesRow
  • SetCommentPropertiesRow
  • SetCommentProperties


ExcelFile.GetCommentRow Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.GetCommentRow Method

Returns the comment at position commentIndex on the specified row.

Remarks

This method is used together with CommentCountRow. See the reference on it for an example.

Syntax

Namespace: FlexCel.Core

public abstract TRichString GetCommentRow(Int32 row, Int32 commentIndex)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row index (1 based)
 | commentIndex | Int32 | Comment index (1 based). See CommentCountRow

Returns

Comment at the specified position.

See also

  • ExcelFile
  • CommentRowCount
  • CommentCountRow
  • GetCommentRowCol
  • GetComment
  • SetCommentRow(Int32, Int32, String, TImageProperties)
  • SetComment(Int32, Int32, TRichString)
  • GetCommentPropertiesRow
  • SetCommentPropertiesRow
  • SetCommentProperties


ExcelFile.GetCommentRowCol Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.GetCommentRowCol Method

Returns the column for comment at position commentIndex

Remarks

This method is used together with CommentCountRow. See the reference on it for an example.

Syntax

Namespace: FlexCel.Core

public abstract Int32 GetCommentRowCol(Int32 row, Int32 commentIndex)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row with the comment. (1 based)
 | commentIndex | Int32 | Index of the comment (1 based)

Returns

The column index corresponding to the comment.

See also

  • ExcelFile
  • CommentRowCount
  • CommentCountRow
  • GetCommentRow
  • GetComment
  • SetCommentRow(Int32, Int32, String, TImageProperties)
  • SetComment(Int32, Int32, TRichString)
  • GetCommentPropertiesRow
  • SetCommentPropertiesRow
  • SetCommentProperties


ExcelFile.GetComment Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.GetComment Method

Returns the comment at the specified row and column, or an empty string if there is no comment on that cell.

Remarks

Use this method when you are searching for a comment on a fixed position. To loop along all comments on a sheet, see CommentRowCount

Syntax

Namespace: FlexCel.Core

public abstract TRichString GetComment(Int32 row, Int32 col)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row index (1 based)
 | col | Int32 | Column index (1 based)

Returns

The comment on the specified cell, String.Empty if there is no comment on it.

See also

  • ExcelFile
  • CommentRowCount
  • CommentCountRow
  • GetCommentRow
  • GetCommentRowCol
  • SetCommentRow(Int32, Int32, String, TImageProperties)
  • SetComment(Int32, Int32, TRichString)
  • GetCommentPropertiesRow
  • SetCommentPropertiesRow
  • SetCommentProperties


ExcelFile.SetCommentRow Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.SetCommentRow Method

Overloads

  • ExcelFile.SetCommentRow(Int32, Int32, TRichString, TImageProperties)
  • ExcelFile.SetCommentRow(Int32, Int32, String, TImageProperties)

ExcelFile.SetCommentRow(Int32, Int32, TRichString, TImageProperties)

Changes the properties (text and position of the popup) for an existing comment at commentIndex. To delete a comment, set a "new TRichString()" as the "value" param. To add a new comment, use SetComment(Int32, Int32, TRichString).

Remarks

This method is used together with CommentCountRow. See the reference on it for an example.

Syntax

Namespace: FlexCel.Core

public abstract void SetCommentRow(Int32 row, Int32 commentIndex, TRichString value, TImageProperties commentProperties)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row Index (1 based)
 | commentIndex | Int32 | Comment index (1 based)
 | value | TRichString | Text of the comment. Set it to "new TRichString()" to remove the comment.
 | commentProperties | TImageProperties | Properties of the popup.

See also

  • ExcelFile
  • CommentRowCount
  • CommentCountRow
  • GetCommentRow
  • GetCommentRowCol
  • GetComment
  • SetComment(Int32, Int32, TRichString)
  • GetCommentPropertiesRow
  • SetCommentPropertiesRow
  • SetCommentProperties

ExcelFile.SetCommentRow(Int32, Int32, String, TImageProperties)

Changes the properties (text and position of the popup) for an existing comment at commentIndex. To delete a comment, set a String.Empty as the "value" param. To add a new comment, use SetComment(Int32, Int32, TRichString).

Remarks

This method is used together with CommentCountRow. See the reference on it for an example.

Syntax

Namespace: FlexCel.Core

public void SetCommentRow(Int32 row, Int32 commentIndex, String value, TImageProperties commentProperties)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row Index (1 based)
 | commentIndex | Int32 | Comment index (1 based)
 | value | String | Text of the comment. Set it to String.Empty to remove the comment.
 | commentProperties | TImageProperties | Properties of the popup.

See also

  • ExcelFile
  • CommentRowCount
  • CommentCountRow
  • GetCommentRow
  • GetCommentRowCol
  • GetComment
  • SetComment(Int32, Int32, TRichString)
  • GetCommentPropertiesRow
  • SetCommentPropertiesRow
  • SetCommentProperties


ExcelFile.SetComment Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.SetComment Method

Overloads

  • ExcelFile.SetComment(Int32, Int32, String)
  • ExcelFile.SetComment(Int32, Int32, TRichString)
  • ExcelFile.SetComment(Int32, Int32, TRichString, String, TImageProperties)
  • ExcelFile.SetComment(Int32, Int32, String, String, TImageProperties)

ExcelFile.SetComment(Int32, Int32, String)

Sets or deletes a comment at the specified cell.

Remarks

To delete a comment, set its value to String.Empty.

Syntax

Namespace: FlexCel.Core

public void SetComment(Int32 row, Int32 col, String value)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row index (1 based)
 | col | Int32 | Column index (1 based)
 | value | String | Text of the comment. Set it to String.Empty to delete the comment.

See also

  • ExcelFile
  • CommentRowCount
  • CommentCountRow
  • GetCommentRow
  • GetCommentRowCol
  • GetComment
  • SetCommentRow(Int32, Int32, String, TImageProperties)
  • GetCommentPropertiesRow
  • SetCommentPropertiesRow
  • SetCommentProperties

ExcelFile.SetComment(Int32, Int32, TRichString)

Sets or deletes a comment at the specified cell.

Remarks

To delete a comment, set its value to String.Empty.

Syntax

Namespace: FlexCel.Core

public void SetComment(Int32 row, Int32 col, TRichString value)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row index (1 based)
 | col | Int32 | Column index (1 based)
 | value | TRichString | Text of the comment. Set it to String.Empty to delete the comment.

See also

  • ExcelFile
  • CommentRowCount
  • CommentCountRow
  • GetCommentRow
  • GetCommentRowCol
  • GetComment
  • SetCommentRow(Int32, Int32, String, TImageProperties)
  • GetCommentPropertiesRow
  • SetCommentPropertiesRow
  • SetCommentProperties

ExcelFile.SetComment(Int32, Int32, TRichString, String, TImageProperties)

Sets or deletes a comment at the specified cell.

Remarks

To delete a comment, set its value to String.Empty.

Syntax

Namespace: FlexCel.Core

public abstract void SetComment(Int32 row, Int32 col, TRichString value, String author, TImageProperties commentProperties)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row index (1 based)
 | col | Int32 | Column index (1 based)
 | value | TRichString | Text of the comment. Set it to String.Empty to delete the comment.
 | author | String | Author of the comment.
 | commentProperties | TImageProperties | Properties of the popup.

See also

  • ExcelFile
  • CommentRowCount
  • CommentCountRow
  • GetCommentRow
  • GetCommentRowCol
  • GetComment
  • SetCommentRow(Int32, Int32, String, TImageProperties)
  • GetCommentPropertiesRow
  • SetCommentPropertiesRow
  • SetCommentProperties

ExcelFile.SetComment(Int32, Int32, String, String, TImageProperties)

Sets or deletes a comment at the specified cell.

Remarks

To delete a comment, set its value to String.Empty.

Syntax

Namespace: FlexCel.Core

public void SetComment(Int32 row, Int32 col, String value, String author, TImageProperties commentProperties)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row index (1 based)
 | col | Int32 | Column index (1 based)
 | value | String | Text of the comment. Set it to String.Empty to delete the comment.
 | author | String | Author of the comment.
 | commentProperties | TImageProperties | Properties of the popup.

See also

  • ExcelFile
  • CommentRowCount
  • CommentCountRow
  • GetCommentRow
  • GetCommentRowCol
  • GetComment
  • SetCommentRow(Int32, Int32, String, TImageProperties)
  • GetCommentPropertiesRow
  • SetCommentPropertiesRow
  • SetCommentProperties


ExcelFile.GetCommentPropertiesRow Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.GetCommentPropertiesRow Method

Returns the comment properties for the popup at position commentIndex

Remarks

This method is used together with CommentCountRow. See the reference on it for an example.

Syntax

Namespace: FlexCel.Core

public abstract TCommentProperties GetCommentPropertiesRow(Int32 row, Int32 commentIndex)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row index (1 based)
 | commentIndex | Int32 | Comment index (1 based)

Returns

The comment properties.

See also

  • ExcelFile
  • CommentRowCount
  • CommentCountRow
  • GetCommentRow
  • GetCommentRowCol
  • GetComment
  • SetCommentRow(Int32, Int32, String, TImageProperties)
  • SetComment(Int32, Int32, TRichString)
  • GetCommentPropertiesRow
  • SetCommentPropertiesRow
  • SetCommentProperties


ExcelFile.GetCommentProperties Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.GetCommentProperties Method

Gets the popup placement for an existing comment. If there is not a comment on cell (row,col), this will return null.

Remarks

Note that you can change the size but not the placement of the popup. This placement you set here is the one you see when you right click the cell and choose "Show comment". The yellow popup box is placed automatically by excel.

Syntax

Namespace: FlexCel.Core

public abstract TCommentProperties GetCommentProperties(Int32 row, Int32 col)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row index (1 based).
 | col | Int32 | Column index (1 based)

Returns

Placement of the comment popup.

See also

  • ExcelFile
  • CommentRowCount
  • CommentCountRow
  • GetCommentRow
  • GetCommentRowCol
  • GetComment
  • SetCommentRow(Int32, Int32, String, TImageProperties)
  • SetComment(Int32, Int32, TRichString)
  • GetCommentPropertiesRow
  • SetCommentPropertiesRow
  • SetCommentProperties


ExcelFile.SetCommentPropertiesRow Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.SetCommentPropertiesRow Method

Sets the comment properties at the specified index.

Remarks

This method is used together with CommentCountRow. See the reference on it for an example.

Syntax

Namespace: FlexCel.Core

public abstract void SetCommentPropertiesRow(Int32 row, Int32 commentIndex, TImageProperties commentProperties)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row index (1 based)
 | commentIndex | Int32 | Comment index (1 based)
 | commentProperties | TImageProperties | Comment properties. This parameter can be a TImageProperties, or the more complete derived class TCommentProperties, if you need to set extra information like the text alignment.

See also

  • ExcelFile
  • CommentRowCount
  • CommentCountRow
  • GetCommentRow
  • GetCommentRowCol
  • GetComment
  • SetCommentRow(Int32, Int32, String, TImageProperties)
  • SetComment(Int32, Int32, TRichString)
  • GetCommentPropertiesRow
  • GetCommentProperties
  • SetCommentProperties


ExcelFile.SetCommentProperties Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.SetCommentProperties Method

Sets the popup placement for an existing comment. If there is not a comment on cell (row,col), this will create an empty one.

Remarks

Note that you can change the size but not the placement of the popup. This placement you set here is the one you see when you right click the cell and choose "Show comment". The yellow popup box is placed automatically by excel.

Syntax

Namespace: FlexCel.Core

public abstract void SetCommentProperties(Int32 row, Int32 col, TImageProperties commentProperties)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row index (1 based)
 | col | Int32 | Column index (1 based)
 | commentProperties | TImageProperties | Placement and properties of the comment popup. Null if there is no comment on the cell. This parameter can be a TImageProperties, or the more complete derived class TCommentProperties, if you need to set extra information like the text alignment.

See also

  • ExcelFile
  • CommentRowCount
  • CommentCountRow
  • GetCommentRow
  • GetCommentRowCol
  • GetComment
  • SetCommentRow(Int32, Int32, String, TImageProperties)
  • SetComment(Int32, Int32, TRichString)
  • GetCommentPropertiesRow
  • GetCommentProperties
  • SetCommentPropertiesRow


ExcelFile.LightClone Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.LightClone Method

Returns a copy of this ExcelFile object with the same backing data, so the cells in both objects are the same. Using a light clone allows you to read from a single ExcelFile in two different threads, since while the data is the same (so you don't use twice the memory as a real clone would), you can have separate activesheets in both. So one thread can be reading from the "original" file with ActiveSheet = 1, and the other thread could be reading from the light clone with activeSheet = 3.

Remarks

There is a difference between a light clone and the original object. When you set the ActiveSheet in the clone, it won't actually set the selected sheet in the physical file as setting it in the original will do. This is because the light clone is targeted at reading, and you don't want to change the actual file you are reading. While FlexCel is safe for more than one thread reading from the same object, it isn't for more than one thread writing to the same object. When modifying an XlsFile, you shouldn't use light clones, use them only for reading.

You can see if an object is a light clone or not by looking at the IsLightClone property.

Syntax

Namespace: FlexCel.Core

public abstract ExcelFile LightClone()

See also

  • ExcelFile


ExcelFile.InsertAndCopyRange Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.InsertAndCopyRange Method

Overloads

  • ExcelFile.InsertAndCopyRange(TXlsCellRange, Int32, Int32, Int32, TFlxInsertMode)
  • ExcelFile.InsertAndCopyRange(TXlsCellRange, Int32, Int32, Int32, TFlxInsertMode, TRangeCopyMode)
  • ExcelFile.InsertAndCopyRange(TXlsCellRange, Int32, Int32, Int32, TFlxInsertMode, TRangeCopyMode, ExcelFile, Int32)
  • ExcelFile.InsertAndCopyRange(TXlsCellRange, Int32, Int32, Int32, TFlxInsertMode, TRangeCopyMode, ExcelFile, Int32, TExcelObjectList)

ExcelFile.InsertAndCopyRange(TXlsCellRange, Int32, Int32, Int32, TFlxInsertMode)

Inserts and/or copies a range of cells from one place to another.

This method is one of the most important on FlexCel API, and it allows you to copy ranges of cells from one place to another, adapting the formulas, images and everything as Excel would do it.

Remarks

This overload is useful for inserting and copying in the same sheet.

Syntax

Namespace: FlexCel.Core

public void InsertAndCopyRange(TXlsCellRange sourceRange, Int32 destRow, Int32 destCol, Int32 destCount, TFlxInsertMode insertMode)

Parameters

<-> | Parameter | Type | Description
 | sourceRange | TXlsCellRange | The range of cells you want to copy. If you specify full rows, they will be copied with Row format information and size. If you copy just a part of a row, Row format will not be copied. The same applies to columns. The only way to copy all row and columns, is to specify the full (A:IV) range.
 | destRow | Int32 | Destination row where the cells will be copied.
 | destCol | Int32 | Destination column where the cells will be copied.
 | destCount | Int32 | Number of times the sourceRange will be copied at (desRow, destCol). If you make for example destCount=2, sourceRange will be copied 2 times at (destRow, destCol)
 | insertMode | TFlxInsertMode | How the cells on destination will be inserted. They can shift down or left. Specifying Row or Col as mode is equivalent to specify a sourceRange including full rows or columns respectively.

See also

  • ExcelFile

ExcelFile.InsertAndCopyRange(TXlsCellRange, Int32, Int32, Int32, TFlxInsertMode, TRangeCopyMode)

Inserts and/or copies a range of cells from one place to another.

This method is one of the most important on FlexCel API, and it allows you to copy ranges of cells from one place to another, adapting the formulas, images and everything as Excel would do it.

Remarks

This overload version is useful for inserting only and not copying.

Syntax

Namespace: FlexCel.Core

public void InsertAndCopyRange(TXlsCellRange sourceRange, Int32 destRow, Int32 destCol, Int32 destCount, TFlxInsertMode insertMode, TRangeCopyMode copyMode)

Parameters

<-> | Parameter | Type | Description
 | sourceRange | TXlsCellRange | The range of cells you want to copy. If you specify full rows, they will be copied with Row format information and size. If you copy just a part of a row, Row format will not be copied. The same applies to columns. The only way to copy all row and columns, is to specify the full (A:IV) range.
 | destRow | Int32 | Destination row where the cells will be copied.
 | destCol | Int32 | Destination column where the cells will be copied.
 | destCount | Int32 | Number of times the sourceRange will be copied at (desRow, destCol). If you make for example destCount=2, sourceRange will be copied 2 times at (destRow, destCol)
 | insertMode | TFlxInsertMode | How the cells on destination will be inserted. They can shift down or left. Specifying Row or Col as mode is equivalent to specify a sourceRange including full rows or columns respectively.
 | copyMode | TRangeCopyMode | Which cells on sourceRange will be copied. If you intend to replace values on the copied cells, you might specify OnlyFormulas. If you just want to insert cells and not copy, specify None.

See also

  • ExcelFile

ExcelFile.InsertAndCopyRange(TXlsCellRange, Int32, Int32, Int32, TFlxInsertMode, TRangeCopyMode, ExcelFile, Int32)

Inserts and/or copies a range of cells from one place to another.

This method is one of the most important on FlexCel API, and it allows you to copy ranges of cells from one place to another, adapting the formulas, images and everything as Excel would do it.

Remarks

This overload is useful for copying from another file. It is not as fast or complete as the other overloaded versions because it has to do a lot of transforms on the data. But it is very useful anyway.

Syntax

Namespace: FlexCel.Core

public void InsertAndCopyRange(TXlsCellRange sourceRange, Int32 destRow, Int32 destCol, Int32 destCount, TFlxInsertMode insertMode, TRangeCopyMode copyMode, ExcelFile sourceWorkbook, Int32 sourceSheet)

Parameters

<-> | Parameter | Type | Description
 | sourceRange | TXlsCellRange | The range of cells you want to copy. If you specify full rows, they will be copied with Row format information and size. If you copy just a part of a row, Row format will not be copied. The same applies to columns. The only way to copy all row and columns, is to specify the full (A:IV) range.
 | destRow | Int32 | Destination row where the cells will be copied.
 | destCol | Int32 | Destination column where the cells will be copied.
 | destCount | Int32 | Number of times the sourceRange will be copied at (desRow, destCol). If you make for example destCount=2, sourceRange will be copied 2 times at (destRow, destCol)
 | insertMode | TFlxInsertMode | How the cells on destination will be inserted. They can shift down or left. Specifying Row or Col as mode is equivalent to specify a sourceRange including full rows or columns respectively.
 | copyMode | TRangeCopyMode | Which cells on sourceRange will be copied. If you intend to replace values on the copied cells, you might specify OnlyFormulas. If you just want to insert cells and not copy, specify None.
 | sourceWorkbook | ExcelFile | Workbook from where we are copying the cells. This might be the same workbook, and you would by copying from another sheet.
 | sourceSheet | Int32 | Sheet index on the source workbook. If sourceWorkbook is the same instance as this, and sourceSheet is the active sheet on the instance, this method is equivalent to the simpler overloaded version.

See also

  • ExcelFile

ExcelFile.InsertAndCopyRange(TXlsCellRange, Int32, Int32, Int32, TFlxInsertMode, TRangeCopyMode, ExcelFile, Int32, TExcelObjectList)

Inserts and/or copies a range of cells from one place to another.

This method is one of the most important on FlexCel API, and it allows you to copy ranges of cells from one place to another, adapting the formulas, images and everything as Excel would do it.

Remarks

This overload is useful for copying from another file. It is not as fast or complete as the other overloaded versions because it has to do a lot of transforms on the data. But it is very useful anyway.

Syntax

Namespace: FlexCel.Core

public abstract void InsertAndCopyRange(TXlsCellRange sourceRange, Int32 destRow, Int32 destCol, Int32 destCount, TFlxInsertMode insertMode, TRangeCopyMode copyMode, ExcelFile sourceWorkbook, Int32 sourceSheet, TExcelObjectList ObjectsInRange)

Parameters

<-> | Parameter | Type | Description
 | sourceRange | TXlsCellRange | The range of cells you want to copy. If you specify full rows, they will be copied with Row format information and size. If you copy just a part of a row, Row format will not be copied. The same applies to columns. The only way to copy all row and columns, is to specify the full (A:IV) range.
 | destRow | Int32 | Destination row where the cells will be copied.
 | destCol | Int32 | Destination column where the cells will be copied.
 | destCount | Int32 | Number of times the sourceRange will be copied at (desRow, destCol). If you make for example destCount=2, sourceRange will be copied 2 times at (destRow, destCol)
 | insertMode | TFlxInsertMode | How the cells on destination will be inserted. They can shift down or left. Specifying Row or Col as mode is equivalent to specify a sourceRange including full rows or columns respectively.
 | copyMode | TRangeCopyMode | Which cells on sourceRange will be copied. If you intend to replace values on the copied cells, you might specify OnlyFormulas. If you just want to insert cells and not copy, specify None.
 | sourceWorkbook | ExcelFile | Workbook from where we are copying the cells. This might be the same workbook, and you would by copying from another sheet.
 | sourceSheet | Int32 | Sheet index on the source workbook. If sourceWorkbook is the same instance as this, and sourceSheet is the active sheet on the instance, this method is equivalent to the simpler overloaded version.
 | ObjectsInRange | TExcelObjectList | Returns the objects that are in the range to be copied. This is an optimization so you don't have to find those objects again. Set it to null to not return any objects

See also

  • ExcelFile


ExcelFile.DeleteRange Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.DeleteRange Method

Overloads

  • ExcelFile.DeleteRange(TXlsCellRange, TFlxInsertMode)
  • ExcelFile.DeleteRange(Int32, Int32, TXlsCellRange, TFlxInsertMode)
  • ExcelFile.DeleteRange(Int32, Int32, TXlsCellRange, TFlxInsertMode, Boolean)

ExcelFile.DeleteRange(TXlsCellRange, TFlxInsertMode)

Deletes a range of cells, and moves all cells below up or all cells to the right left, depending on the insert mode.

Syntax

Namespace: FlexCel.Core

public abstract void DeleteRange(TXlsCellRange cellRange, TFlxInsertMode insertMode)

Parameters

<-> | Parameter | Type | Description
 | cellRange | TXlsCellRange | Range of cells to delete.
 | insertMode | TFlxInsertMode | Mode of deletion. Note that Row and Col are equivalent to ShiftRight and ShiftDown with a cell range of full rows or cols respectively.

See also

  • ExcelFile

ExcelFile.DeleteRange(Int32, Int32, TXlsCellRange, TFlxInsertMode)

Deletes a range of cells, and moves all cells below up or all cells to the right left, depending on the insert mode.

Syntax

Namespace: FlexCel.Core

public void DeleteRange(Int32 sheet1, Int32 sheet2, TXlsCellRange cellRange, TFlxInsertMode insertMode)

Parameters

<-> | Parameter | Type | Description
 | sheet1 | Int32 | First sheet where to delete cells.
 | sheet2 | Int32 | Last sheet where to delete cells.
 | cellRange | TXlsCellRange | Range of cells to delete.
 | insertMode | TFlxInsertMode | Mode of deletion. Note that Row and Col are equivalent to ShiftRight and ShiftDown with a cell range of full rows or cols respectively.

See also

  • ExcelFile

ExcelFile.DeleteRange(Int32, Int32, TXlsCellRange, TFlxInsertMode, Boolean)

Deletes a range of cells, and moves all cells below up or all cells to the right left, depending on the insert mode.

Syntax

Namespace: FlexCel.Core

public abstract void DeleteRange(Int32 sheet1, Int32 sheet2, TXlsCellRange cellRange, TFlxInsertMode insertMode, Boolean removeFormats)

Parameters

<-> | Parameter | Type | Description
 | sheet1 | Int32 | First sheet where to delete cells.
 | sheet2 | Int32 | Last sheet where to delete cells.
 | cellRange | TXlsCellRange | Range of cells to delete.
 | insertMode | TFlxInsertMode | Mode of deletion. Note that Row and Col are equivalent to ShiftRight and ShiftDown with a cell range of full rows or cols respectively.
 | removeFormats | Boolean | If true, both formatting and data will be removed from the range, when clearing a range. This parameter has no effect if insertmode isn't one of the "none" options, because if it isn't the full range will move up or left.

See also

  • ExcelFile


ExcelFile.MoveRange Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.MoveRange Method

Overloads

  • ExcelFile.MoveRange(TXlsCellRange, Int32, Int32, TFlxInsertMode)
  • ExcelFile.MoveRange(TXlsCellRange, Int32, Int32, TFlxInsertMode, Boolean)

ExcelFile.MoveRange(TXlsCellRange, Int32, Int32, TFlxInsertMode)

Moves a range of cells, the same way Excel does it. All references pointing to the old range will be relocated to the new, and all existing references to the new range will be relocated to #ref.

Syntax

Namespace: FlexCel.Core

public void MoveRange(TXlsCellRange cellRange, Int32 newRow, Int32 newCol, TFlxInsertMode insertMode)

Parameters

<-> | Parameter | Type | Description
 | cellRange | TXlsCellRange | Range you want to move.
 | newRow | Int32 | Row where the range will be relocated.
 | newCol | Int32 | Column where the range will be relocated.
 | insertMode | TFlxInsertMode | This parameter switches between 2 different working modes: * Modes NoneDown and NoneRight are the same, and work the same way as when you drag a range of cells in Excel to a new location. Cells on the new range will be replaced by the old, and cells where the old range was located will be cleared(not deleted). No cells are inserted or deleted. * The other modes behave like when you select a range in Excel, cut it, and then right click and select "Insert Cut Cells...". The old range will be inserted where the new range goes, cells where the old range was will be deleted(not cleared). Using for example MoveRange(CellRange, newRow, newCol, TFlxInsertMode.ShiftRight) is equivalent to: 1) InsertAndCopyRange(CellRange, newRow, newCol, 1, TFlxInsertMode.ShiftRight, TRangeCopyMode.None); 2) MoveRange(CellRange, newRow, newCol, TFlxInsertMode.NoneRight); 3) DeleteRange(CellRange, TFlxInsertMode.ShiftRight);

See also

  • ExcelFile

ExcelFile.MoveRange(TXlsCellRange, Int32, Int32, TFlxInsertMode, Boolean)

Moves a range of cells, the same way Excel does it. All references pointing to the old range will be relocated to the new, and all existing references to the new range will be relocated to #ref.

Syntax

Namespace: FlexCel.Core

public abstract void MoveRange(TXlsCellRange cellRange, Int32 newRow, Int32 newCol, TFlxInsertMode insertMode, Boolean fixAllFormulas)

Parameters

<-> | Parameter | Type | Description
 | cellRange | TXlsCellRange | Range you want to move.
 | newRow | Int32 | Row where the range will be relocated.
 | newCol | Int32 | Column where the range will be relocated.
 | insertMode | TFlxInsertMode | This parameter switches between 2 different working modes: * Modes NoneDown and NoneRight are the same, and work the same way as when you drag a range of cells in Excel to a new location. Cells on the new range will be replaced by the old, and cells where the old range was located will be cleared(not deleted). No cells are inserted or deleted. * The other modes behave like when you select a range in Excel, cut it, and then right click and select "Insert Cut Cells...". The old range will be inserted where the new range goes, cells where the old range was will be deleted(not cleared). Using for example MoveRange(CellRange, newRow, newCol, TFlxInsertMode.ShiftRight) is equivalent to: 1) InsertAndCopyRange(CellRange, newRow, newCol, 1, TFlxInsertMode.ShiftRight, TRangeCopyMode.None); 2) MoveRange(CellRange, newRow, newCol, TFlxInsertMode.NoneRight); 3) DeleteRange(CellRange, TFlxInsertMode.ShiftRight);
 | fixAllFormulas | Boolean | If true (the default) FlexCel will correctly adapt all the references in all formulas everywhere. If false only the formulas being moved will be changed. The results with this parameter = false are incorrect if you have formulas pointing to the range moved, but is faster if you know no formulas point to cells inside the range moved. You should normally keep this parameter = true. FlexCel uses it false to emulate the way Excel sorts (which is wrong).

See also

  • ExcelFile


ExcelFile.ClearDataValidation Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.ClearDataValidation Method

Overloads

  • ExcelFile.ClearDataValidation
  • ExcelFile.ClearDataValidation(TXlsCellRange)

ExcelFile.ClearDataValidation

Clears all data validation entries in the active sheet.

Syntax

Namespace: FlexCel.Core

public abstract void ClearDataValidation()

See also

  • ExcelFile

ExcelFile.ClearDataValidation(TXlsCellRange)

Clears all data validation entries inside the specified range.

Syntax

Namespace: FlexCel.Core

public abstract void ClearDataValidation(TXlsCellRange range)

Parameters

<-> | Parameter | Type | Description
 | range | TXlsCellRange | Range of cells where data validation will be cleared.

See also

  • ExcelFile


ExcelFile.AddDataValidation Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.AddDataValidation Method

Adds a new Data Validation to a specified range.

Syntax

Namespace: FlexCel.Core

public abstract void AddDataValidation(TXlsCellRange range, TDataValidationInfo validationInfo)

Parameters

<-> | Parameter | Type | Description
 | range | TXlsCellRange | Range of cells where we will apply the Data Validation.
 | validationInfo | TDataValidationInfo | Validation information.

See also

  • ExcelFile


ExcelFile.GetDataValidation Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.GetDataValidation Method

Overloads

  • ExcelFile.GetDataValidation(Int32, Int32)
  • ExcelFile.GetDataValidation(Int32, Int32, TXlsCellRange)

ExcelFile.GetDataValidation(Int32, Int32)

Returns the validation information for a specific cell. If the cell has no Data Validation associated, this method returns null.

Syntax

Namespace: FlexCel.Core

public TDataValidationInfo GetDataValidation(Int32 row, Int32 col)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row of the cell (1 based)
 | col | Int32 | Column of the cell (1 based)

Returns

The data validation for a cell, or null if the cell has no Data Validation associated.

See also

  • ExcelFile

ExcelFile.GetDataValidation(Int32, Int32, TXlsCellRange)

Returns the validation information for a specific cell. If the cell has no Data Validation associated, this method returns null.

Syntax

Namespace: FlexCel.Core

public abstract TDataValidationInfo GetDataValidation(Int32 row, Int32 col, out TXlsCellRange dvRange)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row of the cell (1 based)
 | col | Int32 | Column of the cell (1 based)
out | dvRange | TXlsCellRange | Range of cells where the data validation is applied.

Returns

The data validation for a cell, or null if the cell has no Data Validation associated.

See also

  • ExcelFile


ExcelFile.GetDataValidationInfo Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.GetDataValidationInfo Method

Returns the data validation information for an entry of the index. There are 2 ways you can access the data validation information on a sheet:

  1. If you know the row and column where you want to look, you can use GetDataValidation(Int32, Int32) to return the data validation in the cell.
  2. If you want to find out all data validation structures in the sheet, you can use DataValidationCount, GetDataValidationInfo and GetDataValidationRanges to loop over all existing data validations.

Syntax

Namespace: FlexCel.Core

public abstract TDataValidationInfo GetDataValidationInfo(Int32 index)

Parameters

<-> | Parameter | Type | Description
 | index | Int32 | Position in the list of data validations. (1 based)

Returns

Data validation information.

See also

  • ExcelFile


ExcelFile.GetDataValidationRanges Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.GetDataValidationRanges Method

Returns a list of ranges for which a data validation definition applies. There are 2 ways you can access the data validation information on a sheet:

  1. If you know the row and column where you want to look, you can use GetDataValidation(Int32, Int32) to return the data validation in the cell.
  2. If you want to find out all data validation structures in the sheet, you can use DataValidationCount, GetDataValidationInfo and GetDataValidationRanges to loop over all existing data validations.

Syntax

Namespace: FlexCel.Core

public abstract TXlsCellRange[] GetDataValidationRanges(Int32 index)

Parameters

<-> | Parameter | Type | Description
 | index | Int32 | Position in the list of data validations. (1 based)

Returns

A list of cell ranges.

See also

  • ExcelFile


ExcelFile.CheckDataValidation Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.CheckDataValidation Method

Overloads

  • ExcelFile.CheckDataValidation(Int32, Int32)
  • ExcelFile.CheckDataValidation(Int32, Int32, Object, Boolean)

ExcelFile.CheckDataValidation(Int32, Int32)

Checks if the data in the cells where the data validation applies conforms to the data validation specifications.

Syntax

Namespace: FlexCel.Core

public abstract TCellAddress[] CheckDataValidation(Int32 index, Int32 maxErrors)

Parameters

<-> | Parameter | Type | Description
 | index | Int32 | Position in the list of data validations. (1 based)
 | maxErrors | Int32 | The maximum number of errors reported by this method. To avoid getting a too big list, set it to a number like 100. If set to 0 or a negative number, the full list of errors will be returned, which can be very big.

Returns

An array with the first maxErrors cells that do not conform to the data validation. And empty array if all the cells conform.

See also

  • ExcelFile

ExcelFile.CheckDataValidation(Int32, Int32, Object, Boolean)

Returns -1 if the value complies with all the data validations at the cell in row, col, or the position of the data validation that causes the error if the value is not valid. The position returned is 1 based, and you can use GetDataValidationInfo to get all information of the data validation.

When the parameter setIsValid is true and the data is valid, then this will also set the cell to value.

Syntax

Namespace: FlexCel.Core

public abstract Int32 CheckDataValidation(Int32 row, Int32 col, Object value, Boolean setIfValid)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row for the cell where we would like to enter the value. (1 based)
 | col | Int32 | Column for the cell where we would like to enter the value. (1 based)
 | value | Object | Value that we want to check if valid.
 | setIfValid | Boolean | When true, the we will also set the cell value if the condition is valid. When false, we will only check if the value is valid, but keep the old value on the cell.

Returns

-1 if the value is valid for the cell according with the data validations on it, the position of the data validation causing the error otherwise. The position returned is 1 based, and you can use GetDataValidationInfo to get all information of the data validation.

Examples

To set a value in a cell if valid, and if not show the error associated to this data validation, you could use code like:

    var xls = new XlsFile(sourceFileName, true);
    xls.ActiveSheetByName = "Sheet With Data";

    //We will try to enter the number 11 at cell (row, col).
    int dv = xls.CheckDataValidation(row, col, 11, true);

    if (dv > 0) //There was an error. The cell value is not modified
    {
        TDataValidationInfo dvInfo = xls.GetDataValidationInfo(dv);
        LogMessage(dvInfo.ErrorBoxText);
    }

See also

  • ExcelFile


ExcelFile.CheckDataValidationsInSheet Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.CheckDataValidationsInSheet Method

Checks if all the cells in the active sheet inside data validations have values that are valid according to the data validation specifications.

Syntax

Namespace: FlexCel.Core

public abstract TCellAddress[] CheckDataValidationsInSheet(Int32 sheet, Int32 maxErrors)

Parameters

<-> | Parameter | Type | Description
 | sheet | Int32 | Sheet to check (1 based)
 | maxErrors | Int32 | The maximum number of errors reported by this method. To avoid getting a too big list, set it to a number like 100. If set to 0 or a negative number, the full list of errors will be returned, which can be very big.

Returns

An array with the first maxErrors cells that do not conform to the data validation. And empty array if all the cells conform.

See also

  • ExcelFile


ExcelFile.CheckDataValidationsInWorkbook Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.CheckDataValidationsInWorkbook Method

Checks if all the cells in the file inside data validations have values that are valid according to the data validation specifications.

Syntax

Namespace: FlexCel.Core

public abstract TCellAddress[] CheckDataValidationsInWorkbook(Int32 maxErrors)

Parameters

<-> | Parameter | Type | Description
 | maxErrors | Int32 | The maximum number of errors reported by this method. To avoid getting a too big list, set it to a number like 100. If set to 0 or a negative number, the full list of errors will be returned, which can be very big.

Returns

An array with the first maxErrors cells that do not conform to the data validation. And empty array if all the cells conform.

Examples

The following code will mark in red all the cells in a file which don't comply with the data validations and save the file with a different name:

    static void CheckDataValidationsInWorkbook(string sourceFileName, string targetFileName)
    {
        var xls = new XlsFile(sourceFileName, true);
        var cellsWithErrors = xls.CheckDataValidationsInWorkbook(0);

        var fmt = xls.GetStyle(xls.GetBuiltInStyleName(TBuiltInStyle.Bad, 0), true);
        int xf = xls.AddFormat(fmt);

        for (int i = 0; i < cellsWithErrors.Length; i++)
        {
            xls.ActiveSheetByName = cellsWithErrors[i].Sheet;
            xls.SetCellFormat(cellsWithErrors[i].Row, cellsWithErrors[i].Col, xf);
        }
        xls.Save(targetFileName);

    }

See also

  • ExcelFile


ExcelFile.GetHyperLink Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.GetHyperLink Method

Returns the hyperlink at position index on the list.

Syntax

Namespace: FlexCel.Core

public abstract THyperLink GetHyperLink(Int32 hyperLinkIndex)

Parameters

<-> | Parameter | Type | Description
 | hyperLinkIndex | Int32 | Index of the hyperlink (1 based).

Returns

Hyperlink description.

See also

  • ExcelFile


ExcelFile.SetHyperLink Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.SetHyperLink Method

Modifies an existing Hyperlink. Use AddHyperLink to add a new one.

Syntax

Namespace: FlexCel.Core

public abstract void SetHyperLink(Int32 hyperLinkIndex, THyperLink value)

Parameters

<-> | Parameter | Type | Description
 | hyperLinkIndex | Int32 | Index of the hyperlink (1 based).
 | value | THyperLink | Hyperlink description.

See also

  • ExcelFile


ExcelFile.GetHyperLinkCellRange Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.GetHyperLinkCellRange Method

Returns the cell range a hyperlink refers to.

Remarks

While normally hyperlinks refer to a single cell, you can make them point to a range. This method will return the first and last cell of the range that the hyperlink applies to.

Syntax

Namespace: FlexCel.Core

public abstract TXlsCellRange GetHyperLinkCellRange(Int32 hyperLinkIndex)

Parameters

<-> | Parameter | Type | Description
 | hyperLinkIndex | Int32 | Index of the hyperlink (1 based).

Returns

Range the hyperlink applies to.

See also

  • ExcelFile


ExcelFile.SetHyperLinkCellRange Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.SetHyperLinkCellRange Method

Changes the cells an hyperlink is linked to.

Syntax

Namespace: FlexCel.Core

public abstract void SetHyperLinkCellRange(Int32 hyperLinkIndex, TXlsCellRange cellRange)

Parameters

<-> | Parameter | Type | Description
 | hyperLinkIndex | Int32 | Index of the hyperlink (1 based).
 | cellRange | TXlsCellRange | Range of cells the hyperlink will refer to.

See also

  • ExcelFile


ExcelFile.AddHyperLink Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.AddHyperLink Method

Adds a new hyperlink to the Active sheet. Use SetHyperLink to modify an existing one.

Syntax

Namespace: FlexCel.Core

public abstract void AddHyperLink(TXlsCellRange cellRange, THyperLink value)

Parameters

<-> | Parameter | Type | Description
 | cellRange | TXlsCellRange | Range of cells the hyperlink will refer to.
 | value | THyperLink | Description of the hyperlink.

See also

  • ExcelFile


ExcelFile.DeleteHyperLink Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.DeleteHyperLink Method

Deletes an existing hyperlink.

Syntax

Namespace: FlexCel.Core

public abstract void DeleteHyperLink(Int32 hyperLinkIndex)

Parameters

<-> | Parameter | Type | Description
 | hyperLinkIndex | Int32 | Index of the hyperlink (1 based).

See also

  • ExcelFile


ExcelFile.LoopHyperLinks Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.LoopHyperLinks Method

Loops over the list of existing hyperlinks in the active sheet which are at least partially contained in range, and executes action for each one of those links. This can be faster than looping over all hyperlinks in a page if you have thousands, since this method uses spatial indexing.

Remarks

The list of links that will be returned is frozen at the start of the method. If you add new links in the anonymous method "action", this method won't loop over those new links.

Syntax

Namespace: FlexCel.Core

public abstract void LoopHyperLinks(TXlsCellRange range, Boolean fullyInside, Action<THyperLink, TXlsCellRange> action)

Parameters

<-> | Parameter | Type | Description
 | range | TXlsCellRange | Range of cells for which you want to retrieve the links.
 | fullyInside | Boolean | If true, only those links that are fully inside the range will be returned. If false, links which have only a part inside but also a part outside will be returned too.
 | action | Action<THyperLink, TXlsCellRange> | Actions to be applied to every link at least partially included in range.

Examples

The following example will find if there is an hyperlink at cell B3, and if there is some, call DoSomething with the link text.

    xls.LoopHyperLinks(new TXlsCellRange("B3"), false,
        (hyperlink, range) =>
        {
            if (hyperlink != null) DoSomething(hyperlink.Text);
        }
    );

Remember that while this method is efficient because the search is indexed, if you want to find for example all links in a column, it is faster to do a single call to LoopHyperLinks(B1:B10) than to call LoopHyperLinks(B1) to get the link at B1, then LoopHyperLinks(B2) for B2 and so on.

See also

  • ExcelFile


ExcelFile.GetRowOutlineLevel Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.GetRowOutlineLevel Method

Returns the Outline level for a row.

Syntax

Namespace: FlexCel.Core

public abstract Int32 GetRowOutlineLevel(Int32 row)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row index (1 based)

Returns

Outline level for a row. It is a number between 0 and 7.

See also

  • ExcelFile


ExcelFile.SetRowOutlineLevel Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.SetRowOutlineLevel Method

Overloads

  • ExcelFile.SetRowOutlineLevel(Int32, Int32)
  • ExcelFile.SetRowOutlineLevel(Int32, Int32, Int32)

ExcelFile.SetRowOutlineLevel(Int32, Int32)

Sets the Outline level for a row.

Syntax

Namespace: FlexCel.Core

public void SetRowOutlineLevel(Int32 row, Int32 level)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row index (1 based)
 | level | Int32 | Outline level. must be between 0 and 7.

See also

  • ExcelFile

ExcelFile.SetRowOutlineLevel(Int32, Int32, Int32)

Sets the Outline level for a row range.

Syntax

Namespace: FlexCel.Core

public abstract void SetRowOutlineLevel(Int32 firstRow, Int32 lastRow, Int32 level)

Parameters

<-> | Parameter | Type | Description
 | firstRow | Int32 | Row index of the first row on the range. (1 based)
 | lastRow | Int32 | Row index of the last row on the range. (1 based)
 | level | Int32 | Outline level. must be between 0 and 7.

See also

  • ExcelFile


ExcelFile.GetColOutlineLevel Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.GetColOutlineLevel Method

Returns the Outline level for a column.

Syntax

Namespace: FlexCel.Core

public abstract Int32 GetColOutlineLevel(Int32 col)

Parameters

<-> | Parameter | Type | Description
 | col | Int32 | Column index (1 based)

Returns

Outline level for a column. It is a number between 0 and 7.

See also

  • ExcelFile


ExcelFile.SetColOutlineLevel Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.SetColOutlineLevel Method

Overloads

  • ExcelFile.SetColOutlineLevel(Int32, Int32)
  • ExcelFile.SetColOutlineLevel(Int32, Int32, Int32)

ExcelFile.SetColOutlineLevel(Int32, Int32)

Sets the Outline level for a column.

Syntax

Namespace: FlexCel.Core

public void SetColOutlineLevel(Int32 col, Int32 level)

Parameters

<-> | Parameter | Type | Description
 | col | Int32 | Column index (1 based)
 | level | Int32 | Outline level. must be between 0 and 7.

See also

  • ExcelFile

ExcelFile.SetColOutlineLevel(Int32, Int32, Int32)

Sets the Outline level for a column range.

Syntax

Namespace: FlexCel.Core

public abstract void SetColOutlineLevel(Int32 firstCol, Int32 lastCol, Int32 level)

Parameters

<-> | Parameter | Type | Description
 | firstCol | Int32 | Column index of the first column on the range. (1 based)
 | lastCol | Int32 | Column index of the last column on the range. (1 based)
 | level | Int32 | Outline level. must be between 0 and 7.

See also

  • ExcelFile


ExcelFile.CollapseOutlineRows Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.CollapseOutlineRows Method

Overloads

  • ExcelFile.CollapseOutlineRows(Int32, TCollapseChildrenMode)
  • ExcelFile.CollapseOutlineRows(Int32, TCollapseChildrenMode, Int32, Int32)

ExcelFile.CollapseOutlineRows(Int32, TCollapseChildrenMode)

Collapses or expands the row outlines in a sheet to the specified level. It is equivalent to pressing the numbers at the top of the outline gutter in Excel.

Syntax

Namespace: FlexCel.Core

public void CollapseOutlineRows(Int32 level, TCollapseChildrenMode collapseChildren)

Parameters

<-> | Parameter | Type | Description
 | level | Int32 | Level that we want to show of the outline. (1 based). For example, setting Level = 3 is the same as pressing the "3" number at the top of the outline gutter in Excel. Setting Level = 1 will collapse all groups, Level = 8 will expand all groups.
 | collapseChildren | TCollapseChildren​Mode | Determines if the children of the collapsed nodes will be collapsed too.

See also

  • ExcelFile

ExcelFile.CollapseOutlineRows(Int32, TCollapseChildrenMode, Int32, Int32)

Collapses or expands the row outlines in a sheet to the specified level. It is equivalent to pressing the numbers at the top of the outline gutter in Excel.

Syntax

Namespace: FlexCel.Core

public abstract void CollapseOutlineRows(Int32 level, TCollapseChildrenMode collapseChildren, Int32 firstRow, Int32 lastRow)

Parameters

<-> | Parameter | Type | Description
 | level | Int32 | Level that we want to show of the outline. (1 based). For example, setting Level = 3 is the same as pressing the "3" number at the top of the outline gutter in Excel. Setting Level = 1 will collapse all groups, Level = 8 will expand all groups.
 | collapseChildren | TCollapseChildren​Mode | Determines if the children of the collapsed nodes will be collapsed too.
 | firstRow | Int32 | This defines the first row of the range to collapse/expand. Only rows inside that range will be modified.
 | lastRow | Int32 | This defines the last row of the range to collapse/expand. Only rows inside that range will be modified.

See also

  • ExcelFile


ExcelFile.CollapseOutlineCols Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.CollapseOutlineCols Method

Overloads

  • ExcelFile.CollapseOutlineCols(Int32, TCollapseChildrenMode)
  • ExcelFile.CollapseOutlineCols(Int32, TCollapseChildrenMode, Int32, Int32)

ExcelFile.CollapseOutlineCols(Int32, TCollapseChildrenMode)

Collapses or expands the column outlines in a sheet to the specified level. It is equivalent to pressing the numbers at the left of the outline gutter in Excel.

Syntax

Namespace: FlexCel.Core

public void CollapseOutlineCols(Int32 level, TCollapseChildrenMode collapseChildren)

Parameters

<-> | Parameter | Type | Description
 | level | Int32 | Level that we want to display from the outline. (1 based). For example, setting Level = 3 is the same as pressing the "3" number at the left of the outline gutter in Excel. Setting Level = 1 will collapse all groups, Level = 8 will expand all groups.
 | collapseChildren | TCollapseChildren​Mode | Determines if the children of the collapsed nodes will be collapsed too.

See also

  • ExcelFile

ExcelFile.CollapseOutlineCols(Int32, TCollapseChildrenMode, Int32, Int32)

Collapses or expands the column outlines in a sheet to the specified level. It is equivalent to pressing the numbers at the top of the outline gutter in Excel.

Syntax

Namespace: FlexCel.Core

public abstract void CollapseOutlineCols(Int32 level, TCollapseChildrenMode collapseChildren, Int32 firstCol, Int32 lastCol)

Parameters

<-> | Parameter | Type | Description
 | level | Int32 | Level that we want to display from the outline. (1 based). For example, setting Level = 3 is the same as pressing the "3" number at the left of the outline gutter in Excel. Setting Level = 1 will collapse all groups, Level = 8 will expand all groups.
 | collapseChildren | TCollapseChildren​Mode | Determines if the children of the collapsed nodes will be collapsed too.
 | firstCol | Int32 | This defines the first column of the range to collapse/expand. Only columns inside that range will be modified.
 | lastCol | Int32 | This defines the last column of the range to collapse/expand. Only columns inside that range will be modified.

See also

  • ExcelFile


ExcelFile.IsOutlineNodeRow Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.IsOutlineNodeRow Method

Returns true when the row is the one that is used for collapsing an outline. (it has a "+" at the left).

Syntax

Namespace: FlexCel.Core

public abstract Boolean IsOutlineNodeRow(Int32 row)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row to test (1 based)

Returns

True if the node has a "+" mark.

See also

  • ExcelFile


ExcelFile.IsOutlineNodeCol Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.IsOutlineNodeCol Method

Returns true when the column is the one that is used for collapsing an outline. (it has a "+" at the top).

Syntax

Namespace: FlexCel.Core

public abstract Boolean IsOutlineNodeCol(Int32 col)

Parameters

<-> | Parameter | Type | Description
 | col | Int32 | Column to test (1 based)

Returns

True if the node has a "+" mark.

See also

  • ExcelFile


ExcelFile.IsOutlineNodeCollapsedRow Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.IsOutlineNodeCollapsedRow Method

Returns true when the row is an outline node (it has a "+" at the left) and it is closed (all children are hidden).

Syntax

Namespace: FlexCel.Core

public abstract Boolean IsOutlineNodeCollapsedRow(Int32 row)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row to test (1 based)

Returns

True if the row contains a node and it is collapsed, false otherwise.

See also

  • ExcelFile


ExcelFile.IsOutlineNodeCollapsedCol Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.IsOutlineNodeCollapsedCol Method

Returns true when the column is an outline node (it has a "+" at the top) and it is closed (all children are hidden).

Syntax

Namespace: FlexCel.Core

public abstract Boolean IsOutlineNodeCollapsedCol(Int32 col)

Parameters

<-> | Parameter | Type | Description
 | col | Int32 | Column to test (1 based)

Returns

True if the column contains a node and it is collapsed, false otherwise.

See also

  • ExcelFile


ExcelFile.CollapseOutlineNodeRow Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.CollapseOutlineNodeRow Method

Use this method to collapse a node of the outline. If the row is not a node (IsOutlineNodeRow is false) this method does nothing. While this method allows a better control of the rows expanded and collapsed, you will normally use CollapseOutlineRows(Int32, TCollapseChildrenMode) to collapse or expand all rows in a sheet.

Syntax

Namespace: FlexCel.Core

public abstract void CollapseOutlineNodeRow(Int32 row, Boolean collapse)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row to expand or collapse (1 based)
 | collapse | Boolean | If true, the node will be collapsed, else it will be expanded.

See also

  • ExcelFile


ExcelFile.CollapseOutlineNodeCol Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.CollapseOutlineNodeCol Method

Use this method to collapse a node of the outline. If the column is not a node (IsOutlineNodeCol is false) this method does nothing. While this method allows a better control of the columns expanded and collapsed, you will normally use CollapseOutlineCols(Int32, TCollapseChildrenMode) to collapse or expand all columns in a sheet.

Syntax

Namespace: FlexCel.Core

public abstract void CollapseOutlineNodeCol(Int32 col, Boolean collapse)

Parameters

<-> | Parameter | Type | Description
 | col | Int32 | Column to expand or collapse. (1 based)
 | collapse | Boolean | If true, the node will be collapsed, else it will be expanded.

See also

  • ExcelFile


ExcelFile.SubtotalDefaultEnglishString Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.SubtotalDefaultEnglishString Method

Returns the english string that Excel uses to refer to Sums, averages, et. when you use the Subtotal command. You can use the result of this method together with Subtotal to specify the text for totals.

Syntax

Namespace: FlexCel.Core

public abstract String SubtotalDefaultEnglishString(Int32 aggFunction)

Parameters

<-> | Parameter | Type | Description
 | aggFunction | Int32 | Number of function used for aggregating. If the number is unknown then this function will return "Total". For known numbers this function will return what Excel writes on the cells for that function.

See also

  • ExcelFile


ExcelFile.Subtotal Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.Subtotal Method

This method works like the "Subtotal" command in Excel in the "Data" tab of the ribbon. It will take a number of cells and group them by similar values, adding a subtotal formula every new different value and a grand total at the end. It will also add outlines at the right.

Syntax

Namespace: FlexCel.Core

public abstract void Subtotal(TXlsCellRange range, Int32 atChangeInColumn, Int32 aggFunction, Int32[] subtotalColumns, Func<Int32, Int32, Object, String, String> SubtotalText, String grandtotalText, Func<TFlxFormat, Object, TFlxFormat> SubTotalRowFormat, Func<TFlxFormat, Object, TFlxFormat> SubTotalCellTextFormat, Func<TFlxFormat, Object, TFlxFormat> SubTotalCellFormulaFormat, Func<TFlxFormat, TFlxFormat> GrandTotalRowFormat, Func<TFlxFormat, TFlxFormat> GrandTotalCellTextFormat, Func<TFlxFormat, TFlxFormat> GrandTotalCellFormulaFormat)

Parameters

<-> | Parameter | Type | Description
 | range | TXlsCellRange | Range where to apply the subtotals. If null, the whole sheet will be used.
 | atChangeInColumn | Int32 | Index of the column where we want to group in. Every time a value in this column changes from the previous row, a new subtotal will be added.
 | aggFunction | Int32 | Function that will be used in the =Subtotal(...) formula added. To do a sum, set this value to 9. For other values, see the Excel reference in the =Subtotal function.
 | subtotalColumns | Int32[] | We will add a subtotal formula in each one of the columns in this array.
 | SubtotalText | Func<Int32, Int32, Object, String, String> | In this function you need to return the text that will be written in every "Subtotal" line. The parameters to this function are the row, column, and value of the cell we are aggregating, as an object and as a string. If this function is null, "aggregatedcolumn Total" will be written.
 | grandtotalText | String | Text for the grand total line. If null or empty, no grand total line will be added. Note: You can pass "Grand " + the result of SubtotalDefaultEnglishString here to get the standard English labels for the function ("Total", "Average", etc).
 | SubTotalRowFormat | Func<TFlxFormat, Object, TFlxFormat> | Row format for the subtotal rows added. You get a TFlxFormat and the cell value for the column you are aggregating, and you must return a changed one with the format you want. You might leave this function null, and no special format will be applied to the rows.
 | SubTotalCellTextFormat | Func<TFlxFormat, Object, TFlxFormat> | Cell format for the subtotal cells which contain text like "Food Subtotal". You get a TFlxFormat and the cell value for the column you are aggregating, and you must return a changed one with the format you want. You might leave this function null, and bold will be applied to all subtotal texts.
 | SubTotalCellFormulaFormat | Func<TFlxFormat, Object, TFlxFormat> | Cell format for the subtotal cells which contain formulas like =Subtotal(...). You get a TFlxFormat and the cell value for the column you are aggregating, and you must return a changed one with the format you want. You might leave this function null, and no special format will be applied to subtotal formulas.
 | GrandTotalRowFormat | Func<TFlxFormat, TFlxFormat> | Row format for the grand total row added. You get a TFlxFormat, and you must return a changed one with the format you want. You might leave this function null, and no special format will be applied to the grand total row.
 | GrandTotalCellTextFormat | Func<TFlxFormat, TFlxFormat> | Cell format for the grand total cells which contain text like "Food Total". You get a TFlxFormat, and you must return a changed one with the format you want. You might leave this function null, and bold will be applied to all grand total texts.
 | GrandTotalCellFormulaFormat | Func<TFlxFormat, TFlxFormat> | Cell format for the grand total cells which contain formulas like =Subtotal(...). You get a TFlxFormat, and you must return a changed one with the format you want. You might leave this function null, and no special format will be applied to grand total formulas.

Examples

The following example will calculate the Count (function 3) of column 2 at every change of column 1. It will write "Grand Count" in the big total, and the rest of parameters will be the default.

    xls.Subtotal(null, 1, 3, new int[] { 2 }, null, "Grand " + xls.SubtotalDefaultEnglishString(3), null, null, null, null, null, null);

Below is a more complex example, which will calculate the Average (function 1) of columns 4 and 5 at every change of column 3. This method uses the callbacks to provide custom text for the subtotal lines and custom formats for all possible cases. This can be useful if default texts aren't enough or you want to use other language than English, but normally most callbacks will be null as the defaults should work in most cases. This example is just to show all the functionality in a single call.

     xls.Subtotal(new TXlsCellRange(2, 1, xls.RowCount - 1, 2), 3, 1, new int[] { 4, 5 },
         (row, col, cellVal, cellValAsString) => { return "This is the average of " + cellValAsString; }
         , "Super Average",
         (fmt, cellval) =>
         {
             fmt.Font.Name = "Courier new";
             fmt.Font.Scheme = TFontScheme.None;
             fmt.FillPattern.Pattern = TFlxPatternStyle.Solid;
             fmt.FillPattern.FgColor = Colors.MediumAquamarine;
             return fmt;
         },
         (fmt, cellval) =>
         {
             fmt.Font.Style = TFlxFontStyles.Bold;
             fmt.FillPattern.Pattern = TFlxPatternStyle.Solid;
             fmt.FillPattern.FgColor = Colors.MediumBlue;
             return fmt;
         },
         (fmt, cellval) =>
         {
             fmt.Font.Style = TFlxFontStyles.Italic;
             fmt.FillPattern.Pattern = TFlxPatternStyle.Solid;
             fmt.FillPattern.FgColor = Colors.MediumOrchid;
             return fmt;
         },
         (fmt) =>
         {
             fmt.Font.Style = TFlxFontStyles.StrikeOut;
             fmt.FillPattern.Pattern = TFlxPatternStyle.Solid;
             fmt.FillPattern.FgColor = Colors.MediumSeaGreen;
             return fmt;
         },
         (fmt) =>
         {
             fmt.Font.Style = TFlxFontStyles.StrikeOut;
             fmt.FillPattern.Pattern = TFlxPatternStyle.Solid;
             fmt.FillPattern.FgColor = Colors.MediumSpringGreen;
             return fmt;
         },
         (fmt) =>
         {
             fmt.Font.Style = TFlxFontStyles.StrikeOut;
             fmt.FillPattern.Pattern = TFlxPatternStyle.Solid;
             fmt.FillPattern.FgColor = Colors.MediumTurquoise;
             return fmt;
         }
    );

See also

  • ExcelFile


ExcelFile.SelectCell Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.SelectCell Method

Selects a single cell. To select multiple cells, use SelectCells

Syntax

Namespace: FlexCel.Core

public void SelectCell(Int32 row, Int32 col, Boolean scrollWindow)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row to select (1 based)
 | col | Int32 | Column to select (1 based)
 | scrollWindow | Boolean | When true, window will scroll so the selected cell is visible. This is equivalent to using ScrollWindow(Int32, Int32) method and is provided as a shortcut.

See also

  • ExcelFile


ExcelFile.SelectCells Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.SelectCells Method

Selects a group of cells on a given pane. If you just want to select just one cell, you can use the simpler method SelectCell This property can work in different windows depending on the value of ActiveWindow

Syntax

Namespace: FlexCel.Core

public abstract void SelectCells(TXlsCellRange[] cellRange)

Parameters

<-> | Parameter | Type | Description
 | cellRange | TXlsCellRange[] | Cells to select.

See also

  • ExcelFile


ExcelFile.GetSelectedCells Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.GetSelectedCells Method

Returns the selected ranges on a sheet. This property can work in different windows depending on the value of ActiveWindow

Syntax

Namespace: FlexCel.Core

public abstract TXlsCellRange[] GetSelectedCells()

See also

  • ExcelFile


ExcelFile.ScrollWindow Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.ScrollWindow Method

Overloads

  • ExcelFile.ScrollWindow(Int32, Int32)
  • ExcelFile.ScrollWindow(TPanePosition, Int32, Int32)

ExcelFile.ScrollWindow(Int32, Int32)

Scrolls the window to a specified place. If the window is split, it will move the left and top panels. This property can work in different windows depending on the value of ActiveWindow

Syntax

Namespace: FlexCel.Core

public void ScrollWindow(Int32 row, Int32 col)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | First visible row.
 | col | Int32 | First visible column.

See also

  • ExcelFile

ExcelFile.ScrollWindow(TPanePosition, Int32, Int32)

Scrolls the window to a specified place. This property can work in different windows depending on the value of ActiveWindow

Syntax

Namespace: FlexCel.Core

public abstract void ScrollWindow(TPanePosition panePosition, Int32 row, Int32 col)

Parameters

<-> | Parameter | Type | Description
 | panePosition | TPanePosition | Pane to move. Note that if you move for example the left column of the upper left pane, you will also move the left column of the lower left pane.
 | row | Int32 | First visible row.
 | col | Int32 | First visible column.

See also

  • ExcelFile


ExcelFile.GetWindowScroll Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.GetWindowScroll Method

Overloads

  • ExcelFile.GetWindowScroll
  • ExcelFile.GetWindowScroll(TPanePosition)

ExcelFile.GetWindowScroll

Returns the window scroll for the main pane. This property can work in different windows depending on the value of ActiveWindow

Syntax

Namespace: FlexCel.Core

public TCellAddress GetWindowScroll()

See also

  • ExcelFile

ExcelFile.GetWindowScroll(TPanePosition)

Returns the window scroll for a specified pane. This property can work in different windows depending on the value of ActiveWindow

Syntax

Namespace: FlexCel.Core

public abstract TCellAddress GetWindowScroll(TPanePosition panePosition)

Parameters

<-> | Parameter | Type | Description
 | panePosition | TPanePosition | Pane to return.

See also

  • ExcelFile


ExcelFile.FreezePanes Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.FreezePanes Method

This command is equivalent to Menu->Window->Freeze Panes. It will freeze the rows and columns above and to the left from cell. Note that because Excel works this way, when you SplitWindow the panes are suppressed and vice-versa See also GetFrozenPanes This property can work in different windows depending on the value of ActiveWindow

Syntax

Namespace: FlexCel.Core

public abstract void FreezePanes(TCellAddress cell)

Parameters

<-> | Parameter | Type | Description
 | cell | TCellAddress | All rows and columns above and to the left of this cell will be frozen. Set it to null or "A1" to unfreeze the panes.

See also

  • ExcelFile


ExcelFile.GetFrozenPanes Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.GetFrozenPanes Method

Returns the cell that is freezing the window, "A1" if no panes are frozen. See also FreezePanes This property can work in different windows depending on the value of ActiveWindow

Syntax

Namespace: FlexCel.Core

public abstract TCellAddress GetFrozenPanes()

See also

  • ExcelFile


ExcelFile.SplitWindow Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.SplitWindow Method

This command is equivalent to Menu->Window->Split. It will split the window in 4 regions. Note that because Excel works this way, when you FreezePanes the windows are unsplitted and vice-versa See also GetSplitWindow This property can work in different windows depending on the value of ActiveWindow

Syntax

Namespace: FlexCel.Core

public abstract void SplitWindow(Int32 xOffset, Int32 yOffset)

Parameters

<-> | Parameter | Type | Description
 | xOffset | Int32 | Offset from the left on 1/20 of a point. Zero for no vertical split.
 | yOffset | Int32 | Offset from the top on 1/20 of a point. Zero for no horizontal split.

See also

  • ExcelFile


ExcelFile.GetSplitWindow Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.GetSplitWindow Method

Returns the horizontal and vertical offsets for the split windows. Zero means no split. See also SplitWindow This property can work in different windows depending on the value of ActiveWindow

Syntax

Namespace: FlexCel.Core

public abstract TPoint GetSplitWindow()

See also

  • ExcelFile


ExcelFile.GetDataConnections Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.GetDataConnections Method

Returns the data connections in the file. Use SetDataConnections to change the connections in the file.

Syntax

Namespace: FlexCel.Core

public abstract TDataConnections GetDataConnections()

See also

  • ExcelFile


ExcelFile.SetDataConnections Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.SetDataConnections Method

Sets the data connections in the file.

Syntax

Namespace: FlexCel.Core

public abstract void SetDataConnections(TDataConnections connections)

Parameters

<-> | Parameter | Type | Description
 | connections | TDataConnections | Object with all connections in the file. Set it to null if you want to remove all connections.

See also

  • ExcelFile


ExcelFile.GetChart Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.GetChart Method

Returns a chart from an object position and path. If the object does not contain a chart, it returns null. Note that charts can be first-level objects (in chart sheets), or they can be embedded inside other objects, that can be themselves embedded inside other objects. So you need to recursively look inside all objects to see if there are charts anywhere.

Look at the example in this topic to see how to get all charts in a sheet.

Syntax

Namespace: FlexCel.Core

public abstract ExcelChart GetChart(Int32 objectIndex, String objectPath)

Parameters

<-> Parameter Type Description
objectIndex Int32 Index of the object (1-based)
objectPath String Index to the child object where the chart is.
If it is a simple object, you can use String.Empty here, if not you need to get the ObjectPath from GetObjectProperties(Int32, Boolean)
If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"

Examples

The following example will retrieve all charts that are inserted as objects in a sheet, along with the chart sheets.

    public void ProcessAllCharts()
    {
        XlsFile xls = new XlsFile(true);
        xls.Open("filewithcharts.xls");
        for (int iSheet = 1; iSheet <= xls.SheetCount; iSheet++)
        {
            xls.ActiveSheet = iSheet;

            //Process charts embedded as objects in worksheets.
            for (int iChart = 1; iChart <= xls.ObjectCount; iChart++)
            {
                TShapeProperties props = xls.GetObjectProperties(iChart, true);
                ProcessChart(xls, iChart, props); //We need to process it even if it is not a chart, since it might be a group with a chart inside.
            }

            //Process chart sheets.
            if (xls.SheetType == TSheetType.Chart)
            {
                ExcelChart chart = xls.GetChart(1, null);
                DoSomething(xls, chart);
            }

        }

        xls.Save("changedfilewithcharts.xls");
    }

    private void ProcessChart(ExcelFile xls, int iChart, TShapeProperties props)
    {
        if (props.ObjectType == TObjectType.Chart)
        {
            ExcelChart chart = xls.GetChart(iChart, props.ObjectPath);
            DoSomething(xls, chart);
        }

        for (int i = 1; i <= props.ChildrenCount; i++)
        {
            TShapeProperties childProp = props.Children(i);
            ProcessChart(xls, i, childProp);
        }
    }

See also

  • ExcelFile


ExcelFile.AddChart Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.AddChart Method

This method will add a chart to the active sheet. You can then add series and customize the returned ExcelChart object.

Important: This method only works in xlsx files.

Syntax

Namespace: FlexCel.Core

public abstract ExcelChart AddChart(TShapeProperties objProps, TChartType chartType, ChartStyle aChartStyle, Boolean roundedCorners)

Parameters

<-> | Parameter | Type | Description
 | objProps | TShapeProperties | Place where the chart will be placed and characteristics like if it is printable or not.
 | chartType | TChartType | Kind of chart created. Note that you can have more than one type of chart in the same chart, so this just sets the base chart type. You can add other chart types over it.
 | aChartStyle | ChartStyle | Theme of the chart. This is a number between 1 and 48 which defines many standard properties for the chart, like the default line width for the series or the legend. The default style is 2.
 | roundedCorners | Boolean | If true, the chart will have rounded corners.

See also

  • ExcelFile


ExcelFile.Find Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.Find Method

Finds a value inside a cell and returns the position for the cell, or null if nothing was found.

Syntax

Namespace: FlexCel.Core

public abstract TCellAddress Find(Object value, TXlsCellRange Range, TCellAddress Start, Boolean ByRows, Boolean CaseInsensitive, Boolean SearchInFormulas, Boolean WholeCellContents)

Parameters

<-> | Parameter | Type | Description
 | value | Object | Value we are searching.
 | Range | TXlsCellRange | Range to Search. Null means the whole worksheet.
 | Start | TCellAddress | Cell where to start searching. For the first time, use null. After this, you can use the result of this method to get the next cell.
 | ByRows | Boolean | If true, the value will be searched down then left. If false, the search will go left then down. SEARCH IS FASTER WHEN BYROWS = FALSE
 | CaseInsensitive | Boolean | If true, string searches will not be case sensitive, "a" = "A"
 | SearchInFormulas | Boolean | If true, the search will cover formulas too.
 | WholeCellContents | Boolean | If true, the string must match the whole cell, not a part of it.

Returns

Cell where the string is found, or null if it is not found.

Examples

To find all cells on a sheet that contain the string "bolts":

    TCellAddress Cell = null; //initialize the value to null to start searching.
    do
    {
        Cell = xls.Find("bolts", null, Cell, false, true, true, false); //find the next value.
        if (Cell != null) LogMessage(Cell.CellRef);
    }
    while (Cell != null); //until it doesn't find any more matches.

See also

  • ExcelFile


ExcelFile.Replace Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.Replace Method

Overloads

  • ExcelFile.Replace(Object, Object, TXlsCellRange, Boolean, Boolean, Boolean)
  • ExcelFile.Replace(Object, Object, TXlsCellRange, Boolean, Boolean, Boolean, Action<TReplaceAction>)

ExcelFile.Replace(Object, Object, TXlsCellRange, Boolean, Boolean, Boolean)

Replaces the instances of oldValue by newValue in the active sheet.

Syntax

Namespace: FlexCel.Core

public Int32 Replace(Object oldValue, Object newValue, TXlsCellRange Range, Boolean CaseInsensitive, Boolean SearchInFormulas, Boolean WholeCellContents)

Parameters

<-> | Parameter | Type | Description
 | oldValue | Object | Value we want to replace.
 | newValue | Object | Value we want to use to replace oldValue.
 | Range | TXlsCellRange | Range to Search. Null means the whole worksheet.
 | CaseInsensitive | Boolean | If true, string searches will not be case sensitive, "a" = "A"
 | SearchInFormulas | Boolean | If true, the search will cover formulas too.
 | WholeCellContents | Boolean | If true, only whole cells will be replaced.

Returns

The number of replacements done.

Examples

To replace all cells on a sheet that contain "hello" with "hi":

    xls.Replace("hello", "hi", null, true, true, false);

See also

  • ExcelFile

ExcelFile.Replace(Object, Object, TXlsCellRange, Boolean, Boolean, Boolean, Action<TReplaceAction>)

Replaces the instances of oldValue by newValue in the active sheet, and allows to specify the cell format and value for every replaced cell.

Syntax

Namespace: FlexCel.Core

public abstract Int32 Replace(Object oldValue, Object newValue, TXlsCellRange Range, Boolean CaseInsensitive, Boolean SearchInFormulas, Boolean WholeCellContents, Action<TReplaceAction> ReplaceAction)

Parameters

<-> | Parameter | Type | Description
 | oldValue | Object | Value we want to replace.
 | newValue | Object | Value we want to use to replace oldValue.
 | Range | TXlsCellRange | Range to Search. Null means the whole worksheet.
 | CaseInsensitive | Boolean | If true, string searches will not be case sensitive, "a" = "A"
 | SearchInFormulas | Boolean | If true, the search will cover formulas too.
 | WholeCellContents | Boolean | If true, only whole cells will be replaced.
 | ReplaceAction | Action<TReplaceAction> | Action to be performed in every replacement.

Returns

The number of replacements done.

Examples

To replace all cells on a sheet that contain 1999-01-01 with 2003-01-01, formatting the cells in column 3 as blue:

    xls.Replace(new DateTime(1999, 01, 01), new DateTime(2003, 01, 01), null, true, true, true,
                (x) =>
                  {
                      if (x.Col == 3)
                      {
                          TFlxFormat fm = x.Workbook.GetFormat(x.XF);
                          fm.FillPattern.FgColor = Colors.Red;
                          fm.FillPattern.Pattern = TFlxPatternStyle.Solid;
                          x.XF = x.Workbook.AddFormat(fm);
                      }
                  }
    );

See also

  • ExcelFile


ExcelFile.Sort Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.Sort Method

Overloads

  • ExcelFile.Sort(TXlsCellRange, Boolean, Int32[], TSortOrder[], IComparer)
  • ExcelFile.Sort(TXlsCellRange, Boolean, Int32[], TSortOrder[], IComparer, TSortFormulaMode)

ExcelFile.Sort(TXlsCellRange, Boolean, Int32[], TSortOrder[], IComparer)

Sorts a range on the current sheet.

Syntax

Namespace: FlexCel.Core

public void Sort(TXlsCellRange Range, Boolean ByRows, Int32[] Keys, TSortOrder[] SortOrder, IComparer Comparer)

Parameters

<-> | Parameter | Type | Description
 | Range | TXlsCellRange | Range to sort. It must not include headers.
 | ByRows | Boolean | If true, rows will be sorted. If false, columns will.
 | Keys | Int32[] | An array of integers indicating the columns or rows you want to use for sorting. Note that this number is absolute, for example column 1 always means column "A" no matter if the range we are sorting begins at column "B". A null array means sort by the first column or row, then by the second, etc. up to 8 entries.
 | SortOrder | TSortOrder[] | An array of flags indicating whether to sort ascending or descending for each Key. If null, all sorts will be ascending. If not null and the array size is less than the size of the "Keys" parameter, all missing entries are assumed to be Ascending.
 | Comparer | IComparer | Comparer to create a custom way to compare the different items. Set it to null to use default ordering.

Examples

To sort the range of cells from B7 to D100, on columns B Ascending and C Descending:

    xls.Sort(new TXlsCellRange("B7:D100"), //To sort the full sheet, you can pass null here.
        true, //Normally we want to sort the rows in the range. But we might want to sort columns and we can do it by setting this to false.
        new int[] { 2, 3 },// Sort by columns B and C (2 and 3)
        new TSortOrder[] { TSortOrder.Ascending, TSortOrder.Descending }, //Sort column B ascending, column C descending. If you want to sort everything in ascending order, just set this to null.
        null // Use the standard comparer.
        );

See also

  • ExcelFile

ExcelFile.Sort(TXlsCellRange, Boolean, Int32[], TSortOrder[], IComparer, TSortFormulaMode)

Sorts a range on the current sheet.

Syntax

Namespace: FlexCel.Core

public abstract void Sort(TXlsCellRange Range, Boolean ByRows, Int32[] Keys, TSortOrder[] SortOrder, IComparer Comparer, TSortFormulaMode SortFormulaMode)

Parameters

<-> | Parameter | Type | Description
 | Range | TXlsCellRange | Range to sort. It must not include headers.
 | ByRows | Boolean | If true, rows will be sorted. If false, columns will.
 | Keys | Int32[] | An array of integers indicating the columns or rows you want to use for sorting. Note that this number is absolute, for example column 1 always means column "A" no matter if the range we are sorting begins at column "B". A null array means sort by the first column or row, then by the second, etc. up to 8 entries.
 | SortOrder | TSortOrder[] | An array of flags indicating whether to sort ascending or descending for each Key. If null, all sorts will be ascending. If not null and the array size is less than the size of the "Keys" parameter, all missing entries are assumed to be Ascending.
 | Comparer | IComparer | Comparer to create a custom way to compare the different items. Set it to null to use default ordering.
 | SortFormulaMode | TSortFormulaMode | Defines how formulas in the file will be changed when sorting.

Examples

To sort the range of cells from B7 to D100, on columns B Ascending and C Descending using TSortFormulaMode.ExcelLike:

    xls.Sort(new TXlsCellRange("B7:D100"), //To sort the full sheet, you can pass null here.
        true, //Normally we want to sort the rows in the range. But we might want to sort columns and we can do it by setting this to false.
        new int[] { 2, 3 },// Sort by columns B and C (2 and 3)
        new TSortOrder[] { TSortOrder.Ascending, TSortOrder.Descending }, //Sort column B ascending, column C descending. If you want to sort everything in ascending order, just set this to null.
        null, // Use the standard comparer.
        TSortFormulaMode.ExcelLike //Excel-like is faster, but won't change formulas outside the range being sorted.
        );

See also

  • ExcelFile


ExcelFile.SetAutoFilter Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.SetAutoFilter Method

Overloads

  • ExcelFile.SetAutoFilter(TXlsCellRange)
  • ExcelFile.SetAutoFilter(TXlsCellRange, Boolean)
  • ExcelFile.SetAutoFilter(Int32, Int32, Int32)
  • ExcelFile.SetAutoFilter(Int32, Int32, Int32, Int32)

ExcelFile.SetAutoFilter(TXlsCellRange)

Important

This Method is obsolete.

Use SetAutoFilter(TXlsCellRange, false) instead.

OBSOLETE: Use SetAutoFilter(TXlsCellRange, Boolean) instead. Sets an AutoFilter in a cell range, ignoring the bottom coordinate of the range. Ignoring the bottom coordinate is almost always what you will want to do, but it is better to be explicit if you want to ignore it. So this method was deprecated, and you should call SetAutofilter(range, false) instead. Doing a search and replace from SetAutofilter(range) to SetAutofilter(range, false) in your code will keep your code working exactly as it worked before.

Syntax

Namespace: FlexCel.Core

public void SetAutoFilter(TXlsCellRange range)

Parameters

<-> | Parameter | Type | Description
 | range | TXlsCellRange | Range to set the AutoFilter. If range is null, this method does nothing.

See also

  • ExcelFile

ExcelFile.SetAutoFilter(TXlsCellRange, Boolean)

Sets an AutoFilter in a cell range.

Syntax

Namespace: FlexCel.Core

public void SetAutoFilter(TXlsCellRange range, Boolean useBottomCoordinate)

Parameters

<-> | Parameter | Type | Description
 | range | TXlsCellRange | Range to set the AutoFilter. If range is null, this method does nothing.
 | useBottomCoordinate | Boolean | If false the bottom coordinate of the range will be ignored, and the range will extend until the first non-empty row. This is the normal way you set autofilters in Excel. When true, the range will go at least up to range.Bottom, no matter the actual used cells in Excel. To set an autofiter this way in Excel, you would select a range, then set the autofilter over that range. Note that the autofilter can include rows after range.Bottom anyway. range.Bottom only specifies the minimum row that must be included.

See also

  • ExcelFile

ExcelFile.SetAutoFilter(Int32, Int32, Int32)

Sets the AutoFilter in the Active sheet to point to the range specified. This is the most common ways to specify autofilters, where the rows in the filter will expand to the first non-empty row. In the not-common case where you want to specify a full range for the autofilter, you can use SetAutoFilter(Int32, Int32, Int32, Int32)

Syntax

Namespace: FlexCel.Core

public void SetAutoFilter(Int32 row, Int32 col1, Int32 col2)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row where the AutoFilter will be placed (1 based).
 | col1 | Int32 | First column for the AutoFilter range (1 based).
 | col2 | Int32 | Last column for the AutoFilter range (1 based).

See also

  • ExcelFile

ExcelFile.SetAutoFilter(Int32, Int32, Int32, Int32)

Sets the AutoFilter in the Active sheet to point to the range specified. Note: You will normally want to use SetAutoFilter(Int32, Int32, Int32), since that is the common way to set autofilters. The last row shouldn't matter, so it will addapt automatically when you add rows. If you specify the last row, then the range will still grow to include all data, but it will include at least the last row you specify, even if it is blank."/>

Syntax

Namespace: FlexCel.Core

public abstract void SetAutoFilter(Int32 row1, Int32 col1, Int32 row2, Int32 col2)

Parameters

<-> | Parameter | Type | Description
 | row1 | Int32 | Row where the AutoFilter will be placed (1 based).
 | col1 | Int32 | First column for the AutoFilter range (1 based).
 | row2 | Int32 | Last row for the autofilter (1 based).
 | col2 | Int32 | Last column for the AutoFilter range (1 based). Note that the autofilter will automatically expand over this row if you have more non-empty rows below this row.

See also

  • ExcelFile


ExcelFile.RemoveAutoFilter Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.RemoveAutoFilter Method

Removes the AutoFilter from the active sheet. If there is no AutoFilter in the sheet, this method does nothing.

Syntax

Namespace: FlexCel.Core

public abstract void RemoveAutoFilter()

See also

  • ExcelFile


ExcelFile.HasAutoFilter Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.HasAutoFilter Method

Overloads

  • ExcelFile.HasAutoFilter
  • ExcelFile.HasAutoFilter(Int32, Int32)

ExcelFile.HasAutoFilter

Returns true if the active sheet has any AutoFilter defined.

Syntax

Namespace: FlexCel.Core

public abstract Boolean HasAutoFilter()

See also

  • ExcelFile

ExcelFile.HasAutoFilter(Int32, Int32)

Returns true if a cell has an AutoFilter.

Syntax

Namespace: FlexCel.Core

public abstract Boolean HasAutoFilter(Int32 row, Int32 col)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row of the cell we want to find out. (1 based)
 | col | Int32 | Column of the cell we want to find out. (1 based)

Returns

True if the cell has an AutoFilter, false otherwise.

See also

  • ExcelFile


ExcelFile.GetAutoFilterRange Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.GetAutoFilterRange Method

Returns the range of cells with AutoFilter in the Active sheet, or null if there is not AutoFilter.

Syntax

Namespace: FlexCel.Core

public abstract TXlsCellRange GetAutoFilterRange()

See also

  • ExcelFile


ExcelFile.Recalc Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.Recalc Method

Overloads

  • ExcelFile.Recalc
  • ExcelFile.Recalc(Boolean)

ExcelFile.Recalc

When RecalcMode is manual, use this method to force a recalculation of the spreadsheet. This specific version of the method will always perform a recalc, even if it is not needed. You can use Recalc(Boolean) to recalc only when is needed.

Syntax

Namespace: FlexCel.Core

public void Recalc()

See also

  • ExcelFile

ExcelFile.Recalc(Boolean)

When RecalcMode is manual, use this method to force a recalculation of the spreadsheet.

Syntax

Namespace: FlexCel.Core

public abstract void Recalc(Boolean forced)

Parameters

<-> | Parameter | Type | Description
 | forced | Boolean | When true this method will always perform a recalc. When false, only if there has been a change on the spreadsheet. While for performance reasons you will normally want to keep this false, you might need to set it to true if the formulas refer to functions like "=NOW()" or "=RANDOM()" that change every time you recalculate.

See also

  • ExcelFile


ExcelFile.RecalcCell Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.RecalcCell Method

This method will recalculate a single cell and all of it's dependencies, but not the whole workbook.

USE THIS METHOD WITH CARE! You will normally want to simply call Recalc or just save the file and let FlexCel calculate the workbook for you. This method is for rare situations where you are making thousands of recalculations and the speed of Recalc is not enough, and you have a big part of the spreadsheet that you know that didn't change.

Note: If you are recalculating many cells without changing data, you can speed up calculations by calling StartBatchRecalcCells and EndBatchRecalcCells

Syntax

Namespace: FlexCel.Core

public abstract Object RecalcCell(Int32 sheet, Int32 row, Int32 col, Boolean forced)

Parameters

<-> | Parameter | Type | Description
 | sheet | Int32 | Sheet for the cell we want to recalculate. Use ActiveSheet here to refer to the active sheet.
 | row | Int32 | Row for the cell we want to recalculate. (1 based)
 | col | Int32 | Column for the cell we want to recalculate. (1 based)
 | forced | Boolean | When true this method will always perform a recalc. When false, only if there has been a change on the spreadsheet. While for performance reasons you will normally want to keep this false, you might need to set it to true if the formulas refer to functions like "=NOW()" or "=RANDOM()" that change every time you recalculate.

Returns

The result of the formula at the cell, or null if there is no formula.

Examples

The following code will recalculate the value of cells A1 and A2, but not C7:

    XlsFile xls = new XlsFile(1, TExcelFileFormat.v2021, true);

    xls.SetCellValue(1, 1, new TFormula("=A2 + 5"));
    xls.SetCellValue(2, 1, new TFormula("=A3 * 2"));
    xls.SetCellValue(3, 1, 7);

    xls.SetCellValue(7, 3, new TFormula("=A3 * 2"));

    object ResultValue = xls.RecalcCell(1, 1, 1, true);

    Debug.Assert((double)ResultValue == 19, "RecalcCell returns the value at the cell.");
    Debug.Assert((double)(xls.GetCellValue(1, 1) as TFormula).Result == 19, "Cell A1 was recalculated because we called RecalcCell on it.");
    Debug.Assert((double)(xls.GetCellValue(2, 1) as TFormula).Result == 14, "Cell A2 was recalculated because A1 depends on A2.");
    Debug.Assert((double)(xls.GetCellValue(7, 3) as TFormula).Result == 0, "Cell C7 was NOT recalculated because A1 doesn't have a dependency with it. Call xlsFile.Recalc() to recalc all cells.");

See also

  • ExcelFile


ExcelFile.StartBatchRecalcCells Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.StartBatchRecalcCells Method

This method tells FlexCel that you are going to call multiple times RecalcCell without changing any data in the spreadsheet. This way, FlexCel won't keep recalculating the same supporting cells each time you call RecalcCells.

Always match this call with a call to EndBatchRecalcCells.

Syntax

Namespace: FlexCel.Core

public abstract void StartBatchRecalcCells()

Examples

Let's imagine that you want to read the values of cell A1 and cell A2 in a spreadsheet. Let's also imagine that both A1 and A2 depend on cell B1 and B1 depends in a lot of other cells. If you call RecalcCell first in A1 and then in A2, FlexCel will recalculate B1 and all the cells B1 depends on twice. But if you wrap both calls in Start/EndBatchRecalcCells:

    //Tell FlexCel that from here, all calls to RecalcCell can use the values calculated by previous calls
    //to RecalcCells.
    xls.StartBatchRecalcCells();

    object A1Value = xls.RecalcCell(1, 1, 1, true);

    //This will not recalculate again anything the previous call calculated.
    object A2Value = xls.RecalcCell(2, 1, 1, true);

    //Go back to normal mode.
    xls.EndBatchRecalcCells();

Then FlexCel will calculate B1 only when calculating A1, and will not calculate it again when calculating A2.

See also

  • ExcelFile


ExcelFile.EndBatchRecalcCells Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.EndBatchRecalcCells Method

This method ends the batch started by StartBatchRecalcCells and goes back to normal mode.

Syntax

Namespace: FlexCel.Core

public abstract void EndBatchRecalcCells()

See also

  • ExcelFile


ExcelFile.RecalcExpression Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.RecalcExpression Method

Overloads

  • ExcelFile.RecalcExpression(String)
  • ExcelFile.RecalcExpression(String, Boolean)

ExcelFile.RecalcExpression(String)

Calculates the value of any formula and returns the result. The expression must be a valid Excel formula, it must start with "=", and cell references that don't specify a sheet (like for example "=A2") will refer to the active sheet. Cells used by the formula will be recalculated as needed too.

You can use this method as a simple calculator, or to calculate things like the sum of a range of cells in the spreadsheet. Look at the example for more information on how to use it.

Note that we will consider the expression to be located in the cell A1 of the Active sheet. So for example "=ROW()" will return 1, and "=A2" will return the value of A2 in the active sheet.

Syntax

Namespace: FlexCel.Core

public Object RecalcExpression(String expression)

Parameters

<-> | Parameter | Type | Description
 | expression | String | Formula to evaluate. It must start with "=" and be a valid Excel formula.

Returns

The value of the calculated formula.

Examples

To calculate the sum of all the cells in column A of the sheet "Data", you can use the following code:

    ExcelFile xls = new XlsFile("myfile.xls", true);
    xls.ActiveSheetByName = "Data";
    Double Result = Convert.ToDouble(xls.RecalcExpression("=Sum(A:A)"));

To calculate a simple expression, you can use:

    return (double)xls.RecalcExpression("=1 + 2 * 3");

See also

  • ExcelFile

ExcelFile.RecalcExpression(String, Boolean)

Calculates the value of any formula and returns the result. The expression must be a valid Excel formula, it must start with "=", and cell references that don't specify a sheet (like for example "=A2") will refer to the active sheet. Cells used by the formula will be recalculated as needed too.

You can use this method as a simple calculator, or to calculate things like the sum of a range of cells in the spreadsheet. Look at the example for more information on how to use it.

Note that we will consider the expression to be located in the cell A1 of the Active sheet. So for example "=ROW()" will return 1, and "=A2" will return the value of A2 in the active sheet.

Syntax

Namespace: FlexCel.Core

public abstract Object RecalcExpression(String expression, Boolean forced)

Parameters

<-> | Parameter | Type | Description
 | expression | String | Formula to evaluate. It must start with "=" and be a valid Excel formula.
 | forced | Boolean | When true this method will always perform a recalc. When false, only if there has been a change on the spreadsheet. While for performance reasons you will normally want to keep this false, you might need to set it to true if the formulas refer to functions like "=NOW()" or "=RANDOM()" that change every time you recalculate.

Returns

The value of the calculated formula.

Examples

To calculate the sum of all the cells in column A of the sheet "Data", you can use the following code:

    ExcelFile xls = new XlsFile("myfile.xls", true);
    xls.ActiveSheetByName = "Data";
    Double Result = Convert.ToDouble(xls.RecalcExpression("=Sum(A:A)"));

To calculate a simple expression, you can use:

    return (double)xls.RecalcExpression("=1 + 2 * 3");

See also

  • ExcelFile


ExcelFile.RecalcRange Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.RecalcRange Method

This method recalculates a formula that returns a range, and returns the cells that compose it. Note that normally ranges are a single rectangle (like in "=A1:B2"), and in this case this method will return a single element in the array. But you might have a formula like "=A1:A10, C6:C7" which will return two different ranges. In this case, the returned array will have more than one TCellAddressRange. If the formula doesn't resolve to a range or group of ranges, this method will return null.

Syntax

Namespace: FlexCel.Core

public abstract TCellAddressRange[] RecalcRange(Int32 activeSheet, Int32 activeRow, Int32 activeCol, Int32 rowOffset, Int32 colOffset, String expression, Boolean forced, Boolean relativeReferences)

Parameters

<-> | Parameter | Type | Description
 | activeSheet | Int32 | Sheet where you are positioned when doing the calculation. You might pass xls.ActiveSheet here.
 | activeRow | Int32 | Row where you are positioned when doing the calculation. This only matters if you have functions that change depending on the cell you are in. (Mainly =Row() and =Column() functions). If you are not sure, specify 1 here.
 | activeCol | Int32 | Column where you are positioned when doing the calculation. This only matters if you have functions that change depending on the cell you are in. (Mainly =Row() and =Column() functions). If you are not sure, specify 1 here.
 | rowOffset | Int32 | Offset from the first cell of a range. This only matters if you have relative references that change depending on the cell you are in. (This is the case with named ranges or data validations and relative references like A1 instead of $A$1). If you are not sure, specify 0 here.
 | colOffset | Int32 | Offset from the first cell of a range. This only matters if you have relative references that change depending on the cell you are in. (This is the case with named ranges or data validations and relative references like A1 instead of $A$1). If you are not sure, specify 0 here.
 | expression | String | Formula to evaluate. It must start with "=", be a valid Excel formula and resolve to a range of cells.
 | forced | Boolean | When true this method will always perform a recalc. When false, only if there has been a change on the spreadsheet. While for performance reasons you will normally want to keep this false, you might need to set it to true if the formulas refer to functions like "=NOW()" or "=RANDOM()" that change every time you recalculate.
 | relativeReferences | Boolean | Specifies if the references in the formula are relative to the cell where the cursor is positioned or not. Formulas in data validations, name definitions and conditional formats are relative and should have this parameter set to true. Formulas in cell are not relative, and should have this parameter set to false.

Returns

The array of ranges that the formula refers to.

See also

  • ExcelFile


ExcelFile.OffsetRelativeFormula Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.OffsetRelativeFormula Method

Use this method to know the actual formula that applies to a cell when the formula is relative. In some places, mostly data validations and names, Excel returns relative formulas.

So for example you might have a name with a definition of "=Sheet1!A2" when you are positioned at cell A1. If you now move the cursor to cell A2 in Excel, the name definition will be "=Sheet1!A3" since the reference is relative to the cell where the cursor is. If you retrieve the name formula with FlexCel, as FlexCel doesn't have a cursor, it will always return the canonical formula as if you were positioned at A1. If you want to know the real formula when you are positioned at A2, you need to call this method with cellRow =3, cellCol = 1 and expression = "=Sheet1!A2". It will return "=Sheet1!A3".

Remarks

Remember that you can use FormulaReferenceStyle to change the formulas to R1C1 style. R1C1 formulas are nicer for relative formulas, since they don't change when you change the cursor. (R1C1 references are already relative to the cell where the cursor is).

Syntax

Namespace: FlexCel.Core

public abstract String OffsetRelativeFormula(Int32 activeSheet, Int32 cellRow, Int32 cellCol, String expression)

Parameters

<-> | Parameter | Type | Description
 | activeSheet | Int32 | Sheet where you are positioned when doing the calculation. You might pass xls.ActiveSheet here.
 | cellRow | Int32 | Row of the cell where the relative formula is.
 | cellCol | Int32 | Column of the cell where the relative formula is.
 | expression | String | Formula to offset. It must start with "=", and be a valid Excel formula.

Returns

The formula with relative references changed to match the cell at cellRow, cellCol

See also

  • ExcelFile


ExcelFile.RecalcRelativeFormula Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.RecalcRelativeFormula Method

Use this method to know the value of a formula that applies to a cell when the formula is relative. In some places, mostly data validations and names, Excel returns relative formulas.

So for example you might have a name with a definition of "=Sheet1!A2" when you are positioned at cell A1. If you now move the cursor to cell A2 in Excel, the name definition will be "=Sheet1!A3" since the reference is relative to the cell where the cursor is. If you use RecalcExpression(String) to know the result of the formula, as FlexCel doesn't have a cursor, it will always return the canonical formula as if you were positioned at A1. If you want to know the real formula when you are positioned at A2, you need to call this method with cellRow =3, cellCol = 1 and expression = "=Sheet1!A2". It will return the result of the formula "=Sheet1!A3".

Syntax

Namespace: FlexCel.Core

public abstract Object RecalcRelativeFormula(Int32 activeSheet, Int32 cellRow, Int32 cellCol, String expression)

Parameters

<-> | Parameter | Type | Description
 | activeSheet | Int32 | Sheet where you are positioned when doing the calculation. You might pass xls.ActiveSheet here.
 | cellRow | Int32 | Row of the cell where the relative formula is.
 | cellCol | Int32 | Column of the cell where the relative formula is.
 | expression | String | Formula to offset. It must start with "=", and be a valid Excel formula.

Returns

The value of the calculated formula

See also

  • ExcelFile


ExcelFile.RecalcAndVerify Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.RecalcAndVerify Method

Use this method to validate a file. FlexCel does not support all the range of functions from Excel when recalculating, so unknown functions will return "#NAME?" errors. Using this function you can validate your user worksheets and see if all the formulas they use are supported.

Remarks

Note that you *can* use unsupported functions on FlexCel. When you open the generated file on Excel it will show ok. The only problem is if you need to natively print or export to PDF the file.

Also, take in account that RecalcAndVerify is slower than recalc, as it has to do more work to locate the errors. Do not use it as a replace for Recalc

Syntax

Namespace: FlexCel.Core

public abstract TUnsupportedFormulaList RecalcAndVerify()

See also

  • ExcelFile


ExcelFile.GetWhatIfTableList Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.GetWhatIfTableList Method

Returns a list of the upper cells of the What-if tables in the page. You can then use GetWhatIfTable to get the definition of each one.

Syntax

Namespace: FlexCel.Core

public abstract TCellAddress[] GetWhatIfTableList()

See also

  • ExcelFile


ExcelFile.GetWhatIfTable Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.GetWhatIfTable Method

Returns the range of cells that make the what-if table that starts at aRow and aCol. If there is no What-if table at aRow, aCol, this method returns null.

If both the returned rowInputCell and colInputCell are null, this means this table points to deleted references.

Syntax

Namespace: FlexCel.Core

public abstract TXlsCellRange GetWhatIfTable(Int32 sheet, Int32 row, Int32 col, out TCellAddress rowInputCell, out TCellAddress colInputCell)

Parameters

<-> | Parameter | Type | Description
 | sheet | Int32 | Sheet where the table is.
 | row | Int32 | First cell from where we want to get a what-if table.
 | col | Int32 | First cell from where we want to get a what-if table.
out | rowInputCell | TCellAddress | Returns the row input cell for this table. If the table doesn't have a row input cell, this value is null.
out | colInputCell | TCellAddress | Returns the column input cell for this table. If the table doesn't have a column input cell, this value is null.

Returns

The full range of the table, not including the formula headers. Only the cells where {=Table()} formulas are..

See also

  • ExcelFile


ExcelFile.SetWhatIfTable Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.SetWhatIfTable Method

Creates an Excel What-if table in the range of cells specified by Range. Calling this method is the same as setting a cell value with a TFormula where TFormula.Span has more than one cell, and TFormula.Text is something like "{=TABLE(,A4)}". The parameters for the =TABLE function are rowInputCell and colInputCell, and they look the same a Excel will show them.

Syntax

Namespace: FlexCel.Core

public abstract void SetWhatIfTable(TXlsCellRange range, TCellAddress rowInputCell, TCellAddress colInputCell)

Parameters

<-> | Parameter | Type | Description
 | range | TXlsCellRange | Range for the table. This is the range of cells that will have "={TABLE()}" formulas.
 | rowInputCell | TCellAddress | Row input cell for the table. Make it null if you don't want a row input cell. If both rowInputCell and colInputCell are null, a table with deleted references will be added. Note that the sheet here is ignored, What-if tables need the input cells to be in the same sheet as the table.
 | colInputCell | TCellAddress | Column input cell for the table. Make it null if you don't want a column input cell. If both rowInputCell and colInputCell are null, a table with deleted references will be added. Note that the sheet here is ignored, What-if tables need the input cells to be in the same sheet as the table.

See also

  • ExcelFile


ExcelFile.GetLink Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.GetLink Method

Gets the external link at position i.

Syntax

Namespace: FlexCel.Core

public abstract String GetLink(Int32 index)

Parameters

<-> | Parameter | Type | Description
 | index | Int32 | Index of the link (1 based). i goes between 1 and LinkCount

See also

  • ExcelFile


ExcelFile.SetLink Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.SetLink Method

Changes the external link at position i for a new value. Note that you can't add new links with this method, external links are added automatically when you add formulas that reference other worksheets. This method is only to change existing links to point to other place. All formulas pointing to the old link will point to the new.

Note that the replacing filename should have the same sheets as the original, or the formulas might break.

Syntax

Namespace: FlexCel.Core

public abstract void SetLink(Int32 index, String value)

Parameters

<-> | Parameter | Type | Description
 | index | Int32 | Index of the link (1 based). i goes between 1 and LinkCount
 | value | String | Please make sure this is a VALID filename, or you are likely to crash Excel. Also, xls file format doesn't like paths starting with "..", so you might need to enter the full path here.

See also

  • ExcelFile


ExcelFile.ConvertFormulasToValues Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.ConvertFormulasToValues Method

Overloads

  • ExcelFile.ConvertFormulasToValues(Boolean)
  • ExcelFile.ConvertFormulasToValues(Boolean, Boolean)

ExcelFile.ConvertFormulasToValues(Boolean)

Use it to convert formulas to their values. It can be useful if for example you are copying the sheet to another workbook, and you don't want any references to it. NOTE: You will probably want to use ConvertExternalNamesToRefErrors(Boolean) too, to convert named ranges besides the formulas.

Also note that if you want to convert a whole file, you need to call ConvertFormulasToValues in every sheet.

Syntax

Namespace: FlexCel.Core

public void ConvertFormulasToValues(Boolean onlyExternal)

Parameters

<-> | Parameter | Type | Description
 | onlyExternal | Boolean | When true, it will only convert the formulas that do not refer to the same sheet. For example "=A1+Sheet2!A1" will be converted, but "=A2+A3" will not.

See also

  • ExcelFile

ExcelFile.ConvertFormulasToValues(Boolean, Boolean)

Use it to convert formulas to their values. It can be useful if for example you are copying the sheet to another workbook, and you don't want any references to it. NOTE: You will probably want to use ConvertExternalNamesToRefErrors(Boolean) too, to convert named ranges besides the formulas.

Also note that if you want to convert a whole file, you need to call ConvertFormulasToValues in every sheet.

Syntax

Namespace: FlexCel.Core

public abstract void ConvertFormulasToValues(Boolean onlyExternal, Boolean recalcBeforeConverting)

Parameters

<-> | Parameter | Type | Description
 | onlyExternal | Boolean | When true, it will only convert the formulas that do not refer to the same sheet. For example "=A1+Sheet2!A1" will be converted, but "=A2+A3" will not.
 | recalcBeforeConverting | Boolean | If true (the default), FlexCel will try to recalculate the file before converting the formulas. Use false when for any reason FlexCel can't recalculate the values (for example if you have links to other files that don't exist anymore)

See also

  • ExcelFile


ExcelFile.ConvertExternalNamesToRefErrors Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.ConvertExternalNamesToRefErrors Method

Overloads

  • ExcelFile.ConvertExternalNamesToRefErrors
  • ExcelFile.ConvertExternalNamesToRefErrors(Boolean)

ExcelFile.ConvertExternalNamesToRefErrors

Use it to convert the external names in a sheet to #REF! . It can be useful when you need to remove all external links in a file. NOTE: You will probably want to use ConvertFormulasToValues(Boolean) too.

Syntax

Namespace: FlexCel.Core

public void ConvertExternalNamesToRefErrors()

See also

  • ExcelFile

ExcelFile.ConvertExternalNamesToRefErrors(Boolean)

Use it to convert the external names in a sheet to #REF! . It can be useful when you need to remove all external links in a file. NOTE: You will probably want to use ConvertFormulasToValues(Boolean) too.

Syntax

Namespace: FlexCel.Core

public abstract void ConvertExternalNamesToRefErrors(Boolean recalcBeforeConverting)

Parameters

<-> | Parameter | Type | Description
 | recalcBeforeConverting | Boolean | If true (the default), FlexCel will try to recalculate the file before converting the formulas. Use false when for any reason FlexCel can't recalculate the values (for example if you have links to other files that don't exist anymore)

See also

  • ExcelFile


ExcelFile.GetCachedFont0 Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.GetCachedFont0 Method

This method is used by FlexCel itself, you shouldn't call it directly.

Syntax

Namespace: FlexCel.Core

public abstract TCachedFontWidth GetCachedFont0()

See also

  • ExcelFile


ExcelFile.SetCachedFont0 Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.SetCachedFont0 Method

This method is used by FlexCel itself, you shouldn't call it directly.

Syntax

Namespace: FlexCel.Core

public abstract void SetCachedFont0(TCachedFontWidth cachedFont)

Parameters

<-> | Parameter | Type | Description
 | cachedFont | TCachedFontWidth |

See also

  • ExcelFile


ExcelFile.AddUserDefinedFunction Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.AddUserDefinedFunction Method

Adds a custom formula function to the FlexCel recalculation engine. Note that this formulas are only valid for Excel custom formulas, not for internal ones. For example, you could define "EDATE" since it is a custom formula defined in the Analysis Addin, but you cannot redefine "SUM". Note that if a custom formula with the name already exists, it will be replaced. Names are Case insensitive ("Date" is the same as "DATE").

Also note that some user defined functions come already built in FlexCel, so you might not need to define them. For more information on adding Custom Formulas make sure you read 'Using Excel's user defined functions (UDF)' in the Api Developer Guide and take a look at the at the Excel User Defined Functions C Sharp / netframework example.

Syntax

Namespace: FlexCel.Core

public abstract void AddUserDefinedFunction(TUserDefinedFunctionScope scope, TUserDefinedFunctionLocation location, TUserDefinedFunction userFunction)

Parameters

<-> | Parameter | Type | Description
 | scope | TUserDefined​Function​Scope | Defines if the custom function will be available globally to all ExcelFile instances or only to the ExcelFile instance where it was added. It is recommended to add functions globally, unless you have different xls files with functions that might have the same name but could be implemented different.
 | location | TUserDefined​Function​Location | Defines if the function will be inserted as a reference to a macro in the local sheet or in an external book or addin. This parameter is used only when adding formulas with user defined functions to a sheet. It is not needed or used when recalculating those functions or when reading the text of a formula.
 | userFunction | TUserDefinedFunction | Formula function we want to add.

See also

  • ExcelFile


ExcelFile.EvaluateUserDefinedFunction Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.EvaluateUserDefinedFunction Method

Evaluates a custom function you have added earlier with AddUserDefinedFunction. You will not normally need to call this method, but it could be used for testing. If the function has not been added with AddUserDefinedFunction, this method will return TFlxFormulaErrorValue.ErrName.

Syntax

Namespace: FlexCel.Core

public abstract Object EvaluateUserDefinedFunction(String functionName, TUdfEventArgs arguments, Object[] parameters)

Parameters

<-> | Parameter | Type | Description
 | functionName | String | Function you want to evaluate.
 | arguments | TUdfEventArgs | Extra arguments you can use to evaluate the formula.
 | parameters | Object[] | Parameters for the formula.

Returns

The result of evaluating the formula. It might be a string, a double, a boolean, a TFlxFormulaError or an Array.

See also

  • ExcelFile


ExcelFile.ClearUserDefinedFunctions Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.ClearUserDefinedFunctions Method

Removes all the custom formula functions from the FlexCel recalculation engine.

Syntax

Namespace: FlexCel.Core

public abstract void ClearUserDefinedFunctions(TUserDefinedFunctionScope scope)

Parameters

<-> | Parameter | Type | Description
 | scope | TUserDefined​Function​Scope |

See also

  • ExcelFile


ExcelFile.RemoveUserDefinedFunction Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.RemoveUserDefinedFunction Method

Removes a single function from the FlexCel recalculation engine. If the function doesn't exist, this method will return false.

Syntax

Namespace: FlexCel.Core

public abstract Boolean RemoveUserDefinedFunction(TUserDefinedFunctionScope scope, String functionName)

Parameters

<-> | Parameter | Type | Description
 | scope | TUserDefined​Function​Scope |
 | functionName | String | Name of the function. Case insensitive.

Returns

True if the function existed and was removed, false if it didn't exist.

See also

  • ExcelFile


ExcelFile.IsDefinedFunction Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.IsDefinedFunction Method

Overloads

  • ExcelFile.IsDefinedFunction(String)
  • ExcelFile.IsDefinedFunction(String, TUserDefinedFunctionLocation)

ExcelFile.IsDefinedFunction(String)

Returns true if the Custom formula function has been added to the FlexCel recalculating engine. Note that internal functions are not returned by this method, but user defined functions pre-defined in FlexCel will be.

Syntax

Namespace: FlexCel.Core

public Boolean IsDefinedFunction(String functionName)

Parameters

<-> | Parameter | Type | Description
 | functionName | String | Name of the function. Case insensitive.

Returns

True if the name has been added, false if not.

See also

  • ExcelFile

ExcelFile.IsDefinedFunction(String, TUserDefinedFunctionLocation)

Returns true if the Custom formula function has been added to the FlexCel recalculating engine. Note that internal functions are not returned by this method, but user defined functions pre-defined in FlexCel will be.

Syntax

Namespace: FlexCel.Core

public abstract Boolean IsDefinedFunction(String functionName, out TUserDefinedFunctionLocation location)

Parameters

<-> | Parameter | Type | Description
 | functionName | String | Name of the function. Case insensitive.
out | location | TUserDefined​Function​Location | Returns if the function is defined as an internal or external function.

Returns

True if the name has been added, false if not.

See also

  • ExcelFile


ExcelFile.GetFormulaTokens Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.GetFormulaTokens Method

Overloads

  • ExcelFile.GetFormulaTokens(Int32, Int32)
  • ExcelFile.GetFormulaTokens(Int32, Int32, Int32)

ExcelFile.GetFormulaTokens(Int32, Int32)

Returns the formula of a cell as an RPN list of tokens that you can use to analyze it. If the cell doesn't have a formula, then this method will return null.

Note that the result is an RPN expression, so for example the formula "= 1 * 2 + 3" would be returned as "1, 2, *, 3, +". While the formula "= 1 * (2 + 3)" would be returned as "1, 2, 3, +, *"

Syntax

Namespace: FlexCel.Core

public TTokenList GetFormulaTokens(Int32 row, Int32 col)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row of the cell with the formula. (1 based)
 | col | Int32 | Column of the cell with the formula. (1 based)

See also

  • ExcelFile

ExcelFile.GetFormulaTokens(Int32, Int32, Int32)

Returns the formula of a cell as an RPN list of tokens that you can use to analyze it. If the cell doesn't have a formula, then this method will return null.

Note that the result is an RPN expression, so for example the formula "= 1 * 2 + 3" would be returned as "1, 2, *, 3, +". While the formula "= 1 * (2 + 3)" would be returned as "1, 2, 3, +, *"

See Using Tokens for more information.

Syntax

Namespace: FlexCel.Core

public abstract TTokenList GetFormulaTokens(Int32 sheet, Int32 row, Int32 col)

Parameters

<-> | Parameter | Type | Description
 | sheet | Int32 | Sheet where the formula is.
 | row | Int32 | Row of the cell with the formula. (1 based)
 | col | Int32 | Column of the cell with the formula. (1 based)

See also

  • ExcelFile


ExcelFile.GetTokens Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.GetTokens Method

Returns the tokens for a formula in text form. See GetFormulaTokens(Int32, Int32) for more information.

Syntax

Namespace: FlexCel.Core

public abstract TTokenList GetTokens(Int32 sheet, String formula)

Parameters

<-> | Parameter | Type | Description
 | sheet | Int32 | Sheet where the formula is. This is used to know if the A1 in the formula "=A1" refers to Sheet1!A1 or Sheet2!A1. This value is 1 based, and you can pass ActiveSheet if the formula is in the active sheet.
 | formula | String | Formula we want to convert into tokens. Must start with an "=" sign.

See also

  • ExcelFile


ExcelFile.SetFormulaTokens Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.SetFormulaTokens Method

Overloads

  • ExcelFile.SetFormulaTokens(Int32, Int32, TTokenList)
  • ExcelFile.SetFormulaTokens(Int32, Int32, Int32, TTokenList)

ExcelFile.SetFormulaTokens(Int32, Int32, TTokenList)

Sets a cell with the formula specified by its tokens. Normally you will get the tokens by modifying the result of GetFormulaTokens(Int32, Int32)

Syntax

Namespace: FlexCel.Core

public void SetFormulaTokens(Int32 row, Int32 col, TTokenList tokens)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row of the cell with the formula. (1 based)
 | col | Int32 | Column of the cell with the formula. (1 based)
 | tokens | TTokenList | A collection of tokens which define the formula.

See also

  • ExcelFile

ExcelFile.SetFormulaTokens(Int32, Int32, Int32, TTokenList)

Sets a cell with the formula specified by its tokens. Normally you will get the tokens by modifying the result of GetFormulaTokens(Int32, Int32)

Syntax

Namespace: FlexCel.Core

public abstract void SetFormulaTokens(Int32 sheet, Int32 row, Int32 col, TTokenList tokens)

Parameters

<-> | Parameter | Type | Description
 | sheet | Int32 | Sheet of the cell with the formula. (1 based)
 | row | Int32 | Row of the cell with the formula. (1 based)
 | col | Int32 | Column of the cell with the formula. (1 based)
 | tokens | TTokenList | A collection of tokens which define the formula.

See also

  • ExcelFile


ExcelFile.SetTokens Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.SetTokens Method

This method converts a list of tokens in the corresponding string. Normally you get the tokens from GetTokens or GetFormulaTokens(Int32, Int32)

Syntax

Namespace: FlexCel.Core

public abstract String SetTokens(Int32 sheet, Int32 row, Int32 col, TTokenList tokens)

Parameters

<-> | Parameter | Type | Description
 | sheet | Int32 | Sheet where the formula is. This is used to know if the A1 in the formula "=A1" refers to Sheet1!A1 or Sheet2!A1. This value is 1 based, and you can pass ActiveSheet if the formula is in the active sheet.
 | row | Int32 | Row where the formula is going to be. (1 based)
 | col | Int32 | Column where the formula is going to be. (1 based)
 | tokens | TTokenList | A collection of tokens which define the formula.

Returns

A string representing the formula. Includes the "=" sign at the start.

See also

  • ExcelFile


ExcelFile.RemoveMacros Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.RemoveMacros Method

If the file has macros, this method will remove them.

Syntax

Namespace: FlexCel.Core

public abstract void RemoveMacros()

See also

  • ExcelFile


ExcelFile.HasMacros Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.HasMacros Method

Returns true if the file has any macros.

Syntax

Namespace: FlexCel.Core

public abstract Boolean HasMacros()

See also

  • ExcelFile


ExcelFile.UnshareWorkbook Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.UnshareWorkbook Method

Removes the "track changes" information of the workbook and unshares the workbook. This is only needed for xls files, as FlexCel doesn't save tracking changes in xlsx files, and the feature is deprecated in Excel.

Syntax

Namespace: FlexCel.Core

public abstract void UnshareWorkbook()

See also

  • ExcelFile


ExcelFile.IsSharedWorkbook Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.IsSharedWorkbook Method

Returns true is this is a shared workbook. This method only will return true for xls files, since FlexCel doesn't load tracking changes in xlsx files.

Syntax

Namespace: FlexCel.Core

public abstract Boolean IsSharedWorkbook()

See also

  • ExcelFile


ExcelFile.HasWebAddinTaskPanes Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.HasWebAddinTaskPanes Method

Returns true if the file has any task pane web add-in. Note that this only applies to task pane addins. The content addins are just objects in the sheet.

Syntax

Namespace: FlexCel.Core

public abstract Boolean HasWebAddinTaskPanes()

See also

  • ExcelFile


ExcelFile.RemoveWebAddinTaskPanes Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.RemoveWebAddinTaskPanes Method

Removes all task pane web add-ins from the file. Note that this will only remove the task pane addins. You can remove the content addins by removing the corresponding objects in the sheet with DeleteObject(Int32)

Syntax

Namespace: FlexCel.Core

public abstract void RemoveWebAddinTaskPanes()

See also

  • ExcelFile


ExcelFile.GetCustomTableStyle Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.GetCustomTableStyle Method

Overloads

  • ExcelFile.GetCustomTableStyle(String)
  • ExcelFile.GetCustomTableStyle(Int32)

ExcelFile.GetCustomTableStyle(String)

Gets the custom table style with a given name. If the name doesn't exist, this method returns null.

Syntax

Namespace: FlexCel.Core

public abstract TCustomTableStyle GetCustomTableStyle(String name)

Parameters

<-> | Parameter | Type | Description
 | name | String | Name of the table style we want to retrieve. Case insensitive: "NAME" is the same as "name".

See also

  • ExcelFile

ExcelFile.GetCustomTableStyle(Int32)

Gets the custom table style at position index (1 based).

Syntax

Namespace: FlexCel.Core

public abstract TCustomTableStyle GetCustomTableStyle(Int32 index)

Parameters

<-> | Parameter | Type | Description
 | index | Int32 | Position for the custom style in the style table. (1 based). If index is less than 0 or equal or bigger than CustomTableStyleCount then this method will throw an exception.

See also

  • ExcelFile


ExcelFile.HasCustomTableStyle Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.HasCustomTableStyle Method

Returns true if the workbook has a custom table style with name "name".

Syntax

Namespace: FlexCel.Core

public abstract Boolean HasCustomTableStyle(String name)

Parameters

<-> | Parameter | Type | Description
 | name | String | Name of the custom table style to check. Case insensitive: "NAME" is the same as "name".

See also

  • ExcelFile


ExcelFile.SetCustomTableStyle Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.SetCustomTableStyle Method

Adds a new or replaces an existing table style.

Syntax

Namespace: FlexCel.Core

public abstract void SetCustomTableStyle(TCustomTableStyle aTableStyle)

Parameters

<-> | Parameter | Type | Description
 | aTableStyle | TCustomTableStyle | Custom table style definition.

See also

  • ExcelFile


ExcelFile.RenameCustomTableStyle Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.RenameCustomTableStyle Method

Renames an existing custom table style. Note that this method won't change the table styles from existing tables from oldName to newName. So after renaming a table style, you should loop in all the tables in the workbook which use that table style, and manually rename their custom table styles too.

Syntax

Namespace: FlexCel.Core

public abstract void RenameCustomTableStyle(String oldName, String newName)

Parameters

<-> | Parameter | Type | Description
 | oldName | String | Existing table style. If the old table style name doesn't exist, this method will raise an exception.
 | newName | String | New name for the table style. If the new table style already exists, this method will raise an exception.

See also

  • ExcelFile


ExcelFile.DeleteCustomTableStyle Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.DeleteCustomTableStyle Method

Overloads

  • ExcelFile.DeleteCustomTableStyle(Int32)
  • ExcelFile.DeleteCustomTableStyle(String)

ExcelFile.DeleteCustomTableStyle(Int32)

Deletes an existing table style.

Syntax

Namespace: FlexCel.Core

public abstract void DeleteCustomTableStyle(Int32 index)

Parameters

<-> | Parameter | Type | Description
 | index | Int32 | Position of the table style to delete (1 based).

See also

  • ExcelFile

ExcelFile.DeleteCustomTableStyle(String)

Deletes an existing table style given its name.

Syntax

Namespace: FlexCel.Core

public abstract void DeleteCustomTableStyle(String name)

Parameters

<-> | Parameter | Type | Description
 | name | String | Name of the table style to delete. If the name doesn't exist, this method will throw an exception. Case insensitive: "NAME" is the same as "name". You can use HasCustomTableStyle to check if a table style exists before deleting it.

See also

  • ExcelFile


ExcelFile.DeleteAllCustomTableStylesInWorkbook Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.DeleteAllCustomTableStylesInWorkbook Method

Deletes all custom table styles in the workbook.

Syntax

Namespace: FlexCel.Core

public abstract void DeleteAllCustomTableStylesInWorkbook()

See also

  • ExcelFile


ExcelFile.GetTable Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.GetTable Method

Overloads

  • ExcelFile.GetTable(String)
  • ExcelFile.GetTable(Int32)
  • ExcelFile.GetTable(String, Boolean)

ExcelFile.GetTable(String)

Returns the definition for a table in the file. Note that this method will return any table in the file, not only in the active sheet, as table names are unique in the whole workbook. You can find which sheet the table is in with GetTableSheet

Syntax

Namespace: FlexCel.Core

public TTableDefinition GetTable(String tableName)

Parameters

<-> | Parameter | Type | Description
 | tableName | String | Name of the table.

Returns

Null if the table doesn't exist, or the table definition otherwise.

See also

  • ExcelFile

ExcelFile.GetTable(Int32)

Returns the table definition for the table at position tableIndex, for the active sheet. (1 based)

Syntax

Namespace: FlexCel.Core

public abstract TTableDefinition GetTable(Int32 tableIndex)

Parameters

<-> | Parameter | Type | Description
 | tableIndex | Int32 | Position of the table in the active sheet. (1-based)

Returns

The table definition. If tableIndex is out of range, then it will throw an Exception.

See also

  • ExcelFile

ExcelFile.GetTable(String, Boolean)

Returns the definition for a table in the file. Note that this method will return any table in the file, not only in the active sheet, as table names are unique in the whole workbook. You can find which sheet the table is in with GetTableSheet

Syntax

Namespace: FlexCel.Core

public abstract TTableDefinition GetTable(String tableName, Boolean ignoreFormulas)

Parameters

<-> | Parameter | Type | Description
 | tableName | String | Name of the table.
 | ignoreFormulas | Boolean | If true, this method won't return the formulas for the totals and the column. This parameter allows to get the table a little faster, when you are not interested in the formulas.

Returns

Null if the table doesn't exist, or the table definition otherwise.

See also

  • ExcelFile


ExcelFile.GetTableSheet Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.GetTableSheet Method

Returns the sheet number of the table, or raises an exception if the table doesn't exist.

Syntax

Namespace: FlexCel.Core

public abstract Int32 GetTableSheet(String tableName)

Parameters

<-> | Parameter | Type | Description
 | tableName | String |

See also

  • ExcelFile


ExcelFile.HasTable Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.HasTable Method

Returns true if the table exists in the file.

Syntax

Namespace: FlexCel.Core

public abstract Boolean HasTable(String tableName)

Parameters

<-> | Parameter | Type | Description
 | tableName | String | Name of the table (case insensitive).

See also

  • ExcelFile


ExcelFile.GetTableName Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.GetTableName Method

If there is a table in the cell at (row, col) then this method will return the name of the table. If not it will return an empty string.

Syntax

Namespace: FlexCel.Core

public abstract String GetTableName(Int32 sheet, Int32 row, Int32 col)

Parameters

<-> | Parameter | Type | Description
 | sheet | Int32 | Sheet where to find the table (1 based)
 | row | Int32 | Row, 1 based.
 | col | Int32 | Column, 1 based.

See also

  • ExcelFile


ExcelFile.GetTableAtCell Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.GetTableAtCell Method

If there is a table in the cell at (row, col) then this method will return the table definition. If not it will return null.

Syntax

Namespace: FlexCel.Core

public abstract TTableDefinition GetTableAtCell(Int32 sheet, Int32 row, Int32 col)

Parameters

<-> | Parameter | Type | Description
 | sheet | Int32 | Sheet where to find the table (1 based)
 | row | Int32 | Row, 1 based.
 | col | Int32 | Column, 1 based.

See also

  • ExcelFile


ExcelFile.AddTable Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.AddTable Method

Adds a table to the active sheet.

Syntax

Namespace: FlexCel.Core

public abstract void AddTable(TTableDefinition aTable)

Parameters

<-> | Parameter | Type | Description
 | aTable | TTableDefinition | Table to add.

See also

  • ExcelFile


ExcelFile.SetTable Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.SetTable Method

Changes an existing table. The table to change is given by the table name in aTable. Note that this method won't change the name of the table. To do so, you need to call RenameTable

Syntax

Namespace: FlexCel.Core

public abstract void SetTable(TTableDefinition aTable)

Parameters

<-> | Parameter | Type | Description
 | aTable | TTableDefinition | Table to modify.

See also

  • ExcelFile


ExcelFile.RenameTable Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.RenameTable Method

Renames an existing table to a new name, renaming also all references to that table. Note that the final name of the table might not be the name you specified in newName, if newName already existed. You need to check the result of this method to know the actual name which the table was renamed to.

Syntax

Namespace: FlexCel.Core

public abstract String RenameTable(String existingName, String newName)

Parameters

<-> | Parameter | Type | Description
 | existingName | String | Existing name of the table.
 | newName | String | New name of the table.

Returns

The actual new name of the table. It might be different from newName if newName already existed in the file.

See also

  • ExcelFile


ExcelFile.DeleteTable Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.DeleteTable Method

Deletes a table from the workbook, based on its name. Note that the table might not be in the active sheet. Note also that this will only delete the table itself, but not the data inside.

Syntax

Namespace: FlexCel.Core

public abstract void DeleteTable(String aName)

Parameters

<-> | Parameter | Type | Description
 | aName | String | Name of the table to delete.

See also

  • ExcelFile


ExcelFile.DeleteAllTablesInSheet Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.DeleteAllTablesInSheet Method

Removes all the tables in the active sheet. The contents are not removed, only the table itself.

Syntax

Namespace: FlexCel.Core

public abstract void DeleteAllTablesInSheet()

See also

  • ExcelFile


ExcelFile.PivotTableCountInSheet Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.PivotTableCountInSheet Method

Returns the number of pivot tables in the active sheet.

Syntax

Namespace: FlexCel.Core

public abstract Int32 PivotTableCountInSheet()

See also

  • ExcelFile


ExcelFile.AddCustomXmlPart Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.AddCustomXmlPart Method

Adds a custom XML part to the file, as described in https://msdn.microsoft.com/en-us/library/bb608618.aspx

Remarks

Excel saves the file in the encoding specified by the xml declaration. But this goes against the spec.

From Open Packaging specification:

XML content shall be encoded using either UTF-8 or UTF-16. If any part includes an encoding declaration, as defined in $4.3.3 of the XML 1.0 specification, that declaration shall not name any encoding other than UTF-8 or UTF-16. Package implementers shall enforce this requirement upon creation and retrieval of the XML content. [M1.17]

FlexCel will behave like Excel and use the encoding in the xml declaration if one is present, but you should make that encoding UTF8 or UTF16.

Syntax

Namespace: FlexCel.Core

public abstract void AddCustomXmlPart(TCustomXmlPart part)

Parameters

<-> | Parameter | Type | Description
 | part | TCustomXmlPart | Part to add.

See also

  • ExcelFile


ExcelFile.RemoveCustomXmlPart Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.RemoveCustomXmlPart Method

Deletes the part at the given position. ( 1 based)

Syntax

Namespace: FlexCel.Core

public abstract void RemoveCustomXmlPart(Int32 position)

Parameters

<-> | Parameter | Type | Description
 | position | Int32 | 1-based index in the collection of custom parts.

See also

  • ExcelFile


ExcelFile.GetCustomXmlPart Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.GetCustomXmlPart Method

Returns the part at the given position. (1 based)

Syntax

Namespace: FlexCel.Core

public abstract TCustomXmlPart GetCustomXmlPart(Int32 position)

Parameters

<-> | Parameter | Type | Description
 | position | Int32 | 1-based index in the collection of custom parts.

See also

  • ExcelFile


ExcelFile.SetXmlMap Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.SetXmlMap Method

Sets the XML Maps in the file. This is equivalent to going to the "Developer" tab in Excel and then clicking in Source in the XML section.

Set it to null to remove the XML Maps in the file.

Remarks

This method only works for xlsx/m files, not for xls.

Syntax

Namespace: FlexCel.Core

public abstract void SetXmlMap(TXmlMap map)

Parameters

<-> | Parameter | Type | Description
 | map | TXmlMap | Map that we wish to set. Make it null to remove the maps in the file.

See also

  • ExcelFile


ExcelFile.GetXmlMap Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.GetXmlMap Method

Returns the XML Maps in the file if it has any, or null if there are no XML Maps. Note that the map returned is a copy, so modifying it won't modify the map in the file. To modify the map in the file you need to get it with GetXmlMap, modify it, then set it with SetXmlMap

Remarks

This method only works for xlsx/m files, not for xls.

Syntax

Namespace: FlexCel.Core

public abstract TXmlMap GetXmlMap()

See also

  • ExcelFile


ExcelFile.GetEnumerator Method | FlexCel Studio for the .NET Framework documentation

ExcelFile.GetEnumerator Method

Returns an enumerator that allows you to loop on all cells in the active worksheet. Once you start the foreach loop, you might change the active sheet and it won't change inside the enumerator.

Syntax

Namespace: FlexCel.Core

public IEnumerator<CellValue> GetEnumerator()

See also

  • ExcelFile


ExcelFile.ActiveWindow Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.ActiveWindow Property

Gets or sets the active windows to which some sheet and workbook options like zoom will apply. (1 based) Note that spreadsheets normally have a single Window, so this value will most likely be 1 and should stay that way. If you are working with multiple spreadsheet windows, you can change this property to change the sheet options of a particular window. The properties that apply to a specific window and are affected by this property mention it on their docs.

Syntax

Namespace: FlexCel.Core

public abstract Int32 ActiveWindow { get; set; }

See also

  • ExcelFile


ExcelFile.WindowCount Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.WindowCount Property

Returns the number of windows in the file. Note that this isn't the sheet count, but the number of views of the workbook. Most Excel documents have only one window.

Syntax

Namespace: FlexCel.Core

public abstract Int32 WindowCount { get; }

See also

  • ExcelFile


ExcelFile.ActiveSheetForActiveWindow Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.ActiveSheetForActiveWindow Property

Gets or sets the active sheet for the ActiveWindow. Note that this won't change the active sheet for FlexCel when you enter a value, you still need to call ActiveSheet for that. This property will only change the sheet that is active in that window when you open the file in Excel. Setting this property will also unselect the other sheets. If you want to select multiple sheets, make sure to select them *after* setting the ActiveSheetForActiveWindow.

Syntax

Namespace: FlexCel.Core

public abstract Int32 ActiveSheetForActiveWindow { get; set; }

See also

  • ExcelFile


ExcelFile.VirtualMode Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.VirtualMode Property

Set this value to true to turn Virtual Mode on. Look at 'Virtual mode' in the Performance Guide for more information.

Syntax

Namespace: FlexCel.Core

public Boolean VirtualMode { get; set; }

Examples

You can find a full example of Virtual mode in the sample: 10.API\22.Virtual Mode But here we will show a simpler example which reads only the first row of cells from the first sheet and then exits.

    static void ReadFirstRowOfAllSheets(string fileName)
    {
        XlsFile xls = new XlsFile(); //Create the object but don't open the file yet.
        xls.VirtualMode = true;  //Set the mode to Virtual.
        xls.VirtualCellRead += (sender, e) =>
        {
            if (e.Cell.Row > 1)
            {
                if (e.Cell.Sheet < e.SheetNames.Length) e.NextSheet = e.SheetNames[e.Cell.Sheet]; //Stop reading this sheet, move to the next.
                else e.NextSheet = null; //Stop reading the file.
            }
            else
            {
                Console.WriteLine("Cell: " + new TCellAddress(e.SheetNames[e.Cell.Sheet - 1], e.Cell.Row, e.Cell.Col, false, false).CellRef);
                Console.Write("Value: ");
                Console.WriteLine(e.Cell.Value);
            }
        };
        xls.Open(fileName);
    }

See also

  • ExcelFile


ExcelFile.DefaultFileFormat Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.DefaultFileFormat Property

Determines the default file format used by Excel when saving a file without specifying one, and when the file format can't be determined from the extension of the file. If set to Automatic (The default) the file will be saved in the same format it was opened. That is, if you opened an xlsx file it will be saved as xlsx. If you opened an xls file (or created it with XlsFile.NewFile()) it will be saved as xls. When this property is automatic, text files will be saved as xls.

Syntax

Namespace: FlexCel.Core

public TFileFormats DefaultFileFormat { get; set; }

See also

  • ExcelFile


ExcelFile.ExcelVersion Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.ExcelVersion Property

Defines the Excel mode used in this thread. Note that while on v2007 (the default) you still can make xls 97 spreadsheets, so the only reason to change this setting is if you have any compatibility issues (for example your formulas depend on a sheet having 65536 rows). IMPORTANT: Do NOT change this value after reading a workbook. Also, remember that the value is changed for all the reports in all threads.

Syntax

Namespace: FlexCel.Core

public static TExcelVersion ExcelVersion { get; set; }

See also

  • ExcelFile


ExcelFile.XlsBiffVersion Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.XlsBiffVersion Property

Xls files created by Excel 2007 have additional records that allow the generated file to store characteristics not available in Excel 2003 or older. (Like for example True color for cells instead of 54 colors). When opening an xls file created by Excel 2007 in Excel 2007, Excel will be able to read those values back.

By default FlexCel will read those extra records and when reading, and identify the file it creates as created by Excel 2007 when writing, so when you open it in Excel 2007 it will read those additional records. If for any reason you prefer FlexCel to behave as Excel 2003, saving the files as if they were created by Excel 2003 (So Excel 2007 will ignore the additional characteristics), and also stop FlexCel from reading those extra records, just change the value of this property.

Syntax

Namespace: FlexCel.Core

public TXlsBiffVersion XlsBiffVersion { get; set; }

See also

  • ExcelFile


ExcelFile.ExcelFileFormat Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.ExcelFileFormat Property

Empty files created by different versions of Excel can have different characteristics. For example, the default font in an Excel 2003 file is Arial, while the default in 2007 is Calibri, and in 2023 it is Aptos. This property returns the version of file that is loaded into FlexCel. When calling NewFile(Int32, TExcelFileFormat) or when opening a new file, FlexCel will update the value of this property.

Syntax

Namespace: FlexCel.Core

public abstract TExcelFileFormat ExcelFileFormat { get; }

See also

  • ExcelFile


ExcelFile.XlsxExtraCompatibility Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.XlsxExtraCompatibility Property

By default, FlexCel creates xlsx files that conform to the published xlsx spec, but are not necessarily the same as a file Excel would create. FlexCel might use different prefixes, etc, as the ones Excel choose to use. While this is ok, some third party tools might have problems opening the xlsx files if they are not exactly as Excel would create them. If you are having issues with third party tools and the xlsx files created by FlexCel, you can try setting this property to true. Note: setting this property to true might result in files that contain invalid Ids, because the Ids are used by FlexCel and Excel. This is a very unlikely possibility, but the risk is there. If possible, it is best to keep this property false.

Syntax

Namespace: FlexCel.Core

public abstract Boolean XlsxExtraCompatibility { get; set; }

See also

  • ExcelFile


ExcelFile.XlsxCompatibilityConvertIndexedColorsToRGB Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.XlsxCompatibilityConvertIndexedColorsToRGB Property

By default, if an xls or xlsx file has indexed colors or if you set an indexed color with the FlexCelAPI, FlexCel will save those colors as indexed in the final file. This is correct and the default, but LibreOffice/OpenOffice at the time of this writing (version 6.2) won't understand indexed colors in xlsx files. So if you have xlsx files with indexed colors that you want to display correctly in Libre/OpenOffice, you must turn this property on.

Syntax

Namespace: FlexCel.Core

public abstract Boolean XlsxCompatibilityConvertIndexedColorsToRGB { get; set; }

See also

  • ExcelFile


ExcelFile.StrictOpenXml Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.StrictOpenXml Property

Read this file to know if the xlsx file loaded by FlexCel is a normal xlsx file or a "Strict Open XML file". Set this property to make FlexCel save as strict or normal open xlsx file.

This property has no effect in xls files, only in xlsx. If you are not sure about what a strict open xml file is, just keep this property false and FlexCel will output normal xlsx files.

IMPORTANT:FlexCel works by preserving a lot of stuff it doesn't know about, and that stuff might be valid in normal files and invalid in strict files or vice-versa. So if you open an strict file and save it as normal, or open a normal file and save it as strict, it might happen that FlexCel preserves some records or namespaces that are not allowed in the new format. Given this, you shouldn't use this property to change the type of existing files, except for simple files or files that you created yourself with NewFile. You should normally read strict files and save them as strict, or read normal files and save them as normal.

Syntax

Namespace: FlexCel.Core

public abstract Boolean StrictOpenXml { get; set; }

See also

  • ExcelFile


ExcelFile.KeepMaxRowsAndColumnsWhenUpdating Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.KeepMaxRowsAndColumnsWhenUpdating Property

Defines what FlexCel will do when it finds a reference to the last row or column in an Excel 97-2003 spreadsheet, and it is upgrading to Excel 2007. If false (the default) row 65536 will be updated to row 1048576, and column 256 to column 16384. If true, references will stay the same. Note: This is a static global property, so it affects all threads running.

Syntax

Namespace: FlexCel.Core

public static Boolean KeepMaxRowsAndColumnsWhenUpdating { get; set; }

See also

  • ExcelFile


ExcelFile.ActiveFileName Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.ActiveFileName Property

The file we are working on. When we save the file with another name, it changes. When we open a stream, it is set to "". This value is also used to get the text of Headers and Footers (when using the filename macro). When using the filename macro on headers/footers, make sure you set this value to what you want.

Syntax

Namespace: FlexCel.Core

public abstract String ActiveFileName { get; set; }

See also

  • ExcelFile


ExcelFile.AllowOverwritingFiles Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.AllowOverwritingFiles Property

Determines if a call to "Save()" will automatically overwrite an existing file or not.

Syntax

Namespace: FlexCel.Core

public Boolean AllowOverwritingFiles { get; set; }

See also

  • ExcelFile


ExcelFile.IsXltTemplate Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.IsXltTemplate Property

Determines if the file is a template (xlt format instead of xls, xltx instead of xlsx, or xltm instead of xlsm). Both file formats are nearly identical, but there is an extra record needed so the file is a proper xlt template. Note that when saving to a file, FlexCel can detect if this is a template from the extension, and so if you save to *.xlt, *.xltx or *.xltm the file will be saved as template, even if this property is false. When saving to a stream, you need to set this property correctly because FlexCel can't guess it from the filename.

Syntax

Namespace: FlexCel.Core

public abstract Boolean IsXltTemplate { get; set; }

See also

  • ExcelFile


ExcelFile.ActiveSheet Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.ActiveSheet Property

The Sheet where we are working on, 1-based(First sheet is 1, not 0). Always set this property before working on a file. You can read or write this value.

Remarks

Setting the active sheet will also set the selected sheet in the file, except when the object is a light clone (LightClone) For lightcloned object, the selected file won't change. Also if the file has multiple windows, this property will only change the selected sheet for the first window. Use ActiveSheetForActiveWindow if you want to change the active sheet for a different window.

Finally, remember that a file can have more than one sheet selected, even if only one can be active. To Select mutiple sheets, call SetSheetSelected.

Syntax

Namespace: FlexCel.Core

public abstract Int32 ActiveSheet { get; set; }

See also

  • ExcelFile


ExcelFile.ActiveSheetByName Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.ActiveSheetByName Property

The sheet where we are working on, referred by name instead of by index. To change the active sheet name, use SheetName

Remarks

Setting the active sheet will also set the selected sheet in the file, except when the object is a light clone (LightClone) For lightcloned object, the selected file won't change.

Syntax

Namespace: FlexCel.Core

public abstract String ActiveSheetByName { get; set; }

See also

  • ExcelFile


ExcelFile.SheetCount Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.SheetCount Property

The number of sheets on the file.

Syntax

Namespace: FlexCel.Core

public abstract Int32 SheetCount { get; }

See also

  • ExcelFile


ExcelFile.SheetCountVisible Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.SheetCountVisible Property

Number of visible sheets in the file.

Syntax

Namespace: FlexCel.Core

public abstract Int32 SheetCountVisible { get; }

See also

  • ExcelFile


ExcelFile.SheetName Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.SheetName Property

Reads and changes the name of the active sheet. To switch to another sheet by its name, use ActiveSheetByName

Remarks

This name must be unique in the file. It can be up to 31 characters long, and it can't contain the characters "/", "\", "?", "[", "]", "*" or ":"

Syntax

Namespace: FlexCel.Core

public abstract String SheetName { get; set; }

See also

  • ExcelFile


ExcelFile.SheetCodeName Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.SheetCodeName Property

Returns or sets the codename of a sheet, that is an unique identifier assigned to the sheet when it is created. Codenames are useful because they never change once the file is created, and they are what macros reference. Very important! We don't support changing codenames if the file has macros, because we can't modify the required macros to use the modified codename. Also, Excel 2003 or older will ignore the codename if the file doesn't have macros. Excel 2007 or newer will preserve the codenames even if the file doesn't have macros.

Syntax

Namespace: FlexCel.Core

public abstract String SheetCodeName { get; set; }

See also

  • ExcelFile


ExcelFile.SheetID Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.SheetID Property

Returns an unique identifier for the active sheet. This is a value that is only used by FlexCel, and you can use it together with GetSheetIndexFromID to retrieve a sheet after deleting or adding sheets. While normally you can use ActiveSheet to store and retrieve a sheet, if you plan to delete or add sheets before restoring the active sheet, the stored ActiveSheet could become invalid. Note that this is a value internal for FlexCel, and not stored in the xls/x file. SheetIDs will change every time you open the file.

Syntax

Namespace: FlexCel.Core

public abstract Guid SheetID { get; }

See also

  • ExcelFile


ExcelFile.SheetVisible Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.SheetVisible Property

Sets the visibility of the active sheet.

Syntax

Namespace: FlexCel.Core

public abstract TXlsSheetVisible SheetVisible { get; set; }

See also

  • ExcelFile


ExcelFile.SheetZoom Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.SheetZoom Property

Reads/Writes the zoom of the current sheet. Note that this property refers to the zoom in the current page view mode. If you are for example in Page Break Preview mode, this would be the zoom for Page Break Preview. You can change of page view mode and the zoom for all of the modes with SheetView This property can work in different windows depending on the value of ActiveWindow

Syntax

Namespace: FlexCel.Core

public abstract Int32 SheetZoom { get; set; }

See also

  • ExcelFile


ExcelFile.FirstSheetVisible Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.FirstSheetVisible Property

This is the first sheet that will be visible in the bar of sheet tabs at the bottom. Normally you will want this to be 1. Note that every time you change ActiveSheet this value gets reset, because it makes no sense to preserve it.

If you want to change it, change it before saving. The same way, to read it, read it just after opening the file.

Please also note that if the first sheet you select is hidden, FlexCel will ignore this value and select a visible sheet. (otherwise Excel would crash) This property can work in different windows depending on the value of ActiveWindow

Syntax

Namespace: FlexCel.Core

public abstract Int32 FirstSheetVisible { get; set; }

See also

  • ExcelFile


ExcelFile.SheetTabColor Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.SheetTabColor Property

Reads/Writes the color of the current sheet tab. TExcelColor.Automatic to specify no color.

Syntax

Namespace: FlexCel.Core

public abstract TExcelColor SheetTabColor { get; set; }

See also

  • ExcelFile


ExcelFile.SheetView Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.SheetView Property

Returns and sets the page view mode with their corresponding zooms. Note that changing the zoom here changes SheetZoom This property can work in different windows depending on the value of ActiveWindow

Syntax

Namespace: FlexCel.Core

public abstract TSheetView SheetView { get; set; }

See also

  • ExcelFile


ExcelFile.SheetIsRightToLeft Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.SheetIsRightToLeft Property

If true then the sheet goes from right to left, with A1 starting at the top right of the page. You can also set this option with SheetOptions

Syntax

Namespace: FlexCel.Core

public abstract Boolean SheetIsRightToLeft { get; set; }

See also

  • ExcelFile


ExcelFile.ShowGridLines Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.ShowGridLines Property

True if the gray grid lines are shown on the Active sheet. You can also set this option with SheetOptions This property can work in different windows depending on the value of ActiveWindow

Syntax

Namespace: FlexCel.Core

public abstract Boolean ShowGridLines { get; set; }

See also

  • ExcelFile


ExcelFile.ShowGridHeadings Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.ShowGridHeadings Property

True is the column headings ("A", "B", etc) and row headings ("1", "2", etc) are shown. You can also set this option with SheetOptions by changing TSheetOptions.ShowRowAndColumnHeaders This property can work in different windows depending on the value of ActiveWindow

Syntax

Namespace: FlexCel.Core

public abstract Boolean ShowGridHeadings { get; set; }

See also

  • ExcelFile


ExcelFile.ShowFormulaText Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.ShowFormulaText Property

When true, the formula text will be displayed instead of the formula value. You can also set this option with SheetOptions This property can work in different windows depending on the value of ActiveWindow

Syntax

Namespace: FlexCel.Core

public abstract Boolean ShowFormulaText { get; set; }

See also

  • ExcelFile


ExcelFile.GridLinesColor Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.GridLinesColor Property

Color of the grid separator lines. This property can work in different windows depending on the value of ActiveWindow

Syntax

Namespace: FlexCel.Core

public abstract TExcelColor GridLinesColor { get; set; }

See also

  • ExcelFile


ExcelFile.HideZeroValues Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.HideZeroValues Property

When true number 0 will be shown as empty. You can also set this option with SheetOptions This property can work in different windows depending on the value of ActiveWindow

Syntax

Namespace: FlexCel.Core

public abstract Boolean HideZeroValues { get; set; }

See also

  • ExcelFile


ExcelFile.SheetType Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.SheetType Property

Use this property to know it the ActiveSheet is a worksheet, a chart sheet or other.

Syntax

Namespace: FlexCel.Core

public abstract TSheetType SheetType { get; }

See also

  • ExcelFile


ExcelFile.SheetOptions Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.SheetOptions Property

This property groups a lot of properties of the sheet, like for example if it is showing formula texts or the results. Most of this properties can be changed directly from XlsFile, but this method allows you to change them all together, or to easily copy the options from one file to another. Look also at SheetWindowOptions for options that affect all sheets. This property can work in different windows depending on the value of ActiveWindow

Syntax

Namespace: FlexCel.Core

public abstract TSheetOptions SheetOptions { get; set; }

See also

  • ExcelFile


ExcelFile.SheetWindowOptions Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.SheetWindowOptions Property

This property groups a lot of properties of all the sheets in the workbook, like for example if the sheet tab bar at the bottom is visible. Look also at SheetOptions for options that affect only the active sheet. This property can work in different windows depending on the value of ActiveWindow

Syntax

Namespace: FlexCel.Core

public abstract TSheetWindowOptions SheetWindowOptions { get; set; }

See also

  • ExcelFile


ExcelFile.HPageBreakCount Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.HPageBreakCount Property

The number of horizontal page breaks in the active sheet.

Syntax

Namespace: FlexCel.Core

public abstract Int32 HPageBreakCount { get; }

See also

  • ExcelFile


ExcelFile.VPageBreakCount Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.VPageBreakCount Property

The number of vertical page breaks in the active sheet.

Syntax

Namespace: FlexCel.Core

public abstract Int32 VPageBreakCount { get; }

See also

  • ExcelFile


ExcelFile.AllowEnteringEmptyStrings Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.AllowEnteringEmptyStrings Property

By default, FlexCel won't allow you to enter empty or null strings into a cell; it will create a blank record instead. If for any reason you need to enter actual empty strings (which might be confusing to the Excel user) set this property to true.

Syntax

Namespace: FlexCel.Core

public abstract Boolean AllowEnteringEmptyStrings { get; set; }

See also

  • ExcelFile


ExcelFile.AllowEnteringUnknownFunctionsAndNames Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.AllowEnteringUnknownFunctionsAndNames Property

Whenever you try to use an unknown function in a formula, like "=MYFUNCTION()", FlexCel will raise an Exception. Same happens with unknown names. This is normally the expected behavior, so you don't enter a misspelled name by mistake, and you can add used defined function to FlexCel so it understands it.

But in some cases, you might want to allow any function to be entered, no matter if is known or not: Excel behaves this way. For those cases, set this property to true. The unknown functions will return #NAME? as formula result.

Syntax

Namespace: FlexCel.Core

public abstract Boolean AllowEnteringUnknownFunctionsAndNames { get; set; }

See also

  • ExcelFile


ExcelFile.FormatCount Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.FormatCount Property

Number of custom formats defined in all the file. When calling GetFormat(XF), 0<=XF<FormatCount.

Syntax

Namespace: FlexCel.Core

public abstract Int32 FormatCount { get; }

See also

  • ExcelFile


ExcelFile.GetDefaultFormat Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.GetDefaultFormat Property

Returns Excel standard format for an empty cell. (NORMAL format)

Syntax

Namespace: FlexCel.Core

public TFlxFormat GetDefaultFormat { get; }

See also

  • ExcelFile


ExcelFile.GetDefaultFormatNormalStyle Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.GetDefaultFormatNormalStyle Property

Returns Excel standard format for the normal style. "Normal" style applies to the headers "A", "B" ... at the top of the columns and "1", "2"... at the left of the rows. This method is the same as calling xls.GetStyle(xls.GetBuiltInStyleName(TBuiltInStyle.Normal, 0)) You normally will want to use GetDefaultFormat instead of this method.

Syntax

Namespace: FlexCel.Core

public TFlxFormat GetDefaultFormatNormalStyle { get; }

See also

  • ExcelFile


ExcelFile.DefaultFormatId Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.DefaultFormatId Property

Returns XF identifier for the style that applies to all empty cells. Note that this is different from the "Normal" style as defined inside Excel. This is a "Cell" format that can be applied to cells, while "Normal" is a "Style" format that is applied to this cell format.

Syntax

Namespace: FlexCel.Core

public Int32 DefaultFormatId { get; }

See also

  • ExcelFile


ExcelFile.FontCount Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.FontCount Property

Number of fonts defined in all the sheet. When calling GetFont(fontIndex), 0<=fontIndex<FormatCount.

Syntax

Namespace: FlexCel.Core

public abstract Int32 FontCount { get; }

See also

  • ExcelFile


ExcelFile.GetDefaultFont Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.GetDefaultFont Property

Returns Excel standard font for an empty cell.

Syntax

Namespace: FlexCel.Core

public abstract TFlxFont GetDefaultFont { get; }

See also

  • ExcelFile


ExcelFile.GetDefaultFontNormalStyle Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.GetDefaultFontNormalStyle Property

Returns Excel font for the "normal" style. This style is used to draw the row and column headings.

Syntax

Namespace: FlexCel.Core

public abstract TFlxFont GetDefaultFontNormalStyle { get; }

See also

  • ExcelFile


ExcelFile.ConditionalFormatCount Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.ConditionalFormatCount Property

Returns the number of conditional format blocks on the list. You can use this value to loop on them and retrieve the individual ones with GetConditionalFormat

Syntax

Namespace: FlexCel.Core

public abstract Int32 ConditionalFormatCount { get; }

See also

  • ExcelFile


ExcelFile.StyleCount Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.StyleCount Property

Returns the number of named styles in the file.

Syntax

Namespace: FlexCel.Core

public abstract Int32 StyleCount { get; }

See also

  • ExcelFile


ExcelFile.CellMergedListCount Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.CellMergedListCount Property

For using with CellMergedList on a loop: for (int i=1;i <= CellMergedListCount;i++) DoSomething(CellMergedList(i))...

Syntax

Namespace: FlexCel.Core

public abstract Int32 CellMergedListCount { get; }

See also

  • ExcelFile


ExcelFile.RowCount Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.RowCount Property

Number of rows actually used on the sheet.

Syntax

Namespace: FlexCel.Core

public abstract Int32 RowCount { get; }

See also

  • ExcelFile


ExcelFile.ColCount Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.ColCount Property

Number of columns actually used on the active sheet, including formatted columns. You will normally want to use ColCountOnlyData instead.

Note that this method is slow as it needs to loop over all the rows to find out the biggest used column. Never use it in a loop like "for (int col = 1; col <= xls.ColCount; col++)". Instead try to use ColCountInRow(Int32). If you *need* to use ColCount, cache its value first:

    int RowCount = xls.RowCount;
    int ColCount = xls.ColCount;
    for (int row = 1; row <= RowCount; row++)
    {
        for (int col = 1; col <= ColCount; col++) //It would be faster to use ColCountInRow. See https://doc.tmssoftware.com/flexcel/net/guides/performance-guide.html#avoid-calling-colcount
        {
            DoSomething(row, col);
        }
    }

Remember that loops in C# will evaluate the second parameter every time the loop is executed.

Syntax

Namespace: FlexCel.Core

public abstract Int32 ColCount { get; }

See also

  • ExcelFile


ExcelFile.ColFormatCount Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.ColFormatCount Property

Returns the number of formatted columns in the file. Note that in xlsx files this number can be very big.

Syntax

Namespace: FlexCel.Core

public abstract Int32 ColFormatCount { get; }

See also

  • ExcelFile


ExcelFile.ColCountOnlyData Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.ColCountOnlyData Property

While ColCount will return the maximum column including both data and formatted columns, this method doesn't include formatted columns, only cells with data, and it is normally what you need to use.

Important: This method includes blank formatted cells. See The Maximum Used Column On A Sheet

Syntax

Namespace: FlexCel.Core

public abstract Int32 ColCountOnlyData { get; }

See also

  • ExcelFile


ExcelFile.DefaultRowHeight Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.DefaultRowHeight Property

The default height for empty rows, in Excel internal units. (1/20th of a point). IMPORTANT: For this property to have any effect, you also need to set DefaultRowHeightAutomatic = false. To get the real default row height Excel will use when DefaultRowHeightAutomatic = true or DefaultRowHidden = true use DefaultRowHeightVisual See Excel Internal Units for more information in Excel internal units.

Remarks

Use FlxConsts.RowMult to convert the internal units to pixels.

Syntax

Namespace: FlexCel.Core

public abstract Int32 DefaultRowHeight { get; set; }

Examples

    double RowHeightInPixels = xls.GetRowHeight(Row) / FlxConsts.RowMult;

See also

  • ExcelFile


ExcelFile.DefaultRowHeightAutomatic Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.DefaultRowHeightAutomatic Property

When this property is true, the row height for empty rows is calculated with the height of the "Normal" font and will change if you change the Normal style. When false, the value in DefaultRowHeight will be used.

Syntax

Namespace: FlexCel.Core

public abstract Boolean DefaultRowHeightAutomatic { get; set; }

See also

  • ExcelFile


ExcelFile.DefaultRowHidden Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.DefaultRowHidden Property

When this property is true, rows with no data are hidden by default. Note that this property only affects the visibility of empty rows. If for example row 6 is empty and you have this property true, then row 6 will be hidden. But if you write any value in a cell in row 6, then the row won't be empty anymore, and it won't be hidden anymore either.

Syntax

Namespace: FlexCel.Core

public abstract Boolean DefaultRowHidden { get; set; }

See also

  • ExcelFile


ExcelFile.DefaultColWidth Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.DefaultColWidth Property

The default width for empty columns, in Excel internal units. (Character width of font 0 / 256) See Excel Internal Units for more information in Excel internal units.

Remarks

Use ExcelMetrics.ColMult to convert the internal units to pixels.

Syntax

Namespace: FlexCel.Core

public abstract Int32 DefaultColWidth { get; set; }

Examples

    double ColWidthInPixels = xls.GetColWidth(Col) / ExcelMetrics.ColMult(xls);

See also

  • ExcelFile


ExcelFile.ColorPaletteCount Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.ColorPaletteCount Property

The number of entries on an Excel color palette. This is always 56.

Syntax

Namespace: FlexCel.Core

public Int32 ColorPaletteCount { get; }

See also

  • ExcelFile


ExcelFile.GetUsedPaletteColors Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.GetUsedPaletteColors Property

Returns a list of the used colors on the palette. You can use it as an entry to NearestColorIndex(TUIColor) to modify the palette.

Syntax

Namespace: FlexCel.Core

public abstract Boolean[] GetUsedPaletteColors { get; }

See also

  • ExcelFile


ExcelFile.NamedRangeCount Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.NamedRangeCount Property

The count of all named ranges on the file.

Syntax

Namespace: FlexCel.Core

public abstract Int32 NamedRangeCount { get; }

See also

  • ExcelFile


ExcelFile.PageHeader Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.PageHeader Property

Page header on the active sheet. Note that this property sets the same header for the all the pages. In Excel 2007 or newer you can set a different header for the first page, or odd/even pages. If you want to control these options, see GetPageHeaderAndFooter and SetPageHeaderAndFooter.

A page header is a string that contains the text for the 3 parts of the header.

The Left section begins with &L, the Center section with &C and the Right with &R

For example, the text"&LThis goes at the left!&CThis is centered!&RThis is right aligned" will write text to all the sections.

This is the full list of macros you can include:

  • && The "&" character itself
  • &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 (XP or Newer)
  • &G Picture (XP or Newer)
  • &U Underlining on/off
  • &E Double underlining on/off
  • &S Strikeout on/off
  • &X Superscript on/off
  • &Y Subscript on/off
  • &"<fontname>" Set new font <fontname>
  • &"<fontname>,<fontstyle>" Set new font with specified style <fontstyle>. The style <fontstyle> is in most cases one of "Regular", "Bold", "Italic", or "Bold Italic". But this setting is dependent on the used font, it may differ (localized style names, or "Standard", "Oblique", ...).
  • &<fontheight> Set font height in points (<fontheight> is a decimal value). If this command is followed by a plain number to be printed in the header, it will be separated from the font height with a space character.
  • &K<fontcolor> Set the font color. Font color can be either specified as a RRGGBB hexadecimal number, like &KFF0000 for red, or as a theme color with "TH-TINT" like &K08-024. For a theme, the first 2 digits before the "-" sign are the number that corresponds with the TPrimaryThemeColor, and the other numbers are the tint of the theme.

Normally, the easiest way to find out which header string you need is to create an xls file on Excel, add a header, open the file with FlexCel and take a look at the generated header (You can use the ApiMate tool for that).

Syntax

Namespace: FlexCel.Core

public abstract String PageHeader { get; set; }

See also

  • ExcelFile


ExcelFile.PageFooter Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.PageFooter Property

Page footer on the active sheet. For a description on the format of the string, see PageHeader

Syntax

Namespace: FlexCel.Core

public abstract String PageFooter { get; set; }

See also

  • ExcelFile


ExcelFile.PrintGridLines Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.PrintGridLines Property

True if the gray grid lines are printed when printing the spreadsheet.

Syntax

Namespace: FlexCel.Core

public abstract Boolean PrintGridLines { get; set; }

See also

  • ExcelFile


ExcelFile.PrintHeadings Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.PrintHeadings Property

When true the row and column labels (A,B...etc for columns, 1,2... for rows) will be printed.

Syntax

Namespace: FlexCel.Core

public abstract Boolean PrintHeadings { get; set; }

See also

  • ExcelFile


ExcelFile.PrintHCentered Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.PrintHCentered Property

When true the sheet will print horizontally centered on the page.

Syntax

Namespace: FlexCel.Core

public abstract Boolean PrintHCentered { get; set; }

See also

  • ExcelFile


ExcelFile.PrintVCentered Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.PrintVCentered Property

When true the sheet will print vertically centered on the page.

Syntax

Namespace: FlexCel.Core

public abstract Boolean PrintVCentered { get; set; }

See also

  • ExcelFile


ExcelFile.PrintToFit Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.PrintToFit Property

If true, sheet will be configured to fit on PrintNumberOfHorizontalPages x PrintNumberOfVerticalPages.

Syntax

Namespace: FlexCel.Core

public abstract Boolean PrintToFit { get; set; }

See also

  • ExcelFile


ExcelFile.PrintCopies Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.PrintCopies Property

Number of copies to print.

Syntax

Namespace: FlexCel.Core

public abstract Int32 PrintCopies { get; set; }

See also

  • ExcelFile


ExcelFile.PrintXResolution Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.PrintXResolution Property

Horizontal printer resolution on DPI.

Syntax

Namespace: FlexCel.Core

public abstract Int32 PrintXResolution { get; set; }

See also

  • ExcelFile


ExcelFile.PrintYResolution Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.PrintYResolution Property

Vertical printer resolution on DPI.

Syntax

Namespace: FlexCel.Core

public abstract Int32 PrintYResolution { get; set; }

See also

  • ExcelFile


ExcelFile.PrintOptions Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.PrintOptions Property

All print options in a single place. You will normally want to set individual properties like PrintLandscape

Syntax

Namespace: FlexCel.Core

public abstract TPrintOptions PrintOptions { get; set; }

See also

  • ExcelFile


ExcelFile.PrintOptionsInitializedFromPrinter Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.PrintOptionsInitializedFromPrinter Property

If this property is false, then Excel has not read the printer options from the printer, and PrintLandscape, PrintPaperSize, PrintScale, PrintXResolution, PrintYResolution and PrintCopies will be ignored. This property will change automatically to true if you manually change any of the above properties.

Remarks

You shouldn't have to set this property, as it is set automatically to true when you set the others like PrintLandscape. But if you set it to true, it will not only set the print options to initialized, but also initialize all uninitialized properties like PrintLandscape to default values.

Syntax

Namespace: FlexCel.Core

public abstract Boolean PrintOptionsInitializedFromPrinter { get; set; }

See also

  • ExcelFile


ExcelFile.PrintLandscape Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.PrintLandscape Property

If true, page will be printed landscape, else portrait.

This property modifies PrintOptions

Syntax

Namespace: FlexCel.Core

public abstract Boolean PrintLandscape { get; set; }

See also

  • ExcelFile


ExcelFile.PrintBlackAndWhite Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.PrintBlackAndWhite Property

If true, page will be printed in "Excel Black and White". Important: This property doesn't mean that the file will be printed in black and white. Instead it means the option in the Page Setup dialog: https://support.microsoft.com/en-us/office/page-setup-71c20d94-b13e-48fd-9800-cedd1fec6da3 Basically, when you select this option no background will be printed, and all foreground colors will be black. So if you have a cell with a black background and a white font, it will print as white background with a black font.

This property modifies PrintOptions

Syntax

Namespace: FlexCel.Core

public abstract Boolean PrintBlackAndWhite { get; set; }

See also

  • ExcelFile


ExcelFile.PrintOverThenDown Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.PrintOverThenDown Property

If true, the pages will be printed to the right, then down. Otherwise pages will be printed down, then to the right.

This property modifies PrintOptions

Syntax

Namespace: FlexCel.Core

public abstract Boolean PrintOverThenDown { get; set; }

See also

  • ExcelFile


ExcelFile.PrintDraftQuality Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.PrintDraftQuality Property

If true, the pages will be printed in draft quality.

This property modifies PrintOptions

Syntax

Namespace: FlexCel.Core

public abstract Boolean PrintDraftQuality { get; set; }

See also

  • ExcelFile


ExcelFile.PrintScale Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.PrintScale Property

Percent to grow/shrink the sheet when printing. 100 means a page scale of 100%.

Syntax

Namespace: FlexCel.Core

public abstract Int32 PrintScale { get; set; }

See also

  • ExcelFile


ExcelFile.PrintFirstPageNumber Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.PrintFirstPageNumber Property

Page number that will be assigned to the first sheet when printing. (So it will show in page headers/footers). You might set this value to null to keep the page automatic. Also, the value returned here will be null it this value is not set (Set to Automatic)

Syntax

Namespace: FlexCel.Core

public abstract Nullable<Int32> PrintFirstPageNumber { get; set; }

See also

  • ExcelFile


ExcelFile.PrintNumberOfHorizontalPages Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.PrintNumberOfHorizontalPages Property

If set, the sheet will be printed on at most this number of horizontal pages. Use 0 to have unlimited horizontal pages while still limiting the vertical pages with PrintNumberOfVerticalPages. (see 'Preparing for printing' in the Api Developer Guide)

Syntax

Namespace: FlexCel.Core

public abstract Int32 PrintNumberOfHorizontalPages { get; set; }

See also

  • ExcelFile
  • PrintNumberOfVerticalPages


ExcelFile.PrintNumberOfVerticalPages Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.PrintNumberOfVerticalPages Property

If set, the sheet will be printed on at most this number of vertical pages. Use 0 to have unlimited vertical pages while still limiting the horizontal pages with PrintNumberOfHorizontalPages. (see 'Preparing for printing' in the Api Developer Guide)

Syntax

Namespace: FlexCel.Core

public abstract Int32 PrintNumberOfVerticalPages { get; set; }

See also

  • ExcelFile
  • PrintNumberOfHorizontalPages


ExcelFile.PrintPaperSize Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.PrintPaperSize Property

Pre-defined standard paper size. If you want to set up a printer specific paper size, see SetPrinterDriverSettings

Syntax

Namespace: FlexCel.Core

public abstract TPaperSize PrintPaperSize { get; set; }

See also

  • ExcelFile


ExcelFile.PrintPaperDimensions Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.PrintPaperDimensions Property

Returns the dimensions for the selected paper. See also PrintPaperSize.

Syntax

Namespace: FlexCel.Core

public abstract TPaperDimensions PrintPaperDimensions { get; }

See also

  • ExcelFile


ExcelFile.PrintErrors Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.PrintErrors Property

Determines how the errors will be printed.

Syntax

Namespace: FlexCel.Core

public abstract TPrintErrors PrintErrors { get; set; }

See also

  • ExcelFile


ExcelFile.PrintComments Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.PrintComments Property

Determines how the comments will be printed.

Syntax

Namespace: FlexCel.Core

public abstract TPrintComments PrintComments { get; set; }

See also

  • ExcelFile


ExcelFile.ImageCount Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.ImageCount Property

The number of images in the active sheet.

Syntax

Namespace: FlexCel.Core

public abstract Int32 ImageCount { get; }

See also

  • ExcelFile


ExcelFile.ObjectCount Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.ObjectCount Property

Count of all graphical objects on the sheet. They can be charts, images, shapes, etc.

Syntax

Namespace: FlexCel.Core

public abstract Int32 ObjectCount { get; }

See also

  • ExcelFile


ExcelFile.IsLightClone Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.IsLightClone Property

Returns true if this object was created with a LightClone call. Light Cloned objects share the data with another file, and they don't switch the selected sheet in the Excel file when changing ActiveSheet

Syntax

Namespace: FlexCel.Core

public Boolean IsLightClone { get; }

See also

  • ExcelFile


ExcelFile.DataValidationCount Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.DataValidationCount Property

Returns the number of DataValidation structures in the active sheet. There are 2 ways you can access the data validation information on a sheet:

  1. If you know the row and column where you want to look, you can use GetDataValidation(Int32, Int32) to return the data validation in the cell.
  2. If you want to find out all data validation structures in the sheet, you can use DataValidationCount, GetDataValidationInfo and GetDataValidationRanges to loop over all existing data validations.

Syntax

Namespace: FlexCel.Core

public abstract Int32 DataValidationCount { get; }

See also

  • ExcelFile


ExcelFile.HyperLinkCount Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.HyperLinkCount Property

The count of hyperlinks on the active sheet

Syntax

Namespace: FlexCel.Core

public abstract Int32 HyperLinkCount { get; }

See also

  • ExcelFile


ExcelFile.OutlineSummaryRowsBelowDetail Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.OutlineSummaryRowsBelowDetail Property

Determines whether the summary rows should be below or above details on outline.

Syntax

Namespace: FlexCel.Core

public abstract Boolean OutlineSummaryRowsBelowDetail { get; set; }

See also

  • ExcelFile


ExcelFile.OutlineSummaryColsRightToDetail Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.OutlineSummaryColsRightToDetail Property

Determines whether the summary columns should be right to or left to the details on outline.

Syntax

Namespace: FlexCel.Core

public abstract Boolean OutlineSummaryColsRightToDetail { get; set; }

See also

  • ExcelFile


ExcelFile.OutlineAutomaticStyles Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.OutlineAutomaticStyles Property

This handles the setting of Automatic Styles inside the outline options.

Syntax

Namespace: FlexCel.Core

public abstract Boolean OutlineAutomaticStyles { get; set; }

See also

  • ExcelFile


ExcelFile.Protection Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.Protection Property

Protection data for the file. Modify its properties to open and read encrypted files.

Syntax

Namespace: FlexCel.Core

public TProtection Protection { get; }

See also

  • ExcelFile


ExcelFile.DocumentProperties Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.DocumentProperties Property

Document properties for the file. With this object you can read the properties (Author, Title, etc.) of a file.

Syntax

Namespace: FlexCel.Core

public TDocumentProperties DocumentProperties { get; }

See also

  • ExcelFile


ExcelFile.ChartCount Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.ChartCount Property

Returns the count of charts on this sheet. Please take note that this method will not return the number of embedded objects with charts inside in a sheet, but just the number of charts in the sheet. In simpler terms, this method will return 0 for all worksheets, and 1 for all chart sheets. This is not a very useful method, but it needs to be this way to be consistent with GetChart. So, looping like this:

    for (int i = 1; i <= xls.ChartCount; i++)
    {
        xls.GetChart(i, null);
    }

will loop 0 times for worksheets and 1 time for workbooks.

Syntax

Namespace: FlexCel.Core

public abstract Int32 ChartCount { get; }

Examples

The following example will retrieve all charts that are inserted as objects in a sheet, along with the chart sheets.

    public void ProcessAllCharts()
    {
        XlsFile xls = new XlsFile(true);
        xls.Open("filewithcharts.xls");
        for (int iSheet = 1; iSheet <= xls.SheetCount; iSheet++)
        {
            xls.ActiveSheet = iSheet;

            //Process charts embedded as objects in worksheets.
            for (int iChart = 1; iChart <= xls.ObjectCount; iChart++)
            {
                TShapeProperties props = xls.GetObjectProperties(iChart, true);
                ProcessChart(xls, iChart, props); //We need to process it even if it is not a chart, since it might be a group with a chart inside.
            }

            //Process chart sheets.
            if (xls.SheetType == TSheetType.Chart)
            {
                ExcelChart chart = xls.GetChart(1, null);
                DoSomething(xls, chart);
            }

        }

        xls.Save("changedfilewithcharts.xls");
    }

    private void ProcessChart(ExcelFile xls, int iChart, TShapeProperties props)
    {
        if (props.ObjectType == TObjectType.Chart)
        {
            ExcelChart chart = xls.GetChart(iChart, props.ObjectPath);
            DoSomething(xls, chart);
        }

        for (int i = 1; i <= props.ChildrenCount; i++)
        {
            TShapeProperties childProp = props.Children(i);
            ProcessChart(xls, i, childProp);
        }
    }

See also

  • ExcelFile


ExcelFile.OptionsDates1904 Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.OptionsDates1904 Property

Excel has 2 different date systems. On windows systems it uses 1900 based dates, and on old Macintosh systems it uses 1904 dates. You can change this on Excel under Options, and this property allows you to know and change which format is being used. See https://support.microsoft.com/en-us/help/214330/differences-between-the-1900-and-the-1904-date-system-in-excel

Syntax

Namespace: FlexCel.Core

public abstract Boolean OptionsDates1904 { get; set; }

See also

  • ExcelFile


ExcelFile.OptionsR1C1 Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.OptionsR1C1 Property

Use this property to change the reference system used in the file. Note that this option only changes how Excel and FlexCel will display the file. Internally, the formulas will always be stored in A1 format, and converted by Excel to and from R1C1 if this property is true. FlexCel will also use this property to render the file when it is set to print formulas.

Also, this property doesn't change how FlexCel will parse or return the formula text in the cells or names. By default, even if this property is true, you will need to enter the formulas in FlexCel in A1 mode. To change the entry mode in FlexCel, please use FormulaReferenceStyle

Syntax

Namespace: FlexCel.Core

public abstract Boolean OptionsR1C1 { get; set; }

See also

  • ExcelFile


ExcelFile.OptionsSaveExternalLinkValues Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.OptionsSaveExternalLinkValues Property

This property has the value of the corresponding option on Excel options.

Syntax

Namespace: FlexCel.Core

public abstract Boolean OptionsSaveExternalLinkValues { get; set; }

See also

  • ExcelFile


ExcelFile.OptionsPrecisionAsDisplayed Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.OptionsPrecisionAsDisplayed Property

This property has the value of the corresponding option on Excel options.

Syntax

Namespace: FlexCel.Core

public abstract Boolean OptionsPrecisionAsDisplayed { get; set; }

See also

  • ExcelFile


ExcelFile.OptionsMultithreadRecalc Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.OptionsMultithreadRecalc Property

Number of threads that can be used at the same time by Excel when recalculating. Set it to 0 to disable multithread recalculation, and to -1 to let Excel decide the best number of threads to use. The maximum value for this property is 1024.

This option only applies to Excel 2007 or newer.

Syntax

Namespace: FlexCel.Core

public abstract Int32 OptionsMultithreadRecalc { get; set; }

See also

  • ExcelFile


ExcelFile.OptionsForceFullRecalc Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.OptionsForceFullRecalc Property

If true, Excel will do full recalculations of the spreadsheet when you change a cell. If false, only the cells that depend on the cell being changed will be recalculated. This option only applies to Excel 2007 or newer.

Syntax

Namespace: FlexCel.Core

public abstract Boolean OptionsForceFullRecalc { get; set; }

See also

  • ExcelFile


ExcelFile.OptionsFullRecalcOnLoad Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.OptionsFullRecalcOnLoad Property

This property tells you if the open file wasn't recalculated when saved. If true, the workbook doesn't have recalculated values and will be recalculated when open in Excel. This option only applies to xlsx files. Note that if you open a file which has FullRecalcOnLoad = true in FlexCel, recalculate it and save it, FlexCel will save the file with FullRecalcOnLoad = false. To change what FlexCel writes in FullRecalcOnLoad when saving, change OptionsFullRecalcOnLoadMode

Syntax

Namespace: FlexCel.Core

public abstract Boolean OptionsFullRecalcOnLoad { get; }

See also

  • ExcelFile


ExcelFile.OptionsFullRecalcOnLoadMode Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.OptionsFullRecalcOnLoadMode Property

Defines how FlexCel will identify the files it creates to be calculated by Excel when it opens them.

Syntax

Namespace: FlexCel.Core

public abstract TFullRecalcOnLoadMode OptionsFullRecalcOnLoadMode { get; set; }

See also

  • ExcelFile


ExcelFile.OptionsRecalcCircularReferences Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.OptionsRecalcCircularReferences Property

If true, Excel and FlexCel will do iterative calculating over cells with circular references, until OptionsRecalcMaxIterations is reached or the difference is less than OptionsRecalcMaxChange

Syntax

Namespace: FlexCel.Core

public abstract Boolean OptionsRecalcCircularReferences { get; set; }

See also

  • ExcelFile


ExcelFile.OptionsRecalcMaxIterations Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.OptionsRecalcMaxIterations Property

Maximum number of iterations when calculating circular references (OptionsRecalcCircularReferences is true),

Syntax

Namespace: FlexCel.Core

public abstract Int32 OptionsRecalcMaxIterations { get; set; }

See also

  • ExcelFile


ExcelFile.OptionsRecalcMaxChange Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.OptionsRecalcMaxChange Property

Maximum difference between 2 iterations when calculating circular references (OptionsRecalcCircularReferences is true),

Syntax

Namespace: FlexCel.Core

public abstract Double OptionsRecalcMaxChange { get; set; }

See also

  • ExcelFile


ExcelFile.OptionsAutoCompressPictures Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.OptionsAutoCompressPictures Property

If true, Excel will try to compress the pictures to keep sizes down. This option only applies to Excel 2007 or newer.

Syntax

Namespace: FlexCel.Core

public abstract Boolean OptionsAutoCompressPictures { get; set; }

See also

  • ExcelFile


ExcelFile.OptionsCheckCompatibility Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.OptionsCheckCompatibility Property

Whether the "Check for compatibility" dialog will pop up when saving as xls in Excel 2007 or newer. This option only applies to Excel 2007 or newer.

Important: When this option is true, Excel will refuse to enable "Autosave" and upload the files to OneDrive (Autosave is the first option in the title bar in Excel 2019). If true, you will get a message:

"How do I turn on Autosave? Before Autosave can save your file, you need to fix the following: This file was created in an older file format. Please select File > Save As to update the file format."

So in order to avoid accidentally setting this option true and preventing the Autosave function, FlexCel will ignore this setting in xlsx files unless you also set OptionsForceUseCheckCompatibility to true

Syntax

Namespace: FlexCel.Core

public abstract Boolean OptionsCheckCompatibility { get; set; }

See also

  • ExcelFile


ExcelFile.OptionsForceUseCheckCompatibility Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.OptionsForceUseCheckCompatibility Property

When the option OptionsCheckCompatibility is true, Excel will refuse to austosave the file. To avoid a confusing situation where Excel refuses to autosave the file and shows a vague warning about an "older file format", OptionsCheckCompatibility is ignored by FlexCel.

In order to force FlexCel to save OptionsCheckCompatibility to the file (thus disabling the "Autosave" function) you need to set this property to true besides OptionsCheckCompatibility.

Syntax

Namespace: FlexCel.Core

public abstract Boolean OptionsForceUseCheckCompatibility { get; set; }

See also

  • ExcelFile


ExcelFile.OptionsBackup Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.OptionsBackup Property

Defines whether to save a backup copy of the workbook or not.

Syntax

Namespace: FlexCel.Core

public abstract Boolean OptionsBackup { get; set; }

See also

  • ExcelFile


ExcelFile.OptionsRecalcMode Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.OptionsRecalcMode Property

Reads and writes the recalculating options in the file. Note that this only affects the file and how Excel will recalculate, not how FlexCel does its recalculation. FlexCel ignores this setting and uses RecalcMode instead.

Syntax

Namespace: FlexCel.Core

public abstract TSheetCalcMode OptionsRecalcMode { get; set; }

See also

  • ExcelFile


ExcelFile.RecalcMode Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.RecalcMode Property

Set this property to change how the file will be recalculated. Note that this affects only how FlexCel recalculates the file, but not how Excel will recalculate it. It doesn't change anything in the generated file. To change the options for the file, use OptionsRecalcMode instead.

Remarks

Setting RecalcMode = Manual might be a little faster for big spreadsheets with *lots* of formulas, but they won't preview ok on Excel viewers as FlexCelPrintDocument. See also RecalcVersion When Manual, you can still call Recalc(Boolean) with "forced" = true to recalculate the sheet.

Not all functions are supported, those that are not will return a #NAME? error on a viewer, and will be recalculated by Excel when you open the file. See Supported Excel Functions for a list of supported functions.

Syntax

Namespace: FlexCel.Core

public abstract TRecalcMode RecalcMode { get; set; }

See also

  • ExcelFile


ExcelFile.CellStackTraceMaxSize Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.CellStackTraceMaxSize Property

Defines what is the maximum number of entries returned in the stack trace when calling RecalcAndVerify. In order to keep the stack trace not too big this number is limited, but if you need a bigger stack trace to see the full loop of cells you can increase this number. Note that if you want to calculate linked files, you need to set the property TWorkspace.CellStackTraceMaxSize instead and it will affect all workbooks.

Syntax

Namespace: FlexCel.Core

public Int32 CellStackTraceMaxSize { get; set; }

See also

  • ExcelFile


ExcelFile.RecalcVersion Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.RecalcVersion Property

Defines which version of Excel recalculation engine will be saved in the file. This affects how Excel will recalculate the file on open.

If you set this property for example to Excel2007, then any Excel version newer than Excel 2007 will recalculate all formulas when you load the file, so it will modify the workbook and will ask for saving changes when closing. Even if you just open and close the file. Note that this will only happen if there are formulas on the sheet.

If there are any formulas that FlexCel can't recalculate, you should set this property to AlwaysRecalc. For example, if you have the formula:

"=GETPIVOTDATA("a";"b")"

FlexCel will return #NAME?, as it doesn't implement this function. If you open this file on Excel and RecalcVersion was not AlwaysRecalc when saving, Excel will not calculate it and will show also #NAME?. If RecalcVersion was AlwaysRecalc, Excel will show the right answer, but will ask for saving the file when closing.

Syntax

Namespace: FlexCel.Core

public abstract TRecalcVersion RecalcVersion { get; set; }

Examples

The following code:

    XlsFile xls = new XlsFile(true); //We can't change the recalcmode once we have opened or created the file.
    xls.RecalcMode = TRecalcMode.Manual; //So the sheet is not recalculated before saving.
    xls.NewFile(1, TExcelFileFormat.v2021); //Create the file *after* recalcmode was changed.
    xls.RecalcVersion = TRecalcVersion.Excel2021; //So Excel equal or older than 2021 won't recalculate either.
    xls.SetCellValue(1, 1, new TFormula("= 1 + 1", 3));  //Basic math...
    xls.Save(OutFileName);

will create a file with a formula "1 + 1" and result = 3 on cell A1. If RecalcVersion was TRecalcVersion.AlwaysRecalc, Excel would show the correct value when opening.

See also

  • ExcelFile


ExcelFile.NeedsRecalc Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.NeedsRecalc Property

True if the file has been modified after loading.

Syntax

Namespace: FlexCel.Core

protected abstract Boolean NeedsRecalc { get; set; }

See also

  • ExcelFile


ExcelFile.FileNeedsRecalc Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.FileNeedsRecalc Property

If true, the file has been modified and not recalculated after load.

Syntax

Namespace: FlexCel.Core

public Boolean FileNeedsRecalc { get; }

See also

  • ExcelFile


ExcelFile.Recalculating Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.Recalculating Property

Returns true if the workbook is being recalculated.

Syntax

Namespace: FlexCel.Core

protected abstract Boolean Recalculating { get; }

See also

  • ExcelFile


ExcelFile.LinkCount Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.LinkCount Property

Returns the number of external links for the file. You can access those links with GetLink and SetLink

Syntax

Namespace: FlexCel.Core

public abstract Int32 LinkCount { get; }

See also

  • ExcelFile


ExcelFile.SemiAbsoluteReferences Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.SemiAbsoluteReferences Property

When this property is false, inserting and copying ranges will behave the same as it does in Excel. When this property is true, absolute references to cells inside the block being copied will be treated as relative. For example, if you have:

A1: 2
B1: =$A$1 + $A$57

and you copy the row 1 to row 2, in Excel or FlexCel when this property is false you will get:

A2: 2
B2: =$A$1 + $A$57

When this property is true, you will get:

A2: 2
B2: =$A$2 + $A$57

In the second case, the first reference was updated because it was inside the range being copied, but the second was not. This property might be useful when you want to duplicate blocks of cells, but want the absolute references inside it to point to the newer block.

Syntax

Namespace: FlexCel.Core

public Boolean SemiAbsoluteReferences { get; set; }

See also

  • ExcelFile


ExcelFile.FormulaReferenceStyle Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.FormulaReferenceStyle Property

Specifies which reference style to use when entering formulas: A1 or R1C1. Note that this property is different from OptionsR1C1. OptionsR1C1 modifies a property of the file, that handles how references will show in Excel.

This property modifies how FlexCel parses or returns the formulas, and has no effect at all in the file generated.

Also note that R1C1 and A1 modes are completely equivalent, and formulas are always stored as A1 inside the generated files. This property only affects the parsing of the formulas, the file generated will be exactly the same no matter the value of this property. And Excel will show it in A1 or R1C1 mode depending only in OptionsR1C1

Syntax

Namespace: FlexCel.Core

public TReferenceStyle FormulaReferenceStyle { get; set; }

See also

  • ExcelFile


ExcelFile.ErrorActions Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.ErrorActions Property

Determines if FlexCel will throw Exceptions or just ignore errors on specific situations. If you are trying to recover corrupt files, you might also want to check RecoveryMode

Syntax

Namespace: FlexCel.Core

public TExcelFileErrorActions ErrorActions { get; set; }

See also

  • ExcelFile


ExcelFile.RecoveryMode Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.RecoveryMode Property

When this property is set to true, FlexCel will try to open corrupt files ignoring most of what can be ignored. Note that FlexCel is not a recovery tool and that this property might be able or not to open a corrupt file. Also, even if you are able to open the file with FlexCel, when you save the corrupt file, it might stay corrupt. FlexCel saves back as much as it can from the original file in order to preserve them, and this means it might save the corrupt parts too.

Note that when opening a file in recovery mode, the value of ErrorActions is ignored, as we will try to ignore as much errors as we can.

Syntax

Namespace: FlexCel.Core

public Boolean RecoveryMode { get; set; }

See also

  • ExcelFile


ExcelFile.FileFormatWhenOpened Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.FileFormatWhenOpened Property

Returns the file format that the file had when it was opened. If the file was created with NewFile, the file format when opened is xls.

Syntax

Namespace: FlexCel.Core

public abstract TFileFormats FileFormatWhenOpened { get; }

See also

  • ExcelFile


ExcelFile.WidthCorrection Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.WidthCorrection Property

Factor to multiply default column widths. See remarks for a detailed explanation.

Remarks

Excel does not print the same things to all printers (or even the same printer with another resolution). Depending on the driver and resolution, printed columns and rows will be a little smaller or bigger.

FlexCel uses .NET framework to print, and so it is resolution independent, it will always print the same no matter where. So FlexCel is tuned to print like Excel on a 600 dpi generic printer. This will probably be ok for most uses, but in some cases might cause FlexCel to print an Extra page with only one column or row.

You can use this property and HeightCorrection to manually fine tune FlexCel printing, previewing and exporting to PDF to make it smaller or larger. A normal value for this property might be 1.05 or 0.99, but don't use it unless you really need to.

Syntax

Namespace: FlexCel.Core

public abstract Double WidthCorrection { get; set; }

Examples

To calculate the exact HeightCorrection and WidthCorrection for your printer create a new Excel sheet, make column A wide (almost a sheet wide) and row 1 larger (almost a sheet tall). Set the borders around cell A1 to a solid line. Now, print this file from Excel and from FlexCel (you can use the PrintPreview demo for this) and compare the 2 resulting boxes. If for example the Excel printed box is 1.2 cm wide and FlexCel is 1.4, WidthCorrection should be 1.4/1.2. (A larger WidthCorrection means a smaller box).

See also

  • ExcelFile


ExcelFile.HeightCorrection Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.HeightCorrection Property

Factor to multiply default row heights. See remarks for a detailed explanation.

Remarks

Excel does not print the same things to all printers (or even the same printer with another resolution). Depending on the driver and resolution, printed columns and rows will be a little smaller or bigger.

FlexCel uses .NET framework to print, and so it is resolution independent, it will always print the same no matter where. So FlexCel is tuned to print like Excel on a 600 dpi generic printer. This will probably be ok for most uses, but in some cases might cause FlexCel to print an Extra page with only one column or row.

You can use this property and WidthCorrection to manually fine tune FlexCel printing, previewing and exporting to PDF to make it smaller or larger. A normal value for this property might be 1.05 or 0.99, but don't use it unless you really need to.

Syntax

Namespace: FlexCel.Core

public abstract Double HeightCorrection { get; set; }

Examples

To calculate the exact HeightCorrection and WidthCorrection for your printer create a new Excel sheet, make column A wide (almost a sheet wide) and row 1 larger (almost a sheet tall). Set the borders around cell A1 to a solid line. Now, print this file from Excel and from FlexCel (you can use the PrintPreview demo for this) and compare the 2 resulting boxes. If for example the Excel printed box is 1.2 cm wide and FlexCel is 1.4, WidthCorrection should be 1.4/1.2. (A larger WidthCorrection means a smaller box)

See also

  • ExcelFile


ExcelFile.Linespacing Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.Linespacing Property

A Linespacing of 1 means use the standard GDI+ linespace when a cell has more than one line. A linespace of 2 would mean double linespacing, and 0.5 would mean half linespacing. Normally linespacing in Excel is a little bigger than linespacing in GDI+, so you can use this property to fine tune what you need.

This property doesn't alter the Excel file in any way. It is only used when rendering.

Syntax

Namespace: FlexCel.Core

public abstract Double Linespacing { get; set; }

See also

  • ExcelFile


ExcelFile.CellMarginFactor Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.CellMarginFactor Property

This property can be used to add a margin to the cells when rendering, so text is rendered smaller and can have more line breaks. The default value of 1.0 means normal cells. The bigger this value, the bigger the margins and the smaller the real cell width for rendering the text. You might want to make this value a little larger than 1 if autofitting and Excel is wrapping text that FlexCel fits into one line.

Syntax

Namespace: FlexCel.Core

public abstract Double CellMarginFactor { get; set; }

See also

  • ExcelFile


ExcelFile.CellIndentationRendering Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.CellIndentationRendering Property

Excel doesn't adapt the cell indentation when changing the print scale. This means that if a cell indentation is 0.1 inches at 100% print scale, it will also be 0.1 inches at 50% print scale. This will break the layout of your files when changing the print scaling, and so by default FlexCel won't behave like Excel here and make the indentation half the size if printing at half the scale. If you want to mimic the exact Excel behavior, set this property to true. See 'Cell indentation' in the Api Developer Guide

Syntax

Namespace: FlexCel.Core

public abstract TCellIndentationRendering CellIndentationRendering { get; set; }

See also

  • ExcelFile


ExcelFile.HeadingColWidth Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.HeadingColWidth Property

Width that will be used by the added column with row numbers when PrintHeadings is true. The default value (0) means to use an automatic value which is fine if you don't have too many rows to print. A positive value will make the column wider or narrower. A negative value will auto-calculate the width depending in the number of rows and normal font of the spreadsheet.

Syntax

Namespace: FlexCel.Core

public abstract Double HeadingColWidth { get; set; }

See also

  • ExcelFile


ExcelFile.HeadingRowHeight Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.HeadingRowHeight Property

Height that will be used by the added row with column headers when PrintHeadings is true. The default value (0) means to use an automatic value which is fine with normal fonts. A positive value will make the column wider or narrower.A negative value will auto-calculate the height depending in the normal font of the spreadsheet.

Syntax

Namespace: FlexCel.Core

public abstract Double HeadingRowHeight { get; set; }

See also

  • ExcelFile


ExcelFile.DpiForImages Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.DpiForImages Property

Allows you to change the dpi for vector images (metafiles) when they are rasterized for converting to PDF / HTML / etc. Note that this is a static setting and will affect all files. This setting is the same as FlexCelConfig.DpiForImages.

Syntax

Namespace: FlexCel.Core

public static Double DpiForImages { get; set; }

See also

  • ExcelFile


ExcelFile.XlsxCompressionLevel Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.XlsxCompressionLevel Property

Zip compression level when creating xlsx files. Xlsx files are zip files, and you can compress more or less by trading speed for file size. The faster you can create the file, the bigger the xlsx files created will be. Excel by default uses "Fastest" compression level and we use "Default". Normally using compression levels more than default is not worth it, since the files will take a lot longer to be created, and the size reduction will be very small.

Remarks

Requires .NET 4.5 or newer. In older .NET versions it has no effect and compression is always default.

Syntax

Namespace: FlexCel.Core

public static CompressionLevel XlsxCompressionLevel { get; set; }

See also

  • ExcelFile


ExcelFile.ScreenScaling Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.ScreenScaling Property

This property lets you specify the screen scaling that FlexCel will assume for reading xlsx files in percent. (default is 100 which means 100%). The values can be between 100 and 500.

Column widths in xlsx files which don't have a fixed column width set will be different in different screen resolutions. So we need to know which resolution to emulate in order to read those files correctly. You will probably want to leave this property to the default value of 100, but you can change it if needed.

For more information, please read https://www.tmssoftware.com/site/blog.asp?post=311

Syntax

Namespace: FlexCel.Core

public abstract Int32 ScreenScaling { get; set; }

See also

  • ExcelFile


ExcelFile.IgnoreFormulaText Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.IgnoreFormulaText Property

This is an optimization property. If you set it to true, methods like GetCellValue or GetNamedRange won't return the formula text, just the formula results. If you don't care about formula texts, setting this property to true can speed up the processing of huge files.

Syntax

Namespace: FlexCel.Core

public Boolean IgnoreFormulaText { get; set; }

See also

  • ExcelFile


ExcelFile.CustomTableStyleCount Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.CustomTableStyleCount Property

Returns the number of custom tables styles defined in the workbook.

Syntax

Namespace: FlexCel.Core

public abstract Int32 CustomTableStyleCount { get; }

See also

  • ExcelFile


ExcelFile.TableCountInWorkbook Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.TableCountInWorkbook Property

Returns the number of tables in the whole workbook. (Not just the active sheet)

Syntax

Namespace: FlexCel.Core

public abstract Int32 TableCountInWorkbook { get; }

See also

  • ExcelFile


ExcelFile.TableCountInSheet Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.TableCountInSheet Property

Returns the number of tables in the active sheet. Use GetTable(Int32) to retrieve the tables in the sheet.

Syntax

Namespace: FlexCel.Core

public abstract Int32 TableCountInSheet { get; }

See also

  • ExcelFile


ExcelFile.CustomXmlPartCount Property | FlexCel Studio for the .NET Framework documentation

ExcelFile.CustomXmlPartCount Property

Returns the number of custom xml parts in the active document.

Syntax

Namespace: FlexCel.Core

public abstract Int32 CustomXmlPartCount { get; }

See also

  • ExcelFile


ExcelFile.VirtualCellRead Event | FlexCel Studio for the .NET Framework documentation

ExcelFile.VirtualCellRead Event

If you assign this event FlexCel will not load the file into memory when opening a file, allowing you to open very big files using little memory. This event will be called for every value read from the file, and then the value will be discarded, instead of loaded into memory. Look at 'Virtual mode' in the Performance Guide for more information.

Syntax

Namespace: FlexCel.Core

public VirtualCellReadEventHandler VirtualCellRead

See also

  • ExcelFile


ExcelFile.VirtualCellStartReading Event | FlexCel Studio for the .NET Framework documentation

ExcelFile.VirtualCellStartReading Event

When in virtual mode (VirtualCellRead is assigned) this event will be called after the sheet names have been read, but before starting to read the cells. You can use this event to know how many sheets you are reading.

Syntax

Namespace: FlexCel.Core

public VirtualCellStartReadingEventHandler VirtualCellStartReading

See also

  • ExcelFile


ExcelFile.VirtualCellEndReading Event | FlexCel Studio for the .NET Framework documentation

ExcelFile.VirtualCellEndReading Event

When in virtual mode (VirtualCellRead is assigned) this event will be called after the file has been processed. You can use it to do cleanup.

Syntax

Namespace: FlexCel.Core

public VirtualCellEndReadingEventHandler VirtualCellEndReading

See also

  • ExcelFile


ExcelFont Class | FlexCel Studio for the .NET Framework documentation

ExcelFont Class

Utility methods to create normal fonts from Excel ones.

Syntax

Namespace: FlexCel.Core

public static class ExcelFont

Methods

Name Description
CreateFont Overloaded
 CreateFont(String, Double, TUIFontStyle)
CreateFont(TUIFont, TUIColor, TUITextDecoration, Double)
ConvertFontStyle Converts between a the Excel font styles and the font styles used in UI.
ConvertTextDecoration Converts between the text decorations used in Excel and the text decorations used for drawing.


ExcelFont.CreateFont Method | FlexCel Studio for the .NET Framework documentation

ExcelFont.CreateFont Method

Overloads

  • ExcelFont.CreateFont(String, Double, TUIFontStyle)
  • ExcelFont.CreateFont(TUIFont, TUIColor, TUITextDecoration, Double)

ExcelFont.CreateFont(String, Double, TUIFontStyle)

Tries to create a new font given the Excel data.

Syntax

Namespace: FlexCel.Core

public static TUIFont CreateFont(String FontName, Double FontSize, TUIFontStyle Style)

Parameters

<-> | Parameter | Type | Description
 | FontName | String | Name of the font we want to create.
 | FontSize | Double | Size of the font.
 | Style | TUIFontStyle | Style of the font.

Returns

A new font with the desired parameters.

See also

  • ExcelFont

ExcelFont.CreateFont(TUIFont, TUIColor, TUITextDecoration, Double)

Creates a font given another font, with a different color.

Syntax

Namespace: FlexCel.Core

public static TFlxFont CreateFont(TUIFont aFont, TUIColor aFontColor, TUITextDecoration aTextDecoration, Double aScale)

Parameters

<-> | Parameter | Type | Description
 | aFont | TUIFont | Font to be used as base.
 | aFontColor | TUIColor | New font color.
 | aTextDecoration | TUITextDecoration | Underline/strikeout
 | aScale | Double | Scale for the font. For normal uses, specify 1. A value of 2 would mean to create a file with twice the size.

See also

  • ExcelFont


ExcelFont.ConvertFontStyle Method | FlexCel Studio for the .NET Framework documentation

ExcelFont.ConvertFontStyle Method

Converts between a the Excel font styles and the font styles used in UI.

Syntax

Namespace: FlexCel.Core

public static TUIFontStyle ConvertFontStyle(TFlxFont Fx)

Parameters

<-> | Parameter | Type | Description
 | Fx | TFlxFont | FlexCel font to convert.

Returns

A similar FontStyle.

See also

  • ExcelFont


ExcelFont.ConvertTextDecoration Method | FlexCel Studio for the .NET Framework documentation

ExcelFont.ConvertTextDecoration Method

Converts between the text decorations used in Excel and the text decorations used for drawing.

Syntax

Namespace: FlexCel.Core

public static TUITextDecoration ConvertTextDecoration(TFlxFont Fx)

Parameters

<-> | Parameter | Type | Description
 | Fx | TFlxFont |

See also

  • ExcelFont


ExcelMetrics Class | FlexCel Studio for the .NET Framework documentation

ExcelMetrics Class

Returns Information to convert between standard units and Excel units.

Syntax

Namespace: FlexCel.Core

public static class ExcelMetrics

Methods

Name | Description
GetFont0Width | Overloaded GetFont0Width(IRowColSize) GetFont0Width(IRowColSize, Boolean)
GetFont0SpaceWidth | Returns the width of a space (" ") in the main font of the workbook.
FmlaMult | When showing/printing the sheet and "Show formula" check box is on, column widths are double of the normal ones. This method returns 0.5 when "Show formulas" is turned on, and 1 if it is not.
ColMultDisplay | Multiply by this number to convert the width of a column from GraphicsUnit.​Display units (1/100 inch) to Excel internal units. Note that the default column width is different, you need to multiply by DefColWidthAdapt See Excel Internal Units for more information in Excel internal units.
RowMultDisplay | Multiply by this number to convert the height of a row from GraphicsUnit.​Display units (1/100 inch) to Excel internal units. See Excel Internal Units for more information in Excel internal units.
ColMult | Multiply by this number to convert the width of a column from resolution-​independent-​pixels (1/96 of an inch) to excel internal units. Note that the default column width is different, you need to multiply by DefColWidthAdapt See Excel Internal Units for more information in Excel internal units.
DefColWidthAdapt | Convert the DEFAULT column width to resolution-​independent-​pixels (1/96 of an inch). This is different from ColMult, that goes in a column by column basis. See Excel Internal Units for more information in Excel internal units.


ExcelMetrics.GetFont0Width Method | FlexCel Studio for the .NET Framework documentation

ExcelMetrics.GetFont0Width Method

Overloads

  • ExcelMetrics.GetFont0Width(IRowColSize)
  • ExcelMetrics.GetFont0Width(IRowColSize, Boolean)

ExcelMetrics.GetFont0Width(IRowColSize)

Returns the width of the 0 font on Excel. Normally this is 7, but can change depending on the file. The user might modify it by changing Format->Style->Normal.

Syntax

Namespace: FlexCel.Core

public static Double GetFont0Width(IRowColSize Workbook)

Parameters

<-> | Parameter | Type | Description
 | Workbook | IRowColSize |

See also

  • ExcelMetrics

ExcelMetrics.GetFont0Width(IRowColSize, Boolean)

Returns the width of the 0 font on Excel, taking in account the screen dpi, which you set in XlsFile.ScreenScaling. Note that with a scaling more than 100%, the fontsize returned will be proportionally larger. So a font that returns 10 points at 100% will return 20 points at 200%. While it makes no sense (a point is 1/72 of an inch no matter the resolution) this is the way Excel handles it.

Syntax

Namespace: FlexCel.Core

public static Double GetFont0Width(IRowColSize Workbook, Boolean UseScreenScaling)

Parameters

<-> | Parameter | Type | Description
 | Workbook | IRowColSize | File with the font.
 | UseScreenScaling | Boolean | If true, we will return the font size at the given screen scaling. If false, we will return the font size at 100% (96 dpi). Note that if a font is say 7 points at 100%, it will be 14 points at 200%. We need it this way because it is the way Excel uses it.

See also

  • ExcelMetrics


ExcelMetrics.GetFont0SpaceWidth Method | FlexCel Studio for the .NET Framework documentation

ExcelMetrics.GetFont0SpaceWidth Method

Returns the width of a space (" ") in the main font of the workbook.

Syntax

Namespace: FlexCel.Core

public static Double GetFont0SpaceWidth(IRowColSize Workbook)

Parameters

<-> | Parameter | Type | Description
 | Workbook | IRowColSize |

See also

  • ExcelMetrics


ExcelMetrics.FmlaMult Method | FlexCel Studio for the .NET Framework documentation

ExcelMetrics.FmlaMult Method

When showing/printing the sheet and "Show formula" check box is on, column widths are double of the normal ones. This method returns 0.5 when "Show formulas" is turned on, and 1 if it is not.

Syntax

Namespace: FlexCel.Core

public static Double FmlaMult(IRowColSize Workbook)

Parameters

<-> | Parameter | Type | Description
 | Workbook | IRowColSize |

See also

  • ExcelMetrics


ExcelMetrics.ColMultDisplay Method | FlexCel Studio for the .NET Framework documentation

ExcelMetrics.ColMultDisplay Method

Multiply by this number to convert the width of a column from GraphicsUnit.Display units (1/100 inch) to Excel internal units. Note that the default column width is different, you need to multiply by DefColWidthAdapt See Excel Internal Units for more information in Excel internal units.

Syntax

Namespace: FlexCel.Core

public static Double ColMultDisplay(IRowColSize Workbook)

Parameters

<-> | Parameter | Type | Description
 | Workbook | IRowColSize |

See also

  • ExcelMetrics


ExcelMetrics.RowMultDisplay Method | FlexCel Studio for the .NET Framework documentation

ExcelMetrics.RowMultDisplay Method

Multiply by this number to convert the height of a row from GraphicsUnit.Display units (1/100 inch) to Excel internal units. See Excel Internal Units for more information in Excel internal units.

Remarks

1 Height unit=1/20 pt. 1pt=1/72 inch. -> 1 Height unit=1/(72*20) inch. -> 1inch/100= 72*20/100= 14.4 PrintPreview on Excel uses different coordinates than the screen.

Syntax

Namespace: FlexCel.Core

public static Double RowMultDisplay(IRowColSize Workbook)

Parameters

<-> | Parameter | Type | Description
 | Workbook | IRowColSize |

See also

  • ExcelMetrics


ExcelMetrics.ColMult Method | FlexCel Studio for the .NET Framework documentation

ExcelMetrics.ColMult Method

Multiply by this number to convert the width of a column from resolution-independent-pixels (1/96 of an inch) to excel internal units. Note that the default column width is different, you need to multiply by DefColWidthAdapt See Excel Internal Units for more information in Excel internal units.

Syntax

Namespace: FlexCel.Core

public static Double ColMult(IRowColSize Workbook)

Parameters

<-> | Parameter | Type | Description
 | Workbook | IRowColSize |

Examples

    double ColWidthInPixels = xls.GetColWidth(Col) / ExcelMetrics.ColMult(xls);

See also

  • ExcelMetrics


ExcelMetrics.DefColWidthAdapt Method | FlexCel Studio for the .NET Framework documentation

ExcelMetrics.DefColWidthAdapt Method

Convert the DEFAULT column width to resolution-independent-pixels (1/96 of an inch). This is different from ColMult, that goes in a column by column basis. See Excel Internal Units for more information in Excel internal units.

Syntax

Namespace: FlexCel.Core

public static Int32 DefColWidthAdapt(Int32 width, ExcelFile workbook)

Parameters

<-> | Parameter | Type | Description
 | width | Int32 |
 | workbook | ExcelFile |

See also

  • ExcelMetrics


FlexCelConfig Class | FlexCel Studio for the .NET Framework documentation

FlexCelConfig Class

A central point of for configuring FlexCel parameters.

Syntax

Namespace: FlexCel.Core

public static class FlexCelConfig

Properties

Name | Description
DpiForImages | Allows you to change the dpi for vector images (metafiles) when they are rasterized for converting to pdf / HTML / etc. Note that this is a static setting and will affect all files. This setting is the same as TExcelFile.​Dpi​ForImages
DpiForReadingImages | Allows you to set a DPI for all images FlexCel is importing. If this value is 0 (the default), then FlexCel will try to read the image resolution from the files themselves, if the files have a resolution saved. If there is no resolution saved with the image, FlexCel will assume the images have the screen resolution. When you set this property to a non 0 value (like 96 for example), then FlexCel will assume this is the resolution of the images it is reading, ignoring any resolution stored in the file.
XlsxCompressionLevel | Zip compression level when creating xlsx files. This setting is the same as TExcelFile.​XlsxCompression​Level.​ Xlsx files are zip files, and you can compress more or less by trading speed for file size. The faster you can create the file, the bigger the xlsx files created will be. Excel by default uses "Fastest" compression level and we use "Default". Normally using compression levels more than default is not worth it, since the files will take a lot longer to be created, and the size reduction will be very small.
PdfPngCompression​Level | Zip compression level when creating pdf files or re encoding png images. Pds and Png files are zip files, and you can compress more or less by trading speed for file size. The faster you can create the file, the bigger the pdf and png files created will be. Normally using compression levels more than default is not worth it, since the files will take a lot longer to be created, and the size reduction will be very small.
GraphicFramework | Defines the graphics framework that FlexCel will use. This property only works in .NET 5 or newer.
ForcePdfFonts​From​Disk | If true, FlexCel will always try to load the fonts for rendering PDF Files from the disk. This allows you to use events like GetFontFolder or GetFontData to tell FlexCel where the fonts are. If this property is set to false (the default), then FlexCel will get the font definition directly from the Graphics engine, if the Graphics engine has a primitive to get the font data. SKIA and CoreGraphics are 2 libraries that support getting the fonts directly.
MaxFontsToCache | Maximum number of fonts that can be cached in memory.
MaxLambdaRecursion | Maximum number of times that a name including a lambda function can refer to itself.
LocalizedTEXTFunction | The =TEXT() function in Excel changes with the locale. Imagine you have a cell with the value "1.23" and format the cell with a number format of "0.00". If you open the file with an English-Localized Excel you will see "1.23", but if you open the same file with a German-Localized Excel, you will see "1,23" instead. It happens automatically. But if you have a formula '=​TEXT(​1.​23,​"0.​00"​)​' it will show correctly in an English-Localized Excel, and as '123' in a German-Localized one. This is because the format string "0.00" is not converted automatically to "0,00" which is what a German Excel would need. ...[more]


FlexCelConfig.DpiForImages Property | FlexCel Studio for the .NET Framework documentation

FlexCelConfig.DpiForImages Property

Allows you to change the dpi for vector images (metafiles) when they are rasterized for converting to pdf / HTML / etc. Note that this is a static setting and will affect all files. This setting is the same as TExcelFile.DpiForImages

Syntax

Namespace: FlexCel.Core

public static Double DpiForImages { get; set; }

See also

  • FlexCelConfig


FlexCelConfig.DpiForReadingImages Property | FlexCel Studio for the .NET Framework documentation

FlexCelConfig.DpiForReadingImages Property

Allows you to set a DPI for all images FlexCel is importing. If this value is 0 (the default), then FlexCel will try to read the image resolution from the files themselves, if the files have a resolution saved. If there is no resolution saved with the image, FlexCel will assume the images have the screen resolution. When you set this property to a non 0 value (like 96 for example), then FlexCel will assume this is the resolution of the images it is reading, ignoring any resolution stored in the file.

Syntax

Namespace: FlexCel.Core

public static Double DpiForReadingImages { get; set; }

See also

  • FlexCelConfig


FlexCelConfig.XlsxCompressionLevel Property | FlexCel Studio for the .NET Framework documentation

FlexCelConfig.XlsxCompressionLevel Property

Zip compression level when creating xlsx files. This setting is the same as TExcelFile.XlsxCompressionLevel. Xlsx files are zip files, and you can compress more or less by trading speed for file size. The faster you can create the file, the bigger the xlsx files created will be. Excel by default uses "Fastest" compression level and we use "Default". Normally using compression levels more than default is not worth it, since the files will take a lot longer to be created, and the size reduction will be very small.

Remarks

Requires .NET 4.5 or newer. In older .NET versions it has no effect and compression is always default.

Syntax

Namespace: FlexCel.Core

public static CompressionLevel XlsxCompressionLevel { get; set; }

See also

  • FlexCelConfig


FlexCelConfig.PdfPngCompressionLevel Property | FlexCel Studio for the .NET Framework documentation

FlexCelConfig.PdfPngCompressionLevel Property

Zip compression level when creating pdf files or re encoding png images. Pds and Png files are zip files, and you can compress more or less by trading speed for file size. The faster you can create the file, the bigger the pdf and png files created will be. Normally using compression levels more than default is not worth it, since the files will take a lot longer to be created, and the size reduction will be very small.

Remarks

Requires .NET 4.5 or newer. In older .NET versions it has no effect and compression is always default.

Syntax

Namespace: FlexCel.Core

public static CompressionLevel PdfPngCompressionLevel { get; set; }

See also

  • FlexCelConfig


FlexCelConfig.GraphicFramework Property | FlexCel Studio for the .NET Framework documentation

FlexCelConfig.GraphicFramework Property

Defines the graphics framework that FlexCel will use. This property only works in .NET 5 or newer.

Syntax

Namespace: FlexCel.Core

public static FlexCelGraphicFramework GraphicFramework { get; set; }

See also

  • FlexCelConfig


FlexCelConfig.ForcePdfFontsFromDisk Property | FlexCel Studio for the .NET Framework documentation

FlexCelConfig.ForcePdfFontsFromDisk Property

If true, FlexCel will always try to load the fonts for rendering PDF Files from the disk. This allows you to use events like GetFontFolder or GetFontData to tell FlexCel where the fonts are. If this property is set to false (the default), then FlexCel will get the font definition directly from the Graphics engine, if the Graphics engine has a primitive to get the font data. SKIA and CoreGraphics are 2 libraries that support getting the fonts directly.

Remarks

Try to not rely in fonts that are not available to the graphics engine, as it could cause issues, for example if the graphics engine tries to measure the font for something.

If you set this property to true and provide the fonts to FlexCel via a PdfWriter.GetFontFolder event, the graphics engine powering FlexCel will not know about that font.

So if possible, try to keep this property false, and make the fonts available to your app in a different way.

For example in iOS, you can add the custom fonts to your app: https://developer.apple.com/documentation/uikit/text_display_and_fonts/adding_a_custom_font_to_your_app and https://developer.apple.com/documentation/bundleresources/information_property_list/uiappfonts You might also load those fonts to SKIA if using SKIA as backend.

Syntax

Namespace: FlexCel.Core

public static Boolean ForcePdfFontsFromDisk { get; set; }

See also

  • FlexCelConfig


FlexCelConfig.MaxFontsToCache Property | FlexCel Studio for the .NET Framework documentation

FlexCelConfig.MaxFontsToCache Property

Maximum number of fonts that can be cached in memory.

Syntax

Namespace: FlexCel.Core

public static Int32 MaxFontsToCache { get; set; }

See also

  • FlexCelConfig


FlexCelConfig.MaxLambdaRecursion Property | FlexCel Studio for the .NET Framework documentation

FlexCelConfig.MaxLambdaRecursion Property

Maximum number of times that a name including a lambda function can refer to itself.

Syntax

Namespace: FlexCel.Core

public static Int32 MaxLambdaRecursion { get; set; }

See also

  • FlexCelConfig


FlexCelConfig.LocalizedTEXTFunction Property | FlexCel Studio for the .NET Framework documentation

FlexCelConfig.LocalizedTEXTFunction Property

The =TEXT() function in Excel changes with the locale.

Imagine you have a cell with the value "1.23" and format the cell with a number format of "0.00". If you open the file with an English-Localized Excel you will see "1.23", but if you open the same file with a German-Localized Excel, you will see "1,23" instead. It happens automatically.

But if you have a formula '=TEXT(1.23,"0.00")' it will show correctly in an English-Localized Excel, and as '123' in a German-Localized one. This is because the format string "0.00" is not converted automatically to "0,00" which is what a German Excel would need.

This makes the function TEXT() useless if you need to share the file with users in others locales, and we recommend you avoid using TEXT() if possible. But if you can't change the spreadsheets, FlexCel offers two different behaviors for the function:

1. If LocalizedTEXTFunction is false (the default), FlexCel will always expect English strings in TEXT. You will always have to write =TEXT(A1,"0.00") in the cells, no matter the locale of your application. This method works better if you are creating PDFs from the xlsx files, as the PDFs will always work if you write the TEXT functions in English. The xlsx files will break if you distribute them to non-English-speaking countries, but there is no way to have TEXT() not break one way or the other.

2. If LocalizedTEXTFunction is true, FlexCel will expect "0,00" if the locale is German, and "0.00" if it is English. Use this mode if you are only targeting users all with the same locale, so you can write the correct xlsx files for them. If reading Excel files created by others with =TEXT, you might also need to set LocalizedTEXTFunction=true and set the FlexCel locale to match the locale the files where created in, in order to see the correct values.

To avoid breaking backwards compatibility, this setting is false by default. But you might find better to turn it on at the start of your app, so FlexCel will behave more like a localized Excel. TEXT() is still broken and you should avoid using it, but at least it will work for users with the same locale. Note also that this is a static property and it will affect all the threads of your app. It is recommended to change it once at the startup of the app, and not keep changing it.

Syntax

Namespace: FlexCel.Core

public static Boolean LocalizedTEXTFunction { get; set; }

See also

  • FlexCelConfig


FlexCelCoreException Class | FlexCel Studio for the .NET Framework documentation

FlexCelCoreException Class

Exception thrown when an exception on the core engine happens.

Syntax

Namespace: FlexCel.Core

public class FlexCelCoreException: FlexCelException

Constructors

Name | Description
FlexCelCoreException | Overloaded FlexCelCoreException FlexCelCoreException(String) FlexCelCoreException(String, FlxErr) FlexCelCoreException(String, Exception) FlexCelCoreException(String, FlxErr, Exception)

Properties

Name | Description
ErrorCode | Error code on the Exception.


FlexCelCoreException.FlexCelCoreException Constructor | FlexCel Studio for the .NET Framework documentation

FlexCelCoreException.FlexCelCoreException Constructor

Overloads

  • FlexCelCoreException.FlexCelCoreException
  • FlexCelCoreException.FlexCelCoreException(String)
  • FlexCelCoreException.FlexCelCoreException(String, FlxErr)
  • FlexCelCoreException.FlexCelCoreException(String, Exception)
  • FlexCelCoreException.FlexCelCoreException(String, FlxErr, Exception)

FlexCelCoreException.FlexCelCoreException

Creates a new FlexCelCoreException

Syntax

Namespace: FlexCel.Core

public FlexCelCoreException()

See also

  • FlexCelCoreException

FlexCelCoreException.FlexCelCoreException(String)

Creates a new FlexCelCoreException with an error message.

Syntax

Namespace: FlexCel.Core

public FlexCelCoreException(String message)

Parameters

<-> | Parameter | Type | Description
 | message | String | Error Message

See also

  • FlexCelCoreException

FlexCelCoreException.FlexCelCoreException(String, FlxErr)

Creates a new FlexCelCoreException with an error message and an exception code.

Syntax

Namespace: FlexCel.Core

public FlexCelCoreException(String message, FlxErr aErrorCode)

Parameters

<-> | Parameter | Type | Description
 | message | String | Error Message
 | aErrorCode | FlxErr | Error code of the exception.

See also

  • FlexCelCoreException

FlexCelCoreException.FlexCelCoreException(String, Exception)

Creates a nested Exception.

Syntax

Namespace: FlexCel.Core

public FlexCelCoreException(String message, Exception inner)

Parameters

<-> | Parameter | Type | Description
 | message | String | Error Message.
 | inner | Exception | Inner Exception.

See also

  • FlexCelCoreException

FlexCelCoreException.FlexCelCoreException(String, FlxErr, Exception)

Creates a nested Exception.

Syntax

Namespace: FlexCel.Core

public FlexCelCoreException(String message, FlxErr aErrorCode, Exception inner)

Parameters

<-> | Parameter | Type | Description
 | message | String | Error Message.
 | aErrorCode | FlxErr | Error code of the exception.
 | inner | Exception | Inner Exception.

See also

  • FlexCelCoreException


FlexCelCoreException.ErrorCode Property | FlexCel Studio for the .NET Framework documentation

FlexCelCoreException.ErrorCode Property

Error code on the Exception.

Syntax

Namespace: FlexCel.Core

public FlxErr ErrorCode { get; }

See also

  • FlexCelCoreException


FlexCelDataFormats Class | FlexCel Studio for the .NET Framework documentation

FlexCelDataFormats Class

Excel formats to copy/paste to/from the clipboard

Syntax

Namespace: FlexCel.Core

public static class FlexCelDataFormats

Fields

Name | Description
Excel97 | Native Excel 97/2003 Format (xls).
UnicodeText | Unicode text.
Html | Clipboard html.

Methods

Name | Description
GetString | Returns the string used for a specific FlexCelClipboard​Format.​


FlexCelDataFormats.Excel97 Field | FlexCel Studio for the .NET Framework documentation

FlexCelDataFormats.Excel97 Field

Native Excel 97/2003 Format (xls).

Syntax

Namespace: FlexCel.Core

public const String Excel97 = "Biff8"

See also

  • FlexCelDataFormats


FlexCelDataFormats.UnicodeText Field | FlexCel Studio for the .NET Framework documentation

FlexCelDataFormats.UnicodeText Field

Unicode text.

Syntax

Namespace: FlexCel.Core

public const String UnicodeText = "UnicodeText"

See also

  • FlexCelDataFormats


FlexCelDataFormats.Html Field | FlexCel Studio for the .NET Framework documentation

FlexCelDataFormats.Html Field

Clipboard html.

Syntax

Namespace: FlexCel.Core

public const String Html = "HTML Format"

See also

  • FlexCelDataFormats


FlexCelDataFormats.GetString Method | FlexCel Studio for the .NET Framework documentation

FlexCelDataFormats.GetString Method

Returns the string used for a specific FlexCelClipboardFormat.

Syntax

Namespace: FlexCel.Core

public static String GetString(FlexCelClipboardFormat fmt)

Parameters

<-> | Parameter | Type | Description
 | fmt | FlexCelClipboard​Format |

See also

  • FlexCelDataFormats


FlexCelException Class | FlexCel Studio for the .NET Framework documentation

FlexCelException Class

Exception thrown when a specific FlexCel error happens. Base of all FlexCel hierarchy list.

Syntax

Namespace: FlexCel.Core

public class FlexCelException: Exception

Constructors

Name | Description
FlexCelException | Overloaded FlexCelException FlexCelException(String) FlexCelException(String, Exception)


FlexCelException.FlexCelException Constructor | FlexCel Studio for the .NET Framework documentation

FlexCelException.FlexCelException Constructor

Overloads

  • FlexCelException.FlexCelException
  • FlexCelException.FlexCelException(String)
  • FlexCelException.FlexCelException(String, Exception)

FlexCelException.FlexCelException

Creates a new FlexCelException

Syntax

Namespace: FlexCel.Core

public FlexCelException()

See also

  • FlexCelException

FlexCelException.FlexCelException(String)

Creates a new FlexCelException with an error message.

Syntax

Namespace: FlexCel.Core

public FlexCelException(String message)

Parameters

<-> | Parameter | Type | Description
 | message | String | Error Message

See also

  • FlexCelException

FlexCelException.FlexCelException(String, Exception)

Creates a nested Exception.

Syntax

Namespace: FlexCel.Core

public FlexCelException(String message, Exception inner)

Parameters

<-> | Parameter | Type | Description
 | message | String | Error Message.
 | inner | Exception | Inner Exception.

See also

  • FlexCelException


FlexCelTrace Class | FlexCel Studio for the .NET Framework documentation

FlexCelTrace Class

This class reports al FlexCel non-fatal errors. Use it to diagnose when something is going wrong.

Syntax

Namespace: FlexCel.Core

public static class FlexCelTrace

Properties

Name | Description
Enabled | Set this to false if you want to prevent FlexCel from tracing non fatal errors. Note that if you don't have any event attached to this class the result will be the same as having Enabled = false.

Events

Name | Description
OnError | This event is called each time a non fatal error happens in FlexCel. Hook an event listener to it to be notified when this happens.


FlexCelTrace.Enabled Property | FlexCel Studio for the .NET Framework documentation

FlexCelTrace.Enabled Property

Set this to false if you want to prevent FlexCel from tracing non fatal errors. Note that if you don't have any event attached to this class the result will be the same as having Enabled = false.

Syntax

Namespace: FlexCel.Core

public static Boolean Enabled { get; set; }

See also

  • FlexCelTrace


FlexCelTrace.OnError Event | FlexCel Studio for the .NET Framework documentation

FlexCelTrace.OnError Event

This event is called each time a non fatal error happens in FlexCel. Hook an event listener to it to be notified when this happens.

Syntax

Namespace: FlexCel.Core

public FlexCelErrorEventHandler OnError

See also

  • FlexCelTrace


FlxConsts Class | FlexCel Studio for the .NET Framework documentation

FlxConsts Class

Utility methods and constants usable anywhere.

Syntax

Namespace: FlexCel.Core

public static class FlxConsts

Fields

Name | Description
DefColWidthAdapt | OBSOLETE: Use ExcelMetrics.​Def​ColWidth​Adapt instead. Multiply by this number to convert the DEFAULT column width to pixels. This is different from ColMult, that goes in a column by column basis.
Max_Columns97_2003 | Maximum column on an xls (Excel 97 - 2003) spreadsheet. (0 based, that is 255)
Max_Columns2007 | Maximum column on an xlsx (Excel 2007 and up) spreadsheet. (0 based, that is 16383)
Max_Rows97_2003 | Maximum row on an xls (Excel 97 - 2003) spreadsheet. (0 based, that is 65535)
Max_Rows95 | Maximum row on an xls (Excel 2 - 95) spreadsheet. (0 based)
Max_Rows2007 | Maximum row on an xlsx (Excel 2007 and up) spreadsheet. (0 based, that is 1048575)
Max_Sheets | Maximum sheet on a spreadsheet. (0 based, that is 65530)
Max_PxlColumns | Maximum column on Pocket Excel a spreadsheet. (0 based, that is 255)
Max_PxlRows | Maximum row on a Pocket Excel spreadsheet. (0 based, that is 16383)
Max_PxlSheets | Maximum sheet on a Pocket Excel spreadsheet. (0 based, that is 255)
Max_​Formula​Arguments2003 | Maximum number of arguments for a formula in xls file format.
Max_​Formula​Arguments2007 | Maximum number of arguments for a formula in xlsx file format.
Max_StringLenInCell | Maximum length of a string in a cell.
ColMult | OBSOLETE: Use ExcelMetrics.ColMult instead. Multiply by this number to convert the width of a column from pixels to excel internal units. Note that the default column width is different, you need to multiply by DefColWidthAdapt
RowMult | Multiply by this number to convert pixels to excel row height units.
DispMul | Number of points in an inch.
ColMultDisplay | OBSOLETE: Use ExcelMetrics.​Col​Mult​Display instead. Multiply by this number to convert the width of a column from GraphicsUnit.​Display units (1/100 inch) to Excel internal units. Note that the default column width is different, you need to multiply by DefColWidthAdapt
RowMultDisplay | OBSOLETE: Use ExcelMetrics.​Row​Mult​Display instead. Multiply by this number to convert the height of a row from GraphicsUnit.​Display units (1/100 inch) to Excel internal units.
DefaultBrightness | Brightness to keep the image unchanged.
DefaultContrast | Contrast to keep the image unchanged.
DefaultGamma | Gamma to keep the image unchanged.
DefaultRotation | Zero rotation.
NoTransparentColor | Constant meaning there is no transparent color defined on the image.
DefaultFormatId | The default XF for a file. You can also access this value with ExcelFile.​Default​FormatId
ObjectPathSeparator | String used to separate 2 objects on an object path.
ObjectPathAbsolute | When an objpath starts with this character, it is an absolute path that includes the object index. If it doesn't start with it, then the ObjPath doesn't include the original object.
ObjectPathObjName | When an objpath starts with this character, it is a path that goes directly to the name of an object. Note that when more than an object have the same name in the same sheet, this path won't work and you will have to use absolute or relative ones.
ObjectPathSpId | When an objpath starts with this character, what follows is a single shape id that identifies the object.
MaxNestedCamera​Objects | When a camera object references an cell range that includes the camera object, there would be infinite recursion. This variable determines what is the maximum times that FlexCel will recurse when rendering the camera objects.

Methods

Name | Description
EncodeColumn | OBSOLETE: Use TCellAddress.​Encode​Column instead. Returns "A" for column 1, "B" for 2 and so on.

Properties

Name | Description
Max_Columns | Maximum column in the spreadsheet. (0 based). Note that this number is 1 less than the maximum column count, because this value is 0-based. You can use MaxColCount to get the number of columns instead. This number might be 255 if ExcelFile.​Excel​Version is TExcelVersion.​v97_​2003 or 16383 otherwise.
MaxRowCount | Returns the maximum number of rows that you can have in a spreadsheet. This is the same as Max_Rows + 1. This number might be 65536 if ExcelFile.​Excel​Version is TExcelVersion.​v97_​2003 or 1048576 otherwise.
MaxColCount | Returns the maximum number of columns that you can have in a spreadsheet. This is the same as Max_Columns + 1. This number might be 256 if ExcelFile.​Excel​Version is TExcelVersion.​v97_​2003 or 16384 otherwise.
Max_Rows | Maximum row in the spreadsheet. (0 based). Note that this number is 1 less than the maximum row count, because this value is 0-based. You can use MaxRowCount to get the number of columns instead. This number might be 65535 if ExcelFile.​Excel​Version is TExcelVersion.​v97_​2003 or 1048575 otherwise.
Max_​Letters​InColumn​Name | Number of letters in a column name. This is 2 in xls97 (columns go up to IV) and 3 in xls2007 (columns go up to XFD)
Max_FormulaLen | Maximum number of characters in a Formula
Max_​Formula​String​Constant | Maximum length of a direct string inside a formula, as in ' = "my long string..."
Max_​Formula​Len97_​2003 | Maximum number of characters in a Formula for an Excel 97 to 2003 spreadsheet.
Max_FormulaLen2007 | Maximum number of characters in a Formula for an Excel 2007 or newer spreadsheet.
Max_DvErrorTitleLen | Maximum number of characters in an Error title for a Data Validation.
Max_DvErrorTextLen | Maximum number of characters in an Error text for a Data Validation.
Max_DvInputTitleLen | Maximum number of characters in an Input title for a Data Validation.
Max_DvInputTextLen | Maximum number of characters in an Input text for a Data Validation.
Max_CommentAuthor | Maximum number of characters allowed in the author of a comment.
Max_ChartSeries | Maximum number of series in a chart.
MaxRowHeight | The maximum height you can set in a row, multiplied by 20. This is (409 * 20 + 10) and means a maximum row height of 409.5. Excel says the maximum is 409, but you can enter up to 409.5
Min_FontSize | Minimum font size allowed in a file.
Max_FontSize | Maximum font size allowed in a file.


FlxConsts.DefColWidthAdapt Field | FlexCel Studio for the .NET Framework documentation

FlxConsts.DefColWidthAdapt Field

Important

This Field is obsolete.

This constant will not work when the user modifies the default font on a file. Use ExcelMetrics.DefColWidthAdapt instead.

OBSOLETE: Use ExcelMetrics.DefColWidthAdapt instead.

Multiply by this number to convert the DEFAULT column width to pixels. This is different from ColMult, that goes in a column by column basis.

Syntax

Namespace: FlexCel.Core

public const Int32 DefColWidthAdapt = 293

See also

  • FlxConsts


FlxConsts.Max_Columns97_2003 Field | FlexCel Studio for the .NET Framework documentation

FlxConsts.Max_Columns97_2003 Field

Maximum column on an xls (Excel 97 - 2003) spreadsheet. (0 based, that is 255)

Syntax

Namespace: FlexCel.Core

public const Int32 Max_Columns97_2003 = 255

See also

  • FlxConsts


FlxConsts.Max_Columns2007 Field | FlexCel Studio for the .NET Framework documentation

FlxConsts.Max_Columns2007 Field

Maximum column on an xlsx (Excel 2007 and up) spreadsheet. (0 based, that is 16383)

Syntax

Namespace: FlexCel.Core

public const Int32 Max_Columns2007 = 16383

See also

  • FlxConsts


FlxConsts.Max_Rows97_2003 Field | FlexCel Studio for the .NET Framework documentation

FlxConsts.Max_Rows97_2003 Field

Maximum row on an xls (Excel 97 - 2003) spreadsheet. (0 based, that is 65535)

Syntax

Namespace: FlexCel.Core

public const Int32 Max_Rows97_2003 = 65535

See also

  • FlxConsts


FlxConsts.Max_Rows95 Field | FlexCel Studio for the .NET Framework documentation

FlxConsts.Max_Rows95 Field

Maximum row on an xls (Excel 2 - 95) spreadsheet. (0 based)

Syntax

Namespace: FlexCel.Core

public const Int32 Max_Rows95 = 16383

See also

  • FlxConsts


FlxConsts.Max_Rows2007 Field | FlexCel Studio for the .NET Framework documentation

FlxConsts.Max_Rows2007 Field

Maximum row on an xlsx (Excel 2007 and up) spreadsheet. (0 based, that is 1048575)

Syntax

Namespace: FlexCel.Core

public const Int32 Max_Rows2007 = 1048575

See also

  • FlxConsts


FlxConsts.Max_Sheets Field | FlexCel Studio for the .NET Framework documentation

FlxConsts.Max_Sheets Field

Maximum sheet on a spreadsheet. (0 based, that is 65530)

Syntax

Namespace: FlexCel.Core

public const Int32 Max_Sheets = 65530

See also

  • FlxConsts


FlxConsts.Max_PxlColumns Field | FlexCel Studio for the .NET Framework documentation

FlxConsts.Max_PxlColumns Field

Maximum column on Pocket Excel a spreadsheet. (0 based, that is 255)

Syntax

Namespace: FlexCel.Core

public const Int32 Max_PxlColumns = 255

See also

  • FlxConsts


FlxConsts.Max_PxlRows Field | FlexCel Studio for the .NET Framework documentation

FlxConsts.Max_PxlRows Field

Maximum row on a Pocket Excel spreadsheet. (0 based, that is 16383)

Syntax

Namespace: FlexCel.Core

public const Int32 Max_PxlRows = 16383

See also

  • FlxConsts


FlxConsts.Max_PxlSheets Field | FlexCel Studio for the .NET Framework documentation

FlxConsts.Max_PxlSheets Field

Maximum sheet on a Pocket Excel spreadsheet. (0 based, that is 255)

Syntax

Namespace: FlexCel.Core

public const Int32 Max_PxlSheets = 255

See also

  • FlxConsts


FlxConsts.Max_FormulaArguments2003 Field | FlexCel Studio for the .NET Framework documentation

FlxConsts.Max_FormulaArguments2003 Field

Maximum number of arguments for a formula in xls file format.

Syntax

Namespace: FlexCel.Core

public const Int32 Max_FormulaArguments2003 = 30

See also

  • FlxConsts


FlxConsts.Max_FormulaArguments2007 Field | FlexCel Studio for the .NET Framework documentation

FlxConsts.Max_FormulaArguments2007 Field

Maximum number of arguments for a formula in xlsx file format.

Syntax

Namespace: FlexCel.Core

public const Int32 Max_FormulaArguments2007 = 255

See also

  • FlxConsts


FlxConsts.Max_StringLenInCell Field | FlexCel Studio for the .NET Framework documentation

FlxConsts.Max_StringLenInCell Field

Maximum length of a string in a cell.

Syntax

Namespace: FlexCel.Core

public const Int32 Max_StringLenInCell = 32767

See also

  • FlxConsts


FlxConsts.ColMult Field | FlexCel Studio for the .NET Framework documentation

FlxConsts.ColMult Field

Important

This Field is obsolete.

This constant will not work when the user modifies the default font on a file. Use ExcelMetrics.ColMult instead.

OBSOLETE: Use ExcelMetrics.ColMult instead.

Multiply by this number to convert the width of a column from pixels to excel internal units. Note that the default column width is different, you need to multiply by DefColWidthAdapt

Syntax

Namespace: FlexCel.Core

public const Double ColMult = 36.5714285714286

See also

  • FlxConsts


FlxConsts.RowMult Field | FlexCel Studio for the .NET Framework documentation

FlxConsts.RowMult Field

Multiply by this number to convert pixels to excel row height units.

Remarks

1 Height unit= 1/20 pt. 1pt=1/72 inch. At 96ppi, 1 Height Unit= 96/(72*20)pixels -> 1 pix=(72*20)/96 = 15 Height units.

Syntax

Namespace: FlexCel.Core

public const Double RowMult = 15

Examples

    double RowHeightInPixels = xls.GetRowHeight(Row) / FlxConsts.RowMult;

See also

  • FlxConsts


FlxConsts.DispMul Field | FlexCel Studio for the .NET Framework documentation

FlxConsts.DispMul Field

Number of points in an inch.

Syntax

Namespace: FlexCel.Core

public const Double DispMul = 72

See also

  • FlxConsts


FlxConsts.ColMultDisplay Field | FlexCel Studio for the .NET Framework documentation

FlxConsts.ColMultDisplay Field

Important

This Field is obsolete.

This constant will not work when the user modifies the default font on a file. Use ExcelMetrics.ColMultDisplay instead.

OBSOLETE: Use ExcelMetrics.ColMultDisplay instead.

Multiply by this number to convert the width of a column from GraphicsUnit.Display units (1/100 inch) to Excel internal units. Note that the default column width is different, you need to multiply by DefColWidthAdapt

Syntax

Namespace: FlexCel.Core

public const Double ColMultDisplay = 33.45

See also

  • FlxConsts


FlxConsts.RowMultDisplay Field | FlexCel Studio for the .NET Framework documentation

FlxConsts.RowMultDisplay Field

Important

This Field is obsolete.

Use ExcelMetrics.RowMultDisplay instead.

OBSOLETE: Use ExcelMetrics.RowMultDisplay instead.

Multiply by this number to convert the height of a row from GraphicsUnit.Display units (1/100 inch) to Excel internal units.

Remarks

1 Height unit=1/20 pt. 1pt=1/72 inch. -> 1 Height unit=1/(72*20) inch. -> 1inch/100= 72*20/100= 14.4

Syntax

Namespace: FlexCel.Core

public const Double RowMultDisplay = 14.72

See also

  • FlxConsts


FlxConsts.DefaultBrightness Field | FlexCel Studio for the .NET Framework documentation

FlxConsts.DefaultBrightness Field

Brightness to keep the image unchanged.

Syntax

Namespace: FlexCel.Core

public const Int32 DefaultBrightness = 0

See also

  • FlxConsts


FlxConsts.DefaultContrast Field | FlexCel Studio for the .NET Framework documentation

FlxConsts.DefaultContrast Field

Contrast to keep the image unchanged.

Syntax

Namespace: FlexCel.Core

public const Int32 DefaultContrast = 65536

See also

  • FlxConsts


FlxConsts.DefaultGamma Field | FlexCel Studio for the .NET Framework documentation

FlxConsts.DefaultGamma Field

Gamma to keep the image unchanged.

Syntax

Namespace: FlexCel.Core

public const Int32 DefaultGamma = 0

See also

  • FlxConsts


FlxConsts.DefaultRotation Field | FlexCel Studio for the .NET Framework documentation

FlxConsts.DefaultRotation Field

Zero rotation.

Syntax

Namespace: FlexCel.Core

public const Int32 DefaultRotation = 0

See also

  • FlxConsts


FlxConsts.NoTransparentColor Field | FlexCel Studio for the .NET Framework documentation

FlxConsts.NoTransparentColor Field

Constant meaning there is no transparent color defined on the image.

Syntax

Namespace: FlexCel.Core

public const Int64 NoTransparentColor = -1

See also

  • FlxConsts


FlxConsts.DefaultFormatId Field | FlexCel Studio for the .NET Framework documentation

FlxConsts.DefaultFormatId Field

The default XF for a file. You can also access this value with ExcelFile.DefaultFormatId

Syntax

Namespace: FlexCel.Core

public const Int32 DefaultFormatId = 0

See also

  • FlxConsts


FlxConsts.ObjectPathSeparator Field | FlexCel Studio for the .NET Framework documentation

FlxConsts.ObjectPathSeparator Field

String used to separate 2 objects on an object path.

Syntax

Namespace: FlexCel.Core

public const String ObjectPathSeparator = "\\"

See also

  • FlxConsts


FlxConsts.ObjectPathAbsolute Field | FlexCel Studio for the .NET Framework documentation

FlxConsts.ObjectPathAbsolute Field

When an objpath starts with this character, it is an absolute path that includes the object index. If it doesn't start with it, then the ObjPath doesn't include the original object.

Syntax

Namespace: FlexCel.Core

public const String ObjectPathAbsolute = "\\"

See also

  • FlxConsts


FlxConsts.ObjectPathObjName Field | FlexCel Studio for the .NET Framework documentation

FlxConsts.ObjectPathObjName Field

When an objpath starts with this character, it is a path that goes directly to the name of an object. Note that when more than an object have the same name in the same sheet, this path won't work and you will have to use absolute or relative ones.

Syntax

Namespace: FlexCel.Core

public const String ObjectPathObjName = "@"

See also

  • FlxConsts


FlxConsts.ObjectPathSpId Field | FlexCel Studio for the .NET Framework documentation

FlxConsts.ObjectPathSpId Field

When an objpath starts with this character, what follows is a single shape id that identifies the object.

Syntax

Namespace: FlexCel.Core

public const String ObjectPathSpId = "|"

See also

  • FlxConsts


FlxConsts.MaxNestedCameraObjects Field | FlexCel Studio for the .NET Framework documentation

FlxConsts.MaxNestedCameraObjects Field

When a camera object references an cell range that includes the camera object, there would be infinite recursion. This variable determines what is the maximum times that FlexCel will recurse when rendering the camera objects.

Syntax

Namespace: FlexCel.Core

public static Int32 MaxNestedCameraObjects

See also

  • FlxConsts


FlxConsts.EncodeColumn Method | FlexCel Studio for the .NET Framework documentation

FlxConsts.EncodeColumn Method

Important

This Method is obsolete.

Use TCellAddress.EncodeColumn instead.

OBSOLETE: Use TCellAddress.EncodeColumn instead.

Returns "A" for column 1, "B" for 2 and so on.

Syntax

Namespace: FlexCel.Core

public static String EncodeColumn(Int32 column)

Parameters

<-> | Parameter | Type | Description
 | column | Int32 | Index of the column, 1 based.

See also

  • FlxConsts


FlxConsts.Max_Columns Property | FlexCel Studio for the .NET Framework documentation

FlxConsts.Max_Columns Property

Maximum column in the spreadsheet. (0 based). Note that this number is 1 less than the maximum column count, because this value is 0-based. You can use MaxColCount to get the number of columns instead.

This number might be 255 if ExcelFile.ExcelVersion is TExcelVersion.v97_2003 or 16383 otherwise.

Syntax

Namespace: FlexCel.Core

public static Int32 Max_Columns { get; }

See also

  • FlxConsts


FlxConsts.MaxRowCount Property | FlexCel Studio for the .NET Framework documentation

FlxConsts.MaxRowCount Property

Returns the maximum number of rows that you can have in a spreadsheet. This is the same as Max_Rows + 1.

This number might be 65536 if ExcelFile.ExcelVersion is TExcelVersion.v97_2003 or 1048576 otherwise.

Syntax

Namespace: FlexCel.Core

public static Int32 MaxRowCount { get; }

See also

  • FlxConsts


FlxConsts.MaxColCount Property | FlexCel Studio for the .NET Framework documentation

FlxConsts.MaxColCount Property

Returns the maximum number of columns that you can have in a spreadsheet. This is the same as Max_Columns + 1.

This number might be 256 if ExcelFile.ExcelVersion is TExcelVersion.v97_2003 or 16384 otherwise.

Syntax

Namespace: FlexCel.Core

public static Int32 MaxColCount { get; }

See also

  • FlxConsts


FlxConsts.Max_Rows Property | FlexCel Studio for the .NET Framework documentation

FlxConsts.Max_Rows Property

Maximum row in the spreadsheet. (0 based). Note that this number is 1 less than the maximum row count, because this value is 0-based. You can use MaxRowCount to get the number of columns instead.

This number might be 65535 if ExcelFile.ExcelVersion is TExcelVersion.v97_2003 or 1048575 otherwise.

Syntax

Namespace: FlexCel.Core

public static Int32 Max_Rows { get; }

See also

  • FlxConsts


FlxConsts.Max_LettersInColumnName Property | FlexCel Studio for the .NET Framework documentation

FlxConsts.Max_LettersInColumnName Property

Number of letters in a column name. This is 2 in xls97 (columns go up to IV) and 3 in xls2007 (columns go up to XFD)

Syntax

Namespace: FlexCel.Core

public static Int32 Max_LettersInColumnName { get; }

See also

  • FlxConsts


FlxConsts.Max_FormulaLen Property | FlexCel Studio for the .NET Framework documentation

FlxConsts.Max_FormulaLen Property

Maximum number of characters in a Formula

Syntax

Namespace: FlexCel.Core

public static Int32 Max_FormulaLen { get; }

See also

  • FlxConsts


FlxConsts.Max_FormulaStringConstant Property | FlexCel Studio for the .NET Framework documentation

FlxConsts.Max_FormulaStringConstant Property

Maximum length of a direct string inside a formula, as in ' = "my long string..."

Syntax

Namespace: FlexCel.Core

public static Int32 Max_FormulaStringConstant { get; }

See also

  • FlxConsts


FlxConsts.Max_FormulaLen97_2003 Property | FlexCel Studio for the .NET Framework documentation

FlxConsts.Max_FormulaLen97_2003 Property

Maximum number of characters in a Formula for an Excel 97 to 2003 spreadsheet.

Syntax

Namespace: FlexCel.Core

public static Int32 Max_FormulaLen97_2003 { get; }

See also

  • FlxConsts


FlxConsts.Max_FormulaLen2007 Property | FlexCel Studio for the .NET Framework documentation

FlxConsts.Max_FormulaLen2007 Property

Maximum number of characters in a Formula for an Excel 2007 or newer spreadsheet.

Syntax

Namespace: FlexCel.Core

public static Int32 Max_FormulaLen2007 { get; }

See also

  • FlxConsts


FlxConsts.Max_DvErrorTitleLen Property | FlexCel Studio for the .NET Framework documentation

FlxConsts.Max_DvErrorTitleLen Property

Maximum number of characters in an Error title for a Data Validation.

Syntax

Namespace: FlexCel.Core

public static Int32 Max_DvErrorTitleLen { get; }

See also

  • FlxConsts


FlxConsts.Max_DvErrorTextLen Property | FlexCel Studio for the .NET Framework documentation

FlxConsts.Max_DvErrorTextLen Property

Maximum number of characters in an Error text for a Data Validation.

Syntax

Namespace: FlexCel.Core

public static Int32 Max_DvErrorTextLen { get; }

See also

  • FlxConsts


FlxConsts.Max_DvInputTitleLen Property | FlexCel Studio for the .NET Framework documentation

FlxConsts.Max_DvInputTitleLen Property

Maximum number of characters in an Input title for a Data Validation.

Syntax

Namespace: FlexCel.Core

public static Int32 Max_DvInputTitleLen { get; }

See also

  • FlxConsts


FlxConsts.Max_DvInputTextLen Property | FlexCel Studio for the .NET Framework documentation

FlxConsts.Max_DvInputTextLen Property

Maximum number of characters in an Input text for a Data Validation.

Syntax

Namespace: FlexCel.Core

public static Int32 Max_DvInputTextLen { get; }

See also

  • FlxConsts


FlxConsts.Max_CommentAuthor Property | FlexCel Studio for the .NET Framework documentation

FlxConsts.Max_CommentAuthor Property

Maximum number of characters allowed in the author of a comment.

Syntax

Namespace: FlexCel.Core

public static Int32 Max_CommentAuthor { get; }

See also

  • FlxConsts


FlxConsts.Max_ChartSeries Property | FlexCel Studio for the .NET Framework documentation

FlxConsts.Max_ChartSeries Property

Maximum number of series in a chart.

Syntax

Namespace: FlexCel.Core

public static Int32 Max_ChartSeries { get; }

See also

  • FlxConsts


FlxConsts.MaxRowHeight Property | FlexCel Studio for the .NET Framework documentation

FlxConsts.MaxRowHeight Property

The maximum height you can set in a row, multiplied by 20. This is (409 * 20 + 10) and means a maximum row height of 409.5. Excel says the maximum is 409, but you can enter up to 409.5

Syntax

Namespace: FlexCel.Core

public static Int32 MaxRowHeight { get; }

See also

  • FlxConsts


FlxConsts.Min_FontSize Property | FlexCel Studio for the .NET Framework documentation

FlxConsts.Min_FontSize Property

Minimum font size allowed in a file.

Syntax

Namespace: FlexCel.Core

public static Double Min_FontSize { get; }

See also

  • FlxConsts


FlxConsts.Max_FontSize Property | FlexCel Studio for the .NET Framework documentation

FlxConsts.Max_FontSize Property

Maximum font size allowed in a file.

Syntax

Namespace: FlexCel.Core

public static Double Max_FontSize { get; }

See also

  • FlxConsts


FlxDateTime Class | FlexCel Studio for the .NET Framework documentation

FlxDateTime Class

Use this class to convert between a Date expressed on Excel format (a double) and a TDateTime.

Syntax

Namespace: FlexCel.Core

public static class FlxDateTime

Fields

Name | Description
OADateMinAsDouble | Minimum date allowed in a OLE Automation date.
OADateMaxAsDouble | Maximum date allowed in a OLE Automation date.

Methods

Name | Description
ToOADate Overloaded
 ToOADate(DateTime, Boolean)
ToOADate(DateTime, Boolean, Boolean)
TryToOADate Converts a DateTime into a Double on Excel format for dates (Ole Automation Format).
FromOADate Converts a Double on Excel format for dates (Ole Automation Format) into a DateTime.
IsValidDate Returns true is the double value can be converted into and Excel date.
TryFromOADate Converts a Double on Excel format for dates (Ole Automation Format) into a DateTime.
ToISO8601 | Returns a date formatted as ISO8601
ToISO8601Local Returns a date formatted as ISO8601 from an OLE Automation Date. It won't convert to UTC time, but use local times instead.


FlxDateTime.OADateMinAsDouble Field | FlexCel Studio for the .NET Framework documentation

FlxDateTime.OADateMinAsDouble Field

Minimum date allowed in a OLE Automation date.

Syntax

Namespace: FlexCel.Core

public const Double OADateMinAsDouble = -657435

See also

  • FlxDateTime


FlxDateTime.OADateMaxAsDouble Field | FlexCel Studio for the .NET Framework documentation

FlxDateTime.OADateMaxAsDouble Field

Maximum date allowed in a OLE Automation date.

Syntax

Namespace: FlexCel.Core

public const Double OADateMaxAsDouble = 2958466

See also

  • FlxDateTime


FlxDateTime.ToOADate Method | FlexCel Studio for the .NET Framework documentation

FlxDateTime.ToOADate Method

Overloads

  • FlxDateTime.ToOADate(DateTime, Boolean)
  • FlxDateTime.ToOADate(DateTime, Boolean, Boolean)

FlxDateTime.ToOADate(DateTime, Boolean)

Converts a DateTime into a Double on Excel format for dates (Ole Automation Format).

Syntax

Namespace: FlexCel.Core

public static Double ToOADate(DateTime value, Boolean Dates1904)

Parameters

<-> | Parameter | Type | Description
 | value | DateTime | DateTime you want to convert.
 | Dates1904 | Boolean | When true dates start at 1904 (pre-OSX macs) instead of 1900 (Windows)

Returns

The value as a double on Excel format.

See also

  • FlxDateTime

FlxDateTime.ToOADate(DateTime, Boolean, Boolean)

Converts a DateTime into a Double on Excel format for dates (Ole Automation Format).

Syntax

Namespace: FlexCel.Core

public static Double ToOADate(DateTime value, Boolean Dates1904, Boolean FirstIsDec1899)

Parameters

<-> | Parameter | Type | Description
 | value | DateTime | DateTime you want to convert.
 | Dates1904 | Boolean | When true dates start at 1904 (pre-OSX macs) instead of 1900 (Windows)
 | FirstIsDec1899 | Boolean | If true, the minimum date returned will be Dec 31, 1899. If false, the minimum is Jan 1, 1900. Note that none of them is valid of a date of 0. Excel shows 1900-01-00 in that case.

Returns

The value as a double on Excel format.

See also

  • FlxDateTime


FlxDateTime.TryToOADate Method | FlexCel Studio for the .NET Framework documentation

FlxDateTime.TryToOADate Method

Converts a DateTime into a Double on Excel format for dates (Ole Automation Format).

Syntax

Namespace: FlexCel.Core

public static Boolean TryToOADate(DateTime value, Boolean Dates1904, out Double ResultDate)

Parameters

<-> | Parameter | Type | Description
 | value | DateTime | DateTime you want to convert.
 | Dates1904 | Boolean | When true dates start at 1904 (pre-OSX macs) instead of 1900 (Windows)
out | ResultDate | Double | Returns the value as double on Excel format. Note that this value will be valid even if the date was an invalid OLE Automation date and the result from this method is false.

Returns

True if conversion was successful, false otherwise.

See also

  • FlxDateTime


FlxDateTime.FromOADate Method | FlexCel Studio for the .NET Framework documentation

FlxDateTime.FromOADate Method

Converts a Double on Excel format for dates (Ole Automation Format) into a DateTime.

Syntax

Namespace: FlexCel.Core

public static DateTime FromOADate(Double value, Boolean Dates1904)

Parameters

<-> | Parameter | Type | Description
 | value | Double | Double you want to convert.
 | Dates1904 | Boolean | When true dates start at 1904 (pre-OSX macs) instead of 1900 (Windows)

Returns

The value as DateTime.

See also

  • FlxDateTime


FlxDateTime.IsValidDate Method | FlexCel Studio for the .NET Framework documentation

FlxDateTime.IsValidDate Method

Returns true is the double value can be converted into and Excel date.

Syntax

Namespace: FlexCel.Core

public static Boolean IsValidDate(Double value, Boolean Dates1904)

Parameters

<-> | Parameter | Type | Description
 | value | Double | Double you want to convert.
 | Dates1904 | Boolean | When true dates start at 1904 (pre-OSX macs) instead of 1900 (Windows)

See also

  • FlxDateTime


FlxDateTime.TryFromOADate Method | FlexCel Studio for the .NET Framework documentation

FlxDateTime.TryFromOADate Method

Converts a Double on Excel format for dates (Ole Automation Format) into a DateTime.

Syntax

Namespace: FlexCel.Core

public static Boolean TryFromOADate(Double value, Boolean Dates1904, out DateTime ResultDate)

Parameters

<-> | Parameter | Type | Description
 | value | Double | Double you want to convert.
 | Dates1904 | Boolean | When true dates start at 1904 (pre-OSX macs) instead of 1900 (Windows)
out | ResultDate | DateTime | Returns the value as DateTime.

Returns

True if conversion was successful, false otherwise.

See also

  • FlxDateTime


FlxDateTime.ToISO8601 Method | FlexCel Studio for the .NET Framework documentation

FlxDateTime.ToISO8601 Method

Returns a date formatted as ISO8601

Syntax

Namespace: FlexCel.Core

public static String ToISO8601(DateTime UTC_d)

Parameters

<-> | Parameter | Type | Description
 | UTC_d | DateTime |

See also

  • FlxDateTime


FlxDateTime.ToISO8601Local Method | FlexCel Studio for the .NET Framework documentation

FlxDateTime.ToISO8601Local Method

Returns a date formatted as ISO8601 from an OLE Automation Date. It won't convert to UTC time, but use local times instead.

Syntax

Namespace: FlexCel.Core

public static String ToISO8601Local(Double OADate, Boolean Dates1904)

Parameters

<-> | Parameter | Type | Description
 | OADate | Double | Serial number for the date.
 | Dates1904 | Boolean | True if using 1904 as start date. Excel for windows normally uses 1900.

See also

  • FlxDateTime


FlxMessages Class | FlexCel Studio for the .NET Framework documentation

FlxMessages Class

FlexCel Native string Constants. It reads the resources from the active locale, and returns the correct string. If your language is not supported and you feel like translating the messages, please send us a copy. We will include it on the next FlexCel version.

To add a new language:

  1. Copy the file flxmsg.resx to your language (for example, flxmsg.es.resx to translate to Spanish)
  2. Edit the new file and change the messages.
  3. Add the .resx file to the FlexCel project

Syntax

Namespace: FlexCel.Core

public static class FlxMessages

Methods

Name | Description
GetString | Overloaded GetString(FlxMessage) GetString(CondFmtError) GetString(FlxErr, Object[])
ThrowException | Overloaded ThrowException(CondFmtError) ThrowException(FlxErr, Object[]) ThrowException(Exception, FlxErr, Object[])


FlxMessages.GetString Method | FlexCel Studio for the .NET Framework documentation

FlxMessages.GetString Method

Overloads

  • FlxMessages.GetString(FlxMessage)
  • FlxMessages.GetString(CondFmtError)
  • FlxMessages.GetString(FlxErr, Object[])

FlxMessages.GetString(FlxMessage)

Returns a string from the FlxMessage enumeration.

Syntax

Namespace: FlexCel.Core

public static String GetString(FlxMessage ResName)

Parameters

<-> | Parameter | Type | Description
 | ResName | FlxMessage | Message code.

Returns

Associated string.

See also

  • FlxMessages

FlxMessages.GetString(CondFmtError)

Returns a string from the CondFmtError enumeration.

Syntax

Namespace: FlexCel.Core

public static String GetString(CondFmtError ResName)

Parameters

<-> | Parameter | Type | Description
 | ResName | CondFmtError | Message code.

Returns

Associated string.

See also

  • FlxMessages

FlxMessages.GetString(FlxErr, Object[])

Returns a string based on the FlxErr enumerator, formatted with args. This method is used to get an Exception error message.

Syntax

Namespace: FlexCel.Core

public static String GetString(FlxErr ResName, params Object[] args)

Parameters

<-> | Parameter | Type | Description
 | ResName | FlxErr | Error Code.
params | args | Object[] | Parameters for this error.

See also

  • FlxMessages


FlxMessages.ThrowException Method | FlexCel Studio for the .NET Framework documentation

FlxMessages.ThrowException Method

Overloads

  • FlxMessages.ThrowException(CondFmtError)
  • FlxMessages.ThrowException(FlxErr, Object[])
  • FlxMessages.ThrowException(Exception, FlxErr, Object[])

FlxMessages.ThrowException(CondFmtError)

Throws an Exception for a conditional format error.

Syntax

Namespace: FlexCel.Core

public static void ThrowException(CondFmtError err)

Parameters

<-> | Parameter | Type | Description
 | err | CondFmtError |

See also

  • FlxMessages

FlxMessages.ThrowException(FlxErr, Object[])

Throws a standard FlexCelException.

Syntax

Namespace: FlexCel.Core

public static void ThrowException(FlxErr ResName, params Object[] args)

Parameters

<-> | Parameter | Type | Description
 | ResName | FlxErr | Error Code.
params | args | Object[] | Parameters for this error.

See also

  • FlxMessages

FlxMessages.ThrowException(Exception, FlxErr, Object[])

Throws a standard FlexCelException with innerException.

Syntax

Namespace: FlexCel.Core

public static void ThrowException(Exception e, FlxErr ResName, params Object[] args)

Parameters

<-> | Parameter | Type | Description
 | e | Exception | Inner exception.
 | ResName | FlxErr | Error Code.
params | args | Object[] | Parameters for this error.

See also

  • FlxMessages


FontCreatedEventArgs Class | FlexCel Studio for the .NET Framework documentation

FontCreatedEventArgs Class

Arguments passed in FontCreated events.

Syntax

Namespace: FlexCel.Core

public class FontCreatedEventArgs: FontCreationEventArgs

Constructors

Name | Description
FontCreatedEventArgs | Creates a new instance of the event arguments with the specified parameters.

Properties

Name | Description
SubstitutedFontName | Name of the final font as decided by the operating system. Note that some operating systems might return the same name as the original font even if they used a substitute font under the hood. In those platforms we can't know a font has been substituted.
OriginalFontName | Name of the font we were trying to create. This property is readonly, to change it change FontCreation​Event​Args.​Font​Name instead.
IsModified | Returns true if any properties of the class were modified since the class was created.


FontCreatedEventArgs.FontCreatedEventArgs Constructor | FlexCel Studio for the .NET Framework documentation

FontCreatedEventArgs.FontCreatedEventArgs Constructor

Creates a new instance of the event arguments with the specified parameters.

Syntax

Namespace: FlexCel.Core

public FontCreatedEventArgs(String aSubstitutedFontName, String aOriginalFontName, Double aFontSize, TUIFontStyle aFontStyle)

Parameters

<-> | Parameter | Type | Description
 | aSubstitutedFontName | String | Name of the final font as decided by the operating system. Note that some operating systems might return the same name as the original font even if they used a substitute font under the hood. In those platforms we can't know a font has been substituted.
 | aOriginalFontName | String | Name of the font we were trying to create. It might not be the same as the font the operating system gave to us.
 | aFontSize | Double | Size in points of the font.
 | aFontStyle | TUIFontStyle | Style of the font.

See also

  • FontCreatedEventArgs


FontCreatedEventArgs.SubstitutedFontName Property | FlexCel Studio for the .NET Framework documentation

FontCreatedEventArgs.SubstitutedFontName Property

Name of the final font as decided by the operating system. Note that some operating systems might return the same name as the original font even if they used a substitute font under the hood. In those platforms we can't know a font has been substituted.

Syntax

Namespace: FlexCel.Core

public String SubstitutedFontName { get; }

See also

  • FontCreatedEventArgs


FontCreatedEventArgs.OriginalFontName Property | FlexCel Studio for the .NET Framework documentation

FontCreatedEventArgs.OriginalFontName Property

Name of the font we were trying to create. This property is readonly, to change it change FontCreationEventArgs.FontName instead.

Syntax

Namespace: FlexCel.Core

public String OriginalFontName { get; }

See also

  • FontCreatedEventArgs


FontCreatedEventArgs.IsModified Property | FlexCel Studio for the .NET Framework documentation

FontCreatedEventArgs.IsModified Property

Returns true if any properties of the class were modified since the class was created.

Syntax

Namespace: FlexCel.Core

public Boolean IsModified { get; }

See also

  • FontCreatedEventArgs


FontCreatingEventArgs Class | FlexCel Studio for the .NET Framework documentation

FontCreatingEventArgs Class

Arguments passed in FontCreating events.

Syntax

Namespace: FlexCel.Core

public class FontCreatingEventArgs: FontCreationEventArgs

Constructors

Name | Description
FontCreating​Event​Args | Creates a new instance of the event arguments with the specified parameters.


FontCreatingEventArgs.FontCreatingEventArgs Constructor | FlexCel Studio for the .NET Framework documentation

FontCreatingEventArgs.FontCreatingEventArgs Constructor

Creates a new instance of the event arguments with the specified parameters.

Syntax

Namespace: FlexCel.Core

public FontCreatingEventArgs(String aFontName, Double aFontSize, TUIFontStyle aFontStyle)

Parameters

<-> | Parameter | Type | Description
 | aFontName | String | Name of the font.
 | aFontSize | Double | Size in points of the font.
 | aFontStyle | TUIFontStyle | Style of the font.

See also

  • FontCreatingEventArgs


FontCreationEventArgs Class | FlexCel Studio for the .NET Framework documentation

FontCreationEventArgs Class

Base class for font creation events.

Syntax

Namespace: FlexCel.Core

public abstract class FontCreationEventArgs

Constructors

Name | Description
FontCreation​Event​Args | Creates a new instance of the event arguments with the specified parameters.

Properties

Name | Description
FontName | Name of the font. Change this value to create a font with a different name.
FontSize | Size in points of the font. Change this value to create a font with a different size.
FontStyle | Style of the font (italics, bold, etc.). Change this value to create a font with a different style.


FontCreationEventArgs.FontCreationEventArgs Constructor | FlexCel Studio for the .NET Framework documentation

FontCreationEventArgs.FontCreationEventArgs Constructor

Creates a new instance of the event arguments with the specified parameters.

Syntax

Namespace: FlexCel.Core

protected FontCreationEventArgs(String aFontName, Double aFontSize, TUIFontStyle aFontStyle)

Parameters

<-> | Parameter | Type | Description
 | aFontName | String | Name of the font.
 | aFontSize | Double | Size in points of the font.
 | aFontStyle | TUIFontStyle | Style of the font.

See also

  • FontCreationEventArgs


FontCreationEventArgs.FontName Property | FlexCel Studio for the .NET Framework documentation

FontCreationEventArgs.FontName Property

Name of the font. Change this value to create a font with a different name.

Syntax

Namespace: FlexCel.Core

public String FontName { get; set; }

See also

  • FontCreationEventArgs


FontCreationEventArgs.FontSize Property | FlexCel Studio for the .NET Framework documentation

FontCreationEventArgs.FontSize Property

Size in points of the font. Change this value to create a font with a different size.

Syntax

Namespace: FlexCel.Core

public Double FontSize { get; set; }

See also

  • FontCreationEventArgs


FontCreationEventArgs.FontStyle Property | FlexCel Studio for the .NET Framework documentation

FontCreationEventArgs.FontStyle Property

Style of the font (italics, bold, etc.). Change this value to create a font with a different style.

Syntax

Namespace: FlexCel.Core

public TUIFontStyle FontStyle { get; set; }

See also

  • FontCreationEventArgs


HtmlFontEventArgs Class | FlexCel Studio for the .NET Framework documentation

HtmlFontEventArgs Class

Arguments passed on FlexCel.Render.FlexCelHtmlExport.OnHtmlFont.

Syntax

Namespace: FlexCel.Core

public class HtmlFontEventArgs: EventArgs

Constructors

Name | Description
HtmlFontEventArgs | Creates a new Argument.

Properties

Name | Description
Workbook | ExcelFile with the cell we are exporting.
CellFont | Font we want to process.
FontFamily | Use this property to return the new font you want for the cell, if you need to replace it. Note that you can return more than one font here, and the format for this string is the format on a font selector "font-family" in a CSS stylesheet. You could for example return the string @"Baskerville, "Heisi Mincho W3", Symbol, serif" here. Look for a complete description of the "font-family" descriptor in the CSS reference. (http:​//​www.​w3.​org/​TR/​REC-​CSS2/​))...[more]


HtmlFontEventArgs.HtmlFontEventArgs Constructor | FlexCel Studio for the .NET Framework documentation

HtmlFontEventArgs.HtmlFontEventArgs Constructor

Creates a new Argument.

Syntax

Namespace: FlexCel.Core

public HtmlFontEventArgs(ExcelFile aWorkbook, TFlxFont aCellFont, String aFontFamily)

Parameters

<-> | Parameter | Type | Description
 | aWorkbook | ExcelFile | See Workbook
 | aCellFont | TFlxFont | See CellFont
 | aFontFamily | String | See FontFamily

See also

  • HtmlFontEventArgs


HtmlFontEventArgs.Workbook Property | FlexCel Studio for the .NET Framework documentation

HtmlFontEventArgs.Workbook Property

ExcelFile with the cell we are exporting.

Syntax

Namespace: FlexCel.Core

public ExcelFile Workbook { get; }

See also

  • HtmlFontEventArgs


HtmlFontEventArgs.CellFont Property | FlexCel Studio for the .NET Framework documentation

HtmlFontEventArgs.CellFont Property

Font we want to process.

Syntax

Namespace: FlexCel.Core

public TFlxFont CellFont { get; }

See also

  • HtmlFontEventArgs


HtmlFontEventArgs.FontFamily Property | FlexCel Studio for the .NET Framework documentation

HtmlFontEventArgs.FontFamily Property

Use this property to return the new font you want for the cell, if you need to replace it. Note that you can return more than one font here, and the format for this string is the format on a font selector "font-family" in a CSS stylesheet. You could for example return the string @"Baskerville, "Heisi Mincho W3", Symbol, serif" here. Look for a complete description of the "font-family" descriptor in the CSS reference. (http://www.w3.org/TR/REC-CSS2/))

Syntax

Namespace: FlexCel.Core

public String FontFamily { get; set; }

See also

  • HtmlFontEventArgs


ImageUtils Class | FlexCel Studio for the .NET Framework documentation

ImageUtils Class

Utilities for manipulating images.

Syntax

Namespace: FlexCel.Core

public static class ImageUtils

Methods

Name | Description
StripOLEHeader | Access stores images encapsulated on an OLE container. This function will load an OLE image and try to return the raw image data.
GetImageType | Overloaded GetImageType(Byte[]) GetImageType(Stream) GetImageType(Byte[], Int32)
GetJPEGOrientation | This function returns the orientation specific to a JPEG file. FlexCel will automatically rotate the images you add with AddImage (same as Excel does), but it will not rotate the images you enter in the headers/footers or if you replace an existing image. In those cases, you can use this method to know if the image needs to be rotated before entering it.


ImageUtils.StripOLEHeader Method | FlexCel Studio for the .NET Framework documentation

ImageUtils.StripOLEHeader Method

Access stores images encapsulated on an OLE container. This function will load an OLE image and try to return the raw image data.

Remarks

See Ms kb Q175261

Syntax

Namespace: FlexCel.Core

public static Byte[] StripOLEHeader(Byte[] data)

Parameters

<-> | Parameter | Type | Description
 | data | Byte[] | Image in OLE format.

Returns

Image on raw format.

See also

  • ImageUtils


ImageUtils.GetImageType Method | FlexCel Studio for the .NET Framework documentation

ImageUtils.GetImageType Method

Overloads

  • ImageUtils.GetImageType(Byte[])
  • ImageUtils.GetImageType(Stream)
  • ImageUtils.GetImageType(Byte[], Int32)

ImageUtils.GetImageType(Byte[])

Returns the image type for a byte array.

Syntax

Namespace: FlexCel.Core

public static TXlsImgType GetImageType(Byte[] data)

Parameters

<-> | Parameter | Type | Description
 | data | Byte[] | Array with the image.

Returns

Image type

See also

  • ImageUtils

ImageUtils.GetImageType(Stream)

Returns the image type for a stream.

Syntax

Namespace: FlexCel.Core

public static TXlsImgType GetImageType(Stream st)

Parameters

<-> | Parameter | Type | Description
 | st | Stream | A stream.

Returns

The image type.

See also

  • ImageUtils

ImageUtils.GetImageType(Byte[], Int32)

Returns the image type for a byte array.

Syntax

Namespace: FlexCel.Core

public static TXlsImgType GetImageType(Byte[] data, Int32 position)

Parameters

<-> | Parameter | Type | Description
 | data | Byte[] | Array with the image.
 | position | Int32 | Position on data where the image begins.

Returns

Image type

See also

  • ImageUtils


ImageUtils.GetJPEGOrientation Method | FlexCel Studio for the .NET Framework documentation

ImageUtils.GetJPEGOrientation Method

This function returns the orientation specific to a JPEG file. FlexCel will automatically rotate the images you add with AddImage (same as Excel does), but it will not rotate the images you enter in the headers/footers or if you replace an existing image. In those cases, you can use this method to know if the image needs to be rotated before entering it.

Syntax

Namespace: FlexCel.Core

public static TJpegOrientation GetJPEGOrientation(Byte[] data)

Parameters

<-> | Parameter | Type | Description
 | data | Byte[] | Image data.

Returns

Orientation of the JPEG file.

See also

  • ImageUtils


LoadLinkedFileEventArgs Class | FlexCel Studio for the .NET Framework documentation

LoadLinkedFileEventArgs Class

Arguments passed on TWorkspace.LoadLinkedFile

Syntax

Namespace: FlexCel.Core

public class LoadLinkedFileEventArgs: EventArgs

Constructors

Name | Description
LoadLinkedFile​Event​Args | Creates a new Argument.

Properties

Name | Description
FileName | The filename of the file we need. Note: The path of this filename is relative to where the parent file is. you might need to add the main path to it in order to load the files.
Xls | Use this parameter to return the ExcelFile that corresponds with FileName. If you return null here, it means that the file was not found and it will result in #REF errors in the formulas that reference that file.


LoadLinkedFileEventArgs.LoadLinkedFileEventArgs Constructor | FlexCel Studio for the .NET Framework documentation

LoadLinkedFileEventArgs.LoadLinkedFileEventArgs Constructor

Creates a new Argument.

Syntax

Namespace: FlexCel.Core

public LoadLinkedFileEventArgs(String aFileName)

Parameters

<-> | Parameter | Type | Description
 | aFileName | String |

See also

  • LoadLinkedFileEventArgs


LoadLinkedFileEventArgs.FileName Property | FlexCel Studio for the .NET Framework documentation

LoadLinkedFileEventArgs.FileName Property

The filename of the file we need. Note: The path of this filename is relative to where the parent file is. you might need to add the main path to it in order to load the files.

Syntax

Namespace: FlexCel.Core

public String FileName { get; }

See also

  • LoadLinkedFileEventArgs


LoadLinkedFileEventArgs.Xls Property | FlexCel Studio for the .NET Framework documentation

LoadLinkedFileEventArgs.Xls Property

Use this parameter to return the ExcelFile that corresponds with FileName. If you return null here, it means that the file was not found and it will result in #REF errors in the formulas that reference that file.

Syntax

Namespace: FlexCel.Core

public ExcelFile Xls { get; set; }

See also

  • LoadLinkedFileEventArgs


OnPasswordEventArgs Class | FlexCel Studio for the .NET Framework documentation

OnPasswordEventArgs Class

Use this class to supply a password to open an encrypted file.

Syntax

Namespace: FlexCel.Core

public class OnPasswordEventArgs: EventArgs

Constructors

Name | Description
OnPasswordEventArgs | Creates a new Argument.

Properties

Name | Description
Password | The password needed to open the file.
Xls | Excel file we are trying to open.


OnPasswordEventArgs.OnPasswordEventArgs Constructor | FlexCel Studio for the .NET Framework documentation

OnPasswordEventArgs.OnPasswordEventArgs Constructor

Creates a new Argument.

Syntax

Namespace: FlexCel.Core

public OnPasswordEventArgs(ExcelFile aXls)

Parameters

<-> | Parameter | Type | Description
 | aXls | ExcelFile |

See also

  • OnPasswordEventArgs


OnPasswordEventArgs.Password Property | FlexCel Studio for the .NET Framework documentation

OnPasswordEventArgs.Password Property

The password needed to open the file.

Syntax

Namespace: FlexCel.Core

public String Password { get; set; }

See also

  • OnPasswordEventArgs


OnPasswordEventArgs.Xls Property | FlexCel Studio for the .NET Framework documentation

OnPasswordEventArgs.Xls Property

Excel file we are trying to open.

Syntax

Namespace: FlexCel.Core

public ExcelFile Xls { get; }

See also

  • OnPasswordEventArgs


OnSheetNameEventArgs Class | FlexCel Studio for the .NET Framework documentation

OnSheetNameEventArgs Class

Arguments passed on a OnSheetName event.

Syntax

Namespace: FlexCel.Core

public class OnSheetNameEventArgs: EventArgs

Constructors

Name | Description
OnSheetNameEventArgs | Creates a new Argument.

Properties

Name | Description
Workbook | ExcelFile we are exporting.
ActiveSheet | Sheet we are exporting.
SheetName | Use this property to return the new name that you want to use when creating a filename instead of the real sheet name.


OnSheetNameEventArgs.OnSheetNameEventArgs Constructor | FlexCel Studio for the .NET Framework documentation

OnSheetNameEventArgs.OnSheetNameEventArgs Constructor

Creates a new Argument.

Syntax

Namespace: FlexCel.Core

public OnSheetNameEventArgs(ExcelFile aWorkbook, Int32 aActiveSheet, String aSheetName)

Parameters

<-> | Parameter | Type | Description
 | aWorkbook | ExcelFile | See Workbook
 | aActiveSheet | Int32 | See ActiveSheet
 | aSheetName | String | See SheetName

See also

  • OnSheetNameEventArgs


OnSheetNameEventArgs.Workbook Property | FlexCel Studio for the .NET Framework documentation

OnSheetNameEventArgs.Workbook Property

ExcelFile we are exporting.

Syntax

Namespace: FlexCel.Core

public ExcelFile Workbook { get; }

See also

  • OnSheetNameEventArgs


OnSheetNameEventArgs.ActiveSheet Property | FlexCel Studio for the .NET Framework documentation

OnSheetNameEventArgs.ActiveSheet Property

Sheet we are exporting.

Syntax

Namespace: FlexCel.Core

public Int32 ActiveSheet { get; }

See also

  • OnSheetNameEventArgs


OnSheetNameEventArgs.SheetName Property | FlexCel Studio for the .NET Framework documentation

OnSheetNameEventArgs.SheetName Property

Use this property to return the new name that you want to use when creating a filename instead of the real sheet name.

Syntax

Namespace: FlexCel.Core

public String SheetName { get; set; }

See also

  • OnSheetNameEventArgs


TAdaptativeFormats Class | FlexCel Studio for the .NET Framework documentation

TAdaptativeFormats Class

Information about characters in a numeric format that need to be adapted when rendering. For example, if the cell A1 has value 1 and format "*_0" it will print as "______1" when the cell is wide, and as "_1" when the cell is shorter.

Syntax

Namespace: FlexCel.Core

public class TAdaptativeFormats

Methods

Name Description
ApplySeparators Returns the string with the characters at the positions in Separator changed by the characters specified in Separators.
AddSeparator Overloaded
 AddSeparator(String, Int32)
AddSeparator(String, Int32, Int32)

Properties

Name | Description
WildcardPos | Position of the last wildcard ("*") character in the format (0 based). If a wildcard is present in the format, the string has to be expanded with the character at position until it fits the width of the cell. A negative value means there is no wildcard in the format.
Separators | An array of positions and characters that must be used to pad the string. In this field you have the the "_" and "?" numeric format delimiters from Excel. The spaces at the positions in the position array should have the width of the character specified in this field. If null, there are no separators in this class.
IsEmpty | Returns true if this class has no adaptative formats.


TAdaptativeFormats.ApplySeparators Method | FlexCel Studio for the .NET Framework documentation

TAdaptativeFormats.ApplySeparators Method

Returns the string with the characters at the positions in Separator changed by the characters specified in Separators.

Syntax

Namespace: FlexCel.Core

public String ApplySeparators(String s)

Parameters

<-> | Parameter | Type | Description
 | s | String |

See also

  • TAdaptativeFormats


TAdaptativeFormats.AddSeparator Method | FlexCel Studio for the .NET Framework documentation

TAdaptativeFormats.AddSeparator Method

Overloads

  • TAdaptativeFormats.AddSeparator(String, Int32)
  • TAdaptativeFormats.AddSeparator(String, Int32, Int32)

TAdaptativeFormats.AddSeparator(String, Int32)

Adds a char separator at a given position. Separator array will be kept in order when you add a value.

Syntax

Namespace: FlexCel.Core

public void AddSeparator(String sep, Int32 sp)

Parameters

<-> | Parameter | Type | Description
 | sep | String | Character that will be used to calculate the width of the string.
 | sp | Int32 | Position in the final string. (0 based)

See also

  • TAdaptativeFormats

TAdaptativeFormats.AddSeparator(String, Int32, Int32)

Adds a separator at a given position. Separator array will be kept in order when you add a value. This routine considers utf32 characters.

Syntax

Namespace: FlexCel.Core

public void AddSeparator(String Format, Int32 fp, Int32 sp)

Parameters

<-> | Parameter | Type | Description
 | Format | String | String with the characters.
 | fp | Int32 | Position in the format string. (0 based)
 | sp | Int32 | Position in the final string. (0 based)

See also

  • TAdaptativeFormats


TAdaptativeFormats.WildcardPos Property | FlexCel Studio for the .NET Framework documentation

TAdaptativeFormats.WildcardPos Property

Position of the last wildcard ("*") character in the format (0 based). If a wildcard is present in the format, the string has to be expanded with the character at position until it fits the width of the cell. A negative value means there is no wildcard in the format.

Syntax

Namespace: FlexCel.Core

public Int32 WildcardPos { get; set; }

See also

  • TAdaptativeFormats


TAdaptativeFormats.Separators Property | FlexCel Studio for the .NET Framework documentation

TAdaptativeFormats.Separators Property

An array of positions and characters that must be used to pad the string. In this field you have the the "_" and "?" numeric format delimiters from Excel. The spaces at the positions in the position array should have the width of the character specified in this field. If null, there are no separators in this class.

Syntax

Namespace: FlexCel.Core

public TCharAndPos[] Separators { get; set; }

See also

  • TAdaptativeFormats


TAdaptativeFormats.IsEmpty Property | FlexCel Studio for the .NET Framework documentation

TAdaptativeFormats.IsEmpty Property

Returns true if this class has no adaptative formats.

Syntax

Namespace: FlexCel.Core

public Boolean IsEmpty { get; }

See also

  • TAdaptativeFormats


TAlphaModFixBlipTransform Class | FlexCel Studio for the .NET Framework documentation

TAlphaModFixBlipTransform Class

Represents a transform that changes the opacity of the image.

Syntax

Namespace: FlexCel.Core

public class TAlphaModFixBlipTransform: TBlipTransform

Constructors

Name | Description
TAlphaModFix​Blip​Transform | Creates a new transform.

Methods

Name | Description
Clone | Creates a deep copy of the object.
CompareTo | Compares two instances.
Equals | Returns true if both objects have the same contents.
GetHashCode | Returns the hashcode of the object.

Properties

Name | Description
Alpha | Opacity which will be multiplied by the image opacity to get the final opacity. 0 Means fully opaque and 1 fully transparent.


TAlphaModFixBlipTransform.TAlphaModFixBlipTransform Constructor | FlexCel Studio for the .NET Framework documentation

TAlphaModFixBlipTransform.TAlphaModFixBlipTransform Constructor

Creates a new transform.

Syntax

Namespace: FlexCel.Core

public TAlphaModFixBlipTransform(Double aAlpha)

Parameters

<-> | Parameter | Type | Description
 | aAlpha | Double | Opacity which will be multiplied by the image opacity to get the final opacity. 0 Means fully opaque and 1 fully transparent.

See also

  • TAlphaModFixBlipTransform


TAlphaModFixBlipTransform.Clone Method | FlexCel Studio for the .NET Framework documentation

TAlphaModFixBlipTransform.Clone Method

Creates a deep copy of the object.

Syntax

Namespace: FlexCel.Core

public override TBlipTransform Clone()

See also

  • TAlphaModFixBlipTransform


TAlphaModFixBlipTransform.CompareTo Method | FlexCel Studio for the .NET Framework documentation

TAlphaModFixBlipTransform.CompareTo Method

Compares two instances.

Syntax

Namespace: FlexCel.Core

public override Int32 CompareTo(TBlipTransform blipTransform)

Parameters

<-> | Parameter | Type | Description
 | blipTransform | TBlipTransform |

See also

  • TAlphaModFixBlipTransform


TAlphaModFixBlipTransform.Equals Method | FlexCel Studio for the .NET Framework documentation

TAlphaModFixBlipTransform.Equals Method

Returns true if both objects have the same contents.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TAlphaModFixBlipTransform


TAlphaModFixBlipTransform.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TAlphaModFixBlipTransform.GetHashCode Method

Returns the hashcode of the object.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TAlphaModFixBlipTransform


TAlphaModFixBlipTransform.Alpha Property | FlexCel Studio for the .NET Framework documentation

TAlphaModFixBlipTransform.Alpha Property

Opacity which will be multiplied by the image opacity to get the final opacity. 0 Means fully opaque and 1 fully transparent.

Syntax

Namespace: FlexCel.Core

public Double Alpha { get; }

See also

  • TAlphaModFixBlipTransform


TAreaChartOptions Class | FlexCel Studio for the .NET Framework documentation

TAreaChartOptions Class

Options specific for an Area chart.

Syntax

Namespace: FlexCel.Core

public class TAreaChartOptions: TAreaLineChartOptions

Constructors

Name Description
TAreaChartOptions Overloaded
 TAreaChartOptions(Boolean, TStackedMode, TChartDropBars)
TAreaChartOptions(Int32, Boolean, Int32, TStackedMode, Boolean, ChartSeriesOptions, TChartDropBars, TDataLabel)


TAreaChartOptions.TAreaChartOptions Constructor | FlexCel Studio for the .NET Framework documentation

TAreaChartOptions.TAreaChartOptions Constructor

Overloads

  • TAreaChartOptions.TAreaChartOptions(Boolean, TStackedMode, TChartDropBars)
  • TAreaChartOptions.TAreaChartOptions(Int32, Boolean, Int32, TStackedMode, Boolean, ChartSeriesOptions, TChartDropBars, TDataLabel)

TAreaChartOptions.TAreaChartOptions(Boolean, TStackedMode, TChartDropBars)

Creates a new TAreaChartOptions instance simplified with the data used in an xlsx chart.

Syntax

Namespace: FlexCel.Core

public TAreaChartOptions(Boolean aChangeColorsOnEachSeries, TStackedMode aStackedMode, TChartDropBars aDropBars)

Parameters

<-> | Parameter | Type | Description
 | aChangeColorsOnEachSeries | Boolean | If false, all series will be the same color.
 | aStackedMode | TStackedMode | TStackedMode of the chart.
 | aDropBars | TChartDropBars | Drop bars and lines information. This value will be copied.

See also

  • TAreaChartOptions

TAreaChartOptions.TAreaChartOptions(Int32, Boolean, Int32, TStackedMode, Boolean, ChartSeriesOptions, TChartDropBars, TDataLabel)

Creates a new TAreaChartOptions instance.

Syntax

Namespace: FlexCel.Core

public TAreaChartOptions(Int32 aAxisNumber, Boolean aChangeColorsOnEachSeries, Int32 aZOrder, TStackedMode aStackedMode, Boolean aHasShadow, ChartSeriesOptions aSeriesOptions, TChartDropBars aDropBars, TDataLabel aDefaultLabel)

Parameters

<-> | Parameter | Type | Description
 | aAxisNumber | Int32 | Axis where this chart group belongs, 0 is primary, 1 is secondary.
 | aChangeColorsOnEachSeries | Boolean | If false, all series will be the same color.
 | aZOrder | Int32 | Z-Order of this chart group, with 0 being the bottom. Chart groups with lower z-Order are drawn below the ones with higher ones.
 | aStackedMode | TStackedMode | TStackedMode of the chart.
 | aHasShadow | Boolean | True if the chart lines have shadows.
 | aSeriesOptions | ChartSeriesOptions | Global options that apply to all the series on this group. This instance will be copied.
 | aDropBars | TChartDropBars | Drop bars and lines information. This value will be copied.
 | aDefaultLabel | TDataLabel | Default label properties for labels in this group.

See also

  • TAreaChartOptions


TAreaLineChartOptions Class | FlexCel Studio for the .NET Framework documentation

TAreaLineChartOptions Class

Options specific for a Line or Area chart.

Syntax

Namespace: FlexCel.Core

public abstract class TAreaLineChartOptions: TChartOptions, IStackedOptions

Constructors

Name | Description
TAreaLineChart​Options | Creates a new TAreaLineChart​Options instance.

Methods

Name | Description
IsStacked | Returns true is the chart is stacked, either normally or 100% stacked.

Properties

Name | Description
StackedMode | TStackedMode of the chart.
HasShadow | True if the chart lines have shadows. This property doesn't apply for xlsx charts.
DropBars | If the chart group has drop lines, the line information. Null otherwise.


TAreaLineChartOptions.TAreaLineChartOptions Constructor | FlexCel Studio for the .NET Framework documentation

TAreaLineChartOptions.TAreaLineChartOptions Constructor

Creates a new TAreaLineChartOptions instance.

Syntax

Namespace: FlexCel.Core

protected TAreaLineChartOptions(TChartType aChartType, Int32 aAxisNumber, Boolean aChangeColorsOnEachSeries, Int32 aZOrder, TStackedMode aStackedMode, Boolean aHasShadow, ChartSeriesOptions aSeriesOptions, TChartDropBars aDropBars, TDataLabel aDefaultLabel)

Parameters

<-> | Parameter | Type | Description
 | aChartType | TChartType | Type of chart. Must be Area or line.
 | aAxisNumber | Int32 | Axis where this chart group belongs, 0 is primary, 1 is secondary.
 | aChangeColorsOnEachSeries | Boolean | If false, all series will be the same color.
 | aZOrder | Int32 | Z-Order of this chart group, with 0 being the bottom. Chart groups with lower z-Order are drawn below the ones with higher ones.
 | aStackedMode | TStackedMode | TStackedMode of the chart.
 | aHasShadow | Boolean | True if the chart lines have shadows.
 | aSeriesOptions | ChartSeriesOptions | Global options that apply to all the series on this group. This instance will be copied.
 | aDropBars | TChartDropBars | Drop Bars, lines and Hi/lo information. This value will be copied.
 | aDefaultLabel | TDataLabel | Default label properties for labels in this group.

See also

  • TAreaLineChartOptions


TAreaLineChartOptions.IsStacked Method | FlexCel Studio for the .NET Framework documentation

TAreaLineChartOptions.IsStacked Method

Returns true is the chart is stacked, either normally or 100% stacked.

Syntax

Namespace: FlexCel.Core

public override Boolean IsStacked()

See also

  • TAreaLineChartOptions


TAreaLineChartOptions.StackedMode Property | FlexCel Studio for the .NET Framework documentation

TAreaLineChartOptions.StackedMode Property

TStackedMode of the chart.

Syntax

Namespace: FlexCel.Core

public TStackedMode StackedMode { get; set; }

See also

  • TAreaLineChartOptions


TAreaLineChartOptions.HasShadow Property | FlexCel Studio for the .NET Framework documentation

TAreaLineChartOptions.HasShadow Property

True if the chart lines have shadows. This property doesn't apply for xlsx charts.

Syntax

Namespace: FlexCel.Core

public Boolean HasShadow { get; set; }

See also

  • TAreaLineChartOptions


TAreaLineChartOptions.DropBars Property | FlexCel Studio for the .NET Framework documentation

TAreaLineChartOptions.DropBars Property

If the chart group has drop lines, the line information. Null otherwise.

Syntax

Namespace: FlexCel.Core

public TChartDropBars DropBars { get; set; }

See also

  • TAreaLineChartOptions


TAxisLineOptions Class | FlexCel Studio for the .NET Framework documentation

TAxisLineOptions Class

Line options for an Axis.

Syntax

Namespace: FlexCel.Core

public class TAxisLineOptions: ICloneable

Methods

Name | Description
Clone | Returns a deep copy of this object.

Properties

Name | Description
MainAxis | Line options for the main axis line.
MajorGridLines | Line options for the major gridlines along the axis.
MinorGridLines | Line options for the minor gridlines along the axis.
DoNotDrawLabels​IfNot​Drawing​Axis | If true and the line format is none, the axis labels will not be drawn.


TAxisLineOptions.Clone Method | FlexCel Studio for the .NET Framework documentation

TAxisLineOptions.Clone Method

Returns a deep copy of this object.

Syntax

Namespace: FlexCel.Core

public Object Clone()

See also

  • TAxisLineOptions


TAxisLineOptions.MainAxis Property | FlexCel Studio for the .NET Framework documentation

TAxisLineOptions.MainAxis Property

Line options for the main axis line.

Syntax

Namespace: FlexCel.Core

public ChartLineOptions MainAxis { get; set; }

See also

  • TAxisLineOptions


TAxisLineOptions.MajorGridLines Property | FlexCel Studio for the .NET Framework documentation

TAxisLineOptions.MajorGridLines Property

Line options for the major gridlines along the axis.

Syntax

Namespace: FlexCel.Core

public ChartLineOptions MajorGridLines { get; set; }

See also

  • TAxisLineOptions


TAxisLineOptions.MinorGridLines Property | FlexCel Studio for the .NET Framework documentation

TAxisLineOptions.MinorGridLines Property

Line options for the minor gridlines along the axis.

Syntax

Namespace: FlexCel.Core

public ChartLineOptions MinorGridLines { get; set; }

See also

  • TAxisLineOptions


TAxisLineOptions.DoNotDrawLabelsIfNotDrawingAxis Property | FlexCel Studio for the .NET Framework documentation

TAxisLineOptions.DoNotDrawLabelsIfNotDrawingAxis Property

If true and the line format is none, the axis labels will not be drawn.

Syntax

Namespace: FlexCel.Core

public Boolean DoNotDrawLabelsIfNotDrawingAxis { get; set; }

See also

  • TAxisLineOptions


TAxisRangeOptions Class | FlexCel Studio for the .NET Framework documentation

TAxisRangeOptions Class

Properties for the ranges of an axis.

Syntax

Namespace: FlexCel.Core

public class TAxisRangeOptions: ICloneable

Constructors

Name Description
TAxisRangeOptions Overloaded
 TAxisRangeOptions(Int32, Int32, Boolean, Boolean, Boolean)
TAxisRangeOptions(Int32, Int32, Boolean, Boolean, Boolean, Boolean)

Methods

Name | Description
Clone | Returns a deep copy of the object.

Properties

Name | Description
LabelFrequency | Frequency at what the labels on categories are displayed. 1 means display all labels, 2 display one label and skip one, and so on.
TickFrequency | Frequency at what the ticks on categories are displayed. 1 means display all ticks, 2 display one tick and skip one, and so on.
ValueAxisBetween​Categories | Specifies if the Y Axis crosses between categories or in the middle of one. Normally a Column Chart cross in the middle, and an area chart will cross between.
ValueAxisAtMaxCategory | True if the Y axis is at the left.
ReverseCategories | True if categories should be printed in reverse order.
MultiLevelLabels | If false, then category labels won't be rendered as multilevel, even if they have multiple levels of data.


TAxisRangeOptions.TAxisRangeOptions Constructor | FlexCel Studio for the .NET Framework documentation

TAxisRangeOptions.TAxisRangeOptions Constructor

Overloads

  • TAxisRangeOptions.TAxisRangeOptions(Int32, Int32, Boolean, Boolean, Boolean)
  • TAxisRangeOptions.TAxisRangeOptions(Int32, Int32, Boolean, Boolean, Boolean, Boolean)

TAxisRangeOptions.TAxisRangeOptions(Int32, Int32, Boolean, Boolean, Boolean)

Creates a new TAxisRangeOptions instance.

Syntax

Namespace: FlexCel.Core

public TAxisRangeOptions(Int32 aLabelFrequency, Int32 aTickFrequency, Boolean aValueAxisBetweenCategories, Boolean aValueAxisAtMaxCategory, Boolean aReverseCategories)

Parameters

<-> | Parameter | Type | Description
 | aLabelFrequency | Int32 | See LabelFrequency
 | aTickFrequency | Int32 | See TickFrequency
 | aValueAxisBetweenCategories | Boolean | See ValueAxisBetweenCategories
 | aValueAxisAtMaxCategory | Boolean | See ValueAxisAtMaxCategory
 | aReverseCategories | Boolean | See ReverseCategories

See also

  • TAxisRangeOptions

TAxisRangeOptions.TAxisRangeOptions(Int32, Int32, Boolean, Boolean, Boolean, Boolean)

Creates a new TAxisRangeOptions instance.

Syntax

Namespace: FlexCel.Core

public TAxisRangeOptions(Int32 aLabelFrequency, Int32 aTickFrequency, Boolean aValueAxisBetweenCategories, Boolean aValueAxisAtMaxCategory, Boolean aReverseCategories, Boolean aMultiLevelLabels)

Parameters

<-> | Parameter | Type | Description
 | aLabelFrequency | Int32 | See LabelFrequency
 | aTickFrequency | Int32 | See TickFrequency
 | aValueAxisBetweenCategories | Boolean | See ValueAxisBetweenCategories
 | aValueAxisAtMaxCategory | Boolean | See ValueAxisAtMaxCategory
 | aReverseCategories | Boolean | See ReverseCategories
 | aMultiLevelLabels | Boolean | See MultiLevelLabels

See also

  • TAxisRangeOptions


TAxisRangeOptions.Clone Method | FlexCel Studio for the .NET Framework documentation

TAxisRangeOptions.Clone Method

Returns a deep copy of the object.

Syntax

Namespace: FlexCel.Core

public Object Clone()

See also

  • TAxisRangeOptions


TAxisRangeOptions.LabelFrequency Property | FlexCel Studio for the .NET Framework documentation

TAxisRangeOptions.LabelFrequency Property

Frequency at what the labels on categories are displayed. 1 means display all labels, 2 display one label and skip one, and so on.

Syntax

Namespace: FlexCel.Core

public Int32 LabelFrequency { get; set; }

See also

  • TAxisRangeOptions


TAxisRangeOptions.TickFrequency Property | FlexCel Studio for the .NET Framework documentation

TAxisRangeOptions.TickFrequency Property

Frequency at what the ticks on categories are displayed. 1 means display all ticks, 2 display one tick and skip one, and so on.

Syntax

Namespace: FlexCel.Core

public Int32 TickFrequency { get; set; }

See also

  • TAxisRangeOptions


TAxisRangeOptions.ValueAxisBetweenCategories Property | FlexCel Studio for the .NET Framework documentation

TAxisRangeOptions.ValueAxisBetweenCategories Property

Specifies if the Y Axis crosses between categories or in the middle of one. Normally a Column Chart cross in the middle, and an area chart will cross between.

Syntax

Namespace: FlexCel.Core

public Boolean ValueAxisBetweenCategories { get; set; }

See also

  • TAxisRangeOptions


TAxisRangeOptions.ValueAxisAtMaxCategory Property | FlexCel Studio for the .NET Framework documentation

TAxisRangeOptions.ValueAxisAtMaxCategory Property

True if the Y axis is at the left.

Syntax

Namespace: FlexCel.Core

public Boolean ValueAxisAtMaxCategory { get; set; }

See also

  • TAxisRangeOptions


TAxisRangeOptions.ReverseCategories Property | FlexCel Studio for the .NET Framework documentation

TAxisRangeOptions.ReverseCategories Property

True if categories should be printed in reverse order.

Syntax

Namespace: FlexCel.Core

public Boolean ReverseCategories { get; set; }

See also

  • TAxisRangeOptions


TAxisRangeOptions.MultiLevelLabels Property | FlexCel Studio for the .NET Framework documentation

TAxisRangeOptions.MultiLevelLabels Property

If false, then category labels won't be rendered as multilevel, even if they have multiple levels of data.

Syntax

Namespace: FlexCel.Core

public Boolean MultiLevelLabels { get; set; }

See also

  • TAxisRangeOptions


TAxisTickOptions Class | FlexCel Studio for the .NET Framework documentation

TAxisTickOptions Class

Properties for the ticks and labels of an axis.

Syntax

Namespace: FlexCel.Core

public class TAxisTickOptions: ICloneable

Constructors

Name Description
TAxisTickOptions Overloaded
 TAxisTickOptions(TTickType, TTickType, TAxisLabelPosition, TBackgroundMode, TDrawingColor, Nullable<Int32>)
TAxisTickOptions(TTickType, TTickType, TAxisLabelPosition, TBackgroundMode, TShapeFill, TDrawingColor, Nullable<Int32>)

Methods

Name | Description
Clone | Returns a deep copy of this object.

Properties

Name | Description
MinorTickType | Major ticks type.
MajorTickType | Minor ticks type.
LabelPosition | Position of the label relative to the axis.
BackgroundMode | How the background of text will be rendered.
LabelFill | Background color of the text of labels in this axis.
LabelColor | Color of the text of labels in this axis.
Rotation | Text Rotation in degrees. If null, then the rotation will be calculated automatically. When this value is from 0 to 90 then this is the rotation degrees in the up direction. When this value is from 91 to 180 then this is a rotation in the down direction. 91 means -1 degree rotation, 92 means -2 degrees, and so on until 180 which means -90 degrees. 255 is vertical text. Other values are invalid.


TAxisTickOptions.TAxisTickOptions Constructor | FlexCel Studio for the .NET Framework documentation

TAxisTickOptions.TAxisTickOptions Constructor

Overloads

  • TAxisTickOptions.TAxisTickOptions(TTickType, TTickType, TAxisLabelPosition, TBackgroundMode, TDrawingColor, Nullable<Int32>)
  • TAxisTickOptions.TAxisTickOptions(TTickType, TTickType, TAxisLabelPosition, TBackgroundMode, TShapeFill, TDrawingColor, Nullable<Int32>)

TAxisTickOptions.TAxisTickOptions(TTickType, TTickType, TAxisLabelPosition, TBackgroundMode, TDrawingColor, Nullable<Int32>)

Creates a new TAxisTickOptions instance.

Syntax

Namespace: FlexCel.Core

public TAxisTickOptions(TTickType aMajorTickType, TTickType aMinorTickType, TAxisLabelPosition aLabelPosition, TBackgroundMode aBackgroundMode, TDrawingColor aLabelColor, Nullable<Int32> aRotation)

Parameters

<-> | Parameter | Type | Description
 | aMajorTickType | TTickType | See MajorTickType
 | aMinorTickType | TTickType | See MinorTickType
 | aLabelPosition | TAxisLabelPosition | See LabelPosition
 | aBackgroundMode | TBackgroundMode | See BackgroundMode
 | aLabelColor | TDrawingColor | See LabelColor
 | aRotation | Nullable<Int32> | See Rotation

See also

  • TAxisTickOptions

TAxisTickOptions.TAxisTickOptions(TTickType, TTickType, TAxisLabelPosition, TBackgroundMode, TShapeFill, TDrawingColor, Nullable<Int32>)

Creates a new TAxisTickOptions instance.

Syntax

Namespace: FlexCel.Core

public TAxisTickOptions(TTickType aMajorTickType, TTickType aMinorTickType, TAxisLabelPosition aLabelPosition, TBackgroundMode aBackgroundMode, TShapeFill aLabelFill, TDrawingColor aLabelColor, Nullable<Int32> aRotation)

Parameters

<-> | Parameter | Type | Description
 | aMajorTickType | TTickType | See MajorTickType
 | aMinorTickType | TTickType | See MinorTickType
 | aLabelPosition | TAxisLabelPosition | See LabelPosition
 | aBackgroundMode | TBackgroundMode | See BackgroundMode
 | aLabelFill | TShapeFill | See LabelFill
 | aLabelColor | TDrawingColor | See LabelColor
 | aRotation | Nullable<Int32> | See Rotation

See also

  • TAxisTickOptions


TAxisTickOptions.Clone Method | FlexCel Studio for the .NET Framework documentation

TAxisTickOptions.Clone Method

Returns a deep copy of this object.

Syntax

Namespace: FlexCel.Core

public Object Clone()

See also

  • TAxisTickOptions


TAxisTickOptions.MinorTickType Property | FlexCel Studio for the .NET Framework documentation

TAxisTickOptions.MinorTickType Property

Major ticks type.

Syntax

Namespace: FlexCel.Core

public TTickType MinorTickType { get; set; }

See also

  • TAxisTickOptions


TAxisTickOptions.MajorTickType Property | FlexCel Studio for the .NET Framework documentation

TAxisTickOptions.MajorTickType Property

Minor ticks type.

Syntax

Namespace: FlexCel.Core

public TTickType MajorTickType { get; set; }

See also

  • TAxisTickOptions


TAxisTickOptions.LabelPosition Property | FlexCel Studio for the .NET Framework documentation

TAxisTickOptions.LabelPosition Property

Position of the label relative to the axis.

Syntax

Namespace: FlexCel.Core

public TAxisLabelPosition LabelPosition { get; set; }

See also

  • TAxisTickOptions


TAxisTickOptions.BackgroundMode Property | FlexCel Studio for the .NET Framework documentation

TAxisTickOptions.BackgroundMode Property

How the background of text will be rendered.

Syntax

Namespace: FlexCel.Core

public TBackgroundMode BackgroundMode { get; set; }

See also

  • TAxisTickOptions


TAxisTickOptions.LabelFill Property | FlexCel Studio for the .NET Framework documentation

TAxisTickOptions.LabelFill Property

Background color of the text of labels in this axis.

Syntax

Namespace: FlexCel.Core

public TShapeFill LabelFill { get; set; }

See also

  • TAxisTickOptions


TAxisTickOptions.LabelColor Property | FlexCel Studio for the .NET Framework documentation

TAxisTickOptions.LabelColor Property

Color of the text of labels in this axis.

Syntax

Namespace: FlexCel.Core

public TDrawingColor LabelColor { get; set; }

See also

  • TAxisTickOptions


TAxisTickOptions.Rotation Property | FlexCel Studio for the .NET Framework documentation

TAxisTickOptions.Rotation Property

Text Rotation in degrees.

If null, then the rotation will be calculated automatically. When this value is from 0 to 90 then this is the rotation degrees in the up direction.

When this value is from 91 to 180 then this is a rotation in the down direction. 91 means -1 degree rotation, 92 means -2 degrees, and so on until 180 which means -90 degrees.

255 is vertical text.

Other values are invalid.

Syntax

Namespace: FlexCel.Core

public Nullable<Int32> Rotation { get; set; }

See also

  • TAxisTickOptions


TBarChartOptions Class | FlexCel Studio for the .NET Framework documentation

TBarChartOptions Class

Options for a Bar or Column chart.

Syntax

Namespace: FlexCel.Core

public class TBarChartOptions: TChartOptions, IStackedOptions

Constructors

Name Description
TBarChartOptions Overloaded
 TBarChartOptions(Boolean, Double, Double, Boolean, TStackedMode, ChartLineOptions)
TBarChartOptions(Int32, Boolean, Int32, Double, Double, Boolean, TStackedMode, Boolean, ChartSeriesOptions, TDataLabel, ChartLineOptions)

Methods

Name | Description
IsStacked | Returns true is the chart is stacked, either normally or 100% stacked.

Properties

Name | Description
BarOverlap | Space between bars in percent of the bar width.
CategoriesGap | Space between categories in percent of bar width.
Horizontal | If true, bars are horizontal and this is a bar chart. If false, bars are vertical and this is a column chart.
StackedMode | TStackedMode of the chart.
HasShadow | True if the bars have shadows.
SeriesLines | Line style for the Lines between Series if they exist, null otherwise.


TBarChartOptions.TBarChartOptions Constructor | FlexCel Studio for the .NET Framework documentation

TBarChartOptions.TBarChartOptions Constructor

Overloads

  • TBarChartOptions.TBarChartOptions(Boolean, Double, Double, Boolean, TStackedMode, ChartLineOptions)
  • TBarChartOptions.TBarChartOptions(Int32, Boolean, Int32, Double, Double, Boolean, TStackedMode, Boolean, ChartSeriesOptions, TDataLabel, ChartLineOptions)

TBarChartOptions.TBarChartOptions(Boolean, Double, Double, Boolean, TStackedMode, ChartLineOptions)

Creates a new TBatChartOptions instance. This overload is simplified for the values that make sense when setting the chart options.

Syntax

Namespace: FlexCel.Core

public TBarChartOptions(Boolean aChangeColorsOnEachSeries, Double aBarOverlap, Double aCategoriesOverlap, Boolean aHorizontal, TStackedMode aStackedMode, ChartLineOptions aSeriesLines)

Parameters

<-> | Parameter | Type | Description
 | aChangeColorsOnEachSeries | Boolean | If false, all series will be the same color.
 | aBarOverlap | Double | Space between bars in percent of the bar width.
 | aCategoriesOverlap | Double | Space between categories in percent of bar width.
 | aHorizontal | Boolean | If true, bars are horizontal and this is a bar chart. If false, bars are vertical and this is a column chart.
 | aStackedMode | TStackedMode | TStackedMode of the chart.
 | aSeriesLines | ChartLineOptions | See SeriesLines

See also

  • TBarChartOptions

TBarChartOptions.TBarChartOptions(Int32, Boolean, Int32, Double, Double, Boolean, TStackedMode, Boolean, ChartSeriesOptions, TDataLabel, ChartLineOptions)

Creates a new TBarChartOptions instance.

Syntax

Namespace: FlexCel.Core

public TBarChartOptions(Int32 aAxisNumber, Boolean aChangeColorsOnEachSeries, Int32 aZOrder, Double aBarOverlap, Double aCategoriesOverlap, Boolean aHorizontal, TStackedMode aStackedMode, Boolean aHasShadow, ChartSeriesOptions aSeriesOptions, TDataLabel aDefaultLabel, ChartLineOptions aSeriesLines)

Parameters

<-> | Parameter | Type | Description
 | aAxisNumber | Int32 | Axis where this chart group belongs, 0 is primary, 1 is secondary.
 | aChangeColorsOnEachSeries | Boolean | If false, all series will be the same color.
 | aZOrder | Int32 | Z-Order of this chart group, with 0 being the bottom. Chart groups with lower z-Order are drawn below the ones with higher ones.
 | aBarOverlap | Double | Space between bars in percent of the bar width.
 | aCategoriesOverlap | Double | Space between categories in percent of bar width.
 | aHorizontal | Boolean | If true, bars are horizontal and this is a bar chart. If false, bars are vertical and this is a column chart.
 | aStackedMode | TStackedMode | TStackedMode of the chart.
 | aHasShadow | Boolean | True if the bars have shadows.
 | aSeriesOptions | ChartSeriesOptions | Global options that apply to all the series on this group. This instance will be copied.
 | aDefaultLabel | TDataLabel | Default label properties for labels in this group.
 | aSeriesLines | ChartLineOptions | See SeriesLines

See also

  • TBarChartOptions


TBarChartOptions.IsStacked Method | FlexCel Studio for the .NET Framework documentation

TBarChartOptions.IsStacked Method

Returns true is the chart is stacked, either normally or 100% stacked.

Syntax

Namespace: FlexCel.Core

public override Boolean IsStacked()

See also

  • TBarChartOptions


TBarChartOptions.BarOverlap Property | FlexCel Studio for the .NET Framework documentation

TBarChartOptions.BarOverlap Property

Space between bars in percent of the bar width.

Syntax

Namespace: FlexCel.Core

public Double BarOverlap { get; set; }

See also

  • TBarChartOptions


TBarChartOptions.CategoriesGap Property | FlexCel Studio for the .NET Framework documentation

TBarChartOptions.CategoriesGap Property

Space between categories in percent of bar width.

Syntax

Namespace: FlexCel.Core

public Double CategoriesGap { get; set; }

See also

  • TBarChartOptions


TBarChartOptions.Horizontal Property | FlexCel Studio for the .NET Framework documentation

TBarChartOptions.Horizontal Property

If true, bars are horizontal and this is a bar chart. If false, bars are vertical and this is a column chart.

Syntax

Namespace: FlexCel.Core

public Boolean Horizontal { get; set; }

See also

  • TBarChartOptions


TBarChartOptions.StackedMode Property | FlexCel Studio for the .NET Framework documentation

TBarChartOptions.StackedMode Property

TStackedMode of the chart.

Syntax

Namespace: FlexCel.Core

public TStackedMode StackedMode { get; set; }

See also

  • TBarChartOptions


TBarChartOptions.HasShadow Property | FlexCel Studio for the .NET Framework documentation

TBarChartOptions.HasShadow Property

True if the bars have shadows.

Syntax

Namespace: FlexCel.Core

public Boolean HasShadow { get; set; }

See also

  • TBarChartOptions


TBarChartOptions.SeriesLines Property | FlexCel Studio for the .NET Framework documentation

TBarChartOptions.SeriesLines Property

Line style for the Lines between Series if they exist, null otherwise.

Syntax

Namespace: FlexCel.Core

public ChartLineOptions SeriesLines { get; set; }

See also

  • TBarChartOptions


TBaseAxis Class | FlexCel Studio for the .NET Framework documentation

TBaseAxis Class

Common ancestor for all Axis types.

Syntax

Namespace: FlexCel.Core

public abstract class TBaseAxis

Constructors

Name | Description
TBaseAxis | Creates a new TBaseAxis instance.

Properties

Name | Description
Deleted | If true, the axis is not a real axis and must not be drawn.
AxisPos | Position of the axis in the chart.
LogBase | If the axis is logarithmic, the base for the logarithm.
Font | Font used on this axis.
NumberFormat | Format for the numbers on this axis.
NumberFormat​Linked​ToSource | True if the format for the numbers on this axis is linked to the format in the cells in the spreadsheet.
AxisLineOptions | Linestyles for the different lines of this axis.
TickOptions | Options for the ticks and the font used on the labels.
Caption | Axis Caption.


TBaseAxis.TBaseAxis Constructor | FlexCel Studio for the .NET Framework documentation

TBaseAxis.TBaseAxis Constructor

Creates a new TBaseAxis instance.

Syntax

Namespace: FlexCel.Core

protected TBaseAxis(TFlxChartFont aFont, String aNumberFormat, Boolean aNumberFormatLinkedToSource, TAxisLineOptions aAxisLineOptions, TAxisTickOptions aTickOptions, TDataLabel aCaption, TChartAxisPos aAxisPos, Double aLogBase)

Parameters

<-> | Parameter | Type | Description
 | aFont | TFlxChartFont | See Font
 | aNumberFormat | String | See NumberFormat
 | aNumberFormatLinkedToSource | Boolean | See NumberFormatLinkedToSource
 | aAxisLineOptions | TAxisLineOptions | See AxisLineOptions
 | aTickOptions | TAxisTickOptions | See TickOptions
 | aCaption | TDataLabel | See Caption
 | aAxisPos | TChartAxisPos | See AxisPos
 | aLogBase | Double | See LogBase

See also

  • TBaseAxis


TBaseAxis.Deleted Property | FlexCel Studio for the .NET Framework documentation

TBaseAxis.Deleted Property

If true, the axis is not a real axis and must not be drawn.

Syntax

Namespace: FlexCel.Core

public Boolean Deleted { get; set; }

See also

  • TBaseAxis


TBaseAxis.AxisPos Property | FlexCel Studio for the .NET Framework documentation

TBaseAxis.AxisPos Property

Position of the axis in the chart.

Syntax

Namespace: FlexCel.Core

public TChartAxisPos AxisPos { get; set; }

See also

  • TBaseAxis


TBaseAxis.LogBase Property | FlexCel Studio for the .NET Framework documentation

TBaseAxis.LogBase Property

If the axis is logarithmic, the base for the logarithm.

Syntax

Namespace: FlexCel.Core

public Double LogBase { get; set; }

See also

  • TBaseAxis


TBaseAxis.Font Property | FlexCel Studio for the .NET Framework documentation

TBaseAxis.Font Property

Font used on this axis.

Syntax

Namespace: FlexCel.Core

public TFlxChartFont Font { get; }

See also

  • TBaseAxis


TBaseAxis.NumberFormat Property | FlexCel Studio for the .NET Framework documentation

TBaseAxis.NumberFormat Property

Format for the numbers on this axis.

Syntax

Namespace: FlexCel.Core

public String NumberFormat { get; set; }

See also

  • TBaseAxis


TBaseAxis.NumberFormatLinkedToSource Property | FlexCel Studio for the .NET Framework documentation

TBaseAxis.NumberFormatLinkedToSource Property

True if the format for the numbers on this axis is linked to the format in the cells in the spreadsheet.

Syntax

Namespace: FlexCel.Core

public Boolean NumberFormatLinkedToSource { get; set; }

See also

  • TBaseAxis


TBaseAxis.AxisLineOptions Property | FlexCel Studio for the .NET Framework documentation

TBaseAxis.AxisLineOptions Property

Linestyles for the different lines of this axis.

Syntax

Namespace: FlexCel.Core

public TAxisLineOptions AxisLineOptions { get; set; }

See also

  • TBaseAxis


TBaseAxis.TickOptions Property | FlexCel Studio for the .NET Framework documentation

TBaseAxis.TickOptions Property

Options for the ticks and the font used on the labels.

Syntax

Namespace: FlexCel.Core

public TAxisTickOptions TickOptions { get; set; }

See also

  • TBaseAxis


TBaseAxis.Caption Property | FlexCel Studio for the .NET Framework documentation

TBaseAxis.Caption Property

Axis Caption.

Syntax

Namespace: FlexCel.Core

public TDataLabel Caption { get; set; }

See also

  • TBaseAxis


TBaseImageProperties Class | FlexCel Studio for the .NET Framework documentation

TBaseImageProperties Class

Image information, for headers and footers, normal images or objects in general.

Syntax

Namespace: FlexCel.Core

public abstract class TBaseImageProperties

Fields

Name | Description
FDefaultsToLocked​Aspect​Ratio | This variable must be set by the class inheriting this one.

Methods

Name | Description
EqualValues | Returns true if both instances of the objects contain the same values. Instances might be different, this method will return if their values are equal. Instances can be null.
Clone | Returns a deep copy of the object.

Properties

Name | Description
DefaultsToLocked​Aspect​Ratio | This property returns true if the shape by default locks its aspect ratio. Images do it, comments don't. You will normally not need to use this value.
FileName | FileName of the image. It sets/gets the original filename of the image before it was inserted. (For example: c:\image.jpg) It is not necessary to set this field, and when the image is not inserted from a file but pasted, Excel does not set it either.
CropArea | Cropping coordinates for the Image.
TransparentColor | Transparent Color. FlxConsts.​NoTransparent​Color (~0L) means no transparent color.
Contrast | Contrast of the image. FlxConsts.​Default​Contrast is the default Contrast.
Brightness | Brightness of the image. FlxConsts.​Default​Brightness is the default Brightness.
Gamma | Gamma of the image. FlxConsts.​Default​Gamma is the default Gamma.
Lock | True if this image can't be selected when the sheet is protected.
Print | If false, the image won't be printed.
Published | Determines if the image should be published when sent to a server. This only applies to charts.
Disabled | If true, the object is disabled.
DefaultSize | If true, the application is expected to choose the default size of the object.
Macro | Macro attached to the image.
PreferRelativeSize | Specifies whether the original size of an object is saved after reformatting. If true, the original size of the object is stored and all resizing is based on a percentage of that original size. Otherwise, each resizing resets the scale to 100%.
LockAspectRatio | Specifies whether the aspect ratio of a shape is locked from being edited.
Grayscale | Image should be displayed in grayscale.
BiLevel | If true, the image will display in 2 color black and white.


TBaseImageProperties.FDefaultsToLockedAspectRatio Field | FlexCel Studio for the .NET Framework documentation

TBaseImageProperties.FDefaultsToLockedAspectRatio Field

This variable must be set by the class inheriting this one.

Syntax

Namespace: FlexCel.Core

protected Boolean FDefaultsToLockedAspectRatio

See also

  • TBaseImageProperties


TBaseImageProperties.EqualValues Method | FlexCel Studio for the .NET Framework documentation

TBaseImageProperties.EqualValues Method

Returns true if both instances of the objects contain the same values. Instances might be different, this method will return if their values are equal. Instances can be null.

Syntax

Namespace: FlexCel.Core

public static Boolean EqualValues(TBaseImageProperties a1, TBaseImageProperties a2)

Parameters

<-> | Parameter | Type | Description
 | a1 | TBaseImageProperties | First instance to compare.
 | a2 | TBaseImageProperties | Second instance to compare.

See also

  • TBaseImageProperties


TBaseImageProperties.Clone Method | FlexCel Studio for the .NET Framework documentation

TBaseImageProperties.Clone Method

Returns a deep copy of the object.

Syntax

Namespace: FlexCel.Core

public virtual TBaseImageProperties Clone()

See also

  • TBaseImageProperties


TBaseImageProperties.DefaultsToLockedAspectRatio Property | FlexCel Studio for the .NET Framework documentation

TBaseImageProperties.DefaultsToLockedAspectRatio Property

This property returns true if the shape by default locks its aspect ratio. Images do it, comments don't. You will normally not need to use this value.

Syntax

Namespace: FlexCel.Core

public Boolean DefaultsToLockedAspectRatio { get; }

See also

  • TBaseImageProperties


TBaseImageProperties.FileName Property | FlexCel Studio for the .NET Framework documentation

TBaseImageProperties.FileName Property

FileName of the image. It sets/gets the original filename of the image before it was inserted. (For example: c:\image.jpg) It is not necessary to set this field, and when the image is not inserted from a file but pasted, Excel does not set it either.

Syntax

Namespace: FlexCel.Core

public String FileName { get; set; }

See also

  • TBaseImageProperties


TBaseImageProperties.CropArea Property | FlexCel Studio for the .NET Framework documentation

TBaseImageProperties.CropArea Property

Cropping coordinates for the Image.

Syntax

Namespace: FlexCel.Core

public TCropArea CropArea { get; set; }

See also

  • TBaseImageProperties


TBaseImageProperties.TransparentColor Property | FlexCel Studio for the .NET Framework documentation

TBaseImageProperties.TransparentColor Property

Transparent Color. FlxConsts.NoTransparentColor (~0L) means no transparent color.

Syntax

Namespace: FlexCel.Core

public Int64 TransparentColor { get; set; }

See also

  • TBaseImageProperties


TBaseImageProperties.Contrast Property | FlexCel Studio for the .NET Framework documentation

TBaseImageProperties.Contrast Property

Contrast of the image. FlxConsts.DefaultContrast is the default Contrast.

Syntax

Namespace: FlexCel.Core

public Int32 Contrast { get; set; }

See also

  • TBaseImageProperties


TBaseImageProperties.Brightness Property | FlexCel Studio for the .NET Framework documentation

TBaseImageProperties.Brightness Property

Brightness of the image. FlxConsts.DefaultBrightness is the default Brightness.

Syntax

Namespace: FlexCel.Core

public Int32 Brightness { get; set; }

See also

  • TBaseImageProperties


TBaseImageProperties.Gamma Property | FlexCel Studio for the .NET Framework documentation

TBaseImageProperties.Gamma Property

Gamma of the image. FlxConsts.DefaultGamma is the default Gamma.

Syntax

Namespace: FlexCel.Core

public Int32 Gamma { get; set; }

See also

  • TBaseImageProperties


TBaseImageProperties.Lock Property | FlexCel Studio for the .NET Framework documentation

TBaseImageProperties.Lock Property

True if this image can't be selected when the sheet is protected.

Syntax

Namespace: FlexCel.Core

public Boolean Lock { get; set; }

See also

  • TBaseImageProperties


TBaseImageProperties.Print Property | FlexCel Studio for the .NET Framework documentation

TBaseImageProperties.Print Property

If false, the image won't be printed.

Syntax

Namespace: FlexCel.Core

public Boolean Print { get; set; }

See also

  • TBaseImageProperties


TBaseImageProperties.Published Property | FlexCel Studio for the .NET Framework documentation

TBaseImageProperties.Published Property

Determines if the image should be published when sent to a server. This only applies to charts.

Syntax

Namespace: FlexCel.Core

public Boolean Published { get; set; }

See also

  • TBaseImageProperties


TBaseImageProperties.Disabled Property | FlexCel Studio for the .NET Framework documentation

TBaseImageProperties.Disabled Property

If true, the object is disabled.

Syntax

Namespace: FlexCel.Core

public Boolean Disabled { get; set; }

See also

  • TBaseImageProperties


TBaseImageProperties.DefaultSize Property | FlexCel Studio for the .NET Framework documentation

TBaseImageProperties.DefaultSize Property

If true, the application is expected to choose the default size of the object.

Syntax

Namespace: FlexCel.Core

public Boolean DefaultSize { get; set; }

See also

  • TBaseImageProperties


TBaseImageProperties.Macro Property | FlexCel Studio for the .NET Framework documentation

TBaseImageProperties.Macro Property

Macro attached to the image.

Syntax

Namespace: FlexCel.Core

public String Macro { get; set; }

See also

  • TBaseImageProperties


TBaseImageProperties.PreferRelativeSize Property | FlexCel Studio for the .NET Framework documentation

TBaseImageProperties.PreferRelativeSize Property

Specifies whether the original size of an object is saved after reformatting. If true, the original size of the object is stored and all resizing is based on a percentage of that original size. Otherwise, each resizing resets the scale to 100%.

Syntax

Namespace: FlexCel.Core

public Boolean PreferRelativeSize { get; set; }

See also

  • TBaseImageProperties


TBaseImageProperties.LockAspectRatio Property | FlexCel Studio for the .NET Framework documentation

TBaseImageProperties.LockAspectRatio Property

Specifies whether the aspect ratio of a shape is locked from being edited.

Syntax

Namespace: FlexCel.Core

public Boolean LockAspectRatio { get; set; }

See also

  • TBaseImageProperties


TBaseImageProperties.Grayscale Property | FlexCel Studio for the .NET Framework documentation

TBaseImageProperties.Grayscale Property

Image should be displayed in grayscale.

Syntax

Namespace: FlexCel.Core

public Boolean Grayscale { get; set; }

See also

  • TBaseImageProperties


TBaseImageProperties.BiLevel Property | FlexCel Studio for the .NET Framework documentation

TBaseImageProperties.BiLevel Property

If true, the image will display in 2 color black and white.

Syntax

Namespace: FlexCel.Core

public Boolean BiLevel { get; set; }

See also

  • TBaseImageProperties


TBlip Class | FlexCel Studio for the .NET Framework documentation

TBlip Class

Picture and properties used in a Blip fill.

Syntax

Namespace: FlexCel.Core

public class TBlip: IComparable

Constructors

Name | Description
TBlip | Creates a new Blip.

Methods

Name | Description
Equals | Returns true if this instance has the same data as the object obj.
CompareTo | Returns -1 if obj is bigger than this, 0 if both objects are the same, and 1 if obj is smaller than this.
GetHashCode | Returns the hashcode for this object

Properties

Name | Description
CompressionState | Specifies the compression state with which the picture is stored. This allows the application to specify the amount of compression that has been applied to a picture.
PictureData | Image data.
ImageFileName | File name which will be used when saving the file inside the xlsx container.
ContentType | Content type for the image, like "image/jpeg".
SVGBlip | If the blip contains an SVG image, then the actual data of the SVG image is here. In this case, PictureData contains a PNG render of the SVG image.


TBlip.TBlip Constructor | FlexCel Studio for the .NET Framework documentation

TBlip.TBlip Constructor

Creates a new Blip.

Syntax

Namespace: FlexCel.Core

public TBlip(TBlipCompression aCompressionState, Byte[] aPictureData, String aImageFileName, String aContentType)

Parameters

<-> | Parameter | Type | Description
 | aCompressionState | TBlipCompression | Compression state.
 | aPictureData | Byte[] | Picture Data. This data will be copied in this object, so after using it, you can modify the original and this won't change.
 | aImageFileName | String | File name which will be used when saving the file inside the xlsx container.
 | aContentType | String | Content type for the image, like "image/jpeg". You can use StandardMimeType to get a list of common mime types.

See also

  • TBlip


TBlip.Equals Method | FlexCel Studio for the .NET Framework documentation

TBlip.Equals Method

Returns true if this instance has the same data as the object obj.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TBlip


TBlip.CompareTo Method | FlexCel Studio for the .NET Framework documentation

TBlip.CompareTo Method

Returns -1 if obj is bigger than this, 0 if both objects are the same, and 1 if obj is smaller than this.

Syntax

Namespace: FlexCel.Core

public Int32 CompareTo(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TBlip


TBlip.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TBlip.GetHashCode Method

Returns the hashcode for this object

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TBlip


TBlip.CompressionState Property | FlexCel Studio for the .NET Framework documentation

TBlip.CompressionState Property

Specifies the compression state with which the picture is stored. This allows the application to specify the amount of compression that has been applied to a picture.

Syntax

Namespace: FlexCel.Core

public TBlipCompression CompressionState { get; }

See also

  • TBlip


TBlip.PictureData Property | FlexCel Studio for the .NET Framework documentation

TBlip.PictureData Property

Image data.

Syntax

Namespace: FlexCel.Core

public Byte[] PictureData { get; }

See also

  • TBlip


TBlip.ImageFileName Property | FlexCel Studio for the .NET Framework documentation

TBlip.ImageFileName Property

File name which will be used when saving the file inside the xlsx container.

Syntax

Namespace: FlexCel.Core

public String ImageFileName { get; }

See also

  • TBlip


TBlip.ContentType Property | FlexCel Studio for the .NET Framework documentation

TBlip.ContentType Property

Content type for the image, like "image/jpeg".

Syntax

Namespace: FlexCel.Core

public String ContentType { get; }

See also

  • TBlip


TBlip.SVGBlip Property | FlexCel Studio for the .NET Framework documentation

TBlip.SVGBlip Property

If the blip contains an SVG image, then the actual data of the SVG image is here. In this case, PictureData contains a PNG render of the SVG image.

Syntax

Namespace: FlexCel.Core

public TSVGBlip SVGBlip { get; }

See also

  • TBlip


TBlipFill Class | FlexCel Studio for the .NET Framework documentation

TBlipFill Class

Shapes are filled with an image.

Syntax

Namespace: FlexCel.Core

public class TBlipFill: TFillStyle

Constructors

Name | Description
TBlipFill | Creates a new Image fill.

Methods

Name | Description
Equals | Returns true if this instance has the same data as the object obj.
CompareTo | Returns -1 if obj is bigger than this, 0 if both objects are the same, and 1 if obj is smaller than this.
GetHashCode | Returns the hashcode for this object

Properties

Name | Description
Dpi | Specifies the DPI (dots per inch) used to calculate the size of the blip. If not present or zero, the DPI in the blip is used.
RotateWithShape | Specifies that the fill should rotate with the shape.
Blip | Picture and properties used in the Blip fill.
SourceRect | This element specifies the portion of the blip used for the fill. Each edge of the source rectangle is defined by a percentage offset from the corresponding edge of the bounding box. A positive percentage specifies an inset, while a negative percentage specifies an outset. For example, a left offset of 25% specifies that the left edge of the source rectangle is located to the right of the bounding box's left edge by an amount equal to 25% of the bounding box's width.
FillMode | Specifies how the blip will be applied to the fill, either by stretching it to cover all the surface, of by tiling it.


TBlipFill.TBlipFill Constructor | FlexCel Studio for the .NET Framework documentation

TBlipFill.TBlipFill Constructor

Creates a new Image fill.

Syntax

Namespace: FlexCel.Core

public TBlipFill(Int32 aDpi, Boolean aRotateWithShape, TBlip aBlip, Nullable<TDrawingRelativeRect> aSourceRect, TBlipFillMode aFillMode)

Parameters

<-> | Parameter | Type | Description
 | aDpi | Int32 |
 | aRotateWithShape | Boolean |
 | aBlip | TBlip |
 | aSourceRect | Nullable<TDrawingRelativeRect> |
 | aFillMode | TBlipFillMode |

See also

  • TBlipFill


TBlipFill.Equals Method | FlexCel Studio for the .NET Framework documentation

TBlipFill.Equals Method

Returns true if this instance has the same data as the object obj.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TBlipFill


TBlipFill.CompareTo Method | FlexCel Studio for the .NET Framework documentation

TBlipFill.CompareTo Method

Returns -1 if obj is bigger than this, 0 if both objects are the same, and 1 if obj is smaller than this.

Syntax

Namespace: FlexCel.Core

public override Int32 CompareTo(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TBlipFill


TBlipFill.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TBlipFill.GetHashCode Method

Returns the hashcode for this object

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TBlipFill


TBlipFill.Dpi Property | FlexCel Studio for the .NET Framework documentation

TBlipFill.Dpi Property

Specifies the DPI (dots per inch) used to calculate the size of the blip. If not present or zero, the DPI in the blip is used.

Syntax

Namespace: FlexCel.Core

public Int32 Dpi { get; }

See also

  • TBlipFill


TBlipFill.RotateWithShape Property | FlexCel Studio for the .NET Framework documentation

TBlipFill.RotateWithShape Property

Specifies that the fill should rotate with the shape.

Syntax

Namespace: FlexCel.Core

public Boolean RotateWithShape { get; }

See also

  • TBlipFill


TBlipFill.Blip Property | FlexCel Studio for the .NET Framework documentation

TBlipFill.Blip Property

Picture and properties used in the Blip fill.

Syntax

Namespace: FlexCel.Core

public TBlip Blip { get; }

See also

  • TBlipFill


TBlipFill.SourceRect Property | FlexCel Studio for the .NET Framework documentation

TBlipFill.SourceRect Property

This element specifies the portion of the blip used for the fill. Each edge of the source rectangle is defined by a percentage offset from the corresponding edge of the bounding box. A positive percentage specifies an inset, while a negative percentage specifies an outset. For example, a left offset of 25% specifies that the left edge of the source rectangle is located to the right of the bounding box's left edge by an amount equal to 25% of the bounding box's width.

Syntax

Namespace: FlexCel.Core

public Nullable<TDrawingRelativeRect> SourceRect { get; }

See also

  • TBlipFill


TBlipFill.FillMode Property | FlexCel Studio for the .NET Framework documentation

TBlipFill.FillMode Property

Specifies how the blip will be applied to the fill, either by stretching it to cover all the surface, of by tiling it.

Syntax

Namespace: FlexCel.Core

public TBlipFillMode FillMode { get; }

See also

  • TBlipFill


TBlipFillMode Class | FlexCel Studio for the .NET Framework documentation

TBlipFillMode Class

This class is designed to store tiling or stretching fill mode information. You need to use any of its descendants, TBlipFillStretch or TBlipFillTile

Syntax

Namespace: FlexCel.Core

public abstract class TBlipFillMode: IComparable

Methods

Name | Description
CompareTo | Returns -1 if obj is bigger than this, 0 if both objects are the same, and 1 if obj is smaller than this.


TBlipFillMode.CompareTo Method | FlexCel Studio for the .NET Framework documentation

TBlipFillMode.CompareTo Method

Returns -1 if obj is bigger than this, 0 if both objects are the same, and 1 if obj is smaller than this.

Syntax

Namespace: FlexCel.Core

public virtual Int32 CompareTo(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TBlipFillMode


TBlipFillStretch Class | FlexCel Studio for the .NET Framework documentation

TBlipFillStretch Class

This element specifies that a BLIP should be stretched to fill the target rectangle. The other option is a tile where a BLIP is tiled to fill the available area.

Syntax

Namespace: FlexCel.Core

public class TBlipFillStretch: TBlipFillMode

Constructors

Name | Description
TBlipFillStretch | Creates a new TBlipFillStretch object.

Methods

Name | Description
Equals | Returns true if this instance has the same data as the object obj.
CompareTo | Returns -1 if obj is bigger than this, 0 if both objects are the same, and 1 if obj is smaller than this.
GetHashCode | Returns the hashcode for this object

Properties

Name | Description
FillRect | Rectangle where the picture will be stretched.


TBlipFillStretch.TBlipFillStretch Constructor | FlexCel Studio for the .NET Framework documentation

TBlipFillStretch.TBlipFillStretch Constructor

Creates a new TBlipFillStretch object.

Syntax

Namespace: FlexCel.Core

public TBlipFillStretch(TDrawingRelativeRect aFillRect)

Parameters

<-> | Parameter | Type | Description
 | aFillRect | TDrawingRelativeRect |

See also

  • TBlipFillStretch


TBlipFillStretch.Equals Method | FlexCel Studio for the .NET Framework documentation

TBlipFillStretch.Equals Method

Returns true if this instance has the same data as the object obj.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TBlipFillStretch


TBlipFillStretch.CompareTo Method | FlexCel Studio for the .NET Framework documentation

TBlipFillStretch.CompareTo Method

Returns -1 if obj is bigger than this, 0 if both objects are the same, and 1 if obj is smaller than this.

Syntax

Namespace: FlexCel.Core

public override Int32 CompareTo(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TBlipFillStretch


TBlipFillStretch.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TBlipFillStretch.GetHashCode Method

Returns the hashcode for this object

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TBlipFillStretch


TBlipFillStretch.FillRect Property | FlexCel Studio for the .NET Framework documentation

TBlipFillStretch.FillRect Property

Rectangle where the picture will be stretched.

Syntax

Namespace: FlexCel.Core

public TDrawingRelativeRect FillRect { get; }

See also

  • TBlipFillStretch


TBlipFillTile Class | FlexCel Studio for the .NET Framework documentation

TBlipFillTile Class

This element specifies that a BLIP should be tiled to fill the available space. This element defines a "tile" rectangle within the bounding box. The image is encompassed within the tile rectangle, and the tile rectangle is tiled across the bounding box to fill the entire area.

Syntax

Namespace: FlexCel.Core

public class TBlipFillTile: TBlipFillMode

Constructors

Name | Description
TBlipFillTile | Creates a new Blip fill tile instance.

Methods

Name | Description
Equals | Returns true if this instance has the same data as the object obj.
CompareTo | Returns -1 if obj is bigger than this, 0 if both objects are the same, and 1 if obj is smaller than this.
GetHashCode | Returns the hashcode for this object

Properties

Name | Description
Align | Specifies where to align the first tile with respect to the shape. Alignment happens after the scaling, but before the additional offset.
Flip | Specifies the direction(s) in which to flip the source image while tiling. Images can be flipped horizontally, vertically, or in both directions to fill the entire region.
Tx | Specifies an extra horizontal offset after alignment.
Ty | Specifies an extra vertical offset after alignment.
ScaleX | Indicates the amount to horizontally scale the source rectangle.
ScaleY | Indicates the amount to vertically scale the source rectangle.


TBlipFillTile.TBlipFillTile Constructor | FlexCel Studio for the .NET Framework documentation

TBlipFillTile.TBlipFillTile Constructor

Creates a new Blip fill tile instance.

Syntax

Namespace: FlexCel.Core

public TBlipFillTile(TDrawingRectAlign aAlign, TFlipMode aFlip, TDrawingCoordinate aTx, TDrawingCoordinate aTy, Double aScaleX, Double aScaleY)

Parameters

<-> | Parameter | Type | Description
 | aAlign | TDrawingRectAlign |
 | aFlip | TFlipMode |
 | aTx | TDrawingCoordinate |
 | aTy | TDrawingCoordinate |
 | aScaleX | Double |
 | aScaleY | Double |

See also

  • TBlipFillTile


TBlipFillTile.Equals Method | FlexCel Studio for the .NET Framework documentation

TBlipFillTile.Equals Method

Returns true if this instance has the same data as the object obj.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TBlipFillTile


TBlipFillTile.CompareTo Method | FlexCel Studio for the .NET Framework documentation

TBlipFillTile.CompareTo Method

Returns -1 if obj is bigger than this, 0 if both objects are the same, and 1 if obj is smaller than this.

Syntax

Namespace: FlexCel.Core

public override Int32 CompareTo(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TBlipFillTile


TBlipFillTile.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TBlipFillTile.GetHashCode Method

Returns the hashcode for this object

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TBlipFillTile


TBlipFillTile.Align Property | FlexCel Studio for the .NET Framework documentation

TBlipFillTile.Align Property

Specifies where to align the first tile with respect to the shape. Alignment happens after the scaling, but before the additional offset.

Syntax

Namespace: FlexCel.Core

public TDrawingRectAlign Align { get; }

See also

  • TBlipFillTile


TBlipFillTile.Flip Property | FlexCel Studio for the .NET Framework documentation

TBlipFillTile.Flip Property

Specifies the direction(s) in which to flip the source image while tiling. Images can be flipped horizontally, vertically, or in both directions to fill the entire region.

Syntax

Namespace: FlexCel.Core

public TFlipMode Flip { get; }

See also

  • TBlipFillTile


TBlipFillTile.Tx Property | FlexCel Studio for the .NET Framework documentation

TBlipFillTile.Tx Property

Specifies an extra horizontal offset after alignment.

Syntax

Namespace: FlexCel.Core

public TDrawingCoordinate Tx { get; }

See also

  • TBlipFillTile


TBlipFillTile.Ty Property | FlexCel Studio for the .NET Framework documentation

TBlipFillTile.Ty Property

Specifies an extra vertical offset after alignment.

Syntax

Namespace: FlexCel.Core

public TDrawingCoordinate Ty { get; }

See also

  • TBlipFillTile


TBlipFillTile.ScaleX Property | FlexCel Studio for the .NET Framework documentation

TBlipFillTile.ScaleX Property

Indicates the amount to horizontally scale the source rectangle.

Syntax

Namespace: FlexCel.Core

public Double ScaleX { get; }

See also

  • TBlipFillTile


TBlipFillTile.ScaleY Property | FlexCel Studio for the .NET Framework documentation

TBlipFillTile.ScaleY Property

Indicates the amount to vertically scale the source rectangle.

Syntax

Namespace: FlexCel.Core

public Double ScaleY { get; }

See also

  • TBlipFillTile


TBlipTransform Class | FlexCel Studio for the .NET Framework documentation

TBlipTransform Class

Represents a simple transformation applied to an image. You should use the descendants of this class, not this class directly.

Syntax

Namespace: FlexCel.Core

public abstract class TBlipTransform

Constructors

Name | Description
TBlipTransform | Internal method.

Methods

Name | Description
Clone | Creates a deep copy of the object.
CompareTo | Compares two instances.
Equals | Returns true if both objects have the same contents.
CompareStrings | Compares 2 strings.
GetHashCode | Returns the hashcode of the object.

Properties

Name | Description
TransformType | The type of transformation.


TBlipTransform.TBlipTransform Constructor | FlexCel Studio for the .NET Framework documentation

TBlipTransform.TBlipTransform Constructor

Internal method.

Syntax

Namespace: FlexCel.Core

protected TBlipTransform(TBlipTransformType aTransformType)

Parameters

<-> | Parameter | Type | Description
 | aTransformType | TBlipTransformType |

See also

  • TBlipTransform


TBlipTransform.Clone Method | FlexCel Studio for the .NET Framework documentation

TBlipTransform.Clone Method

Creates a deep copy of the object.

Syntax

Namespace: FlexCel.Core

public abstract TBlipTransform Clone()

See also

  • TBlipTransform


TBlipTransform.CompareTo Method | FlexCel Studio for the .NET Framework documentation

TBlipTransform.CompareTo Method

Compares two instances.

Syntax

Namespace: FlexCel.Core

public virtual Int32 CompareTo(TBlipTransform blipTransform)

Parameters

<-> | Parameter | Type | Description
 | blipTransform | TBlipTransform |

See also

  • TBlipTransform


TBlipTransform.Equals Method | FlexCel Studio for the .NET Framework documentation

TBlipTransform.Equals Method

Returns true if both objects have the same contents.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TBlipTransform


TBlipTransform.CompareStrings Method | FlexCel Studio for the .NET Framework documentation

TBlipTransform.CompareStrings Method

Compares 2 strings.

Syntax

Namespace: FlexCel.Core

protected Int32 CompareStrings(String s1, String s2)

Parameters

<-> | Parameter | Type | Description
 | s1 | String |
 | s2 | String |

See also

  • TBlipTransform


TBlipTransform.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TBlipTransform.GetHashCode Method

Returns the hashcode of the object.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TBlipTransform


TBlipTransform.TransformType Property | FlexCel Studio for the .NET Framework documentation

TBlipTransform.TransformType Property

The type of transformation.

Syntax

Namespace: FlexCel.Core

public TBlipTransformType TransformType { get; }

See also

  • TBlipTransform


TBlipTransformList Class | FlexCel Studio for the .NET Framework documentation

TBlipTransformList Class

A list with TBlipTransforms.

Syntax

Namespace: FlexCel.Core

public class TBlipTransformList

Constructors

Name | Description
TBlipTransformList | Creates a new TBlipTransformList with the given number of elements.

Methods

Name | Description
Clone | Returns a deep copy of the object.
Compare | Compares 2 instances of BlipTransformLists, and returns -1 is aBlipTransforms1 < aBlipTransforms2, 0 if they are the same, and 1 otherwise.

Properties

Name | Description
Length | Number of elements in the list.
this[] | Returns element index of the transform.


TBlipTransformList.TBlipTransformList Constructor | FlexCel Studio for the .NET Framework documentation

TBlipTransformList.TBlipTransformList Constructor

Creates a new TBlipTransformList with the given number of elements.

Syntax

Namespace: FlexCel.Core

public TBlipTransformList(Int32 listLength)

Parameters

<-> | Parameter | Type | Description
 | listLength | Int32 | Number of elements in the list.

See also

  • TBlipTransformList


TBlipTransformList.Clone Method | FlexCel Studio for the .NET Framework documentation

TBlipTransformList.Clone Method

Returns a deep copy of the object.

Syntax

Namespace: FlexCel.Core

public TBlipTransformList Clone()

See also

  • TBlipTransformList


TBlipTransformList.Compare Method | FlexCel Studio for the .NET Framework documentation

TBlipTransformList.Compare Method

Compares 2 instances of BlipTransformLists, and returns -1 is aBlipTransforms1 < aBlipTransforms2, 0 if they are the same, and 1 otherwise.

Syntax

Namespace: FlexCel.Core

public static Int32 Compare(TBlipTransformList aBlipTransforms1, TBlipTransformList aBlipTransforms2)

Parameters

<-> | Parameter | Type | Description
 | aBlipTransforms1 | TBlipTransformList |
 | aBlipTransforms2 | TBlipTransformList |

See also

  • TBlipTransformList


TBlipTransformList.Length Property | FlexCel Studio for the .NET Framework documentation

TBlipTransformList.Length Property

Number of elements in the list.

Syntax

Namespace: FlexCel.Core

public Int32 Length { get; }

See also

  • TBlipTransformList


TBlipTransformList.this[] Property | FlexCel Studio for the .NET Framework documentation

TBlipTransformList.this[] Property

Returns element index of the transform.

Syntax

Namespace: FlexCel.Core

public TBlipTransform this[] { get; }

See also

  • TBlipTransformList


TBlurEffect Class | FlexCel Studio for the .NET Framework documentation

TBlurEffect Class

A blur effect applied to the whole shape.

Syntax

Namespace: FlexCel.Core

public class TBlurEffect: TDrawingEffect, IComparable, IComparable<TBlurEffect>

Constructors

Name | Description
TBlurEffect | Creates a new blur effect.

Methods

Name | Description
Clone | Creates a deep copy of the object.
CompareTo | Overloaded CompareTo(Object) CompareTo(TBlurEffect)
Equals | Overloaded Equals(TBlurEffect) Equals(Object)
GetHashCode | Returns the hashcode of the object.

Properties

Name | Description
Radius | Radius of the blur.
Grow | If true, the blur can extend outside the bounds of the object.


TBlurEffect.TBlurEffect Constructor | FlexCel Studio for the .NET Framework documentation

TBlurEffect.TBlurEffect Constructor

Creates a new blur effect.

Syntax

Namespace: FlexCel.Core

public TBlurEffect(Int64 aRadius, Boolean aGrow)

Parameters

<-> | Parameter | Type | Description
 | aRadius | Int64 | Radius of the blur.
 | aGrow | Boolean | If true, the blur can extend outside the bounds of the object.

See also

  • TBlurEffect


TBlurEffect.Clone Method | FlexCel Studio for the .NET Framework documentation

TBlurEffect.Clone Method

Creates a deep copy of the object.

Syntax

Namespace: FlexCel.Core

public TBlurEffect Clone()

See also

  • TBlurEffect


TBlurEffect.CompareTo Method | FlexCel Studio for the .NET Framework documentation

TBlurEffect.CompareTo Method

Overloads

  • TBlurEffect.CompareTo(Object)
  • TBlurEffect.CompareTo(TBlurEffect)

TBlurEffect.CompareTo(Object)

Returns -1, 0 or 1 depending if this object is smaller or bigger than the other.

Syntax

Namespace: FlexCel.Core

public Int32 CompareTo(Object other)

Parameters

<-> | Parameter | Type | Description
 | other | Object |

See also

  • TBlurEffect

TBlurEffect.CompareTo(TBlurEffect)

Returns -1, 0 or 1 depending if this object is smaller or bigger than the other.

Syntax

Namespace: FlexCel.Core

public Int32 CompareTo(TBlurEffect other)

Parameters

<-> | Parameter | Type | Description
 | other | TBlurEffect |

See also

  • TBlurEffect


TBlurEffect.Equals Method | FlexCel Studio for the .NET Framework documentation

TBlurEffect.Equals Method

Overloads

  • TBlurEffect.Equals(TBlurEffect)
  • TBlurEffect.Equals(Object)

TBlurEffect.Equals(TBlurEffect)

Returns true if both objects are the same.

Syntax

Namespace: FlexCel.Core

protected Boolean Equals(TBlurEffect other)

Parameters

<-> | Parameter | Type | Description
 | other | TBlurEffect |

See also

  • TBlurEffect

TBlurEffect.Equals(Object)

Returns true if both objects are the same.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object other)

Parameters

<-> | Parameter | Type | Description
 | other | Object |

See also

  • TBlurEffect


TBlurEffect.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TBlurEffect.GetHashCode Method

Returns the hashcode of the object.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TBlurEffect


TBlurEffect.Radius Property | FlexCel Studio for the .NET Framework documentation

TBlurEffect.Radius Property

Radius of the blur.

Syntax

Namespace: FlexCel.Core

public Int64 Radius { get; }

See also

  • TBlurEffect


TBlurEffect.Grow Property | FlexCel Studio for the .NET Framework documentation

TBlurEffect.Grow Property

If true, the blur can extend outside the bounds of the object.

Syntax

Namespace: FlexCel.Core

public Boolean Grow { get; }

See also

  • TBlurEffect


TCategoryAxis Class | FlexCel Studio for the .NET Framework documentation

TCategoryAxis Class

Information about an Axis of categories. (normally the x axis)

Syntax

Namespace: FlexCel.Core

public class TCategoryAxis: TBaseAxis

Constructors

Name | Description
TCategoryAxis | Overloaded TCategoryAxis TCategoryAxis(Int32, Int32, Int32, TDateUnits, Int32, TDateUnits, TDateUnits, Int32, TCategoryAxisOptions, TFlxChartFont, String, Boolean, TAxisLineOptions, TAxisTickOptions, TAxisRangeOptions, TDataLabel, TChartAxisPos, Double) TCategoryAxis(Int32, Int32, Int32, TDateUnits, Int32, TDateUnits, TDateUnits, Int32, TCategoryAxisOptions, TFlxChartFont, String, Boolean, TAxisLineOptions, TAxisTickOptions, TAxisRangeOptions, TDataLabel, TChartAxisPos, Double, Double)

Properties

Name | Description
Min | Minimum value for the axis, when not set to automatic in AxisOptions.
Max | Maximum value for the axis, when not set to automatic in AxisOptions.
MajorValue | Value for the major unit, when not set to automatic in AxisOptions.
MajorUnit | Units for the major unit, when not set to automatic in AxisOptions.
MinorValue | Value for the minor unit, when not set to automatic in AxisOptions.
MinorUnit | Units for the minor unit, when not set to automatic in AxisOptions.
BaseUnit | Base units for the axis, when not set to automatic in AxisOptions.
CrossValue | Value where the other Axis will cross this one, when not set to automatic in AxisOptions.
LabelOffset | Distance from the labels to the axis. Defaults to 100.
AxisOptions | Enumerates which of the other options contain valid values or are automatic.
RangeOptions | Options for the range of this axis.


TCategoryAxis.TCategoryAxis Constructor | FlexCel Studio for the .NET Framework documentation

TCategoryAxis.TCategoryAxis Constructor

Overloads

  • TCategoryAxis.TCategoryAxis
  • TCategoryAxis.TCategoryAxis(Int32, Int32, Int32, TDateUnits, Int32, TDateUnits, TDateUnits, Int32, TCategoryAxisOptions, TFlxChartFont, String, Boolean, TAxisLineOptions, TAxisTickOptions, TAxisRangeOptions, TDataLabel, TChartAxisPos, Double)
  • TCategoryAxis.TCategoryAxis(Int32, Int32, Int32, TDateUnits, Int32, TDateUnits, TDateUnits, Int32, TCategoryAxisOptions, TFlxChartFont, String, Boolean, TAxisLineOptions, TAxisTickOptions, TAxisRangeOptions, TDataLabel, TChartAxisPos, Double, Double)

TCategoryAxis.TCategoryAxis

Constructs a new TCategoryAxisOption instance with all values set to automatic.

Syntax

Namespace: FlexCel.Core

public TCategoryAxis()

See also

  • TCategoryAxis

TCategoryAxis.TCategoryAxis(Int32, Int32, Int32, TDateUnits, Int32, TDateUnits, TDateUnits, Int32, TCategoryAxisOptions, TFlxChartFont, String, Boolean, TAxisLineOptions, TAxisTickOptions, TAxisRangeOptions, TDataLabel, TChartAxisPos, Double)

Constructs a new TCategoryAxisOptions instance.

Syntax

Namespace: FlexCel.Core

public TCategoryAxis(Int32 aMin, Int32 aMax, Int32 aMajorValue, TDateUnits aMajorUnit, Int32 aMinorValue, TDateUnits aMinorUnit, TDateUnits aBaseUnit, Int32 aCrossValue, TCategoryAxisOptions aAxisOptions, TFlxChartFont aFont, String aNumberFormat, Boolean aNumberFormatLinkedToSource, TAxisLineOptions aAxisLineOptions, TAxisTickOptions aTickOptions, TAxisRangeOptions aRangeOptions, TDataLabel aCaption, TChartAxisPos aAxisPos, Double aLabelOffset)

Parameters

<-> | Parameter | Type | Description
 | aMin | Int32 | See Min
 | aMax | Int32 | See Max
 | aMajorValue | Int32 | See MajorValue
 | aMajorUnit | TDateUnits | See MajorUnit
 | aMinorValue | Int32 | See MinorValue
 | aMinorUnit | TDateUnits | See MinorUnit
 | aBaseUnit | TDateUnits | See BaseUnit
 | aCrossValue | Int32 | See CrossValue
 | aAxisOptions | TCategoryAxisOptions | See AxisOptions
 | aFont | TFlxChartFont | See TBaseAxis.Font
 | aNumberFormat | String | See TBaseAxis.NumberFormat
 | aNumberFormatLinkedToSource | Boolean | See TBaseAxis.NumberFormatLinkedToSource
 | aAxisLineOptions | TAxisLineOptions | See TBaseAxis.AxisLineOptions. This parameter will be cloned.
 | aTickOptions | TAxisTickOptions | See TBaseAxis.TickOptions This parameter will be cloned.
 | aRangeOptions | TAxisRangeOptions | See RangeOptions This parameter will be cloned.
 | aCaption | TDataLabel | See TBaseAxis.Caption This parameter will be cloned.
 | aAxisPos | TChartAxisPos | See TBaseAxis.AxisPos
 | aLabelOffset | Double | See LabelOffset

See also

  • TCategoryAxis

TCategoryAxis.TCategoryAxis(Int32, Int32, Int32, TDateUnits, Int32, TDateUnits, TDateUnits, Int32, TCategoryAxisOptions, TFlxChartFont, String, Boolean, TAxisLineOptions, TAxisTickOptions, TAxisRangeOptions, TDataLabel, TChartAxisPos, Double, Double)

Constructs a new TCategoryAxisOptions instance.

Syntax

Namespace: FlexCel.Core

public TCategoryAxis(Int32 aMin, Int32 aMax, Int32 aMajorValue, TDateUnits aMajorUnit, Int32 aMinorValue, TDateUnits aMinorUnit, TDateUnits aBaseUnit, Int32 aCrossValue, TCategoryAxisOptions aAxisOptions, TFlxChartFont aFont, String aNumberFormat, Boolean aNumberFormatLinkedToSource, TAxisLineOptions aAxisLineOptions, TAxisTickOptions aTickOptions, TAxisRangeOptions aRangeOptions, TDataLabel aCaption, TChartAxisPos aAxisPos, Double aLabelOffset, Double aLogBase)

Parameters

<-> | Parameter | Type | Description
 | aMin | Int32 | See Min
 | aMax | Int32 | See Max
 | aMajorValue | Int32 | See MajorValue
 | aMajorUnit | TDateUnits | See MajorUnit
 | aMinorValue | Int32 | See MinorValue
 | aMinorUnit | TDateUnits | See MinorUnit
 | aBaseUnit | TDateUnits | See BaseUnit
 | aCrossValue | Int32 | See CrossValue
 | aAxisOptions | TCategoryAxisOptions | See AxisOptions
 | aFont | TFlxChartFont | See TBaseAxis.Font
 | aNumberFormat | String | See TBaseAxis.NumberFormat
 | aNumberFormatLinkedToSource | Boolean | See TBaseAxis.NumberFormatLinkedToSource
 | aAxisLineOptions | TAxisLineOptions | See TBaseAxis.AxisLineOptions. This parameter will be cloned.
 | aTickOptions | TAxisTickOptions | See TBaseAxis.TickOptions This parameter will be cloned.
 | aRangeOptions | TAxisRangeOptions | See RangeOptions This parameter will be cloned.
 | aCaption | TDataLabel | See TBaseAxis.Caption This parameter will be cloned.
 | aAxisPos | TChartAxisPos | See TBaseAxis.AxisPos
 | aLabelOffset | Double | See LabelOffset
 | aLogBase | Double | See TBaseAxis.LogBase

See also

  • TCategoryAxis


TCategoryAxis.Min Property | FlexCel Studio for the .NET Framework documentation

TCategoryAxis.Min Property

Minimum value for the axis, when not set to automatic in AxisOptions.

Syntax

Namespace: FlexCel.Core

public Int32 Min { get; set; }

See also

  • TCategoryAxis


TCategoryAxis.Max Property | FlexCel Studio for the .NET Framework documentation

TCategoryAxis.Max Property

Maximum value for the axis, when not set to automatic in AxisOptions.

Syntax

Namespace: FlexCel.Core

public Int32 Max { get; set; }

See also

  • TCategoryAxis


TCategoryAxis.MajorValue Property | FlexCel Studio for the .NET Framework documentation

TCategoryAxis.MajorValue Property

Value for the major unit, when not set to automatic in AxisOptions.

Syntax

Namespace: FlexCel.Core

public Int32 MajorValue { get; set; }

See also

  • TCategoryAxis


TCategoryAxis.MajorUnit Property | FlexCel Studio for the .NET Framework documentation

TCategoryAxis.MajorUnit Property

Units for the major unit, when not set to automatic in AxisOptions.

Syntax

Namespace: FlexCel.Core

public TDateUnits MajorUnit { get; set; }

See also

  • TCategoryAxis


TCategoryAxis.MinorValue Property | FlexCel Studio for the .NET Framework documentation

TCategoryAxis.MinorValue Property

Value for the minor unit, when not set to automatic in AxisOptions.

Syntax

Namespace: FlexCel.Core

public Int32 MinorValue { get; set; }

See also

  • TCategoryAxis


TCategoryAxis.MinorUnit Property | FlexCel Studio for the .NET Framework documentation

TCategoryAxis.MinorUnit Property

Units for the minor unit, when not set to automatic in AxisOptions.

Syntax

Namespace: FlexCel.Core

public TDateUnits MinorUnit { get; set; }

See also

  • TCategoryAxis


TCategoryAxis.BaseUnit Property | FlexCel Studio for the .NET Framework documentation

TCategoryAxis.BaseUnit Property

Base units for the axis, when not set to automatic in AxisOptions.

Syntax

Namespace: FlexCel.Core

public TDateUnits BaseUnit { get; set; }

See also

  • TCategoryAxis


TCategoryAxis.CrossValue Property | FlexCel Studio for the .NET Framework documentation

TCategoryAxis.CrossValue Property

Value where the other Axis will cross this one, when not set to automatic in AxisOptions.

Syntax

Namespace: FlexCel.Core

public Int32 CrossValue { get; set; }

See also

  • TCategoryAxis


TCategoryAxis.LabelOffset Property | FlexCel Studio for the .NET Framework documentation

TCategoryAxis.LabelOffset Property

Distance from the labels to the axis. Defaults to 100.

Syntax

Namespace: FlexCel.Core

public Double LabelOffset { get; set; }

See also

  • TCategoryAxis


TCategoryAxis.AxisOptions Property | FlexCel Studio for the .NET Framework documentation

TCategoryAxis.AxisOptions Property

Enumerates which of the other options contain valid values or are automatic.

Syntax

Namespace: FlexCel.Core

public TCategoryAxisOptions AxisOptions { get; set; }

See also

  • TCategoryAxis


TCategoryAxis.RangeOptions Property | FlexCel Studio for the .NET Framework documentation

TCategoryAxis.RangeOptions Property

Options for the range of this axis.

Syntax

Namespace: FlexCel.Core

public TAxisRangeOptions RangeOptions { get; set; }

See also

  • TCategoryAxis


TCellAddress Class | FlexCel Studio for the .NET Framework documentation

TCellAddress Class

Small class that can convert between a string reference ("A1") into row and col integers (1,1).

Syntax

Namespace: FlexCel.Core

public class TCellAddress

Constructors

Name | Description
TCellAddress | Overloaded TCellAddress TCellAddress(String) TCellAddress(Int32, Int32) TCellAddress(Int32, Int32, Boolean, Boolean) TCellAddress(String, Int32, Int32, Boolean, Boolean)

Methods

Name | Description
Clone | Returns a deep copy of the cell address.
QuoteSheet | Quotes a sheet name if it is needed. For example, Sheet 1 should be quoted as 'Sheet 1'
NameIsReserved | Returns true if the string can be a cell reference, like A1 or LVM78, or "R", "C", "TRUE" or "FALSE". If this method returns true, you can't name a sheet or a named range with name.
EncodeColumn | Returns "A" for column 1, "B" for 2 and so on.
DecodeColumn | Returns 1 for column "A", 2 for "B" and so on. If the string isn't a valid column name, this method will return -1. You normally will just want to create TCellAddress to convert between cell references (var cell = new TCellAddress(row, col); DoSomething(​cell.​Cell​Ref)​.​ But this method could be used in specific cases where you want only the column string and not the full address.
ToString | Returns the cell reference.
CellRefR1C1 | Returns the cell reference in the objects in R1C1 notation.
TrySetCellRef | Overloaded TrySetCellRef(String) TrySetCellRef(String, TReferenceStyle, Int32, Int32)
TryParseSheet | Parses a string like Sheet1!A1 into a sheet component and the rest. If the sheet is quoted ('sheet 1') it will be unquoted.
Equals | Returns true if both objects have the same data.
GetHashCode | Returns the hashcode of this object.

Properties

Name | Description
Sheet | Sheet name of the reference.
Row | Row index for this reference (1-based).
Col | Column index for this reference (1-based).
RowAbsolute | True if the row is an absolute reference (as in A$5)
ColAbsolute | True if the column is an absolute reference (as in $A5)
CellRef | Cell address in Excel A1 notation. (For example "A5"). Absolute references ($A$5) will work too.


TCellAddress.TCellAddress Constructor | FlexCel Studio for the .NET Framework documentation

TCellAddress.TCellAddress Constructor

Overloads

  • TCellAddress.TCellAddress
  • TCellAddress.TCellAddress(String)
  • TCellAddress.TCellAddress(Int32, Int32)
  • TCellAddress.TCellAddress(Int32, Int32, Boolean, Boolean)
  • TCellAddress.TCellAddress(String, Int32, Int32, Boolean, Boolean)

TCellAddress.TCellAddress

Creates Cell Address pointing to A1.

Syntax

Namespace: FlexCel.Core

public TCellAddress()

See also

  • TCellAddress

TCellAddress.TCellAddress(String)

Creates a Cell Address pointing to (aCellRef).

Syntax

Namespace: FlexCel.Core

public TCellAddress(String aCellRef)

Parameters

<-> | Parameter | Type | Description
 | aCellRef | String | String containing the cell address in Excel notation (for example "A5"). Absolute references ($A$5) work too.

See also

  • TCellAddress

TCellAddress.TCellAddress(Int32, Int32)

Creates Cell Address pointing to (aRow, aCol).

Syntax

Namespace: FlexCel.Core

public TCellAddress(Int32 aRow, Int32 aCol)

Parameters

<-> | Parameter | Type | Description
 | aRow | Int32 | Row index of the reference (1-based).
 | aCol | Int32 | Column index of the reference (1-based).

See also

  • TCellAddress

TCellAddress.TCellAddress(Int32, Int32, Boolean, Boolean)

Creates Cell Address pointing to (aRow, aCol) with the corresponding absolute values.

Syntax

Namespace: FlexCel.Core

public TCellAddress(Int32 aRow, Int32 aCol, Boolean aRowAbsolute, Boolean aColAbsolute)

Parameters

<-> | Parameter | Type | Description
 | aRow | Int32 | Row index of the reference (1-based).
 | aCol | Int32 | Column index of the reference (1-based).
 | aRowAbsolute | Boolean | If true row will be an absolute reference. (As in A$5).
 | aColAbsolute | Boolean | If true col will be an absolute reference. (As in $A5).

See also

  • TCellAddress

TCellAddress.TCellAddress(String, Int32, Int32, Boolean, Boolean)

Creates Cell Address pointing to (aRow, aCol) with the corresponding absolute values.

Syntax

Namespace: FlexCel.Core

public TCellAddress(String aSheet, Int32 aRow, Int32 aCol, Boolean aRowAbsolute, Boolean aColAbsolute)

Parameters

<-> | Parameter | Type | Description
 | aSheet | String | Sheet name of the reference.
 | aRow | Int32 | Row index of the reference (1-based).
 | aCol | Int32 | Column index of the reference (1-based).
 | aRowAbsolute | Boolean | If true row will be an absolute reference. (As in A$5).
 | aColAbsolute | Boolean | If true col will be an absolute reference. (As in $A5).

See also

  • TCellAddress


TCellAddress.Clone Method | FlexCel Studio for the .NET Framework documentation

TCellAddress.Clone Method

Returns a deep copy of the cell address.

Syntax

Namespace: FlexCel.Core

public TCellAddress Clone()

See also

  • TCellAddress


TCellAddress.QuoteSheet Method | FlexCel Studio for the .NET Framework documentation

TCellAddress.QuoteSheet Method

Quotes a sheet name if it is needed. For example, Sheet 1 should be quoted as 'Sheet 1'

Syntax

Namespace: FlexCel.Core

public static String QuoteSheet(String SheetName)

Parameters

<-> | Parameter | Type | Description
 | SheetName | String | Sheet to quote

Returns

Quoted sheet.

See also

  • TCellAddress


TCellAddress.NameIsReserved Method | FlexCel Studio for the .NET Framework documentation

TCellAddress.NameIsReserved Method

Returns true if the string can be a cell reference, like A1 or LVM78, or "R", "C", "TRUE" or "FALSE". If this method returns true, you can't name a sheet or a named range with name.

Syntax

Namespace: FlexCel.Core

public static Boolean NameIsReserved(String Name)

Parameters

<-> | Parameter | Type | Description
 | Name | String |

See also

  • TCellAddress


TCellAddress.EncodeColumn Method | FlexCel Studio for the .NET Framework documentation

TCellAddress.EncodeColumn Method

Returns "A" for column 1, "B" for 2 and so on.

Syntax

Namespace: FlexCel.Core

public static String EncodeColumn(Int32 column)

Parameters

<-> | Parameter | Type | Description
 | column | Int32 | Index of the column, 1 based.

See also

  • TCellAddress


TCellAddress.DecodeColumn Method | FlexCel Studio for the .NET Framework documentation

TCellAddress.DecodeColumn Method

Returns 1 for column "A", 2 for "B" and so on. If the string isn't a valid column name, this method will return -1. You normally will just want to create TCellAddress to convert between cell references (var cell = new TCellAddress(row, col); DoSomething(cell.CellRef). But this method could be used in specific cases where you want only the column string and not the full address.

Syntax

Namespace: FlexCel.Core

public static Int32 DecodeColumn(String col)

Parameters

<-> | Parameter | Type | Description
 | col | String | String which defines a column.

Returns

-1 if col can't be converted to a column reference, or the column number (1 based) otherwise.

See also

  • TCellAddress


TCellAddress.ToString Method | FlexCel Studio for the .NET Framework documentation

TCellAddress.ToString Method

Returns the cell reference.

Syntax

Namespace: FlexCel.Core

public override String ToString()

See also

  • TCellAddress


TCellAddress.CellRefR1C1 Method | FlexCel Studio for the .NET Framework documentation

TCellAddress.CellRefR1C1 Method

Returns the cell reference in the objects in R1C1 notation.

Syntax

Namespace: FlexCel.Core

public String CellRefR1C1(Int32 cellRow, Int32 cellCol)

Parameters

<-> | Parameter | Type | Description
 | cellRow | Int32 | Row where the cell that has the formula is. This is used in relative R1C1 references, so for example, if the cell with the formula is B7, and this object holds a relative C9, the result would be R[2]C[1]
 | cellCol | Int32 | Column where the cell that has the formula is. This is used in relative R1C1 references, so for example, if the cell with the formula is B7, and this object holds a relative C9, the result would be R[2]C[1]

Returns

The cell reference in R1C1 notation.

See also

  • TCellAddress


TCellAddress.TrySetCellRef Method | FlexCel Studio for the .NET Framework documentation

TCellAddress.TrySetCellRef Method

Overloads

  • TCellAddress.TrySetCellRef(String)
  • TCellAddress.TrySetCellRef(String, TReferenceStyle, Int32, Int32)

TCellAddress.TrySetCellRef(String)

Tries to set a cell reference, and returns true if the cell is a correct A1 reference. This is similar to setting CellRef to a string, but it will not raise an exception.

Syntax

Namespace: FlexCel.Core

public Boolean TrySetCellRef(String value)

Parameters

<-> | Parameter | Type | Description
 | value | String | String with the cell reference, in A1 format. To use R1C1 notation, see TrySetCellRef(String, TReferenceStyle, Int32, Int32)

Returns

True if value was a correct cell reference, false otherwise.

See also

  • TCellAddress

TCellAddress.TrySetCellRef(String, TReferenceStyle, Int32, Int32)

Tries to set a cell reference, and returns true if the cell is a correct A1 or R1C1 reference.

Syntax

Namespace: FlexCel.Core

public Boolean TrySetCellRef(String value, TReferenceStyle referenceStyle, Int32 cellRow, Int32 cellCol)

Parameters

<-> | Parameter | Type | Description
 | value | String | String with the cell reference, in A1 or R1C1 format.
 | referenceStyle | TReferenceStyle | Style the reference is in (A1 or R1C1).
 | cellRow | Int32 | Row where the cell is. This is only used for R1C1 relative references, to know where the cell is. For example, the reference R[1]C[1] when cellRow is 5 will reference row 6. A1 references or absolute R1C1 references ignore this parameter.
 | cellCol | Int32 | Column where the cell is. This is only used for R1C1 relative references, to know where the cell is. For example, the reference R[1]C[1] when cellCol is 5 will reference column 6. A1 references or absolute R1C1 references ignore this parameter.

Returns

True if value was a correct cell reference, false otherwise.

See also

  • TCellAddress


TCellAddress.TryParseSheet Method | FlexCel Studio for the .NET Framework documentation

TCellAddress.TryParseSheet Method

Parses a string like Sheet1!A1 into a sheet component and the rest. If the sheet is quoted ('sheet 1') it will be unquoted.

Syntax

Namespace: FlexCel.Core

public static Boolean TryParseSheet(String value, out String sheet, out String rest)

Parameters

<-> | Parameter | Type | Description
 | value | String | String to parse
out | sheet | String | Part of the string that is the sheet.
out | rest | String | Part of the string that is not the sheet.

See also

  • TCellAddress


TCellAddress.Equals Method | FlexCel Studio for the .NET Framework documentation

TCellAddress.Equals Method

Returns true if both objects have the same data.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TCellAddress


TCellAddress.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TCellAddress.GetHashCode Method

Returns the hashcode of this object.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TCellAddress


TCellAddress.Sheet Property | FlexCel Studio for the .NET Framework documentation

TCellAddress.Sheet Property

Sheet name of the reference.

Syntax

Namespace: FlexCel.Core

public String Sheet { get; set; }

See also

  • TCellAddress


TCellAddress.Row Property | FlexCel Studio for the .NET Framework documentation

TCellAddress.Row Property

Row index for this reference (1-based).

Syntax

Namespace: FlexCel.Core

public Int32 Row { get; set; }

See also

  • TCellAddress


TCellAddress.Col Property | FlexCel Studio for the .NET Framework documentation

TCellAddress.Col Property

Column index for this reference (1-based).

Syntax

Namespace: FlexCel.Core

public Int32 Col { get; set; }

See also

  • TCellAddress


TCellAddress.RowAbsolute Property | FlexCel Studio for the .NET Framework documentation

TCellAddress.RowAbsolute Property

True if the row is an absolute reference (as in A$5)

Syntax

Namespace: FlexCel.Core

public Boolean RowAbsolute { get; set; }

See also

  • TCellAddress


TCellAddress.ColAbsolute Property | FlexCel Studio for the .NET Framework documentation

TCellAddress.ColAbsolute Property

True if the column is an absolute reference (as in $A5)

Syntax

Namespace: FlexCel.Core

public Boolean ColAbsolute { get; set; }

See also

  • TCellAddress


TCellAddress.CellRef Property | FlexCel Studio for the .NET Framework documentation

TCellAddress.CellRef Property

Cell address in Excel A1 notation. (For example "A5"). Absolute references ($A$5) will work too.

Syntax

Namespace: FlexCel.Core

public String CellRef { get; set; }

See also

  • TCellAddress


TCellAddressRange Class | FlexCel Studio for the .NET Framework documentation

TCellAddressRange Class

A class with 2 TCellAddress objects marking the start and end of a cell range.

Syntax

Namespace: FlexCel.Core

public class TCellAddressRange

Constructors

Name | Description
TCellAddressRange | Creates a new instance. Addresses can't be null.

Methods

Name | Description
Equals | Returns true if both objects have the same data.
GetHashCode | HashCode for the object
HasValidAddress | Returns true if row1 and col1 are > 0, row2 and col2 >= col1 and row2 and col2 <= MaxRow and MaxCol

Properties

Name | Description
TopLeft | The cell at the top left position in the range. It can't be null.
BottomRight | The cell at the bottom right position in the range. It can't be null.


TCellAddressRange.TCellAddressRange Constructor | FlexCel Studio for the .NET Framework documentation

TCellAddressRange.TCellAddressRange Constructor

Creates a new instance. Addresses can't be null.

Syntax

Namespace: FlexCel.Core

public TCellAddressRange(TCellAddress aTopLeft, TCellAddress aBottomRight)

Parameters

<-> | Parameter | Type | Description
 | aTopLeft | TCellAddress |
 | aBottomRight | TCellAddress |

See also

  • TCellAddressRange


TCellAddressRange.Equals Method | FlexCel Studio for the .NET Framework documentation

TCellAddressRange.Equals Method

Returns true if both objects have the same data.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TCellAddressRange


TCellAddressRange.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TCellAddressRange.GetHashCode Method

HashCode for the object

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TCellAddressRange


TCellAddressRange.HasValidAddress Method | FlexCel Studio for the .NET Framework documentation

TCellAddressRange.HasValidAddress Method

Returns true if row1 and col1 are > 0, row2 and col2 >= col1 and row2 and col2 <= MaxRow and MaxCol

Syntax

Namespace: FlexCel.Core

public Boolean HasValidAddress()

See also

  • TCellAddressRange


TCellAddressRange.TopLeft Property | FlexCel Studio for the .NET Framework documentation

TCellAddressRange.TopLeft Property

The cell at the top left position in the range. It can't be null.

Syntax

Namespace: FlexCel.Core

public TCellAddress TopLeft { get; set; }

See also

  • TCellAddressRange


TCellAddressRange.BottomRight Property | FlexCel Studio for the .NET Framework documentation

TCellAddressRange.BottomRight Property

The cell at the bottom right position in the range. It can't be null.

Syntax

Namespace: FlexCel.Core

public TCellAddress BottomRight { get; set; }

See also

  • TCellAddressRange


TChart3DOptions Class | FlexCel Studio for the .NET Framework documentation

TChart3DOptions Class

Holds the 3D properties of the chart.

Syntax

Namespace: FlexCel.Core

public class TChart3DOptions

Constructors

Name | Description
TChart3DOptions | Creates a new TChart3DOptions object.

Properties

Name | Description
XRotation | Specifies the amount a 3-D chart shall be rotated in the X direction in degrees. Must be between -90 and 90.
YRotation | Specifies the amount a 3-D chart shall be rotated in the Y direction in degrees. Must be between 0 and 360.
HeightPercent | Height of a 3-D chart as a percentage of the chart width. Must be between 5% and 500%.
DepthPercent | Depth of the 3-D plot area as a percentage of its width. Must be between 1 and 2000.
Perspective | Specifies the field of view angle for the 3-D chart in degrees. Must be between 0 and 100. IMPORTANT: In Excel 2007 or newer, this value is displayed on screen in 1/2 degrees instead of degrees, so it will show as the double of the value you see here. In Excel 2003 or older it is displayed in degrees instead.


TChart3DOptions.TChart3DOptions Constructor | FlexCel Studio for the .NET Framework documentation

TChart3DOptions.TChart3DOptions Constructor

Creates a new TChart3DOptions object.

Syntax

Namespace: FlexCel.Core

public TChart3DOptions(Double aXRotation, Double aYRotation, Double aHeightPercent, Double aDepthPercent, Double aPerspective)

Parameters

<-> | Parameter | Type | Description
 | aXRotation | Double | See XRotation.
 | aYRotation | Double | See YRotation.
 | aHeightPercent | Double | See HeightPercent.
 | aDepthPercent | Double | See DepthPercent.
 | aPerspective | Double | See Perspective.

See also

  • TChart3DOptions


TChart3DOptions.XRotation Property | FlexCel Studio for the .NET Framework documentation

TChart3DOptions.XRotation Property

Specifies the amount a 3-D chart shall be rotated in the X direction in degrees. Must be between -90 and 90.

Syntax

Namespace: FlexCel.Core

public Double XRotation { get; set; }

See also

  • TChart3DOptions


TChart3DOptions.YRotation Property | FlexCel Studio for the .NET Framework documentation

TChart3DOptions.YRotation Property

Specifies the amount a 3-D chart shall be rotated in the Y direction in degrees. Must be between 0 and 360.

Syntax

Namespace: FlexCel.Core

public Double YRotation { get; set; }

See also

  • TChart3DOptions


TChart3DOptions.HeightPercent Property | FlexCel Studio for the .NET Framework documentation

TChart3DOptions.HeightPercent Property

Height of a 3-D chart as a percentage of the chart width. Must be between 5% and 500%.

Syntax

Namespace: FlexCel.Core

public Double HeightPercent { get; set; }

See also

  • TChart3DOptions


TChart3DOptions.DepthPercent Property | FlexCel Studio for the .NET Framework documentation

TChart3DOptions.DepthPercent Property

Depth of the 3-D plot area as a percentage of its width. Must be between 1 and 2000.

Syntax

Namespace: FlexCel.Core

public Double DepthPercent { get; set; }

See also

  • TChart3DOptions


TChart3DOptions.Perspective Property | FlexCel Studio for the .NET Framework documentation

TChart3DOptions.Perspective Property

Specifies the field of view angle for the 3-D chart in degrees. Must be between 0 and 100. IMPORTANT: In Excel 2007 or newer, this value is displayed on screen in 1/2 degrees instead of degrees, so it will show as the double of the value you see here. In Excel 2003 or older it is displayed in degrees instead.

Syntax

Namespace: FlexCel.Core

public Double Perspective { get; set; }

See also

  • TChart3DOptions


TChartAxis Class | FlexCel Studio for the .NET Framework documentation

TChartAxis Class

A class encapsulating the information of an axis

Syntax

Namespace: FlexCel.Core

public class TChartAxis

Constructors

Name | Description
TChartAxis | Creates a new ChartAxis instance.

Properties

Name | Description
Index | Axis Index. 0 means primary, 1 secondary.
CategoryAxis | Returns information about the Category Axis (X-Axis on a non rotated chart). Note that this might be a TValueAxis axis for scatter charts, or a TCategoryAxis for line or bar charts.
ValueAxis | Returns information about the Value Axis (Y-Axis on a non rotated chart).


TChartAxis.TChartAxis Constructor | FlexCel Studio for the .NET Framework documentation

TChartAxis.TChartAxis Constructor

Creates a new ChartAxis instance.

Syntax

Namespace: FlexCel.Core

public TChartAxis(Int32 aIndex, TBaseAxis aCategoryAxis, TBaseAxis aValueAxis)

Parameters

<-> | Parameter | Type | Description
 | aIndex | Int32 | Axis Index. 0 means primary, 1 secondary.
 | aCategoryAxis | TBaseAxis | Data of the Category Axis. This might be a CategoryAxis for line or bar charts, or a ValuesAxis for a Scatter Chart.
 | aValueAxis | TBaseAxis | Data of the value Axis.

See also

  • TChartAxis


TChartAxis.Index Property | FlexCel Studio for the .NET Framework documentation

TChartAxis.Index Property

Axis Index. 0 means primary, 1 secondary.

Syntax

Namespace: FlexCel.Core

public Int32 Index { get; set; }

See also

  • TChartAxis


TChartAxis.CategoryAxis Property | FlexCel Studio for the .NET Framework documentation

TChartAxis.CategoryAxis Property

Returns information about the Category Axis (X-Axis on a non rotated chart). Note that this might be a TValueAxis axis for scatter charts, or a TCategoryAxis for line or bar charts.

Syntax

Namespace: FlexCel.Core

public TBaseAxis CategoryAxis { get; }

See also

  • TChartAxis


TChartAxis.ValueAxis Property | FlexCel Studio for the .NET Framework documentation

TChartAxis.ValueAxis Property

Returns information about the Value Axis (Y-Axis on a non rotated chart).

Syntax

Namespace: FlexCel.Core

public TBaseAxis ValueAxis { get; }

See also

  • TChartAxis


TChartDropBars Class | FlexCel Studio for the .NET Framework documentation

TChartDropBars Class

Information about a Drop Bar.

Syntax

Namespace: FlexCel.Core

public class TChartDropBars: ICloneable

Constructors

Name | Description
TChartDropBars | Creates a new TChartDropBars instance.

Methods

Name | Description
Clone | Returns a deep copy of this object.

Properties

Name | Description
DropLines | Line style for the drop lines if they exist, null otherwise.
HiLoLines | Line style for the High-Low lines if they exist, null otherwise.
UpBar | The data for the up drop bar.
DownBar | The data for the down drop bar.


TChartDropBars.TChartDropBars Constructor | FlexCel Studio for the .NET Framework documentation

TChartDropBars.TChartDropBars Constructor

Creates a new TChartDropBars instance.

Syntax

Namespace: FlexCel.Core

public TChartDropBars(ChartLineOptions aDropLines, ChartLineOptions aHiLoLines, TChartOneDropBar aUpBar, TChartOneDropBar aDownBar)

Parameters

<-> | Parameter | Type | Description
 | aDropLines | ChartLineOptions | See DropLines
 | aHiLoLines | ChartLineOptions | See HiLoLines
 | aUpBar | TChartOneDropBar | See UpBar
 | aDownBar | TChartOneDropBar | See DownBar

See also

  • TChartDropBars


TChartDropBars.Clone Method | FlexCel Studio for the .NET Framework documentation

TChartDropBars.Clone Method

Returns a deep copy of this object.

Syntax

Namespace: FlexCel.Core

public Object Clone()

See also

  • TChartDropBars


TChartDropBars.DropLines Property | FlexCel Studio for the .NET Framework documentation

TChartDropBars.DropLines Property

Line style for the drop lines if they exist, null otherwise.

Syntax

Namespace: FlexCel.Core

public ChartLineOptions DropLines { get; set; }

See also

  • TChartDropBars


TChartDropBars.HiLoLines Property | FlexCel Studio for the .NET Framework documentation

TChartDropBars.HiLoLines Property

Line style for the High-Low lines if they exist, null otherwise.

Syntax

Namespace: FlexCel.Core

public ChartLineOptions HiLoLines { get; set; }

See also

  • TChartDropBars


TChartDropBars.UpBar Property | FlexCel Studio for the .NET Framework documentation

TChartDropBars.UpBar Property

The data for the up drop bar.

Syntax

Namespace: FlexCel.Core

public TChartOneDropBar UpBar { get; set; }

See also

  • TChartDropBars


TChartDropBars.DownBar Property | FlexCel Studio for the .NET Framework documentation

TChartDropBars.DownBar Property

The data for the down drop bar.

Syntax

Namespace: FlexCel.Core

public TChartOneDropBar DownBar { get; set; }

See also

  • TChartDropBars


TChartErrorBars Class | FlexCel Studio for the .NET Framework documentation

TChartErrorBars Class

Information about an Error Bar.

Syntax

Namespace: FlexCel.Core

public class TChartErrorBars: ICloneable

Constructors

Name | Description
TChartErrorBars | Creates a new TChartErrorBars instance.

Methods

Name | Description
CalcErrorValues | This method will calculate the Values array based on the error types and series values.
Clone | Returns a deep copy of this object.

Properties

Name | Description
Direction | Direction of the error bars.
BarType | Positive or negative error bars.
ErrorType | Type of error bar.
IsTShaped | If true, the error bar has a top line like a T.
NumValue | Numeric value of the error. The meaning of this depends in the ErrorType.
LineOptions | Line options for the error bars, color, line width, etc. If null, standard options will be used.
ValuesPlus | Values of the positive error bars. This will be null unless you explicitly calculate them by calling CalcErrorValues.
ValuesMinus | Values of the negative error bars. This will be null unless you explicitly calculate them by calling CalcErrorValues.
StdAvg | Returns the average of the series. This value is calculated by CalcErrorValues, and only is the error type is StdErr or StdDev. It is used when the error type is StdDev as error bars must be drawn from the average.
CustomDefPlus | Returns the formula text used for a custom error bar for the + values.
CustomDefMinus | Returns the formula text used for a custom error bar for the - values.
CustomValuesPlus | Returns the formula values used for a custom error bar for the + values.
CustomValuesMinus | Returns the formula values used for a custom error bar for the - values.


TChartErrorBars.TChartErrorBars Constructor | FlexCel Studio for the .NET Framework documentation

TChartErrorBars.TChartErrorBars Constructor

Creates a new TChartErrorBars instance.

Syntax

Namespace: FlexCel.Core

public TChartErrorBars(TChartErrorBarDirection aDirection, TChartErrorBarBarType aBarType, TChartErrorBarErrorType aErrorType, Boolean aIsTShaped, Double aNumValue, ChartLineOptions aLineOptions, String aCustomDefPlus, Object[] aCustomValuesPlus, String aCustomDefMinus, Object[] aCustomValuesMinus)

Parameters

<-> | Parameter | Type | Description
 | aDirection | TChartErrorBar​Direction | Direction of the error bars.
 | aBarType | TChartErrorBar​BarType | Positive or negative error bars.
 | aErrorType | TChartErrorBar​Error​Type | Type of error bar.
 | aIsTShaped | Boolean | If true, the error bar has a top line like a T.
 | aNumValue | Double | Numeric value of the error. The meaning of this depends in the ErrorType.
 | aLineOptions | ChartLineOptions | Line options for the error bars, color, line width, etc. If null, standard options will be used.
 | aCustomDefPlus | String | Definition for the custom error bars in the plus direction. If the error is not custom this will be null.
 | aCustomValuesPlus | Object[] | Values for the custom error bars in the plus direction. If the error is not custom this will be null.
 | aCustomDefMinus | String | Definition for the custom error bars in the minus direction. If the error is not custom this will be null.
 | aCustomValuesMinus | Object[] | Values for the custom error bars in the minus direction. If the error is not custom this will be null.

See also

  • TChartErrorBars


TChartErrorBars.CalcErrorValues Method | FlexCel Studio for the .NET Framework documentation

TChartErrorBars.CalcErrorValues Method

This method will calculate the Values array based on the error types and series values.

Syntax

Namespace: FlexCel.Core

public void CalcErrorValues(Int32 NumberOfSeries, Int32 SeriesLen, Func<Int32, Int32, Double> SeriesVal, Func<Int32, Int32, Boolean> SeriesHasVal, Int32 SeriesPos)

Parameters

<-> | Parameter | Type | Description
 | NumberOfSeries | Int32 | Total number of series.
 | SeriesLen | Int32 | Length of one series.
 | SeriesVal | Func<Int32, Int32, Double> | Function that returns the value of a point of one of the series. First parameter is the series number, second is the point position.
 | SeriesHasVal | Func<Int32, Int32, Boolean> | Function that returns true if a point of the series exists. First parameter is the series number, second is the point position.
 | SeriesPos | Int32 | Series for which we are calculating the values.

See also

  • TChartErrorBars


TChartErrorBars.Clone Method | FlexCel Studio for the .NET Framework documentation

TChartErrorBars.Clone Method

Returns a deep copy of this object.

Syntax

Namespace: FlexCel.Core

public Object Clone()

See also

  • TChartErrorBars


TChartErrorBars.Direction Property | FlexCel Studio for the .NET Framework documentation

TChartErrorBars.Direction Property

Direction of the error bars.

Syntax

Namespace: FlexCel.Core

public TChartErrorBarDirection Direction { get; set; }

See also

  • TChartErrorBars


TChartErrorBars.BarType Property | FlexCel Studio for the .NET Framework documentation

TChartErrorBars.BarType Property

Positive or negative error bars.

Syntax

Namespace: FlexCel.Core

public TChartErrorBarBarType BarType { get; set; }

See also

  • TChartErrorBars


TChartErrorBars.ErrorType Property | FlexCel Studio for the .NET Framework documentation

TChartErrorBars.ErrorType Property

Type of error bar.

Syntax

Namespace: FlexCel.Core

public TChartErrorBarErrorType ErrorType { get; set; }

See also

  • TChartErrorBars


TChartErrorBars.IsTShaped Property | FlexCel Studio for the .NET Framework documentation

TChartErrorBars.IsTShaped Property

If true, the error bar has a top line like a T.

Syntax

Namespace: FlexCel.Core

public Boolean IsTShaped { get; set; }

See also

  • TChartErrorBars


TChartErrorBars.NumValue Property | FlexCel Studio for the .NET Framework documentation

TChartErrorBars.NumValue Property

Numeric value of the error. The meaning of this depends in the ErrorType.

Syntax

Namespace: FlexCel.Core

public Double NumValue { get; set; }

See also

  • TChartErrorBars


TChartErrorBars.LineOptions Property | FlexCel Studio for the .NET Framework documentation

TChartErrorBars.LineOptions Property

Line options for the error bars, color, line width, etc. If null, standard options will be used.

Syntax

Namespace: FlexCel.Core

public ChartLineOptions LineOptions { get; }

See also

  • TChartErrorBars


TChartErrorBars.ValuesPlus Property | FlexCel Studio for the .NET Framework documentation

TChartErrorBars.ValuesPlus Property

Values of the positive error bars. This will be null unless you explicitly calculate them by calling CalcErrorValues.

Syntax

Namespace: FlexCel.Core

public Double[] ValuesPlus { get; }

See also

  • TChartErrorBars


TChartErrorBars.ValuesMinus Property | FlexCel Studio for the .NET Framework documentation

TChartErrorBars.ValuesMinus Property

Values of the negative error bars. This will be null unless you explicitly calculate them by calling CalcErrorValues.

Syntax

Namespace: FlexCel.Core

public Double[] ValuesMinus { get; }

See also

  • TChartErrorBars


TChartErrorBars.StdAvg Property | FlexCel Studio for the .NET Framework documentation

TChartErrorBars.StdAvg Property

Returns the average of the series. This value is calculated by CalcErrorValues, and only is the error type is StdErr or StdDev. It is used when the error type is StdDev as error bars must be drawn from the average.

Syntax

Namespace: FlexCel.Core

public Double StdAvg { get; }

See also

  • TChartErrorBars


TChartErrorBars.CustomDefPlus Property | FlexCel Studio for the .NET Framework documentation

TChartErrorBars.CustomDefPlus Property

Returns the formula text used for a custom error bar for the + values.

Syntax

Namespace: FlexCel.Core

public String CustomDefPlus { get; }

See also

  • TChartErrorBars


TChartErrorBars.CustomDefMinus Property | FlexCel Studio for the .NET Framework documentation

TChartErrorBars.CustomDefMinus Property

Returns the formula text used for a custom error bar for the - values.

Syntax

Namespace: FlexCel.Core

public String CustomDefMinus { get; }

See also

  • TChartErrorBars


TChartErrorBars.CustomValuesPlus Property | FlexCel Studio for the .NET Framework documentation

TChartErrorBars.CustomValuesPlus Property

Returns the formula values used for a custom error bar for the + values.

Syntax

Namespace: FlexCel.Core

public Object[] CustomValuesPlus { get; }

See also

  • TChartErrorBars


TChartErrorBars.CustomValuesMinus Property | FlexCel Studio for the .NET Framework documentation

TChartErrorBars.CustomValuesMinus Property

Returns the formula values used for a custom error bar for the - values.

Syntax

Namespace: FlexCel.Core

public Object[] CustomValuesMinus { get; }

See also

  • TChartErrorBars


TChartFrameOptions Class | FlexCel Studio for the .NET Framework documentation

TChartFrameOptions Class

Description of a box, its coordinates, fill style and line style.

Syntax

Namespace: FlexCel.Core

public class TChartFrameOptions: ICloneable

Constructors

Name Description
TChartFrameOptions Overloaded
 TChartFrameOptions(ChartLineOptions, ChartFillOptions, Boolean)
TChartFrameOptions(Nullable<TDrawingColor>, Nullable<Int32>, Nullable<TDrawingColor>, Boolean)

Methods

Name | Description
Clone | Returns a deep copy of this object.

Properties

Name | Description
FillOptions | Fill options for the frame.
LineOptions | Line options for the frame.
RoundedCorners | If true, the chart frame will have rounded corners. Note that this value doesn't apply in most places. One of the only places where you can actually have rounded corners is in the frame about the chart itself.
XlsxMode | If true, the chart was created by an xlsx-capable Excel version (2007 or newer) and so has different defaults. For example, it will have different automatic colors for the series.


TChartFrameOptions.TChartFrameOptions Constructor | FlexCel Studio for the .NET Framework documentation

TChartFrameOptions.TChartFrameOptions Constructor

Overloads

  • TChartFrameOptions.TChartFrameOptions(ChartLineOptions, ChartFillOptions, Boolean)
  • TChartFrameOptions.TChartFrameOptions(Nullable<TDrawingColor>, Nullable<Int32>, Nullable<TDrawingColor>, Boolean)

TChartFrameOptions.TChartFrameOptions(ChartLineOptions, ChartFillOptions, Boolean)

Creates a new TChartFrameOptions instance.

Syntax

Namespace: FlexCel.Core

public TChartFrameOptions(ChartLineOptions aLineOptions, ChartFillOptions aFillOptions, Boolean aRoundedCorners)

Parameters

<-> | Parameter | Type | Description
 | aLineOptions | ChartLineOptions | See LineOptions
 | aFillOptions | ChartFillOptions | See FillOptions
 | aRoundedCorners | Boolean | See RoundedCorners

See also

  • TChartFrameOptions

TChartFrameOptions.TChartFrameOptions(Nullable<TDrawingColor>, Nullable<Int32>, Nullable<TDrawingColor>, Boolean)

This is a convenience constructor to easily create the most common options which are a solid fill and line.

Syntax

Namespace: FlexCel.Core

public TChartFrameOptions(Nullable<TDrawingColor> aLineColor, Nullable<Int32> aLineWidth, Nullable<TDrawingColor> aFillColor, Boolean aRoundedCorners)

Parameters

<-> | Parameter | Type | Description
 | aLineColor | Nullable<TDrawingColor> | Color for the line. If null, no line will be used.
 | aLineWidth | Nullable<Int32> | Width of the line in EMUs (1 pt = 12700 EMUs). If null, width of the theme will be used.
 | aFillColor | Nullable<TDrawingColor> | Color for the fill. If null, no fill will be used.
 | aRoundedCorners | Boolean |

See also

  • TChartFrameOptions


TChartFrameOptions.Clone Method | FlexCel Studio for the .NET Framework documentation

TChartFrameOptions.Clone Method

Returns a deep copy of this object.

Syntax

Namespace: FlexCel.Core

public Object Clone()

See also

  • TChartFrameOptions


TChartFrameOptions.FillOptions Property | FlexCel Studio for the .NET Framework documentation

TChartFrameOptions.FillOptions Property

Fill options for the frame.

Syntax

Namespace: FlexCel.Core

public ChartFillOptions FillOptions { get; set; }

See also

  • TChartFrameOptions


TChartFrameOptions.LineOptions Property | FlexCel Studio for the .NET Framework documentation

TChartFrameOptions.LineOptions Property

Line options for the frame.

Syntax

Namespace: FlexCel.Core

public ChartLineOptions LineOptions { get; set; }

See also

  • TChartFrameOptions


TChartFrameOptions.RoundedCorners Property | FlexCel Studio for the .NET Framework documentation

TChartFrameOptions.RoundedCorners Property

If true, the chart frame will have rounded corners. Note that this value doesn't apply in most places. One of the only places where you can actually have rounded corners is in the frame about the chart itself.

Syntax

Namespace: FlexCel.Core

public Boolean RoundedCorners { get; set; }

See also

  • TChartFrameOptions


TChartFrameOptions.XlsxMode Property | FlexCel Studio for the .NET Framework documentation

TChartFrameOptions.XlsxMode Property

If true, the chart was created by an xlsx-capable Excel version (2007 or newer) and so has different defaults. For example, it will have different automatic colors for the series.

Syntax

Namespace: FlexCel.Core

public Boolean XlsxMode { get; set; }

See also

  • TChartFrameOptions


TChartLegend Class | FlexCel Studio for the .NET Framework documentation

TChartLegend Class

Description of the chart's legend box.

Syntax

Namespace: FlexCel.Core

public class TChartLegend: ICloneable

Constructors

Name Description
TChartLegend Overloaded
 TChartLegend(TChartLegendPlacement, Boolean, TChartFrameOptions, TChartTextOptions, Nullable<TChartRelativeRectangle>)
TChartLegend(TChartLegendPlacement, Boolean, TChartFrameOptions, TChartTextOptions, TChartRelativeRectangle, Nullable<TChartRelativeRectangle>)

Methods

Name | Description
Clone | Returns a deep copy of this object.

Properties

Name | Description
Placement | Placement of the legend inside of the chart. Note that newer Excel versions might report a non docked placement even if the legend is docked to a side. You need to check CanOverlapWithChart to see if the legend is docked, and then look at the side it is to see if it is docked to the left, top, etc.
CanOverlapWithChart | If true, the chart can overlap the legend. Note that if Placement is different from TChartLegend​Placement.​Not​Docked then CanOverlapWithChart will be false. But even if not docked, this value can still be false as newer Excel versions allow you to specify this property on its own.
Frame | Line and fill style options for the frame.
TextOptions | Global font options for the legend labels.
Position | Coordinates of the legend in percent (0 to 1) assuming no margins on the chart area. If PositionZeroBased is not null, it must be used instead. Note that for setting options, this value is ignored and PositionZeroBased is used instead.
PositionZeroBased | Coordinates of the legend in percent (0 to 1) assuming no margins on the chart area. If this value is null Position must be used instead.


TChartLegend.TChartLegend Constructor | FlexCel Studio for the .NET Framework documentation

TChartLegend.TChartLegend Constructor

Overloads

  • TChartLegend.TChartLegend(TChartLegendPlacement, Boolean, TChartFrameOptions, TChartTextOptions, Nullable<TChartRelativeRectangle>)
  • TChartLegend.TChartLegend(TChartLegendPlacement, Boolean, TChartFrameOptions, TChartTextOptions, TChartRelativeRectangle, Nullable<TChartRelativeRectangle>)

TChartLegend.TChartLegend(TChartLegendPlacement, Boolean, TChartFrameOptions, TChartTextOptions, Nullable<TChartRelativeRectangle>)

Creates a new TChartLegend instance.

Syntax

Namespace: FlexCel.Core

public TChartLegend(TChartLegendPlacement aPlacement, Boolean aCanOverlapWithChart, TChartFrameOptions aFrame, TChartTextOptions aTextOptions, Nullable<TChartRelativeRectangle> aPositionZeroBased)

Parameters

<-> | Parameter | Type | Description
 | aPlacement | TChartLegend​Placement | See Placement
 | aCanOverlapWithChart | Boolean | See CanOverlapWithChart
 | aFrame | TChartFrameOptions | See Frame
 | aTextOptions | TChartTextOptions | See TextOptions
 | aPositionZeroBased | Nullable<TChartRelative​Rectangle> | See PositionZeroBased

See also

  • TChartLegend

TChartLegend.TChartLegend(TChartLegendPlacement, Boolean, TChartFrameOptions, TChartTextOptions, TChartRelativeRectangle, Nullable<TChartRelativeRectangle>)

Creates a new TChartLegend instance.

Syntax

Namespace: FlexCel.Core

public TChartLegend(TChartLegendPlacement aPlacement, Boolean aCanOverlapWithChart, TChartFrameOptions aFrame, TChartTextOptions aTextOptions, TChartRelativeRectangle aPosition, Nullable<TChartRelativeRectangle> aPositionZeroBased)

Parameters

<-> | Parameter | Type | Description
 | aPlacement | TChartLegend​Placement | See Placement
 | aCanOverlapWithChart | Boolean | See CanOverlapWithChart
 | aFrame | TChartFrameOptions | See Frame
 | aTextOptions | TChartTextOptions | See TextOptions
 | aPosition | TChartRelative​Rectangle | See Position
 | aPositionZeroBased | Nullable<TChartRelative​Rectangle> | See PositionZeroBased

See also

  • TChartLegend


TChartLegend.Clone Method | FlexCel Studio for the .NET Framework documentation

TChartLegend.Clone Method

Returns a deep copy of this object.

Syntax

Namespace: FlexCel.Core

public Object Clone()

See also

  • TChartLegend


TChartLegend.Placement Property | FlexCel Studio for the .NET Framework documentation

TChartLegend.Placement Property

Placement of the legend inside of the chart. Note that newer Excel versions might report a non docked placement even if the legend is docked to a side. You need to check CanOverlapWithChart to see if the legend is docked, and then look at the side it is to see if it is docked to the left, top, etc.

Syntax

Namespace: FlexCel.Core

public TChartLegendPlacement Placement { get; set; }

See also

  • TChartLegend


TChartLegend.CanOverlapWithChart Property | FlexCel Studio for the .NET Framework documentation

TChartLegend.CanOverlapWithChart Property

If true, the chart can overlap the legend. Note that if Placement is different from TChartLegendPlacement.NotDocked then CanOverlapWithChart will be false. But even if not docked, this value can still be false as newer Excel versions allow you to specify this property on its own.

Syntax

Namespace: FlexCel.Core

public Boolean CanOverlapWithChart { get; set; }

See also

  • TChartLegend


TChartLegend.Frame Property | FlexCel Studio for the .NET Framework documentation

TChartLegend.Frame Property

Line and fill style options for the frame.

Syntax

Namespace: FlexCel.Core

public TChartFrameOptions Frame { get; set; }

See also

  • TChartLegend


TChartLegend.TextOptions Property | FlexCel Studio for the .NET Framework documentation

TChartLegend.TextOptions Property

Global font options for the legend labels.

Syntax

Namespace: FlexCel.Core

public TChartTextOptions TextOptions { get; set; }

See also

  • TChartLegend


TChartLegend.Position Property | FlexCel Studio for the .NET Framework documentation

TChartLegend.Position Property

Coordinates of the legend in percent (0 to 1) assuming no margins on the chart area. If PositionZeroBased is not null, it must be used instead. Note that for setting options, this value is ignored and PositionZeroBased is used instead.

Syntax

Namespace: FlexCel.Core

public TChartRelativeRectangle Position { get; }

See also

  • TChartLegend


TChartLegend.PositionZeroBased Property | FlexCel Studio for the .NET Framework documentation

TChartLegend.PositionZeroBased Property

Coordinates of the legend in percent (0 to 1) assuming no margins on the chart area. If this value is null Position must be used instead.

Syntax

Namespace: FlexCel.Core

public Nullable<TChartRelativeRectangle> PositionZeroBased { get; }

See also

  • TChartLegend


TChartOneDropBar Class | FlexCel Studio for the .NET Framework documentation

TChartOneDropBar Class

Information about one specific drop bar.

Syntax

Namespace: FlexCel.Core

public class TChartOneDropBar: ICloneable

Constructors

Name | Description
TChartOneDropBar | Creates a new instance.

Methods

Name | Description
Clone | Returns a deep copy of this object.

Properties

Name | Description
Frame | Properties for the drop bar.
GapWidth | Gap width on percent.(100 means 100%)


TChartOneDropBar.TChartOneDropBar Constructor | FlexCel Studio for the .NET Framework documentation

TChartOneDropBar.TChartOneDropBar Constructor

Creates a new instance.

Syntax

Namespace: FlexCel.Core

public TChartOneDropBar(TChartFrameOptions aFrame, Int32 aGapWidth)

Parameters

<-> | Parameter | Type | Description
 | aFrame | TChartFrameOptions | See Frame
 | aGapWidth | Int32 | See GapWidth

See also

  • TChartOneDropBar


TChartOneDropBar.Clone Method | FlexCel Studio for the .NET Framework documentation

TChartOneDropBar.Clone Method

Returns a deep copy of this object.

Syntax

Namespace: FlexCel.Core

public Object Clone()

See also

  • TChartOneDropBar


TChartOneDropBar.Frame Property | FlexCel Studio for the .NET Framework documentation

TChartOneDropBar.Frame Property

Properties for the drop bar.

Syntax

Namespace: FlexCel.Core

public TChartFrameOptions Frame { get; set; }

See also

  • TChartOneDropBar


TChartOneDropBar.GapWidth Property | FlexCel Studio for the .NET Framework documentation

TChartOneDropBar.GapWidth Property

Gap width on percent.(100 means 100%)

Syntax

Namespace: FlexCel.Core

public Int32 GapWidth { get; set; }

See also

  • TChartOneDropBar


TChartOptions Class | FlexCel Studio for the .NET Framework documentation

TChartOptions Class

Base class for options specific to the type of chart.

Syntax

Namespace: FlexCel.Core

public abstract class TChartOptions: IComparable, IComparable<TChartOptions>

Constructors

Name | Description
TChartOptions | Creates a new TChartOptions instance.

Methods

Name | Description
IsStacked | Returns true is the chart is stacked, either normally or 100% stacked.
CompareTo | Orders the chart options depending on their z-order.
Equals | Returns true if both objects are equal.
GetHashCode | Returns a hashcode for the object.

Operators

Name | Description
Equality | Returns true if both objects are equal. Note this is for backwards compatibility, this is a class and not immutable, so this method should return true if references are different. But that would break old code.
Inequality | Returns true if both objects do not have the same value. Note this is for backwards compatibility, this is a class and not immutable, so this method should return true if references are different. But that would break old code.
GreaterThan | Returns true if o1 is bigger than o2.
LessThan | Returns true if o1 is less than o2.

Properties

Name | Description
ChartType | Chart Type.
ChangeColors​OnEach​Series | If false, all series will be the same color.
ZOrder | Z-Order of this chart group, with 0 being the bottom. Chart groups with lower z-Order are drawn below the ones with higher ones.
AxisNumber | Axis where this chart group belongs, 0 is primary, 1 is secondary. In xlsx files it is not used, since the primary or secondary axis is given by the subchart where the series is.
SeriesOptions | Global options for all the series on this chart group.
DefaultLabel | Default label properties for this group of charts.


TChartOptions.TChartOptions Constructor | FlexCel Studio for the .NET Framework documentation

TChartOptions.TChartOptions Constructor

Creates a new TChartOptions instance.

Syntax

Namespace: FlexCel.Core

protected TChartOptions(TChartType aChartType, Boolean aChangeColorsOnEachSeries, Int32 aZOrder, Int32 aAxisNumber, ChartSeriesOptions aSeriesOptions, TDataLabel aDefaultLabel)

Parameters

<-> | Parameter | Type | Description
 | aChartType | TChartType | Type of the chart.
 | aChangeColorsOnEachSeries | Boolean | If false, all series will be the same color.
 | aZOrder | Int32 | Z-Order of this chart group, with 0 being the bottom. Chart groups with lower z-Order are drawn below the ones with higher ones.
 | aAxisNumber | Int32 | Axis where this chart group belongs, 0 is primary, 1 is secondary.
 | aSeriesOptions | ChartSeriesOptions | Global options that apply to all the series on this group. This instance will be copied.
 | aDefaultLabel | TDataLabel | Default label properties for labels on this series group.

See also

  • TChartOptions


TChartOptions.IsStacked Method | FlexCel Studio for the .NET Framework documentation

TChartOptions.IsStacked Method

Returns true is the chart is stacked, either normally or 100% stacked.

Syntax

Namespace: FlexCel.Core

public abstract Boolean IsStacked()

See also

  • TChartOptions


TChartOptions.CompareTo Method | FlexCel Studio for the .NET Framework documentation

TChartOptions.CompareTo Method

Orders the chart options depending on their z-order.

Syntax

Namespace: FlexCel.Core

public Int32 CompareTo(TChartOptions obj)

Parameters

<-> | Parameter | Type | Description
 | obj | TChartOptions | Object to compare to.

Returns

-1, 0 or 1 depending if the series has a bigger z-order than obj.

See also

  • TChartOptions


TChartOptions.Equals Method | FlexCel Studio for the .NET Framework documentation

TChartOptions.Equals Method

Returns true if both objects are equal.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TChartOptions


TChartOptions.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TChartOptions.GetHashCode Method

Returns a hashcode for the object.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TChartOptions


TChartOptions.Equality Operator | FlexCel Studio for the .NET Framework documentation

TChartOptions.Equality Operator

Returns true if both objects are equal. Note this is for backwards compatibility, this is a class and not immutable, so this method should return true if references are different. But that would break old code.

Syntax

Namespace: FlexCel.Core

public static Boolean op_Equality(TChartOptions o1, TChartOptions o2)

Parameters

<-> | Parameter | Type | Description
 | o1 | TChartOptions |
 | o2 | TChartOptions |

See also

  • TChartOptions


TChartOptions.Inequality Operator | FlexCel Studio for the .NET Framework documentation

TChartOptions.Inequality Operator

Returns true if both objects do not have the same value. Note this is for backwards compatibility, this is a class and not immutable, so this method should return true if references are different. But that would break old code.

Syntax

Namespace: FlexCel.Core

public static Boolean op_Inequality(TChartOptions s1, TChartOptions s2)

Parameters

<-> | Parameter | Type | Description
 | s1 | TChartOptions |
 | s2 | TChartOptions |

See also

  • TChartOptions


TChartOptions.GreaterThan Operator | FlexCel Studio for the .NET Framework documentation

TChartOptions.GreaterThan Operator

Returns true if o1 is bigger than o2.

Syntax

Namespace: FlexCel.Core

public static Boolean op_GreaterThan(TChartOptions o1, TChartOptions o2)

Parameters

<-> | Parameter | Type | Description
 | o1 | TChartOptions |
 | o2 | TChartOptions |

See also

  • TChartOptions


TChartOptions.LessThan Operator | FlexCel Studio for the .NET Framework documentation

TChartOptions.LessThan Operator

Returns true if o1 is less than o2.

Syntax

Namespace: FlexCel.Core

public static Boolean op_LessThan(TChartOptions o1, TChartOptions o2)

Parameters

<-> | Parameter | Type | Description
 | o1 | TChartOptions |
 | o2 | TChartOptions |

See also

  • TChartOptions


TChartOptions.ChartType Property | FlexCel Studio for the .NET Framework documentation

TChartOptions.ChartType Property

Chart Type.

Syntax

Namespace: FlexCel.Core

public TChartType ChartType { get; }

See also

  • TChartOptions


TChartOptions.ChangeColorsOnEachSeries Property | FlexCel Studio for the .NET Framework documentation

TChartOptions.ChangeColorsOnEachSeries Property

If false, all series will be the same color.

Syntax

Namespace: FlexCel.Core

public Boolean ChangeColorsOnEachSeries { get; set; }

See also

  • TChartOptions


TChartOptions.ZOrder Property | FlexCel Studio for the .NET Framework documentation

TChartOptions.ZOrder Property

Z-Order of this chart group, with 0 being the bottom. Chart groups with lower z-Order are drawn below the ones with higher ones.

Syntax

Namespace: FlexCel.Core

public Int32 ZOrder { get; set; }

See also

  • TChartOptions


TChartOptions.AxisNumber Property | FlexCel Studio for the .NET Framework documentation

TChartOptions.AxisNumber Property

Axis where this chart group belongs, 0 is primary, 1 is secondary. In xlsx files it is not used, since the primary or secondary axis is given by the subchart where the series is.

Syntax

Namespace: FlexCel.Core

public Int32 AxisNumber { get; set; }

See also

  • TChartOptions


TChartOptions.SeriesOptions Property | FlexCel Studio for the .NET Framework documentation

TChartOptions.SeriesOptions Property

Global options for all the series on this chart group.

Syntax

Namespace: FlexCel.Core

public ChartSeriesOptions SeriesOptions { get; set; }

See also

  • TChartOptions


TChartOptions.DefaultLabel Property | FlexCel Studio for the .NET Framework documentation

TChartOptions.DefaultLabel Property

Default label properties for this group of charts.

Syntax

Namespace: FlexCel.Core

public TDataLabel DefaultLabel { get; set; }

See also

  • TChartOptions


TChartPlotArea Class | FlexCel Studio for the .NET Framework documentation

TChartPlotArea Class

Line and fill styles for the Plot Area.

Syntax

Namespace: FlexCel.Core

public class TChartPlotArea: ICloneable

Constructors

Name | Description
TChartPlotArea | Creates a new PlotArea instance.

Methods

Name | Description
Clone | Returns a deep copy of this object.

Properties

Name | Description
ChartFrameOptions | Line and fill style for this PlotArea.
Position | Position of the plot area in the chart.
LayoutAsExcel2003 | When this property is true, this file was saved with Excel 2003 or older, and the layout of the chart is different. FlexCel uses this property to correctly render charts saved with Excel versions newer or older than Excel 2003. Note that for xlsx files this property is always false, but for charts in xls files it depends on what version of Excel was used to create the file.
CalculatedPosition | Returns the position that was last calculated by Excel, if that was saved in the file. Note that only xls files save the last calculated position, so in xlsx files this value will be empty.


TChartPlotArea.TChartPlotArea Constructor | FlexCel Studio for the .NET Framework documentation

TChartPlotArea.TChartPlotArea Constructor

Creates a new PlotArea instance.

Syntax

Namespace: FlexCel.Core

public TChartPlotArea(TChartFrameOptions aChartFrameOptions, TChartPlotAreaPosition aPosition, Boolean aLayoutAsExcel2003)

Parameters

<-> | Parameter | Type | Description
 | aChartFrameOptions | TChartFrameOptions | See ChartFrameOptions
 | aPosition | TChartPlotArea​Position | See Position
 | aLayoutAsExcel2003 | Boolean | See LayoutAsExcel2003

See also

  • TChartPlotArea


TChartPlotArea.Clone Method | FlexCel Studio for the .NET Framework documentation

TChartPlotArea.Clone Method

Returns a deep copy of this object.

Syntax

Namespace: FlexCel.Core

public Object Clone()

See also

  • TChartPlotArea


TChartPlotArea.ChartFrameOptions Property | FlexCel Studio for the .NET Framework documentation

TChartPlotArea.ChartFrameOptions Property

Line and fill style for this PlotArea.

Syntax

Namespace: FlexCel.Core

public TChartFrameOptions ChartFrameOptions { get; set; }

See also

  • TChartPlotArea


TChartPlotArea.Position Property | FlexCel Studio for the .NET Framework documentation

TChartPlotArea.Position Property

Position of the plot area in the chart.

Syntax

Namespace: FlexCel.Core

public TChartPlotAreaPosition Position { get; set; }

See also

  • TChartPlotArea


TChartPlotArea.LayoutAsExcel2003 Property | FlexCel Studio for the .NET Framework documentation

TChartPlotArea.LayoutAsExcel2003 Property

When this property is true, this file was saved with Excel 2003 or older, and the layout of the chart is different. FlexCel uses this property to correctly render charts saved with Excel versions newer or older than Excel 2003. Note that for xlsx files this property is always false, but for charts in xls files it depends on what version of Excel was used to create the file.

Syntax

Namespace: FlexCel.Core

public Boolean LayoutAsExcel2003 { get; set; }

See also

  • TChartPlotArea


TChartPlotArea.CalculatedPosition Property | FlexCel Studio for the .NET Framework documentation

TChartPlotArea.CalculatedPosition Property

Returns the position that was last calculated by Excel, if that was saved in the file. Note that only xls files save the last calculated position, so in xlsx files this value will be empty.

Syntax

Namespace: FlexCel.Core

public TChartRelativeRectangle CalculatedPosition { get; set; }

See also

  • TChartPlotArea


TChartTextOptions Class | FlexCel Studio for the .NET Framework documentation

TChartTextOptions Class

Options for text inside the chart.

Syntax

Namespace: FlexCel.Core

public class TChartTextOptions: ICloneable

Constructors

Name | Description
TChartTextOptions | Overloaded TChartTextOptions TChartTextOptions(TFlxChartFont, THFlxAlignment, TVFlxAlignment, TBackgroundMode, ChartFillOptions)

Methods

Name | Description
Clone | Returns a deep copy of the object.

Properties

Name | Description
Font | Font style for the text.
TextColor | Color of the text.
BackgroundMode | Background mode, transparent or opaque.
HAlign | Horizontal alignment for the text.
VAlign | Vertical alignment for the text.
Rotation | Text Rotation in degrees. When this value is from 0 to 90 then this is the rotation degrees in the up direction. When this value is from 91 to 180 then this is a rotation in the down direction. 91 means -1 degree rotation, 92 means -2 degrees, and so on until 180 which means -90 degrees. 255 is vertical text. Other values are invalid. If null, then it is not set.


TChartTextOptions.TChartTextOptions Constructor | FlexCel Studio for the .NET Framework documentation

TChartTextOptions.TChartTextOptions Constructor

Overloads

  • TChartTextOptions.TChartTextOptions
  • TChartTextOptions.TChartTextOptions(TFlxChartFont, THFlxAlignment, TVFlxAlignment, TBackgroundMode, ChartFillOptions)

TChartTextOptions.TChartTextOptions

Creates an empty TChartTextOptions.

Syntax

Namespace: FlexCel.Core

public TChartTextOptions()

See also

  • TChartTextOptions

TChartTextOptions.TChartTextOptions(TFlxChartFont, THFlxAlignment, TVFlxAlignment, TBackgroundMode, ChartFillOptions)

Creates a new ChartTextOptions.

Syntax

Namespace: FlexCel.Core

public TChartTextOptions(TFlxChartFont aFont, THFlxAlignment aHAlign, TVFlxAlignment aVAlign, TBackgroundMode aBackgroundMode, ChartFillOptions aTextColor)

Parameters

<-> | Parameter | Type | Description
 | aFont | TFlxChartFont |
 | aHAlign | THFlxAlignment |
 | aVAlign | TVFlxAlignment |
 | aBackgroundMode | TBackgroundMode |
 | aTextColor | ChartFillOptions |

See also

  • TChartTextOptions


TChartTextOptions.Clone Method | FlexCel Studio for the .NET Framework documentation

TChartTextOptions.Clone Method

Returns a deep copy of the object.

Syntax

Namespace: FlexCel.Core

public Object Clone()

See also

  • TChartTextOptions


TChartTextOptions.Font Property | FlexCel Studio for the .NET Framework documentation

TChartTextOptions.Font Property

Font style for the text.

Syntax

Namespace: FlexCel.Core

public TFlxChartFont Font { get; set; }

See also

  • TChartTextOptions


TChartTextOptions.TextColor Property | FlexCel Studio for the .NET Framework documentation

TChartTextOptions.TextColor Property

Color of the text.

Syntax

Namespace: FlexCel.Core

public ChartFillOptions TextColor { get; set; }

See also

  • TChartTextOptions


TChartTextOptions.BackgroundMode Property | FlexCel Studio for the .NET Framework documentation

TChartTextOptions.BackgroundMode Property

Background mode, transparent or opaque.

Syntax

Namespace: FlexCel.Core

public TBackgroundMode BackgroundMode { get; set; }

See also

  • TChartTextOptions


TChartTextOptions.HAlign Property | FlexCel Studio for the .NET Framework documentation

TChartTextOptions.HAlign Property

Horizontal alignment for the text.

Syntax

Namespace: FlexCel.Core

public THFlxAlignment HAlign { get; set; }

See also

  • TChartTextOptions


TChartTextOptions.VAlign Property | FlexCel Studio for the .NET Framework documentation

TChartTextOptions.VAlign Property

Vertical alignment for the text.

Syntax

Namespace: FlexCel.Core

public TVFlxAlignment VAlign { get; set; }

See also

  • TChartTextOptions


TChartTextOptions.Rotation Property | FlexCel Studio for the .NET Framework documentation

TChartTextOptions.Rotation Property

Text Rotation in degrees.

When this value is from 0 to 90 then this is the rotation degrees in the up direction.

When this value is from 91 to 180 then this is a rotation in the down direction. 91 means -1 degree rotation, 92 means -2 degrees, and so on until 180 which means -90 degrees.

255 is vertical text.

Other values are invalid. If null, then it is not set.

Syntax

Namespace: FlexCel.Core

public Nullable<Int32> Rotation { get; set; }

See also

  • TChartTextOptions


TChartTitle Class | FlexCel Studio for the .NET Framework documentation

TChartTitle Class

Represents the title of the chart.

Syntax

Namespace: FlexCel.Core

public class TChartTitle


TChartTrendline Class | FlexCel Studio for the .NET Framework documentation

TChartTrendline Class

This class holds a definition for a trendline.

Syntax

Namespace: FlexCel.Core

public class TChartTrendline

Properties

Name | Description
Name | Name for the trendline. Make it null to make it automatic.
LineOptions | Properties of the line, like the color or width.
TrendlineType | Type of trendline.
Order | Integer between 2 and 6 indicating the order of the polynomial. This property only applies if the TrendlineType is TChartTrendline​Type.​Polynomial.
Period | Period for the moving average. This property only applies if the TrendlineType is TChartTrendline​Type.​Moving​Average.
Forward | The number of categories (or units on a scatter chart) that the trendline extends after the data for the series. This number must be bigger or equal to 0
Backward | The number of categories (or units on a scatter chart) that the trendline extends before the data for the series. If the chart is not scattered, this value must be 0 or 0.5.
Intercept | This property sets where the trendline crosses the x-axis. If null, the crossing point will be automatically calculated. Only applies for see cref=​"Trendline​Type"​/> of TChartTrendline​Type.​Exponential, TChartTrendline​Type.​Linear or TChartTrendline​Type.​Polynomial
DisplayEquation | Determines if the trendline equation is displayed on the chart.
DisplayRSquared | Determines if the value of R-squared is displayed on the chart.
LineLabel | Determines if the value of R-squared is displayed on the chart.


TChartTrendline.Name Property | FlexCel Studio for the .NET Framework documentation

TChartTrendline.Name Property

Name for the trendline. Make it null to make it automatic.

Syntax

Namespace: FlexCel.Core

public String Name { get; set; }

See also

  • TChartTrendline


TChartTrendline.LineOptions Property | FlexCel Studio for the .NET Framework documentation

TChartTrendline.LineOptions Property

Properties of the line, like the color or width.

Syntax

Namespace: FlexCel.Core

public ChartLineOptions LineOptions { get; set; }

See also

  • TChartTrendline


TChartTrendline.TrendlineType Property | FlexCel Studio for the .NET Framework documentation

TChartTrendline.TrendlineType Property

Type of trendline.

Syntax

Namespace: FlexCel.Core

public TChartTrendlineType TrendlineType { get; set; }

See also

  • TChartTrendline


TChartTrendline.Order Property | FlexCel Studio for the .NET Framework documentation

TChartTrendline.Order Property

Integer between 2 and 6 indicating the order of the polynomial. This property only applies if the TrendlineType is TChartTrendlineType.Polynomial.

Syntax

Namespace: FlexCel.Core

public Int32 Order { get; set; }

See also

  • TChartTrendline


TChartTrendline.Period Property | FlexCel Studio for the .NET Framework documentation

TChartTrendline.Period Property

Period for the moving average. This property only applies if the TrendlineType is TChartTrendlineType.MovingAverage.

Syntax

Namespace: FlexCel.Core

public Int64 Period { get; set; }

See also

  • TChartTrendline


TChartTrendline.Forward Property | FlexCel Studio for the .NET Framework documentation

TChartTrendline.Forward Property

The number of categories (or units on a scatter chart) that the trendline extends after the data for the series. This number must be bigger or equal to 0

Syntax

Namespace: FlexCel.Core

public Double Forward { get; set; }

See also

  • TChartTrendline


TChartTrendline.Backward Property | FlexCel Studio for the .NET Framework documentation

TChartTrendline.Backward Property

The number of categories (or units on a scatter chart) that the trendline extends before the data for the series. If the chart is not scattered, this value must be 0 or 0.5.

Syntax

Namespace: FlexCel.Core

public Double Backward { get; set; }

See also

  • TChartTrendline


TChartTrendline.Intercept Property | FlexCel Studio for the .NET Framework documentation

TChartTrendline.Intercept Property

This property sets where the trendline crosses the x-axis. If null, the crossing point will be automatically calculated. Only applies for see cref="TrendlineType"/> of TChartTrendlineType.Exponential, TChartTrendlineType.Linear or TChartTrendlineType.Polynomial

Syntax

Namespace: FlexCel.Core

public Nullable<Double> Intercept { get; set; }

See also

  • TChartTrendline


TChartTrendline.DisplayEquation Property | FlexCel Studio for the .NET Framework documentation

TChartTrendline.DisplayEquation Property

Determines if the trendline equation is displayed on the chart.

Syntax

Namespace: FlexCel.Core

public Boolean DisplayEquation { get; set; }

See also

  • TChartTrendline


TChartTrendline.DisplayRSquared Property | FlexCel Studio for the .NET Framework documentation

TChartTrendline.DisplayRSquared Property

Determines if the value of R-squared is displayed on the chart.

Syntax

Namespace: FlexCel.Core

public Boolean DisplayRSquared { get; set; }

See also

  • TChartTrendline


TChartTrendline.LineLabel Property | FlexCel Studio for the .NET Framework documentation

TChartTrendline.LineLabel Property

Determines if the value of R-squared is displayed on the chart.

Syntax

Namespace: FlexCel.Core

public TChartTrendlineLabel LineLabel { get; set; }

See also

  • TChartTrendline


TChartTrendlineLabel Class | FlexCel Studio for the .NET Framework documentation

TChartTrendlineLabel Class

Properties for a label in a trendline.

Syntax

Namespace: FlexCel.Core

public class TChartTrendlineLabel

Methods

Name | Description
Clone | Returns a deep copy of the trendline label.

Properties

Name | Description
Layout | Box surrounding the label.
FormatCode | Format for the label.
SourceLinked | If true, the format of the source is linked to the label.


TChartTrendlineLabel.Clone Method | FlexCel Studio for the .NET Framework documentation

TChartTrendlineLabel.Clone Method

Returns a deep copy of the trendline label.

Syntax

Namespace: FlexCel.Core

public TChartTrendlineLabel Clone()

See also

  • TChartTrendlineLabel


TChartTrendlineLabel.Layout Property | FlexCel Studio for the .NET Framework documentation

TChartTrendlineLabel.Layout Property

Box surrounding the label.

Syntax

Namespace: FlexCel.Core

public TChartRelativeRectangle Layout { get; set; }

See also

  • TChartTrendlineLabel


TChartTrendlineLabel.FormatCode Property | FlexCel Studio for the .NET Framework documentation

TChartTrendlineLabel.FormatCode Property

Format for the label.

Syntax

Namespace: FlexCel.Core

public String FormatCode { get; set; }

See also

  • TChartTrendlineLabel


TChartTrendlineLabel.SourceLinked Property | FlexCel Studio for the .NET Framework documentation

TChartTrendlineLabel.SourceLinked Property

If true, the format of the source is linked to the label.

Syntax

Namespace: FlexCel.Core

public Boolean SourceLinked { get; set; }

See also

  • TChartTrendlineLabel


TChildAnchor Class | FlexCel Studio for the .NET Framework documentation

TChildAnchor Class

A class to hold the offsets relative to the parent on grouped shapes.

Syntax

Namespace: FlexCel.Core

public class TChildAnchor: ICloneable

Constructors

Name | Description
TChildAnchor | Overloaded TChildAnchor TChildAnchor(Double, Double, Double, Double)

Methods

Name | Description
Clone | Returns a deep copy of the Anchor.
EqualValues | Returns true if both instances of the objects contain the same values. Instances might be different, this method will return if their values are equal. Instances can be null.
Equals | Returns true if both objects have the same data.
GetHashCode | Returns the hashcode for the object.

Properties

Name | Description
Dx1 | Offset from the left on the parent, on percent of the total width of the parent.
Dy1 | Offset from the top on the parent, on percent of the total height of the parent.
Dx2 | Right coordinate of the box, in percent of the total width of the parent.
Dy2 | Bottom coordinate of the box, in percent of the total height of the parent.


TChildAnchor.TChildAnchor Constructor | FlexCel Studio for the .NET Framework documentation

TChildAnchor.TChildAnchor Constructor

Overloads

  • TChildAnchor.TChildAnchor
  • TChildAnchor.TChildAnchor(Double, Double, Double, Double)

TChildAnchor.TChildAnchor

Creates a new empty instance.

Syntax

Namespace: FlexCel.Core

public TChildAnchor()

See also

  • TChildAnchor

TChildAnchor.TChildAnchor(Double, Double, Double, Double)

Creates an instance with the defined values.

Syntax

Namespace: FlexCel.Core

public TChildAnchor(Double aDx1, Double aDy1, Double aDx2, Double aDy2)

Parameters

<-> | Parameter | Type | Description
 | aDx1 | Double |
 | aDy1 | Double |
 | aDx2 | Double |
 | aDy2 | Double |

See also

  • TChildAnchor


TChildAnchor.Clone Method | FlexCel Studio for the .NET Framework documentation

TChildAnchor.Clone Method

Returns a deep copy of the Anchor.

Syntax

Namespace: FlexCel.Core

public Object Clone()

See also

  • TChildAnchor


TChildAnchor.EqualValues Method | FlexCel Studio for the .NET Framework documentation

TChildAnchor.EqualValues Method

Returns true if both instances of the objects contain the same values. Instances might be different, this method will return if their values are equal. Instances can be null.

Syntax

Namespace: FlexCel.Core

public static Boolean EqualValues(TChildAnchor a1, TChildAnchor a2)

Parameters

<-> | Parameter | Type | Description
 | a1 | TChildAnchor | First instance to compare.
 | a2 | TChildAnchor | Second instance to compare.

See also

  • TChildAnchor


TChildAnchor.Equals Method | FlexCel Studio for the .NET Framework documentation

TChildAnchor.Equals Method

Returns true if both objects have the same data.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TChildAnchor


TChildAnchor.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TChildAnchor.GetHashCode Method

Returns the hashcode for the object.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TChildAnchor


TChildAnchor.Dx1 Property | FlexCel Studio for the .NET Framework documentation

TChildAnchor.Dx1 Property

Offset from the left on the parent, on percent of the total width of the parent.

Syntax

Namespace: FlexCel.Core

public Double Dx1 { get; set; }

See also

  • TChildAnchor


TChildAnchor.Dy1 Property | FlexCel Studio for the .NET Framework documentation

TChildAnchor.Dy1 Property

Offset from the top on the parent, on percent of the total height of the parent.

Syntax

Namespace: FlexCel.Core

public Double Dy1 { get; set; }

See also

  • TChildAnchor


TChildAnchor.Dx2 Property | FlexCel Studio for the .NET Framework documentation

TChildAnchor.Dx2 Property

Right coordinate of the box, in percent of the total width of the parent.

Syntax

Namespace: FlexCel.Core

public Double Dx2 { get; set; }

See also

  • TChildAnchor


TChildAnchor.Dy2 Property | FlexCel Studio for the .NET Framework documentation

TChildAnchor.Dy2 Property

Bottom coordinate of the box, in percent of the total height of the parent.

Syntax

Namespace: FlexCel.Core

public Double Dy2 { get; set; }

See also

  • TChildAnchor


TClientAnchor Class | FlexCel Studio for the .NET Framework documentation

TClientAnchor Class

Image Anchor information.

Syntax

Namespace: FlexCel.Core

public class TClientAnchor: ICloneable

Constructors

Name Description
TClientAnchor Overloaded
 TClientAnchor
TClientAnchor(TFlxAnchorType, Int32, Int32, Int32, Int32, Int32, Int32, IRowColSize)
TClientAnchor(TFlxAnchorType, Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32)
TClientAnchor(Boolean, TFlxAnchorType, Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32)
TClientAnchor(TFlxAnchorType, Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32, IRowColSize)

Methods

Name | Description
CreateKeeping​Aspect​Ratio This method will create an anchor so the image keeps its aspect ratio, and it is contained inside the group of cells.
If you supply negative values for Col2 or Row2, then those values will be ignored. If you set Col2 negative, then this method will place the image between Row1 and Row2, and calculate Col2 so the image keeps its aspect ratio.
Similar if you set Row2 negative.
Inc | Returns a COPY of the anchor with rows and cols incremented by one
Dec | Returns a COPY of the anchor with rows and cols decremented by one
CalcImageCoords Overloaded
 CalcImageCoords(Double, Double, IRowColSize)
CalcImageCoords(Double, Double, Double, Double, IRowColSize)
CalcImageCoords​InPoints Calculates the width and height of the image in Points.
Dx1Pix Returns the offset of the object in resolution-​independent-​pixels (1/96 of an inch) from the left of the cell.
Dy1Pix Returns the offset of the object in resolution-​independent-​pixels (1/96 of an inch) from the top of the cell.
Dx2Pix Returns the offset of the object in resolution-​independent-​pixels (1/96 of an inch) from the left of the cell.
Dy2Pix Returns the offset of the object in resolution-​independent-​pixels (1/96 of an inch) from the top of the cell.
Dx1Points Returns the offset of the object in points from the left of the cell. This is used for display, and is not the exact conversion from Dx1Pix.
Dy1Points Returns the offset of the object in points from the top of the cell.
Dx2Points Returns the offset of the object in points from the left of the cell.
Dy2Points Returns the offset of the object in points from the top of the cell.
Clone | Creates a copy of the Anchor
EqualValues Returns true if both instances of the objects contain the same values. Instances might be different, this method will return if their values are equal. Instances can be null. This method is equivalent to TClientAnchor.​Equals(​a,​b)​, and kept for backwards compatibility.
Equals Returns true if both objects have the same data.
GetHashCode Returns the hash code for the object.
Contains Returns true if the target anchor is inside or equal to this one.
CalcChildRect Returns the coordinates of the shape when it is part of a group.

Properties

Name | Description
ChartCoords | If true, this object is inside a chart, and columns and rows range from 0 to 4000.
AnchorType | How the image behaves when copying/inserting cells.
Col1 | First column of object
Dx1 | Delta x of image, on 1/1024 of a cell. 0 means totally at the left, 512 on half of the cell, 1024 means at the left of next cell.
Row1 | First Row of object.
Dy1 | Delta y of image on 1/255 of a cell. 0 means totally at the top, 128 on half of the cell, 255 means at the top of next cell.
Col2 | Last column of object.
Dx2 | Delta x of image, on 1/1024 of a cell. 0 means totally at the left, 512 on half of the cell, 1024 means at the left of next cell.
Row2 | Last row of object.
Dy2 | Delta y of image on 1/255 of a cell. 0 means totally at the top, 128 on half of the cell, 255 means at the top of next cell.
ChildAnchor | Returns the offset on the parent system for the image, when it is grouped. For example, if the parent shape on the group is 100 px wide, and ChildAnchor has a dx of 0.5, the image starts 50px to the right of the parent. If the shape is not grouped or it is the shape on top of the group, ChildAnchor is null. When this member is not null, other values on ClientAnchor have no meaning.


TClientAnchor.TClientAnchor Constructor | FlexCel Studio for the .NET Framework documentation

TClientAnchor.TClientAnchor Constructor

Overloads

  • TClientAnchor.TClientAnchor
  • TClientAnchor.TClientAnchor(TFlxAnchorType, Int32, Int32, Int32, Int32, Int32, Int32, IRowColSize)
  • TClientAnchor.TClientAnchor(TFlxAnchorType, Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32)
  • TClientAnchor.TClientAnchor(Boolean, TFlxAnchorType, Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32)
  • TClientAnchor.TClientAnchor(TFlxAnchorType, Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32, IRowColSize)

TClientAnchor.TClientAnchor

Creates an Empty ClientAnchor.

Syntax

Namespace: FlexCel.Core

public TClientAnchor()

See also

  • TClientAnchor

TClientAnchor.TClientAnchor(TFlxAnchorType, Int32, Int32, Int32, Int32, Int32, Int32, IRowColSize)

Creates a new image based on the image size.

Syntax

Namespace: FlexCel.Core

public TClientAnchor(TFlxAnchorType aAnchorType, Int32 aRow1, Int32 aPixDy1, Int32 aCol1, Int32 aPixDx1, Int32 height, Int32 width, IRowColSize Workbook)

Parameters

<-> | Parameter | Type | Description
 | aAnchorType | TFlxAnchorType | How the image behaves when copying/inserting cells.
 | aRow1 | Int32 | Row where to insert the image.
 | aPixDy1 | Int32 | Delta in resolution-independent-pixels (1/96 of an inch) that the image is moved from aRow1.
 | aCol1 | Int32 | Column where to insert the image.
 | aPixDx1 | Int32 | Delta in resolution-independent-pixels (1/96 of an inch) that the image is moved from aCol1.
 | height | Int32 | Height in resolution-independent-pixels (1/96 of an inch).
 | width | Int32 | Width in resolution-independent-pixels (1/96 of an inch).
 | Workbook | IRowColSize | ExcelFile with the workbook, used to calculate the cells.

See also

  • TClientAnchor

TClientAnchor.TClientAnchor(TFlxAnchorType, Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32)

Creates a new ClientAnchor object, based on cell coords. Does not take in count actual image size.

Syntax

Namespace: FlexCel.Core

public TClientAnchor(TFlxAnchorType aAnchorType, Int32 aRow1, Int32 aDy1, Int32 aCol1, Int32 aDx1, Int32 aRow2, Int32 aDy2, Int32 aCol2, Int32 aDx2)

Parameters

<-> | Parameter | Type | Description
 | aAnchorType | TFlxAnchorType | How the image behaves when copying/inserting cells.
 | aRow1 | Int32 | First Row of object.
 | aDy1 | Int32 | Delta y of image on 1/255 of a cell. 0 means totally at the top, 128 on half of the cell, 255 means at the top of next cell.
 | aCol1 | Int32 | First column of object
 | aDx1 | Int32 | Delta x of image, on 1/1024 of a cell. 0 means totally at the left, 512 on half of the cell, 1024 means at the left of next cell.
 | aRow2 | Int32 | Last row of object.
 | aDy2 | Int32 | Delta y of image on 1/255 of a cell. 0 means totally at the top, 128 on half of the cell, 255 means at the top of next cell.
 | aCol2 | Int32 | Last column of object.
 | aDx2 | Int32 | Delta x of image, on 1/1024 of a cell. 0 means totally at the left, 512 on half of the cell, 1024 means at the left of next cell.

See also

  • TClientAnchor

TClientAnchor.TClientAnchor(Boolean, TFlxAnchorType, Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32)

Creates a new ClientAnchor object, based on cell coordinates. Ignores actual image size.

Syntax

Namespace: FlexCel.Core

public TClientAnchor(Boolean aChartCoords, TFlxAnchorType aAnchorType, Int32 aRow1, Int32 aDy1, Int32 aCol1, Int32 aDx1, Int32 aRow2, Int32 aDy2, Int32 aCol2, Int32 aDx2)

Parameters

<-> | Parameter | Type | Description
 | aChartCoords | Boolean | If true, the object is inside a chart and rows and columns range from 0 to 4000.
 | aAnchorType | TFlxAnchorType | How the image behaves when copying/inserting cells.
 | aRow1 | Int32 | First Row of object.
 | aDy1 | Int32 | Delta y of image on 1/255 of a cell. 0 means totally at the top, 128 on half of the cell, 255 means at the top of next cell.
 | aCol1 | Int32 | First column of object.
 | aDx1 | Int32 | Delta x of image, on 1/1024 of a cell. 0 means totally at the left, 512 on half of the cell, 1024 means at the left of next cell.
 | aRow2 | Int32 | Last row of object.
 | aDy2 | Int32 | Delta y of image on 1/255 of a cell. 0 means totally at the top, 128 on half of the cell, 255 means at the top of next cell.
 | aCol2 | Int32 | Last column of object.
 | aDx2 | Int32 | Delta x of image, on 1/1024 of a cell. 0 means totally at the left, 512 on half of the cell, 1024 means at the left of next cell.

See also

  • TClientAnchor

TClientAnchor.TClientAnchor(TFlxAnchorType, Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32, IRowColSize)

Creates a new image based on the image size.

Syntax

Namespace: FlexCel.Core

public TClientAnchor(TFlxAnchorType aAnchorType, Int32 aRow1, Int32 aPixDy1, Int32 aCol1, Int32 aPixDx1, Int32 aRow2, Int32 aPixDy2, Int32 aCol2, Int32 aPixDx2, IRowColSize Workbook)

Parameters

<-> | Parameter | Type | Description
 | aAnchorType | TFlxAnchorType | How the image behaves when copying/inserting cells.
 | aRow1 | Int32 | Row where to insert the image.
 | aPixDy1 | Int32 | Delta in resolution-independent-pixels (1/96 of an inch) that the image is moved from aRow1.
 | aCol1 | Int32 | Column where to insert the image.
 | aPixDx1 | Int32 | Delta in resolution-independent-pixels (1/96 of an inch) that the image is moved from aCol1.
 | aRow2 | Int32 | Row where to insert the image.
 | aPixDy2 | Int32 | Delta in resolution-independent-pixels (1/96 of an inch) that the image is moved from aRow1.
 | aCol2 | Int32 | Column where to insert the image.
 | aPixDx2 | Int32 | Delta in resolution-independent-pixels (1/96 of an inch) that the image is moved from aCol1.
 | Workbook | IRowColSize | ExcelFile with the workbook, used to calculate the cells.

See also

  • TClientAnchor


TClientAnchor.CreateKeepingAspectRatio Method | FlexCel Studio for the .NET Framework documentation

TClientAnchor.CreateKeepingAspectRatio Method

This method will create an anchor so the image keeps its aspect ratio, and it is contained inside the group of cells. If you supply negative values for Col2 or Row2, then those values will be ignored. If you set Col2 negative, then this method will place the image between Row1 and Row2, and calculate Col2 so the image keeps its aspect ratio. Similar if you set Row2 negative.

Syntax

Namespace: FlexCel.Core

public static TClientAnchor CreateKeepingAspectRatio(TUIImage Image, TFlxAnchorType aAnchorType, Int32 aRow1, Int32 aDy1, Int32 aCol1, Int32 aDx1, Int32 aRow2, Int32 aDy2, Int32 aCol2, Int32 aDx2, TFlexCelImageVertAlign aVAlign, TFlexCelImageHorizAlign aHAlign, IRowColSize Workbook)

Parameters

<-> | Parameter | Type | Description
 | Image | TUIImage | Image that you want to insert. It is used to know its dimensions and dpi.
 | aAnchorType | TFlxAnchorType | How the image behaves when copying/inserting cells.
 | aRow1 | Int32 | First Row of object.
 | aDy1 | Int32 | Delta y of image on 1/255 of a cell. 0 means totally at the top, 128 on half of the cell, 255 means at the top of next cell.
 | aCol1 | Int32 | First column of object.
 | aDx1 | Int32 | Delta x of image, on 1/1024 of a cell. 0 means totally at the left, 512 on half of the cell, 1024 means at the left of next cell.
 | aRow2 | Int32 | Last row of object.Set it to 0 or negative for unlimited rows.
 | aDy2 | Int32 | Delta y of image on 1/255 of a cell. 0 means totally at the top, 128 on half of the cell, 255 means at the top of next cell.
 | aCol2 | Int32 | Last column of object.Set it to 0 or negative for unlimited columns.
 | aDx2 | Int32 | Delta x of image, on 1/1024 of a cell. 0 means totally at the left, 512 on half of the cell, 1024 means at the left of next cell.
 | aVAlign | TFlexCelImage​Vert​Align | How the image will be fit inside the range of cells.
 | aHAlign | TFlexCelImage​Horiz​Align | How the image will be fit inside the range of cells.
 | Workbook | IRowColSize | ExcelFile with the workbook, used to calculate the cells.

See also

  • TClientAnchor


TClientAnchor.Inc Method | FlexCel Studio for the .NET Framework documentation

TClientAnchor.Inc Method

Returns a COPY of the anchor with rows and cols incremented by one

Syntax

Namespace: FlexCel.Core

public TClientAnchor Inc()

See also

  • TClientAnchor


TClientAnchor.Dec Method | FlexCel Studio for the .NET Framework documentation

TClientAnchor.Dec Method

Returns a COPY of the anchor with rows and cols decremented by one

Syntax

Namespace: FlexCel.Core

public TClientAnchor Dec()

See also

  • TClientAnchor


TClientAnchor.CalcImageCoords Method | FlexCel Studio for the .NET Framework documentation

TClientAnchor.CalcImageCoords Method

Overloads

  • TClientAnchor.CalcImageCoords(Double, Double, IRowColSize)
  • TClientAnchor.CalcImageCoords(Double, Double, Double, Double, IRowColSize)

TClientAnchor.CalcImageCoords(Double, Double, IRowColSize)

Calculates the width and height of the image in resolution-independent-pixels (1/96 of an inch). MAKE SURE THE ACTIVESHEET IN WORKBOOK IS THE CORRECT ONE.

Syntax

Namespace: FlexCel.Core

public void CalcImageCoords(ref Double height, ref Double width, IRowColSize Workbook)

Parameters

<-> | Parameter | Type | Description
ref | height | Double | Will return the height of the object.
ref | width | Double | Will return the width of the object.
 | Workbook | IRowColSize | Workbook used to know the column widths and row heights.

See also

  • TClientAnchor

TClientAnchor.CalcImageCoords(Double, Double, Double, Double, IRowColSize)

Calculates the width and height of the image in resolution-independent-pixels (1/96 of an inch). MAKE SURE THE ACTIVESHEET IN WORKBOOK IS THE CORRECT ONE.

Syntax

Namespace: FlexCel.Core

public void CalcImageCoords(out Double top, out Double left, out Double height, out Double width, IRowColSize Workbook)

Parameters

<-> | Parameter | Type | Description
out | top | Double | Will return the top position of the start of the object in resolution-independent-pixels (1/96 of an inch).
out | left | Double | Will return the left position of the start of the object in resolution-independent-pixels (1/96 of an inch).
out | height | Double | Will return the height of the object.
out | width | Double | Will return the width of the object.
 | Workbook | IRowColSize | Workbook used to know the column widths and row heights.

See also

  • TClientAnchor


TClientAnchor.CalcImageCoordsInPoints Method | FlexCel Studio for the .NET Framework documentation

TClientAnchor.CalcImageCoordsInPoints Method

Calculates the width and height of the image in Points.

Syntax

Namespace: FlexCel.Core

public void CalcImageCoordsInPoints(ref Double height, ref Double width, IRowColSize Workbook)

Parameters

<-> | Parameter | Type | Description
ref | height | Double | Will return the height of the object.
ref | width | Double | Will return the width of the object.
 | Workbook | IRowColSize | Workbook used to know the column widths and row heights.

See also

  • TClientAnchor


TClientAnchor.Dx1Pix Method | FlexCel Studio for the .NET Framework documentation

TClientAnchor.Dx1Pix Method

Returns the offset of the object in resolution-independent-pixels (1/96 of an inch) from the left of the cell.

Syntax

Namespace: FlexCel.Core

public Int32 Dx1Pix(IRowColSize Workbook)

Parameters

<-> | Parameter | Type | Description
 | Workbook | IRowColSize | ExcelFile where this object is placed

Returns

Offset in resolution-independent-pixels (1/96 of an inch).

See also

  • TClientAnchor


TClientAnchor.Dy1Pix Method | FlexCel Studio for the .NET Framework documentation

TClientAnchor.Dy1Pix Method

Returns the offset of the object in resolution-independent-pixels (1/96 of an inch) from the top of the cell.

Syntax

Namespace: FlexCel.Core

public Int32 Dy1Pix(IRowColSize Workbook)

Parameters

<-> | Parameter | Type | Description
 | Workbook | IRowColSize | ExcelFile where this object is placed

Returns

Offset in resolution-independent-pixels (1/96 of an inch).

See also

  • TClientAnchor


TClientAnchor.Dx2Pix Method | FlexCel Studio for the .NET Framework documentation

TClientAnchor.Dx2Pix Method

Returns the offset of the object in resolution-independent-pixels (1/96 of an inch) from the left of the cell.

Syntax

Namespace: FlexCel.Core

public Int32 Dx2Pix(IRowColSize Workbook)

Parameters

<-> | Parameter | Type | Description
 | Workbook | IRowColSize | ExcelFile where this object is placed

Returns

Offset in resolution-independent-pixels (1/96 of an inch).

See also

  • TClientAnchor


TClientAnchor.Dy2Pix Method | FlexCel Studio for the .NET Framework documentation

TClientAnchor.Dy2Pix Method

Returns the offset of the object in resolution-independent-pixels (1/96 of an inch) from the top of the cell.

Syntax

Namespace: FlexCel.Core

public Int32 Dy2Pix(IRowColSize Workbook)

Parameters

<-> | Parameter | Type | Description
 | Workbook | IRowColSize | ExcelFile where this object is placed

Returns

Offset in resolution-independent-pixels (1/96 of an inch).

See also

  • TClientAnchor


TClientAnchor.Dx1Points Method | FlexCel Studio for the .NET Framework documentation

TClientAnchor.Dx1Points Method

Returns the offset of the object in points from the left of the cell. This is used for display, and is not the exact conversion from Dx1Pix.

Syntax

Namespace: FlexCel.Core

public Double Dx1Points(IRowColSize Workbook)

Parameters

<-> | Parameter | Type | Description
 | Workbook | IRowColSize | ExcelFile where this object is placed

Returns

Offset in points (1/72 of an inch).

See also

  • TClientAnchor


TClientAnchor.Dy1Points Method | FlexCel Studio for the .NET Framework documentation

TClientAnchor.Dy1Points Method

Returns the offset of the object in points from the top of the cell.

Syntax

Namespace: FlexCel.Core

public Double Dy1Points(IRowColSize Workbook)

Parameters

<-> | Parameter | Type | Description
 | Workbook | IRowColSize | ExcelFile where this object is placed

Returns

Offset in points (1/72 of an inch).

See also

  • TClientAnchor


TClientAnchor.Dx2Points Method | FlexCel Studio for the .NET Framework documentation

TClientAnchor.Dx2Points Method

Returns the offset of the object in points from the left of the cell.

Syntax

Namespace: FlexCel.Core

public Double Dx2Points(IRowColSize Workbook)

Parameters

<-> | Parameter | Type | Description
 | Workbook | IRowColSize | ExcelFile where this object is placed

Returns

Offset in points (1/72 of an inch).

See also

  • TClientAnchor


TClientAnchor.Dy2Points Method | FlexCel Studio for the .NET Framework documentation

TClientAnchor.Dy2Points Method

Returns the offset of the object in points from the top of the cell.

Syntax

Namespace: FlexCel.Core

public Double Dy2Points(IRowColSize Workbook)

Parameters

<-> | Parameter | Type | Description
 | Workbook | IRowColSize | ExcelFile where this object is placed

Returns

Offset in points (1/72 of an inch).

See also

  • TClientAnchor


TClientAnchor.Clone Method | FlexCel Studio for the .NET Framework documentation

TClientAnchor.Clone Method

Creates a copy of the Anchor

Syntax

Namespace: FlexCel.Core

public Object Clone()

See also

  • TClientAnchor


TClientAnchor.EqualValues Method | FlexCel Studio for the .NET Framework documentation

TClientAnchor.EqualValues Method

Returns true if both instances of the objects contain the same values. Instances might be different, this method will return if their values are equal. Instances can be null. This method is equivalent to TClientAnchor.Equals(a,b), and kept for backwards compatibility.

Syntax

Namespace: FlexCel.Core

public static Boolean EqualValues(TClientAnchor a1, TClientAnchor a2)

Parameters

<-> | Parameter | Type | Description
 | a1 | TClientAnchor | First instance to compare.
 | a2 | TClientAnchor | Second instance to compare.

See also

  • TClientAnchor


TClientAnchor.Equals Method | FlexCel Studio for the .NET Framework documentation

TClientAnchor.Equals Method

Returns true if both objects have the same data.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TClientAnchor


TClientAnchor.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TClientAnchor.GetHashCode Method

Returns the hash code for the object.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TClientAnchor


TClientAnchor.Contains Method | FlexCel Studio for the .NET Framework documentation

TClientAnchor.Contains Method

Returns true if the target anchor is inside or equal to this one.

Syntax

Namespace: FlexCel.Core

public Boolean Contains(TClientAnchor targetAnchor)

Parameters

<-> | Parameter | Type | Description
 | targetAnchor | TClientAnchor | Anchor to test.

See also

  • TClientAnchor


TClientAnchor.CalcChildRect Method | FlexCel Studio for the .NET Framework documentation

TClientAnchor.CalcChildRect Method

Returns the coordinates of the shape when it is part of a group.

Syntax

Namespace: FlexCel.Core

public TUIRectangle CalcChildRect(TUIRectangle ParentRect)

Parameters

<-> | Parameter | Type | Description
 | ParentRect | TUIRectangle | Coordinates for the parent group shape.

See also

  • TClientAnchor


TClientAnchor.ChartCoords Property | FlexCel Studio for the .NET Framework documentation

TClientAnchor.ChartCoords Property

If true, this object is inside a chart, and columns and rows range from 0 to 4000.

Syntax

Namespace: FlexCel.Core

public Boolean ChartCoords { get; set; }

See also

  • TClientAnchor


TClientAnchor.AnchorType Property | FlexCel Studio for the .NET Framework documentation

TClientAnchor.AnchorType Property

How the image behaves when copying/inserting cells.

Syntax

Namespace: FlexCel.Core

public TFlxAnchorType AnchorType { get; set; }

See also

  • TClientAnchor


TClientAnchor.Col1 Property | FlexCel Studio for the .NET Framework documentation

TClientAnchor.Col1 Property

First column of object

Syntax

Namespace: FlexCel.Core

public Int32 Col1 { get; set; }

See also

  • TClientAnchor


TClientAnchor.Dx1 Property | FlexCel Studio for the .NET Framework documentation

TClientAnchor.Dx1 Property

Delta x of image, on 1/1024 of a cell. 0 means totally at the left, 512 on half of the cell, 1024 means at the left of next cell.

Syntax

Namespace: FlexCel.Core

public Int32 Dx1 { get; set; }

See also

  • TClientAnchor


TClientAnchor.Row1 Property | FlexCel Studio for the .NET Framework documentation

TClientAnchor.Row1 Property

First Row of object.

Syntax

Namespace: FlexCel.Core

public Int32 Row1 { get; set; }

See also

  • TClientAnchor


TClientAnchor.Dy1 Property | FlexCel Studio for the .NET Framework documentation

TClientAnchor.Dy1 Property

Delta y of image on 1/255 of a cell. 0 means totally at the top, 128 on half of the cell, 255 means at the top of next cell.

Syntax

Namespace: FlexCel.Core

public Int32 Dy1 { get; set; }

See also

  • TClientAnchor


TClientAnchor.Col2 Property | FlexCel Studio for the .NET Framework documentation

TClientAnchor.Col2 Property

Last column of object.

Syntax

Namespace: FlexCel.Core

public Int32 Col2 { get; set; }

See also

  • TClientAnchor


TClientAnchor.Dx2 Property | FlexCel Studio for the .NET Framework documentation

TClientAnchor.Dx2 Property

Delta x of image, on 1/1024 of a cell. 0 means totally at the left, 512 on half of the cell, 1024 means at the left of next cell.

Syntax

Namespace: FlexCel.Core

public Int32 Dx2 { get; set; }

See also

  • TClientAnchor


TClientAnchor.Row2 Property | FlexCel Studio for the .NET Framework documentation

TClientAnchor.Row2 Property

Last row of object.

Syntax

Namespace: FlexCel.Core

public Int32 Row2 { get; set; }

See also

  • TClientAnchor


TClientAnchor.Dy2 Property | FlexCel Studio for the .NET Framework documentation

TClientAnchor.Dy2 Property

Delta y of image on 1/255 of a cell. 0 means totally at the top, 128 on half of the cell, 255 means at the top of next cell.

Syntax

Namespace: FlexCel.Core

public Int32 Dy2 { get; set; }

See also

  • TClientAnchor


TClientAnchor.ChildAnchor Property | FlexCel Studio for the .NET Framework documentation

TClientAnchor.ChildAnchor Property

Returns the offset on the parent system for the image, when it is grouped. For example, if the parent shape on the group is 100 px wide, and ChildAnchor has a dx of 0.5, the image starts 50px to the right of the parent. If the shape is not grouped or it is the shape on top of the group, ChildAnchor is null. When this member is not null, other values on ClientAnchor have no meaning.

Remarks

This offset is relative to the parent shape. If there are 2 parent shapes before on the hierarchy, this object applies to the parent, not the grandparent.

Syntax

Namespace: FlexCel.Core

public TChildAnchor ChildAnchor { get; set; }

See also

  • TClientAnchor


TColorChangeBlipTransform Class | FlexCel Studio for the .NET Framework documentation

TColorChangeBlipTransform Class

Represents a color transformation from one color to another. This transform can be used to make a color transparent.

Syntax

Namespace: FlexCel.Core

public class TColorChangeBlipTransform: TBlipTransform

Constructors

Name | Description
TColorChange​Blip​Transform | Creates a new transform.

Methods

Name | Description
Clone | Creates a deep copy of the object.
CompareTo | Compares two instances.
Equals | Returns true if both objects have the same contents.
GetHashCode | Returns the hashcode of the object.

Properties

Name | Description
ColorFrom | Color which we are going to replace.
ColorTo | Color used to replace ColorFrom.
UseAlpha | If false, the alpha components of ColorFrom and ColorTo will be ignored.


TColorChangeBlipTransform.TColorChangeBlipTransform Constructor | FlexCel Studio for the .NET Framework documentation

TColorChangeBlipTransform.TColorChangeBlipTransform Constructor

Creates a new transform.

Syntax

Namespace: FlexCel.Core

public TColorChangeBlipTransform(TDrawingColor aColorFrom, TDrawingColor aColorTo, Boolean aUseAlpha)

Parameters

<-> | Parameter | Type | Description
 | aColorFrom | TDrawingColor | Color which we are going to replace.
 | aColorTo | TDrawingColor | Color used to replace aColorFrom.
 | aUseAlpha | Boolean | If false, the alpha components of ColorFrom and ColorTo will be ignored.

See also

  • TColorChangeBlipTransform


TColorChangeBlipTransform.Clone Method | FlexCel Studio for the .NET Framework documentation

TColorChangeBlipTransform.Clone Method

Creates a deep copy of the object.

Syntax

Namespace: FlexCel.Core

public override TBlipTransform Clone()

See also

  • TColorChangeBlipTransform


TColorChangeBlipTransform.CompareTo Method | FlexCel Studio for the .NET Framework documentation

TColorChangeBlipTransform.CompareTo Method

Compares two instances.

Syntax

Namespace: FlexCel.Core

public override Int32 CompareTo(TBlipTransform blipTransform)

Parameters

<-> | Parameter | Type | Description
 | blipTransform | TBlipTransform |

See also

  • TColorChangeBlipTransform


TColorChangeBlipTransform.Equals Method | FlexCel Studio for the .NET Framework documentation

TColorChangeBlipTransform.Equals Method

Returns true if both objects have the same contents.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TColorChangeBlipTransform


TColorChangeBlipTransform.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TColorChangeBlipTransform.GetHashCode Method

Returns the hashcode of the object.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TColorChangeBlipTransform


TColorChangeBlipTransform.ColorFrom Property | FlexCel Studio for the .NET Framework documentation

TColorChangeBlipTransform.ColorFrom Property

Color which we are going to replace.

Syntax

Namespace: FlexCel.Core

public TDrawingColor ColorFrom { get; }

See also

  • TColorChangeBlipTransform


TColorChangeBlipTransform.ColorTo Property | FlexCel Studio for the .NET Framework documentation

TColorChangeBlipTransform.ColorTo Property

Color used to replace ColorFrom.

Syntax

Namespace: FlexCel.Core

public TDrawingColor ColorTo { get; }

See also

  • TColorChangeBlipTransform


TColorChangeBlipTransform.UseAlpha Property | FlexCel Studio for the .NET Framework documentation

TColorChangeBlipTransform.UseAlpha Property

If false, the alpha components of ColorFrom and ColorTo will be ignored.

Syntax

Namespace: FlexCel.Core

public Boolean UseAlpha { get; }

See also

  • TColorChangeBlipTransform


TColumnBlock Class | FlexCel Studio for the .NET Framework documentation

TColumnBlock Class

This class represents a block of columns with the same formatting, options and width.

Syntax

Namespace: FlexCel.Core

public class TColumnBlock

Fields

Name | Description
FirstCol | First column of the range (1 based).
LastCol | Last column of the range (1 based).
Width | Width of the columns.
Options | Options of the columns.
XF | Format of the columns.

Constructors

Name | Description
TColumnBlock | Creates a new TColumnBlock.

Methods

Name | Description
Equals | returns true if both objects have the same values.
GetHashCode | returns the hashcode.

Properties

Name | Description
Hidden | Returns true if the columns are hidden


TColumnBlock.FirstCol Field | FlexCel Studio for the .NET Framework documentation

TColumnBlock.FirstCol Field

First column of the range (1 based).

Syntax

Namespace: FlexCel.Core

public readonly Int32 FirstCol

See also

  • TColumnBlock


TColumnBlock.LastCol Field | FlexCel Studio for the .NET Framework documentation

TColumnBlock.LastCol Field

Last column of the range (1 based).

Syntax

Namespace: FlexCel.Core

public readonly Int32 LastCol

See also

  • TColumnBlock


TColumnBlock.Width Field | FlexCel Studio for the .NET Framework documentation

TColumnBlock.Width Field

Width of the columns.

Syntax

Namespace: FlexCel.Core

public readonly Int32 Width

See also

  • TColumnBlock


TColumnBlock.Options Field | FlexCel Studio for the .NET Framework documentation

TColumnBlock.Options Field

Options of the columns.

Syntax

Namespace: FlexCel.Core

public readonly Int32 Options

See also

  • TColumnBlock


TColumnBlock.XF Field | FlexCel Studio for the .NET Framework documentation

TColumnBlock.XF Field

Format of the columns.

Syntax

Namespace: FlexCel.Core

public readonly Int32 XF

See also

  • TColumnBlock


TColumnBlock.TColumnBlock Constructor | FlexCel Studio for the .NET Framework documentation

TColumnBlock.TColumnBlock Constructor

Creates a new TColumnBlock.

Syntax

Namespace: FlexCel.Core

public TColumnBlock(Int32 aFirstCol, Int32 aLastCol, Int32 aWidth, Int32 aOptions, Int32 aXF)

Parameters

<-> | Parameter | Type | Description
 | aFirstCol | Int32 |
 | aLastCol | Int32 |
 | aWidth | Int32 |
 | aOptions | Int32 |
 | aXF | Int32 |

See also

  • TColumnBlock


TColumnBlock.Equals Method | FlexCel Studio for the .NET Framework documentation

TColumnBlock.Equals Method

returns true if both objects have the same values.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TColumnBlock


TColumnBlock.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TColumnBlock.GetHashCode Method

returns the hashcode.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TColumnBlock


TColumnBlock.Hidden Property | FlexCel Studio for the .NET Framework documentation

TColumnBlock.Hidden Property

Returns true if the columns are hidden

Syntax

Namespace: FlexCel.Core

public Boolean Hidden { get; }

See also

  • TColumnBlock


TCommentProperties Class | FlexCel Studio for the .NET Framework documentation

TCommentProperties Class

Holds the properties for a comment. This class is a descendant of TObjectProperties, and it adds specific behavior for a comment.

Syntax

Namespace: FlexCel.Core

public class TCommentProperties: TObjectProperties

Fields

Name | Description
DefaultFillColorRGB | Default color used in the comments.
DefaultFillColor​System | Default color used in the comments, as a system color.
DefaultLineColor​System | Default color used in the comments, as a system color.
ObjId | Object Id if there is one.

Constructors

Name | Description
TCommentProperties | Overloaded TCommentProperties TCommentProperties(TClientAnchor) TCommentProperties(TClientAnchor, String) TCommentProperties(TClientAnchor, String, TObjectTextProperties, Boolean, Boolean)

Methods

Name | Description
CreateStandard | Creates a standard yellow comment of standard height and width for the cell at row, col.
Clone | Returns a deep copy of the object.

Properties

Name | Description
TextProperties | Properties of the text in the object.
AutoSize | If true, the comment box will adapt its size to the size of the text.
Hidden | If true, the comment box will be hidden (this is the default).
AutoTextMargins | If true, the comment will use automatic margins around the text, instead of what is set in TShapeOption.​dxText​Left, TShapeOption.​dxText​Right, TShapeOption.​dyTextTop and TShapeOption.​dyText​Bottom. By default comments have automatic margins.


TCommentProperties.DefaultFillColorRGB Field | FlexCel Studio for the .NET Framework documentation

TCommentProperties.DefaultFillColorRGB Field

Default color used in the comments.

Syntax

Namespace: FlexCel.Core

public const Int32 DefaultFillColorRGB = -31

See also

  • TCommentProperties


TCommentProperties.DefaultFillColorSystem Field | FlexCel Studio for the .NET Framework documentation

TCommentProperties.DefaultFillColorSystem Field

Default color used in the comments, as a system color.

Syntax

Namespace: FlexCel.Core

public const TSystemColor DefaultFillColorSystem = 21

See also

  • TCommentProperties


TCommentProperties.DefaultLineColorSystem Field | FlexCel Studio for the .NET Framework documentation

TCommentProperties.DefaultLineColorSystem Field

Default color used in the comments, as a system color.

Syntax

Namespace: FlexCel.Core

public const TSystemColor DefaultLineColorSystem = 0

See also

  • TCommentProperties


TCommentProperties.ObjId Field | FlexCel Studio for the .NET Framework documentation

TCommentProperties.ObjId Field

Object Id if there is one.

Syntax

Namespace: FlexCel.Core

public readonly Int32 ObjId

See also

  • TCommentProperties


TCommentProperties.TCommentProperties Constructor | FlexCel Studio for the .NET Framework documentation

TCommentProperties.TCommentProperties Constructor

Overloads

  • TCommentProperties.TCommentProperties
  • TCommentProperties.TCommentProperties(TClientAnchor)
  • TCommentProperties.TCommentProperties(TClientAnchor, String)
  • TCommentProperties.TCommentProperties(TClientAnchor, String, TObjectTextProperties, Boolean, Boolean)

TCommentProperties.TCommentProperties

Creates a new empty TCommentProperties instance.

Syntax

Namespace: FlexCel.Core

public TCommentProperties()

See also

  • TCommentProperties

TCommentProperties.TCommentProperties(TClientAnchor)

This method will create a new copy of aAnchor, so you can modify it later.

Syntax

Namespace: FlexCel.Core

public TCommentProperties(TClientAnchor aAnchor)

Parameters

<-> | Parameter | Type | Description
 | aAnchor | TClientAnchor | Anchor. It will be copied here.

See also

  • TCommentProperties

TCommentProperties.TCommentProperties(TClientAnchor, String)

This method will create a new copy of aAnchor, so you can modify it later.

Syntax

Namespace: FlexCel.Core

public TCommentProperties(TClientAnchor aAnchor, String aShapeName)

Parameters

<-> | Parameter | Type | Description
 | aAnchor | TClientAnchor | Anchor. It will be copied here.
 | aShapeName | String | Shape name for the comment box, as it will appear on the names combo box.

See also

  • TCommentProperties

TCommentProperties.TCommentProperties(TClientAnchor, String, TObjectTextProperties, Boolean, Boolean)

This method will create a new copy of aAnchor, so you can modify it later.

Syntax

Namespace: FlexCel.Core

public TCommentProperties(TClientAnchor aAnchor, String aShapeName, TObjectTextProperties aTextProperties, Boolean aLock, Boolean aAutoSize)

Parameters

<-> | Parameter | Type | Description
 | aAnchor | TClientAnchor | Anchor. It will be copied here.
 | aShapeName | String | Name of the shape, as it appears on the names combobox. Set it to null to not add an imagename.
 | aTextProperties | TObjectTextProperties | Propertied of the text in the comment.
 | aLock | Boolean | Specifies if the comment is locked.
 | aAutoSize | Boolean | If true, the comment box will autosize to hold the text.

See also

  • TCommentProperties


TCommentProperties.CreateStandard Method | FlexCel Studio for the .NET Framework documentation

TCommentProperties.CreateStandard Method

Creates a standard yellow comment of standard height and width for the cell at row, col.

Syntax

Namespace: FlexCel.Core

public static TCommentProperties CreateStandard(Int32 row, Int32 col, ExcelFile Workbook)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row where the comment will be (1 based).
 | col | Int32 | Column where the comment will be (1 based).
 | Workbook | ExcelFile |

See also

  • TCommentProperties


TCommentProperties.Clone Method | FlexCel Studio for the .NET Framework documentation

TCommentProperties.Clone Method

Returns a deep copy of the object.

Syntax

Namespace: FlexCel.Core

public override TBaseImageProperties Clone()

See also

  • TCommentProperties


TCommentProperties.TextProperties Property | FlexCel Studio for the .NET Framework documentation

TCommentProperties.TextProperties Property

Properties of the text in the object.

Syntax

Namespace: FlexCel.Core

public TObjectTextProperties TextProperties { get; set; }

See also

  • TCommentProperties


TCommentProperties.AutoSize Property | FlexCel Studio for the .NET Framework documentation

TCommentProperties.AutoSize Property

If true, the comment box will adapt its size to the size of the text.

Syntax

Namespace: FlexCel.Core

public Boolean AutoSize { get; set; }

See also

  • TCommentProperties


TCommentProperties.Hidden Property | FlexCel Studio for the .NET Framework documentation

TCommentProperties.Hidden Property

If true, the comment box will be hidden (this is the default).

Syntax

Namespace: FlexCel.Core

public Boolean Hidden { get; set; }

See also

  • TCommentProperties


TCommentProperties.AutoTextMargins Property | FlexCel Studio for the .NET Framework documentation

TCommentProperties.AutoTextMargins Property

If true, the comment will use automatic margins around the text, instead of what is set in TShapeOption.dxTextLeft, TShapeOption.dxTextRight, TShapeOption.dyTextTop and TShapeOption.dyTextBottom. By default comments have automatic margins.

Syntax

Namespace: FlexCel.Core

public Boolean AutoTextMargins { get; set; }

See also

  • TCommentProperties


TConditionalAboveAverageRule Class | FlexCel Studio for the .NET Framework documentation

TConditionalAboveAverageRule Class

A conditional format rule which highlights cells which are below or above the average value of the group of cells.

Syntax

Namespace: FlexCel.Core

public class TConditionalAboveAverageRule: TConditionalFormatStandardDefRule

Constructors

Name | Description
TConditional​Above​Average​Rule | Creates a new instance of TConditional​Above​Average​Rule.​

Methods

Name | Description
Equals | Returns true if this object is equal to obj.
GetHashCode | Returns the hashcode for this object.

Properties

Name | Description
IsBelowAverage | If true, then this rule highlights values below the average instead of above.
IncludeAverage | If true, the average value itself will be highlighted.
StdDev | The number of standard deviations to include above or below the average.


TConditionalAboveAverageRule.TConditionalAboveAverageRule Constructor | FlexCel Studio for the .NET Framework documentation

TConditionalAboveAverageRule.TConditionalAboveAverageRule Constructor

Creates a new instance of TConditionalAboveAverageRule.

Syntax

Namespace: FlexCel.Core

public TConditionalAboveAverageRule(Int32 aPriority, Boolean aStopIfTrue, Boolean aIsBelowAverage, Boolean aIncludeAverage, Int32 aStdDev)

Parameters

<-> | Parameter | Type | Description
 | aPriority | Int32 | Priority of the rule. 1 means highest priority, and rules with higher numbers will be evaluated later.
 | aStopIfTrue | Boolean | See TConditionalFormatRule.StopIfTrue
 | aIsBelowAverage | Boolean | If true, then this rule highlights values below the average instead of above.
 | aIncludeAverage | Boolean | If true, the average value itself will be highlighted.
 | aStdDev | Int32 | The number of standard deviations to include above or below the average.

See also

  • TConditionalAboveAverageRule


TConditionalAboveAverageRule.Equals Method | FlexCel Studio for the .NET Framework documentation

TConditionalAboveAverageRule.Equals Method

Returns true if this object is equal to obj.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TConditionalAboveAverageRule


TConditionalAboveAverageRule.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TConditionalAboveAverageRule.GetHashCode Method

Returns the hashcode for this object.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TConditionalAboveAverageRule


TConditionalAboveAverageRule.IsBelowAverage Property | FlexCel Studio for the .NET Framework documentation

TConditionalAboveAverageRule.IsBelowAverage Property

If true, then this rule highlights values below the average instead of above.

Syntax

Namespace: FlexCel.Core

public Boolean IsBelowAverage { get; set; }

See also

  • TConditionalAboveAverageRule


TConditionalAboveAverageRule.IncludeAverage Property | FlexCel Studio for the .NET Framework documentation

TConditionalAboveAverageRule.IncludeAverage Property

If true, the average value itself will be highlighted.

Syntax

Namespace: FlexCel.Core

public Boolean IncludeAverage { get; set; }

See also

  • TConditionalAboveAverageRule


TConditionalAboveAverageRule.StdDev Property | FlexCel Studio for the .NET Framework documentation

TConditionalAboveAverageRule.StdDev Property

The number of standard deviations to include above or below the average.

Syntax

Namespace: FlexCel.Core

public Int32 StdDev { get; set; }

See also

  • TConditionalAboveAverageRule


TConditionalBaseTextRule Class | FlexCel Studio for the .NET Framework documentation

TConditionalBaseTextRule Class

A base conditional format rule which highlights cells which contain specific text. This class is not used directly, you use the descendants.

Syntax

Namespace: FlexCel.Core

public abstract class TConditionalBaseTextRule: TConditionalFormatStandardDefRule

Constructors

Name | Description
TConditional​Base​Text​Rule | Creates a new instance of TConditional​Base​Text​Rule.​

Methods

Name | Description
Equals | Returns true if this object is equal to obj.
GetHashCode | Returns the hashcode for this object.

Properties

Name | Description
Text | Text to search for. If it starts with "=" it will be considered a formula.


TConditionalBaseTextRule.TConditionalBaseTextRule Constructor | FlexCel Studio for the .NET Framework documentation

TConditionalBaseTextRule.TConditionalBaseTextRule Constructor

Creates a new instance of TConditionalBaseTextRule.

Syntax

Namespace: FlexCel.Core

protected TConditionalBaseTextRule(TConditionalFormatKind aKind, Int32 aPriority, Boolean aStopIfTrue, String aText)

Parameters

<-> | Parameter | Type | Description
 | aKind | TConditional​Format​Kind | Type of text used by the rule.
 | aPriority | Int32 | Priority of the rule. 1 means highest priority, and rules with higher numbers will be evaluated later.
 | aStopIfTrue | Boolean | See TConditionalFormatRule.StopIfTrue
 | aText | String | Text to search for. If it starts with "=" it will be considered a formula.

See also

  • TConditionalBaseTextRule


TConditionalBaseTextRule.Equals Method | FlexCel Studio for the .NET Framework documentation

TConditionalBaseTextRule.Equals Method

Returns true if this object is equal to obj.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TConditionalBaseTextRule


TConditionalBaseTextRule.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TConditionalBaseTextRule.GetHashCode Method

Returns the hashcode for this object.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TConditionalBaseTextRule


TConditionalBaseTextRule.Text Property | FlexCel Studio for the .NET Framework documentation

TConditionalBaseTextRule.Text Property

Text to search for. If it starts with "=" it will be considered a formula.

Syntax

Namespace: FlexCel.Core

public String Text { get; set; }

See also

  • TConditionalBaseTextRule


TConditionalBeginsWithTextRule Class | FlexCel Studio for the .NET Framework documentation

TConditionalBeginsWithTextRule Class

A conditional format rule which highlights cells which start with some text.

Syntax

Namespace: FlexCel.Core

public class TConditionalBeginsWithTextRule: TConditionalBaseTextRule

Constructors

Name | Description
TConditional​Begins​With​Text​Rule | Creates a new instance of TConditional​Begins​With​Text​Rule.​


TConditionalBeginsWithTextRule.TConditionalBeginsWithTextRule Constructor | FlexCel Studio for the .NET Framework documentation

TConditionalBeginsWithTextRule.TConditionalBeginsWithTextRule Constructor

Creates a new instance of TConditionalBeginsWithTextRule.

Syntax

Namespace: FlexCel.Core

public TConditionalBeginsWithTextRule(Int32 aPriority, Boolean aStopIfTrue, String aText)

Parameters

<-> | Parameter | Type | Description
 | aPriority | Int32 | Priority of the rule. 1 means highest priority, and rules with higher numbers will be evaluated later.
 | aStopIfTrue | Boolean | See TConditionalFormatRule.StopIfTrue
 | aText | String | Text to search for.

See also

  • TConditionalBeginsWithTextRule


TConditionalCellIsRule Class | FlexCel Studio for the .NET Framework documentation

TConditionalCellIsRule Class

A conditional format rule specified by the value on a cell (less than, equal, etc).

Syntax

Namespace: FlexCel.Core

public class TConditionalCellIsRule: TConditionalFormatStandardDefRule

Constructors

Name | Description
TConditional​Cell​IsRule | Creates a new instance of TConditional​Cell​IsRule.​

Methods

Name | Description
Equals | Returns true if this object is equal to obj.
GetHashCode | Returns the hashcode for this object.

Properties

Name | Description
ConditionType | Condition to apply for the rule.
Formula1 | The first formula to be evaluated. When the condition needs only one parameter (for example when condition is "Equal") this is the only formula that is used. Note that with relative references, we always consider "A1" to be the cell where the format is. This means that the formula: "=$A$1 + A1" when evaluated in Cell B8, will read "=$A$1 + B8". To provide a negative offset, you need to wrap the formula. For example "=A1048575" will evaluate to B7 when evaluated in B8.
Formula2 | The second formula to be evaluated. Note that this formula is only used if the condition needs more than one parameter (for example when condition is "Between"). If using a condition with only one parameter, you can leave this formula to null. Note that with relative references, we always consider "A1" to be the cell where the format is. This means that the formula: "=$A$1 + A1" when evaluated in Cell B8, will read "=$A$1 + B8". To provide a negative offset, you need to wrap the formula. For example "=A1048575" will evaluate to B7 when evaluated in B8.


TConditionalCellIsRule.TConditionalCellIsRule Constructor | FlexCel Studio for the .NET Framework documentation

TConditionalCellIsRule.TConditionalCellIsRule Constructor

Creates a new instance of TConditionalCellIsRule.

Syntax

Namespace: FlexCel.Core

public TConditionalCellIsRule(Int32 aPriority, Boolean aStopIfTrue, TConditionType aConditionType, String aFormula1, String aFormula2)

Parameters

<-> | Parameter | Type | Description
 | aPriority | Int32 | Priority of the rule. 1 means highest priority, and rules with higher numbers will be evaluated later.
 | aStopIfTrue | Boolean | See TConditionalFormatRule.StopIfTrue
 | aConditionType | TConditionType | See ConditionType
 | aFormula1 | String | See Formula1
 | aFormula2 | String | See Formula2

See also

  • TConditionalCellIsRule


TConditionalCellIsRule.Equals Method | FlexCel Studio for the .NET Framework documentation

TConditionalCellIsRule.Equals Method

Returns true if this object is equal to obj.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TConditionalCellIsRule


TConditionalCellIsRule.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TConditionalCellIsRule.GetHashCode Method

Returns the hashcode for this object.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TConditionalCellIsRule


TConditionalCellIsRule.ConditionType Property | FlexCel Studio for the .NET Framework documentation

TConditionalCellIsRule.ConditionType Property

Condition to apply for the rule.

Syntax

Namespace: FlexCel.Core

public TConditionType ConditionType { get; set; }

See also

  • TConditionalCellIsRule


TConditionalCellIsRule.Formula1 Property | FlexCel Studio for the .NET Framework documentation

TConditionalCellIsRule.Formula1 Property

The first formula to be evaluated. When the condition needs only one parameter (for example when condition is "Equal") this is the only formula that is used.

Note that with relative references, we always consider "A1" to be the cell where the format is. This means that the formula: "=$A$1 + A1" when evaluated in Cell B8, will read "=$A$1 + B8". To provide a negative offset, you need to wrap the formula. For example "=A1048575" will evaluate to B7 when evaluated in B8.

Syntax

Namespace: FlexCel.Core

public String Formula1 { get; set; }

See also

  • TConditionalCellIsRule


TConditionalCellIsRule.Formula2 Property | FlexCel Studio for the .NET Framework documentation

TConditionalCellIsRule.Formula2 Property

The second formula to be evaluated. Note that this formula is only used if the condition needs more than one parameter (for example when condition is "Between"). If using a condition with only one parameter, you can leave this formula to null.

Note that with relative references, we always consider "A1" to be the cell where the format is. This means that the formula: "=$A$1 + A1" when evaluated in Cell B8, will read "=$A$1 + B8". To provide a negative offset, you need to wrap the formula. For example "=A1048575" will evaluate to B7 when evaluated in B8.

Syntax

Namespace: FlexCel.Core

public String Formula2 { get; set; }

See also

  • TConditionalCellIsRule


TConditionalColorScaleRule Class | FlexCel Studio for the .NET Framework documentation

TConditionalColorScaleRule Class

A conditional format rule specified as a color scale.

Syntax

Namespace: FlexCel.Core

public class TConditionalColorScaleRule: TConditionalFormatValuesRule

Constructors

Name | Description
TConditional​Color​Scale​Rule | Creates a new instance of TConditional​Color​Scale​Rule.​

Methods

Name | Description
Equals | Returns true if this object is equal to obj.
GetHashCode | Returns the hashcode for this object.
Clone | Returns a deep copy of the object.
CheckIsValid | Checks if the rule is valid. This check will be applied automatically when you try to add a conditional format to a sheet, so there is no need to call this method directly. But you can use it to know if a conditional format will be rejected when you try to add it.

Properties

Name | Description
FormatDef | Format to apply when the rule evaluates to true.


TConditionalColorScaleRule.TConditionalColorScaleRule Constructor | FlexCel Studio for the .NET Framework documentation

TConditionalColorScaleRule.TConditionalColorScaleRule Constructor

Creates a new instance of TConditionalColorScaleRule.

Syntax

Namespace: FlexCel.Core

public TConditionalColorScaleRule(Int32 aPriority, String aFormula)

Parameters

<-> | Parameter | Type | Description
 | aPriority | Int32 | Priority of the rule. 1 means highest priority, and rules with higher numbers will be evaluated later.
 | aFormula | String | Formula that defines if the format will be shown or not. A value of 0 or false means that the conditional format won't be displayed. If the formula is empty or returns another value, the format will be displayed. Note that there is no way to enter a formula in the Excel UI for this cases: From Excel the formula will always be empty. But if you create a file with a formula, it will be honored and preserved when you open it in Excel.

See also

  • TConditionalColorScaleRule


TConditionalColorScaleRule.Equals Method | FlexCel Studio for the .NET Framework documentation

TConditionalColorScaleRule.Equals Method

Returns true if this object is equal to obj.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TConditionalColorScaleRule


TConditionalColorScaleRule.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TConditionalColorScaleRule.GetHashCode Method

Returns the hashcode for this object.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TConditionalColorScaleRule


TConditionalColorScaleRule.Clone Method | FlexCel Studio for the .NET Framework documentation

TConditionalColorScaleRule.Clone Method

Returns a deep copy of the object.

Syntax

Namespace: FlexCel.Core

public override TConditionalFormatRule Clone()

See also

  • TConditionalColorScaleRule


TConditionalColorScaleRule.CheckIsValid Method | FlexCel Studio for the .NET Framework documentation

TConditionalColorScaleRule.CheckIsValid Method

Checks if the rule is valid. This check will be applied automatically when you try to add a conditional format to a sheet, so there is no need to call this method directly. But you can use it to know if a conditional format will be rejected when you try to add it.

Syntax

Namespace: FlexCel.Core

public override CondFmtError CheckIsValid()

See also

  • TConditionalColorScaleRule


TConditionalColorScaleRule.FormatDef Property | FlexCel Studio for the .NET Framework documentation

TConditionalColorScaleRule.FormatDef Property

Format to apply when the rule evaluates to true.

Syntax

Namespace: FlexCel.Core

public TConditionalFormatDefColorScale FormatDef { get; }

See also

  • TConditionalColorScaleRule


TConditionalContainsBlanksRule Class | FlexCel Studio for the .NET Framework documentation

TConditionalContainsBlanksRule Class

A conditional format rule which highlights blank cells.

Syntax

Namespace: FlexCel.Core

public class TConditionalContainsBlanksRule: TConditionalFormatStandardDefRule

Constructors

Name | Description
TConditional​Contains​Blanks​Rule | Creates a new instance of TConditional​Contains​Blanks​Rule.​


TConditionalContainsBlanksRule.TConditionalContainsBlanksRule Constructor | FlexCel Studio for the .NET Framework documentation

TConditionalContainsBlanksRule.TConditionalContainsBlanksRule Constructor

Creates a new instance of TConditionalContainsBlanksRule.

Syntax

Namespace: FlexCel.Core

public TConditionalContainsBlanksRule(Int32 aPriority, Boolean aStopIfTrue)

Parameters

<-> | Parameter | Type | Description
 | aPriority | Int32 | Priority of the rule. 1 means highest priority, and rules with higher numbers will be evaluated later.
 | aStopIfTrue | Boolean | See TConditionalFormatRule.StopIfTrue

See also

  • TConditionalContainsBlanksRule


TConditionalContainsErrorsRule Class | FlexCel Studio for the .NET Framework documentation

TConditionalContainsErrorsRule Class

A conditional format rule which highlights cells with errors.

Syntax

Namespace: FlexCel.Core

public class TConditionalContainsErrorsRule: TConditionalFormatStandardDefRule

Constructors

Name | Description
TConditional​Contains​Errors​Rule | Creates a new instance of TConditional​Contains​Errors​Rule.​


TConditionalContainsErrorsRule.TConditionalContainsErrorsRule Constructor | FlexCel Studio for the .NET Framework documentation

TConditionalContainsErrorsRule.TConditionalContainsErrorsRule Constructor

Creates a new instance of TConditionalContainsErrorsRule.

Syntax

Namespace: FlexCel.Core

public TConditionalContainsErrorsRule(Int32 aPriority, Boolean aStopIfTrue)

Parameters

<-> | Parameter | Type | Description
 | aPriority | Int32 | Priority of the rule. 1 means highest priority, and rules with higher numbers will be evaluated later.
 | aStopIfTrue | Boolean | See TConditionalFormatRule.StopIfTrue

See also

  • TConditionalContainsErrorsRule


TConditionalContainsTextRule Class | FlexCel Studio for the .NET Framework documentation

TConditionalContainsTextRule Class

A conditional format rule which highlights cells which contain some text.

Syntax

Namespace: FlexCel.Core

public class TConditionalContainsTextRule: TConditionalBaseTextRule

Constructors

Name | Description
TConditional​Contains​Text​Rule | Creates a new instance of TConditional​Contains​Text​Rule.​


TConditionalContainsTextRule.TConditionalContainsTextRule Constructor | FlexCel Studio for the .NET Framework documentation

TConditionalContainsTextRule.TConditionalContainsTextRule Constructor

Creates a new instance of TConditionalContainsTextRule.

Syntax

Namespace: FlexCel.Core

public TConditionalContainsTextRule(Int32 aPriority, Boolean aStopIfTrue, String aText)

Parameters

<-> | Parameter | Type | Description
 | aPriority | Int32 | Priority of the rule. 1 means highest priority, and rules with higher numbers will be evaluated later.
 | aStopIfTrue | Boolean | See TConditionalFormatRule.StopIfTrue
 | aText | String | Text to search for.

See also

  • TConditionalContainsTextRule


TConditionalDataBarRule Class | FlexCel Studio for the .NET Framework documentation

TConditionalDataBarRule Class

A conditional format rule specified as a Data Bar.

Syntax

Namespace: FlexCel.Core

public class TConditionalDataBarRule: TConditionalFormatValuesRule

Constructors

Name | Description
TConditional​Data​BarRule | Creates a new instance of TConditional​Data​BarRule.​

Methods

Name | Description
Equals | Returns true if this object is equal to obj.
GetHashCode | Returns the hashcode for this object.
Clone | Returns a deep copy of the object.
CheckIsValid | Checks if the rule is valid. This check will be applied automatically when you try to add a conditional format to a sheet, so there is no need to call this method directly. But you can use it to know if a conditional format will be rejected when you try to add it.

Properties

Name | Description
FormatDef | Format to apply when the rule evaluates to true.


TConditionalDataBarRule.TConditionalDataBarRule Constructor | FlexCel Studio for the .NET Framework documentation

TConditionalDataBarRule.TConditionalDataBarRule Constructor

Creates a new instance of TConditionalDataBarRule.

Syntax

Namespace: FlexCel.Core

public TConditionalDataBarRule(Int32 aPriority, String aFormula)

Parameters

<-> | Parameter | Type | Description
 | aPriority | Int32 | Priority of the rule. 1 means highest priority, and rules with higher numbers will be evaluated later.
 | aFormula | String | Formula that defines if the format will be shown or not. A value of 0 or false means that the conditional format won't be displayed. If the formula is empty or returns another value, the format will be displayed. Note that there is no way to enter a formula in the Excel UI for this cases: From Excel the formula will always be empty. But if you create a file with a formula, it will be honored and preserved when you open it in Excel.

See also

  • TConditionalDataBarRule


TConditionalDataBarRule.Equals Method | FlexCel Studio for the .NET Framework documentation

TConditionalDataBarRule.Equals Method

Returns true if this object is equal to obj.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TConditionalDataBarRule


TConditionalDataBarRule.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TConditionalDataBarRule.GetHashCode Method

Returns the hashcode for this object.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TConditionalDataBarRule


TConditionalDataBarRule.Clone Method | FlexCel Studio for the .NET Framework documentation

TConditionalDataBarRule.Clone Method

Returns a deep copy of the object.

Syntax

Namespace: FlexCel.Core

public override TConditionalFormatRule Clone()

See also

  • TConditionalDataBarRule


TConditionalDataBarRule.CheckIsValid Method | FlexCel Studio for the .NET Framework documentation

TConditionalDataBarRule.CheckIsValid Method

Checks if the rule is valid. This check will be applied automatically when you try to add a conditional format to a sheet, so there is no need to call this method directly. But you can use it to know if a conditional format will be rejected when you try to add it.

Syntax

Namespace: FlexCel.Core

public override CondFmtError CheckIsValid()

See also

  • TConditionalDataBarRule


TConditionalDataBarRule.FormatDef Property | FlexCel Studio for the .NET Framework documentation

TConditionalDataBarRule.FormatDef Property

Format to apply when the rule evaluates to true.

Syntax

Namespace: FlexCel.Core

public TConditionalFormatDefDataBar FormatDef { get; }

See also

  • TConditionalDataBarRule


TConditionalDuplicateValuesRule Class | FlexCel Studio for the .NET Framework documentation

TConditionalDuplicateValuesRule Class

A conditional format rule which highlights duplicated values.

Syntax

Namespace: FlexCel.Core

public class TConditionalDuplicateValuesRule: TConditionalFormatStandardDefRule

Constructors

Name | Description
TConditional​Duplicate​Values​Rule | Creates a new instance of TConditional​Duplicate​Value​Rule.​


TConditionalDuplicateValuesRule.TConditionalDuplicateValuesRule Constructor | FlexCel Studio for the .NET Framework documentation

TConditionalDuplicateValuesRule.TConditionalDuplicateValuesRule Constructor

Creates a new instance of TConditionalDuplicateValueRule.

Syntax

Namespace: FlexCel.Core

public TConditionalDuplicateValuesRule(Int32 aPriority, Boolean aStopIfTrue)

Parameters

<-> | Parameter | Type | Description
 | aPriority | Int32 | Priority of the rule. 1 means highest priority, and rules with higher numbers will be evaluated later.
 | aStopIfTrue | Boolean | See TConditionalFormatRule.StopIfTrue

See also

  • TConditionalDuplicateValuesRule


TConditionalEndsWithTextRule Class | FlexCel Studio for the .NET Framework documentation

TConditionalEndsWithTextRule Class

A conditional format rule which highlights cells which end with some text.

Syntax

Namespace: FlexCel.Core

public class TConditionalEndsWithTextRule: TConditionalBaseTextRule

Constructors

Name | Description
TConditional​Ends​With​Text​Rule | Creates a new instance of TConditional​Begins​With​Text​Rule.​


TConditionalEndsWithTextRule.TConditionalEndsWithTextRule Constructor | FlexCel Studio for the .NET Framework documentation

TConditionalEndsWithTextRule.TConditionalEndsWithTextRule Constructor

Creates a new instance of TConditionalBeginsWithTextRule.

Syntax

Namespace: FlexCel.Core

public TConditionalEndsWithTextRule(Int32 aPriority, Boolean aStopIfTrue, String aText)

Parameters

<-> | Parameter | Type | Description
 | aPriority | Int32 | Priority of the rule. 1 means highest priority, and rules with higher numbers will be evaluated later.
 | aStopIfTrue | Boolean | See TConditionalFormatRule.StopIfTrue
 | aText | String | Text to search for.

See also

  • TConditionalEndsWithTextRule


TConditionalExpressionRule Class | FlexCel Studio for the .NET Framework documentation

TConditionalExpressionRule Class

A conditional format rule specified by a formula.

Syntax

Namespace: FlexCel.Core

public class TConditionalExpressionRule: TConditionalFormatStandardDefRule

Constructors

Name | Description
TConditional​Expression​Rule | Creates a new instance of TConditional​Expression​Rule.​

Methods

Name | Description
Equals | Returns true if this object is equal to obj.
GetHashCode | Returns the hashcode for this object.

Properties

Name | Description
Formula | The formula to be evaluated. The conditional format will be applied when it evaluates to true. Note that with relative references, we always consider "A1" to be the cell where the format is. This means that the formula: "=$A$1 + A1" when evaluated in Cell B8, will read "=$A$1 + B8". To provide a negative offset, you need to wrap the formula. For example "=A1048575" will evaluate to B7 when evaluated in B8. In Icon sets, Data bars and Color Scales, the formula specifies if the conditional format is applied or not. This is not an option in the Excel UI, but you can specify it in the file and Excel will obey it. ...[more]


TConditionalExpressionRule.TConditionalExpressionRule Constructor | FlexCel Studio for the .NET Framework documentation

TConditionalExpressionRule.TConditionalExpressionRule Constructor

Creates a new instance of TConditionalExpressionRule.

Syntax

Namespace: FlexCel.Core

public TConditionalExpressionRule(Int32 aPriority, Boolean aStopIfTrue, String aFormula)

Parameters

<-> | Parameter | Type | Description
 | aPriority | Int32 | Priority of the rule. 1 means highest priority, and rules with higher numbers will be evaluated later.
 | aStopIfTrue | Boolean | See TConditionalFormatRule.StopIfTrue
 | aFormula | String | See Formula

See also

  • TConditionalExpressionRule


TConditionalExpressionRule.Equals Method | FlexCel Studio for the .NET Framework documentation

TConditionalExpressionRule.Equals Method

Returns true if this object is equal to obj.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TConditionalExpressionRule


TConditionalExpressionRule.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TConditionalExpressionRule.GetHashCode Method

Returns the hashcode for this object.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TConditionalExpressionRule


TConditionalExpressionRule.Formula Property | FlexCel Studio for the .NET Framework documentation

TConditionalExpressionRule.Formula Property

The formula to be evaluated. The conditional format will be applied when it evaluates to true.

Note that with relative references, we always consider "A1" to be the cell where the format is. This means that the formula: "=$A$1 + A1" when evaluated in Cell B8, will read "=$A$1 + B8". To provide a negative offset, you need to wrap the formula. For example "=A1048575" will evaluate to B7 when evaluated in B8.

In Icon sets, Data bars and Color Scales, the formula specifies if the conditional format is applied or not. This is not an option in the Excel UI, but you can specify it in the file and Excel will obey it.

Syntax

Namespace: FlexCel.Core

public String Formula { get; set; }

See also

  • TConditionalExpressionRule


TConditionalFormat Class | FlexCel Studio for the .NET Framework documentation

TConditionalFormat Class

This class encapsulates a list of conditional formats for a range of cells.

Syntax

Namespace: FlexCel.Core

public class TConditionalFormat

Constructors

Name | Description
TConditionalFormat | Creates a new conditional format.

Methods

Name | Description
CheckIsValid | Checks if the format is valid. This check will be applied automatically when you try to add a conditional format to a sheet, so there is no need to call this method directly. But you can use it to know if a conditional format will be rejected when you try to add it.
Equals | Returns true if both conditional formats are the same.
GetHashCode | Returns the hashcode of the object

Properties

Name | Description
Rules | List of rules that will be applied to the cells.
Ranges | List of cell ranges where this conditional format applies.
IsPivot | If true, then this is a conditional format for a pivot table.


TConditionalFormat.TConditionalFormat Constructor | FlexCel Studio for the .NET Framework documentation

TConditionalFormat.TConditionalFormat Constructor

Creates a new conditional format.

Syntax

Namespace: FlexCel.Core

public TConditionalFormat(TXlsCellRange[] aRanges, TConditionalFormatRule[] aRules, Boolean aIsPivot)

Parameters

<-> | Parameter | Type | Description
 | aRanges | TXlsCellRange[] | List of ranges where this format will apply.
 | aRules | TConditional​Format​Rule[] | List of rules to apply to the cells.
 | aIsPivot | Boolean | If true, then this is a conditional format for a pivot table.

See also

  • TConditionalFormat


TConditionalFormat.CheckIsValid Method | FlexCel Studio for the .NET Framework documentation

TConditionalFormat.CheckIsValid Method

Checks if the format is valid. This check will be applied automatically when you try to add a conditional format to a sheet, so there is no need to call this method directly. But you can use it to know if a conditional format will be rejected when you try to add it.

Syntax

Namespace: FlexCel.Core

public CondFmtError CheckIsValid()

See also

  • TConditionalFormat


TConditionalFormat.Equals Method | FlexCel Studio for the .NET Framework documentation

TConditionalFormat.Equals Method

Returns true if both conditional formats are the same.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TConditionalFormat


TConditionalFormat.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TConditionalFormat.GetHashCode Method

Returns the hashcode of the object

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TConditionalFormat


TConditionalFormat.Rules Property | FlexCel Studio for the .NET Framework documentation

TConditionalFormat.Rules Property

List of rules that will be applied to the cells.

Syntax

Namespace: FlexCel.Core

public TConditionalFormatRule[] Rules { get; set; }

See also

  • TConditionalFormat


TConditionalFormat.Ranges Property | FlexCel Studio for the .NET Framework documentation

TConditionalFormat.Ranges Property

List of cell ranges where this conditional format applies.

Syntax

Namespace: FlexCel.Core

public TXlsCellRange[] Ranges { get; set; }

See also

  • TConditionalFormat


TConditionalFormat.IsPivot Property | FlexCel Studio for the .NET Framework documentation

TConditionalFormat.IsPivot Property

If true, then this is a conditional format for a pivot table.

Syntax

Namespace: FlexCel.Core

public Boolean IsPivot { get; set; }

See also

  • TConditionalFormat


TConditionalFormatColorList Class | FlexCel Studio for the .NET Framework documentation

TConditionalFormatColorList Class

A list of conditional value colors.

Syntax

Namespace: FlexCel.Core

public class TConditionalFormatColorList

Methods

Name | Description
Clone | Returns a deep copy of the list of value objects.
CopyFrom | Copies the values from other list. If this list has values, they will be deleted.
Equals | Returns true if both lists are the same.
GetHashCode | Returns a hashcode for the list.
Add | Adds a color to the list.
Clear | Clears the list.

Properties

Name | Description
Count | Returns the count of objects in the list.
this[] | Returns the color at position index.


TConditionalFormatColorList.Clone Method | FlexCel Studio for the .NET Framework documentation

TConditionalFormatColorList.Clone Method

Returns a deep copy of the list of value objects.

Syntax

Namespace: FlexCel.Core

public TConditionalFormatColorList Clone()

See also

  • TConditionalFormatColorList


TConditionalFormatColorList.CopyFrom Method | FlexCel Studio for the .NET Framework documentation

TConditionalFormatColorList.CopyFrom Method

Copies the values from other list. If this list has values, they will be deleted.

Syntax

Namespace: FlexCel.Core

public void CopyFrom(TConditionalFormatColorList other)

Parameters

<-> | Parameter | Type | Description
 | other | TConditional​Format​Color​List | List from where to copy the values.

See also

  • TConditionalFormatColorList


TConditionalFormatColorList.Equals Method | FlexCel Studio for the .NET Framework documentation

TConditionalFormatColorList.Equals Method

Returns true if both lists are the same.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TConditionalFormatColorList


TConditionalFormatColorList.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TConditionalFormatColorList.GetHashCode Method

Returns a hashcode for the list.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TConditionalFormatColorList


TConditionalFormatColorList.Add Method | FlexCel Studio for the .NET Framework documentation

TConditionalFormatColorList.Add Method

Adds a color to the list.

Syntax

Namespace: FlexCel.Core

public void Add(TExcelColor color)

Parameters

<-> | Parameter | Type | Description
 | color | TExcelColor |

See also

  • TConditionalFormatColorList


TConditionalFormatColorList.Clear Method | FlexCel Studio for the .NET Framework documentation

TConditionalFormatColorList.Clear Method

Clears the list.

Syntax

Namespace: FlexCel.Core

public void Clear()

See also

  • TConditionalFormatColorList


TConditionalFormatColorList.Count Property | FlexCel Studio for the .NET Framework documentation

TConditionalFormatColorList.Count Property

Returns the count of objects in the list.

Syntax

Namespace: FlexCel.Core

public Int32 Count { get; }

See also

  • TConditionalFormatColorList


TConditionalFormatColorList.this[] Property | FlexCel Studio for the .NET Framework documentation

TConditionalFormatColorList.this[] Property

Returns the color at position index.

Syntax

Namespace: FlexCel.Core

public TExcelColor this[] { get; }

See also

  • TConditionalFormatColorList


TConditionalFormatDef Class | FlexCel Studio for the .NET Framework documentation

TConditionalFormatDef Class

The format to apply when a TConditionalFormatRule is applied.

Syntax

Namespace: FlexCel.Core

public abstract class TConditionalFormatDef

Methods

Name | Description
Clone | Returns a deep copy of this object.
CheckIsValid | Checks if the format definition is valid. This check will be applied automatically when you try to add a conditional format to a sheet, so there is no need to call this method directly. But you can use it to know if a conditional format will be rejected when you try to add it.


TConditionalFormatDef.Clone Method | FlexCel Studio for the .NET Framework documentation

TConditionalFormatDef.Clone Method

Returns a deep copy of this object.

Syntax

Namespace: FlexCel.Core

public virtual TConditionalFormatDef Clone()

See also

  • TConditionalFormatDef


TConditionalFormatDef.CheckIsValid Method | FlexCel Studio for the .NET Framework documentation

TConditionalFormatDef.CheckIsValid Method

Checks if the format definition is valid. This check will be applied automatically when you try to add a conditional format to a sheet, so there is no need to call this method directly. But you can use it to know if a conditional format will be rejected when you try to add it.

Syntax

Namespace: FlexCel.Core

public abstract CondFmtError CheckIsValid()

See also

  • TConditionalFormatDef


TConditionalFormatDefColorScale Class | FlexCel Studio for the .NET Framework documentation

TConditionalFormatDefColorScale Class

Defines a format of the color scales in a conditional format.

Syntax

Namespace: FlexCel.Core

public class TConditionalFormatDefColorScale: TConditionalFormatDef

Constructors

Name | Description
TConditional​Format​DefColor​Scale | Creates an empty instance, where no format applies.

Methods

Name | Description
CheckIsValid | Checks if the format definition is valid. This check will be applied automatically when you try to add a conditional format to a sheet, so there is no need to call this method directly. But you can use it to know if a conditional format will be rejected when you try to add it.
Clone | Returns a deep copy of the object.
Equals | Returns true if this object is equal to obj.
GetHashCode | Returns the hashcode for this object.

Properties

Name | Description
ValuesAndColors | A list of definitions and colors for the color scale.


TConditionalFormatDefColorScale.TConditionalFormatDefColorScale Constructor | FlexCel Studio for the .NET Framework documentation

TConditionalFormatDefColorScale.TConditionalFormatDefColorScale Constructor

Creates an empty instance, where no format applies.

Syntax

Namespace: FlexCel.Core

public TConditionalFormatDefColorScale()

See also

  • TConditionalFormatDefColorScale


TConditionalFormatDefColorScale.CheckIsValid Method | FlexCel Studio for the .NET Framework documentation

TConditionalFormatDefColorScale.CheckIsValid Method

Checks if the format definition is valid. This check will be applied automatically when you try to add a conditional format to a sheet, so there is no need to call this method directly. But you can use it to know if a conditional format will be rejected when you try to add it.

Syntax

Namespace: FlexCel.Core

public override CondFmtError CheckIsValid()

See also

  • TConditionalFormatDefColorScale


TConditionalFormatDefColorScale.Clone Method | FlexCel Studio for the .NET Framework documentation

TConditionalFormatDefColorScale.Clone Method

Returns a deep copy of the object.

Syntax

Namespace: FlexCel.Core

public override TConditionalFormatDef Clone()

See also

  • TConditionalFormatDefColorScale


TConditionalFormatDefColorScale.Equals Method | FlexCel Studio for the .NET Framework documentation

TConditionalFormatDefColorScale.Equals Method

Returns true if this object is equal to obj.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TConditionalFormatDefColorScale


TConditionalFormatDefColorScale.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TConditionalFormatDefColorScale.GetHashCode Method

Returns the hashcode for this object.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TConditionalFormatDefColorScale


TConditionalFormatDefColorScale.ValuesAndColors Property | FlexCel Studio for the .NET Framework documentation

TConditionalFormatDefColorScale.ValuesAndColors Property

A list of definitions and colors for the color scale.

Syntax

Namespace: FlexCel.Core

public TConditionalFormatValueAndColorList ValuesAndColors { get; }

See also

  • TConditionalFormatDefColorScale


TConditionalFormatDefDataBar Class | FlexCel Studio for the .NET Framework documentation

TConditionalFormatDefDataBar Class

Defines a format of the databars in a conditional format.

Syntax

Namespace: FlexCel.Core

public class TConditionalFormatDefDataBar: TConditionalFormatDef

Constructors

Name | Description
TConditional​Format​DefDataBar | Creates an empty instance, where no format applies.

Methods

Name | Description
CheckIsValid | Checks if the format definition is valid. This check will be applied automatically when you try to add a conditional format to a sheet, so there is no need to call this method directly. But you can use it to know if a conditional format will be rejected when you try to add it.
Clone | Returns a deep copy of the object.
Equals | Returns true if this object is equal to obj.
GetHashCode | Returns the hashcode for this object.

Properties

Name | Description
MinLengthValue | A condition that specifies the value that corresponds with the minimum length of the databar.
MaxLengthValue | A condition that specifies the value that corresponds with the maximum length of the databar.
Colors | Colors that define the databar.
MinBarWidth | The minimum length of the data bar, as a percentage of the cell width.
MaxBarWidth | The maximum length of the data bar, as a percentage of the cell width.
ShowValues | If true, we will show the values in the cell where the databar is.
HasBorders | If true the databar has a border.
IsGradient | If true the fill will be a gradient, otherwise it will be a solid color.
Direction | Direction of the databar.
IsNegativeBar​Color​Same​AsPositive | If true, the negative bars have the same color as the positives.
IsNegativeBar​Border​Color​Same​AsPositive | If true, the borders of the negative bars are the same color as the positives.
AxisPosition | Position for the axis.


TConditionalFormatDefDataBar.TConditionalFormatDefDataBar Constructor | FlexCel Studio for the .NET Framework documentation

TConditionalFormatDefDataBar.TConditionalFormatDefDataBar Constructor

Creates an empty instance, where no format applies.

Syntax

Namespace: FlexCel.Core

public TConditionalFormatDefDataBar()

See also

  • TConditionalFormatDefDataBar


TConditionalFormatDefDataBar.CheckIsValid Method | FlexCel Studio for the .NET Framework documentation

TConditionalFormatDefDataBar.CheckIsValid Method

Checks if the format definition is valid. This check will be applied automatically when you try to add a conditional format to a sheet, so there is no need to call this method directly. But you can use it to know if a conditional format will be rejected when you try to add it.

Syntax

Namespace: FlexCel.Core

public override CondFmtError CheckIsValid()

See also

  • TConditionalFormatDefDataBar


TConditionalFormatDefDataBar.Clone Method | FlexCel Studio for the .NET Framework documentation

TConditionalFormatDefDataBar.Clone Method

Returns a deep copy of the object.

Syntax

Namespace: FlexCel.Core

public override TConditionalFormatDef Clone()

See also

  • TConditionalFormatDefDataBar


TConditionalFormatDefDataBar.Equals Method | FlexCel Studio for the .NET Framework documentation

TConditionalFormatDefDataBar.Equals Method

Returns true if this object is equal to obj.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TConditionalFormatDefDataBar


TConditionalFormatDefDataBar.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TConditionalFormatDefDataBar.GetHashCode Method

Returns the hashcode for this object.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TConditionalFormatDefDataBar


TConditionalFormatDefDataBar.MinLengthValue Property | FlexCel Studio for the .NET Framework documentation

TConditionalFormatDefDataBar.MinLengthValue Property

A condition that specifies the value that corresponds with the minimum length of the databar.

Syntax

Namespace: FlexCel.Core

public TConditionalFormatValueObject MinLengthValue { get; set; }

See also

  • TConditionalFormatDefDataBar


TConditionalFormatDefDataBar.MaxLengthValue Property | FlexCel Studio for the .NET Framework documentation

TConditionalFormatDefDataBar.MaxLengthValue Property

A condition that specifies the value that corresponds with the maximum length of the databar.

Syntax

Namespace: FlexCel.Core

public TConditionalFormatValueObject MaxLengthValue { get; set; }

See also

  • TConditionalFormatDefDataBar


TConditionalFormatDefDataBar.Colors Property | FlexCel Studio for the .NET Framework documentation

TConditionalFormatDefDataBar.Colors Property

Colors that define the databar.

Syntax

Namespace: FlexCel.Core

public TDataBarColors Colors { get; }

See also

  • TConditionalFormatDefDataBar


TConditionalFormatDefDataBar.MinBarWidth Property | FlexCel Studio for the .NET Framework documentation

TConditionalFormatDefDataBar.MinBarWidth Property

The minimum length of the data bar, as a percentage of the cell width.

Syntax

Namespace: FlexCel.Core

public Int32 MinBarWidth { get; set; }

See also

  • TConditionalFormatDefDataBar


TConditionalFormatDefDataBar.MaxBarWidth Property | FlexCel Studio for the .NET Framework documentation

TConditionalFormatDefDataBar.MaxBarWidth Property

The maximum length of the data bar, as a percentage of the cell width.

Syntax

Namespace: FlexCel.Core

public Int32 MaxBarWidth { get; set; }

See also

  • TConditionalFormatDefDataBar


TConditionalFormatDefDataBar.ShowValues Property | FlexCel Studio for the .NET Framework documentation

TConditionalFormatDefDataBar.ShowValues Property

If true, we will show the values in the cell where the databar is.

Syntax

Namespace: FlexCel.Core

public Boolean ShowValues { get; set; }

See also

  • TConditionalFormatDefDataBar


TConditionalFormatDefDataBar.HasBorders Property | FlexCel Studio for the .NET Framework documentation

TConditionalFormatDefDataBar.HasBorders Property

If true the databar has a border.

Syntax

Namespace: FlexCel.Core

public Boolean HasBorders { get; set; }

See also

  • TConditionalFormatDefDataBar


TConditionalFormatDefDataBar.IsGradient Property | FlexCel Studio for the .NET Framework documentation

TConditionalFormatDefDataBar.IsGradient Property

If true the fill will be a gradient, otherwise it will be a solid color.

Syntax

Namespace: FlexCel.Core

public Boolean IsGradient { get; set; }

See also

  • TConditionalFormatDefDataBar


TConditionalFormatDefDataBar.Direction Property | FlexCel Studio for the .NET Framework documentation

TConditionalFormatDefDataBar.Direction Property

Direction of the databar.

Syntax

Namespace: FlexCel.Core

public TDataBarDirection Direction { get; set; }

See also

  • TConditionalFormatDefDataBar


TConditionalFormatDefDataBar.IsNegativeBarColorSameAsPositive Property | FlexCel Studio for the .NET Framework documentation

TConditionalFormatDefDataBar.IsNegativeBarColorSameAsPositive Property

If true, the negative bars have the same color as the positives.

Syntax

Namespace: FlexCel.Core

public Boolean IsNegativeBarColorSameAsPositive { get; set; }

See also

  • TConditionalFormatDefDataBar


TConditionalFormatDefDataBar.IsNegativeBarBorderColorSameAsPositive Property | FlexCel Studio for the .NET Framework documentation

TConditionalFormatDefDataBar.IsNegativeBarBorderColorSameAsPositive Property

If true, the borders of the negative bars are the same color as the positives.

Syntax

Namespace: FlexCel.Core

public Boolean IsNegativeBarBorderColorSameAsPositive { get; set; }

See also

  • TConditionalFormatDefDataBar


TConditionalFormatDefDataBar.AxisPosition Property | FlexCel Studio for the .NET Framework documentation

TConditionalFormatDefDataBar.AxisPosition Property

Position for the axis.

Syntax

Namespace: FlexCel.Core

public TDataBarAxisPosition AxisPosition { get; set; }

See also

  • TConditionalFormatDefDataBar


TConditionalFormatDefIconSet Class | FlexCel Studio for the .NET Framework documentation

TConditionalFormatDefIconSet Class

Defines a format of the color scales in a conditional format.

Syntax

Namespace: FlexCel.Core

public class TConditionalFormatDefIconSet: TConditionalFormatDef

Constructors

Name | Description
TConditional​Format​DefIconSet | Creates an empty instance, where no format applies.

Methods

Name | Description
CheckIsValid | Checks if the format definition is valid. This check will be applied automatically when you try to add a conditional format to a sheet, so there is no need to call this method directly. But you can use it to know if a conditional format will be rejected when you try to add it.
GetIconCount | Returns the number of icons for a given iconset.
Clone | Returns a deep copy of the object.
Equals | Returns true if this object is equal to obj.
GetHashCode | Returns the hashcode for this object.

Properties

Name | Description
Values | A list of definitions and colors for the Icon Set. It must have the same number of values as the count of the icons in the set - 1. ...[more]
IconSet | The set of icons used in the conditional format.
Reverse | If true the icons will be reversed.
ShowValues | If false the cell values will not be shown.
CustomIcons | Use this property to mix and match icons from different iconsets. If null, then only the standard icons from the set will be used.
IsCustom | Returns true if CustomIcons is not empty.


TConditionalFormatDefIconSet.TConditionalFormatDefIconSet Constructor | FlexCel Studio for the .NET Framework documentation

TConditionalFormatDefIconSet.TConditionalFormatDefIconSet Constructor

Creates an empty instance, where no format applies.

Syntax

Namespace: FlexCel.Core

public TConditionalFormatDefIconSet()

See also

  • TConditionalFormatDefIconSet


TConditionalFormatDefIconSet.CheckIsValid Method | FlexCel Studio for the .NET Framework documentation

TConditionalFormatDefIconSet.CheckIsValid Method

Checks if the format definition is valid. This check will be applied automatically when you try to add a conditional format to a sheet, so there is no need to call this method directly. But you can use it to know if a conditional format will be rejected when you try to add it.

Syntax

Namespace: FlexCel.Core

public override CondFmtError CheckIsValid()

See also

  • TConditionalFormatDefIconSet


TConditionalFormatDefIconSet.GetIconCount Method | FlexCel Studio for the .NET Framework documentation

TConditionalFormatDefIconSet.GetIconCount Method

Returns the number of icons for a given iconset.

Syntax

Namespace: FlexCel.Core

public static Int32 GetIconCount(TCondFmtIconSet IconSet)

Parameters

<-> | Parameter | Type | Description
 | IconSet | TCondFmtIconSet | Iconset for which we want to know the number of icons.

Returns

The number of icons in the set.

See also

  • TConditionalFormatDefIconSet


TConditionalFormatDefIconSet.Clone Method | FlexCel Studio for the .NET Framework documentation

TConditionalFormatDefIconSet.Clone Method

Returns a deep copy of the object.

Syntax

Namespace: FlexCel.Core

public override TConditionalFormatDef Clone()

See also

  • TConditionalFormatDefIconSet


TConditionalFormatDefIconSet.Equals Method | FlexCel Studio for the .NET Framework documentation

TConditionalFormatDefIconSet.Equals Method

Returns true if this object is equal to obj.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TConditionalFormatDefIconSet


TConditionalFormatDefIconSet.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TConditionalFormatDefIconSet.GetHashCode Method

Returns the hashcode for this object.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TConditionalFormatDefIconSet


TConditionalFormatDefIconSet.Values Property | FlexCel Studio for the .NET Framework documentation

TConditionalFormatDefIconSet.Values Property

A list of definitions and colors for the Icon Set. It must have the same number of values as the count of the icons in the set - 1.

  • If the value is <(=) Values[0] then use icon 0.
  • else if the value is <(=) Values[1] then use icon 1.
  • else if the value is <(=) Values[n - 1] then use icon n - 1.
  • else use icon n.

Syntax

Namespace: FlexCel.Core

public TConditionalFormatValueList Values { get; }

See also

  • TConditionalFormatDefIconSet


TConditionalFormatDefIconSet.IconSet Property | FlexCel Studio for the .NET Framework documentation

TConditionalFormatDefIconSet.IconSet Property

The set of icons used in the conditional format.

Syntax

Namespace: FlexCel.Core

public TCondFmtIconSet IconSet { get; set; }

See also

  • TConditionalFormatDefIconSet


TConditionalFormatDefIconSet.Reverse Property | FlexCel Studio for the .NET Framework documentation

TConditionalFormatDefIconSet.Reverse Property

If true the icons will be reversed.

Syntax

Namespace: FlexCel.Core

public Boolean Reverse { get; set; }

See also

  • TConditionalFormatDefIconSet


TConditionalFormatDefIconSet.ShowValues Property | FlexCel Studio for the .NET Framework documentation

TConditionalFormatDefIconSet.ShowValues Property

If false the cell values will not be shown.

Syntax

Namespace: FlexCel.Core

public Boolean ShowValues { get; set; }

See also

  • TConditionalFormatDefIconSet


TConditionalFormatDefIconSet.CustomIcons Property | FlexCel Studio for the .NET Framework documentation

TConditionalFormatDefIconSet.CustomIcons Property

Use this property to mix and match icons from different iconsets. If null, then only the standard icons from the set will be used.

Syntax

Namespace: FlexCel.Core

public TConditionalFormatCustomIconDef[] CustomIcons { get; set; }

See also

  • TConditionalFormatDefIconSet


TConditionalFormatDefIconSet.IsCustom Property | FlexCel Studio for the .NET Framework documentation

TConditionalFormatDefIconSet.IsCustom Property

Returns true if CustomIcons is not empty.

Syntax

Namespace: FlexCel.Core

public Boolean IsCustom { get; }

See also

  • TConditionalFormatDefIconSet


TConditionalFormatDefStandard Class | FlexCel Studio for the .NET Framework documentation

TConditionalFormatDefStandard Class

Defines a format to apply for cells when a rule evaluates to true.

Syntax

Namespace: FlexCel.Core

public class TConditionalFormatDefStandard: TConditionalFormatDef

Fields

Name | Description
ApplyFont | Specifies which properties of Font will be applied in the final format.
Font | The definition of the font. Only those properties true in ApplyFont will be used.
ApplyFill | Specifies which properties of Fill will be applied in the final format.
Fill | Fill properties that will be applied. Only those in ApplyFill will be used.
ApplyBorders | Defines which borders will be applied to the final format.
Borders | Defines the borders. Only those borders where ApplyBorders is true will be used.

Constructors

Name | Description
TConditional​Format​DefStandard | Creates an empty instance, where no format applies.

Methods

Name | Description
CheckIsValid | Checks if the format definition is valid. This check will be applied automatically when you try to add a conditional format to a sheet, so there is no need to call this method directly. But you can use it to know if a conditional format will be rejected when you try to add it.
Clone | Returns a deep copy of the object.
Equals | Returns true if this object is equal to obj.
GetHashCode | Returns the hashcode for this object.

Properties

Name | Description
NumericFormat | Numeric format for the cell, when ApplyNumericFormat is true.
ApplyNumericFormat | When true the format specified in NumericFormat will be applied, else it will be ignored.
HasFontBlock | Returns true if any font formatting is applied
HasBorderBlock | Returns true if any border formatting is applied.
HasFillBlock | Returns true if any pattern formatting is applied.
HasNumericFormat​Block | Returns true if the numeric format is applied.
HasFormat | Returns true if any format is applied.


TConditionalFormatDefStandard.ApplyFont Field | FlexCel Studio for the .NET Framework documentation

TConditionalFormatDefStandard.ApplyFont Field

Specifies which properties of Font will be applied in the final format.

Syntax

Namespace: FlexCel.Core

public TCondFmtApplyFont ApplyFont

See also

  • TConditionalFormatDefStandard


TConditionalFormatDefStandard.Font Field | FlexCel Studio for the .NET Framework documentation

TConditionalFormatDefStandard.Font Field

The definition of the font. Only those properties true in ApplyFont will be used.

Syntax

Namespace: FlexCel.Core

public TCondFmtFont Font

See also

  • TConditionalFormatDefStandard


TConditionalFormatDefStandard.ApplyFill Field | FlexCel Studio for the .NET Framework documentation

TConditionalFormatDefStandard.ApplyFill Field

Specifies which properties of Fill will be applied in the final format.

Syntax

Namespace: FlexCel.Core

public TCondFmtApplyFill ApplyFill

See also

  • TConditionalFormatDefStandard


TConditionalFormatDefStandard.Fill Field | FlexCel Studio for the .NET Framework documentation

TConditionalFormatDefStandard.Fill Field

Fill properties that will be applied. Only those in ApplyFill will be used.

Syntax

Namespace: FlexCel.Core

public TFlxFillPattern Fill

See also

  • TConditionalFormatDefStandard


TConditionalFormatDefStandard.ApplyBorders Field | FlexCel Studio for the .NET Framework documentation

TConditionalFormatDefStandard.ApplyBorders Field

Defines which borders will be applied to the final format.

Syntax

Namespace: FlexCel.Core

public TCondFmtApplyBorders ApplyBorders

See also

  • TConditionalFormatDefStandard


TConditionalFormatDefStandard.Borders Field | FlexCel Studio for the .NET Framework documentation

TConditionalFormatDefStandard.Borders Field

Defines the borders. Only those borders where ApplyBorders is true will be used.

Syntax

Namespace: FlexCel.Core

public TCondFmtBorders Borders

See also

  • TConditionalFormatDefStandard


TConditionalFormatDefStandard.TConditionalFormatDefStandard Constructor | FlexCel Studio for the .NET Framework documentation

TConditionalFormatDefStandard.TConditionalFormatDefStandard Constructor

Creates an empty instance, where no format applies.

Syntax

Namespace: FlexCel.Core

public TConditionalFormatDefStandard()

See also

  • TConditionalFormatDefStandard


TConditionalFormatDefStandard.CheckIsValid Method | FlexCel Studio for the .NET Framework documentation

TConditionalFormatDefStandard.CheckIsValid Method

Checks if the format definition is valid. This check will be applied automatically when you try to add a conditional format to a sheet, so there is no need to call this method directly. But you can use it to know if a conditional format will be rejected when you try to add it.

Syntax

Namespace: FlexCel.Core

public override CondFmtError CheckIsValid()

See also

  • TConditionalFormatDefStandard


TConditionalFormatDefStandard.Clone Method | FlexCel Studio for the .NET Framework documentation

TConditionalFormatDefStandard.Clone Method

Returns a deep copy of the object.

Syntax

Namespace: FlexCel.Core

public override TConditionalFormatDef Clone()

See also

  • TConditionalFormatDefStandard


TConditionalFormatDefStandard.Equals Method | FlexCel Studio for the .NET Framework documentation

TConditionalFormatDefStandard.Equals Method

Returns true if this object is equal to obj.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TConditionalFormatDefStandard


TConditionalFormatDefStandard.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TConditionalFormatDefStandard.GetHashCode Method

Returns the hashcode for this object.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TConditionalFormatDefStandard


TConditionalFormatDefStandard.NumericFormat Property | FlexCel Studio for the .NET Framework documentation

TConditionalFormatDefStandard.NumericFormat Property

Numeric format for the cell, when ApplyNumericFormat is true.

Syntax

Namespace: FlexCel.Core

public String NumericFormat { get; set; }

See also

  • TConditionalFormatDefStandard


TConditionalFormatDefStandard.ApplyNumericFormat Property | FlexCel Studio for the .NET Framework documentation

TConditionalFormatDefStandard.ApplyNumericFormat Property

When true the format specified in NumericFormat will be applied, else it will be ignored.

Syntax

Namespace: FlexCel.Core

public Boolean ApplyNumericFormat { get; set; }

See also

  • TConditionalFormatDefStandard


TConditionalFormatDefStandard.HasFontBlock Property | FlexCel Studio for the .NET Framework documentation

TConditionalFormatDefStandard.HasFontBlock Property

Returns true if any font formatting is applied

Syntax

Namespace: FlexCel.Core

public Boolean HasFontBlock { get; }

See also

  • TConditionalFormatDefStandard


TConditionalFormatDefStandard.HasBorderBlock Property | FlexCel Studio for the .NET Framework documentation

TConditionalFormatDefStandard.HasBorderBlock Property

Returns true if any border formatting is applied.

Syntax

Namespace: FlexCel.Core

public Boolean HasBorderBlock { get; }

See also

  • TConditionalFormatDefStandard


TConditionalFormatDefStandard.HasFillBlock Property | FlexCel Studio for the .NET Framework documentation

TConditionalFormatDefStandard.HasFillBlock Property

Returns true if any pattern formatting is applied.

Syntax

Namespace: FlexCel.Core

public Boolean HasFillBlock { get; }

See also

  • TConditionalFormatDefStandard


TConditionalFormatDefStandard.HasNumericFormatBlock Property | FlexCel Studio for the .NET Framework documentation

TConditionalFormatDefStandard.HasNumericFormatBlock Property

Returns true if the numeric format is applied.

Syntax

Namespace: FlexCel.Core

public Boolean HasNumericFormatBlock { get; }

See also

  • TConditionalFormatDefStandard


TConditionalFormatDefStandard.HasFormat Property | FlexCel Studio for the .NET Framework documentation

TConditionalFormatDefStandard.HasFormat Property

Returns true if any format is applied.

Syntax

Namespace: FlexCel.Core

public Boolean HasFormat { get; }

See also

  • TConditionalFormatDefStandard


TConditionalFormatRule Class | FlexCel Studio for the .NET Framework documentation

TConditionalFormatRule Class

A rule specifying a conditional format. You cannot create instances of this class, only of their children.

Syntax

Namespace: FlexCel.Core

public abstract class TConditionalFormatRule

Constructors

Name | Description
TConditional​Format​Rule | Creates a new instance of TConditional​Format​Rule, with the corresponding Format definition.

Methods

Name | Description
Equals | Returns true if this object is equal to obj.
GetHashCode | Returns the hashcode for this object.
Clone | Returns a deep copy of the object.
CheckIsValid | Checks if the rule is valid. This check will be applied automatically when you try to add a conditional format to a sheet, so there is no need to call this method directly. But you can use it to know if a conditional format will be rejected when you try to add it.

Properties

Name | Description
Kind | Defines which kind of conditional rule this object contains. FormatDef will contain a subclass that must match the kind here.
Priority | Priority for the rule. 1 means highest priority and higher number mean that the rule will be evaluated later. Note that priorities of all conditional rules must be unique on the sheet. If you specify a duplicated priority, all other priorities might be shifted when you save the file so they keep being unique.
StopIfTrue | When true, rules after this one will not evaluate if this one applies. Only Applies to Excel 2007 or newer, and it doesn't apply to DataBars, IconSets or ColorScales.


TConditionalFormatRule.TConditionalFormatRule Constructor | FlexCel Studio for the .NET Framework documentation

TConditionalFormatRule.TConditionalFormatRule Constructor

Creates a new instance of TConditionalFormatRule, with the corresponding Format definition.

Syntax

Namespace: FlexCel.Core

protected TConditionalFormatRule(TConditionalFormatKind aKind, Int32 aPriority, Boolean aStopIfTrue)

Parameters

<-> | Parameter | Type | Description
 | aKind | TConditional​Format​Kind | Kind of conditional rule this instance contains.
 | aPriority | Int32 | Priority of the rule. 1 means highest priority, and rules with higher numbers will be evaluated later. Note that priorities must be unique on the sheet. If you specify a duplicated priority, all other priorities might be shifted when you save the file so they keep being unique.
 | aStopIfTrue | Boolean | Only valid on Excel 2007 or newer, and it doesn't apply to DataBars, IconSets or ColorScales. If true, no more conditional format rules after this one will be applied if this rule applies.

See also

  • TConditionalFormatRule


TConditionalFormatRule.Equals Method | FlexCel Studio for the .NET Framework documentation

TConditionalFormatRule.Equals Method

Returns true if this object is equal to obj.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TConditionalFormatRule


TConditionalFormatRule.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TConditionalFormatRule.GetHashCode Method

Returns the hashcode for this object.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TConditionalFormatRule


TConditionalFormatRule.Clone Method | FlexCel Studio for the .NET Framework documentation

TConditionalFormatRule.Clone Method

Returns a deep copy of the object.

Syntax

Namespace: FlexCel.Core

public virtual TConditionalFormatRule Clone()

See also

  • TConditionalFormatRule


TConditionalFormatRule.CheckIsValid Method | FlexCel Studio for the .NET Framework documentation

TConditionalFormatRule.CheckIsValid Method

Checks if the rule is valid. This check will be applied automatically when you try to add a conditional format to a sheet, so there is no need to call this method directly. But you can use it to know if a conditional format will be rejected when you try to add it.

Syntax

Namespace: FlexCel.Core

public virtual CondFmtError CheckIsValid()

See also

  • TConditionalFormatRule


TConditionalFormatRule.Kind Property | FlexCel Studio for the .NET Framework documentation

TConditionalFormatRule.Kind Property

Defines which kind of conditional rule this object contains. FormatDef will contain a subclass that must match the kind here.

Syntax

Namespace: FlexCel.Core

public TConditionalFormatKind Kind { get; set; }

See also

  • TConditionalFormatRule


TConditionalFormatRule.Priority Property | FlexCel Studio for the .NET Framework documentation

TConditionalFormatRule.Priority Property

Priority for the rule. 1 means highest priority and higher number mean that the rule will be evaluated later. Note that priorities of all conditional rules must be unique on the sheet. If you specify a duplicated priority, all other priorities might be shifted when you save the file so they keep being unique.

Syntax

Namespace: FlexCel.Core

public Int32 Priority { get; set; }

See also

  • TConditionalFormatRule


TConditionalFormatRule.StopIfTrue Property | FlexCel Studio for the .NET Framework documentation

TConditionalFormatRule.StopIfTrue Property

When true, rules after this one will not evaluate if this one applies. Only Applies to Excel 2007 or newer, and it doesn't apply to DataBars, IconSets or ColorScales.

Syntax

Namespace: FlexCel.Core

public Boolean StopIfTrue { get; set; }

See also

  • TConditionalFormatRule


TConditionalFormatStandardDefRule Class | FlexCel Studio for the .NET Framework documentation

TConditionalFormatStandardDefRule Class

A conditional format rule which modifies the cell format (color, font, etc). This is different from other rules as databars or iconsets.

Syntax

Namespace: FlexCel.Core

public abstract class TConditionalFormatStandardDefRule: TConditionalFormatRule

Constructors

Name | Description
TConditional​Format​Standard​DefRule | Creates a new instance of TConditional​Format​Standard​DefRule, with the corresponding Format definition.

Methods

Name | Description
Equals | Returns true if this object is equal to obj.
GetHashCode | Returns the hashcode for this object.
Clone | Returns a deep copy of the object.
CheckIsValid | Checks if the rule is valid. This check will be applied automatically when you try to add a conditional format to a sheet, so there is no need to call this method directly. But you can use it to know if a conditional format will be rejected when you try to add it.

Properties

Name | Description
FormatDef | Format to apply when the rule evaluates to true.


TConditionalFormatStandardDefRule.TConditionalFormatStandardDefRule Constructor | FlexCel Studio for the .NET Framework documentation

TConditionalFormatStandardDefRule.TConditionalFormatStandardDefRule Constructor

Creates a new instance of TConditionalFormatStandardDefRule, with the corresponding Format definition.

Syntax

Namespace: FlexCel.Core

protected TConditionalFormatStandardDefRule(TConditionalFormatKind aKind, Int32 aPriority, Boolean aStopIfTrue)

Parameters

<-> | Parameter | Type | Description
 | aKind | TConditional​Format​Kind | Kind of conditional rule this instance contains.
 | aPriority | Int32 | Priority of the rule. 1 means highest priority, and rules with higher numbers will be evaluated later. Note that priorities must be unique on the sheet. If you specify a duplicated priority, all other priorities might be shifted when you save the file so they keep being unique.
 | aStopIfTrue | Boolean | Only valid on Excel 2007 or newer, and it doesn't apply to DataBars, IconSets or ColorScales. If true, no more conditional format rules after this one will be applied if this rule applies.

See also

  • TConditionalFormatStandardDefRule


TConditionalFormatStandardDefRule.Equals Method | FlexCel Studio for the .NET Framework documentation

TConditionalFormatStandardDefRule.Equals Method

Returns true if this object is equal to obj.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TConditionalFormatStandardDefRule


TConditionalFormatStandardDefRule.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TConditionalFormatStandardDefRule.GetHashCode Method

Returns the hashcode for this object.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TConditionalFormatStandardDefRule


TConditionalFormatStandardDefRule.Clone Method | FlexCel Studio for the .NET Framework documentation

TConditionalFormatStandardDefRule.Clone Method

Returns a deep copy of the object.

Syntax

Namespace: FlexCel.Core

public override TConditionalFormatRule Clone()

See also

  • TConditionalFormatStandardDefRule


TConditionalFormatStandardDefRule.CheckIsValid Method | FlexCel Studio for the .NET Framework documentation

TConditionalFormatStandardDefRule.CheckIsValid Method

Checks if the rule is valid. This check will be applied automatically when you try to add a conditional format to a sheet, so there is no need to call this method directly. But you can use it to know if a conditional format will be rejected when you try to add it.

Syntax

Namespace: FlexCel.Core

public override CondFmtError CheckIsValid()

See also

  • TConditionalFormatStandardDefRule


TConditionalFormatStandardDefRule.FormatDef Property | FlexCel Studio for the .NET Framework documentation

TConditionalFormatStandardDefRule.FormatDef Property

Format to apply when the rule evaluates to true.

Syntax

Namespace: FlexCel.Core

public TConditionalFormatDefStandard FormatDef { get; }

See also

  • TConditionalFormatStandardDefRule


TConditionalFormatValueAndColorList Class | FlexCel Studio for the .NET Framework documentation

TConditionalFormatValueAndColorList Class

A list of conditional value objects with their corresponding colors.

Syntax

Namespace: FlexCel.Core

public class TConditionalFormatValueAndColorList

Methods

Name | Description
Clone | Returns a deep copy of the object.
Equals | Returns true if both objects are the same.
GetHashCode | Returns the hashcode of the object.

Properties

Name | Description
Values | Returns the list of values for this list.
Colors | Returns the list of colors for this list.


TConditionalFormatValueAndColorList.Clone Method | FlexCel Studio for the .NET Framework documentation

TConditionalFormatValueAndColorList.Clone Method

Returns a deep copy of the object.

Syntax

Namespace: FlexCel.Core

public TConditionalFormatValueAndColorList Clone()

See also

  • TConditionalFormatValueAndColorList


TConditionalFormatValueAndColorList.Equals Method | FlexCel Studio for the .NET Framework documentation

TConditionalFormatValueAndColorList.Equals Method

Returns true if both objects are the same.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TConditionalFormatValueAndColorList


TConditionalFormatValueAndColorList.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TConditionalFormatValueAndColorList.GetHashCode Method

Returns the hashcode of the object.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TConditionalFormatValueAndColorList


TConditionalFormatValueAndColorList.Values Property | FlexCel Studio for the .NET Framework documentation

TConditionalFormatValueAndColorList.Values Property

Returns the list of values for this list.

Syntax

Namespace: FlexCel.Core

public TConditionalFormatValueList Values { get; }

See also

  • TConditionalFormatValueAndColorList


TConditionalFormatValueAndColorList.Colors Property | FlexCel Studio for the .NET Framework documentation

TConditionalFormatValueAndColorList.Colors Property

Returns the list of colors for this list.

Syntax

Namespace: FlexCel.Core

public TConditionalFormatColorList Colors { get; }

See also

  • TConditionalFormatValueAndColorList


TConditionalFormatValueList Class | FlexCel Studio for the .NET Framework documentation

TConditionalFormatValueList Class

A list of conditional value objects.

Syntax

Namespace: FlexCel.Core

public class TConditionalFormatValueList

Methods

Name | Description
Clone | Returns a deep copy of the list of value objects.
Equals | Returns true if both lists are the same.
GetHashCode | Returns a hashcode for the list.
Add | Adds the value to the list. Note that this is not a copy which is added, but the real object.
CopyFrom | Copies and replaces the values from a different list.
Clear | Removes all entries in the list.

Properties

Name | Description
Count | Returns the count of objects in the list.
this[] | Returns element at position index.


TConditionalFormatValueList.Clone Method | FlexCel Studio for the .NET Framework documentation

TConditionalFormatValueList.Clone Method

Returns a deep copy of the list of value objects.

Syntax

Namespace: FlexCel.Core

public TConditionalFormatValueList Clone()

See also

  • TConditionalFormatValueList


TConditionalFormatValueList.Equals Method | FlexCel Studio for the .NET Framework documentation

TConditionalFormatValueList.Equals Method

Returns true if both lists are the same.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TConditionalFormatValueList


TConditionalFormatValueList.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TConditionalFormatValueList.GetHashCode Method

Returns a hashcode for the list.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TConditionalFormatValueList


TConditionalFormatValueList.Add Method | FlexCel Studio for the .NET Framework documentation

TConditionalFormatValueList.Add Method

Adds the value to the list. Note that this is not a copy which is added, but the real object.

Syntax

Namespace: FlexCel.Core

public void Add(TConditionalFormatValueObject cfvo)

Parameters

<-> | Parameter | Type | Description
 | cfvo | TConditional​Format​Value​Object |

See also

  • TConditionalFormatValueList


TConditionalFormatValueList.CopyFrom Method | FlexCel Studio for the .NET Framework documentation

TConditionalFormatValueList.CopyFrom Method

Copies and replaces the values from a different list.

Syntax

Namespace: FlexCel.Core

public void CopyFrom(TConditionalFormatValueList other)

Parameters

<-> | Parameter | Type | Description
 | other | TConditional​Format​Value​List |

See also

  • TConditionalFormatValueList


TConditionalFormatValueList.Clear Method | FlexCel Studio for the .NET Framework documentation

TConditionalFormatValueList.Clear Method

Removes all entries in the list.

Syntax

Namespace: FlexCel.Core

public void Clear()

See also

  • TConditionalFormatValueList


TConditionalFormatValueList.Count Property | FlexCel Studio for the .NET Framework documentation

TConditionalFormatValueList.Count Property

Returns the count of objects in the list.

Syntax

Namespace: FlexCel.Core

public Int32 Count { get; }

See also

  • TConditionalFormatValueList


TConditionalFormatValueList.this[] Property | FlexCel Studio for the .NET Framework documentation

TConditionalFormatValueList.this[] Property

Returns element at position index.

Syntax

Namespace: FlexCel.Core

public TConditionalFormatValueObject this[] { get; }

See also

  • TConditionalFormatValueList


TConditionalFormatValueObject Class | FlexCel Studio for the .NET Framework documentation

TConditionalFormatValueObject Class

Describes an interpolation point in a gradient scale.

Syntax

Namespace: FlexCel.Core

public class TConditionalFormatValueObject

Constructors

Name | Description
TConditional​Format​Value​Object | Overloaded TConditionalFormatValueObject TConditionalFormatValueObject(Boolean, TCfvoType, String)

Methods

Name | Description
Clone | Returns a deep copy of the object.
Equals | Returns true if both objects are the same.
GetHashCode | Returns the hashcode of the object.

Properties

Name | Description
GreaterThanOrEqual | If true, then "Greater than or equal" is used as a threshold for applying the rule. If false, "greater than" is used instead. This attribute only applies to icon sets.
VoType | Type of value object.
Value | Value of the object.


TConditionalFormatValueObject.TConditionalFormatValueObject Constructor | FlexCel Studio for the .NET Framework documentation

TConditionalFormatValueObject.TConditionalFormatValueObject Constructor

Overloads

  • TConditionalFormatValueObject.TConditionalFormatValueObject
  • TConditionalFormatValueObject.TConditionalFormatValueObject(Boolean, TCfvoType, String)

TConditionalFormatValueObject.TConditionalFormatValueObject

Creates a new TConditionalFormatValue object.

Syntax

Namespace: FlexCel.Core

public TConditionalFormatValueObject()

See also

  • TConditionalFormatValueObject

TConditionalFormatValueObject.TConditionalFormatValueObject(Boolean, TCfvoType, String)

Creates a new TConditionalFormatValue object.

Syntax

Namespace: FlexCel.Core

public TConditionalFormatValueObject(Boolean aGreaterThanOrEqual, TCfvoType aVoType, String aValue)

Parameters

<-> | Parameter | Type | Description
 | aGreaterThanOrEqual | Boolean |
 | aVoType | TCfvoType |
 | aValue | String |

See also

  • TConditionalFormatValueObject


TConditionalFormatValueObject.Clone Method | FlexCel Studio for the .NET Framework documentation

TConditionalFormatValueObject.Clone Method

Returns a deep copy of the object.

Syntax

Namespace: FlexCel.Core

public TConditionalFormatValueObject Clone()

See also

  • TConditionalFormatValueObject


TConditionalFormatValueObject.Equals Method | FlexCel Studio for the .NET Framework documentation

TConditionalFormatValueObject.Equals Method

Returns true if both objects are the same.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TConditionalFormatValueObject


TConditionalFormatValueObject.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TConditionalFormatValueObject.GetHashCode Method

Returns the hashcode of the object.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TConditionalFormatValueObject


TConditionalFormatValueObject.GreaterThanOrEqual Property | FlexCel Studio for the .NET Framework documentation

TConditionalFormatValueObject.GreaterThanOrEqual Property

If true, then "Greater than or equal" is used as a threshold for applying the rule. If false, "greater than" is used instead. This attribute only applies to icon sets.

Syntax

Namespace: FlexCel.Core

public Boolean GreaterThanOrEqual { get; set; }

See also

  • TConditionalFormatValueObject


TConditionalFormatValueObject.VoType Property | FlexCel Studio for the .NET Framework documentation

TConditionalFormatValueObject.VoType Property

Type of value object.

Syntax

Namespace: FlexCel.Core

public TCfvoType VoType { get; set; }

See also

  • TConditionalFormatValueObject


TConditionalFormatValueObject.Value Property | FlexCel Studio for the .NET Framework documentation

TConditionalFormatValueObject.Value Property

Value of the object.

Syntax

Namespace: FlexCel.Core

public String Value { get; set; }

See also

  • TConditionalFormatValueObject


TConditionalFormatValuesRule Class | FlexCel Studio for the .NET Framework documentation

TConditionalFormatValuesRule Class

An abstract class which has common properties for a Databars, IconSet or ColorScale rule.

Syntax

Namespace: FlexCel.Core

public abstract class TConditionalFormatValuesRule: TConditionalFormatRule

Constructors

Name | Description
TConditional​Format​Values​Rule | Creates a new instance of TConditional​Format​Values​Rule.​

Methods

Name | Description
Equals | Returns true if this object is equal to obj.
GetHashCode | Returns the hashcode for this object.

Properties

Name | Description
Formula | The formula to be evaluated. The conditional format will be displayed when it evaluates to true or a non zero value. If the formula equals to 0 or false, the conditional format won't be shown. Note that from Excel you can't set a formula, it will always be empty for databars, iconsets or colorscales. But if you set a formula in the xlsx file, it will be used by Excel and preserved when saved, even if Excel won't display it. Note that with relative references, we always consider "A1" to be the cell where the format is. This means that the formula: "=$A$1 + A1" when evaluated in Cell B8, will read "=$A$1 + B8". To provide a negative offset, you need to wrap the formula. For example "=A1048575" will evaluate to B7 when evaluated in B8.


TConditionalFormatValuesRule.TConditionalFormatValuesRule Constructor | FlexCel Studio for the .NET Framework documentation

TConditionalFormatValuesRule.TConditionalFormatValuesRule Constructor

Creates a new instance of TConditionalFormatValuesRule.

Syntax

Namespace: FlexCel.Core

protected TConditionalFormatValuesRule(TConditionalFormatKind aKind, Int32 aPriority, Boolean aStopIfTrue, String aFormula)

Parameters

<-> | Parameter | Type | Description
 | aKind | TConditional​Format​Kind | Kind of conditional rule this instance contains.
 | aPriority | Int32 | Priority of the rule. 1 means highest priority, and rules with higher numbers will be evaluated later.
 | aStopIfTrue | Boolean | See TConditionalFormatRule.StopIfTrue
 | aFormula | String | See Formula

See also

  • TConditionalFormatValuesRule


TConditionalFormatValuesRule.Equals Method | FlexCel Studio for the .NET Framework documentation

TConditionalFormatValuesRule.Equals Method

Returns true if this object is equal to obj.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TConditionalFormatValuesRule


TConditionalFormatValuesRule.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TConditionalFormatValuesRule.GetHashCode Method

Returns the hashcode for this object.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TConditionalFormatValuesRule


TConditionalFormatValuesRule.Formula Property | FlexCel Studio for the .NET Framework documentation

TConditionalFormatValuesRule.Formula Property

The formula to be evaluated. The conditional format will be displayed when it evaluates to true or a non zero value. If the formula equals to 0 or false, the conditional format won't be shown. Note that from Excel you can't set a formula, it will always be empty for databars, iconsets or colorscales. But if you set a formula in the xlsx file, it will be used by Excel and preserved when saved, even if Excel won't display it.

Note that with relative references, we always consider "A1" to be the cell where the format is. This means that the formula: "=$A$1 + A1" when evaluated in Cell B8, will read "=$A$1 + B8". To provide a negative offset, you need to wrap the formula. For example "=A1048575" will evaluate to B7 when evaluated in B8.

Syntax

Namespace: FlexCel.Core

public String Formula { get; set; }

See also

  • TConditionalFormatValuesRule


TConditionalIconSetRule Class | FlexCel Studio for the .NET Framework documentation

TConditionalIconSetRule Class

A conditional format rule specified as an icon Set.

Syntax

Namespace: FlexCel.Core

public class TConditionalIconSetRule: TConditionalFormatValuesRule

Constructors

Name | Description
TConditional​Icon​SetRule | Creates a new instance of TConditional​Icon​SetRule.​

Methods

Name | Description
Equals | Returns true if this object is equal to obj.
GetHashCode | Returns the hashcode for this object.
Clone | Returns a deep copy of the object.
CheckIsValid | Checks if the rule is valid. This check will be applied automatically when you try to add a conditional format to a sheet, so there is no need to call this method directly. But you can use it to know if a conditional format will be rejected when you try to add it.

Properties

Name | Description
FormatDef | Format to apply when the rule evaluates to true.


TConditionalIconSetRule.TConditionalIconSetRule Constructor | FlexCel Studio for the .NET Framework documentation

TConditionalIconSetRule.TConditionalIconSetRule Constructor

Creates a new instance of TConditionalIconSetRule.

Syntax

Namespace: FlexCel.Core

public TConditionalIconSetRule(Int32 aPriority, String aFormula)

Parameters

<-> | Parameter | Type | Description
 | aPriority | Int32 | Priority of the rule. 1 means highest priority, and rules with higher numbers will be evaluated later.
 | aFormula | String | Formula that defines if the format will be shown or not. A value of 0 or false means that the conditional format won't be displayed. If the formula is empty or returns another value, the format will be displayed. Note that there is no way to enter a formula in the Excel UI for this cases: From Excel the formula will always be empty. But if you create a file with a formula, it will be honored and preserved when you open it in Excel.

See also

  • TConditionalIconSetRule


TConditionalIconSetRule.Equals Method | FlexCel Studio for the .NET Framework documentation

TConditionalIconSetRule.Equals Method

Returns true if this object is equal to obj.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TConditionalIconSetRule


TConditionalIconSetRule.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TConditionalIconSetRule.GetHashCode Method

Returns the hashcode for this object.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TConditionalIconSetRule


TConditionalIconSetRule.Clone Method | FlexCel Studio for the .NET Framework documentation

TConditionalIconSetRule.Clone Method

Returns a deep copy of the object.

Syntax

Namespace: FlexCel.Core

public override TConditionalFormatRule Clone()

See also

  • TConditionalIconSetRule


TConditionalIconSetRule.CheckIsValid Method | FlexCel Studio for the .NET Framework documentation

TConditionalIconSetRule.CheckIsValid Method

Checks if the rule is valid. This check will be applied automatically when you try to add a conditional format to a sheet, so there is no need to call this method directly. But you can use it to know if a conditional format will be rejected when you try to add it.

Syntax

Namespace: FlexCel.Core

public override CondFmtError CheckIsValid()

See also

  • TConditionalIconSetRule


TConditionalIconSetRule.FormatDef Property | FlexCel Studio for the .NET Framework documentation

TConditionalIconSetRule.FormatDef Property

Format to apply when the rule evaluates to true.

Syntax

Namespace: FlexCel.Core

public TConditionalFormatDefIconSet FormatDef { get; }

See also

  • TConditionalIconSetRule


TConditionalNotContainsBlanksRule Class | FlexCel Studio for the .NET Framework documentation

TConditionalNotContainsBlanksRule Class

A conditional format rule which highlights not blank cells.

Syntax

Namespace: FlexCel.Core

public class TConditionalNotContainsBlanksRule: TConditionalFormatStandardDefRule

Constructors

Name | Description
TConditional​NotContains​Blanks​Rule | Creates a new instance of TConditional​NotContains​Blanks​Rule.​


TConditionalNotContainsBlanksRule.TConditionalNotContainsBlanksRule Constructor | FlexCel Studio for the .NET Framework documentation

TConditionalNotContainsBlanksRule.TConditionalNotContainsBlanksRule Constructor

Creates a new instance of TConditionalNotContainsBlanksRule.

Syntax

Namespace: FlexCel.Core

public TConditionalNotContainsBlanksRule(Int32 aPriority, Boolean aStopIfTrue)

Parameters

<-> | Parameter | Type | Description
 | aPriority | Int32 | Priority of the rule. 1 means highest priority, and rules with higher numbers will be evaluated later.
 | aStopIfTrue | Boolean | See TConditionalFormatRule.StopIfTrue

See also

  • TConditionalNotContainsBlanksRule


TConditionalNotContainsErrorsRule Class | FlexCel Studio for the .NET Framework documentation

TConditionalNotContainsErrorsRule Class

A conditional format rule which highlights cells without errors.

Syntax

Namespace: FlexCel.Core

public class TConditionalNotContainsErrorsRule: TConditionalFormatStandardDefRule

Constructors

Name | Description
TConditional​NotContains​Errors​Rule | Creates a new instance of TConditional​NotContains​Errors​Rule.​


TConditionalNotContainsErrorsRule.TConditionalNotContainsErrorsRule Constructor | FlexCel Studio for the .NET Framework documentation

TConditionalNotContainsErrorsRule.TConditionalNotContainsErrorsRule Constructor

Creates a new instance of TConditionalNotContainsErrorsRule.

Syntax

Namespace: FlexCel.Core

public TConditionalNotContainsErrorsRule(Int32 aPriority, Boolean aStopIfTrue)

Parameters

<-> | Parameter | Type | Description
 | aPriority | Int32 | Priority of the rule. 1 means highest priority, and rules with higher numbers will be evaluated later.
 | aStopIfTrue | Boolean | See TConditionalFormatRule.StopIfTrue

See also

  • TConditionalNotContainsErrorsRule


TConditionalNotContainsTextRule Class | FlexCel Studio for the .NET Framework documentation

TConditionalNotContainsTextRule Class

A conditional format rule which highlights cells which don't contain some text.

Syntax

Namespace: FlexCel.Core

public class TConditionalNotContainsTextRule: TConditionalBaseTextRule

Constructors

Name | Description
TConditional​NotContains​Text​Rule | Creates a new instance of TConditional​NotContains​Text​Rule.​


TConditionalNotContainsTextRule.TConditionalNotContainsTextRule Constructor | FlexCel Studio for the .NET Framework documentation

TConditionalNotContainsTextRule.TConditionalNotContainsTextRule Constructor

Creates a new instance of TConditionalNotContainsTextRule.

Syntax

Namespace: FlexCel.Core

public TConditionalNotContainsTextRule(Int32 aPriority, Boolean aStopIfTrue, String aText)

Parameters

<-> | Parameter | Type | Description
 | aPriority | Int32 | Priority of the rule. 1 means highest priority, and rules with higher numbers will be evaluated later.
 | aStopIfTrue | Boolean | See TConditionalFormatRule.StopIfTrue
 | aText | String | Text to search for.

See also

  • TConditionalNotContainsTextRule


TConditionalTimePeriodRule Class | FlexCel Studio for the .NET Framework documentation

TConditionalTimePeriodRule Class

A conditional format rule which highlights cells which are in a specific time period. Note that it will also apply to number intervals, since dates are formatted numbers.

Syntax

Namespace: FlexCel.Core

public class TConditionalTimePeriodRule: TConditionalFormatStandardDefRule

Constructors

Name | Description
TConditional​Time​Period​Rule | Creates a new instance of TConditional​Time​Period​Rule.​

Methods

Name | Description
Equals | Returns true if this object is equal to obj.
GetHashCode | Returns the hashcode for this object.

Properties

Name | Description
TimePeriod | Time period to highlight.


TConditionalTimePeriodRule.TConditionalTimePeriodRule Constructor | FlexCel Studio for the .NET Framework documentation

TConditionalTimePeriodRule.TConditionalTimePeriodRule Constructor

Creates a new instance of TConditionalTimePeriodRule.

Syntax

Namespace: FlexCel.Core

public TConditionalTimePeriodRule(Int32 aPriority, Boolean aStopIfTrue, TTimePeriod aTimePeriod)

Parameters

<-> | Parameter | Type | Description
 | aPriority | Int32 | Priority of the rule. 1 means highest priority, and rules with higher numbers will be evaluated later.
 | aStopIfTrue | Boolean | See TConditionalFormatRule.StopIfTrue
 | aTimePeriod | TTimePeriod | Time period to highlight.

See also

  • TConditionalTimePeriodRule


TConditionalTimePeriodRule.Equals Method | FlexCel Studio for the .NET Framework documentation

TConditionalTimePeriodRule.Equals Method

Returns true if this object is equal to obj.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TConditionalTimePeriodRule


TConditionalTimePeriodRule.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TConditionalTimePeriodRule.GetHashCode Method

Returns the hashcode for this object.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TConditionalTimePeriodRule


TConditionalTimePeriodRule.TimePeriod Property | FlexCel Studio for the .NET Framework documentation

TConditionalTimePeriodRule.TimePeriod Property

Time period to highlight.

Syntax

Namespace: FlexCel.Core

public TTimePeriod TimePeriod { get; set; }

See also

  • TConditionalTimePeriodRule


TConditionalTopNRule Class | FlexCel Studio for the .NET Framework documentation

TConditionalTopNRule Class

A conditional format rule specified by the top-N or bottom-N values.

Syntax

Namespace: FlexCel.Core

public class TConditionalTopNRule: TConditionalFormatStandardDefRule

Constructors

Name | Description
TConditionalTopNRule | Creates a new instance of TConditional​Expression​Rule.​

Methods

Name | Description
Equals | Returns true if this object is equal to obj.
GetHashCode | Returns the hashcode for this object.

Properties

Name | Description
Rank | The value of N in Top-N
IsBottom | If true then this rule targets the bottom-n values instead of the top-n.
IsPercent | If true, then this rule targets top n% instead of top n values.


TConditionalTopNRule.TConditionalTopNRule Constructor | FlexCel Studio for the .NET Framework documentation

TConditionalTopNRule.TConditionalTopNRule Constructor

Creates a new instance of TConditionalExpressionRule.

Syntax

Namespace: FlexCel.Core

public TConditionalTopNRule(Int32 aPriority, Boolean aStopIfTrue, Int32 aRank, Boolean aIsBottom, Boolean aIsPercent)

Parameters

<-> | Parameter | Type | Description
 | aPriority | Int32 | Priority of the rule. 1 means highest priority, and rules with higher numbers will be evaluated later.
 | aStopIfTrue | Boolean | See TConditionalFormatRule.StopIfTrue
 | aRank | Int32 | The n for top-n.
 | aIsBottom | Boolean | If true, this rule will use the bottom N values instead of the top N
 | aIsPercent | Boolean | If true the rule applies to the top n% values instead of top n.

See also

  • TConditionalTopNRule


TConditionalTopNRule.Equals Method | FlexCel Studio for the .NET Framework documentation

TConditionalTopNRule.Equals Method

Returns true if this object is equal to obj.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TConditionalTopNRule


TConditionalTopNRule.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TConditionalTopNRule.GetHashCode Method

Returns the hashcode for this object.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TConditionalTopNRule


TConditionalTopNRule.Rank Property | FlexCel Studio for the .NET Framework documentation

TConditionalTopNRule.Rank Property

The value of N in Top-N

Syntax

Namespace: FlexCel.Core

public Int32 Rank { get; set; }

See also

  • TConditionalTopNRule


TConditionalTopNRule.IsBottom Property | FlexCel Studio for the .NET Framework documentation

TConditionalTopNRule.IsBottom Property

If true then this rule targets the bottom-n values instead of the top-n.

Syntax

Namespace: FlexCel.Core

public Boolean IsBottom { get; set; }

See also

  • TConditionalTopNRule


TConditionalTopNRule.IsPercent Property | FlexCel Studio for the .NET Framework documentation

TConditionalTopNRule.IsPercent Property

If true, then this rule targets top n% instead of top n values.

Syntax

Namespace: FlexCel.Core

public Boolean IsPercent { get; set; }

See also

  • TConditionalTopNRule


TConditionalUniqueValuesRule Class | FlexCel Studio for the .NET Framework documentation

TConditionalUniqueValuesRule Class

A conditional format rule which highlights unique values.

Syntax

Namespace: FlexCel.Core

public class TConditionalUniqueValuesRule: TConditionalFormatStandardDefRule

Constructors

Name | Description
TConditional​Unique​Values​Rule | Creates a new instance of TConditional​Unique​Value​Rule.​


TConditionalUniqueValuesRule.TConditionalUniqueValuesRule Constructor | FlexCel Studio for the .NET Framework documentation

TConditionalUniqueValuesRule.TConditionalUniqueValuesRule Constructor

Creates a new instance of TConditionalUniqueValueRule.

Syntax

Namespace: FlexCel.Core

public TConditionalUniqueValuesRule(Int32 aPriority, Boolean aStopIfTrue)

Parameters

<-> | Parameter | Type | Description
 | aPriority | Int32 | Priority of the rule. 1 means highest priority, and rules with higher numbers will be evaluated later.
 | aStopIfTrue | Boolean | See TConditionalFormatRule.StopIfTrue

See also

  • TConditionalUniqueValuesRule


TCropArea Class | FlexCel Studio for the .NET Framework documentation

TCropArea Class

Defines a cropping area for an image. If the values are not zero, only a part of the image will display on Excel.

Syntax

Namespace: FlexCel.Core

public class TCropArea: ICloneable

Constructors

Name | Description
TCropArea | Overloaded TCropArea TCropArea(Int32, Int32, Int32, Int32)

Methods

Name | Description
Clone | Returns a deep copy of this object
IsEmpty | Returns true if all the coordinates are 0.
EqualValues | Returns true if both instances of the objects contain the same values. Instances might be different, this method will return if their values are equal. Instances can be null.

Properties

Name | Description
CropFromTop | How much to crop the image, in fractions of 65536 of the total image height.
CropFromBottom | How much to crop the image, in fractions of 65536 of the total image height.
CropFromLeft | How much to crop the image, in fractions of 65536 of the total image width.
CropFromRight | How much to crop the image, in fractions of 65536 of the total image width.


TCropArea.TCropArea Constructor | FlexCel Studio for the .NET Framework documentation

TCropArea.TCropArea Constructor

Overloads

  • TCropArea.TCropArea
  • TCropArea.TCropArea(Int32, Int32, Int32, Int32)

TCropArea.TCropArea

Creates a new crop area with no crop.

Syntax

Namespace: FlexCel.Core

public TCropArea()

See also

  • TCropArea

TCropArea.TCropArea(Int32, Int32, Int32, Int32)

Creates a new crop area with the indicated coordinates.

Syntax

Namespace: FlexCel.Core

public TCropArea(Int32 aCropFromTop, Int32 aCropFromBottom, Int32 aCropFromLeft, Int32 aCropFromRight)

Parameters

<-> | Parameter | Type | Description
 | aCropFromTop | Int32 |
 | aCropFromBottom | Int32 |
 | aCropFromLeft | Int32 |
 | aCropFromRight | Int32 |

See also

  • TCropArea


TCropArea.Clone Method | FlexCel Studio for the .NET Framework documentation

TCropArea.Clone Method

Returns a deep copy of this object

Syntax

Namespace: FlexCel.Core

public Object Clone()

See also

  • TCropArea


TCropArea.IsEmpty Method | FlexCel Studio for the .NET Framework documentation

TCropArea.IsEmpty Method

Returns true if all the coordinates are 0.

Syntax

Namespace: FlexCel.Core

public Boolean IsEmpty()

See also

  • TCropArea


TCropArea.EqualValues Method | FlexCel Studio for the .NET Framework documentation

TCropArea.EqualValues Method

Returns true if both instances of the objects contain the same values. Instances might be different, this method will return if their values are equal. Instances can be null.

Syntax

Namespace: FlexCel.Core

public static Boolean EqualValues(TCropArea a1, TCropArea a2)

Parameters

<-> | Parameter | Type | Description
 | a1 | TCropArea | First instance to compare.
 | a2 | TCropArea | Second instance to compare.

See also

  • TCropArea


TCropArea.CropFromTop Property | FlexCel Studio for the .NET Framework documentation

TCropArea.CropFromTop Property

How much to crop the image, in fractions of 65536 of the total image height.

Syntax

Namespace: FlexCel.Core

public Int32 CropFromTop { get; set; }

See also

  • TCropArea


TCropArea.CropFromBottom Property | FlexCel Studio for the .NET Framework documentation

TCropArea.CropFromBottom Property

How much to crop the image, in fractions of 65536 of the total image height.

Syntax

Namespace: FlexCel.Core

public Int32 CropFromBottom { get; set; }

See also

  • TCropArea


TCropArea.CropFromLeft Property | FlexCel Studio for the .NET Framework documentation

TCropArea.CropFromLeft Property

How much to crop the image, in fractions of 65536 of the total image width.

Syntax

Namespace: FlexCel.Core

public Int32 CropFromLeft { get; set; }

See also

  • TCropArea


TCropArea.CropFromRight Property | FlexCel Studio for the .NET Framework documentation

TCropArea.CropFromRight Property

How much to crop the image, in fractions of 65536 of the total image width.

Syntax

Namespace: FlexCel.Core

public Int32 CropFromRight { get; set; }

See also

  • TCropArea


TCustomTableStyle Class | FlexCel Studio for the .NET Framework documentation

TCustomTableStyle Class

Represents a custom table style.

Syntax

Namespace: FlexCel.Core

public class TCustomTableStyle

Methods

Name | Description
CreateSection | Initializes a section to all empty values. You need to call this method before setting element values. IF the section already existed, this method will clear all values on it.
DeleteSection | Deletes a section and sets it to nulls.
Equals | Returns true if obj has the same data as this object.
GetHashCode | Returns the hash code of the object.
Clone | Returns a deep copy of this object.

Properties

Name | Description
Name | Name of the custom table style.
CanBeUsedAsPivot​Table | If true, then this table style can be used in pivot tables.
CanBeUsedAsTable | If true, then this table style can be used in normal tables.
SectionCount | This returns the number of sections possible, and it is the same as the highest value of TTableStyleType. Note that many of the sections can be null, meaning there is no format applied to them.
this[] | Returns the format for a given section of the table. If the value is null, this means no format is applied to that section.


TCustomTableStyle.CreateSection Method | FlexCel Studio for the .NET Framework documentation

TCustomTableStyle.CreateSection Method

Initializes a section to all empty values. You need to call this method before setting element values. IF the section already existed, this method will clear all values on it.

Syntax

Namespace: FlexCel.Core

public void CreateSection(TTableStyleType section)

Parameters

<-> | Parameter | Type | Description
 | section | TTableStyleType | Section that we want to initialize.

See also

  • TCustomTableStyle


TCustomTableStyle.DeleteSection Method | FlexCel Studio for the .NET Framework documentation

TCustomTableStyle.DeleteSection Method

Deletes a section and sets it to nulls.

Syntax

Namespace: FlexCel.Core

public void DeleteSection(TTableStyleType section)

Parameters

<-> | Parameter | Type | Description
 | section | TTableStyleType | Section that we want to delete.

See also

  • TCustomTableStyle


TCustomTableStyle.Equals Method | FlexCel Studio for the .NET Framework documentation

TCustomTableStyle.Equals Method

Returns true if obj has the same data as this object.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TCustomTableStyle


TCustomTableStyle.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TCustomTableStyle.GetHashCode Method

Returns the hash code of the object.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TCustomTableStyle


TCustomTableStyle.Clone Method | FlexCel Studio for the .NET Framework documentation

TCustomTableStyle.Clone Method

Returns a deep copy of this object.

Syntax

Namespace: FlexCel.Core

public TCustomTableStyle Clone()

See also

  • TCustomTableStyle


TCustomTableStyle.Name Property | FlexCel Studio for the .NET Framework documentation

TCustomTableStyle.Name Property

Name of the custom table style.

Syntax

Namespace: FlexCel.Core

public String Name { get; set; }

See also

  • TCustomTableStyle


TCustomTableStyle.CanBeUsedAsPivotTable Property | FlexCel Studio for the .NET Framework documentation

TCustomTableStyle.CanBeUsedAsPivotTable Property

If true, then this table style can be used in pivot tables.

Syntax

Namespace: FlexCel.Core

public Boolean CanBeUsedAsPivotTable { get; set; }

See also

  • TCustomTableStyle


TCustomTableStyle.CanBeUsedAsTable Property | FlexCel Studio for the .NET Framework documentation

TCustomTableStyle.CanBeUsedAsTable Property

If true, then this table style can be used in normal tables.

Syntax

Namespace: FlexCel.Core

public Boolean CanBeUsedAsTable { get; set; }

See also

  • TCustomTableStyle


TCustomTableStyle.SectionCount Property | FlexCel Studio for the .NET Framework documentation

TCustomTableStyle.SectionCount Property

This returns the number of sections possible, and it is the same as the highest value of TTableStyleType. Note that many of the sections can be null, meaning there is no format applied to them.

Syntax

Namespace: FlexCel.Core

public Int32 SectionCount { get; }

See also

  • TCustomTableStyle


TCustomTableStyle.this[] Property | FlexCel Studio for the .NET Framework documentation

TCustomTableStyle.this[] Property

Returns the format for a given section of the table. If the value is null, this means no format is applied to that section.

Syntax

Namespace: FlexCel.Core

public TCustomTableStyleSection this[] { get; }

See also

  • TCustomTableStyle


TCustomTableStyleSection Class | FlexCel Studio for the .NET Framework documentation

TCustomTableStyleSection Class

Represents the format of a table section (header, totals, etc).

Syntax

Namespace: FlexCel.Core

public class TCustomTableStyleSection

Constructors

Name | Description
TCustomTable​Style​Section | Creates a new Table Style section.

Methods

Name | Description
Equals | Returns true if both objects are the same.
GetHashCode | Returns the hashcode of the object.

Properties

Name | Description
Format | Format that will be applied to this section of the table.
SectionSize | This property only applies to strides. It defines how much rows or columns are in each stride. For other sections like headers, it is ignored.


TCustomTableStyleSection.TCustomTableStyleSection Constructor | FlexCel Studio for the .NET Framework documentation

TCustomTableStyleSection.TCustomTableStyleSection Constructor

Creates a new Table Style section.

Syntax

Namespace: FlexCel.Core

public TCustomTableStyleSection()

See also

  • TCustomTableStyleSection


TCustomTableStyleSection.Equals Method | FlexCel Studio for the .NET Framework documentation

TCustomTableStyleSection.Equals Method

Returns true if both objects are the same.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TCustomTableStyleSection


TCustomTableStyleSection.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TCustomTableStyleSection.GetHashCode Method

Returns the hashcode of the object.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TCustomTableStyleSection


TCustomTableStyleSection.Format Property | FlexCel Studio for the .NET Framework documentation

TCustomTableStyleSection.Format Property

Format that will be applied to this section of the table.

Syntax

Namespace: FlexCel.Core

public TTableFormat Format { get; }

See also

  • TCustomTableStyleSection


TCustomTableStyleSection.SectionSize Property | FlexCel Studio for the .NET Framework documentation

TCustomTableStyleSection.SectionSize Property

This property only applies to strides. It defines how much rows or columns are in each stride. For other sections like headers, it is ignored.

Syntax

Namespace: FlexCel.Core

public Int32 SectionSize { get; set; }

See also

  • TCustomTableStyleSection


TCustomXmlPart Class | FlexCel Studio for the .NET Framework documentation

TCustomXmlPart Class

Implements a custom XML part as described in https://msdn.microsoft.com/en-us/library/bb608618.aspx

Syntax

Namespace: FlexCel.Core

public class TCustomXmlPart

Constructors

Name | Description
TCustomXmlPart | Overloaded TCustomXmlPart TCustomXmlPart(String, String[]) TCustomXmlPart(Guid, String, String[])

Methods

Name | Description
Equals | Returns true if both objects have the same contents.
GetHashCode | Returns the hashcode for the object.
Clone | Returns a deep copy of the object.

Properties

Name | Description
Id | Id of the part. This must be an unique identifier.
Xml | Xml content of the part.
Schemas | A list of schemas associated with the part. When you set this value the array will be cloned, so you can then modify the original array and it won't modify the part.


TCustomXmlPart.TCustomXmlPart Constructor | FlexCel Studio for the .NET Framework documentation

TCustomXmlPart.TCustomXmlPart Constructor

Overloads

  • TCustomXmlPart.TCustomXmlPart
  • TCustomXmlPart.TCustomXmlPart(String, String[])
  • TCustomXmlPart.TCustomXmlPart(Guid, String, String[])

TCustomXmlPart.TCustomXmlPart

Creates a new TCustomXmlPart. It will set the Id to a random GUID.

Syntax

Namespace: FlexCel.Core

public TCustomXmlPart()

See also

  • TCustomXmlPart

TCustomXmlPart.TCustomXmlPart(String, String[])

Creates a new TCustomXmlParts with a random Id and the given xml and schemas.

Syntax

Namespace: FlexCel.Core

public TCustomXmlPart(String aXml, String[] aSchemas)

Parameters

<-> | Parameter | Type | Description
 | aXml | String | Xml of the custom part.
 | aSchemas | String[] | List of schemas for the custom part. Leave it null or empty if there a no schemas. Note that the array will be copied, so you can modify it after setting it and it won't change the Xml part.

See also

  • TCustomXmlPart

TCustomXmlPart.TCustomXmlPart(Guid, String, String[])

Creates a new TCustomXmlParts the given Id, xml and schemas.

Syntax

Namespace: FlexCel.Core

public TCustomXmlPart(Guid aId, String aXml, String[] aSchemas)

Parameters

<-> | Parameter | Type | Description
 | aId | Guid | Guid for the part. Make sure this is unique.
 | aXml | String | Xml of the custom part.
 | aSchemas | String[] | List of schemas for the custom part. Leave it null or empty if there a no schemas. Note that the array will be copied, so you can modify it after setting it and it won't change the Xml part.

See also

  • TCustomXmlPart


TCustomXmlPart.Equals Method | FlexCel Studio for the .NET Framework documentation

TCustomXmlPart.Equals Method

Returns true if both objects have the same contents.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TCustomXmlPart


TCustomXmlPart.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TCustomXmlPart.GetHashCode Method

Returns the hashcode for the object.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TCustomXmlPart


TCustomXmlPart.Clone Method | FlexCel Studio for the .NET Framework documentation

TCustomXmlPart.Clone Method

Returns a deep copy of the object.

Syntax

Namespace: FlexCel.Core

public TCustomXmlPart Clone()

See also

  • TCustomXmlPart


TCustomXmlPart.Id Property | FlexCel Studio for the .NET Framework documentation

TCustomXmlPart.Id Property

Id of the part. This must be an unique identifier.

Syntax

Namespace: FlexCel.Core

public Guid Id { get; set; }

See also

  • TCustomXmlPart


TCustomXmlPart.Xml Property | FlexCel Studio for the .NET Framework documentation

TCustomXmlPart.Xml Property

Xml content of the part.

Syntax

Namespace: FlexCel.Core

public String Xml { get; set; }

See also

  • TCustomXmlPart


TCustomXmlPart.Schemas Property | FlexCel Studio for the .NET Framework documentation

TCustomXmlPart.Schemas Property

A list of schemas associated with the part. When you set this value the array will be cloned, so you can then modify the original array and it won't modify the part.

Syntax

Namespace: FlexCel.Core

public String[] Schemas { get; set; }

See also

  • TCustomXmlPart


TDataBarColors Class | FlexCel Studio for the .NET Framework documentation

TDataBarColors Class

Colors which define the databar.

Syntax

Namespace: FlexCel.Core

public class TDataBarColors

Methods

Name | Description
Clone | Returns a deep copy of the list of value objects.

Properties

Name | Description
FillColor | Fill color for the bar.
BorderColor | Border color for the bar.
NegativeFillColor | Color for negative bars.
NegativeBorderColor | Color for the border of negative bars.
AxisColor | Color for the axis.


TDataBarColors.Clone Method | FlexCel Studio for the .NET Framework documentation

TDataBarColors.Clone Method

Returns a deep copy of the list of value objects.

Syntax

Namespace: FlexCel.Core

public TDataBarColors Clone()

See also

  • TDataBarColors


TDataBarColors.FillColor Property | FlexCel Studio for the .NET Framework documentation

TDataBarColors.FillColor Property

Fill color for the bar.

Syntax

Namespace: FlexCel.Core

public TExcelColor FillColor { get; set; }

See also

  • TDataBarColors


TDataBarColors.BorderColor Property | FlexCel Studio for the .NET Framework documentation

TDataBarColors.BorderColor Property

Border color for the bar.

Syntax

Namespace: FlexCel.Core

public TExcelColor BorderColor { get; set; }

See also

  • TDataBarColors


TDataBarColors.NegativeFillColor Property | FlexCel Studio for the .NET Framework documentation

TDataBarColors.NegativeFillColor Property

Color for negative bars.

Syntax

Namespace: FlexCel.Core

public TExcelColor NegativeFillColor { get; set; }

See also

  • TDataBarColors


TDataBarColors.NegativeBorderColor Property | FlexCel Studio for the .NET Framework documentation

TDataBarColors.NegativeBorderColor Property

Color for the border of negative bars.

Syntax

Namespace: FlexCel.Core

public TExcelColor NegativeBorderColor { get; set; }

See also

  • TDataBarColors


TDataBarColors.AxisColor Property | FlexCel Studio for the .NET Framework documentation

TDataBarColors.AxisColor Property

Color for the axis.

Syntax

Namespace: FlexCel.Core

public TExcelColor AxisColor { get; set; }

See also

  • TDataBarColors


TDataConnection Class | FlexCel Studio for the .NET Framework documentation

TDataConnection Class

This class represents one data connection on the workbook.

Syntax

Namespace: FlexCel.Core

public class TDataConnection

Methods

Name | Description
Equals | Returns true if obj is the same as this object.
GetHashCode | Returns the hashcode of the object.

Properties

Name | Description
DbProperties | This element stores all properties associated with an ODBC or OLE DB external data connection.
OlapProperties | This element contains all the properties needed for an OLAP data connection. OLAP connections contain both the TDataConnection​DbProperties and TDataConnection​Olap​Properties child elements.
WebQueryProperties | This element specifies the properties for a web query source. A web query will retrieve data from HTML tables, and can also supply HTTP "Get" parameters to be processed by the web server in generating the HTML by including the parameters and parameter elements.
TextImportProperties | This element contains all of the text import settings.
Parameters | This element stores properties about any parameters used with external data connections. Parameters are used to change the query executed externally and cause different data to be retrieved into the workbook.The type of parameter used determines whether the user is prompted for a value before data is refreshed, or the value is pulled from a cell in the workbook, or whether the same value should be used until explicitly changed in the data connection. Parameters are permitted for ODBC and web queries.
ID | Specifies The unique identifier of this connection.
SourceFile | Used when the external data source is file-based. When a connection to such a data source fails, the spreadsheet application attempts to connect directly to this file. Can be expressed in URI or system-specific file path notation.
OdcFile | Specifies the full path to external connection file from which this connection was created. If a connection fails during an attempt to refresh data, and ReconnectionMethod is AsRequired, then the spreadsheet application will try again using information from the external connection file instead of the connection object embedded within the workbook.
KeepAlive | True when the spreadsheet application should make efforts to keep the connection open.When false, the application should close the connection after retrieving the information.
Interval | Specifies the number of minutes between automatic refreshes of the connection. When this attribute is not present, the connection is not automatically refreshed.
Name | Specifies the name of the connection. Each connection shall have a unique name.
Description | Specifies the user description for this connection.
ConnectionType | Specifies the data source type.
ReconnectionMethod | Specifies what the spreadsheet application should do when a connection fails.
RefreshedVersion | For backward compatibility purposes, this attribute indicates the version of the spreadsheet application that last refreshed the connection.
MinRefreshable​Version | For compatibility with legacy spreadsheet applications. This represents the minimum version # that is required to be able to correctly refresh the data connection.
SavePassword | True if the password is to be saved as part of the connection string
IsNew | True if the connection has not been refreshed for the first time. This can happen when the user saves the file before a query has finished returning.
Deleted | Indicates whether the associated workbook connection has been deleted. Deleted connections contain only the attributes name and deleted=true, all other information is removed when saving the file. If a new connection is created with the same name as a deleted connection, then the deleted connection is overwritten by the new connection.
OnlyUseConnection​File | Indicates whether the spreadsheet application should always and only use the connection information in the external connection file indicated by the odcFile attribute when the connection is refreshed. If false, then the spreadsheet application should follow the procedure indicated by the reconnectionMethod attribute. Applies to ODBC connections, and may be applied to custom data connections.This attribute is ignored for other types of connections.
SingleSignOnId | Identifier for Single Sign On (SSO) used for authentication between an intermediate spreadsheetML server and the external data source.
Credentials | Specifies the authentication method to be used when establishing (or re-establishing) the connection.
SaveData | True if the external data fetched over the connection to populate a table is to be saved with the workbook; otherwise, false. This exists for data security purposes - if no external data is saved in (or "cached") in the workbook, then current user credentials can be required every time to retrieve the relevant data, and people won't see the data the workbook author had last been using before saving the file.
RefreshOnLoad | True if this connection should be refreshed when opening the file.
Background | Indicates whether the connection can be refreshed in the background (​asynchronously)​.​ True if preferred usage of the connection is to refresh asynchronously in the background; False if preferred usage of the connection is to refresh synchronously in the foreground.


TDataConnection.Equals Method | FlexCel Studio for the .NET Framework documentation

TDataConnection.Equals Method

Returns true if obj is the same as this object.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TDataConnection


TDataConnection.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TDataConnection.GetHashCode Method

Returns the hashcode of the object.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TDataConnection


TDataConnection.DbProperties Property | FlexCel Studio for the .NET Framework documentation

TDataConnection.DbProperties Property

This element stores all properties associated with an ODBC or OLE DB external data connection.

Syntax

Namespace: FlexCel.Core

public TDataConnectionDbProperties DbProperties { get; set; }

See also

  • TDataConnection


TDataConnection.OlapProperties Property | FlexCel Studio for the .NET Framework documentation

TDataConnection.OlapProperties Property

This element contains all the properties needed for an OLAP data connection. OLAP connections contain both the TDataConnectionDbProperties and TDataConnectionOlapProperties child elements.

Syntax

Namespace: FlexCel.Core

public TDataConnectionOlapProperties OlapProperties { get; set; }

See also

  • TDataConnection


TDataConnection.WebQueryProperties Property | FlexCel Studio for the .NET Framework documentation

TDataConnection.WebQueryProperties Property

This element specifies the properties for a web query source. A web query will retrieve data from HTML tables, and can also supply HTTP "Get" parameters to be processed by the web server in generating the HTML by including the parameters and parameter elements.

Syntax

Namespace: FlexCel.Core

public TDataConnectionWebQueryProperties WebQueryProperties { get; set; }

See also

  • TDataConnection


TDataConnection.TextImportProperties Property | FlexCel Studio for the .NET Framework documentation

TDataConnection.TextImportProperties Property

This element contains all of the text import settings.

Syntax

Namespace: FlexCel.Core

public TDataConnectionTextImportProperties TextImportProperties { get; set; }

See also

  • TDataConnection


TDataConnection.Parameters Property | FlexCel Studio for the .NET Framework documentation

TDataConnection.Parameters Property

This element stores properties about any parameters used with external data connections. Parameters are used to change the query executed externally and cause different data to be retrieved into the workbook.The type of parameter used determines whether the user is prompted for a value before data is refreshed, or the value is pulled from a cell in the workbook, or whether the same value should be used until explicitly changed in the data connection. Parameters are permitted for ODBC and web queries.

Syntax

Namespace: FlexCel.Core

public TDataConnectionParameters Parameters { get; set; }

See also

  • TDataConnection


TDataConnection.ID Property | FlexCel Studio for the .NET Framework documentation

TDataConnection.ID Property

Specifies The unique identifier of this connection.

Syntax

Namespace: FlexCel.Core

public Int64 ID { get; set; }

See also

  • TDataConnection


TDataConnection.SourceFile Property | FlexCel Studio for the .NET Framework documentation

TDataConnection.SourceFile Property

Used when the external data source is file-based. When a connection to such a data source fails, the spreadsheet application attempts to connect directly to this file. Can be expressed in URI or system-specific file path notation.

Syntax

Namespace: FlexCel.Core

public String SourceFile { get; set; }

See also

  • TDataConnection


TDataConnection.OdcFile Property | FlexCel Studio for the .NET Framework documentation

TDataConnection.OdcFile Property

Specifies the full path to external connection file from which this connection was created. If a connection fails during an attempt to refresh data, and ReconnectionMethod is AsRequired, then the spreadsheet application will try again using information from the external connection file instead of the connection object embedded within the workbook.

Syntax

Namespace: FlexCel.Core

public String OdcFile { get; set; }

See also

  • TDataConnection


TDataConnection.KeepAlive Property | FlexCel Studio for the .NET Framework documentation

TDataConnection.KeepAlive Property

True when the spreadsheet application should make efforts to keep the connection open.When false, the application should close the connection after retrieving the information.

Syntax

Namespace: FlexCel.Core

public Boolean KeepAlive { get; set; }

See also

  • TDataConnection


TDataConnection.Interval Property | FlexCel Studio for the .NET Framework documentation

TDataConnection.Interval Property

Specifies the number of minutes between automatic refreshes of the connection. When this attribute is not present, the connection is not automatically refreshed.

Syntax

Namespace: FlexCel.Core

public Int64 Interval { get; set; }

See also

  • TDataConnection


TDataConnection.Name Property | FlexCel Studio for the .NET Framework documentation

TDataConnection.Name Property

Specifies the name of the connection. Each connection shall have a unique name.

Syntax

Namespace: FlexCel.Core

public String Name { get; set; }

See also

  • TDataConnection


TDataConnection.Description Property | FlexCel Studio for the .NET Framework documentation

TDataConnection.Description Property

Specifies the user description for this connection.

Syntax

Namespace: FlexCel.Core

public String Description { get; set; }

See also

  • TDataConnection


TDataConnection.ConnectionType Property | FlexCel Studio for the .NET Framework documentation

TDataConnection.ConnectionType Property

Specifies the data source type.

Syntax

Namespace: FlexCel.Core

public TDataConnectionType ConnectionType { get; set; }

See also

  • TDataConnection


TDataConnection.ReconnectionMethod Property | FlexCel Studio for the .NET Framework documentation

TDataConnection.ReconnectionMethod Property

Specifies what the spreadsheet application should do when a connection fails.

Syntax

Namespace: FlexCel.Core

public TDataConnectionReconnectionMethod ReconnectionMethod { get; set; }

See also

  • TDataConnection


TDataConnection.RefreshedVersion Property | FlexCel Studio for the .NET Framework documentation

TDataConnection.RefreshedVersion Property

For backward compatibility purposes, this attribute indicates the version of the spreadsheet application that last refreshed the connection.

Syntax

Namespace: FlexCel.Core

public Byte RefreshedVersion { get; set; }

See also

  • TDataConnection


TDataConnection.MinRefreshableVersion Property | FlexCel Studio for the .NET Framework documentation

TDataConnection.MinRefreshableVersion Property

For compatibility with legacy spreadsheet applications. This represents the minimum version # that is required to be able to correctly refresh the data connection.

Syntax

Namespace: FlexCel.Core

public Byte MinRefreshableVersion { get; set; }

See also

  • TDataConnection


TDataConnection.SavePassword Property | FlexCel Studio for the .NET Framework documentation

TDataConnection.SavePassword Property

True if the password is to be saved as part of the connection string

Syntax

Namespace: FlexCel.Core

public Boolean SavePassword { get; set; }

See also

  • TDataConnection


TDataConnection.IsNew Property | FlexCel Studio for the .NET Framework documentation

TDataConnection.IsNew Property

True if the connection has not been refreshed for the first time. This can happen when the user saves the file before a query has finished returning.

Syntax

Namespace: FlexCel.Core

public Boolean IsNew { get; set; }

See also

  • TDataConnection


TDataConnection.Deleted Property | FlexCel Studio for the .NET Framework documentation

TDataConnection.Deleted Property

Indicates whether the associated workbook connection has been deleted. Deleted connections contain only the attributes name and deleted=true, all other information is removed when saving the file. If a new connection is created with the same name as a deleted connection, then the deleted connection is overwritten by the new connection.

Syntax

Namespace: FlexCel.Core

public Boolean Deleted { get; set; }

See also

  • TDataConnection


TDataConnection.OnlyUseConnectionFile Property | FlexCel Studio for the .NET Framework documentation

TDataConnection.OnlyUseConnectionFile Property

Indicates whether the spreadsheet application should always and only use the connection information in the external connection file indicated by the odcFile attribute when the connection is refreshed. If false, then the spreadsheet application should follow the procedure indicated by the reconnectionMethod attribute.

Applies to ODBC connections, and may be applied to custom data connections.This attribute is ignored for other types of connections.

Syntax

Namespace: FlexCel.Core

public Boolean OnlyUseConnectionFile { get; set; }

See also

  • TDataConnection


TDataConnection.SingleSignOnId Property | FlexCel Studio for the .NET Framework documentation

TDataConnection.SingleSignOnId Property

Identifier for Single Sign On (SSO) used for authentication between an intermediate spreadsheetML server and the external data source.

Syntax

Namespace: FlexCel.Core

public String SingleSignOnId { get; set; }

See also

  • TDataConnection


TDataConnection.Credentials Property | FlexCel Studio for the .NET Framework documentation

TDataConnection.Credentials Property

Specifies the authentication method to be used when establishing (or re-establishing) the connection.

Syntax

Namespace: FlexCel.Core

public TDataConnectionCredentialMethod Credentials { get; set; }

See also

  • TDataConnection


TDataConnection.SaveData Property | FlexCel Studio for the .NET Framework documentation

TDataConnection.SaveData Property

True if the external data fetched over the connection to populate a table is to be saved with the workbook; otherwise, false. This exists for data security purposes - if no external data is saved in (or "cached") in the workbook, then current user credentials can be required every time to retrieve the relevant data, and people won't see the data the workbook author had last been using before saving the file.

Syntax

Namespace: FlexCel.Core

public Boolean SaveData { get; set; }

See also

  • TDataConnection


TDataConnection.RefreshOnLoad Property | FlexCel Studio for the .NET Framework documentation

TDataConnection.RefreshOnLoad Property

True if this connection should be refreshed when opening the file.

Syntax

Namespace: FlexCel.Core

public Boolean RefreshOnLoad { get; set; }

See also

  • TDataConnection


TDataConnection.Background Property | FlexCel Studio for the .NET Framework documentation

TDataConnection.Background Property

Indicates whether the connection can be refreshed in the background (asynchronously). True if preferred usage of the connection is to refresh asynchronously in the background; False if preferred usage of the connection is to refresh synchronously in the foreground.

Syntax

Namespace: FlexCel.Core

public Boolean Background { get; set; }

See also

  • TDataConnection


TDataConnectionDbProperties Class | FlexCel Studio for the .NET Framework documentation

TDataConnectionDbProperties Class

This element stores all properties associated with an ODBC or OLE DB external data connection.

Syntax

Namespace: FlexCel.Core

public class TDataConnectionDbProperties

Methods

Name | Description
Equals | Returns true if both objects are the same.
GetHashCode | Returns the hashcode of the object.

Properties

Name | Description
Connection | The string used to initiate a session with a data source.
Command | The string containing the database command to pass to the data provider that will interact with the external source in order to retrieve data.
ServerCommand | Specifies a second command text string that is persisted when PivotTable server-based page fields are in use. For ODBC connections, serverCommand is usually a broader query than command(no WHERE clause is present in the former). Based on these 2 commands, parameter UI can be populated and parameterized queries can be constructed.
CommandType | Specifies the custom data source command type. Values are passed to the custom data source provider and their meaning might change depending on the provider. For example, for OLEDB, the values can be: 1. Query specifies a cube name 2. Query specifies a SQL statement 3. Query specifies a table name 4. Query specifies that default information has been given, and it is up to the provider how to interpret. 5. Query is against a web based List Data Provider


TDataConnectionDbProperties.Equals Method | FlexCel Studio for the .NET Framework documentation

TDataConnectionDbProperties.Equals Method

Returns true if both objects are the same.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TDataConnectionDbProperties


TDataConnectionDbProperties.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TDataConnectionDbProperties.GetHashCode Method

Returns the hashcode of the object.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TDataConnectionDbProperties


TDataConnectionDbProperties.Connection Property | FlexCel Studio for the .NET Framework documentation

TDataConnectionDbProperties.Connection Property

The string used to initiate a session with a data source.

Syntax

Namespace: FlexCel.Core

public String Connection { get; set; }

See also

  • TDataConnectionDbProperties


TDataConnectionDbProperties.Command Property | FlexCel Studio for the .NET Framework documentation

TDataConnectionDbProperties.Command Property

The string containing the database command to pass to the data provider that will interact with the external source in order to retrieve data.

Syntax

Namespace: FlexCel.Core

public String Command { get; set; }

See also

  • TDataConnectionDbProperties


TDataConnectionDbProperties.ServerCommand Property | FlexCel Studio for the .NET Framework documentation

TDataConnectionDbProperties.ServerCommand Property

Specifies a second command text string that is persisted when PivotTable server-based page fields are in use. For ODBC connections, serverCommand is usually a broader query than command(no WHERE clause is present in the former). Based on these 2 commands, parameter UI can be populated and parameterized queries can be constructed.

Syntax

Namespace: FlexCel.Core

public String ServerCommand { get; set; }

See also

  • TDataConnectionDbProperties


TDataConnectionDbProperties.CommandType Property | FlexCel Studio for the .NET Framework documentation

TDataConnectionDbProperties.CommandType Property

Specifies the custom data source command type. Values are passed to the custom data source provider and their meaning might change depending on the provider.

For example, for OLEDB, the values can be: 1. Query specifies a cube name 2. Query specifies a SQL statement 3. Query specifies a table name 4. Query specifies that default information has been given, and it is up to the provider how to interpret. 5. Query is against a web based List Data Provider

Syntax

Namespace: FlexCel.Core

public Int32 CommandType { get; set; }

See also

  • TDataConnectionDbProperties


TDataConnectionOlapProperties Class | FlexCel Studio for the .NET Framework documentation

TDataConnectionOlapProperties Class

This element contains all the properties needed for an OLAP data connection. OLAP connections contain both the TDataConnectionDbProperties and TDataConnectionOlapProperties child elements.

Syntax

Namespace: FlexCel.Core

public class TDataConnectionOlapProperties

Methods

Name | Description
Equals | Returns true if both objects are the same.
GetHashCode | Returns the hashcode of the object.

Properties

Name | Description
Local | Flag indicating whether we should get data from the local cube on refresh versus the original data source. true if a local cube has been created for OLAP data, and it should be used instead of the server.
LocalConnection | Specifies a connection string to use when a local cube is available. This is used when local is set to true.
LocalRefresh | Flag indicating whether we should refresh the local cube from the original data source. When true, the original OLAP data source is queried each time the user explicitly refreshes the data in the application, and a new local cube is constructed from this query.
SendLocale | When true, the spreadsheetML app should send the user interface locale ID to the OLAP provider to retrieve localized member names and properties, etc. When false, no locale ID is expected.
RowDrillCount | Maximum number of drill-through rows to return when the user drills through an aggregate value in a PivotTable.
ServerFill | When true a PivotTable based on an OLAP source should format the data and aggregate cells in the PivotTable view using the background color from the OLAP source if this information is available.When false, OLAP server background fill colors are ignored, and standard formatting rules within the worksheet are followed.
ServerNumberFormat | When true, a PivotTable based on OLAP source should format the data and aggregate cells in the PivotTable view using the number format from the OLAP source.When false, OLAP server number formats are ignored, and standard formatting rules within the worksheet are followed.
ServerFont | When true, a PivotTable based on OLAP source should format the data and aggregate cells in the PivotTable view using the font from the OLAP source (e.g., Arial or Tahoma). When false, OLAP server fonts are ignored, and standard formatting rules within the worksheet are followed.
ServerFontColor | When true a PivotTable based on OLAP source should format the data and aggregate cells in the PivotTable view using the font color from the OLAP source.When false, OLAP server font colors are ignored, and standard formatting rules within the worksheet are followed.


TDataConnectionOlapProperties.Equals Method | FlexCel Studio for the .NET Framework documentation

TDataConnectionOlapProperties.Equals Method

Returns true if both objects are the same.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TDataConnectionOlapProperties


TDataConnectionOlapProperties.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TDataConnectionOlapProperties.GetHashCode Method

Returns the hashcode of the object.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TDataConnectionOlapProperties


TDataConnectionOlapProperties.Local Property | FlexCel Studio for the .NET Framework documentation

TDataConnectionOlapProperties.Local Property

Flag indicating whether we should get data from the local cube on refresh versus the original data source. true if a local cube has been created for OLAP data, and it should be used instead of the server.

Syntax

Namespace: FlexCel.Core

public Boolean Local { get; set; }

See also

  • TDataConnectionOlapProperties


TDataConnectionOlapProperties.LocalConnection Property | FlexCel Studio for the .NET Framework documentation

TDataConnectionOlapProperties.LocalConnection Property

Specifies a connection string to use when a local cube is available. This is used when local is set to true.

Syntax

Namespace: FlexCel.Core

public String LocalConnection { get; set; }

See also

  • TDataConnectionOlapProperties


TDataConnectionOlapProperties.LocalRefresh Property | FlexCel Studio for the .NET Framework documentation

TDataConnectionOlapProperties.LocalRefresh Property

Flag indicating whether we should refresh the local cube from the original data source. When true, the original OLAP data source is queried each time the user explicitly refreshes the data in the application, and a new local cube is constructed from this query.

Syntax

Namespace: FlexCel.Core

public Boolean LocalRefresh { get; set; }

See also

  • TDataConnectionOlapProperties


TDataConnectionOlapProperties.SendLocale Property | FlexCel Studio for the .NET Framework documentation

TDataConnectionOlapProperties.SendLocale Property

When true, the spreadsheetML app should send the user interface locale ID to the OLAP provider to retrieve localized member names and properties, etc. When false, no locale ID is expected.

Syntax

Namespace: FlexCel.Core

public Boolean SendLocale { get; set; }

See also

  • TDataConnectionOlapProperties


TDataConnectionOlapProperties.RowDrillCount Property | FlexCel Studio for the .NET Framework documentation

TDataConnectionOlapProperties.RowDrillCount Property

Maximum number of drill-through rows to return when the user drills through an aggregate value in a PivotTable.

Syntax

Namespace: FlexCel.Core

public Int32 RowDrillCount { get; set; }

See also

  • TDataConnectionOlapProperties


TDataConnectionOlapProperties.ServerFill Property | FlexCel Studio for the .NET Framework documentation

TDataConnectionOlapProperties.ServerFill Property

When true a PivotTable based on an OLAP source should format the data and aggregate cells in the PivotTable view using the background color from the OLAP source if this information is available.When false, OLAP server background fill colors are ignored, and standard formatting rules within the worksheet are followed.

Syntax

Namespace: FlexCel.Core

public Boolean ServerFill { get; set; }

See also

  • TDataConnectionOlapProperties


TDataConnectionOlapProperties.ServerNumberFormat Property | FlexCel Studio for the .NET Framework documentation

TDataConnectionOlapProperties.ServerNumberFormat Property

When true, a PivotTable based on OLAP source should format the data and aggregate cells in the PivotTable view using the number format from the OLAP source.When false, OLAP server number formats are ignored, and standard formatting rules within the worksheet are followed.

Syntax

Namespace: FlexCel.Core

public Boolean ServerNumberFormat { get; set; }

See also

  • TDataConnectionOlapProperties


TDataConnectionOlapProperties.ServerFont Property | FlexCel Studio for the .NET Framework documentation

TDataConnectionOlapProperties.ServerFont Property

When true, a PivotTable based on OLAP source should format the data and aggregate cells in the PivotTable view using the font from the OLAP source (e.g., Arial or Tahoma). When false, OLAP server fonts are ignored, and standard formatting rules within the worksheet are followed.

Syntax

Namespace: FlexCel.Core

public Boolean ServerFont { get; set; }

See also

  • TDataConnectionOlapProperties


TDataConnectionOlapProperties.ServerFontColor Property | FlexCel Studio for the .NET Framework documentation

TDataConnectionOlapProperties.ServerFontColor Property

When true a PivotTable based on OLAP source should format the data and aggregate cells in the PivotTable view using the font color from the OLAP source.When false, OLAP server font colors are ignored, and standard formatting rules within the worksheet are followed.

Syntax

Namespace: FlexCel.Core

public Boolean ServerFontColor { get; set; }

See also

  • TDataConnectionOlapProperties


TDataConnectionParameter Class | FlexCel Studio for the .NET Framework documentation

TDataConnectionParameter Class

This element stores properties about any parameters used with external data connections. Parameters are used to change the query executed externally and cause different data to be retrieved into the workbook.The type of parameter used determines whether the user is prompted for a value before data is refreshed, or the value is pulled from a cell in the workbook, or whether the same value should be used until explicitly changed in the data connection. Parameters are permitted for ODBC and web queries.

Syntax

Namespace: FlexCel.Core

public class TDataConnectionParameter

Methods

Name | Description
Equals | Returns true if both objects are the same.
GetHashCode | Returns the hashcode of the object.

Properties

Name | Description
Name | The name of the parameter.
SqlType | SQL data type of the parameter. This attribute is only supported for ODBC data sources. For more information, including supported data types, see ISO 9075-3:2008, Table 33 - Codes used for concise data types.
ParameterType | Type of parameter used. If the parameterType=value, then the value from AsBoolean, AsDouble, AsInteger, or AsString are used.In this case, it is expected that only one of those properties is specified.
RefreshOnChange | Flag indicating whether the query should automatically refresh when the contents of a cell that provides the parameter value changes. If true, then external data is refreshed using the new parameter value every time there's a change. If false, then external data is only refreshed when requested by the user, or some other event triggers refresh (e.g., workbook opened).
Prompt | Prompt string for the parameter. Presented to the spreadsheet user along with input UI to collect the parameter value before refreshing the external data.Used only when ParameterType = prompt.
AsBoolean | Boolean value to use as the query parameter. Used only when ParameterType = value.
AsDouble | Non-integer numeric value to use as the query parameter. Used only when ParameterType = value.
AsInteger | Integer value to use as the query parameter. Used when ParameterType = value.
AsString | String value to use as the query parameter. Used only when ParameterType = value.
AsCell | Cell reference indicating which cell's value to use for the query parameter. Used only when ParameterType = cell.


TDataConnectionParameter.Equals Method | FlexCel Studio for the .NET Framework documentation

TDataConnectionParameter.Equals Method

Returns true if both objects are the same.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TDataConnectionParameter


TDataConnectionParameter.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TDataConnectionParameter.GetHashCode Method

Returns the hashcode of the object.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TDataConnectionParameter


TDataConnectionParameter.Name Property | FlexCel Studio for the .NET Framework documentation

TDataConnectionParameter.Name Property

The name of the parameter.

Syntax

Namespace: FlexCel.Core

public String Name { get; set; }

See also

  • TDataConnectionParameter


TDataConnectionParameter.SqlType Property | FlexCel Studio for the .NET Framework documentation

TDataConnectionParameter.SqlType Property

SQL data type of the parameter. This attribute is only supported for ODBC data sources. For more information, including supported data types, see ISO 9075-3:2008, Table 33 - Codes used for concise data types.

Syntax

Namespace: FlexCel.Core

public Int32 SqlType { get; set; }

See also

  • TDataConnectionParameter


TDataConnectionParameter.ParameterType Property | FlexCel Studio for the .NET Framework documentation

TDataConnectionParameter.ParameterType Property

Type of parameter used. If the parameterType=value, then the value from AsBoolean, AsDouble, AsInteger, or AsString are used.In this case, it is expected that only one of those properties is specified.

Syntax

Namespace: FlexCel.Core

public TDataConnectionParameterType ParameterType { get; set; }

See also

  • TDataConnectionParameter


TDataConnectionParameter.RefreshOnChange Property | FlexCel Studio for the .NET Framework documentation

TDataConnectionParameter.RefreshOnChange Property

Flag indicating whether the query should automatically refresh when the contents of a cell that provides the parameter value changes. If true, then external data is refreshed using the new parameter value every time there's a change. If false, then external data is only refreshed when requested by the user, or some other event triggers refresh (e.g., workbook opened).

Syntax

Namespace: FlexCel.Core

public Boolean RefreshOnChange { get; set; }

See also

  • TDataConnectionParameter


TDataConnectionParameter.Prompt Property | FlexCel Studio for the .NET Framework documentation

TDataConnectionParameter.Prompt Property

Prompt string for the parameter. Presented to the spreadsheet user along with input UI to collect the parameter value before refreshing the external data.Used only when ParameterType = prompt.

Syntax

Namespace: FlexCel.Core

public String Prompt { get; set; }

See also

  • TDataConnectionParameter


TDataConnectionParameter.AsBoolean Property | FlexCel Studio for the .NET Framework documentation

TDataConnectionParameter.AsBoolean Property

Boolean value to use as the query parameter. Used only when ParameterType = value.

Syntax

Namespace: FlexCel.Core

public Nullable<Boolean> AsBoolean { get; set; }

See also

  • TDataConnectionParameter


TDataConnectionParameter.AsDouble Property | FlexCel Studio for the .NET Framework documentation

TDataConnectionParameter.AsDouble Property

Non-integer numeric value to use as the query parameter. Used only when ParameterType = value.

Syntax

Namespace: FlexCel.Core

public Nullable<Double> AsDouble { get; set; }

See also

  • TDataConnectionParameter


TDataConnectionParameter.AsInteger Property | FlexCel Studio for the .NET Framework documentation

TDataConnectionParameter.AsInteger Property

Integer value to use as the query parameter. Used when ParameterType = value.

Syntax

Namespace: FlexCel.Core

public Nullable<Int32> AsInteger { get; set; }

See also

  • TDataConnectionParameter


TDataConnectionParameter.AsString Property | FlexCel Studio for the .NET Framework documentation

TDataConnectionParameter.AsString Property

String value to use as the query parameter. Used only when ParameterType = value.

Syntax

Namespace: FlexCel.Core

public String AsString { get; set; }

See also

  • TDataConnectionParameter


TDataConnectionParameter.AsCell Property | FlexCel Studio for the .NET Framework documentation

TDataConnectionParameter.AsCell Property

Cell reference indicating which cell's value to use for the query parameter. Used only when ParameterType = cell.

Syntax

Namespace: FlexCel.Core

public String AsCell { get; set; }

See also

  • TDataConnectionParameter


TDataConnectionParameters Class | FlexCel Studio for the .NET Framework documentation

TDataConnectionParameters Class

A list of TDataConnectionParameter.

Syntax

Namespace: FlexCel.Core

public class TDataConnectionParameters

Methods

Name | Description
Add | Adds a new parameter to the list.
RemoveAt | Removes a parameter from the list.
Clear | Removes all parameters from the list.
Equals | Returns true if object obj has the same data in the same order.
GetHashCode | Returns the hashcode of the object.

Properties

Name | Description
Count | Count of available parameters.
this[] | Gets or sets the parameter at position index (0 based).


TDataConnectionParameters.Add Method | FlexCel Studio for the .NET Framework documentation

TDataConnectionParameters.Add Method

Adds a new parameter to the list.

Syntax

Namespace: FlexCel.Core

public void Add(TDataConnectionParameter aParameter)

Parameters

<-> | Parameter | Type | Description
 | aParameter | TDataConnection​Parameter | Parameter to add.

See also

  • TDataConnectionParameters


TDataConnectionParameters.RemoveAt Method | FlexCel Studio for the .NET Framework documentation

TDataConnectionParameters.RemoveAt Method

Removes a parameter from the list.

Syntax

Namespace: FlexCel.Core

public void RemoveAt(Int32 index)

Parameters

<-> | Parameter | Type | Description
 | index | Int32 | Index where to remove the parameter (0 based)

See also

  • TDataConnectionParameters


TDataConnectionParameters.Clear Method | FlexCel Studio for the .NET Framework documentation

TDataConnectionParameters.Clear Method

Removes all parameters from the list.

Syntax

Namespace: FlexCel.Core

public void Clear()

See also

  • TDataConnectionParameters


TDataConnectionParameters.Equals Method | FlexCel Studio for the .NET Framework documentation

TDataConnectionParameters.Equals Method

Returns true if object obj has the same data in the same order.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TDataConnectionParameters


TDataConnectionParameters.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TDataConnectionParameters.GetHashCode Method

Returns the hashcode of the object.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TDataConnectionParameters


TDataConnectionParameters.Count Property | FlexCel Studio for the .NET Framework documentation

TDataConnectionParameters.Count Property

Count of available parameters.

Syntax

Namespace: FlexCel.Core

public Int32 Count { get; }

See also

  • TDataConnectionParameters


TDataConnectionParameters.this[] Property | FlexCel Studio for the .NET Framework documentation

TDataConnectionParameters.this[] Property

Gets or sets the parameter at position index (0 based).

Syntax

Namespace: FlexCel.Core

public TDataConnectionParameter this[] { get; set; }

See also

  • TDataConnectionParameters


TDataConnections Class | FlexCel Studio for the .NET Framework documentation

TDataConnections Class

Collection of data connections in a file.

Syntax

Namespace: FlexCel.Core

public class TDataConnections

Methods

Name | Description
Add | Adds a new connection to the list.
RemoveAt | Removes a connection from the list.
Clear | Removes all connections from the list.
Equals | Returns true if object obj has the same data in the same order.
GetHashCode | Returns the hashcode of the object.

Properties

Name | Description
Count | Count of available connections.
this[] | Gets or sets the connection at position index (0 based).


TDataConnections.Add Method | FlexCel Studio for the .NET Framework documentation

TDataConnections.Add Method

Adds a new connection to the list.

Syntax

Namespace: FlexCel.Core

public void Add(TDataConnection aConnection)

Parameters

<-> | Parameter | Type | Description
 | aConnection | TDataConnection | Connection to add.

See also

  • TDataConnections


TDataConnections.RemoveAt Method | FlexCel Studio for the .NET Framework documentation

TDataConnections.RemoveAt Method

Removes a connection from the list.

Syntax

Namespace: FlexCel.Core

public void RemoveAt(Int32 index)

Parameters

<-> | Parameter | Type | Description
 | index | Int32 | Index where to remove the connection (0 based)

See also

  • TDataConnections


TDataConnections.Clear Method | FlexCel Studio for the .NET Framework documentation

TDataConnections.Clear Method

Removes all connections from the list.

Syntax

Namespace: FlexCel.Core

public void Clear()

See also

  • TDataConnections


TDataConnections.Equals Method | FlexCel Studio for the .NET Framework documentation

TDataConnections.Equals Method

Returns true if object obj has the same data in the same order.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TDataConnections


TDataConnections.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TDataConnections.GetHashCode Method

Returns the hashcode of the object.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TDataConnections


TDataConnections.Count Property | FlexCel Studio for the .NET Framework documentation

TDataConnections.Count Property

Count of available connections.

Syntax

Namespace: FlexCel.Core

public Int32 Count { get; }

See also

  • TDataConnections


TDataConnections.this[] Property | FlexCel Studio for the .NET Framework documentation

TDataConnections.this[] Property

Gets or sets the connection at position index (0 based).

Syntax

Namespace: FlexCel.Core

public TDataConnection this[] { get; set; }

See also

  • TDataConnections


TDataConnectionTable Class | FlexCel Studio for the .NET Framework documentation

TDataConnectionTable Class

Specifies the HTML table to import.

Syntax

Namespace: FlexCel.Core

public class TDataConnectionTable

Methods

Name | Description
Equals | Returns true if both objects are the same.
GetHashCode | Returns the hashcode of the object.

Properties

Name | Description
TableName | This element is used to specify an HTML table to import by name. If the tables are not named, they shall be specified with the TableIndex property instead. If neither this property or TableIndex are given, the table is considered missing.
TableIndex | Index of the HTML table that is going to be imported. this is used if no TableName is specified. . If neither this property or TableName are given, the table is considered missing.


TDataConnectionTable.Equals Method | FlexCel Studio for the .NET Framework documentation

TDataConnectionTable.Equals Method

Returns true if both objects are the same.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TDataConnectionTable


TDataConnectionTable.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TDataConnectionTable.GetHashCode Method

Returns the hashcode of the object.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TDataConnectionTable


TDataConnectionTable.TableName Property | FlexCel Studio for the .NET Framework documentation

TDataConnectionTable.TableName Property

This element is used to specify an HTML table to import by name. If the tables are not named, they shall be specified with the TableIndex property instead. If neither this property or TableIndex are given, the table is considered missing.

Syntax

Namespace: FlexCel.Core

public String TableName { get; set; }

See also

  • TDataConnectionTable


TDataConnectionTable.TableIndex Property | FlexCel Studio for the .NET Framework documentation

TDataConnectionTable.TableIndex Property

Index of the HTML table that is going to be imported. this is used if no TableName is specified. . If neither this property or TableName are given, the table is considered missing.

Syntax

Namespace: FlexCel.Core

public Nullable<Int32> TableIndex { get; set; }

See also

  • TDataConnectionTable


TDataConnectionTables Class | FlexCel Studio for the .NET Framework documentation

TDataConnectionTables Class

Collection of HTML tables in a web query connection.

Syntax

Namespace: FlexCel.Core

public class TDataConnectionTables

Methods

Name | Description
Add | Adds a new table to the list.
RemoveAt | Removes a table from the list.
Clear | Removes all tables from the list.
Equals | Returns true if object obj has the same data in the same order.
GetHashCode | Returns the hashcode of the object.

Properties

Name | Description
Count | Count of available tables.
this[] | Gets or sets the table at position index (0 based).


TDataConnectionTables.Add Method | FlexCel Studio for the .NET Framework documentation

TDataConnectionTables.Add Method

Adds a new table to the list.

Syntax

Namespace: FlexCel.Core

public void Add(TDataConnectionTable aTable)

Parameters

<-> | Parameter | Type | Description
 | aTable | TDataConnectionTable | Table to add.

See also

  • TDataConnectionTables


TDataConnectionTables.RemoveAt Method | FlexCel Studio for the .NET Framework documentation

TDataConnectionTables.RemoveAt Method

Removes a table from the list.

Syntax

Namespace: FlexCel.Core

public void RemoveAt(Int32 index)

Parameters

<-> | Parameter | Type | Description
 | index | Int32 | Index where to remove the table (0 based)

See also

  • TDataConnectionTables


TDataConnectionTables.Clear Method | FlexCel Studio for the .NET Framework documentation

TDataConnectionTables.Clear Method

Removes all tables from the list.

Syntax

Namespace: FlexCel.Core

public void Clear()

See also

  • TDataConnectionTables


TDataConnectionTables.Equals Method | FlexCel Studio for the .NET Framework documentation

TDataConnectionTables.Equals Method

Returns true if object obj has the same data in the same order.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TDataConnectionTables


TDataConnectionTables.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TDataConnectionTables.GetHashCode Method

Returns the hashcode of the object.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TDataConnectionTables


TDataConnectionTables.Count Property | FlexCel Studio for the .NET Framework documentation

TDataConnectionTables.Count Property

Count of available tables.

Syntax

Namespace: FlexCel.Core

public Int32 Count { get; }

See also

  • TDataConnectionTables


TDataConnectionTables.this[] Property | FlexCel Studio for the .NET Framework documentation

TDataConnectionTables.this[] Property

Gets or sets the table at position index (0 based).

Syntax

Namespace: FlexCel.Core

public TDataConnectionTable this[] { get; set; }

See also

  • TDataConnectionTables


TDataConnectionTextField Class | FlexCel Studio for the .NET Framework documentation

TDataConnectionTextField Class

This element specifies field settings for text import.

Syntax

Namespace: FlexCel.Core

public class TDataConnectionTextField

Methods

Name | Description
Equals | Returns true if both objects are the same.
GetHashCode | Returns the hashcode of the object.

Properties

Name | Description
Position | The character position the field starts at for fixed-length fields. The index is 0-based. Subsequent textField elements or carriage returns in the text stream serve to denote endpoints for text fields.
FieldType | Specifies the field Type. When text is imported into cells in the worksheet, the data in the cells are converted to the field type defined here. Types can be specified by the user, or determined algorithmically via heuristics.


TDataConnectionTextField.Equals Method | FlexCel Studio for the .NET Framework documentation

TDataConnectionTextField.Equals Method

Returns true if both objects are the same.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TDataConnectionTextField


TDataConnectionTextField.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TDataConnectionTextField.GetHashCode Method

Returns the hashcode of the object.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TDataConnectionTextField


TDataConnectionTextField.Position Property | FlexCel Studio for the .NET Framework documentation

TDataConnectionTextField.Position Property

The character position the field starts at for fixed-length fields. The index is 0-based. Subsequent textField elements or carriage returns in the text stream serve to denote endpoints for text fields.

Syntax

Namespace: FlexCel.Core

public Int32 Position { get; set; }

See also

  • TDataConnectionTextField


TDataConnectionTextField.FieldType Property | FlexCel Studio for the .NET Framework documentation

TDataConnectionTextField.FieldType Property

Specifies the field Type. When text is imported into cells in the worksheet, the data in the cells are converted to the field type defined here. Types can be specified by the user, or determined algorithmically via heuristics.

Syntax

Namespace: FlexCel.Core

public TDataConnectionFieldType FieldType { get; set; }

See also

  • TDataConnectionTextField


TDataConnectionTextFields Class | FlexCel Studio for the .NET Framework documentation

TDataConnectionTextFields Class

Collection of fields in the Text connection.

Syntax

Namespace: FlexCel.Core

public class TDataConnectionTextFields

Methods

Name | Description
Add | Adds a new field to the list.
RemoveAt | Removes a field from the list.
Clear | Removes all fields from the list.
Equals | Returns true if object obj has the same data in the same order.
GetHashCode | Returns the hashcode of the object.

Properties

Name | Description
Count | Count of available fields.
this[] | Gets or sets the field at position index (0 based).


TDataConnectionTextFields.Add Method | FlexCel Studio for the .NET Framework documentation

TDataConnectionTextFields.Add Method

Adds a new field to the list.

Syntax

Namespace: FlexCel.Core

public void Add(TDataConnectionTextField aField)

Parameters

<-> | Parameter | Type | Description
 | aField | TDataConnection​Text​Field | Field to add.

See also

  • TDataConnectionTextFields


TDataConnectionTextFields.RemoveAt Method | FlexCel Studio for the .NET Framework documentation

TDataConnectionTextFields.RemoveAt Method

Removes a field from the list.

Syntax

Namespace: FlexCel.Core

public void RemoveAt(Int32 index)

Parameters

<-> | Parameter | Type | Description
 | index | Int32 | Index where to remove the field (0 based)

See also

  • TDataConnectionTextFields


TDataConnectionTextFields.Clear Method | FlexCel Studio for the .NET Framework documentation

TDataConnectionTextFields.Clear Method

Removes all fields from the list.

Syntax

Namespace: FlexCel.Core

public void Clear()

See also

  • TDataConnectionTextFields


TDataConnectionTextFields.Equals Method | FlexCel Studio for the .NET Framework documentation

TDataConnectionTextFields.Equals Method

Returns true if object obj has the same data in the same order.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TDataConnectionTextFields


TDataConnectionTextFields.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TDataConnectionTextFields.GetHashCode Method

Returns the hashcode of the object.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TDataConnectionTextFields


TDataConnectionTextFields.Count Property | FlexCel Studio for the .NET Framework documentation

TDataConnectionTextFields.Count Property

Count of available fields.

Syntax

Namespace: FlexCel.Core

public Int32 Count { get; }

See also

  • TDataConnectionTextFields


TDataConnectionTextFields.this[] Property | FlexCel Studio for the .NET Framework documentation

TDataConnectionTextFields.this[] Property

Gets or sets the field at position index (0 based).

Syntax

Namespace: FlexCel.Core

public TDataConnectionTextField this[] { get; set; }

See also

  • TDataConnectionTextFields


TDataConnectionTextImportProperties Class | FlexCel Studio for the .NET Framework documentation

TDataConnectionTextImportProperties Class

This element contains all of the text import settings.

Syntax

Namespace: FlexCel.Core

public class TDataConnectionTextImportProperties

Methods

Name | Description
Equals | Returns true if both objects are the same.
GetHashCode | Returns the hashcode of the object.

Properties

Name | Description
TextFields | Field definitions. This property is never null, and by modifying it you modify the parent TextImportProperties too.
PromptForFileName | Flag indicating whether the user wants to be prompted for the file name on refresh. If false, then the user is not prompted.If true or not present, then the user is prompted.
FileType | Ignorable attribute. Determines the kind of character set to use during import. Only one of FileType and CharacterSet or CodePage shall be specified.
CharacterSet | Name of the character set associated with the text file. Values for this attribute are restricted to the names and aliases listed in the IANA CHARACTER SETS listing found at http:​//​www.​iana.​org/​assignments/​character-​sets.​ If this attribute is not present then the CodePage attribute is used.
FirstRow | Indicates at what row of the file to start the data import. All unsignedInt values are permitted, although it's possible that firstRow is higher than the number of rows in the text file, in which case no data is imported.
SourceFile | Path to the text file to use to import external data. Can be expressed in URI or systemspecific file path notation.
IsDelimited | True if the file is Tab or character delimited. false if the file should be parsed according to fixed length fields.
DecimalSeparator | The decimal separator character. This and the thousands attribute are used only when data in the text file contains decimal and thousands separators that are different from those used on the computer, due to a different language setting being used.
ThousandsSeparator | The thousands separator character. This and the decimal attribute are used only when data in the text file contains decimal and thousands separators that are different from those used on the computer, due to a different language setting being used.Please refer to the decimal attribute description above for a Table describing the behavior. Strings values of this attribute are expected to be one character in length.
TabIsDelimiter | Flag indicating whether to treat tab characters as field delimiters. If false, then tabs will not be used as delimiters.If true or not present, then they are used as delimiters.
SpaceIsDelimiter | Flag indicating whether to treat space characters as field delimiters.
CommaIsDelimiter | Flag indicating whether to treat comma characters as field delimiters.
SemicolonIsDelimiter | Flag indicating whether to treat semicolon characters as field delimiters.
ConsecutiveDelimiters | Flag indicating whether consecutive delimiters should be treated as just one delimiter. If this flag is true than it's possible or even likely that some rows will return more fields than others, and these fields will always fill cells in the worksheet from left to right.
Qualifier | Character used as the text string qualifier.
Delimiter | User-specified character to be treated as a field delimiter. Only single characters are supported.


TDataConnectionTextImportProperties.Equals Method | FlexCel Studio for the .NET Framework documentation

TDataConnectionTextImportProperties.Equals Method

Returns true if both objects are the same.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TDataConnectionTextImportProperties


TDataConnectionTextImportProperties.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TDataConnectionTextImportProperties.GetHashCode Method

Returns the hashcode of the object.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TDataConnectionTextImportProperties


TDataConnectionTextImportProperties.TextFields Property | FlexCel Studio for the .NET Framework documentation

TDataConnectionTextImportProperties.TextFields Property

Field definitions. This property is never null, and by modifying it you modify the parent TextImportProperties too.

Syntax

Namespace: FlexCel.Core

public TDataConnectionTextFields TextFields { get; }

See also

  • TDataConnectionTextImportProperties


TDataConnectionTextImportProperties.PromptForFileName Property | FlexCel Studio for the .NET Framework documentation

TDataConnectionTextImportProperties.PromptForFileName Property

Flag indicating whether the user wants to be prompted for the file name on refresh. If false, then the user is not prompted.If true or not present, then the user is prompted.

Syntax

Namespace: FlexCel.Core

public Boolean PromptForFileName { get; set; }

See also

  • TDataConnectionTextImportProperties


TDataConnectionTextImportProperties.FileType Property | FlexCel Studio for the .NET Framework documentation

TDataConnectionTextImportProperties.FileType Property

Ignorable attribute. Determines the kind of character set to use during import. Only one of FileType and CharacterSet or CodePage shall be specified.

Syntax

Namespace: FlexCel.Core

public TDataConnectionFileType FileType { get; set; }

See also

  • TDataConnectionTextImportProperties


TDataConnectionTextImportProperties.CharacterSet Property | FlexCel Studio for the .NET Framework documentation

TDataConnectionTextImportProperties.CharacterSet Property

Name of the character set associated with the text file. Values for this attribute are restricted to the names and aliases listed in the IANA CHARACTER SETS listing found at http://www.iana.org/assignments/character-sets.

If this attribute is not present then the CodePage attribute is used.

Syntax

Namespace: FlexCel.Core

public String CharacterSet { get; set; }

See also

  • TDataConnectionTextImportProperties


TDataConnectionTextImportProperties.FirstRow Property | FlexCel Studio for the .NET Framework documentation

TDataConnectionTextImportProperties.FirstRow Property

Indicates at what row of the file to start the data import. All unsignedInt values are permitted, although it's possible that firstRow is higher than the number of rows in the text file, in which case no data is imported.

Syntax

Namespace: FlexCel.Core

public Int32 FirstRow { get; set; }

See also

  • TDataConnectionTextImportProperties


TDataConnectionTextImportProperties.SourceFile Property | FlexCel Studio for the .NET Framework documentation

TDataConnectionTextImportProperties.SourceFile Property

Path to the text file to use to import external data. Can be expressed in URI or systemspecific file path notation.

Syntax

Namespace: FlexCel.Core

public String SourceFile { get; set; }

See also

  • TDataConnectionTextImportProperties


TDataConnectionTextImportProperties.IsDelimited Property | FlexCel Studio for the .NET Framework documentation

TDataConnectionTextImportProperties.IsDelimited Property

True if the file is Tab or character delimited. false if the file should be parsed according to fixed length fields.

Syntax

Namespace: FlexCel.Core

public Boolean IsDelimited { get; set; }

See also

  • TDataConnectionTextImportProperties


TDataConnectionTextImportProperties.DecimalSeparator Property | FlexCel Studio for the .NET Framework documentation

TDataConnectionTextImportProperties.DecimalSeparator Property

The decimal separator character. This and the thousands attribute are used only when data in the text file contains decimal and thousands separators that are different from those used on the computer, due to a different language setting being used.

Syntax

Namespace: FlexCel.Core

public String DecimalSeparator { get; set; }

See also

  • TDataConnectionTextImportProperties


TDataConnectionTextImportProperties.ThousandsSeparator Property | FlexCel Studio for the .NET Framework documentation

TDataConnectionTextImportProperties.ThousandsSeparator Property

The thousands separator character. This and the decimal attribute are used only when data in the text file contains decimal and thousands separators that are different from those used on the computer, due to a different language setting being used.Please refer to the decimal attribute description above for a Table describing the behavior. Strings values of this attribute are expected to be one character in length.

Syntax

Namespace: FlexCel.Core

public String ThousandsSeparator { get; set; }

See also

  • TDataConnectionTextImportProperties


TDataConnectionTextImportProperties.TabIsDelimiter Property | FlexCel Studio for the .NET Framework documentation

TDataConnectionTextImportProperties.TabIsDelimiter Property

Flag indicating whether to treat tab characters as field delimiters. If false, then tabs will not be used as delimiters.If true or not present, then they are used as delimiters.

Syntax

Namespace: FlexCel.Core

public Boolean TabIsDelimiter { get; set; }

See also

  • TDataConnectionTextImportProperties


TDataConnectionTextImportProperties.SpaceIsDelimiter Property | FlexCel Studio for the .NET Framework documentation

TDataConnectionTextImportProperties.SpaceIsDelimiter Property

Flag indicating whether to treat space characters as field delimiters.

Syntax

Namespace: FlexCel.Core

public Boolean SpaceIsDelimiter { get; set; }

See also

  • TDataConnectionTextImportProperties


TDataConnectionTextImportProperties.CommaIsDelimiter Property | FlexCel Studio for the .NET Framework documentation

TDataConnectionTextImportProperties.CommaIsDelimiter Property

Flag indicating whether to treat comma characters as field delimiters.

Syntax

Namespace: FlexCel.Core

public Boolean CommaIsDelimiter { get; set; }

See also

  • TDataConnectionTextImportProperties


TDataConnectionTextImportProperties.SemicolonIsDelimiter Property | FlexCel Studio for the .NET Framework documentation

TDataConnectionTextImportProperties.SemicolonIsDelimiter Property

Flag indicating whether to treat semicolon characters as field delimiters.

Syntax

Namespace: FlexCel.Core

public Boolean SemicolonIsDelimiter { get; set; }

See also

  • TDataConnectionTextImportProperties


TDataConnectionTextImportProperties.ConsecutiveDelimiters Property | FlexCel Studio for the .NET Framework documentation

TDataConnectionTextImportProperties.ConsecutiveDelimiters Property

Flag indicating whether consecutive delimiters should be treated as just one delimiter. If this flag is true than it's possible or even likely that some rows will return more fields than others, and these fields will always fill cells in the worksheet from left to right.

Syntax

Namespace: FlexCel.Core

public Boolean ConsecutiveDelimiters { get; set; }

See also

  • TDataConnectionTextImportProperties


TDataConnectionTextImportProperties.Qualifier Property | FlexCel Studio for the .NET Framework documentation

TDataConnectionTextImportProperties.Qualifier Property

Character used as the text string qualifier.

Syntax

Namespace: FlexCel.Core

public TDataConnectionQualifier Qualifier { get; set; }

See also

  • TDataConnectionTextImportProperties


TDataConnectionTextImportProperties.Delimiter Property | FlexCel Studio for the .NET Framework documentation

TDataConnectionTextImportProperties.Delimiter Property

User-specified character to be treated as a field delimiter. Only single characters are supported.

Syntax

Namespace: FlexCel.Core

public String Delimiter { get; set; }

See also

  • TDataConnectionTextImportProperties


TDataConnectionWebQueryProperties Class | FlexCel Studio for the .NET Framework documentation

TDataConnectionWebQueryProperties Class

This element specifies the properties for a web query source. A web query will retrieve data from HTML tables, and can also supply HTTP "Get" parameters to be processed by the web server in generating the HTML by including the parameters and parameter elements.

Syntax

Namespace: FlexCel.Core

public class TDataConnectionWebQueryProperties

Methods

Name | Description
Equals | Returns true if both objects are the same.
GetHashCode | Returns the hashcode of the object.

Properties

Name | Description
EditPage | The URL of the user-facing web page showing the web query data. This URL is persisted in the case that sourceData = "true" and url has been redirected to reference an XML file. Then the user-facing page can be shown in the UI, and the XML data can be retrieved behind the scenes.
HtmlFormat | How to handle formatting from the HTML source when bringing web query data into the worksheet. Relevant when SourceData is True.
HtmlTables | Flag indicating whether web queries should only work on HTML tables.
Post | Returns or sets the string used with the post method of inputting data into a web server to return data from a web query.
Url | URL to use to refresh external data.
Xl2000 | This flag exists for backward compatibility with older existing spreadsheet files, and is set to true if this web query was refreshed in a spreadsheet application newer than or equal to Microsoft Excel 2000. This is an optional attribute that can be ignored.
TextDates | Flag indicating whether dates should be imported into cells in the worksheet as text rather than dates.
Xl97 | This flag exists for backward compatibility with older existing spreadhseet files, and is set to true if this web query was created in Microsoft Excel 97. This is an optional attribute that can be ignored.
FirstRow | Flag indicating whether to parse all tables inside a PRE block with the same width settings as the first row.
ConsecutiveDelimiters | Flag indicating whether consecutive delimiters should be treated as just one delimiter.
ParsePre | Flag indicating whether data contained within HTML <PRE> tags in the web page is parsed into columns when you import the page into a query table.
SourceData | Flag indicating that XML source data should be imported instead of the HTML table itself.
Xml | true if the web query source is XML (versus HTML).
Tables | A collection of tables in the HTML file. This property is never null, and by modifying it you modify the parent WebQueryProperties too.


TDataConnectionWebQueryProperties.Equals Method | FlexCel Studio for the .NET Framework documentation

TDataConnectionWebQueryProperties.Equals Method

Returns true if both objects are the same.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TDataConnectionWebQueryProperties


TDataConnectionWebQueryProperties.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TDataConnectionWebQueryProperties.GetHashCode Method

Returns the hashcode of the object.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TDataConnectionWebQueryProperties


TDataConnectionWebQueryProperties.EditPage Property | FlexCel Studio for the .NET Framework documentation

TDataConnectionWebQueryProperties.EditPage Property

The URL of the user-facing web page showing the web query data. This URL is persisted in the case that sourceData = "true" and url has been redirected to reference an XML file. Then the user-facing page can be shown in the UI, and the XML data can be retrieved behind the scenes.

Syntax

Namespace: FlexCel.Core

public String EditPage { get; set; }

See also

  • TDataConnectionWebQueryProperties


TDataConnectionWebQueryProperties.HtmlFormat Property | FlexCel Studio for the .NET Framework documentation

TDataConnectionWebQueryProperties.HtmlFormat Property

How to handle formatting from the HTML source when bringing web query data into the worksheet. Relevant when SourceData is True.

Syntax

Namespace: FlexCel.Core

public TDataConnectionHtmlFormat HtmlFormat { get; set; }

See also

  • TDataConnectionWebQueryProperties


TDataConnectionWebQueryProperties.HtmlTables Property | FlexCel Studio for the .NET Framework documentation

TDataConnectionWebQueryProperties.HtmlTables Property

Flag indicating whether web queries should only work on HTML tables.

Syntax

Namespace: FlexCel.Core

public Boolean HtmlTables { get; set; }

See also

  • TDataConnectionWebQueryProperties


TDataConnectionWebQueryProperties.Post Property | FlexCel Studio for the .NET Framework documentation

TDataConnectionWebQueryProperties.Post Property

Returns or sets the string used with the post method of inputting data into a web server to return data from a web query.

Syntax

Namespace: FlexCel.Core

public String Post { get; set; }

See also

  • TDataConnectionWebQueryProperties


TDataConnectionWebQueryProperties.Url Property | FlexCel Studio for the .NET Framework documentation

TDataConnectionWebQueryProperties.Url Property

URL to use to refresh external data.

Syntax

Namespace: FlexCel.Core

public String Url { get; set; }

See also

  • TDataConnectionWebQueryProperties


TDataConnectionWebQueryProperties.Xl2000 Property | FlexCel Studio for the .NET Framework documentation

TDataConnectionWebQueryProperties.Xl2000 Property

This flag exists for backward compatibility with older existing spreadsheet files, and is set to true if this web query was refreshed in a spreadsheet application newer than or equal to Microsoft Excel 2000. This is an optional attribute that can be ignored.

Syntax

Namespace: FlexCel.Core

public Boolean Xl2000 { get; set; }

See also

  • TDataConnectionWebQueryProperties


TDataConnectionWebQueryProperties.TextDates Property | FlexCel Studio for the .NET Framework documentation

TDataConnectionWebQueryProperties.TextDates Property

Flag indicating whether dates should be imported into cells in the worksheet as text rather than dates.

Syntax

Namespace: FlexCel.Core

public Boolean TextDates { get; set; }

See also

  • TDataConnectionWebQueryProperties


TDataConnectionWebQueryProperties.Xl97 Property | FlexCel Studio for the .NET Framework documentation

TDataConnectionWebQueryProperties.Xl97 Property

This flag exists for backward compatibility with older existing spreadhseet files, and is set to true if this web query was created in Microsoft Excel 97. This is an optional attribute that can be ignored.

Syntax

Namespace: FlexCel.Core

public Boolean Xl97 { get; set; }

See also

  • TDataConnectionWebQueryProperties


TDataConnectionWebQueryProperties.FirstRow Property | FlexCel Studio for the .NET Framework documentation

TDataConnectionWebQueryProperties.FirstRow Property

Flag indicating whether to parse all tables inside a PRE block with the same width settings as the first row.

Syntax

Namespace: FlexCel.Core

public Boolean FirstRow { get; set; }

See also

  • TDataConnectionWebQueryProperties


TDataConnectionWebQueryProperties.ConsecutiveDelimiters Property | FlexCel Studio for the .NET Framework documentation

TDataConnectionWebQueryProperties.ConsecutiveDelimiters Property

Flag indicating whether consecutive delimiters should be treated as just one delimiter.

Syntax

Namespace: FlexCel.Core

public Boolean ConsecutiveDelimiters { get; set; }

See also

  • TDataConnectionWebQueryProperties


TDataConnectionWebQueryProperties.ParsePre Property | FlexCel Studio for the .NET Framework documentation

TDataConnectionWebQueryProperties.ParsePre Property

Flag indicating whether data contained within HTML <PRE> tags in the web page is parsed into columns when you import the page into a query table.

Syntax

Namespace: FlexCel.Core

public Boolean ParsePre { get; set; }

See also

  • TDataConnectionWebQueryProperties


TDataConnectionWebQueryProperties.SourceData Property | FlexCel Studio for the .NET Framework documentation

TDataConnectionWebQueryProperties.SourceData Property

Flag indicating that XML source data should be imported instead of the HTML table itself.

Syntax

Namespace: FlexCel.Core

public Boolean SourceData { get; set; }

See also

  • TDataConnectionWebQueryProperties


TDataConnectionWebQueryProperties.Xml Property | FlexCel Studio for the .NET Framework documentation

TDataConnectionWebQueryProperties.Xml Property

true if the web query source is XML (versus HTML).

Syntax

Namespace: FlexCel.Core

public Boolean Xml { get; set; }

See also

  • TDataConnectionWebQueryProperties


TDataConnectionWebQueryProperties.Tables Property | FlexCel Studio for the .NET Framework documentation

TDataConnectionWebQueryProperties.Tables Property

A collection of tables in the HTML file. This property is never null, and by modifying it you modify the parent WebQueryProperties too.

Syntax

Namespace: FlexCel.Core

public TDataConnectionTables Tables { get; }

See also

  • TDataConnectionWebQueryProperties


TDataLabel Class | FlexCel Studio for the .NET Framework documentation

TDataLabel Class

Represents one data label on the chart.

Syntax

Namespace: FlexCel.Core

public class TDataLabel: ICloneable

Methods

Name | Description
Clone | Returns a deep copy of the object.

Properties

Name | Description
PositionXls | Position of the label, assuming margins in the plot area. This value is only set in xls files, and has different meanings depending on the kind of label: In titles, x and y are the offset from the chart position in units of 1/4000 of the position. In axis titles, x means offset perpendicular to the axis, in units of 1/1000 of the plot-area bounding box, and y means offset parallel to the axis, in units of 1/1000 of the axis length. In data labels for pie charts, x is the offset angle from the default, in degrees clockwise, while y is the radial offset, in units of 1/1000 of the pie radius....[more]
PositionZeroBased | Coordinates in percent of the chart area. Different from PositionXls this value has no margin attached. In old xls files, this value might not be set. If set, it should always be used instead of PositionXls. Note that for titles and axis titles the height and width is always automatic. For data labels in xlsx files, you can specify a size.
TextOptions | Formatting options for this label.
LabelOptions | Data options for the label.
Frame | Background for the label, if there is one. Null otherwise.
LabelValues | A list with the actual values for the label, evaluated from the formula at LabelDefinition IMPORTANT NOTE: The values here only are valid if LabelOptions indicates a manual DataType. The results can contain TDrawingRich​Strings.​
LabelDefinition | The formula defining the values on this label. You can access the actual values of the labels with LabelValues.
LinkedTo | Defines to which object this label is linked.
SeriesIndex | Series number for the series this label displays. This value only has meaning if LinkedTo is TLinkOptions.​Data​Label
DataPointIndex | Point index of the point this label displays. This value only has meaning if LinkedTo is TLinkOptions.​Data​Label and the label is for only one point. When the label is for the whole series, DataPointIndex is -1.
NumberFormat | Numeric format for this label.
NumberFormat​Linked​ToSource | True if the format for the numbers on this label is linked to the format in the cells in the spreadsheet.
LeaderLines | True if there are lines from the slices to the labels. This value only has effect in the default label for the series, since you can't individually set leader lines.
LeaderLineStyle | Line style for the leader lines, only has meaning if LeaderLines is true.
EnclosingRect | Calculated rectangle enclosing the label at zero rotation. The default value is empty unless you manually set it.
EnclosingRect​Rotation | The calculated angle in degrees to rotate EnclosingRect. The default value is empty unless you manually set it.


TDataLabel.Clone Method | FlexCel Studio for the .NET Framework documentation

TDataLabel.Clone Method

Returns a deep copy of the object.

Syntax

Namespace: FlexCel.Core

public Object Clone()

See also

  • TDataLabel


TDataLabel.PositionXls Property | FlexCel Studio for the .NET Framework documentation

TDataLabel.PositionXls Property

Position of the label, assuming margins in the plot area. This value is only set in xls files, and has different meanings depending on the kind of label:

In titles, x and y are the offset from the chart position in units of 1/4000 of the position.

In axis titles, x means offset perpendicular to the axis, in units of 1/1000 of the plot-area bounding box, and y means offset parallel to the axis, in units of 1/1000 of the axis length.

In data labels for pie charts, x is the offset angle from the default, in degrees clockwise, while y is the radial offset, in units of 1/1000 of the pie radius.

In data labels for bar and column charts, x is the offset perpendicular to the bar or column, in units of 1/1000 of the plot area, while y is the offset parallel to the bar or column, in units of 1/1000 of the plot area.

For other charts, x is the horizontal offset from the default position, in units of 1/1000 of the plot area and y is vertical offset from the default position, in units of 1/1000 of the plot area.

Syntax

Namespace: FlexCel.Core

public TXlsChartLabelPosition PositionXls { get; set; }

See also

  • TDataLabel


TDataLabel.PositionZeroBased Property | FlexCel Studio for the .NET Framework documentation

TDataLabel.PositionZeroBased Property

Coordinates in percent of the chart area. Different from PositionXls this value has no margin attached. In old xls files, this value might not be set. If set, it should always be used instead of PositionXls. Note that for titles and axis titles the height and width is always automatic. For data labels in xlsx files, you can specify a size.

Syntax

Namespace: FlexCel.Core

public Nullable<TChartRelativeRectangle> PositionZeroBased { get; set; }

See also

  • TDataLabel


TDataLabel.TextOptions Property | FlexCel Studio for the .NET Framework documentation

TDataLabel.TextOptions Property

Formatting options for this label.

Syntax

Namespace: FlexCel.Core

public TChartTextOptions TextOptions { get; set; }

See also

  • TDataLabel


TDataLabel.LabelOptions Property | FlexCel Studio for the .NET Framework documentation

TDataLabel.LabelOptions Property

Data options for the label.

Syntax

Namespace: FlexCel.Core

public TDataLabelOptions LabelOptions { get; set; }

See also

  • TDataLabel


TDataLabel.Frame Property | FlexCel Studio for the .NET Framework documentation

TDataLabel.Frame Property

Background for the label, if there is one. Null otherwise.

Syntax

Namespace: FlexCel.Core

public TChartFrameOptions Frame { get; set; }

See also

  • TDataLabel


TDataLabel.LabelValues Property | FlexCel Studio for the .NET Framework documentation

TDataLabel.LabelValues Property

A list with the actual values for the label, evaluated from the formula at LabelDefinition IMPORTANT NOTE: The values here only are valid if LabelOptions indicates a manual DataType. The results can contain TDrawingRichStrings.

Syntax

Namespace: FlexCel.Core

public Object[] LabelValues { get; set; }

See also

  • TDataLabel


TDataLabel.LabelDefinition Property | FlexCel Studio for the .NET Framework documentation

TDataLabel.LabelDefinition Property

The formula defining the values on this label. You can access the actual values of the labels with LabelValues.

Syntax

Namespace: FlexCel.Core

public String LabelDefinition { get; set; }

See also

  • TDataLabel


TDataLabel.LinkedTo Property | FlexCel Studio for the .NET Framework documentation

TDataLabel.LinkedTo Property

Defines to which object this label is linked.

Syntax

Namespace: FlexCel.Core

public TLinkOption LinkedTo { get; set; }

See also

  • TDataLabel


TDataLabel.SeriesIndex Property | FlexCel Studio for the .NET Framework documentation

TDataLabel.SeriesIndex Property

Series number for the series this label displays. This value only has meaning if LinkedTo is TLinkOptions.DataLabel

Syntax

Namespace: FlexCel.Core

public Int32 SeriesIndex { get; set; }

See also

  • TDataLabel


TDataLabel.DataPointIndex Property | FlexCel Studio for the .NET Framework documentation

TDataLabel.DataPointIndex Property

Point index of the point this label displays. This value only has meaning if LinkedTo is TLinkOptions.DataLabel and the label is for only one point. When the label is for the whole series, DataPointIndex is -1.

Syntax

Namespace: FlexCel.Core

public Int32 DataPointIndex { get; set; }

See also

  • TDataLabel


TDataLabel.NumberFormat Property | FlexCel Studio for the .NET Framework documentation

TDataLabel.NumberFormat Property

Numeric format for this label.

Syntax

Namespace: FlexCel.Core

public String NumberFormat { get; set; }

See also

  • TDataLabel


TDataLabel.NumberFormatLinkedToSource Property | FlexCel Studio for the .NET Framework documentation

TDataLabel.NumberFormatLinkedToSource Property

True if the format for the numbers on this label is linked to the format in the cells in the spreadsheet.

Syntax

Namespace: FlexCel.Core

public Boolean NumberFormatLinkedToSource { get; set; }

See also

  • TDataLabel


TDataLabel.LeaderLines Property | FlexCel Studio for the .NET Framework documentation

TDataLabel.LeaderLines Property

True if there are lines from the slices to the labels. This value only has effect in the default label for the series, since you can't individually set leader lines.

Syntax

Namespace: FlexCel.Core

public Boolean LeaderLines { get; set; }

See also

  • TDataLabel


TDataLabel.LeaderLineStyle Property | FlexCel Studio for the .NET Framework documentation

TDataLabel.LeaderLineStyle Property

Line style for the leader lines, only has meaning if LeaderLines is true.

Syntax

Namespace: FlexCel.Core

public ChartLineOptions LeaderLineStyle { get; set; }

See also

  • TDataLabel


TDataLabel.EnclosingRect Property | FlexCel Studio for the .NET Framework documentation

TDataLabel.EnclosingRect Property

Calculated rectangle enclosing the label at zero rotation. The default value is empty unless you manually set it.

Syntax

Namespace: FlexCel.Core

public TUIRectangle EnclosingRect { get; set; }

See also

  • TDataLabel


TDataLabel.EnclosingRectRotation Property | FlexCel Studio for the .NET Framework documentation

TDataLabel.EnclosingRectRotation Property

The calculated angle in degrees to rotate EnclosingRect. The default value is empty unless you manually set it.

Syntax

Namespace: FlexCel.Core

public Double EnclosingRectRotation { get; set; }

See also

  • TDataLabel


TDataLabelOptions Class | FlexCel Studio for the .NET Framework documentation

TDataLabelOptions Class

Options for a data label.

Syntax

Namespace: FlexCel.Core

public class TDataLabelOptions: ICloneable

Methods

Name | Description
Clone | Returns a deep copy of the object.

Properties

Name | Description
AutoColor | True if this label will use automatic coloring, false if the color is user defined.
ShowLegendKey | If true, the legend key will be shown along with the label.
ShowDataLabelsRange | If true and this label DataType is SeriesInfo, this label will display the values specified in "Value from Cells" .
ShowSeriesName | If true and this label DataType is SeriesInfo, this label will display the Series name.
ShowCategories | If true and this label DataType is SeriesInfo, this label will display the Categories.
ShowValues | If true and this label DataType is SeriesInfo, this label will display the actual value of the data.
ShowPercents | If true and this label DataType is SeriesInfo, this label will display the percentage of the total data. This value only applies to PIE charts.
ShowBubbles | If true and this label DataType is SeriesInfo, this label will display the percentage bubble size. This value only applies to BUBBLE charts.
Separator | The separator that will be used to separate labels when they contain more than one value. (For example, if the labels contains both the value and the category, they will be separated by this string).
DataType | Defines which information this label displays.
Deleted | If true, this label has been manually deleted by the user and should not be displayed.
Position | Where the label is placed.
CanOverlapWithChart | If true, the label is not used when calculating the plot area dimensions.


TDataLabelOptions.Clone Method | FlexCel Studio for the .NET Framework documentation

TDataLabelOptions.Clone Method

Returns a deep copy of the object.

Syntax

Namespace: FlexCel.Core

public Object Clone()

See also

  • TDataLabelOptions


TDataLabelOptions.AutoColor Property | FlexCel Studio for the .NET Framework documentation

TDataLabelOptions.AutoColor Property

True if this label will use automatic coloring, false if the color is user defined.

Syntax

Namespace: FlexCel.Core

public Boolean AutoColor { get; set; }

See also

  • TDataLabelOptions


TDataLabelOptions.ShowLegendKey Property | FlexCel Studio for the .NET Framework documentation

TDataLabelOptions.ShowLegendKey Property

If true, the legend key will be shown along with the label.

Syntax

Namespace: FlexCel.Core

public Boolean ShowLegendKey { get; set; }

See also

  • TDataLabelOptions


TDataLabelOptions.ShowDataLabelsRange Property | FlexCel Studio for the .NET Framework documentation

TDataLabelOptions.ShowDataLabelsRange Property

If true and this label DataType is SeriesInfo, this label will display the values specified in "Value from Cells" .

Syntax

Namespace: FlexCel.Core

public Boolean ShowDataLabelsRange { get; set; }

See also

  • TDataLabelOptions


TDataLabelOptions.ShowSeriesName Property | FlexCel Studio for the .NET Framework documentation

TDataLabelOptions.ShowSeriesName Property

If true and this label DataType is SeriesInfo, this label will display the Series name.

Syntax

Namespace: FlexCel.Core

public Boolean ShowSeriesName { get; set; }

See also

  • TDataLabelOptions


TDataLabelOptions.ShowCategories Property | FlexCel Studio for the .NET Framework documentation

TDataLabelOptions.ShowCategories Property

If true and this label DataType is SeriesInfo, this label will display the Categories.

Syntax

Namespace: FlexCel.Core

public Boolean ShowCategories { get; set; }

See also

  • TDataLabelOptions


TDataLabelOptions.ShowValues Property | FlexCel Studio for the .NET Framework documentation

TDataLabelOptions.ShowValues Property

If true and this label DataType is SeriesInfo, this label will display the actual value of the data.

Syntax

Namespace: FlexCel.Core

public Boolean ShowValues { get; set; }

See also

  • TDataLabelOptions


TDataLabelOptions.ShowPercents Property | FlexCel Studio for the .NET Framework documentation

TDataLabelOptions.ShowPercents Property

If true and this label DataType is SeriesInfo, this label will display the percentage of the total data. This value only applies to PIE charts.

Syntax

Namespace: FlexCel.Core

public Boolean ShowPercents { get; set; }

See also

  • TDataLabelOptions


TDataLabelOptions.ShowBubbles Property | FlexCel Studio for the .NET Framework documentation

TDataLabelOptions.ShowBubbles Property

If true and this label DataType is SeriesInfo, this label will display the percentage bubble size. This value only applies to BUBBLE charts.

Syntax

Namespace: FlexCel.Core

public Boolean ShowBubbles { get; set; }

See also

  • TDataLabelOptions


TDataLabelOptions.Separator Property | FlexCel Studio for the .NET Framework documentation

TDataLabelOptions.Separator Property

The separator that will be used to separate labels when they contain more than one value. (For example, if the labels contains both the value and the category, they will be separated by this string).

Syntax

Namespace: FlexCel.Core

public String Separator { get; set; }

See also

  • TDataLabelOptions


TDataLabelOptions.DataType Property | FlexCel Studio for the .NET Framework documentation

TDataLabelOptions.DataType Property

Defines which information this label displays.

Syntax

Namespace: FlexCel.Core

public TLabelDataValue DataType { get; set; }

See also

  • TDataLabelOptions


TDataLabelOptions.Deleted Property | FlexCel Studio for the .NET Framework documentation

TDataLabelOptions.Deleted Property

If true, this label has been manually deleted by the user and should not be displayed.

Syntax

Namespace: FlexCel.Core

public Boolean Deleted { get; set; }

See also

  • TDataLabelOptions


TDataLabelOptions.Position Property | FlexCel Studio for the .NET Framework documentation

TDataLabelOptions.Position Property

Where the label is placed.

Syntax

Namespace: FlexCel.Core

public TDataLabelPosition Position { get; set; }

See also

  • TDataLabelOptions


TDataLabelOptions.CanOverlapWithChart Property | FlexCel Studio for the .NET Framework documentation

TDataLabelOptions.CanOverlapWithChart Property

If true, the label is not used when calculating the plot area dimensions.

Syntax

Namespace: FlexCel.Core

public Boolean CanOverlapWithChart { get; set; }

See also

  • TDataLabelOptions


TDataValidationInfo Class | FlexCel Studio for the .NET Framework documentation

TDataValidationInfo Class

Contains the information to define a data validation in a range of cells.

Syntax

Namespace: FlexCel.Core

public class TDataValidationInfo: IComparable

Constructors

Name | Description
TDataValidationInfo | Overloaded TDataValidationInfo TDataValidationInfo(TDataValidationDataType, TDataValidationConditionType, String, String, Boolean, Boolean, Boolean, Boolean, String, String, Boolean, String, String, TDataValidationIcon)

Methods

Name | Description
CompareTo | Compares the object with other.
Equals | Returns true if both objects are equal.
GetHashCode | Returns a hashcode for the object.

Operators

Name | Description
Equality | Returns true if both objects are equal. Note this is for backwards compatibility, this is a class and not immutable, so this method should return true if references are different. But that would break old code.
Inequality | Returns true if both objects are not equal. Note this is for backwards compatibility, this is a class and not immutable, so this method should return true if references are different. But that would break old code.
GreaterThan | Returns true if o1 is bigger than o2.
LessThan | Returns true if o1 is less than o2.

Properties

Name | Description
ValidationType | Type of validation we will be doing.
Condition | Condition used to apply the data validation.
FirstFormula | Formula for the first condition of the data validation. The text of the formula is limited to 255 characters. If ExplicitList is true, this formula can contain a list of values. Note that with relative references, we always consider "A1" to be the cell where the data validation is. This means that the formula: "=$A$1 + A1" when evaluated in Cell B8, will read "=$A$1 + B8". To provide a negative offset, you need to wrap the formula. For example "=A1048575" will evaluate to B7 when evaluated in B8.
SecondFormula | Formula for the second condition of the data validation, if it has two conditions. The text of the formula is limited to 255 characters. Note that with relative references, we always consider "A1" to be the cell where the data validation is. This means that the formula: "=$A$1 + A1" when evaluated in Cell B8, will read "=$A$1 + B8". To provide a negative offset, you need to wrap the formula. For example "=A1048575" will evaluate to B7 when evaluated in B8.
IgnoreEmptyCells | If true Empty cells will not trigger data validation errors.
InCellDropDown | When the ValidationType parameter is a list, this property indicates whether to display a drop down box or not.
ExplicitList | If true, FirstFormula contains a list of values. In this case, Formula1 must be a formula of the type: ="string", where string is a list of values separated by Character(0). For example, in C# Formula1 could be: ="​Apples\0Lemmons\0Melons In Delphi.NET, Formula1 could be: '="Apples' + #0 + 'Lemmons' + #0 + 'Melons'
ShowErrorBox | If true, an error box dialog will be shown when the user enters an invalid value.
ErrorBoxCaption | Caption of the Error Alert box. Note that this text cannot be longer than 32 characters. Extra characters will be truncated. If this parameter is null, the default Error alert will be displayed. If ShowErrorBox is false, this parameter does nothing.
ErrorBoxText | Text on the Error Alert box. Note that this text cannot be longer than 225 characters. Extra characters will be truncated. If this parameter is null, the default Error alert will be displayed. If ShowErrorBox is false, this parameter does nothing.
ShowInputBox | If true, a box showing a message will be shown when the user selecte the cell.
InputBoxCaption | Caption of the Input Message box. Note that this text cannot be longer than 32 characters. Extra characters will be truncated. If this parameter is null, the Input box will display the default message. if ShowInputBox is false, this parameter does nothing.
InputBoxText | Text on the Input Message box. Note that this text cannot be longer than 255 characters. Extra characters will be truncated. If this parameter is null, the Input box will display the default message. if ShowInputBox is false, this parameter does nothing.
ErrorIcon | Icon to display in the error box.
ImeMode | The IME (input method editor) mode enforced by this data validation.


TDataValidationInfo.TDataValidationInfo Constructor | FlexCel Studio for the .NET Framework documentation

TDataValidationInfo.TDataValidationInfo Constructor

Overloads

  • TDataValidationInfo.TDataValidationInfo
  • TDataValidationInfo.TDataValidationInfo(TDataValidationDataType, TDataValidationConditionType, String, String, Boolean, Boolean, Boolean, Boolean, String, String, Boolean, String, String, TDataValidationIcon)

TDataValidationInfo.TDataValidationInfo

Empty constructor. Creates a new instance of TDataValidationInfo without assigning any value.

Syntax

Namespace: FlexCel.Core

public TDataValidationInfo()

See also

  • TDataValidationInfo

TDataValidationInfo.TDataValidationInfo(TDataValidationDataType, TDataValidationConditionType, String, String, Boolean, Boolean, Boolean, Boolean, String, String, Boolean, String, String, TDataValidationIcon)

Creates a new Data Validation condition with all parameters.

Syntax

Namespace: FlexCel.Core

public TDataValidationInfo(TDataValidationDataType aValidationType, TDataValidationConditionType aCondition, String aFirstFormula, String aSecondFormula, Boolean aIgnoreEmptyCells, Boolean aInCellDropDown, Boolean aExplicitList, Boolean aShowErrorBox, String aErrorBoxCaption, String aErrorBoxText, Boolean aShowInputBox, String aInputBoxCaption, String aInputBoxText, TDataValidationIcon aErrorIcon)

Parameters

<-> | Parameter | Type | Description
 | aValidationType | TDataValidation​Data​Type | See ValidationType
 | aCondition | TDataValidation​Condition​Type | See Condition
 | aFirstFormula | String | See FirstFormula
 | aSecondFormula | String | See SecondFormula
 | aIgnoreEmptyCells | Boolean | See IgnoreEmptyCells
 | aInCellDropDown | Boolean | See InCellDropDown
 | aExplicitList | Boolean | See ExplicitList
 | aShowErrorBox | Boolean | See ShowErrorBox
 | aErrorBoxCaption | String | See ErrorBoxCaption
 | aErrorBoxText | String | See ErrorBoxText
 | aShowInputBox | Boolean | See ShowInputBox
 | aInputBoxCaption | String | See InputBoxCaption
 | aInputBoxText | String | See InputBoxText
 | aErrorIcon | TDataValidationIcon | See ErrorIcon

See also

  • TDataValidationInfo


TDataValidationInfo.CompareTo Method | FlexCel Studio for the .NET Framework documentation

TDataValidationInfo.CompareTo Method

Compares the object with other.

Syntax

Namespace: FlexCel.Core

public Int32 CompareTo(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

Returns

-1 is o2 is less than this, 0 if they are equal and 1 if o2 is bigger.

See also

  • TDataValidationInfo


TDataValidationInfo.Equals Method | FlexCel Studio for the .NET Framework documentation

TDataValidationInfo.Equals Method

Returns true if both objects are equal.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TDataValidationInfo


TDataValidationInfo.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TDataValidationInfo.GetHashCode Method

Returns a hashcode for the object.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TDataValidationInfo


TDataValidationInfo.Equality Operator | FlexCel Studio for the .NET Framework documentation

TDataValidationInfo.Equality Operator

Returns true if both objects are equal. Note this is for backwards compatibility, this is a class and not immutable, so this method should return true if references are different. But that would break old code.

Syntax

Namespace: FlexCel.Core

public static Boolean op_Equality(TDataValidationInfo o1, TDataValidationInfo o2)

Parameters

<-> | Parameter | Type | Description
 | o1 | TDataValidationInfo |
 | o2 | TDataValidationInfo |

See also

  • TDataValidationInfo


TDataValidationInfo.Inequality Operator | FlexCel Studio for the .NET Framework documentation

TDataValidationInfo.Inequality Operator

Returns true if both objects are not equal. Note this is for backwards compatibility, this is a class and not immutable, so this method should return true if references are different. But that would break old code.

Syntax

Namespace: FlexCel.Core

public static Boolean op_Inequality(TDataValidationInfo o1, TDataValidationInfo o2)

Parameters

<-> | Parameter | Type | Description
 | o1 | TDataValidationInfo |
 | o2 | TDataValidationInfo |

See also

  • TDataValidationInfo


TDataValidationInfo.GreaterThan Operator | FlexCel Studio for the .NET Framework documentation

TDataValidationInfo.GreaterThan Operator

Returns true if o1 is bigger than o2.

Syntax

Namespace: FlexCel.Core

public static Boolean op_GreaterThan(TDataValidationInfo o1, TDataValidationInfo o2)

Parameters

<-> | Parameter | Type | Description
 | o1 | TDataValidationInfo |
 | o2 | TDataValidationInfo |

See also

  • TDataValidationInfo


TDataValidationInfo.LessThan Operator | FlexCel Studio for the .NET Framework documentation

TDataValidationInfo.LessThan Operator

Returns true if o1 is less than o2.

Syntax

Namespace: FlexCel.Core

public static Boolean op_LessThan(TDataValidationInfo o1, TDataValidationInfo o2)

Parameters

<-> | Parameter | Type | Description
 | o1 | TDataValidationInfo |
 | o2 | TDataValidationInfo |

See also

  • TDataValidationInfo


TDataValidationInfo.ValidationType Property | FlexCel Studio for the .NET Framework documentation

TDataValidationInfo.ValidationType Property

Type of validation we will be doing.

Syntax

Namespace: FlexCel.Core

public TDataValidationDataType ValidationType { get; set; }

See also

  • TDataValidationInfo


TDataValidationInfo.Condition Property | FlexCel Studio for the .NET Framework documentation

TDataValidationInfo.Condition Property

Condition used to apply the data validation.

Syntax

Namespace: FlexCel.Core

public TDataValidationConditionType Condition { get; set; }

See also

  • TDataValidationInfo


TDataValidationInfo.FirstFormula Property | FlexCel Studio for the .NET Framework documentation

TDataValidationInfo.FirstFormula Property

Formula for the first condition of the data validation. The text of the formula is limited to 255 characters. If ExplicitList is true, this formula can contain a list of values.

Note that with relative references, we always consider "A1" to be the cell where the data validation is. This means that the formula: "=$A$1 + A1" when evaluated in Cell B8, will read "=$A$1 + B8". To provide a negative offset, you need to wrap the formula. For example "=A1048575" will evaluate to B7 when evaluated in B8.

Remarks

If this formula refers to a cell range, you can get the cell range by calling ExcelFile.RecalcRange.

To get the text for a particular cell, use ExcelFile.OffsetRelativeFormula.

To get the result of evaluating the formula, use ExcelFile.RecalcRelativeFormula

Syntax

Namespace: FlexCel.Core

public String FirstFormula { get; set; }

See also

  • TDataValidationInfo


TDataValidationInfo.SecondFormula Property | FlexCel Studio for the .NET Framework documentation

TDataValidationInfo.SecondFormula Property

Formula for the second condition of the data validation, if it has two conditions. The text of the formula is limited to 255 characters.

Note that with relative references, we always consider "A1" to be the cell where the data validation is. This means that the formula: "=$A$1 + A1" when evaluated in Cell B8, will read "=$A$1 + B8". To provide a negative offset, you need to wrap the formula. For example "=A1048575" will evaluate to B7 when evaluated in B8.

Remarks

If this formula refers to a cell range, you can get the cell range by calling ExcelFile.RecalcRange.

To get the text for a particular cell, use ExcelFile.OffsetRelativeFormula.

To get the result of evaluating the formula, use ExcelFile.RecalcRelativeFormula.

Syntax

Namespace: FlexCel.Core

public String SecondFormula { get; set; }

See also

  • TDataValidationInfo


TDataValidationInfo.IgnoreEmptyCells Property | FlexCel Studio for the .NET Framework documentation

TDataValidationInfo.IgnoreEmptyCells Property

If true Empty cells will not trigger data validation errors.

Syntax

Namespace: FlexCel.Core

public Boolean IgnoreEmptyCells { get; set; }

See also

  • TDataValidationInfo


TDataValidationInfo.InCellDropDown Property | FlexCel Studio for the .NET Framework documentation

TDataValidationInfo.InCellDropDown Property

When the ValidationType parameter is a list, this property indicates whether to display a drop down box or not.

Syntax

Namespace: FlexCel.Core

public Boolean InCellDropDown { get; set; }

See also

  • TDataValidationInfo


TDataValidationInfo.ExplicitList Property | FlexCel Studio for the .NET Framework documentation

TDataValidationInfo.ExplicitList Property

If true, FirstFormula contains a list of values. In this case, Formula1 must be a formula of the type: ="string", where string is a list of values separated by Character(0). For example, in C# Formula1 could be: ="Apples\0Lemmons\0Melons In Delphi.NET, Formula1 could be: '="Apples' + #0 + 'Lemmons' + #0 + 'Melons'

Syntax

Namespace: FlexCel.Core

public Boolean ExplicitList { get; set; }

See also

  • TDataValidationInfo


TDataValidationInfo.ShowErrorBox Property | FlexCel Studio for the .NET Framework documentation

TDataValidationInfo.ShowErrorBox Property

If true, an error box dialog will be shown when the user enters an invalid value.

Syntax

Namespace: FlexCel.Core

public Boolean ShowErrorBox { get; set; }

See also

  • TDataValidationInfo


TDataValidationInfo.ErrorBoxCaption Property | FlexCel Studio for the .NET Framework documentation

TDataValidationInfo.ErrorBoxCaption Property

Caption of the Error Alert box. Note that this text cannot be longer than 32 characters. Extra characters will be truncated. If this parameter is null, the default Error alert will be displayed. If ShowErrorBox is false, this parameter does nothing.

Syntax

Namespace: FlexCel.Core

public String ErrorBoxCaption { get; set; }

See also

  • TDataValidationInfo


TDataValidationInfo.ErrorBoxText Property | FlexCel Studio for the .NET Framework documentation

TDataValidationInfo.ErrorBoxText Property

Text on the Error Alert box. Note that this text cannot be longer than 225 characters. Extra characters will be truncated. If this parameter is null, the default Error alert will be displayed. If ShowErrorBox is false, this parameter does nothing.

Syntax

Namespace: FlexCel.Core

public String ErrorBoxText { get; set; }

See also

  • TDataValidationInfo


TDataValidationInfo.ShowInputBox Property | FlexCel Studio for the .NET Framework documentation

TDataValidationInfo.ShowInputBox Property

If true, a box showing a message will be shown when the user selecte the cell.

Syntax

Namespace: FlexCel.Core

public Boolean ShowInputBox { get; set; }

See also

  • TDataValidationInfo


TDataValidationInfo.InputBoxCaption Property | FlexCel Studio for the .NET Framework documentation

TDataValidationInfo.InputBoxCaption Property

Caption of the Input Message box. Note that this text cannot be longer than 32 characters. Extra characters will be truncated. If this parameter is null, the Input box will display the default message. if ShowInputBox is false, this parameter does nothing.

Syntax

Namespace: FlexCel.Core

public String InputBoxCaption { get; set; }

See also

  • TDataValidationInfo


TDataValidationInfo.InputBoxText Property | FlexCel Studio for the .NET Framework documentation

TDataValidationInfo.InputBoxText Property

Text on the Input Message box. Note that this text cannot be longer than 255 characters. Extra characters will be truncated. If this parameter is null, the Input box will display the default message. if ShowInputBox is false, this parameter does nothing.

Syntax

Namespace: FlexCel.Core

public String InputBoxText { get; set; }

See also

  • TDataValidationInfo


TDataValidationInfo.ErrorIcon Property | FlexCel Studio for the .NET Framework documentation

TDataValidationInfo.ErrorIcon Property

Icon to display in the error box.

Syntax

Namespace: FlexCel.Core

public TDataValidationIcon ErrorIcon { get; set; }

See also

  • TDataValidationInfo


TDataValidationInfo.ImeMode Property | FlexCel Studio for the .NET Framework documentation

TDataValidationInfo.ImeMode Property

The IME (input method editor) mode enforced by this data validation.

Syntax

Namespace: FlexCel.Core

public TDataValidationImeMode ImeMode { get; set; }

See also

  • TDataValidationInfo


TDefaultShapeOptions Class | FlexCel Studio for the .NET Framework documentation

TDefaultShapeOptions Class

Helper class to know which shape options default to true when not specified.

Syntax

Namespace: FlexCel.Core

public static class TDefaultShapeOptions

Methods

Name | Description
DefaultsToTrue | Returns true if the shape option has a true value when not specified.


TDefaultShapeOptions.DefaultsToTrue Method | FlexCel Studio for the .NET Framework documentation

TDefaultShapeOptions.DefaultsToTrue Method

Returns true if the shape option has a true value when not specified.

Syntax

Namespace: FlexCel.Core

public static Boolean DefaultsToTrue(TShapeOption so)

Parameters

<-> | Parameter | Type | Description
 | so | TShapeOption | Shape option to test.

See also

  • TDefaultShapeOptions


TDocumentProperties Class | FlexCel Studio for the .NET Framework documentation

TDocumentProperties Class

Properties for an Excel sheet.

Syntax

Namespace: FlexCel.Core

public sealed class TDocumentProperties

Methods

Name | Description
GetStandardProperty | Returns a standard document property (Like Author, Title, etc.). This method returns an object that might be:...[more]
GetUsedStandard​Properties | Returns a list of all the standard properties that are set.
SetStandardProperty | This method only works in xlsx files. It will set the standard property with the given Id to the specified value. Set the value to null or empty to clear the property.
GetCustomProperty | Returns a custom property with a given name.
SetCustomProperty | This method only works in xlsx files. Sets a custom property with a given name. Set the value to null or empty string to remove the property.
GetAllCustom​Properties | Returns a list of all the names of custom properties in the file.
RemoveAllProperties | This method will remove all document properties of the file. You can use it to be sure you aren't embedding any confidential information on the properties.

Properties

Name | Description
PreserveCreationDate | By default FlexCel will set the creation date in the file to be the date when you actually created it, no matter the value originally stored in the file. This assumes you are starting from a template and generating a new document from it. But if you are modifying an existing file and want to preserve the original creation date, then you need to set this property to true. Note that this property sets itself automatically to true if you manually set the creation time of a file.
PreserveModifiedDate | By default FlexCel will set the modified date in the file to be the date when you actually saved it, no matter the value originally stored in the file. But if you need to set a different modified date than the date in the server, or you don't want a new modified date to be saved and preserve the one in the document, then you need to set this property to true. If you are setting this property to true, you probably also want to set PreserveCreationDate to true. Note that this property sets itself automatically to true if you manually set the modified time of a file. ...[more]


TDocumentProperties.GetStandardProperty Method | FlexCel Studio for the .NET Framework documentation

TDocumentProperties.GetStandardProperty Method

Returns a standard document property (Like Author, Title, etc.). This method returns an object that might be:

  • null: If the property is not assigned.
  • Int16, Int32, Int64, Single, Double, Decimal: If the property is a number.
  • DateTime: If the property is a Date or a DateTime.
  • String: If the property is a string.
  • Boolean: If the property is a boolean.
  • An array of byte (byte[]): If the property is a Blob.
  • An array of object (object[]): If the property is an array. Each one of the members of the array must be of one of the types specified here.

Syntax

Namespace: FlexCel.Core

public Object GetStandardProperty(TPropertyId PropertyId)

Parameters

<-> | Parameter | Type | Description
 | PropertyId | TPropertyId |

See also

  • TDocumentProperties


TDocumentProperties.GetUsedStandardProperties Method | FlexCel Studio for the .NET Framework documentation

TDocumentProperties.GetUsedStandardProperties Method

Returns a list of all the standard properties that are set.

Syntax

Namespace: FlexCel.Core

public TPropertyId[] GetUsedStandardProperties(Boolean returnOnlySeteable)

Parameters

<-> | Parameter | Type | Description
 | returnOnlySeteable | Boolean | If true, only the properties that you can set will be returned.

See also

  • TDocumentProperties


TDocumentProperties.SetStandardProperty Method | FlexCel Studio for the .NET Framework documentation

TDocumentProperties.SetStandardProperty Method

This method only works in xlsx files. It will set the standard property with the given Id to the specified value. Set the value to null or empty to clear the property.

Syntax

Namespace: FlexCel.Core

public void SetStandardProperty(TPropertyId PropertyId, String value)

Parameters

<-> | Parameter | Type | Description
 | PropertyId | TPropertyId | Property id that we want to modify.
 | value | String | Set it to null or empty to clear the property.

See also

  • TDocumentProperties


TDocumentProperties.GetCustomProperty Method | FlexCel Studio for the .NET Framework documentation

TDocumentProperties.GetCustomProperty Method

Returns a custom property with a given name.

Syntax

Namespace: FlexCel.Core

public TDocumentCustomProperty GetCustomProperty(String name)

Parameters

<-> | Parameter | Type | Description
 | name | String |

See also

  • TDocumentProperties


TDocumentProperties.SetCustomProperty Method | FlexCel Studio for the .NET Framework documentation

TDocumentProperties.SetCustomProperty Method

This method only works in xlsx files. Sets a custom property with a given name. Set the value to null or empty string to remove the property.

Syntax

Namespace: FlexCel.Core

public void SetCustomProperty(String name, TDocumentCustomPropertyType proptype, String value, Int32 propertyId)

Parameters

<-> | Parameter | Type | Description
 | name | String | Name of the custom property you want to create or modify.
 | proptype | TDocumentCustom​Property​Type | Type of the property (boolean, string, etc.)
 | value | String | Value for the property. Note that while it is a string, it must be convertible to the type you are specifying. Doubles should use "." as decimal separators.
 | propertyId | Int32 | Numeric Id for the property. This value must be unique and bigger or equal to 2.

See also

  • TDocumentProperties


TDocumentProperties.GetAllCustomProperties Method | FlexCel Studio for the .NET Framework documentation

TDocumentProperties.GetAllCustomProperties Method

Returns a list of all the names of custom properties in the file.

Syntax

Namespace: FlexCel.Core

public String[] GetAllCustomProperties()

See also

  • TDocumentProperties


TDocumentProperties.RemoveAllProperties Method | FlexCel Studio for the .NET Framework documentation

TDocumentProperties.RemoveAllProperties Method

This method will remove all document properties of the file. You can use it to be sure you aren't embedding any confidential information on the properties.

Syntax

Namespace: FlexCel.Core

public void RemoveAllProperties()

See also

  • TDocumentProperties


TDocumentProperties.PreserveCreationDate Property | FlexCel Studio for the .NET Framework documentation

TDocumentProperties.PreserveCreationDate Property

By default FlexCel will set the creation date in the file to be the date when you actually created it, no matter the value originally stored in the file. This assumes you are starting from a template and generating a new document from it. But if you are modifying an existing file and want to preserve the original creation date, then you need to set this property to true. **Note that this property sets itself automatically to true if you manually set the creation time of a file. **

Syntax

Namespace: FlexCel.Core

public Boolean PreserveCreationDate { get; set; }

See also

  • TDocumentProperties


TDocumentProperties.PreserveModifiedDate Property | FlexCel Studio for the .NET Framework documentation

TDocumentProperties.PreserveModifiedDate Property

By default FlexCel will set the modified date in the file to be the date when you actually saved it, no matter the value originally stored in the file. But if you need to set a different modified date than the date in the server, or you don't want a new modified date to be saved and preserve the one in the document, then you need to set this property to true. If you are setting this property to true, you probably also want to set PreserveCreationDate to true. **Note that this property sets itself automatically to true if you manually set the modified time of a file. **

Syntax

Namespace: FlexCel.Core

public Boolean PreserveModifiedDate { get; set; }

See also

  • TDocumentProperties


TDrawingConditionalFormat Class | FlexCel Studio for the .NET Framework documentation

TDrawingConditionalFormat Class

This class contains the data needed to draw a "complex" conditional format like a databar or iconset. It is used for exporting xls/x files to drawings or pdf.

Syntax

Namespace: FlexCel.Core

public class TDrawingConditionalFormat

Fields

Name | Description
DataBar | Data needed to draw a data bar in the screen.
IconSet | Data needed to draw an icon set in the screen.

Constructors

Name | Description
TDrawingConditional​Format | Crates a new object.


TDrawingConditionalFormat.DataBar Field | FlexCel Studio for the .NET Framework documentation

TDrawingConditionalFormat.DataBar Field

Data needed to draw a data bar in the screen.

Syntax

Namespace: FlexCel.Core

public TDrawingConditionalFormatDataBar DataBar

See also

  • TDrawingConditionalFormat


TDrawingConditionalFormat.IconSet Field | FlexCel Studio for the .NET Framework documentation

TDrawingConditionalFormat.IconSet Field

Data needed to draw an icon set in the screen.

Syntax

Namespace: FlexCel.Core

public TDrawingConditionalFormatIconSet IconSet

See also

  • TDrawingConditionalFormat


TDrawingConditionalFormat.TDrawingConditionalFormat Constructor | FlexCel Studio for the .NET Framework documentation

TDrawingConditionalFormat.TDrawingConditionalFormat Constructor

Crates a new object.

Syntax

Namespace: FlexCel.Core

public TDrawingConditionalFormat(TDrawingConditionalFormatDataBar aDataBar, TDrawingConditionalFormatIconSet aIconSet)

Parameters

<-> | Parameter | Type | Description
 | aDataBar | TDrawingConditional​Format​DataBar |
 | aIconSet | TDrawingConditional​Format​IconSet |

See also

  • TDrawingConditionalFormat


TDrawingEffect Class | FlexCel Studio for the .NET Framework documentation

TDrawingEffect Class

Base class for all drawing effects, like TBlurEffect or TGlowEffect

Syntax

Namespace: FlexCel.Core

public class TDrawingEffect


TDrawingGradientDef Class | FlexCel Studio for the .NET Framework documentation

TDrawingGradientDef Class

A base class for storing gradient definitions, be them Linear or Path gradients.

Syntax

Namespace: FlexCel.Core

public abstract class TDrawingGradientDef

Methods

Name | Description
Clone | Returns a deep copy of this object.
CompareTo | Returns if an objects is bigger than the other.


TDrawingGradientDef.Clone Method | FlexCel Studio for the .NET Framework documentation

TDrawingGradientDef.Clone Method

Returns a deep copy of this object.

Syntax

Namespace: FlexCel.Core

public virtual TDrawingGradientDef Clone()

See also

  • TDrawingGradientDef


TDrawingGradientDef.CompareTo Method | FlexCel Studio for the .NET Framework documentation

TDrawingGradientDef.CompareTo Method

Returns if an objects is bigger than the other.

Syntax

Namespace: FlexCel.Core

public virtual Int32 CompareTo(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TDrawingGradientDef


TDrawingHyperlink Class | FlexCel Studio for the .NET Framework documentation

TDrawingHyperlink Class

Specifies an hyperlink in a drawing. While this class is similar to THyperlink for links in cells, it has some differences.

Syntax

Namespace: FlexCel.Core

public sealed class TDrawingHyperlink: IComparable

Constructors

Name | Description
TDrawingHyperlink | Overloaded TDrawingHyperlink TDrawingHyperlink(String, String, String, String, Boolean, Boolean, Boolean) TDrawingHyperlink(String, String, String, String, String, Boolean, Boolean, Boolean)

Methods

Name | Description
CompareTo | Returns -1, 0 or 1 depending if this object is smaller or bigger than the other.
GetHashCode | Returns the hashcode of the object.
Equals | Returns true if both instances have the same data.
CloneLink | Returns a deep clone of source.
GetLinkType | Returns the type of hyperlink.

Operators

Name | Description
Equality | Returns true if both objects are equal.
Inequality | Returns true if both objects do not have the same value.
Implicit Conversion | Overloaded Implicit conversion from TDrawingHyperlink to THyperLink Implicit conversion from THyperLink to TDrawingHyperlink

Properties

Name | Description
Url | Url for the link (including the prefix like "file:///"). Note that if the file has a BaseUrl, the final URL is given by FullUrl
BaseUrl | Base URL that will be added to the start of Url if it is set in the file. The property FullUrl contains the combined URL.
FullUrl | Returns BaseUrl combined with Url when Url is not an absolute Uri.
TargetFrame | If blank then a new window will be used.
Hint | Tooltip to show when the user hovers over the hyperlink.
Action | Specifies an action that is to be taken when this hyperlink is activated. This can be used to specify a slide to be navigated to or a script of code to be run. Doesn't seem to be used in Excel.
HighlightClick | When set to true, the link will be painted in a "Visited" color.
AddToHistory | If true, the link will be added to the history.
EndsSounds | If true, any sound currently playing will be stopped when you click the link.


TDrawingHyperlink.TDrawingHyperlink Constructor | FlexCel Studio for the .NET Framework documentation

TDrawingHyperlink.TDrawingHyperlink Constructor

Overloads

  • TDrawingHyperlink.TDrawingHyperlink
  • TDrawingHyperlink.TDrawingHyperlink(String, String, String, String, Boolean, Boolean, Boolean)
  • TDrawingHyperlink.TDrawingHyperlink(String, String, String, String, String, Boolean, Boolean, Boolean)

TDrawingHyperlink.TDrawingHyperlink

Creates a new hyperlink for a drawing.

Syntax

Namespace: FlexCel.Core

public TDrawingHyperlink()

See also

  • TDrawingHyperlink

TDrawingHyperlink.TDrawingHyperlink(String, String, String, String, Boolean, Boolean, Boolean)

Creates a new hyperlink for a drawing.

Syntax

Namespace: FlexCel.Core

public TDrawingHyperlink(String aUrl, String aTargetFrame, String aHint, String aAction, Boolean aHighlightClick, Boolean aAddToHistory, Boolean aEndsSounds)

Parameters

<-> | Parameter | Type | Description
 | aUrl | String | Url for the link (including the prefix like "file:///")
 | aTargetFrame | String | If blank then a new window will be used.
 | aHint | String | Tooltip to show when the user hovers over the hyperlink.
 | aAction | String | Specifies an action that is to be taken when this hyperlink is activated. This can be used to specify a slide to be navigated to or a script of code to be run. Doesn't seem to be used in Excel.
 | aHighlightClick | Boolean | When set to true, the link will be painted in a "Visited" color.
 | aAddToHistory | Boolean | If true, the link will be added to the history.
 | aEndsSounds | Boolean | If true, any sound currently playing will be stopped when you click the link.

See also

  • TDrawingHyperlink

TDrawingHyperlink.TDrawingHyperlink(String, String, String, String, String, Boolean, Boolean, Boolean)

Creates a new hyperlink for a drawing.

Syntax

Namespace: FlexCel.Core

public TDrawingHyperlink(String aUrl, String aBaseUrl, String aTargetFrame, String aHint, String aAction, Boolean aHighlightClick, Boolean aAddToHistory, Boolean aEndsSounds)

Parameters

<-> | Parameter | Type | Description
 | aUrl | String | Url for the link (including the prefix like "file:///")
 | aBaseUrl | String | Base Url for the link which will be combined with aUrl.
 | aTargetFrame | String | If blank then a new window will be used.
 | aHint | String | Tooltip to show when the user hovers over the hyperlink.
 | aAction | String | Specifies an action that is to be taken when this hyperlink is activated. This can be used to specify a slide to be navigated to or a script of code to be run. Doesn't seem to be used in Excel.
 | aHighlightClick | Boolean | When set to true, the link will be painted in a "Visited" color.
 | aAddToHistory | Boolean | If true, the link will be added to the history.
 | aEndsSounds | Boolean | If true, any sound currently playing will be stopped when you click the link.

See also

  • TDrawingHyperlink


TDrawingHyperlink.CompareTo Method | FlexCel Studio for the .NET Framework documentation

TDrawingHyperlink.CompareTo Method

Returns -1, 0 or 1 depending if this object is smaller or bigger than the other.

Syntax

Namespace: FlexCel.Core

public Int32 CompareTo(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TDrawingHyperlink


TDrawingHyperlink.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TDrawingHyperlink.GetHashCode Method

Returns the hashcode of the object.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TDrawingHyperlink


TDrawingHyperlink.Equals Method | FlexCel Studio for the .NET Framework documentation

TDrawingHyperlink.Equals Method

Returns true if both instances have the same data.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object | Object to compare.

Returns

True if both strings are the same.

See also

  • TDrawingHyperlink


TDrawingHyperlink.CloneLink Method | FlexCel Studio for the .NET Framework documentation

TDrawingHyperlink.CloneLink Method

Returns a deep clone of source.

Syntax

Namespace: FlexCel.Core

public static TDrawingHyperlink CloneLink(TDrawingHyperlink source)

Parameters

<-> | Parameter | Type | Description
 | source | TDrawingHyperlink | Object to be cloned.

See also

  • TDrawingHyperlink


TDrawingHyperlink.GetLinkType Method | FlexCel Studio for the .NET Framework documentation

TDrawingHyperlink.GetLinkType Method

Returns the type of hyperlink.

Syntax

Namespace: FlexCel.Core

public THyperLinkType GetLinkType()

See also

  • TDrawingHyperlink


TDrawingHyperlink.Equality Operator | FlexCel Studio for the .NET Framework documentation

TDrawingHyperlink.Equality Operator

Returns true if both objects are equal.

Syntax

Namespace: FlexCel.Core

public static Boolean op_Equality(TDrawingHyperlink o1, TDrawingHyperlink o2)

Parameters

<-> | Parameter | Type | Description
 | o1 | TDrawingHyperlink | First object to compare.
 | o2 | TDrawingHyperlink | Second object to compare.

See also

  • TDrawingHyperlink


TDrawingHyperlink.Inequality Operator | FlexCel Studio for the .NET Framework documentation

TDrawingHyperlink.Inequality Operator

Returns true if both objects do not have the same value.

Syntax

Namespace: FlexCel.Core

public static Boolean op_Inequality(TDrawingHyperlink o1, TDrawingHyperlink o2)

Parameters

<-> | Parameter | Type | Description
 | o1 | TDrawingHyperlink | First objects to compare.
 | o2 | TDrawingHyperlink | Second objects to compare.

See also

  • TDrawingHyperlink


TDrawingHyperlink Implicit Conversion Operator | FlexCel Studio for the .NET Framework documentation

TDrawingHyperlink Implicit Conversion Operator

Overloads

  • Implicit conversion from TDrawingHyperlink to THyperLink
  • Implicit conversion from THyperLink to TDrawingHyperlink

Implicit conversion from TDrawingHyperlink to THyperLink

Converts automatically a TDrawingHyperlink into a THyperlink.

Syntax

Namespace: FlexCel.Core

public static THyperLink op_Implicit(TDrawingHyperlink link)

Parameters

<-> | Parameter | Type | Description
 | link | TDrawingHyperlink |

See also

  • TDrawingHyperlink

Implicit conversion from THyperLink to TDrawingHyperlink

Converts automatically a THyperlink into a TDrawingHyperlink.

Syntax

Namespace: FlexCel.Core

public static TDrawingHyperlink op_Implicit(THyperLink link)

Parameters

<-> | Parameter | Type | Description
 | link | THyperLink |

See also

  • TDrawingHyperlink


TDrawingHyperlink.Url Property | FlexCel Studio for the .NET Framework documentation

TDrawingHyperlink.Url Property

Url for the link (including the prefix like "file:///"). Note that if the file has a BaseUrl, the final URL is given by FullUrl

Syntax

Namespace: FlexCel.Core

public String Url { get; set; }

See also

  • TDrawingHyperlink


TDrawingHyperlink.BaseUrl Property | FlexCel Studio for the .NET Framework documentation

TDrawingHyperlink.BaseUrl Property

Base URL that will be added to the start of Url if it is set in the file. The property FullUrl contains the combined URL.

Syntax

Namespace: FlexCel.Core

public String BaseUrl { get; set; }

See also

  • TDrawingHyperlink


TDrawingHyperlink.FullUrl Property | FlexCel Studio for the .NET Framework documentation

TDrawingHyperlink.FullUrl Property

Returns BaseUrl combined with Url when Url is not an absolute Uri.

Syntax

Namespace: FlexCel.Core

public String FullUrl { get; }

See also

  • TDrawingHyperlink


TDrawingHyperlink.TargetFrame Property | FlexCel Studio for the .NET Framework documentation

TDrawingHyperlink.TargetFrame Property

If blank then a new window will be used.

Syntax

Namespace: FlexCel.Core

public String TargetFrame { get; set; }

See also

  • TDrawingHyperlink


TDrawingHyperlink.Hint Property | FlexCel Studio for the .NET Framework documentation

TDrawingHyperlink.Hint Property

Tooltip to show when the user hovers over the hyperlink.

Syntax

Namespace: FlexCel.Core

public String Hint { get; set; }

See also

  • TDrawingHyperlink


TDrawingHyperlink.Action Property | FlexCel Studio for the .NET Framework documentation

TDrawingHyperlink.Action Property

Specifies an action that is to be taken when this hyperlink is activated. This can be used to specify a slide to be navigated to or a script of code to be run. Doesn't seem to be used in Excel.

Syntax

Namespace: FlexCel.Core

public String Action { get; set; }

See also

  • TDrawingHyperlink


TDrawingHyperlink.HighlightClick Property | FlexCel Studio for the .NET Framework documentation

TDrawingHyperlink.HighlightClick Property

When set to true, the link will be painted in a "Visited" color.

Syntax

Namespace: FlexCel.Core

public Boolean HighlightClick { get; set; }

See also

  • TDrawingHyperlink


TDrawingHyperlink.AddToHistory Property | FlexCel Studio for the .NET Framework documentation

TDrawingHyperlink.AddToHistory Property

If true, the link will be added to the history.

Syntax

Namespace: FlexCel.Core

public Boolean AddToHistory { get; set; }

See also

  • TDrawingHyperlink


TDrawingHyperlink.EndsSounds Property | FlexCel Studio for the .NET Framework documentation

TDrawingHyperlink.EndsSounds Property

If true, any sound currently playing will be stopped when you click the link.

Syntax

Namespace: FlexCel.Core

public Boolean EndsSounds { get; set; }

See also

  • TDrawingHyperlink


TDrawingLinearGradient Class | FlexCel Studio for the .NET Framework documentation

TDrawingLinearGradient Class

This class holds a linear gradient definition.

Syntax

Namespace: FlexCel.Core

public class TDrawingLinearGradient: TDrawingGradientDef

Constructors

Name | Description
TDrawingLinear​Gradient | Creates a new Linear gradient definition.

Methods

Name | Description
Equals | Returns true if this instance has the same data as the object obj.
CompareTo | Returns -1 if obj is bigger than this, 0 if both objects are the same, and 1 if obj is smaller than this.
GetHashCode | Returns the hashcode for this object

Properties

Name | Description
Angle | Specifies the direction of color change for the gradient. To define this angle, let its value be x measured clockwise. Then ( -sin x, cos x ) is a vector parallel to the line of constant color in the gradient fill.
Scaled | Whether the gradient angle scales with the fill region. Mathematically, if this flag is true, then the gradient vector ( cos x , sin x ) is scaled by the width (w) and height (h) of the fill region, so that the vector becomes ( w cos x, h sin x ) (before normalization).


TDrawingLinearGradient.TDrawingLinearGradient Constructor | FlexCel Studio for the .NET Framework documentation

TDrawingLinearGradient.TDrawingLinearGradient Constructor

Creates a new Linear gradient definition.

Syntax

Namespace: FlexCel.Core

public TDrawingLinearGradient(Double aAngle, Boolean aScaled)

Parameters

<-> | Parameter | Type | Description
 | aAngle | Double |
 | aScaled | Boolean |

See also

  • TDrawingLinearGradient


TDrawingLinearGradient.Equals Method | FlexCel Studio for the .NET Framework documentation

TDrawingLinearGradient.Equals Method

Returns true if this instance has the same data as the object obj.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TDrawingLinearGradient


TDrawingLinearGradient.CompareTo Method | FlexCel Studio for the .NET Framework documentation

TDrawingLinearGradient.CompareTo Method

Returns -1 if obj is bigger than this, 0 if both objects are the same, and 1 if obj is smaller than this.

Syntax

Namespace: FlexCel.Core

public override Int32 CompareTo(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TDrawingLinearGradient


TDrawingLinearGradient.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TDrawingLinearGradient.GetHashCode Method

Returns the hashcode for this object

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TDrawingLinearGradient


TDrawingLinearGradient.Angle Property | FlexCel Studio for the .NET Framework documentation

TDrawingLinearGradient.Angle Property

Specifies the direction of color change for the gradient. To define this angle, let its value be x measured clockwise. Then ( -sin x, cos x ) is a vector parallel to the line of constant color in the gradient fill.

Syntax

Namespace: FlexCel.Core

public Double Angle { get; }

See also

  • TDrawingLinearGradient


TDrawingLinearGradient.Scaled Property | FlexCel Studio for the .NET Framework documentation

TDrawingLinearGradient.Scaled Property

Whether the gradient angle scales with the fill region. Mathematically, if this flag is true, then the gradient vector ( cos x , sin x ) is scaled by the width (w) and height (h) of the fill region, so that the vector becomes ( w cos x, h sin x ) (before normalization).

Syntax

Namespace: FlexCel.Core

public Boolean Scaled { get; }

See also

  • TDrawingLinearGradient


TDrawingPathGradient Class | FlexCel Studio for the .NET Framework documentation

TDrawingPathGradient Class

Holds a Path gradient definition.

Syntax

Namespace: FlexCel.Core

public class TDrawingPathGradient: TDrawingGradientDef

Constructors

Name | Description
TDrawingPathGradient | Creates a new TDrawingPath object.

Methods

Name | Description
Equals | Returns true if this instance has the same data as the object obj.
CompareTo | Returns -1 if obj is bigger than this, 0 if both objects are the same, and 1 if obj is smaller than this.
GetHashCode | Returns the hashcode for this object

Properties

Name | Description
FillToRect | This element defines the "focus" rectangle for the center shade, specified relative to the fill tile rectangle. The center shade fills the entire tile except the margins specified by each attribute. Each edge of the center shade rectangle is defined by a percentage offset from the corresponding edge of the tile rectangle. A positive percentage specifies an inset, while a negative percentage specifies an outset.
Path | Specifies the shape of the path to follow.


TDrawingPathGradient.TDrawingPathGradient Constructor | FlexCel Studio for the .NET Framework documentation

TDrawingPathGradient.TDrawingPathGradient Constructor

Creates a new TDrawingPath object.

Syntax

Namespace: FlexCel.Core

public TDrawingPathGradient(Nullable<TDrawingRelativeRect> aFillToRect, TPathShadeType aPath)

Parameters

<-> | Parameter | Type | Description
 | aFillToRect | Nullable<TDrawingRelativeRect> |
 | aPath | TPathShadeType |

See also

  • TDrawingPathGradient


TDrawingPathGradient.Equals Method | FlexCel Studio for the .NET Framework documentation

TDrawingPathGradient.Equals Method

Returns true if this instance has the same data as the object obj.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TDrawingPathGradient


TDrawingPathGradient.CompareTo Method | FlexCel Studio for the .NET Framework documentation

TDrawingPathGradient.CompareTo Method

Returns -1 if obj is bigger than this, 0 if both objects are the same, and 1 if obj is smaller than this.

Syntax

Namespace: FlexCel.Core

public override Int32 CompareTo(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TDrawingPathGradient


TDrawingPathGradient.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TDrawingPathGradient.GetHashCode Method

Returns the hashcode for this object

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TDrawingPathGradient


TDrawingPathGradient.FillToRect Property | FlexCel Studio for the .NET Framework documentation

TDrawingPathGradient.FillToRect Property

This element defines the "focus" rectangle for the center shade, specified relative to the fill tile rectangle.

The center shade fills the entire tile except the margins specified by each attribute.

Each edge of the center shade rectangle is defined by a percentage offset from the corresponding edge of the tile rectangle. A positive percentage specifies an inset, while a negative percentage specifies an outset.

Syntax

Namespace: FlexCel.Core

public Nullable<TDrawingRelativeRect> FillToRect { get; }

See also

  • TDrawingPathGradient


TDrawingPathGradient.Path Property | FlexCel Studio for the .NET Framework documentation

TDrawingPathGradient.Path Property

Specifies the shape of the path to follow.

Syntax

Namespace: FlexCel.Core

public TPathShadeType Path { get; }

See also

  • TDrawingPathGradient


TDrawingRichString Class | FlexCel Studio for the .NET Framework documentation

TDrawingRichString Class

A rich string used in drawings. It is similar to TRichString but it has more properties like for example wordart properties. Similar to a string, this class is immutable.

Syntax

Namespace: FlexCel.Core

public sealed class TDrawingRichString: IComparable

Constructors

Name | Description
TDrawingRichString | Overloaded TDrawingRichString TDrawingRichString(String) TDrawingRichString(TDrawingTextParagraph[]) TDrawingRichString(String, TDrawingAlignment)

Methods

Name Description
Paragraph A paragraph of the text.
Substring Overloaded
 Substring(Int32)
Substring(Int32, Int32)
Add Adds two richstrings together. If using C#, you can just use the overloaded "+" operator to contactenate rich strings.
Trim Trims all the whitespace at the beginning and end of the string.
RightTrim Trims all the whitespace at the end of the string.
ToString Returns the string without Rich text info.
HasFields Returns true if the TDrawingRichString has any fields that must be replaced by values.
ToRichString Overloaded
 ToRichString(ExcelFile, TShapeFont)
ToRichString(ExcelFile, TShapeFont, TFlxFont)
ToRichString(ExcelFile, TShapeFont, TFlxFont, Func<String, TRichString>)
ToRichString(ExcelFile, TShapeFont, TFlxFont, Func<String, TRichString>, Boolean)
FirstRun Returns the first run of the text. Note that an empty TDrawingRichText can have a run anyway, while a TRichString can't.
If there is no first run, the returned value will have a a negative FirstChar.
FromRichString Overloaded
 FromRichString(TRichString, ExcelFile, TDrawingAlignment)
FromRichString(TRichString, ExcelFile, TDrawingRichString, TDrawingAlignment)
FromRichString(TRichString, ExcelFile, TDrawingRichString, TDrawingAlignment, Boolean)
ReplaceText Replaces the existing text in this struct with the text in rs, keeping the properties of the text.
GetTextProperties Modifies a TDrawingText​Properties by adding the settings from a TFxFont.
CompareTo Returns -1 if obj is bigger than this, 0 if both strings are the same, and 1 if obj is smaller than this.
GetHashCode Returns the hashcode of the object.
Equals Returns true if both instances have the same string and formatting.
DrawingHAlign​From​Align Converts a horizontal alignment from Excel alignment to Drawing alignment.
ReplaceParagraph Returns a new rich string with one paragraph of the original rich string replaced.
WithNewFieldIds Returns a new TDrawingRichString with new field ids if the DrawingRichString has field ids.
While FlexCel will do this automatically when you link a shape, you can use this method when creating a new linked shape that requires new field ids.

Operators

Name | Description
Addition | Concatenates two TDrawingRichString objects.
Implicit Conversion | Overloaded Implicit conversion from String to TDrawingRichString Implicit conversion from TDrawingRichString to String
Equality | Returns true if both strings are equal.
Inequality | Returns true if both strings do not have the same value.
LessThan | Returns true is a string is less than the other.
GreaterThan | Returns true is a string is bigger than the other.

Properties

Name | Description
Value | Text of the string without formatting. Might be null.
ParagraphCount | The count of Paragraphs in this string.
Length | Length of the DrawingRichString.
IsEmpty | Returns true if the string has no data.


TDrawingRichString.TDrawingRichString Constructor | FlexCel Studio for the .NET Framework documentation

TDrawingRichString.TDrawingRichString Constructor

Overloads

  • TDrawingRichString.TDrawingRichString
  • TDrawingRichString.TDrawingRichString(String)
  • TDrawingRichString.TDrawingRichString(TDrawingTextParagraph[])
  • TDrawingRichString.TDrawingRichString(String, TDrawingAlignment)

TDrawingRichString.TDrawingRichString

Creates a new TDrawingRichString with a null value.

Syntax

Namespace: FlexCel.Core

public TDrawingRichString()

See also

  • TDrawingRichString

TDrawingRichString.TDrawingRichString(String)

Creates a new TDrawingRichString with no formatting and left alignment.

Syntax

Namespace: FlexCel.Core

public TDrawingRichString(String s)

Parameters

<-> | Parameter | Type | Description
 | s | String | String with the data.

See also

  • TDrawingRichString

TDrawingRichString.TDrawingRichString(TDrawingTextParagraph[])

Creates a new TDrawingRichString from an array of paragraphs.

Syntax

Namespace: FlexCel.Core

public TDrawingRichString(TDrawingTextParagraph[] aParagraphs)

Parameters

<-> | Parameter | Type | Description
 | aParagraphs | TDrawingText​Paragraph[] | Array of RTF runs with the data and formatting for the string.

See also

  • TDrawingRichString

TDrawingRichString.TDrawingRichString(String, TDrawingAlignment)

Creates a new TDrawingRichString with no formatting and the specified alignment.

Syntax

Namespace: FlexCel.Core

public TDrawingRichString(String s, TDrawingAlignment hAlign)

Parameters

<-> | Parameter | Type | Description
 | s | String | String with the data.
 | hAlign | TDrawingAlignment | Alignment for the text.

See also

  • TDrawingRichString


TDrawingRichString.Paragraph Method | FlexCel Studio for the .NET Framework documentation

TDrawingRichString.Paragraph Method

A paragraph of the text.

Syntax

Namespace: FlexCel.Core

public TDrawingTextParagraph Paragraph(Int32 index)

Parameters

<-> | Parameter | Type | Description
 | index | Int32 | Index on the list. 0 based.

Returns

The paragraph.

See also

  • TDrawingRichString


TDrawingRichString.Substring Method | FlexCel Studio for the .NET Framework documentation

TDrawingRichString.Substring Method

Overloads

  • TDrawingRichString.Substring(Int32)
  • TDrawingRichString.Substring(Int32, Int32)

TDrawingRichString.Substring(Int32)

Retrieves a substring from this instance. The substring starts at a specified character position and ends at the end of the string.

Syntax

Namespace: FlexCel.Core

public TDrawingRichString Substring(Int32 index)

Parameters

<-> | Parameter | Type | Description
 | index | Int32 | Start of the substring (0 based)

See also

  • TDrawingRichString

TDrawingRichString.Substring(Int32, Int32)

Retrieves a substring from this instance. The substring starts at a specified character position and has a specified length.

Syntax

Namespace: FlexCel.Core

public TDrawingRichString Substring(Int32 index, Int32 count)

Parameters

<-> | Parameter | Type | Description
 | index | Int32 | Start of the substring (0 based)
 | count | Int32 | Number of characters to copy.

See also

  • TDrawingRichString


TDrawingRichString.Add Method | FlexCel Studio for the .NET Framework documentation

TDrawingRichString.Add Method

Adds two richstrings together. If using C#, you can just use the overloaded "+" operator to contactenate rich strings.

Syntax

Namespace: FlexCel.Core

public TDrawingRichString Add(TDrawingRichString s1)

Parameters

<-> | Parameter | Type | Description
 | s1 | TDrawingRichString |

See also

  • TDrawingRichString


TDrawingRichString.Trim Method | FlexCel Studio for the .NET Framework documentation

TDrawingRichString.Trim Method

Trims all the whitespace at the beginning and end of the string.

Syntax

Namespace: FlexCel.Core

public TDrawingRichString Trim()

See also

  • TDrawingRichString


TDrawingRichString.RightTrim Method | FlexCel Studio for the .NET Framework documentation

TDrawingRichString.RightTrim Method

Trims all the whitespace at the end of the string.

Syntax

Namespace: FlexCel.Core

public TDrawingRichString RightTrim()

See also

  • TDrawingRichString


TDrawingRichString.ToString Method | FlexCel Studio for the .NET Framework documentation

TDrawingRichString.ToString Method

Returns the string without Rich text info.

Syntax

Namespace: FlexCel.Core

public override String ToString()

See also

  • TDrawingRichString


TDrawingRichString.HasFields Method | FlexCel Studio for the .NET Framework documentation

TDrawingRichString.HasFields Method

Returns true if the TDrawingRichString has any fields that must be replaced by values.

Syntax

Namespace: FlexCel.Core

public Boolean HasFields()

See also

  • TDrawingRichString


TDrawingRichString.ToRichString Method | FlexCel Studio for the .NET Framework documentation

TDrawingRichString.ToRichString Method

Overloads

  • TDrawingRichString.ToRichString(ExcelFile, TShapeFont)
  • TDrawingRichString.ToRichString(ExcelFile, TShapeFont, TFlxFont)
  • TDrawingRichString.ToRichString(ExcelFile, TShapeFont, TFlxFont, Func<String, TRichString>)
  • TDrawingRichString.ToRichString(ExcelFile, TShapeFont, TFlxFont, Func<String, TRichString>, Boolean)

TDrawingRichString.ToRichString(ExcelFile, TShapeFont)

Converts this TDrawingRichString into a TRichString. Note that the conversion is not perfect as a TDrawingRichString has different information from a TRichString.

Syntax

Namespace: FlexCel.Core

public TRichString ToRichString(ExcelFile xls, TShapeFont ShapeThemeFont)

Parameters

<-> | Parameter | Type | Description
 | xls | ExcelFile | Excel file with the fonts.
 | ShapeThemeFont | TShapeFont | Theme font used by default when no formatting is specified. Set it to null to use the default.

See also

  • TDrawingRichString

TDrawingRichString.ToRichString(ExcelFile, TShapeFont, TFlxFont)

Converts this TDrawingRichString into a TRichString. Note that the conversion is not perfect as a TDrawingRichString has different information from a TRichString.

Syntax

Namespace: FlexCel.Core

public TRichString ToRichString(ExcelFile xls, TShapeFont ShapeThemeFont, TFlxFont DefaultFont)

Parameters

<-> | Parameter | Type | Description
 | xls | ExcelFile | Excel file with the fonts.
 | ShapeThemeFont | TShapeFont | Theme font used by default when no formatting is specified. Set it to null to use the default.
 | DefaultFont | TFlxFont | Font to be used by default. If left null, the default font for the workbook will be used.

See also

  • TDrawingRichString

TDrawingRichString.ToRichString(ExcelFile, TShapeFont, TFlxFont, Func<String, TRichString>)

Converts this TDrawingRichString into a TRichString. Note that the conversion is not perfect as a TDrawingRichString has different information from a TRichString.

Syntax

Namespace: FlexCel.Core

public TRichString ToRichString(ExcelFile xls, TShapeFont ShapeThemeFont, TFlxFont DefaultFont, Func<String, TRichString> FieldReplacer)

Parameters

<-> | Parameter | Type | Description
 | xls | ExcelFile | Excel file with the fonts.
 | ShapeThemeFont | TShapeFont | Theme font used by default when no formatting is specified. Set it to null to use the default.
 | DefaultFont | TFlxFont | Font to be used by default. If left null, the default font for the workbook will be used.
 | FieldReplacer | Func<String, TRichString> | Use this lambda function to replace text in fields. It will take the field name as a parameter, and you need to return the field value in the result. Set it to null if you don't want to replace fields.

See also

  • TDrawingRichString

TDrawingRichString.ToRichString(ExcelFile, TShapeFont, TFlxFont, Func<String, TRichString>, Boolean)

Converts this TDrawingRichString into a TRichString. Note that the conversion is not perfect as a TDrawingRichString has different information from a TRichString.

Syntax

Namespace: FlexCel.Core

public TRichString ToRichString(ExcelFile xls, TShapeFont ShapeThemeFont, TFlxFont DefaultFont, Func<String, TRichString> FieldReplacer, Boolean UppercaseIfAllCaps)

Parameters

<-> | Parameter | Type | Description
 | xls | ExcelFile | Excel file with the fonts.
 | ShapeThemeFont | TShapeFont | Theme font used by default when no formatting is specified. Set it to null to use the default.
 | DefaultFont | TFlxFont | Font to be used by default. If left null, the default font for the workbook will be used.
 | FieldReplacer | Func<String, TRichString> | Use this lambda function to replace text in fields. It will take the field name as a parameter, and you need to return the field value in the result. Set it to null if you don't want to replace fields.
 | UppercaseIfAllCaps | Boolean | If true and the style of the TDrawingRichString is all-caps, this will return the string converted to uppercase. Because a RichString doesn't have information about all-caps.

See also

  • TDrawingRichString


TDrawingRichString.FirstRun Method | FlexCel Studio for the .NET Framework documentation

TDrawingRichString.FirstRun Method

Returns the first run of the text. Note that an empty TDrawingRichText can have a run anyway, while a TRichString can't. If there is no first run, the returned value will have a a negative FirstChar.

Syntax

Namespace: FlexCel.Core

public TRTFRun FirstRun(ExcelFile xls, TShapeFont ShapeThemeFont, TFlxChartFont DefFont)

Parameters

<-> | Parameter | Type | Description
 | xls | ExcelFile |
 | ShapeThemeFont | TShapeFont |
 | DefFont | TFlxChartFont |

See also

  • TDrawingRichString


TDrawingRichString.FromRichString Method | FlexCel Studio for the .NET Framework documentation

TDrawingRichString.FromRichString Method

Overloads

  • TDrawingRichString.FromRichString(TRichString, ExcelFile, TDrawingAlignment)
  • TDrawingRichString.FromRichString(TRichString, ExcelFile, TDrawingRichString, TDrawingAlignment)
  • TDrawingRichString.FromRichString(TRichString, ExcelFile, TDrawingRichString, TDrawingAlignment, Boolean)

TDrawingRichString.FromRichString(TRichString, ExcelFile, TDrawingAlignment)

Returns a new TDrawingRichString from a TRichString. Note that the conversion is not perfect since information in both kind of strings is different.

Syntax

Namespace: FlexCel.Core

public static TDrawingRichString FromRichString(TRichString aValue, ExcelFile xls, TDrawingAlignment HAlign)

Parameters

<-> | Parameter | Type | Description
 | aValue | TRichString | String that we want to convert.
 | xls | ExcelFile | Excel file with the string. It will be used to convert indexed colors if there are any.
 | HAlign | TDrawingAlignment | Alignment for the paragraphs.

See also

  • TDrawingRichString

TDrawingRichString.FromRichString(TRichString, ExcelFile, TDrawingRichString, TDrawingAlignment)

Returns a new TDrawingRichString from a TRichString. Note that the conversion is not perfect since information in both kind of strings is different.

Syntax

Namespace: FlexCel.Core

public static TDrawingRichString FromRichString(TRichString aValue, ExcelFile xls, TDrawingRichString origString, TDrawingAlignment HAlign)

Parameters

<-> | Parameter | Type | Description
 | aValue | TRichString | String that we want to convert.
 | xls | ExcelFile | Excel file with the string. It will be used to convert indexed colors if there are any.
 | origString | TDrawingRichString | String used as a template when replacing text.
 | HAlign | TDrawingAlignment | Alignment for the paragraphs.

See also

  • TDrawingRichString

TDrawingRichString.FromRichString(TRichString, ExcelFile, TDrawingRichString, TDrawingAlignment, Boolean)

Returns a new TDrawingRichString from a TRichString. Note that the conversion is not perfect since information in both kind of strings is different.

Syntax

Namespace: FlexCel.Core

public static TDrawingRichString FromRichString(TRichString aValue, ExcelFile xls, TDrawingRichString origString, TDrawingAlignment HAlign, Boolean splitIntoParagraphs)

Parameters

<-> | Parameter | Type | Description
 | aValue | TRichString | String that we want to convert.
 | xls | ExcelFile | Excel file with the string. It will be used to convert indexed colors if there are any.
 | origString | TDrawingRichString | String used as a template when replacing text.
 | HAlign | TDrawingAlignment | Alignment for the paragraphs.
 | splitIntoParagraphs | Boolean | You will normally want this parameter to be true. If false, returns in the text will be encoded in the same paragraph. This is needed in some parts in the xlsx file, but normally you want one paragraph per line.

See also

  • TDrawingRichString


TDrawingRichString.ReplaceText Method | FlexCel Studio for the .NET Framework documentation

TDrawingRichString.ReplaceText Method

Replaces the existing text in this struct with the text in rs, keeping the properties of the text.

Syntax

Namespace: FlexCel.Core

public TDrawingRichString ReplaceText(TRichString rs, ExcelFile xls)

Parameters

<-> | Parameter | Type | Description
 | rs | TRichString | Text that we want the string to have.
 | xls | ExcelFile | Used to calculate indexed colors. Might be null.

See also

  • TDrawingRichString


TDrawingRichString.GetTextProperties Method | FlexCel Studio for the .NET Framework documentation

TDrawingRichString.GetTextProperties Method

Modifies a TDrawingTextProperties by adding the settings from a TFxFont.

Syntax

Namespace: FlexCel.Core

public static TDrawingTextProperties GetTextProperties(TFlxFont NewFont, TDrawingTextProperties TextRun0Props, ExcelFile xls)

Parameters

<-> | Parameter | Type | Description
 | NewFont | TFlxFont | Font we want the properties from.
 | TextRun0Props | TDrawingText​Properties | Text properties we want to modify.
 | xls | ExcelFile | Excel file where the string is.

See also

  • TDrawingRichString


TDrawingRichString.CompareTo Method | FlexCel Studio for the .NET Framework documentation

TDrawingRichString.CompareTo Method

Returns -1 if obj is bigger than this, 0 if both strings are the same, and 1 if obj is smaller than this.

Syntax

Namespace: FlexCel.Core

public Int32 CompareTo(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TDrawingRichString


TDrawingRichString.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TDrawingRichString.GetHashCode Method

Returns the hashcode of the object.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TDrawingRichString


TDrawingRichString.Equals Method | FlexCel Studio for the .NET Framework documentation

TDrawingRichString.Equals Method

Returns true if both instances have the same string and formatting.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object | Object to compare.

Returns

True if both strings are the same.

See also

  • TDrawingRichString


TDrawingRichString.DrawingHAlignFromAlign Method | FlexCel Studio for the .NET Framework documentation

TDrawingRichString.DrawingHAlignFromAlign Method

Converts a horizontal alignment from Excel alignment to Drawing alignment.

Syntax

Namespace: FlexCel.Core

public static TDrawingAlignment DrawingHAlignFromAlign(THFlxAlignment hAlign)

Parameters

<-> | Parameter | Type | Description
 | hAlign | THFlxAlignment |

See also

  • TDrawingRichString


TDrawingRichString.ReplaceParagraph Method | FlexCel Studio for the .NET Framework documentation

TDrawingRichString.ReplaceParagraph Method

Returns a new rich string with one paragraph of the original rich string replaced.

Syntax

Namespace: FlexCel.Core

public TDrawingRichString ReplaceParagraph(Int32 paragraphIndex, TDrawingTextParagraph drawingTextParagraph)

Parameters

<-> | Parameter | Type | Description
 | paragraphIndex | Int32 | Paragraph to replace (0 based)
 | drawingTextParagraph | TDrawingText​Paragraph | New paragraph.

See also

  • TDrawingRichString


TDrawingRichString.WithNewFieldIds Method | FlexCel Studio for the .NET Framework documentation

TDrawingRichString.WithNewFieldIds Method

Returns a new TDrawingRichString with new field ids if the DrawingRichString has field ids. While FlexCel will do this automatically when you link a shape, you can use this method when creating a new linked shape that requires new field ids.

Syntax

Namespace: FlexCel.Core

public TDrawingRichString WithNewFieldIds()

See also

  • TDrawingRichString


TDrawingRichString.Addition Operator | FlexCel Studio for the .NET Framework documentation

TDrawingRichString.Addition Operator

Concatenates two TDrawingRichString objects.

Syntax

Namespace: FlexCel.Core

public static TDrawingRichString op_Addition(TDrawingRichString s1, TDrawingRichString s2)

Parameters

<-> | Parameter | Type | Description
 | s1 | TDrawingRichString | First string to concatenate.
 | s2 | TDrawingRichString | Second string to concatenate.

Returns

The concatenated string.

See also

  • TDrawingRichString


TDrawingRichString Implicit Conversion Operator | FlexCel Studio for the .NET Framework documentation

TDrawingRichString Implicit Conversion Operator

Overloads

  • Implicit conversion from String to TDrawingRichString
  • Implicit conversion from TDrawingRichString to String

Implicit conversion from String to TDrawingRichString

Converts a string to a TDrawingRichString.

Syntax

Namespace: FlexCel.Core

public static TDrawingRichString op_Implicit(String s)

Parameters

<-> | Parameter | Type | Description
 | s | String |

See also

  • TDrawingRichString

Implicit conversion from TDrawingRichString to String

Converts a TDrawingRichString to a string.

Syntax

Namespace: FlexCel.Core

public static String op_Implicit(TDrawingRichString r)

Parameters

<-> | Parameter | Type | Description
 | r | TDrawingRichString |

See also

  • TDrawingRichString


TDrawingRichString.Equality Operator | FlexCel Studio for the .NET Framework documentation

TDrawingRichString.Equality Operator

Returns true if both strings are equal.

Syntax

Namespace: FlexCel.Core

public static Boolean op_Equality(TDrawingRichString o1, TDrawingRichString o2)

Parameters

<-> | Parameter | Type | Description
 | o1 | TDrawingRichString | First string to compare.
 | o2 | TDrawingRichString | Second string to compare.

See also

  • TDrawingRichString


TDrawingRichString.Inequality Operator | FlexCel Studio for the .NET Framework documentation

TDrawingRichString.Inequality Operator

Returns true if both strings do not have the same value.

Syntax

Namespace: FlexCel.Core

public static Boolean op_Inequality(TDrawingRichString o1, TDrawingRichString o2)

Parameters

<-> | Parameter | Type | Description
 | o1 | TDrawingRichString | First string to compare.
 | o2 | TDrawingRichString | Second string to compare.

See also

  • TDrawingRichString


TDrawingRichString.LessThan Operator | FlexCel Studio for the .NET Framework documentation

TDrawingRichString.LessThan Operator

Returns true is a string is less than the other.

Syntax

Namespace: FlexCel.Core

public static Boolean op_LessThan(TDrawingRichString o1, TDrawingRichString o2)

Parameters

<-> | Parameter | Type | Description
 | o1 | TDrawingRichString | First string to compare.
 | o2 | TDrawingRichString | Second string to compare.

See also

  • TDrawingRichString


TDrawingRichString.GreaterThan Operator | FlexCel Studio for the .NET Framework documentation

TDrawingRichString.GreaterThan Operator

Returns true is a string is bigger than the other.

Syntax

Namespace: FlexCel.Core

public static Boolean op_GreaterThan(TDrawingRichString o1, TDrawingRichString o2)

Parameters

<-> | Parameter | Type | Description
 | o1 | TDrawingRichString | First string to compare.
 | o2 | TDrawingRichString | Second string to compare.

See also

  • TDrawingRichString


TDrawingRichString.Value Property | FlexCel Studio for the .NET Framework documentation

TDrawingRichString.Value Property

Text of the string without formatting. Might be null.

Syntax

Namespace: FlexCel.Core

public String Value { get; }

See also

  • TDrawingRichString


TDrawingRichString.ParagraphCount Property | FlexCel Studio for the .NET Framework documentation

TDrawingRichString.ParagraphCount Property

The count of Paragraphs in this string.

Syntax

Namespace: FlexCel.Core

public Int32 ParagraphCount { get; }

See also

  • TDrawingRichString


TDrawingRichString.Length Property | FlexCel Studio for the .NET Framework documentation

TDrawingRichString.Length Property

Length of the DrawingRichString.

Syntax

Namespace: FlexCel.Core

public Int32 Length { get; }

See also

  • TDrawingRichString


TDrawingRichString.IsEmpty Property | FlexCel Studio for the .NET Framework documentation

TDrawingRichString.IsEmpty Property

Returns true if the string has no data.

Syntax

Namespace: FlexCel.Core

public Boolean IsEmpty { get; }

See also

  • TDrawingRichString


TDrawingUnderline Class | FlexCel Studio for the .NET Framework documentation

TDrawingUnderline Class

Specifies the Fill style and line style of underlined text, when it is underlined.

Syntax

Namespace: FlexCel.Core

public sealed class TDrawingUnderline: IComparable

Methods

Name | Description
CompareTo | Returns -1, 0 or 1 depending if this object is smaller or bigger than the other.
GetHashCode | Returns the hashcode of the object.
Equals | Returns true if both instances have the same data.

Operators

Name | Description
Equality | Returns true if both objects are equal.
Inequality | Returns true if both objects do not have the same value.


TDrawingUnderline.CompareTo Method | FlexCel Studio for the .NET Framework documentation

TDrawingUnderline.CompareTo Method

Returns -1, 0 or 1 depending if this object is smaller or bigger than the other.

Syntax

Namespace: FlexCel.Core

public Int32 CompareTo(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TDrawingUnderline


TDrawingUnderline.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TDrawingUnderline.GetHashCode Method

Returns the hashcode of the object.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TDrawingUnderline


TDrawingUnderline.Equals Method | FlexCel Studio for the .NET Framework documentation

TDrawingUnderline.Equals Method

Returns true if both instances have the same data.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object | Object to compare.

Returns

True if both strings are the same.

See also

  • TDrawingUnderline


TDrawingUnderline.Equality Operator | FlexCel Studio for the .NET Framework documentation

TDrawingUnderline.Equality Operator

Returns true if both objects are equal.

Syntax

Namespace: FlexCel.Core

public static Boolean op_Equality(TDrawingUnderline o1, TDrawingUnderline o2)

Parameters

<-> | Parameter | Type | Description
 | o1 | TDrawingUnderline | First object to compare.
 | o2 | TDrawingUnderline | Second object to compare.

See also

  • TDrawingUnderline


TDrawingUnderline.Inequality Operator | FlexCel Studio for the .NET Framework documentation

TDrawingUnderline.Inequality Operator

Returns true if both objects do not have the same value.

Syntax

Namespace: FlexCel.Core

public static Boolean op_Inequality(TDrawingUnderline o1, TDrawingUnderline o2)

Parameters

<-> | Parameter | Type | Description
 | o1 | TDrawingUnderline | First objects to compare.
 | o2 | TDrawingUnderline | Second objects to compare.

See also

  • TDrawingUnderline


TEffectContainer Class | FlexCel Studio for the .NET Framework documentation

TEffectContainer Class

This class encapsulates a node of the effect DAC.

Syntax

Namespace: FlexCel.Core

public class TEffectContainer: TDrawingEffect, IComparable, IComparable<TEffectContainer>

Methods

Name | Description
Clone | Creates a deep copy of the object.
CompareTo | Overloaded CompareTo(Object) CompareTo(TEffectContainer)
Equals | Overloaded Equals(TEffectContainer) Equals(Object)
GetHashCode | Returns the hashcode of the object.


TEffectContainer.Clone Method | FlexCel Studio for the .NET Framework documentation

TEffectContainer.Clone Method

Creates a deep copy of the object.

Syntax

Namespace: FlexCel.Core

public TEffectContainer Clone()

See also

  • TEffectContainer


TEffectContainer.CompareTo Method | FlexCel Studio for the .NET Framework documentation

TEffectContainer.CompareTo Method

Overloads

  • TEffectContainer.CompareTo(Object)
  • TEffectContainer.CompareTo(TEffectContainer)

TEffectContainer.CompareTo(Object)

Returns -1, 0 or 1 depending if this object is smaller or bigger than the other.

Syntax

Namespace: FlexCel.Core

public Int32 CompareTo(Object other)

Parameters

<-> | Parameter | Type | Description
 | other | Object |

See also

  • TEffectContainer

TEffectContainer.CompareTo(TEffectContainer)

Returns -1, 0 or 1 depending if this object is smaller or bigger than the other.

Syntax

Namespace: FlexCel.Core

public Int32 CompareTo(TEffectContainer other)

Parameters

<-> | Parameter | Type | Description
 | other | TEffectContainer |

See also

  • TEffectContainer


TEffectContainer.Equals Method | FlexCel Studio for the .NET Framework documentation

TEffectContainer.Equals Method

Overloads

  • TEffectContainer.Equals(TEffectContainer)
  • TEffectContainer.Equals(Object)

TEffectContainer.Equals(TEffectContainer)

Returns true if both objects are the same.

Syntax

Namespace: FlexCel.Core

protected Boolean Equals(TEffectContainer other)

Parameters

<-> | Parameter | Type | Description
 | other | TEffectContainer |

See also

  • TEffectContainer

TEffectContainer.Equals(Object)

Returns true if both objects are the same.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TEffectContainer


TEffectContainer.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TEffectContainer.GetHashCode Method

Returns the hashcode of the object.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TEffectContainer


TEffectList Class | FlexCel Studio for the .NET Framework documentation

TEffectList Class

This class holds a list of effects that are applied to a drawing.

Syntax

Namespace: FlexCel.Core

public class TEffectList: IComparable<TEffectList>, IComparable

Constructors

Name | Description
TEffectList | Overloaded TEffectList TEffectList(TBlurEffect, TFillOverlayEffect, TGlowEffect, TInnerShadowEffect, TOuterShadowEffect, TPresetShadowEffect, TReflectionEffect, TSoftEdgesEffect)

Methods

Name | Description
Clone | Returns a deep copy of this object.
CompareTo | Overloaded CompareTo(Object) CompareTo(TEffectList)
Equals | Overloaded Equals(TEffectList) Equals(Object)
GetHashCode | Returns the hashcode of the object.

Properties

Name | Description
Blur | Blur effect.
FillOverlay | Fill overlay effect.
Glow | Glow effect.
InnerShadow | Inner shadow effect.
OuterShadow | Outer shadow effect.
PresetShadow | Preset shadow effect.
Reflection | Reflection effect.
SoftEdges | Soft edges effect.


TEffectList.TEffectList Constructor | FlexCel Studio for the .NET Framework documentation

TEffectList.TEffectList Constructor

Overloads

  • TEffectList.TEffectList
  • TEffectList.TEffectList(TBlurEffect, TFillOverlayEffect, TGlowEffect, TInnerShadowEffect, TOuterShadowEffect, TPresetShadowEffect, TReflectionEffect, TSoftEdgesEffect)

TEffectList.TEffectList

Creates a new TEffectList without any values.

Syntax

Namespace: FlexCel.Core

public TEffectList()

See also

  • TEffectList

TEffectList.TEffectList(TBlurEffect, TFillOverlayEffect, TGlowEffect, TInnerShadowEffect, TOuterShadowEffect, TPresetShadowEffect, TReflectionEffect, TSoftEdgesEffect)

Creates a new TEffectList with the given values.

Syntax

Namespace: FlexCel.Core

public TEffectList(TBlurEffect aBlur, TFillOverlayEffect aFillOverlay, TGlowEffect aGlow, TInnerShadowEffect aInnerShadow, TOuterShadowEffect aOuterShadow, TPresetShadowEffect aPresetShadow, TReflectionEffect aReflection, TSoftEdgesEffect aSoftEdges)

Parameters

<-> | Parameter | Type | Description
 | aBlur | TBlurEffect | Blur effect.
 | aFillOverlay | TFillOverlayEffect | Fill overlay effect.
 | aGlow | TGlowEffect | Glow effect.
 | aInnerShadow | TInnerShadowEffect | Inner shadow effect.
 | aOuterShadow | TOuterShadowEffect | Outer shadow effect.
 | aPresetShadow | TPresetShadowEffect | Preset shadow effect.
 | aReflection | TReflectionEffect | Reflection effect.
 | aSoftEdges | TSoftEdgesEffect | Soft edges effect.

See also

  • TEffectList


TEffectList.Clone Method | FlexCel Studio for the .NET Framework documentation

TEffectList.Clone Method

Returns a deep copy of this object.

Syntax

Namespace: FlexCel.Core

public TEffectList Clone()

See also

  • TEffectList


TEffectList.CompareTo Method | FlexCel Studio for the .NET Framework documentation

TEffectList.CompareTo Method

Overloads

  • TEffectList.CompareTo(Object)
  • TEffectList.CompareTo(TEffectList)

TEffectList.CompareTo(Object)

Returns -1, 0 or 1 depending if this object is smaller or bigger than the other.

Syntax

Namespace: FlexCel.Core

public Int32 CompareTo(Object other)

Parameters

<-> | Parameter | Type | Description
 | other | Object |

See also

  • TEffectList

TEffectList.CompareTo(TEffectList)

Returns -1, 0 or 1 depending if this object is smaller or bigger than the other.

Syntax

Namespace: FlexCel.Core

public Int32 CompareTo(TEffectList other)

Parameters

<-> | Parameter | Type | Description
 | other | TEffectList |

See also

  • TEffectList


TEffectList.Equals Method | FlexCel Studio for the .NET Framework documentation

TEffectList.Equals Method

Overloads

  • TEffectList.Equals(TEffectList)
  • TEffectList.Equals(Object)

TEffectList.Equals(TEffectList)

Returns true if both objects are the same.

Syntax

Namespace: FlexCel.Core

protected Boolean Equals(TEffectList other)

Parameters

<-> | Parameter | Type | Description
 | other | TEffectList |

See also

  • TEffectList

TEffectList.Equals(Object)

Returns true if both objects are the same.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object other)

Parameters

<-> | Parameter | Type | Description
 | other | Object |

See also

  • TEffectList


TEffectList.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TEffectList.GetHashCode Method

Returns the hashcode of the object.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TEffectList


TEffectList.Blur Property | FlexCel Studio for the .NET Framework documentation

TEffectList.Blur Property

Blur effect.

Syntax

Namespace: FlexCel.Core

public TBlurEffect Blur { get; set; }

See also

  • TEffectList


TEffectList.FillOverlay Property | FlexCel Studio for the .NET Framework documentation

TEffectList.FillOverlay Property

Fill overlay effect.

Syntax

Namespace: FlexCel.Core

public TFillOverlayEffect FillOverlay { get; set; }

See also

  • TEffectList


TEffectList.Glow Property | FlexCel Studio for the .NET Framework documentation

TEffectList.Glow Property

Glow effect.

Syntax

Namespace: FlexCel.Core

public TGlowEffect Glow { get; set; }

See also

  • TEffectList


TEffectList.InnerShadow Property | FlexCel Studio for the .NET Framework documentation

TEffectList.InnerShadow Property

Inner shadow effect.

Syntax

Namespace: FlexCel.Core

public TInnerShadowEffect InnerShadow { get; set; }

See also

  • TEffectList


TEffectList.OuterShadow Property | FlexCel Studio for the .NET Framework documentation

TEffectList.OuterShadow Property

Outer shadow effect.

Syntax

Namespace: FlexCel.Core

public TOuterShadowEffect OuterShadow { get; set; }

See also

  • TEffectList


TEffectList.PresetShadow Property | FlexCel Studio for the .NET Framework documentation

TEffectList.PresetShadow Property

Preset shadow effect.

Syntax

Namespace: FlexCel.Core

public TPresetShadowEffect PresetShadow { get; set; }

See also

  • TEffectList


TEffectList.Reflection Property | FlexCel Studio for the .NET Framework documentation

TEffectList.Reflection Property

Reflection effect.

Syntax

Namespace: FlexCel.Core

public TReflectionEffect Reflection { get; set; }

See also

  • TEffectList


TEffectList.SoftEdges Property | FlexCel Studio for the .NET Framework documentation

TEffectList.SoftEdges Property

Soft edges effect.

Syntax

Namespace: FlexCel.Core

public TSoftEdgesEffect SoftEdges { get; set; }

See also

  • TEffectList


TEffectProperties Class | FlexCel Studio for the .NET Framework documentation

TEffectProperties Class

A class encapsulating an effect that can be used for subtle, intense or moderate types. This class can contain either a standard list of effects (which you can access with EffectLst) or a Directed Acyclic Graph (DAG). One of EffectLst or EffectDag will always be null.

Syntax

Namespace: FlexCel.Core

public class TEffectProperties: IComparable, IComparable<TEffectProperties>

Methods

Name | Description
Clone | Returns a deep copy of the object.
Equals | Overloaded Equals(TEffectProperties) Equals(Object)
GetHashCode | Returns the hashcode of the object.
CompareTo | Overloaded CompareTo(Object) CompareTo(TEffectProperties)

Properties

Name | Description
EffectLst | Effect encapsulated by this class when it contains a list of effects. If it contains a DAG, this property is null ans EffectDag will contain the DAG.
EffectDag | Effect encapsulated by this class when it contains a Directed Acyclic Graph of effects. If it contains a list, this property is null ans EffectLst will contain the List.
HasEffects | Returns true if there are any effects.
IsDag | Returns true if this class contains a DAG. When true, EffectDag is not null.


TEffectProperties.Clone Method | FlexCel Studio for the .NET Framework documentation

TEffectProperties.Clone Method

Returns a deep copy of the object.

Syntax

Namespace: FlexCel.Core

public TEffectProperties Clone()

See also

  • TEffectProperties


TEffectProperties.Equals Method | FlexCel Studio for the .NET Framework documentation

TEffectProperties.Equals Method

Overloads

  • TEffectProperties.Equals(TEffectProperties)
  • TEffectProperties.Equals(Object)

TEffectProperties.Equals(TEffectProperties)

Returns true if both objects are the same.

Syntax

Namespace: FlexCel.Core

protected Boolean Equals(TEffectProperties other)

Parameters

<-> | Parameter | Type | Description
 | other | TEffectProperties |

See also

  • TEffectProperties

TEffectProperties.Equals(Object)

Returns true if both objects are the same.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TEffectProperties


TEffectProperties.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TEffectProperties.GetHashCode Method

Returns the hashcode of the object.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TEffectProperties


TEffectProperties.CompareTo Method | FlexCel Studio for the .NET Framework documentation

TEffectProperties.CompareTo Method

Overloads

  • TEffectProperties.CompareTo(Object)
  • TEffectProperties.CompareTo(TEffectProperties)

TEffectProperties.CompareTo(Object)

Returns -1, 0 or 1 depending if this object is smaller or bigger than the other.

Syntax

Namespace: FlexCel.Core

public Int32 CompareTo(Object other)

Parameters

<-> | Parameter | Type | Description
 | other | Object |

See also

  • TEffectProperties

TEffectProperties.CompareTo(TEffectProperties)

Returns -1, 0 or 1 depending if this object is smaller or bigger than the other.

Syntax

Namespace: FlexCel.Core

public Int32 CompareTo(TEffectProperties other)

Parameters

<-> | Parameter | Type | Description
 | other | TEffectProperties |

See also

  • TEffectProperties


TEffectProperties.EffectLst Property | FlexCel Studio for the .NET Framework documentation

TEffectProperties.EffectLst Property

Effect encapsulated by this class when it contains a list of effects. If it contains a DAG, this property is null ans EffectDag will contain the DAG.

Syntax

Namespace: FlexCel.Core

public TEffectList EffectLst { get; set; }

See also

  • TEffectProperties


TEffectProperties.EffectDag Property | FlexCel Studio for the .NET Framework documentation

TEffectProperties.EffectDag Property

Effect encapsulated by this class when it contains a Directed Acyclic Graph of effects. If it contains a list, this property is null ans EffectLst will contain the List.

Syntax

Namespace: FlexCel.Core

public TEffectContainer EffectDag { get; set; }

See also

  • TEffectProperties


TEffectProperties.HasEffects Property | FlexCel Studio for the .NET Framework documentation

TEffectProperties.HasEffects Property

Returns true if there are any effects.

Syntax

Namespace: FlexCel.Core

public Boolean HasEffects { get; }

See also

  • TEffectProperties


TEffectProperties.IsDag Property | FlexCel Studio for the .NET Framework documentation

TEffectProperties.IsDag Property

Returns true if this class contains a DAG. When true, EffectDag is not null.

Syntax

Namespace: FlexCel.Core

public Boolean IsDag { get; }

See also

  • TEffectProperties


TEffectStyle Class | FlexCel Studio for the .NET Framework documentation

TEffectStyle Class

A class encapsulating a style including 3D styles.

Syntax

Namespace: FlexCel.Core

public class TEffectStyle

Methods

Name | Description
Clone | Returns a deep copy of the object.
Equals | Overloaded Equals(TEffectStyle) Equals(Object)
GetHashCode | Hashcode for the object.
EnsureProperties | If properties is null, it will create new empty properties.
EnsureEffectLst | If effects is null, it will create new empty effects.
HasOuterShadowEffect | Returns true if the effect has an outer shadow.

Properties

Name | Description
Scene3D | Scene 3D effects. Currently this is an xml string, in the future it might change to a parsed class.
Shape3D | Shape 3D effects. Currently this is an xml string, in the future it might change to a parsed class.
Properties | 2D effects applied to the shape.


TEffectStyle.Clone Method | FlexCel Studio for the .NET Framework documentation

TEffectStyle.Clone Method

Returns a deep copy of the object.

Syntax

Namespace: FlexCel.Core

public TEffectStyle Clone()

See also

  • TEffectStyle


TEffectStyle.Equals Method | FlexCel Studio for the .NET Framework documentation

TEffectStyle.Equals Method

Overloads

  • TEffectStyle.Equals(TEffectStyle)
  • TEffectStyle.Equals(Object)

TEffectStyle.Equals(TEffectStyle)

True if both objects are the same.

Syntax

Namespace: FlexCel.Core

protected Boolean Equals(TEffectStyle other)

Parameters

<-> | Parameter | Type | Description
 | other | TEffectStyle |

See also

  • TEffectStyle

TEffectStyle.Equals(Object)

Returns true if both objects are the same.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TEffectStyle


TEffectStyle.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TEffectStyle.GetHashCode Method

Hashcode for the object.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TEffectStyle


TEffectStyle.EnsureProperties Method | FlexCel Studio for the .NET Framework documentation

TEffectStyle.EnsureProperties Method

If properties is null, it will create new empty properties.

Syntax

Namespace: FlexCel.Core

public void EnsureProperties()

See also

  • TEffectStyle


TEffectStyle.EnsureEffectLst Method | FlexCel Studio for the .NET Framework documentation

TEffectStyle.EnsureEffectLst Method

If effects is null, it will create new empty effects.

Syntax

Namespace: FlexCel.Core

public void EnsureEffectLst()

See also

  • TEffectStyle


TEffectStyle.HasOuterShadowEffect Method | FlexCel Studio for the .NET Framework documentation

TEffectStyle.HasOuterShadowEffect Method

Returns true if the effect has an outer shadow.

Syntax

Namespace: FlexCel.Core

public Boolean HasOuterShadowEffect()

See also

  • TEffectStyle


TEffectStyle.Scene3D Property | FlexCel Studio for the .NET Framework documentation

TEffectStyle.Scene3D Property

Scene 3D effects. Currently this is an xml string, in the future it might change to a parsed class.

Syntax

Namespace: FlexCel.Core

public String Scene3D { get; set; }

See also

  • TEffectStyle


TEffectStyle.Shape3D Property | FlexCel Studio for the .NET Framework documentation

TEffectStyle.Shape3D Property

Shape 3D effects. Currently this is an xml string, in the future it might change to a parsed class.

Syntax

Namespace: FlexCel.Core

public String Shape3D { get; set; }

See also

  • TEffectStyle


TEffectStyle.Properties Property | FlexCel Studio for the .NET Framework documentation

TEffectStyle.Properties Property

2D effects applied to the shape.

Syntax

Namespace: FlexCel.Core

public TEffectProperties Properties { get; }

See also

  • TEffectStyle


TEffectStyleList Class | FlexCel Studio for the .NET Framework documentation

TEffectStyleList Class

A list with all the effects for subtle, moderate and intense formatting types.

Syntax

Namespace: FlexCel.Core

public class TEffectStyleList

Constructors

Name | Description
TEffectStyleList | Creates a new instance.

Methods

Name | Description
Clone | Returns a deep copy of the object.
Clear | Deletes all elements in this object.
Add | Adds a new effect to the list. First style is subtle, then moderate adn then intense.

Properties

Name | Description
Count | Number of effects saved on this list.
Last | Returns the last element in the list, or null if the list has no elements.
this[] | Returns the effect at position index. First item is Subtle, second Moderate and third Intense.


TEffectStyleList.TEffectStyleList Constructor | FlexCel Studio for the .NET Framework documentation

TEffectStyleList.TEffectStyleList Constructor

Creates a new instance.

Syntax

Namespace: FlexCel.Core

public TEffectStyleList()

See also

  • TEffectStyleList


TEffectStyleList.Clone Method | FlexCel Studio for the .NET Framework documentation

TEffectStyleList.Clone Method

Returns a deep copy of the object.

Syntax

Namespace: FlexCel.Core

public TEffectStyleList Clone()

See also

  • TEffectStyleList


TEffectStyleList.Clear Method | FlexCel Studio for the .NET Framework documentation

TEffectStyleList.Clear Method

Deletes all elements in this object.

Syntax

Namespace: FlexCel.Core

public void Clear()

See also

  • TEffectStyleList


TEffectStyleList.Add Method | FlexCel Studio for the .NET Framework documentation

TEffectStyleList.Add Method

Adds a new effect to the list. First style is subtle, then moderate adn then intense.

Syntax

Namespace: FlexCel.Core

public void Add(TEffectStyle effect)

Parameters

<-> | Parameter | Type | Description
 | effect | TEffectStyle |

See also

  • TEffectStyleList


TEffectStyleList.Count Property | FlexCel Studio for the .NET Framework documentation

TEffectStyleList.Count Property

Number of effects saved on this list.

Syntax

Namespace: FlexCel.Core

public Int32 Count { get; }

See also

  • TEffectStyleList


TEffectStyleList.Last Property | FlexCel Studio for the .NET Framework documentation

TEffectStyleList.Last Property

Returns the last element in the list, or null if the list has no elements.

Syntax

Namespace: FlexCel.Core

public TEffectStyle Last { get; }

See also

  • TEffectStyleList


TEffectStyleList.this[] Property | FlexCel Studio for the .NET Framework documentation

TEffectStyleList.this[] Property

Returns the effect at position index. First item is Subtle, second Moderate and third Intense.

Syntax

Namespace: FlexCel.Core

public TEffectStyle this[] { get; set; }

See also

  • TEffectStyleList


TExcelGradient Class | FlexCel Studio for the .NET Framework documentation

TExcelGradient Class

Represents a gradient fill for a background cell. This class is abstract, you need to use its children: TExcelLinearGradient and TExcelRectangularGradient

Syntax

Namespace: FlexCel.Core

public abstract class TExcelGradient

Fields

Name | Description
FGradientType | Type of gradient.

Methods

Name | Description
Clone | Creates a deep copy of this object.
Equals | Returns true if both classes contain the same gradient.
GetHashCode | Returns the hashcode for this object.

Properties

Name | Description
GradientType | Type of gradient stored inside this object.
Stops | Different colors used in the gradient. This array must have at least one stop, and no more than 256.


TExcelGradient.FGradientType Field | FlexCel Studio for the .NET Framework documentation

TExcelGradient.FGradientType Field

Type of gradient.

Syntax

Namespace: FlexCel.Core

protected TGradientType FGradientType

See also

  • TExcelGradient


TExcelGradient.Clone Method | FlexCel Studio for the .NET Framework documentation

TExcelGradient.Clone Method

Creates a deep copy of this object.

Syntax

Namespace: FlexCel.Core

public TExcelGradient Clone()

See also

  • TExcelGradient


TExcelGradient.Equals Method | FlexCel Studio for the .NET Framework documentation

TExcelGradient.Equals Method

Returns true if both classes contain the same gradient.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TExcelGradient


TExcelGradient.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TExcelGradient.GetHashCode Method

Returns the hashcode for this object.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TExcelGradient


TExcelGradient.GradientType Property | FlexCel Studio for the .NET Framework documentation

TExcelGradient.GradientType Property

Type of gradient stored inside this object.

Syntax

Namespace: FlexCel.Core

public TGradientType GradientType { get; }

See also

  • TExcelGradient


TExcelGradient.Stops Property | FlexCel Studio for the .NET Framework documentation

TExcelGradient.Stops Property

Different colors used in the gradient. This array must have at least one stop, and no more than 256.

Syntax

Namespace: FlexCel.Core

public TGradientStop[] Stops { get; set; }

See also

  • TExcelGradient


TExcelLinearGradient Class | FlexCel Studio for the .NET Framework documentation

TExcelLinearGradient Class

A linear gradient used for filling a background.

Syntax

Namespace: FlexCel.Core

public class TExcelLinearGradient: TExcelGradient

Constructors

Name | Description
TExcelLinearGradient | Overloaded TExcelLinearGradient TExcelLinearGradient(TGradientStop[], Double)

Methods

Name | Description
Equals | Returns true if both classes contain the same gradient.
GetHashCode | Returns the hashcode for this object.

Properties

Name | Description
RotationAngle | Rotation angle of the gradient in degrees.


TExcelLinearGradient.TExcelLinearGradient Constructor | FlexCel Studio for the .NET Framework documentation

TExcelLinearGradient.TExcelLinearGradient Constructor

Overloads

  • TExcelLinearGradient.TExcelLinearGradient
  • TExcelLinearGradient.TExcelLinearGradient(TGradientStop[], Double)

TExcelLinearGradient.TExcelLinearGradient

Creates a new TExcelLinearGradient class.

Syntax

Namespace: FlexCel.Core

public TExcelLinearGradient()

See also

  • TExcelLinearGradient

TExcelLinearGradient.TExcelLinearGradient(TGradientStop[], Double)

Creates a new TExcelLinearGradient instance.

Syntax

Namespace: FlexCel.Core

public TExcelLinearGradient(TGradientStop[] aStops, Double aRotationAngle)

Parameters

<-> | Parameter | Type | Description
 | aStops | TGradientStop[] | Gradient stops.
 | aRotationAngle | Double | Rotation angle in degrees.

See also

  • TExcelLinearGradient


TExcelLinearGradient.Equals Method | FlexCel Studio for the .NET Framework documentation

TExcelLinearGradient.Equals Method

Returns true if both classes contain the same gradient.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TExcelLinearGradient


TExcelLinearGradient.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TExcelLinearGradient.GetHashCode Method

Returns the hashcode for this object.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TExcelLinearGradient


TExcelLinearGradient.RotationAngle Property | FlexCel Studio for the .NET Framework documentation

TExcelLinearGradient.RotationAngle Property

Rotation angle of the gradient in degrees.

Syntax

Namespace: FlexCel.Core

public Double RotationAngle { get; set; }

See also

  • TExcelLinearGradient


TExcelObjectList Class | FlexCel Studio for the .NET Framework documentation

TExcelObjectList Class

A list that contains the Ids and positions of the Excel objects

Syntax

Namespace: FlexCel.Core

public class TExcelObjectList

Constructors

Name | Description
TExcelObjectList | Overloaded TExcelObjectList TExcelObjectList(Boolean)

Methods

Name | Description
ShapeId | Returns the shape id of the object in the list.

Properties

Name | Description
IncludeCopies | If this property is true, all shape ids from the copies made will be stored in the Copies property.
Count | Number of objects in the list.
this[] | Returns position i in the list.


TExcelObjectList.TExcelObjectList Constructor | FlexCel Studio for the .NET Framework documentation

TExcelObjectList.TExcelObjectList Constructor

Overloads

  • TExcelObjectList.TExcelObjectList
  • TExcelObjectList.TExcelObjectList(Boolean)

TExcelObjectList.TExcelObjectList

Creates a new instance. IncludeCopies is false.

Syntax

Namespace: FlexCel.Core

public TExcelObjectList()

See also

  • TExcelObjectList

TExcelObjectList.TExcelObjectList(Boolean)

Creates a new TObjectList instance.

Syntax

Namespace: FlexCel.Core

public TExcelObjectList(Boolean includeCopies)

Parameters

<-> | Parameter | Type | Description
 | includeCopies | Boolean | If true, all shape ids of copied shapes will be included in the Copies property.

See also

  • TExcelObjectList


TExcelObjectList.ShapeId Method | FlexCel Studio for the .NET Framework documentation

TExcelObjectList.ShapeId Method

Returns the shape id of the object in the list.

Syntax

Namespace: FlexCel.Core

public Int64 ShapeId(Int32 index)

Parameters

<-> | Parameter | Type | Description
 | index | Int32 |

See also

  • TExcelObjectList


TExcelObjectList.IncludeCopies Property | FlexCel Studio for the .NET Framework documentation

TExcelObjectList.IncludeCopies Property

If this property is true, all shape ids from the copies made will be stored in the Copies property.

Syntax

Namespace: FlexCel.Core

public Boolean IncludeCopies { get; }

See also

  • TExcelObjectList


TExcelObjectList.Count Property | FlexCel Studio for the .NET Framework documentation

TExcelObjectList.Count Property

Number of objects in the list.

Syntax

Namespace: FlexCel.Core

public Int32 Count { get; }

See also

  • TExcelObjectList


TExcelObjectList.this[] Property | FlexCel Studio for the .NET Framework documentation

TExcelObjectList.this[] Property

Returns position i in the list.

Syntax

Namespace: FlexCel.Core

public Int32 this[] { get; }

See also

  • TExcelObjectList


TExcelRectangularGradient Class | FlexCel Studio for the .NET Framework documentation

TExcelRectangularGradient Class

A rectangular gradient used for filling a background.

Syntax

Namespace: FlexCel.Core

public class TExcelRectangularGradient: TExcelGradient

Constructors

Name | Description
TExcelRectangular​Gradient | Overloaded TExcelRectangularGradient TExcelRectangularGradient(TGradientStop[], Double, Double, Double, Double)

Methods

Name | Description
Equals | Returns true if both classes contain the same gradient.
GetHashCode | Returns the hashcode for this object.

Properties

Name | Description
Top | Top coordinate for the gradient. This value must be between 0 and 1, and specifies in percent where the first color of the gradient will be placed.
Left | Left coordinate for the gradient. This value must be between 0 and 1, and specifies in percent where the first color of the gradient will be placed.
Bottom | Bottom coordinate for the gradient. This value must be between 0 and 1, and specifies in percent where the last color of the gradient will be placed.
Right | Right coordinate for the gradient. This value must be between 0 and 1, and specifies in percent where the last color of the gradient will be placed.


TExcelRectangularGradient.TExcelRectangularGradient Constructor | FlexCel Studio for the .NET Framework documentation

TExcelRectangularGradient.TExcelRectangularGradient Constructor

Overloads

  • TExcelRectangularGradient.TExcelRectangularGradient
  • TExcelRectangularGradient.TExcelRectangularGradient(TGradientStop[], Double, Double, Double, Double)

TExcelRectangularGradient.TExcelRectangularGradient

Creates a new TExcelRectangularGradient class.

Syntax

Namespace: FlexCel.Core

public TExcelRectangularGradient()

See also

  • TExcelRectangularGradient

TExcelRectangularGradient.TExcelRectangularGradient(TGradientStop[], Double, Double, Double, Double)

Creates a new rectangular gradient.

Syntax

Namespace: FlexCel.Core

public TExcelRectangularGradient(TGradientStop[] aStops, Double aTop, Double aLeft, Double aBottom, Double aRight)

Parameters

<-> | Parameter | Type | Description
 | aStops | TGradientStop[] | Gradient stops.
 | aTop | Double | Top coordinate for the gradient. This value must be between 0 and 1, and specifies in percent where the first color of the gradient will be placed.
 | aLeft | Double | Left coordinate for the gradient. This value must be between 0 and 1, and specifies in percent where the first color of the gradient will be placed.
 | aBottom | Double | Bottom coordinate for the gradient. This value must be between 0 and 1, and specifies in percent where the last color of the gradient will be placed.
 | aRight | Double | Right coordinate for the gradient. This value must be between 0 and 1, and specifies in percent where the last color of the gradient will be placed.

See also

  • TExcelRectangularGradient


TExcelRectangularGradient.Equals Method | FlexCel Studio for the .NET Framework documentation

TExcelRectangularGradient.Equals Method

Returns true if both classes contain the same gradient.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TExcelRectangularGradient


TExcelRectangularGradient.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TExcelRectangularGradient.GetHashCode Method

Returns the hashcode for this object.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TExcelRectangularGradient


TExcelRectangularGradient.Top Property | FlexCel Studio for the .NET Framework documentation

TExcelRectangularGradient.Top Property

Top coordinate for the gradient. This value must be between 0 and 1, and specifies in percent where the first color of the gradient will be placed.

Syntax

Namespace: FlexCel.Core

public Double Top { get; set; }

See also

  • TExcelRectangularGradient


TExcelRectangularGradient.Left Property | FlexCel Studio for the .NET Framework documentation

TExcelRectangularGradient.Left Property

Left coordinate for the gradient. This value must be between 0 and 1, and specifies in percent where the first color of the gradient will be placed.

Syntax

Namespace: FlexCel.Core

public Double Left { get; set; }

See also

  • TExcelRectangularGradient


TExcelRectangularGradient.Bottom Property | FlexCel Studio for the .NET Framework documentation

TExcelRectangularGradient.Bottom Property

Bottom coordinate for the gradient. This value must be between 0 and 1, and specifies in percent where the last color of the gradient will be placed.

Syntax

Namespace: FlexCel.Core

public Double Bottom { get; set; }

See also

  • TExcelRectangularGradient


TExcelRectangularGradient.Right Property | FlexCel Studio for the .NET Framework documentation

TExcelRectangularGradient.Right Property

Right coordinate for the gradient. This value must be between 0 and 1, and specifies in percent where the last color of the gradient will be placed.

Syntax

Namespace: FlexCel.Core

public Double Right { get; set; }

See also

  • TExcelRectangularGradient


TExcelTypes Class | FlexCel Studio for the .NET Framework documentation

TExcelTypes Class

Manages converting from/to objects/Native excel types.

Syntax

Namespace: FlexCel.Core

public static class TExcelTypes

Methods

Name | Description
ObjectToCellType | Converts an object on a CellType representation.
ConvertToAllowed​Object | Converts an object to a native Excel datatype, that is: Number, String, Null, bool or Error.
SameByteArray | Returns true if both arrays contains same data. Handles null arrays.


TExcelTypes.ObjectToCellType Method | FlexCel Studio for the .NET Framework documentation

TExcelTypes.ObjectToCellType Method

Converts an object on a CellType representation.

Syntax

Namespace: FlexCel.Core

public static TCellType ObjectToCellType(Object o)

Parameters

<-> | Parameter | Type | Description
 | o | Object | Object with the value.

Returns

Cell Type

See also

  • TExcelTypes


TExcelTypes.ConvertToAllowedObject Method | FlexCel Studio for the .NET Framework documentation

TExcelTypes.ConvertToAllowedObject Method

Converts an object to a native Excel datatype, that is: Number, String, Null, bool or Error.

Syntax

Namespace: FlexCel.Core

public static Object ConvertToAllowedObject(Object o, Boolean Dates1904)

Parameters

<-> | Parameter | Type | Description
 | o | Object | Object to convert.
 | Dates1904 | Boolean | True if using 1904 as start date. Excel for windows normally uses 1900.

See also

  • TExcelTypes


TExcelTypes.SameByteArray Method | FlexCel Studio for the .NET Framework documentation

TExcelTypes.SameByteArray Method

Returns true if both arrays contains same data. Handles null arrays.

Syntax

Namespace: FlexCel.Core

public static Boolean SameByteArray(Byte[] a1, Byte[] a2)

Parameters

<-> | Parameter | Type | Description
 | a1 | Byte[] |
 | a2 | Byte[] |

See also

  • TExcelTypes


TFillOverlayEffect Class | FlexCel Studio for the .NET Framework documentation

TFillOverlayEffect Class

A fill overlay effect.

Syntax

Namespace: FlexCel.Core

public class TFillOverlayEffect: TDrawingEffect, IComparable, IComparable<TFillOverlayEffect>

Constructors

Name | Description
TFillOverlayEffect | Creates a new fill overlay effect.

Methods

Name | Description
Clone | Returns a deep copy of the object.
CompareTo | Overloaded CompareTo(Object) CompareTo(TFillOverlayEffect)
Equals | Overloaded Equals(TFillOverlayEffect) Equals(Object)
GetHashCode | Returns the hashcode of the object.

Properties

Name | Description
Fill | Fill used to overlay.
Blend | How the fill blends with the image.


TFillOverlayEffect.TFillOverlayEffect Constructor | FlexCel Studio for the .NET Framework documentation

TFillOverlayEffect.TFillOverlayEffect Constructor

Creates a new fill overlay effect.

Syntax

Namespace: FlexCel.Core

public TFillOverlayEffect(TFillStyle aFill, TOverlayBlendMode aBlend)

Parameters

<-> | Parameter | Type | Description
 | aFill | TFillStyle | Fill used to overlay.
 | aBlend | TOverlayBlendMode | How the fill blends with the image.

See also

  • TFillOverlayEffect


TFillOverlayEffect.Clone Method | FlexCel Studio for the .NET Framework documentation

TFillOverlayEffect.Clone Method

Returns a deep copy of the object.

Syntax

Namespace: FlexCel.Core

public TFillOverlayEffect Clone()

See also

  • TFillOverlayEffect


TFillOverlayEffect.CompareTo Method | FlexCel Studio for the .NET Framework documentation

TFillOverlayEffect.CompareTo Method

Overloads

  • TFillOverlayEffect.CompareTo(Object)
  • TFillOverlayEffect.CompareTo(TFillOverlayEffect)

TFillOverlayEffect.CompareTo(Object)

Returns -1, 0 or 1 depending if this object is smaller or bigger than the other.

Syntax

Namespace: FlexCel.Core

public Int32 CompareTo(Object other)

Parameters

<-> | Parameter | Type | Description
 | other | Object |

See also

  • TFillOverlayEffect

TFillOverlayEffect.CompareTo(TFillOverlayEffect)

Returns -1, 0 or 1 depending if this object is smaller or bigger than the other.

Syntax

Namespace: FlexCel.Core

public Int32 CompareTo(TFillOverlayEffect other)

Parameters

<-> | Parameter | Type | Description
 | other | TFillOverlayEffect |

See also

  • TFillOverlayEffect


TFillOverlayEffect.Equals Method | FlexCel Studio for the .NET Framework documentation

TFillOverlayEffect.Equals Method

Overloads

  • TFillOverlayEffect.Equals(TFillOverlayEffect)
  • TFillOverlayEffect.Equals(Object)

TFillOverlayEffect.Equals(TFillOverlayEffect)

Returns true if both objects are the same.

Syntax

Namespace: FlexCel.Core

protected Boolean Equals(TFillOverlayEffect other)

Parameters

<-> | Parameter | Type | Description
 | other | TFillOverlayEffect |

See also

  • TFillOverlayEffect

TFillOverlayEffect.Equals(Object)

Returns true if both objects are the same.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object other)

Parameters

<-> | Parameter | Type | Description
 | other | Object |

See also

  • TFillOverlayEffect


TFillOverlayEffect.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TFillOverlayEffect.GetHashCode Method

Returns the hashcode of the object.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TFillOverlayEffect


TFillOverlayEffect.Fill Property | FlexCel Studio for the .NET Framework documentation

TFillOverlayEffect.Fill Property

Fill used to overlay.

Syntax

Namespace: FlexCel.Core

public TFillStyle Fill { get; }

See also

  • TFillOverlayEffect


TFillOverlayEffect.Blend Property | FlexCel Studio for the .NET Framework documentation

TFillOverlayEffect.Blend Property

How the fill blends with the image.

Syntax

Namespace: FlexCel.Core

public TOverlayBlendMode Blend { get; }

See also

  • TFillOverlayEffect


TFillStyle Class | FlexCel Studio for the .NET Framework documentation

TFillStyle Class

Base definition for a Drawing fill style. This class is abstract, and you should use its descendants like TSolidFill or TGradientFill

Syntax

Namespace: FlexCel.Core

public abstract class TFillStyle: IComparable

Constructors

Name | Description
TFillStyle | Initializes the fill style.

Methods

Name | Description
Clone | Returns a deep copy of the fill style.
Equals | Returns true if this instance has the same data as the object obj.
CompareTo | Returns -1 if obj is bigger than this, 0 if both objects are the same, and 1 if obj is smaller than this.
GetHashCode | Returns the hashcode for this object

Properties

Name | Description
FillStyleType | Stores which kind of fill style is used.


TFillStyle.TFillStyle Constructor | FlexCel Studio for the .NET Framework documentation

TFillStyle.TFillStyle Constructor

Initializes the fill style.

Syntax

Namespace: FlexCel.Core

protected TFillStyle(TFillStyleType aFillStyleType)

Parameters

<-> | Parameter | Type | Description
 | aFillStyleType | TFillStyleType |

See also

  • TFillStyle


TFillStyle.Clone Method | FlexCel Studio for the .NET Framework documentation

TFillStyle.Clone Method

Returns a deep copy of the fill style.

Syntax

Namespace: FlexCel.Core

public virtual TFillStyle Clone()

See also

  • TFillStyle


TFillStyle.Equals Method | FlexCel Studio for the .NET Framework documentation

TFillStyle.Equals Method

Returns true if this instance has the same data as the object obj.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TFillStyle


TFillStyle.CompareTo Method | FlexCel Studio for the .NET Framework documentation

TFillStyle.CompareTo Method

Returns -1 if obj is bigger than this, 0 if both objects are the same, and 1 if obj is smaller than this.

Syntax

Namespace: FlexCel.Core

public virtual Int32 CompareTo(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TFillStyle


TFillStyle.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TFillStyle.GetHashCode Method

Returns the hashcode for this object

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TFillStyle


TFillStyle.FillStyleType Property | FlexCel Studio for the .NET Framework documentation

TFillStyle.FillStyleType Property

Stores which kind of fill style is used.

Syntax

Namespace: FlexCel.Core

public TFillStyleType FillStyleType { get; }

See also

  • TFillStyle


TFillStyleList Class | FlexCel Studio for the .NET Framework documentation

TFillStyleList Class

Represents the fill style characteristics for an autoshape.

Syntax

Namespace: FlexCel.Core

public class TFillStyleList

Constructors

Name | Description
TFillStyleList | Creates a new TFillStyleList instance.

Methods

Name | Description
Clone | Creates a deep copy of this object.
Add | Adds a new FillStyle to the collection. Fill styles must be added in order, first is "Subtle", second is "Moderate", third is "Intense" and there could be new definitions in newer versions of Excel.
GetRealFillStyle | Returns the fill style that results from applying the formatting type to a color.
Clear | Clears all the formatting definitions.

Properties

Name | Description
this[] | Returns the fill style for a given formatting type. Currently Excel defines only 3 formatting types, but more could be added in the future. If you need to access a formatting type that is not defined in the TFormattingType enumeration, just cast an integer to TFormattingType.
Count | Returns the number of elements stored in this collection.


TFillStyleList.TFillStyleList Constructor | FlexCel Studio for the .NET Framework documentation

TFillStyleList.TFillStyleList Constructor

Creates a new TFillStyleList instance.

Syntax

Namespace: FlexCel.Core

public TFillStyleList()

See also

  • TFillStyleList


TFillStyleList.Clone Method | FlexCel Studio for the .NET Framework documentation

TFillStyleList.Clone Method

Creates a deep copy of this object.

Syntax

Namespace: FlexCel.Core

public TFillStyleList Clone()

See also

  • TFillStyleList


TFillStyleList.Add Method | FlexCel Studio for the .NET Framework documentation

TFillStyleList.Add Method

Adds a new FillStyle to the collection. Fill styles must be added in order, first is "Subtle", second is "Moderate", third is "Intense" and there could be new definitions in newer versions of Excel.

Syntax

Namespace: FlexCel.Core

public void Add(TFillStyle aFill)

Parameters

<-> | Parameter | Type | Description
 | aFill | TFillStyle | Fill style to add.

See also

  • TFillStyleList


TFillStyleList.GetRealFillStyle Method | FlexCel Studio for the .NET Framework documentation

TFillStyleList.GetRealFillStyle Method

Returns the fill style that results from applying the formatting type to a color.

Syntax

Namespace: FlexCel.Core

public TFillStyle GetRealFillStyle(TFormattingType index, TDrawingColor basicColor)

Parameters

<-> | Parameter | Type | Description
 | index | TFormattingType | Index to the collection.
 | basicColor | TDrawingColor | Color that will be used as a base to calculate the fill style.

See also

  • TFillStyleList


TFillStyleList.Clear Method | FlexCel Studio for the .NET Framework documentation

TFillStyleList.Clear Method

Clears all the formatting definitions.

Syntax

Namespace: FlexCel.Core

public void Clear()

See also

  • TFillStyleList


TFillStyleList.this[] Property | FlexCel Studio for the .NET Framework documentation

TFillStyleList.this[] Property

Returns the fill style for a given formatting type. Currently Excel defines only 3 formatting types, but more could be added in the future. If you need to access a formatting type that is not defined in the TFormattingType enumeration, just cast an integer to TFormattingType.

Syntax

Namespace: FlexCel.Core

public TFillStyle this[] { get; set; }

See also

  • TFillStyleList


TFillStyleList.Count Property | FlexCel Studio for the .NET Framework documentation

TFillStyleList.Count Property

Returns the number of elements stored in this collection.

Syntax

Namespace: FlexCel.Core

public Int32 Count { get; }

See also

  • TFillStyleList


TFlexCelErrorInfo Class | FlexCel Studio for the .NET Framework documentation

TFlexCelErrorInfo Class

This class contains generic information about a non fatal error that happened in FlexCel. Children classes might contain more information specific to the error type.

Syntax

Namespace: FlexCel.Core

public abstract class TFlexCelErrorInfo

Constructors

Name | Description
TFlexCelErrorInfo | Creates a new TFlexCelErrorInfo class.

Properties

Name | Description
Error | Error type that this class is holding.
Message | Error message with detailed information on what happened.


TFlexCelErrorInfo.TFlexCelErrorInfo Constructor | FlexCel Studio for the .NET Framework documentation

TFlexCelErrorInfo.TFlexCelErrorInfo Constructor

Creates a new TFlexCelErrorInfo class.

Syntax

Namespace: FlexCel.Core

protected TFlexCelErrorInfo(FlexCelError aError, String aMessage)

Parameters

<-> | Parameter | Type | Description
 | aError | FlexCelError | Parameter indicating the type of error that happened.
 | aMessage | String | String detailing the error that happened.

See also

  • TFlexCelErrorInfo


TFlexCelErrorInfo.Error Property | FlexCel Studio for the .NET Framework documentation

TFlexCelErrorInfo.Error Property

Error type that this class is holding.

Syntax

Namespace: FlexCel.Core

public FlexCelError Error { get; }

See also

  • TFlexCelErrorInfo


TFlexCelErrorInfo.Message Property | FlexCel Studio for the .NET Framework documentation

TFlexCelErrorInfo.Message Property

Error message with detailed information on what happened.

Syntax

Namespace: FlexCel.Core

public String Message { get; }

See also

  • TFlexCelErrorInfo


TFlxApplyBorders Class | FlexCel Studio for the .NET Framework documentation

TFlxApplyBorders Class

Border style for a cell.

Syntax

Namespace: FlexCel.Core

public class TFlxApplyBorders: ICloneable

Constructors

Name | Description
TFlxApplyBorders | Overloaded TFlxApplyBorders TFlxApplyBorders(Boolean)

Methods

Name | Description
SetAllMembers | Sets all members to true or false
Apply | This method will modify existingFormat with the properties from newFormat that are specified on this class
Clone | Returns a deep copy of the border.
Equals | Returns true if both members are the same.
GetHashCode | Returns the hash code of the object.

Properties

Name | Description
Left | Left border.
Right | Right border.
Top | Top border.
Bottom | Bottom border.
Diagonal | Diagonal border.
DiagonalStyle | When defined, there will be one or two diagonal lines across the cell.
IsEmpty | Returns true if the format does not apply any setting.


TFlxApplyBorders.TFlxApplyBorders Constructor | FlexCel Studio for the .NET Framework documentation

TFlxApplyBorders.TFlxApplyBorders Constructor

Overloads

  • TFlxApplyBorders.TFlxApplyBorders
  • TFlxApplyBorders.TFlxApplyBorders(Boolean)

TFlxApplyBorders.TFlxApplyBorders

Creates the class setting all members to false.

Syntax

Namespace: FlexCel.Core

public TFlxApplyBorders()

See also

  • TFlxApplyBorders

TFlxApplyBorders.TFlxApplyBorders(Boolean)

Creates the class setting all members to true or false.

Syntax

Namespace: FlexCel.Core

public TFlxApplyBorders(Boolean AllTrue)

Parameters

<-> | Parameter | Type | Description
 | AllTrue | Boolean | If true all members will be set to true.

See also

  • TFlxApplyBorders


TFlxApplyBorders.SetAllMembers Method | FlexCel Studio for the .NET Framework documentation

TFlxApplyBorders.SetAllMembers Method

Sets all members to true or false

Syntax

Namespace: FlexCel.Core

public void SetAllMembers(Boolean Value)

Parameters

<-> | Parameter | Type | Description
 | Value | Boolean |

See also

  • TFlxApplyBorders


TFlxApplyBorders.Apply Method | FlexCel Studio for the .NET Framework documentation

TFlxApplyBorders.Apply Method

This method will modify existingFormat with the properties from newFormat that are specified on this class

Syntax

Namespace: FlexCel.Core

public Boolean Apply(TFlxBorders existingFormat, TFlxBorders newFormat)

Parameters

<-> | Parameter | Type | Description
 | existingFormat | TFlxBorders | Existing format that will be updated with the properties of newFormat specified.
 | newFormat | TFlxBorders | New format to apply

Returns

True if there was any change on existingFormat, false otherwise.

See also

  • TFlxApplyBorders


TFlxApplyBorders.Clone Method | FlexCel Studio for the .NET Framework documentation

TFlxApplyBorders.Clone Method

Returns a deep copy of the border.

Syntax

Namespace: FlexCel.Core

public Object Clone()

See also

  • TFlxApplyBorders


TFlxApplyBorders.Equals Method | FlexCel Studio for the .NET Framework documentation

TFlxApplyBorders.Equals Method

Returns true if both members are the same.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TFlxApplyBorders


TFlxApplyBorders.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TFlxApplyBorders.GetHashCode Method

Returns the hash code of the object.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TFlxApplyBorders


TFlxApplyBorders.Left Property | FlexCel Studio for the .NET Framework documentation

TFlxApplyBorders.Left Property

Left border.

Syntax

Namespace: FlexCel.Core

public Boolean Left { get; set; }

See also

  • TFlxApplyBorders


TFlxApplyBorders.Right Property | FlexCel Studio for the .NET Framework documentation

TFlxApplyBorders.Right Property

Right border.

Syntax

Namespace: FlexCel.Core

public Boolean Right { get; set; }

See also

  • TFlxApplyBorders


TFlxApplyBorders.Top Property | FlexCel Studio for the .NET Framework documentation

TFlxApplyBorders.Top Property

Top border.

Syntax

Namespace: FlexCel.Core

public Boolean Top { get; set; }

See also

  • TFlxApplyBorders


TFlxApplyBorders.Bottom Property | FlexCel Studio for the .NET Framework documentation

TFlxApplyBorders.Bottom Property

Bottom border.

Syntax

Namespace: FlexCel.Core

public Boolean Bottom { get; set; }

See also

  • TFlxApplyBorders


TFlxApplyBorders.Diagonal Property | FlexCel Studio for the .NET Framework documentation

TFlxApplyBorders.Diagonal Property

Diagonal border.

Syntax

Namespace: FlexCel.Core

public Boolean Diagonal { get; set; }

See also

  • TFlxApplyBorders


TFlxApplyBorders.DiagonalStyle Property | FlexCel Studio for the .NET Framework documentation

TFlxApplyBorders.DiagonalStyle Property

When defined, there will be one or two diagonal lines across the cell.

Syntax

Namespace: FlexCel.Core

public Boolean DiagonalStyle { get; set; }

See also

  • TFlxApplyBorders


TFlxApplyBorders.IsEmpty Property | FlexCel Studio for the .NET Framework documentation

TFlxApplyBorders.IsEmpty Property

Returns true if the format does not apply any setting.

Syntax

Namespace: FlexCel.Core

public Boolean IsEmpty { get; }

See also

  • TFlxApplyBorders


TFlxApplyFont Class | FlexCel Studio for the .NET Framework documentation

TFlxApplyFont Class

Encapsulation of an Excel Font.

Syntax

Namespace: FlexCel.Core

public class TFlxApplyFont: ICloneable

Methods

Name | Description
SetAllMembers | Sets all members to true or false
Apply | This method will modify existingFormat with the properties from newFormat that are specified on this class
Clone | Returns a deep copy of the font.
Equals | Returns true if both objects are the same.
GetHashCode | Returns the hash code of the object.
HasStyleStrikeout | Returns true if this struct applies a strikeout. This is the same as checking if StyleEx contains Strikeout.

Properties

Name | Description
Name | Font name. (For example, "Arial")
Size20 | Height of the font (in units of 1/20th of a point). A Size20=200 means 10 points.
Color | Color of the font.
Style | Style of the font, such as bold or italics. Underline is a different option. Note that when true this applies the full style, and sets all values of StyleEx to true. StyleEx can be used for more fine control over what styles are applied.
StyleEx | Allows to control which styles are applied one by one, different from Style which applies all the styles at once. Setting Style will change all the StyleEx at once.
Underline | Underline type.
Family | Font family, (see Windows API LOGFONT structure).
CharSet | Character set. (see Windows API LOGFONT structure)
Scheme | Scheme of the font, when using themes. (Excel 2007).
IsEmpty | Returns true if the format definition does not apply any setting.


TFlxApplyFont.SetAllMembers Method | FlexCel Studio for the .NET Framework documentation

TFlxApplyFont.SetAllMembers Method

Sets all members to true or false

Syntax

Namespace: FlexCel.Core

public void SetAllMembers(Boolean Value)

Parameters

<-> | Parameter | Type | Description
 | Value | Boolean |

See also

  • TFlxApplyFont


TFlxApplyFont.Apply Method | FlexCel Studio for the .NET Framework documentation

TFlxApplyFont.Apply Method

This method will modify existingFormat with the properties from newFormat that are specified on this class

Syntax

Namespace: FlexCel.Core

public Boolean Apply(TFlxFont existingFormat, TFlxFont newFormat)

Parameters

<-> | Parameter | Type | Description
 | existingFormat | TFlxFont | Existing format that will be updated with the properties of newFormat specified.
 | newFormat | TFlxFont | New format to apply

Returns

True if there was any change on existingFormat, false otherwise.

See also

  • TFlxApplyFont


TFlxApplyFont.Clone Method | FlexCel Studio for the .NET Framework documentation

TFlxApplyFont.Clone Method

Returns a deep copy of the font.

Syntax

Namespace: FlexCel.Core

public Object Clone()

See also

  • TFlxApplyFont


TFlxApplyFont.Equals Method | FlexCel Studio for the .NET Framework documentation

TFlxApplyFont.Equals Method

Returns true if both objects are the same.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TFlxApplyFont


TFlxApplyFont.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TFlxApplyFont.GetHashCode Method

Returns the hash code of the object.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TFlxApplyFont


TFlxApplyFont.HasStyleStrikeout Method | FlexCel Studio for the .NET Framework documentation

TFlxApplyFont.HasStyleStrikeout Method

Returns true if this struct applies a strikeout. This is the same as checking if StyleEx contains Strikeout.

Syntax

Namespace: FlexCel.Core

public Boolean HasStyleStrikeout()

See also

  • TFlxApplyFont


TFlxApplyFont.Name Property | FlexCel Studio for the .NET Framework documentation

TFlxApplyFont.Name Property

Font name. (For example, "Arial")

Syntax

Namespace: FlexCel.Core

public Boolean Name { get; set; }

See also

  • TFlxApplyFont


TFlxApplyFont.Size20 Property | FlexCel Studio for the .NET Framework documentation

TFlxApplyFont.Size20 Property

Height of the font (in units of 1/20th of a point). A Size20=200 means 10 points.

Syntax

Namespace: FlexCel.Core

public Boolean Size20 { get; set; }

See also

  • TFlxApplyFont


TFlxApplyFont.Color Property | FlexCel Studio for the .NET Framework documentation

TFlxApplyFont.Color Property

Color of the font.

Syntax

Namespace: FlexCel.Core

public Boolean Color { get; set; }

See also

  • TFlxApplyFont


TFlxApplyFont.Style Property | FlexCel Studio for the .NET Framework documentation

TFlxApplyFont.Style Property

Style of the font, such as bold or italics. Underline is a different option. Note that when true this applies the full style, and sets all values of StyleEx to true. StyleEx can be used for more fine control over what styles are applied.

Syntax

Namespace: FlexCel.Core

public Boolean Style { get; set; }

See also

  • TFlxApplyFont


TFlxApplyFont.StyleEx Property | FlexCel Studio for the .NET Framework documentation

TFlxApplyFont.StyleEx Property

Allows to control which styles are applied one by one, different from Style which applies all the styles at once. Setting Style will change all the StyleEx at once.

Syntax

Namespace: FlexCel.Core

public TFlxFontStyles StyleEx { get; set; }

See also

  • TFlxApplyFont


TFlxApplyFont.Underline Property | FlexCel Studio for the .NET Framework documentation

TFlxApplyFont.Underline Property

Underline type.

Syntax

Namespace: FlexCel.Core

public Boolean Underline { get; set; }

See also

  • TFlxApplyFont


TFlxApplyFont.Family Property | FlexCel Studio for the .NET Framework documentation

TFlxApplyFont.Family Property

Font family, (see Windows API LOGFONT structure).

Syntax

Namespace: FlexCel.Core

public Boolean Family { get; set; }

See also

  • TFlxApplyFont


TFlxApplyFont.CharSet Property | FlexCel Studio for the .NET Framework documentation

TFlxApplyFont.CharSet Property

Character set. (see Windows API LOGFONT structure)

Syntax

Namespace: FlexCel.Core

public Boolean CharSet { get; set; }

See also

  • TFlxApplyFont


TFlxApplyFont.Scheme Property | FlexCel Studio for the .NET Framework documentation

TFlxApplyFont.Scheme Property

Scheme of the font, when using themes. (Excel 2007).

Syntax

Namespace: FlexCel.Core

public Boolean Scheme { get; set; }

See also

  • TFlxApplyFont


TFlxApplyFont.IsEmpty Property | FlexCel Studio for the .NET Framework documentation

TFlxApplyFont.IsEmpty Property

Returns true if the format definition does not apply any setting.

Syntax

Namespace: FlexCel.Core

public Boolean IsEmpty { get; }

See also

  • TFlxApplyFont


TFlxApplyFormat Class | FlexCel Studio for the .NET Framework documentation

TFlxApplyFormat Class

Defines which attributes of a TFlxFormat will be applied for one cell. Whatever member is set to false, it will not apply this member property to the cell.

Syntax

Namespace: FlexCel.Core

public class TFlxApplyFormat: ICloneable

Fields

Name | Description
FillPattern | Fill pattern.

Constructors

Name | Description
TFlxApplyFormat | Creates an empty Format class.

Methods

Name | Description
SetAllMembers | Sets all members to true or false
Apply | This method will modify existingFormat with the properties from newFormat that are specified on this class
Clone | Returns a deep copy of the format.

Properties

Name | Description
Font | Cell Font.
Borders | Cell borders.
Format | Format string. (For example, "yyyy-mm-dd" for a date format, or "#.00" for a numeric 2 decimal format) This format string is the same you use in Excel under "Custom" format when formatting a cell, and it is documented in Excel documentation. Under "Finding out what format string to use in TFlxFormat.Format" section in UsingFlexCelAPI.pdf you can find more detailed information on how to create this string.
HAlignment | Horizontal align on the cell.
VAlignment | Vertical align on the cell.
Locked | Cell is locked.
Hidden | Cell is Hidden.
ParentStyle | Parent style. This is the parent style name and all the properties that are linked to it.
WrapText | Cell wrap.
ShrinkToFit | Shrink to fit.
Rotation | Text Rotation in degrees. When this value is from 0 to 90 then this is the rotation degrees in the up direction. When this value is from 91 to 180 then this is a rotation in the down direction. 91 means -1 degree rotation, 92 means -2 degrees, and so on until 180 which means -90 degrees. 255 is vertical text. Other values are invalid.
Indent | Indent value. (on characters)
ReadingOrder | Reading order.
Lotus123Prefix | Lotus 123 compatibility prefixes.
IsEmpty | Returns true if the format does not apply any setting.
HasOnlyBorders | Returns true if the format definition contains only borders.


TFlxApplyFormat.FillPattern Field | FlexCel Studio for the .NET Framework documentation

TFlxApplyFormat.FillPattern Field

Fill pattern.

Syntax

Namespace: FlexCel.Core

public TFlxApplyFillPattern FillPattern

See also

  • TFlxApplyFormat


TFlxApplyFormat.TFlxApplyFormat Constructor | FlexCel Studio for the .NET Framework documentation

TFlxApplyFormat.TFlxApplyFormat Constructor

Creates an empty Format class.

Syntax

Namespace: FlexCel.Core

public TFlxApplyFormat()

See also

  • TFlxApplyFormat


TFlxApplyFormat.SetAllMembers Method | FlexCel Studio for the .NET Framework documentation

TFlxApplyFormat.SetAllMembers Method

Sets all members to true or false

Syntax

Namespace: FlexCel.Core

public void SetAllMembers(Boolean Value)

Parameters

<-> | Parameter | Type | Description
 | Value | Boolean |

See also

  • TFlxApplyFormat


TFlxApplyFormat.Apply Method | FlexCel Studio for the .NET Framework documentation

TFlxApplyFormat.Apply Method

This method will modify existingFormat with the properties from newFormat that are specified on this class

Syntax

Namespace: FlexCel.Core

public Boolean Apply(TFlxFormat existingFormat, TFlxFormat newFormat)

Parameters

<-> | Parameter | Type | Description
 | existingFormat | TFlxFormat | Existing format that will be updated with the properties of newFormat specified.
 | newFormat | TFlxFormat | New format to apply

Returns

True if there was any change on existingFormat, false otherwise.

See also

  • TFlxApplyFormat


TFlxApplyFormat.Clone Method | FlexCel Studio for the .NET Framework documentation

TFlxApplyFormat.Clone Method

Returns a deep copy of the format.

Syntax

Namespace: FlexCel.Core

public Object Clone()

See also

  • TFlxApplyFormat


TFlxApplyFormat.Font Property | FlexCel Studio for the .NET Framework documentation

TFlxApplyFormat.Font Property

Cell Font.

Syntax

Namespace: FlexCel.Core

public TFlxApplyFont Font { get; }

See also

  • TFlxApplyFormat


TFlxApplyFormat.Borders Property | FlexCel Studio for the .NET Framework documentation

TFlxApplyFormat.Borders Property

Cell borders.

Syntax

Namespace: FlexCel.Core

public TFlxApplyBorders Borders { get; }

See also

  • TFlxApplyFormat


TFlxApplyFormat.Format Property | FlexCel Studio for the .NET Framework documentation

TFlxApplyFormat.Format Property

Format string. (For example, "yyyy-mm-dd" for a date format, or "#.00" for a numeric 2 decimal format) This format string is the same you use in Excel under "Custom" format when formatting a cell, and it is documented in Excel documentation. Under "Finding out what format string to use in TFlxFormat.Format" section in UsingFlexCelAPI.pdf you can find more detailed information on how to create this string.

Syntax

Namespace: FlexCel.Core

public Boolean Format { get; set; }

See also

  • TFlxApplyFormat


TFlxApplyFormat.HAlignment Property | FlexCel Studio for the .NET Framework documentation

TFlxApplyFormat.HAlignment Property

Horizontal align on the cell.

Syntax

Namespace: FlexCel.Core

public Boolean HAlignment { get; set; }

See also

  • TFlxApplyFormat


TFlxApplyFormat.VAlignment Property | FlexCel Studio for the .NET Framework documentation

TFlxApplyFormat.VAlignment Property

Vertical align on the cell.

Syntax

Namespace: FlexCel.Core

public Boolean VAlignment { get; set; }

See also

  • TFlxApplyFormat


TFlxApplyFormat.Locked Property | FlexCel Studio for the .NET Framework documentation

TFlxApplyFormat.Locked Property

Cell is locked.

Syntax

Namespace: FlexCel.Core

public Boolean Locked { get; set; }

See also

  • TFlxApplyFormat


TFlxApplyFormat.Hidden Property | FlexCel Studio for the .NET Framework documentation

TFlxApplyFormat.Hidden Property

Cell is Hidden.

Syntax

Namespace: FlexCel.Core

public Boolean Hidden { get; set; }

See also

  • TFlxApplyFormat


TFlxApplyFormat.ParentStyle Property | FlexCel Studio for the .NET Framework documentation

TFlxApplyFormat.ParentStyle Property

Parent style. This is the parent style name and all the properties that are linked to it.

Syntax

Namespace: FlexCel.Core

public Boolean ParentStyle { get; set; }

See also

  • TFlxApplyFormat


TFlxApplyFormat.WrapText Property | FlexCel Studio for the .NET Framework documentation

TFlxApplyFormat.WrapText Property

Cell wrap.

Syntax

Namespace: FlexCel.Core

public Boolean WrapText { get; set; }

See also

  • TFlxApplyFormat


TFlxApplyFormat.ShrinkToFit Property | FlexCel Studio for the .NET Framework documentation

TFlxApplyFormat.ShrinkToFit Property

Shrink to fit.

Syntax

Namespace: FlexCel.Core

public Boolean ShrinkToFit { get; set; }

See also

  • TFlxApplyFormat


TFlxApplyFormat.Rotation Property | FlexCel Studio for the .NET Framework documentation

TFlxApplyFormat.Rotation Property

Text Rotation in degrees.

When this value is from 0 to 90 then this is the rotation degrees in the up direction.

When this value is from 91 to 180 then this is a rotation in the down direction. 91 means -1 degree rotation, 92 means -2 degrees, and so on until 180 which means -90 degrees.

255 is vertical text.

Other values are invalid.

Syntax

Namespace: FlexCel.Core

public Boolean Rotation { get; set; }

See also

  • TFlxApplyFormat


TFlxApplyFormat.Indent Property | FlexCel Studio for the .NET Framework documentation

TFlxApplyFormat.Indent Property

Indent value. (on characters)

Syntax

Namespace: FlexCel.Core

public Boolean Indent { get; set; }

See also

  • TFlxApplyFormat


TFlxApplyFormat.ReadingOrder Property | FlexCel Studio for the .NET Framework documentation

TFlxApplyFormat.ReadingOrder Property

Reading order.

Syntax

Namespace: FlexCel.Core

public Boolean ReadingOrder { get; set; }

See also

  • TFlxApplyFormat


TFlxApplyFormat.Lotus123Prefix Property | FlexCel Studio for the .NET Framework documentation

TFlxApplyFormat.Lotus123Prefix Property

Lotus 123 compatibility prefixes.

Syntax

Namespace: FlexCel.Core

public Boolean Lotus123Prefix { get; set; }

See also

  • TFlxApplyFormat


TFlxApplyFormat.IsEmpty Property | FlexCel Studio for the .NET Framework documentation

TFlxApplyFormat.IsEmpty Property

Returns true if the format does not apply any setting.

Syntax

Namespace: FlexCel.Core

public Boolean IsEmpty { get; }

See also

  • TFlxApplyFormat


TFlxApplyFormat.HasOnlyBorders Property | FlexCel Studio for the .NET Framework documentation

TFlxApplyFormat.HasOnlyBorders Property

Returns true if the format definition contains only borders.

Syntax

Namespace: FlexCel.Core

public Boolean HasOnlyBorders { get; }

See also

  • TFlxApplyFormat


TFlxBorders Class | FlexCel Studio for the .NET Framework documentation

TFlxBorders Class

Border style for a cell.

Syntax

Namespace: FlexCel.Core

public class TFlxBorders: ICloneable

Fields

Name | Description
Left | Left border.
Right | Right border.
Top | Top border.
Bottom | Bottom border.
Diagonal | Diagonal border.
DiagonalStyle | When defined, there will be one or two diagonal lines across the cell.

Methods

Name | Description
SetAllBorders | Sets all borders to a linestyle and color. Diagonal borders are not changed.
Clone | Returns a deep copy of the border.
Equals | Returns true if both borders are the same.
GetHashCode | Returns the hashcode for the border.


TFlxBorders.Left Field | FlexCel Studio for the .NET Framework documentation

TFlxBorders.Left Field

Left border.

Syntax

Namespace: FlexCel.Core

public TFlxOneBorder Left

See also

  • TFlxBorders


TFlxBorders.Right Field | FlexCel Studio for the .NET Framework documentation

TFlxBorders.Right Field

Right border.

Syntax

Namespace: FlexCel.Core

public TFlxOneBorder Right

See also

  • TFlxBorders


TFlxBorders.Top Field | FlexCel Studio for the .NET Framework documentation

TFlxBorders.Top Field

Top border.

Syntax

Namespace: FlexCel.Core

public TFlxOneBorder Top

See also

  • TFlxBorders


TFlxBorders.Bottom Field | FlexCel Studio for the .NET Framework documentation

TFlxBorders.Bottom Field

Bottom border.

Syntax

Namespace: FlexCel.Core

public TFlxOneBorder Bottom

See also

  • TFlxBorders


TFlxBorders.Diagonal Field | FlexCel Studio for the .NET Framework documentation

TFlxBorders.Diagonal Field

Diagonal border.

Syntax

Namespace: FlexCel.Core

public TFlxOneBorder Diagonal

See also

  • TFlxBorders


TFlxBorders.DiagonalStyle Field | FlexCel Studio for the .NET Framework documentation

TFlxBorders.DiagonalStyle Field

When defined, there will be one or two diagonal lines across the cell.

Syntax

Namespace: FlexCel.Core

public TFlxDiagonalBorder DiagonalStyle

See also

  • TFlxBorders


TFlxBorders.SetAllBorders Method | FlexCel Studio for the .NET Framework documentation

TFlxBorders.SetAllBorders Method

Sets all borders to a linestyle and color. Diagonal borders are not changed.

Syntax

Namespace: FlexCel.Core

public void SetAllBorders(TFlxBorderStyle borderStyle, TExcelColor color)

Parameters

<-> | Parameter | Type | Description
 | borderStyle | TFlxBorderStyle | Border style to apply.
 | color | TExcelColor | Color to apply

See also

  • TFlxBorders


TFlxBorders.Clone Method | FlexCel Studio for the .NET Framework documentation

TFlxBorders.Clone Method

Returns a deep copy of the border.

Syntax

Namespace: FlexCel.Core

public Object Clone()

See also

  • TFlxBorders


TFlxBorders.Equals Method | FlexCel Studio for the .NET Framework documentation

TFlxBorders.Equals Method

Returns true if both borders are the same.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TFlxBorders


TFlxBorders.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TFlxBorders.GetHashCode Method

Returns the hashcode for the border.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TFlxBorders


TFlxChartFont Class | FlexCel Studio for the .NET Framework documentation

TFlxChartFont Class

A TFlxFont with Scaling factor. Scaling factor might be different than 1 if the chart has Autosize Fonts. To get the real value of the font, you need to multiply by the factor.

Syntax

Namespace: FlexCel.Core

public class TFlxChartFont: ICloneable

Constructors

Name | Description
TFlxChartFont | Overloaded TFlxChartFont TFlxChartFont(TFlxFont) TFlxChartFont(String, Int32) TFlxChartFont(String, Int32, Boolean) TFlxChartFont(String, Int32, TExcelColor, TFlxFontStyles, TFlxUnderline, TFontScheme)

Methods

Name | Description
Clone | Return a deep copy of the copy.

Properties

Name | Description
Scale | Scale for the font. Multiply by this value to get the real size in points.
Font | Actual information for the font.
IsCalculated | If true, this font was calculated from defaults, and didn't had a real value in the file. If the font is calculated, then you shouldn't set it when setting a font.


TFlxChartFont.TFlxChartFont Constructor | FlexCel Studio for the .NET Framework documentation

TFlxChartFont.TFlxChartFont Constructor

Overloads

  • TFlxChartFont.TFlxChartFont
  • TFlxChartFont.TFlxChartFont(TFlxFont)
  • TFlxChartFont.TFlxChartFont(String, Int32)
  • TFlxChartFont.TFlxChartFont(String, Int32, Boolean)
  • TFlxChartFont.TFlxChartFont(String, Int32, TExcelColor, TFlxFontStyles, TFlxUnderline, TFontScheme)

TFlxChartFont.TFlxChartFont

Constructs a new instance.

Syntax

Namespace: FlexCel.Core

public TFlxChartFont()

See also

  • TFlxChartFont

TFlxChartFont.TFlxChartFont(TFlxFont)

Constructs a new instance.

Syntax

Namespace: FlexCel.Core

public TFlxChartFont(TFlxFont aFont)

Parameters

<-> | Parameter | Type | Description
 | aFont | TFlxFont | Font.

See also

  • TFlxChartFont

TFlxChartFont.TFlxChartFont(String, Int32)

Constructs a new instance.

Syntax

Namespace: FlexCel.Core

public TFlxChartFont(String aName, Int32 Size20)

Parameters

<-> | Parameter | Type | Description
 | aName | String | Name of the font.
 | Size20 | Int32 | Height of the font (in units of 1/20th of a point). A Size20 = 200 means 10 points.

See also

  • TFlxChartFont

TFlxChartFont.TFlxChartFont(String, Int32, Boolean)

Constructs a new instance.

Syntax

Namespace: FlexCel.Core

public TFlxChartFont(String aName, Int32 Size20, Boolean aIsCalculated)

Parameters

<-> | Parameter | Type | Description
 | aName | String | Name of the font.
 | Size20 | Int32 | Height of the font (in units of 1/20th of a point). A Size20 = 200 means 10 points.
 | aIsCalculated | Boolean | If true, this font was calculated from defaults, and didn't had a real value in the file.

See also

  • TFlxChartFont

TFlxChartFont.TFlxChartFont(String, Int32, TExcelColor, TFlxFontStyles, TFlxUnderline, TFontScheme)

Constructs a new instance.

Syntax

Namespace: FlexCel.Core

public TFlxChartFont(String aName, Int32 Size20, TExcelColor aColor, TFlxFontStyles aStyle, TFlxUnderline aUnderline, TFontScheme aScheme)

Parameters

<-> | Parameter | Type | Description
 | aName | String |
 | Size20 | Int32 |
 | aColor | TExcelColor |
 | aStyle | TFlxFontStyles |
 | aUnderline | TFlxUnderline |
 | aScheme | TFontScheme |

See also

  • TFlxChartFont


TFlxChartFont.Clone Method | FlexCel Studio for the .NET Framework documentation

TFlxChartFont.Clone Method

Return a deep copy of the copy.

Syntax

Namespace: FlexCel.Core

public Object Clone()

See also

  • TFlxChartFont


TFlxChartFont.Scale Property | FlexCel Studio for the .NET Framework documentation

TFlxChartFont.Scale Property

Scale for the font. Multiply by this value to get the real size in points.

Syntax

Namespace: FlexCel.Core

public Double Scale { get; set; }

See also

  • TFlxChartFont


TFlxChartFont.Font Property | FlexCel Studio for the .NET Framework documentation

TFlxChartFont.Font Property

Actual information for the font.

Syntax

Namespace: FlexCel.Core

public TFlxFont Font { get; set; }

See also

  • TFlxChartFont


TFlxChartFont.IsCalculated Property | FlexCel Studio for the .NET Framework documentation

TFlxChartFont.IsCalculated Property

If true, this font was calculated from defaults, and didn't had a real value in the file. If the font is calculated, then you shouldn't set it when setting a font.

Syntax

Namespace: FlexCel.Core

public Boolean IsCalculated { get; set; }

See also

  • TFlxChartFont


TFlxFont Class | FlexCel Studio for the .NET Framework documentation

TFlxFont Class

Encapsulation of an Excel Font.

Syntax

Namespace: FlexCel.Core

public class TFlxFont: ICloneable

Constructors

Name | Description
TFlxFont | Overloaded TFlxFont TFlxFont(String, Int32)

Methods

Name | Description
CopyTo | Copies this font information to other font object.
Clone | Returns a deep copy of the font.
Equals | Returns true if a font has is the same as the current.
GetHashCode | Hash code of the font.

Properties

Name | Description
Name | Font name. (For example, "Arial"). Important: When using Excel 2007, if Scheme is different from "None", the font scheme takes precedence over the name. If for example Name = "Arial" but Scheme is Major and the major font is Calibri, the font will use Calibri.
Size20 | Height of the font (in units of 1/20th of a point). A Size20 = 200 means 10 points.
Color | Color of the font.
Style | Style of the font, such as bold or italics. Underline is a different option.
Underline | Underline type.
Family | Font family, (see Windows API LOGFONT structure).
CharSet | Character set. (see Windows API LOGFONT structure)
Scheme | Font scheme. This only applies to Excel 2007. Note that this property takes over other properties like font name: If the scheme is for example "Major" and the theme has a Major font defined as calibri, then the font will be Calibri no matter if you change the font name. To manually change the font name, make sure to set Scheme = TFontScheme.None


TFlxFont.TFlxFont Constructor | FlexCel Studio for the .NET Framework documentation

TFlxFont.TFlxFont Constructor

Overloads

  • TFlxFont.TFlxFont
  • TFlxFont.TFlxFont(String, Int32)

TFlxFont.TFlxFont

Creates a font with size 10 and name "Arial".

Syntax

Namespace: FlexCel.Core

public TFlxFont()

See also

  • TFlxFont

TFlxFont.TFlxFont(String, Int32)

Creates a font with size and name.

Syntax

Namespace: FlexCel.Core

public TFlxFont(String aName, Int32 aSize20)

Parameters

<-> | Parameter | Type | Description
 | aName | String |
 | aSize20 | Int32 |

See also

  • TFlxFont


TFlxFont.CopyTo Method | FlexCel Studio for the .NET Framework documentation

TFlxFont.CopyTo Method

Copies this font information to other font object.

Syntax

Namespace: FlexCel.Core

public void CopyTo(TFlxFont Dest)

Parameters

<-> | Parameter | Type | Description
 | Dest | TFlxFont | Existing Font object where new data will be copied.

See also

  • TFlxFont


TFlxFont.Clone Method | FlexCel Studio for the .NET Framework documentation

TFlxFont.Clone Method

Returns a deep copy of the font.

Syntax

Namespace: FlexCel.Core

public Object Clone()

See also

  • TFlxFont


TFlxFont.Equals Method | FlexCel Studio for the .NET Framework documentation

TFlxFont.Equals Method

Returns true if a font has is the same as the current.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TFlxFont


TFlxFont.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TFlxFont.GetHashCode Method

Hash code of the font.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TFlxFont


TFlxFont.Name Property | FlexCel Studio for the .NET Framework documentation

TFlxFont.Name Property

Font name. (For example, "Arial"). Important: When using Excel 2007, if Scheme is different from "None", the font scheme takes precedence over the name. If for example Name = "Arial" but Scheme is Major and the major font is Calibri, the font will use Calibri.

Syntax

Namespace: FlexCel.Core

public String Name { get; set; }

See also

  • TFlxFont


TFlxFont.Size20 Property | FlexCel Studio for the .NET Framework documentation

TFlxFont.Size20 Property

Height of the font (in units of 1/20th of a point). A Size20 = 200 means 10 points.

Syntax

Namespace: FlexCel.Core

public Int32 Size20 { get; set; }

See also

  • TFlxFont


TFlxFont.Color Property | FlexCel Studio for the .NET Framework documentation

TFlxFont.Color Property

Color of the font.

Syntax

Namespace: FlexCel.Core

public TExcelColor Color { get; set; }

See also

  • TFlxFont


TFlxFont.Style Property | FlexCel Studio for the .NET Framework documentation

TFlxFont.Style Property

Style of the font, such as bold or italics. Underline is a different option.

Syntax

Namespace: FlexCel.Core

public TFlxFontStyles Style { get; set; }

See also

  • TFlxFont


TFlxFont.Underline Property | FlexCel Studio for the .NET Framework documentation

TFlxFont.Underline Property

Underline type.

Syntax

Namespace: FlexCel.Core

public TFlxUnderline Underline { get; set; }

See also

  • TFlxFont


TFlxFont.Family Property | FlexCel Studio for the .NET Framework documentation

TFlxFont.Family Property

Font family, (see Windows API LOGFONT structure).

Syntax

Namespace: FlexCel.Core

public Byte Family { get; set; }

See also

  • TFlxFont


TFlxFont.CharSet Property | FlexCel Studio for the .NET Framework documentation

TFlxFont.CharSet Property

Character set. (see Windows API LOGFONT structure)

Syntax

Namespace: FlexCel.Core

public Byte CharSet { get; set; }

See also

  • TFlxFont


TFlxFont.Scheme Property | FlexCel Studio for the .NET Framework documentation

TFlxFont.Scheme Property

Font scheme. This only applies to Excel 2007. Note that this property takes over other properties like font name: If the scheme is for example "Major" and the theme has a Major font defined as calibri, then the font will be Calibri no matter if you change the font name.

To manually change the font name, make sure to set Scheme = TFontScheme.None

Syntax

Namespace: FlexCel.Core

public TFontScheme Scheme { get; set; }

See also

  • TFlxFont


TFlxFormat Class | FlexCel Studio for the .NET Framework documentation

TFlxFormat Class

Format for one cell or named style. Cell formats are used to format cells, Named styles to create styles. A Cell format can have a parent style format, even when normally this is null (parent is normal format). Named styles will have a non-null Style property. Cell formats will have style = null.

Syntax

Namespace: FlexCel.Core

public class TFlxFormat: ICloneable

Fields

Name | Description
FillPattern | Fill pattern.
IsStyle | When true this format is a named style, when false a cell format.

Methods

Name | Description
CreateStandard2007 | Returns a standard TFlxFormat for Excel 2007. (Font name is Calibri, etc). You will normally want to use ExcelFile.​Get​Default​Format instead of this, since it returns the default format for a specific file, and not a generic format like this.
Clone | Returns a deep copy of the format.
Equals | Returns true if 2 instances have the same values.
GetHashCode | Returns the hashcode of the object.

Properties

Name | Description
Font | Cell Font.
Borders | Cell borders.
Format | Format string. (For example, "yyyy-mm-dd" for a date format, or "#.00" for a numeric 2 decimal format) This format string is the same you use in Excel under "Custom" format when formatting a cell (for English versions of Excel), and it is documented in the Excel documentation. You can use APIMate to find out which string to use from a format you entered in Excel.
HAlignment | Horizontal alignment on the cell.
VAlignment | Vertical alignment on the cell.
Locked | Cell is locked.
Hidden | Cell is Hidden.
WrapText | Cell wrap.
ShrinkToFit | Shrink to fit.
Rotation | Text Rotation in degrees. When this value is from 0 to 90 then this is the rotation degrees in the up direction. When this value is from 91 to 180 then this is a rotation in the down direction. 91 means -1 degree rotation, 92 means -2 degrees, and so on until 180 which means -90 degrees. 255 is vertical text. Other values are invalid.
Indent | Indent value. (in characters). This value can't be bigger than 15 in Excel 2003 or earlier, and no bigger than 250 in Excel 2007 or newer.
Lotus123Prefix | If true the prefix for the cell is compatible with Lotus 123.
ReadingOrder | Reading order for the cell.
ParentStyle | Name of the Parent style. Normally you will want to keep it at null (parent is normal style), but you can write an existing style here. If IsStyle is true this property is not used.
NotNullParentStyle | This is similar to ParentStyle but will return "Normal" when the parent is null.
LinkedStyle | If this object holds a Cell format, LinkedStyle specifies which properties of the cell format are linked to its parent style. If this object holds a Style format, LinkedStyle specifies the default set of properties that will be applied when you use this style from Excel.
WillWrap | Returns true if the text will wrap in the cell. This might be because WrapText is true, of because the alignment is justify or distributed.


TFlxFormat.FillPattern Field | FlexCel Studio for the .NET Framework documentation

TFlxFormat.FillPattern Field

Fill pattern.

Syntax

Namespace: FlexCel.Core

public TFlxFillPattern FillPattern

See also

  • TFlxFormat


TFlxFormat.IsStyle Field | FlexCel Studio for the .NET Framework documentation

TFlxFormat.IsStyle Field

When true this format is a named style, when false a cell format.

Syntax

Namespace: FlexCel.Core

public Boolean IsStyle

See also

  • TFlxFormat


TFlxFormat.CreateStandard2007 Method | FlexCel Studio for the .NET Framework documentation

TFlxFormat.CreateStandard2007 Method

Returns a standard TFlxFormat for Excel 2007. (Font name is Calibri, etc). You will normally want to use ExcelFile.GetDefaultFormat instead of this, since it returns the default format for a specific file, and not a generic format like this.

Syntax

Namespace: FlexCel.Core

public static TFlxFormat CreateStandard2007()

See also

  • TFlxFormat


TFlxFormat.Clone Method | FlexCel Studio for the .NET Framework documentation

TFlxFormat.Clone Method

Returns a deep copy of the format.

Syntax

Namespace: FlexCel.Core

public Object Clone()

See also

  • TFlxFormat


TFlxFormat.Equals Method | FlexCel Studio for the .NET Framework documentation

TFlxFormat.Equals Method

Returns true if 2 instances have the same values.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TFlxFormat


TFlxFormat.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TFlxFormat.GetHashCode Method

Returns the hashcode of the object.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TFlxFormat


TFlxFormat.Font Property | FlexCel Studio for the .NET Framework documentation

TFlxFormat.Font Property

Cell Font.

Syntax

Namespace: FlexCel.Core

public TFlxFont Font { get; set; }

See also

  • TFlxFormat


TFlxFormat.Borders Property | FlexCel Studio for the .NET Framework documentation

TFlxFormat.Borders Property

Cell borders.

Syntax

Namespace: FlexCel.Core

public TFlxBorders Borders { get; set; }

See also

  • TFlxFormat


TFlxFormat.Format Property | FlexCel Studio for the .NET Framework documentation

TFlxFormat.Format Property

Format string. (For example, "yyyy-mm-dd" for a date format, or "#.00" for a numeric 2 decimal format) This format string is the same you use in Excel under "Custom" format when formatting a cell (for English versions of Excel), and it is documented in the Excel documentation. You can use APIMate to find out which string to use from a format you entered in Excel.

Syntax

Namespace: FlexCel.Core

public String Format { get; set; }

See also

  • TFlxFormat


TFlxFormat.HAlignment Property | FlexCel Studio for the .NET Framework documentation

TFlxFormat.HAlignment Property

Horizontal alignment on the cell.

Syntax

Namespace: FlexCel.Core

public THFlxAlignment HAlignment { get; set; }

See also

  • TFlxFormat


TFlxFormat.VAlignment Property | FlexCel Studio for the .NET Framework documentation

TFlxFormat.VAlignment Property

Vertical alignment on the cell.

Syntax

Namespace: FlexCel.Core

public TVFlxAlignment VAlignment { get; set; }

See also

  • TFlxFormat


TFlxFormat.Locked Property | FlexCel Studio for the .NET Framework documentation

TFlxFormat.Locked Property

Cell is locked.

Syntax

Namespace: FlexCel.Core

public Boolean Locked { get; set; }

See also

  • TFlxFormat


TFlxFormat.Hidden Property | FlexCel Studio for the .NET Framework documentation

TFlxFormat.Hidden Property

Cell is Hidden.

Syntax

Namespace: FlexCel.Core

public Boolean Hidden { get; set; }

See also

  • TFlxFormat


TFlxFormat.WrapText Property | FlexCel Studio for the .NET Framework documentation

TFlxFormat.WrapText Property

Cell wrap.

Syntax

Namespace: FlexCel.Core

public Boolean WrapText { get; set; }

See also

  • TFlxFormat


TFlxFormat.ShrinkToFit Property | FlexCel Studio for the .NET Framework documentation

TFlxFormat.ShrinkToFit Property

Shrink to fit.

Syntax

Namespace: FlexCel.Core

public Boolean ShrinkToFit { get; set; }

See also

  • TFlxFormat


TFlxFormat.Rotation Property | FlexCel Studio for the .NET Framework documentation

TFlxFormat.Rotation Property

Text Rotation in degrees.

When this value is from 0 to 90 then this is the rotation degrees in the up direction.

When this value is from 91 to 180 then this is a rotation in the down direction. 91 means -1 degree rotation, 92 means -2 degrees, and so on until 180 which means -90 degrees.

255 is vertical text.

Other values are invalid.

Syntax

Namespace: FlexCel.Core

public Byte Rotation { get; set; }

See also

  • TFlxFormat


TFlxFormat.Indent Property | FlexCel Studio for the .NET Framework documentation

TFlxFormat.Indent Property

Indent value. (in characters). This value can't be bigger than 15 in Excel 2003 or earlier, and no bigger than 250 in Excel 2007 or newer.

Syntax

Namespace: FlexCel.Core

public Byte Indent { get; set; }

See also

  • TFlxFormat


TFlxFormat.Lotus123Prefix Property | FlexCel Studio for the .NET Framework documentation

TFlxFormat.Lotus123Prefix Property

If true the prefix for the cell is compatible with Lotus 123.

Syntax

Namespace: FlexCel.Core

public Boolean Lotus123Prefix { get; set; }

See also

  • TFlxFormat


TFlxFormat.ReadingOrder Property | FlexCel Studio for the .NET Framework documentation

TFlxFormat.ReadingOrder Property

Reading order for the cell.

Syntax

Namespace: FlexCel.Core

public TFlxReadingOrder ReadingOrder { get; set; }

See also

  • TFlxFormat


TFlxFormat.ParentStyle Property | FlexCel Studio for the .NET Framework documentation

TFlxFormat.ParentStyle Property

Name of the Parent style. Normally you will want to keep it at null (parent is normal style), but you can write an existing style here. If IsStyle is true this property is not used.

Syntax

Namespace: FlexCel.Core

public String ParentStyle { get; set; }

See also

  • TFlxFormat


TFlxFormat.NotNullParentStyle Property | FlexCel Studio for the .NET Framework documentation

TFlxFormat.NotNullParentStyle Property

This is similar to ParentStyle but will return "Normal" when the parent is null.

Syntax

Namespace: FlexCel.Core

public String NotNullParentStyle { get; }

See also

  • TFlxFormat


TFlxFormat.LinkedStyle Property | FlexCel Studio for the .NET Framework documentation

TFlxFormat.LinkedStyle Property

If this object holds a Cell format, LinkedStyle specifies which properties of the cell format are linked to its parent style. If this object holds a Style format, LinkedStyle specifies the default set of properties that will be applied when you use this style from Excel.

Syntax

Namespace: FlexCel.Core

public TLinkedStyle LinkedStyle { get; }

See also

  • TFlxFormat


TFlxFormat.WillWrap Property | FlexCel Studio for the .NET Framework documentation

TFlxFormat.WillWrap Property

Returns true if the text will wrap in the cell. This might be because WrapText is true, of because the alignment is justify or distributed.

Syntax

Namespace: FlexCel.Core

public Boolean WillWrap { get; }

See also

  • TFlxFormat


TFlxNumberFormat Class | FlexCel Studio for the .NET Framework documentation

TFlxNumberFormat Class

Static class to convert cells to formatted strings. It uses format strings from Excel, that are different to those on .net, so we have to try to reconcile the diffs.

Syntax

Namespace: FlexCel.Core

public static class TFlxNumberFormat

Methods

Name Description
FormatValue Overloaded
 FormatValue(Object, String, ExcelFile)
FormatValue(Object, String, TUIColor, ExcelFile)
FormatValue(Object, String, TUIColor, ExcelFile, Boolean)
FormatValue(Object, String, TUIColor, ExcelFile, Boolean, Boolean)
FormatValue(Object, String, TUIColor, ExcelFile, Boolean, Boolean, TAdaptativeFormats)
FormatValue(Object, String, TUIColor, ExcelFile, Boolean, Boolean, Int32, TAdaptativeFormats)
HasDateOrTime Returns true if the format string has a date or a time.
HasDate Returns true if the format string has a date.
HasTime Returns true if the format string has a time.
PercentCount Returns the number of % sign in a cell. Each % in the format string multiplies the value by 100, so 0.1 formatted as "0%" will display as 10% and formatted as 0%% will display as 1000%%.

Properties

Name | Description
RegionalDateString | Returns the string used on a standard date on the current locale
RegionalDate​Time​String | Returns the string used on a standard date and time on the current locale

Events

Name | Description
CultureCreating | Fires before a culture is created. Read Localized Month Names for more information on how to use it. Note that this event is static and it applies to the whole app.


TFlxNumberFormat.FormatValue Method | FlexCel Studio for the .NET Framework documentation

TFlxNumberFormat.FormatValue Method

Overloads

  • TFlxNumberFormat.FormatValue(Object, String, ExcelFile)
  • TFlxNumberFormat.FormatValue(Object, String, TUIColor, ExcelFile)
  • TFlxNumberFormat.FormatValue(Object, String, TUIColor, ExcelFile, Boolean)
  • TFlxNumberFormat.FormatValue(Object, String, TUIColor, ExcelFile, Boolean, Boolean)
  • TFlxNumberFormat.FormatValue(Object, String, TUIColor, ExcelFile, Boolean, Boolean, TAdaptativeFormats)
  • TFlxNumberFormat.FormatValue(Object, String, TUIColor, ExcelFile, Boolean, Boolean, Int32, TAdaptativeFormats)

TFlxNumberFormat.FormatValue(Object, String, ExcelFile)

Formats a value as it would be shown by Excel.

Syntax

Namespace: FlexCel.Core

public static String FormatValue(Object Value, String Format, ExcelFile Workbook)

Parameters

<-> | Parameter | Type | Description
 | Value | Object | Value to format.
 | Format | String | Cell Format. (For example, "yyyy-mm-dd" for a date format, or "#.00" for a numeric 2 decimal format) This format string is the same you use in Excel under "Custom" format when formatting a cell (for English versions of Excel), and it is documented in the Excel documentation. You can use APIMate to find out which string to use from a format you entered in Excel.
 | Workbook | ExcelFile | Workbook with the cell. If null, no color information will be returned and the base date fill be assumed to be 1900 (windows) and not 1904 (macs).

See also

  • TFlxNumberFormat

TFlxNumberFormat.FormatValue(Object, String, TUIColor, ExcelFile)

Formats a value as it would be shown by Excel. Conditional formats are not applied, you need to call ExcelFile.ConditionallyModifyFormat(TFlxFormat, Int32, Int32, Boolean, TDrawingConditionalFormat) to the cell style for that.

Syntax

Namespace: FlexCel.Core

public static TRichString FormatValue(Object Value, String Format, ref TUIColor aColor, ExcelFile Workbook)

Parameters

<-> | Parameter | Type | Description
 | Value | Object | Value to format.
 | Format | String | Cell Format. (For example, "yyyy-mm-dd" for a date format, or "#.00" for a numeric 2 decimal format) This format string is the same you use in Excel under "Custom" format when formatting a cell (for English versions of Excel), and it is documented in the Excel documentation. You can use APIMate to find out which string to use from a format you entered in Excel.
ref | aColor | TUIColor | Final color of the text. (Depending on the format, color might change. I.e. Red for negatives)
 | Workbook | ExcelFile | Workbook with the cell. If null, no color information will be returned and the base date fill be assumed to be 1900 (windows) and not 1904 (macs).

Returns

Formatted string.

See also

  • TFlxNumberFormat

TFlxNumberFormat.FormatValue(Object, String, TUIColor, ExcelFile, Boolean)

Formats a value as it would be shown by Excel. Conditional formats are not applied, you need to call ExcelFile.ConditionallyModifyFormat(TFlxFormat, Int32, Int32, Boolean, TDrawingConditionalFormat) to the cell style for that.

Syntax

Namespace: FlexCel.Core

public static TRichString FormatValue(Object Value, String Format, ref TUIColor aColor, ExcelFile Workbook, Boolean ignorePrintErrors)

Parameters

<-> | Parameter | Type | Description
 | Value | Object | Value to format.
 | Format | String | Cell Format. (For example, "yyyy-mm-dd" for a date format, or "#.00" for a numeric 2 decimal format) This format string is the same you use in Excel under "Custom" format when formatting a cell (for English versions of Excel), and it is documented in the Excel documentation. You can use APIMate to find out which string to use from a format you entered in Excel.
ref | aColor | TUIColor | Final color of the text. (Depending on the format, color might change. I.e. Red for negatives)
 | Workbook | ExcelFile | Workbook with the cell. If null, no color information will be returned and the base date fill be assumed to be 1900 (windows) and not 1904 (macs).
 | ignorePrintErrors | Boolean | If true, the string for an error like #DIV/0 will always by #DIV/0 instead of using the value of ExcelFile.PrintErrors. Set it to true when the value is not for printing it.

Returns

Formatted string.

See also

  • TFlxNumberFormat

TFlxNumberFormat.FormatValue(Object, String, TUIColor, ExcelFile, Boolean, Boolean)

Formats a value as it would be shown by Excel.

Syntax

Namespace: FlexCel.Core

public static TRichString FormatValue(Object Value, String Format, ref TUIColor aColor, ExcelFile Workbook, out Boolean HasDate, out Boolean HasTime)

Parameters

<-> | Parameter | Type | Description
 | Value | Object | Value to format.
 | Format | String | Cell Format. (For example, "yyyy-mm-dd" for a date format, or "#.00" for a numeric 2 decimal format) This format string is the same you use in Excel under "Custom" format when formatting a cell (for English versions of Excel), and it is documented in the Excel documentation. You can use APIMate to find out which string to use from a format you entered in Excel.
ref | aColor | TUIColor | Final color of the text. (Depending on the format, color might change. I.e. Red for negatives)
 | Workbook | ExcelFile | Workbook with the cell. If null, no color information will be returned and the base date fill be assumed to be 1900 (windows) and not 1904 (macs).
out | HasDate | Boolean | Returns if the format contains a date.
out | HasTime | Boolean | Returns if the format contains a time.

Returns

Formatted string.

See also

  • TFlxNumberFormat

TFlxNumberFormat.FormatValue(Object, String, TUIColor, ExcelFile, Boolean, Boolean, TAdaptativeFormats)

Formats a value as it would be shown by Excel.

Syntax

Namespace: FlexCel.Core

public static TRichString FormatValue(Object Value, String Format, ref TUIColor aColor, ExcelFile Workbook, out Boolean HasDate, out Boolean HasTime, out TAdaptativeFormats AdaptativeFormats)

Parameters

<-> | Parameter | Type | Description
 | Value | Object | Value to format.
 | Format | String | Cell Format. (For example, "yyyy-mm-dd" for a date format, or "#.00" for a numeric 2 decimal format) This format string is the same you use in Excel under "Custom" format when formatting a cell (for English versions of Excel), and it is documented in the Excel documentation. You can use APIMate to find out which string to use from a format you entered in Excel.
ref | aColor | TUIColor | Final color of the text. (Depending on the format, color might change. I.e. Red for negatives)
 | Workbook | ExcelFile | Workbook with the cell. If null, no color information will be returned and the base date fill be assumed to be 1900 (windows) and not 1904 (macs).
out | HasDate | Boolean | Returns if the format contains a date.
out | HasTime | Boolean | Returns if the format contains a time.
out | AdaptativeFormats | TAdaptativeFormats | Returns micro-justification information needed to adapt the text better to a cell. Null if there are no adaptative formats.

Returns

Formatted string.

See also

  • TFlxNumberFormat

TFlxNumberFormat.FormatValue(Object, String, TUIColor, ExcelFile, Boolean, Boolean, Int32, TAdaptativeFormats)

Formats a value as it would be shown by Excel.

Syntax

Namespace: FlexCel.Core

public static TRichString FormatValue(Object Value, String Format, ref TUIColor aColor, ExcelFile Workbook, out Boolean HasDate, out Boolean HasTime, out Int32 PercentCount, out TAdaptativeFormats AdaptativeFormats)

Parameters

<-> | Parameter | Type | Description
 | Value | Object | Value to format.
 | Format | String | Cell Format. (For example, "yyyy-mm-dd" for a date format, or "#.00" for a numeric 2 decimal format) This format string is the same you use in Excel under "Custom" format when formatting a cell (for English versions of Excel), and it is documented in the Excel documentation. You can use APIMate to find out which string to use from a format you entered in Excel.
ref | aColor | TUIColor | Final color of the text. (Depending on the format, color might change. I.e. Red for negatives)
 | Workbook | ExcelFile | Workbook with the cell. If null, no color information will be returned and the base date fill be assumed to be 1900 (windows) and not 1904 (macs).
out | HasDate | Boolean | Returns if the format contains a date.
out | HasTime | Boolean | Returns if the format contains a time.
out | PercentCount | Int32 | Returns the number of % signs applied to the format. Each % in the format string multiplies the number by 100, so 0.1 displays as "10%" or "1000%%"
out | AdaptativeFormats | TAdaptativeFormats | Returns micro-justification information needed to adapt the text better to a cell. Null if there are no adaptative formats.

Returns

Formatted string.

See also

  • TFlxNumberFormat


TFlxNumberFormat.HasDateOrTime Method | FlexCel Studio for the .NET Framework documentation

TFlxNumberFormat.HasDateOrTime Method

Returns true if the format string has a date or a time.

Syntax

Namespace: FlexCel.Core

public static Boolean HasDateOrTime(String Format)

Parameters

<-> | Parameter | Type | Description
 | Format | String | Cell format.

See also

  • TFlxNumberFormat


TFlxNumberFormat.HasDate Method | FlexCel Studio for the .NET Framework documentation

TFlxNumberFormat.HasDate Method

Returns true if the format string has a date.

Syntax

Namespace: FlexCel.Core

public static Boolean HasDate(String Format)

Parameters

<-> | Parameter | Type | Description
 | Format | String | Cell format.

See also

  • TFlxNumberFormat


TFlxNumberFormat.HasTime Method | FlexCel Studio for the .NET Framework documentation

TFlxNumberFormat.HasTime Method

Returns true if the format string has a time.

Syntax

Namespace: FlexCel.Core

public static Boolean HasTime(String Format)

Parameters

<-> | Parameter | Type | Description
 | Format | String | Cell format.

See also

  • TFlxNumberFormat


TFlxNumberFormat.PercentCount Method | FlexCel Studio for the .NET Framework documentation

TFlxNumberFormat.PercentCount Method

Returns the number of % sign in a cell. Each % in the format string multiplies the value by 100, so 0.1 formatted as "0%" will display as 10% and formatted as 0%% will display as 1000%%.

Syntax

Namespace: FlexCel.Core

public static Int32 PercentCount(Object Value, String Format)

Parameters

<-> | Parameter | Type | Description
 | Value | Object | Value we are formatting. Normally this shouldn't affect the number of percents in the format string, but if the format string is different for positive and negative numbers or zero values, then the value might affect the result.
 | Format | String | Cell format.

See also

  • TFlxNumberFormat


TFlxNumberFormat.RegionalDateString Property | FlexCel Studio for the .NET Framework documentation

TFlxNumberFormat.RegionalDateString Property

Returns the string used on a standard date on the current locale

Syntax

Namespace: FlexCel.Core

public static String RegionalDateString { get; }

See also

  • TFlxNumberFormat


TFlxNumberFormat.RegionalDateTimeString Property | FlexCel Studio for the .NET Framework documentation

TFlxNumberFormat.RegionalDateTimeString Property

Returns the string used on a standard date and time on the current locale

Syntax

Namespace: FlexCel.Core

public static String RegionalDateTimeString { get; }

See also

  • TFlxNumberFormat


TFlxNumberFormat.CultureCreating Event | FlexCel Studio for the .NET Framework documentation

TFlxNumberFormat.CultureCreating Event

Fires before a culture is created. Read Localized Month Names for more information on how to use it. Note that this event is static and it applies to the whole app.

Syntax

Namespace: FlexCel.Core

public CultureCreatingEventHandler CultureCreating

See also

  • TFlxNumberFormat


TFormula Class | FlexCel Studio for the .NET Framework documentation

TFormula Class

An Excel formula. Use this class to pass a formula to an Excel sheet.

Remarks

There are 4 public members here: 1) The formula text 2) The internal formula data. This member is not public. 3) The formula result. If RecalcMode is not manual, this value will be ignored. 4) The formula span. Some formulas, like some array formulas, can span over more than one cell. Not all of them need to be set, in fact, you won't probably never set internal formula data. Internal formula data is used so we can make Flexcel1.SetValue(FlexCel2.GetValue(1,1)); and not have to convert data->text->back to data.

Syntax

Namespace: FlexCel.Core

public class TFormula: ICloneable, IConvertible

Constructors

Name | Description
TFormula | Overloaded TFormula TFormula(String) TFormula(String, Object) TFormula(String, Object, TFormulaSpan)

Methods

Name | Description
Clone | Returns a Deep copy of the formula.
ToString | Returns the formula result as a string.
Equals | Returns true if obj is equal to this instance.
GetHashCode | Hashcode of the formula.

Properties

Name | Description
Text | The formula text, as it is written on Excel. It must begin with "=" or "{" for array formulas.
Result | The formula result.
Span | For multicell formulas (like an array formula entered over more than one cell) this property says how many rows and columns the formula uses. Normal formulas will span one single cell


TFormula.TFormula Constructor | FlexCel Studio for the .NET Framework documentation

TFormula.TFormula Constructor

Overloads

  • TFormula.TFormula
  • TFormula.TFormula(String)
  • TFormula.TFormula(String, Object)
  • TFormula.TFormula(String, Object, TFormulaSpan)

TFormula.TFormula

Creates an empty Excel formula

Syntax

Namespace: FlexCel.Core

public TFormula()

See also

  • TFormula

TFormula.TFormula(String)

Creates a formula with the corresponding text and result=null.

Syntax

Namespace: FlexCel.Core

public TFormula(String aText)

Parameters

<-> | Parameter | Type | Description
 | aText | String | Formula Text

See also

  • TFormula

TFormula.TFormula(String, Object)

Creates a formula with the corresponding text and result.

Syntax

Namespace: FlexCel.Core

public TFormula(String aText, Object aResult)

Parameters

<-> | Parameter | Type | Description
 | aText | String | Formula Text
 | aResult | Object | Formula Result

See also

  • TFormula

TFormula.TFormula(String, Object, TFormulaSpan)

Creates a formula that spans to more than one row or column. Use it to create multicell array formulas or what-if tables.

Syntax

Namespace: FlexCel.Core

public TFormula(String aText, Object aResult, TFormulaSpan aSpan)

Parameters

<-> | Parameter | Type | Description
 | aText | String | Formula Text
 | aResult | Object | Formula Result. You will normally want to set this to null, as it will be recalculated by FlexCel.
 | aSpan | TFormulaSpan | How many rows and columns this formula will span, and in which position for the array the formula is.

See also

  • TFormula


TFormula.Clone Method | FlexCel Studio for the .NET Framework documentation

TFormula.Clone Method

Returns a Deep copy of the formula.

Syntax

Namespace: FlexCel.Core

public Object Clone()

See also

  • TFormula


TFormula.ToString Method | FlexCel Studio for the .NET Framework documentation

TFormula.ToString Method

Returns the formula result as a string.

Syntax

Namespace: FlexCel.Core

public override String ToString()

See also

  • TFormula


TFormula.Equals Method | FlexCel Studio for the .NET Framework documentation

TFormula.Equals Method

Returns true if obj is equal to this instance.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TFormula


TFormula.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TFormula.GetHashCode Method

Hashcode of the formula.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TFormula


TFormula.Text Property | FlexCel Studio for the .NET Framework documentation

TFormula.Text Property

The formula text, as it is written on Excel. It must begin with "=" or "{" for array formulas.

Syntax

Namespace: FlexCel.Core

public String Text { get; set; }

See also

  • TFormula


TFormula.Result Property | FlexCel Studio for the .NET Framework documentation

TFormula.Result Property

The formula result.

Syntax

Namespace: FlexCel.Core

public Object Result { get; set; }

See also

  • TFormula


TFormula.Span Property | FlexCel Studio for the .NET Framework documentation

TFormula.Span Property

For multicell formulas (like an array formula entered over more than one cell) this property says how many rows and columns the formula uses. Normal formulas will span one single cell

Syntax

Namespace: FlexCel.Core

public TFormulaSpan Span { get; }

See also

  • TFormula


TFormulaMessages Class | FlexCel Studio for the .NET Framework documentation

TFormulaMessages Class

Tokens that can be used on a formula.

Syntax

Namespace: FlexCel.Core

public static class TFormulaMessages

Methods

Name Description
ErrString Message for the ErrorCode.
TokenString Formula tokens.
TokenChar Returns the formula token as a character.
FloatToString This is a non-localized version of FloatToStr It will always use "." as decimal separator.
If you are localizing this unit to your language, change this function to be: public string FloatToString(​double Value) { return Value.ToString(); } And it will use your current locale to get the decimal separator.
Just remember that if you for example use "," as decimal sep, you should also change fmArrayColSep, fmFunctionSep and all vars with value=","


TFormulaMessages.ErrString Method | FlexCel Studio for the .NET Framework documentation

TFormulaMessages.ErrString Method

Message for the ErrorCode.

Syntax

Namespace: FlexCel.Core

public static String ErrString(TFlxFormulaErrorValue ErrCode)

Parameters

<-> | Parameter | Type | Description
 | ErrCode | TFlxFormulaError​Value | Error Code.

Returns

Message.

See also

  • TFormulaMessages


TFormulaMessages.TokenString Method | FlexCel Studio for the .NET Framework documentation

TFormulaMessages.TokenString Method

Formula tokens.

Syntax

Namespace: FlexCel.Core

public static String TokenString(TFormulaToken Token)

Parameters

<-> | Parameter | Type | Description
 | Token | TFormulaToken | Token.

Returns

Message.

See also

  • TFormulaMessages


TFormulaMessages.TokenChar Method | FlexCel Studio for the .NET Framework documentation

TFormulaMessages.TokenChar Method

Returns the formula token as a character.

Syntax

Namespace: FlexCel.Core

public static Char TokenChar(TFormulaToken Token)

Parameters

<-> | Parameter | Type | Description
 | Token | TFormulaToken | Token.

Returns

Message

See also

  • TFormulaMessages


TFormulaMessages.FloatToString Method | FlexCel Studio for the .NET Framework documentation

TFormulaMessages.FloatToString Method

This is a non-localized version of FloatToStr It will always use "." as decimal separator. If you are localizing this unit to your language, change this function to be: public string FloatToString(double Value) { return Value.ToString(); } And it will use your current locale to get the decimal separator. Just remember that if you for example use "," as decimal sep, you should also change fmArrayColSep, fmFunctionSep and all vars with value=","

Syntax

Namespace: FlexCel.Core

public static String FloatToString(Double Value)

Parameters

<-> | Parameter | Type | Description
 | Value | Double | Value to convert

Returns

String using ALWAYS "." as decimal separator, regardless of the regional settings

See also

  • TFormulaMessages


TGlowEffect Class | FlexCel Studio for the .NET Framework documentation

TGlowEffect Class

A glow effect.

Syntax

Namespace: FlexCel.Core

public class TGlowEffect: TDrawingEffect, IComparable, IComparable<TGlowEffect>

Constructors

Name | Description
TGlowEffect | Creates a new Glow effect.

Methods

Name | Description
Clone | Creates a deep copy of the object.
CompareTo | Overloaded CompareTo(Object) CompareTo(TGlowEffect)
Equals | Overloaded Equals(TGlowEffect) Equals(Object)
GetHashCode | Returns the hashcode of the object.

Properties

Name | Description
GlowColor | Color for the glow.
Radius | Radius for the glow.


TGlowEffect.TGlowEffect Constructor | FlexCel Studio for the .NET Framework documentation

TGlowEffect.TGlowEffect Constructor

Creates a new Glow effect.

Syntax

Namespace: FlexCel.Core

public TGlowEffect(TDrawingColor aGlowColor, Int64 aRadius)

Parameters

<-> | Parameter | Type | Description
 | aGlowColor | TDrawingColor | Color of the glow.
 | aRadius | Int64 | Radius of the glow.

See also

  • TGlowEffect


TGlowEffect.Clone Method | FlexCel Studio for the .NET Framework documentation

TGlowEffect.Clone Method

Creates a deep copy of the object.

Syntax

Namespace: FlexCel.Core

public TGlowEffect Clone()

See also

  • TGlowEffect


TGlowEffect.CompareTo Method | FlexCel Studio for the .NET Framework documentation

TGlowEffect.CompareTo Method

Overloads

  • TGlowEffect.CompareTo(Object)
  • TGlowEffect.CompareTo(TGlowEffect)

TGlowEffect.CompareTo(Object)

Returns -1, 0 or 1 depending if this object is smaller or bigger than the other.

Syntax

Namespace: FlexCel.Core

public Int32 CompareTo(Object other)

Parameters

<-> | Parameter | Type | Description
 | other | Object |

See also

  • TGlowEffect

TGlowEffect.CompareTo(TGlowEffect)

Returns -1, 0 or 1 depending if this object is smaller or bigger than the other.

Syntax

Namespace: FlexCel.Core

public Int32 CompareTo(TGlowEffect other)

Parameters

<-> | Parameter | Type | Description
 | other | TGlowEffect |

See also

  • TGlowEffect


TGlowEffect.Equals Method | FlexCel Studio for the .NET Framework documentation

TGlowEffect.Equals Method

Overloads

  • TGlowEffect.Equals(TGlowEffect)
  • TGlowEffect.Equals(Object)

TGlowEffect.Equals(TGlowEffect)

Returns true if both objects are the same.

Syntax

Namespace: FlexCel.Core

protected Boolean Equals(TGlowEffect other)

Parameters

<-> | Parameter | Type | Description
 | other | TGlowEffect |

See also

  • TGlowEffect

TGlowEffect.Equals(Object)

Returns true if both objects are the same.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object other)

Parameters

<-> | Parameter | Type | Description
 | other | Object |

See also

  • TGlowEffect


TGlowEffect.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TGlowEffect.GetHashCode Method

Returns the hashcode of the object.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TGlowEffect


TGlowEffect.GlowColor Property | FlexCel Studio for the .NET Framework documentation

TGlowEffect.GlowColor Property

Color for the glow.

Syntax

Namespace: FlexCel.Core

public TDrawingColor GlowColor { get; }

See also

  • TGlowEffect


TGlowEffect.Radius Property | FlexCel Studio for the .NET Framework documentation

TGlowEffect.Radius Property

Radius for the glow.

Syntax

Namespace: FlexCel.Core

public Int64 Radius { get; }

See also

  • TGlowEffect


TGradientFill Class | FlexCel Studio for the .NET Framework documentation

TGradientFill Class

Shapes are filled with a gradient.

Syntax

Namespace: FlexCel.Core

public class TGradientFill: TFillStyle

Constructors

Name | Description
TGradientFill | Creates a new Gradient fill.

Methods

Name | Description
Equals | Returns true if this instance has the same data as the object obj.
CompareTo | Returns -1 if obj is bigger than this, 0 if both objects are the same, and 1 if obj is smaller than this.
GetHashCode | Returns the hashcode for this object

Properties

Name | Description
RotateWithShape | Specifies that the fill should rotate with the shape.
TileRect | This element specifies a rectangular region of the shape to which the gradient is applied. This region is then tiled across the remaining area of the shape to complete the fill. The tile rectangle is defined by percentage offsets from the sides of the shape's bounding box.
Flip | Specifies the direction(s) in which to flip the gradient while tiling. Normally a gradient fill encompasses the entire bounding box of the shape which contains the fill. However, with the tileRect element, it is possible to define a "tile" rectangle which is smaller than the bounding box. In this situation, the gradient fill is encompassed within the tile rectangle, and the tile rectangle is tiled across the bounding box to fill the entire area
GradientStops | The list of gradient stops that specifies the gradient colors and their relative positions in the color band.
GradientDef | Definition of the gradient. This can be a TDrawingLinear​Gradient class or a TDrawingPathGradient class.


TGradientFill.TGradientFill Constructor | FlexCel Studio for the .NET Framework documentation

TGradientFill.TGradientFill Constructor

Creates a new Gradient fill.

Syntax

Namespace: FlexCel.Core

public TGradientFill(Nullable<TDrawingRelativeRect> aTileRect, Boolean aRotateWithShape, TFlipMode aFlip, TDrawingGradientStop[] aGradientStops, TDrawingGradientDef aGradientDef)

Parameters

<-> | Parameter | Type | Description
 | aTileRect | Nullable<TDrawingRelativeRect> |
 | aRotateWithShape | Boolean |
 | aFlip | TFlipMode |
 | aGradientStops | TDrawingGradientStop[] |
 | aGradientDef | TDrawingGradientDef |

See also

  • TGradientFill


TGradientFill.Equals Method | FlexCel Studio for the .NET Framework documentation

TGradientFill.Equals Method

Returns true if this instance has the same data as the object obj.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TGradientFill


TGradientFill.CompareTo Method | FlexCel Studio for the .NET Framework documentation

TGradientFill.CompareTo Method

Returns -1 if obj is bigger than this, 0 if both objects are the same, and 1 if obj is smaller than this.

Syntax

Namespace: FlexCel.Core

public override Int32 CompareTo(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TGradientFill


TGradientFill.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TGradientFill.GetHashCode Method

Returns the hashcode for this object

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TGradientFill


TGradientFill.RotateWithShape Property | FlexCel Studio for the .NET Framework documentation

TGradientFill.RotateWithShape Property

Specifies that the fill should rotate with the shape.

Syntax

Namespace: FlexCel.Core

public Boolean RotateWithShape { get; }

See also

  • TGradientFill


TGradientFill.TileRect Property | FlexCel Studio for the .NET Framework documentation

TGradientFill.TileRect Property

This element specifies a rectangular region of the shape to which the gradient is applied. This region is then tiled across the remaining area of the shape to complete the fill. The tile rectangle is defined by percentage offsets from the sides of the shape's bounding box.

Syntax

Namespace: FlexCel.Core

public Nullable<TDrawingRelativeRect> TileRect { get; }

See also

  • TGradientFill


TGradientFill.Flip Property | FlexCel Studio for the .NET Framework documentation

TGradientFill.Flip Property

Specifies the direction(s) in which to flip the gradient while tiling.

Normally a gradient fill encompasses the entire bounding box of the shape which contains the fill. However, with the tileRect element, it is possible to define a "tile" rectangle which is smaller than the bounding box. In this situation, the gradient fill is encompassed within the tile rectangle, and the tile rectangle is tiled across the bounding box to fill the entire area

Syntax

Namespace: FlexCel.Core

public TFlipMode Flip { get; }

See also

  • TGradientFill


TGradientFill.GradientStops Property | FlexCel Studio for the .NET Framework documentation

TGradientFill.GradientStops Property

The list of gradient stops that specifies the gradient colors and their relative positions in the color band.

Syntax

Namespace: FlexCel.Core

public TDrawingGradientStop[] GradientStops { get; }

See also

  • TGradientFill


TGradientFill.GradientDef Property | FlexCel Studio for the .NET Framework documentation

TGradientFill.GradientDef Property

Definition of the gradient. This can be a TDrawingLinearGradient class or a TDrawingPathGradient class.

Syntax

Namespace: FlexCel.Core

public TDrawingGradientDef GradientDef { get; }

See also

  • TGradientFill


TGroupFill Class | FlexCel Studio for the .NET Framework documentation

TGroupFill Class

Shape is part of a group and filled with its parent fill style.

Syntax

Namespace: FlexCel.Core

public class TGroupFill: TFillStyle

Constructors

Name | Description
TGroupFill | Creates a new TGroupFill instance.

Methods

Name | Description
Equals | Returns true if this instance has the same data as the object obj.
CompareTo | Returns -1 if obj is bigger than this, 0 if both objects are the same, and 1 if obj is smaller than this.
GetHashCode | Returns the hashcode for this object


TGroupFill.TGroupFill Constructor | FlexCel Studio for the .NET Framework documentation

TGroupFill.TGroupFill Constructor

Creates a new TGroupFill instance.

Syntax

Namespace: FlexCel.Core

public TGroupFill()

See also

  • TGroupFill


TGroupFill.Equals Method | FlexCel Studio for the .NET Framework documentation

TGroupFill.Equals Method

Returns true if this instance has the same data as the object obj.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TGroupFill


TGroupFill.CompareTo Method | FlexCel Studio for the .NET Framework documentation

TGroupFill.CompareTo Method

Returns -1 if obj is bigger than this, 0 if both objects are the same, and 1 if obj is smaller than this.

Syntax

Namespace: FlexCel.Core

public override Int32 CompareTo(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TGroupFill


TGroupFill.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TGroupFill.GetHashCode Method

Returns the hashcode for this object

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TGroupFill


THeaderOrFooterAnchor Class | FlexCel Studio for the .NET Framework documentation

THeaderOrFooterAnchor Class

Image information for an image inside a header or footer.

Syntax

Namespace: FlexCel.Core

public class THeaderOrFooterAnchor: ICloneable

Constructors

Name | Description
THeaderOrFooter​Anchor | Creates a new Anchor for a Header or footer image.

Methods

Name | Description
GetData | All the data as a byte array.
Clone | Returns a clone of the anchor.
EqualValues | Returns true if both instances of the objects contain the same values. Instances might be different, this method will return if their values are equal. Instances can be null.

Properties

Name | Description
Width | Width of the image in device independent pixels (dip). 1 dip = 1/96 inch, no matter the reslution of the output device.
Height | Height of the image in device independent pixels (dip). 1 dip = 1/96 inch, no matter the reslution of the output device.
Length | Length of the Serialized array.


THeaderOrFooterAnchor.THeaderOrFooterAnchor Constructor | FlexCel Studio for the .NET Framework documentation

THeaderOrFooterAnchor.THeaderOrFooterAnchor Constructor

Creates a new Anchor for a Header or footer image.

Syntax

Namespace: FlexCel.Core

public THeaderOrFooterAnchor(Int64 aWidth, Int64 aHeight)

Parameters

<-> | Parameter | Type | Description
 | aWidth | Int64 | Width of the image in device independent pixels (dip). 1 dip = 1/96 inch, no matter the reslution of the output device.
 | aHeight | Int64 | Height of the image in device independent pixels (dip). 1 dip = 1/96 inch, no matter the reslution of the output device.

See also

  • THeaderOrFooterAnchor


THeaderOrFooterAnchor.GetData Method | FlexCel Studio for the .NET Framework documentation

THeaderOrFooterAnchor.GetData Method

All the data as a byte array.

Syntax

Namespace: FlexCel.Core

public Byte[] GetData()

See also

  • THeaderOrFooterAnchor


THeaderOrFooterAnchor.Clone Method | FlexCel Studio for the .NET Framework documentation

THeaderOrFooterAnchor.Clone Method

Returns a clone of the anchor.

Syntax

Namespace: FlexCel.Core

public Object Clone()

See also

  • THeaderOrFooterAnchor


THeaderOrFooterAnchor.EqualValues Method | FlexCel Studio for the .NET Framework documentation

THeaderOrFooterAnchor.EqualValues Method

Returns true if both instances of the objects contain the same values. Instances might be different, this method will return if their values are equal. Instances can be null.

Syntax

Namespace: FlexCel.Core

public static Boolean EqualValues(THeaderOrFooterAnchor a1, THeaderOrFooterAnchor a2)

Parameters

<-> | Parameter | Type | Description
 | a1 | THeaderOrFooter​Anchor | First instance to compare.
 | a2 | THeaderOrFooter​Anchor | Second instance to compare.

See also

  • THeaderOrFooterAnchor


THeaderOrFooterAnchor.Width Property | FlexCel Studio for the .NET Framework documentation

THeaderOrFooterAnchor.Width Property

Width of the image in device independent pixels (dip). 1 dip = 1/96 inch, no matter the reslution of the output device.

Syntax

Namespace: FlexCel.Core

public Int64 Width { get; set; }

See also

  • THeaderOrFooterAnchor


THeaderOrFooterAnchor.Height Property | FlexCel Studio for the .NET Framework documentation

THeaderOrFooterAnchor.Height Property

Height of the image in device independent pixels (dip). 1 dip = 1/96 inch, no matter the reslution of the output device.

Syntax

Namespace: FlexCel.Core

public Int64 Height { get; set; }

See also

  • THeaderOrFooterAnchor


THeaderOrFooterAnchor.Length Property | FlexCel Studio for the .NET Framework documentation

THeaderOrFooterAnchor.Length Property

Length of the Serialized array.

Syntax

Namespace: FlexCel.Core

public Byte Length { get; }

See also

  • THeaderOrFooterAnchor


THeaderOrFooterImageProperties Class | FlexCel Studio for the .NET Framework documentation

THeaderOrFooterImageProperties Class

Image information for an image embedded inside a header or footer.

Syntax

Namespace: FlexCel.Core

public class THeaderOrFooterImageProperties: TBaseImageProperties

Constructors

Name | Description
THeaderOrFooter​Image​Properties | Overloaded THeaderOrFooterImageProperties THeaderOrFooterImageProperties(THeaderOrFooterAnchor, String, TCropArea)

Methods

Name | Description
Clone | Performs a deep copy of the object.
EqualValues | Returns true if both instances of the objects contain the same values. Instances might be different, this method will return if their values are equal. Instances can be null.

Properties

Name | Description
Anchor | Image position


THeaderOrFooterImageProperties.THeaderOrFooterImageProperties Constructor | FlexCel Studio for the .NET Framework documentation

THeaderOrFooterImageProperties.THeaderOrFooterImageProperties Constructor

Overloads

  • THeaderOrFooterImageProperties.THeaderOrFooterImageProperties
  • THeaderOrFooterImageProperties.THeaderOrFooterImageProperties(THeaderOrFooterAnchor, String, TCropArea)

THeaderOrFooterImageProperties.THeaderOrFooterImageProperties

Creates a new empty THeaderOrFooterImageProperties instance.

Syntax

Namespace: FlexCel.Core

public THeaderOrFooterImageProperties()

See also

  • THeaderOrFooterImageProperties

THeaderOrFooterImageProperties.THeaderOrFooterImageProperties(THeaderOrFooterAnchor, String, TCropArea)

This method will create a new copy of aAnchor and aCropArea, so you can modify it later.

Syntax

Namespace: FlexCel.Core

public THeaderOrFooterImageProperties(THeaderOrFooterAnchor aAnchor, String aFileName, TCropArea aCropArea)

Parameters

<-> | Parameter | Type | Description
 | aAnchor | THeaderOrFooter​Anchor | Anchor. It will be copied here.
 | aFileName | String | Filename of the image, for saving the info on the sheet. Mostly unused.
 | aCropArea | TCropArea | Crop area for the image.

See also

  • THeaderOrFooterImageProperties


THeaderOrFooterImageProperties.Clone Method | FlexCel Studio for the .NET Framework documentation

THeaderOrFooterImageProperties.Clone Method

Performs a deep copy of the object.

Syntax

Namespace: FlexCel.Core

public override TBaseImageProperties Clone()

See also

  • THeaderOrFooterImageProperties


THeaderOrFooterImageProperties.EqualValues Method | FlexCel Studio for the .NET Framework documentation

THeaderOrFooterImageProperties.EqualValues Method

Returns true if both instances of the objects contain the same values. Instances might be different, this method will return if their values are equal. Instances can be null.

Syntax

Namespace: FlexCel.Core

public static Boolean EqualValues(THeaderOrFooterImageProperties a1, THeaderOrFooterImageProperties a2)

Parameters

<-> | Parameter | Type | Description
 | a1 | THeaderOrFooter​Image​Properties | First instance to compare.
 | a2 | THeaderOrFooter​Image​Properties | Second instance to compare.

See also

  • THeaderOrFooterImageProperties


THeaderOrFooterImageProperties.Anchor Property | FlexCel Studio for the .NET Framework documentation

THeaderOrFooterImageProperties.Anchor Property

Image position

Syntax

Namespace: FlexCel.Core

public THeaderOrFooterAnchor Anchor { get; set; }

See also

  • THeaderOrFooterImageProperties


THtmlColors Class | FlexCel Studio for the .NET Framework documentation

THtmlColors Class

Converts between Color structs and HTML values.

Syntax

Namespace: FlexCel.Core

public static class THtmlColors

Methods

Name | Description
GetColor | Overloaded GetColor(String) GetColor(TUIColor)


THtmlColors.GetColor Method | FlexCel Studio for the .NET Framework documentation

THtmlColors.GetColor Method

Overloads

  • THtmlColors.GetColor(String)
  • THtmlColors.GetColor(TUIColor)

THtmlColors.GetColor(String)

Returns a Color struct from an HTML string

Syntax

Namespace: FlexCel.Core

public static TUIColor GetColor(String Value)

Parameters

<-> | Parameter | Type | Description
 | Value | String | String with color on HTML format. (one of the 16 named colors or #notation)

Returns

The corresponding Color.

See also

  • THtmlColors

THtmlColors.GetColor(TUIColor)

Returns an HTML color string from a Color struct.

Syntax

Namespace: FlexCel.Core

public static String GetColor(TUIColor Value)

Parameters

<-> | Parameter | Type | Description
 | Value | TUIColor | The color we want to convert.

Returns

String with color on HTML format. (one of the 16 named colors or #notation).

See also

  • THtmlColors


THtmlDataUri Class | FlexCel Studio for the .NET Framework documentation

THtmlDataUri Class

Provides functionality to create a data uri from data.

Syntax

Namespace: FlexCel.Core

public static class THtmlDataUri

Methods

Name | Description
GetUriBase64 | Creates a data uri according to the RFC 2397: http:​//​tools.​ietf.​org/​html/​rfc2397 It will use base64 encoding


THtmlDataUri.GetUriBase64 Method | FlexCel Studio for the .NET Framework documentation

THtmlDataUri.GetUriBase64 Method

Creates a data uri according to the RFC 2397: http://tools.ietf.org/html/rfc2397 It will use base64 encoding

Syntax

Namespace: FlexCel.Core

public static String GetUriBase64(String mimeType, Byte[] data)

Parameters

<-> | Parameter | Type | Description
 | mimeType | String | Mime type of the data. You can use StandardMimeType for common mime types.
 | data | Byte[] | Data to encode.

See also

  • THtmlDataUri


THtmlEntities Class | FlexCel Studio for the .NET Framework documentation

THtmlEntities Class

Contains a list of HTML entities and their values

Syntax

Namespace: FlexCel.Core

public static class THtmlEntities

Methods

Name Description
TryNameToCode Converts an Html entity like "amp" into the unicode code for the character. The input string can also be a # code, in decimal or hexadecimal. (for example &#64).
GetTag Returns the identifier of a tag.
EncodeAsHtml Overloaded
 EncodeAsHtml(String, THtmlVersion, Encoding)
EncodeAsHtml(String, THtmlVersion, Encoding, TEnterStyle)

Properties

Name | Description
MaxNameLength | Returns the maximum length for a name. This includes decimal entities, that can have up to 7 numbers.


THtmlEntities.TryNameToCode Method | FlexCel Studio for the .NET Framework documentation

THtmlEntities.TryNameToCode Method

Converts an Html entity like "amp" into the unicode code for the character. The input string can also be a # code, in decimal or hexadecimal. (for example &#64).

Syntax

Namespace: FlexCel.Core

public static Boolean TryNameToCode(String EntityName, out Int32 Code)

Parameters

<-> | Parameter | Type | Description
 | EntityName | String | Name of the entity without the starting "&" and the trailing ";"
out | Code | Int32 | Unicode representation of the entity.

Returns

True if the code exists, false otherwise.

See also

  • THtmlEntities


THtmlEntities.GetTag Method | FlexCel Studio for the .NET Framework documentation

THtmlEntities.GetTag Method

Returns the identifier of a tag.

Syntax

Namespace: FlexCel.Core

public static String GetTag(String HtmlString, Int32 i)

Parameters

<-> | Parameter | Type | Description
 | HtmlString | String | String containing the tag.
 | i | Int32 | Position of the open "<"

Returns

The tag name.

See also

  • THtmlEntities


THtmlEntities.EncodeAsHtml Method | FlexCel Studio for the .NET Framework documentation

THtmlEntities.EncodeAsHtml Method

Overloads

  • THtmlEntities.EncodeAsHtml(String, THtmlVersion, Encoding)
  • THtmlEntities.EncodeAsHtml(String, THtmlVersion, Encoding, TEnterStyle)

THtmlEntities.EncodeAsHtml(String, THtmlVersion, Encoding)

Converts a normal string into a string that can be used inside an HTML file. This includes converting characters to entities, replacing carriage returns by <br> tags, replacing multiple spaces by nbsp and more. EnterStyle is TEnterStyle.Br if omitted.

Syntax

Namespace: FlexCel.Core

public static String EncodeAsHtml(String originalString, THtmlVersion htmlVersion, Encoding encoding)

Parameters

<-> | Parameter | Type | Description
 | originalString | String | String we want to convert.
 | htmlVersion | THtmlVersion | Version of html we are targeting. In Html 4 <br> is valid and <br/> is not. In XHtml the inverse is true.
 | encoding | Encoding | Code page used to encode the string. Normally this is UTF-8

See also

  • THtmlEntities

THtmlEntities.EncodeAsHtml(String, THtmlVersion, Encoding, TEnterStyle)

Converts a normal string into a string that can be used inside an HTML file. This includes converting characters to entities, replacing carriage returns by <br> tags, replacing multiple spaces by nbsp and more. EnterStyle is TEnterStyle.Br if omitted.

Syntax

Namespace: FlexCel.Core

public static String EncodeAsHtml(String originalString, THtmlVersion htmlVersion, Encoding encoding, TEnterStyle EnterStyle)

Parameters

<-> | Parameter | Type | Description
 | originalString | String | String we want to convert.
 | htmlVersion | THtmlVersion | Version of html we are targeting. In Html 4 <br> is valid and <br/> is not. In XHtml the inverse is true.
 | encoding | Encoding | Code page used to encode the string. Normally this is UTF-8
 | EnterStyle | TEnterStyle | How to convert enters and multiple spaces in the text.

See also

  • THtmlEntities


THtmlEntities.MaxNameLength Property | FlexCel Studio for the .NET Framework documentation

THtmlEntities.MaxNameLength Property

Returns the maximum length for a name. This includes decimal entities, that can have up to 7 numbers.

Syntax

Namespace: FlexCel.Core

public static Int32 MaxNameLength { get; }

See also

  • THtmlEntities


THtmlParsedString Class | FlexCel Studio for the .NET Framework documentation

THtmlParsedString Class

An Html string parsed into a C# string and tags.

Syntax

Namespace: FlexCel.Core

public class THtmlParsedString

Constructors

Name | Description
THtmlParsedString | Overloaded THtmlParsedString THtmlParsedString(String)

Methods

Name | Description
Parse | Parses an Html string and fills this instance with the parsed values.

Properties

Name | Description
Text | The parsed html text.
Tags | A list of the tags on the parsed string.


THtmlParsedString.THtmlParsedString Constructor | FlexCel Studio for the .NET Framework documentation

THtmlParsedString.THtmlParsedString Constructor

Overloads

  • THtmlParsedString.THtmlParsedString
  • THtmlParsedString.THtmlParsedString(String)

THtmlParsedString.THtmlParsedString

Creates a new empty THtmlParsedString.

Syntax

Namespace: FlexCel.Core

public THtmlParsedString()

See also

  • THtmlParsedString

THtmlParsedString.THtmlParsedString(String)

Creates a new THtmlParsedString containing an existing Html string.

Syntax

Namespace: FlexCel.Core

public THtmlParsedString(String HtmlString)

Parameters

<-> | Parameter | Type | Description
 | HtmlString | String | Html string we want to parse.

See also

  • THtmlParsedString


THtmlParsedString.Parse Method | FlexCel Studio for the .NET Framework documentation

THtmlParsedString.Parse Method

Parses an Html string and fills this instance with the parsed values.

Syntax

Namespace: FlexCel.Core

public void Parse(String HtmlString)

Parameters

<-> | Parameter | Type | Description
 | HtmlString | String | Html string we want to parse.

See also

  • THtmlParsedString


THtmlParsedString.Text Property | FlexCel Studio for the .NET Framework documentation

THtmlParsedString.Text Property

The parsed html text.

Syntax

Namespace: FlexCel.Core

public String Text { get; }

See also

  • THtmlParsedString


THtmlParsedString.Tags Property | FlexCel Studio for the .NET Framework documentation

THtmlParsedString.Tags Property

A list of the tags on the parsed string.

Syntax

Namespace: FlexCel.Core

public THtmlTag[] Tags { get; }

See also

  • THtmlParsedString


THtmlSaveSharingViolationError Class | FlexCel Studio for the .NET Framework documentation

THtmlSaveSharingViolationError Class

This class has information for a FlexCelError.HtmlSaveSharingViolation error. Look at FlexCelError.HtmlSaveSharingViolation for more information.

Syntax

Namespace: FlexCel.Core

public class THtmlSaveSharingViolationError: TFlexCelErrorInfo

Constructors

Name | Description
THtmlSaveSharing​Violation​Error | Creates a new instance.

Properties

Name | Description
FileName | File with the sharing violation.


THtmlSaveSharingViolationError.THtmlSaveSharingViolationError Constructor | FlexCel Studio for the .NET Framework documentation

THtmlSaveSharingViolationError.THtmlSaveSharingViolationError Constructor

Creates a new instance.

Syntax

Namespace: FlexCel.Core

public THtmlSaveSharingViolationError(String aMessage, String aFileName)

Parameters

<-> | Parameter | Type | Description
 | aMessage | String | See TFlexCelErrorInfo.Message
 | aFileName | String | See FileName

See also

  • THtmlSaveSharingViolationError


THtmlSaveSharingViolationError.FileName Property | FlexCel Studio for the .NET Framework documentation

THtmlSaveSharingViolationError.FileName Property

File with the sharing violation.

Syntax

Namespace: FlexCel.Core

public String FileName { get; }

See also

  • THtmlSaveSharingViolationError


THtmlTag Class | FlexCel Studio for the .NET Framework documentation

THtmlTag Class

Contains an HTML tag and its position on the string.

Syntax

Namespace: FlexCel.Core

public class THtmlTag

Constructors

Name | Description
THtmlTag | Creates a new instance of a Tag.

Properties

Name | Description
Text | The tag text.
Position | Position of this tag inside the converted string. (the string without tags)


THtmlTag.THtmlTag Constructor | FlexCel Studio for the .NET Framework documentation

THtmlTag.THtmlTag Constructor

Creates a new instance of a Tag.

Syntax

Namespace: FlexCel.Core

public THtmlTag(Int32 aPosition, String aText)

Parameters

<-> | Parameter | Type | Description
 | aPosition | Int32 | Position of the final string where the tag is.
 | aText | String | Text of the tag. (not including brackets)

See also

  • THtmlTag


THtmlTag.Text Property | FlexCel Studio for the .NET Framework documentation

THtmlTag.Text Property

The tag text.

Syntax

Namespace: FlexCel.Core

public String Text { get; set; }

See also

  • THtmlTag


THtmlTag.Position Property | FlexCel Studio for the .NET Framework documentation

THtmlTag.Position Property

Position of this tag inside the converted string. (the string without tags)

Syntax

Namespace: FlexCel.Core

public Int32 Position { get; set; }

See also

  • THtmlTag


THtmlTagCreator Class | FlexCel Studio for the .NET Framework documentation

THtmlTagCreator Class

Creates html tags for different actions, and depending on the HTML style.

Syntax

Namespace: FlexCel.Core

public static class THtmlTagCreator

Methods

Name | Description
StartFontColor | Returns a tag to change the font color. Remember to close it with EndFontColor
EndFontColor | Returns a tag to end changing a font color that was started with StartFontColor


THtmlTagCreator.StartFontColor Method | FlexCel Studio for the .NET Framework documentation

THtmlTagCreator.StartFontColor Method

Returns a tag to change the font color. Remember to close it with EndFontColor

Syntax

Namespace: FlexCel.Core

public static String StartFontColor(TUIColor aColor, THtmlStyle htmlStyle)

Parameters

<-> | Parameter | Type | Description
 | aColor | TUIColor | Color to use.
 | htmlStyle | THtmlStyle | Style of the generated HTML.

See also

  • THtmlTagCreator


THtmlTagCreator.EndFontColor Method | FlexCel Studio for the .NET Framework documentation

THtmlTagCreator.EndFontColor Method

Returns a tag to end changing a font color that was started with StartFontColor

Syntax

Namespace: FlexCel.Core

public static String EndFontColor(THtmlStyle htmlStyle)

Parameters

<-> | Parameter | Type | Description
 | htmlStyle | THtmlStyle | Specifies if to use css or not.

See also

  • THtmlTagCreator


THyperLink Class | FlexCel Studio for the .NET Framework documentation

THyperLink Class

An encapsulation of an Excel hyperlink.

Syntax

Namespace: FlexCel.Core

public class THyperLink: ICloneable

Constructors

Name Description
THyperLink Overloaded
 THyperLink
THyperLink(THyperLinkType, String, String, String, String)
THyperLink(THyperLinkType, String, String, String, String, String)
THyperLink(THyperLinkType, String, String, String, String, String, String)

Methods

Name | Description
ToString | Returns the text and description of the link.
Clone | Returns a copy of the hyperlink.

Properties

Name | Description
LinkType | The type of hyperlink: to a local file, to an url, to a cell or to a networked file.
Text | Text of the HyperLink. This is empty when linking to a cell.
BaseUrl | Base Url that must be combined with Text. This only happens if the file has a LinkBase property set.
FullUrl | Returns BaseUrl combined with Text when Text is not an absolute Uri.
Description | Description of the HyperLink.
TargetFrame | This parameter is not documented. You will probably leave it empty.
TextMark | When entering an URL, you can enter additional text following the url with a "#" character (for example www.​your_​url.​com#​myurl"​) The text Mark is the text after the "#" char. When entering an address to a cell, the address goes here too.
Hint | Hint when the mouse hovers over the hyperlink.


THyperLink.THyperLink Constructor | FlexCel Studio for the .NET Framework documentation

THyperLink.THyperLink Constructor

Overloads

  • THyperLink.THyperLink
  • THyperLink.THyperLink(THyperLinkType, String, String, String, String)
  • THyperLink.THyperLink(THyperLinkType, String, String, String, String, String)
  • THyperLink.THyperLink(THyperLinkType, String, String, String, String, String, String)

THyperLink.THyperLink

Creates a new instance of an Hyperlink class.

Syntax

Namespace: FlexCel.Core

public THyperLink()

See also

  • THyperLink

THyperLink.THyperLink(THyperLinkType, String, String, String, String)

Creates a new instance of an Hyperlink class.

Syntax

Namespace: FlexCel.Core

public THyperLink(THyperLinkType aLinkType, String aText, String aDescription, String aTargetFrame, String aTextMark)

Parameters

<-> | Parameter | Type | Description
 | aLinkType | THyperLinkType | The type of hyperlink: to a local file, to an url, to a cell or to a networked file.
 | aText | String | Text of the HyperLink. This is empty when linking to a cell.
 | aDescription | String | Description of the HyperLink.
 | aTargetFrame | String | Specifies the target frame that is to be used when opening this hyperlink. When the hyperlink is activated this attribute is used to determine if a new window is launched for viewing or if an existing one can be used.
 | aTextMark | String | When entering an URL on excel, you can enter additional text following the url with a "#" character (for example www.your_url.com#myurl") The text Mark is the text after the "#" char. When entering an address to a cell, the address goes here too.

See also

  • THyperLink

THyperLink.THyperLink(THyperLinkType, String, String, String, String, String)

Creates a new instance of an Hyperlink class, including a hint.

Syntax

Namespace: FlexCel.Core

public THyperLink(THyperLinkType aLinkType, String aText, String aDescription, String aTargetFrame, String aTextMark, String aHint)

Parameters

<-> | Parameter | Type | Description
 | aLinkType | THyperLinkType | The type of hyperlink: to a local file, to an url, to a cell or to a networked file.
 | aText | String | Text of the HyperLink. This is empty when linking to a cell.
 | aDescription | String | Description of the HyperLink.
 | aTargetFrame | String | Specifies the target frame that is to be used when opening this hyperlink. When the hyperlink is activated this attribute is used to determine if a new window is launched for viewing or if an existing one can be used.
 | aTextMark | String | When entering an URL on excel, you can enter additional text following the url with a "#" character (for example www.your_url.com#myurl") The text Mark is the text after the "#" char. When entering an address to a cell, the address goes here too.
 | aHint | String | Tooltip to be shown when hovering over the link.

See also

  • THyperLink

THyperLink.THyperLink(THyperLinkType, String, String, String, String, String, String)

Creates a new instance of an Hyperlink class, including a hint and a base Url.

Syntax

Namespace: FlexCel.Core

public THyperLink(THyperLinkType aLinkType, String aText, String aBaseUrl, String aDescription, String aTargetFrame, String aTextMark, String aHint)

Parameters

<-> | Parameter | Type | Description
 | aLinkType | THyperLinkType | The type of hyperlink: to a local file, to an url, to a cell or to a networked file.
 | aText | String | Text of the HyperLink. This is empty when linking to a cell.
 | aBaseUrl | String | Base Url used in all entries in the file. This will combine with aText to give the full Url.
 | aDescription | String | Description of the HyperLink.
 | aTargetFrame | String | Specifies the target frame that is to be used when opening this hyperlink. When the hyperlink is activated this attribute is used to determine if a new window is launched for viewing or if an existing one can be used.
 | aTextMark | String | When entering an URL on excel, you can enter additional text following the url with a "#" character (for example www.your_url.com#myurl") The text Mark is the text after the "#" char. When entering an address to a cell, the address goes here too.
 | aHint | String | Tooltip to be shown when hovering over the link.

See also

  • THyperLink


THyperLink.ToString Method | FlexCel Studio for the .NET Framework documentation

THyperLink.ToString Method

Returns the text and description of the link.

Syntax

Namespace: FlexCel.Core

public override String ToString()

See also

  • THyperLink


THyperLink.Clone Method | FlexCel Studio for the .NET Framework documentation

THyperLink.Clone Method

Returns a copy of the hyperlink.

Syntax

Namespace: FlexCel.Core

public Object Clone()

See also

  • THyperLink


THyperLink.LinkType Property | FlexCel Studio for the .NET Framework documentation

THyperLink.LinkType Property

The type of hyperlink: to a local file, to an url, to a cell or to a networked file.

Syntax

Namespace: FlexCel.Core

public THyperLinkType LinkType { get; set; }

See also

  • THyperLink


THyperLink.Text Property | FlexCel Studio for the .NET Framework documentation

THyperLink.Text Property

Text of the HyperLink. This is empty when linking to a cell.

Syntax

Namespace: FlexCel.Core

public String Text { get; set; }

See also

  • THyperLink


THyperLink.BaseUrl Property | FlexCel Studio for the .NET Framework documentation

THyperLink.BaseUrl Property

Base Url that must be combined with Text. This only happens if the file has a LinkBase property set.

Syntax

Namespace: FlexCel.Core

public String BaseUrl { get; set; }

See also

  • THyperLink


THyperLink.FullUrl Property | FlexCel Studio for the .NET Framework documentation

THyperLink.FullUrl Property

Returns BaseUrl combined with Text when Text is not an absolute Uri.

Syntax

Namespace: FlexCel.Core

public String FullUrl { get; }

See also

  • THyperLink


THyperLink.Description Property | FlexCel Studio for the .NET Framework documentation

THyperLink.Description Property

Description of the HyperLink.

Syntax

Namespace: FlexCel.Core

public String Description { get; set; }

See also

  • THyperLink


THyperLink.TargetFrame Property | FlexCel Studio for the .NET Framework documentation

THyperLink.TargetFrame Property

This parameter is not documented. You will probably leave it empty.

Syntax

Namespace: FlexCel.Core

public String TargetFrame { get; set; }

See also

  • THyperLink


THyperLink.TextMark Property | FlexCel Studio for the .NET Framework documentation

THyperLink.TextMark Property

When entering an URL, you can enter additional text following the url with a "#" character (for example www.your_url.com#myurl") The text Mark is the text after the "#" char. When entering an address to a cell, the address goes here too.

Syntax

Namespace: FlexCel.Core

public String TextMark { get; set; }

See also

  • THyperLink


THyperLink.Hint Property | FlexCel Studio for the .NET Framework documentation

THyperLink.Hint Property

Hint when the mouse hovers over the hyperlink.

Syntax

Namespace: FlexCel.Core

public String Hint { get; set; }

See also

  • THyperLink


TImageProperties Class | FlexCel Studio for the .NET Framework documentation

TImageProperties Class

Image information for a normal image.

Syntax

Namespace: FlexCel.Core

public class TImageProperties: TBaseImageProperties

Constructors

Name Description
TImageProperties Overloaded
 TImageProperties
TImageProperties(TClientAnchor, String)
TImageProperties(TClientAnchor, String, String)
TImageProperties(TClientAnchor, String, String, TCropArea)

Methods

Name | Description
Inc | Returns a COPY of the class with its coordinates incremented by 1.
IncNoCopy | Increments the anchor of the image, and returns the SAME object. This method doesn't clone the TImageProperties object.
Dec | Returns a COPY of the class with its coords decremented by 1.
DecNoCopy | Decrements the anchor of the image, and returns the SAME object. This method doesn't clone the TImageProperties object.
Clone | Performs a deep copy of the object.
EqualValues | Returns true if both instances of the objects contain the same values. Instances might be different, this method will return if their values are equal. Instances can be null.

Properties

Name | Description
Anchor | Image position
ShapeName | Name of the image. It sets/gets the name of the shape for the image as you can see it on the names combobox. If you set it to null Excel will show a generic name, like "Picture 31"
AltText | Alternative Text. This is the same as the "Alt Text" tab in the properties dialog for the image, and is used when exporting to HTML.
Title | Specifies the title (caption) of the current object.
IsCameraObject | Returns true if this is a camera object


TImageProperties.TImageProperties Constructor | FlexCel Studio for the .NET Framework documentation

TImageProperties.TImageProperties Constructor

Overloads

  • TImageProperties.TImageProperties
  • TImageProperties.TImageProperties(TClientAnchor, String)
  • TImageProperties.TImageProperties(TClientAnchor, String, String)
  • TImageProperties.TImageProperties(TClientAnchor, String, String, TCropArea)

TImageProperties.TImageProperties

Creates a new empty TImageProperties instance.

Syntax

Namespace: FlexCel.Core

public TImageProperties()

See also

  • TImageProperties

TImageProperties.TImageProperties(TClientAnchor, String)

This method will create a new copy of aAnchor, so you can modify it later.

Syntax

Namespace: FlexCel.Core

public TImageProperties(TClientAnchor aAnchor, String aFileName)

Parameters

<-> | Parameter | Type | Description
 | aAnchor | TClientAnchor | Anchor. It will be copied here.
 | aFileName | String | Filename of the image, for saving the info on the sheet. Mostly unused.

See also

  • TImageProperties

TImageProperties.TImageProperties(TClientAnchor, String, String)

This method will create a new copy of aAnchor, so you can modify it later.

Syntax

Namespace: FlexCel.Core

public TImageProperties(TClientAnchor aAnchor, String aFileName, String aShapeName)

Parameters

<-> | Parameter | Type | Description
 | aAnchor | TClientAnchor | Anchor. It will be copied here.
 | aFileName | String | Filename of the image, for saving the info on the sheet. Mostly unused.
 | aShapeName | String | Shape name as it will appear on the names combo box.

See also

  • TImageProperties

TImageProperties.TImageProperties(TClientAnchor, String, String, TCropArea)

This method will create a new copy of aAnchor and aCropArea, so you can modify it later.

Syntax

Namespace: FlexCel.Core

public TImageProperties(TClientAnchor aAnchor, String aFileName, String aShapeName, TCropArea aCropArea)

Parameters

<-> | Parameter | Type | Description
 | aAnchor | TClientAnchor | Anchor. It will be copied here.
 | aFileName | String | Filename of the image, for saving the info on the sheet. Mostly unused.
 | aShapeName | String | Name of the shape, as it appears on the names combobox. Set it to null to not add an imagename.
 | aCropArea | TCropArea | Crop area for the image.

See also

  • TImageProperties


TImageProperties.Inc Method | FlexCel Studio for the .NET Framework documentation

TImageProperties.Inc Method

Returns a COPY of the class with its coordinates incremented by 1.

Syntax

Namespace: FlexCel.Core

public virtual TImageProperties Inc()

See also

  • TImageProperties


TImageProperties.IncNoCopy Method | FlexCel Studio for the .NET Framework documentation

TImageProperties.IncNoCopy Method

Increments the anchor of the image, and returns the SAME object. This method doesn't clone the TImageProperties object.

Syntax

Namespace: FlexCel.Core

public virtual TImageProperties IncNoCopy()

See also

  • TImageProperties


TImageProperties.Dec Method | FlexCel Studio for the .NET Framework documentation

TImageProperties.Dec Method

Returns a COPY of the class with its coords decremented by 1.

Syntax

Namespace: FlexCel.Core

public virtual TImageProperties Dec()

See also

  • TImageProperties


TImageProperties.DecNoCopy Method | FlexCel Studio for the .NET Framework documentation

TImageProperties.DecNoCopy Method

Decrements the anchor of the image, and returns the SAME object. This method doesn't clone the TImageProperties object.

Syntax

Namespace: FlexCel.Core

public virtual TImageProperties DecNoCopy()

See also

  • TImageProperties


TImageProperties.Clone Method | FlexCel Studio for the .NET Framework documentation

TImageProperties.Clone Method

Performs a deep copy of the object.

Syntax

Namespace: FlexCel.Core

public override TBaseImageProperties Clone()

See also

  • TImageProperties


TImageProperties.EqualValues Method | FlexCel Studio for the .NET Framework documentation

TImageProperties.EqualValues Method

Returns true if both instances of the objects contain the same values. Instances might be different, this method will return if their values are equal. Instances can be null.

Syntax

Namespace: FlexCel.Core

public static Boolean EqualValues(TImageProperties a1, TImageProperties a2)

Parameters

<-> | Parameter | Type | Description
 | a1 | TImageProperties | First instance to compare.
 | a2 | TImageProperties | Second instance to compare.

See also

  • TImageProperties


TImageProperties.Anchor Property | FlexCel Studio for the .NET Framework documentation

TImageProperties.Anchor Property

Image position

Syntax

Namespace: FlexCel.Core

public TClientAnchor Anchor { get; set; }

See also

  • TImageProperties


TImageProperties.ShapeName Property | FlexCel Studio for the .NET Framework documentation

TImageProperties.ShapeName Property

Name of the image. It sets/gets the name of the shape for the image as you can see it on the names combobox. If you set it to null Excel will show a generic name, like "Picture 31"

Syntax

Namespace: FlexCel.Core

public String ShapeName { get; set; }

See also

  • TImageProperties


TImageProperties.AltText Property | FlexCel Studio for the .NET Framework documentation

TImageProperties.AltText Property

Alternative Text. This is the same as the "Alt Text" tab in the properties dialog for the image, and is used when exporting to HTML.

Syntax

Namespace: FlexCel.Core

public String AltText { get; set; }

See also

  • TImageProperties


TImageProperties.Title Property | FlexCel Studio for the .NET Framework documentation

TImageProperties.Title Property

Specifies the title (caption) of the current object.

Syntax

Namespace: FlexCel.Core

public String Title { get; set; }

See also

  • TImageProperties


TImageProperties.IsCameraObject Property | FlexCel Studio for the .NET Framework documentation

TImageProperties.IsCameraObject Property

Returns true if this is a camera object

Syntax

Namespace: FlexCel.Core

public Boolean IsCameraObject { get; set; }

See also

  • TImageProperties


TImplementedFunction Class | FlexCel Studio for the .NET Framework documentation

TImplementedFunction Class

Data of an implemented formula function.

Syntax

Namespace: FlexCel.Core

public class TImplementedFunction

Constructors

Name | Description
TImplementedFunction | Creates a new TImplementedFunction with supplied values.

Properties

Name | Description
Id | Formula ID. (Excel specific)
FunctionName | Formula Name.
MinArgCount | Minimum argument count for the function.
MaxArgCount | Maximum argument count for the function.


TImplementedFunction.TImplementedFunction Constructor | FlexCel Studio for the .NET Framework documentation

TImplementedFunction.TImplementedFunction Constructor

Creates a new TImplementedFunction with supplied values.

Syntax

Namespace: FlexCel.Core

public TImplementedFunction(Int32 aId, String aFunctionName, Int32 aMinArgCount, Int32 aMaxArgCount)

Parameters

<-> | Parameter | Type | Description
 | aId | Int32 | Formula ID
 | aFunctionName | String | Formula Name
 | aMinArgCount | Int32 | Minimum argument count for the function.
 | aMaxArgCount | Int32 | Maximum argument count for the function.

See also

  • TImplementedFunction


TImplementedFunction.Id Property | FlexCel Studio for the .NET Framework documentation

TImplementedFunction.Id Property

Formula ID. (Excel specific)

Syntax

Namespace: FlexCel.Core

public Int32 Id { get; set; }

See also

  • TImplementedFunction


TImplementedFunction.FunctionName Property | FlexCel Studio for the .NET Framework documentation

TImplementedFunction.FunctionName Property

Formula Name.

Syntax

Namespace: FlexCel.Core

public String FunctionName { get; set; }

See also

  • TImplementedFunction


TImplementedFunction.MinArgCount Property | FlexCel Studio for the .NET Framework documentation

TImplementedFunction.MinArgCount Property

Minimum argument count for the function.

Syntax

Namespace: FlexCel.Core

public Int32 MinArgCount { get; set; }

See also

  • TImplementedFunction


TImplementedFunction.MaxArgCount Property | FlexCel Studio for the .NET Framework documentation

TImplementedFunction.MaxArgCount Property

Maximum argument count for the function.

Syntax

Namespace: FlexCel.Core

public Int32 MaxArgCount { get; set; }

See also

  • TImplementedFunction


TImplementedFunctionList Class | FlexCel Studio for the .NET Framework documentation

TImplementedFunctionList Class

Holds a list of currently implemented formula functions on FlexCel.

Syntax

Namespace: FlexCel.Core

public class TImplementedFunctionList: Dictionary

Constructors

Name | Description
TImplemented​Function​List | Creates and initializes a list with all implemented functions.


TImplementedFunctionList.TImplementedFunctionList Constructor | FlexCel Studio for the .NET Framework documentation

TImplementedFunctionList.TImplementedFunctionList Constructor

Creates and initializes a list with all implemented functions.

Syntax

Namespace: FlexCel.Core

public TImplementedFunctionList()

See also

  • TImplementedFunctionList


TInnerShadowEffect Class | FlexCel Studio for the .NET Framework documentation

TInnerShadowEffect Class

An inner shadow effect.

Syntax

Namespace: FlexCel.Core

public class TInnerShadowEffect: TDrawingEffect, IComparable, IComparable<TInnerShadowEffect>

Constructors

Name | Description
TInnerShadowEffect | Creates a new inner shadow effect.

Methods

Name | Description
Clone | Creates a deep copy of the object.
CompareTo | Overloaded CompareTo(Object) CompareTo(TInnerShadowEffect)
Equals | Overloaded Equals(TInnerShadowEffect) Equals(Object)
GetHashCode | Returns the hashcode of the object.

Properties

Name | Description
ShadowColor | Color for the shadow.
BlurRadius | Blur radius.
Distance | Distance of the shadow.
Direction | Rotation of the shadow.


TInnerShadowEffect.TInnerShadowEffect Constructor | FlexCel Studio for the .NET Framework documentation

TInnerShadowEffect.TInnerShadowEffect Constructor

Creates a new inner shadow effect.

Syntax

Namespace: FlexCel.Core

public TInnerShadowEffect(TDrawingColor aShadowColor, Int64 aBlurRadius, Int64 aDistance, Double aDirection)

Parameters

<-> | Parameter | Type | Description
 | aShadowColor | TDrawingColor | Color of the Shadow.
 | aBlurRadius | Int64 | Blur radius.
 | aDistance | Int64 | Distance.
 | aDirection | Double | Rotation of the shadow.

See also

  • TInnerShadowEffect


TInnerShadowEffect.Clone Method | FlexCel Studio for the .NET Framework documentation

TInnerShadowEffect.Clone Method

Creates a deep copy of the object.

Syntax

Namespace: FlexCel.Core

public TInnerShadowEffect Clone()

See also

  • TInnerShadowEffect


TInnerShadowEffect.CompareTo Method | FlexCel Studio for the .NET Framework documentation

TInnerShadowEffect.CompareTo Method

Overloads

  • TInnerShadowEffect.CompareTo(Object)
  • TInnerShadowEffect.CompareTo(TInnerShadowEffect)

TInnerShadowEffect.CompareTo(Object)

Returns -1, 0 or 1 depending if this object is smaller or bigger than the other.

Syntax

Namespace: FlexCel.Core

public Int32 CompareTo(Object other)

Parameters

<-> | Parameter | Type | Description
 | other | Object |

See also

  • TInnerShadowEffect

TInnerShadowEffect.CompareTo(TInnerShadowEffect)

Returns -1, 0 or 1 depending if this object is smaller or bigger than the other.

Syntax

Namespace: FlexCel.Core

public Int32 CompareTo(TInnerShadowEffect other)

Parameters

<-> | Parameter | Type | Description
 | other | TInnerShadowEffect |

See also

  • TInnerShadowEffect


TInnerShadowEffect.Equals Method | FlexCel Studio for the .NET Framework documentation

TInnerShadowEffect.Equals Method

Overloads

  • TInnerShadowEffect.Equals(TInnerShadowEffect)
  • TInnerShadowEffect.Equals(Object)

TInnerShadowEffect.Equals(TInnerShadowEffect)

Returns true if both objects are the same.

Syntax

Namespace: FlexCel.Core

protected Boolean Equals(TInnerShadowEffect other)

Parameters

<-> | Parameter | Type | Description
 | other | TInnerShadowEffect |

See also

  • TInnerShadowEffect

TInnerShadowEffect.Equals(Object)

Returns true if both objects are the same.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object other)

Parameters

<-> | Parameter | Type | Description
 | other | Object |

See also

  • TInnerShadowEffect


TInnerShadowEffect.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TInnerShadowEffect.GetHashCode Method

Returns the hashcode of the object.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TInnerShadowEffect


TInnerShadowEffect.ShadowColor Property | FlexCel Studio for the .NET Framework documentation

TInnerShadowEffect.ShadowColor Property

Color for the shadow.

Syntax

Namespace: FlexCel.Core

public TDrawingColor ShadowColor { get; }

See also

  • TInnerShadowEffect


TInnerShadowEffect.BlurRadius Property | FlexCel Studio for the .NET Framework documentation

TInnerShadowEffect.BlurRadius Property

Blur radius.

Syntax

Namespace: FlexCel.Core

public Int64 BlurRadius { get; }

See also

  • TInnerShadowEffect


TInnerShadowEffect.Distance Property | FlexCel Studio for the .NET Framework documentation

TInnerShadowEffect.Distance Property

Distance of the shadow.

Syntax

Namespace: FlexCel.Core

public Int64 Distance { get; }

See also

  • TInnerShadowEffect


TInnerShadowEffect.Direction Property | FlexCel Studio for the .NET Framework documentation

TInnerShadowEffect.Direction Property

Rotation of the shadow.

Syntax

Namespace: FlexCel.Core

public Double Direction { get; }

See also

  • TInnerShadowEffect


TLegendEntryOptions Class | FlexCel Studio for the .NET Framework documentation

TLegendEntryOptions Class

Description of one particular entry on the Legend box.

Syntax

Namespace: FlexCel.Core

public class TLegendEntryOptions: ICloneable

Constructors

Name | Description
TLegendEntryOptions | Creates a new TLegendEntryOptions instance.

Methods

Name | Description
Clone | Returns a deep copy of this object.

Properties

Name | Description
EntryDeleted | If true, this series has been deleted from the legend box, and it should not be displayed.
TextFormat | Font to use on this particular entry. If null, the default font for the legend box should be used.


TLegendEntryOptions.TLegendEntryOptions Constructor | FlexCel Studio for the .NET Framework documentation

TLegendEntryOptions.TLegendEntryOptions Constructor

Creates a new TLegendEntryOptions instance.

Syntax

Namespace: FlexCel.Core

public TLegendEntryOptions(Boolean aEntryDeleted, TChartTextOptions aTextFormat)

Parameters

<-> | Parameter | Type | Description
 | aEntryDeleted | Boolean | See EntryDeleted
 | aTextFormat | TChartTextOptions | See TextFormat

See also

  • TLegendEntryOptions


TLegendEntryOptions.Clone Method | FlexCel Studio for the .NET Framework documentation

TLegendEntryOptions.Clone Method

Returns a deep copy of this object.

Syntax

Namespace: FlexCel.Core

public Object Clone()

See also

  • TLegendEntryOptions


TLegendEntryOptions.EntryDeleted Property | FlexCel Studio for the .NET Framework documentation

TLegendEntryOptions.EntryDeleted Property

If true, this series has been deleted from the legend box, and it should not be displayed.

Syntax

Namespace: FlexCel.Core

public Boolean EntryDeleted { get; set; }

See also

  • TLegendEntryOptions


TLegendEntryOptions.TextFormat Property | FlexCel Studio for the .NET Framework documentation

TLegendEntryOptions.TextFormat Property

Font to use on this particular entry. If null, the default font for the legend box should be used.

Syntax

Namespace: FlexCel.Core

public TChartTextOptions TextFormat { get; set; }

See also

  • TLegendEntryOptions


TLegendOptionsList Class | FlexCel Studio for the .NET Framework documentation

TLegendOptionsList Class

A list of options for the legend on the whole series and for specific data points inside these series.

Syntax

Namespace: FlexCel.Core

public class TLegendOptionsList: IEnumerable<Int32>

Constructors

Name | Description
TLegendOptionsList | Creates a new TLegendOptionsList instance.

Methods

Name | Description
Add | Adds a new option to the list. If the option is null, nothing will be done.
GetValues | Gets all the values of the series.
GetEnumerator | Gets the enumerator for this class.

Properties

Name | Description
this[] | Gets or sets the value for a data point or for the whole series (when key = -1).


TLegendOptionsList.TLegendOptionsList Constructor | FlexCel Studio for the .NET Framework documentation

TLegendOptionsList.TLegendOptionsList Constructor

Creates a new TLegendOptionsList instance.

Syntax

Namespace: FlexCel.Core

public TLegendOptionsList()

See also

  • TLegendOptionsList


TLegendOptionsList.Add Method | FlexCel Studio for the .NET Framework documentation

TLegendOptionsList.Add Method

Adds a new option to the list. If the option is null, nothing will be done.

Syntax

Namespace: FlexCel.Core

public void Add(Int32 PointNumber, TLegendEntryOptions Options)

Parameters

<-> | Parameter | Type | Description
 | PointNumber | Int32 | Point where this value applies. -1 means the whole series.
 | Options | TLegendEntryOptions | Options to add.

See also

  • TLegendOptionsList


TLegendOptionsList.GetValues Method | FlexCel Studio for the .NET Framework documentation

TLegendOptionsList.GetValues Method

Gets all the values of the series.

Syntax

Namespace: FlexCel.Core

public TLegendEntryOptions[] GetValues()

See also

  • TLegendOptionsList


TLegendOptionsList.GetEnumerator Method | FlexCel Studio for the .NET Framework documentation

TLegendOptionsList.GetEnumerator Method

Gets the enumerator for this class.

Syntax

Namespace: FlexCel.Core

public IEnumerator GetEnumerator()

See also

  • TLegendOptionsList


TLegendOptionsList.this[] Property | FlexCel Studio for the .NET Framework documentation

TLegendOptionsList.this[] Property

Gets or sets the value for a data point or for the whole series (when key = -1).

Syntax

Namespace: FlexCel.Core

public TLegendEntryOptions this[] { get; set; }

See also

  • TLegendOptionsList


TLineChartOptions Class | FlexCel Studio for the .NET Framework documentation

TLineChartOptions Class

Options specific for a Line chart.

Syntax

Namespace: FlexCel.Core

public class TLineChartOptions: TAreaLineChartOptions

Constructors

Name Description
TLineChartOptions Overloaded
 TLineChartOptions(Boolean, TStackedMode, TChartDropBars)
TLineChartOptions(Int32, Boolean, Int32, TStackedMode, Boolean, ChartSeriesOptions, TChartDropBars, TDataLabel)


TLineChartOptions.TLineChartOptions Constructor | FlexCel Studio for the .NET Framework documentation

TLineChartOptions.TLineChartOptions Constructor

Overloads

  • TLineChartOptions.TLineChartOptions(Boolean, TStackedMode, TChartDropBars)
  • TLineChartOptions.TLineChartOptions(Int32, Boolean, Int32, TStackedMode, Boolean, ChartSeriesOptions, TChartDropBars, TDataLabel)

TLineChartOptions.TLineChartOptions(Boolean, TStackedMode, TChartDropBars)

Creates a new TLineChartOptions instance. This overload is simplified for the values that make sense when setting the chart options.

Syntax

Namespace: FlexCel.Core

public TLineChartOptions(Boolean aChangeColorsOnEachSeries, TStackedMode aStackedMode, TChartDropBars aDropBars)

Parameters

<-> | Parameter | Type | Description
 | aChangeColorsOnEachSeries | Boolean | If false, all series will be the same color.
 | aStackedMode | TStackedMode | TStackedMode of the chart.
 | aDropBars | TChartDropBars | Drop bars and lines information. This value will be copied.

See also

  • TLineChartOptions

TLineChartOptions.TLineChartOptions(Int32, Boolean, Int32, TStackedMode, Boolean, ChartSeriesOptions, TChartDropBars, TDataLabel)

Creates a new TLineChartOptions instance.

Syntax

Namespace: FlexCel.Core

public TLineChartOptions(Int32 aAxisNumber, Boolean aChangeColorsOnEachSeries, Int32 aZOrder, TStackedMode aStackedMode, Boolean aHasShadow, ChartSeriesOptions aSeriesOptions, TChartDropBars aDropBars, TDataLabel aDefaultLabel)

Parameters

<-> | Parameter | Type | Description
 | aAxisNumber | Int32 | Axis where this chart group belongs, 0 is primary, 1 is secondary.
 | aChangeColorsOnEachSeries | Boolean | If false, all series will be the same color.
 | aZOrder | Int32 | Z-Order of this chart group, with 0 being the bottom. Chart groups with lower z-Order are drawn below the ones with higher ones.
 | aStackedMode | TStackedMode | TStackedMode of the chart.
 | aHasShadow | Boolean | True if the chart lines have shadows.
 | aSeriesOptions | ChartSeriesOptions | Global options that apply to all the series on this group. This instance will be copied.
 | aDropBars | TChartDropBars | Drop bars and lines information. This value will be copied.
 | aDefaultLabel | TDataLabel | Default label properties for labels in this group.

See also

  • TLineChartOptions


TLineStyle Class | FlexCel Studio for the .NET Framework documentation

TLineStyle Class

Definition for a Drawing line style.

Syntax

Namespace: FlexCel.Core

public class TLineStyle: IComparable

Fields

Name | Description
DefaultWidth | Default line width.

Constructors

Name Description
TLineStyle Overloaded
 TLineStyle(TFillStyle)
TLineStyle(TFillStyle, Nullable<Int32>)
TLineStyle(TDrawingColor, Nullable<Int32>)
TLineStyle(TFillStyle, Nullable<Int32>, Nullable<TPenAlignment>, Nullable<TLineCap>, Nullable<TCompoundLineType>, Nullable<TLineDashing>, Nullable<TLineJoin>, Nullable<Double>, Nullable<TLineArrow>, Nullable<TLineArrow>)

Methods

Name | Description
Clone | Returns a deep copy of the fill style.
Equals | Returns true if this instance has the same data as the object obj.
GetHashCode | Returns the hashcode for this object
CompareTo | Returns -1, 0 or 1 depending if the object is smaller, equal or bigger than the other.

Properties

Name | Description
Fill | Line color and/or fill.
Width | Width of the line in EMUs (1 pt = 12700 EMUs). If null, width of the theme will be used.
PenAlign | Specifies the alignment to be used for the underline stroke. If null, default from the theme will be used.
LineCap | How the line ends. If null, default from the theme will be used.
CompoundLineType | Compound line style. If null, default from the theme will be used.
Dashing | Line dashing. If null, default from the theme will be used.
Join | How the line joins with the next. If null, default from the theme will be used.
MiterLim | The amount by which lines is extended to form a miter join, when Join is TLineJoin.Miter.
HeadArrow | Head arrow if it has one. If null, default from the theme will be used.
TailArrow | Tail arrow if it has one. If null, default from the theme will be used.


TLineStyle.DefaultWidth Field | FlexCel Studio for the .NET Framework documentation

TLineStyle.DefaultWidth Field

Default line width.

Syntax

Namespace: FlexCel.Core

public const Int32 DefaultWidth = 9525

See also

  • TLineStyle


TLineStyle.TLineStyle Constructor | FlexCel Studio for the .NET Framework documentation

TLineStyle.TLineStyle Constructor

Overloads

  • TLineStyle.TLineStyle(TFillStyle)
  • TLineStyle.TLineStyle(TFillStyle, Nullable<Int32>)
  • TLineStyle.TLineStyle(TDrawingColor, Nullable<Int32>)
  • TLineStyle.TLineStyle(TFillStyle, Nullable<Int32>, Nullable<TPenAlignment>, Nullable<TLineCap>, Nullable<TCompoundLineType>, Nullable<TLineDashing>, Nullable<TLineJoin>, Nullable<Double>, Nullable<TLineArrow>, Nullable<TLineArrow>)

TLineStyle.TLineStyle(TFillStyle)

Creates a simple line with most values by default, including default width.

Syntax

Namespace: FlexCel.Core

public TLineStyle(TFillStyle aFill)

Parameters

<-> | Parameter | Type | Description
 | aFill | TFillStyle | Fill for the line.

See also

  • TLineStyle

TLineStyle.TLineStyle(TFillStyle, Nullable<Int32>)

Creates a simple line with most values by default.

Syntax

Namespace: FlexCel.Core

public TLineStyle(TFillStyle aFill, Nullable<Int32> aWidth)

Parameters

<-> | Parameter | Type | Description
 | aFill | TFillStyle | Fill for the line.
 | aWidth | Nullable<Int32> | Width of the line in EMUs (1 pt = 12700 EMUs). If null, width of the theme will be used.

See also

  • TLineStyle

TLineStyle.TLineStyle(TDrawingColor, Nullable<Int32>)

Creates a simple line with a solid color and most values by default.

Syntax

Namespace: FlexCel.Core

public TLineStyle(TDrawingColor aColor, Nullable<Int32> aWidth)

Parameters

<-> | Parameter | Type | Description
 | aColor | TDrawingColor | Color for the line.
 | aWidth | Nullable<Int32> | Width of the line in EMUs (1 pt = 12700 EMUs). If null, width of the theme will be used.

See also

  • TLineStyle

TLineStyle.TLineStyle(TFillStyle, Nullable<Int32>, Nullable<TPenAlignment>, Nullable<TLineCap>, Nullable<TCompoundLineType>, Nullable<TLineDashing>, Nullable<TLineJoin>, Nullable<Double>, Nullable<TLineArrow>, Nullable<TLineArrow>)

Initializes the line style.

Syntax

Namespace: FlexCel.Core

public TLineStyle(TFillStyle aFill, Nullable<Int32> aWidth, Nullable<TPenAlignment> aPenAlign, Nullable<TLineCap> aLineCap, Nullable<TCompoundLineType> aCompoundLineType, Nullable<TLineDashing> aDashing, Nullable<TLineJoin> aJoin, Nullable<Double> aMiterLim, Nullable<TLineArrow> aHeadArrow, Nullable<TLineArrow> aTailArrow)

Parameters

<-> | Parameter | Type | Description
 | aFill | TFillStyle |
 | aWidth | Nullable<Int32> |
 | aPenAlign | Nullable<TPenAlignment> |
 | aLineCap | Nullable<TLineCap> |
 | aCompoundLineType | Nullable<TCompoundLineType> |
 | aDashing | Nullable<TLineDashing> |
 | aJoin | Nullable<TLineJoin> |
 | aMiterLim | Nullable<Double> |
 | aHeadArrow | Nullable<TLineArrow> |
 | aTailArrow | Nullable<TLineArrow> |

See also

  • TLineStyle


TLineStyle.Clone Method | FlexCel Studio for the .NET Framework documentation

TLineStyle.Clone Method

Returns a deep copy of the fill style.

Syntax

Namespace: FlexCel.Core

public virtual TLineStyle Clone()

See also

  • TLineStyle


TLineStyle.Equals Method | FlexCel Studio for the .NET Framework documentation

TLineStyle.Equals Method

Returns true if this instance has the same data as the object obj.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TLineStyle


TLineStyle.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TLineStyle.GetHashCode Method

Returns the hashcode for this object

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TLineStyle


TLineStyle.CompareTo Method | FlexCel Studio for the .NET Framework documentation

TLineStyle.CompareTo Method

Returns -1, 0 or 1 depending if the object is smaller, equal or bigger than the other.

Syntax

Namespace: FlexCel.Core

public Int32 CompareTo(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TLineStyle


TLineStyle.Fill Property | FlexCel Studio for the .NET Framework documentation

TLineStyle.Fill Property

Line color and/or fill.

Syntax

Namespace: FlexCel.Core

public TFillStyle Fill { get; }

See also

  • TLineStyle


TLineStyle.Width Property | FlexCel Studio for the .NET Framework documentation

TLineStyle.Width Property

Width of the line in EMUs (1 pt = 12700 EMUs). If null, width of the theme will be used.

Syntax

Namespace: FlexCel.Core

public Nullable<Int32> Width { get; }

See also

  • TLineStyle


TLineStyle.PenAlign Property | FlexCel Studio for the .NET Framework documentation

TLineStyle.PenAlign Property

Specifies the alignment to be used for the underline stroke. If null, default from the theme will be used.

Syntax

Namespace: FlexCel.Core

public Nullable<TPenAlignment> PenAlign { get; }

See also

  • TLineStyle


TLineStyle.LineCap Property | FlexCel Studio for the .NET Framework documentation

TLineStyle.LineCap Property

How the line ends. If null, default from the theme will be used.

Syntax

Namespace: FlexCel.Core

public Nullable<TLineCap> LineCap { get; }

See also

  • TLineStyle


TLineStyle.CompoundLineType Property | FlexCel Studio for the .NET Framework documentation

TLineStyle.CompoundLineType Property

Compound line style. If null, default from the theme will be used.

Syntax

Namespace: FlexCel.Core

public Nullable<TCompoundLineType> CompoundLineType { get; }

See also

  • TLineStyle


TLineStyle.Dashing Property | FlexCel Studio for the .NET Framework documentation

TLineStyle.Dashing Property

Line dashing. If null, default from the theme will be used.

Syntax

Namespace: FlexCel.Core

public Nullable<TLineDashing> Dashing { get; }

See also

  • TLineStyle


TLineStyle.Join Property | FlexCel Studio for the .NET Framework documentation

TLineStyle.Join Property

How the line joins with the next. If null, default from the theme will be used.

Syntax

Namespace: FlexCel.Core

public Nullable<TLineJoin> Join { get; }

See also

  • TLineStyle


TLineStyle.MiterLim Property | FlexCel Studio for the .NET Framework documentation

TLineStyle.MiterLim Property

The amount by which lines is extended to form a miter join, when Join is TLineJoin.Miter.

Syntax

Namespace: FlexCel.Core

public Nullable<Double> MiterLim { get; }

See also

  • TLineStyle


TLineStyle.HeadArrow Property | FlexCel Studio for the .NET Framework documentation

TLineStyle.HeadArrow Property

Head arrow if it has one. If null, default from the theme will be used.

Syntax

Namespace: FlexCel.Core

public Nullable<TLineArrow> HeadArrow { get; }

See also

  • TLineStyle


TLineStyle.TailArrow Property | FlexCel Studio for the .NET Framework documentation

TLineStyle.TailArrow Property

Tail arrow if it has one. If null, default from the theme will be used.

Syntax

Namespace: FlexCel.Core

public Nullable<TLineArrow> TailArrow { get; }

See also

  • TLineStyle


TLineStyleList Class | FlexCel Studio for the .NET Framework documentation

TLineStyleList Class

Represents the line style characteristics.

Syntax

Namespace: FlexCel.Core

public class TLineStyleList

Constructors

Name | Description
TLineStyleList | Creates a new instance.

Methods

Name | Description
Clone | Returns a deep copy of the object.
GetRealFillStyle | Returns the line color that results from applying the formatting type to a color.
Add | Adds a new LineStyle to the collection. Line styles must be added in order, first is "Subtle", second is "Moderate", third is "Intense" and there could be new definitions in newer versions of Excel.

Properties

Name | Description
Count | Count of line styles.
this[] | Returns the line style for a given formatting type. Currently Excel defines only 3 formatting types, but more could be added in the future. If you need to access a formatting type that is not defined in the TFormattingType enumeration, just cast an integer to TFormattingType.


TLineStyleList.TLineStyleList Constructor | FlexCel Studio for the .NET Framework documentation

TLineStyleList.TLineStyleList Constructor

Creates a new instance.

Syntax

Namespace: FlexCel.Core

public TLineStyleList()

See also

  • TLineStyleList


TLineStyleList.Clone Method | FlexCel Studio for the .NET Framework documentation

TLineStyleList.Clone Method

Returns a deep copy of the object.

Syntax

Namespace: FlexCel.Core

public TLineStyleList Clone()

See also

  • TLineStyleList


TLineStyleList.GetRealFillStyle Method | FlexCel Studio for the .NET Framework documentation

TLineStyleList.GetRealFillStyle Method

Returns the line color that results from applying the formatting type to a color.

Syntax

Namespace: FlexCel.Core

public TFillStyle GetRealFillStyle(TFormattingType index, TDrawingColor basicColor)

Parameters

<-> | Parameter | Type | Description
 | index | TFormattingType | Index to the collection.
 | basicColor | TDrawingColor | Color that will be used as a base to calculate the fill style.

See also

  • TLineStyleList


TLineStyleList.Add Method | FlexCel Studio for the .NET Framework documentation

TLineStyleList.Add Method

Adds a new LineStyle to the collection. Line styles must be added in order, first is "Subtle", second is "Moderate", third is "Intense" and there could be new definitions in newer versions of Excel.

Syntax

Namespace: FlexCel.Core

public void Add(TLineStyle aLineStyle)

Parameters

<-> | Parameter | Type | Description
 | aLineStyle | TLineStyle | Line style to add.

See also

  • TLineStyleList


TLineStyleList.Count Property | FlexCel Studio for the .NET Framework documentation

TLineStyleList.Count Property

Count of line styles.

Syntax

Namespace: FlexCel.Core

public Int32 Count { get; }

See also

  • TLineStyleList


TLineStyleList.this[] Property | FlexCel Studio for the .NET Framework documentation

TLineStyleList.this[] Property

Returns the line style for a given formatting type. Currently Excel defines only 3 formatting types, but more could be added in the future. If you need to access a formatting type that is not defined in the TFormattingType enumeration, just cast an integer to TFormattingType.

Syntax

Namespace: FlexCel.Core

public TLineStyle this[] { get; set; }

See also

  • TLineStyleList


TLinkedStyle Class | FlexCel Studio for the .NET Framework documentation

TLinkedStyle Class

This class is used as a part of a TFlxFormat class, and stores how a cell format is linked to a style.

Syntax

Namespace: FlexCel.Core

public class TLinkedStyle: ICloneable

Methods

Name | Description
Assign | Copies a new style into this object.
SameData | Returns true if the 2 instances have the same data.
Clone | Returns a deep copy of the object.
Equals | Returns true if obj and this object have the same value.
GetHashCode | Returns a hashcode for this object.

Properties

Name | Description
AutomaticChoose | When this property is true (the default) FlexCel will automatically choose which linked properties to apply depending on what changes from the base style. For example, if this style has a different font than the basic style, the font will be not linked, and when you change the base style it will keep the same. Excel behaves this way when it adds styles. To manually choose what the format will affect, set this to none. This property doesn't correspond with any Excel property, and it is not stored in the file.
LinkedNumericFormat | If true, the numeric format will be linked to the parent style, and it will change when you change the style. If false the numeric format will not change even if you change it in the base style. Note that this property has no effect unless AutomaticChoose is false.
LinkedFont | If true, the font will be linked to the parent style, and it will change when you change the style. If false the font will not change even if you change it in the base style. Note that this property has no effect unless AutomaticChoose is false.
LinkedAlignment | If true, the alignment will be linked to the parent style, and it will change when you change the style. If false the alignment not change even if you change it in the base style. Note that this property has no effect unless AutomaticChoose is false.
LinkedBorder | If true, the border will be linked to the parent style, and it will change when you change the style. If false the border will not change even if you change it in the base style. Note that this property has no effect unless AutomaticChoose is false.
LinkedFill | If true, the fill pattern will be linked to the parent style, and it will change when you change the style. If false the fill pattern will not change even if you change it in the base style. Note that this property has no effect unless AutomaticChoose is false.
LinkedProtection | If true, the protection will be linked to the parent style, and it will change when you change the style. If false the protection will not change even if you change it in the base style. Note that this property has no effect unless AutomaticChoose is false.


TLinkedStyle.Assign Method | FlexCel Studio for the .NET Framework documentation

TLinkedStyle.Assign Method

Copies a new style into this object.

Syntax

Namespace: FlexCel.Core

public void Assign(TLinkedStyle newStyle)

Parameters

<-> | Parameter | Type | Description
 | newStyle | TLinkedStyle | Style with the values to copy.

See also

  • TLinkedStyle


TLinkedStyle.SameData Method | FlexCel Studio for the .NET Framework documentation

TLinkedStyle.SameData Method

Returns true if the 2 instances have the same data.

Syntax

Namespace: FlexCel.Core

public Boolean SameData(TLinkedStyle otherStyle)

Parameters

<-> | Parameter | Type | Description
 | otherStyle | TLinkedStyle | Style with which we want to compare.

Returns

True if otherStyle has the same values as this object.

See also

  • TLinkedStyle


TLinkedStyle.Clone Method | FlexCel Studio for the .NET Framework documentation

TLinkedStyle.Clone Method

Returns a deep copy of the object.

Syntax

Namespace: FlexCel.Core

public Object Clone()

See also

  • TLinkedStyle


TLinkedStyle.Equals Method | FlexCel Studio for the .NET Framework documentation

TLinkedStyle.Equals Method

Returns true if obj and this object have the same value.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object | Object to compare.

See also

  • TLinkedStyle


TLinkedStyle.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TLinkedStyle.GetHashCode Method

Returns a hashcode for this object.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TLinkedStyle


TLinkedStyle.AutomaticChoose Property | FlexCel Studio for the .NET Framework documentation

TLinkedStyle.AutomaticChoose Property

When this property is true (the default) FlexCel will automatically choose which linked properties to apply depending on what changes from the base style. For example, if this style has a different font than the basic style, the font will be not linked, and when you change the base style it will keep the same. Excel behaves this way when it adds styles. To manually choose what the format will affect, set this to none. This property doesn't correspond with any Excel property, and it is not stored in the file.

Syntax

Namespace: FlexCel.Core

public Boolean AutomaticChoose { get; set; }

See also

  • TLinkedStyle


TLinkedStyle.LinkedNumericFormat Property | FlexCel Studio for the .NET Framework documentation

TLinkedStyle.LinkedNumericFormat Property

If true, the numeric format will be linked to the parent style, and it will change when you change the style. If false the numeric format will not change even if you change it in the base style. Note that this property has no effect unless AutomaticChoose is false.

Syntax

Namespace: FlexCel.Core

public Boolean LinkedNumericFormat { get; set; }

See also

  • TLinkedStyle


TLinkedStyle.LinkedFont Property | FlexCel Studio for the .NET Framework documentation

TLinkedStyle.LinkedFont Property

If true, the font will be linked to the parent style, and it will change when you change the style. If false the font will not change even if you change it in the base style. Note that this property has no effect unless AutomaticChoose is false.

Syntax

Namespace: FlexCel.Core

public Boolean LinkedFont { get; set; }

See also

  • TLinkedStyle


TLinkedStyle.LinkedAlignment Property | FlexCel Studio for the .NET Framework documentation

TLinkedStyle.LinkedAlignment Property

If true, the alignment will be linked to the parent style, and it will change when you change the style. If false the alignment not change even if you change it in the base style. Note that this property has no effect unless AutomaticChoose is false.

Syntax

Namespace: FlexCel.Core

public Boolean LinkedAlignment { get; set; }

See also

  • TLinkedStyle


TLinkedStyle.LinkedBorder Property | FlexCel Studio for the .NET Framework documentation

TLinkedStyle.LinkedBorder Property

If true, the border will be linked to the parent style, and it will change when you change the style. If false the border will not change even if you change it in the base style. Note that this property has no effect unless AutomaticChoose is false.

Syntax

Namespace: FlexCel.Core

public Boolean LinkedBorder { get; set; }

See also

  • TLinkedStyle


TLinkedStyle.LinkedFill Property | FlexCel Studio for the .NET Framework documentation

TLinkedStyle.LinkedFill Property

If true, the fill pattern will be linked to the parent style, and it will change when you change the style. If false the fill pattern will not change even if you change it in the base style. Note that this property has no effect unless AutomaticChoose is false.

Syntax

Namespace: FlexCel.Core

public Boolean LinkedFill { get; set; }

See also

  • TLinkedStyle


TLinkedStyle.LinkedProtection Property | FlexCel Studio for the .NET Framework documentation

TLinkedStyle.LinkedProtection Property

If true, the protection will be linked to the parent style, and it will change when you change the style. If false the protection will not change even if you change it in the base style. Note that this property has no effect unless AutomaticChoose is false.

Syntax

Namespace: FlexCel.Core

public Boolean LinkedProtection { get; set; }

See also

  • TLinkedStyle


TMalformedUrlError Class | FlexCel Studio for the .NET Framework documentation

TMalformedUrlError Class

This class has information for a FlexCelError.MalformedUrl error. Look at FlexCelError.MalformedUrl for more information.

Syntax

Namespace: FlexCel.Core

public class TMalformedUrlError: TFlexCelErrorInfo

Constructors

Name | Description
TMalformedUrlError | Creates a new instance.

Properties

Name | Description
Url | Malformed url.


TMalformedUrlError.TMalformedUrlError Constructor | FlexCel Studio for the .NET Framework documentation

TMalformedUrlError.TMalformedUrlError Constructor

Creates a new instance.

Syntax

Namespace: FlexCel.Core

public TMalformedUrlError(String aMessage, String aUrl)

Parameters

<-> | Parameter | Type | Description
 | aMessage | String | See TFlexCelErrorInfo.Message
 | aUrl | String | See Url

See also

  • TMalformedUrlError


TMalformedUrlError.Url Property | FlexCel Studio for the .NET Framework documentation

TMalformedUrlError.Url Property

Malformed url.

Syntax

Namespace: FlexCel.Core

public String Url { get; }

See also

  • TMalformedUrlError


TMimeWriter Class | FlexCel Studio for the .NET Framework documentation

TMimeWriter Class

A simple class used to create MIME formatted messages. While it does not provide much functionality, it gives enough to create simple multipart archives.

Syntax

Namespace: FlexCel.Core

public class TMimeWriter

Methods

Name | Description
CreateMultiPart​Message | Creates the headers for a multipart MIME file. This must be the first method to call in order to create a MIME file. After this, you need to call AddPartHeader and start adding the parts of the message, and you always need to end the message by calling EndMultiPartMessage.
AddPartHeader | Adds the header for a part in a multipart Mime message. After calling this method, you need to write your data content into the TextWriter using WriteQuotedPrintable or WriteBase64 and after that always call EndPart.
EndPart | Ends a MIME part started with AddPartHeader.
EndMultiPartMessage | Call this method after the last call to EndPart, to finish the MIME message.
QEncode | Returns the Q-encode of a string, used in the MIME Headers. //RFC 2047
WriteQuotedPrintable | Writes the Quoted Printable encoding of a string, as defined in RFC 2045 section 6.7 This method keeps state and breaks the line every time it is longer than 76 characters. The state is reset each time AddPartHeader is called.
WriteBase64 | Writes the base64 encoding of a byte array, as defined in RFC 2045 section 6.8 This method does not keep the state, so all binary data must be supplied at once. As an alternative you could use System.​Convert.​ToBase64String(​byte[​]​, int, int), but this method avoids creating a temporary string, and then doubling the memory needed for the encoding. This method will also correctly split the string at 76 characters, while Convert.ToBase64 in .NET 1.1 will not. (2.0 added this support)


TMimeWriter.CreateMultiPartMessage Method | FlexCel Studio for the .NET Framework documentation

TMimeWriter.CreateMultiPartMessage Method

Creates the headers for a multipart MIME file. This must be the first method to call in order to create a MIME file. After this, you need to call AddPartHeader and start adding the parts of the message, and you always need to end the message by calling EndMultiPartMessage.

Syntax

Namespace: FlexCel.Core

public void CreateMultiPartMessage(TextWriter message, TMultipartType multipartType, String contentType, Uri contentLocation)

Parameters

<-> | Parameter | Type | Description
 | message | TextWriter |
 | multipartType | TMultipartType | Type of multipart for this file.
 | contentType | String | Type of the header as defined in the MIME standard, e.g. "text/plain", "text/html", etc. This is the type of the main part on a related message. Set it to null if there is no main part.
 | contentLocation | Uri | The location for the whole mime file. null if you do not want to set a location. for this to work in ie/opera, etc, this should be something like "file:///filename.ext"

See also

  • TMimeWriter


TMimeWriter.AddPartHeader Method | FlexCel Studio for the .NET Framework documentation

TMimeWriter.AddPartHeader Method

Adds the header for a part in a multipart Mime message. After calling this method, you need to write your data content into the TextWriter using WriteQuotedPrintable or WriteBase64 and after that always call EndPart.

Syntax

Namespace: FlexCel.Core

public void AddPartHeader(TextWriter message, String contentType, TContentTransferEncoding contentTransferEncoding, Uri contentLocation, String contentId, String encodingName)

Parameters

<-> | Parameter | Type | Description
 | message | TextWriter | TextWriter where you are saving the message.
 | contentType | String | Type of the header as defined in the MIME standard, e.g. "text/plain", "text/html", etc.
 | contentTransferEncoding | TContentTransfer​Encoding | How the part will be codified. Use base64 for binary TextWriter and quotedprintable for text.
 | contentLocation | Uri | The location for this resource. null if you do not want to set a location.
 | contentId | String | Content id of the resource, if you want to use it in cid: links. Null if you do not want to specify a content-id. Note that this string will not be escaped by the framework, so make sure it contains valid characters. As it needs to be globally unique, normally a GUID can be a good option here.
 | encodingName | String | Name for the encoding on this part. Null means do not write an encoding. (for example in binary parts)

See also

  • TMimeWriter


TMimeWriter.EndPart Method | FlexCel Studio for the .NET Framework documentation

TMimeWriter.EndPart Method

Ends a MIME part started with AddPartHeader.

Syntax

Namespace: FlexCel.Core

public void EndPart(TextWriter message)

Parameters

<-> | Parameter | Type | Description
 | message | TextWriter | TextWriter where you are saving the message.

See also

  • TMimeWriter


TMimeWriter.EndMultiPartMessage Method | FlexCel Studio for the .NET Framework documentation

TMimeWriter.EndMultiPartMessage Method

Call this method after the last call to EndPart, to finish the MIME message.

Syntax

Namespace: FlexCel.Core

public void EndMultiPartMessage(TextWriter message)

Parameters

<-> | Parameter | Type | Description
 | message | TextWriter |

See also

  • TMimeWriter


TMimeWriter.QEncode Method | FlexCel Studio for the .NET Framework documentation

TMimeWriter.QEncode Method

Returns the Q-encode of a string, used in the MIME Headers. //RFC 2047

Syntax

Namespace: FlexCel.Core

public static String QEncode(String s, TQEncodeMetaInfo addMetaInfo)

Parameters

<-> | Parameter | Type | Description
 | s | String | String to encode
 | addMetaInfo | TQEncodeMetaInfo | Defines if to add the string "=?charset?encoding?" will be appended at the begining, and "?=" at the end.

See also

  • TMimeWriter


TMimeWriter.WriteQuotedPrintable Method | FlexCel Studio for the .NET Framework documentation

TMimeWriter.WriteQuotedPrintable Method

Writes the Quoted Printable encoding of a string, as defined in RFC 2045 section 6.7 This method keeps state and breaks the line every time it is longer than 76 characters. The state is reset each time AddPartHeader is called.

Syntax

Namespace: FlexCel.Core

public void WriteQuotedPrintable(TextWriter Data, String s)

Parameters

<-> | Parameter | Type | Description
 | Data | TextWriter | TextWriter where we will write the data.
 | s | String | String to Encode.

See also

  • TMimeWriter


TMimeWriter.WriteBase64 Method | FlexCel Studio for the .NET Framework documentation

TMimeWriter.WriteBase64 Method

Writes the base64 encoding of a byte array, as defined in RFC 2045 section 6.8 This method does not keep the state, so all binary data must be supplied at once. As an alternative you could use System.Convert.ToBase64String(byte[], int, int), but this method avoids creating a temporary string, and then doubling the memory needed for the encoding. This method will also correctly split the string at 76 characters, while Convert.ToBase64 in .NET 1.1 will not. (2.0 added this support)

Syntax

Namespace: FlexCel.Core

public static void WriteBase64(TextWriter Data, Byte[] s)

Parameters

<-> | Parameter | Type | Description
 | Data | TextWriter | TextWriter where we will write the data.
 | s | Byte[] | String to Encode.

See also

  • TMimeWriter


TNoFill Class | FlexCel Studio for the .NET Framework documentation

TNoFill Class

There is no fill associated with the shapes.

Syntax

Namespace: FlexCel.Core

public class TNoFill: TFillStyle

Constructors

Name | Description
TNoFill | Creates a new TNoFill instance.

Methods

Name | Description
Equals | Returns true if this instance has the same data as the object obj.
GetHashCode | Returns the hashcode for this object


TNoFill.TNoFill Constructor | FlexCel Studio for the .NET Framework documentation

TNoFill.TNoFill Constructor

Creates a new TNoFill instance.

Syntax

Namespace: FlexCel.Core

public TNoFill()

See also

  • TNoFill


TNoFill.Equals Method | FlexCel Studio for the .NET Framework documentation

TNoFill.Equals Method

Returns true if this instance has the same data as the object obj.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TNoFill


TNoFill.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TNoFill.GetHashCode Method

Returns the hashcode for this object

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TNoFill


TObjectProperties Class | FlexCel Studio for the .NET Framework documentation

TObjectProperties Class

Holds the properties for an object.

Syntax

Namespace: FlexCel.Core

public class TObjectProperties: TImageProperties

Fields

Name | Description
FTextProperties | Internal use.
FAutoSize | Internal use.
FHidden | Internal use.
FCheckboxState | Internal use.
FLinkedFmla | Internal use.
FIs3D | Internal use.

Constructors

Name | Description
TObjectProperties | Overloaded TObjectProperties TObjectProperties(TClientAnchor) TObjectProperties(TClientAnchor, String) TObjectProperties(TClientAnchor, String, TObjectTextProperties, Boolean, Boolean)

Methods

Name | Description
EqualValues | Returns true if both instances of the objects contain the same values. Instances might be different, this method will return if their values are equal. Instances can be null.
Clone | Returns a deep copy of the object.

Properties

Name | Description
ShapeFill | Fill style used to fill the background of the comment. If you are using a solid color, only Indexed colors or RGB are allowed here, if you specify something else, the color will be converted to RGB. It might be a gradient fill or a texture too. If null, default fill style will be used.
InvertedFill | Fill style used to fill the background of bars in bar charts when the value is negative and "invert negative colors" is true.
ShapeBorder | Line style for the object.
EffectStyle | Effects for the object, like inner shadow or glow.
IsWebAddin | Returns true if the object is a web addin.


TObjectProperties.FTextProperties Field | FlexCel Studio for the .NET Framework documentation

TObjectProperties.FTextProperties Field

Internal use.

Syntax

Namespace: FlexCel.Core

protected internal TObjectTextProperties FTextProperties

See also

  • TObjectProperties


TObjectProperties.FAutoSize Field | FlexCel Studio for the .NET Framework documentation

TObjectProperties.FAutoSize Field

Internal use.

Syntax

Namespace: FlexCel.Core

protected internal Boolean FAutoSize

See also

  • TObjectProperties


TObjectProperties.FHidden Field | FlexCel Studio for the .NET Framework documentation

TObjectProperties.FHidden Field

Internal use.

Syntax

Namespace: FlexCel.Core

protected internal Boolean FHidden

See also

  • TObjectProperties


TObjectProperties.FCheckboxState Field | FlexCel Studio for the .NET Framework documentation

TObjectProperties.FCheckboxState Field

Internal use.

Syntax

Namespace: FlexCel.Core

protected internal TCheckboxState FCheckboxState

See also

  • TObjectProperties


TObjectProperties.FLinkedFmla Field | FlexCel Studio for the .NET Framework documentation

TObjectProperties.FLinkedFmla Field

Internal use.

Syntax

Namespace: FlexCel.Core

protected internal String FLinkedFmla

See also

  • TObjectProperties


TObjectProperties.FIs3D Field | FlexCel Studio for the .NET Framework documentation

TObjectProperties.FIs3D Field

Internal use.

Syntax

Namespace: FlexCel.Core

protected internal Boolean FIs3D

See also

  • TObjectProperties


TObjectProperties.TObjectProperties Constructor | FlexCel Studio for the .NET Framework documentation

TObjectProperties.TObjectProperties Constructor

Overloads

  • TObjectProperties.TObjectProperties
  • TObjectProperties.TObjectProperties(TClientAnchor)
  • TObjectProperties.TObjectProperties(TClientAnchor, String)
  • TObjectProperties.TObjectProperties(TClientAnchor, String, TObjectTextProperties, Boolean, Boolean)

TObjectProperties.TObjectProperties

Creates a new empty instance.

Syntax

Namespace: FlexCel.Core

public TObjectProperties()

See also

  • TObjectProperties

TObjectProperties.TObjectProperties(TClientAnchor)

This method will create a new copy of aAnchor, so you can modify it later.

Syntax

Namespace: FlexCel.Core

public TObjectProperties(TClientAnchor aAnchor)

Parameters

<-> | Parameter | Type | Description
 | aAnchor | TClientAnchor | Anchor. It will be copied here.

See also

  • TObjectProperties

TObjectProperties.TObjectProperties(TClientAnchor, String)

This method will create a new copy of aAnchor, so you can modify it later.

Syntax

Namespace: FlexCel.Core

public TObjectProperties(TClientAnchor aAnchor, String aShapeName)

Parameters

<-> | Parameter | Type | Description
 | aAnchor | TClientAnchor | Anchor. It will be copied here.
 | aShapeName | String | Shape name for the object, as it will appear on the names combo box.

See also

  • TObjectProperties

TObjectProperties.TObjectProperties(TClientAnchor, String, TObjectTextProperties, Boolean, Boolean)

This method will create a new copy of aAnchor, so you can modify it later.

Syntax

Namespace: FlexCel.Core

public TObjectProperties(TClientAnchor aAnchor, String aShapeName, TObjectTextProperties aTextProperties, Boolean aLock, Boolean aAutoSize)

Parameters

<-> | Parameter | Type | Description
 | aAnchor | TClientAnchor | Anchor. It will be copied here.
 | aShapeName | String | Name of the shape, as it appears on the names combobox. Set it to null to not add an imagename.
 | aTextProperties | TObjectTextProperties | Propertied of the text in the object.
 | aLock | Boolean | Specifies if the object is locked.
 | aAutoSize | Boolean | If true, the object will autosize to hold the text.

See also

  • TObjectProperties


TObjectProperties.EqualValues Method | FlexCel Studio for the .NET Framework documentation

TObjectProperties.EqualValues Method

Returns true if both instances of the objects contain the same values. Instances might be different, this method will return if their values are equal. Instances can be null.

Syntax

Namespace: FlexCel.Core

public static Boolean EqualValues(TObjectProperties a1, TObjectProperties a2)

Parameters

<-> | Parameter | Type | Description
 | a1 | TObjectProperties | First instance to compare.
 | a2 | TObjectProperties | Second instance to compare.

See also

  • TObjectProperties


TObjectProperties.Clone Method | FlexCel Studio for the .NET Framework documentation

TObjectProperties.Clone Method

Returns a deep copy of the object.

Syntax

Namespace: FlexCel.Core

public override TBaseImageProperties Clone()

See also

  • TObjectProperties


TObjectProperties.ShapeFill Property | FlexCel Studio for the .NET Framework documentation

TObjectProperties.ShapeFill Property

Fill style used to fill the background of the comment. If you are using a solid color, only Indexed colors or RGB are allowed here, if you specify something else, the color will be converted to RGB. It might be a gradient fill or a texture too. If null, default fill style will be used.

Syntax

Namespace: FlexCel.Core

public TShapeFill ShapeFill { get; set; }

See also

  • TObjectProperties


TObjectProperties.InvertedFill Property | FlexCel Studio for the .NET Framework documentation

TObjectProperties.InvertedFill Property

Fill style used to fill the background of bars in bar charts when the value is negative and "invert negative colors" is true.

Syntax

Namespace: FlexCel.Core

public TShapeFill InvertedFill { get; set; }

See also

  • TObjectProperties


TObjectProperties.ShapeBorder Property | FlexCel Studio for the .NET Framework documentation

TObjectProperties.ShapeBorder Property

Line style for the object.

Syntax

Namespace: FlexCel.Core

public TShapeLine ShapeBorder { get; set; }

See also

  • TObjectProperties


TObjectProperties.EffectStyle Property | FlexCel Studio for the .NET Framework documentation

TObjectProperties.EffectStyle Property

Effects for the object, like inner shadow or glow.

Syntax

Namespace: FlexCel.Core

public TEffectStyle EffectStyle { get; }

See also

  • TObjectProperties


TObjectProperties.IsWebAddin Property | FlexCel Studio for the .NET Framework documentation

TObjectProperties.IsWebAddin Property

Returns true if the object is a web addin.

Syntax

Namespace: FlexCel.Core

public Boolean IsWebAddin { get; }

See also

  • TObjectProperties


TObjectTextProperties Class | FlexCel Studio for the .NET Framework documentation

TObjectTextProperties Class

Specifies properties for the text in an autoshape or object.

Syntax

Namespace: FlexCel.Core

public class TObjectTextProperties: ICloneable

Constructors

Name | Description
TObjectTextProperties | Overloaded TObjectTextProperties TObjectTextProperties(Boolean, THFlxAlignment, TVFlxAlignment, TTextRotation)

Methods

Name | Description
EqualValues | Returns true if both instances of the objects contain the same values. Instances might be different, this method will return if their values are equal. Instances can be null.
Clone | Creates a new object that is a copy of the current instance.

Properties

Name | Description
LockText | Specifies if the text of the object is locked.
HAlignment | Horizontal alignment for the text in the object. Important: This property uses xls, not xlsx semantics, because it is used in comments which follow xls semantics even in xlsx files. For more information see Text Rotation In Xls And Xlsx
VAlignment | Horizontal alignment for the text in the object. Important: This property uses xls, not xlsx semantics, because it is used in comments which follow xls semantics even in xlsx files. For more information see Text Rotation In Xls And Xlsx
TextRotation | Determines how the text is oriented in the object. Important: This property uses xls, not xlsx semantics, because it is used in comments which follow xls semantics even in xlsx files. For more information see Text Rotation In Xls And Xlsx


TObjectTextProperties.TObjectTextProperties Constructor | FlexCel Studio for the .NET Framework documentation

TObjectTextProperties.TObjectTextProperties Constructor

Overloads

  • TObjectTextProperties.TObjectTextProperties
  • TObjectTextProperties.TObjectTextProperties(Boolean, THFlxAlignment, TVFlxAlignment, TTextRotation)

TObjectTextProperties.TObjectTextProperties

Creates a new instance and sets its values to defaults.

Syntax

Namespace: FlexCel.Core

public TObjectTextProperties()

See also

  • TObjectTextProperties

TObjectTextProperties.TObjectTextProperties(Boolean, THFlxAlignment, TVFlxAlignment, TTextRotation)

Creates a new instance and sets its values.

Syntax

Namespace: FlexCel.Core

public TObjectTextProperties(Boolean aLockText, THFlxAlignment aHAlignment, TVFlxAlignment aVAlignment, TTextRotation aTextRotation)

Parameters

<-> | Parameter | Type | Description
 | aLockText | Boolean |
 | aHAlignment | THFlxAlignment |
 | aVAlignment | TVFlxAlignment |
 | aTextRotation | TTextRotation |

See also

  • TObjectTextProperties


TObjectTextProperties.EqualValues Method | FlexCel Studio for the .NET Framework documentation

TObjectTextProperties.EqualValues Method

Returns true if both instances of the objects contain the same values. Instances might be different, this method will return if their values are equal. Instances can be null.

Syntax

Namespace: FlexCel.Core

public static Boolean EqualValues(TObjectTextProperties a1, TObjectTextProperties a2)

Parameters

<-> | Parameter | Type | Description
 | a1 | TObjectTextProperties | First instance to compare.
 | a2 | TObjectTextProperties | Second instance to compare.

See also

  • TObjectTextProperties


TObjectTextProperties.Clone Method | FlexCel Studio for the .NET Framework documentation

TObjectTextProperties.Clone Method

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

Syntax

Namespace: FlexCel.Core

public Object Clone()

See also

  • TObjectTextProperties


TObjectTextProperties.LockText Property | FlexCel Studio for the .NET Framework documentation

TObjectTextProperties.LockText Property

Specifies if the text of the object is locked.

Syntax

Namespace: FlexCel.Core

public Boolean LockText { get; set; }

See also

  • TObjectTextProperties


TObjectTextProperties.HAlignment Property | FlexCel Studio for the .NET Framework documentation

TObjectTextProperties.HAlignment Property

Horizontal alignment for the text in the object.

Important: This property uses xls, not xlsx semantics, because it is used in comments which follow xls semantics even in xlsx files. For more information see Text Rotation In Xls And Xlsx

Syntax

Namespace: FlexCel.Core

public THFlxAlignment HAlignment { get; set; }

See also

  • TObjectTextProperties


TObjectTextProperties.VAlignment Property | FlexCel Studio for the .NET Framework documentation

TObjectTextProperties.VAlignment Property

Horizontal alignment for the text in the object.

Important: This property uses xls, not xlsx semantics, because it is used in comments which follow xls semantics even in xlsx files. For more information see Text Rotation In Xls And Xlsx

Syntax

Namespace: FlexCel.Core

public TVFlxAlignment VAlignment { get; set; }

See also

  • TObjectTextProperties


TObjectTextProperties.TextRotation Property | FlexCel Studio for the .NET Framework documentation

TObjectTextProperties.TextRotation Property

Determines how the text is oriented in the object.

Important: This property uses xls, not xlsx semantics, because it is used in comments which follow xls semantics even in xlsx files. For more information see Text Rotation In Xls And Xlsx

Syntax

Namespace: FlexCel.Core

public TTextRotation TextRotation { get; set; }

See also

  • TObjectTextProperties


TOuterShadowEffect Class | FlexCel Studio for the .NET Framework documentation

TOuterShadowEffect Class

An outer shadow effect.

Syntax

Namespace: FlexCel.Core

public class TOuterShadowEffect: TDrawingEffect, IComparable, IComparable<TOuterShadowEffect>

Constructors

Name | Description
TOuterShadowEffect | Creates a new outer shadow effect.

Methods

Name | Description
Clone | Creates a deep copy of the object.
CompareTo | Overloaded CompareTo(Object) CompareTo(TOuterShadowEffect)
Equals | Overloaded Equals(TOuterShadowEffect) Equals(Object)
GetHashCode | Returns the hashcode of the object.

Properties

Name | Description
ShadowColor | Color for the shadow.
BlurRadius | Blur radius.
Distance | Distance of the shadow.
Direction | Rotation of the shadow.
HorizontalScaling​Factor | Horizontal scaling factor. Negative scaling causes a flip.
VerticalScaling​Factor | Vertical scaling factor. Negative scaling causes a flip.
HorizontalSkew | Horizontal skew angle.
VerticalSkew | Vertical skew angle.
ShadowAlignment | Shadow Alignment.
RotateWithShape | If true, the effect rotates with the shape.


TOuterShadowEffect.TOuterShadowEffect Constructor | FlexCel Studio for the .NET Framework documentation

TOuterShadowEffect.TOuterShadowEffect Constructor

Creates a new outer shadow effect.

Syntax

Namespace: FlexCel.Core

public TOuterShadowEffect(TDrawingColor aShadowColor, Int64 aBlurRadius, Int64 aDistance, Double aDirection, Double aHorizontalScalingFactor, Double aVerticalScalingFactor, Double aHorizontalSkew, Double aVerticalSkew, TDrawingRectAlign aShadowAlignment, Boolean aRotateWithShape)

Parameters

<-> | Parameter | Type | Description
 | aShadowColor | TDrawingColor | Color for the shadow.
 | aBlurRadius | Int64 | Blur radius.
 | aDistance | Int64 | Distance of the shadow.
 | aDirection | Double | Rotation of the shadow.
 | aHorizontalScalingFactor | Double | Horizontal scaling factor. Negative scaling causes a flip.
 | aVerticalScalingFactor | Double | Vertical scaling factor. Negative scaling causes a flip.
 | aHorizontalSkew | Double | Horizontal skew angle.
 | aVerticalSkew | Double | Vertical skew angle.
 | aShadowAlignment | TDrawingRectAlign | Shadow Alignment.
 | aRotateWithShape | Boolean | If true, the effect rotates with the shape.

See also

  • TOuterShadowEffect


TOuterShadowEffect.Clone Method | FlexCel Studio for the .NET Framework documentation

TOuterShadowEffect.Clone Method

Creates a deep copy of the object.

Syntax

Namespace: FlexCel.Core

public TOuterShadowEffect Clone()

See also

  • TOuterShadowEffect


TOuterShadowEffect.CompareTo Method | FlexCel Studio for the .NET Framework documentation

TOuterShadowEffect.CompareTo Method

Overloads

  • TOuterShadowEffect.CompareTo(Object)
  • TOuterShadowEffect.CompareTo(TOuterShadowEffect)

TOuterShadowEffect.CompareTo(Object)

Returns -1, 0 or 1 depending if this object is smaller or bigger than the other.

Syntax

Namespace: FlexCel.Core

public Int32 CompareTo(Object other)

Parameters

<-> | Parameter | Type | Description
 | other | Object |

See also

  • TOuterShadowEffect

TOuterShadowEffect.CompareTo(TOuterShadowEffect)

Returns -1, 0 or 1 depending if this object is smaller or bigger than the other.

Syntax

Namespace: FlexCel.Core

public Int32 CompareTo(TOuterShadowEffect other)

Parameters

<-> | Parameter | Type | Description
 | other | TOuterShadowEffect |

See also

  • TOuterShadowEffect


TOuterShadowEffect.Equals Method | FlexCel Studio for the .NET Framework documentation

TOuterShadowEffect.Equals Method

Overloads

  • TOuterShadowEffect.Equals(TOuterShadowEffect)
  • TOuterShadowEffect.Equals(Object)

TOuterShadowEffect.Equals(TOuterShadowEffect)

Returns true if both objects are the same.

Syntax

Namespace: FlexCel.Core

protected Boolean Equals(TOuterShadowEffect other)

Parameters

<-> | Parameter | Type | Description
 | other | TOuterShadowEffect |

See also

  • TOuterShadowEffect

TOuterShadowEffect.Equals(Object)

Returns true if both objects are the same.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object other)

Parameters

<-> | Parameter | Type | Description
 | other | Object |

See also

  • TOuterShadowEffect


TOuterShadowEffect.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TOuterShadowEffect.GetHashCode Method

Returns the hashcode of the object.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TOuterShadowEffect


TOuterShadowEffect.ShadowColor Property | FlexCel Studio for the .NET Framework documentation

TOuterShadowEffect.ShadowColor Property

Color for the shadow.

Syntax

Namespace: FlexCel.Core

public TDrawingColor ShadowColor { get; }

See also

  • TOuterShadowEffect


TOuterShadowEffect.BlurRadius Property | FlexCel Studio for the .NET Framework documentation

TOuterShadowEffect.BlurRadius Property

Blur radius.

Syntax

Namespace: FlexCel.Core

public Int64 BlurRadius { get; }

See also

  • TOuterShadowEffect


TOuterShadowEffect.Distance Property | FlexCel Studio for the .NET Framework documentation

TOuterShadowEffect.Distance Property

Distance of the shadow.

Syntax

Namespace: FlexCel.Core

public Int64 Distance { get; }

See also

  • TOuterShadowEffect


TOuterShadowEffect.Direction Property | FlexCel Studio for the .NET Framework documentation

TOuterShadowEffect.Direction Property

Rotation of the shadow.

Syntax

Namespace: FlexCel.Core

public Double Direction { get; }

See also

  • TOuterShadowEffect


TOuterShadowEffect.HorizontalScalingFactor Property | FlexCel Studio for the .NET Framework documentation

TOuterShadowEffect.HorizontalScalingFactor Property

Horizontal scaling factor. Negative scaling causes a flip.

Syntax

Namespace: FlexCel.Core

public Double HorizontalScalingFactor { get; }

See also

  • TOuterShadowEffect


TOuterShadowEffect.VerticalScalingFactor Property | FlexCel Studio for the .NET Framework documentation

TOuterShadowEffect.VerticalScalingFactor Property

Vertical scaling factor. Negative scaling causes a flip.

Syntax

Namespace: FlexCel.Core

public Double VerticalScalingFactor { get; }

See also

  • TOuterShadowEffect


TOuterShadowEffect.HorizontalSkew Property | FlexCel Studio for the .NET Framework documentation

TOuterShadowEffect.HorizontalSkew Property

Horizontal skew angle.

Syntax

Namespace: FlexCel.Core

public Double HorizontalSkew { get; }

See also

  • TOuterShadowEffect


TOuterShadowEffect.VerticalSkew Property | FlexCel Studio for the .NET Framework documentation

TOuterShadowEffect.VerticalSkew Property

Vertical skew angle.

Syntax

Namespace: FlexCel.Core

public Double VerticalSkew { get; }

See also

  • TOuterShadowEffect


TOuterShadowEffect.ShadowAlignment Property | FlexCel Studio for the .NET Framework documentation

TOuterShadowEffect.ShadowAlignment Property

Shadow Alignment.

Syntax

Namespace: FlexCel.Core

public TDrawingRectAlign ShadowAlignment { get; }

See also

  • TOuterShadowEffect


TOuterShadowEffect.RotateWithShape Property | FlexCel Studio for the .NET Framework documentation

TOuterShadowEffect.RotateWithShape Property

If true, the effect rotates with the shape.

Syntax

Namespace: FlexCel.Core

public Boolean RotateWithShape { get; }

See also

  • TOuterShadowEffect


TPaperDimensions Class | FlexCel Studio for the .NET Framework documentation

TPaperDimensions Class

Dimensions of an Excel paper

Syntax

Namespace: FlexCel.Core

public class TPaperDimensions

Constructors

Name | Description
TPaperDimensions | Overloaded TPaperDimensions(TPaperSize) TPaperDimensions(String, Double, Double)

Methods

Name | Description
mm | Converts millimeters to inches/100
in100 | Converts inches/100 to millimeters

Properties

Name | Description
PaperName | Paper Name.
Width | Paper width in inches/100
Height | Paper height in inches/100
SizeInPoints | The size in points (inches/72)


TPaperDimensions.TPaperDimensions Constructor | FlexCel Studio for the .NET Framework documentation

TPaperDimensions.TPaperDimensions Constructor

Overloads

  • TPaperDimensions.TPaperDimensions(TPaperSize)
  • TPaperDimensions.TPaperDimensions(String, Double, Double)

TPaperDimensions.TPaperDimensions(TPaperSize)

Creates a new TPaperDimensions instance.

Syntax

Namespace: FlexCel.Core

public TPaperDimensions(TPaperSize PaperSize)

Parameters

<-> | Parameter | Type | Description
 | PaperSize | TPaperSize | Excel standard papersize.

See also

  • TPaperDimensions

TPaperDimensions.TPaperDimensions(String, Double, Double)

Creates a new TPaperDimensions instance.

Syntax

Namespace: FlexCel.Core

public TPaperDimensions(String aPaperName, Double aWidth, Double aHeight)

Parameters

<-> | Parameter | Type | Description
 | aPaperName | String | A string identifying the paper name
 | aWidth | Double | Width in inches/100
 | aHeight | Double | Height in inches/100

See also

  • TPaperDimensions


TPaperDimensions.mm Method | FlexCel Studio for the .NET Framework documentation

TPaperDimensions.mm Method

Converts millimeters to inches/100

Syntax

Namespace: FlexCel.Core

public static Double mm(Double v)

Parameters

<-> | Parameter | Type | Description
 | v | Double | Value in millimeters

Returns

Value in inches/100

See also

  • TPaperDimensions


TPaperDimensions.in100 Method | FlexCel Studio for the .NET Framework documentation

TPaperDimensions.in100 Method

Converts inches/100 to millimeters

Syntax

Namespace: FlexCel.Core

public static Double in100(Double v)

Parameters

<-> | Parameter | Type | Description
 | v | Double | Value in inches/100

Returns

Value in millimeters

See also

  • TPaperDimensions


TPaperDimensions.PaperName Property | FlexCel Studio for the .NET Framework documentation

TPaperDimensions.PaperName Property

Paper Name.

Syntax

Namespace: FlexCel.Core

public String PaperName { get; set; }

See also

  • TPaperDimensions


TPaperDimensions.Width Property | FlexCel Studio for the .NET Framework documentation

TPaperDimensions.Width Property

Paper width in inches/100

Syntax

Namespace: FlexCel.Core

public Double Width { get; set; }

See also

  • TPaperDimensions


TPaperDimensions.Height Property | FlexCel Studio for the .NET Framework documentation

TPaperDimensions.Height Property

Paper height in inches/100

Syntax

Namespace: FlexCel.Core

public Double Height { get; set; }

See also

  • TPaperDimensions


TPaperDimensions.SizeInPoints Property | FlexCel Studio for the .NET Framework documentation

TPaperDimensions.SizeInPoints Property

The size in points (inches/72)

Syntax

Namespace: FlexCel.Core

public TUISize SizeInPoints { get; }

See also

  • TPaperDimensions


TPatternFill Class | FlexCel Studio for the .NET Framework documentation

TPatternFill Class

Shapes are filled with a texture.

Syntax

Namespace: FlexCel.Core

public class TPatternFill: TFillStyle

Constructors

Name | Description
TPatternFill | Creates a new Pattern fill.

Methods

Name | Description
Equals | Returns true if this instance has the same data as the object obj.
CompareTo | Returns -1 if obj is bigger than this, 0 if both objects are the same, and 1 if obj is smaller than this.
GetHashCode | Returns the hashcode for this object

Properties

Name | Description
FgColor | Foreground color of a pattern fill.
BgColor | Background color of a Pattern fill.
Pattern | Type of hatching.


TPatternFill.TPatternFill Constructor | FlexCel Studio for the .NET Framework documentation

TPatternFill.TPatternFill Constructor

Creates a new Pattern fill.

Syntax

Namespace: FlexCel.Core

public TPatternFill(TDrawingColor aFgColor, TDrawingColor aBgColor, TDrawingPattern aPattern)

Parameters

<-> | Parameter | Type | Description
 | aFgColor | TDrawingColor |
 | aBgColor | TDrawingColor |
 | aPattern | TDrawingPattern |

See also

  • TPatternFill


TPatternFill.Equals Method | FlexCel Studio for the .NET Framework documentation

TPatternFill.Equals Method

Returns true if this instance has the same data as the object obj.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TPatternFill


TPatternFill.CompareTo Method | FlexCel Studio for the .NET Framework documentation

TPatternFill.CompareTo Method

Returns -1 if obj is bigger than this, 0 if both objects are the same, and 1 if obj is smaller than this.

Syntax

Namespace: FlexCel.Core

public override Int32 CompareTo(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TPatternFill


TPatternFill.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TPatternFill.GetHashCode Method

Returns the hashcode for this object

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TPatternFill


TPatternFill.FgColor Property | FlexCel Studio for the .NET Framework documentation

TPatternFill.FgColor Property

Foreground color of a pattern fill.

Syntax

Namespace: FlexCel.Core

public TDrawingColor FgColor { get; }

See also

  • TPatternFill


TPatternFill.BgColor Property | FlexCel Studio for the .NET Framework documentation

TPatternFill.BgColor Property

Background color of a Pattern fill.

Syntax

Namespace: FlexCel.Core

public TDrawingColor BgColor { get; }

See also

  • TPatternFill


TPatternFill.Pattern Property | FlexCel Studio for the .NET Framework documentation

TPatternFill.Pattern Property

Type of hatching.

Syntax

Namespace: FlexCel.Core

public TDrawingPattern Pattern { get; }

See also

  • TPatternFill


TPdfCorruptFontInFontFolderError Class | FlexCel Studio for the .NET Framework documentation

TPdfCorruptFontInFontFolderError Class

This class has information for a FlexCelError.PdfCorruptFontInFontFolder error. Look at FlexCelError.PdfCorruptFontInFontFolder for more information.

Syntax

Namespace: FlexCel.Core

public class TPdfCorruptFontInFontFolderError: TFlexCelErrorInfo

Constructors

Name | Description
TPdfCorruptFont​InFont​Folder​Error | Creates a new instance.

Properties

Name | Description
FileName | Font file that FlexCel couldn't parse.


TPdfCorruptFontInFontFolderError.TPdfCorruptFontInFontFolderError Constructor | FlexCel Studio for the .NET Framework documentation

TPdfCorruptFontInFontFolderError.TPdfCorruptFontInFontFolderError Constructor

Creates a new instance.

Syntax

Namespace: FlexCel.Core

public TPdfCorruptFontInFontFolderError(String aMessage, String aFileName)

Parameters

<-> | Parameter | Type | Description
 | aMessage | String | See TFlexCelErrorInfo.Message
 | aFileName | String | See FileName

See also

  • TPdfCorruptFontInFontFolderError


TPdfCorruptFontInFontFolderError.FileName Property | FlexCel Studio for the .NET Framework documentation

TPdfCorruptFontInFontFolderError.FileName Property

Font file that FlexCel couldn't parse.

Syntax

Namespace: FlexCel.Core

public String FileName { get; }

See also

  • TPdfCorruptFontInFontFolderError


TPdfFauxBoldOrItalicsError Class | FlexCel Studio for the .NET Framework documentation

TPdfFauxBoldOrItalicsError Class

This class has information for a FlexCelError.PdfFauxBoldOrItalics error. Look at FlexCelError.PdfFauxBoldOrItalics for more information.

Syntax

Namespace: FlexCel.Core

public class TPdfFauxBoldOrItalicsError: TFlexCelErrorInfo

Constructors

Name | Description
TPdfFauxBold​OrItalics​Error | Creates a new instance.

Properties

Name | Description
FontName | Name of the font that doesn't contain Italics or bold definition.
Style | Style missing from the font.


TPdfFauxBoldOrItalicsError.TPdfFauxBoldOrItalicsError Constructor | FlexCel Studio for the .NET Framework documentation

TPdfFauxBoldOrItalicsError.TPdfFauxBoldOrItalicsError Constructor

Creates a new instance.

Syntax

Namespace: FlexCel.Core

public TPdfFauxBoldOrItalicsError(String aMessage, String aFontName, TUIFontStyle aStyle)

Parameters

<-> | Parameter | Type | Description
 | aMessage | String | See TFlexCelErrorInfo.Message
 | aFontName | String | See FontName
 | aStyle | TUIFontStyle | See Style

See also

  • TPdfFauxBoldOrItalicsError


TPdfFauxBoldOrItalicsError.FontName Property | FlexCel Studio for the .NET Framework documentation

TPdfFauxBoldOrItalicsError.FontName Property

Name of the font that doesn't contain Italics or bold definition.

Syntax

Namespace: FlexCel.Core

public String FontName { get; set; }

See also

  • TPdfFauxBoldOrItalicsError


TPdfFauxBoldOrItalicsError.Style Property | FlexCel Studio for the .NET Framework documentation

TPdfFauxBoldOrItalicsError.Style Property

Style missing from the font.

Syntax

Namespace: FlexCel.Core

public TUIFontStyle Style { get; set; }

See also

  • TPdfFauxBoldOrItalicsError


TPdfFontLicenseDoesntAllowEmbeddingError Class | FlexCel Studio for the .NET Framework documentation

TPdfFontLicenseDoesntAllowEmbeddingError Class

This class has information for a FlexCelError.PdfFontLicenseDoesntAllowEmbedding error. Look at FlexCelError.PdfFontLicenseDoesntAllowEmbedding for more information.

Syntax

Namespace: FlexCel.Core

public class TPdfFontLicenseDoesntAllowEmbeddingError: TFlexCelErrorInfo

Constructors

Name | Description
TPdfFontLicense​Doesnt​Allow​Embedding​Error | Creates a new instance.

Properties

Name | Description
FontName | Font whose license doesn't allow embedding.


TPdfFontLicenseDoesntAllowEmbeddingError.TPdfFontLicenseDoesntAllowEmbeddingError Constructor | FlexCel Studio for the .NET Framework documentation

TPdfFontLicenseDoesntAllowEmbeddingError.TPdfFontLicenseDoesntAllowEmbeddingError Constructor

Creates a new instance.

Syntax

Namespace: FlexCel.Core

public TPdfFontLicenseDoesntAllowEmbeddingError(String aMessage, String aFontName)

Parameters

<-> | Parameter | Type | Description
 | aMessage | String | See TFlexCelErrorInfo.Message
 | aFontName | String | See FontName

See also

  • TPdfFontLicenseDoesntAllowEmbeddingError


TPdfFontLicenseDoesntAllowEmbeddingError.FontName Property | FlexCel Studio for the .NET Framework documentation

TPdfFontLicenseDoesntAllowEmbeddingError.FontName Property

Font whose license doesn't allow embedding.

Syntax

Namespace: FlexCel.Core

public String FontName { get; }

See also

  • TPdfFontLicenseDoesntAllowEmbeddingError


TPdfFontNotFoundError Class | FlexCel Studio for the .NET Framework documentation

TPdfFontNotFoundError Class

This class has information for a FlexCelError.PdfFontNotFound error. Look at FlexCelError.PdfFontNotFound for more information.

Syntax

Namespace: FlexCel.Core

public class TPdfFontNotFoundError: TFlexCelErrorInfo

Constructors

Name | Description
TPdfFontNotFound​Error | Creates a new instance.

Properties

Name | Description
FontName | Font that was not found.
ReplacementFontName | Font that was used to replace FontName.


TPdfFontNotFoundError.TPdfFontNotFoundError Constructor | FlexCel Studio for the .NET Framework documentation

TPdfFontNotFoundError.TPdfFontNotFoundError Constructor

Creates a new instance.

Syntax

Namespace: FlexCel.Core

public TPdfFontNotFoundError(String aMessage, String aFontName, String aReplacementFontName)

Parameters

<-> | Parameter | Type | Description
 | aMessage | String | See TFlexCelErrorInfo.Message
 | aFontName | String | See FontName
 | aReplacementFontName | String | See ReplacementFontName

See also

  • TPdfFontNotFoundError


TPdfFontNotFoundError.FontName Property | FlexCel Studio for the .NET Framework documentation

TPdfFontNotFoundError.FontName Property

Font that was not found.

Syntax

Namespace: FlexCel.Core

public String FontName { get; }

See also

  • TPdfFontNotFoundError


TPdfFontNotFoundError.ReplacementFontName Property | FlexCel Studio for the .NET Framework documentation

TPdfFontNotFoundError.ReplacementFontName Property

Font that was used to replace FontName.

Syntax

Namespace: FlexCel.Core

public String ReplacementFontName { get; }

See also

  • TPdfFontNotFoundError


TPdfGlyphNotInFontError Class | FlexCel Studio for the .NET Framework documentation

TPdfGlyphNotInFontError Class

This class has information for a FlexCelError.PdfGlyphNotInFont error. Look at FlexCelError.PdfGlyphNotInFont for more information.

Syntax

Namespace: FlexCel.Core

public class TPdfGlyphNotInFontError: TFlexCelErrorInfo

Constructors

Name | Description
TPdfGlyphNot​InFont​Error | Creates a new instance.

Properties

Name | Description
MissingChar | Character missing in the font.
FontName | Font that doesn't contain the character.


TPdfGlyphNotInFontError.TPdfGlyphNotInFontError Constructor | FlexCel Studio for the .NET Framework documentation

TPdfGlyphNotInFontError.TPdfGlyphNotInFontError Constructor

Creates a new instance.

Syntax

Namespace: FlexCel.Core

public TPdfGlyphNotInFontError(String aMessage, String aFontName, Int64 aMissingChar)

Parameters

<-> | Parameter | Type | Description
 | aMessage | String | See TFlexCelErrorInfo.Message
 | aFontName | String | See FontName
 | aMissingChar | Int64 | See MissingChar

See also

  • TPdfGlyphNotInFontError


TPdfGlyphNotInFontError.MissingChar Property | FlexCel Studio for the .NET Framework documentation

TPdfGlyphNotInFontError.MissingChar Property

Character missing in the font.

Syntax

Namespace: FlexCel.Core

public Int64 MissingChar { get; }

See also

  • TPdfGlyphNotInFontError


TPdfGlyphNotInFontError.FontName Property | FlexCel Studio for the .NET Framework documentation

TPdfGlyphNotInFontError.FontName Property

Font that doesn't contain the character.

Syntax

Namespace: FlexCel.Core

public String FontName { get; }

See also

  • TPdfGlyphNotInFontError


TPdfUsedFallbackFontError Class | FlexCel Studio for the .NET Framework documentation

TPdfUsedFallbackFontError Class

This class has information for a FlexCelError.PdfUsedFallbackFont error. Look at FlexCelError.PdfUsedFallbackFont for more information.

Syntax

Namespace: FlexCel.Core

public class TPdfUsedFallbackFontError: TFlexCelErrorInfo

Constructors

Name | Description
TPdfUsedFallback​Font​Error | Creates a new instance.

Properties

Name | Description
OriginalFontName | Font that should be used, but that doesn't contain the needed characters.
SubstitutedFontName | Fallback font that substituted OriginalFontName.


TPdfUsedFallbackFontError.TPdfUsedFallbackFontError Constructor | FlexCel Studio for the .NET Framework documentation

TPdfUsedFallbackFontError.TPdfUsedFallbackFontError Constructor

Creates a new instance.

Syntax

Namespace: FlexCel.Core

public TPdfUsedFallbackFontError(String aMessage, String aOriginalFontName, String aSubstitutedFontName)

Parameters

<-> | Parameter | Type | Description
 | aMessage | String | See TFlexCelErrorInfo.Message
 | aOriginalFontName | String | See OriginalFontName
 | aSubstitutedFontName | String | See SubstitutedFontName

See also

  • TPdfUsedFallbackFontError


TPdfUsedFallbackFontError.OriginalFontName Property | FlexCel Studio for the .NET Framework documentation

TPdfUsedFallbackFontError.OriginalFontName Property

Font that should be used, but that doesn't contain the needed characters.

Syntax

Namespace: FlexCel.Core

public String OriginalFontName { get; }

See also

  • TPdfUsedFallbackFontError


TPdfUsedFallbackFontError.SubstitutedFontName Property | FlexCel Studio for the .NET Framework documentation

TPdfUsedFallbackFontError.SubstitutedFontName Property

Fallback font that substituted OriginalFontName.

Syntax

Namespace: FlexCel.Core

public String SubstitutedFontName { get; }

See also

  • TPdfUsedFallbackFontError


TPieChartOptions Class | FlexCel Studio for the .NET Framework documentation

TPieChartOptions Class

Options specific for a Pie chart.

Syntax

Namespace: FlexCel.Core

public class TPieChartOptions: TChartOptions

Constructors

Name Description
TPieChartOptions Overloaded
 TPieChartOptions(Boolean, Int32, Boolean, Int32)
TPieChartOptions(Int32, Boolean, Int32, Int32, Boolean, Int32, Boolean, ChartSeriesOptions, TDataLabel)

Methods

Name | Description
IsStacked | Returns true is the chart is stacked, either normally or 100% stacked.

Properties

Name | Description
FirstSliceAngle | Angle of the first slice in degrees. It can go from 0 to 359.
DoughnutRadius | Radius of the center of the doughnut in Percent. 0 Means a Pie without hole. Note that in xls charts, 0 means a Pie chart. In xlsx, 0 still means a doughnut chart, but without hole in the middle. It is not possible to have a doughnut chart without hole in xls.
IsDoughnut | Returns true if the chart is a doughnut chart instead of a pie chart. In xls charts, a pie chart is just defined as DoughnutRadius = 0, but in xlsx you can have doughnut charts with DoughnutRadius = 0.
HasShadow | True if the chart lines have shadows.


TPieChartOptions.TPieChartOptions Constructor | FlexCel Studio for the .NET Framework documentation

TPieChartOptions.TPieChartOptions Constructor

Overloads

  • TPieChartOptions.TPieChartOptions(Boolean, Int32, Boolean, Int32)
  • TPieChartOptions.TPieChartOptions(Int32, Boolean, Int32, Int32, Boolean, Int32, Boolean, ChartSeriesOptions, TDataLabel)

TPieChartOptions.TPieChartOptions(Boolean, Int32, Boolean, Int32)

Creates a new TPieChartOptions instance. This overload is simplified to specify the fields you need when setting chart options.

Syntax

Namespace: FlexCel.Core

public TPieChartOptions(Boolean aChangeColorsOnEachSeries, Int32 aFirstSliceAngle, Boolean aIsDoughnut, Int32 aDoughnutRadius)

Parameters

<-> | Parameter | Type | Description
 | aChangeColorsOnEachSeries | Boolean | If false, all series will be the same color.
 | aFirstSliceAngle | Int32 | Angle of the first slice in degrees. It can go from 0 to 359.
 | aIsDoughnut | Boolean | True if the chart is a doughnut chart instead of a pie chart.
 | aDoughnutRadius | Int32 | Radius of the center of the doughnut in Percent.

See also

  • TPieChartOptions

TPieChartOptions.TPieChartOptions(Int32, Boolean, Int32, Int32, Boolean, Int32, Boolean, ChartSeriesOptions, TDataLabel)

Creates a new TPieChartOptions instance.

Syntax

Namespace: FlexCel.Core

public TPieChartOptions(Int32 aAxisNumber, Boolean aChangeColorsOnEachSeries, Int32 aZOrder, Int32 aFirstSliceAngle, Boolean aIsDoughnut, Int32 aDoughnutRadius, Boolean aHasShadow, ChartSeriesOptions aSeriesOptions, TDataLabel aDefaultLabel)

Parameters

<-> | Parameter | Type | Description
 | aAxisNumber | Int32 | Axis where this chart group belongs, 0 is primary, 1 is secondary.
 | aChangeColorsOnEachSeries | Boolean | If false, all series will be the same color.
 | aZOrder | Int32 | Z-Order of this chart group, with 0 being the bottom. Chart groups with lower z-Order are drawn below the ones with higher ones.
 | aFirstSliceAngle | Int32 | Angle of the first slice in degrees. It can go from 0 to 359.
 | aIsDoughnut | Boolean | True if the chart is a doughnut chart instead of a pie chart.
 | aDoughnutRadius | Int32 | Radius of the center of the doughnut in Percent.
 | aHasShadow | Boolean | True if the chart lines have shadows.
 | aSeriesOptions | ChartSeriesOptions | Global options that apply to all the series on this group. This instance will be copied.
 | aDefaultLabel | TDataLabel | Default label properties for labels in this group.

See also

  • TPieChartOptions


TPieChartOptions.IsStacked Method | FlexCel Studio for the .NET Framework documentation

TPieChartOptions.IsStacked Method

Returns true is the chart is stacked, either normally or 100% stacked.

Syntax

Namespace: FlexCel.Core

public override Boolean IsStacked()

See also

  • TPieChartOptions


TPieChartOptions.FirstSliceAngle Property | FlexCel Studio for the .NET Framework documentation

TPieChartOptions.FirstSliceAngle Property

Angle of the first slice in degrees. It can go from 0 to 359.

Syntax

Namespace: FlexCel.Core

public Int32 FirstSliceAngle { get; set; }

See also

  • TPieChartOptions


TPieChartOptions.DoughnutRadius Property | FlexCel Studio for the .NET Framework documentation

TPieChartOptions.DoughnutRadius Property

Radius of the center of the doughnut in Percent. 0 Means a Pie without hole. Note that in xls charts, 0 means a Pie chart. In xlsx, 0 still means a doughnut chart, but without hole in the middle. It is not possible to have a doughnut chart without hole in xls.

Syntax

Namespace: FlexCel.Core

public Int32 DoughnutRadius { get; set; }

See also

  • TPieChartOptions


TPieChartOptions.IsDoughnut Property | FlexCel Studio for the .NET Framework documentation

TPieChartOptions.IsDoughnut Property

Returns true if the chart is a doughnut chart instead of a pie chart. In xls charts, a pie chart is just defined as DoughnutRadius = 0, but in xlsx you can have doughnut charts with DoughnutRadius = 0.

Syntax

Namespace: FlexCel.Core

public Boolean IsDoughnut { get; set; }

See also

  • TPieChartOptions


TPieChartOptions.HasShadow Property | FlexCel Studio for the .NET Framework documentation

TPieChartOptions.HasShadow Property

True if the chart lines have shadows.

Syntax

Namespace: FlexCel.Core

public Boolean HasShadow { get; set; }

See also

  • TPieChartOptions


TPresetShadowEffect Class | FlexCel Studio for the .NET Framework documentation

TPresetShadowEffect Class

Applies a preset shadow effect.

Syntax

Namespace: FlexCel.Core

public class TPresetShadowEffect: TDrawingEffect, IComparable<TPresetShadowEffect>, IComparable

Constructors

Name | Description
TPresetShadowEffect | Creates a new preset shadow effect.

Methods

Name | Description
Clone | Creates a deep copy of the object.
CompareTo | Overloaded CompareTo(Object) CompareTo(TPresetShadowEffect)
Equals | Overloaded Equals(TPresetShadowEffect) Equals(Object)
GetHashCode | Returns the hashcode of the object.

Properties

Name | Description
ShadowColor | Color for the shadow.
ShadowType | Preset shadow type.
Distance | Distance of the shadow.
Direction | Rotation of the shadow.


TPresetShadowEffect.TPresetShadowEffect Constructor | FlexCel Studio for the .NET Framework documentation

TPresetShadowEffect.TPresetShadowEffect Constructor

Creates a new preset shadow effect.

Syntax

Namespace: FlexCel.Core

public TPresetShadowEffect(TDrawingColor aShadowColor, TPresetShadowEffectType aShadowType, Int64 aDistance, Double aDirection)

Parameters

<-> | Parameter | Type | Description
 | aShadowColor | TDrawingColor | Shadow color.
 | aShadowType | TPresetShadow​Effect​Type | Preset shadow type.
 | aDistance | Int64 | Distance of the shadow.
 | aDirection | Double | Direction for the shadow.

See also

  • TPresetShadowEffect


TPresetShadowEffect.Clone Method | FlexCel Studio for the .NET Framework documentation

TPresetShadowEffect.Clone Method

Creates a deep copy of the object.

Syntax

Namespace: FlexCel.Core

public TPresetShadowEffect Clone()

See also

  • TPresetShadowEffect


TPresetShadowEffect.CompareTo Method | FlexCel Studio for the .NET Framework documentation

TPresetShadowEffect.CompareTo Method

Overloads

  • TPresetShadowEffect.CompareTo(Object)
  • TPresetShadowEffect.CompareTo(TPresetShadowEffect)

TPresetShadowEffect.CompareTo(Object)

Returns -1, 0 or 1 depending if this object is smaller or bigger than the other.

Syntax

Namespace: FlexCel.Core

public Int32 CompareTo(Object other)

Parameters

<-> | Parameter | Type | Description
 | other | Object |

See also

  • TPresetShadowEffect

TPresetShadowEffect.CompareTo(TPresetShadowEffect)

Returns -1, 0 or 1 depending if this object is smaller or bigger than the other.

Syntax

Namespace: FlexCel.Core

public Int32 CompareTo(TPresetShadowEffect other)

Parameters

<-> | Parameter | Type | Description
 | other | TPresetShadowEffect |

See also

  • TPresetShadowEffect


TPresetShadowEffect.Equals Method | FlexCel Studio for the .NET Framework documentation

TPresetShadowEffect.Equals Method

Overloads

  • TPresetShadowEffect.Equals(TPresetShadowEffect)
  • TPresetShadowEffect.Equals(Object)

TPresetShadowEffect.Equals(TPresetShadowEffect)

Returns true if both objects are the same.

Syntax

Namespace: FlexCel.Core

protected Boolean Equals(TPresetShadowEffect other)

Parameters

<-> | Parameter | Type | Description
 | other | TPresetShadowEffect |

See also

  • TPresetShadowEffect

TPresetShadowEffect.Equals(Object)

Returns true if both objects are the same.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object other)

Parameters

<-> | Parameter | Type | Description
 | other | Object |

See also

  • TPresetShadowEffect


TPresetShadowEffect.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TPresetShadowEffect.GetHashCode Method

Returns the hashcode of the object.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TPresetShadowEffect


TPresetShadowEffect.ShadowColor Property | FlexCel Studio for the .NET Framework documentation

TPresetShadowEffect.ShadowColor Property

Color for the shadow.

Syntax

Namespace: FlexCel.Core

public TDrawingColor ShadowColor { get; }

See also

  • TPresetShadowEffect


TPresetShadowEffect.ShadowType Property | FlexCel Studio for the .NET Framework documentation

TPresetShadowEffect.ShadowType Property

Preset shadow type.

Syntax

Namespace: FlexCel.Core

public TPresetShadowEffectType ShadowType { get; }

See also

  • TPresetShadowEffect


TPresetShadowEffect.Distance Property | FlexCel Studio for the .NET Framework documentation

TPresetShadowEffect.Distance Property

Distance of the shadow.

Syntax

Namespace: FlexCel.Core

public Int64 Distance { get; }

See also

  • TPresetShadowEffect


TPresetShadowEffect.Direction Property | FlexCel Studio for the .NET Framework documentation

TPresetShadowEffect.Direction Property

Rotation of the shadow.

Syntax

Namespace: FlexCel.Core

public Double Direction { get; }

See also

  • TPresetShadowEffect


TPrinterDriverSettings Class | FlexCel Studio for the .NET Framework documentation

TPrinterDriverSettings Class

Printer specific settings. It is a byte array with a Win32 DEVMODE struct.

Syntax

Namespace: FlexCel.Core

public class TPrinterDriverSettings

Constructors

Name | Description
TPrinterDriver​Settings | Creates a new instance of a TPrinterDriver​Settings class, with a COPY of aData

Methods

Name | Description
GetData | The current printer data as a byte stream. The first 2 bytes are the operating system (0=windows) and the rest is a Win32 DEVMODE struct.
Equals | Returns true if two instances have the same data.
GetHashCode | Returns the hashcode for this instance.

Operators

Name | Description
Equality | Returns true if both objects are equal. Note this is for backwards compatibility, this is a class and not immutable, so this method should return true if references are different. But that would break old code.
Inequality | Returns true if both objects do not have the same value. Note this is for backwards compatibility, this is a class and not immutable, so this method should return true if references are different. But that would break old code.


TPrinterDriverSettings.TPrinterDriverSettings Constructor | FlexCel Studio for the .NET Framework documentation

TPrinterDriverSettings.TPrinterDriverSettings Constructor

Creates a new instance of a TPrinterDriverSettings class, with a COPY of aData

Syntax

Namespace: FlexCel.Core

public TPrinterDriverSettings(Byte[] aData)

Parameters

<-> | Parameter | Type | Description
 | aData | Byte[] |

See also

  • TPrinterDriverSettings


TPrinterDriverSettings.GetData Method | FlexCel Studio for the .NET Framework documentation

TPrinterDriverSettings.GetData Method

The current printer data as a byte stream. The first 2 bytes are the operating system (0=windows) and the rest is a Win32 DEVMODE struct.

Syntax

Namespace: FlexCel.Core

public Byte[] GetData()

See also

  • TPrinterDriverSettings


TPrinterDriverSettings.Equals Method | FlexCel Studio for the .NET Framework documentation

TPrinterDriverSettings.Equals Method

Returns true if two instances have the same data.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TPrinterDriverSettings


TPrinterDriverSettings.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TPrinterDriverSettings.GetHashCode Method

Returns the hashcode for this instance.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TPrinterDriverSettings


TPrinterDriverSettings.Equality Operator | FlexCel Studio for the .NET Framework documentation

TPrinterDriverSettings.Equality Operator

Returns true if both objects are equal. Note this is for backwards compatibility, this is a class and not immutable, so this method should return true if references are different. But that would break old code.

Syntax

Namespace: FlexCel.Core

public static Boolean op_Equality(TPrinterDriverSettings o1, TPrinterDriverSettings o2)

Parameters

<-> | Parameter | Type | Description
 | o1 | TPrinterDriver​Settings |
 | o2 | TPrinterDriver​Settings |

See also

  • TPrinterDriverSettings


TPrinterDriverSettings.Inequality Operator | FlexCel Studio for the .NET Framework documentation

TPrinterDriverSettings.Inequality Operator

Returns true if both objects do not have the same value. Note this is for backwards compatibility, this is a class and not immutable, so this method should return true if references are different. But that would break old code.

Syntax

Namespace: FlexCel.Core

public static Boolean op_Inequality(TPrinterDriverSettings s1, TPrinterDriverSettings s2)

Parameters

<-> | Parameter | Type | Description
 | s1 | TPrinterDriver​Settings |
 | s2 | TPrinterDriver​Settings |

See also

  • TPrinterDriverSettings


TProtectedRange Class | FlexCel Studio for the .NET Framework documentation

TProtectedRange Class

Specifies a protected range in a sheet. You can define those ranges in Excel 2007 by going to "Review" tab and selecting "Allow Users to Edit Ranges" In Excel 2003, they are available under "Menu->Tools->Protection".

Syntax

Namespace: FlexCel.Core

public sealed class TProtectedRange

Constructors

Name | Description
TProtectedRange | Overloaded TProtectedRange TProtectedRange(String, String, TXlsCellRange[])

Methods

Name | Description
Clone | Returns a deep copy of the object.
Equals | Returns true if the 2 objects have the same contents.
GetHashCode | Return the hashcode of the object

Properties

Name | Description
Password | Password used to protect the range. Use empty or null to have no password. Note: As this password is not saved in the file, when you open a file this property will be empty. You can know if a file has a password by looking at PasswordHash. Setting this property will set the PasswordHash property using the current EncryptionAlgorithm.
PasswordHash | This is the hash for the password that is stored in the file. You shouldn't set this property directly unless you are copying the hash from other place. When you set this property, Password will be reset.
EncryptionAlgorithm | Returns the encryption algorithm used to encrypt the password hash.
Ranges | Ranges of cells this protection applies to. You can specify more than one range of cells for the same ProtectedRange.
Name | Name of the protected range.
SecurityDescriptor​XLSX | Returns the security descriptor of the protected range, for XLSX files. This is a string used if you are giving permissions to some users in the range. Note that because of the different security descriptor formats, FlexCel won't convert between security descriptors from xls and xlsx. Take a look at APIMate to see the descriptor of a particular file.
SecurityDescriptorXLS | Returns the security descriptor of the protected range, for XLS files. This is a byte array encapsulating a Windows Security Descriptor, and it is used if you are giving permissions to some users in the range. Note that because of the different security descriptor formats, FlexCel won't convert between security descriptors from xls and xlsx. Take a look at APIMate to see the descriptor of a particular file.


TProtectedRange.TProtectedRange Constructor | FlexCel Studio for the .NET Framework documentation

TProtectedRange.TProtectedRange Constructor

Overloads

  • TProtectedRange.TProtectedRange
  • TProtectedRange.TProtectedRange(String, String, TXlsCellRange[])

TProtectedRange.TProtectedRange

Creates an empty protected range.

Syntax

Namespace: FlexCel.Core

public TProtectedRange()

See also

  • TProtectedRange

TProtectedRange.TProtectedRange(String, String, TXlsCellRange[])

Creates and initializes a protected range.

Syntax

Namespace: FlexCel.Core

public TProtectedRange(String aName, String aPassword, params TXlsCellRange[] aRanges)

Parameters

<-> | Parameter | Type | Description
 | aName | String | Name for the protected range.
 | aPassword | String | Password to modify the cells. Keep it null if you don't want to set a password.
params | aRanges | TXlsCellRange[] | Ranges of cells where this protected range applies. You might pass an array of TXlsCellRanges here or just a single TXlsCellRange object.

See also

  • TProtectedRange


TProtectedRange.Clone Method | FlexCel Studio for the .NET Framework documentation

TProtectedRange.Clone Method

Returns a deep copy of the object.

Syntax

Namespace: FlexCel.Core

public TProtectedRange Clone()

See also

  • TProtectedRange


TProtectedRange.Equals Method | FlexCel Studio for the .NET Framework documentation

TProtectedRange.Equals Method

Returns true if the 2 objects have the same contents.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TProtectedRange


TProtectedRange.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TProtectedRange.GetHashCode Method

Return the hashcode of the object

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TProtectedRange


TProtectedRange.Password Property | FlexCel Studio for the .NET Framework documentation

TProtectedRange.Password Property

Password used to protect the range. Use empty or null to have no password. Note: As this password is not saved in the file, when you open a file this property will be empty. You can know if a file has a password by looking at PasswordHash. Setting this property will set the PasswordHash property using the current EncryptionAlgorithm.

Syntax

Namespace: FlexCel.Core

public String Password { get; set; }

See also

  • TProtectedRange


TProtectedRange.PasswordHash Property | FlexCel Studio for the .NET Framework documentation

TProtectedRange.PasswordHash Property

This is the hash for the password that is stored in the file. You shouldn't set this property directly unless you are copying the hash from other place. When you set this property, Password will be reset.

Syntax

Namespace: FlexCel.Core

public String PasswordHash { get; set; }

See also

  • TProtectedRange


TProtectedRange.EncryptionAlgorithm Property | FlexCel Studio for the .NET Framework documentation

TProtectedRange.EncryptionAlgorithm Property

Returns the encryption algorithm used to encrypt the password hash.

Syntax

Namespace: FlexCel.Core

public String EncryptionAlgorithm { get; set; }

See also

  • TProtectedRange


TProtectedRange.Ranges Property | FlexCel Studio for the .NET Framework documentation

TProtectedRange.Ranges Property

Ranges of cells this protection applies to. You can specify more than one range of cells for the same ProtectedRange.

Syntax

Namespace: FlexCel.Core

public TXlsCellRange[] Ranges { get; set; }

See also

  • TProtectedRange


TProtectedRange.Name Property | FlexCel Studio for the .NET Framework documentation

TProtectedRange.Name Property

Name of the protected range.

Syntax

Namespace: FlexCel.Core

public String Name { get; set; }

See also

  • TProtectedRange


TProtectedRange.SecurityDescriptorXLSX Property | FlexCel Studio for the .NET Framework documentation

TProtectedRange.SecurityDescriptorXLSX Property

Returns the security descriptor of the protected range, for XLSX files. This is a string used if you are giving permissions to some users in the range. Note that because of the different security descriptor formats, FlexCel won't convert between security descriptors from xls and xlsx. Take a look at APIMate to see the descriptor of a particular file.

Syntax

Namespace: FlexCel.Core

public String SecurityDescriptorXLSX { get; set; }

See also

  • TProtectedRange


TProtectedRange.SecurityDescriptorXLS Property | FlexCel Studio for the .NET Framework documentation

TProtectedRange.SecurityDescriptorXLS Property

Returns the security descriptor of the protected range, for XLS files. This is a byte array encapsulating a Windows Security Descriptor, and it is used if you are giving permissions to some users in the range. Note that because of the different security descriptor formats, FlexCel won't convert between security descriptors from xls and xlsx. Take a look at APIMate to see the descriptor of a particular file.

Syntax

Namespace: FlexCel.Core

public Byte[] SecurityDescriptorXLS { get; set; }

See also

  • TProtectedRange


TProtection Class | FlexCel Studio for the .NET Framework documentation

TProtection Class

Encryption data for an Excel sheet.

Syntax

Namespace: FlexCel.Core

public sealed class TProtection

Methods

Name | Description
SetModifyPassword | Sets the password for modifying the file. It won't encrypt the file, it just won't let Excel save the file. On Excel goto Options->Security to check it. Note that you can only set it, there is no way to retrieve an existing password.
SetWorkbookProtection | Protects the workbook. On Excel goto Protect->Workbook to check it.
GetWorkbookProtection​Options | Reads the Workbook protection options for a file.
SetWorkbookProtection​Options | Sets the workbook protection options for a file.
SetSharedWorkbook​Protection | Protects the change history from being removed. On Excel goto Protect->Protect Shared Workbook to check it.
GetSharedWorkbook​Protection​Options | Reads the protection options for the change history.
SetSharedWorkbook​Protection​Options | Sets the change history protection options for a file.
SetSheetProtection | Protects a sheet. On Excel goto Protect->Sheet to check it.
GetSheetProtection​Options | Return the sheet protection options for the file.
SetSheetProtection​Options | Sets the sheet protection options for the file.
GetProtectedRange | Returns a protected range.
AddProtectedRange | Adds a protected range to the sheet.
DeleteProtectedRange | Deletes an existing protected range.
ClearProtectedRanges | Removes all protected ranges in the sheet.
AssignedOnPassword | Returns true is there is at least one event handler attached to then OnPassword event.
RemoveAllOnPassword​Events | Removes all event handlers attached to OnPassword.

Properties

Name | Description
EncryptionType | Encryption mode for xls files .
EncryptionAlgorithm​Xlsx | Encryption algorithm for xlsx files.
OpenPassword | Sets the password to open the file. When set, the file will be encrypted. On Excel go to Options->Security to check it. Set this to null to clear it.
HasModifyPassword | Returns true if the file has a password to modify.
RecommendReadOnly | Returns true if the file is recommended to open read-only.
HasWorkbookPassword | Returns true if the workbook is protected with a password.
HasSharedWorkbook​Password | Returns true if the change history is protected with a password.
HasSheetPassword | Returns true if the active sheet is protected with a password.
WriteAccess | Reads or sets the user writing the file. Useful to know which user opened the file in Excel when you want to save and the file is in use.
ProtectedRangeCount | Returns a the count of protected ranges in the active sheet.

Events

Name | Description
OnPassword | It is called when opening a password protected file, so you can supply the correct password. If you know beforehand that the file is protected you do not need this event, just use the OpenPassword method on this object.


TProtection.SetModifyPassword Method | FlexCel Studio for the .NET Framework documentation

TProtection.SetModifyPassword Method

Sets the password for modifying the file. It won't encrypt the file, it just won't let Excel save the file. On Excel goto Options->Security to check it. Note that you can only set it, there is no way to retrieve an existing password.

Syntax

Namespace: FlexCel.Core

public void SetModifyPassword(String modifyPassword, Boolean recommendReadOnly, String reservingUser)

Parameters

<-> | Parameter | Type | Description
 | modifyPassword | String | The new password. Set it to null to clear it.
 | recommendReadOnly | Boolean | When true, Excel will recommend read only when opening a file.
 | reservingUser | String | The user that reserves the file. It will appear on the password dialog on Excel.

See also

  • TProtection


TProtection.SetWorkbookProtection Method | FlexCel Studio for the .NET Framework documentation

TProtection.SetWorkbookProtection Method

Protects the workbook. On Excel goto Protect->Workbook to check it.

Syntax

Namespace: FlexCel.Core

public void SetWorkbookProtection(String workbookPassword, TWorkbookProtectionOptions workbookProtectionOptions)

Parameters

<-> | Parameter | Type | Description
 | workbookPassword | String | Password to protect the file. You can set it to null to clear it.
 | workbookProtectionOptions | TWorkbookProtection​Options | The options to protect.

See also

  • TProtection


TProtection.GetWorkbookProtectionOptions Method | FlexCel Studio for the .NET Framework documentation

TProtection.GetWorkbookProtectionOptions Method

Reads the Workbook protection options for a file.

Syntax

Namespace: FlexCel.Core

public TWorkbookProtectionOptions GetWorkbookProtectionOptions()

See also

  • TProtection


TProtection.SetWorkbookProtectionOptions Method | FlexCel Studio for the .NET Framework documentation

TProtection.SetWorkbookProtectionOptions Method

Sets the workbook protection options for a file.

Syntax

Namespace: FlexCel.Core

public void SetWorkbookProtectionOptions(TWorkbookProtectionOptions value)

Parameters

<-> | Parameter | Type | Description
 | value | TWorkbookProtection​Options | Workbook protection options.

See also

  • TProtection


TProtection.SetSharedWorkbookProtection Method | FlexCel Studio for the .NET Framework documentation

TProtection.SetSharedWorkbookProtection Method

Protects the change history from being removed. On Excel goto Protect->Protect Shared Workbook to check it.

Syntax

Namespace: FlexCel.Core

public void SetSharedWorkbookProtection(String sharedWorkbookPassword, TSharedWorkbookProtectionOptions sharedWorkbookProtectionOptions)

Parameters

<-> | Parameter | Type | Description
 | sharedWorkbookPassword | String | Password to protect this setting. You can set it to null to clear it.
 | sharedWorkbookProtectionOptions | TSharedWorkbook​Protection​Options | The options to protect.

See also

  • TProtection


TProtection.GetSharedWorkbookProtectionOptions Method | FlexCel Studio for the .NET Framework documentation

TProtection.GetSharedWorkbookProtectionOptions Method

Reads the protection options for the change history.

Syntax

Namespace: FlexCel.Core

public TSharedWorkbookProtectionOptions GetSharedWorkbookProtectionOptions()

See also

  • TProtection


TProtection.SetSharedWorkbookProtectionOptions Method | FlexCel Studio for the .NET Framework documentation

TProtection.SetSharedWorkbookProtectionOptions Method

Sets the change history protection options for a file.

Syntax

Namespace: FlexCel.Core

public void SetSharedWorkbookProtectionOptions(TSharedWorkbookProtectionOptions value)

Parameters

<-> | Parameter | Type | Description
 | value | TSharedWorkbook​Protection​Options | Protection options.

See also

  • TProtection


TProtection.SetSheetProtection Method | FlexCel Studio for the .NET Framework documentation

TProtection.SetSheetProtection Method

Protects a sheet. On Excel goto Protect->Sheet to check it.

Syntax

Namespace: FlexCel.Core

public void SetSheetProtection(String sheetPassword, TSheetProtectionOptions sheetProtectionOptions)

Parameters

<-> | Parameter | Type | Description
 | sheetPassword | String | Password to protect the active sheet. You can set it to null to clear it.
 | sheetProtectionOptions | TSheetProtection​Options | The options to protect.

See also

  • TProtection


TProtection.GetSheetProtectionOptions Method | FlexCel Studio for the .NET Framework documentation

TProtection.GetSheetProtectionOptions Method

Return the sheet protection options for the file.

Syntax

Namespace: FlexCel.Core

public TSheetProtectionOptions GetSheetProtectionOptions()

See also

  • TProtection


TProtection.SetSheetProtectionOptions Method | FlexCel Studio for the .NET Framework documentation

TProtection.SetSheetProtectionOptions Method

Sets the sheet protection options for the file.

Syntax

Namespace: FlexCel.Core

public void SetSheetProtectionOptions(TSheetProtectionOptions value)

Parameters

<-> | Parameter | Type | Description
 | value | TSheetProtection​Options | Protection options.

See also

  • TProtection


TProtection.GetProtectedRange Method | FlexCel Studio for the .NET Framework documentation

TProtection.GetProtectedRange Method

Returns a protected range.

Syntax

Namespace: FlexCel.Core

public TProtectedRange GetProtectedRange(Int32 index)

Parameters

<-> | Parameter | Type | Description
 | index | Int32 | Index of the protected range we want to retrieve. 1-based.

See also

  • TProtection


TProtection.AddProtectedRange Method | FlexCel Studio for the .NET Framework documentation

TProtection.AddProtectedRange Method

Adds a protected range to the sheet.

Syntax

Namespace: FlexCel.Core

public void AddProtectedRange(TProtectedRange range)

Parameters

<-> | Parameter | Type | Description
 | range | TProtectedRange | range to add.

See also

  • TProtection


TProtection.DeleteProtectedRange Method | FlexCel Studio for the .NET Framework documentation

TProtection.DeleteProtectedRange Method

Deletes an existing protected range.

Syntax

Namespace: FlexCel.Core

public void DeleteProtectedRange(Int32 index)

Parameters

<-> | Parameter | Type | Description
 | index | Int32 | Position of the range to be deleted. 1-based.

See also

  • TProtection


TProtection.ClearProtectedRanges Method | FlexCel Studio for the .NET Framework documentation

TProtection.ClearProtectedRanges Method

Removes all protected ranges in the sheet.

Syntax

Namespace: FlexCel.Core

public void ClearProtectedRanges()

See also

  • TProtection


TProtection.AssignedOnPassword Method | FlexCel Studio for the .NET Framework documentation

TProtection.AssignedOnPassword Method

Returns true is there is at least one event handler attached to then OnPassword event.

Syntax

Namespace: FlexCel.Core

public Boolean AssignedOnPassword()

See also

  • TProtection


TProtection.RemoveAllOnPasswordEvents Method | FlexCel Studio for the .NET Framework documentation

TProtection.RemoveAllOnPasswordEvents Method

Removes all event handlers attached to OnPassword.

Syntax

Namespace: FlexCel.Core

public void RemoveAllOnPasswordEvents()

See also

  • TProtection


TProtection.EncryptionType Property | FlexCel Studio for the .NET Framework documentation

TProtection.EncryptionType Property

Encryption mode for xls files .

Syntax

Namespace: FlexCel.Core

public TEncryptionType EncryptionType { get; set; }

See also

  • TProtection


TProtection.EncryptionAlgorithmXlsx Property | FlexCel Studio for the .NET Framework documentation

TProtection.EncryptionAlgorithmXlsx Property

Encryption algorithm for xlsx files.

Syntax

Namespace: FlexCel.Core

public TEncryptionAlgorithm EncryptionAlgorithmXlsx { get; set; }

See also

  • TProtection


TProtection.OpenPassword Property | FlexCel Studio for the .NET Framework documentation

TProtection.OpenPassword Property

Sets the password to open the file. When set, the file will be encrypted. On Excel go to Options->Security to check it. Set this to null to clear it.

Syntax

Namespace: FlexCel.Core

public String OpenPassword { get; set; }

See also

  • TProtection


TProtection.HasModifyPassword Property | FlexCel Studio for the .NET Framework documentation

TProtection.HasModifyPassword Property

Returns true if the file has a password to modify.

Syntax

Namespace: FlexCel.Core

public Boolean HasModifyPassword { get; }

See also

  • TProtection


TProtection.RecommendReadOnly Property | FlexCel Studio for the .NET Framework documentation

TProtection.RecommendReadOnly Property

Returns true if the file is recommended to open read-only.

Syntax

Namespace: FlexCel.Core

public Boolean RecommendReadOnly { get; set; }

See also

  • TProtection


TProtection.HasWorkbookPassword Property | FlexCel Studio for the .NET Framework documentation

TProtection.HasWorkbookPassword Property

Returns true if the workbook is protected with a password.

Syntax

Namespace: FlexCel.Core

public Boolean HasWorkbookPassword { get; }

See also

  • TProtection


TProtection.HasSharedWorkbookPassword Property | FlexCel Studio for the .NET Framework documentation

TProtection.HasSharedWorkbookPassword Property

Returns true if the change history is protected with a password.

Syntax

Namespace: FlexCel.Core

public Boolean HasSharedWorkbookPassword { get; }

See also

  • TProtection


TProtection.HasSheetPassword Property | FlexCel Studio for the .NET Framework documentation

TProtection.HasSheetPassword Property

Returns true if the active sheet is protected with a password.

Syntax

Namespace: FlexCel.Core

public Boolean HasSheetPassword { get; }

See also

  • TProtection


TProtection.WriteAccess Property | FlexCel Studio for the .NET Framework documentation

TProtection.WriteAccess Property

Reads or sets the user writing the file. Useful to know which user opened the file in Excel when you want to save and the file is in use.

Syntax

Namespace: FlexCel.Core

public String WriteAccess { get; set; }

See also

  • TProtection


TProtection.ProtectedRangeCount Property | FlexCel Studio for the .NET Framework documentation

TProtection.ProtectedRangeCount Property

Returns a the count of protected ranges in the active sheet.

Syntax

Namespace: FlexCel.Core

public Int32 ProtectedRangeCount { get; }

See also

  • TProtection


TProtection.OnPassword Event | FlexCel Studio for the .NET Framework documentation

TProtection.OnPassword Event

It is called when opening a password protected file, so you can supply the correct password. If you know beforehand that the file is protected you do not need this event, just use the OpenPassword method on this object.

Syntax

Namespace: FlexCel.Core

public OnPasswordEventHandler OnPassword

See also

  • TProtection


TRadarChartOptions Class | FlexCel Studio for the .NET Framework documentation

TRadarChartOptions Class

Options specific for a Radar chart.

Syntax

Namespace: FlexCel.Core

public class TRadarChartOptions: TChartOptions

Constructors

Name | Description
TRadarChartOptions | Creates a new TRadarChartOptions instance.

Methods

Name | Description
IsStacked | Returns true is the chart is stacked, either normally or 100% stacked.

Properties

Name | Description
RadarStyle | Radar style.


TRadarChartOptions.TRadarChartOptions Constructor | FlexCel Studio for the .NET Framework documentation

TRadarChartOptions.TRadarChartOptions Constructor

Creates a new TRadarChartOptions instance.

Syntax

Namespace: FlexCel.Core

public TRadarChartOptions(Int32 aAxisNumber, Boolean aChangeColorsOnEachSeries, Int32 aZOrder, ChartSeriesOptions aSeriesOptions, TChartRadarStyle aRadarStyle)

Parameters

<-> | Parameter | Type | Description
 | aAxisNumber | Int32 | See TChartOptions.AxisNumber
 | aChangeColorsOnEachSeries | Boolean | See TChartOptions.ChangeColorsOnEachSeries
 | aZOrder | Int32 | See TChartOptions.ZOrder
 | aSeriesOptions | ChartSeriesOptions | See TChartOptions.SeriesOptions
 | aRadarStyle | TChartRadarStyle | Fill style for the radar lines.

See also

  • TRadarChartOptions


TRadarChartOptions.IsStacked Method | FlexCel Studio for the .NET Framework documentation

TRadarChartOptions.IsStacked Method

Returns true is the chart is stacked, either normally or 100% stacked.

Syntax

Namespace: FlexCel.Core

public override Boolean IsStacked()

See also

  • TRadarChartOptions


TRadarChartOptions.RadarStyle Property | FlexCel Studio for the .NET Framework documentation

TRadarChartOptions.RadarStyle Property

Radar style.

Syntax

Namespace: FlexCel.Core

public TChartRadarStyle RadarStyle { get; set; }

See also

  • TRadarChartOptions


TRecoveryInvalidFormat Class | FlexCel Studio for the .NET Framework documentation

TRecoveryInvalidFormat Class

This error happens when in recovery mode and a format has invalid data.

Syntax

Namespace: FlexCel.Core

public class TRecoveryInvalidFormat: TFlexCelErrorInfo

Constructors

Name | Description
TRecoveryInvalid​Format | Creates a new instance.

Properties

Name | Description
FileName | File with the invalid formula.
InvalidFormat | Format that couldn't be read.


TRecoveryInvalidFormat.TRecoveryInvalidFormat Constructor | FlexCel Studio for the .NET Framework documentation

TRecoveryInvalidFormat.TRecoveryInvalidFormat Constructor

Creates a new instance.

Syntax

Namespace: FlexCel.Core

public TRecoveryInvalidFormat(String aMessage, String aFileName, String aInvalidFormat)

Parameters

<-> | Parameter | Type | Description
 | aMessage | String | See TFlexCelErrorInfo.Message
 | aFileName | String | See FileName
 | aInvalidFormat | String | See InvalidFormat

See also

  • TRecoveryInvalidFormat


TRecoveryInvalidFormat.FileName Property | FlexCel Studio for the .NET Framework documentation

TRecoveryInvalidFormat.FileName Property

File with the invalid formula.

Syntax

Namespace: FlexCel.Core

public String FileName { get; }

See also

  • TRecoveryInvalidFormat


TRecoveryInvalidFormat.InvalidFormat Property | FlexCel Studio for the .NET Framework documentation

TRecoveryInvalidFormat.InvalidFormat Property

Format that couldn't be read.

Syntax

Namespace: FlexCel.Core

public String InvalidFormat { get; }

See also

  • TRecoveryInvalidFormat


TRecoveryInvalidFormulaTokens Class | FlexCel Studio for the .NET Framework documentation

TRecoveryInvalidFormulaTokens Class

This error happens when in recovery mode and a formula has invalid data.

Syntax

Namespace: FlexCel.Core

public class TRecoveryInvalidFormulaTokens: TFlexCelErrorInfo

Constructors

Name | Description
TRecoveryInvalid​Formula​Tokens | Creates a new instance.

Properties

Name | Description
FileName | File with the invalid formula.


TRecoveryInvalidFormulaTokens.TRecoveryInvalidFormulaTokens Constructor | FlexCel Studio for the .NET Framework documentation

TRecoveryInvalidFormulaTokens.TRecoveryInvalidFormulaTokens Constructor

Creates a new instance.

Syntax

Namespace: FlexCel.Core

public TRecoveryInvalidFormulaTokens(String aMessage, String aFileName)

Parameters

<-> | Parameter | Type | Description
 | aMessage | String | See TFlexCelErrorInfo.Message
 | aFileName | String | See FileName

See also

  • TRecoveryInvalidFormulaTokens


TRecoveryInvalidFormulaTokens.FileName Property | FlexCel Studio for the .NET Framework documentation

TRecoveryInvalidFormulaTokens.FileName Property

File with the invalid formula.

Syntax

Namespace: FlexCel.Core

public String FileName { get; }

See also

  • TRecoveryInvalidFormulaTokens


TRecoveryInvalidNameError Class | FlexCel Studio for the .NET Framework documentation

TRecoveryInvalidNameError Class

This error happens when in recovery mode and a name has to be ignored because it can't be read.

Syntax

Namespace: FlexCel.Core

public class TRecoveryInvalidNameError: TFlexCelErrorInfo

Constructors

Name | Description
TRecoveryInvalid​Name​Error | Creates a new instance.

Properties

Name | Description
FileName | File with the invalid name.
NameIndex | Position of the invalid named range in the name table.
ExceptionMsg | Exception error.


TRecoveryInvalidNameError.TRecoveryInvalidNameError Constructor | FlexCel Studio for the .NET Framework documentation

TRecoveryInvalidNameError.TRecoveryInvalidNameError Constructor

Creates a new instance.

Syntax

Namespace: FlexCel.Core

public TRecoveryInvalidNameError(String aMessage, String aFileName, Int32 aNameIndex, String aExceptionMsg)

Parameters

<-> | Parameter | Type | Description
 | aMessage | String | See TFlexCelErrorInfo.Message
 | aFileName | String | See FileName
 | aNameIndex | Int32 | See NameIndex
 | aExceptionMsg | String | See ExceptionMsg

See also

  • TRecoveryInvalidNameError


TRecoveryInvalidNameError.FileName Property | FlexCel Studio for the .NET Framework documentation

TRecoveryInvalidNameError.FileName Property

File with the invalid name.

Syntax

Namespace: FlexCel.Core

public String FileName { get; }

See also

  • TRecoveryInvalidNameError


TRecoveryInvalidNameError.NameIndex Property | FlexCel Studio for the .NET Framework documentation

TRecoveryInvalidNameError.NameIndex Property

Position of the invalid named range in the name table.

Syntax

Namespace: FlexCel.Core

public Int32 NameIndex { get; }

See also

  • TRecoveryInvalidNameError


TRecoveryInvalidNameError.ExceptionMsg Property | FlexCel Studio for the .NET Framework documentation

TRecoveryInvalidNameError.ExceptionMsg Property

Exception error.

Syntax

Namespace: FlexCel.Core

public String ExceptionMsg { get; }

See also

  • TRecoveryInvalidNameError


TReflectionEffect Class | FlexCel Studio for the .NET Framework documentation

TReflectionEffect Class

Applies a reflection effect.

Syntax

Namespace: FlexCel.Core

public class TReflectionEffect: TDrawingEffect, IComparable<TReflectionEffect>, IComparable

Constructors

Name | Description
TReflectionEffect | Creates a new Reflection effect.

Methods

Name | Description
Clone | Creates a deep copy of the object.
CompareTo | Overloaded CompareTo(Object) CompareTo(TReflectionEffect)
Equals | Overloaded Equals(TReflectionEffect) Equals(Object)
GetHashCode | Returns the hashcode of the object.

Properties

Name | Description
BlurRadius | Blur radius.
StartAlpha | Starting reflection opacity.
StartPos | Starting position of the Alpha value.
EndAlpha | Ending reflection opacity.
EndPos | Ending position of the Alpha value.
Distance | Distance of the reflection.
Direction | Rotation of the reflection.
FadeDirection | Direction to offset the reflection.
HorizontalScaling​Factor | Horizontal scaling factor. Negative scaling causes a flip.
VerticalScaling​Factor | Vertical scaling factor. Negative scaling causes a flip.
HorizontalSkew | Horizontal skew angle.
VerticalSkew | Vertical skew angle.
ShadowAlignment | Shadow Alignment.
RotateWithShape | If true, the effect rotates with the shape.


TReflectionEffect.TReflectionEffect Constructor | FlexCel Studio for the .NET Framework documentation

TReflectionEffect.TReflectionEffect Constructor

Creates a new Reflection effect.

Syntax

Namespace: FlexCel.Core

public TReflectionEffect(Int64 aBlurRadius, Double aStartAlpha, Double aStartPos, Double aEndAlpha, Double aEndPos, Int64 aDistance, Double aDirection, Double aFadeDirection, Double aHorizontalScalingFactor, Double aVerticalScalingFactor, Double aHorizontalSkew, Double aVerticalSkew, TDrawingRectAlign aShadowAlignment, Boolean aRotateWithShape)

Parameters

<-> | Parameter | Type | Description
 | aBlurRadius | Int64 | Blur radius.
 | aStartAlpha | Double | Starting Alpha.
 | aStartPos | Double | Starting position for Alpha.
 | aEndAlpha | Double | Ending Alpha.
 | aEndPos | Double | Ending position for Alpha.
 | aDistance | Int64 | Distance of the shadow.
 | aDirection | Double | Rotation of the shadow.
 | aFadeDirection | Double | Fade direction.
 | aHorizontalScalingFactor | Double | Horizontal scaling factor. Negative scaling causes a flip.
 | aVerticalScalingFactor | Double | Vertical scaling factor. Negative scaling causes a flip.
 | aHorizontalSkew | Double | Horizontal skew angle.
 | aVerticalSkew | Double | Vertical skew angle.
 | aShadowAlignment | TDrawingRectAlign | Shadow Alignment.
 | aRotateWithShape | Boolean | If true, the effect rotates with the shape.

See also

  • TReflectionEffect


TReflectionEffect.Clone Method | FlexCel Studio for the .NET Framework documentation

TReflectionEffect.Clone Method

Creates a deep copy of the object.

Syntax

Namespace: FlexCel.Core

public TReflectionEffect Clone()

See also

  • TReflectionEffect


TReflectionEffect.CompareTo Method | FlexCel Studio for the .NET Framework documentation

TReflectionEffect.CompareTo Method

Overloads

  • TReflectionEffect.CompareTo(Object)
  • TReflectionEffect.CompareTo(TReflectionEffect)

TReflectionEffect.CompareTo(Object)

Returns -1, 0 or 1 depending if this object is smaller or bigger than the other.

Syntax

Namespace: FlexCel.Core

public Int32 CompareTo(Object other)

Parameters

<-> | Parameter | Type | Description
 | other | Object |

See also

  • TReflectionEffect

TReflectionEffect.CompareTo(TReflectionEffect)

Returns -1, 0 or 1 depending if this object is smaller or bigger than the other.

Syntax

Namespace: FlexCel.Core

public Int32 CompareTo(TReflectionEffect other)

Parameters

<-> | Parameter | Type | Description
 | other | TReflectionEffect |

See also

  • TReflectionEffect


TReflectionEffect.Equals Method | FlexCel Studio for the .NET Framework documentation

TReflectionEffect.Equals Method

Overloads

  • TReflectionEffect.Equals(TReflectionEffect)
  • TReflectionEffect.Equals(Object)

TReflectionEffect.Equals(TReflectionEffect)

Returns true if both objects are the same.

Syntax

Namespace: FlexCel.Core

protected Boolean Equals(TReflectionEffect other)

Parameters

<-> | Parameter | Type | Description
 | other | TReflectionEffect |

See also

  • TReflectionEffect

TReflectionEffect.Equals(Object)

Returns true if both objects are the same.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object other)

Parameters

<-> | Parameter | Type | Description
 | other | Object |

See also

  • TReflectionEffect


TReflectionEffect.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TReflectionEffect.GetHashCode Method

Returns the hashcode of the object.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TReflectionEffect


TReflectionEffect.BlurRadius Property | FlexCel Studio for the .NET Framework documentation

TReflectionEffect.BlurRadius Property

Blur radius.

Syntax

Namespace: FlexCel.Core

public Int64 BlurRadius { get; }

See also

  • TReflectionEffect


TReflectionEffect.StartAlpha Property | FlexCel Studio for the .NET Framework documentation

TReflectionEffect.StartAlpha Property

Starting reflection opacity.

Syntax

Namespace: FlexCel.Core

public Double StartAlpha { get; }

See also

  • TReflectionEffect


TReflectionEffect.StartPos Property | FlexCel Studio for the .NET Framework documentation

TReflectionEffect.StartPos Property

Starting position of the Alpha value.

Syntax

Namespace: FlexCel.Core

public Double StartPos { get; }

See also

  • TReflectionEffect


TReflectionEffect.EndAlpha Property | FlexCel Studio for the .NET Framework documentation

TReflectionEffect.EndAlpha Property

Ending reflection opacity.

Syntax

Namespace: FlexCel.Core

public Double EndAlpha { get; }

See also

  • TReflectionEffect


TReflectionEffect.EndPos Property | FlexCel Studio for the .NET Framework documentation

TReflectionEffect.EndPos Property

Ending position of the Alpha value.

Syntax

Namespace: FlexCel.Core

public Double EndPos { get; }

See also

  • TReflectionEffect


TReflectionEffect.Distance Property | FlexCel Studio for the .NET Framework documentation

TReflectionEffect.Distance Property

Distance of the reflection.

Syntax

Namespace: FlexCel.Core

public Int64 Distance { get; }

See also

  • TReflectionEffect


TReflectionEffect.Direction Property | FlexCel Studio for the .NET Framework documentation

TReflectionEffect.Direction Property

Rotation of the reflection.

Syntax

Namespace: FlexCel.Core

public Double Direction { get; }

See also

  • TReflectionEffect


TReflectionEffect.FadeDirection Property | FlexCel Studio for the .NET Framework documentation

TReflectionEffect.FadeDirection Property

Direction to offset the reflection.

Syntax

Namespace: FlexCel.Core

public Double FadeDirection { get; }

See also

  • TReflectionEffect


TReflectionEffect.HorizontalScalingFactor Property | FlexCel Studio for the .NET Framework documentation

TReflectionEffect.HorizontalScalingFactor Property

Horizontal scaling factor. Negative scaling causes a flip.

Syntax

Namespace: FlexCel.Core

public Double HorizontalScalingFactor { get; }

See also

  • TReflectionEffect


TReflectionEffect.VerticalScalingFactor Property | FlexCel Studio for the .NET Framework documentation

TReflectionEffect.VerticalScalingFactor Property

Vertical scaling factor. Negative scaling causes a flip.

Syntax

Namespace: FlexCel.Core

public Double VerticalScalingFactor { get; }

See also

  • TReflectionEffect


TReflectionEffect.HorizontalSkew Property | FlexCel Studio for the .NET Framework documentation

TReflectionEffect.HorizontalSkew Property

Horizontal skew angle.

Syntax

Namespace: FlexCel.Core

public Double HorizontalSkew { get; }

See also

  • TReflectionEffect


TReflectionEffect.VerticalSkew Property | FlexCel Studio for the .NET Framework documentation

TReflectionEffect.VerticalSkew Property

Vertical skew angle.

Syntax

Namespace: FlexCel.Core

public Double VerticalSkew { get; }

See also

  • TReflectionEffect


TReflectionEffect.ShadowAlignment Property | FlexCel Studio for the .NET Framework documentation

TReflectionEffect.ShadowAlignment Property

Shadow Alignment.

Syntax

Namespace: FlexCel.Core

public TDrawingRectAlign ShadowAlignment { get; }

See also

  • TReflectionEffect


TReflectionEffect.RotateWithShape Property | FlexCel Studio for the .NET Framework documentation

TReflectionEffect.RotateWithShape Property

If true, the effect rotates with the shape.

Syntax

Namespace: FlexCel.Core

public Boolean RotateWithShape { get; }

See also

  • TReflectionEffect


TRenderCorruptImageError Class | FlexCel Studio for the .NET Framework documentation

TRenderCorruptImageError Class

This class has information for a FlexCelError.RenderCorruptImage error. Look at FlexCelError.RenderCorruptImage for more information.

Syntax

Namespace: FlexCel.Core

public class TRenderCorruptImageError: TFlexCelErrorInfo

Constructors

Name | Description
TRenderCorrupt​Image​Error | Creates a new instance.


TRenderCorruptImageError.TRenderCorruptImageError Constructor | FlexCel Studio for the .NET Framework documentation

TRenderCorruptImageError.TRenderCorruptImageError Constructor

Creates a new instance.

Syntax

Namespace: FlexCel.Core

public TRenderCorruptImageError(String aMessage)

Parameters

<-> | Parameter | Type | Description
 | aMessage | String | See TFlexCelErrorInfo.Message

See also

  • TRenderCorruptImageError


TRenderErrorDrawingImageError Class | FlexCel Studio for the .NET Framework documentation

TRenderErrorDrawingImageError Class

This class has information for a FlexCelError.RenderErrorDrawingImage error. Look at FlexCelError.RenderErrorDrawingImage for more information.

Syntax

Namespace: FlexCel.Core

public class TRenderErrorDrawingImageError: TFlexCelErrorInfo

Constructors

Name | Description
TRenderError​Drawing​Image​Error | Creates a new instance.


TRenderErrorDrawingImageError.TRenderErrorDrawingImageError Constructor | FlexCel Studio for the .NET Framework documentation

TRenderErrorDrawingImageError.TRenderErrorDrawingImageError Constructor

Creates a new instance.

Syntax

Namespace: FlexCel.Core

public TRenderErrorDrawingImageError(String aMessage)

Parameters

<-> | Parameter | Type | Description
 | aMessage | String | See TFlexCelErrorInfo.Message

See also

  • TRenderErrorDrawingImageError


TRenderGenericPreviewError Class | FlexCel Studio for the .NET Framework documentation

TRenderGenericPreviewError Class

This class has information for a FlexCelError.RenderGenericPreview error. Look at FlexCelError.RenderGenericPreview for more information.

Syntax

Namespace: FlexCel.Core

public class TRenderGenericPreviewError: TFlexCelErrorInfo

Constructors

Name | Description
TRenderGeneric​Preview​Error | Creates a new instance.

Properties

Name | Description
StackTrace | Returns the stack trace for the error.


TRenderGenericPreviewError.TRenderGenericPreviewError Constructor | FlexCel Studio for the .NET Framework documentation

TRenderGenericPreviewError.TRenderGenericPreviewError Constructor

Creates a new instance.

Syntax

Namespace: FlexCel.Core

public TRenderGenericPreviewError(String aMessage, String aStackTrace)

Parameters

<-> | Parameter | Type | Description
 | aMessage | String | See TFlexCelErrorInfo.Message
 | aStackTrace | String | Stack trace for the error.

See also

  • TRenderGenericPreviewError


TRenderGenericPreviewError.StackTrace Property | FlexCel Studio for the .NET Framework documentation

TRenderGenericPreviewError.StackTrace Property

Returns the stack trace for the error.

Syntax

Namespace: FlexCel.Core

public String StackTrace { get; }

See also

  • TRenderGenericPreviewError


TRenderMetafileError Class | FlexCel Studio for the .NET Framework documentation

TRenderMetafileError Class

This class has information for a FlexCelError.RenderMetafile error. Look at FlexCelError.RenderMetafile for more information.

Syntax

Namespace: FlexCel.Core

public class TRenderMetafileError: TFlexCelErrorInfo

Constructors

Name | Description
TRenderMetafileError | Creates a new instance.


TRenderMetafileError.TRenderMetafileError Constructor | FlexCel Studio for the .NET Framework documentation

TRenderMetafileError.TRenderMetafileError Constructor

Creates a new instance.

Syntax

Namespace: FlexCel.Core

public TRenderMetafileError(String aMessage)

Parameters

<-> | Parameter | Type | Description
 | aMessage | String | See TFlexCelErrorInfo.Message

See also

  • TRenderMetafileError


TReplaceAction Class | FlexCel Studio for the .NET Framework documentation

TReplaceAction Class

Specifies actions to do in every replacement.

Syntax

Namespace: FlexCel.Core

public class TReplaceAction

Properties

Name | Description
Workbook | File where the cell is being replaced.
Row | Row of the replaced cell.
Col | Column of the replaced cell.
ReplacementNumber | Number of replacement being made. This number will be 1 for the first replacement, 2 for the second and so on.
SkipReplacement | Set this value to true to skip the current replacement.
XF | Format for the replaced cell. Change it if you want to provide custom format for the cell.
CellValue | Value of the replaced cell. You can change it to something else.


TReplaceAction.Workbook Property | FlexCel Studio for the .NET Framework documentation

TReplaceAction.Workbook Property

File where the cell is being replaced.

Syntax

Namespace: FlexCel.Core

public ExcelFile Workbook { get; }

See also

  • TReplaceAction


TReplaceAction.Row Property | FlexCel Studio for the .NET Framework documentation

TReplaceAction.Row Property

Row of the replaced cell.

Syntax

Namespace: FlexCel.Core

public Int32 Row { get; }

See also

  • TReplaceAction


TReplaceAction.Col Property | FlexCel Studio for the .NET Framework documentation

TReplaceAction.Col Property

Column of the replaced cell.

Syntax

Namespace: FlexCel.Core

public Int32 Col { get; }

See also

  • TReplaceAction


TReplaceAction.ReplacementNumber Property | FlexCel Studio for the .NET Framework documentation

TReplaceAction.ReplacementNumber Property

Number of replacement being made. This number will be 1 for the first replacement, 2 for the second and so on.

Syntax

Namespace: FlexCel.Core

public Int32 ReplacementNumber { get; }

See also

  • TReplaceAction


TReplaceAction.SkipReplacement Property | FlexCel Studio for the .NET Framework documentation

TReplaceAction.SkipReplacement Property

Set this value to true to skip the current replacement.

Syntax

Namespace: FlexCel.Core

public Boolean SkipReplacement { get; set; }

See also

  • TReplaceAction


TReplaceAction.XF Property | FlexCel Studio for the .NET Framework documentation

TReplaceAction.XF Property

Format for the replaced cell. Change it if you want to provide custom format for the cell.

Syntax

Namespace: FlexCel.Core

public Int32 XF { get; set; }

See also

  • TReplaceAction


TReplaceAction.CellValue Property | FlexCel Studio for the .NET Framework documentation

TReplaceAction.CellValue Property

Value of the replaced cell. You can change it to something else.

Syntax

Namespace: FlexCel.Core

public Object CellValue { get; set; }

See also

  • TReplaceAction


TRichString Class | FlexCel Studio for the .NET Framework documentation

TRichString Class

A string cell value with its rich text information. RTFRuns is an array of TRTFRun structures, where each struct identifies a font style for a portion of text. For example, if you have: Value = "Hello" RTFRuns = {FirstChar:1 FontIndex:1, FirstChar:3, FontIndex:2} "H" (char 0) will be formatted with the specific cell format.

"el" (chars 1 and 2) will have font number 1 "lo" (chars 3 and 4) will have font number 2

Syntax

Namespace: FlexCel.Core

public class TRichString: ICloneable, IConvertible

Constructors

Name | Description
TRichString | Overloaded TRichString TRichString(String) TRichString(String, TRTFRun[], ExcelFile) TRichString(String, TRichString, Int32)

Methods

Name | Description
FromHtml | Returns a new TRichString from an HTML text. Note that only some tags from HTML are converted, the ones that do not have correspondence on Excel rich text will be discarded.Note: This method is for advanced uses only. Normally you would just use ExcelFile.​Set​Cell​From​Html(​​Int32, Int32, String, Int32)
RTFRun A run of RTF.
SetRTFRun Sets one RTF run.
GetFont Return the font for a font index.
GetFontForChar Returns the index of the run for the character charIndex in the string. If there is no font for the character, it will return -1.
ToString Returns the string without Rich text info.
Substring Overloaded
 Substring(Int32)
Substring(Int32, Int32)
Add Adds two richstrings together. If using C#, you can just use the overloaded "+" operator to concatenate rich strings.
Trim Trims all the whitespace at the beginning and end of the string.
RightTrim Trims all the whitespace at the end of the string.
Replace Overloaded
 Replace(String, String)
Replace(String, String, Boolean)
SetFromHtml | Sets the rich string content from an HTML Formatted string. Note: This method is for advanced uses only. Normally you would just use ExcelFile.​Set​Cell​From​Html(​​Int32, Int32, String, Int32)
ToHtml Overloaded
 ToHtml(ExcelFile, TFlxFormat, THtmlVersion, THtmlStyle, Encoding)
ToHtml(ExcelFile, TFlxFormat, THtmlVersion, THtmlStyle, Encoding, IHtmlFontEvent)
Clone Returns a Deep copy of the Rich string.
Equals Returns true when both richstrings are equal.
GetHashCode Hashcode for this richstring.

Operators

Name | Description
Addition | Concatenates two TRichString objects. Be careful that formats will be preserved from s1 to s2. If s1 ends up in red, s2 will start with red too. If you want to avoid this, make sure s2 has a font definition at character 0. ALSO, MAKE SURE YOU ARE CONCATENATING RICH STRINGS FROM THE SAME WORKBOOK, SO FONT INDEXES ARE SIMILAR.
Implicit Conversion | Overloaded Implicit conversion from String to TRichString Implicit conversion from TRichString to String
Equality | Returns true if both RichStrings are equal. Note this is for backwards compatibility, this is a class and not immutable, so this method should return true if references are different. But that would break old code.
Inequality | Returns true if both RichStrings do not have the same value. Note this is for backwards compatibility, this is a class and not immutable, so this method should return true if references are different. But that would break old code.

Properties

Name | Description
Value | Text of the string without formatting.
RTFRunCount | Number of RTF runs.
MaxFontIndex | The count of Fonts on the richstring.
this[] | Returns the character at position index.
Length | Length of the RichString.
IsEmpty | Returns true if the string is empty.


TRichString.TRichString Constructor | FlexCel Studio for the .NET Framework documentation

TRichString.TRichString Constructor

Overloads

  • TRichString.TRichString
  • TRichString.TRichString(String)
  • TRichString.TRichString(String, TRTFRun[], ExcelFile)
  • TRichString.TRichString(String, TRichString, Int32)

TRichString.TRichString

Constructs an empty RichString.

Syntax

Namespace: FlexCel.Core

public TRichString()

See also

  • TRichString

TRichString.TRichString(String)

Constructs a RichString without formatting.

Syntax

Namespace: FlexCel.Core

public TRichString(String aValue)

Parameters

<-> | Parameter | Type | Description
 | aValue | String |

See also

  • TRichString

TRichString.TRichString(String, TRTFRun[], ExcelFile)

Constructs a default RichString with text and RTF info.

Syntax

Namespace: FlexCel.Core

public TRichString(String aValue, TRTFRun[] aRTFRuns, ExcelFile aWorkbook)

Parameters

<-> | Parameter | Type | Description
 | aValue | String | Cell Text
 | aRTFRuns | TRTFRun[] | Array of TRTFRuns structs. This value will be COPIED, so old reference is not used
 | aWorkbook | ExcelFile | Workbook containing the fonts.

See also

  • TRichString

TRichString.TRichString(String, TRichString, Int32)

Constructs a default RichString with text and RTF info.

Syntax

Namespace: FlexCel.Core

public TRichString(String aValue, TRichString aRichString, Int32 offset)

Parameters

<-> | Parameter | Type | Description
 | aValue | String | Cell Text
 | aRichString | TRichString | Rich string with the RTF values to copy. This value will be COPIED, so old reference is not used
 | offset | Int32 | How many characters the RTFRun must be moved. For example: RichString(s.SubString(3), RTFRuns, 3) will adapt the RTFRun for s to the new substring.

See also

  • TRichString


TRichString.FromHtml Method | FlexCel Studio for the .NET Framework documentation

TRichString.FromHtml Method

Returns a new TRichString from an HTML text. Note that only some tags from HTML are converted, the ones that do not have correspondence on Excel rich text will be discarded.Note: This method is for advanced uses only. Normally you would just use ExcelFile.SetCellFromHtml(Int32, Int32, String, Int32)

Syntax

Namespace: FlexCel.Core

public static TRichString FromHtml(String HtmlString, TFlxFormat aCellFormat, ExcelFile aWorkbook)

Parameters

<-> | Parameter | Type | Description
 | HtmlString | String | Html string we want to convert.
 | aCellFormat | TFlxFormat | Original format of the cell where we want to enter the string. Note that depending on the starting cell, the Rich string will be different. For example, if you have a cell with Red text and add a "hello <b> world" string, then resulting RichString will include a RED bold "world" string
 | aWorkbook | ExcelFile | File where this string will be added.

Returns

A TRichString containing the converted Html.

See also

  • TRichString


TRichString.RTFRun Method | FlexCel Studio for the .NET Framework documentation

TRichString.RTFRun Method

A run of RTF.

Syntax

Namespace: FlexCel.Core

public TRTFRun RTFRun(Int32 index)

Parameters

<-> | Parameter | Type | Description
 | index | Int32 | Index on the list. 0-Based.

See also

  • TRichString


TRichString.SetRTFRun Method | FlexCel Studio for the .NET Framework documentation

TRichString.SetRTFRun Method

Sets one RTF run.

Syntax

Namespace: FlexCel.Core

public void SetRTFRun(ExcelFile xls, Int32 index, TRTFRun value)

Parameters

<-> | Parameter | Type | Description
 | xls | ExcelFile |
 | index | Int32 |
 | value | TRTFRun |

See also

  • TRichString


TRichString.GetFont Method | FlexCel Studio for the .NET Framework documentation

TRichString.GetFont Method

Return the font for a font index.

Syntax

Namespace: FlexCel.Core

public TFlxFont GetFont(Int32 i)

Parameters

<-> | Parameter | Type | Description
 | i | Int32 | index of the font (0 based).

See also

  • TRichString


TRichString.GetFontForChar Method | FlexCel Studio for the .NET Framework documentation

TRichString.GetFontForChar Method

Returns the index of the run for the character charIndex in the string. If there is no font for the character, it will return -1.

Syntax

Namespace: FlexCel.Core

public Int32 GetFontForChar(Int32 charIndex)

Parameters

<-> | Parameter | Type | Description
 | charIndex | Int32 | Index of the character in the string (0 based)

Returns

Run that includes charIndex (0 based)

See also

  • TRichString


TRichString.ToString Method | FlexCel Studio for the .NET Framework documentation

TRichString.ToString Method

Returns the string without Rich text info.

Syntax

Namespace: FlexCel.Core

public override String ToString()

See also

  • TRichString


TRichString.Substring Method | FlexCel Studio for the .NET Framework documentation

TRichString.Substring Method

Overloads

  • TRichString.Substring(Int32)
  • TRichString.Substring(Int32, Int32)

TRichString.Substring(Int32)

Retrieves a substring from this instance. The substring starts at a specified character position and ends at the end of the string.

Syntax

Namespace: FlexCel.Core

public TRichString Substring(Int32 index)

Parameters

<-> | Parameter | Type | Description
 | index | Int32 | Start of the substring (0 based)

See also

  • TRichString

TRichString.Substring(Int32, Int32)

Retrieves a substring from this instance. The substring starts at a specified character position and has a specified length.

Syntax

Namespace: FlexCel.Core

public TRichString Substring(Int32 index, Int32 count)

Parameters

<-> | Parameter | Type | Description
 | index | Int32 | Start of the substring (0 based)
 | count | Int32 | Number of characters to copy.

See also

  • TRichString


TRichString.Add Method | FlexCel Studio for the .NET Framework documentation

TRichString.Add Method

Adds two richstrings together. If using C#, you can just use the overloaded "+" operator to concatenate rich strings.

Syntax

Namespace: FlexCel.Core

public TRichString Add(TRichString s1)

Parameters

<-> | Parameter | Type | Description
 | s1 | TRichString |

See also

  • TRichString


TRichString.Trim Method | FlexCel Studio for the .NET Framework documentation

TRichString.Trim Method

Trims all the whitespace at the beginning and end of the string.

Syntax

Namespace: FlexCel.Core

public TRichString Trim()

See also

  • TRichString


TRichString.RightTrim Method | FlexCel Studio for the .NET Framework documentation

TRichString.RightTrim Method

Trims all the whitespace at the end of the string.

Syntax

Namespace: FlexCel.Core

public TRichString RightTrim()

See also

  • TRichString


TRichString.Replace Method | FlexCel Studio for the .NET Framework documentation

TRichString.Replace Method

Overloads

  • TRichString.Replace(String, String)
  • TRichString.Replace(String, String, Boolean)

TRichString.Replace(String, String)

Replaces all oldValue strings with newValue strings inside the RichString. (case sensitive)

Syntax

Namespace: FlexCel.Core

public TRichString Replace(String oldValue, String newValue)

Parameters

<-> | Parameter | Type | Description
 | oldValue | String | String to replace.
 | newValue | String | String that will replace oldValue

Returns

A new TRichString with all oldValues replaced with newValues.

See also

  • TRichString

TRichString.Replace(String, String, Boolean)

Replaces all oldValue strings with newValue strings inside the RichString.

Syntax

Namespace: FlexCel.Core

public TRichString Replace(String oldValue, String newValue, Boolean CaseInsensitive)

Parameters

<-> | Parameter | Type | Description
 | oldValue | String | String to replace.
 | newValue | String | String that will replace oldValue
 | CaseInsensitive | Boolean | If true, it will not take care of case for the search.

Returns

A new TRichString with all oldValues replaced with newValues.

See also

  • TRichString


TRichString.SetFromHtml Method | FlexCel Studio for the .NET Framework documentation

TRichString.SetFromHtml Method

Sets the rich string content from an HTML Formatted string. Note: This method is for advanced uses only. Normally you would just use ExcelFile.SetCellFromHtml(Int32, Int32, String, Int32)

Syntax

Namespace: FlexCel.Core

public void SetFromHtml(String HtmlString, TFlxFormat aCellFormat, ExcelFile aWorkbook)

Parameters

<-> | Parameter | Type | Description
 | HtmlString | String | String with the HTML data.
 | aCellFormat | TFlxFormat | Initial format of the cell where we want to enter the html string.
 | aWorkbook | ExcelFile | ExcelFile where the cell is.

See also

  • TRichString


TRichString.ToHtml Method | FlexCel Studio for the .NET Framework documentation

TRichString.ToHtml Method

Overloads

  • TRichString.ToHtml(ExcelFile, TFlxFormat, THtmlVersion, THtmlStyle, Encoding)
  • TRichString.ToHtml(ExcelFile, TFlxFormat, THtmlVersion, THtmlStyle, Encoding, IHtmlFontEvent)

TRichString.ToHtml(ExcelFile, TFlxFormat, THtmlVersion, THtmlStyle, Encoding)

Returns the rich string content as an HTML Formatted string. Note: This method is for advanced uses only. Normally you would just use ExcelFile.GetHtmlFromCell(Int32, Int32, THtmlVersion, THtmlStyle, Encoding)

Syntax

Namespace: FlexCel.Core

public String ToHtml(ExcelFile aWorkbook, TFlxFormat aCellFormat, THtmlVersion htmlVersion, THtmlStyle htmlStyle, Encoding aEncoding)

Parameters

<-> | Parameter | Type | Description
 | aWorkbook | ExcelFile | ExcelFile where the cell is.
 | aCellFormat | TFlxFormat | Format of the cell where this string is.
 | htmlVersion | THtmlVersion | Version of the html returned. In XHTML, single tags have a "/" at the end, while in 4.0 they don't.
 | htmlStyle | THtmlStyle | Specifies whether to use CSS or not.
 | aEncoding | Encoding | Encoder used to return the string. Use UTF-8 for normal cases.

Returns

The string formatted as an HTML string.

See also

  • TRichString

TRichString.ToHtml(ExcelFile, TFlxFormat, THtmlVersion, THtmlStyle, Encoding, IHtmlFontEvent)

Returns the rich string content as an HTML Formatted string. Note: This method is for advanced uses only. Normally you would just use ExcelFile.GetHtmlFromCell(Int32, Int32, THtmlVersion, THtmlStyle, Encoding)

Syntax

Namespace: FlexCel.Core

public String ToHtml(ExcelFile aWorkbook, TFlxFormat aCellFormat, THtmlVersion htmlVersion, THtmlStyle htmlStyle, Encoding aEncoding, IHtmlFontEvent OnHtmlFont)

Parameters

<-> | Parameter | Type | Description
 | aWorkbook | ExcelFile | ExcelFile where the cell is.
 | aCellFormat | TFlxFormat | Format of the cell where this string is.
 | htmlVersion | THtmlVersion | Version of the html returned. In XHTML, single tags have a "/" at the end, while in 4.0 they don't.
 | htmlStyle | THtmlStyle | Specifies whether to use CSS or not.
 | aEncoding | Encoding | Encoder used to return the string. Use UTF-8 for normal cases.
 | OnHtmlFont | IHtmlFontEvent | Provide this parameter to customize what to do when different fonts are found in the string.

Returns

The string formatted as an HTML string.

See also

  • TRichString


TRichString.Clone Method | FlexCel Studio for the .NET Framework documentation

TRichString.Clone Method

Returns a Deep copy of the Rich string.

Syntax

Namespace: FlexCel.Core

public Object Clone()

See also

  • TRichString


TRichString.Equals Method | FlexCel Studio for the .NET Framework documentation

TRichString.Equals Method

Returns true when both richstrings are equal.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TRichString


TRichString.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TRichString.GetHashCode Method

Hashcode for this richstring.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TRichString


TRichString.Addition Operator | FlexCel Studio for the .NET Framework documentation

TRichString.Addition Operator

Concatenates two TRichString objects. Be careful that formats will be preserved from s1 to s2. If s1 ends up in red, s2 will start with red too. If you want to avoid this, make sure s2 has a font definition at character 0. ALSO, MAKE SURE YOU ARE CONCATENATING RICH STRINGS FROM THE SAME WORKBOOK, SO FONT INDEXES ARE SIMILAR.

Syntax

Namespace: FlexCel.Core

public static TRichString op_Addition(TRichString s1, TRichString s2)

Parameters

<-> | Parameter | Type | Description
 | s1 | TRichString | First string to concatenate.
 | s2 | TRichString | Second string to concatenate.

See also

  • TRichString


TRichString Implicit Conversion Operator | FlexCel Studio for the .NET Framework documentation

TRichString Implicit Conversion Operator

Overloads

  • Implicit conversion from String to TRichString
  • Implicit conversion from TRichString to String

Implicit conversion from String to TRichString

Converts a string to a TRichstring.

Syntax

Namespace: FlexCel.Core

public static TRichString op_Implicit(String s)

Parameters

<-> | Parameter | Type | Description
 | s | String |

See also

  • TRichString

Implicit conversion from TRichString to String

Converts a TRichstring to a string.

Syntax

Namespace: FlexCel.Core

public static String op_Implicit(TRichString r)

Parameters

<-> | Parameter | Type | Description
 | r | TRichString |

See also

  • TRichString


TRichString.Equality Operator | FlexCel Studio for the .NET Framework documentation

TRichString.Equality Operator

Returns true if both RichStrings are equal. Note this is for backwards compatibility, this is a class and not immutable, so this method should return true if references are different. But that would break old code.

Syntax

Namespace: FlexCel.Core

public static Boolean op_Equality(TRichString s1, TRichString s2)

Parameters

<-> | Parameter | Type | Description
 | s1 | TRichString |
 | s2 | TRichString |

See also

  • TRichString


TRichString.Inequality Operator | FlexCel Studio for the .NET Framework documentation

TRichString.Inequality Operator

Returns true if both RichStrings do not have the same value. Note this is for backwards compatibility, this is a class and not immutable, so this method should return true if references are different. But that would break old code.

Syntax

Namespace: FlexCel.Core

public static Boolean op_Inequality(TRichString s1, TRichString s2)

Parameters

<-> | Parameter | Type | Description
 | s1 | TRichString |
 | s2 | TRichString |

See also

  • TRichString


TRichString.Value Property | FlexCel Studio for the .NET Framework documentation

TRichString.Value Property

Text of the string without formatting.

Syntax

Namespace: FlexCel.Core

public String Value { get; set; }

See also

  • TRichString


TRichString.RTFRunCount Property | FlexCel Studio for the .NET Framework documentation

TRichString.RTFRunCount Property

Number of RTF runs.

Syntax

Namespace: FlexCel.Core

public Int32 RTFRunCount { get; }

See also

  • TRichString


TRichString.MaxFontIndex Property | FlexCel Studio for the .NET Framework documentation

TRichString.MaxFontIndex Property

The count of Fonts on the richstring.

Syntax

Namespace: FlexCel.Core

public Int32 MaxFontIndex { get; }

See also

  • TRichString


TRichString.this[] Property | FlexCel Studio for the .NET Framework documentation

TRichString.this[] Property

Returns the character at position index.

Syntax

Namespace: FlexCel.Core

public Char this[] { get; }

See also

  • TRichString


TRichString.Length Property | FlexCel Studio for the .NET Framework documentation

TRichString.Length Property

Length of the RichString.

Syntax

Namespace: FlexCel.Core

public Int32 Length { get; }

See also

  • TRichString


TRichString.IsEmpty Property | FlexCel Studio for the .NET Framework documentation

TRichString.IsEmpty Property

Returns true if the string is empty.

Syntax

Namespace: FlexCel.Core

public Boolean IsEmpty { get; }

See also

  • TRichString


TScatterChartOptions Class | FlexCel Studio for the .NET Framework documentation

TScatterChartOptions Class

Options specific for a Scatter/Bubble chart.

Syntax

Namespace: FlexCel.Core

public class TScatterChartOptions: TChartOptions

Constructors

Name | Description
TScatterChartOptions | Overloaded TScatterChartOptions(Boolean) TScatterChartOptions(Boolean, Int32, TBubbleSizeType, Boolean) TScatterChartOptions(Int32, Boolean, Int32, ChartSeriesOptions, Int32, TBubbleSizeType, Boolean, Boolean, Boolean, TDataLabel)

Methods

Name | Description
IsStacked | Returns true is the chart is stacked, either normally or 100% stacked.

Properties

Name | Description
BubblePercentRatio | Percent of largest bubble compared to chart in general.
BubbleSizeType | What the bubble size represents.
IsBubbleChart | True if this is a bubble chart, false if it is a scatter chart.
ShowNegativeBubbles | True if negative bubbles should be shwown.
BubblesHaveShadow | True if the bubbles have shadows.


TScatterChartOptions.TScatterChartOptions Constructor | FlexCel Studio for the .NET Framework documentation

TScatterChartOptions.TScatterChartOptions Constructor

Overloads

  • TScatterChartOptions.TScatterChartOptions(Boolean)
  • TScatterChartOptions.TScatterChartOptions(Boolean, Int32, TBubbleSizeType, Boolean)
  • TScatterChartOptions.TScatterChartOptions(Int32, Boolean, Int32, ChartSeriesOptions, Int32, TBubbleSizeType, Boolean, Boolean, Boolean, TDataLabel)

TScatterChartOptions.TScatterChartOptions(Boolean)

Creates a new chart options simplified for a scatter chart.

Syntax

Namespace: FlexCel.Core

public TScatterChartOptions(Boolean aChangeColorsOnEachSeries)

Parameters

<-> | Parameter | Type | Description
 | aChangeColorsOnEachSeries | Boolean | See TChartOptions.ChangeColorsOnEachSeries

See also

  • TScatterChartOptions

TScatterChartOptions.TScatterChartOptions(Boolean, Int32, TBubbleSizeType, Boolean)

Creates a new chart options simplified for a bubble chart.

Syntax

Namespace: FlexCel.Core

public TScatterChartOptions(Boolean aChangeColorsOnEachSeries, Int32 aBubblePercentRatio, TBubbleSizeType aBubbleSizeType, Boolean aShowNegativeBubbles)

Parameters

<-> | Parameter | Type | Description
 | aChangeColorsOnEachSeries | Boolean | See TChartOptions.ChangeColorsOnEachSeries
 | aBubblePercentRatio | Int32 | See BubblePercentRatio
 | aBubbleSizeType | TBubbleSizeType | See BubbleSizeType
 | aShowNegativeBubbles | Boolean | See ShowNegativeBubbles

See also

  • TScatterChartOptions

TScatterChartOptions.TScatterChartOptions(Int32, Boolean, Int32, ChartSeriesOptions, Int32, TBubbleSizeType, Boolean, Boolean, Boolean, TDataLabel)

Creates a new TScatterChartOptions instance.

Syntax

Namespace: FlexCel.Core

public TScatterChartOptions(Int32 aAxisNumber, Boolean aChangeColorsOnEachSeries, Int32 aZOrder, ChartSeriesOptions aSeriesOptions, Int32 aBubblePercentRatio, TBubbleSizeType aBubbleSizeType, Boolean aIsBubbleChart, Boolean aShowNegativeBubbles, Boolean aBubblesHaveShadow, TDataLabel aDefaultLabel)

Parameters

<-> | Parameter | Type | Description
 | aAxisNumber | Int32 | See TChartOptions.AxisNumber
 | aChangeColorsOnEachSeries | Boolean | See TChartOptions.ChangeColorsOnEachSeries
 | aZOrder | Int32 | See TChartOptions.ZOrder
 | aSeriesOptions | ChartSeriesOptions | See TChartOptions.SeriesOptions
 | aBubblePercentRatio | Int32 | See BubblePercentRatio
 | aBubbleSizeType | TBubbleSizeType | See BubbleSizeType
 | aIsBubbleChart | Boolean | See IsBubbleChart
 | aShowNegativeBubbles | Boolean | See ShowNegativeBubbles
 | aBubblesHaveShadow | Boolean | See BubblesHaveShadow
 | aDefaultLabel | TDataLabel | Default label properties for labels in this group.

See also

  • TScatterChartOptions


TScatterChartOptions.IsStacked Method | FlexCel Studio for the .NET Framework documentation

TScatterChartOptions.IsStacked Method

Returns true is the chart is stacked, either normally or 100% stacked.

Syntax

Namespace: FlexCel.Core

public override Boolean IsStacked()

See also

  • TScatterChartOptions


TScatterChartOptions.BubblePercentRatio Property | FlexCel Studio for the .NET Framework documentation

TScatterChartOptions.BubblePercentRatio Property

Percent of largest bubble compared to chart in general.

Syntax

Namespace: FlexCel.Core

public Int32 BubblePercentRatio { get; set; }

See also

  • TScatterChartOptions


TScatterChartOptions.BubbleSizeType Property | FlexCel Studio for the .NET Framework documentation

TScatterChartOptions.BubbleSizeType Property

What the bubble size represents.

Syntax

Namespace: FlexCel.Core

public TBubbleSizeType BubbleSizeType { get; set; }

See also

  • TScatterChartOptions


TScatterChartOptions.IsBubbleChart Property | FlexCel Studio for the .NET Framework documentation

TScatterChartOptions.IsBubbleChart Property

True if this is a bubble chart, false if it is a scatter chart.

Syntax

Namespace: FlexCel.Core

public Boolean IsBubbleChart { get; set; }

See also

  • TScatterChartOptions


TScatterChartOptions.ShowNegativeBubbles Property | FlexCel Studio for the .NET Framework documentation

TScatterChartOptions.ShowNegativeBubbles Property

True if negative bubbles should be shwown.

Syntax

Namespace: FlexCel.Core

public Boolean ShowNegativeBubbles { get; set; }

See also

  • TScatterChartOptions


TScatterChartOptions.BubblesHaveShadow Property | FlexCel Studio for the .NET Framework documentation

TScatterChartOptions.BubblesHaveShadow Property

True if the bubbles have shadows.

Syntax

Namespace: FlexCel.Core

public Boolean BubblesHaveShadow { get; set; }

See also

  • TScatterChartOptions


TSeriesOptionsList Class | FlexCel Studio for the .NET Framework documentation

TSeriesOptionsList Class

A list of options for the whole series and for specific data points inside these series.

Syntax

Namespace: FlexCel.Core

public class TSeriesOptionsList: IEnumerable, IEnumerable<Int32>

Constructors

Name | Description
TSeriesOptionsList | Creates a new TSeriesOptionsList instance.

Methods

Name | Description
Add | Adds a new option to the list. If the option is null, nothing will be done.
GetValues | Gets all the values of the series.
GetEnumerator | Gets the enumerator for this class.

Properties

Name | Description
this[] | Gets or sets the value for a data point or for the whole series (when key = -1).
Count | Count of options.


TSeriesOptionsList.TSeriesOptionsList Constructor | FlexCel Studio for the .NET Framework documentation

TSeriesOptionsList.TSeriesOptionsList Constructor

Creates a new TSeriesOptionsList instance.

Syntax

Namespace: FlexCel.Core

public TSeriesOptionsList()

See also

  • TSeriesOptionsList


TSeriesOptionsList.Add Method | FlexCel Studio for the .NET Framework documentation

TSeriesOptionsList.Add Method

Adds a new option to the list. If the option is null, nothing will be done.

Syntax

Namespace: FlexCel.Core

public void Add(ChartSeriesOptions Options)

Parameters

<-> | Parameter | Type | Description
 | Options | ChartSeriesOptions | Options to add.

See also

  • TSeriesOptionsList


TSeriesOptionsList.GetValues Method | FlexCel Studio for the .NET Framework documentation

TSeriesOptionsList.GetValues Method

Gets all the values of the series.

Syntax

Namespace: FlexCel.Core

public ChartSeriesOptions[] GetValues()

See also

  • TSeriesOptionsList


TSeriesOptionsList.GetEnumerator Method | FlexCel Studio for the .NET Framework documentation

TSeriesOptionsList.GetEnumerator Method

Gets the enumerator for this class.

Syntax

Namespace: FlexCel.Core

public IEnumerator GetEnumerator()

See also

  • TSeriesOptionsList


TSeriesOptionsList.this[] Property | FlexCel Studio for the .NET Framework documentation

TSeriesOptionsList.this[] Property

Gets or sets the value for a data point or for the whole series (when key = -1).

Syntax

Namespace: FlexCel.Core

public ChartSeriesOptions this[] { get; set; }

See also

  • TSeriesOptionsList


TSeriesOptionsList.Count Property | FlexCel Studio for the .NET Framework documentation

TSeriesOptionsList.Count Property

Count of options.

Syntax

Namespace: FlexCel.Core

public Int32 Count { get; }

See also

  • TSeriesOptionsList


TShapeEffects Class | FlexCel Studio for the .NET Framework documentation

TShapeEffects Class

Contains information for the basic effects of an autoshape (subtle, none or moderate).

Syntax

Namespace: FlexCel.Core

public class TShapeEffects

Constructors

Name | Description
TShapeEffects | Creates a new instance.

Methods

Name | Description
Equals | Returns true if both objects are the same.
GetHashCode | Returns the hashcode for the object.
Clone | Returns a deep copy of this class.

Properties

Name | Description
ThemeStyle | Scheme used in the theme.
ThemeColor | Color used for the effects.


TShapeEffects.TShapeEffects Constructor | FlexCel Studio for the .NET Framework documentation

TShapeEffects.TShapeEffects Constructor

Creates a new instance.

Syntax

Namespace: FlexCel.Core

public TShapeEffects(TFormattingType aThemeStyle, TDrawingColor aThemeColor)

Parameters

<-> | Parameter | Type | Description
 | aThemeStyle | TFormattingType |
 | aThemeColor | TDrawingColor |

See also

  • TShapeEffects


TShapeEffects.Equals Method | FlexCel Studio for the .NET Framework documentation

TShapeEffects.Equals Method

Returns true if both objects are the same.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TShapeEffects


TShapeEffects.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TShapeEffects.GetHashCode Method

Returns the hashcode for the object.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TShapeEffects


TShapeEffects.Clone Method | FlexCel Studio for the .NET Framework documentation

TShapeEffects.Clone Method

Returns a deep copy of this class.

Syntax

Namespace: FlexCel.Core

public TShapeEffects Clone()

See also

  • TShapeEffects


TShapeEffects.ThemeStyle Property | FlexCel Studio for the .NET Framework documentation

TShapeEffects.ThemeStyle Property

Scheme used in the theme.

Syntax

Namespace: FlexCel.Core

public TFormattingType ThemeStyle { get; set; }

See also

  • TShapeEffects


TShapeEffects.ThemeColor Property | FlexCel Studio for the .NET Framework documentation

TShapeEffects.ThemeColor Property

Color used for the effects.

Syntax

Namespace: FlexCel.Core

public TDrawingColor ThemeColor { get; set; }

See also

  • TShapeEffects


TShapeFill Class | FlexCel Studio for the .NET Framework documentation

TShapeFill Class

Contains the information for the fill of an autoshape.

Syntax

Namespace: FlexCel.Core

public class TShapeFill

Constructors

Name Description
TShapeFill Overloaded
 TShapeFill(Boolean, TFillStyle)
TShapeFill(TFillStyle, Boolean, TFormattingType, Nullable<TDrawingColor>, Boolean)

Methods

Name | Description
Clone | Returns a deep copy of this object.
GetFill | Fill style for this object. This method will return FillStyle if it isn't null, or the default theme fill if it is.
Equals | Returns true if both objects have the same data.
GetHashCode | Hash code for the object.

Properties

Name | Description
HasFill | True if the object has fill, false if it is transparent.
FillStyle | Fill for the shape. If this value is null, the fill specified in the theme will be used instead. To know the real fill style used even if this value is null, use GetFill
ThemeColor | Fill taken from a theme. If FillStyle is null, this color here will be used along with the current theme.
ThemeStyle | Style (subtle, normal, intense) from the theme used, when a theme is used.
UseThemeBk | If true and using a theme, the background fill from the theme will be used, if not, the normal fill from the theme will be used.


TShapeFill.TShapeFill Constructor | FlexCel Studio for the .NET Framework documentation

TShapeFill.TShapeFill Constructor

Overloads

  • TShapeFill.TShapeFill(Boolean, TFillStyle)
  • TShapeFill.TShapeFill(TFillStyle, Boolean, TFormattingType, Nullable<TDrawingColor>, Boolean)

TShapeFill.TShapeFill(Boolean, TFillStyle)

Creates a simple shape fill.

Syntax

Namespace: FlexCel.Core

public TShapeFill(Boolean aHasFill, TFillStyle aFillStyle)

Parameters

<-> | Parameter | Type | Description
 | aHasFill | Boolean | True if the object has fill, false if it is transparent.
 | aFillStyle | TFillStyle | Fill used in the shape.

See also

  • TShapeFill

TShapeFill.TShapeFill(TFillStyle, Boolean, TFormattingType, Nullable<TDrawingColor>, Boolean)

Creates a more complex shape fill.

Syntax

Namespace: FlexCel.Core

public TShapeFill(TFillStyle aFillStyle, Boolean aHasFill, TFormattingType aThemeStyle, Nullable<TDrawingColor> aThemeColor, Boolean aUseThemeBk)

Parameters

<-> | Parameter | Type | Description
 | aFillStyle | TFillStyle |
 | aHasFill | Boolean |
 | aThemeStyle | TFormattingType |
 | aThemeColor | Nullable<TDrawingColor> |
 | aUseThemeBk | Boolean |

See also

  • TShapeFill


TShapeFill.Clone Method | FlexCel Studio for the .NET Framework documentation

TShapeFill.Clone Method

Returns a deep copy of this object.

Syntax

Namespace: FlexCel.Core

public TShapeFill Clone()

See also

  • TShapeFill


TShapeFill.GetFill Method | FlexCel Studio for the .NET Framework documentation

TShapeFill.GetFill Method

Fill style for this object. This method will return FillStyle if it isn't null, or the default theme fill if it is.

Syntax

Namespace: FlexCel.Core

public TFillStyle GetFill(IFlexCelPalette aPalette)

Parameters

<-> | Parameter | Type | Description
 | aPalette | IFlexCelPalette |

See also

  • TShapeFill


TShapeFill.Equals Method | FlexCel Studio for the .NET Framework documentation

TShapeFill.Equals Method

Returns true if both objects have the same data.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TShapeFill


TShapeFill.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TShapeFill.GetHashCode Method

Hash code for the object.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TShapeFill


TShapeFill.HasFill Property | FlexCel Studio for the .NET Framework documentation

TShapeFill.HasFill Property

True if the object has fill, false if it is transparent.

Syntax

Namespace: FlexCel.Core

public Boolean HasFill { get; set; }

See also

  • TShapeFill


TShapeFill.FillStyle Property | FlexCel Studio for the .NET Framework documentation

TShapeFill.FillStyle Property

Fill for the shape. If this value is null, the fill specified in the theme will be used instead. To know the real fill style used even if this value is null, use GetFill

Syntax

Namespace: FlexCel.Core

public TFillStyle FillStyle { get; set; }

See also

  • TShapeFill


TShapeFill.ThemeColor Property | FlexCel Studio for the .NET Framework documentation

TShapeFill.ThemeColor Property

Fill taken from a theme. If FillStyle is null, this color here will be used along with the current theme.

Syntax

Namespace: FlexCel.Core

public Nullable<TDrawingColor> ThemeColor { get; set; }

See also

  • TShapeFill


TShapeFill.ThemeStyle Property | FlexCel Studio for the .NET Framework documentation

TShapeFill.ThemeStyle Property

Style (subtle, normal, intense) from the theme used, when a theme is used.

Syntax

Namespace: FlexCel.Core

public TFormattingType ThemeStyle { get; set; }

See also

  • TShapeFill


TShapeFill.UseThemeBk Property | FlexCel Studio for the .NET Framework documentation

TShapeFill.UseThemeBk Property

If true and using a theme, the background fill from the theme will be used, if not, the normal fill from the theme will be used.

Syntax

Namespace: FlexCel.Core

public Boolean UseThemeBk { get; set; }

See also

  • TShapeFill


TShapeFont Class | FlexCel Studio for the .NET Framework documentation

TShapeFont Class

Contains information for the font of an autoshape.

Syntax

Namespace: FlexCel.Core

public class TShapeFont

Constructors

Name | Description
TShapeFont | Creates a new instance.

Methods

Name | Description
Equals | Returns true if both objects are the same.
GetHashCode | Returns the hascode for the object.
Clone | Returns a deep copy of this class.

Properties

Name | Description
ThemeScheme | Scheme used in the theme.
ThemeColor | Color used for the font.


TShapeFont.TShapeFont Constructor | FlexCel Studio for the .NET Framework documentation

TShapeFont.TShapeFont Constructor

Creates a new instance.

Syntax

Namespace: FlexCel.Core

public TShapeFont(TFontScheme aThemeScheme, TDrawingColor aThemeColor)

Parameters

<-> | Parameter | Type | Description
 | aThemeScheme | TFontScheme |
 | aThemeColor | TDrawingColor |

See also

  • TShapeFont


TShapeFont.Equals Method | FlexCel Studio for the .NET Framework documentation

TShapeFont.Equals Method

Returns true if both objects are the same.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TShapeFont


TShapeFont.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TShapeFont.GetHashCode Method

Returns the hascode for the object.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TShapeFont


TShapeFont.Clone Method | FlexCel Studio for the .NET Framework documentation

TShapeFont.Clone Method

Returns a deep copy of this class.

Syntax

Namespace: FlexCel.Core

public TShapeFont Clone()

See also

  • TShapeFont


TShapeFont.ThemeScheme Property | FlexCel Studio for the .NET Framework documentation

TShapeFont.ThemeScheme Property

Scheme used in the theme.

Syntax

Namespace: FlexCel.Core

public TFontScheme ThemeScheme { get; set; }

See also

  • TShapeFont


TShapeFont.ThemeColor Property | FlexCel Studio for the .NET Framework documentation

TShapeFont.ThemeColor Property

Color used for the font.

Syntax

Namespace: FlexCel.Core

public TDrawingColor ThemeColor { get; set; }

See also

  • TShapeFont


TShapeLine Class | FlexCel Studio for the .NET Framework documentation

TShapeLine Class

Contains the information for the line style for an autoshape.

Syntax

Namespace: FlexCel.Core

public class TShapeLine

Constructors

Name | Description
TShapeLine | Overloaded TShapeLine TShapeLine(Boolean, TLineStyle) TShapeLine(Boolean, TLineStyle, Nullable<TDrawingColor>, TFormattingType)

Methods

Name | Description
Clone | Returns a deep copy of this object.
GetLineFill | This is the color used to draw the line, even if LineStyle is null
GetWidth | Returns the line width. If there is a LineStyle this is the Line width, else if it is null it is the Theme line width.
GetDashing | Returns the line dashing, if there is a LineStyle this is the Line dashing, else if it is null it is the Theme line dashing.
GetCap | Returns the line cap, if there is a LineStyle this is the Line cap, else if it is null it is the Theme line cap.
GetCompoundLineType | Returns the line type, if there is a LineStyle this is the Line type, else if it is null it is the Theme line type.
GetJoin | Returns the line joining, if there is a LineStyle this is the Line join, else if it is null it is the Theme line join.
GetHeadArrow | Returns the line arrow for the head, if there is a LineStyle this is the Line arrow, else if it is null it is the Theme line arrow.
GetTailArrow | Returns the line arrow for the tail, if there is a LineStyle this is the Line arrow, else if it is null it is the Theme line arrow.
Equals | Returns true if both objects have the same data.
GetHashCode | Hash code for the object.

Properties

Name | Description
HasLine | True if the object has a border, false otherwise.
LineStyle | Line style used to draw the line. Note that this can be null, and in this case, a line style from the current theme is used. If this isn't null, the theme properties are ignored.
ThemeStyle | Theme used to draw the line. This property has effect only if LineStyle is null.
ThemeColor | Color that will be used instead of the default in the theme, when using a theme to draw the line. This property has effect only if LineStyle is null.


TShapeLine.TShapeLine Constructor | FlexCel Studio for the .NET Framework documentation

TShapeLine.TShapeLine Constructor

Overloads

  • TShapeLine.TShapeLine
  • TShapeLine.TShapeLine(Boolean, TLineStyle)
  • TShapeLine.TShapeLine(Boolean, TLineStyle, Nullable<TDrawingColor>, TFormattingType)

TShapeLine.TShapeLine

Creates a black simple line.

Syntax

Namespace: FlexCel.Core

public TShapeLine()

See also

  • TShapeLine

TShapeLine.TShapeLine(Boolean, TLineStyle)

Creates a line with a line style and no theme.

Syntax

Namespace: FlexCel.Core

public TShapeLine(Boolean aHasLine, TLineStyle aLineStyle)

Parameters

<-> | Parameter | Type | Description
 | aHasLine | Boolean | True if the shape has a line.
 | aLineStyle | TLineStyle | Custom line style. If null, the theme line style will be used.

See also

  • TShapeLine

TShapeLine.TShapeLine(Boolean, TLineStyle, Nullable<TDrawingColor>, TFormattingType)

Creates a line with all the options.

Syntax

Namespace: FlexCel.Core

public TShapeLine(Boolean aHasLine, TLineStyle aLineStyle, Nullable<TDrawingColor> aThemeColor, TFormattingType aThemeStyle)

Parameters

<-> | Parameter | Type | Description
 | aHasLine | Boolean | True if the shape has a line.
 | aLineStyle | TLineStyle | Custom line style. If null, the theme line style will be used.
 | aThemeColor | Nullable<TDrawingColor> | Color to use in a theme line style. Will be used only if aLineStyle is null. It has the color that will be used instead of the one in the theme. All other line properties come from the theme.
 | aThemeStyle | TFormattingType | Theme that will be used for the line. This only affects the line if aLineStyle is null.

See also

  • TShapeLine


TShapeLine.Clone Method | FlexCel Studio for the .NET Framework documentation

TShapeLine.Clone Method

Returns a deep copy of this object.

Syntax

Namespace: FlexCel.Core

public TShapeLine Clone()

See also

  • TShapeLine


TShapeLine.GetLineFill Method | FlexCel Studio for the .NET Framework documentation

TShapeLine.GetLineFill Method

This is the color used to draw the line, even if LineStyle is null

Syntax

Namespace: FlexCel.Core

public TFillStyle GetLineFill(IFlexCelPalette aPalette)

Parameters

<-> | Parameter | Type | Description
 | aPalette | IFlexCelPalette |

See also

  • TShapeLine


TShapeLine.GetWidth Method | FlexCel Studio for the .NET Framework documentation

TShapeLine.GetWidth Method

Returns the line width. If there is a LineStyle this is the Line width, else if it is null it is the Theme line width.

Syntax

Namespace: FlexCel.Core

public Int32 GetWidth(IFlexCelPalette aPalette, Int32 defaultValue)

Parameters

<-> | Parameter | Type | Description
 | aPalette | IFlexCelPalette |
 | defaultValue | Int32 |

See also

  • TShapeLine


TShapeLine.GetDashing Method | FlexCel Studio for the .NET Framework documentation

TShapeLine.GetDashing Method

Returns the line dashing, if there is a LineStyle this is the Line dashing, else if it is null it is the Theme line dashing.

Syntax

Namespace: FlexCel.Core

public TLineDashing GetDashing(IFlexCelPalette aPalette)

Parameters

<-> | Parameter | Type | Description
 | aPalette | IFlexCelPalette |

See also

  • TShapeLine


TShapeLine.GetCap Method | FlexCel Studio for the .NET Framework documentation

TShapeLine.GetCap Method

Returns the line cap, if there is a LineStyle this is the Line cap, else if it is null it is the Theme line cap.

Syntax

Namespace: FlexCel.Core

public TLineCap GetCap(IFlexCelPalette aPalette)

Parameters

<-> | Parameter | Type | Description
 | aPalette | IFlexCelPalette |

See also

  • TShapeLine


TShapeLine.GetCompoundLineType Method | FlexCel Studio for the .NET Framework documentation

TShapeLine.GetCompoundLineType Method

Returns the line type, if there is a LineStyle this is the Line type, else if it is null it is the Theme line type.

Syntax

Namespace: FlexCel.Core

public TCompoundLineType GetCompoundLineType(IFlexCelPalette aPalette)

Parameters

<-> | Parameter | Type | Description
 | aPalette | IFlexCelPalette |

See also

  • TShapeLine


TShapeLine.GetJoin Method | FlexCel Studio for the .NET Framework documentation

TShapeLine.GetJoin Method

Returns the line joining, if there is a LineStyle this is the Line join, else if it is null it is the Theme line join.

Syntax

Namespace: FlexCel.Core

public TLineJoin GetJoin(IFlexCelPalette aPalette)

Parameters

<-> | Parameter | Type | Description
 | aPalette | IFlexCelPalette |

See also

  • TShapeLine


TShapeLine.GetHeadArrow Method | FlexCel Studio for the .NET Framework documentation

TShapeLine.GetHeadArrow Method

Returns the line arrow for the head, if there is a LineStyle this is the Line arrow, else if it is null it is the Theme line arrow.

Syntax

Namespace: FlexCel.Core

public Nullable<TLineArrow> GetHeadArrow(IFlexCelPalette aPalette)

Parameters

<-> | Parameter | Type | Description
 | aPalette | IFlexCelPalette |

See also

  • TShapeLine


TShapeLine.GetTailArrow Method | FlexCel Studio for the .NET Framework documentation

TShapeLine.GetTailArrow Method

Returns the line arrow for the tail, if there is a LineStyle this is the Line arrow, else if it is null it is the Theme line arrow.

Syntax

Namespace: FlexCel.Core

public Nullable<TLineArrow> GetTailArrow(IFlexCelPalette aPalette)

Parameters

<-> | Parameter | Type | Description
 | aPalette | IFlexCelPalette |

See also

  • TShapeLine


TShapeLine.Equals Method | FlexCel Studio for the .NET Framework documentation

TShapeLine.Equals Method

Returns true if both objects have the same data.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TShapeLine


TShapeLine.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TShapeLine.GetHashCode Method

Hash code for the object.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TShapeLine


TShapeLine.HasLine Property | FlexCel Studio for the .NET Framework documentation

TShapeLine.HasLine Property

True if the object has a border, false otherwise.

Syntax

Namespace: FlexCel.Core

public Boolean HasLine { get; set; }

See also

  • TShapeLine


TShapeLine.LineStyle Property | FlexCel Studio for the .NET Framework documentation

TShapeLine.LineStyle Property

Line style used to draw the line. Note that this can be null, and in this case, a line style from the current theme is used. If this isn't null, the theme properties are ignored.

Syntax

Namespace: FlexCel.Core

public TLineStyle LineStyle { get; set; }

See also

  • TShapeLine


TShapeLine.ThemeStyle Property | FlexCel Studio for the .NET Framework documentation

TShapeLine.ThemeStyle Property

Theme used to draw the line. This property has effect only if LineStyle is null.

Syntax

Namespace: FlexCel.Core

public TFormattingType ThemeStyle { get; set; }

See also

  • TShapeLine


TShapeLine.ThemeColor Property | FlexCel Studio for the .NET Framework documentation

TShapeLine.ThemeColor Property

Color that will be used instead of the default in the theme, when using a theme to draw the line. This property has effect only if LineStyle is null.

Syntax

Namespace: FlexCel.Core

public Nullable<TDrawingColor> ThemeColor { get; set; }

See also

  • TShapeLine


TShapeOptionList Class | FlexCel Studio for the .NET Framework documentation

TShapeOptionList Class

This class holds a list of key/values pairs specifying the options for a shape. To Get a value from it, use: ShapeOptionList[TShapeOption.xxx];

Syntax

Namespace: FlexCel.Core

public class TShapeOptionList: IEnumerable, ICloneable, IEnumerable<TShapeOption>

Methods

Name Description
AsLong Returns a long property if it exists, otherwise the default value. Note: This method will always assume a positive number.
To get a signed int, use AsSignedLong
AsSignedLong Returns a long property if it exists, otherwise the default value. Note: This method will return negative numbers if the number is bigger than 65536.
To get an unsigned int, use AsLong
AsInt32 Returns a long property if it exists, otherwise the default value. Note: This method will return negative numbers if the number is bigger than 65536.
As1616 Returns a double (Expressed as 16.16) property if it exists, otherwise the default value.
ShapeOptionType Returns the type of property that a specific shape option is.
AsBool Overloaded
 AsBool(TShapeOption, Boolean)
AsBool(TShapeOption, Boolean, Int32)
CalcBoolKey Returns the position of a boolean in a set. This is an advanced method and should normally not be used.
AsUnicodeString Returns an unicode property if it exists, otherwise the default value.
GetGradientStopAlpha Returns a list of individual alpha values for the stops of a gradient. This is not available in xls files, only xlsx.
The alpha values determine the opacity of each stop, with 0 being completely transparent and 255 being completely opaque.
This value might be null if there is no gradient in the pattern, or if the individual stops don't have a defined alpha.
AsHyperLink Overloaded
 AsHyperLink(TShapeOption, TDrawingHyperlink)
AsHyperLink(ExcelFile, TShapeOption, TDrawingHyperlink)
AsByteArray Returns a byte array property if it exists, otherwise null.
AsImage Returns a byte array with the image if it exists, otherwise null.
Note that for SVG images, xlsx files store both a PNG and SVG image. In those cases, for backward compatibility reasons, this method will return the PNG image. To get the SVG, call AsImageAlternate
AsImageAlternate Returns a byte array with the image if it exists, otherwise null.
Note that for SVG images, xlsx files store both a PNG and SVG image. In those cases, this method will return the SVG image. To get the PNG, call AsImage
SetValue Overloaded
 SetValue(TShapeOption, Double)
SetValue(TShapeOption, Boolean)
SetValue(TShapeOption, TDrawingHyperlink)
SetValue(TShapeOption, String)
SetImage Sets a property with the bytes of an image.
SetBytes Sets a property with arbitrary bytes.
Equals Returns true if 2 instances of this class have the same values.
GetHashCode Hashcode for the object.
GetEnumerator Gets the enumerator for this class.
Clone Creates a deep copy of the object.

Properties

Name | Description
Keys | A list of the shape options in the list.


TShapeOptionList.AsLong Method | FlexCel Studio for the .NET Framework documentation

TShapeOptionList.AsLong Method

Returns a long property if it exists, otherwise the default value. Note: This method will always assume a positive number. To get a signed int, use AsSignedLong

Syntax

Namespace: FlexCel.Core

public Int64 AsLong(TShapeOption key, Int64 Default)

Parameters

<-> | Parameter | Type | Description
 | key | TShapeOption | Property Name.
 | Default | Int64 | What to return if the property does not exist.

See also

  • TShapeOptionList


TShapeOptionList.AsSignedLong Method | FlexCel Studio for the .NET Framework documentation

TShapeOptionList.AsSignedLong Method

Returns a long property if it exists, otherwise the default value. Note: This method will return negative numbers if the number is bigger than 65536. To get an unsigned int, use AsLong

Syntax

Namespace: FlexCel.Core

public Int64 AsSignedLong(TShapeOption key, Int64 Default)

Parameters

<-> | Parameter | Type | Description
 | key | TShapeOption | Property Name.
 | Default | Int64 | What to return if the property does not exist.

See also

  • TShapeOptionList


TShapeOptionList.AsInt32 Method | FlexCel Studio for the .NET Framework documentation

TShapeOptionList.AsInt32 Method

Returns a long property if it exists, otherwise the default value. Note: This method will return negative numbers if the number is bigger than 65536.

Syntax

Namespace: FlexCel.Core

public Int32 AsInt32(TShapeOption key, Int32 Default)

Parameters

<-> | Parameter | Type | Description
 | key | TShapeOption | Property Name.
 | Default | Int32 | What to return if the property does not exist.

See also

  • TShapeOptionList


TShapeOptionList.As1616 Method | FlexCel Studio for the .NET Framework documentation

TShapeOptionList.As1616 Method

Returns a double (Expressed as 16.16) property if it exists, otherwise the default value.

Syntax

Namespace: FlexCel.Core

public Double As1616(TShapeOption key, Double Default)

Parameters

<-> | Parameter | Type | Description
 | key | TShapeOption | Property Name.
 | Default | Double | What to return if the property does not exist.

See also

  • TShapeOptionList


TShapeOptionList.ShapeOptionType Method | FlexCel Studio for the .NET Framework documentation

TShapeOptionList.ShapeOptionType Method

Returns the type of property that a specific shape option is.

Syntax

Namespace: FlexCel.Core

public static TShapeOptionType ShapeOptionType(TShapeOption op)

Parameters

<-> | Parameter | Type | Description
 | op | TShapeOption | Shape option.

Returns

Type of the shape option.

See also

  • TShapeOptionList


TShapeOptionList.AsBool Method | FlexCel Studio for the .NET Framework documentation

TShapeOptionList.AsBool Method

Overloads

  • TShapeOptionList.AsBool(TShapeOption, Boolean)
  • TShapeOptionList.AsBool(TShapeOption, Boolean, Int32)

TShapeOptionList.AsBool(TShapeOption, Boolean)

Returns a bool property if it exists, otherwise the default value. This method overload automatically calculates the position in the boolean set so you don't need to specify it.

Syntax

Namespace: FlexCel.Core

public Boolean AsBool(TShapeOption key, Boolean Default)

Parameters

<-> | Parameter | Type | Description
 | key | TShapeOption | Property Name.
 | Default | Boolean | What to return if the property does not exist.

See also

  • TShapeOptionList

TShapeOptionList.AsBool(TShapeOption, Boolean, Int32)

Returns a bool property if it exists, otherwise the default value.

Syntax

Namespace: FlexCel.Core

public Boolean AsBool(TShapeOption key, Boolean Default, Int32 PositionInSet)

Parameters

<-> | Parameter | Type | Description
 | key | TShapeOption | Property Name.
 | Default | Boolean | What to return if the property does not exist.
 | PositionInSet | Int32 | Boolean properties are grouped so all properties on one set are in only one value. So, the last bool property on the set is the first bit, and so on. ONLY THE LAST PROPERTY ON THE SET IS PRESENT.

See also

  • TShapeOptionList


TShapeOptionList.CalcBoolKey Method | FlexCel Studio for the .NET Framework documentation

TShapeOptionList.CalcBoolKey Method

Returns the position of a boolean in a set. This is an advanced method and should normally not be used.

Syntax

Namespace: FlexCel.Core

public static TShapeOption CalcBoolKey(TShapeOption key, out Int32 PositionInSet)

Parameters

<-> | Parameter | Type | Description
 | key | TShapeOption | Boolean key
out | PositionInSet | Int32 | Position in the boolean set.

See also

  • TShapeOptionList


TShapeOptionList.AsUnicodeString Method | FlexCel Studio for the .NET Framework documentation

TShapeOptionList.AsUnicodeString Method

Returns an unicode property if it exists, otherwise the default value.

Syntax

Namespace: FlexCel.Core

public String AsUnicodeString(TShapeOption key, String Default)

Parameters

<-> | Parameter | Type | Description
 | key | TShapeOption | Property Name.
 | Default | String | What to return if the property does not exist.

See also

  • TShapeOptionList


TShapeOptionList.GetGradientStopAlpha Method | FlexCel Studio for the .NET Framework documentation

TShapeOptionList.GetGradientStopAlpha Method

Returns a list of individual alpha values for the stops of a gradient. This is not available in xls files, only xlsx. The alpha values determine the opacity of each stop, with 0 being completely transparent and 255 being completely opaque. This value might be null if there is no gradient in the pattern, or if the individual stops don't have a defined alpha.

Syntax

Namespace: FlexCel.Core

public Byte[] GetGradientStopAlpha()

See also

  • TShapeOptionList


TShapeOptionList.AsHyperLink Method | FlexCel Studio for the .NET Framework documentation

TShapeOptionList.AsHyperLink Method

Overloads

  • TShapeOptionList.AsHyperLink(TShapeOption, TDrawingHyperlink)
  • TShapeOptionList.AsHyperLink(ExcelFile, TShapeOption, TDrawingHyperlink)

TShapeOptionList.AsHyperLink(TShapeOption, TDrawingHyperlink)

Returns an hyperlink property if it exists, otherwise the default value. You will normally want to use this property with TShapeOption.pihlShape since that is the property that holds the link for the objects. Note that this overload won't return a LinkBase, you need to call the overload taking an ExcelFile for that.

Syntax

Namespace: FlexCel.Core

public TDrawingHyperlink AsHyperLink(TShapeOption key, TDrawingHyperlink Default)

Parameters

<-> | Parameter | Type | Description
 | key | TShapeOption | Property Name.
 | Default | TDrawingHyperlink | What to return if the property does not exist.

See also

  • TShapeOptionList

TShapeOptionList.AsHyperLink(ExcelFile, TShapeOption, TDrawingHyperlink)

Returns an hyperlink property if it exists, otherwise the default value. You will normally want to use this property with TShapeOption.pihlShape since that is the property that holds the link for the objects.

Syntax

Namespace: FlexCel.Core

public TDrawingHyperlink AsHyperLink(ExcelFile xls, TShapeOption key, TDrawingHyperlink Default)

Parameters

<-> | Parameter | Type | Description
 | xls | ExcelFile | Excel file containing the hyperlink. Might be null. If not null, it is used to search for a hyperlink base.
 | key | TShapeOption | Property Name.
 | Default | TDrawingHyperlink | What to return if the property does not exist.

See also

  • TShapeOptionList


TShapeOptionList.AsByteArray Method | FlexCel Studio for the .NET Framework documentation

TShapeOptionList.AsByteArray Method

Returns a byte array property if it exists, otherwise null.

Syntax

Namespace: FlexCel.Core

public Byte[] AsByteArray(TShapeOption key)

Parameters

<-> | Parameter | Type | Description
 | key | TShapeOption | Property Name.

See also

  • TShapeOptionList


TShapeOptionList.AsImage Method | FlexCel Studio for the .NET Framework documentation

TShapeOptionList.AsImage Method

Returns a byte array with the image if it exists, otherwise null. Note that for SVG images, xlsx files store both a PNG and SVG image. In those cases, for backward compatibility reasons, this method will return the PNG image. To get the SVG, call AsImageAlternate

Syntax

Namespace: FlexCel.Core

public Byte[] AsImage(ExcelFile xls, String objectPath, TShapeOption key)

Parameters

<-> | Parameter | Type | Description
 | xls | ExcelFile | File with the images.
 | objectPath | String | Object path to the image.
 | key | TShapeOption | Property Name.

See also

  • TShapeOptionList


TShapeOptionList.AsImageAlternate Method | FlexCel Studio for the .NET Framework documentation

TShapeOptionList.AsImageAlternate Method

Returns a byte array with the image if it exists, otherwise null. Note that for SVG images, xlsx files store both a PNG and SVG image. In those cases, this method will return the SVG image. To get the PNG, call AsImage

Syntax

Namespace: FlexCel.Core

public Byte[] AsImageAlternate(ExcelFile xls, String objectPath, TShapeOption key)

Parameters

<-> | Parameter | Type | Description
 | xls | ExcelFile | File with the images.
 | objectPath | String | Object path to the image.
 | key | TShapeOption | Property Name.

See also

  • TShapeOptionList


TShapeOptionList.SetValue Method | FlexCel Studio for the .NET Framework documentation

TShapeOptionList.SetValue Method

Overloads

  • TShapeOptionList.SetValue(TShapeOption, Double)
  • TShapeOptionList.SetValue(TShapeOption, Boolean)
  • TShapeOptionList.SetValue(TShapeOption, TDrawingHyperlink)
  • TShapeOptionList.SetValue(TShapeOption, String)

TShapeOptionList.SetValue(TShapeOption, Double)

Sets a property with a floating point or integer value.

Syntax

Namespace: FlexCel.Core

public void SetValue(TShapeOption option, Double value)

Parameters

<-> | Parameter | Type | Description
 | option | TShapeOption | Option to set.
 | value | Double | Value to set.

See also

  • TShapeOptionList

TShapeOptionList.SetValue(TShapeOption, Boolean)

Sets a property with a boolean value.

Syntax

Namespace: FlexCel.Core

public void SetValue(TShapeOption option, Boolean value)

Parameters

<-> | Parameter | Type | Description
 | option | TShapeOption | Option to set.
 | value | Boolean | Value to set.

See also

  • TShapeOptionList

TShapeOptionList.SetValue(TShapeOption, TDrawingHyperlink)

Sets a property with an hyperlink value.

Syntax

Namespace: FlexCel.Core

public void SetValue(TShapeOption option, TDrawingHyperlink value)

Parameters

<-> | Parameter | Type | Description
 | option | TShapeOption | Option to set.
 | value | TDrawingHyperlink | Value to set.

See also

  • TShapeOptionList

TShapeOptionList.SetValue(TShapeOption, String)

Sets a property with a string value.

Syntax

Namespace: FlexCel.Core

public void SetValue(TShapeOption option, String value)

Parameters

<-> | Parameter | Type | Description
 | option | TShapeOption | Option to set.
 | value | String | Value to set.

See also

  • TShapeOptionList


TShapeOptionList.SetImage Method | FlexCel Studio for the .NET Framework documentation

TShapeOptionList.SetImage Method

Sets a property with the bytes of an image.

Syntax

Namespace: FlexCel.Core

public void SetImage(TShapeOption option, Byte[] value)

Parameters

<-> | Parameter | Type | Description
 | option | TShapeOption | Option to set.
 | value | Byte[] | Value to set.

See also

  • TShapeOptionList


TShapeOptionList.SetBytes Method | FlexCel Studio for the .NET Framework documentation

TShapeOptionList.SetBytes Method

Sets a property with arbitrary bytes.

Syntax

Namespace: FlexCel.Core

public void SetBytes(TShapeOption option, Byte[] value)

Parameters

<-> | Parameter | Type | Description
 | option | TShapeOption | Option to set.
 | value | Byte[] | Value to set.

See also

  • TShapeOptionList


TShapeOptionList.Equals Method | FlexCel Studio for the .NET Framework documentation

TShapeOptionList.Equals Method

Returns true if 2 instances of this class have the same values.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TShapeOptionList


TShapeOptionList.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TShapeOptionList.GetHashCode Method

Hashcode for the object.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TShapeOptionList


TShapeOptionList.GetEnumerator Method | FlexCel Studio for the .NET Framework documentation

TShapeOptionList.GetEnumerator Method

Gets the enumerator for this class.

Syntax

Namespace: FlexCel.Core

public IEnumerator GetEnumerator()

See also

  • TShapeOptionList


TShapeOptionList.Clone Method | FlexCel Studio for the .NET Framework documentation

TShapeOptionList.Clone Method

Creates a deep copy of the object.

Syntax

Namespace: FlexCel.Core

public Object Clone()

See also

  • TShapeOptionList


TShapeOptionList.Keys Property | FlexCel Studio for the .NET Framework documentation

TShapeOptionList.Keys Property

A list of the shape options in the list.

Syntax

Namespace: FlexCel.Core

public IEnumerable<TShapeOption> Keys { get; }

See also

  • TShapeOptionList


TShapeProperties Class | FlexCel Studio for the .NET Framework documentation

TShapeProperties Class

A class describing an Excel graphics object.

Syntax

Namespace: FlexCel.Core

public class TShapeProperties

Constructors

Name | Description
TShapeProperties | Creates a new instance.

Methods

Name | Description
TextAsRichString | Converts the TDrawingRichString to a TRichString
Children | Returns one of the shapes inside of this one.
AddChild | Adds a new child for this autoshape.
Clone | Returns a deep copy of the object.
GetAlternateText | Returns the Alternate Text for a shape. This is used for example in the "Alt" attribute when exporting to html. Note that if there is no alternate text for the image (​TShape​Option.​wzDescription)​, this method will return the image name. The idea is to return something that can describe the image for users who can't see them.
GetConnectorType | Returns the type of connector shape for a connector, if any.
HasShadow | Returns true if the shape has a shadow.

Properties

Name | Description
ShapeType | Type of shape. Note that this is not the same as ObjectType A comment might have a ShapeType=​TShape​Type.​Rectangle, but its object type is TObjectType.​Comment.​ A rectangle Autoshape will also have ShapeType=​TShape​Type.​Rectangle, but its ObjectType will be TObjectType.​Rectangle.​
ObjectType | Type of object. Note that this is not the same as ShapeType. A comment might have a ShapeType = TShapeType.​Rectangle, but its object type is TObjectType.​Comment.​ A rectangle Autoshape will also have ShapeType=​TShape​Type.​Rectangle, but its ObjectType will be TObjectType.​Rectangle.​
ShapeName | Name of the shape if it is named, null otherwise.
ShapeId | This is an internal identified for the shape. It will remain the same once the file is loaded, but it might change when you load the same file at different times.
ObjectPath | Use this string to identify the shape when it is not the first on the hierarchy. For Example, imagine you have a Group Shape A with 2 children, B and C. If you want to change the text on shape C, you need to call SetObjectText(​n,​Object​Path)​; The object path can be of 2 types: Absolute or relative. Absolute object paths start with "\\" and include the parent object. Relative paths don't include the main group shape. For example the absolute path "\\1\\2\\3" is the same as accessing the object 1, with object path "2\\3"...[more]
ObjectPathAbsolute | Use this string to identify the shape when it is not the first on the hierarchy. For Example, imagine you have a Group Shape A with 2 children, B and C. If you want to change the text on shape C, you need to call SetObjectText(n, ObjectPath); The object path can be of 2 types: Absolute or relative. Absolute object paths start with "\\" and include the parent object. Relative paths don't include the main group shape. For example the absolute path "\\1\\2\\3" is the same as accessing the object 1, with object path "2\\3"...[more]
ObjectPathShapeId | Returns the object path as a shape id. This is used mostly internally.
Text | Text of the shape if is has some, null otherwise.
TextFlags | Option flags for the Text shape. Important:Instead of changing this flag, you should use instead LockText, TextHorizontal​Alignment and TextVertical​Alignment. Changing those properties will automatically change the text flags, but in a simpler way. The option flags work differently in xls and xlsx files. All properties in FlexCel assume the xls way, and convert to the corresponding properties in xlsx when saving or loading xlsx files. For more information, check...[more]
TextHorizontal​Alignment | This property gets or sets the horizontal alignment for the text. Note that xls and xlsx files behave differently when text is rotated with TextRotated. In xlsx, if you rotate the text 90 degrees clockwise, a text aligned to the top and left will be aligned to the top and right of the shape. While in xls, the rotation is absolute and always means aligned to the top left of the shape. This method uses the xls way, even when dealing with xlsx files. For more information see...[more]
TextVertical​Alignment | This property gets or sets the vertical alignment for the text. Note that xls and xlsx files behave differently when text is rotated with TextRotated. In xlsx, if you rotate the text 90 degrees clockwise, a text aligned to the top and left will be aligned to the top and right of the shape. While in xls, the rotation is absolute and always means aligned to the top left of the shape. This method uses the xls way, even when dealing with xlsx files. For more information see...[more]
LockText | True if the Lock Text option is on (Format Text Box dialog box, Protection tab). When changing this property, the value of TextFlags, will change too.
TextRotation | Text rotation: 0 means horizontal, 1 means vertical text, 2 means rotated -90 degrees clockwise, 3 means rotated 90 degrees clockwise. This method uses the xls way to set text rotation. For more information, see Text Rotation In Xls And Xlsx
TextRotated | This methods gets or sets TextRotation in a simpler way. As with all FlexCel methods, it uses the xls, not the xlsx way to apply the rotation. For more information, see Text Rotation In Xls And Xlsx.
RotateTextWithShape | If true, the text will be rotated with the shape. Note that this option is only available in Excel 2007 or newer. Older Excels will never rotate the text with the shape.
TextVerticalOverflow | Gets or sets how the text overflows the shape vertically. Note that the checkbox in Excel "Allow text to overflow shape" sets both this property and TextHorizontal​Overflow
TextHorizontal​Overflow | Gets or sets how the text overflows the shape horizontally. Note that the checkbox in Excel "Allow text to overflow shape" sets both this property and TextVerticalOverflow
ShapeOptions | A lot of personalized settings, like shadow type fill color, line type, etc.
Anchor | Coordinates of the shape. Note that when the shape is a group, this value is null and the real anchor is returned in the first child of the shape. To get the real Anchor of a first level object, use NestedAnchor
ShapeGeometry | Geometry of the shape as XML, if it is an xlsx shape. Shapes in xls will have this value empty. You can find the XML string by creating the shape in Excel and opening the file with APIMate.
ShapeFill | Fill of the shape, for xlsx shapes (even those which are saved in xls files). This property has a more complete description of the fill style than the one you can get by querying ShapeOptions, but will be null for xls files saved by Excel 2003 or earlier.
ShapeLine | Line of the shape, for xlsx shapes (even those which are saved in xls files). This property has a more complete description of the line style than the one you can get by querying ShapeOptions, but will be null for xls files saved by Excel 2003 or earlier.
ShapeEffects | Effects for the shape, for xlsx shapes (even those which are saved in xls files). The effects include glow, shadow, etc.
ShapeThemeEffects | Returns the theme effects applied to the shape.
ShapeThemeFont | Theme Font used for the text in the shape. This property only affects xlsx files, in xls files the font is always arial black. You can change the font only inside the rich string, not in a global way. In xls files this will be null.
NestedOptions | When the shape is a group, the real properties of the shape are in its first children. This method returns the correct shape options.
NestedAnchor | Real Coordinates of the shape. Note that when the shape is a group, the value in Anchor is null and the real anchor is returned in the first child of the shape. This method will get the real Anchor of a first level object.
FlipH | True if the shape is flipped horizontally.
FlipV | True if the shape is flipped vertically.
IsConnector | True if the shape is a connector.
StartShapeConnection | This property only applies to connector shapes. It identifies the first shape where the connector is attached to.
EndShapeConnection | This property only applies to connector shapes. It identifies the second shape where the connector is attached to.
Print | True if the shape should be printed.
IsLocked | True if the shape should is locked.
Visible | True if the shape is visible.
IsActiveX | Returns true if the object is an ActiveX object.
IsOleObject | Returns true if the object is an embedded ole object.
IsInternal | Returns true if the object is an internal object, like a comment or the arrow of an autofilter. Internal objects shouldn't be modified.
ChildrenCount | Number of shapes that are inside this shape.


TShapeProperties.TShapeProperties Constructor | FlexCel Studio for the .NET Framework documentation

TShapeProperties.TShapeProperties Constructor

Creates a new instance.

Syntax

Namespace: FlexCel.Core

public TShapeProperties()

See also

  • TShapeProperties


TShapeProperties.TextAsRichString Method | FlexCel Studio for the .NET Framework documentation

TShapeProperties.TextAsRichString Method

Converts the TDrawingRichString to a TRichString

Syntax

Namespace: FlexCel.Core

public TRichString TextAsRichString(ExcelFile xls)

Parameters

<-> | Parameter | Type | Description
 | xls | ExcelFile | ExcelFile with the string. It is used to calculate indexed colors.

See also

  • TShapeProperties


TShapeProperties.Children Method | FlexCel Studio for the .NET Framework documentation

TShapeProperties.Children Method

Returns one of the shapes inside of this one.

Syntax

Namespace: FlexCel.Core

public TShapeProperties Children(Int32 index)

Parameters

<-> | Parameter | Type | Description
 | index | Int32 | Index of the shape (1-based)

Returns

A child shape.

See also

  • TShapeProperties


TShapeProperties.AddChild Method | FlexCel Studio for the .NET Framework documentation

TShapeProperties.AddChild Method

Adds a new child for this autoshape.

Syntax

Namespace: FlexCel.Core

public void AddChild(TShapeProperties sp)

Parameters

<-> | Parameter | Type | Description
 | sp | TShapeProperties | Shape to be added.

See also

  • TShapeProperties


TShapeProperties.Clone Method | FlexCel Studio for the .NET Framework documentation

TShapeProperties.Clone Method

Returns a deep copy of the object.

Syntax

Namespace: FlexCel.Core

public TShapeProperties Clone()

See also

  • TShapeProperties


TShapeProperties.GetAlternateText Method | FlexCel Studio for the .NET Framework documentation

TShapeProperties.GetAlternateText Method

Returns the Alternate Text for a shape. This is used for example in the "Alt" attribute when exporting to html. Note that if there is no alternate text for the image (TShapeOption.wzDescription), this method will return the image name. The idea is to return something that can describe the image for users who can't see them.

Syntax

Namespace: FlexCel.Core

public String GetAlternateText()

See also

  • TShapeProperties


TShapeProperties.GetConnectorType Method | FlexCel Studio for the .NET Framework documentation

TShapeProperties.GetConnectorType Method

Returns the type of connector shape for a connector, if any.

Syntax

Namespace: FlexCel.Core

public static TEscherConnectorType GetConnectorType(TShapeType shapeType)

Parameters

<-> | Parameter | Type | Description
 | shapeType | TShapeType |

See also

  • TShapeProperties


TShapeProperties.HasShadow Method | FlexCel Studio for the .NET Framework documentation

TShapeProperties.HasShadow Method

Returns true if the shape has a shadow.

Syntax

Namespace: FlexCel.Core

public Boolean HasShadow()

See also

  • TShapeProperties


TShapeProperties.ShapeType Property | FlexCel Studio for the .NET Framework documentation

TShapeProperties.ShapeType Property

Type of shape. Note that this is not the same as ObjectType A comment might have a ShapeType=TShapeType.Rectangle, but its object type is TObjectType.Comment. A rectangle Autoshape will also have ShapeType=TShapeType.Rectangle, but its ObjectType will be TObjectType.Rectangle.

Syntax

Namespace: FlexCel.Core

public TShapeType ShapeType { get; set; }

See also

  • TShapeProperties


TShapeProperties.ObjectType Property | FlexCel Studio for the .NET Framework documentation

TShapeProperties.ObjectType Property

Type of object. Note that this is not the same as ShapeType. A comment might have a ShapeType = TShapeType.Rectangle, but its object type is TObjectType.Comment. A rectangle Autoshape will also have ShapeType=TShapeType.Rectangle, but its ObjectType will be TObjectType.Rectangle.

Syntax

Namespace: FlexCel.Core

public TObjectType ObjectType { get; set; }

See also

  • TShapeProperties


TShapeProperties.ShapeName Property | FlexCel Studio for the .NET Framework documentation

TShapeProperties.ShapeName Property

Name of the shape if it is named, null otherwise.

Syntax

Namespace: FlexCel.Core

public String ShapeName { get; set; }

See also

  • TShapeProperties


TShapeProperties.ShapeId Property | FlexCel Studio for the .NET Framework documentation

TShapeProperties.ShapeId Property

This is an internal identified for the shape. It will remain the same once the file is loaded, but it might change when you load the same file at different times.

Syntax

Namespace: FlexCel.Core

public Int64 ShapeId { get; set; }

See also

  • TShapeProperties


TShapeProperties.ObjectPath Property | FlexCel Studio for the .NET Framework documentation

TShapeProperties.ObjectPath Property

Use this string to identify the shape when it is not the first on the hierarchy. For Example, imagine you have a Group Shape A with 2 children, B and C. If you want to change the text on shape C, you need to call SetObjectText(n,ObjectPath); The object path can be of 2 types: Absolute or relative. Absolute object paths start with "\\" and include the parent object. Relative paths don't include the main group shape.

For example the absolute path "\\1\\2\\3" is the same as accessing the object 1, with object path "2\\3" **** This property returns the relative path, you can get the absolute path with ObjectPathAbsolute.

Syntax

Namespace: FlexCel.Core

public String ObjectPath { get; }

See also

  • TShapeProperties


TShapeProperties.ObjectPathAbsolute Property | FlexCel Studio for the .NET Framework documentation

TShapeProperties.ObjectPathAbsolute Property

Use this string to identify the shape when it is not the first on the hierarchy. For Example, imagine you have a Group Shape A with 2 children, B and C. If you want to change the text on shape C, you need to call SetObjectText(n, ObjectPath); The object path can be of 2 types: Absolute or relative. Absolute object paths start with "\\" and include the parent object. Relative paths don't include the main group shape.

For example the absolute path "\\1\\2\\3" is the same as accessing the object 1, with object path "2\\3" **** This property returns the absolute path, you can get the relative path with ObjectPath.

Syntax

Namespace: FlexCel.Core

public String ObjectPathAbsolute { get; set; }

See also

  • TShapeProperties


TShapeProperties.ObjectPathShapeId Property | FlexCel Studio for the .NET Framework documentation

TShapeProperties.ObjectPathShapeId Property

Returns the object path as a shape id. This is used mostly internally.

Syntax

Namespace: FlexCel.Core

public String ObjectPathShapeId { get; }

See also

  • TShapeProperties


TShapeProperties.Text Property | FlexCel Studio for the .NET Framework documentation

TShapeProperties.Text Property

Text of the shape if is has some, null otherwise.

Syntax

Namespace: FlexCel.Core

public TDrawingRichString Text { get; set; }

See also

  • TShapeProperties


TShapeProperties.TextFlags Property | FlexCel Studio for the .NET Framework documentation

TShapeProperties.TextFlags Property

Option flags for the Text shape.

Important:Instead of changing this flag, you should use instead LockText, TextHorizontalAlignment and TextVerticalAlignment. Changing those properties will automatically change the text flags, but in a simpler way.

The option flags work differently in xls and xlsx files. All properties in FlexCel assume the xls way, and convert to the corresponding properties in xlsx when saving or loading xlsx files. For more information, check Text Rotation In Xls And Xlsx Mask: 0x000E Horizontal text alignment: 1 = left-aligned 2 = centered 3 = right-aligned 4 = justified Mask: 0x0070 Vertical text alignment: 1 = top 2 = center 3 = bottom 4 = justify Mask: 0x0200 1 if the Lock Text option is on (Format Text Box dialog box, Protection tab)

Syntax

Namespace: FlexCel.Core

public Int32 TextFlags { get; set; }

See also

  • TShapeProperties
  • TextHorizontalAlignment
  • TextVerticalAlignment
  • LockText
  • TextRotation
  • TextRotated
  • Text Rotation In Xls And Xlsx


TShapeProperties.TextHorizontalAlignment Property | FlexCel Studio for the .NET Framework documentation

TShapeProperties.TextHorizontalAlignment Property

This property gets or sets the horizontal alignment for the text.

Note that xls and xlsx files behave differently when text is rotated with TextRotated. In xlsx, if you rotate the text 90 degrees clockwise, a text aligned to the top and left will be aligned to the top and right of the shape. While in xls, the rotation is absolute and always means aligned to the top left of the shape.

This method uses the xls way, even when dealing with xlsx files. For more information see Text Rotation In Xls And Xlsx

Syntax

Namespace: FlexCel.Core

public THFlxAlignment TextHorizontalAlignment { get; set; }

See also

  • TShapeProperties
  • TextVerticalAlignment
  • TextRotated
  • Text Rotation In Xls And Xlsx


TShapeProperties.TextVerticalAlignment Property | FlexCel Studio for the .NET Framework documentation

TShapeProperties.TextVerticalAlignment Property

This property gets or sets the vertical alignment for the text.

Note that xls and xlsx files behave differently when text is rotated with TextRotated. In xlsx, if you rotate the text 90 degrees clockwise, a text aligned to the top and left will be aligned to the top and right of the shape. While in xls, the rotation is absolute and always means aligned to the top left of the shape.

This method uses the xls way, even when dealing with xlsx files. For more information see Text Rotation In Xls And Xlsx

Syntax

Namespace: FlexCel.Core

public TVFlxAlignment TextVerticalAlignment { get; set; }

See also

  • TShapeProperties
  • TextHorizontalAlignment
  • TextRotated
  • Text Rotation In Xls And Xlsx


TShapeProperties.LockText Property | FlexCel Studio for the .NET Framework documentation

TShapeProperties.LockText Property

True if the Lock Text option is on (Format Text Box dialog box, Protection tab). When changing this property, the value of TextFlags, will change too.

Syntax

Namespace: FlexCel.Core

public Boolean LockText { get; set; }

See also

  • TShapeProperties


TShapeProperties.TextRotation Property | FlexCel Studio for the .NET Framework documentation

TShapeProperties.TextRotation Property

Text rotation: 0 means horizontal, 1 means vertical text, 2 means rotated -90 degrees clockwise, 3 means rotated 90 degrees clockwise. This method uses the xls way to set text rotation.

For more information, see Text Rotation In Xls And Xlsx

Syntax

Namespace: FlexCel.Core

public Int32 TextRotation { get; set; }

See also

  • TShapeProperties
  • TextRotated


TShapeProperties.TextRotated Property | FlexCel Studio for the .NET Framework documentation

TShapeProperties.TextRotated Property

This methods gets or sets TextRotation in a simpler way. As with all FlexCel methods, it uses the xls, not the xlsx way to apply the rotation.

For more information, see Text Rotation In Xls And Xlsx.

Syntax

Namespace: FlexCel.Core

public TTextRotation TextRotated { get; set; }

See also

  • TShapeProperties


TShapeProperties.RotateTextWithShape Property | FlexCel Studio for the .NET Framework documentation

TShapeProperties.RotateTextWithShape Property

If true, the text will be rotated with the shape. Note that this option is only available in Excel 2007 or newer. Older Excels will never rotate the text with the shape.

Syntax

Namespace: FlexCel.Core

public Boolean RotateTextWithShape { get; set; }

See also

  • TShapeProperties


TShapeProperties.TextVerticalOverflow Property | FlexCel Studio for the .NET Framework documentation

TShapeProperties.TextVerticalOverflow Property

Gets or sets how the text overflows the shape vertically. Note that the checkbox in Excel "Allow text to overflow shape" sets both this property and TextHorizontalOverflow

Syntax

Namespace: FlexCel.Core

public TTextVertOverflow TextVerticalOverflow { get; set; }

See also

  • TShapeProperties


TShapeProperties.TextHorizontalOverflow Property | FlexCel Studio for the .NET Framework documentation

TShapeProperties.TextHorizontalOverflow Property

Gets or sets how the text overflows the shape horizontally. Note that the checkbox in Excel "Allow text to overflow shape" sets both this property and TextVerticalOverflow

Syntax

Namespace: FlexCel.Core

public TTextHorzOverflow TextHorizontalOverflow { get; set; }

See also

  • TShapeProperties


TShapeProperties.ShapeOptions Property | FlexCel Studio for the .NET Framework documentation

TShapeProperties.ShapeOptions Property

A lot of personalized settings, like shadow type fill color, line type, etc.

Syntax

Namespace: FlexCel.Core

public TShapeOptionList ShapeOptions { get; set; }

See also

  • TShapeProperties


TShapeProperties.Anchor Property | FlexCel Studio for the .NET Framework documentation

TShapeProperties.Anchor Property

Coordinates of the shape. Note that when the shape is a group, this value is null and the real anchor is returned in the first child of the shape. To get the real Anchor of a first level object, use NestedAnchor

Syntax

Namespace: FlexCel.Core

public TClientAnchor Anchor { get; set; }

See also

  • TShapeProperties


TShapeProperties.ShapeGeometry Property | FlexCel Studio for the .NET Framework documentation

TShapeProperties.ShapeGeometry Property

Geometry of the shape as XML, if it is an xlsx shape. Shapes in xls will have this value empty. You can find the XML string by creating the shape in Excel and opening the file with APIMate.

Syntax

Namespace: FlexCel.Core

public String ShapeGeometry { get; set; }

See also

  • TShapeProperties


TShapeProperties.ShapeFill Property | FlexCel Studio for the .NET Framework documentation

TShapeProperties.ShapeFill Property

Fill of the shape, for xlsx shapes (even those which are saved in xls files). This property has a more complete description of the fill style than the one you can get by querying ShapeOptions, but will be null for xls files saved by Excel 2003 or earlier.

Syntax

Namespace: FlexCel.Core

public TShapeFill ShapeFill { get; set; }

See also

  • TShapeProperties


TShapeProperties.ShapeLine Property | FlexCel Studio for the .NET Framework documentation

TShapeProperties.ShapeLine Property

Line of the shape, for xlsx shapes (even those which are saved in xls files). This property has a more complete description of the line style than the one you can get by querying ShapeOptions, but will be null for xls files saved by Excel 2003 or earlier.

Syntax

Namespace: FlexCel.Core

public TShapeLine ShapeLine { get; set; }

See also

  • TShapeProperties


TShapeProperties.ShapeEffects Property | FlexCel Studio for the .NET Framework documentation

TShapeProperties.ShapeEffects Property

Effects for the shape, for xlsx shapes (even those which are saved in xls files). The effects include glow, shadow, etc.

Syntax

Namespace: FlexCel.Core

public TEffectStyle ShapeEffects { get; }

See also

  • TShapeProperties


TShapeProperties.ShapeThemeEffects Property | FlexCel Studio for the .NET Framework documentation

TShapeProperties.ShapeThemeEffects Property

Returns the theme effects applied to the shape.

Syntax

Namespace: FlexCel.Core

public TShapeEffects ShapeThemeEffects { get; }

See also

  • TShapeProperties


TShapeProperties.ShapeThemeFont Property | FlexCel Studio for the .NET Framework documentation

TShapeProperties.ShapeThemeFont Property

Theme Font used for the text in the shape. This property only affects xlsx files, in xls files the font is always arial black. You can change the font only inside the rich string, not in a global way. In xls files this will be null.

Syntax

Namespace: FlexCel.Core

public TShapeFont ShapeThemeFont { get; set; }

See also

  • TShapeProperties


TShapeProperties.NestedOptions Property | FlexCel Studio for the .NET Framework documentation

TShapeProperties.NestedOptions Property

When the shape is a group, the real properties of the shape are in its first children. This method returns the correct shape options.

Syntax

Namespace: FlexCel.Core

public TShapeOptionList NestedOptions { get; }

See also

  • TShapeProperties


TShapeProperties.NestedAnchor Property | FlexCel Studio for the .NET Framework documentation

TShapeProperties.NestedAnchor Property

Real Coordinates of the shape. Note that when the shape is a group, the value in Anchor is null and the real anchor is returned in the first child of the shape. This method will get the real Anchor of a first level object.

Syntax

Namespace: FlexCel.Core

public TClientAnchor NestedAnchor { get; }

See also

  • TShapeProperties


TShapeProperties.FlipH Property | FlexCel Studio for the .NET Framework documentation

TShapeProperties.FlipH Property

True if the shape is flipped horizontally.

Syntax

Namespace: FlexCel.Core

public Boolean FlipH { get; set; }

See also

  • TShapeProperties


TShapeProperties.FlipV Property | FlexCel Studio for the .NET Framework documentation

TShapeProperties.FlipV Property

True if the shape is flipped vertically.

Syntax

Namespace: FlexCel.Core

public Boolean FlipV { get; set; }

See also

  • TShapeProperties


TShapeProperties.IsConnector Property | FlexCel Studio for the .NET Framework documentation

TShapeProperties.IsConnector Property

True if the shape is a connector.

Syntax

Namespace: FlexCel.Core

public Boolean IsConnector { get; set; }

See also

  • TShapeProperties


TShapeProperties.StartShapeConnection Property | FlexCel Studio for the .NET Framework documentation

TShapeProperties.StartShapeConnection Property

This property only applies to connector shapes. It identifies the first shape where the connector is attached to.

Syntax

Namespace: FlexCel.Core

public TShapeConnector StartShapeConnection { get; set; }

See also

  • TShapeProperties


TShapeProperties.EndShapeConnection Property | FlexCel Studio for the .NET Framework documentation

TShapeProperties.EndShapeConnection Property

This property only applies to connector shapes. It identifies the second shape where the connector is attached to.

Syntax

Namespace: FlexCel.Core

public TShapeConnector EndShapeConnection { get; set; }

See also

  • TShapeProperties


TShapeProperties.Print Property | FlexCel Studio for the .NET Framework documentation

TShapeProperties.Print Property

True if the shape should be printed.

Syntax

Namespace: FlexCel.Core

public Boolean Print { get; set; }

See also

  • TShapeProperties


TShapeProperties.IsLocked Property | FlexCel Studio for the .NET Framework documentation

TShapeProperties.IsLocked Property

True if the shape should is locked.

Syntax

Namespace: FlexCel.Core

public Boolean IsLocked { get; set; }

See also

  • TShapeProperties


TShapeProperties.Visible Property | FlexCel Studio for the .NET Framework documentation

TShapeProperties.Visible Property

True if the shape is visible.

Syntax

Namespace: FlexCel.Core

public Boolean Visible { get; set; }

See also

  • TShapeProperties


TShapeProperties.IsActiveX Property | FlexCel Studio for the .NET Framework documentation

TShapeProperties.IsActiveX Property

Returns true if the object is an ActiveX object.

Syntax

Namespace: FlexCel.Core

public Boolean IsActiveX { get; }

See also

  • TShapeProperties


TShapeProperties.IsOleObject Property | FlexCel Studio for the .NET Framework documentation

TShapeProperties.IsOleObject Property

Returns true if the object is an embedded ole object.

Syntax

Namespace: FlexCel.Core

public Boolean IsOleObject { get; }

See also

  • TShapeProperties


TShapeProperties.IsInternal Property | FlexCel Studio for the .NET Framework documentation

TShapeProperties.IsInternal Property

Returns true if the object is an internal object, like a comment or the arrow of an autofilter. Internal objects shouldn't be modified.

Syntax

Namespace: FlexCel.Core

public Boolean IsInternal { get; }

See also

  • TShapeProperties


TShapeProperties.ChildrenCount Property | FlexCel Studio for the .NET Framework documentation

TShapeProperties.ChildrenCount Property

Number of shapes that are inside this shape.

Syntax

Namespace: FlexCel.Core

public Int32 ChildrenCount { get; }

See also

  • TShapeProperties


TSharedWorkbookProtectionOptions Class | FlexCel Studio for the .NET Framework documentation

TSharedWorkbookProtectionOptions Class

Options for protecting the change list in a shared workbook. In Excel you can change this settings in Protection->Protect Shared Workbook.

Syntax

Namespace: FlexCel.Core

public sealed class TSharedWorkbookProtectionOptions

Constructors

Name | Description
TSharedWorkbook​Protection​Options | Overloaded TSharedWorkbookProtectionOptions TSharedWorkbookProtectionOptions(Boolean)

Properties

Name | Description
SharingWithTrack​Changes | True to protect the change history from being removed.


TSharedWorkbookProtectionOptions.TSharedWorkbookProtectionOptions Constructor | FlexCel Studio for the .NET Framework documentation

TSharedWorkbookProtectionOptions.TSharedWorkbookProtectionOptions Constructor

Overloads

  • TSharedWorkbookProtectionOptions.TSharedWorkbookProtectionOptions
  • TSharedWorkbookProtectionOptions.TSharedWorkbookProtectionOptions(Boolean)

TSharedWorkbookProtectionOptions.TSharedWorkbookProtectionOptions

Initializes empty protection.

Syntax

Namespace: FlexCel.Core

public TSharedWorkbookProtectionOptions()

See also

  • TSharedWorkbookProtectionOptions

TSharedWorkbookProtectionOptions.TSharedWorkbookProtectionOptions(Boolean)

Initializes the class.

Syntax

Namespace: FlexCel.Core

public TSharedWorkbookProtectionOptions(Boolean aSharingWithTrackChanges)

Parameters

<-> | Parameter | Type | Description
 | aSharingWithTrackChanges | Boolean | True to protect the change history from being removed.

See also

  • TSharedWorkbookProtectionOptions


TSharedWorkbookProtectionOptions.SharingWithTrackChanges Property | FlexCel Studio for the .NET Framework documentation

TSharedWorkbookProtectionOptions.SharingWithTrackChanges Property

True to protect the change history from being removed.

Syntax

Namespace: FlexCel.Core

public Boolean SharingWithTrackChanges { get; set; }

See also

  • TSharedWorkbookProtectionOptions


TSheetProtectionOptions Class | FlexCel Studio for the .NET Framework documentation

TSheetProtectionOptions Class

Options for protecting a sheet.

Syntax

Namespace: FlexCel.Core

public sealed class TSheetProtectionOptions

Constructors

Name | Description
TSheetProtection​Options | Overloaded TSheetProtectionOptions TSheetProtectionOptions(Boolean) TSheetProtectionOptions(TProtectionType)

Properties

Name | Description
Contents | Sheet contents are protected
Objects | If TRUE, objects on the sheet are protected. Note that this setting behaves like Scenarios and opposite from all the rest. In the other settings, FALSE means that the setting is protected, TRUE that the setting can be changed.
Scenarios | If TRUE, scenarios on the sheet are protected. Note that this setting behaves like Objects and opposite from all the rest. In the other settings, FALSE means that the setting is protected, TRUE that the setting can be changed.
CellFormatting | If TRUE, users are allowed to change this setting. Set it to FALSE to disable this property. Only on Excel >= XP.
ColumnFormatting | If TRUE, users are allowed to change this setting. Set it to FALSE to disable this property. Only on Excel >= XP.
RowFormatting | If TRUE, users are allowed to change this setting. Set it to FALSE to disable this property. Only on Excel >= XP.
InsertColumns | If TRUE, users are allowed to change this setting. Set it to FALSE to disable this property. Only on Excel >= XP.
InsertRows | If TRUE, users are allowed to change this setting. Set it to FALSE to disable this property. Only on Excel >= XP.
InsertHyperlinks | If TRUE, users are allowed to change this setting. Set it to FALSE to disable this property. Only on Excel >= XP.
DeleteColumns | If TRUE, users are allowed to change this setting. Set it to FALSE to disable this property. Only on Excel >= XP.
DeleteRows | If TRUE, users are allowed to change this setting. Set it to FALSE to disable this property. Only on Excel >= XP.
SelectLockedCells | If TRUE, users are allowed to change this setting. Set it to FALSE to disable this property. Only on Excel >= XP.
SortCellRange | If TRUE, users are allowed to change this setting. Set it to FALSE to disable this property. Only on Excel >= XP.
EditAutoFilters | If TRUE, users are allowed to change this setting. Set it to FALSE to disable this property. Only on Excel >= XP.
EditPivotTables | If TRUE, users are allowed to change this setting. Set it to FALSE to disable this property. Only on Excel >= XP.
SelectUnlockedCells | If TRUE, users are allowed to change this setting. Set it to FALSE to disable this property. Only on Excel >= XP.


TSheetProtectionOptions.TSheetProtectionOptions Constructor | FlexCel Studio for the .NET Framework documentation

TSheetProtectionOptions.TSheetProtectionOptions Constructor

Overloads

  • TSheetProtectionOptions.TSheetProtectionOptions
  • TSheetProtectionOptions.TSheetProtectionOptions(Boolean)
  • TSheetProtectionOptions.TSheetProtectionOptions(TProtectionType)

TSheetProtectionOptions.TSheetProtectionOptions

Initializes a not protected block.

Syntax

Namespace: FlexCel.Core

public TSheetProtectionOptions()

See also

  • TSheetProtectionOptions

TSheetProtectionOptions.TSheetProtectionOptions(Boolean)

Creates a protected or unprotected sheet.

Syntax

Namespace: FlexCel.Core

public TSheetProtectionOptions(Boolean allTrue)

Parameters

<-> | Parameter | Type | Description
 | allTrue | Boolean | If true, all properties on this class will be set to true. This means cells on the sheet will be protected, and things like Cell formatting will be not. If false, all properties will be set to false.

See also

  • TSheetProtectionOptions

TSheetProtectionOptions.TSheetProtectionOptions(TProtectionType)

Creates a protected or unprotected sheet.

Syntax

Namespace: FlexCel.Core

public TSheetProtectionOptions(TProtectionType protectAll)

Parameters

<-> | Parameter | Type | Description
 | protectAll | TProtectionType | If true, all things in the sheet will be protected. this means a property like Contents will be true, and others like CellFormatting will be false. If false, nothing will.

See also

  • TSheetProtectionOptions


TSheetProtectionOptions.Contents Property | FlexCel Studio for the .NET Framework documentation

TSheetProtectionOptions.Contents Property

Sheet contents are protected

Syntax

Namespace: FlexCel.Core

public Boolean Contents { get; set; }

See also

  • TSheetProtectionOptions


TSheetProtectionOptions.Objects Property | FlexCel Studio for the .NET Framework documentation

TSheetProtectionOptions.Objects Property

If TRUE, objects on the sheet are protected. Note that this setting behaves like Scenarios and opposite from all the rest. In the other settings, FALSE means that the setting is protected, TRUE that the setting can be changed.

Syntax

Namespace: FlexCel.Core

public Boolean Objects { get; set; }

See also

  • TSheetProtectionOptions


TSheetProtectionOptions.Scenarios Property | FlexCel Studio for the .NET Framework documentation

TSheetProtectionOptions.Scenarios Property

If TRUE, scenarios on the sheet are protected. Note that this setting behaves like Objects and opposite from all the rest. In the other settings, FALSE means that the setting is protected, TRUE that the setting can be changed.

Syntax

Namespace: FlexCel.Core

public Boolean Scenarios { get; set; }

See also

  • TSheetProtectionOptions


TSheetProtectionOptions.CellFormatting Property | FlexCel Studio for the .NET Framework documentation

TSheetProtectionOptions.CellFormatting Property

If TRUE, users are allowed to change this setting. Set it to FALSE to disable this property. Only on Excel >= XP.

Syntax

Namespace: FlexCel.Core

public Boolean CellFormatting { get; set; }

See also

  • TSheetProtectionOptions


TSheetProtectionOptions.ColumnFormatting Property | FlexCel Studio for the .NET Framework documentation

TSheetProtectionOptions.ColumnFormatting Property

If TRUE, users are allowed to change this setting. Set it to FALSE to disable this property. Only on Excel >= XP.

Syntax

Namespace: FlexCel.Core

public Boolean ColumnFormatting { get; set; }

See also

  • TSheetProtectionOptions


TSheetProtectionOptions.RowFormatting Property | FlexCel Studio for the .NET Framework documentation

TSheetProtectionOptions.RowFormatting Property

If TRUE, users are allowed to change this setting. Set it to FALSE to disable this property. Only on Excel >= XP.

Syntax

Namespace: FlexCel.Core

public Boolean RowFormatting { get; set; }

See also

  • TSheetProtectionOptions


TSheetProtectionOptions.InsertColumns Property | FlexCel Studio for the .NET Framework documentation

TSheetProtectionOptions.InsertColumns Property

If TRUE, users are allowed to change this setting. Set it to FALSE to disable this property. Only on Excel >= XP.

Syntax

Namespace: FlexCel.Core

public Boolean InsertColumns { get; set; }

See also

  • TSheetProtectionOptions


TSheetProtectionOptions.InsertRows Property | FlexCel Studio for the .NET Framework documentation

TSheetProtectionOptions.InsertRows Property

If TRUE, users are allowed to change this setting. Set it to FALSE to disable this property. Only on Excel >= XP.

Syntax

Namespace: FlexCel.Core

public Boolean InsertRows { get; set; }

See also

  • TSheetProtectionOptions


TSheetProtectionOptions.InsertHyperlinks Property | FlexCel Studio for the .NET Framework documentation

TSheetProtectionOptions.InsertHyperlinks Property

If TRUE, users are allowed to change this setting. Set it to FALSE to disable this property. Only on Excel >= XP.

Syntax

Namespace: FlexCel.Core

public Boolean InsertHyperlinks { get; set; }

See also

  • TSheetProtectionOptions


TSheetProtectionOptions.DeleteColumns Property | FlexCel Studio for the .NET Framework documentation

TSheetProtectionOptions.DeleteColumns Property

If TRUE, users are allowed to change this setting. Set it to FALSE to disable this property. Only on Excel >= XP.

Syntax

Namespace: FlexCel.Core

public Boolean DeleteColumns { get; set; }

See also

  • TSheetProtectionOptions


TSheetProtectionOptions.DeleteRows Property | FlexCel Studio for the .NET Framework documentation

TSheetProtectionOptions.DeleteRows Property

If TRUE, users are allowed to change this setting. Set it to FALSE to disable this property. Only on Excel >= XP.

Syntax

Namespace: FlexCel.Core

public Boolean DeleteRows { get; set; }

See also

  • TSheetProtectionOptions


TSheetProtectionOptions.SelectLockedCells Property | FlexCel Studio for the .NET Framework documentation

TSheetProtectionOptions.SelectLockedCells Property

If TRUE, users are allowed to change this setting. Set it to FALSE to disable this property. Only on Excel >= XP.

Syntax

Namespace: FlexCel.Core

public Boolean SelectLockedCells { get; set; }

See also

  • TSheetProtectionOptions


TSheetProtectionOptions.SortCellRange Property | FlexCel Studio for the .NET Framework documentation

TSheetProtectionOptions.SortCellRange Property

If TRUE, users are allowed to change this setting. Set it to FALSE to disable this property. Only on Excel >= XP.

Syntax

Namespace: FlexCel.Core

public Boolean SortCellRange { get; set; }

See also

  • TSheetProtectionOptions


TSheetProtectionOptions.EditAutoFilters Property | FlexCel Studio for the .NET Framework documentation

TSheetProtectionOptions.EditAutoFilters Property

If TRUE, users are allowed to change this setting. Set it to FALSE to disable this property. Only on Excel >= XP.

Syntax

Namespace: FlexCel.Core

public Boolean EditAutoFilters { get; set; }

See also

  • TSheetProtectionOptions


TSheetProtectionOptions.EditPivotTables Property | FlexCel Studio for the .NET Framework documentation

TSheetProtectionOptions.EditPivotTables Property

If TRUE, users are allowed to change this setting. Set it to FALSE to disable this property. Only on Excel >= XP.

Syntax

Namespace: FlexCel.Core

public Boolean EditPivotTables { get; set; }

See also

  • TSheetProtectionOptions


TSheetProtectionOptions.SelectUnlockedCells Property | FlexCel Studio for the .NET Framework documentation

TSheetProtectionOptions.SelectUnlockedCells Property

If TRUE, users are allowed to change this setting. Set it to FALSE to disable this property. Only on Excel >= XP.

Syntax

Namespace: FlexCel.Core

public Boolean SelectUnlockedCells { get; set; }

See also

  • TSheetProtectionOptions


TSheetView Class | FlexCel Studio for the .NET Framework documentation

TSheetView Class

This class has the different "Page View" modes that you can choose in Excel, ad properties of each mode.

Syntax

Namespace: FlexCel.Core

public class TSheetView

Constructors

Name | Description
TSheetView | Creates a new TSheetView with the specified values.

Methods

Name | Description
Equals | Returns true if both object are the same.
GetHashCode | Returns the hashcode of the instance.

Properties

Name | Description
ViewType | Active view mode.
ShowWhitespace | If true, when in Page Layout mode Excel will show whitespace between sheets.
ShowRulers | If true, Excel will show rulers when in Page Layout mode.
ZoomNormal | Zoom for when we are in normal mode. It must be 0, or a value between 10 and 400. Zero means to use the default zoom.
ZoomPageLayout | Zoom for when we are in Page Layout mode. It must be 0, or a value between 10 and 400. Zero means to use the default zoom.
ZoomPageBreakPreview | Zoom for when we are in Page Break Preview mode. It must be 0, or a value between 10 and 400. Zero means to use the default zoom which is 60% for Excel 2013.


TSheetView.TSheetView Constructor | FlexCel Studio for the .NET Framework documentation

TSheetView.TSheetView Constructor

Creates a new TSheetView with the specified values.

Syntax

Namespace: FlexCel.Core

public TSheetView(TSheetViewType aViewType, Boolean aShowWhitespace, Boolean aShowRulers, Int32 aZoomNormal, Int32 aZoomPageLayout, Int32 aZoomPageBreakPreview)

Parameters

<-> | Parameter | Type | Description
 | aViewType | TSheetViewType | See ViewType.
 | aShowWhitespace | Boolean | See ShowWhitespace.
 | aShowRulers | Boolean | See ShowRulers.
 | aZoomNormal | Int32 | See ZoomNormal.
 | aZoomPageLayout | Int32 | See ZoomPageLayout.
 | aZoomPageBreakPreview | Int32 | See ZoomPageBreakPreview.

See also

  • TSheetView


TSheetView.Equals Method | FlexCel Studio for the .NET Framework documentation

TSheetView.Equals Method

Returns true if both object are the same.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TSheetView


TSheetView.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TSheetView.GetHashCode Method

Returns the hashcode of the instance.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TSheetView


TSheetView.ViewType Property | FlexCel Studio for the .NET Framework documentation

TSheetView.ViewType Property

Active view mode.

Syntax

Namespace: FlexCel.Core

public TSheetViewType ViewType { get; set; }

See also

  • TSheetView


TSheetView.ShowWhitespace Property | FlexCel Studio for the .NET Framework documentation

TSheetView.ShowWhitespace Property

If true, when in Page Layout mode Excel will show whitespace between sheets.

Syntax

Namespace: FlexCel.Core

public Boolean ShowWhitespace { get; set; }

See also

  • TSheetView


TSheetView.ShowRulers Property | FlexCel Studio for the .NET Framework documentation

TSheetView.ShowRulers Property

If true, Excel will show rulers when in Page Layout mode.

Syntax

Namespace: FlexCel.Core

public Boolean ShowRulers { get; set; }

See also

  • TSheetView


TSheetView.ZoomNormal Property | FlexCel Studio for the .NET Framework documentation

TSheetView.ZoomNormal Property

Zoom for when we are in normal mode. It must be 0, or a value between 10 and 400. Zero means to use the default zoom.

Syntax

Namespace: FlexCel.Core

public Int32 ZoomNormal { get; set; }

See also

  • TSheetView


TSheetView.ZoomPageLayout Property | FlexCel Studio for the .NET Framework documentation

TSheetView.ZoomPageLayout Property

Zoom for when we are in Page Layout mode. It must be 0, or a value between 10 and 400. Zero means to use the default zoom.

Syntax

Namespace: FlexCel.Core

public Int32 ZoomPageLayout { get; set; }

See also

  • TSheetView


TSheetView.ZoomPageBreakPreview Property | FlexCel Studio for the .NET Framework documentation

TSheetView.ZoomPageBreakPreview Property

Zoom for when we are in Page Break Preview mode. It must be 0, or a value between 10 and 400. Zero means to use the default zoom which is 60% for Excel 2013.

Syntax

Namespace: FlexCel.Core

public Int32 ZoomPageBreakPreview { get; set; }

See also

  • TSheetView


TSoftEdgesEffect Class | FlexCel Studio for the .NET Framework documentation

TSoftEdgesEffect Class

Applies a soft edges effect.

Syntax

Namespace: FlexCel.Core

public class TSoftEdgesEffect: TDrawingEffect, IComparable, IComparable<TSoftEdgesEffect>

Constructors

Name | Description
TSoftEdgesEffect | Creates a new soft edges effect.

Methods

Name | Description
Clone | Creates a deep copy of the object.
CompareTo | Overloaded CompareTo(Object) CompareTo(TSoftEdgesEffect)
Equals | Overloaded Equals(TSoftEdgesEffect) Equals(Object)
GetHashCode | Returns the hashcode of the object.

Properties

Name | Description
Radius | Radius for the soft edges.


TSoftEdgesEffect.TSoftEdgesEffect Constructor | FlexCel Studio for the .NET Framework documentation

TSoftEdgesEffect.TSoftEdgesEffect Constructor

Creates a new soft edges effect.

Syntax

Namespace: FlexCel.Core

public TSoftEdgesEffect(Int64 aRadius)

Parameters

<-> | Parameter | Type | Description
 | aRadius | Int64 | Radius for the soft edges.

See also

  • TSoftEdgesEffect


TSoftEdgesEffect.Clone Method | FlexCel Studio for the .NET Framework documentation

TSoftEdgesEffect.Clone Method

Creates a deep copy of the object.

Syntax

Namespace: FlexCel.Core

public TSoftEdgesEffect Clone()

See also

  • TSoftEdgesEffect


TSoftEdgesEffect.CompareTo Method | FlexCel Studio for the .NET Framework documentation

TSoftEdgesEffect.CompareTo Method

Overloads

  • TSoftEdgesEffect.CompareTo(Object)
  • TSoftEdgesEffect.CompareTo(TSoftEdgesEffect)

TSoftEdgesEffect.CompareTo(Object)

Returns -1, 0 or 1 depending if this object is smaller or bigger than the other.

Syntax

Namespace: FlexCel.Core

public Int32 CompareTo(Object other)

Parameters

<-> | Parameter | Type | Description
 | other | Object |

See also

  • TSoftEdgesEffect

TSoftEdgesEffect.CompareTo(TSoftEdgesEffect)

Returns -1, 0 or 1 depending if this object is smaller or bigger than the other.

Syntax

Namespace: FlexCel.Core

public Int32 CompareTo(TSoftEdgesEffect other)

Parameters

<-> | Parameter | Type | Description
 | other | TSoftEdgesEffect |

See also

  • TSoftEdgesEffect


TSoftEdgesEffect.Equals Method | FlexCel Studio for the .NET Framework documentation

TSoftEdgesEffect.Equals Method

Overloads

  • TSoftEdgesEffect.Equals(TSoftEdgesEffect)
  • TSoftEdgesEffect.Equals(Object)

TSoftEdgesEffect.Equals(TSoftEdgesEffect)

Returns true if both objects are the same.

Syntax

Namespace: FlexCel.Core

protected Boolean Equals(TSoftEdgesEffect other)

Parameters

<-> | Parameter | Type | Description
 | other | TSoftEdgesEffect |

See also

  • TSoftEdgesEffect

TSoftEdgesEffect.Equals(Object)

Returns true if both objects are the same.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object other)

Parameters

<-> | Parameter | Type | Description
 | other | Object |

See also

  • TSoftEdgesEffect


TSoftEdgesEffect.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TSoftEdgesEffect.GetHashCode Method

Returns the hashcode of the object.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TSoftEdgesEffect


TSoftEdgesEffect.Radius Property | FlexCel Studio for the .NET Framework documentation

TSoftEdgesEffect.Radius Property

Radius for the soft edges.

Syntax

Namespace: FlexCel.Core

public Int64 Radius { get; }

See also

  • TSoftEdgesEffect


TSolidFill Class | FlexCel Studio for the .NET Framework documentation

TSolidFill Class

Shapes are filled with a solid color.

Syntax

Namespace: FlexCel.Core

public class TSolidFill: TFillStyle

Constructors

Name | Description
TSolidFill | Creates a new Solid fill.

Methods

Name | Description
Equals | Returns true if this instance has the same data as the object obj.
CompareTo | Returns -1 if obj is bigger than this, 0 if both objects are the same, and 1 if obj is smaller than this.
GetHashCode | Returns the hashcode for this object

Properties

Name | Description
Color | Color used to fill the shape.


TSolidFill.TSolidFill Constructor | FlexCel Studio for the .NET Framework documentation

TSolidFill.TSolidFill Constructor

Creates a new Solid fill.

Syntax

Namespace: FlexCel.Core

public TSolidFill(TDrawingColor aColor)

Parameters

<-> | Parameter | Type | Description
 | aColor | TDrawingColor | Color for the fill.

See also

  • TSolidFill


TSolidFill.Equals Method | FlexCel Studio for the .NET Framework documentation

TSolidFill.Equals Method

Returns true if this instance has the same data as the object obj.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TSolidFill


TSolidFill.CompareTo Method | FlexCel Studio for the .NET Framework documentation

TSolidFill.CompareTo Method

Returns -1 if obj is bigger than this, 0 if both objects are the same, and 1 if obj is smaller than this.

Syntax

Namespace: FlexCel.Core

public override Int32 CompareTo(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TSolidFill


TSolidFill.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TSolidFill.GetHashCode Method

Returns the hashcode for this object

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TSolidFill


TSolidFill.Color Property | FlexCel Studio for the .NET Framework documentation

TSolidFill.Color Property

Color used to fill the shape.

Syntax

Namespace: FlexCel.Core

public TDrawingColor Color { get; }

See also

  • TSolidFill


TSpinProperties Class | FlexCel Studio for the .NET Framework documentation

TSpinProperties Class

Spin properties of a scrollbar, spinner, listbox or combobox.

Syntax

Namespace: FlexCel.Core

public class TSpinProperties

Constructors

Name Description
TSpinProperties Overloaded
 TSpinProperties
TSpinProperties(Int32, Int32, Int32, Int32)
TSpinProperties(Int32, Int32, Int32, Int32, Int32)
TSpinProperties(Int32, Int32, Int32, Int32, Int32, Boolean)

Methods

Name | Description
Equals | Returns true if both objects have the same data.
GetHashCode | Hashcode for the object.
Clone | Creates a copy of the data.

Properties

Name | Description
Min | Minimum value for the spinner/scrollbar.
Max | Maximum value for the spinner/scrollbar.
Incr | How much the scrollbar moves when you press the up or down arrow. You will probably want to keep this at 1.
Page | How much the scrollbar moves when you press pgup/down.
Dx | Width of the scrollbar. It should normally be 16.
IsHorizontal | If used in a scrollbar, this property defines if the scrollbar is horizontal or vertical.


TSpinProperties.TSpinProperties Constructor | FlexCel Studio for the .NET Framework documentation

TSpinProperties.TSpinProperties Constructor

Overloads

  • TSpinProperties.TSpinProperties
  • TSpinProperties.TSpinProperties(Int32, Int32, Int32, Int32)
  • TSpinProperties.TSpinProperties(Int32, Int32, Int32, Int32, Int32)
  • TSpinProperties.TSpinProperties(Int32, Int32, Int32, Int32, Int32, Boolean)

TSpinProperties.TSpinProperties

Creates an empty TSpinProperties instance.

Syntax

Namespace: FlexCel.Core

public TSpinProperties()

See also

  • TSpinProperties

TSpinProperties.TSpinProperties(Int32, Int32, Int32, Int32)

Creates a new instance with data and a default dx of 16.

Syntax

Namespace: FlexCel.Core

public TSpinProperties(Int32 aMin, Int32 aMax, Int32 aIncr, Int32 aPage)

Parameters

<-> | Parameter | Type | Description
 | aMin | Int32 | Minimum value for the spin control.
 | aMax | Int32 | Maximum value for the spin control.
 | aIncr | Int32 | Small increment.
 | aPage | Int32 | Big increment.

See also

  • TSpinProperties

TSpinProperties.TSpinProperties(Int32, Int32, Int32, Int32, Int32)

Creates a new instance with data.

Syntax

Namespace: FlexCel.Core

public TSpinProperties(Int32 aMin, Int32 aMax, Int32 aIncr, Int32 aPage, Int32 aDx)

Parameters

<-> | Parameter | Type | Description
 | aMin | Int32 | Minimum value for the spin control.
 | aMax | Int32 | Maximum value for the spin control.
 | aIncr | Int32 | Small increment.
 | aPage | Int32 | Big increment.
 | aDx | Int32 | Width of the scrollbar. It should normally be 16.

See also

  • TSpinProperties

TSpinProperties.TSpinProperties(Int32, Int32, Int32, Int32, Int32, Boolean)

Creates a new instance with data.

Syntax

Namespace: FlexCel.Core

public TSpinProperties(Int32 aMin, Int32 aMax, Int32 aIncr, Int32 aPage, Int32 aDx, Boolean aHorizontal)

Parameters

<-> | Parameter | Type | Description
 | aMin | Int32 | Minimum value for the spin control.
 | aMax | Int32 | Maximum value for the spin control.
 | aIncr | Int32 | Small increment.
 | aPage | Int32 | Big increment.
 | aDx | Int32 | Width of the scrollbar. It should normally be 16.
 | aHorizontal | Boolean | If true, the spin control will be oriented horizontally.

See also

  • TSpinProperties


TSpinProperties.Equals Method | FlexCel Studio for the .NET Framework documentation

TSpinProperties.Equals Method

Returns true if both objects have the same data.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TSpinProperties


TSpinProperties.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TSpinProperties.GetHashCode Method

Hashcode for the object.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TSpinProperties


TSpinProperties.Clone Method | FlexCel Studio for the .NET Framework documentation

TSpinProperties.Clone Method

Creates a copy of the data.

Syntax

Namespace: FlexCel.Core

public TSpinProperties Clone()

See also

  • TSpinProperties


TSpinProperties.Min Property | FlexCel Studio for the .NET Framework documentation

TSpinProperties.Min Property

Minimum value for the spinner/scrollbar.

Syntax

Namespace: FlexCel.Core

public Int32 Min { get; set; }

See also

  • TSpinProperties


TSpinProperties.Max Property | FlexCel Studio for the .NET Framework documentation

TSpinProperties.Max Property

Maximum value for the spinner/scrollbar.

Syntax

Namespace: FlexCel.Core

public Int32 Max { get; set; }

See also

  • TSpinProperties


TSpinProperties.Incr Property | FlexCel Studio for the .NET Framework documentation

TSpinProperties.Incr Property

How much the scrollbar moves when you press the up or down arrow. You will probably want to keep this at 1.

Syntax

Namespace: FlexCel.Core

public Int32 Incr { get; set; }

See also

  • TSpinProperties


TSpinProperties.Page Property | FlexCel Studio for the .NET Framework documentation

TSpinProperties.Page Property

How much the scrollbar moves when you press pgup/down.

Syntax

Namespace: FlexCel.Core

public Int32 Page { get; set; }

See also

  • TSpinProperties


TSpinProperties.Dx Property | FlexCel Studio for the .NET Framework documentation

TSpinProperties.Dx Property

Width of the scrollbar. It should normally be 16.

Syntax

Namespace: FlexCel.Core

public Int32 Dx { get; set; }

See also

  • TSpinProperties


TSpinProperties.IsHorizontal Property | FlexCel Studio for the .NET Framework documentation

TSpinProperties.IsHorizontal Property

If used in a scrollbar, this property defines if the scrollbar is horizontal or vertical.

Syntax

Namespace: FlexCel.Core

public Boolean IsHorizontal { get; set; }

See also

  • TSpinProperties


TTableDefinition Class | FlexCel Studio for the .NET Framework documentation

TTableDefinition Class

Contains the definition of an Excel table.

Syntax

Namespace: FlexCel.Core

public class TTableDefinition

Methods

Name | Description
Equals | Returns true if this instance is the same as obj,
GetHashCode | Returns the hash code of the object.
AddColumn | Adds a column to a table definition. This is mostly used for tables without headers, as in the tables with headers columns will be inferred from the cells in the header.
ClearColumns | Clears all column definitions in the table.
ColumnFromId | Returns the column definition for an id, or returns a column with Id = -1 and name empty if the id doesn't exist.
ColumnFromPos | Returns the column at position columnPosition (0 based).
ColumnInGridFromId | Returns the position int the Excel grid for a column id. So for example if the table starts at column 10 in Excel, and aId is the second column of the table, this method will return 11. If the id doesn't exists, this method will return -1.
ColumnFromName | Returns the column definition for a given column name. If tableXls is null, then this method will return the stored column name. If not null and the table has headers, this method will try to get the column name from the cell value of the table headers in the Excel file. If the column name doesn't exist, this method will return a TTableColumn​Definition(​null, -1);

Properties

Name | Description
Name | The name of the table.
Range | The range of cells used by the table.
Comment | The comment for the table.
Style | The built in style of the table, if any.
HasHeaderRow | If true the table has a header row.
HasTotalsRow | If true the table has a Totals row.
HasAutofilter | If true the table has an autofilter.
ColumnCount | Returns the number of columns in the table definition.


TTableDefinition.Equals Method | FlexCel Studio for the .NET Framework documentation

TTableDefinition.Equals Method

Returns true if this instance is the same as obj,

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TTableDefinition


TTableDefinition.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TTableDefinition.GetHashCode Method

Returns the hash code of the object.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TTableDefinition


TTableDefinition.AddColumn Method | FlexCel Studio for the .NET Framework documentation

TTableDefinition.AddColumn Method

Adds a column to a table definition. This is mostly used for tables without headers, as in the tables with headers columns will be inferred from the cells in the header.

Syntax

Namespace: FlexCel.Core

public void AddColumn(TTableColumnDefinition columnDefinition)

Parameters

<-> | Parameter | Type | Description
 | columnDefinition | TTableColumn​Definition |

See also

  • TTableDefinition


TTableDefinition.ClearColumns Method | FlexCel Studio for the .NET Framework documentation

TTableDefinition.ClearColumns Method

Clears all column definitions in the table.

Syntax

Namespace: FlexCel.Core

public void ClearColumns()

See also

  • TTableDefinition


TTableDefinition.ColumnFromId Method | FlexCel Studio for the .NET Framework documentation

TTableDefinition.ColumnFromId Method

Returns the column definition for an id, or returns a column with Id = -1 and name empty if the id doesn't exist.

Syntax

Namespace: FlexCel.Core

public TTableColumnDefinition ColumnFromId(Int32 aId, ExcelFile xls, Int32 tableSheet)

Parameters

<-> | Parameter | Type | Description
 | aId | Int32 | Id for the column.
 | xls | ExcelFile | Excel file where the table is. you can set it to null to retrieve the actual value stored in the column. If not null, this method will try to get the actual name in the cell and return that as the column name.
 | tableSheet | Int32 | Sheet where the table is.(1 based)

See also

  • TTableDefinition


TTableDefinition.ColumnFromPos Method | FlexCel Studio for the .NET Framework documentation

TTableDefinition.ColumnFromPos Method

Returns the column at position columnPosition (0 based).

Syntax

Namespace: FlexCel.Core

public TTableColumnDefinition ColumnFromPos(Int32 columnPosition)

Parameters

<-> | Parameter | Type | Description
 | columnPosition | Int32 |

See also

  • TTableDefinition


TTableDefinition.ColumnInGridFromId Method | FlexCel Studio for the .NET Framework documentation

TTableDefinition.ColumnInGridFromId Method

Returns the position int the Excel grid for a column id. So for example if the table starts at column 10 in Excel, and aId is the second column of the table, this method will return 11. If the id doesn't exists, this method will return -1.

Syntax

Namespace: FlexCel.Core

public Int32 ColumnInGridFromId(Int32 aId)

Parameters

<-> | Parameter | Type | Description
 | aId | Int32 | Id of the column we want to find.

Returns

-1 if not found, either the position in the list.

See also

  • TTableDefinition


TTableDefinition.ColumnFromName Method | FlexCel Studio for the .NET Framework documentation

TTableDefinition.ColumnFromName Method

Returns the column definition for a given column name. If tableXls is null, then this method will return the stored column name. If not null and the table has headers, this method will try to get the column name from the cell value of the table headers in the Excel file.

If the column name doesn't exist, this method will return a TTableColumnDefinition(null, -1);

Syntax

Namespace: FlexCel.Core

public TTableColumnDefinition ColumnFromName(String columnName, ExcelFile tableXls, Int32 tableSheet)

Parameters

<-> | Parameter | Type | Description
 | columnName | String | Column name which we want to find.
 | tableXls | ExcelFile | ExcelFile which contains the table. It can be null, and in this case the stored value of the header will be used. If not null, we will read the actual cell value in the file for the header, and return that.
 | tableSheet | Int32 | Sheet where the table is inside tableXls (1 based).

See also

  • TTableDefinition


TTableDefinition.Name Property | FlexCel Studio for the .NET Framework documentation

TTableDefinition.Name Property

The name of the table.

Syntax

Namespace: FlexCel.Core

public String Name { get; set; }

See also

  • TTableDefinition


TTableDefinition.Range Property | FlexCel Studio for the .NET Framework documentation

TTableDefinition.Range Property

The range of cells used by the table.

Syntax

Namespace: FlexCel.Core

public TXlsCellRange Range { get; set; }

See also

  • TTableDefinition


TTableDefinition.Comment Property | FlexCel Studio for the .NET Framework documentation

TTableDefinition.Comment Property

The comment for the table.

Syntax

Namespace: FlexCel.Core

public String Comment { get; set; }

See also

  • TTableDefinition


TTableDefinition.Style Property | FlexCel Studio for the .NET Framework documentation

TTableDefinition.Style Property

The built in style of the table, if any.

Syntax

Namespace: FlexCel.Core

public TTableStyle Style { get; set; }

See also

  • TTableDefinition


TTableDefinition.HasHeaderRow Property | FlexCel Studio for the .NET Framework documentation

TTableDefinition.HasHeaderRow Property

If true the table has a header row.

Syntax

Namespace: FlexCel.Core

public Boolean HasHeaderRow { get; set; }

See also

  • TTableDefinition


TTableDefinition.HasTotalsRow Property | FlexCel Studio for the .NET Framework documentation

TTableDefinition.HasTotalsRow Property

If true the table has a Totals row.

Syntax

Namespace: FlexCel.Core

public Boolean HasTotalsRow { get; set; }

See also

  • TTableDefinition


TTableDefinition.HasAutofilter Property | FlexCel Studio for the .NET Framework documentation

TTableDefinition.HasAutofilter Property

If true the table has an autofilter.

Syntax

Namespace: FlexCel.Core

public Boolean HasAutofilter { get; set; }

See also

  • TTableDefinition


TTableDefinition.ColumnCount Property | FlexCel Studio for the .NET Framework documentation

TTableDefinition.ColumnCount Property

Returns the number of columns in the table definition.

Syntax

Namespace: FlexCel.Core

public Int32 ColumnCount { get; }

See also

  • TTableDefinition


TTableFormat Class | FlexCel Studio for the .NET Framework documentation

TTableFormat Class

Defines a custom format for a table.

Syntax

Namespace: FlexCel.Core

public class TTableFormat

Fields

Name | Description
ApplyFont | Specifies which properties of Font will be applied in the final format.
Font | The definition of the font. Only those properties true in ApplyFont will be used.
ApplyFill | Specifies which properties of Fill will be applied in the final format.
Fill | Fill properties that will be applied. Only those in ApplyFill will be used.
ApplyBorders | Defines which borders will be applied to the final format.
Borders | Defines the borders. Only those borders where ApplyBorders is true will be used.

Constructors

Name | Description
TTableFormat | Creates an empty instance, where no format applies.

Methods

Name | Description
Clone | Returns a deep copy of the object.
Equals | Returns true if this object is equal to obj.
GetHashCode | Returns the hashcode for this object.

Properties

Name | Description
HasFontBlock | Returns true if any font formatting is applied
HasBorderBlock | Returns true if any border formatting is applied.
HasFillBlock | Returns true if any pattern formatting is applied.
HasFormat | Returns true if any format is applied.


TTableFormat.ApplyFont Field | FlexCel Studio for the .NET Framework documentation

TTableFormat.ApplyFont Field

Specifies which properties of Font will be applied in the final format.

Syntax

Namespace: FlexCel.Core

public TTableApplyFont ApplyFont

See also

  • TTableFormat


TTableFormat.Font Field | FlexCel Studio for the .NET Framework documentation

TTableFormat.Font Field

The definition of the font. Only those properties true in ApplyFont will be used.

Syntax

Namespace: FlexCel.Core

public TTableFont Font

See also

  • TTableFormat


TTableFormat.ApplyFill Field | FlexCel Studio for the .NET Framework documentation

TTableFormat.ApplyFill Field

Specifies which properties of Fill will be applied in the final format.

Syntax

Namespace: FlexCel.Core

public TTableApplyFill ApplyFill

See also

  • TTableFormat


TTableFormat.Fill Field | FlexCel Studio for the .NET Framework documentation

TTableFormat.Fill Field

Fill properties that will be applied. Only those in ApplyFill will be used.

Syntax

Namespace: FlexCel.Core

public TFlxFillPattern Fill

See also

  • TTableFormat


TTableFormat.ApplyBorders Field | FlexCel Studio for the .NET Framework documentation

TTableFormat.ApplyBorders Field

Defines which borders will be applied to the final format.

Syntax

Namespace: FlexCel.Core

public TTableApplyBorders ApplyBorders

See also

  • TTableFormat


TTableFormat.Borders Field | FlexCel Studio for the .NET Framework documentation

TTableFormat.Borders Field

Defines the borders. Only those borders where ApplyBorders is true will be used.

Syntax

Namespace: FlexCel.Core

public TTableBorders Borders

See also

  • TTableFormat


TTableFormat.TTableFormat Constructor | FlexCel Studio for the .NET Framework documentation

TTableFormat.TTableFormat Constructor

Creates an empty instance, where no format applies.

Syntax

Namespace: FlexCel.Core

public TTableFormat()

See also

  • TTableFormat


TTableFormat.Clone Method | FlexCel Studio for the .NET Framework documentation

TTableFormat.Clone Method

Returns a deep copy of the object.

Syntax

Namespace: FlexCel.Core

public TTableFormat Clone()

See also

  • TTableFormat


TTableFormat.Equals Method | FlexCel Studio for the .NET Framework documentation

TTableFormat.Equals Method

Returns true if this object is equal to obj.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TTableFormat


TTableFormat.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TTableFormat.GetHashCode Method

Returns the hashcode for this object.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TTableFormat


TTableFormat.HasFontBlock Property | FlexCel Studio for the .NET Framework documentation

TTableFormat.HasFontBlock Property

Returns true if any font formatting is applied

Syntax

Namespace: FlexCel.Core

public Boolean HasFontBlock { get; }

See also

  • TTableFormat


TTableFormat.HasBorderBlock Property | FlexCel Studio for the .NET Framework documentation

TTableFormat.HasBorderBlock Property

Returns true if any border formatting is applied.

Syntax

Namespace: FlexCel.Core

public Boolean HasBorderBlock { get; }

See also

  • TTableFormat


TTableFormat.HasFillBlock Property | FlexCel Studio for the .NET Framework documentation

TTableFormat.HasFillBlock Property

Returns true if any pattern formatting is applied.

Syntax

Namespace: FlexCel.Core

public Boolean HasFillBlock { get; }

See also

  • TTableFormat


TTableFormat.HasFormat Property | FlexCel Studio for the .NET Framework documentation

TTableFormat.HasFormat Property

Returns true if any format is applied.

Syntax

Namespace: FlexCel.Core

public Boolean HasFormat { get; }

See also

  • TTableFormat


TTheme Class | FlexCel Studio for the .NET Framework documentation

TTheme Class

Contains a complete definition for an Office Theme.

Syntax

Namespace: FlexCel.Core

public class TTheme

Constructors

Name | Description
TTheme | Creates a new standard "Office" theme with Excel 2007 defaults. Note that the standard Office theme for newer versions changed.

Methods

Name | Description
Clone | Returns a deep copy of this object.
GetThemeVersion | Returns the theme id associated with a specific Excel version. If FlexCel doesn't know about the version, it returns -1.
FileFormat | Returns the file format normally associated with the theme. Note that multiple Excel version can use the same theme, so this method will return the latest Excel using this theme.

Properties

Name | Description
Name | Name of the theme definition. This will be shown in Excel UI.
Elements | Elements of the theme.
ThemeVersion | Excel version that saved this theme. For Excel 2007 this value is 124226. For themes new to Excel 2010, this value might be 144315. Excel 2016 is 164011 and Excel 2019 is 166925
IsStandard2007 | Returns true if the theme is standard as saved by Excel 2007. Note that Excel versions bigger than 2010 use different standard themes.


TTheme.TTheme Constructor | FlexCel Studio for the .NET Framework documentation

TTheme.TTheme Constructor

Creates a new standard "Office" theme with Excel 2007 defaults. Note that the standard Office theme for newer versions changed.

Syntax

Namespace: FlexCel.Core

public TTheme()

See also

  • TTheme


TTheme.Clone Method | FlexCel Studio for the .NET Framework documentation

TTheme.Clone Method

Returns a deep copy of this object.

Syntax

Namespace: FlexCel.Core

public TTheme Clone()

See also

  • TTheme


TTheme.GetThemeVersion Method | FlexCel Studio for the .NET Framework documentation

TTheme.GetThemeVersion Method

Returns the theme id associated with a specific Excel version. If FlexCel doesn't know about the version, it returns -1.

Syntax

Namespace: FlexCel.Core

public static Int32 GetThemeVersion(TExcelFileFormat excelVersion)

Parameters

<-> | Parameter | Type | Description
 | excelVersion | TExcelFileFormat |

See also

  • TTheme


TTheme.FileFormat Method | FlexCel Studio for the .NET Framework documentation

TTheme.FileFormat Method

Returns the file format normally associated with the theme. Note that multiple Excel version can use the same theme, so this method will return the latest Excel using this theme.

Syntax

Namespace: FlexCel.Core

public TExcelFileFormat FileFormat()

See also

  • TTheme


TTheme.Name Property | FlexCel Studio for the .NET Framework documentation

TTheme.Name Property

Name of the theme definition. This will be shown in Excel UI.

Syntax

Namespace: FlexCel.Core

public String Name { get; set; }

See also

  • TTheme


TTheme.Elements Property | FlexCel Studio for the .NET Framework documentation

TTheme.Elements Property

Elements of the theme.

Syntax

Namespace: FlexCel.Core

public TThemeElements Elements { get; }

See also

  • TTheme


TTheme.ThemeVersion Property | FlexCel Studio for the .NET Framework documentation

TTheme.ThemeVersion Property

Excel version that saved this theme. For Excel 2007 this value is 124226. For themes new to Excel 2010, this value might be 144315. Excel 2016 is 164011 and Excel 2019 is 166925

Syntax

Namespace: FlexCel.Core

public Int32 ThemeVersion { get; set; }

See also

  • TTheme


TTheme.IsStandard2007 Property | FlexCel Studio for the .NET Framework documentation

TTheme.IsStandard2007 Property

Returns true if the theme is standard as saved by Excel 2007. Note that Excel versions bigger than 2010 use different standard themes.

Syntax

Namespace: FlexCel.Core

public Boolean IsStandard2007 { get; }

See also

  • TTheme


TThemeColorScheme Class | FlexCel Studio for the .NET Framework documentation

TThemeColorScheme Class

A color scheme for a theme.

Syntax

Namespace: FlexCel.Core

public class TThemeColorScheme

Constructors

Name | Description
TThemeColorScheme | Creates a new ColorScheme with standard properties.

Methods

Name | Description
Reset | Resets the color scheme to be the Excel 2007 standard.

Properties

Name | Description
Name | Name of the color definition. This will be shown in Excel UI.
this[] | Returns a color definition for a themed color.


TThemeColorScheme.TThemeColorScheme Constructor | FlexCel Studio for the .NET Framework documentation

TThemeColorScheme.TThemeColorScheme Constructor

Creates a new ColorScheme with standard properties.

Syntax

Namespace: FlexCel.Core

public TThemeColorScheme()

See also

  • TThemeColorScheme


TThemeColorScheme.Reset Method | FlexCel Studio for the .NET Framework documentation

TThemeColorScheme.Reset Method

Resets the color scheme to be the Excel 2007 standard.

Syntax

Namespace: FlexCel.Core

public void Reset()

See also

  • TThemeColorScheme


TThemeColorScheme.Name Property | FlexCel Studio for the .NET Framework documentation

TThemeColorScheme.Name Property

Name of the color definition. This will be shown in Excel UI.

Syntax

Namespace: FlexCel.Core

public String Name { get; set; }

See also

  • TThemeColorScheme


TThemeColorScheme.this[] Property | FlexCel Studio for the .NET Framework documentation

TThemeColorScheme.this[] Property

Returns a color definition for a themed color.

Syntax

Namespace: FlexCel.Core

public TDrawingColor this[] { get; set; }

See also

  • TThemeColorScheme


TThemeElements Class | FlexCel Studio for the .NET Framework documentation

TThemeElements Class

Definitions of the elements in a theme (colors, fonts, formats). This is the main part of a theme.

Syntax

Namespace: FlexCel.Core

public class TThemeElements

Constructors

Name | Description
TThemeElements | Creates a new theme elements.

Methods

Name | Description
Clone | Returns a deep copy of this object.

Properties

Name | Description
IsStandard2007 | Returns true if the elements in this theme are the default ones in Office 2007.
ColorScheme | Color Scheme in the theme.
FontScheme | Font Scheme in the theme.
FormatScheme | Format Scheme (Effects). This won't affect cells in the spreadsheet, but can affect drawings.


TThemeElements.TThemeElements Constructor | FlexCel Studio for the .NET Framework documentation

TThemeElements.TThemeElements Constructor

Creates a new theme elements.

Syntax

Namespace: FlexCel.Core

public TThemeElements()

See also

  • TThemeElements


TThemeElements.Clone Method | FlexCel Studio for the .NET Framework documentation

TThemeElements.Clone Method

Returns a deep copy of this object.

Syntax

Namespace: FlexCel.Core

public TThemeElements Clone()

See also

  • TThemeElements


TThemeElements.IsStandard2007 Property | FlexCel Studio for the .NET Framework documentation

TThemeElements.IsStandard2007 Property

Returns true if the elements in this theme are the default ones in Office 2007.

Syntax

Namespace: FlexCel.Core

public Boolean IsStandard2007 { get; }

See also

  • TThemeElements


TThemeElements.ColorScheme Property | FlexCel Studio for the .NET Framework documentation

TThemeElements.ColorScheme Property

Color Scheme in the theme.

Syntax

Namespace: FlexCel.Core

public TThemeColorScheme ColorScheme { get; }

See also

  • TThemeElements


TThemeElements.FontScheme Property | FlexCel Studio for the .NET Framework documentation

TThemeElements.FontScheme Property

Font Scheme in the theme.

Syntax

Namespace: FlexCel.Core

public TThemeFontScheme FontScheme { get; }

See also

  • TThemeElements


TThemeElements.FormatScheme Property | FlexCel Studio for the .NET Framework documentation

TThemeElements.FormatScheme Property

Format Scheme (Effects). This won't affect cells in the spreadsheet, but can affect drawings.

Syntax

Namespace: FlexCel.Core

public TThemeFormatScheme FormatScheme { get; }

See also

  • TThemeElements


TThemeFont Class | FlexCel Studio for the .NET Framework documentation

TThemeFont Class

Represents either a major or a minor font for the theme.

Syntax

Namespace: FlexCel.Core

public class TThemeFont

Constructors

Name | Description
TThemeFont | Overloaded TThemeFont TThemeFont(TThemeTextFont, TThemeTextFont, TThemeTextFont)

Methods

Name | Description
AddFont | Adds a new font to the font collection.
GetFont | Returns the typeface associated with a script.
ClearFonts | Clears all font associations.
GetFontScripts | Returns all scripts that have a current association. You can use the values in this array as keys for GetFont
Clone | Returns a deep copy of this object.
Equals | Returns true if both objects are the same.
GetHashCode | Returns the hashcode for the object.

Properties

Name | Description
Latin | NORMALLY THIS IS ALL YOU HAVE TO CHANGE TO CHANGE A TYPEFACE. Check with APIMate if unsure. This element specifies that a Latin font be used for a specific run of text. This font is specified with a typeface attribute much like the others but is specifically classified as a Latin font.
EastAsian | This element specifies that an East Asian font be used for a specific run of text. This font is specified with a typeface attribute much like the others but is specifically classified as an East Asian font.
ComplexScript | This element specifies that a complex script font be used for a specific run of text. This font is specified with a typeface attribute much like the others but is specifically classified as a complex script font.


TThemeFont.TThemeFont Constructor | FlexCel Studio for the .NET Framework documentation

TThemeFont.TThemeFont Constructor

Overloads

  • TThemeFont.TThemeFont
  • TThemeFont.TThemeFont(TThemeTextFont, TThemeTextFont, TThemeTextFont)

TThemeFont.TThemeFont

Creates a new TThemeFont instance.

Syntax

Namespace: FlexCel.Core

public TThemeFont()

See also

  • TThemeFont

TThemeFont.TThemeFont(TThemeTextFont, TThemeTextFont, TThemeTextFont)

Creates a new TThemeFont.

Syntax

Namespace: FlexCel.Core

public TThemeFont(TThemeTextFont aLatin, TThemeTextFont aEastAsian, TThemeTextFont aComplexScript)

Parameters

<-> | Parameter | Type | Description
 | aLatin | TThemeTextFont | See Latin
 | aEastAsian | TThemeTextFont | See EastAsian
 | aComplexScript | TThemeTextFont | See ComplexScript

See also

  • TThemeFont


TThemeFont.AddFont Method | FlexCel Studio for the .NET Framework documentation

TThemeFont.AddFont Method

Adds a new font to the font collection.

Syntax

Namespace: FlexCel.Core

public void AddFont(String script, String typeface)

Parameters

<-> | Parameter | Type | Description
 | script | String | Script to be associated with the font.
 | typeface | String | Typeface to associate. Set it to null to delete the element

See also

  • TThemeFont


TThemeFont.GetFont Method | FlexCel Studio for the .NET Framework documentation

TThemeFont.GetFont Method

Returns the typeface associated with a script.

Syntax

Namespace: FlexCel.Core

public String GetFont(String script)

Parameters

<-> | Parameter | Type | Description
 | script | String |

See also

  • TThemeFont


TThemeFont.ClearFonts Method | FlexCel Studio for the .NET Framework documentation

TThemeFont.ClearFonts Method

Clears all font associations.

Syntax

Namespace: FlexCel.Core

public void ClearFonts()

See also

  • TThemeFont


TThemeFont.GetFontScripts Method | FlexCel Studio for the .NET Framework documentation

TThemeFont.GetFontScripts Method

Returns all scripts that have a current association. You can use the values in this array as keys for GetFont

Syntax

Namespace: FlexCel.Core

public String[] GetFontScripts()

See also

  • TThemeFont


TThemeFont.Clone Method | FlexCel Studio for the .NET Framework documentation

TThemeFont.Clone Method

Returns a deep copy of this object.

Syntax

Namespace: FlexCel.Core

public TThemeFont Clone()

See also

  • TThemeFont


TThemeFont.Equals Method | FlexCel Studio for the .NET Framework documentation

TThemeFont.Equals Method

Returns true if both objects are the same.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TThemeFont


TThemeFont.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TThemeFont.GetHashCode Method

Returns the hashcode for the object.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TThemeFont


TThemeFont.Latin Property | FlexCel Studio for the .NET Framework documentation

TThemeFont.Latin Property

NORMALLY THIS IS ALL YOU HAVE TO CHANGE TO CHANGE A TYPEFACE. Check with APIMate if unsure. This element specifies that a Latin font be used for a specific run of text. This font is specified with a typeface attribute much like the others but is specifically classified as a Latin font.

Syntax

Namespace: FlexCel.Core

public TThemeTextFont Latin { get; set; }

See also

  • TThemeFont


TThemeFont.EastAsian Property | FlexCel Studio for the .NET Framework documentation

TThemeFont.EastAsian Property

This element specifies that an East Asian font be used for a specific run of text. This font is specified with a typeface attribute much like the others but is specifically classified as an East Asian font.

Syntax

Namespace: FlexCel.Core

public TThemeTextFont EastAsian { get; set; }

See also

  • TThemeFont


TThemeFont.ComplexScript Property | FlexCel Studio for the .NET Framework documentation

TThemeFont.ComplexScript Property

This element specifies that a complex script font be used for a specific run of text. This font is specified with a typeface attribute much like the others but is specifically classified as a complex script font.

Syntax

Namespace: FlexCel.Core

public TThemeTextFont ComplexScript { get; set; }

See also

  • TThemeFont


TThemeFontScheme Class | FlexCel Studio for the .NET Framework documentation

TThemeFontScheme Class

Represents the fonts for a theme.

Syntax

Namespace: FlexCel.Core

public class TThemeFontScheme

Constructors

Name | Description
TThemeFontScheme | Creates a new font scheme with standard properties.

Properties

Name | Description
Name | Name of the font definition. This will be shown in Excel UI.
MajorFont | This element defines the set of major fonts which are to be used under different languages or locals.
MinorFont | This element defines the set of minor fonts which are to be used under different languages or locals.


TThemeFontScheme.TThemeFontScheme Constructor | FlexCel Studio for the .NET Framework documentation

TThemeFontScheme.TThemeFontScheme Constructor

Creates a new font scheme with standard properties.

Syntax

Namespace: FlexCel.Core

public TThemeFontScheme()

See also

  • TThemeFontScheme


TThemeFontScheme.Name Property | FlexCel Studio for the .NET Framework documentation

TThemeFontScheme.Name Property

Name of the font definition. This will be shown in Excel UI.

Syntax

Namespace: FlexCel.Core

public String Name { get; set; }

See also

  • TThemeFontScheme


TThemeFontScheme.MajorFont Property | FlexCel Studio for the .NET Framework documentation

TThemeFontScheme.MajorFont Property

This element defines the set of major fonts which are to be used under different languages or locals.

Syntax

Namespace: FlexCel.Core

public TThemeFont MajorFont { get; set; }

See also

  • TThemeFontScheme


TThemeFontScheme.MinorFont Property | FlexCel Studio for the .NET Framework documentation

TThemeFontScheme.MinorFont Property

This element defines the set of minor fonts which are to be used under different languages or locals.

Syntax

Namespace: FlexCel.Core

public TThemeFont MinorFont { get; set; }

See also

  • TThemeFontScheme


TThemeFormatScheme Class | FlexCel Studio for the .NET Framework documentation

TThemeFormatScheme Class

Represents the drawing formats (fill styles, line styles, effects) for a theme.

Syntax

Namespace: FlexCel.Core

public class TThemeFormatScheme

Constructors

Name | Description
TThemeFormatScheme | Creates a new Format scheme instance.

Properties

Name | Description
Name | Name of the format definition. This will be shown in Excel UI.
FillStyleList | This element defines a set of three fill styles that are used within a theme.
LineStyleList | This element defines a list of three line styles for use within a theme.
EffectStyleList | This element defines a set of three effect styles (or more) that create the effect style list for a theme.
BkFillStyleList | This element defines a list of background fills that are used within a theme.


TThemeFormatScheme.TThemeFormatScheme Constructor | FlexCel Studio for the .NET Framework documentation

TThemeFormatScheme.TThemeFormatScheme Constructor

Creates a new Format scheme instance.

Syntax

Namespace: FlexCel.Core

public TThemeFormatScheme()

See also

  • TThemeFormatScheme


TThemeFormatScheme.Name Property | FlexCel Studio for the .NET Framework documentation

TThemeFormatScheme.Name Property

Name of the format definition. This will be shown in Excel UI.

Syntax

Namespace: FlexCel.Core

public String Name { get; set; }

See also

  • TThemeFormatScheme


TThemeFormatScheme.FillStyleList Property | FlexCel Studio for the .NET Framework documentation

TThemeFormatScheme.FillStyleList Property

This element defines a set of three fill styles that are used within a theme.

Syntax

Namespace: FlexCel.Core

public TFillStyleList FillStyleList { get; }

See also

  • TThemeFormatScheme


TThemeFormatScheme.LineStyleList Property | FlexCel Studio for the .NET Framework documentation

TThemeFormatScheme.LineStyleList Property

This element defines a list of three line styles for use within a theme.

Syntax

Namespace: FlexCel.Core

public TLineStyleList LineStyleList { get; }

See also

  • TThemeFormatScheme


TThemeFormatScheme.EffectStyleList Property | FlexCel Studio for the .NET Framework documentation

TThemeFormatScheme.EffectStyleList Property

This element defines a set of three effect styles (or more) that create the effect style list for a theme.

Syntax

Namespace: FlexCel.Core

public TEffectStyleList EffectStyleList { get; }

See also

  • TThemeFormatScheme


TThemeFormatScheme.BkFillStyleList Property | FlexCel Studio for the .NET Framework documentation

TThemeFormatScheme.BkFillStyleList Property

This element defines a list of background fills that are used within a theme.

Syntax

Namespace: FlexCel.Core

public TFillStyleList BkFillStyleList { get; }

See also

  • TThemeFormatScheme


TToken Class | FlexCel Studio for the .NET Framework documentation

TToken Class

This class and all its descendants represent a token in a formula. You can use these classes to modify formulas without having to parse the text in them, which can be a difficult task.

Syntax

Namespace: FlexCel.Core

public abstract class TToken

Constructors

Name | Description
TToken | Creates a new token.

Properties

Name | Description
TokenType | Returns the type of token.


TToken.TToken Constructor | FlexCel Studio for the .NET Framework documentation

TToken.TToken Constructor

Creates a new token.

Syntax

Namespace: FlexCel.Core

protected TToken(TTokenType aTokenType)

Parameters

<-> | Parameter | Type | Description
 | aTokenType | TTokenType |

See also

  • TToken


TToken.TokenType Property | FlexCel Studio for the .NET Framework documentation

TToken.TokenType Property

Returns the type of token.

Syntax

Namespace: FlexCel.Core

public TTokenType TokenType { get; }

See also

  • TToken


TTokenCellAddress Class | FlexCel Studio for the .NET Framework documentation

TTokenCellAddress Class

A single cell address in the same sheet or to other sheet. See also TTokenCellRange, TTokenRelativeCellAddress, TTokenRelativeCellRange for other tokens that can contain addresses.

Syntax

Namespace: FlexCel.Core

public class TTokenCellAddress: TToken

Constructors

Name | Description
TTokenCellAddress | Creates a new Cell address token.

Properties

Name | Description
Address | Cell address where this reference points to.
ExternalBookName | File where the reference points to, when this is a reference to other file. Empty or null if the reference is to the same file.


TTokenCellAddress.TTokenCellAddress Constructor | FlexCel Studio for the .NET Framework documentation

TTokenCellAddress.TTokenCellAddress Constructor

Creates a new Cell address token.

Syntax

Namespace: FlexCel.Core

public TTokenCellAddress(String aExternalBookName, TCellAddress aAddress)

Parameters

<-> | Parameter | Type | Description
 | aExternalBookName | String | File where the reference points to, when this is a reference to other file. Empty or null if the reference is to the same file.
 | aAddress | TCellAddress | Cell where this token will point to.

See also

  • TTokenCellAddress


TTokenCellAddress.Address Property | FlexCel Studio for the .NET Framework documentation

TTokenCellAddress.Address Property

Cell address where this reference points to.

Syntax

Namespace: FlexCel.Core

public TCellAddress Address { get; set; }

See also

  • TTokenCellAddress


TTokenCellAddress.ExternalBookName Property | FlexCel Studio for the .NET Framework documentation

TTokenCellAddress.ExternalBookName Property

File where the reference points to, when this is a reference to other file. Empty or null if the reference is to the same file.

Syntax

Namespace: FlexCel.Core

public String ExternalBookName { get; set; }

See also

  • TTokenCellAddress


TTokenCellRange Class | FlexCel Studio for the .NET Framework documentation

TTokenCellRange Class

A range of cells. See TTokenCellAddress for single cell references.

Syntax

Namespace: FlexCel.Core

public class TTokenCellRange: TToken

Constructors

Name | Description
TTokenCellRange | Creates a new Cell range token.

Properties

Name | Description
ExternalBookName | File where the reference points to, when this is a reference to other file. Empty or null if the reference is to the same file.
Sheet1 | First sheet where the reference points to. Empty or null if the reference points to the same sheet.
Sheet2 | Second sheet where the reference points to. Empty or null if the reference points to the same sheet.
Row1 | First row of the range (1 based).
Col1 | First column of the range (1 based).
Row2 | Last row of the range (1 based).
Col2 | Last column of the range (1 based).
Row1Absolute | True if the reference is absolute (as in $A$1).
Col1Absolute | True if the reference is absolute (as in $A$1).
Row2Absolute | True if the reference is absolute (as in $A$1).
Col2Absolute | True if the reference is absolute (as in $A$1).


TTokenCellRange.TTokenCellRange Constructor | FlexCel Studio for the .NET Framework documentation

TTokenCellRange.TTokenCellRange Constructor

Creates a new Cell range token.

Syntax

Namespace: FlexCel.Core

public TTokenCellRange(String aExternalBookName, String aSheet1, String aSheet2, Int32 aRow1, Int32 aCol1, Int32 aRow2, Int32 aCol2, Boolean aRow1Abs, Boolean aCol1Abs, Boolean aRow2Abs, Boolean aCol2Abs)

Parameters

<-> | Parameter | Type | Description
 | aExternalBookName | String | File where the reference points to, when this is a reference to other file. Empty or null if the reference is to the same file.
 | aSheet1 | String | First sheet where the reference points to. Empty or null if the reference points to the same sheet.
 | aSheet2 | String | Second where the reference points to. Empty or null if the reference points to the same sheet.
 | aRow1 | Int32 | First row (1 based).
 | aCol1 | Int32 | First column (1 based).
 | aRow2 | Int32 | Last row (1 based).
 | aCol2 | Int32 | Last column (1 based).
 | aRow1Abs | Boolean | True if the first row is an absolute reference (like in A$1)
 | aCol1Abs | Boolean | True if the first column is an absolute reference (like in $A1)
 | aRow2Abs | Boolean | True if the last row is an absolute reference (like in A$1)
 | aCol2Abs | Boolean | True if the last column is an absolute reference (like in $A1)

See also

  • TTokenCellRange


TTokenCellRange.ExternalBookName Property | FlexCel Studio for the .NET Framework documentation

TTokenCellRange.ExternalBookName Property

File where the reference points to, when this is a reference to other file. Empty or null if the reference is to the same file.

Syntax

Namespace: FlexCel.Core

public String ExternalBookName { get; set; }

See also

  • TTokenCellRange


TTokenCellRange.Sheet1 Property | FlexCel Studio for the .NET Framework documentation

TTokenCellRange.Sheet1 Property

First sheet where the reference points to. Empty or null if the reference points to the same sheet.

Syntax

Namespace: FlexCel.Core

public String Sheet1 { get; set; }

See also

  • TTokenCellRange


TTokenCellRange.Sheet2 Property | FlexCel Studio for the .NET Framework documentation

TTokenCellRange.Sheet2 Property

Second sheet where the reference points to. Empty or null if the reference points to the same sheet.

Syntax

Namespace: FlexCel.Core

public String Sheet2 { get; set; }

See also

  • TTokenCellRange


TTokenCellRange.Row1 Property | FlexCel Studio for the .NET Framework documentation

TTokenCellRange.Row1 Property

First row of the range (1 based).

Syntax

Namespace: FlexCel.Core

public Int32 Row1 { get; set; }

See also

  • TTokenCellRange


TTokenCellRange.Col1 Property | FlexCel Studio for the .NET Framework documentation

TTokenCellRange.Col1 Property

First column of the range (1 based).

Syntax

Namespace: FlexCel.Core

public Int32 Col1 { get; set; }

See also

  • TTokenCellRange


TTokenCellRange.Row2 Property | FlexCel Studio for the .NET Framework documentation

TTokenCellRange.Row2 Property

Last row of the range (1 based).

Syntax

Namespace: FlexCel.Core

public Int32 Row2 { get; set; }

See also

  • TTokenCellRange


TTokenCellRange.Col2 Property | FlexCel Studio for the .NET Framework documentation

TTokenCellRange.Col2 Property

Last column of the range (1 based).

Syntax

Namespace: FlexCel.Core

public Int32 Col2 { get; set; }

See also

  • TTokenCellRange


TTokenCellRange.Row1Absolute Property | FlexCel Studio for the .NET Framework documentation

TTokenCellRange.Row1Absolute Property

True if the reference is absolute (as in $A$1).

Syntax

Namespace: FlexCel.Core

public Boolean Row1Absolute { get; set; }

See also

  • TTokenCellRange


TTokenCellRange.Col1Absolute Property | FlexCel Studio for the .NET Framework documentation

TTokenCellRange.Col1Absolute Property

True if the reference is absolute (as in $A$1).

Syntax

Namespace: FlexCel.Core

public Boolean Col1Absolute { get; set; }

See also

  • TTokenCellRange


TTokenCellRange.Row2Absolute Property | FlexCel Studio for the .NET Framework documentation

TTokenCellRange.Row2Absolute Property

True if the reference is absolute (as in $A$1).

Syntax

Namespace: FlexCel.Core

public Boolean Row2Absolute { get; set; }

See also

  • TTokenCellRange


TTokenCellRange.Col2Absolute Property | FlexCel Studio for the .NET Framework documentation

TTokenCellRange.Col2Absolute Property

True if the reference is absolute (as in $A$1).

Syntax

Namespace: FlexCel.Core

public Boolean Col2Absolute { get; set; }

See also

  • TTokenCellRange


TTokenData Class | FlexCel Studio for the .NET Framework documentation

TTokenData Class

Constant data, like "Hello" and 1 in the formula: "=IF(A1 = 1,,"Hello")"

Syntax

Namespace: FlexCel.Core

public class TTokenData: TToken

Constructors

Name | Description
TTokenData | Creates a new data token.

Properties

Name | Description
Data | Data represented by this token.


TTokenData.TTokenData Constructor | FlexCel Studio for the .NET Framework documentation

TTokenData.TTokenData Constructor

Creates a new data token.

Syntax

Namespace: FlexCel.Core

public TTokenData(Object aData)

Parameters

<-> | Parameter | Type | Description
 | aData | Object | Data.

See also

  • TTokenData


TTokenData.Data Property | FlexCel Studio for the .NET Framework documentation

TTokenData.Data Property

Data represented by this token.

Syntax

Namespace: FlexCel.Core

public Object Data { get; set; }

See also

  • TTokenData


TTokenDataArray Class | FlexCel Studio for the .NET Framework documentation

TTokenDataArray Class

Array of Constant data, like "Hello" and 1 in the formula: "=IF(A1 = 1,,"Hello")"

Syntax

Namespace: FlexCel.Core

public class TTokenDataArray: TToken

Constructors

Name | Description
TTokenDataArray | Creates a new data token.

Properties

Name | Description
Data | Data represented by this token.


TTokenDataArray.TTokenDataArray Constructor | FlexCel Studio for the .NET Framework documentation

TTokenDataArray.TTokenDataArray Constructor

Creates a new data token.

Syntax

Namespace: FlexCel.Core

public TTokenDataArray(Object[, ] aData)

Parameters

<-> | Parameter | Type | Description
 | aData | Object[, ] | Data.

See also

  • TTokenDataArray


TTokenDataArray.Data Property | FlexCel Studio for the .NET Framework documentation

TTokenDataArray.Data Property

Data represented by this token.

Syntax

Namespace: FlexCel.Core

public Object[, ] Data { get; set; }

See also

  • TTokenDataArray


TTokenFunction Class | FlexCel Studio for the .NET Framework documentation

TTokenFunction Class

A function like "Sum" or "If"

Syntax

Namespace: FlexCel.Core

public class TTokenFunction: TToken

Constructors

Name Description
TTokenFunction Overloaded
 TTokenFunction(String, Int32)
TTokenFunction(String, Int32, Boolean)

Properties

Name | Description
FunctionName | Name of the function represented by this token.
ArgumentCount | Number of arguments for this function. Note that if the function has a fixed number of arguments, this parameter is ignored.
IsUserDefined | If true, the function is used defined, not built-in in Excel. Note that some built-in functions from Excel 2003 like EOMonth, while available in Excel, are implemented as user-defined functions (they were available in ToolPacks like the Analysis ToolPack).


TTokenFunction.TTokenFunction Constructor | FlexCel Studio for the .NET Framework documentation

TTokenFunction.TTokenFunction Constructor

Overloads

  • TTokenFunction.TTokenFunction(String, Int32)
  • TTokenFunction.TTokenFunction(String, Int32, Boolean)

TTokenFunction.TTokenFunction(String, Int32)

Creates a new function token for internal (not user-defined) functions.

Syntax

Namespace: FlexCel.Core

public TTokenFunction(String aFunctionName, Int32 aArgumentCount)

Parameters

<-> | Parameter | Type | Description
 | aFunctionName | String | Name of the function.
 | aArgumentCount | Int32 | Number of arguments for this function. Note that if the function has a fixed number of arguments, this parameter is ignored.

See also

  • TTokenFunction

TTokenFunction.TTokenFunction(String, Int32, Boolean)

Creates a new function token. It can be an internal or an user-defined function.

Syntax

Namespace: FlexCel.Core

public TTokenFunction(String aFunctionName, Int32 aArgumentCount, Boolean aIsUserDefined)

Parameters

<-> | Parameter | Type | Description
 | aFunctionName | String | Name of the function.
 | aArgumentCount | Int32 | Number of arguments for this function. Note that if the function has a fixed number of arguments, this parameter is ignored.
 | aIsUserDefined | Boolean | If true, the function is used defined, not built-in in Excel. Note that some built-in functions from Excel 2003 like EOMonth, while available in Excel, are implemented as user-defined functions (they were available in ToolPacks like the Analysis ToolPack).

See also

  • TTokenFunction


TTokenFunction.FunctionName Property | FlexCel Studio for the .NET Framework documentation

TTokenFunction.FunctionName Property

Name of the function represented by this token.

Syntax

Namespace: FlexCel.Core

public String FunctionName { get; set; }

See also

  • TTokenFunction


TTokenFunction.ArgumentCount Property | FlexCel Studio for the .NET Framework documentation

TTokenFunction.ArgumentCount Property

Number of arguments for this function. Note that if the function has a fixed number of arguments, this parameter is ignored.

Syntax

Namespace: FlexCel.Core

public Int32 ArgumentCount { get; set; }

See also

  • TTokenFunction


TTokenFunction.IsUserDefined Property | FlexCel Studio for the .NET Framework documentation

TTokenFunction.IsUserDefined Property

If true, the function is used defined, not built-in in Excel. Note that some built-in functions from Excel 2003 like EOMonth, while available in Excel, are implemented as user-defined functions (they were available in ToolPacks like the Analysis ToolPack).

Syntax

Namespace: FlexCel.Core

public Boolean IsUserDefined { get; set; }

See also

  • TTokenFunction


TTokenLambdaCallName Class | FlexCel Studio for the .NET Framework documentation

TTokenLambdaCallName Class

This token is used when you call a name like "=MyName(5)" and MyName has a lambda function. Note that if a cell has the expression like "=Lambda(x,x)" then you will just get a simple TTokenFunction with a name of "Lambda". This token only appears when using a name as a user-defined function.

Syntax

Namespace: FlexCel.Core

public class TTokenLambdaCallName: TToken

Constructors

Name | Description
TTokenLambdaCallName | Creates a new TTokenLambdaCallName token.

Properties

Name | Description
ArgumentCount | The number of arguments for the function. The last argument is the Name to be called. For example the function "=MyName(4,3) will have 3 arguments: 4, 3, and the name MyName.


TTokenLambdaCallName.TTokenLambdaCallName Constructor | FlexCel Studio for the .NET Framework documentation

TTokenLambdaCallName.TTokenLambdaCallName Constructor

Creates a new TTokenLambdaCallName token.

Syntax

Namespace: FlexCel.Core

public TTokenLambdaCallName(Int32 aArgumentCount)

Parameters

<-> | Parameter | Type | Description
 | aArgumentCount | Int32 | The number of arguments for the function. The last argument is the Name to be called. For example the function "=MyName(4,3) will have 3 arguments: 4, 3, and the name MyName.

See also

  • TTokenLambdaCallName


TTokenLambdaCallName.ArgumentCount Property | FlexCel Studio for the .NET Framework documentation

TTokenLambdaCallName.ArgumentCount Property

The number of arguments for the function. The last argument is the Name to be called. For example the function "=MyName(4,3) will have 3 arguments: 4, 3, and the name MyName.

Syntax

Namespace: FlexCel.Core

public Int32 ArgumentCount { get; set; }

See also

  • TTokenLambdaCallName


TTokenLambdaParameterDefinition Class | FlexCel Studio for the .NET Framework documentation

TTokenLambdaParameterDefinition Class

A parameter definition in the expression of a =LET or =LAMBDA function, like the first x in the formula: "=LET(x,3,x+3)"

Syntax

Namespace: FlexCel.Core

public class TTokenLambdaParameterDefinition: TToken

Constructors

Name | Description
TTokenLambda​Parameter​Definition | Creates a new parameter reference token.

Properties

Name | Description
ParameterName | Name of the parameter.
IsOptional | Returns true if the parameter is optional.


TTokenLambdaParameterDefinition.TTokenLambdaParameterDefinition Constructor | FlexCel Studio for the .NET Framework documentation

TTokenLambdaParameterDefinition.TTokenLambdaParameterDefinition Constructor

Creates a new parameter reference token.

Syntax

Namespace: FlexCel.Core

public TTokenLambdaParameterDefinition(String aParameterName, Boolean aIsOptional)

Parameters

<-> | Parameter | Type | Description
 | aParameterName | String | Parameter name.
 | aIsOptional | Boolean | True if the parameter is optional.

See also

  • TTokenLambdaParameterDefinition


TTokenLambdaParameterDefinition.ParameterName Property | FlexCel Studio for the .NET Framework documentation

TTokenLambdaParameterDefinition.ParameterName Property

Name of the parameter.

Syntax

Namespace: FlexCel.Core

public String ParameterName { get; set; }

See also

  • TTokenLambdaParameterDefinition


TTokenLambdaParameterDefinition.IsOptional Property | FlexCel Studio for the .NET Framework documentation

TTokenLambdaParameterDefinition.IsOptional Property

Returns true if the parameter is optional.

Syntax

Namespace: FlexCel.Core

public Boolean IsOptional { get; set; }

See also

  • TTokenLambdaParameterDefinition


TTokenLambdaParameterReference Class | FlexCel Studio for the .NET Framework documentation

TTokenLambdaParameterReference Class

A parameter reference in the expression of a =LET or =LAMBDA function, like the second x in the formula: "=LET(x,3,x+3)"

Syntax

Namespace: FlexCel.Core

public class TTokenLambdaParameterReference: TToken

Constructors

Name | Description
TTokenLambda​Parameter​Reference | Creates a new parameter reference token.

Properties

Name | Description
ParameterName | Name of the parameter.


TTokenLambdaParameterReference.TTokenLambdaParameterReference Constructor | FlexCel Studio for the .NET Framework documentation

TTokenLambdaParameterReference.TTokenLambdaParameterReference Constructor

Creates a new parameter reference token.

Syntax

Namespace: FlexCel.Core

public TTokenLambdaParameterReference(String aParameterName)

Parameters

<-> | Parameter | Type | Description
 | aParameterName | String | Parameter name.

See also

  • TTokenLambdaParameterReference


TTokenLambdaParameterReference.ParameterName Property | FlexCel Studio for the .NET Framework documentation

TTokenLambdaParameterReference.ParameterName Property

Name of the parameter.

Syntax

Namespace: FlexCel.Core

public String ParameterName { get; set; }

See also

  • TTokenLambdaParameterReference


TTokenList Class | FlexCel Studio for the .NET Framework documentation

TTokenList Class

A list of tokens which create a formula.

Syntax

Namespace: FlexCel.Core

public class TTokenList: IEnumerable<TToken>

Constructors

Name | Description
TTokenList | Overloaded TTokenList TTokenList(Int32)

Methods

Name | Description
Add | Adds a new token to the end of the list.
Clear | Removes all tokens from the list.
Insert | Inserts a specific token into the list at a given position (0 based).
RemoveAt | Removes the token at index.
GetEnumerator | Returns the enumerator for the class.

Properties

Name | Description
Count | The number of tokens in the list.
this[] | Gets or sets the token at the given index.
IsArrayFormula | If true, the tokens in this list refer to an array formula.
Span | This property only applies if IsArrayFormula is true. It has the range for the array formula.


TTokenList.TTokenList Constructor | FlexCel Studio for the .NET Framework documentation

TTokenList.TTokenList Constructor

Overloads

  • TTokenList.TTokenList
  • TTokenList.TTokenList(Int32)

TTokenList.TTokenList

Creates an empty list with default capacity.

Syntax

Namespace: FlexCel.Core

public TTokenList()

See also

  • TTokenList

TTokenList.TTokenList(Int32)

Creates an empty list with a given capacity.

Syntax

Namespace: FlexCel.Core

public TTokenList(Int32 capacity)

Parameters

<-> | Parameter | Type | Description
 | capacity | Int32 | The number of element the list can initially store.

See also

  • TTokenList


TTokenList.Add Method | FlexCel Studio for the .NET Framework documentation

TTokenList.Add Method

Adds a new token to the end of the list.

Syntax

Namespace: FlexCel.Core

public void Add(TToken token)

Parameters

<-> | Parameter | Type | Description
 | token | TToken | Token to add.

See also

  • TTokenList


TTokenList.Clear Method | FlexCel Studio for the .NET Framework documentation

TTokenList.Clear Method

Removes all tokens from the list.

Syntax

Namespace: FlexCel.Core

public void Clear()

See also

  • TTokenList


TTokenList.Insert Method | FlexCel Studio for the .NET Framework documentation

TTokenList.Insert Method

Inserts a specific token into the list at a given position (0 based).

Syntax

Namespace: FlexCel.Core

public void Insert(Int32 index, TToken token)

Parameters

<-> | Parameter | Type | Description
 | index | Int32 | Zero based index where the token should be inserted.
 | token | TToken | Token to insert.

See also

  • TTokenList


TTokenList.RemoveAt Method | FlexCel Studio for the .NET Framework documentation

TTokenList.RemoveAt Method

Removes the token at index.

Syntax

Namespace: FlexCel.Core

public void RemoveAt(Int32 index)

Parameters

<-> | Parameter | Type | Description
 | index | Int32 | Zero based index of the token that should be removed.

See also

  • TTokenList


TTokenList.GetEnumerator Method | FlexCel Studio for the .NET Framework documentation

TTokenList.GetEnumerator Method

Returns the enumerator for the class.

Syntax

Namespace: FlexCel.Core

public IEnumerator<TToken> GetEnumerator()

See also

  • TTokenList


TTokenList.Count Property | FlexCel Studio for the .NET Framework documentation

TTokenList.Count Property

The number of tokens in the list.

Syntax

Namespace: FlexCel.Core

public Int32 Count { get; }

See also

  • TTokenList


TTokenList.this[] Property | FlexCel Studio for the .NET Framework documentation

TTokenList.this[] Property

Gets or sets the token at the given index.

Syntax

Namespace: FlexCel.Core

public TToken this[] { get; set; }

See also

  • TTokenList


TTokenList.IsArrayFormula Property | FlexCel Studio for the .NET Framework documentation

TTokenList.IsArrayFormula Property

If true, the tokens in this list refer to an array formula.

Syntax

Namespace: FlexCel.Core

public Boolean IsArrayFormula { get; set; }

See also

  • TTokenList


TTokenList.Span Property | FlexCel Studio for the .NET Framework documentation

TTokenList.Span Property

This property only applies if IsArrayFormula is true. It has the range for the array formula.

Syntax

Namespace: FlexCel.Core

public TFormulaSpan Span { get; set; }

See also

  • TTokenList


TTokenMissingArgument Class | FlexCel Studio for the .NET Framework documentation

TTokenMissingArgument Class

A missing argument for a function. For example the second parameter in the formula: "=IF(A1 = 1,,"Hello")"

Syntax

Namespace: FlexCel.Core

public class TTokenMissingArgument: TToken

Constructors

Name | Description
TTokenMissing​Argument | Creates a new Missing argument token.


TTokenMissingArgument.TTokenMissingArgument Constructor | FlexCel Studio for the .NET Framework documentation

TTokenMissingArgument.TTokenMissingArgument Constructor

Creates a new Missing argument token.

Syntax

Namespace: FlexCel.Core

public TTokenMissingArgument()

See also

  • TTokenMissingArgument


TTokenName Class | FlexCel Studio for the .NET Framework documentation

TTokenName Class

A named range. Might refer to a name in a different file.

Syntax

Namespace: FlexCel.Core

public class TTokenName: TToken

Constructors

Name | Description
TTokenName | Creates a new name token.

Properties

Name | Description
Name | Named range represented by this token.
Sheet | Sheet where the name is stored. Make it null or empty if the name is a global name.
WorkbookName | Workbook where the name is, if this is an external name. If then name is in the same file as the reference, this value will be null or empty.


TTokenName.TTokenName Constructor | FlexCel Studio for the .NET Framework documentation

TTokenName.TTokenName Constructor

Creates a new name token.

Syntax

Namespace: FlexCel.Core

public TTokenName(String aName, String aWorkbookName, String aSheet)

Parameters

<-> | Parameter | Type | Description
 | aName | String | Named range.
 | aWorkbookName | String | Workbook where the name is, if this is an external name. If the name is in the same file as the reference, this value will be null or empty.
 | aSheet | String | Sheet where the name is stored. Make it null or empty if the name is a global name.

See also

  • TTokenName


TTokenName.Name Property | FlexCel Studio for the .NET Framework documentation

TTokenName.Name Property

Named range represented by this token.

Syntax

Namespace: FlexCel.Core

public String Name { get; set; }

See also

  • TTokenName


TTokenName.Sheet Property | FlexCel Studio for the .NET Framework documentation

TTokenName.Sheet Property

Sheet where the name is stored. Make it null or empty if the name is a global name.

Syntax

Namespace: FlexCel.Core

public String Sheet { get; set; }

See also

  • TTokenName


TTokenName.WorkbookName Property | FlexCel Studio for the .NET Framework documentation

TTokenName.WorkbookName Property

Workbook where the name is, if this is an external name. If then name is in the same file as the reference, this value will be null or empty.

Syntax

Namespace: FlexCel.Core

public String WorkbookName { get; set; }

See also

  • TTokenName


TTokenOperator Class | FlexCel Studio for the .NET Framework documentation

TTokenOperator Class

An operator like "+" or "-"

Syntax

Namespace: FlexCel.Core

public class TTokenOperator: TToken

Constructors

Name | Description
TTokenOperator | Creates a new operator token.

Properties

Name | Description
Operator | Operator represented by this token.


TTokenOperator.TTokenOperator Constructor | FlexCel Studio for the .NET Framework documentation

TTokenOperator.TTokenOperator Constructor

Creates a new operator token.

Syntax

Namespace: FlexCel.Core

public TTokenOperator(TOperator aOperator)

Parameters

<-> | Parameter | Type | Description
 | aOperator | TOperator | Type of operator.

See also

  • TTokenOperator


TTokenOperator.Operator Property | FlexCel Studio for the .NET Framework documentation

TTokenOperator.Operator Property

Operator represented by this token.

Syntax

Namespace: FlexCel.Core

public TOperator Operator { get; set; }

See also

  • TTokenOperator


TTokenParenthesis Class | FlexCel Studio for the .NET Framework documentation

TTokenParenthesis Class

A parenthesis surrounding the last token. Note that this token is not used in the formula (since RPN doesn't need parenthesis) but it is there so Excel can display them.

Syntax

Namespace: FlexCel.Core

public class TTokenParenthesis: TToken

Constructors

Name | Description
TTokenParenthesis | Creates a new parenthesis token.


TTokenParenthesis.TTokenParenthesis Constructor | FlexCel Studio for the .NET Framework documentation

TTokenParenthesis.TTokenParenthesis Constructor

Creates a new parenthesis token.

Syntax

Namespace: FlexCel.Core

public TTokenParenthesis()

See also

  • TTokenParenthesis


TTokenRangeOp Class | FlexCel Studio for the .NET Framework documentation

TTokenRangeOp Class

An operator that operates in ranges, like union or intersection.

Syntax

Namespace: FlexCel.Core

public class TTokenRangeOp: TToken

Constructors

Name | Description
TTokenRangeOp | Creates a new range operator token.

Properties

Name | Description
Operator | Operator represented by this token.


TTokenRangeOp.TTokenRangeOp Constructor | FlexCel Studio for the .NET Framework documentation

TTokenRangeOp.TTokenRangeOp Constructor

Creates a new range operator token.

Syntax

Namespace: FlexCel.Core

public TTokenRangeOp(TRangeOp aOperator)

Parameters

<-> | Parameter | Type | Description
 | aOperator | TRangeOp | Type of operator.

See also

  • TTokenRangeOp


TTokenRangeOp.Operator Property | FlexCel Studio for the .NET Framework documentation

TTokenRangeOp.Operator Property

Operator represented by this token.

Syntax

Namespace: FlexCel.Core

public TRangeOp Operator { get; set; }

See also

  • TTokenRangeOp


TTokenReferenceError Class | FlexCel Studio for the .NET Framework documentation

TTokenReferenceError Class

This token represents an error like #REF!

Syntax

Namespace: FlexCel.Core

public class TTokenReferenceError: TToken

Constructors

Name | Description
TTokenReferenceError | Creates a new TTokenError instance with the corresponding error type.

Properties

Name | Description
IsArea | Returns true if this is a reference to an area of cells.
Is3D | Returns true if this is a reference to multiple sheets.
IsRelative | If true this reference is relative to the cell where the formula is.


TTokenReferenceError.TTokenReferenceError Constructor | FlexCel Studio for the .NET Framework documentation

TTokenReferenceError.TTokenReferenceError Constructor

Creates a new TTokenError instance with the corresponding error type.

Syntax

Namespace: FlexCel.Core

public TTokenReferenceError(Boolean aIsArea, Boolean aIs3D, Boolean aIsRelative)

Parameters

<-> | Parameter | Type | Description
 | aIsArea | Boolean | If true this is a reference to an area, else to a cell.
 | aIs3D | Boolean | If true this is a 3d reference, else it is a normal 2D reference.
 | aIsRelative | Boolean | If true this reference is relative to the cell where the formula is.

See also

  • TTokenReferenceError


TTokenReferenceError.IsArea Property | FlexCel Studio for the .NET Framework documentation

TTokenReferenceError.IsArea Property

Returns true if this is a reference to an area of cells.

Syntax

Namespace: FlexCel.Core

public Boolean IsArea { get; set; }

See also

  • TTokenReferenceError


TTokenReferenceError.Is3D Property | FlexCel Studio for the .NET Framework documentation

TTokenReferenceError.Is3D Property

Returns true if this is a reference to multiple sheets.

Syntax

Namespace: FlexCel.Core

public Boolean Is3D { get; set; }

See also

  • TTokenReferenceError


TTokenReferenceError.IsRelative Property | FlexCel Studio for the .NET Framework documentation

TTokenReferenceError.IsRelative Property

If true this reference is relative to the cell where the formula is.

Syntax

Namespace: FlexCel.Core

public Boolean IsRelative { get; set; }

See also

  • TTokenReferenceError


TTokenRelativeCellAddress Class | FlexCel Studio for the .NET Framework documentation

TTokenRelativeCellAddress Class

A single cell address in the same sheet or to other sheet. It handles a reference relative to the current cell. So a reference in Cell A4 of RowOffset = -1 and ColOffset = 3 would mean the cell D3.

Syntax

Namespace: FlexCel.Core

public class TTokenRelativeCellAddress: TToken

Constructors

Name | Description
TTokenRelative​Cell​Address | Creates a new relative cell address token.

Properties

Name | Description
RowOffset | The number of rows after or before the current row. It might be negative.
ColOffset | The number of columns after or before the current column. It might be negative.
ExternalBookName | File where the reference points to, when this is a reference to other file. Empty or null if the reference is to the same file.
Sheet | Sheet where the reference points to. Empty or null if the reference points to the same sheet.


TTokenRelativeCellAddress.TTokenRelativeCellAddress Constructor | FlexCel Studio for the .NET Framework documentation

TTokenRelativeCellAddress.TTokenRelativeCellAddress Constructor

Creates a new relative cell address token.

Syntax

Namespace: FlexCel.Core

public TTokenRelativeCellAddress(String aExternalBookName, String aSheet, Int32 aRowOffset, Int32 aColOffset)

Parameters

<-> | Parameter | Type | Description
 | aExternalBookName | String | File where the reference points to, when this is a reference to other file. Empty or null if the reference is to the same file.
 | aSheet | String | Sheet where the reference points to. Empty or null if the reference points to the same sheet.
 | aRowOffset | Int32 | The number of rows after or before the current row. It might be negative.
 | aColOffset | Int32 | The number of columns after or before the current column. It might be negative.

See also

  • TTokenRelativeCellAddress


TTokenRelativeCellAddress.RowOffset Property | FlexCel Studio for the .NET Framework documentation

TTokenRelativeCellAddress.RowOffset Property

The number of rows after or before the current row. It might be negative.

Syntax

Namespace: FlexCel.Core

public Int32 RowOffset { get; set; }

See also

  • TTokenRelativeCellAddress


TTokenRelativeCellAddress.ColOffset Property | FlexCel Studio for the .NET Framework documentation

TTokenRelativeCellAddress.ColOffset Property

The number of columns after or before the current column. It might be negative.

Syntax

Namespace: FlexCel.Core

public Int32 ColOffset { get; set; }

See also

  • TTokenRelativeCellAddress


TTokenRelativeCellAddress.ExternalBookName Property | FlexCel Studio for the .NET Framework documentation

TTokenRelativeCellAddress.ExternalBookName Property

File where the reference points to, when this is a reference to other file. Empty or null if the reference is to the same file.

Syntax

Namespace: FlexCel.Core

public String ExternalBookName { get; set; }

See also

  • TTokenRelativeCellAddress


TTokenRelativeCellAddress.Sheet Property | FlexCel Studio for the .NET Framework documentation

TTokenRelativeCellAddress.Sheet Property

Sheet where the reference points to. Empty or null if the reference points to the same sheet.

Syntax

Namespace: FlexCel.Core

public String Sheet { get; set; }

See also

  • TTokenRelativeCellAddress


TTokenRelativeCellRange Class | FlexCel Studio for the .NET Framework documentation

TTokenRelativeCellRange Class

A range of cells with relative references. This is used mostly in named ranges.

Syntax

Namespace: FlexCel.Core

public class TTokenRelativeCellRange: TToken

Constructors

Name | Description
TTokenRelative​Cell​Range | Creates a new relative cell range token.

Properties

Name | Description
ExternalBookName | File where the reference points to, when this is a reference to other file. Empty or null if the reference is to the same file.
Sheet1 | First sheet where the reference points to. Empty or null if the reference points to the same sheet.
Sheet2 | Second sheet where the reference points to. Empty or null if the reference points to the same sheet.
RowOffset1 | First row of the range (1 based).
ColOffset1 | First column of the range (1 based).
RowOffset2 | Last row of the range (1 based).
ColOffset2 | Last column of the range (1 based).


TTokenRelativeCellRange.TTokenRelativeCellRange Constructor | FlexCel Studio for the .NET Framework documentation

TTokenRelativeCellRange.TTokenRelativeCellRange Constructor

Creates a new relative cell range token.

Syntax

Namespace: FlexCel.Core

public TTokenRelativeCellRange(String aExternalBookName, String aSheet1, String aSheet2, Int32 aRowOffset1, Int32 aColOffset1, Int32 aRowOffset2, Int32 aColOffset2)

Parameters

<-> | Parameter | Type | Description
 | aExternalBookName | String | File where the reference points to, when this is a reference to other file. Empty or null if the reference is to the same file.
 | aSheet1 | String | First sheet where the reference points to. Empty or null if the reference points to the same sheet.
 | aSheet2 | String | Second where the reference points to. Empty or null if the reference points to the same sheet.
 | aRowOffset1 | Int32 | First row (1 based).
 | aColOffset1 | Int32 | First column (1 based).
 | aRowOffset2 | Int32 | Last row (1 based).
 | aColOffset2 | Int32 | Last column (1 based).

See also

  • TTokenRelativeCellRange


TTokenRelativeCellRange.ExternalBookName Property | FlexCel Studio for the .NET Framework documentation

TTokenRelativeCellRange.ExternalBookName Property

File where the reference points to, when this is a reference to other file. Empty or null if the reference is to the same file.

Syntax

Namespace: FlexCel.Core

public String ExternalBookName { get; set; }

See also

  • TTokenRelativeCellRange


TTokenRelativeCellRange.Sheet1 Property | FlexCel Studio for the .NET Framework documentation

TTokenRelativeCellRange.Sheet1 Property

First sheet where the reference points to. Empty or null if the reference points to the same sheet.

Syntax

Namespace: FlexCel.Core

public String Sheet1 { get; set; }

See also

  • TTokenRelativeCellRange


TTokenRelativeCellRange.Sheet2 Property | FlexCel Studio for the .NET Framework documentation

TTokenRelativeCellRange.Sheet2 Property

Second sheet where the reference points to. Empty or null if the reference points to the same sheet.

Syntax

Namespace: FlexCel.Core

public String Sheet2 { get; set; }

See also

  • TTokenRelativeCellRange


TTokenRelativeCellRange.RowOffset1 Property | FlexCel Studio for the .NET Framework documentation

TTokenRelativeCellRange.RowOffset1 Property

First row of the range (1 based).

Syntax

Namespace: FlexCel.Core

public Int32 RowOffset1 { get; set; }

See also

  • TTokenRelativeCellRange


TTokenRelativeCellRange.ColOffset1 Property | FlexCel Studio for the .NET Framework documentation

TTokenRelativeCellRange.ColOffset1 Property

First column of the range (1 based).

Syntax

Namespace: FlexCel.Core

public Int32 ColOffset1 { get; set; }

See also

  • TTokenRelativeCellRange


TTokenRelativeCellRange.RowOffset2 Property | FlexCel Studio for the .NET Framework documentation

TTokenRelativeCellRange.RowOffset2 Property

Last row of the range (1 based).

Syntax

Namespace: FlexCel.Core

public Int32 RowOffset2 { get; set; }

See also

  • TTokenRelativeCellRange


TTokenRelativeCellRange.ColOffset2 Property | FlexCel Studio for the .NET Framework documentation

TTokenRelativeCellRange.ColOffset2 Property

Last column of the range (1 based).

Syntax

Namespace: FlexCel.Core

public Int32 ColOffset2 { get; set; }

See also

  • TTokenRelativeCellRange


TTokenStructuredReference Class | FlexCel Studio for the .NET Framework documentation

TTokenStructuredReference Class

A reference for a cell in a table. For example the reference in the formula =SUM(Table1[[#All],[SomeColumn]])

Syntax

Namespace: FlexCel.Core

public class TTokenStructuredReference: TToken

Constructors

Name | Description
TTokenStructured​Reference | Creates a new Structured Reference argument token.

Properties

Name | Description
WorkbookName | Name of the file where the referenced table is. If this value is empty, then the table is in the same file as the reference.
TableName | Table that used by this reference.
Sections | The sections of the table where this reference applies.
FirstColumn | First column where the reference applies. Set it to empty if the reference applies to the whole table.
LastColumn | Last column where the reference applies. If empty and FirstColumn is empty too, then the reference applies to the whole table. If empty but FirstColumn is not empty, then this reference applies only to FirstColumn.
SpaceAfterComma | If true, the text of the structured reference arguments will include a space after every comma separating arguments.
SpaceAfterBrackets | If true, the text of the structure reference will include a space after the brackets which define the arguments.


TTokenStructuredReference.TTokenStructuredReference Constructor | FlexCel Studio for the .NET Framework documentation

TTokenStructuredReference.TTokenStructuredReference Constructor

Creates a new Structured Reference argument token.

Syntax

Namespace: FlexCel.Core

public TTokenStructuredReference(String aWorkbookName, String aTableName, TStructRefSection aSections, String aFirstColumn, String aLastColumn, Boolean aSpaceAfterComma, Boolean aSpaceAfterBrackets)

Parameters

<-> | Parameter | Type | Description
 | aWorkbookName | String | Name of the file where the referenced table is. If this value is empty, then the table is in the same file as the reference.
 | aTableName | String | Name of the table where this reference applies.
 | aSections | TStructRefSection | Sections of the table where the reference applies.
 | aFirstColumn | String | First column where the reference applies. Set it to empty if the reference applies to the whole table.
 | aLastColumn | String | Last column where the reference applies. If empty and FirstColumn is empty too, then the reference applies to the whole table. If empty but FirstColumn is not empty, then this reference applies only to FirstColumn.
 | aSpaceAfterComma | Boolean | If true, the text of the structured reference arguments will include a space after every comma separating arguments.
 | aSpaceAfterBrackets | Boolean | If true, the text of the structure reference will include a space after the brackets which define the arguments.

See also

  • TTokenStructuredReference


TTokenStructuredReference.WorkbookName Property | FlexCel Studio for the .NET Framework documentation

TTokenStructuredReference.WorkbookName Property

Name of the file where the referenced table is. If this value is empty, then the table is in the same file as the reference.

Syntax

Namespace: FlexCel.Core

public String WorkbookName { get; set; }

See also

  • TTokenStructuredReference


TTokenStructuredReference.TableName Property | FlexCel Studio for the .NET Framework documentation

TTokenStructuredReference.TableName Property

Table that used by this reference.

Syntax

Namespace: FlexCel.Core

public String TableName { get; set; }

See also

  • TTokenStructuredReference


TTokenStructuredReference.Sections Property | FlexCel Studio for the .NET Framework documentation

TTokenStructuredReference.Sections Property

The sections of the table where this reference applies.

Syntax

Namespace: FlexCel.Core

public TStructRefSection Sections { get; set; }

See also

  • TTokenStructuredReference


TTokenStructuredReference.FirstColumn Property | FlexCel Studio for the .NET Framework documentation

TTokenStructuredReference.FirstColumn Property

First column where the reference applies. Set it to empty if the reference applies to the whole table.

Syntax

Namespace: FlexCel.Core

public String FirstColumn { get; set; }

See also

  • TTokenStructuredReference


TTokenStructuredReference.LastColumn Property | FlexCel Studio for the .NET Framework documentation

TTokenStructuredReference.LastColumn Property

Last column where the reference applies. If empty and FirstColumn is empty too, then the reference applies to the whole table. If empty but FirstColumn is not empty, then this reference applies only to FirstColumn.

Syntax

Namespace: FlexCel.Core

public String LastColumn { get; set; }

See also

  • TTokenStructuredReference


TTokenStructuredReference.SpaceAfterComma Property | FlexCel Studio for the .NET Framework documentation

TTokenStructuredReference.SpaceAfterComma Property

If true, the text of the structured reference arguments will include a space after every comma separating arguments.

Syntax

Namespace: FlexCel.Core

public Boolean SpaceAfterComma { get; set; }

See also

  • TTokenStructuredReference


TTokenStructuredReference.SpaceAfterBrackets Property | FlexCel Studio for the .NET Framework documentation

TTokenStructuredReference.SpaceAfterBrackets Property

If true, the text of the structure reference will include a space after the brackets which define the arguments.

Syntax

Namespace: FlexCel.Core

public Boolean SpaceAfterBrackets { get; set; }

See also

  • TTokenStructuredReference


TTokenUnsupported Class | FlexCel Studio for the .NET Framework documentation

TTokenUnsupported Class

This token is not supported by FlexCel.

Syntax

Namespace: FlexCel.Core

public class TTokenUnsupported: TToken

Constructors

Name | Description
TTokenUnsupported | Creates a new unsupported token.


TTokenUnsupported.TTokenUnsupported Constructor | FlexCel Studio for the .NET Framework documentation

TTokenUnsupported.TTokenUnsupported Constructor

Creates a new unsupported token.

Syntax

Namespace: FlexCel.Core

public TTokenUnsupported()

See also

  • TTokenUnsupported


TTokenWhitespace Class | FlexCel Studio for the .NET Framework documentation

TTokenWhitespace Class

Whitespace like " ". This is not used in calculation, but it is use by Excel to show the formula as it was entered.

Syntax

Namespace: FlexCel.Core

public class TTokenWhitespace: TToken

Constructors

Name | Description
TTokenWhitespace | Creates a new whitespace token.

Properties

Name | Description
WhitespaceCount | Number of whitespace characters in this token.
Character | Character used in the whitespace.
Position | Position of the whitespace.


TTokenWhitespace.TTokenWhitespace Constructor | FlexCel Studio for the .NET Framework documentation

TTokenWhitespace.TTokenWhitespace Constructor

Creates a new whitespace token.

Syntax

Namespace: FlexCel.Core

public TTokenWhitespace(Int32 aWhitespaceCount, TTokenWhitespaceCharacter aCharacter, TTokenWhitespacePosition aPosition)

Parameters

<-> | Parameter | Type | Description
 | aWhitespaceCount | Int32 | Whitespace in the formula.
 | aCharacter | TTokenWhitespace​Character | Defines the character used in the whitespace.
 | aPosition | TTokenWhitespace​Position | Position for the whitespace respect to the next token.

See also

  • TTokenWhitespace


TTokenWhitespace.WhitespaceCount Property | FlexCel Studio for the .NET Framework documentation

TTokenWhitespace.WhitespaceCount Property

Number of whitespace characters in this token.

Syntax

Namespace: FlexCel.Core

public Int32 WhitespaceCount { get; set; }

See also

  • TTokenWhitespace


TTokenWhitespace.Character Property | FlexCel Studio for the .NET Framework documentation

TTokenWhitespace.Character Property

Character used in the whitespace.

Syntax

Namespace: FlexCel.Core

public TTokenWhitespaceCharacter Character { get; set; }

See also

  • TTokenWhitespace


TTokenWhitespace.Position Property | FlexCel Studio for the .NET Framework documentation

TTokenWhitespace.Position Property

Position of the whitespace.

Syntax

Namespace: FlexCel.Core

public TTokenWhitespacePosition Position { get; set; }

See also

  • TTokenWhitespace


TUdfEventArgs Class | FlexCel Studio for the .NET Framework documentation

TUdfEventArgs Class

Encapsulates the parameters to send to a user Defined Function for evaluation.

Syntax

Namespace: FlexCel.Core

public class TUdfEventArgs

Constructors

Name | Description
TUdfEventArgs | Creates a new instance.

Properties

Name | Description
Xls | ExcelFile that has the formula being evaluated. You might change its ActiveSheet property inside this method and there is no need to restore it back.
Sheet | Index of the sheet where the formula is located. This value only has meaning when evaluating formulas in cells. (Not when for example evaluating formulas inside named ranges)
Row | Row index where the formula is located. This value only has meaning when evaluating formulas in cells. (Not when for example evaluating formulas inside named ranges)
Col | Column index where the formula is located. This value only has meaning when evaluating formulas in cells. (Not when for example evaluating formulas inside named ranges)


TUdfEventArgs.TUdfEventArgs Constructor | FlexCel Studio for the .NET Framework documentation

TUdfEventArgs.TUdfEventArgs Constructor

Creates a new instance.

Syntax

Namespace: FlexCel.Core

public TUdfEventArgs(ExcelFile aXls, Int32 aSheet, Int32 aRow, Int32 aCol)

Parameters

<-> | Parameter | Type | Description
 | aXls | ExcelFile | See Xls
 | aSheet | Int32 | See Sheet
 | aRow | Int32 | See Row
 | aCol | Int32 | See Col

See also

  • TUdfEventArgs


TUdfEventArgs.Xls Property | FlexCel Studio for the .NET Framework documentation

TUdfEventArgs.Xls Property

ExcelFile that has the formula being evaluated. You might change its ActiveSheet property inside this method and there is no need to restore it back.

Syntax

Namespace: FlexCel.Core

public ExcelFile Xls { get; }

See also

  • TUdfEventArgs


TUdfEventArgs.Sheet Property | FlexCel Studio for the .NET Framework documentation

TUdfEventArgs.Sheet Property

Index of the sheet where the formula is located. This value only has meaning when evaluating formulas in cells. (Not when for example evaluating formulas inside named ranges)

Syntax

Namespace: FlexCel.Core

public Int32 Sheet { get; }

See also

  • TUdfEventArgs


TUdfEventArgs.Row Property | FlexCel Studio for the .NET Framework documentation

TUdfEventArgs.Row Property

Row index where the formula is located. This value only has meaning when evaluating formulas in cells. (Not when for example evaluating formulas inside named ranges)

Syntax

Namespace: FlexCel.Core

public Int32 Row { get; }

See also

  • TUdfEventArgs


TUdfEventArgs.Col Property | FlexCel Studio for the .NET Framework documentation

TUdfEventArgs.Col Property

Column index where the formula is located. This value only has meaning when evaluating formulas in cells. (Not when for example evaluating formulas inside named ranges)

Syntax

Namespace: FlexCel.Core

public Int32 Col { get; }

See also

  • TUdfEventArgs


TUIBrush Class | FlexCel Studio for the .NET Framework documentation

TUIBrush Class

A base brush for painting.

Syntax

Namespace: FlexCel.Core

public abstract class TUIBrush: IDisposable

Methods

Name | Description
Dispose | Overloaded Dispose Dispose(Boolean)

Operators

Name | Description
Implicit Conversion | Creates a UIBrush from a given System.​Drawing.​Brush. Important: When you do an implicit conversion, the TUIBrush will take ownership of the brush, and the original System.​Drawing.​Brush will be disposed when you dispose this class.


TUIBrush.Dispose Method | FlexCel Studio for the .NET Framework documentation

TUIBrush.Dispose Method

Overloads

  • TUIBrush.Dispose
  • TUIBrush.Dispose(Boolean)

TUIBrush.Dispose

Disposes this instance.

Syntax

Namespace: FlexCel.Core

public void Dispose()

See also

  • TUIBrush

TUIBrush.Dispose(Boolean)

Override this method to dispose your own objects in your descending classes.

Syntax

Namespace: FlexCel.Core

protected virtual void Dispose(Boolean disposing)

Parameters

<-> | Parameter | Type | Description
 | disposing | Boolean | If true, this is a direct call to Dispose(), and you need to dispose both managed and unmanaged resources. If false, this is called by the finalizer, and you only need to release unmanaged resources.

See also

  • TUIBrush


TUIBrush Implicit Conversion Operator | FlexCel Studio for the .NET Framework documentation

TUIBrush Implicit Conversion Operator

Creates a UIBrush from a given System.Drawing.Brush. Important: When you do an implicit conversion, the TUIBrush will take ownership of the brush, and the original System.Drawing.Brush will be disposed when you dispose this class.

Syntax

Namespace: FlexCel.Core

public static TUIBrush op_Implicit(Brush br)

Parameters

<-> | Parameter | Type | Description
 | br | Brush |

See also

  • TUIBrush


TUIColorBlend Class | FlexCel Studio for the .NET Framework documentation

TUIColorBlend Class

Defines a complex gradient by using an array of TUIGradientStop

Syntax

Namespace: FlexCel.Core

public class TUIColorBlend

Constructors

Name | Description
TUIColorBlend | Creates a color blend with n stops.

Methods

Name | Description
EnsureMinimum​AndMaximum | Makes sure the blend has at least 2 stops, one at position 0 and the other at position 1.
InvertColorBlend | Reverts the color blend, moving the stop at position 0 to 1, the stop at 1 to 0, and mirroring all other stops in the middle.
SortAscending | Sorts the gradient stops from the lowest position to the largest.
HasInterpolation​Colors | Returns false if the gradient has only 2 colors: one at the start and one at the end.

Properties

Name | Description
Count | Number of gradient stops in the blend definition.
this[] | Returns a particular stop in the blend.


TUIColorBlend.TUIColorBlend Constructor | FlexCel Studio for the .NET Framework documentation

TUIColorBlend.TUIColorBlend Constructor

Creates a color blend with n stops.

Syntax

Namespace: FlexCel.Core

public TUIColorBlend(Int32 aCount)

Parameters

<-> | Parameter | Type | Description
 | aCount | Int32 | Number of gradient stops in the blend definition.

See also

  • TUIColorBlend


TUIColorBlend.EnsureMinimumAndMaximum Method | FlexCel Studio for the .NET Framework documentation

TUIColorBlend.EnsureMinimumAndMaximum Method

Makes sure the blend has at least 2 stops, one at position 0 and the other at position 1.

Syntax

Namespace: FlexCel.Core

public void EnsureMinimumAndMaximum(TUIColor Color1, TUIColor Color2)

Parameters

<-> | Parameter | Type | Description
 | Color1 | TUIColor | Color for stop at position 0 if it doesn't exist.
 | Color2 | TUIColor | Color for stop at position 1 if it doesn't exist.

See also

  • TUIColorBlend


TUIColorBlend.InvertColorBlend Method | FlexCel Studio for the .NET Framework documentation

TUIColorBlend.InvertColorBlend Method

Reverts the color blend, moving the stop at position 0 to 1, the stop at 1 to 0, and mirroring all other stops in the middle.

Syntax

Namespace: FlexCel.Core

public void InvertColorBlend()

See also

  • TUIColorBlend


TUIColorBlend.SortAscending Method | FlexCel Studio for the .NET Framework documentation

TUIColorBlend.SortAscending Method

Sorts the gradient stops from the lowest position to the largest.

Syntax

Namespace: FlexCel.Core

public void SortAscending()

See also

  • TUIColorBlend


TUIColorBlend.HasInterpolationColors Method | FlexCel Studio for the .NET Framework documentation

TUIColorBlend.HasInterpolationColors Method

Returns false if the gradient has only 2 colors: one at the start and one at the end.

Syntax

Namespace: FlexCel.Core

public static Boolean HasInterpolationColors(TDrawingGradientStop[] stops)

Parameters

<-> | Parameter | Type | Description
 | stops | TDrawingGradientStop[] |

See also

  • TUIColorBlend


TUIColorBlend.Count Property | FlexCel Studio for the .NET Framework documentation

TUIColorBlend.Count Property

Number of gradient stops in the blend definition.

Syntax

Namespace: FlexCel.Core

public Int32 Count { get; }

See also

  • TUIColorBlend


TUIColorBlend.this[] Property | FlexCel Studio for the .NET Framework documentation

TUIColorBlend.this[] Property

Returns a particular stop in the blend.

Syntax

Namespace: FlexCel.Core

public TUIGradientStop this[] { get; set; }

See also

  • TUIColorBlend


TUIFont Class | FlexCel Studio for the .NET Framework documentation

TUIFont Class

Represents a font used for drawing in a pdf/gdi+/wpf/winrt canvas. This class might hold resources which need disposing.

Syntax

Namespace: FlexCel.Core

public abstract class TUIFont: IDisposable

Methods

Name | Description
Create Overloaded
 Create(String, Double)
Create(String, Double, TUIFontStyle)
CreateFromMemory Creates a font from the font data. IMPORTANT NOTE: When using GDI+ (default in Windows), this method will create a FontCollection that can never be disposed until the application exits.
When using GDI+, try not to use this method, or make sure that it is called only a couple of times since the memory for the loaded font won't be released. On the other hand, calling this method multiple times with the same font is ok, FlexCel will cache the font and not create multiple instances.
CreateFromFile Creates a font from a font file. IMPORTANT NOTE: When using GDI+ (default in Windows), this method will create a FontCollection that can never be disposed until the application exits.
When using GDI+, try not to use this method, or make sure that it is called only a couple of times since the memory for the loaded font won't be released. On the other hand, calling this method multiple times with the same font is ok, FlexCel will cache the font and not create multiple instances.
CreateSimilarFont Creates a font which is the most similar to the one you specify. Some fonts don't have specific styles like italics or bold, if this is the case, this method will return the same font with a different style.
GetHeight Height of the font for a given resolution.
GetWidth Returns the width of a string in device-independent pixels at dpi resolution when written in the current font.
FontLinespacing Returns the linespacing for the font.
FontDescent Returns the font descent.
SupportsTTFTables | Returns true if the platform supports returning a TTF table, and you can then use GetTTFTable
GetTTFTable Returns a True Type table for the font, if the platform gives the functionality. Currently supported in OSX only.
To see if the platform supports returning tables, see SupportsTTFTables
ToString | Returns the font as a string
Dispose Overloaded
 Dispose
Dispose(Boolean)
OnFontCreating Replace this event when creating a custom descendant of TUIFont.
OnFontCreated Replace this event when creating a custom descendant of TUIFont.

Properties

Name | Description
Name | Name of the font.
OriginalFontName | Returns the name of the font as stored in the xls/x file, and not the font name after it was replaced by one of the fonts installed in the machine where we are running.
SizeInPoints | Size in points of the font.
Style | Style of the font (bold, italics, etc).
Italic | Returns true if the font is italic.
Bold | Returns true if the font is bold.

Events

Name | Description
FontCreating | Fires before a font is created. You can customize the font properties and create a different font instead. Note that this event is static and it applies to the whole app.
FontCreated | Fires after a font has been created. You can use this event to handle fonts that don't exist in your system and are replaced by a different font by the OS. Note that this event is static and it applies to the whole app. Remark: As this event fires after the font has been created, it means that if you modify it the font is created twice. It is not going to have a big impact in performance, but if possible use the FontCreating event instead, as it won't cause the font to be created twice. This event has to be used only for cases where you want to override the default operating system font substitution algorithm.


TUIFont.Create Method | FlexCel Studio for the .NET Framework documentation

TUIFont.Create Method

Overloads

  • TUIFont.Create(String, Double)
  • TUIFont.Create(String, Double, TUIFontStyle)

TUIFont.Create(String, Double)

Creates a font with the given name and size.

Syntax

Namespace: FlexCel.Core

public static TUIFont Create(String aName, Double aSize)

Parameters

<-> | Parameter | Type | Description
 | aName | String | Name of the font.
 | aSize | Double | Size in points of the font.

See also

  • TUIFont

TUIFont.Create(String, Double, TUIFontStyle)

Creates a font with the given name, size and style.

Syntax

Namespace: FlexCel.Core

public static TUIFont Create(String aName, Double aSize, TUIFontStyle aFontStyle)

Parameters

<-> | Parameter | Type | Description
 | aName | String | Name of the font.
 | aSize | Double | Size in points of the font.
 | aFontStyle | TUIFontStyle | Style of the font (italic, bold, etc)

See also

  • TUIFont


TUIFont.CreateFromMemory Method | FlexCel Studio for the .NET Framework documentation

TUIFont.CreateFromMemory Method

Creates a font from the font data. IMPORTANT NOTE: When using GDI+ (default in Windows), this method will create a FontCollection that can never be disposed until the application exits. When using GDI+, try not to use this method, or make sure that it is called only a couple of times since the memory for the loaded font won't be released. On the other hand, calling this method multiple times with the same font is ok, FlexCel will cache the font and not create multiple instances.

Syntax

Namespace: FlexCel.Core

public static TUIFont CreateFromMemory(Byte[] aFontData, Double aSize, TUIFontStyle aFontStyle, Int32 aFontIndex)

Parameters

<-> | Parameter | Type | Description
 | aFontData | Byte[] | Byte array containing the ttf font data.
 | aSize | Double | Size in points of the font.
 | aFontStyle | TUIFontStyle | Style of the font (italic, bold, etc)
 | aFontIndex | Int32 | Index of the font

See also

  • TUIFont


TUIFont.CreateFromFile Method | FlexCel Studio for the .NET Framework documentation

TUIFont.CreateFromFile Method

Creates a font from a font file. IMPORTANT NOTE: When using GDI+ (default in Windows), this method will create a FontCollection that can never be disposed until the application exits. When using GDI+, try not to use this method, or make sure that it is called only a couple of times since the memory for the loaded font won't be released. On the other hand, calling this method multiple times with the same font is ok, FlexCel will cache the font and not create multiple instances.

Syntax

Namespace: FlexCel.Core

public static TUIFont CreateFromFile(String aFontFilename, Double aSize, TUIFontStyle aFontStyle, Int32 aFontIndex)

Parameters

<-> | Parameter | Type | Description
 | aFontFilename | String | Filename of the file containing the ttf font data.
 | aSize | Double | Size in points of the font.
 | aFontStyle | TUIFontStyle | Style of the font (italic, bold, etc)
 | aFontIndex | Int32 | Index of the font

See also

  • TUIFont


TUIFont.CreateSimilarFont Method | FlexCel Studio for the .NET Framework documentation

TUIFont.CreateSimilarFont Method

Creates a font which is the most similar to the one you specify. Some fonts don't have specific styles like italics or bold, if this is the case, this method will return the same font with a different style.

Syntax

Namespace: FlexCel.Core

public static TUIFont CreateSimilarFont(String FontName, Double FontSize, TUIFontStyle FontStyle)

Parameters

<-> | Parameter | Type | Description
 | FontName | String | Name of the font we wish to create.
 | FontSize | Double | Size in points of the font.
 | FontStyle | TUIFontStyle | Style of the font.

Returns

The font if it was possible to create it, or a similar one if it wasn't.

See also

  • TUIFont


TUIFont.GetHeight Method | FlexCel Studio for the .NET Framework documentation

TUIFont.GetHeight Method

Height of the font for a given resolution.

Syntax

Namespace: FlexCel.Core

public abstract Double GetHeight(Int32 dpi)

Parameters

<-> | Parameter | Type | Description
 | dpi | Int32 | Resolution.

See also

  • TUIFont


TUIFont.GetWidth Method | FlexCel Studio for the .NET Framework documentation

TUIFont.GetWidth Method

Returns the width of a string in device-independent pixels at dpi resolution when written in the current font.

Syntax

Namespace: FlexCel.Core

public abstract Double GetWidth(String aText, Int32 dpi, TFlxReadingOrder aReadingOrder)

Parameters

<-> | Parameter | Type | Description
 | aText | String | Text we want to measure.
 | dpi | Int32 | Dpi to measure the string.
 | aReadingOrder | TFlxReadingOrder | Reading order for the document where the string is.

See also

  • TUIFont


TUIFont.FontLinespacing Method | FlexCel Studio for the .NET Framework documentation

TUIFont.FontLinespacing Method

Returns the linespacing for the font.

Syntax

Namespace: FlexCel.Core

public abstract Double FontLinespacing()

See also

  • TUIFont


TUIFont.FontDescent Method | FlexCel Studio for the .NET Framework documentation

TUIFont.FontDescent Method

Returns the font descent.

Syntax

Namespace: FlexCel.Core

public abstract Double FontDescent()

See also

  • TUIFont


TUIFont.SupportsTTFTables Method | FlexCel Studio for the .NET Framework documentation

TUIFont.SupportsTTFTables Method

Returns true if the platform supports returning a TTF table, and you can then use GetTTFTable

Syntax

Namespace: FlexCel.Core

public virtual Boolean SupportsTTFTables()

See also

  • TUIFont


TUIFont.GetTTFTable Method | FlexCel Studio for the .NET Framework documentation

TUIFont.GetTTFTable Method

Returns a True Type table for the font, if the platform gives the functionality. Currently supported in OSX only. To see if the platform supports returning tables, see SupportsTTFTables

Syntax

Namespace: FlexCel.Core

public virtual Byte[] GetTTFTable(Int64 tableName)

Parameters

<-> | Parameter | Type | Description
 | tableName | Int64 |

See also

  • TUIFont


TUIFont.ToString Method | FlexCel Studio for the .NET Framework documentation

TUIFont.ToString Method

Returns the font as a string

Syntax

Namespace: FlexCel.Core

public override String ToString()

See also

  • TUIFont


TUIFont.Dispose Method | FlexCel Studio for the .NET Framework documentation

TUIFont.Dispose Method

Overloads

  • TUIFont.Dispose
  • TUIFont.Dispose(Boolean)

TUIFont.Dispose

Disposes this instance.

Syntax

Namespace: FlexCel.Core

public void Dispose()

See also

  • TUIFont

TUIFont.Dispose(Boolean)

Override this method to dispose your own objects in your descending classes.

Syntax

Namespace: FlexCel.Core

protected virtual void Dispose(Boolean disposing)

Parameters

<-> | Parameter | Type | Description
 | disposing | Boolean | If true, this is a direct call to Dispose(), and you need to dispose both managed and unmanaged resources. If false, this is called by the finalizer, and you only need to release unmanaged resources.

See also

  • TUIFont


TUIFont.OnFontCreating Method | FlexCel Studio for the .NET Framework documentation

TUIFont.OnFontCreating Method

Replace this event when creating a custom descendant of TUIFont.

Syntax

Namespace: FlexCel.Core

protected static void OnFontCreating(FontCreatingEventArgs e)

Parameters

<-> | Parameter | Type | Description
 | e | FontCreating​Event​Args |

See also

  • TUIFont


TUIFont.OnFontCreated Method | FlexCel Studio for the .NET Framework documentation

TUIFont.OnFontCreated Method

Replace this event when creating a custom descendant of TUIFont.

Syntax

Namespace: FlexCel.Core

protected static void OnFontCreated(FontCreatedEventArgs e)

Parameters

<-> | Parameter | Type | Description
 | e | FontCreatedEventArgs |

See also

  • TUIFont


TUIFont.Name Property | FlexCel Studio for the .NET Framework documentation

TUIFont.Name Property

Name of the font.

Syntax

Namespace: FlexCel.Core

public abstract String Name { get; }

See also

  • TUIFont


TUIFont.OriginalFontName Property | FlexCel Studio for the .NET Framework documentation

TUIFont.OriginalFontName Property

Returns the name of the font as stored in the xls/x file, and not the font name after it was replaced by one of the fonts installed in the machine where we are running.

Syntax

Namespace: FlexCel.Core

public String OriginalFontName { get; }

See also

  • TUIFont


TUIFont.SizeInPoints Property | FlexCel Studio for the .NET Framework documentation

TUIFont.SizeInPoints Property

Size in points of the font.

Syntax

Namespace: FlexCel.Core

public abstract Double SizeInPoints { get; }

See also

  • TUIFont


TUIFont.Style Property | FlexCel Studio for the .NET Framework documentation

TUIFont.Style Property

Style of the font (bold, italics, etc).

Syntax

Namespace: FlexCel.Core

public abstract TUIFontStyle Style { get; }

See also

  • TUIFont


TUIFont.Italic Property | FlexCel Studio for the .NET Framework documentation

TUIFont.Italic Property

Returns true if the font is italic.

Syntax

Namespace: FlexCel.Core

public Boolean Italic { get; }

See also

  • TUIFont


TUIFont.Bold Property | FlexCel Studio for the .NET Framework documentation

TUIFont.Bold Property

Returns true if the font is bold.

Syntax

Namespace: FlexCel.Core

public Boolean Bold { get; }

See also

  • TUIFont


TUIFont.FontCreating Event | FlexCel Studio for the .NET Framework documentation

TUIFont.FontCreating Event

Fires before a font is created. You can customize the font properties and create a different font instead. Note that this event is static and it applies to the whole app.

Syntax

Namespace: FlexCel.Core

public FontCreatingEventHandler FontCreating

See also

  • TUIFont


TUIFont.FontCreated Event | FlexCel Studio for the .NET Framework documentation

TUIFont.FontCreated Event

Fires after a font has been created. You can use this event to handle fonts that don't exist in your system and are replaced by a different font by the OS. Note that this event is static and it applies to the whole app.

Remark: As this event fires after the font has been created, it means that if you modify it the font is created twice. It is not going to have a big impact in performance, but if possible use the FontCreating event instead, as it won't cause the font to be created twice. This event has to be used only for cases where you want to override the default operating system font substitution algorithm.

Syntax

Namespace: FlexCel.Core

public FontCreatedEventHandler FontCreated

See also

  • TUIFont


TUIGraphics Class | FlexCel Studio for the .NET Framework documentation

TUIGraphics Class

This class represents a native canvas for drawing.

Syntax

Namespace: FlexCel.Core

public abstract class TUIGraphics: IDisposable

Methods

Name | Description
Dispose | Overloaded Dispose Dispose(Boolean)
Clear | Clears the image to a color.
FromImage | Gets the graphics context from an image.
SetMode | Sets the interpolation and smoothing modes.

Operators

Name | Description
Implicit Conversion | Creates a UIGraphics from a given System.​Drawing.​Graphics. Important: When you do an implicit conversion, the TUIBrush will take ownership of the brush, and the original System.​Drawing.​Brush will be disposed when you dispose this class.


TUIGraphics.Dispose Method | FlexCel Studio for the .NET Framework documentation

TUIGraphics.Dispose Method

Overloads

  • TUIGraphics.Dispose
  • TUIGraphics.Dispose(Boolean)

TUIGraphics.Dispose

Disposes this instance.

Syntax

Namespace: FlexCel.Core

public void Dispose()

See also

  • TUIGraphics

TUIGraphics.Dispose(Boolean)

Override this method to dispose your own objects in your descending classes.

Syntax

Namespace: FlexCel.Core

protected virtual void Dispose(Boolean disposing)

Parameters

<-> | Parameter | Type | Description
 | disposing | Boolean | If true, this is a direct call to Dispose(), and you need to dispose both managed and unmanaged resources. If false, this is called by the finalizer, and you only need to release unmanaged resources.

See also

  • TUIGraphics


TUIGraphics.Clear Method | FlexCel Studio for the .NET Framework documentation

TUIGraphics.Clear Method

Clears the image to a color.

Syntax

Namespace: FlexCel.Core

public abstract void Clear(TUIColor aColor)

Parameters

<-> | Parameter | Type | Description
 | aColor | TUIColor | Color to fill the image.

See also

  • TUIGraphics


TUIGraphics.FromImage Method | FlexCel Studio for the .NET Framework documentation

TUIGraphics.FromImage Method

Gets the graphics context from an image.

Syntax

Namespace: FlexCel.Core

public static TUIGraphics FromImage(TUIImage Img)

Parameters

<-> | Parameter | Type | Description
 | Img | TUIImage |

See also

  • TUIGraphics


TUIGraphics.SetMode Method | FlexCel Studio for the .NET Framework documentation

TUIGraphics.SetMode Method

Sets the interpolation and smoothing modes.

Syntax

Namespace: FlexCel.Core

public abstract void SetMode(TUIInterpolationMode aInterpolationMode, TUISmoothingMode aSmoothingMode)

Parameters

<-> | Parameter | Type | Description
 | aInterpolationMode | TUIInterpolationMode |
 | aSmoothingMode | TUISmoothingMode |

See also

  • TUIGraphics


TUIGraphics Implicit Conversion Operator | FlexCel Studio for the .NET Framework documentation

TUIGraphics Implicit Conversion Operator

Creates a UIGraphics from a given System.Drawing.Graphics. Important: When you do an implicit conversion, the TUIBrush will take ownership of the brush, and the original System.Drawing.Brush will be disposed when you dispose this class.

Syntax

Namespace: FlexCel.Core

public static TUIGraphics op_Implicit(Graphics gr)

Parameters

<-> | Parameter | Type | Description
 | gr | Graphics |

See also

  • TUIGraphics


TUIHatchBrush Class | FlexCel Studio for the .NET Framework documentation

TUIHatchBrush Class

A class representing a platform independent hatch brush.

Syntax

Namespace: FlexCel.Core

public abstract class TUIHatchBrush: TUIBrush

Methods

Name | Description
Create | This method will return the appropriate Brush depending in the Graphics framework you are using to render images.

Operators

Name | Description
Implicit Conversion | Creates a UIBrush from a given System.​Drawing.​Brush. Important: When you do an implicit conversion, the TUIBrush will take ownership of the brush, and the original System.​Drawing.​Brush will be disposed when you dispose this class.

Properties

Name | Description
ForegroundColor | Foreground color for the pattern.
BackgroundColor | Background color for the pattern.
HatchStyle | Hatch style for the pattern.


TUIHatchBrush.Create Method | FlexCel Studio for the .NET Framework documentation

TUIHatchBrush.Create Method

This method will return the appropriate Brush depending in the Graphics framework you are using to render images.

Syntax

Namespace: FlexCel.Core

public static TUIBrush Create(TUIHatchStyle hatchStyle, TUIColor ColorFg, TUIColor ColorBg)

Parameters

<-> | Parameter | Type | Description
 | hatchStyle | TUIHatchStyle | Hatch style for the pattern.
 | ColorFg | TUIColor | Foreground color for the pattern.
 | ColorBg | TUIColor | Background color for the pattern.

See also

  • TUIHatchBrush


TUIHatchBrush Implicit Conversion Operator | FlexCel Studio for the .NET Framework documentation

TUIHatchBrush Implicit Conversion Operator

Creates a UIBrush from a given System.Drawing.Brush. Important: When you do an implicit conversion, the TUIBrush will take ownership of the brush, and the original System.Drawing.Brush will be disposed when you dispose this class.

Syntax

Namespace: FlexCel.Core

public static TUIHatchBrush op_Implicit(HatchBrush br)

Parameters

<-> | Parameter | Type | Description
 | br | HatchBrush |

See also

  • TUIHatchBrush


TUIHatchBrush.ForegroundColor Property | FlexCel Studio for the .NET Framework documentation

TUIHatchBrush.ForegroundColor Property

Foreground color for the pattern.

Syntax

Namespace: FlexCel.Core

public abstract TUIColor ForegroundColor { get; }

See also

  • TUIHatchBrush


TUIHatchBrush.BackgroundColor Property | FlexCel Studio for the .NET Framework documentation

TUIHatchBrush.BackgroundColor Property

Background color for the pattern.

Syntax

Namespace: FlexCel.Core

public abstract TUIColor BackgroundColor { get; }

See also

  • TUIHatchBrush


TUIHatchBrush.HatchStyle Property | FlexCel Studio for the .NET Framework documentation

TUIHatchBrush.HatchStyle Property

Hatch style for the pattern.

Syntax

Namespace: FlexCel.Core

public abstract TUIHatchStyle HatchStyle { get; }

See also

  • TUIHatchBrush


TUIImage Class | FlexCel Studio for the .NET Framework documentation

TUIImage Class

A platform independent image.

Syntax

Namespace: FlexCel.Core

public abstract class TUIImage: IDisposable

Methods

Name Description
FromFile Creates an image from a file.
FromStream Creates an image from a stream.
CreateBitmap Creates a bitmap of the specified dimensions.
Dispose Overloaded
 Dispose
Dispose(Boolean)
ConvertToBWDither Converts the image to pure black and white, using dithering.
ConvertToBiLevel Converts the image to pure black and white, without diffusion.
ConvertToGrayscale Converts the image to shades of gray.
ConvertTo256Colors Converts the image to 256 indexed colors.
Save Overloaded
 Save(Stream, TXlsImgType)
Save(String, TXlsImgType)
RasterMetafile Converts a vectorial metafile to a bitmap.
SaveStart Starts saving a multi page image.
SupportsMultiPage Returns true if the current platform supports multipage images.

Operators

Name | Description
Implicit Conversion | Overloaded Implicit conversion from Image to TUIImage Implicit conversion from TUIImage to Image

Properties

Name | Description
Width | Width of the image in device-dependent pixels.
Height | Height of the image in device-dependent pixels.
WidthInPoints | Width of the image in Points (1/72 of an inch)
HeightInPoints | Height of the image in Points (1/72 of an inch)
RawFormat | Format of the image.
IsMetafile | Returns true if the file is a WMF or EMF file.
Is8bitGrayscale | Returns true if the image has 256 shades of gray.


TUIImage.FromFile Method | FlexCel Studio for the .NET Framework documentation

TUIImage.FromFile Method

Creates an image from a file.

Syntax

Namespace: FlexCel.Core

public static TUIImage FromFile(String aFileName)

Parameters

<-> | Parameter | Type | Description
 | aFileName | String | A file name.

Returns

The image.

See also

  • TUIImage


TUIImage.FromStream Method | FlexCel Studio for the .NET Framework documentation

TUIImage.FromStream Method

Creates an image from a stream.

Syntax

Namespace: FlexCel.Core

public static TUIImage FromStream(Stream aStream)

Parameters

<-> | Parameter | Type | Description
 | aStream | Stream |

See also

  • TUIImage


TUIImage.CreateBitmap Method | FlexCel Studio for the .NET Framework documentation

TUIImage.CreateBitmap Method

Creates a bitmap of the specified dimensions.

Syntax

Namespace: FlexCel.Core

public static TUIImage CreateBitmap(Int32 width, Int32 height, ImageColorDepth aPixelFormat, Double hres, Double vres)

Parameters

<-> | Parameter | Type | Description
 | width | Int32 | Width of the bitmap in pixels.
 | height | Int32 | Height of the bitmap in pixels.
 | aPixelFormat | ImageColorDepth | Pixel Format.
 | hres | Double | Horizontal resolution of the image
 | vres | Double | Vertical resolution of the image

See also

  • TUIImage


TUIImage.Dispose Method | FlexCel Studio for the .NET Framework documentation

TUIImage.Dispose Method

Overloads

  • TUIImage.Dispose
  • TUIImage.Dispose(Boolean)

TUIImage.Dispose

Disposes this instance.

Syntax

Namespace: FlexCel.Core

public void Dispose()

See also

  • TUIImage

TUIImage.Dispose(Boolean)

Override this method to dispose your own objects in your descending classes.

Syntax

Namespace: FlexCel.Core

protected virtual void Dispose(Boolean disposing)

Parameters

<-> | Parameter | Type | Description
 | disposing | Boolean | If true, this is a direct call to Dispose(), and you need to dispose both managed and unmanaged resources. If false, this is called by the finalizer, and you only need to release unmanaged resources.

See also

  • TUIImage


TUIImage.ConvertToBWDither Method | FlexCel Studio for the .NET Framework documentation

TUIImage.ConvertToBWDither Method

Converts the image to pure black and white, using dithering.

Syntax

Namespace: FlexCel.Core

public abstract TUIImage ConvertToBWDither()

See also

  • TUIImage


TUIImage.ConvertToBiLevel Method | FlexCel Studio for the .NET Framework documentation

TUIImage.ConvertToBiLevel Method

Converts the image to pure black and white, without diffusion.

Syntax

Namespace: FlexCel.Core

public abstract TUIImage ConvertToBiLevel()

See also

  • TUIImage


TUIImage.ConvertToGrayscale Method | FlexCel Studio for the .NET Framework documentation

TUIImage.ConvertToGrayscale Method

Converts the image to shades of gray.

Syntax

Namespace: FlexCel.Core

public abstract TUIImage ConvertToGrayscale()

See also

  • TUIImage


TUIImage.ConvertTo256Colors Method | FlexCel Studio for the .NET Framework documentation

TUIImage.ConvertTo256Colors Method

Converts the image to 256 indexed colors.

Syntax

Namespace: FlexCel.Core

public abstract TUIImage ConvertTo256Colors()

See also

  • TUIImage


TUIImage.Save Method | FlexCel Studio for the .NET Framework documentation

TUIImage.Save Method

Overloads

  • TUIImage.Save(Stream, TXlsImgType)
  • TUIImage.Save(String, TXlsImgType)

TUIImage.Save(Stream, TXlsImgType)

Saves the image to a stream, in the specified format.

Syntax

Namespace: FlexCel.Core

public abstract TXlsImgType Save(Stream outMs, TXlsImgType ImgType)

Parameters

<-> | Parameter | Type | Description
 | outMs | Stream |
 | ImgType | TXlsImgType |

Returns

The actual file format in which the file was saved. It might not be possible to save in the required format, and a different one might be used.

See also

  • TUIImage

TUIImage.Save(String, TXlsImgType)

Saves the image to a file.

Syntax

Namespace: FlexCel.Core

public TXlsImgType Save(String fileName, TXlsImgType ImgType)

Parameters

<-> | Parameter | Type | Description
 | fileName | String |
 | ImgType | TXlsImgType |

Returns

The actual file format in which the file was saved. It might not be possible to save in the required format, and a different one might be used.

See also

  • TUIImage


TUIImage.RasterMetafile Method | FlexCel Studio for the .NET Framework documentation

TUIImage.RasterMetafile Method

Converts a vectorial metafile to a bitmap.

Syntax

Namespace: FlexCel.Core

public abstract TUIImage RasterMetafile(TUIRectangle Coords)

Parameters

<-> | Parameter | Type | Description
 | Coords | TUIRectangle |

See also

  • TUIImage


TUIImage.SaveStart Method | FlexCel Studio for the .NET Framework documentation

TUIImage.SaveStart Method

Starts saving a multi page image.

Syntax

Namespace: FlexCel.Core

public abstract TUIMultiPageSaver SaveStart(Stream outStream, ImageExportType ExportType, Int32 totalPages)

Parameters

<-> | Parameter | Type | Description
 | outStream | Stream | Stream where the image will be saved.
 | ExportType | ImageExportType | Format for the exported images.
 | totalPages | Int32 | Number of pages to export.

Returns

Image state that will be used when saving the other pages.

See also

  • TUIImage


TUIImage.SupportsMultiPage Method | FlexCel Studio for the .NET Framework documentation

TUIImage.SupportsMultiPage Method

Returns true if the current platform supports multipage images.

Syntax

Namespace: FlexCel.Core

public static Boolean SupportsMultiPage()

See also

  • TUIImage


TUIImage Implicit Conversion Operator | FlexCel Studio for the .NET Framework documentation

TUIImage Implicit Conversion Operator

Overloads

  • Implicit conversion from Image to TUIImage
  • Implicit conversion from TUIImage to Image

Implicit conversion from Image to TUIImage

Creates a UIImage from a given System.Drawing.Image. Important: When you do an implicit conversion, the TUIImage will take ownership of the image, and the original System.Drawing.Image will be disposed when you dispose this class.

Syntax

Namespace: FlexCel.Core

public static TUIImage op_Implicit(Image img)

Parameters

<-> | Parameter | Type | Description
 | img | Image |

See also

  • TUIImage

Implicit conversion from TUIImage to Image

Converts a TUIImage into a System.Drawing.Image. Note that after converting it, this class won't hold a reference to the image anymore, and you have to dispose the converted System.DrawingImage instead.

Syntax

Namespace: FlexCel.Core

public static Image op_Implicit(TUIImage img)

Parameters

<-> | Parameter | Type | Description
 | img | TUIImage |

See also

  • TUIImage


TUIImage.Width Property | FlexCel Studio for the .NET Framework documentation

TUIImage.Width Property

Width of the image in device-dependent pixels.

Syntax

Namespace: FlexCel.Core

public abstract Double Width { get; }

See also

  • TUIImage


TUIImage.Height Property | FlexCel Studio for the .NET Framework documentation

TUIImage.Height Property

Height of the image in device-dependent pixels.

Syntax

Namespace: FlexCel.Core

public abstract Double Height { get; }

See also

  • TUIImage


TUIImage.WidthInPoints Property | FlexCel Studio for the .NET Framework documentation

TUIImage.WidthInPoints Property

Width of the image in Points (1/72 of an inch)

Syntax

Namespace: FlexCel.Core

public abstract Double WidthInPoints { get; }

See also

  • TUIImage


TUIImage.HeightInPoints Property | FlexCel Studio for the .NET Framework documentation

TUIImage.HeightInPoints Property

Height of the image in Points (1/72 of an inch)

Syntax

Namespace: FlexCel.Core

public abstract Double HeightInPoints { get; }

See also

  • TUIImage


TUIImage.RawFormat Property | FlexCel Studio for the .NET Framework documentation

TUIImage.RawFormat Property

Format of the image.

Syntax

Namespace: FlexCel.Core

public abstract TXlsImgType RawFormat { get; }

See also

  • TUIImage


TUIImage.IsMetafile Property | FlexCel Studio for the .NET Framework documentation

TUIImage.IsMetafile Property

Returns true if the file is a WMF or EMF file.

Syntax

Namespace: FlexCel.Core

public abstract Boolean IsMetafile { get; }

See also

  • TUIImage


TUIImage.Is8bitGrayscale Property | FlexCel Studio for the .NET Framework documentation

TUIImage.Is8bitGrayscale Property

Returns true if the image has 256 shades of gray.

Syntax

Namespace: FlexCel.Core

public abstract Boolean Is8bitGrayscale { get; }

See also

  • TUIImage


TUIImageAttributes Class | FlexCel Studio for the .NET Framework documentation

TUIImageAttributes Class

Platform independent image attributes.

Syntax

Namespace: FlexCel.Core

public abstract class TUIImageAttributes: IDisposable

Methods

Name | Description
Create | Creates a new image attribute.
MakeTransparent | Makes the image transparent.
ColorImage | Adds color to the image.
Dispose | Overloaded Dispose Dispose(Boolean)


TUIImageAttributes.Create Method | FlexCel Studio for the .NET Framework documentation

TUIImageAttributes.Create Method

Creates a new image attribute.

Syntax

Namespace: FlexCel.Core

public static TUIImageAttributes Create()

See also

  • TUIImageAttributes


TUIImageAttributes.MakeTransparent Method | FlexCel Studio for the .NET Framework documentation

TUIImageAttributes.MakeTransparent Method

Makes the image transparent.

Syntax

Namespace: FlexCel.Core

public static void MakeTransparent(ref TUIImageAttributes imgAtt, Double Opacity)

Parameters

<-> | Parameter | Type | Description
ref | imgAtt | TUIImageAttributes |
 | Opacity | Double |

See also

  • TUIImageAttributes


TUIImageAttributes.ColorImage Method | FlexCel Studio for the .NET Framework documentation

TUIImageAttributes.ColorImage Method

Adds color to the image.

Syntax

Namespace: FlexCel.Core

public static void ColorImage(ref TUIImageAttributes imgAtt, TUIColor bgColor, TUIColor fgColor)

Parameters

<-> | Parameter | Type | Description
ref | imgAtt | TUIImageAttributes |
 | bgColor | TUIColor |
 | fgColor | TUIColor |

See also

  • TUIImageAttributes


TUIImageAttributes.Dispose Method | FlexCel Studio for the .NET Framework documentation

TUIImageAttributes.Dispose Method

Overloads

  • TUIImageAttributes.Dispose
  • TUIImageAttributes.Dispose(Boolean)

TUIImageAttributes.Dispose

Disposes this instance.

Syntax

Namespace: FlexCel.Core

public void Dispose()

See also

  • TUIImageAttributes

TUIImageAttributes.Dispose(Boolean)

Override this method to dispose your own objects in your descending classes.

Syntax

Namespace: FlexCel.Core

protected virtual void Dispose(Boolean disposing)

Parameters

<-> | Parameter | Type | Description
 | disposing | Boolean | If true, this is a direct call to Dispose(), and you need to dispose both managed and unmanaged resources. If false, this is called by the finalizer, and you only need to release unmanaged resources.

See also

  • TUIImageAttributes


TUILinearGradientBrush Class | FlexCel Studio for the .NET Framework documentation

TUILinearGradientBrush Class

Represents a platform independent linear gradient.

Syntax

Namespace: FlexCel.Core

public abstract class TUILinearGradientBrush: TUIBrush

Methods

Name | Description
Create | This method will return the appropriate Brush depending in the Graphics framework you are using to render images.
CalculateTransform​Elements | Calculates the transform elements given a rotation and a rectangle, for platforms that can't calculate it.
CalcRotatedCoords | Returns the rotated coordinates for the gradient, needed to define in platforms like PDF or OSX.
InvertBlend | Inverts the colors of the gradient.

Operators

Name | Description
Implicit Conversion | Creates a UIBrush from a given System.​Drawing.​Brush. Important: When you do an implicit conversion, the TUIBrush will take ownership of the brush, and the original System.​Drawing.​Brush will be disposed when you dispose this class.

Properties

Name | Description
Rectangle | Rectangle that defines the gradient.
TransformElements | Transform matrix.
InterpolationColors | Colors that define the gradient.


TUILinearGradientBrush.Create Method | FlexCel Studio for the .NET Framework documentation

TUILinearGradientBrush.Create Method

This method will return the appropriate Brush depending in the Graphics framework you are using to render images.

Syntax

Namespace: FlexCel.Core

public static TUILinearGradientBrush Create(TUIRectangle CellRect, TUIColor Color1, TUIColor Color2, Double Rotation, Boolean IsAngleScalable)

Parameters

<-> | Parameter | Type | Description
 | CellRect | TUIRectangle |
 | Color1 | TUIColor |
 | Color2 | TUIColor |
 | Rotation | Double |
 | IsAngleScalable | Boolean |

See also

  • TUILinearGradientBrush


TUILinearGradientBrush.CalculateTransformElements Method | FlexCel Studio for the .NET Framework documentation

TUILinearGradientBrush.CalculateTransformElements Method

Calculates the transform elements given a rotation and a rectangle, for platforms that can't calculate it.

Syntax

Namespace: FlexCel.Core

protected static Double[] CalculateTransformElements(TUIRectangle Rect, Double Rotation, Boolean Scale)

Parameters

<-> | Parameter | Type | Description
 | Rect | TUIRectangle |
 | Rotation | Double |
 | Scale | Boolean |

See also

  • TUILinearGradientBrush


TUILinearGradientBrush.CalcRotatedCoords Method | FlexCel Studio for the .NET Framework documentation

TUILinearGradientBrush.CalcRotatedCoords Method

Returns the rotated coordinates for the gradient, needed to define in platforms like PDF or OSX.

Syntax

Namespace: FlexCel.Core

public static TUIRectangle CalcRotatedCoords(Double[] aPatternMatrix, TUIRectangle aBrushCoords)

Parameters

<-> | Parameter | Type | Description
 | aPatternMatrix | Double[] |
 | aBrushCoords | TUIRectangle |

See also

  • TUILinearGradientBrush


TUILinearGradientBrush.InvertBlend Method | FlexCel Studio for the .NET Framework documentation

TUILinearGradientBrush.InvertBlend Method

Inverts the colors of the gradient.

Syntax

Namespace: FlexCel.Core

public abstract void InvertBlend()

See also

  • TUILinearGradientBrush


TUILinearGradientBrush Implicit Conversion Operator | FlexCel Studio for the .NET Framework documentation

TUILinearGradientBrush Implicit Conversion Operator

Creates a UIBrush from a given System.Drawing.Brush. Important: When you do an implicit conversion, the TUIBrush will take ownership of the brush, and the original System.Drawing.Brush will be disposed when you dispose this class.

Syntax

Namespace: FlexCel.Core

public static TUILinearGradientBrush op_Implicit(LinearGradientBrush br)

Parameters

<-> | Parameter | Type | Description
 | br | LinearGradientBrush |

See also

  • TUILinearGradientBrush


TUILinearGradientBrush.Rectangle Property | FlexCel Studio for the .NET Framework documentation

TUILinearGradientBrush.Rectangle Property

Rectangle that defines the gradient.

Syntax

Namespace: FlexCel.Core

public abstract TUIRectangle Rectangle { get; }

See also

  • TUILinearGradientBrush


TUILinearGradientBrush.TransformElements Property | FlexCel Studio for the .NET Framework documentation

TUILinearGradientBrush.TransformElements Property

Transform matrix.

Syntax

Namespace: FlexCel.Core

public abstract Double[] TransformElements { get; }

See also

  • TUILinearGradientBrush


TUILinearGradientBrush.InterpolationColors Property | FlexCel Studio for the .NET Framework documentation

TUILinearGradientBrush.InterpolationColors Property

Colors that define the gradient.

Syntax

Namespace: FlexCel.Core

public abstract TUIColorBlend InterpolationColors { get; set; }

See also

  • TUILinearGradientBrush


TUIMultiPageSaver Class | FlexCel Studio for the .NET Framework documentation

TUIMultiPageSaver Class

This class is used to carry information when saving multi page images, like for example a multipage tiff.

Syntax

Namespace: FlexCel.Core

public abstract class TUIMultiPageSaver: IDisposable

Methods

Name | Description
SaveAdd | Adds a new image to a multi page image.
SaveEnd | Finish a multipage image.
Dispose | Overloaded Dispose Dispose(Boolean)


TUIMultiPageSaver.SaveAdd Method | FlexCel Studio for the .NET Framework documentation

TUIMultiPageSaver.SaveAdd Method

Adds a new image to a multi page image.

Syntax

Namespace: FlexCel.Core

public abstract void SaveAdd(TUIImage imageToAdd)

Parameters

<-> | Parameter | Type | Description
 | imageToAdd | TUIImage | Image that will be added to the multipage image.

See also

  • TUIMultiPageSaver


TUIMultiPageSaver.SaveEnd Method | FlexCel Studio for the .NET Framework documentation

TUIMultiPageSaver.SaveEnd Method

Finish a multipage image.

Syntax

Namespace: FlexCel.Core

public abstract void SaveEnd()

See also

  • TUIMultiPageSaver


TUIMultiPageSaver.Dispose Method | FlexCel Studio for the .NET Framework documentation

TUIMultiPageSaver.Dispose Method

Overloads

  • TUIMultiPageSaver.Dispose
  • TUIMultiPageSaver.Dispose(Boolean)

TUIMultiPageSaver.Dispose

Disposes this instance.

Syntax

Namespace: FlexCel.Core

public void Dispose()

See also

  • TUIMultiPageSaver

TUIMultiPageSaver.Dispose(Boolean)

Override this method to dispose your own objects in your descending classes.

Syntax

Namespace: FlexCel.Core

protected virtual void Dispose(Boolean disposing)

Parameters

<-> | Parameter | Type | Description
 | disposing | Boolean | If true, this is a direct call to Dispose(), and you need to dispose both managed and unmanaged resources. If false, this is called by the finalizer, and you only need to release unmanaged resources.

See also

  • TUIMultiPageSaver


TUIPathGradientBrush Class | FlexCel Studio for the .NET Framework documentation

TUIPathGradientBrush Class

A platform-independent Path gradient implementation.

Syntax

Namespace: FlexCel.Core

public abstract class TUIPathGradientBrush: TUIBrush

Methods

Name | Description
InvertBlend | Inverts the colors of the gradient.

Operators

Name | Description
Implicit Conversion | Creates a UIBrush from a given System.​Drawing.​Brush. Important: When you do an implicit conversion, the TUIBrush will take ownership of the brush, and the original System.​Drawing.​Brush will be disposed when you dispose this class.

Properties

Name | Description
Rectangle | Rectangle that defines the gradient.
TransformElements | Transform matrix.
IsRectangular | If true, this gradient is rectangular, else it is radial.
InterpolationColors | Colors that define the gradient.
CenterPoint | Center of the gradient.
CenterColor | Color for the center of the gradient.
SurroundColor | Colors on the ouside of the path.


TUIPathGradientBrush.InvertBlend Method | FlexCel Studio for the .NET Framework documentation

TUIPathGradientBrush.InvertBlend Method

Inverts the colors of the gradient.

Syntax

Namespace: FlexCel.Core

public abstract void InvertBlend()

See also

  • TUIPathGradientBrush


TUIPathGradientBrush Implicit Conversion Operator | FlexCel Studio for the .NET Framework documentation

TUIPathGradientBrush Implicit Conversion Operator

Creates a UIBrush from a given System.Drawing.Brush. Important: When you do an implicit conversion, the TUIBrush will take ownership of the brush, and the original System.Drawing.Brush will be disposed when you dispose this class.

Syntax

Namespace: FlexCel.Core

public static TUIPathGradientBrush op_Implicit(PathGradientBrush br)

Parameters

<-> | Parameter | Type | Description
 | br | PathGradientBrush |

See also

  • TUIPathGradientBrush


TUIPathGradientBrush.Rectangle Property | FlexCel Studio for the .NET Framework documentation

TUIPathGradientBrush.Rectangle Property

Rectangle that defines the gradient.

Syntax

Namespace: FlexCel.Core

public abstract TUIRectangle Rectangle { get; }

See also

  • TUIPathGradientBrush


TUIPathGradientBrush.TransformElements Property | FlexCel Studio for the .NET Framework documentation

TUIPathGradientBrush.TransformElements Property

Transform matrix.

Syntax

Namespace: FlexCel.Core

public abstract Double[] TransformElements { get; }

See also

  • TUIPathGradientBrush


TUIPathGradientBrush.IsRectangular Property | FlexCel Studio for the .NET Framework documentation

TUIPathGradientBrush.IsRectangular Property

If true, this gradient is rectangular, else it is radial.

Syntax

Namespace: FlexCel.Core

public abstract Boolean IsRectangular { get; }

See also

  • TUIPathGradientBrush


TUIPathGradientBrush.InterpolationColors Property | FlexCel Studio for the .NET Framework documentation

TUIPathGradientBrush.InterpolationColors Property

Colors that define the gradient.

Syntax

Namespace: FlexCel.Core

public abstract TUIColorBlend InterpolationColors { get; set; }

See also

  • TUIPathGradientBrush


TUIPathGradientBrush.CenterPoint Property | FlexCel Studio for the .NET Framework documentation

TUIPathGradientBrush.CenterPoint Property

Center of the gradient.

Syntax

Namespace: FlexCel.Core

public abstract TPointF CenterPoint { get; }

See also

  • TUIPathGradientBrush


TUIPathGradientBrush.CenterColor Property | FlexCel Studio for the .NET Framework documentation

TUIPathGradientBrush.CenterColor Property

Color for the center of the gradient.

Syntax

Namespace: FlexCel.Core

public abstract TUIColor CenterColor { get; set; }

See also

  • TUIPathGradientBrush


TUIPathGradientBrush.SurroundColor Property | FlexCel Studio for the .NET Framework documentation

TUIPathGradientBrush.SurroundColor Property

Colors on the ouside of the path.

Syntax

Namespace: FlexCel.Core

public abstract TUIColor SurroundColor { get; set; }

See also

  • TUIPathGradientBrush


TUIPen Class | FlexCel Studio for the .NET Framework documentation

TUIPen Class

A pen used to draw into a canvas.

Syntax

Namespace: FlexCel.Core

public abstract class TUIPen: IDisposable

Methods

Name | Description
Create | Overloaded Create(TUIColor) Create(TUIColor, Double)
Dispose | Overloaded Dispose Dispose(Boolean)

Operators

Name | Description
Implicit Conversion | Creates a UIPen from a given System.​Drawing.​Pen. Important: When you do an implicit conversion, the TUIPen will take ownership of the pen, and the original System.Drawing.Pen will be disposed when you dispose this class.

Properties

Name | Description
Color | Gets or sets the color of the pen.
Width | Gets or sets the width of the pen.
DashStyle | Gets or sets the style of the pen.
LineCap | Gets or sets the line cap of the pen.
LineJoin | Gets or sets the line join for the pen.
MiterLimit | Gets or sets the miter limit for the pen.
HeadArrow | Defines a start arrow for the lines.
TailArrow | Defines a start arrow for the lines.
Zoom100 | Zoom used in the page. This is used to calculate the minimum arrow size.


TUIPen.Create Method | FlexCel Studio for the .NET Framework documentation

TUIPen.Create Method

Overloads

  • TUIPen.Create(TUIColor)
  • TUIPen.Create(TUIColor, Double)

TUIPen.Create(TUIColor)

Creates a new pen with a given color and a width of 1.

Syntax

Namespace: FlexCel.Core

public static TUIPen Create(TUIColor aColor)

Parameters

<-> | Parameter | Type | Description
 | aColor | TUIColor | Color of the pen.

See also

  • TUIPen

TUIPen.Create(TUIColor, Double)

Creates a new pen with a given color and width.

Syntax

Namespace: FlexCel.Core

public static TUIPen Create(TUIColor aColor, Double aWidth)

Parameters

<-> | Parameter | Type | Description
 | aColor | TUIColor | Color for the pen.
 | aWidth | Double | Width of the pen.

See also

  • TUIPen


TUIPen.Dispose Method | FlexCel Studio for the .NET Framework documentation

TUIPen.Dispose Method

Overloads

  • TUIPen.Dispose
  • TUIPen.Dispose(Boolean)

TUIPen.Dispose

Disposes this instance.

Syntax

Namespace: FlexCel.Core

public void Dispose()

See also

  • TUIPen

TUIPen.Dispose(Boolean)

Override this method to dispose your own objects in your descending classes.

Syntax

Namespace: FlexCel.Core

protected virtual void Dispose(Boolean disposing)

Parameters

<-> | Parameter | Type | Description
 | disposing | Boolean | If true, this is a direct call to Dispose(), and you need to dispose both managed and unmanaged resources. If false, this is called by the finalizer, and you only need to release unmanaged resources.

See also

  • TUIPen


TUIPen Implicit Conversion Operator | FlexCel Studio for the .NET Framework documentation

TUIPen Implicit Conversion Operator

Creates a UIPen from a given System.Drawing.Pen. Important: When you do an implicit conversion, the TUIPen will take ownership of the pen, and the original System.Drawing.Pen will be disposed when you dispose this class.

Syntax

Namespace: FlexCel.Core

public static TUIPen op_Implicit(Pen aPen)

Parameters

<-> | Parameter | Type | Description
 | aPen | Pen |

See also

  • TUIPen


TUIPen.Color Property | FlexCel Studio for the .NET Framework documentation

TUIPen.Color Property

Gets or sets the color of the pen.

Syntax

Namespace: FlexCel.Core

public abstract TUIColor Color { get; set; }

See also

  • TUIPen


TUIPen.Width Property | FlexCel Studio for the .NET Framework documentation

TUIPen.Width Property

Gets or sets the width of the pen.

Syntax

Namespace: FlexCel.Core

public abstract Double Width { get; set; }

See also

  • TUIPen


TUIPen.DashStyle Property | FlexCel Studio for the .NET Framework documentation

TUIPen.DashStyle Property

Gets or sets the style of the pen.

Syntax

Namespace: FlexCel.Core

public abstract TUIDashStyle DashStyle { get; set; }

See also

  • TUIPen


TUIPen.LineCap Property | FlexCel Studio for the .NET Framework documentation

TUIPen.LineCap Property

Gets or sets the line cap of the pen.

Syntax

Namespace: FlexCel.Core

public abstract TLineCap LineCap { get; set; }

See also

  • TUIPen


TUIPen.LineJoin Property | FlexCel Studio for the .NET Framework documentation

TUIPen.LineJoin Property

Gets or sets the line join for the pen.

Syntax

Namespace: FlexCel.Core

public abstract TLineJoin LineJoin { get; set; }

See also

  • TUIPen


TUIPen.MiterLimit Property | FlexCel Studio for the .NET Framework documentation

TUIPen.MiterLimit Property

Gets or sets the miter limit for the pen.

Syntax

Namespace: FlexCel.Core

public abstract Double MiterLimit { get; set; }

See also

  • TUIPen


TUIPen.HeadArrow Property | FlexCel Studio for the .NET Framework documentation

TUIPen.HeadArrow Property

Defines a start arrow for the lines.

Syntax

Namespace: FlexCel.Core

public abstract TLineArrow HeadArrow { get; set; }

See also

  • TUIPen


TUIPen.TailArrow Property | FlexCel Studio for the .NET Framework documentation

TUIPen.TailArrow Property

Defines a start arrow for the lines.

Syntax

Namespace: FlexCel.Core

public abstract TLineArrow TailArrow { get; set; }

See also

  • TUIPen


TUIPen.Zoom100 Property | FlexCel Studio for the .NET Framework documentation

TUIPen.Zoom100 Property

Zoom used in the page. This is used to calculate the minimum arrow size.

Syntax

Namespace: FlexCel.Core

public Double Zoom100 { get; set; }

See also

  • TUIPen


TUISolidBrush Class | FlexCel Studio for the .NET Framework documentation

TUISolidBrush Class

A solid brush with a single color.

Syntax

Namespace: FlexCel.Core

public abstract class TUISolidBrush: TUIBrush

Methods

Name | Description
Create | This is a factory method that will create the correct brush depending in what UI framework you are using. (TUISolidBrush is an abstract class)

Operators

Name | Description
Implicit Conversion | Creates a UIBrush from a given System.​Drawing.​Brush. Important: When you do an implicit conversion, the TUIBrush will take ownership of the brush, and the original System.​Drawing.​Brush will be disposed when you dispose this class.

Properties

Name | Description
Color | Returns the color of the brush.


TUISolidBrush.Create Method | FlexCel Studio for the .NET Framework documentation

TUISolidBrush.Create Method

This is a factory method that will create the correct brush depending in what UI framework you are using. (TUISolidBrush is an abstract class)

Syntax

Namespace: FlexCel.Core

public static TUISolidBrush Create(TUIColor aColor)

Parameters

<-> | Parameter | Type | Description
 | aColor | TUIColor | Color for the brush.

See also

  • TUISolidBrush


TUISolidBrush Implicit Conversion Operator | FlexCel Studio for the .NET Framework documentation

TUISolidBrush Implicit Conversion Operator

Creates a UIBrush from a given System.Drawing.Brush. Important: When you do an implicit conversion, the TUIBrush will take ownership of the brush, and the original System.Drawing.Brush will be disposed when you dispose this class.

Syntax

Namespace: FlexCel.Core

public static TUISolidBrush op_Implicit(SolidBrush br)

Parameters

<-> | Parameter | Type | Description
 | br | SolidBrush |

See also

  • TUISolidBrush


TUISolidBrush.Color Property | FlexCel Studio for the .NET Framework documentation

TUISolidBrush.Color Property

Returns the color of the brush.

Syntax

Namespace: FlexCel.Core

public abstract TUIColor Color { get; }

See also

  • TUISolidBrush


TUITextureBrush Class | FlexCel Studio for the .NET Framework documentation

TUITextureBrush Class

A brush using an image as a pattern.

Syntax

Namespace: FlexCel.Core

public abstract class TUITextureBrush: TUIBrush

Methods

Name | Description
Create | This method will return the appropriate Brush depending in the Graphics framework you are using to render images.

Properties

Name | Description
Image | Image used to paint the brush.
TransformElements | Transform matrix.


TUITextureBrush.Create Method | FlexCel Studio for the .NET Framework documentation

TUITextureBrush.Create Method

This method will return the appropriate Brush depending in the Graphics framework you are using to render images.

Syntax

Namespace: FlexCel.Core

public static TUITextureBrush Create(TUIImage img, Double[] atm, Double[] canvasMatrix)

Parameters

<-> | Parameter | Type | Description
 | img | TUIImage | Image for the brush.
 | atm | Double[] | Transform Matrix for the pattern.
 | canvasMatrix | Double[] | Transform matrix for the graphics context.

See also

  • TUITextureBrush


TUITextureBrush.Image Property | FlexCel Studio for the .NET Framework documentation

TUITextureBrush.Image Property

Image used to paint the brush.

Syntax

Namespace: FlexCel.Core

public abstract TUIImage Image { get; }

See also

  • TUITextureBrush


TUITextureBrush.TransformElements Property | FlexCel Studio for the .NET Framework documentation

TUITextureBrush.TransformElements Property

Transform matrix.

Syntax

Namespace: FlexCel.Core

public abstract Double[] TransformElements { get; }

See also

  • TUITextureBrush


TUnknownBlipTransform Class | FlexCel Studio for the .NET Framework documentation

TUnknownBlipTransform Class

Represents a color transform that FlexCel currently doesn't know about.

Syntax

Namespace: FlexCel.Core

public class TUnknownBlipTransform: TBlipTransform

Constructors

Name | Description
TUnknownBlip​Transform | Creates a new instance.

Methods

Name | Description
Clone | Creates a deep copy of the object.
CompareTo | Compares two instances.
Equals | Returns true if both objects have the same contents.
GetHashCode | Returns the hashcode of the object.

Properties

Name | Description
TransformName | Name of the transform.
TransformDef | Transform definition as XML.


TUnknownBlipTransform.TUnknownBlipTransform Constructor | FlexCel Studio for the .NET Framework documentation

TUnknownBlipTransform.TUnknownBlipTransform Constructor

Creates a new instance.

Syntax

Namespace: FlexCel.Core

public TUnknownBlipTransform(String aTransformName, String aTransformDef)

Parameters

<-> | Parameter | Type | Description
 | aTransformName | String | Name of the transform.
 | aTransformDef | String | Transform definition as XML.

See also

  • TUnknownBlipTransform


TUnknownBlipTransform.Clone Method | FlexCel Studio for the .NET Framework documentation

TUnknownBlipTransform.Clone Method

Creates a deep copy of the object.

Syntax

Namespace: FlexCel.Core

public override TBlipTransform Clone()

See also

  • TUnknownBlipTransform


TUnknownBlipTransform.CompareTo Method | FlexCel Studio for the .NET Framework documentation

TUnknownBlipTransform.CompareTo Method

Compares two instances.

Syntax

Namespace: FlexCel.Core

public override Int32 CompareTo(TBlipTransform blipTransform)

Parameters

<-> | Parameter | Type | Description
 | blipTransform | TBlipTransform |

See also

  • TUnknownBlipTransform


TUnknownBlipTransform.Equals Method | FlexCel Studio for the .NET Framework documentation

TUnknownBlipTransform.Equals Method

Returns true if both objects have the same contents.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TUnknownBlipTransform


TUnknownBlipTransform.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TUnknownBlipTransform.GetHashCode Method

Returns the hashcode of the object.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TUnknownBlipTransform


TUnknownBlipTransform.TransformName Property | FlexCel Studio for the .NET Framework documentation

TUnknownBlipTransform.TransformName Property

Name of the transform.

Syntax

Namespace: FlexCel.Core

public String TransformName { get; }

See also

  • TUnknownBlipTransform


TUnknownBlipTransform.TransformDef Property | FlexCel Studio for the .NET Framework documentation

TUnknownBlipTransform.TransformDef Property

Transform definition as XML.

Syntax

Namespace: FlexCel.Core

public String TransformDef { get; }

See also

  • TUnknownBlipTransform


TUnknownChartOptions Class | FlexCel Studio for the .NET Framework documentation

TUnknownChartOptions Class

Options for an unknown chart. This class does not have any information except the charttype.

Syntax

Namespace: FlexCel.Core

public class TUnknownChartOptions: TChartOptions

Constructors

Name | Description
TUnknownChartOptions | Creates a new TUnknownChartOptions instance.

Methods

Name | Description
IsStacked | Returns true is the chart is stacked, either normally or 100% stacked.


TUnknownChartOptions.TUnknownChartOptions Constructor | FlexCel Studio for the .NET Framework documentation

TUnknownChartOptions.TUnknownChartOptions Constructor

Creates a new TUnknownChartOptions instance.

Syntax

Namespace: FlexCel.Core

public TUnknownChartOptions()

See also

  • TUnknownChartOptions


TUnknownChartOptions.IsStacked Method | FlexCel Studio for the .NET Framework documentation

TUnknownChartOptions.IsStacked Method

Returns true is the chart is stacked, either normally or 100% stacked.

Syntax

Namespace: FlexCel.Core

public override Boolean IsStacked()

See also

  • TUnknownChartOptions


TUnsupportedFormula Class | FlexCel Studio for the .NET Framework documentation

TUnsupportedFormula Class

An unsupported formula, the cell it is in, and the reason why it is not supported.

Syntax

Namespace: FlexCel.Core

public class TUnsupportedFormula

Constructors

Name | Description
TUnsupportedFormula | Overloaded TUnsupportedFormula TUnsupportedFormula(TUnsupportedFormulaErrorType, TCellAddress, String, String) TUnsupportedFormula(TUnsupportedFormulaErrorType, TCellAddress, String, String, TCellAddressWithFileName[])

Methods

Name | Description
GetHashCode | Hashcode for this object.
Equals | Returns true if both objects have the same values.

Properties

Name | Description
ErrorType | Type of error.
Cell | Cell where the formula is (1 based)
FunctionName | If the error is TUnsupported​Formula​Error​Type.​Missing​Function then this is the name of the missing function. If the error is TUnsupported​Formula​Error​Type.​External​Reference then this is the name of the file not found.
FileName | This property has the name of the physical file being evaluated, and can be of use when evaluating linked files. If the files are opened from a stream or not from a physical place, it will be null.
StackTrace | This property only has a value is the error is TUnsupported​Formula​Error​Type.​Circular​Reference. It contains a list of all the cells that lead to this cell having to recalculate itself. Note that this stack is limited to the last ExcelFile.​Cell​Stack​Trace​MaxSize elements to avoid consuming too much memory.


TUnsupportedFormula.TUnsupportedFormula Constructor | FlexCel Studio for the .NET Framework documentation

TUnsupportedFormula.TUnsupportedFormula Constructor

Overloads

  • TUnsupportedFormula.TUnsupportedFormula
  • TUnsupportedFormula.TUnsupportedFormula(TUnsupportedFormulaErrorType, TCellAddress, String, String)
  • TUnsupportedFormula.TUnsupportedFormula(TUnsupportedFormulaErrorType, TCellAddress, String, String, TCellAddressWithFileName[])

TUnsupportedFormula.TUnsupportedFormula

Creates a new empty instance.

Syntax

Namespace: FlexCel.Core

public TUnsupportedFormula()

See also

  • TUnsupportedFormula

TUnsupportedFormula.TUnsupportedFormula(TUnsupportedFormulaErrorType, TCellAddress, String, String)

Creates a new instance of a TUnsupported formula class.

Syntax

Namespace: FlexCel.Core

public TUnsupportedFormula(TUnsupportedFormulaErrorType aErrorType, TCellAddress aCell, String aFunctionName, String aFileName)

Parameters

<-> | Parameter | Type | Description
 | aErrorType | TUnsupported​Formula​Error​Type | See ErrorType
 | aCell | TCellAddress | See Cell
 | aFunctionName | String | See FunctionName
 | aFileName | String | See FileName

See also

  • TUnsupportedFormula

TUnsupportedFormula.TUnsupportedFormula(TUnsupportedFormulaErrorType, TCellAddress, String, String, TCellAddressWithFileName[])

Creates a new instance of a TUnsupported formula class.

Syntax

Namespace: FlexCel.Core

public TUnsupportedFormula(TUnsupportedFormulaErrorType aErrorType, TCellAddress aCell, String aFunctionName, String aFileName, TCellAddressWithFileName[] aStackTrace)

Parameters

<-> | Parameter | Type | Description
 | aErrorType | TUnsupported​Formula​Error​Type | See ErrorType
 | aCell | TCellAddress | See Cell
 | aFunctionName | String | See FunctionName
 | aFileName | String | See FileName
 | aStackTrace | TCellAddress​With​File​Name[] | See StackTrace

See also

  • TUnsupportedFormula


TUnsupportedFormula.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TUnsupportedFormula.GetHashCode Method

Hashcode for this object.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TUnsupportedFormula


TUnsupportedFormula.Equals Method | FlexCel Studio for the .NET Framework documentation

TUnsupportedFormula.Equals Method

Returns true if both objects have the same values.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TUnsupportedFormula


TUnsupportedFormula.ErrorType Property | FlexCel Studio for the .NET Framework documentation

TUnsupportedFormula.ErrorType Property

Type of error.

Syntax

Namespace: FlexCel.Core

public TUnsupportedFormulaErrorType ErrorType { get; set; }

See also

  • TUnsupportedFormula


TUnsupportedFormula.Cell Property | FlexCel Studio for the .NET Framework documentation

TUnsupportedFormula.Cell Property

Cell where the formula is (1 based)

Syntax

Namespace: FlexCel.Core

public TCellAddress Cell { get; set; }

See also

  • TUnsupportedFormula


TUnsupportedFormula.FunctionName Property | FlexCel Studio for the .NET Framework documentation

TUnsupportedFormula.FunctionName Property

If the error is TUnsupportedFormulaErrorType.MissingFunction then this is the name of the missing function. If the error is TUnsupportedFormulaErrorType.ExternalReference then this is the name of the file not found.

Syntax

Namespace: FlexCel.Core

public String FunctionName { get; set; }

See also

  • TUnsupportedFormula


TUnsupportedFormula.FileName Property | FlexCel Studio for the .NET Framework documentation

TUnsupportedFormula.FileName Property

This property has the name of the physical file being evaluated, and can be of use when evaluating linked files. If the files are opened from a stream or not from a physical place, it will be null.

Syntax

Namespace: FlexCel.Core

public String FileName { get; set; }

See also

  • TUnsupportedFormula


TUnsupportedFormula.StackTrace Property | FlexCel Studio for the .NET Framework documentation

TUnsupportedFormula.StackTrace Property

This property only has a value is the error is TUnsupportedFormulaErrorType.CircularReference. It contains a list of all the cells that lead to this cell having to recalculate itself. Note that this stack is limited to the last ExcelFile.CellStackTraceMaxSize elements to avoid consuming too much memory.

Syntax

Namespace: FlexCel.Core

public TCellAddressWithFileName[] StackTrace { get; set; }

See also

  • TUnsupportedFormula


TUnsupportedFormulaList Class | FlexCel Studio for the .NET Framework documentation

TUnsupportedFormulaList Class

A list of unsupported formulas on a sheet.

Syntax

Namespace: FlexCel.Core

public class TUnsupportedFormulaList

Methods

Name | Description
Add | Adds a new unsupported formula to the list.

Properties

Name | Description
Count | The number of errors on the list.
this[] | Returns the items at position index.


TUnsupportedFormulaList.Add Method | FlexCel Studio for the .NET Framework documentation

TUnsupportedFormulaList.Add Method

Adds a new unsupported formula to the list.

Syntax

Namespace: FlexCel.Core

public void Add(TUnsupportedFormula fmla)

Parameters

<-> | Parameter | Type | Description
 | fmla | TUnsupportedFormula | Unsupported formula.

See also

  • TUnsupportedFormulaList


TUnsupportedFormulaList.Count Property | FlexCel Studio for the .NET Framework documentation

TUnsupportedFormulaList.Count Property

The number of errors on the list.

Syntax

Namespace: FlexCel.Core

public Int32 Count { get; }

See also

  • TUnsupportedFormulaList


TUnsupportedFormulaList.this[] Property | FlexCel Studio for the .NET Framework documentation

TUnsupportedFormulaList.this[] Property

Returns the items at position index.

Syntax

Namespace: FlexCel.Core

public TUnsupportedFormula this[] { get; set; }

See also

  • TUnsupportedFormulaList


TUserDefinedFunction Class | FlexCel Studio for the .NET Framework documentation

TUserDefinedFunction Class

Inherit from this class to create your own user defined functions. Make sure you read 'Using Excel's user defined functions (UDF)' in the Api Developer Guide to get more information on what user defined functions are and how they are created.

Syntax

Namespace: FlexCel.Core

public abstract class TUserDefinedFunction

Constructors

Name | Description
TUserDefinedFunction | Overloaded TUserDefinedFunction(String) TUserDefinedFunction(String, String)

Methods

Name | Description
Evaluate | Override this method to provide your own implementation on the function. If this method throws an exception, it will not be handled and the recalculation will be aborted. So if you want to return an error, return a TFlxFormulaError​Value value. Do not use any global variable in this method, it must be stateless and always return the same value when called with the same arguments. See 'Using excels user defined functions udf' in the Api Developer Guide ...[more]
CheckParameters | Checks that the parameter array has the expected number of arguments, and that no one is an Error. If any argument is an error it is returned in ResultError, since the default in Excel is to stop processing arguments in a function when one is an error.
GetSingleParameter | Returns a single value from a parameter. If the parameter is a cell range and the cell range has only one cell, this method will return the value of the cell, else it will return an error.
TryGetDouble | Tries to retrieve a double from a parameter, and return it if it can be converted or an error if not.
TryGetDate | Tries to retrieve a date/time from a parameter, and return it if it can be converted or an error if not.
TryGetDoubleList | Tries to retrieve a list of double arguments from the parameters, starting at parameter startParam. Use this method for functions that accept a range of numeric values as an entry. (for example =Sum(a1:a10))
TryGetString | Tries to retrieve a string from a parameter, and return it if it can be converted or an error if not.
TryGetBoolean | Tries to retrieve a boolean from a parameter, and return it if it can be converted or an error if not.
TryGetCellRange | Tries to retrieve a cell range from a parameter, and return it if it can be converted or an error if not.
TryGetArray | Tries to retrieve an array from a parameter, and return it if it can be converted or an error if not.

Properties

Name | Description
Name | Name that will be assigned to the function.
InternalName | Name that will be used when saving xls (biff8) files. Some functions are saved by Excel 2010 as .xlfn_Name when saving xls (not xlsx). This is the name that should be saved in the xls file, not the real name of the function.


TUserDefinedFunction.TUserDefinedFunction Constructor | FlexCel Studio for the .NET Framework documentation

TUserDefinedFunction.TUserDefinedFunction Constructor

Overloads

  • TUserDefinedFunction.TUserDefinedFunction(String)
  • TUserDefinedFunction.TUserDefinedFunction(String, String)

TUserDefinedFunction.TUserDefinedFunction(String)

Initializes the name of the user defined function.

Syntax

Namespace: FlexCel.Core

protected TUserDefinedFunction(String aName)

Parameters

<-> | Parameter | Type | Description
 | aName | String | Name to be used in the user defined function. This is the same name that should be in the xls file.

See also

  • TUserDefinedFunction

TUserDefinedFunction.TUserDefinedFunction(String, String)

Initializes the name of the user defined function, with a special name for older Excel versions.

Syntax

Namespace: FlexCel.Core

protected TUserDefinedFunction(String aName, String aInternalName)

Parameters

<-> | Parameter | Type | Description
 | aName | String | Name to be used in the user defined function. This is the same name that should be in the xls file.
 | aInternalName | String | Name that will be used when saving xls (biff8) files. Some functions are saved by Excel 2010 as .xlfn_Name when saving xls (not xlsx). This is the name that should be saved in the xls file, not the real name of the function.

See also

  • TUserDefinedFunction


TUserDefinedFunction.Evaluate Method | FlexCel Studio for the .NET Framework documentation

TUserDefinedFunction.Evaluate Method

Override this method to provide your own implementation on the function.

If this method throws an exception, it will not be handled and the recalculation will be aborted. So if you want to return an error, return a TFlxFormulaErrorValue value.

Do not use any global variable in this method, it must be stateless and always return the same value when called with the same arguments.

See 'Using excels user defined functions udf' in the Api Developer Guide for more information.

Syntax

Namespace: FlexCel.Core

public abstract Object Evaluate(TUdfEventArgs arguments, Object[] parameters)

Parameters

<-> | Parameter | Type | Description
 | arguments | TUdfEventArgs | Extra objects you can use to evaluate the function.
 | parameters | Object[] | Parameters for the function. When this method is called by FlexCel, this parameter will never be null, but might be an array of zero length if there are no parameters. Each parameter in the array will always be one of the following objects: * Null. (Nothing in VB). If the parameter is empty or missing. * A "System.Boolean" * A "System.String" * A "System.Double" * A TXls3DRange This will be returned when the argument is a cell reference. * A TFlxFormulaErrorValue. Except in very special cases (like an IsError function), the expected behavior in Excel is that whenever you get an Error parameter your function should return the same error and exit. You can use the method CheckParameters to implement that. * A 2-dimensional array of objects, where each object in the array will be of any of the types mentioned here again. This class provides utility methods like TryGetDouble that will help you get a specific type of object from a parameter.

Returns

Return any object you want here. Normally a double, a string, a boolean a TFlxFormulaErrorValue or a null. If this method returns a class, it will be converted to an allowed value, normally to a string. If you want to return an array for an array formula, return a 2-dimensional array of objects (object?[,]) where the elements of the array are the values you want to return.

Examples

See 'Using excels user defined functions udf' in the Api Developer Guide for examples.

See also

  • TUserDefinedFunction


TUserDefinedFunction.CheckParameters Method | FlexCel Studio for the .NET Framework documentation

TUserDefinedFunction.CheckParameters Method

Checks that the parameter array has the expected number of arguments, and that no one is an Error. If any argument is an error it is returned in ResultError, since the default in Excel is to stop processing arguments in a function when one is an error.

Syntax

Namespace: FlexCel.Core

public static Boolean CheckParameters(Object[] parameters, Int32 expectedCount, out TFlxFormulaErrorValue ResultError)

Parameters

<-> | Parameter | Type | Description
 | parameters | Object[] | Array of parameters to check.
 | expectedCount | Int32 | Number of parameters expected. If this number is variable, specify -1 here.
out | ResultError | TFlxFormulaError​Value | Returns the error in the parameters. This parameter is only valid if this function returns false.

Returns

True if all parameters are correct, false otherwise.

See also

  • TUserDefinedFunction


TUserDefinedFunction.GetSingleParameter Method | FlexCel Studio for the .NET Framework documentation

TUserDefinedFunction.GetSingleParameter Method

Returns a single value from a parameter. If the parameter is a cell range and the cell range has only one cell, this method will return the value of the cell, else it will return an error.

Syntax

Namespace: FlexCel.Core

public static Object GetSingleParameter(ExcelFile xls, Object param)

Parameters

<-> | Parameter | Type | Description
 | xls | ExcelFile | ExcelFile that will be used to read the value if param is a cell reference.
 | param | Object | One of the parameters passed to Evaluate

See also

  • TUserDefinedFunction


TUserDefinedFunction.TryGetDouble Method | FlexCel Studio for the .NET Framework documentation

TUserDefinedFunction.TryGetDouble Method

Tries to retrieve a double from a parameter, and return it if it can be converted or an error if not.

Syntax

Namespace: FlexCel.Core

public static Boolean TryGetDouble(ExcelFile xls, Object param, out Double ResultValue, out TFlxFormulaErrorValue ResultError)

Parameters

<-> | Parameter | Type | Description
 | xls | ExcelFile | ExcelFile used to read the parameter when it is a cell reference.
 | param | Object | One of the parameters passed to Evaluate
out | ResultValue | Double | Value of the parameter as double. If TryGetDouble returns false, this value is undefined.
out | ResultError | TFlxFormulaError​Value | Value of the error when converting the parameter. If TryGetDouble returns true (there was no error), this value is undefined.

Returns

True if the parameter can be converted to a double, false if there was an error.

See also

  • TUserDefinedFunction


TUserDefinedFunction.TryGetDate Method | FlexCel Studio for the .NET Framework documentation

TUserDefinedFunction.TryGetDate Method

Tries to retrieve a date/time from a parameter, and return it if it can be converted or an error if not.

Syntax

Namespace: FlexCel.Core

public static Boolean TryGetDate(ExcelFile xls, Object param, Boolean SuppressTime, out DateTime ResultValue, out TFlxFormulaErrorValue ResultError)

Parameters

<-> | Parameter | Type | Description
 | xls | ExcelFile | ExcelFile used to read the parameter when it is a cell reference.
 | param | Object | One of the parameters passed to Evaluate
 | SuppressTime | Boolean | If true, the date returned will have the time set to 0:00 no matter the real value.
out | ResultValue | DateTime | Value of the parameter as double. If TryGetDate returns false, this value is undefined.
out | ResultError | TFlxFormulaError​Value | Value of the error when converting the parameter. If TryGetDate returns true (there was no error), this value is undefined.

Returns

True if the parameter can be converted to a datetime, false if there was an error.

See also

  • TUserDefinedFunction


TUserDefinedFunction.TryGetDoubleList Method | FlexCel Studio for the .NET Framework documentation

TUserDefinedFunction.TryGetDoubleList Method

Tries to retrieve a list of double arguments from the parameters, starting at parameter startParam. Use this method for functions that accept a range of numeric values as an entry. (for example =Sum(a1:a10))

Syntax

Namespace: FlexCel.Core

public Boolean TryGetDoubleList(ExcelFile Xls, Object[] parameters, Int32 startParam, Int32 endParam, IUserDefinedFunctionAggregator agg, out TFlxFormulaErrorValue Err)

Parameters

<-> | Parameter | Type | Description
 | Xls | ExcelFile | ExcelFile used to read the parameter when it is a cell reference.
 | parameters | Object[] | The parameters passed to the function.
 | startParam | Int32 | First parameter we want to evaluate.
 | endParam | Int32 | Last parameter we want to evaluate. If < 0, it will evaluate all parameters from startParam to parameters.Length
 | agg | IUserDefined​Function​Aggregator | A class descending from TUserDefinedFunctionAggregator that will process the values for every entry in the range.
out | Err | TFlxFormulaError​Value | Value of the error when converting the parameter. If TryGetDouble returns true (there was no error), this value is undefined.

See also

  • TUserDefinedFunction


TUserDefinedFunction.TryGetString Method | FlexCel Studio for the .NET Framework documentation

TUserDefinedFunction.TryGetString Method

Tries to retrieve a string from a parameter, and return it if it can be converted or an error if not.

Syntax

Namespace: FlexCel.Core

public static Boolean TryGetString(ExcelFile xls, Object param, out String ResultValue, out TFlxFormulaErrorValue ResultError)

Parameters

<-> | Parameter | Type | Description
 | xls | ExcelFile | ExcelFile used to read the parameter when it is a cell reference.
 | param | Object | One of the parameters passed to Evaluate
out | ResultValue | String | Value of the parameter as string. If TryGetString returns false, this value is undefined.
out | ResultError | TFlxFormulaError​Value | Value of the error when converting the parameter. If TryGetString returns true (there was no error), this value is undefined.

Returns

True if the parameter can be converted to a string, false if there was an error.

See also

  • TUserDefinedFunction


TUserDefinedFunction.TryGetBoolean Method | FlexCel Studio for the .NET Framework documentation

TUserDefinedFunction.TryGetBoolean Method

Tries to retrieve a boolean from a parameter, and return it if it can be converted or an error if not.

Syntax

Namespace: FlexCel.Core

public static Boolean TryGetBoolean(ExcelFile xls, Object param, out Boolean ResultValue, out TFlxFormulaErrorValue ResultError)

Parameters

<-> | Parameter | Type | Description
 | xls | ExcelFile | ExcelFile used to read the parameter when it is a cell reference.
 | param | Object | One of the parameters passed to Evaluate
out | ResultValue | Boolean | Value of the parameter as a boolean. If TryGetBoolean returns false, this value is undefined.
out | ResultError | TFlxFormulaError​Value | Value of the error when converting the parameter. If TryGetBoolean returns true (there was no error), this value is undefined.

Returns

True if the parameter can be converted to a boolean, false if there was an error.

See also

  • TUserDefinedFunction


TUserDefinedFunction.TryGetCellRange Method | FlexCel Studio for the .NET Framework documentation

TUserDefinedFunction.TryGetCellRange Method

Tries to retrieve a cell range from a parameter, and return it if it can be converted or an error if not.

Syntax

Namespace: FlexCel.Core

public static Boolean TryGetCellRange(Object param, out TXls3DRange ResultValue, out TFlxFormulaErrorValue ResultError)

Parameters

<-> | Parameter | Type | Description
 | param | Object | One of the parameters passed to Evaluate
out | ResultValue | TXls3DRange | Value of the parameter as a TXls3DRange. If TryGetRange returns false, this value is undefined.
out | ResultError | TFlxFormulaError​Value | Value of the error when converting the parameter. If TryGetCellRange returns true (there was no error), this value is undefined.

Returns

True if the parameter can be converted to a cell range, false if there was an error.

See also

  • TUserDefinedFunction


TUserDefinedFunction.TryGetArray Method | FlexCel Studio for the .NET Framework documentation

TUserDefinedFunction.TryGetArray Method

Tries to retrieve an array from a parameter, and return it if it can be converted or an error if not.

Syntax

Namespace: FlexCel.Core

public static Boolean TryGetArray(ExcelFile xls, Object param, out Object[, ] ResultValue, out TFlxFormulaErrorValue ResultError)

Parameters

<-> | Parameter | Type | Description
 | xls | ExcelFile | ExcelFile used to read the parameter when it is a cell reference.
 | param | Object | One of the parameters passed to Evaluate
out | ResultValue | Object[, ] | Value of the parameter as an array. If TryGetArray returns false, this value is undefined.
out | ResultError | TFlxFormulaError​Value | Value of the error when converting the parameter. If TryGetArray returns true (there was no error), this value is undefined.

Returns

True if the parameter can be converted to an array, false if there was an error.

See also

  • TUserDefinedFunction


TUserDefinedFunction.Name Property | FlexCel Studio for the .NET Framework documentation

TUserDefinedFunction.Name Property

Name that will be assigned to the function.

Syntax

Namespace: FlexCel.Core

public String Name { get; set; }

See also

  • TUserDefinedFunction


TUserDefinedFunction.InternalName Property | FlexCel Studio for the .NET Framework documentation

TUserDefinedFunction.InternalName Property

Name that will be used when saving xls (biff8) files. Some functions are saved by Excel 2010 as .xlfn_Name when saving xls (not xlsx). This is the name that should be saved in the xls file, not the real name of the function.

Syntax

Namespace: FlexCel.Core

public String InternalName { get; set; }

See also

  • TUserDefinedFunction


TValueAxis Class | FlexCel Studio for the .NET Framework documentation

TValueAxis Class

Information about an Axis of values. (normally the y axis)

Syntax

Namespace: FlexCel.Core

public class TValueAxis: TBaseAxis

Constructors

Name | Description
TValueAxis | Overloaded TValueAxis TValueAxis(Double, Double, Double, Double, Double, TValueAxisOptions, TFlxChartFont, String, Boolean, TAxisLineOptions, TAxisTickOptions, TDataLabel, TChartAxisPos) TValueAxis(Double, Double, Double, Double, Double, TValueAxisOptions, TFlxChartFont, String, Boolean, TAxisLineOptions, TAxisTickOptions, TDataLabel, TChartAxisPos, Double)

Properties

Name | Description
Min | Minimum value for the axis, when not set to automatic in AxisOptions.
Max | Maximum value for the axis, when not set to automatic in AxisOptions.
Major | Value for the major unit, when not set to automatic in AxisOptions.
Minor | Value for the minor unit, when not set to automatic in AxisOptions.
CrossValue | Value where the other Axis will cross this one, when not set to automatic in AxisOptions.
AxisOptions | Enumerates which of the other options contain valid values or are automatic.


TValueAxis.TValueAxis Constructor | FlexCel Studio for the .NET Framework documentation

TValueAxis.TValueAxis Constructor

Overloads

  • TValueAxis.TValueAxis
  • TValueAxis.TValueAxis(Double, Double, Double, Double, Double, TValueAxisOptions, TFlxChartFont, String, Boolean, TAxisLineOptions, TAxisTickOptions, TDataLabel, TChartAxisPos)
  • TValueAxis.TValueAxis(Double, Double, Double, Double, Double, TValueAxisOptions, TFlxChartFont, String, Boolean, TAxisLineOptions, TAxisTickOptions, TDataLabel, TChartAxisPos, Double)

TValueAxis.TValueAxis

Constructs a new TValueAxisOptions instance with all values set to automatic.

Syntax

Namespace: FlexCel.Core

public TValueAxis()

See also

  • TValueAxis

TValueAxis.TValueAxis(Double, Double, Double, Double, Double, TValueAxisOptions, TFlxChartFont, String, Boolean, TAxisLineOptions, TAxisTickOptions, TDataLabel, TChartAxisPos)

Constructs a new TValueAxisOptions instance.

Syntax

Namespace: FlexCel.Core

public TValueAxis(Double aMin, Double aMax, Double aMajor, Double aMinor, Double aCrossValue, TValueAxisOptions aAxisOptions, TFlxChartFont aFont, String aNumberFormat, Boolean aNumberFormatLinkedToSource, TAxisLineOptions aAxisLineOptions, TAxisTickOptions aTickOptions, TDataLabel aCaption, TChartAxisPos aAxisPos)

Parameters

<-> | Parameter | Type | Description
 | aMin | Double | See Min
 | aMax | Double | See Max
 | aMajor | Double | See Major
 | aMinor | Double | See Minor
 | aCrossValue | Double | See CrossValue
 | aAxisOptions | TValueAxisOptions | See AxisOptions
 | aFont | TFlxChartFont | See TBaseAxis.Font. This parameter will be cloned.
 | aNumberFormat | String | See TBaseAxis.NumberFormat
 | aNumberFormatLinkedToSource | Boolean | See TBaseAxis.NumberFormatLinkedToSource
 | aAxisLineOptions | TAxisLineOptions | See TBaseAxis.AxisLineOptions. This parameter will be cloned.
 | aTickOptions | TAxisTickOptions | See TBaseAxis.TickOptions. This parameter will be cloned.
 | aCaption | TDataLabel | See TBaseAxis.Caption This parameter will be cloned.
 | aAxisPos | TChartAxisPos | See TBaseAxis.AxisPos

See also

  • TValueAxis

TValueAxis.TValueAxis(Double, Double, Double, Double, Double, TValueAxisOptions, TFlxChartFont, String, Boolean, TAxisLineOptions, TAxisTickOptions, TDataLabel, TChartAxisPos, Double)

Constructs a new TValueAxisOptions instance.

Syntax

Namespace: FlexCel.Core

public TValueAxis(Double aMin, Double aMax, Double aMajor, Double aMinor, Double aCrossValue, TValueAxisOptions aAxisOptions, TFlxChartFont aFont, String aNumberFormat, Boolean aNumberFormatLinkedToSource, TAxisLineOptions aAxisLineOptions, TAxisTickOptions aTickOptions, TDataLabel aCaption, TChartAxisPos aAxisPos, Double aLogBase)

Parameters

<-> | Parameter | Type | Description
 | aMin | Double | See Min
 | aMax | Double | See Max
 | aMajor | Double | See Major
 | aMinor | Double | See Minor
 | aCrossValue | Double | See CrossValue
 | aAxisOptions | TValueAxisOptions | See AxisOptions
 | aFont | TFlxChartFont | See TBaseAxis.Font. This parameter will be cloned.
 | aNumberFormat | String | See TBaseAxis.NumberFormat
 | aNumberFormatLinkedToSource | Boolean | See TBaseAxis.NumberFormatLinkedToSource
 | aAxisLineOptions | TAxisLineOptions | See TBaseAxis.AxisLineOptions. This parameter will be cloned.
 | aTickOptions | TAxisTickOptions | See TBaseAxis.TickOptions. This parameter will be cloned.
 | aCaption | TDataLabel | See TBaseAxis.Caption This parameter will be cloned.
 | aAxisPos | TChartAxisPos | See TBaseAxis.AxisPos
 | aLogBase | Double | See TBaseAxis.LogBase

See also

  • TValueAxis


TValueAxis.Min Property | FlexCel Studio for the .NET Framework documentation

TValueAxis.Min Property

Minimum value for the axis, when not set to automatic in AxisOptions.

Syntax

Namespace: FlexCel.Core

public Double Min { get; set; }

See also

  • TValueAxis


TValueAxis.Max Property | FlexCel Studio for the .NET Framework documentation

TValueAxis.Max Property

Maximum value for the axis, when not set to automatic in AxisOptions.

Syntax

Namespace: FlexCel.Core

public Double Max { get; set; }

See also

  • TValueAxis


TValueAxis.Major Property | FlexCel Studio for the .NET Framework documentation

TValueAxis.Major Property

Value for the major unit, when not set to automatic in AxisOptions.

Syntax

Namespace: FlexCel.Core

public Double Major { get; set; }

See also

  • TValueAxis


TValueAxis.Minor Property | FlexCel Studio for the .NET Framework documentation

TValueAxis.Minor Property

Value for the minor unit, when not set to automatic in AxisOptions.

Syntax

Namespace: FlexCel.Core

public Double Minor { get; set; }

See also

  • TValueAxis


TValueAxis.CrossValue Property | FlexCel Studio for the .NET Framework documentation

TValueAxis.CrossValue Property

Value where the other Axis will cross this one, when not set to automatic in AxisOptions.

Syntax

Namespace: FlexCel.Core

public Double CrossValue { get; set; }

See also

  • TValueAxis


TValueAxis.AxisOptions Property | FlexCel Studio for the .NET Framework documentation

TValueAxis.AxisOptions Property

Enumerates which of the other options contain valid values or are automatic.

Syntax

Namespace: FlexCel.Core

public TValueAxisOptions AxisOptions { get; set; }

See also

  • TValueAxis


TWorkbookProtectionOptions Class | FlexCel Studio for the .NET Framework documentation

TWorkbookProtectionOptions Class

Options for protecting the workbook.

Syntax

Namespace: FlexCel.Core

public sealed class TWorkbookProtectionOptions

Constructors

Name | Description
TWorkbookProtection​Options | Overloaded TWorkbookProtectionOptions TWorkbookProtectionOptions(Boolean, Boolean)

Properties

Name | Description
Window | Window is protected.
Structure | Structure is protected.


TWorkbookProtectionOptions.TWorkbookProtectionOptions Constructor | FlexCel Studio for the .NET Framework documentation

TWorkbookProtectionOptions.TWorkbookProtectionOptions Constructor

Overloads

  • TWorkbookProtectionOptions.TWorkbookProtectionOptions
  • TWorkbookProtectionOptions.TWorkbookProtectionOptions(Boolean, Boolean)

TWorkbookProtectionOptions.TWorkbookProtectionOptions

Initializes empty protection.

Syntax

Namespace: FlexCel.Core

public TWorkbookProtectionOptions()

See also

  • TWorkbookProtectionOptions

TWorkbookProtectionOptions.TWorkbookProtectionOptions(Boolean, Boolean)

Initializes the class.

Syntax

Namespace: FlexCel.Core

public TWorkbookProtectionOptions(Boolean aWindow, Boolean aStructure)

Parameters

<-> | Parameter | Type | Description
 | aWindow | Boolean | True if the window will be protected.
 | aStructure | Boolean | True if the structure will be protected.

See also

  • TWorkbookProtectionOptions


TWorkbookProtectionOptions.Window Property | FlexCel Studio for the .NET Framework documentation

TWorkbookProtectionOptions.Window Property

Window is protected.

Syntax

Namespace: FlexCel.Core

public Boolean Window { get; set; }

See also

  • TWorkbookProtectionOptions


TWorkbookProtectionOptions.Structure Property | FlexCel Studio for the .NET Framework documentation

TWorkbookProtectionOptions.Structure Property

Structure is protected.

Syntax

Namespace: FlexCel.Core

public Boolean Structure { get; set; }

See also

  • TWorkbookProtectionOptions


TWorkspace Class | FlexCel Studio for the .NET Framework documentation

TWorkspace Class

This class links together a group of spreadsheets, so you can recalculate among linked spreadsheets. In order to use it, just define an object of this class and add all the files you need for the linked recalculation. If you don't know in advance which files you will need, you can use the LoadLinkedFile event.

Note that whenever you recalculate any file in the workspace, all files will be recalculated, so you don't need to calculate them twice.

Remarks

Files are case insensitive, even if running in Linux. "a.xls" is the same as "A.XLS"

Syntax

Namespace: FlexCel.Core

public class TWorkspace: IEnumerable, IEnumerable<ExcelFile>

Constructors

Name | Description
TWorkspace | Creates a new workspace.

Methods

Name | Description
Add | Adds a file to the workspace. Whenever you recalculate any file in this workspace, all linked files will be recalculated too. Note that you can't add two files with the same name or same reference twice to this collection.
GetFile | Returns the file at index.
Clear | Removes all files from the workspace.
Recalc | Use this method to force a recalculation of all the spreadsheets in the workspace. This is the same as calling Recalc() in any of the files in the workspace.
RecalcAndVerify | This method will do the same as ExcelFile.​Recalc​AndVerify, but for a workspace of files.
GetEnumerator | Returns an enumerator with all the files in the Workspace.
OnLoadLinkedFile | Replace this event when creating a custom descendant of TWorkspace. See also LoadLinkedFile

Properties

Name | Description
CellStackTrace​MaxSize | Defines what is the maximum number of entries returned in the stack trace when calling RecalcAndVerify. In order to keep the stack trace not too big this number is limited, but if you need a bigger stack trace to see the full loop of cells you can increase this number.
Count | Number of linked files in this workspace.
this[] | Returns the Excel file with the given name. To get the file at a given position, use GetFile

Events

Name | Description
LoadLinkedFile | Use this event to load files to recalculate on demand, if you don't know a priori which linked files you need. Note that this event will add the new file to the workspace. It will only be called once for each file, even if the file is used many times.

Examples

If you have 3 files, xls1, xls2 and xls3, you can recalculate them together with the following code:

    XlsFile xls1 = new XlsFile("File1.xlsx");
    XlsFile xls2 = new XlsFile("File2.xlsx");
    XlsFile xls3 = new XlsFile("File3.xlsx");

    TWorkspace work = new TWorkspace();
    work.Add("xls1", xls1);
    work.Add("xls2", xls2);
    work.Add("xls3", xls3);

    //Either work.Recalc, xls1.Recalc, xls2.Recalc or xls3.Recalc will recalculate all the files in the workspace.
    work.Recalc(true);


TWorkspace.TWorkspace Constructor | FlexCel Studio for the .NET Framework documentation

TWorkspace.TWorkspace Constructor

Creates a new workspace.

Syntax

Namespace: FlexCel.Core

public TWorkspace()

See also

  • TWorkspace


TWorkspace.Add Method | FlexCel Studio for the .NET Framework documentation

TWorkspace.Add Method

Adds a file to the workspace. Whenever you recalculate any file in this workspace, all linked files will be recalculated too. Note that you can't add two files with the same name or same reference twice to this collection.

Syntax

Namespace: FlexCel.Core

public void Add(String FileName, ExcelFile xls)

Parameters

<-> | Parameter | Type | Description
 | FileName | String | Name that this file will have in the workspace. When recalculating a linked formula, this name will be used. If you want to include paths in the name you can too, but it is normally not needed since FlexCel will search for the simple filename anyway. You only need to include paths if you have 2 files with the same name in different folders used in the recalculation.
 | xls | ExcelFile | Excel file to add.

See also

  • TWorkspace


TWorkspace.GetFile Method | FlexCel Studio for the .NET Framework documentation

TWorkspace.GetFile Method

Returns the file at index.

Syntax

Namespace: FlexCel.Core

public ExcelFile GetFile(Int32 index)

Parameters

<-> | Parameter | Type | Description
 | index | Int32 | Index of the file in the workspace. (1 based)

See also

  • TWorkspace


TWorkspace.Clear Method | FlexCel Studio for the .NET Framework documentation

TWorkspace.Clear Method

Removes all files from the workspace.

Syntax

Namespace: FlexCel.Core

public void Clear()

See also

  • TWorkspace


TWorkspace.Recalc Method | FlexCel Studio for the .NET Framework documentation

TWorkspace.Recalc Method

Use this method to force a recalculation of all the spreadsheets in the workspace. This is the same as calling Recalc() in any of the files in the workspace.

Syntax

Namespace: FlexCel.Core

public void Recalc(Boolean forced)

Parameters

<-> | Parameter | Type | Description
 | forced | Boolean | When true this method will perform a recalc in all files. When false, it will only recalculate the files where there has been a change.

See also

  • TWorkspace


TWorkspace.RecalcAndVerify Method | FlexCel Studio for the .NET Framework documentation

TWorkspace.RecalcAndVerify Method

This method will do the same as ExcelFile.RecalcAndVerify, but for a workspace of files.

Syntax

Namespace: FlexCel.Core

public TUnsupportedFormulaList RecalcAndVerify()

See also

  • TWorkspace


TWorkspace.GetEnumerator Method | FlexCel Studio for the .NET Framework documentation

TWorkspace.GetEnumerator Method

Returns an enumerator with all the files in the Workspace.

Syntax

Namespace: FlexCel.Core

public IEnumerator GetEnumerator()

See also

  • TWorkspace


TWorkspace.OnLoadLinkedFile Method | FlexCel Studio for the .NET Framework documentation

TWorkspace.OnLoadLinkedFile Method

Replace this event when creating a custom descendant of TWorkspace. See also LoadLinkedFile

Syntax

Namespace: FlexCel.Core

protected virtual void OnLoadLinkedFile(LoadLinkedFileEventArgs e)

Parameters

<-> | Parameter | Type | Description
 | e | LoadLinkedFile​Event​Args |

See also

  • TWorkspace


TWorkspace.CellStackTraceMaxSize Property | FlexCel Studio for the .NET Framework documentation

TWorkspace.CellStackTraceMaxSize Property

Defines what is the maximum number of entries returned in the stack trace when calling RecalcAndVerify. In order to keep the stack trace not too big this number is limited, but if you need a bigger stack trace to see the full loop of cells you can increase this number.

Syntax

Namespace: FlexCel.Core

public Int32 CellStackTraceMaxSize { get; set; }

See also

  • TWorkspace


TWorkspace.Count Property | FlexCel Studio for the .NET Framework documentation

TWorkspace.Count Property

Number of linked files in this workspace.

Syntax

Namespace: FlexCel.Core

public Int32 Count { get; }

See also

  • TWorkspace


TWorkspace.this[] Property | FlexCel Studio for the .NET Framework documentation

TWorkspace.this[] Property

Returns the Excel file with the given name. To get the file at a given position, use GetFile

Syntax

Namespace: FlexCel.Core

public ExcelFile this[] { get; }

See also

  • TWorkspace


TWorkspace.LoadLinkedFile Event | FlexCel Studio for the .NET Framework documentation

TWorkspace.LoadLinkedFile Event

Use this event to load files to recalculate on demand, if you don't know a priori which linked files you need. Note that this event will add the new file to the workspace. It will only be called once for each file, even if the file is used many times.

Syntax

Namespace: FlexCel.Core

public LoadLinkedFileEventHandler LoadLinkedFile

See also

  • TWorkspace


TXls3DRange Class | FlexCel Studio for the .NET Framework documentation

TXls3DRange Class

A 3d Excel range.

Syntax

Namespace: FlexCel.Core

public class TXls3DRange: TXlsCellRange

Constructors

Name Description
TXls3DRange Overloaded
 TXls3DRange
TXls3DRange(ExcelFile, String)
TXls3DRange(Int32, Int32, Int32, Int32, Int32, Int32)
TXls3DRange(String, Int32, Int32, Int32, Int32, Int32, Int32)

Methods

Name | Description
SetRange3DRef | Sets the value of the 3d range based on the string that defines the range in A1 notation.
TrySetRange3DRef | Tries to set the value of the 3d range based on the string that defines the range in A1 notation. If the name can't be set, no data is modified and this method returns false.
Equals | Returns true if both objects are equal.
GetHashCode | Returns the hashcode of the object.

Operators

Name | Description
Equality | Returns true if both objects are equal. Note this is for backwards compatibility, this is a class and not immutable, so this method should return true if references are different. But that would break old code.
Inequality | Returns true if both objects do not have the same value. Note this is for backwards compatibility, this is a class and not immutable, so this method should return true if references are different. But that would break old code.

Properties

Name | Description
IsOneCell | Returns true if the range has only one cell.
FileName | Filename if the range is in a different file.
Sheet1 | First sheet of the range.
Sheet2 | Second sheet of the range.


TXls3DRange.TXls3DRange Constructor | FlexCel Studio for the .NET Framework documentation

TXls3DRange.TXls3DRange Constructor

Overloads

  • TXls3DRange.TXls3DRange
  • TXls3DRange.TXls3DRange(ExcelFile, String)
  • TXls3DRange.TXls3DRange(Int32, Int32, Int32, Int32, Int32, Int32)
  • TXls3DRange.TXls3DRange(String, Int32, Int32, Int32, Int32, Int32, Int32)

TXls3DRange.TXls3DRange

Creates an empty 3d range.

Syntax

Namespace: FlexCel.Core

public TXls3DRange()

See also

  • TXls3DRange

TXls3DRange.TXls3DRange(ExcelFile, String)

Creates a new TXls3DRange from a range string like "Sheet1:Sheet2!D4"

Syntax

Namespace: FlexCel.Core

public TXls3DRange(ExcelFile xls, String rangeDef)

Parameters

<-> | Parameter | Type | Description
 | xls | ExcelFile | Excel file with the sheet definitions.
 | rangeDef | String | String defining the name.

See also

  • TXls3DRange

TXls3DRange.TXls3DRange(Int32, Int32, Int32, Int32, Int32, Int32)

Creates a new TXls3DRange class.

Syntax

Namespace: FlexCel.Core

public TXls3DRange(Int32 aSheet1, Int32 aSheet2, Int32 aFirstRow, Int32 aFirstCol, Int32 aLastRow, Int32 aLastCol)

Parameters

<-> | Parameter | Type | Description
 | aSheet1 | Int32 | First sheet of the range.
 | aSheet2 | Int32 | Second sheet of the range.
 | aFirstRow | Int32 | First row on range.
 | aFirstCol | Int32 | First column on range.
 | aLastRow | Int32 | Last row on range.
 | aLastCol | Int32 | Last column on range.

See also

  • TXls3DRange

TXls3DRange.TXls3DRange(String, Int32, Int32, Int32, Int32, Int32, Int32)

Creates a new TXls3DRange class.

Syntax

Namespace: FlexCel.Core

public TXls3DRange(String aFileName, Int32 aSheet1, Int32 aSheet2, Int32 aFirstRow, Int32 aFirstCol, Int32 aLastRow, Int32 aLastCol)

Parameters

<-> | Parameter | Type | Description
 | aFileName | String | Filename with the range if this range is in a linked file.
 | aSheet1 | Int32 | First sheet of the range.
 | aSheet2 | Int32 | Second sheet of the range.
 | aFirstRow | Int32 | First row on range.
 | aFirstCol | Int32 | First column on range.
 | aLastRow | Int32 | Last row on range.
 | aLastCol | Int32 | Last column on range.

See also

  • TXls3DRange


TXls3DRange.SetRange3DRef Method | FlexCel Studio for the .NET Framework documentation

TXls3DRange.SetRange3DRef Method

Sets the value of the 3d range based on the string that defines the range in A1 notation.

Syntax

Namespace: FlexCel.Core

public void SetRange3DRef(ExcelFile xls, String rangeDef)

Parameters

<-> | Parameter | Type | Description
 | xls | ExcelFile | ExcelFile where the range is defined.
 | rangeDef | String | String that defines the range, like for example "=[Sheet2:Sheet3]!A1:A3

See also

  • TXls3DRange


TXls3DRange.TrySetRange3DRef Method | FlexCel Studio for the .NET Framework documentation

TXls3DRange.TrySetRange3DRef Method

Tries to set the value of the 3d range based on the string that defines the range in A1 notation. If the name can't be set, no data is modified and this method returns false.

Syntax

Namespace: FlexCel.Core

public Boolean TrySetRange3DRef(ExcelFile xls, String rangeDef)

Parameters

<-> | Parameter | Type | Description
 | xls | ExcelFile | ExcelFile where the range is defined.
 | rangeDef | String | String that defines the range, like for example "=[Sheet2:Sheet3]!A1:A3

See also

  • TXls3DRange


TXls3DRange.Equals Method | FlexCel Studio for the .NET Framework documentation

TXls3DRange.Equals Method

Returns true if both objects are equal.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TXls3DRange


TXls3DRange.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TXls3DRange.GetHashCode Method

Returns the hashcode of the object.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TXls3DRange


TXls3DRange.Equality Operator | FlexCel Studio for the .NET Framework documentation

TXls3DRange.Equality Operator

Returns true if both objects are equal. Note this is for backwards compatibility, this is a class and not immutable, so this method should return true if references are different. But that would break old code.

Syntax

Namespace: FlexCel.Core

public static Boolean op_Equality(TXls3DRange o1, TXls3DRange o2)

Parameters

<-> | Parameter | Type | Description
 | o1 | TXls3DRange |
 | o2 | TXls3DRange |

See also

  • TXls3DRange


TXls3DRange.Inequality Operator | FlexCel Studio for the .NET Framework documentation

TXls3DRange.Inequality Operator

Returns true if both objects do not have the same value. Note this is for backwards compatibility, this is a class and not immutable, so this method should return true if references are different. But that would break old code.

Syntax

Namespace: FlexCel.Core

public static Boolean op_Inequality(TXls3DRange s1, TXls3DRange s2)

Parameters

<-> | Parameter | Type | Description
 | s1 | TXls3DRange |
 | s2 | TXls3DRange |

See also

  • TXls3DRange


TXls3DRange.IsOneCell Property | FlexCel Studio for the .NET Framework documentation

TXls3DRange.IsOneCell Property

Returns true if the range has only one cell.

Syntax

Namespace: FlexCel.Core

public override Boolean IsOneCell { get; }

See also

  • TXls3DRange


TXls3DRange.FileName Property | FlexCel Studio for the .NET Framework documentation

TXls3DRange.FileName Property

Filename if the range is in a different file.

Syntax

Namespace: FlexCel.Core

public String FileName { get; set; }

See also

  • TXls3DRange


TXls3DRange.Sheet1 Property | FlexCel Studio for the .NET Framework documentation

TXls3DRange.Sheet1 Property

First sheet of the range.

Syntax

Namespace: FlexCel.Core

public Int32 Sheet1 { get; set; }

See also

  • TXls3DRange


TXls3DRange.Sheet2 Property | FlexCel Studio for the .NET Framework documentation

TXls3DRange.Sheet2 Property

Second sheet of the range.

Syntax

Namespace: FlexCel.Core

public Int32 Sheet2 { get; set; }

See also

  • TXls3DRange


TXlsCellRange Class | FlexCel Studio for the .NET Framework documentation

TXlsCellRange Class

An Excel Cell range, 1-based.

Syntax

Namespace: FlexCel.Core

public class TXlsCellRange: ICloneable

Fields

Name | Description
Top | First row on range.
Left | First column on range.
Bottom | Last row on range.
Right | Last column on range.

Constructors

Name | Description
TXlsCellRange | Overloaded TXlsCellRange TXlsCellRange(String) TXlsCellRange(Int32, Int32, Int32, Int32)

Methods

Name | Description
FullRange | Creates a range with all cells on the sheet (65536 rows x 256 columns in Excel 97-2003)
Transpose | Returns the range transposed, rows by columns.
Clone | Returns a copy of the original range.
Offset | Creates a new range with the start at newTopRow, newLeftCol.
HasRow | True if the specified row is in the range
HasCol | True if the specified column is in the range
CalcTopCell | Returns the minimum top and left coordinates for an array of ranges. If for example you have C7 and D5, this method will return C5
Dec | Returns a COPY of the range decremented by one.
Inc | Returns a COPY of the range incremented by one.
Equals | Returns true if both objects are equal.
GetHashCode | Returns the hashcode of the object.
Contains | Returns true if the cell is inside the range.
ToString | A human-readable representation of the range.

Operators

Name | Description
Equality | Returns true if both objects are equal. Note this is for backwards compatibility, this is a class and not immutable, so this method should return true if references are different. But that would break old code.
Inequality | Returns true if both objects do not have the same value. Note this is for backwards compatibility, this is a class and not immutable, so this method should return true if references are different. But that would break old code.

Properties

Name | Description
IsOneCell | Returns true if the range has only one cell.
RowCount | Number of rows on the range.
ColCount | Number of columns on the range.
CellRef | Gets or sets the string that defines the 2D-range in A1 notation.


TXlsCellRange.Top Field | FlexCel Studio for the .NET Framework documentation

TXlsCellRange.Top Field

First row on range.

Syntax

Namespace: FlexCel.Core

public Int32 Top

See also

  • TXlsCellRange


TXlsCellRange.Left Field | FlexCel Studio for the .NET Framework documentation

TXlsCellRange.Left Field

First column on range.

Syntax

Namespace: FlexCel.Core

public Int32 Left

See also

  • TXlsCellRange


TXlsCellRange.Bottom Field | FlexCel Studio for the .NET Framework documentation

TXlsCellRange.Bottom Field

Last row on range.

Syntax

Namespace: FlexCel.Core

public Int32 Bottom

See also

  • TXlsCellRange


TXlsCellRange.Right Field | FlexCel Studio for the .NET Framework documentation

TXlsCellRange.Right Field

Last column on range.

Syntax

Namespace: FlexCel.Core

public Int32 Right

See also

  • TXlsCellRange


TXlsCellRange.TXlsCellRange Constructor | FlexCel Studio for the .NET Framework documentation

TXlsCellRange.TXlsCellRange Constructor

Overloads

  • TXlsCellRange.TXlsCellRange
  • TXlsCellRange.TXlsCellRange(String)
  • TXlsCellRange.TXlsCellRange(Int32, Int32, Int32, Int32)

TXlsCellRange.TXlsCellRange

Creates an empty Cell range.

Syntax

Namespace: FlexCel.Core

public TXlsCellRange()

See also

  • TXlsCellRange

TXlsCellRange.TXlsCellRange(String)

Creates a cell range based in an Excel range string, like "A1:A10"

Syntax

Namespace: FlexCel.Core

public TXlsCellRange(String rangeDef)

Parameters

<-> | Parameter | Type | Description
 | rangeDef | String | Definition for the range, in Excel A1 notation. For example A1:B3

See also

  • TXlsCellRange

TXlsCellRange.TXlsCellRange(Int32, Int32, Int32, Int32)

Creates a new TXlsCellRange class.

Syntax

Namespace: FlexCel.Core

public TXlsCellRange(Int32 aFirstRow, Int32 aFirstCol, Int32 aLastRow, Int32 aLastCol)

Parameters

<-> | Parameter | Type | Description
 | aFirstRow | Int32 | First row on range.
 | aFirstCol | Int32 | First column on range.
 | aLastRow | Int32 | Last row on range.
 | aLastCol | Int32 | Last column on range.

See also

  • TXlsCellRange


TXlsCellRange.FullRange Method | FlexCel Studio for the .NET Framework documentation

TXlsCellRange.FullRange Method

Creates a range with all cells on the sheet (65536 rows x 256 columns in Excel 97-2003)

Syntax

Namespace: FlexCel.Core

public static TXlsCellRange FullRange()

See also

  • TXlsCellRange


TXlsCellRange.Transpose Method | FlexCel Studio for the .NET Framework documentation

TXlsCellRange.Transpose Method

Returns the range transposed, rows by columns.

Syntax

Namespace: FlexCel.Core

public TXlsCellRange Transpose()

See also

  • TXlsCellRange


TXlsCellRange.Clone Method | FlexCel Studio for the .NET Framework documentation

TXlsCellRange.Clone Method

Returns a copy of the original range.

Syntax

Namespace: FlexCel.Core

public Object Clone()

See also

  • TXlsCellRange


TXlsCellRange.Offset Method | FlexCel Studio for the .NET Framework documentation

TXlsCellRange.Offset Method

Creates a new range with the start at newTopRow, newLeftCol.

Syntax

Namespace: FlexCel.Core

public TXlsCellRange Offset(Int32 newTopRow, Int32 newLeftCol)

Parameters

<-> | Parameter | Type | Description
 | newTopRow | Int32 |
 | newLeftCol | Int32 |

See also

  • TXlsCellRange


TXlsCellRange.HasRow Method | FlexCel Studio for the .NET Framework documentation

TXlsCellRange.HasRow Method

True if the specified row is in the range

Syntax

Namespace: FlexCel.Core

public Boolean HasRow(Int32 row)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row we want to know if is on the range.

See also

  • TXlsCellRange


TXlsCellRange.HasCol Method | FlexCel Studio for the .NET Framework documentation

TXlsCellRange.HasCol Method

True if the specified column is in the range

Syntax

Namespace: FlexCel.Core

public Boolean HasCol(Int32 col)

Parameters

<-> | Parameter | Type | Description
 | col | Int32 | Column we want to know if is on the range.

See also

  • TXlsCellRange


TXlsCellRange.CalcTopCell Method | FlexCel Studio for the .NET Framework documentation

TXlsCellRange.CalcTopCell Method

Returns the minimum top and left coordinates for an array of ranges. If for example you have C7 and D5, this method will return C5

Syntax

Namespace: FlexCel.Core

public static TCellAddress CalcTopCell(TXlsCellRange[] ranges, Boolean ResultBase1)

Parameters

<-> | Parameter | Type | Description
 | ranges | TXlsCellRange[] | An array of ranges, 1 based.
 | ResultBase1 | Boolean | If true, the address will be in base 1 (1, 1 is the top cell). If false, (0, 0) will be the top cell for the returned address.

See also

  • TXlsCellRange


TXlsCellRange.Dec Method | FlexCel Studio for the .NET Framework documentation

TXlsCellRange.Dec Method

Returns a COPY of the range decremented by one.

Syntax

Namespace: FlexCel.Core

public TXlsCellRange Dec()

See also

  • TXlsCellRange


TXlsCellRange.Inc Method | FlexCel Studio for the .NET Framework documentation

TXlsCellRange.Inc Method

Returns a COPY of the range incremented by one.

Syntax

Namespace: FlexCel.Core

public TXlsCellRange Inc()

See also

  • TXlsCellRange


TXlsCellRange.Equals Method | FlexCel Studio for the .NET Framework documentation

TXlsCellRange.Equals Method

Returns true if both objects are equal.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TXlsCellRange


TXlsCellRange.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TXlsCellRange.GetHashCode Method

Returns the hashcode of the object.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TXlsCellRange


TXlsCellRange.Contains Method | FlexCel Studio for the .NET Framework documentation

TXlsCellRange.Contains Method

Returns true if the cell is inside the range.

Syntax

Namespace: FlexCel.Core

public Boolean Contains(Int32 R1, Int32 C1)

Parameters

<-> | Parameter | Type | Description
 | R1 | Int32 |
 | C1 | Int32 |

See also

  • TXlsCellRange


TXlsCellRange.ToString Method | FlexCel Studio for the .NET Framework documentation

TXlsCellRange.ToString Method

A human-readable representation of the range.

Syntax

Namespace: FlexCel.Core

public override String ToString()

See also

  • TXlsCellRange


TXlsCellRange.Equality Operator | FlexCel Studio for the .NET Framework documentation

TXlsCellRange.Equality Operator

Returns true if both objects are equal. Note this is for backwards compatibility, this is a class and not immutable, so this method should return true if references are different. But that would break old code.

Syntax

Namespace: FlexCel.Core

public static Boolean op_Equality(TXlsCellRange o1, TXlsCellRange o2)

Parameters

<-> | Parameter | Type | Description
 | o1 | TXlsCellRange |
 | o2 | TXlsCellRange |

See also

  • TXlsCellRange


TXlsCellRange.Inequality Operator | FlexCel Studio for the .NET Framework documentation

TXlsCellRange.Inequality Operator

Returns true if both objects do not have the same value. Note this is for backwards compatibility, this is a class and not immutable, so this method should return true if references are different. But that would break old code.

Syntax

Namespace: FlexCel.Core

public static Boolean op_Inequality(TXlsCellRange s1, TXlsCellRange s2)

Parameters

<-> | Parameter | Type | Description
 | s1 | TXlsCellRange |
 | s2 | TXlsCellRange |

See also

  • TXlsCellRange


TXlsCellRange.IsOneCell Property | FlexCel Studio for the .NET Framework documentation

TXlsCellRange.IsOneCell Property

Returns true if the range has only one cell.

Syntax

Namespace: FlexCel.Core

public virtual Boolean IsOneCell { get; }

See also

  • TXlsCellRange


TXlsCellRange.RowCount Property | FlexCel Studio for the .NET Framework documentation

TXlsCellRange.RowCount Property

Number of rows on the range.

Syntax

Namespace: FlexCel.Core

public Int32 RowCount { get; }

See also

  • TXlsCellRange


TXlsCellRange.ColCount Property | FlexCel Studio for the .NET Framework documentation

TXlsCellRange.ColCount Property

Number of columns on the range.

Syntax

Namespace: FlexCel.Core

public Int32 ColCount { get; }

See also

  • TXlsCellRange


TXlsCellRange.CellRef Property | FlexCel Studio for the .NET Framework documentation

TXlsCellRange.CellRef Property

Gets or sets the string that defines the 2D-range in A1 notation.

Syntax

Namespace: FlexCel.Core

public String CellRef { get; set; }

See also

  • TXlsCellRange


TXlsMargins Class | FlexCel Studio for the .NET Framework documentation

TXlsMargins Class

Sheet margin for printing, in inches.

Syntax

Namespace: FlexCel.Core

public class TXlsMargins

Constructors

Name | Description
TXlsMargins | Overloaded TXlsMargins TXlsMargins(Double, Double, Double, Double, Double, Double)

Properties

Name | Description
Left | Left Margin in inches.
Top | Top Margin in inches.
Right | Right Margin in inches.
Bottom | Bottom Margin in inches.
Header | Header Margin in inches. Space for the header at top of page, it is taken from Top margin.
Footer | Footer Margin in inches. Space for the footer at bottom of page, it is taken from Bottom margin.


TXlsMargins.TXlsMargins Constructor | FlexCel Studio for the .NET Framework documentation

TXlsMargins.TXlsMargins Constructor

Overloads

  • TXlsMargins.TXlsMargins
  • TXlsMargins.TXlsMargins(Double, Double, Double, Double, Double, Double)

TXlsMargins.TXlsMargins

Creates default Margins

Syntax

Namespace: FlexCel.Core

public TXlsMargins()

See also

  • TXlsMargins

TXlsMargins.TXlsMargins(Double, Double, Double, Double, Double, Double)

Creates Personalized Margins. All units are in inches.

Syntax

Namespace: FlexCel.Core

public TXlsMargins(Double aLeft, Double aTop, Double aRight, Double aBottom, Double aHeader, Double aFooter)

Parameters

<-> | Parameter | Type | Description
 | aLeft | Double | Left margin in inches.
 | aTop | Double | Top margin in inches.
 | aRight | Double | Right margin in inches.
 | aBottom | Double | Bottom margin in inches.
 | aHeader | Double | Header margin in inches.
 | aFooter | Double | Footer margin in inches.

See also

  • TXlsMargins


TXlsMargins.Left Property | FlexCel Studio for the .NET Framework documentation

TXlsMargins.Left Property

Left Margin in inches.

Syntax

Namespace: FlexCel.Core

public Double Left { get; set; }

See also

  • TXlsMargins


TXlsMargins.Top Property | FlexCel Studio for the .NET Framework documentation

TXlsMargins.Top Property

Top Margin in inches.

Syntax

Namespace: FlexCel.Core

public Double Top { get; set; }

See also

  • TXlsMargins


TXlsMargins.Right Property | FlexCel Studio for the .NET Framework documentation

TXlsMargins.Right Property

Right Margin in inches.

Syntax

Namespace: FlexCel.Core

public Double Right { get; set; }

See also

  • TXlsMargins


TXlsMargins.Bottom Property | FlexCel Studio for the .NET Framework documentation

TXlsMargins.Bottom Property

Bottom Margin in inches.

Syntax

Namespace: FlexCel.Core

public Double Bottom { get; set; }

See also

  • TXlsMargins


TXlsMargins.Header Property | FlexCel Studio for the .NET Framework documentation

TXlsMargins.Header Property

Header Margin in inches. Space for the header at top of page, it is taken from Top margin.

Syntax

Namespace: FlexCel.Core

public Double Header { get; set; }

See also

  • TXlsMargins


TXlsMargins.Footer Property | FlexCel Studio for the .NET Framework documentation

TXlsMargins.Footer Property

Footer Margin in inches. Space for the footer at bottom of page, it is taken from Bottom margin.

Syntax

Namespace: FlexCel.Core

public Double Footer { get; set; }

See also

  • TXlsMargins


TXlsNamedRange Class | FlexCel Studio for the .NET Framework documentation

TXlsNamedRange Class

An Excel named range.

Syntax

Namespace: FlexCel.Core

public class TXlsNamedRange: TXlsCellRange

Constructors

Name Description
TXlsNamedRange Overloaded
 TXlsNamedRange
TXlsNamedRange(String, Int32, Int32, String)
TXlsNamedRange(String, Int32, Int32, Int32, Int32, Int32, Int32, Int32)
TXlsNamedRange(String, Int32, Int32, Int32, Int32, Int32, Int32, Int32, String)

Methods

Name | Description
Equals | Returns true if both objects are equal.
GetHashCode | Returns the hashcode of the object.
GetInternalName | Returns the string that corresponds to an internal name.
ToString | A human-readable representation of the range.
IsValidRangeName | Returns true if the string is a valid name for a named range. Valid names must start with a letter or an underscore
GetRanges | Returns a list of ranges and cells included in this name. This can be used to parse for example the PRINT_TITLES range, which might be something like "1:1,A:A". ("," is the union operator in Excel formulas).This method would return an array with the ranges 1:1 and A:A.

Operators

Name | Description
Equality | Returns true if both objects are equal. Note this is for backwards compatibility, this is a class and not immutable, so this method should return true if references are different. But that would break old code.
Inequality | Returns true if both objects do not have the same value. Note this is for backwards compatibility, this is a class and not immutable, so this method should return true if references are different. But that would break old code.

Properties

Name | Description
Name | The name of the range.
SheetIndex | The Sheet index where the row and col properties apply. 1-based. When RangeFormula is set, it is not used.
NameSheetIndex | The sheet index for the name (1 based). A named range can have the same name than other as long as they are on different sheets. The default value(0) means a global named range, not tied to any specific sheet.
OptionFlags | Options of the range. You can access the options by using the corresponding properties. (Hidden, BuiltIn, etc). You can use this property to set them all at the same time. You can get the properties by OR'ing the following values: 01. Name is hidden. Corresponds to the property Hidden. 02. Name is a function. Corresponds to the property Function. 04. Name is a VB procedure. If set you also need to set 08 (name is a macro). Corresponds to the property...[more]
RangeFormula | This is a formula defining the range. It can be used to define complex ranges. For example you can use "=​Sheet1!​$A:​$B,​Sheet1!​$1:​$2"​. When this parameter is set, SheetIndex, Left, Top, Right and Bottom properties have no meaning. Note that with relative references, we always consider "A1" to be the cell where the name is. This means that the formula: "=$A$1 + A1" when evaluated in Cell B8, will read "=$A$1 + B8". To provide a negative offset, you need to wrap the formula. For example "=A1048575" will evaluate to B7 when evaluated in B8.
Hidden | True if the range is hidden.
Function | True if the range is a function.
VisualBasicProc | True if the range is a Visual Basic Procedure
Proc | True if the range is a function on a macro sheet.
CalcExp | True if the range contains a complex function.
BuiltIn | True if the range is a built in name. Built in names are 1 char long.
FunctionGroup | Specifies the function group index if the defined name refers to a function. The function group defines the general category for the function. This attribute is used when there is an add-in or other code project associated with the file.
PublishToServer | Indicates whether the defined name is included in the version of the workbook that is published to or rendered on a Web or application server. This is new to Excel 2007.
WorkbookParameter | Indicates that the name is used as a workbook parameter on a version of the workbook that is published to or rendered on a Web or application server. This is new to Excel 2007.
Comment | Returns the comment associated with the name, if there is one. Comments are only available in Excel 2007, but they are saved too in xls file format.


TXlsNamedRange.TXlsNamedRange Constructor | FlexCel Studio for the .NET Framework documentation

TXlsNamedRange.TXlsNamedRange Constructor

Overloads

  • TXlsNamedRange.TXlsNamedRange
  • TXlsNamedRange.TXlsNamedRange(String, Int32, Int32, String)
  • TXlsNamedRange.TXlsNamedRange(String, Int32, Int32, Int32, Int32, Int32, Int32, Int32)
  • TXlsNamedRange.TXlsNamedRange(String, Int32, Int32, Int32, Int32, Int32, Int32, Int32, String)

TXlsNamedRange.TXlsNamedRange

Creates an empty NamedRange.

Syntax

Namespace: FlexCel.Core

public TXlsNamedRange()

See also

  • TXlsNamedRange

TXlsNamedRange.TXlsNamedRange(String, Int32, Int32, String)

Creates a complex Named range, with a formula.

Syntax

Namespace: FlexCel.Core

public TXlsNamedRange(String aName, Int32 aNameSheetIndex, Int32 aOptionFlags, String aRangeFormula)

Parameters

<-> | Parameter | Type | Description
 | aName | String | Name of the range.
 | aNameSheetIndex | Int32 | Sheet index for the sheet that holds the range. 0 means a global range (default on Excel)
 | aOptionFlags | Int32 | Options of this Range.
 | aRangeFormula | String | The formula for the range, expressed as text. For example: "A1:B2,C3:C7" Note that with relative references, we always consider "A1" to be the cell where the name is. This means that the formula: "=$A$1 + A1" when evaluated in Cell B8, will read "=$A$1 + B8". To provide a negative offset, you need to wrap the formula. For example "=A1048575" will evaluate to B7 when evaluated in B8.

See also

  • TXlsNamedRange

TXlsNamedRange.TXlsNamedRange(String, Int32, Int32, Int32, Int32, Int32, Int32, Int32)

Creates a new Named range with the given values. Use this overload to create a simple range.

Syntax

Namespace: FlexCel.Core

public TXlsNamedRange(String aName, Int32 aNameSheetIndex, Int32 aSheetIndex, Int32 aFirstRow, Int32 aFirstCol, Int32 aLastRow, Int32 aLastCol, Int32 aOptionFlags)

Parameters

<-> | Parameter | Type | Description
 | aName | String | Name of the range.
 | aNameSheetIndex | Int32 | Sheet index for the sheet that holds the range. 0 means a global range (default on Excel)
 | aSheetIndex | Int32 | Sheet index where the range apply. This is where row and col properties apply, not where the range is stored. (1-based)
 | aFirstRow | Int32 | First row on range.
 | aFirstCol | Int32 | First column on range.
 | aLastRow | Int32 | Last row on range.
 | aLastCol | Int32 | Last column on range.
 | aOptionFlags | Int32 | Options of this Range.

See also

  • TXlsNamedRange

TXlsNamedRange.TXlsNamedRange(String, Int32, Int32, Int32, Int32, Int32, Int32, Int32, String)

Creates a new Named range with the given values. Use this overload to create a simple range.

Syntax

Namespace: FlexCel.Core

public TXlsNamedRange(String aName, Int32 aNameSheetIndex, Int32 aSheetIndex, Int32 aFirstRow, Int32 aFirstCol, Int32 aLastRow, Int32 aLastCol, Int32 aOptionFlags, String aRangeFormula)

Parameters

<-> | Parameter | Type | Description
 | aName | String | Name of the range.
 | aNameSheetIndex | Int32 | Sheet index for the sheet that holds the range. 0 means a global range (default on Excel)
 | aSheetIndex | Int32 | Sheet index where the range apply. This is where row and col properties apply, not where the range is stored. (1-based)
 | aFirstRow | Int32 | First row on range.
 | aFirstCol | Int32 | First column on range.
 | aLastRow | Int32 | Last row on range.
 | aLastCol | Int32 | Last column on range.
 | aOptionFlags | Int32 | Options of this Range.
 | aRangeFormula | String | The formula for the range, expressed as text. Use it if the range is complex and cannot be expressed with aSheetIndex, aFirstRow... etc When you specify this parameter, all SheetIndex, aFirstRow, etc. lose their meaning.

See also

  • TXlsNamedRange


TXlsNamedRange.Equals Method | FlexCel Studio for the .NET Framework documentation

TXlsNamedRange.Equals Method

Returns true if both objects are equal.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TXlsNamedRange


TXlsNamedRange.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TXlsNamedRange.GetHashCode Method

Returns the hashcode of the object.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TXlsNamedRange


TXlsNamedRange.GetInternalName Method | FlexCel Studio for the .NET Framework documentation

TXlsNamedRange.GetInternalName Method

Returns the string that corresponds to an internal name.

Syntax

Namespace: FlexCel.Core

public static String GetInternalName(InternalNameRange name)

Parameters

<-> | Parameter | Type | Description
 | name | InternalNameRange | Internal name we want to find.

Returns

The one-char string that represents that internal name.

See also

  • TXlsNamedRange


TXlsNamedRange.ToString Method | FlexCel Studio for the .NET Framework documentation

TXlsNamedRange.ToString Method

A human-readable representation of the range.

Syntax

Namespace: FlexCel.Core

public override String ToString()

See also

  • TXlsNamedRange


TXlsNamedRange.IsValidRangeName Method | FlexCel Studio for the .NET Framework documentation

TXlsNamedRange.IsValidRangeName Method

Returns true if the string is a valid name for a named range. Valid names must start with a letter or an underscore

Syntax

Namespace: FlexCel.Core

public static Boolean IsValidRangeName(String Name, out Boolean IsInternal)

Parameters

<-> | Parameter | Type | Description
 | Name | String | String we want to check.
out | IsInternal | Boolean | Returns true if this is an internal name, like Print_Range. Internal names have only one character.

See also

  • TXlsNamedRange


TXlsNamedRange.GetRanges Method | FlexCel Studio for the .NET Framework documentation

TXlsNamedRange.GetRanges Method

Returns a list of ranges and cells included in this name. This can be used to parse for example the PRINT_TITLES range, which might be something like "1:1,A:A". ("," is the union operator in Excel formulas).This method would return an array with the ranges 1:1 and A:A.

Syntax

Namespace: FlexCel.Core

public TXlsCellRange[] GetRanges(ExcelFile Workbook)

Parameters

<-> | Parameter | Type | Description
 | Workbook | ExcelFile | File which contains this range.

See also

  • TXlsNamedRange


TXlsNamedRange.Equality Operator | FlexCel Studio for the .NET Framework documentation

TXlsNamedRange.Equality Operator

Returns true if both objects are equal. Note this is for backwards compatibility, this is a class and not immutable, so this method should return true if references are different. But that would break old code.

Syntax

Namespace: FlexCel.Core

public static Boolean op_Equality(TXlsNamedRange o1, TXlsNamedRange o2)

Parameters

<-> | Parameter | Type | Description
 | o1 | TXlsNamedRange |
 | o2 | TXlsNamedRange |

See also

  • TXlsNamedRange


TXlsNamedRange.Inequality Operator | FlexCel Studio for the .NET Framework documentation

TXlsNamedRange.Inequality Operator

Returns true if both objects do not have the same value. Note this is for backwards compatibility, this is a class and not immutable, so this method should return true if references are different. But that would break old code.

Syntax

Namespace: FlexCel.Core

public static Boolean op_Inequality(TXlsNamedRange s1, TXlsNamedRange s2)

Parameters

<-> | Parameter | Type | Description
 | s1 | TXlsNamedRange |
 | s2 | TXlsNamedRange |

See also

  • TXlsNamedRange


TXlsNamedRange.Name Property | FlexCel Studio for the .NET Framework documentation

TXlsNamedRange.Name Property

The name of the range.

Syntax

Namespace: FlexCel.Core

public String Name { get; set; }

See also

  • TXlsNamedRange


TXlsNamedRange.SheetIndex Property | FlexCel Studio for the .NET Framework documentation

TXlsNamedRange.SheetIndex Property

The Sheet index where the row and col properties apply. 1-based. When RangeFormula is set, it is not used.

Syntax

Namespace: FlexCel.Core

public Int32 SheetIndex { get; set; }

See also

  • TXlsNamedRange


TXlsNamedRange.NameSheetIndex Property | FlexCel Studio for the .NET Framework documentation

TXlsNamedRange.NameSheetIndex Property

The sheet index for the name (1 based). A named range can have the same name than other as long as they are on different sheets. The default value(0) means a global named range, not tied to any specific sheet.

Syntax

Namespace: FlexCel.Core

public Int32 NameSheetIndex { get; set; }

See also

  • TXlsNamedRange


TXlsNamedRange.OptionFlags Property | FlexCel Studio for the .NET Framework documentation

TXlsNamedRange.OptionFlags Property

Options of the range. You can access the options by using the corresponding properties. (Hidden, BuiltIn, etc).

You can use this property to set them all at the same time.

You can get the properties by OR'ing the following values:

01. Name is hidden. Corresponds to the property Hidden.

02. Name is a function. Corresponds to the property Function.

04. Name is a VB procedure. If set you also need to set 08 (name is a macro). Corresponds to the property VisualBasicProc.

08. Name is a Macro. Corresponds to the property Proc.

16. Name returns an Array. Corresponds to the property CalcExp.

32. Name is a BuiltIn name (like Print_Area). Corresponds to the property BuiltIn.

8192. Name will be published when exporting to html. Corresponds to the property PublishToServer.

16384. Indicates that the name is used as a workbook parameter on a version of the workbook that is published to or rendered on a Web or application server. Corresponds to the property WorkbookParameter.

Syntax

Namespace: FlexCel.Core

public Int32 OptionFlags { get; set; }

See also

  • TXlsNamedRange


TXlsNamedRange.RangeFormula Property | FlexCel Studio for the .NET Framework documentation

TXlsNamedRange.RangeFormula Property

This is a formula defining the range. It can be used to define complex ranges. For example you can use "=Sheet1!$A:$B,Sheet1!$1:$2". When this parameter is set, SheetIndex, Left, Top, Right and Bottom properties have no meaning.

Note that with relative references, we always consider "A1" to be the cell where the name is. This means that the formula: "=$A$1 + A1" when evaluated in Cell B8, will read "=$A$1 + B8". To provide a negative offset, you need to wrap the formula. For example "=A1048575" will evaluate to B7 when evaluated in B8.

Remarks

In latest FlexCel versions, you *can* use ranges like "A:B" instead (A1:B65536). Using "A:B" form is preferred, since it will work also in Excel 2007.

If this formula refers to a cell range, you can get the cell range by calling ExcelFile.RecalcRange.

To get the text for a particular cell, use ExcelFile.OffsetRelativeFormula.

To get the result of evaluating the formula, use ExcelFile.RecalcRelativeFormula

Syntax

Namespace: FlexCel.Core

public String RangeFormula { get; set; }

See also

  • TXlsNamedRange


TXlsNamedRange.Hidden Property | FlexCel Studio for the .NET Framework documentation

TXlsNamedRange.Hidden Property

True if the range is hidden.

Syntax

Namespace: FlexCel.Core

public Boolean Hidden { get; set; }

See also

  • TXlsNamedRange


TXlsNamedRange.Function Property | FlexCel Studio for the .NET Framework documentation

TXlsNamedRange.Function Property

True if the range is a function.

Syntax

Namespace: FlexCel.Core

public Boolean Function { get; set; }

See also

  • TXlsNamedRange


TXlsNamedRange.VisualBasicProc Property | FlexCel Studio for the .NET Framework documentation

TXlsNamedRange.VisualBasicProc Property

True if the range is a Visual Basic Procedure

Syntax

Namespace: FlexCel.Core

public Boolean VisualBasicProc { get; set; }

See also

  • TXlsNamedRange


TXlsNamedRange.Proc Property | FlexCel Studio for the .NET Framework documentation

TXlsNamedRange.Proc Property

True if the range is a function on a macro sheet.

Syntax

Namespace: FlexCel.Core

public Boolean Proc { get; set; }

See also

  • TXlsNamedRange


TXlsNamedRange.CalcExp Property | FlexCel Studio for the .NET Framework documentation

TXlsNamedRange.CalcExp Property

True if the range contains a complex function.

Syntax

Namespace: FlexCel.Core

public Boolean CalcExp { get; set; }

See also

  • TXlsNamedRange


TXlsNamedRange.BuiltIn Property | FlexCel Studio for the .NET Framework documentation

TXlsNamedRange.BuiltIn Property

True if the range is a built in name. Built in names are 1 char long.

Syntax

Namespace: FlexCel.Core

public Boolean BuiltIn { get; set; }

See also

  • TXlsNamedRange


TXlsNamedRange.FunctionGroup Property | FlexCel Studio for the .NET Framework documentation

TXlsNamedRange.FunctionGroup Property

Specifies the function group index if the defined name refers to a function. The function group defines the general category for the function. This attribute is used when there is an add-in or other code project associated with the file.

Syntax

Namespace: FlexCel.Core

public TFunctionGroup FunctionGroup { get; set; }

See also

  • TXlsNamedRange


TXlsNamedRange.PublishToServer Property | FlexCel Studio for the .NET Framework documentation

TXlsNamedRange.PublishToServer Property

Indicates whether the defined name is included in the version of the workbook that is published to or rendered on a Web or application server. This is new to Excel 2007.

Syntax

Namespace: FlexCel.Core

public Boolean PublishToServer { get; set; }

See also

  • TXlsNamedRange


TXlsNamedRange.WorkbookParameter Property | FlexCel Studio for the .NET Framework documentation

TXlsNamedRange.WorkbookParameter Property

Indicates that the name is used as a workbook parameter on a version of the workbook that is published to or rendered on a Web or application server. This is new to Excel 2007.

Syntax

Namespace: FlexCel.Core

public Boolean WorkbookParameter { get; set; }

See also

  • TXlsNamedRange


TXlsNamedRange.Comment Property | FlexCel Studio for the .NET Framework documentation

TXlsNamedRange.Comment Property

Returns the comment associated with the name, if there is one. Comments are only available in Excel 2007, but they are saved too in xls file format.

Syntax

Namespace: FlexCel.Core

public String Comment { get; set; }

See also

  • TXlsNamedRange


TXlsTooManyPageBreaksError Class | FlexCel Studio for the .NET Framework documentation

TXlsTooManyPageBreaksError Class

This class has information for a FlexCelError.XlsTooManyPageBreaks error. Look at FlexCelError.XlsTooManyPageBreaks for more information.

Syntax

Namespace: FlexCel.Core

public class TXlsTooManyPageBreaksError: TFlexCelErrorInfo

Constructors

Name | Description
TXlsTooManyPage​Breaks​Error | Creates a new instance.

Properties

Name | Description
FileName | File with too many page breaks.


TXlsTooManyPageBreaksError.TXlsTooManyPageBreaksError Constructor | FlexCel Studio for the .NET Framework documentation

TXlsTooManyPageBreaksError.TXlsTooManyPageBreaksError Constructor

Creates a new instance.

Syntax

Namespace: FlexCel.Core

public TXlsTooManyPageBreaksError(String aMessage, String aFileName)

Parameters

<-> | Parameter | Type | Description
 | aMessage | String | See TFlexCelErrorInfo.Message
 | aFileName | String | See FileName

See also

  • TXlsTooManyPageBreaksError


TXlsTooManyPageBreaksError.FileName Property | FlexCel Studio for the .NET Framework documentation

TXlsTooManyPageBreaksError.FileName Property

File with too many page breaks.

Syntax

Namespace: FlexCel.Core

public String FileName { get; }

See also

  • TXlsTooManyPageBreaksError


TXlsxInvalidNameError Class | FlexCel Studio for the .NET Framework documentation

TXlsxInvalidNameError Class

This class has information for a FlexCelError.XlsxInvalidName error. Look at FlexCelError.XlsxInvalidName for more information.

Syntax

Namespace: FlexCel.Core

public class TXlsxInvalidNameError: TFlexCelErrorInfo

Constructors

Name | Description
TXlsxInvalid​Name​Error | Creates a new instance.

Properties

Name | Description
FileName | File with the invalid name.
Name | Name of the invalid named range.
Definition | Definition of the invalid named range.


TXlsxInvalidNameError.TXlsxInvalidNameError Constructor | FlexCel Studio for the .NET Framework documentation

TXlsxInvalidNameError.TXlsxInvalidNameError Constructor

Creates a new instance.

Syntax

Namespace: FlexCel.Core

public TXlsxInvalidNameError(String aMessage, String aFileName, String aName, String aDefinition)

Parameters

<-> | Parameter | Type | Description
 | aMessage | String | See TFlexCelErrorInfo.Message
 | aFileName | String | See FileName
 | aName | String | See Name
 | aDefinition | String | See Definition

See also

  • TXlsxInvalidNameError


TXlsxInvalidNameError.FileName Property | FlexCel Studio for the .NET Framework documentation

TXlsxInvalidNameError.FileName Property

File with the invalid name.

Syntax

Namespace: FlexCel.Core

public String FileName { get; }

See also

  • TXlsxInvalidNameError


TXlsxInvalidNameError.Name Property | FlexCel Studio for the .NET Framework documentation

TXlsxInvalidNameError.Name Property

Name of the invalid named range.

Syntax

Namespace: FlexCel.Core

public String Name { get; }

See also

  • TXlsxInvalidNameError


TXlsxInvalidNameError.Definition Property | FlexCel Studio for the .NET Framework documentation

TXlsxInvalidNameError.Definition Property

Definition of the invalid named range.

Syntax

Namespace: FlexCel.Core

public String Definition { get; }

See also

  • TXlsxInvalidNameError


TXlsxMissingPartError Class | FlexCel Studio for the .NET Framework documentation

TXlsxMissingPartError Class

This class has information for a FlexCelError.XlsxMissingPart error. Look at FlexCelError.XlsxMissingPart for more information.

Syntax

Namespace: FlexCel.Core

public class TXlsxMissingPartError: TFlexCelErrorInfo

Constructors

Name | Description
TXlsxMissing​Part​Error | Creates a new instance.

Properties

Name | Description
FileName | File with the missing part.
PartName | Name of the missing part.


TXlsxMissingPartError.TXlsxMissingPartError Constructor | FlexCel Studio for the .NET Framework documentation

TXlsxMissingPartError.TXlsxMissingPartError Constructor

Creates a new instance.

Syntax

Namespace: FlexCel.Core

public TXlsxMissingPartError(String aMessage, String aFileName, String aPartName)

Parameters

<-> | Parameter | Type | Description
 | aMessage | String | See TFlexCelErrorInfo.Message
 | aFileName | String | See FileName
 | aPartName | String | See PartName

See also

  • TXlsxMissingPartError


TXlsxMissingPartError.FileName Property | FlexCel Studio for the .NET Framework documentation

TXlsxMissingPartError.FileName Property

File with the missing part.

Syntax

Namespace: FlexCel.Core

public String FileName { get; }

See also

  • TXlsxMissingPartError


TXlsxMissingPartError.PartName Property | FlexCel Studio for the .NET Framework documentation

TXlsxMissingPartError.PartName Property

Name of the missing part.

Syntax

Namespace: FlexCel.Core

public String PartName { get; }

See also

  • TXlsxMissingPartError


TXmlMap Class | FlexCel Studio for the .NET Framework documentation

TXmlMap Class

Encapsulates the XML Maps in a file.

Syntax

Namespace: FlexCel.Core

public class TXmlMap

Methods

Name | Description
AddSchema | Adds a new schema to the xml map, and returns it so you can fill the data of the new schema. The returned schema is owned by this class and modifying it will modify the schema in the class.
AddMap | Adds a new map to the xml map, and returns it so you can fill the data of the new map. The returned map is owned by this class and modifying it will modify the map in the class.
GetSchema | Gets the schema at position index. (0 based). The schema returned is not a copy but the actual schema in the class, so modifying it will modify the schema in the class.
GetMap | Gets the map at position index. (0 based). The map returned is not a copy but the actual map in the class, so modifying it will modify the map in the class.
ClearSchemas | Erases all schemas in the class.
ClearMap | Erases all maps in the class.
Assign | Copies a different xml map to this instance, clearing any existing data in this instance. If map is null, then this method will clear everything.
Clone | Returns a deep copy of this object.
Equals | Returns true if both objects have the same data.
GetHashCode | Returns the hashcode of the object.

Properties

Name | Description
SelectionNamespaces | Ties the prefix to the actual namespace. This is used when writing xpath expressions at runtime against the XML instance structures, because the xpath expressions use namespace prefixes instead of the fully spelled out namespace.
SchemaCount | Count of schemas in the class.
MapCount | Count of maps in the class.
IsEmpty | Returns true if this class has no schemas or maps.


TXmlMap.AddSchema Method | FlexCel Studio for the .NET Framework documentation

TXmlMap.AddSchema Method

Adds a new schema to the xml map, and returns it so you can fill the data of the new schema. The returned schema is owned by this class and modifying it will modify the schema in the class.

Syntax

Namespace: FlexCel.Core

public TXmlMapSchema AddSchema()

See also

  • TXmlMap


TXmlMap.AddMap Method | FlexCel Studio for the .NET Framework documentation

TXmlMap.AddMap Method

Adds a new map to the xml map, and returns it so you can fill the data of the new map. The returned map is owned by this class and modifying it will modify the map in the class.

Syntax

Namespace: FlexCel.Core

public TXmlMapMap AddMap()

See also

  • TXmlMap


TXmlMap.GetSchema Method | FlexCel Studio for the .NET Framework documentation

TXmlMap.GetSchema Method

Gets the schema at position index. (0 based). The schema returned is not a copy but the actual schema in the class, so modifying it will modify the schema in the class.

Syntax

Namespace: FlexCel.Core

public TXmlMapSchema GetSchema(Int32 index)

Parameters

<-> | Parameter | Type | Description
 | index | Int32 | Index of the schema to return, 0 based.

See also

  • TXmlMap


TXmlMap.GetMap Method | FlexCel Studio for the .NET Framework documentation

TXmlMap.GetMap Method

Gets the map at position index. (0 based). The map returned is not a copy but the actual map in the class, so modifying it will modify the map in the class.

Syntax

Namespace: FlexCel.Core

public TXmlMapMap GetMap(Int32 index)

Parameters

<-> | Parameter | Type | Description
 | index | Int32 | Index of the map to return, 0 based.

See also

  • TXmlMap


TXmlMap.ClearSchemas Method | FlexCel Studio for the .NET Framework documentation

TXmlMap.ClearSchemas Method

Erases all schemas in the class.

Syntax

Namespace: FlexCel.Core

public void ClearSchemas()

See also

  • TXmlMap


TXmlMap.ClearMap Method | FlexCel Studio for the .NET Framework documentation

TXmlMap.ClearMap Method

Erases all maps in the class.

Syntax

Namespace: FlexCel.Core

public void ClearMap()

See also

  • TXmlMap


TXmlMap.Assign Method | FlexCel Studio for the .NET Framework documentation

TXmlMap.Assign Method

Copies a different xml map to this instance, clearing any existing data in this instance. If map is null, then this method will clear everything.

Syntax

Namespace: FlexCel.Core

public void Assign(TXmlMap map)

Parameters

<-> | Parameter | Type | Description
 | map | TXmlMap | Map to assign to this instance.

See also

  • TXmlMap


TXmlMap.Clone Method | FlexCel Studio for the .NET Framework documentation

TXmlMap.Clone Method

Returns a deep copy of this object.

Syntax

Namespace: FlexCel.Core

public TXmlMap Clone()

See also

  • TXmlMap


TXmlMap.Equals Method | FlexCel Studio for the .NET Framework documentation

TXmlMap.Equals Method

Returns true if both objects have the same data.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TXmlMap


TXmlMap.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TXmlMap.GetHashCode Method

Returns the hashcode of the object.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TXmlMap


TXmlMap.SelectionNamespaces Property | FlexCel Studio for the .NET Framework documentation

TXmlMap.SelectionNamespaces Property

Ties the prefix to the actual namespace. This is used when writing xpath expressions at runtime against the XML instance structures, because the xpath expressions use namespace prefixes instead of the fully spelled out namespace.

Syntax

Namespace: FlexCel.Core

public String SelectionNamespaces { get; set; }

See also

  • TXmlMap


TXmlMap.SchemaCount Property | FlexCel Studio for the .NET Framework documentation

TXmlMap.SchemaCount Property

Count of schemas in the class.

Syntax

Namespace: FlexCel.Core

public Int32 SchemaCount { get; }

See also

  • TXmlMap


TXmlMap.MapCount Property | FlexCel Studio for the .NET Framework documentation

TXmlMap.MapCount Property

Count of maps in the class.

Syntax

Namespace: FlexCel.Core

public Int32 MapCount { get; }

See also

  • TXmlMap


TXmlMap.IsEmpty Property | FlexCel Studio for the .NET Framework documentation

TXmlMap.IsEmpty Property

Returns true if this class has no schemas or maps.

Syntax

Namespace: FlexCel.Core

public Boolean IsEmpty { get; }

See also

  • TXmlMap


TXmlMapDataBinding Class | FlexCel Studio for the .NET Framework documentation

TXmlMapDataBinding Class

Specifies how the XML binding works.

Syntax

Namespace: FlexCel.Core

public class TXmlMapDataBinding

Methods

Name | Description
Assign | Copies an existing databinding into this object, clearing any existing data.
Equals | Returns true if both databindings are the same.
GetHashCode | Returns the hashcode of the object.

Properties

Name | Description
DataBindingName | Specifies the name for the binding. Must be unique.
FileBinding | If true the binding must be recovered from a file and the path to the file is in the connection element.
ConnectionID | Connection id for an external connection. Must exist if FileBinding is true.
FileBindingName | Name of the file binding. Must be unique.
DataBindingLoadMode | Loading mode for this databinding.
Xml | Actual data defining the databinding.


TXmlMapDataBinding.Assign Method | FlexCel Studio for the .NET Framework documentation

TXmlMapDataBinding.Assign Method

Copies an existing databinding into this object, clearing any existing data.

Syntax

Namespace: FlexCel.Core

public void Assign(TXmlMapDataBinding aDataBinding)

Parameters

<-> | Parameter | Type | Description
 | aDataBinding | TXmlMapDataBinding | Databinding to copy. If null, the instance will be cleared.

See also

  • TXmlMapDataBinding


TXmlMapDataBinding.Equals Method | FlexCel Studio for the .NET Framework documentation

TXmlMapDataBinding.Equals Method

Returns true if both databindings are the same.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TXmlMapDataBinding


TXmlMapDataBinding.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TXmlMapDataBinding.GetHashCode Method

Returns the hashcode of the object.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TXmlMapDataBinding


TXmlMapDataBinding.DataBindingName Property | FlexCel Studio for the .NET Framework documentation

TXmlMapDataBinding.DataBindingName Property

Specifies the name for the binding. Must be unique.

Syntax

Namespace: FlexCel.Core

public String DataBindingName { get; set; }

See also

  • TXmlMapDataBinding


TXmlMapDataBinding.FileBinding Property | FlexCel Studio for the .NET Framework documentation

TXmlMapDataBinding.FileBinding Property

If true the binding must be recovered from a file and the path to the file is in the connection element.

Syntax

Namespace: FlexCel.Core

public Boolean FileBinding { get; set; }

See also

  • TXmlMapDataBinding


TXmlMapDataBinding.ConnectionID Property | FlexCel Studio for the .NET Framework documentation

TXmlMapDataBinding.ConnectionID Property

Connection id for an external connection. Must exist if FileBinding is true.

Syntax

Namespace: FlexCel.Core

public Int64 ConnectionID { get; set; }

See also

  • TXmlMapDataBinding


TXmlMapDataBinding.FileBindingName Property | FlexCel Studio for the .NET Framework documentation

TXmlMapDataBinding.FileBindingName Property

Name of the file binding. Must be unique.

Syntax

Namespace: FlexCel.Core

public String FileBindingName { get; set; }

See also

  • TXmlMapDataBinding


TXmlMapDataBinding.DataBindingLoadMode Property | FlexCel Studio for the .NET Framework documentation

TXmlMapDataBinding.DataBindingLoadMode Property

Loading mode for this databinding.

Syntax

Namespace: FlexCel.Core

public TDataBindingLoadMode DataBindingLoadMode { get; set; }

See also

  • TXmlMapDataBinding


TXmlMapDataBinding.Xml Property | FlexCel Studio for the .NET Framework documentation

TXmlMapDataBinding.Xml Property

Actual data defining the databinding.

Syntax

Namespace: FlexCel.Core

public String Xml { get; set; }

See also

  • TXmlMapDataBinding


TXmlMapMap Class | FlexCel Studio for the .NET Framework documentation

TXmlMapMap Class

Defines the XML Map.

Syntax

Namespace: FlexCel.Core

public class TXmlMapMap

Methods

Name | Description
Clone | Returns a deep copy of this object.
Equals | Returns true if both maps have the same values.
GetHashCode | Returns the hashcode of the map.

Properties

Name | Description
ID | Identifies the map object.
Name | Friendly name of the map object.
RootElement | Root element of the XML instance.
SchemaID | Which schema collection the map uses.
ShowImportExport​Validation​Errors | When an XML instance is imported or exported, the schema should be used to validate the instance, and schema errors should be shown to the user.
AutoFit | Indicates if cells should be autofitted after a refresh.
Append | If true when refreshing old data will not be discarded, but new data will be appended to the existing data.
PreserveSortAFLayout | Indicates if to keep filters on tables.
PreserveFormat | Indicates if we will preserve the formats on the cells or re apply them depending in the data.
DataBinding | Databinding associated with this map.


TXmlMapMap.Clone Method | FlexCel Studio for the .NET Framework documentation

TXmlMapMap.Clone Method

Returns a deep copy of this object.

Syntax

Namespace: FlexCel.Core

public TXmlMapMap Clone()

See also

  • TXmlMapMap


TXmlMapMap.Equals Method | FlexCel Studio for the .NET Framework documentation

TXmlMapMap.Equals Method

Returns true if both maps have the same values.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TXmlMapMap


TXmlMapMap.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TXmlMapMap.GetHashCode Method

Returns the hashcode of the map.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TXmlMapMap


TXmlMapMap.ID Property | FlexCel Studio for the .NET Framework documentation

TXmlMapMap.ID Property

Identifies the map object.

Syntax

Namespace: FlexCel.Core

public Int64 ID { get; set; }

See also

  • TXmlMapMap


TXmlMapMap.Name Property | FlexCel Studio for the .NET Framework documentation

TXmlMapMap.Name Property

Friendly name of the map object.

Syntax

Namespace: FlexCel.Core

public String Name { get; set; }

See also

  • TXmlMapMap


TXmlMapMap.RootElement Property | FlexCel Studio for the .NET Framework documentation

TXmlMapMap.RootElement Property

Root element of the XML instance.

Syntax

Namespace: FlexCel.Core

public String RootElement { get; set; }

See also

  • TXmlMapMap


TXmlMapMap.SchemaID Property | FlexCel Studio for the .NET Framework documentation

TXmlMapMap.SchemaID Property

Which schema collection the map uses.

Syntax

Namespace: FlexCel.Core

public String SchemaID { get; set; }

See also

  • TXmlMapMap


TXmlMapMap.ShowImportExportValidationErrors Property | FlexCel Studio for the .NET Framework documentation

TXmlMapMap.ShowImportExportValidationErrors Property

When an XML instance is imported or exported, the schema should be used to validate the instance, and schema errors should be shown to the user.

Syntax

Namespace: FlexCel.Core

public Boolean ShowImportExportValidationErrors { get; set; }

See also

  • TXmlMapMap


TXmlMapMap.AutoFit Property | FlexCel Studio for the .NET Framework documentation

TXmlMapMap.AutoFit Property

Indicates if cells should be autofitted after a refresh.

Syntax

Namespace: FlexCel.Core

public Boolean AutoFit { get; set; }

See also

  • TXmlMapMap


TXmlMapMap.Append Property | FlexCel Studio for the .NET Framework documentation

TXmlMapMap.Append Property

If true when refreshing old data will not be discarded, but new data will be appended to the existing data.

Syntax

Namespace: FlexCel.Core

public Boolean Append { get; set; }

See also

  • TXmlMapMap


TXmlMapMap.PreserveSortAFLayout Property | FlexCel Studio for the .NET Framework documentation

TXmlMapMap.PreserveSortAFLayout Property

Indicates if to keep filters on tables.

Syntax

Namespace: FlexCel.Core

public Boolean PreserveSortAFLayout { get; set; }

See also

  • TXmlMapMap


TXmlMapMap.PreserveFormat Property | FlexCel Studio for the .NET Framework documentation

TXmlMapMap.PreserveFormat Property

Indicates if we will preserve the formats on the cells or re apply them depending in the data.

Syntax

Namespace: FlexCel.Core

public Boolean PreserveFormat { get; set; }

See also

  • TXmlMapMap


TXmlMapMap.DataBinding Property | FlexCel Studio for the .NET Framework documentation

TXmlMapMap.DataBinding Property

Databinding associated with this map.

Syntax

Namespace: FlexCel.Core

public TXmlMapDataBinding DataBinding { get; }

See also

  • TXmlMapMap


TXmlMapSchema Class | FlexCel Studio for the .NET Framework documentation

TXmlMapSchema Class

Stores the schemas for a particular XML map object. There can be multiple Schema elements in a workbook, one for each XML map.

Syntax

Namespace: FlexCel.Core

public class TXmlMapSchema

Methods

Name | Description
Clone | Returns a deep copy of this object.
Equals | Returns true if both objects have the same values.
GetHashCode | Returns the hashcode of the object.

Properties

Name | Description
Id | Identifies the schema collection used to define a particular XML map object.
SchemaRef | The schemaRef attribute is used in the specific case where the schema definition happens to include another schema file that contributes to the same namespace.The value of this attribute is the relative path to a "root" schema file on disk which in turn references the other schema files contributing type definitions to the same namespace.
Namespace | Namespace used by the schema.
Language | Specifies the media type of the schema language.
Xml | Actual XML defining the schema.


TXmlMapSchema.Clone Method | FlexCel Studio for the .NET Framework documentation

TXmlMapSchema.Clone Method

Returns a deep copy of this object.

Syntax

Namespace: FlexCel.Core

public TXmlMapSchema Clone()

See also

  • TXmlMapSchema


TXmlMapSchema.Equals Method | FlexCel Studio for the .NET Framework documentation

TXmlMapSchema.Equals Method

Returns true if both objects have the same values.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TXmlMapSchema


TXmlMapSchema.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TXmlMapSchema.GetHashCode Method

Returns the hashcode of the object.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TXmlMapSchema


TXmlMapSchema.Id Property | FlexCel Studio for the .NET Framework documentation

TXmlMapSchema.Id Property

Identifies the schema collection used to define a particular XML map object.

Syntax

Namespace: FlexCel.Core

public String Id { get; set; }

See also

  • TXmlMapSchema


TXmlMapSchema.SchemaRef Property | FlexCel Studio for the .NET Framework documentation

TXmlMapSchema.SchemaRef Property

The schemaRef attribute is used in the specific case where the schema definition happens to include another schema file that contributes to the same namespace.The value of this attribute is the relative path to a "root" schema file on disk which in turn references the other schema files contributing type definitions to the same namespace.

Syntax

Namespace: FlexCel.Core

public String SchemaRef { get; set; }

See also

  • TXmlMapSchema


TXmlMapSchema.Namespace Property | FlexCel Studio for the .NET Framework documentation

TXmlMapSchema.Namespace Property

Namespace used by the schema.

Syntax

Namespace: FlexCel.Core

public String Namespace { get; set; }

See also

  • TXmlMapSchema


TXmlMapSchema.Language Property | FlexCel Studio for the .NET Framework documentation

TXmlMapSchema.Language Property

Specifies the media type of the schema language.

Syntax

Namespace: FlexCel.Core

public String Language { get; set; }

See also

  • TXmlMapSchema


TXmlMapSchema.Xml Property | FlexCel Studio for the .NET Framework documentation

TXmlMapSchema.Xml Property

Actual XML defining the schema.

Syntax

Namespace: FlexCel.Core

public String Xml { get; set; }

See also

  • TXmlMapSchema


TZippyReader Class | FlexCel Studio for the .NET Framework documentation

TZippyReader Class

Simple class for reading the contents of a zip file. It can read from multiple files at the same time, but not multithreaded.

Syntax

Namespace: FlexCel.Core

public class TZippyReader: IDisposable

Constructors

Name | Description
TZippyReader | Overloaded TZippyReader TZippyReader(Boolean)

Methods

Name | Description
Open Overloaded
 Open(String)
Open(Stream, Boolean)
TryOpen Tries to open a zip file and load the contents. If the file is invalid no Exception will be thrown. Note that other exceptions like a disk read error will still be raised. You can use this method instead of "if (​TZippy​Reader.​IsZip​Valid(​stream)​) TZippyReader.​Open(​stream)​" as it will be faster because it doesn't have to read the file twice.
Close Frees the memory associated with the object, and if this class owns the stream, it will free the associated stream too.
ExtractFile Overloaded
 ExtractFile(String, String)
ExtractFile(Int32, String)
CopyStream Utility method. Copies the stream from input to output.
FileCount Returns the number of files inside the zip file, including files in all folders.
FileExists Returns true if a file exists inside the zip file.
GetFile Overloaded
 GetFile(String)
GetFile(Int32)
GetFileInfo Overloaded
 GetFileInfo(Int32)
GetFileInfo(String)
GetFileName Returns the filename for the file at position Index.
IsZipValid Overloaded
 IsZipValid(String)
IsZipValid(Stream)
ExtractFileName | Returns the filename part of a full zip path. For example, if aFileName is 'test/​test2/​file1.​zip' this method will return 'file1.zip'
ExtractFilePath | Returns the path part of a full zip path, including the trailing slash. For example, if aFileName is 'test/​test2/​file1.​zip' this method will return 'test/test2/'
Dispose Overloaded
 Dispose
Dispose(Boolean)


TZippyReader.TZippyReader Constructor | FlexCel Studio for the .NET Framework documentation

TZippyReader.TZippyReader Constructor

Overloads

  • TZippyReader.TZippyReader
  • TZippyReader.TZippyReader(Boolean)

TZippyReader.TZippyReader

Creates a new TZippyReader.

Syntax

Namespace: FlexCel.Core

public TZippyReader()

See also

  • TZippyReader

TZippyReader.TZippyReader(Boolean)

Creates a new TZippyReader specifying if the files are case-insensitive. Note: Zip files by default are *not* case insensitive, but you might need this for compatibility with wrong xlsx files where the listed file doesn't match the case of the actual file. (Excel opens those files fine).

Syntax

Namespace: FlexCel.Core

public TZippyReader(Boolean caseInsensitiveFiles)

Parameters

<-> | Parameter | Type | Description
 | caseInsensitiveFiles | Boolean | If true, files inside the zip will be treated the same ignoring the case. So README.TXT and readme.txt will be considered the same file.

See also

  • TZippyReader


TZippyReader.Open Method | FlexCel Studio for the .NET Framework documentation

TZippyReader.Open Method

Overloads

  • TZippyReader.Open(String)
  • TZippyReader.Open(Stream, Boolean)

TZippyReader.Open(String)

Opens an existing filename. If the file isn't a supported zip file, an Exception will be raised.

Syntax

Namespace: FlexCel.Core

public void Open(String aZipFileName)

Parameters

<-> | Parameter | Type | Description
 | aZipFileName | String | File to open.

See also

  • TZippyReader

TZippyReader.Open(Stream, Boolean)

Opens an existing stream for reading. If the file isn't a supported zip file, an exception will be raised. If you prefer to not raise an exception, use TryOpen instead.

Syntax

Namespace: FlexCel.Core

public void Open(Stream aStream, Boolean aOwnsStream)

Parameters

<-> | Parameter | Type | Description
 | aStream | Stream | Stream that contains the file to load.
 | aOwnsStream | Boolean | If true, aStream will be destroyed when you destroy this object. If false, no attempt to free the Stream will be done.

See also

  • TZippyReader


TZippyReader.TryOpen Method | FlexCel Studio for the .NET Framework documentation

TZippyReader.TryOpen Method

Tries to open a zip file and load the contents. If the file is invalid no Exception will be thrown. Note that other exceptions like a disk read error will still be raised. You can use this method instead of "if (TZippyReader.IsZipValid(stream)) TZippyReader.Open(stream)" as it will be faster because it doesn't have to read the file twice.

Syntax

Namespace: FlexCel.Core

public Boolean TryOpen(Stream aStream, Boolean aOwnsStream)

Parameters

<-> | Parameter | Type | Description
 | aStream | Stream | Stream that contains the file to load.
 | aOwnsStream | Boolean | If true, aStream will be destroyed when you destroy this object. If false, no attempt to free the Stream will be done

See also

  • TZippyReader


TZippyReader.Close Method | FlexCel Studio for the .NET Framework documentation

TZippyReader.Close Method

Frees the memory associated with the object, and if this class owns the stream, it will free the associated stream too.

Remarks

There is normally no need to call this method, since it will be automatically called when you dispose the object.

Syntax

Namespace: FlexCel.Core

public void Close()

See also

  • TZippyReader


TZippyReader.ExtractFile Method | FlexCel Studio for the .NET Framework documentation

TZippyReader.ExtractFile Method

Overloads

  • TZippyReader.ExtractFile(String, String)
  • TZippyReader.ExtractFile(Int32, String)

TZippyReader.ExtractFile(String, String)

Extracts a file from the zip file into the disk.

Syntax

Namespace: FlexCel.Core

public void ExtractFile(String aFileName, String aNameOnDisk)

Parameters

<-> | Parameter | Type | Description
 | aFileName | String | Name of the file on the zip file. See description and remarks at FileExists.
 | aNameOnDisk | String | Name of the extracted file on the disk.

See also

  • TZippyReader

TZippyReader.ExtractFile(Int32, String)

Extracts a file from the zip file into the disk.

Syntax

Namespace: FlexCel.Core

public void ExtractFile(Int32 Index, String aNameOnDisk)

Parameters

<-> | Parameter | Type | Description
 | Index | Int32 | Index (0 based) of the file. Must be between 0 and FileCount - 1.
 | aNameOnDisk | String | Name of the extracted file on the disk.

See also

  • TZippyReader


TZippyReader.CopyStream Method | FlexCel Studio for the .NET Framework documentation

TZippyReader.CopyStream Method

Utility method. Copies the stream from input to output.

Syntax

Namespace: FlexCel.Core

public static void CopyStream(Stream input, Stream output)

Parameters

<-> | Parameter | Type | Description
 | input | Stream | Input stream.
 | output | Stream | Output stream.

See also

  • TZippyReader


TZippyReader.FileCount Method | FlexCel Studio for the .NET Framework documentation

TZippyReader.FileCount Method

Returns the number of files inside the zip file, including files in all folders.

Syntax

Namespace: FlexCel.Core

public Int32 FileCount()

See also

  • TZippyReader


TZippyReader.FileExists Method | FlexCel Studio for the .NET Framework documentation

TZippyReader.FileExists Method

Returns true if a file exists inside the zip file.

Remarks

To find the filename "test.xml" inside a folder "TestFolder", you need to use:

if (FileExists("TestFolder/test.xml"))...

Note how there isn't a starting slash, and that the name is case sensitive.

if (FileExists("/TestFolder/test.xml")) would return false, as would if (FileExists("testfolder/test.xml"))

An empty folder would be stored as a 0 byte file: 'EmptyFolder/'. Non empty folders are not stored.

Syntax

Namespace: FlexCel.Core

public Boolean FileExists(String aFileName)

Parameters

<-> | Parameter | Type | Description
 | aFileName | String | File that you want to find. If the file is in a folder, you must always use a forward slash ("/") to separate folders. The name shouldn't start with a slash. Names are case sensitive. Empty folders are stored as files with zero size and ending in a forward slash. Non empty folders are not stored.

Returns

True if the file exists, false otherwise.

See also

  • TZippyReader


TZippyReader.GetFile Method | FlexCel Studio for the .NET Framework documentation

TZippyReader.GetFile Method

Overloads

  • TZippyReader.GetFile(String)
  • TZippyReader.GetFile(Int32)

TZippyReader.GetFile(String)

Returns a stream with the contents of file aFileName. You must free this stream once you are done reading, even if the TZippyReader object owns the main stream.

Remarks

You might open more than one stream in parallel from the same file and read from them all at the same time. What you can't do is to read from those streams in different threads without synchronization, since this isn't thread safe.

Syntax

Namespace: FlexCel.Core

public Stream GetFile(String aFileName)

Parameters

<-> | Parameter | Type | Description
 | aFileName | String | Name of the file. See description and remarks at FileExists.

Returns

Stream with the file contents. You need to free this stream once you are done reading.

See also

  • TZippyReader

TZippyReader.GetFile(Int32)

Returns the contents of the file at position Index. See GetFile(String) for description and remarks.

Syntax

Namespace: FlexCel.Core

public Stream GetFile(Int32 Index)

Parameters

<-> | Parameter | Type | Description
 | Index | Int32 | Index (0 based) of the file. Must be between 0 and FileCount - 1.

Returns

Stream with the file contents. You must free this stream once you are done reading.

See also

  • TZippyReader


TZippyReader.GetFileInfo Method | FlexCel Studio for the .NET Framework documentation

TZippyReader.GetFileInfo Method

Overloads

  • TZippyReader.GetFileInfo(Int32)
  • TZippyReader.GetFileInfo(String)

TZippyReader.GetFileInfo(Int32)

Returns the information for the file at position "Index" in the zip file.

Syntax

Namespace: FlexCel.Core

public TZippyFileInfo GetFileInfo(Int32 Index)

Parameters

<-> | Parameter | Type | Description
 | Index | Int32 | Index (0 based) of the file. Must be between 0 and FileCount - 1.

See also

  • TZippyReader

TZippyReader.GetFileInfo(String)

Returns the information for file "aFileName" in the zip file.

Syntax

Namespace: FlexCel.Core

public TZippyFileInfo GetFileInfo(String aFileName)

Parameters

<-> | Parameter | Type | Description
 | aFileName | String | Full Name and path of the file. See description and remarks at FileExists.

See also

  • TZippyReader


TZippyReader.GetFileName Method | FlexCel Studio for the .NET Framework documentation

TZippyReader.GetFileName Method

Returns the filename for the file at position Index.

Syntax

Namespace: FlexCel.Core

public String GetFileName(Int32 Index)

Parameters

<-> | Parameter | Type | Description
 | Index | Int32 | Index (0 based) of the file. Must be between 0 and FileCount - 1.

See also

  • TZippyReader


TZippyReader.IsZipValid Method | FlexCel Studio for the .NET Framework documentation

TZippyReader.IsZipValid Method

Overloads

  • TZippyReader.IsZipValid(String)
  • TZippyReader.IsZipValid(Stream)

TZippyReader.IsZipValid(String)

Returns true if the file is a valid zip file.

Syntax

Namespace: FlexCel.Core

public static Boolean IsZipValid(String aZipFileName)

Parameters

<-> | Parameter | Type | Description
 | aZipFileName | String | File to test.

See also

  • TZippyReader

TZippyReader.IsZipValid(Stream)

Returns true if the stream contains a valid zip file.

Syntax

Namespace: FlexCel.Core

public static Boolean IsZipValid(Stream aStream)

Parameters

<-> | Parameter | Type | Description
 | aStream | Stream | Stream with the contents.

See also

  • TZippyReader


TZippyReader.ExtractFileName Method | FlexCel Studio for the .NET Framework documentation

TZippyReader.ExtractFileName Method

Returns the filename part of a full zip path. For example, if aFileName is 'test/test2/file1.zip' this method will return 'file1.zip'

Syntax

Namespace: FlexCel.Core

public static String ExtractFileName(String aFileName)

Parameters

<-> | Parameter | Type | Description
 | aFileName | String | Full Name and path of the file. See description and remarks at FileExists.

See also

  • TZippyReader


TZippyReader.ExtractFilePath Method | FlexCel Studio for the .NET Framework documentation

TZippyReader.ExtractFilePath Method

Returns the path part of a full zip path, including the trailing slash. For example, if aFileName is 'test/test2/file1.zip' this method will return 'test/test2/'

Syntax

Namespace: FlexCel.Core

public static String ExtractFilePath(String aFileName)

Parameters

<-> | Parameter | Type | Description
 | aFileName | String | Full Name and path of the file. See description and remarks at FileExists.

See also

  • TZippyReader


TZippyReader.Dispose Method | FlexCel Studio for the .NET Framework documentation

TZippyReader.Dispose Method

Overloads

  • TZippyReader.Dispose
  • TZippyReader.Dispose(Boolean)

TZippyReader.Dispose

Releases all resources used by the TZippyReader object.

Remarks

Call Dispose when you are finished using the TZippyReader. The Dispose method leaves the TZippyReader in an unusable state. After calling Dispose, you must release all references to the TZippyReader so the garbage collector can reclaim the memory that the TZippyReader was occupying.

Syntax

Namespace: FlexCel.Core

public void Dispose()

See also

  • TZippyReader

TZippyReader.Dispose(Boolean)

See dispose pattern.

Syntax

Namespace: FlexCel.Core

protected virtual void Dispose(Boolean disposing)

Parameters

<-> | Parameter | Type | Description
 | disposing | Boolean | If set to true this code is called from a Dispose call; if not from a finalizer.

See also

  • TZippyReader


TZippyWriter Class | FlexCel Studio for the .NET Framework documentation

TZippyWriter Class

Simple class for writing to a zip file. It can compress on the fly as you are generating the file.

Syntax

Namespace: FlexCel.Core

public class TZippyWriter: IDisposable

Constructors

Name | Description
TZippyWriter | Creates a new TZippyWriter object.

Methods

Name | Description
Close | Finalizes the zip file, by writing the final headers. You normally don't need to call this method, since it will be called automatically when you destroy the object.
CreateZip | Overloaded CreateZip(String) CreateZip(Stream, Boolean)
Add | Overloaded Add(String) Add(String, TCompressionMode) Add(String, DateTime, TCompressionMode)
AddFile | Adds an existing file to the zip file.
AddStream | Adds an existing stream to the zip file. Note that this method will add the data of an existing stream, if you want to get a stream where you can write data and it will be added on the fly to the zip file, use Add(​String) instead.
GetCompressionMode | Returns the compression mode for a file name. This method is used when you don't specify a compression mode or it is cmAutomatic.
Dispose | Overloaded Dispose Dispose(Boolean)


TZippyWriter.TZippyWriter Constructor | FlexCel Studio for the .NET Framework documentation

TZippyWriter.TZippyWriter Constructor

Creates a new TZippyWriter object.

Syntax

Namespace: FlexCel.Core

public TZippyWriter()

See also

  • TZippyWriter


TZippyWriter.Close Method | FlexCel Studio for the .NET Framework documentation

TZippyWriter.Close Method

Finalizes the zip file, by writing the final headers. You normally don't need to call this method, since it will be called automatically when you destroy the object.

Syntax

Namespace: FlexCel.Core

public void Close()

See also

  • TZippyWriter


TZippyWriter.CreateZip Method | FlexCel Studio for the .NET Framework documentation

TZippyWriter.CreateZip Method

Overloads

  • TZippyWriter.CreateZip(String)
  • TZippyWriter.CreateZip(Stream, Boolean)

TZippyWriter.CreateZip(String)

Creates a zip file on disk. After creating it, you can add new files with Add(String), AddFile and AddStream

Syntax

Namespace: FlexCel.Core

public void CreateZip(String aZipFileName)

Parameters

<-> | Parameter | Type | Description
 | aZipFileName | String | Name of the file that will be created on disk.

See also

  • TZippyWriter

TZippyWriter.CreateZip(Stream, Boolean)

Creates a zip file in a stream. After creating it, you can add new files with Add(String), AddFile and AddStream

Syntax

Namespace: FlexCel.Core

public void CreateZip(Stream aStream, Boolean aOwnsStream)

Parameters

<-> | Parameter | Type | Description
 | aStream | Stream | Stream where you want to create the file.
 | aOwnsStream | Boolean | If true, aStream will be freed when you destroy this object. If false, you need to destroy the stream yourself.

See also

  • TZippyWriter


TZippyWriter.Add Method | FlexCel Studio for the .NET Framework documentation

TZippyWriter.Add Method

Overloads

  • TZippyWriter.Add(String)
  • TZippyWriter.Add(String, TCompressionMode)
  • TZippyWriter.Add(String, DateTime, TCompressionMode)

TZippyWriter.Add(String)

Creates a new file in the zip file, and returns a new stream where you can write data to it on the fly. If you just want to add an existing stream or file to the zip file, use AddFile or AddStream instead. Important: The stream returned is owned by this TZippyWriter object, and you shouldn't destroy it.

Syntax

Namespace: FlexCel.Core

public Stream Add(String aFileName)

Parameters

<-> | Parameter | Type | Description
 | aFileName | String | FileName for the new file inside the zip file. For information and remarks about it, see TZippyReader.GetFileName

See also

  • TZippyWriter

TZippyWriter.Add(String, TCompressionMode)

Creates a new file in the zip file, and returns a new stream where you can write data to it on the fly. If you just want to add an existing stream or file to the zip file, use AddFile or AddStream instead. Important: The stream returned is owned by this TZippyWriter object, and you shouldn't destroy it.

Syntax

Namespace: FlexCel.Core

public Stream Add(String aFileName, TCompressionMode CompressionMode)

Parameters

<-> | Parameter | Type | Description
 | aFileName | String | FileName for the new file inside the zip file. For information and remarks about it, see TZippyReader.GetFileName
 | CompressionMode | TCompressionMode | How the file will be stored. We support deflated and stored modes. You can use stored to store files that are already compressed (like a png image), and deflated for the rest.

See also

  • TZippyWriter

TZippyWriter.Add(String, DateTime, TCompressionMode)

Creates a new file in the zip file, and returns a new stream where you can write data to it on the fly. If you just want to add an existing stream or file to the zip file, use AddFile or AddStream instead. Important: The stream returned is owned by this TZippyWriter object, and you shouldn't destroy it.

Syntax

Namespace: FlexCel.Core

public Stream Add(String aFileName, DateTime aFileDateTime, TCompressionMode CompressionMode)

Parameters

<-> | Parameter | Type | Description
 | aFileName | String | FileName for the new file inside the zip file. For information and remarks about it, see TZippyReader.GetFileName
 | aFileDateTime | DateTime | Date and time for the file that will be created inside the zip file.
 | CompressionMode | TCompressionMode | How the file will be stored. We support deflated and stored modes. You can use stored to store files that are already compressed (like a png image), and deflated for the rest.

See also

  • TZippyWriter


TZippyWriter.AddFile Method | FlexCel Studio for the .NET Framework documentation

TZippyWriter.AddFile Method

Adds an existing file to the zip file.

Syntax

Namespace: FlexCel.Core

public void AddFile(String aNameOnDisk, String aNameOnZip, DateTime aFileDateTime, TCompressionMode CompressionMode)

Parameters

<-> | Parameter | Type | Description
 | aNameOnDisk | String | File on the disk that you want to add to the zip file.
 | aNameOnZip | String | FileName for the new file inside the zip file. For information and remarks about it, see TZippyReader.GetFileName
 | aFileDateTime | DateTime | Date and time for the file that will be created inside the zip file.
 | CompressionMode | TCompressionMode | How the file will be stored. We support deflated and stored modes. You can use stored to store files that are already compressed (like a png image), and deflated for the rest.

See also

  • TZippyWriter


TZippyWriter.AddStream Method | FlexCel Studio for the .NET Framework documentation

TZippyWriter.AddStream Method

Adds an existing stream to the zip file. Note that this method will add the data of an existing stream, if you want to get a stream where you can write data and it will be added on the fly to the zip file, use Add(String) instead.

Syntax

Namespace: FlexCel.Core

public void AddStream(Stream aDataStream, String aNameOnZip, DateTime aFileDateTime, TCompressionMode CompressionMode)

Parameters

<-> | Parameter | Type | Description
 | aDataStream | Stream | Stream with the data that you want to add to the zip file.
 | aNameOnZip | String | FileName for the new file inside the zip file. For information and remarks about it, see TZippyReader.GetFileName
 | aFileDateTime | DateTime | Date and time for the file that will be created inside the zip file.
 | CompressionMode | TCompressionMode | How the file will be stored. We support deflated and stored modes. You can use stored to store files that are already compressed (like a png image), and deflated for the rest.

See also

  • TZippyWriter


TZippyWriter.GetCompressionMode Method | FlexCel Studio for the .NET Framework documentation

TZippyWriter.GetCompressionMode Method

Returns the compression mode for a file name. This method is used when you don't specify a compression mode or it is cmAutomatic.

Syntax

Namespace: FlexCel.Core

public static TCompressionMode GetCompressionMode(String aFileName)

Parameters

<-> | Parameter | Type | Description
 | aFileName | String | Name of the file as it will be stored in the zip file.

See also

  • TZippyWriter


TZippyWriter.Dispose Method | FlexCel Studio for the .NET Framework documentation

TZippyWriter.Dispose Method

Overloads

  • TZippyWriter.Dispose
  • TZippyWriter.Dispose(Boolean)

TZippyWriter.Dispose

Destroys the object.

Syntax

Namespace: FlexCel.Core

public void Dispose()

See also

  • TZippyWriter

TZippyWriter.Dispose(Boolean)

Destroys the object according to a normal dispose pattern.

Syntax

Namespace: FlexCel.Core

protected virtual void Dispose(Boolean disposing)

Parameters

<-> | Parameter | Type | Description
 | disposing | Boolean |

See also

  • TZippyWriter


VirtualCellEndReadingEventArgs Class | FlexCel Studio for the .NET Framework documentation

VirtualCellEndReadingEventArgs Class

Arguments passed in the event.

Syntax

Namespace: FlexCel.Core

public class VirtualCellEndReadingEventArgs: EventArgs


VirtualCellReadEventArgs Class | FlexCel Studio for the .NET Framework documentation

VirtualCellReadEventArgs Class

Arguments passed in the event.

Syntax

Namespace: FlexCel.Core

public class VirtualCellReadEventArgs: EventArgs

Constructors

Name | Description
VirtualCellRead​Event​Args | Creates a new instance.

Properties

Name | Description
Cell | Value and position of a cell.
NextSheet | Sheet where the next cell will be. By default, this value is set automatically, but you can change to other value to skip some sheets, or set it to null or empty to end reading the file. If for example you are at sheet "Sheet1" and set NextSheet to be "Sheet5", then the next time this event is called it will be with the first cell of Sheet5. To stop reading this sheet and move to the next, set "NextSheet" to be SheetNames[Cell.Sheet]
SheetNames | Array with all the sheet names in the file. You can use this array and Cell.Sheet to know the current and next sheet names.


VirtualCellReadEventArgs.VirtualCellReadEventArgs Constructor | FlexCel Studio for the .NET Framework documentation

VirtualCellReadEventArgs.VirtualCellReadEventArgs Constructor

Creates a new instance.

Syntax

Namespace: FlexCel.Core

public VirtualCellReadEventArgs(CellValue aCell, String aNextSheet, String[] aSheetNames)

Parameters

<-> | Parameter | Type | Description
 | aCell | CellValue | Cell value.
 | aNextSheet | String | Sheet where the next cell will be.
 | aSheetNames | String[] | An array with all the sheet names in the file.

See also

  • VirtualCellReadEventArgs


VirtualCellReadEventArgs.Cell Property | FlexCel Studio for the .NET Framework documentation

VirtualCellReadEventArgs.Cell Property

Value and position of a cell.

Syntax

Namespace: FlexCel.Core

public CellValue Cell { get; }

See also

  • VirtualCellReadEventArgs


VirtualCellReadEventArgs.NextSheet Property | FlexCel Studio for the .NET Framework documentation

VirtualCellReadEventArgs.NextSheet Property

Sheet where the next cell will be. By default, this value is set automatically, but you can change to other value to skip some sheets, or set it to null or empty to end reading the file.

If for example you are at sheet "Sheet1" and set NextSheet to be "Sheet5", then the next time this event is called it will be with the first cell of Sheet5. To stop reading this sheet and move to the next, set "NextSheet" to be SheetNames[Cell.Sheet]

Syntax

Namespace: FlexCel.Core

public String NextSheet { get; set; }

See also

  • VirtualCellReadEventArgs


VirtualCellReadEventArgs.SheetNames Property | FlexCel Studio for the .NET Framework documentation

VirtualCellReadEventArgs.SheetNames Property

Array with all the sheet names in the file. You can use this array and Cell.Sheet to know the current and next sheet names.

Syntax

Namespace: FlexCel.Core

public String[] SheetNames { get; }

See also

  • VirtualCellReadEventArgs


VirtualCellStartReadingEventArgs Class | FlexCel Studio for the .NET Framework documentation

VirtualCellStartReadingEventArgs Class

Arguments passed in the event.

Syntax

Namespace: FlexCel.Core

public class VirtualCellStartReadingEventArgs: EventArgs

Constructors

Name | Description
VirtualCellStart​Reading​Event​Args | Creates a new instance.

Properties

Name | Description
SheetNames | A list with all the sheets available in the file.
NextSheet | This is the next sheet that will be read by FlexCel. You can change it to start reading the file by a different sheet, or set it to empty or null to finish reading the file.


VirtualCellStartReadingEventArgs.VirtualCellStartReadingEventArgs Constructor | FlexCel Studio for the .NET Framework documentation

VirtualCellStartReadingEventArgs.VirtualCellStartReadingEventArgs Constructor

Creates a new instance.

Syntax

Namespace: FlexCel.Core

public VirtualCellStartReadingEventArgs(String[] aSheetNames, String aNextSheet)

Parameters

<-> | Parameter | Type | Description
 | aSheetNames | String[] | Array with all the sheet names available in the file.
 | aNextSheet | String | This is the next sheet that will be read by FlexCel. You can change it to start reading the file by a different sheet, or set it to empty or null to finish reading the file.

See also

  • VirtualCellStartReadingEventArgs


VirtualCellStartReadingEventArgs.SheetNames Property | FlexCel Studio for the .NET Framework documentation

VirtualCellStartReadingEventArgs.SheetNames Property

A list with all the sheets available in the file.

Syntax

Namespace: FlexCel.Core

public String[] SheetNames { get; }

See also

  • VirtualCellStartReadingEventArgs


VirtualCellStartReadingEventArgs.NextSheet Property | FlexCel Studio for the .NET Framework documentation

VirtualCellStartReadingEventArgs.NextSheet Property

This is the next sheet that will be read by FlexCel. You can change it to start reading the file by a different sheet, or set it to empty or null to finish reading the file.

Syntax

Namespace: FlexCel.Core

public String NextSheet { get; set; }

See also

  • VirtualCellStartReadingEventArgs


ChartStyle Structure | FlexCel Studio for the .NET Framework documentation

ChartStyle Structure

This structure defines the default style of a chart. Excel defines 48 default styles.

Syntax

Namespace: FlexCel.Core

public struct ChartStyle

Constructors

Name | Description
ChartStyle | Creates a new chart style.

Properties

Name | Description
Id | Returns the Style Id, between 1 and 48.
IdExtended | Returns the Id and adds 100 if is it extended.
IsExtended | Returns true if this is an extended style, used in Excel 2013 or newer.


ChartStyle.ChartStyle Constructor | FlexCel Studio for the .NET Framework documentation

ChartStyle.ChartStyle Constructor

Creates a new chart style.

Syntax

Namespace: FlexCel.Core

public ChartStyle(Int32 aStyle)

Parameters

<-> | Parameter | Type | Description
 | aStyle | Int32 | Style id. This number must be between 1 and 48 or 101 and 148. If it is outside this range, the style id will be initialized to 2. Numbers between 101 and 148 are extended styles which correspond to the numbers between 1 and 48, but with the IsExtended flag true.

See also

  • ChartStyle


ChartStyle.Id Property | FlexCel Studio for the .NET Framework documentation

ChartStyle.Id Property

Returns the Style Id, between 1 and 48.

Syntax

Namespace: FlexCel.Core

public Int32 Id { get; }

See also

  • ChartStyle


ChartStyle.IdExtended Property | FlexCel Studio for the .NET Framework documentation

ChartStyle.IdExtended Property

Returns the Id and adds 100 if is it extended.

Syntax

Namespace: FlexCel.Core

public Int32 IdExtended { get; }

See also

  • ChartStyle


ChartStyle.IsExtended Property | FlexCel Studio for the .NET Framework documentation

ChartStyle.IsExtended Property

Returns true if this is an extended style, used in Excel 2013 or newer.

Syntax

Namespace: FlexCel.Core

public Boolean IsExtended { get; }

See also

  • ChartStyle


StandardMimeType Structure | FlexCel Studio for the .NET Framework documentation

StandardMimeType Structure

Mime types for common file types.

Syntax

Namespace: FlexCel.Core

public struct StandardMimeType

Fields

Name | Description
Xls | Xls file.
Xlsx | Xlsx file.
Xlsm | Xlsm file.
Xltx | Xltx file.
Html | Html file.
Text | Text file.
Pdf | Pdf file.
Jpeg | Jpeg file.
Png | Png file.
Svg | Svg file.
Gif | Gif file.
Tiff | Tiff file.
Pict | Pict file.
Bmp | Bmp file.
Wmf | Wmf file.
Emf | Emf file.
OctectStream | This is the mime type required in PDF/A3 if the mime type is unknown.
Xml | An arbitrary xml file.
Wdp | Wdp (Windows Media Photo) file.


StandardMimeType.Xls Field | FlexCel Studio for the .NET Framework documentation

StandardMimeType.Xls Field

Xls file.

Syntax

Namespace: FlexCel.Core

public const String Xls = "application/vnd.ms-excel"

See also

  • StandardMimeType


StandardMimeType.Xlsx Field | FlexCel Studio for the .NET Framework documentation

StandardMimeType.Xlsx Field

Xlsx file.

Syntax

Namespace: FlexCel.Core

public const String Xlsx = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"

See also

  • StandardMimeType


StandardMimeType.Xlsm Field | FlexCel Studio for the .NET Framework documentation

StandardMimeType.Xlsm Field

Xlsm file.

Syntax

Namespace: FlexCel.Core

public const String Xlsm = "application/vnd.ms-excel.sheet.macroEnabled.12"

See also

  • StandardMimeType


StandardMimeType.Xltx Field | FlexCel Studio for the .NET Framework documentation

StandardMimeType.Xltx Field

Xltx file.

Syntax

Namespace: FlexCel.Core

public const String Xltx = "application/vnd.openxmlformats-officedocument.spreadsheetml.template"

See also

  • StandardMimeType


StandardMimeType.Html Field | FlexCel Studio for the .NET Framework documentation

StandardMimeType.Html Field

Html file.

Syntax

Namespace: FlexCel.Core

public const String Html = "text/html"

See also

  • StandardMimeType


StandardMimeType.Text Field | FlexCel Studio for the .NET Framework documentation

StandardMimeType.Text Field

Text file.

Syntax

Namespace: FlexCel.Core

public const String Text = "text/plain"

See also

  • StandardMimeType


StandardMimeType.Pdf Field | FlexCel Studio for the .NET Framework documentation

StandardMimeType.Pdf Field

Pdf file.

Syntax

Namespace: FlexCel.Core

public const String Pdf = "application/pdf"

See also

  • StandardMimeType


StandardMimeType.Jpeg Field | FlexCel Studio for the .NET Framework documentation

StandardMimeType.Jpeg Field

Jpeg file.

Syntax

Namespace: FlexCel.Core

public const String Jpeg = "image/jpeg"

See also

  • StandardMimeType


StandardMimeType.Png Field | FlexCel Studio for the .NET Framework documentation

StandardMimeType.Png Field

Png file.

Syntax

Namespace: FlexCel.Core

public const String Png = "image/png"

See also

  • StandardMimeType


StandardMimeType.Svg Field | FlexCel Studio for the .NET Framework documentation

StandardMimeType.Svg Field

Svg file.

Syntax

Namespace: FlexCel.Core

public const String Svg = "image/svg+xml"

See also

  • StandardMimeType


StandardMimeType.Gif Field | FlexCel Studio for the .NET Framework documentation

StandardMimeType.Gif Field

Gif file.

Syntax

Namespace: FlexCel.Core

public const String Gif = "image/gif"

See also

  • StandardMimeType


StandardMimeType.Tiff Field | FlexCel Studio for the .NET Framework documentation

StandardMimeType.Tiff Field

Tiff file.

Syntax

Namespace: FlexCel.Core

public const String Tiff = "image/tiff"

See also

  • StandardMimeType


StandardMimeType.Pict Field | FlexCel Studio for the .NET Framework documentation

StandardMimeType.Pict Field

Pict file.

Syntax

Namespace: FlexCel.Core

public const String Pict = "image/pict"

See also

  • StandardMimeType


StandardMimeType.Bmp Field | FlexCel Studio for the .NET Framework documentation

StandardMimeType.Bmp Field

Bmp file.

Syntax

Namespace: FlexCel.Core

public const String Bmp = "image/bmp"

See also

  • StandardMimeType


StandardMimeType.Wmf Field | FlexCel Studio for the .NET Framework documentation

StandardMimeType.Wmf Field

Wmf file.

Syntax

Namespace: FlexCel.Core

public const String Wmf = "image/x-wmf"

See also

  • StandardMimeType


StandardMimeType.Emf Field | FlexCel Studio for the .NET Framework documentation

StandardMimeType.Emf Field

Emf file.

Syntax

Namespace: FlexCel.Core

public const String Emf = "image/x-emf"

See also

  • StandardMimeType


StandardMimeType.OctectStream Field | FlexCel Studio for the .NET Framework documentation

StandardMimeType.OctectStream Field

This is the mime type required in PDF/A3 if the mime type is unknown.

Syntax

Namespace: FlexCel.Core

public const String OctectStream = "application/octet-stream"

See also

  • StandardMimeType


StandardMimeType.Xml Field | FlexCel Studio for the .NET Framework documentation

StandardMimeType.Xml Field

An arbitrary xml file.

Syntax

Namespace: FlexCel.Core

public const String Xml = "application/xml"

See also

  • StandardMimeType


StandardMimeType.Wdp Field | FlexCel Studio for the .NET Framework documentation

StandardMimeType.Wdp Field

Wdp (Windows Media Photo) file.

Syntax

Namespace: FlexCel.Core

public const String Wdp = "image/vnd.ms-photo"

See also

  • StandardMimeType


TCachedFontWidth Structure | FlexCel Studio for the .NET Framework documentation

TCachedFontWidth Structure

A font size cached for speed.

Syntax

Namespace: FlexCel.Core

public struct TCachedFontWidth

Fields

Name | Description
FontWidth | Width of the "0" character.
FontWidthScaled | Width of the "0" character at the current screen scaling.
SpaceWidth | Width of the Space character.
FontName | Font name.
FontSize | Font size.
FontStyle | Font Style.
ScreenScaling | The scale at which this font was measured.

Constructors

Name | Description
TCachedFontWidth | Creates an initializes an instance.


TCachedFontWidth.FontWidth Field | FlexCel Studio for the .NET Framework documentation

TCachedFontWidth.FontWidth Field

Width of the "0" character.

Syntax

Namespace: FlexCel.Core

public Double FontWidth

See also

  • TCachedFontWidth


TCachedFontWidth.FontWidthScaled Field | FlexCel Studio for the .NET Framework documentation

TCachedFontWidth.FontWidthScaled Field

Width of the "0" character at the current screen scaling.

Syntax

Namespace: FlexCel.Core

public Double FontWidthScaled

See also

  • TCachedFontWidth


TCachedFontWidth.SpaceWidth Field | FlexCel Studio for the .NET Framework documentation

TCachedFontWidth.SpaceWidth Field

Width of the Space character.

Syntax

Namespace: FlexCel.Core

public Double SpaceWidth

See also

  • TCachedFontWidth


TCachedFontWidth.FontName Field | FlexCel Studio for the .NET Framework documentation

TCachedFontWidth.FontName Field

Font name.

Syntax

Namespace: FlexCel.Core

public String FontName

See also

  • TCachedFontWidth


TCachedFontWidth.FontSize Field | FlexCel Studio for the .NET Framework documentation

TCachedFontWidth.FontSize Field

Font size.

Syntax

Namespace: FlexCel.Core

public Int32 FontSize

See also

  • TCachedFontWidth


TCachedFontWidth.FontStyle Field | FlexCel Studio for the .NET Framework documentation

TCachedFontWidth.FontStyle Field

Font Style.

Syntax

Namespace: FlexCel.Core

public TFlxFontStyles FontStyle

See also

  • TCachedFontWidth


TCachedFontWidth.ScreenScaling Field | FlexCel Studio for the .NET Framework documentation

TCachedFontWidth.ScreenScaling Field

The scale at which this font was measured.

Syntax

Namespace: FlexCel.Core

public Int32 ScreenScaling

See also

  • TCachedFontWidth


TCachedFontWidth.TCachedFontWidth Constructor | FlexCel Studio for the .NET Framework documentation

TCachedFontWidth.TCachedFontWidth Constructor

Creates an initializes an instance.

Syntax

Namespace: FlexCel.Core

public TCachedFontWidth(Double aFontWidth, Double aFontWidthScaled, Double aSpaceWidth, TFlxFont Fx, Int32 aScreenScaling)

Parameters

<-> | Parameter | Type | Description
 | aFontWidth | Double |
 | aFontWidthScaled | Double |
 | aSpaceWidth | Double |
 | Fx | TFlxFont |
 | aScreenScaling | Int32 |

See also

  • TCachedFontWidth


TCellAddressWithFileName Structure | FlexCel Studio for the .NET Framework documentation

TCellAddressWithFileName Structure

Encapsulates a cell address and the file where the cell is stored.

Syntax

Namespace: FlexCel.Core

public struct TCellAddressWithFileName

Fields

Name | Description
FileName | File where the cells is.
Address | Address where the cell is.

Constructors

Name | Description
TCellAddress​With​File​Name | Creates a new TCellAddress​With​File​Name with the given values.

Methods

Name | Description
Equals | Returns true if both objects are the same.
GetHashCode | Hash code of the object.

Operators

Name | Description
Equality | This operator is overridden so you can compare this structure directly with ==
Inequality | This operator is overriden so you can compare this structure directly with !=


TCellAddressWithFileName.FileName Field | FlexCel Studio for the .NET Framework documentation

TCellAddressWithFileName.FileName Field

File where the cells is.

Syntax

Namespace: FlexCel.Core

public readonly String FileName

See also

  • TCellAddressWithFileName


TCellAddressWithFileName.Address Field | FlexCel Studio for the .NET Framework documentation

TCellAddressWithFileName.Address Field

Address where the cell is.

Syntax

Namespace: FlexCel.Core

public readonly TCellAddress Address

See also

  • TCellAddressWithFileName


TCellAddressWithFileName.TCellAddressWithFileName Constructor | FlexCel Studio for the .NET Framework documentation

TCellAddressWithFileName.TCellAddressWithFileName Constructor

Creates a new TCellAddressWithFileName with the given values.

Syntax

Namespace: FlexCel.Core

public TCellAddressWithFileName(String aFileName, TCellAddress aAddress)

Parameters

<-> | Parameter | Type | Description
 | aFileName | String | File where the cell is.
 | aAddress | TCellAddress | Address where the cell is.

See also

  • TCellAddressWithFileName


TCellAddressWithFileName.Equals Method | FlexCel Studio for the .NET Framework documentation

TCellAddressWithFileName.Equals Method

Returns true if both objects are the same.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TCellAddressWithFileName


TCellAddressWithFileName.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TCellAddressWithFileName.GetHashCode Method

Hash code of the object.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TCellAddressWithFileName


TCellAddressWithFileName.Equality Operator | FlexCel Studio for the .NET Framework documentation

TCellAddressWithFileName.Equality Operator

This operator is overridden so you can compare this structure directly with ==

Syntax

Namespace: FlexCel.Core

public static Boolean op_Equality(TCellAddressWithFileName o1, TCellAddressWithFileName o2)

Parameters

<-> | Parameter | Type | Description
 | o1 | TCellAddress​With​File​Name |
 | o2 | TCellAddress​With​File​Name |

See also

  • TCellAddressWithFileName


TCellAddressWithFileName.Inequality Operator | FlexCel Studio for the .NET Framework documentation

TCellAddressWithFileName.Inequality Operator

This operator is overriden so you can compare this structure directly with !=

Syntax

Namespace: FlexCel.Core

public static Boolean op_Inequality(TCellAddressWithFileName o1, TCellAddressWithFileName o2)

Parameters

<-> | Parameter | Type | Description
 | o1 | TCellAddress​With​File​Name |
 | o2 | TCellAddress​With​File​Name |

See also

  • TCellAddressWithFileName


TCellMergedState Structure | FlexCel Studio for the .NET Framework documentation

TCellMergedState Structure

This struct is used in ExcelFile.CellMergedNext to keep track of the next merged cell that will be iterated.

Syntax

Namespace: FlexCel.Core

public struct TCellMergedState

Methods

Name | Description
Init | Initializes a new State ready to enumerate all merged cells in a sheet.


TCellMergedState.Init Method | FlexCel Studio for the .NET Framework documentation

TCellMergedState.Init Method

Initializes a new State ready to enumerate all merged cells in a sheet.

Syntax

Namespace: FlexCel.Core

public static TCellMergedState Init()

See also

  • TCellMergedState


TCharAndPos Structure | FlexCel Studio for the .NET Framework documentation

TCharAndPos Structure

A simple structure containing a position and a character.

Syntax

Namespace: FlexCel.Core

public struct TCharAndPos

Methods

Name | Description
Equals | True if both structs are the same.
GetHashCode | Returns the hashcode for the object.

Operators

Name | Description
Equality | Compares two structures.
Inequality | Compares two structures.

Properties

Name | Description
Pos | Position of the character in the string (0 based).
Char | Character that should go at position. Note that if this is a surrogate pair (UTF32) the string might have 2 UTF16 characters.


TCharAndPos.Equals Method | FlexCel Studio for the .NET Framework documentation

TCharAndPos.Equals Method

True if both structs are the same.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object | Object to check.

See also

  • TCharAndPos


TCharAndPos.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TCharAndPos.GetHashCode Method

Returns the hashcode for the object.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TCharAndPos


TCharAndPos.Equality Operator | FlexCel Studio for the .NET Framework documentation

TCharAndPos.Equality Operator

Compares two structures.

Syntax

Namespace: FlexCel.Core

public static Boolean op_Equality(TCharAndPos o1, TCharAndPos o2)

Parameters

<-> | Parameter | Type | Description
 | o1 | TCharAndPos |
 | o2 | TCharAndPos |

See also

  • TCharAndPos


TCharAndPos.Inequality Operator | FlexCel Studio for the .NET Framework documentation

TCharAndPos.Inequality Operator

Compares two structures.

Syntax

Namespace: FlexCel.Core

public static Boolean op_Inequality(TCharAndPos o1, TCharAndPos o2)

Parameters

<-> | Parameter | Type | Description
 | o1 | TCharAndPos |
 | o2 | TCharAndPos |

See also

  • TCharAndPos


TCharAndPos.Pos Property | FlexCel Studio for the .NET Framework documentation

TCharAndPos.Pos Property

Position of the character in the string (0 based).

Syntax

Namespace: FlexCel.Core

public Int32 Pos { get; set; }

See also

  • TCharAndPos


TCharAndPos.Char Property | FlexCel Studio for the .NET Framework documentation

TCharAndPos.Char Property

Character that should go at position. Note that if this is a surrogate pair (UTF32) the string might have 2 UTF16 characters.

Syntax

Namespace: FlexCel.Core

public String Char { get; set; }

See also

  • TCharAndPos


TChartPlotAreaPosition Structure | FlexCel Studio for the .NET Framework documentation

TChartPlotAreaPosition Structure

Defines the rectangle where a chart element is positioned.

Syntax

Namespace: FlexCel.Core

public struct TChartPlotAreaPosition

Constructors

Name | Description
TChartPlotArea​Position | Creates a new plot area position.

Properties

Name | Description
IsAutomatic | If true, then the rectangle is calculated on the fly, and the value of Rectangle has no meaning.
Rectangle | Rectangle where the element is. If IsAutomatic is true, this rectangle has no meaning. Otherwise, the actual value of the coordinates of the rectangle depend on LayoutTarget.
LayoutTarget | What the Rectangle means.
RectangleStarts​AtZero | In Excel 2003 or older, there is a margin around the plot area where no data can go. So, a Rectangle left of 0, meant to the start of the plot area + the margin. After Excel 2007 there is no margin anymore, and so you can place the plotarea at the actual 0 coordinates. If this property is false, it means the file was last saved by Excel 2003 and Rectangle includes margins.


TChartPlotAreaPosition.TChartPlotAreaPosition Constructor | FlexCel Studio for the .NET Framework documentation

TChartPlotAreaPosition.TChartPlotAreaPosition Constructor

Creates a new plot area position.

Syntax

Namespace: FlexCel.Core

public TChartPlotAreaPosition(Boolean aIsAutomatic, TChartRelativeRectangle aRectangle, TChartLayoutTarget aLayoutTarget, Boolean aRectangleStartsAtZero)

Parameters

<-> | Parameter | Type | Description
 | aIsAutomatic | Boolean | See IsAutomatic.
 | aRectangle | TChartRelative​Rectangle | See Rectangle.
 | aLayoutTarget | TChartLayoutTarget | See LayoutTarget.
 | aRectangleStartsAtZero | Boolean | See RectangleStartsAtZero

See also

  • TChartPlotAreaPosition


TChartPlotAreaPosition.IsAutomatic Property | FlexCel Studio for the .NET Framework documentation

TChartPlotAreaPosition.IsAutomatic Property

If true, then the rectangle is calculated on the fly, and the value of Rectangle has no meaning.

Syntax

Namespace: FlexCel.Core

public Boolean IsAutomatic { get; }

See also

  • TChartPlotAreaPosition


TChartPlotAreaPosition.Rectangle Property | FlexCel Studio for the .NET Framework documentation

TChartPlotAreaPosition.Rectangle Property

Rectangle where the element is. If IsAutomatic is true, this rectangle has no meaning. Otherwise, the actual value of the coordinates of the rectangle depend on LayoutTarget.

Syntax

Namespace: FlexCel.Core

public TChartRelativeRectangle Rectangle { get; }

See also

  • TChartPlotAreaPosition


TChartPlotAreaPosition.LayoutTarget Property | FlexCel Studio for the .NET Framework documentation

TChartPlotAreaPosition.LayoutTarget Property

What the Rectangle means.

Syntax

Namespace: FlexCel.Core

public TChartLayoutTarget LayoutTarget { get; }

See also

  • TChartPlotAreaPosition


TChartPlotAreaPosition.RectangleStartsAtZero Property | FlexCel Studio for the .NET Framework documentation

TChartPlotAreaPosition.RectangleStartsAtZero Property

In Excel 2003 or older, there is a margin around the plot area where no data can go. So, a Rectangle left of 0, meant to the start of the plot area + the margin. After Excel 2007 there is no margin anymore, and so you can place the plotarea at the actual 0 coordinates. If this property is false, it means the file was last saved by Excel 2003 and Rectangle includes margins.

Syntax

Namespace: FlexCel.Core

public Boolean RectangleStartsAtZero { get; }

See also

  • TChartPlotAreaPosition


TChartRelativeRectangle Structure | FlexCel Studio for the .NET Framework documentation

TChartRelativeRectangle Structure

A rectangle used in charts that is relative to a parent rectangle. The coordinates of the rectangle go between 0 and 1 where 0 means 0% of the coordinate of the parent, and 1 means 100%.

Syntax

Namespace: FlexCel.Core

public struct TChartRelativeRectangle

Constructors

Name | Description
TChartRelative​Rectangle | Creates a new TChartRelative​Rectangle.​

Methods

Name Description
CalcRect Overloaded
 CalcRect(TPointF, TUIRectangle)
CalcRect(TPointF, TUIRectangle, Double, Double)

Properties

Name | Description
X1 | Percent of the parent coordinate. 0 means parent.Left and 1 means parent.Right.
Y1 | Percent of the parent coordinate. 0 means parent.Top and 1 means parent.Bottom.
X2 | Percent of the parent coordinate. This value depends on WidthMode. If WidthMode is Factor, then 0 means 0 width, and 1 the width of the parent. If WidthMode is Edge, then 0 means parent.Left and 1 means parent.Right.
Y2 | Percent of the parent coordinate. This value depends on HeightMode. If HeightMode is Factor, then 0 means 0 height, and 1 the height of the parent. If HeightMode is Edge, then 0 means parent.Top and 1 means parent.Bottom.
XMode | Defines how X1 behaves. When this value is Factor, X1 is a percent of the offset from the default position. When this value is Edge, X1 is the left coordinate of the point.
YMode | Defines how Y1 behaves. When this value is Factor, Y1 is a percent of offset from the default position. When this value is Edge, Y1 is the top coordinate of the point.
WidthMode | Defines how X2 behaves. When this value is Factor, X2 is a percent of the width of the rectangle. When this value is Edge, X2 is the right coordinate of the rectangle.
HeightMode | Defines how Y2 behaves. When this value is Factor, Y2 is a percent of the height of the rectangle. When this value is Edge, Y2 is the bottom coordinate of the rectangle.
Automatic | Returns a new rectangle with no position set.


TChartRelativeRectangle.TChartRelativeRectangle Constructor | FlexCel Studio for the .NET Framework documentation

TChartRelativeRectangle.TChartRelativeRectangle Constructor

Creates a new TChartRelativeRectangle.

Syntax

Namespace: FlexCel.Core

public TChartRelativeRectangle(TChartLayoutMode aXMode, TChartLayoutMode aYMode, TChartLayoutMode aWidthMode, TChartLayoutMode aHeightMode, Double aX1, Double aY1, Double aX2, Double aY2)

Parameters

<-> | Parameter | Type | Description
 | aXMode | TChartLayoutMode | See XMode
 | aYMode | TChartLayoutMode | See YMode
 | aWidthMode | TChartLayoutMode | See WidthMode
 | aHeightMode | TChartLayoutMode | See HeightMode
 | aX1 | Double | See X1
 | aY1 | Double | See Y1
 | aX2 | Double | See X2
 | aY2 | Double | See Y2

See also

  • TChartRelativeRectangle


TChartRelativeRectangle.CalcRect Method | FlexCel Studio for the .NET Framework documentation

TChartRelativeRectangle.CalcRect Method

Overloads

  • TChartRelativeRectangle.CalcRect(TPointF, TUIRectangle)
  • TChartRelativeRectangle.CalcRect(TPointF, TUIRectangle, Double, Double)

TChartRelativeRectangle.CalcRect(TPointF, TUIRectangle)

Calculates the dimension of the rectangle given the parent rectangle.

Syntax

Namespace: FlexCel.Core

public TUIRectangle CalcRect(TPointF Point, TUIRectangle Coords)

Parameters

<-> | Parameter | Type | Description
 | Point | TPointF | Point with the default position to be used by the parent. When mode is not factor, it is not used.
 | Coords | TUIRectangle | Parent rectangle coordinates.

See also

  • TChartRelativeRectangle

TChartRelativeRectangle.CalcRect(TPointF, TUIRectangle, Double, Double)

Calculates the absolute rectangle given the parent rectangle.

Syntax

Namespace: FlexCel.Core

public TUIRectangle CalcRect(TPointF Point, TUIRectangle Coords, Double XDir, Double YDir)

Parameters

<-> | Parameter | Type | Description
 | Point | TPointF | Point with the default position to be used by the parent. When mode is not factor, it is not used.
 | Coords | TUIRectangle | Parent rectangle coordinates.
 | XDir | Double | Set it to -1 to reverse the x direction, or to 1 to keep it normal.
 | YDir | Double | Set it to -1 to reverse the y direction, or to 1 to keep it normal.

See also

  • TChartRelativeRectangle


TChartRelativeRectangle.X1 Property | FlexCel Studio for the .NET Framework documentation

TChartRelativeRectangle.X1 Property

Percent of the parent coordinate. 0 means parent.Left and 1 means parent.Right.

Syntax

Namespace: FlexCel.Core

public Double X1 { get; }

See also

  • TChartRelativeRectangle


TChartRelativeRectangle.Y1 Property | FlexCel Studio for the .NET Framework documentation

TChartRelativeRectangle.Y1 Property

Percent of the parent coordinate. 0 means parent.Top and 1 means parent.Bottom.

Syntax

Namespace: FlexCel.Core

public Double Y1 { get; }

See also

  • TChartRelativeRectangle


TChartRelativeRectangle.X2 Property | FlexCel Studio for the .NET Framework documentation

TChartRelativeRectangle.X2 Property

Percent of the parent coordinate. This value depends on WidthMode. If WidthMode is Factor, then 0 means 0 width, and 1 the width of the parent. If WidthMode is Edge, then 0 means parent.Left and 1 means parent.Right.

Syntax

Namespace: FlexCel.Core

public Double X2 { get; }

See also

  • TChartRelativeRectangle


TChartRelativeRectangle.Y2 Property | FlexCel Studio for the .NET Framework documentation

TChartRelativeRectangle.Y2 Property

Percent of the parent coordinate. This value depends on HeightMode. If HeightMode is Factor, then 0 means 0 height, and 1 the height of the parent. If HeightMode is Edge, then 0 means parent.Top and 1 means parent.Bottom.

Syntax

Namespace: FlexCel.Core

public Double Y2 { get; }

See also

  • TChartRelativeRectangle


TChartRelativeRectangle.XMode Property | FlexCel Studio for the .NET Framework documentation

TChartRelativeRectangle.XMode Property

Defines how X1 behaves. When this value is Factor, X1 is a percent of the offset from the default position. When this value is Edge, X1 is the left coordinate of the point.

Syntax

Namespace: FlexCel.Core

public TChartLayoutMode XMode { get; }

See also

  • TChartRelativeRectangle


TChartRelativeRectangle.YMode Property | FlexCel Studio for the .NET Framework documentation

TChartRelativeRectangle.YMode Property

Defines how Y1 behaves. When this value is Factor, Y1 is a percent of offset from the default position. When this value is Edge, Y1 is the top coordinate of the point.

Syntax

Namespace: FlexCel.Core

public TChartLayoutMode YMode { get; }

See also

  • TChartRelativeRectangle


TChartRelativeRectangle.WidthMode Property | FlexCel Studio for the .NET Framework documentation

TChartRelativeRectangle.WidthMode Property

Defines how X2 behaves. When this value is Factor, X2 is a percent of the width of the rectangle. When this value is Edge, X2 is the right coordinate of the rectangle.

Syntax

Namespace: FlexCel.Core

public TChartLayoutMode WidthMode { get; }

See also

  • TChartRelativeRectangle


TChartRelativeRectangle.HeightMode Property | FlexCel Studio for the .NET Framework documentation

TChartRelativeRectangle.HeightMode Property

Defines how Y2 behaves. When this value is Factor, Y2 is a percent of the height of the rectangle. When this value is Edge, Y2 is the bottom coordinate of the rectangle.

Syntax

Namespace: FlexCel.Core

public TChartLayoutMode HeightMode { get; }

See also

  • TChartRelativeRectangle


TChartRelativeRectangle.Automatic Property | FlexCel Studio for the .NET Framework documentation

TChartRelativeRectangle.Automatic Property

Returns a new rectangle with no position set.

Syntax

Namespace: FlexCel.Core

public static TChartRelativeRectangle Automatic { get; }

See also

  • TChartRelativeRectangle


TColorTransform Structure | FlexCel Studio for the .NET Framework documentation

TColorTransform Structure

Specifies a color transformation to be applied to a color.

Syntax

Namespace: FlexCel.Core

public struct TColorTransform

Constructors

Name | Description
TColorTransform | Creates a new TColorTransform with the corresponding parameters.

Methods

Name | Description
Equals | Returns true if both color transforms are the same.
GetHashCode | Hashcode for the color transform.
Transform | Applies the transform for a given color.

Operators

Name | Description
Equality | Returns true if both color transforms have the same value.
Inequality | Returns true if both color transforms do not have the same value.

Properties

Name | Description
ColorTransformType | Type of transformation to be applied.
Value | Value of the transform. The meaning of this field depends in the ColorTransformType value.


TColorTransform.TColorTransform Constructor | FlexCel Studio for the .NET Framework documentation

TColorTransform.TColorTransform Constructor

Creates a new TColorTransform with the corresponding parameters.

Syntax

Namespace: FlexCel.Core

public TColorTransform(TColorTransformType aColorTransformType, Double aValue)

Parameters

<-> | Parameter | Type | Description
 | aColorTransformType | TColorTransformType | Type of transformation to be applied.
 | aValue | Double | Value of the transform. The meaning of this field depends in the ColorTransformType value.

See also

  • TColorTransform


TColorTransform.Equals Method | FlexCel Studio for the .NET Framework documentation

TColorTransform.Equals Method

Returns true if both color transforms are the same.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TColorTransform


TColorTransform.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TColorTransform.GetHashCode Method

Hashcode for the color transform.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TColorTransform


TColorTransform.Transform Method | FlexCel Studio for the .NET Framework documentation

TColorTransform.Transform Method

Applies the transform for a given color.

Syntax

Namespace: FlexCel.Core

public TUIColor Transform(TUIColor c)

Parameters

<-> | Parameter | Type | Description
 | c | TUIColor | Color to transform.

Returns

Transformed color.

See also

  • TColorTransform


TColorTransform.Equality Operator | FlexCel Studio for the .NET Framework documentation

TColorTransform.Equality Operator

Returns true if both color transforms have the same value.

Syntax

Namespace: FlexCel.Core

public static Boolean op_Equality(TColorTransform o1, TColorTransform o2)

Parameters

<-> | Parameter | Type | Description
 | o1 | TColorTransform | First color transform to compare.
 | o2 | TColorTransform | Second color transform to compare.

See also

  • TColorTransform


TColorTransform.Inequality Operator | FlexCel Studio for the .NET Framework documentation

TColorTransform.Inequality Operator

Returns true if both color transforms do not have the same value.

Syntax

Namespace: FlexCel.Core

public static Boolean op_Inequality(TColorTransform o1, TColorTransform o2)

Parameters

<-> | Parameter | Type | Description
 | o1 | TColorTransform | First color transform to compare.
 | o2 | TColorTransform | Second color transform to compare.

See also

  • TColorTransform


TColorTransform.ColorTransformType Property | FlexCel Studio for the .NET Framework documentation

TColorTransform.ColorTransformType Property

Type of transformation to be applied.

Syntax

Namespace: FlexCel.Core

public TColorTransformType ColorTransformType { get; }

See also

  • TColorTransform


TColorTransform.Value Property | FlexCel Studio for the .NET Framework documentation

TColorTransform.Value Property

Value of the transform. The meaning of this field depends in the ColorTransformType value.

Syntax

Namespace: FlexCel.Core

public Double Value { get; }

See also

  • TColorTransform


TCondFmtApplyBorders Structure | FlexCel Studio for the .NET Framework documentation

TCondFmtApplyBorders Structure

Determines which parts of the borders will be applied in the conditional format.

Syntax

Namespace: FlexCel.Core

public struct TCondFmtApplyBorders

Constructors

Name | Description
TCondFmtApplyBorders | Overloaded TCondFmtApplyBorders(Boolean) TCondFmtApplyBorders(Boolean, Boolean, Boolean, Boolean)

Methods

Name | Description
Equals | Returns true if both objects are the same
GetHashCode | Returns the hashcode of the struct.

Operators

Name | Description
Equality | Returns true if both objects have the same information.
Inequality | returns true if both objects are different.

Properties

Name | Description
Left | Left border.
Top | Top border.
Right | Right border.
Bottom | Bottom border.
IsEmpty | Returns true if the format does not apply any setting.


TCondFmtApplyBorders.TCondFmtApplyBorders Constructor | FlexCel Studio for the .NET Framework documentation

TCondFmtApplyBorders.TCondFmtApplyBorders Constructor

Overloads

  • TCondFmtApplyBorders.TCondFmtApplyBorders(Boolean)
  • TCondFmtApplyBorders.TCondFmtApplyBorders(Boolean, Boolean, Boolean, Boolean)

TCondFmtApplyBorders.TCondFmtApplyBorders(Boolean)

Creates an Apply Borders setting all members to true or false.

Syntax

Namespace: FlexCel.Core

public TCondFmtApplyBorders(Boolean AllTrue)

Parameters

<-> | Parameter | Type | Description
 | AllTrue | Boolean | If true all members will be set to true. If not, all members will be false.

See also

  • TCondFmtApplyBorders

TCondFmtApplyBorders.TCondFmtApplyBorders(Boolean, Boolean, Boolean, Boolean)

Creates a new struct setting the members to true or false.

Syntax

Namespace: FlexCel.Core

public TCondFmtApplyBorders(Boolean aLeft, Boolean aTop, Boolean aRight, Boolean aBottom)

Parameters

<-> | Parameter | Type | Description
 | aLeft | Boolean | If true, the left border will be applied.
 | aTop | Boolean | If true, the top border will be applied.
 | aRight | Boolean | If true, the right border will be applied.
 | aBottom | Boolean | If true, the bottom border will be applied.

See also

  • TCondFmtApplyBorders


TCondFmtApplyBorders.Equals Method | FlexCel Studio for the .NET Framework documentation

TCondFmtApplyBorders.Equals Method

Returns true if both objects are the same

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TCondFmtApplyBorders


TCondFmtApplyBorders.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TCondFmtApplyBorders.GetHashCode Method

Returns the hashcode of the struct.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TCondFmtApplyBorders


TCondFmtApplyBorders.Equality Operator | FlexCel Studio for the .NET Framework documentation

TCondFmtApplyBorders.Equality Operator

Returns true if both objects have the same information.

Syntax

Namespace: FlexCel.Core

public static Boolean op_Equality(TCondFmtApplyBorders o1, TCondFmtApplyBorders o2)

Parameters

<-> | Parameter | Type | Description
 | o1 | TCondFmtApplyBorders |
 | o2 | TCondFmtApplyBorders |

See also

  • TCondFmtApplyBorders


TCondFmtApplyBorders.Inequality Operator | FlexCel Studio for the .NET Framework documentation

TCondFmtApplyBorders.Inequality Operator

returns true if both objects are different.

Syntax

Namespace: FlexCel.Core

public static Boolean op_Inequality(TCondFmtApplyBorders o1, TCondFmtApplyBorders o2)

Parameters

<-> | Parameter | Type | Description
 | o1 | TCondFmtApplyBorders |
 | o2 | TCondFmtApplyBorders |

See also

  • TCondFmtApplyBorders


TCondFmtApplyBorders.Left Property | FlexCel Studio for the .NET Framework documentation

TCondFmtApplyBorders.Left Property

Left border.

Syntax

Namespace: FlexCel.Core

public Boolean Left { get; set; }

See also

  • TCondFmtApplyBorders


TCondFmtApplyBorders.Top Property | FlexCel Studio for the .NET Framework documentation

TCondFmtApplyBorders.Top Property

Top border.

Syntax

Namespace: FlexCel.Core

public Boolean Top { get; set; }

See also

  • TCondFmtApplyBorders


TCondFmtApplyBorders.Right Property | FlexCel Studio for the .NET Framework documentation

TCondFmtApplyBorders.Right Property

Right border.

Syntax

Namespace: FlexCel.Core

public Boolean Right { get; set; }

See also

  • TCondFmtApplyBorders


TCondFmtApplyBorders.Bottom Property | FlexCel Studio for the .NET Framework documentation

TCondFmtApplyBorders.Bottom Property

Bottom border.

Syntax

Namespace: FlexCel.Core

public Boolean Bottom { get; set; }

See also

  • TCondFmtApplyBorders


TCondFmtApplyBorders.IsEmpty Property | FlexCel Studio for the .NET Framework documentation

TCondFmtApplyBorders.IsEmpty Property

Returns true if the format does not apply any setting.

Syntax

Namespace: FlexCel.Core

public Boolean IsEmpty { get; }

See also

  • TCondFmtApplyBorders


TCondFmtApplyFill Structure | FlexCel Studio for the .NET Framework documentation

TCondFmtApplyFill Structure

Determines which parts of the pattern will be applied in the conditional format.

Syntax

Namespace: FlexCel.Core

public struct TCondFmtApplyFill

Constructors

Name | Description
TCondFmtApplyFill | Overloaded TCondFmtApplyFill(Boolean) TCondFmtApplyFill(Boolean, Boolean, Boolean)

Methods

Name | Description
Equals | Returns true if both objects are the same
GetHashCode | Returns the hashcode of the struct.

Operators

Name | Description
Equality | Returns true if both objects have the same information.
Inequality | returns true if both objects are the same.

Properties

Name | Description
Pattern | Fill style.
FgColor | Color for the foreground of the pattern.
BgColor | Color for the background of the pattern. If the pattern is solid, has no effect.
IsEmpty | Returns true if the format does not apply any setting.


TCondFmtApplyFill.TCondFmtApplyFill Constructor | FlexCel Studio for the .NET Framework documentation

TCondFmtApplyFill.TCondFmtApplyFill Constructor

Overloads

  • TCondFmtApplyFill.TCondFmtApplyFill(Boolean)
  • TCondFmtApplyFill.TCondFmtApplyFill(Boolean, Boolean, Boolean)

TCondFmtApplyFill.TCondFmtApplyFill(Boolean)

Creates an Apply Fill setting all members to true or false.

Syntax

Namespace: FlexCel.Core

public TCondFmtApplyFill(Boolean AllTrue)

Parameters

<-> | Parameter | Type | Description
 | AllTrue | Boolean | If true all members will be set to true. If not, all members will be false.

See also

  • TCondFmtApplyFill

TCondFmtApplyFill.TCondFmtApplyFill(Boolean, Boolean, Boolean)

Creates a new struct setting the members to true or false.

Syntax

Namespace: FlexCel.Core

public TCondFmtApplyFill(Boolean aStyle, Boolean aFgColor, Boolean aBgColor)

Parameters

<-> | Parameter | Type | Description
 | aStyle | Boolean | If true, the style will be applied.
 | aFgColor | Boolean | If true, the foreground color will be applied.
 | aBgColor | Boolean | If true, the background color will be applied.

See also

  • TCondFmtApplyFill


TCondFmtApplyFill.Equals Method | FlexCel Studio for the .NET Framework documentation

TCondFmtApplyFill.Equals Method

Returns true if both objects are the same

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TCondFmtApplyFill


TCondFmtApplyFill.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TCondFmtApplyFill.GetHashCode Method

Returns the hashcode of the struct.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TCondFmtApplyFill


TCondFmtApplyFill.Equality Operator | FlexCel Studio for the .NET Framework documentation

TCondFmtApplyFill.Equality Operator

Returns true if both objects have the same information.

Syntax

Namespace: FlexCel.Core

public static Boolean op_Equality(TCondFmtApplyFill o1, TCondFmtApplyFill o2)

Parameters

<-> | Parameter | Type | Description
 | o1 | TCondFmtApplyFill |
 | o2 | TCondFmtApplyFill |

See also

  • TCondFmtApplyFill


TCondFmtApplyFill.Inequality Operator | FlexCel Studio for the .NET Framework documentation

TCondFmtApplyFill.Inequality Operator

returns true if both objects are the same.

Syntax

Namespace: FlexCel.Core

public static Boolean op_Inequality(TCondFmtApplyFill o1, TCondFmtApplyFill o2)

Parameters

<-> | Parameter | Type | Description
 | o1 | TCondFmtApplyFill |
 | o2 | TCondFmtApplyFill |

See also

  • TCondFmtApplyFill


TCondFmtApplyFill.Pattern Property | FlexCel Studio for the .NET Framework documentation

TCondFmtApplyFill.Pattern Property

Fill style.

Syntax

Namespace: FlexCel.Core

public Boolean Pattern { get; set; }

See also

  • TCondFmtApplyFill


TCondFmtApplyFill.FgColor Property | FlexCel Studio for the .NET Framework documentation

TCondFmtApplyFill.FgColor Property

Color for the foreground of the pattern.

Syntax

Namespace: FlexCel.Core

public Boolean FgColor { get; set; }

See also

  • TCondFmtApplyFill


TCondFmtApplyFill.BgColor Property | FlexCel Studio for the .NET Framework documentation

TCondFmtApplyFill.BgColor Property

Color for the background of the pattern. If the pattern is solid, has no effect.

Syntax

Namespace: FlexCel.Core

public Boolean BgColor { get; set; }

See also

  • TCondFmtApplyFill


TCondFmtApplyFill.IsEmpty Property | FlexCel Studio for the .NET Framework documentation

TCondFmtApplyFill.IsEmpty Property

Returns true if the format does not apply any setting.

Syntax

Namespace: FlexCel.Core

public Boolean IsEmpty { get; }

See also

  • TCondFmtApplyFill


TCondFmtApplyFont Structure | FlexCel Studio for the .NET Framework documentation

TCondFmtApplyFont Structure

Determines which parts of the font will be applied in the conditional format.

Syntax

Namespace: FlexCel.Core

public struct TCondFmtApplyFont

Constructors

Name | Description
TCondFmtApplyFont | Overloaded TCondFmtApplyFont(Boolean) TCondFmtApplyFont(Boolean, Boolean, Boolean, Boolean, Boolean, Boolean)

Methods

Name | Description
Equals | Returns true if both objects are the same.
GetHashCode | Returns the hashcode of the struct.

Operators

Name | Description
Equality | Returns true if both objects have the same information.
Inequality | returns true if both objects are different.

Properties

Name | Description
Size20 | Size of the font.
Color | Color of the font.
BoldAndItalic | If true, both bold and italic will be applied.
Strikeout | If true, the strikeout style of the font will be used.
SubSuperscript | If true, both superscript and subscript will be applied.
Underline | If true, the underline style of the font will be used.
IsEmpty | Returns true if the format does not apply any setting.


TCondFmtApplyFont.TCondFmtApplyFont Constructor | FlexCel Studio for the .NET Framework documentation

TCondFmtApplyFont.TCondFmtApplyFont Constructor

Overloads

  • TCondFmtApplyFont.TCondFmtApplyFont(Boolean)
  • TCondFmtApplyFont.TCondFmtApplyFont(Boolean, Boolean, Boolean, Boolean, Boolean, Boolean)

TCondFmtApplyFont.TCondFmtApplyFont(Boolean)

Creates an Apply Font setting all members to true or false.

Syntax

Namespace: FlexCel.Core

public TCondFmtApplyFont(Boolean AllTrue)

Parameters

<-> | Parameter | Type | Description
 | AllTrue | Boolean | If true all members will be set to true. If not, all members will be false.

See also

  • TCondFmtApplyFont

TCondFmtApplyFont.TCondFmtApplyFont(Boolean, Boolean, Boolean, Boolean, Boolean, Boolean)

Creates a new struct setting the members to true or false.

Syntax

Namespace: FlexCel.Core

public TCondFmtApplyFont(Boolean aSize20, Boolean aColor, Boolean aBoldAndItalic, Boolean aStrikeout, Boolean aSubSuperscript, Boolean aUnderline)

Parameters

<-> | Parameter | Type | Description
 | aSize20 | Boolean | If true, the font size will be applied.
 | aColor | Boolean | If true, the font color will be applied.
 | aBoldAndItalic | Boolean | If true, the font bold and italic styles will be applied.
 | aStrikeout | Boolean | If true, the font strikeout style will be applied.
 | aSubSuperscript | Boolean | If true, the font subscript and superscript will be applied.
 | aUnderline | Boolean | If true, the font underline will be applied.

See also

  • TCondFmtApplyFont


TCondFmtApplyFont.Equals Method | FlexCel Studio for the .NET Framework documentation

TCondFmtApplyFont.Equals Method

Returns true if both objects are the same.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TCondFmtApplyFont


TCondFmtApplyFont.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TCondFmtApplyFont.GetHashCode Method

Returns the hashcode of the struct.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TCondFmtApplyFont


TCondFmtApplyFont.Equality Operator | FlexCel Studio for the .NET Framework documentation

TCondFmtApplyFont.Equality Operator

Returns true if both objects have the same information.

Syntax

Namespace: FlexCel.Core

public static Boolean op_Equality(TCondFmtApplyFont o1, TCondFmtApplyFont o2)

Parameters

<-> | Parameter | Type | Description
 | o1 | TCondFmtApplyFont |
 | o2 | TCondFmtApplyFont |

See also

  • TCondFmtApplyFont


TCondFmtApplyFont.Inequality Operator | FlexCel Studio for the .NET Framework documentation

TCondFmtApplyFont.Inequality Operator

returns true if both objects are different.

Syntax

Namespace: FlexCel.Core

public static Boolean op_Inequality(TCondFmtApplyFont o1, TCondFmtApplyFont o2)

Parameters

<-> | Parameter | Type | Description
 | o1 | TCondFmtApplyFont |
 | o2 | TCondFmtApplyFont |

See also

  • TCondFmtApplyFont


TCondFmtApplyFont.Size20 Property | FlexCel Studio for the .NET Framework documentation

TCondFmtApplyFont.Size20 Property

Size of the font.

Syntax

Namespace: FlexCel.Core

public Boolean Size20 { get; set; }

See also

  • TCondFmtApplyFont


TCondFmtApplyFont.Color Property | FlexCel Studio for the .NET Framework documentation

TCondFmtApplyFont.Color Property

Color of the font.

Syntax

Namespace: FlexCel.Core

public Boolean Color { get; set; }

See also

  • TCondFmtApplyFont


TCondFmtApplyFont.BoldAndItalic Property | FlexCel Studio for the .NET Framework documentation

TCondFmtApplyFont.BoldAndItalic Property

If true, both bold and italic will be applied.

Syntax

Namespace: FlexCel.Core

public Boolean BoldAndItalic { get; set; }

See also

  • TCondFmtApplyFont


TCondFmtApplyFont.Strikeout Property | FlexCel Studio for the .NET Framework documentation

TCondFmtApplyFont.Strikeout Property

If true, the strikeout style of the font will be used.

Syntax

Namespace: FlexCel.Core

public Boolean Strikeout { get; set; }

See also

  • TCondFmtApplyFont


TCondFmtApplyFont.SubSuperscript Property | FlexCel Studio for the .NET Framework documentation

TCondFmtApplyFont.SubSuperscript Property

If true, both superscript and subscript will be applied.

Syntax

Namespace: FlexCel.Core

public Boolean SubSuperscript { get; set; }

See also

  • TCondFmtApplyFont


TCondFmtApplyFont.Underline Property | FlexCel Studio for the .NET Framework documentation

TCondFmtApplyFont.Underline Property

If true, the underline style of the font will be used.

Syntax

Namespace: FlexCel.Core

public Boolean Underline { get; set; }

See also

  • TCondFmtApplyFont


TCondFmtApplyFont.IsEmpty Property | FlexCel Studio for the .NET Framework documentation

TCondFmtApplyFont.IsEmpty Property

Returns true if the format does not apply any setting.

Syntax

Namespace: FlexCel.Core

public Boolean IsEmpty { get; }

See also

  • TCondFmtApplyFont


TCondFmtBorders Structure | FlexCel Studio for the .NET Framework documentation

TCondFmtBorders Structure

Determines which parts of the borders will be applied in the conditional format.

Syntax

Namespace: FlexCel.Core

public struct TCondFmtBorders

Fields

Name | Description
Left | Left border.
Top | Top border.
Right | Right border.
Bottom | Bottom border.

Constructors

Name | Description
TCondFmtBorders | Creates a new struct setting the members.

Methods

Name | Description
Equals | Returns true if both objects are the same
GetHashCode | Returns the hashcode of the struct.

Operators

Name | Description
Equality | Returns true if both objects have the same information.
Inequality | returns true if both objects are different.


TCondFmtBorders.Left Field | FlexCel Studio for the .NET Framework documentation

TCondFmtBorders.Left Field

Left border.

Syntax

Namespace: FlexCel.Core

public TFlxOneBorder Left

See also

  • TCondFmtBorders


TCondFmtBorders.Top Field | FlexCel Studio for the .NET Framework documentation

TCondFmtBorders.Top Field

Top border.

Syntax

Namespace: FlexCel.Core

public TFlxOneBorder Top

See also

  • TCondFmtBorders


TCondFmtBorders.Right Field | FlexCel Studio for the .NET Framework documentation

TCondFmtBorders.Right Field

Right border.

Syntax

Namespace: FlexCel.Core

public TFlxOneBorder Right

See also

  • TCondFmtBorders


TCondFmtBorders.Bottom Field | FlexCel Studio for the .NET Framework documentation

TCondFmtBorders.Bottom Field

Bottom border.

Syntax

Namespace: FlexCel.Core

public TFlxOneBorder Bottom

See also

  • TCondFmtBorders


TCondFmtBorders.TCondFmtBorders Constructor | FlexCel Studio for the .NET Framework documentation

TCondFmtBorders.TCondFmtBorders Constructor

Creates a new struct setting the members.

Syntax

Namespace: FlexCel.Core

public TCondFmtBorders(TFlxOneBorder aLeft, TFlxOneBorder aTop, TFlxOneBorder aRight, TFlxOneBorder aBottom)

Parameters

<-> | Parameter | Type | Description
 | aLeft | TFlxOneBorder | Left border.
 | aTop | TFlxOneBorder | Top border.
 | aRight | TFlxOneBorder | Right border.
 | aBottom | TFlxOneBorder | Bottom border.

See also

  • TCondFmtBorders


TCondFmtBorders.Equals Method | FlexCel Studio for the .NET Framework documentation

TCondFmtBorders.Equals Method

Returns true if both objects are the same

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TCondFmtBorders


TCondFmtBorders.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TCondFmtBorders.GetHashCode Method

Returns the hashcode of the struct.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TCondFmtBorders


TCondFmtBorders.Equality Operator | FlexCel Studio for the .NET Framework documentation

TCondFmtBorders.Equality Operator

Returns true if both objects have the same information.

Syntax

Namespace: FlexCel.Core

public static Boolean op_Equality(TCondFmtBorders o1, TCondFmtBorders o2)

Parameters

<-> | Parameter | Type | Description
 | o1 | TCondFmtBorders |
 | o2 | TCondFmtBorders |

See also

  • TCondFmtBorders


TCondFmtBorders.Inequality Operator | FlexCel Studio for the .NET Framework documentation

TCondFmtBorders.Inequality Operator

returns true if both objects are different.

Syntax

Namespace: FlexCel.Core

public static Boolean op_Inequality(TCondFmtBorders o1, TCondFmtBorders o2)

Parameters

<-> | Parameter | Type | Description
 | o1 | TCondFmtBorders |
 | o2 | TCondFmtBorders |

See also

  • TCondFmtBorders


TCondFmtFont Structure | FlexCel Studio for the .NET Framework documentation

TCondFmtFont Structure

Determines which parts of the font will be applied in the conditional format.

Syntax

Namespace: FlexCel.Core

public struct TCondFmtFont

Fields

Name | Description
Size20 | Font size in 1/20 of a point.
Color | Color of the font.
Style | Style of the font.
Underline | Underline of the font.

Constructors

Name | Description
TCondFmtFont | Creates a new struct setting the members.

Methods

Name | Description
Equals | Returns true if both objects are the same.
GetHashCode | Returns the hashcode of the struct.

Operators

Name | Description
Equality | Returns true if both objects have the same information.
Inequality | returns true if both objects are different.


TCondFmtFont.Size20 Field | FlexCel Studio for the .NET Framework documentation

TCondFmtFont.Size20 Field

Font size in 1/20 of a point.

Syntax

Namespace: FlexCel.Core

public Int32 Size20

See also

  • TCondFmtFont


TCondFmtFont.Color Field | FlexCel Studio for the .NET Framework documentation

TCondFmtFont.Color Field

Color of the font.

Syntax

Namespace: FlexCel.Core

public TExcelColor Color

See also

  • TCondFmtFont


TCondFmtFont.Style Field | FlexCel Studio for the .NET Framework documentation

TCondFmtFont.Style Field

Style of the font.

Syntax

Namespace: FlexCel.Core

public TFlxFontStyles Style

See also

  • TCondFmtFont


TCondFmtFont.Underline Field | FlexCel Studio for the .NET Framework documentation

TCondFmtFont.Underline Field

Underline of the font.

Syntax

Namespace: FlexCel.Core

public TFlxUnderline Underline

See also

  • TCondFmtFont


TCondFmtFont.TCondFmtFont Constructor | FlexCel Studio for the .NET Framework documentation

TCondFmtFont.TCondFmtFont Constructor

Creates a new struct setting the members.

Syntax

Namespace: FlexCel.Core

public TCondFmtFont(Int32 aSize20, TExcelColor aColor, TFlxFontStyles aStyle, TFlxUnderline aUnderline)

Parameters

<-> | Parameter | Type | Description
 | aSize20 | Int32 | Size of the font in 1/20 of a point.
 | aColor | TExcelColor | Color of the font.
 | aStyle | TFlxFontStyles | Style of the font.
 | aUnderline | TFlxUnderline | Underline of the font.

See also

  • TCondFmtFont


TCondFmtFont.Equals Method | FlexCel Studio for the .NET Framework documentation

TCondFmtFont.Equals Method

Returns true if both objects are the same.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TCondFmtFont


TCondFmtFont.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TCondFmtFont.GetHashCode Method

Returns the hashcode of the struct.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TCondFmtFont


TCondFmtFont.Equality Operator | FlexCel Studio for the .NET Framework documentation

TCondFmtFont.Equality Operator

Returns true if both objects have the same information.

Syntax

Namespace: FlexCel.Core

public static Boolean op_Equality(TCondFmtFont o1, TCondFmtFont o2)

Parameters

<-> | Parameter | Type | Description
 | o1 | TCondFmtFont |
 | o2 | TCondFmtFont |

See also

  • TCondFmtFont


TCondFmtFont.Inequality Operator | FlexCel Studio for the .NET Framework documentation

TCondFmtFont.Inequality Operator

returns true if both objects are different.

Syntax

Namespace: FlexCel.Core

public static Boolean op_Inequality(TCondFmtFont o1, TCondFmtFont o2)

Parameters

<-> | Parameter | Type | Description
 | o1 | TCondFmtFont |
 | o2 | TCondFmtFont |

See also

  • TCondFmtFont


TConditionalFormatCustomIconDef Structure | FlexCel Studio for the .NET Framework documentation

TConditionalFormatCustomIconDef Structure

This structure holds a single icon from a specific icon set.

Syntax

Namespace: FlexCel.Core

public struct TConditionalFormatCustomIconDef

Constructors

Name | Description
TConditional​Format​Custom​IconDef | Creates a new structure with the given iconset and number.

Properties

Name | Description
IconSet | Icon set where to get the icon.
IconNumber | Icon position in the set (0 based).


TConditionalFormatCustomIconDef.TConditionalFormatCustomIconDef Constructor | FlexCel Studio for the .NET Framework documentation

TConditionalFormatCustomIconDef.TConditionalFormatCustomIconDef Constructor

Creates a new structure with the given iconset and number.

Syntax

Namespace: FlexCel.Core

public TConditionalFormatCustomIconDef(TCondFmtIconSet aIconSet, Int32 aIconNumber)

Parameters

<-> | Parameter | Type | Description
 | aIconSet | TCondFmtIconSet | Icon set where to get the icon.
 | aIconNumber | Int32 | Icon position in the set (0 based).

See also

  • TConditionalFormatCustomIconDef


TConditionalFormatCustomIconDef.IconSet Property | FlexCel Studio for the .NET Framework documentation

TConditionalFormatCustomIconDef.IconSet Property

Icon set where to get the icon.

Syntax

Namespace: FlexCel.Core

public TCondFmtIconSet IconSet { get; }

See also

  • TConditionalFormatCustomIconDef


TConditionalFormatCustomIconDef.IconNumber Property | FlexCel Studio for the .NET Framework documentation

TConditionalFormatCustomIconDef.IconNumber Property

Icon position in the set (0 based).

Syntax

Namespace: FlexCel.Core

public Int32 IconNumber { get; }

See also

  • TConditionalFormatCustomIconDef


TDataLabelsRange Structure | FlexCel Studio for the .NET Framework documentation

TDataLabelsRange Structure

Encapsulates the data for a range of text used in labels

Syntax

Namespace: FlexCel.Core

public struct TDataLabelsRange

Constructors

Name | Description
TDataLabelsRange | Overloaded TDataLabelsRange(String) TDataLabelsRange(String, TRichString[])

Properties

Name | Description
Formula | Formula text.
Value | Values of the formula.


TDataLabelsRange.TDataLabelsRange Constructor | FlexCel Studio for the .NET Framework documentation

TDataLabelsRange.TDataLabelsRange Constructor

Overloads

  • TDataLabelsRange.TDataLabelsRange(String)
  • TDataLabelsRange.TDataLabelsRange(String, TRichString[])

TDataLabelsRange.TDataLabelsRange(String)

Creates an object with a formula but unknown values.

Syntax

Namespace: FlexCel.Core

public TDataLabelsRange(String aFormula)

Parameters

<-> | Parameter | Type | Description
 | aFormula | String |

See also

  • TDataLabelsRange

TDataLabelsRange.TDataLabelsRange(String, TRichString[])

Creates an object and assigns the values.

Syntax

Namespace: FlexCel.Core

public TDataLabelsRange(String aFormula, TRichString[] aValue)

Parameters

<-> | Parameter | Type | Description
 | aFormula | String |
 | aValue | TRichString[] |

See also

  • TDataLabelsRange


TDataLabelsRange.Formula Property | FlexCel Studio for the .NET Framework documentation

TDataLabelsRange.Formula Property

Formula text.

Syntax

Namespace: FlexCel.Core

public String Formula { get; }

See also

  • TDataLabelsRange


TDataLabelsRange.Value Property | FlexCel Studio for the .NET Framework documentation

TDataLabelsRange.Value Property

Values of the formula.

Syntax

Namespace: FlexCel.Core

public TRichString[] Value { get; }

See also

  • TDataLabelsRange


TDocumentCustomProperty Structure | FlexCel Studio for the .NET Framework documentation

TDocumentCustomProperty Structure

Encapsulates a custom property of an Excel file.

Syntax

Namespace: FlexCel.Core

public struct TDocumentCustomProperty

Constructors

Name Description
TDocumentCustom​Property Overloaded
 TDocumentCustomProperty(String, String, Int32, String, TDocumentCustomPropertyType, String)
TDocumentCustomProperty(String, String, Int32, String, TDocumentCustomPropertyType, String, String)

Methods

Name | Description
Equals | Returns true if 2 objects have the same data.
GetHashCode | The hashcode of the object.

Operators

Name | Description
Equality | Returns true if 2 structures have the same values.
Inequality | Returns true if 2 structures have different values.

Properties

Name | Description
Name | Name of the custom property.
FmtId | GUID for the property. In Excel this value is always {​D5CDD505-​2E9C-​101B-​9397-​08002B2CF9AE} You can leave this null, in this case {​D5CDD505-​2E9C-​101B-​9397-​08002B2CF9AE} will be used.
PId | Numeric Id for the property. This value is for OLE compatibility and must be unique.
LinkTarget | Specifies the name of a bookmark in the table or named cell from which the value of this custom document property should be extracted. You can normally leave this value null.
PropType | Type of the property. Note that while you can define any variant, Excel only recognizes the types in this enumeration.
Value | Value of the property. You must ensure it is valid for the proptype.
PropTypeStr | Used for unknown prop types, it handles the string with the name. You shouldn't need to use this.
Empty | Returns an empty property


TDocumentCustomProperty.TDocumentCustomProperty Constructor | FlexCel Studio for the .NET Framework documentation

TDocumentCustomProperty.TDocumentCustomProperty Constructor

Overloads

  • TDocumentCustomProperty.TDocumentCustomProperty(String, String, Int32, String, TDocumentCustomPropertyType, String)
  • TDocumentCustomProperty.TDocumentCustomProperty(String, String, Int32, String, TDocumentCustomPropertyType, String, String)

TDocumentCustomProperty.TDocumentCustomProperty(String, String, Int32, String, TDocumentCustomPropertyType, String)

Creates a new instance of this object. Don't call this overload if PropType is Unknown, since in that case you also need to specify PropTypeStr

Syntax

Namespace: FlexCel.Core

public TDocumentCustomProperty(String aName, String aFmtId, Int32 aPId, String aLinkTarget, TDocumentCustomPropertyType aPropType, String aValue)

Parameters

<-> | Parameter | Type | Description
 | aName | String | See Name.
 | aFmtId | String | See FmtId.
 | aPId | Int32 | See PId.
 | aLinkTarget | String | See LinkTarget.
 | aPropType | TDocumentCustom​Property​Type | See PropType.
 | aValue | String | See Value.

See also

  • TDocumentCustomProperty

TDocumentCustomProperty.TDocumentCustomProperty(String, String, Int32, String, TDocumentCustomPropertyType, String, String)

Creates a new instance of this object. Call this overload if PropType is Unknown, since in that case you also need to specify PropTypeStr

Syntax

Namespace: FlexCel.Core

public TDocumentCustomProperty(String aName, String aFmtId, Int32 aPId, String aLinkTarget, TDocumentCustomPropertyType aPropType, String aValue, String aPropTypeStr)

Parameters

<-> | Parameter | Type | Description
 | aName | String | See Name.
 | aFmtId | String | See FmtId.
 | aPId | Int32 | See PId.
 | aLinkTarget | String | See LinkTarget.
 | aPropType | TDocumentCustom​Property​Type | See PropType.
 | aValue | String | See Value.
 | aPropTypeStr | String | See PropTypeStr.

See also

  • TDocumentCustomProperty


TDocumentCustomProperty.Equals Method | FlexCel Studio for the .NET Framework documentation

TDocumentCustomProperty.Equals Method

Returns true if 2 objects have the same data.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TDocumentCustomProperty


TDocumentCustomProperty.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TDocumentCustomProperty.GetHashCode Method

The hashcode of the object.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TDocumentCustomProperty


TDocumentCustomProperty.Equality Operator | FlexCel Studio for the .NET Framework documentation

TDocumentCustomProperty.Equality Operator

Returns true if 2 structures have the same values.

Syntax

Namespace: FlexCel.Core

public static Boolean op_Equality(TDocumentCustomProperty o1, TDocumentCustomProperty o2)

Parameters

<-> | Parameter | Type | Description
 | o1 | TDocumentCustom​Property |
 | o2 | TDocumentCustom​Property |

See also

  • TDocumentCustomProperty


TDocumentCustomProperty.Inequality Operator | FlexCel Studio for the .NET Framework documentation

TDocumentCustomProperty.Inequality Operator

Returns true if 2 structures have different values.

Syntax

Namespace: FlexCel.Core

public static Boolean op_Inequality(TDocumentCustomProperty o1, TDocumentCustomProperty o2)

Parameters

<-> | Parameter | Type | Description
 | o1 | TDocumentCustom​Property |
 | o2 | TDocumentCustom​Property |

See also

  • TDocumentCustomProperty


TDocumentCustomProperty.Name Property | FlexCel Studio for the .NET Framework documentation

TDocumentCustomProperty.Name Property

Name of the custom property.

Syntax

Namespace: FlexCel.Core

public String Name { get; }

See also

  • TDocumentCustomProperty


TDocumentCustomProperty.FmtId Property | FlexCel Studio for the .NET Framework documentation

TDocumentCustomProperty.FmtId Property

GUID for the property. In Excel this value is always {D5CDD505-2E9C-101B-9397-08002B2CF9AE} You can leave this null, in this case {D5CDD505-2E9C-101B-9397-08002B2CF9AE} will be used.

Syntax

Namespace: FlexCel.Core

public String FmtId { get; }

See also

  • TDocumentCustomProperty


TDocumentCustomProperty.PId Property | FlexCel Studio for the .NET Framework documentation

TDocumentCustomProperty.PId Property

Numeric Id for the property. This value is for OLE compatibility and must be unique.

Syntax

Namespace: FlexCel.Core

public Int32 PId { get; }

See also

  • TDocumentCustomProperty


TDocumentCustomProperty.LinkTarget Property | FlexCel Studio for the .NET Framework documentation

TDocumentCustomProperty.LinkTarget Property

Specifies the name of a bookmark in the table or named cell from which the value of this custom document property should be extracted. You can normally leave this value null.

Syntax

Namespace: FlexCel.Core

public String LinkTarget { get; }

See also

  • TDocumentCustomProperty


TDocumentCustomProperty.PropType Property | FlexCel Studio for the .NET Framework documentation

TDocumentCustomProperty.PropType Property

Type of the property. Note that while you can define any variant, Excel only recognizes the types in this enumeration.

Syntax

Namespace: FlexCel.Core

public TDocumentCustomPropertyType PropType { get; }

See also

  • TDocumentCustomProperty


TDocumentCustomProperty.Value Property | FlexCel Studio for the .NET Framework documentation

TDocumentCustomProperty.Value Property

Value of the property. You must ensure it is valid for the proptype.

Syntax

Namespace: FlexCel.Core

public String Value { get; }

See also

  • TDocumentCustomProperty


TDocumentCustomProperty.PropTypeStr Property | FlexCel Studio for the .NET Framework documentation

TDocumentCustomProperty.PropTypeStr Property

Used for unknown prop types, it handles the string with the name. You shouldn't need to use this.

Syntax

Namespace: FlexCel.Core

public String PropTypeStr { get; }

See also

  • TDocumentCustomProperty


TDocumentCustomProperty.Empty Property | FlexCel Studio for the .NET Framework documentation

TDocumentCustomProperty.Empty Property

Returns an empty property

Syntax

Namespace: FlexCel.Core

public static TDocumentCustomProperty Empty { get; }

See also

  • TDocumentCustomProperty


TDrawingColor Structure | FlexCel Studio for the .NET Framework documentation

TDrawingColor Structure

Represents a Color for a drawing or a theme. Different from TExcelColor, this structure is defined in terms of DrawingML, not SpreadsheetML.

Syntax

Namespace: FlexCel.Core

public struct TDrawingColor

Methods

Name | Description
GetColorTransform | Returns an array with all the color transforms in this object.
CompareTo | Overloaded CompareTo(Object) CompareTo(TDrawingColor)
GetHashCode | Returns the hashcode of the object.
Equals | Returns true if both instances have the same color.
FromPreset | Returns a color class with a specified preset color.
FromSystem | Returns a color class with a specified system color.
FromColor | Overloaded FromColor(TUIColor) FromColor(TExcelColor, IFlexCelPalette)
FromRgb | Returns a color from its byte components.
FromScRgb | Returns a color class with a specified scRGB color.
FromTheme | Returns a color class with a specified themed color.
FromHSL | Returns a color class with a specified HSL color.
AddTransform | Returns the DrawingColor that results of applying the transform to the existing DrawingColor.
ToExcelColor | Returns a color class with a specified color.
ToColor | Returns the .NET Color specified by this structure.
GetSystemColor | Returns the color associated with a simple color.
IndexedSolidPalette | Returns the indexed colors from 0 to 7. Mostly for internal use.
GetComponents | Returns R, G and B components of the color. If this is a theme or indexed color, it will be converted to RGB before getting the components.

Operators

Name | Description
Equality | Returns true if both colors are equal.
Inequality | Returns true if both colors do not have the same value.
GreaterThan | Returns true if o1 is bigger than o2.
LessThan | Returns true if o1 is less than o2.
Implicit Conversion | Assigns a .NET color to this instance.

Properties

Name | Description
ColorType | Identifies which kind of color is the one to apply in this structure.
HSL | Returns the color when this structure has an HSL color, as a 0xHHSSLL integer. If you try to read the value of this property and ColorType is not the right kind, an Exception will be raised.
RGB | Returns the color when this structure has an RGB color, as a 0xRRGGBB integer. If you try to read the value of this property and ColorType is not the right kind, an Exception will be raised.
ScRGB | Returns the color when this structure has an scRGB color. If you try to read the value of this property and ColorType is not the right kind, an Exception will be raised.
Preset | Returns the color when this structure has a Preset color. If you try to read the value of this property and ColorType is not the right kind, an Exception will be raised.
System | Returns the color when this structure has a System color. If you try to read the value of this property and ColorType is not the right kind, an Exception will be raised.
Theme | Returns the color when this structure has a Themed color. If you try to read the value of this property and ColorType is not the right kind, an Exception will be raised.
Transparent | Returns the transparent color.


TDrawingColor.GetColorTransform Method | FlexCel Studio for the .NET Framework documentation

TDrawingColor.GetColorTransform Method

Returns an array with all the color transforms in this object.

Syntax

Namespace: FlexCel.Core

public TColorTransform[] GetColorTransform()

See also

  • TDrawingColor


TDrawingColor.CompareTo Method | FlexCel Studio for the .NET Framework documentation

TDrawingColor.CompareTo Method

Overloads

  • TDrawingColor.CompareTo(Object)
  • TDrawingColor.CompareTo(TDrawingColor)

TDrawingColor.CompareTo(Object)

Returns -1 if obj sorts after color, 0 if both colors are the same, and 1 if obj sorts before color.

Syntax

Namespace: FlexCel.Core

public Int32 CompareTo(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TDrawingColor

TDrawingColor.CompareTo(TDrawingColor)

Returns -1 if Color2 sorts after color, 0 if both colors are the same, and 1 if Color2 sorts before color.

Syntax

Namespace: FlexCel.Core

public Int32 CompareTo(TDrawingColor Color2)

Parameters

<-> | Parameter | Type | Description
 | Color2 | TDrawingColor |

See also

  • TDrawingColor


TDrawingColor.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TDrawingColor.GetHashCode Method

Returns the hashcode of the object.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TDrawingColor


TDrawingColor.Equals Method | FlexCel Studio for the .NET Framework documentation

TDrawingColor.Equals Method

Returns true if both instances have the same color.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object | Object to compare.

Returns

True if both colors are the same.

See also

  • TDrawingColor


TDrawingColor.FromPreset Method | FlexCel Studio for the .NET Framework documentation

TDrawingColor.FromPreset Method

Returns a color class with a specified preset color.

Syntax

Namespace: FlexCel.Core

public static TDrawingColor FromPreset(TPresetColor aColor, params TColorTransform[] aTransforms)

Parameters

<-> | Parameter | Type | Description
 | aColor | TPresetColor | Color that we want to set.
params | aTransforms | TColorTransform[] | Transformations you want to apply.

Returns

The corresponding preset color.

See also

  • TDrawingColor


TDrawingColor.FromSystem Method | FlexCel Studio for the .NET Framework documentation

TDrawingColor.FromSystem Method

Returns a color class with a specified system color.

Syntax

Namespace: FlexCel.Core

public static TDrawingColor FromSystem(TSystemColor aColor, params TColorTransform[] aTransforms)

Parameters

<-> | Parameter | Type | Description
 | aColor | TSystemColor | Color that we want to set.
params | aTransforms | TColorTransform[] | Transformations you want to apply.

Returns

The corresponding system color.

See also

  • TDrawingColor


TDrawingColor.FromColor Method | FlexCel Studio for the .NET Framework documentation

TDrawingColor.FromColor Method

Overloads

  • TDrawingColor.FromColor(TUIColor)
  • TDrawingColor.FromColor(TExcelColor, IFlexCelPalette)

TDrawingColor.FromColor(TUIColor)

Returns a color class with a specified color. There is no real need to call this method, since conversion between TDrawingColor and TUIColor is implicit. You can just assign Color to this class and viceversa.

Syntax

Namespace: FlexCel.Core

public static TDrawingColor FromColor(TUIColor aColor)

Parameters

<-> | Parameter | Type | Description
 | aColor | TUIColor | Color that we want to set.

Returns

The corresponding system color.

See also

  • TDrawingColor

TDrawingColor.FromColor(TExcelColor, IFlexCelPalette)

Returns a color class with a specified color.

Syntax

Namespace: FlexCel.Core

public static TDrawingColor FromColor(TExcelColor aColor, IFlexCelPalette xls)

Parameters

<-> | Parameter | Type | Description
 | aColor | TExcelColor | Color that we want to set.
 | xls | IFlexCelPalette | Workbook with the color information.

Returns

The corresponding system color.

See also

  • TDrawingColor


TDrawingColor.FromRgb Method | FlexCel Studio for the .NET Framework documentation

TDrawingColor.FromRgb Method

Returns a color from its byte components.

Syntax

Namespace: FlexCel.Core

public static TDrawingColor FromRgb(Byte r, Byte g, Byte b, params TColorTransform[] aTransforms)

Parameters

<-> | Parameter | Type | Description
 | r | Byte | Red component.
 | g | Byte | Green component.
 | b | Byte | Blue component.
params | aTransforms | TColorTransform[] | Transformations you want to apply.

See also

  • TDrawingColor


TDrawingColor.FromScRgb Method | FlexCel Studio for the .NET Framework documentation

TDrawingColor.FromScRgb Method

Returns a color class with a specified scRGB color.

Syntax

Namespace: FlexCel.Core

public static TDrawingColor FromScRgb(TScRGBColor aColor, params TColorTransform[] aTransforms)

Parameters

<-> | Parameter | Type | Description
 | aColor | TScRGBColor | Color that we want to set.
params | aTransforms | TColorTransform[] | Transformations you want to apply.

Returns

The corresponding system color.

See also

  • TDrawingColor


TDrawingColor.FromTheme Method | FlexCel Studio for the .NET Framework documentation

TDrawingColor.FromTheme Method

Returns a color class with a specified themed color.

Syntax

Namespace: FlexCel.Core

public static TDrawingColor FromTheme(TThemeColor aColor, params TColorTransform[] aTransforms)

Parameters

<-> | Parameter | Type | Description
 | aColor | TThemeColor | Color that we want to set.
params | aTransforms | TColorTransform[] | Transformations you want to apply.

Returns

The corresponding system color.

See also

  • TDrawingColor


TDrawingColor.FromHSL Method | FlexCel Studio for the .NET Framework documentation

TDrawingColor.FromHSL Method

Returns a color class with a specified HSL color.

Syntax

Namespace: FlexCel.Core

public static TDrawingColor FromHSL(THSLColor aColor, params TColorTransform[] aTransforms)

Parameters

<-> | Parameter | Type | Description
 | aColor | THSLColor | Color that we want to set.
params | aTransforms | TColorTransform[] | Transformations you want to apply.

Returns

The corresponding system color.

See also

  • TDrawingColor


TDrawingColor.AddTransform Method | FlexCel Studio for the .NET Framework documentation

TDrawingColor.AddTransform Method

Returns the DrawingColor that results of applying the transform to the existing DrawingColor.

Syntax

Namespace: FlexCel.Core

public static TDrawingColor AddTransform(TDrawingColor oldColor, TColorTransform[] aTransform)

Parameters

<-> | Parameter | Type | Description
 | oldColor | TDrawingColor | Original color where we will apply the transform.
 | aTransform | TColorTransform[] | Transform to be applied to oldColor.

See also

  • TDrawingColor


TDrawingColor.ToExcelColor Method | FlexCel Studio for the .NET Framework documentation

TDrawingColor.ToExcelColor Method

Returns a color class with a specified color.

Syntax

Namespace: FlexCel.Core

public TExcelColor ToExcelColor(IFlexCelPalette xls)

Parameters

<-> | Parameter | Type | Description
 | xls | IFlexCelPalette | Workbook with the color information.

Returns

The corresponding excel color.

See also

  • TDrawingColor


TDrawingColor.ToColor Method | FlexCel Studio for the .NET Framework documentation

TDrawingColor.ToColor Method

Returns the .NET Color specified by this structure.

Syntax

Namespace: FlexCel.Core

public TUIColor ToColor(IFlexCelPalette xls)

Parameters

<-> | Parameter | Type | Description
 | xls | IFlexCelPalette | Excel file containing the themes and palettes for the color indexes.

Returns

The corresponding .NET color.

See also

  • TDrawingColor


TDrawingColor.GetSystemColor Method | FlexCel Studio for the .NET Framework documentation

TDrawingColor.GetSystemColor Method

Returns the color associated with a simple color.

Syntax

Namespace: FlexCel.Core

public static TUIColor GetSystemColor(TSystemColor aSystem)

Parameters

<-> | Parameter | Type | Description
 | aSystem | TSystemColor |

See also

  • TDrawingColor


TDrawingColor.IndexedSolidPalette Method | FlexCel Studio for the .NET Framework documentation

TDrawingColor.IndexedSolidPalette Method

Returns the indexed colors from 0 to 7. Mostly for internal use.

Syntax

Namespace: FlexCel.Core

public static TDrawingColor IndexedSolidPalette(Int32 v)

Parameters

<-> | Parameter | Type | Description
 | v | Int32 |

See also

  • TDrawingColor


TDrawingColor.GetComponents Method | FlexCel Studio for the .NET Framework documentation

TDrawingColor.GetComponents Method

Returns R, G and B components of the color. If this is a theme or indexed color, it will be converted to RGB before getting the components.

Syntax

Namespace: FlexCel.Core

public void GetComponents(ExcelFile xls, out Byte R, out Byte G, out Byte B)

Parameters

<-> | Parameter | Type | Description
 | xls | ExcelFile | ExcelFile that will be used to know the palette and themes of the file for indexed/themed colors.
out | R | Byte | Returns the red component of the color.
out | G | Byte | Returns the green component of the color.
out | B | Byte | Returns the blue component of the color.

See also

  • TDrawingColor


TDrawingColor.Equality Operator | FlexCel Studio for the .NET Framework documentation

TDrawingColor.Equality Operator

Returns true if both colors are equal.

Syntax

Namespace: FlexCel.Core

public static Boolean op_Equality(TDrawingColor o1, TDrawingColor o2)

Parameters

<-> | Parameter | Type | Description
 | o1 | TDrawingColor | First color to compare.
 | o2 | TDrawingColor | Second color to compare.

See also

  • TDrawingColor


TDrawingColor.Inequality Operator | FlexCel Studio for the .NET Framework documentation

TDrawingColor.Inequality Operator

Returns true if both colors do not have the same value.

Syntax

Namespace: FlexCel.Core

public static Boolean op_Inequality(TDrawingColor o1, TDrawingColor o2)

Parameters

<-> | Parameter | Type | Description
 | o1 | TDrawingColor | First color to compare.
 | o2 | TDrawingColor | Second color to compare.

See also

  • TDrawingColor


TDrawingColor.GreaterThan Operator | FlexCel Studio for the .NET Framework documentation

TDrawingColor.GreaterThan Operator

Returns true if o1 is bigger than o2.

Syntax

Namespace: FlexCel.Core

public static Boolean op_GreaterThan(TDrawingColor o1, TDrawingColor o2)

Parameters

<-> | Parameter | Type | Description
 | o1 | TDrawingColor |
 | o2 | TDrawingColor |

See also

  • TDrawingColor


TDrawingColor.LessThan Operator | FlexCel Studio for the .NET Framework documentation

TDrawingColor.LessThan Operator

Returns true if o1 is less than o2.

Syntax

Namespace: FlexCel.Core

public static Boolean op_LessThan(TDrawingColor o1, TDrawingColor o2)

Parameters

<-> | Parameter | Type | Description
 | o1 | TDrawingColor |
 | o2 | TDrawingColor |

See also

  • TDrawingColor


TDrawingColor Implicit Conversion Operator | FlexCel Studio for the .NET Framework documentation

TDrawingColor Implicit Conversion Operator

Assigns a .NET color to this instance.

Syntax

Namespace: FlexCel.Core

public static TDrawingColor op_Implicit(TUIColor aColor)

Parameters

<-> | Parameter | Type | Description
 | aColor | TUIColor |

See also

  • TDrawingColor


TDrawingColor.ColorType Property | FlexCel Studio for the .NET Framework documentation

TDrawingColor.ColorType Property

Identifies which kind of color is the one to apply in this structure.

Syntax

Namespace: FlexCel.Core

public TDrawingColorType ColorType { get; }

See also

  • TDrawingColor


TDrawingColor.HSL Property | FlexCel Studio for the .NET Framework documentation

TDrawingColor.HSL Property

Returns the color when this structure has an HSL color, as a 0xHHSSLL integer.

If you try to read the value of this property and ColorType is not the right kind, an Exception will be raised.

Syntax

Namespace: FlexCel.Core

public THSLColor HSL { get; }

See also

  • TDrawingColor


TDrawingColor.RGB Property | FlexCel Studio for the .NET Framework documentation

TDrawingColor.RGB Property

Returns the color when this structure has an RGB color, as a 0xRRGGBB integer.

If you try to read the value of this property and ColorType is not the right kind, an Exception will be raised.

Syntax

Namespace: FlexCel.Core

public Int64 RGB { get; }

See also

  • TDrawingColor


TDrawingColor.ScRGB Property | FlexCel Studio for the .NET Framework documentation

TDrawingColor.ScRGB Property

Returns the color when this structure has an scRGB color.

If you try to read the value of this property and ColorType is not the right kind, an Exception will be raised.

Syntax

Namespace: FlexCel.Core

public TScRGBColor ScRGB { get; }

See also

  • TDrawingColor


TDrawingColor.Preset Property | FlexCel Studio for the .NET Framework documentation

TDrawingColor.Preset Property

Returns the color when this structure has a Preset color.

If you try to read the value of this property and ColorType is not the right kind, an Exception will be raised.

Syntax

Namespace: FlexCel.Core

public TPresetColor Preset { get; }

See also

  • TDrawingColor


TDrawingColor.System Property | FlexCel Studio for the .NET Framework documentation

TDrawingColor.System Property

Returns the color when this structure has a System color.

If you try to read the value of this property and ColorType is not the right kind, an Exception will be raised.

Syntax

Namespace: FlexCel.Core

public TSystemColor System { get; }

See also

  • TDrawingColor


TDrawingColor.Theme Property | FlexCel Studio for the .NET Framework documentation

TDrawingColor.Theme Property

Returns the color when this structure has a Themed color.

If you try to read the value of this property and ColorType is not the right kind, an Exception will be raised.

Syntax

Namespace: FlexCel.Core

public TThemeColor Theme { get; }

See also

  • TDrawingColor


TDrawingColor.Transparent Property | FlexCel Studio for the .NET Framework documentation

TDrawingColor.Transparent Property

Returns the transparent color.

Syntax

Namespace: FlexCel.Core

public static TDrawingColor Transparent { get; }

See also

  • TDrawingColor


TDrawingConditionalFormatDataBar Structure | FlexCel Studio for the .NET Framework documentation

TDrawingConditionalFormatDataBar Structure

Defines the characteristics of a conditional format data bar which is going to be rendered on the screen or to a file. It is used for exporting xls/x files to drawings or pdf.

Syntax

Namespace: FlexCel.Core

public struct TDrawingConditionalFormatDataBar

Constructors

Name | Description
TDrawingConditional​Format​DataBar | Creates a new struct and initialized the data.

Properties

Name | Description
HasDataBar | If false, the cell doesn't have a databar defined.
HideValues | If true, the contents of the cell won't be displayed.
Rectangle | Rectangle for the databar, relative to the cell rectangle. 0 means the Left or Top coordinates of the cell, and 1 the Right or Bottom coordinates of the cell.
FillColor | Color that will be used to fill the databar.
BorderColor | Border color for the databar. TUIColor.Empty means no border.
AxisColor | Color for the axis where the databar crosses 0. If this is TUIColor.Empty, no axis should be drawn.
IsGradient | If true, the fill will be a gradient starting in FillColor and ending in white.
IsRightToLeft | If true, the bar goes from Right to left. If this property is true and there is a fill gradient in the bar, then the white side of the gradient must be at the left.


TDrawingConditionalFormatDataBar.TDrawingConditionalFormatDataBar Constructor | FlexCel Studio for the .NET Framework documentation

TDrawingConditionalFormatDataBar.TDrawingConditionalFormatDataBar Constructor

Creates a new struct and initialized the data.

Syntax

Namespace: FlexCel.Core

public TDrawingConditionalFormatDataBar(Boolean aHasDataBar, Boolean aHideValues, TUIRectangle aRectangle, TUIColor aFillColor, TUIColor aBorderColor, TUIColor aAxisColor, Boolean aIsGradient, Boolean aIsRightToLeft)

Parameters

<-> | Parameter | Type | Description
 | aHasDataBar | Boolean | If true, the format has a databar.
 | aHideValues | Boolean | If true, the cell text won't be displayed.
 | aRectangle | TUIRectangle | Rectangle of the databar in coordinates relative to the cell. 0 means Left and Top, 1 right and bottom.
 | aFillColor | TUIColor | Color for the fill of the databar.
 | aBorderColor | TUIColor | Color for the border of the DataBar. TUIColor.Empty means no border.
 | aAxisColor | TUIColor | Color for the axis where the databar crosses 0. If this is TUIColor.Empty, no axis should be drawn. If not empty the position depends in the value of IsRightToLeft parameter.
 | aIsGradient | Boolean | If true, this databar has a gradient fill.
 | aIsRightToLeft | Boolean | If true, the databar goes right to left and the gradient must go right to left too.

See also

  • TDrawingConditionalFormatDataBar


TDrawingConditionalFormatDataBar.HasDataBar Property | FlexCel Studio for the .NET Framework documentation

TDrawingConditionalFormatDataBar.HasDataBar Property

If false, the cell doesn't have a databar defined.

Syntax

Namespace: FlexCel.Core

public Boolean HasDataBar { get; }

See also

  • TDrawingConditionalFormatDataBar


TDrawingConditionalFormatDataBar.HideValues Property | FlexCel Studio for the .NET Framework documentation

TDrawingConditionalFormatDataBar.HideValues Property

If true, the contents of the cell won't be displayed.

Syntax

Namespace: FlexCel.Core

public Boolean HideValues { get; }

See also

  • TDrawingConditionalFormatDataBar


TDrawingConditionalFormatDataBar.Rectangle Property | FlexCel Studio for the .NET Framework documentation

TDrawingConditionalFormatDataBar.Rectangle Property

Rectangle for the databar, relative to the cell rectangle. 0 means the Left or Top coordinates of the cell, and 1 the Right or Bottom coordinates of the cell.

Syntax

Namespace: FlexCel.Core

public TUIRectangle Rectangle { get; }

See also

  • TDrawingConditionalFormatDataBar


TDrawingConditionalFormatDataBar.FillColor Property | FlexCel Studio for the .NET Framework documentation

TDrawingConditionalFormatDataBar.FillColor Property

Color that will be used to fill the databar.

Syntax

Namespace: FlexCel.Core

public TUIColor FillColor { get; }

See also

  • TDrawingConditionalFormatDataBar


TDrawingConditionalFormatDataBar.BorderColor Property | FlexCel Studio for the .NET Framework documentation

TDrawingConditionalFormatDataBar.BorderColor Property

Border color for the databar. TUIColor.Empty means no border.

Syntax

Namespace: FlexCel.Core

public TUIColor BorderColor { get; }

See also

  • TDrawingConditionalFormatDataBar


TDrawingConditionalFormatDataBar.AxisColor Property | FlexCel Studio for the .NET Framework documentation

TDrawingConditionalFormatDataBar.AxisColor Property

Color for the axis where the databar crosses 0. If this is TUIColor.Empty, no axis should be drawn.

Syntax

Namespace: FlexCel.Core

public TUIColor AxisColor { get; }

See also

  • TDrawingConditionalFormatDataBar


TDrawingConditionalFormatDataBar.IsGradient Property | FlexCel Studio for the .NET Framework documentation

TDrawingConditionalFormatDataBar.IsGradient Property

If true, the fill will be a gradient starting in FillColor and ending in white.

Syntax

Namespace: FlexCel.Core

public Boolean IsGradient { get; }

See also

  • TDrawingConditionalFormatDataBar


TDrawingConditionalFormatDataBar.IsRightToLeft Property | FlexCel Studio for the .NET Framework documentation

TDrawingConditionalFormatDataBar.IsRightToLeft Property

If true, the bar goes from Right to left. If this property is true and there is a fill gradient in the bar, then the white side of the gradient must be at the left.

Syntax

Namespace: FlexCel.Core

public Boolean IsRightToLeft { get; }

See also

  • TDrawingConditionalFormatDataBar


TDrawingConditionalFormatIconSet Structure | FlexCel Studio for the .NET Framework documentation

TDrawingConditionalFormatIconSet Structure

Defines the characteristics of a conditional format icon which is going to be rendered on the screen or to a file. It is used for exporting xls/x files to drawings or pdf.

Syntax

Namespace: FlexCel.Core

public struct TDrawingConditionalFormatIconSet

Constructors

Name | Description
TDrawingConditional​Format​IconSet | Creates a new struct and initializes the data.

Properties

Name | Description
HasIcon | If false, the cell doesn't have an icon. Note that a cell that doesn't have an icon is different from a cell with a TCondFmtIcon​Set.​None: The second case can be a custom icon set of noicon, and when rendering the cell we need to add an indentation to make room for the empty icon. If HasIcon is false, no indentation in the text is needed.
HideValues | If true, the contents of the cell won't be displayed.
Icon | Icon that must be rendered. It only makes sense if HasIcon is true.


TDrawingConditionalFormatIconSet.TDrawingConditionalFormatIconSet Constructor | FlexCel Studio for the .NET Framework documentation

TDrawingConditionalFormatIconSet.TDrawingConditionalFormatIconSet Constructor

Creates a new struct and initializes the data.

Syntax

Namespace: FlexCel.Core

public TDrawingConditionalFormatIconSet(Boolean aHasIcon, TConditionalFormatCustomIconDef aIcon, Boolean aHideValues)

Parameters

<-> | Parameter | Type | Description
 | aHasIcon | Boolean | If false, this cell doesn't have an icon and the Icon property will be ignored and set to TCondFmtIconSet.None.
 | aIcon | TConditional​Format​Custom​IconDef | Icon that needs to be rendered in the cell. It will be ignored if aHasIcon is false.
 | aHideValues | Boolean | If true, the text in the cell won't be shown.

See also

  • TDrawingConditionalFormatIconSet


TDrawingConditionalFormatIconSet.HasIcon Property | FlexCel Studio for the .NET Framework documentation

TDrawingConditionalFormatIconSet.HasIcon Property

If false, the cell doesn't have an icon. Note that a cell that doesn't have an icon is different from a cell with a TCondFmtIconSet.None: The second case can be a custom icon set of noicon, and when rendering the cell we need to add an indentation to make room for the empty icon. If HasIcon is false, no indentation in the text is needed.

Syntax

Namespace: FlexCel.Core

public Boolean HasIcon { get; }

See also

  • TDrawingConditionalFormatIconSet


TDrawingConditionalFormatIconSet.HideValues Property | FlexCel Studio for the .NET Framework documentation

TDrawingConditionalFormatIconSet.HideValues Property

If true, the contents of the cell won't be displayed.

Syntax

Namespace: FlexCel.Core

public Boolean HideValues { get; }

See also

  • TDrawingConditionalFormatIconSet


TDrawingConditionalFormatIconSet.Icon Property | FlexCel Studio for the .NET Framework documentation

TDrawingConditionalFormatIconSet.Icon Property

Icon that must be rendered. It only makes sense if HasIcon is true.

Syntax

Namespace: FlexCel.Core

public TConditionalFormatCustomIconDef Icon { get; }

See also

  • TDrawingConditionalFormatIconSet


TDrawingCoordinate Structure | FlexCel Studio for the .NET Framework documentation

TDrawingCoordinate Structure

A coordinate in a drawing.

Syntax

Namespace: FlexCel.Core

public struct TDrawingCoordinate

Fields

Name | Description
CmToEmu | Returns how many EMUs in 1 cm.
InchesToEmu | Returns how many EMUs in 1 inch.
PointsToEmu | Returns how many EMUs in 1 point.
PcToEmu | Returns how many EMUs in 1 pc.
PiToEmu | Returns how many EMUs in 1 pi.

Constructors

Name | Description
TDrawingCoordinate | Creates a coordinate in Emus. To use other units, use the "From..." methods of this struct.

Methods

Name | Description
FromCm | Creates a drawing coordinate from a measunement in centimeters.
FromMm | Creates a drawing coordinate from a measunement in milimeters.
FromInches | Creates a drawing coordinate from a measurement in inches.
FromPoints | Creates a drawing coordinate from a measunement in points. (1/72 of an inch)
Equals | Returns true if this instance has the same data as the object obj.
GetHashCode | Returns the hashcode for this object
ToString | Returns a string representing the measurement in cm.
CompareTo |

Properties

Name | Description
Emu | Value of the coordinate in EMUs (English Metric Units)
Cm | Value of the coordinate in cm
Inches | Value of the coordinate in inches
Points | Value of the coordinate in points
Pixels | Value of the coordinate in pixels


TDrawingCoordinate.CmToEmu Field | FlexCel Studio for the .NET Framework documentation

TDrawingCoordinate.CmToEmu Field

Returns how many EMUs in 1 cm.

Syntax

Namespace: FlexCel.Core

public const Double CmToEmu = 360000

See also

  • TDrawingCoordinate


TDrawingCoordinate.InchesToEmu Field | FlexCel Studio for the .NET Framework documentation

TDrawingCoordinate.InchesToEmu Field

Returns how many EMUs in 1 inch.

Syntax

Namespace: FlexCel.Core

public const Double InchesToEmu = 914400

See also

  • TDrawingCoordinate


TDrawingCoordinate.PointsToEmu Field | FlexCel Studio for the .NET Framework documentation

TDrawingCoordinate.PointsToEmu Field

Returns how many EMUs in 1 point.

Syntax

Namespace: FlexCel.Core

public const Double PointsToEmu = 12700

See also

  • TDrawingCoordinate


TDrawingCoordinate.PcToEmu Field | FlexCel Studio for the .NET Framework documentation

TDrawingCoordinate.PcToEmu Field

Returns how many EMUs in 1 pc.

Syntax

Namespace: FlexCel.Core

public const Double PcToEmu = 152400

See also

  • TDrawingCoordinate


TDrawingCoordinate.PiToEmu Field | FlexCel Studio for the .NET Framework documentation

TDrawingCoordinate.PiToEmu Field

Returns how many EMUs in 1 pi.

Syntax

Namespace: FlexCel.Core

public const Double PiToEmu = 152400

See also

  • TDrawingCoordinate


TDrawingCoordinate.TDrawingCoordinate Constructor | FlexCel Studio for the .NET Framework documentation

TDrawingCoordinate.TDrawingCoordinate Constructor

Creates a coordinate in Emus. To use other units, use the "From..." methods of this struct.

Syntax

Namespace: FlexCel.Core

public TDrawingCoordinate(Int64 aEmu)

Parameters

<-> | Parameter | Type | Description
 | aEmu | Int64 | Value of the coordinate.

See also

  • TDrawingCoordinate


TDrawingCoordinate.FromCm Method | FlexCel Studio for the .NET Framework documentation

TDrawingCoordinate.FromCm Method

Creates a drawing coordinate from a measunement in centimeters.

Syntax

Namespace: FlexCel.Core

public static TDrawingCoordinate FromCm(Double p)

Parameters

<-> | Parameter | Type | Description
 | p | Double | Value in cm.

Returns

The corresponding DrawingCoordinate.

See also

  • TDrawingCoordinate


TDrawingCoordinate.FromMm Method | FlexCel Studio for the .NET Framework documentation

TDrawingCoordinate.FromMm Method

Creates a drawing coordinate from a measunement in milimeters.

Syntax

Namespace: FlexCel.Core

public static TDrawingCoordinate FromMm(Double p)

Parameters

<-> | Parameter | Type | Description
 | p | Double | Value in mm.

Returns

The corresponding DrawingCoordinate.

See also

  • TDrawingCoordinate


TDrawingCoordinate.FromInches Method | FlexCel Studio for the .NET Framework documentation

TDrawingCoordinate.FromInches Method

Creates a drawing coordinate from a measurement in inches.

Syntax

Namespace: FlexCel.Core

public static TDrawingCoordinate FromInches(Double p)

Parameters

<-> | Parameter | Type | Description
 | p | Double | Value in inches.

Returns

The corresponding DrawingCoordinate.

See also

  • TDrawingCoordinate


TDrawingCoordinate.FromPoints Method | FlexCel Studio for the .NET Framework documentation

TDrawingCoordinate.FromPoints Method

Creates a drawing coordinate from a measunement in points. (1/72 of an inch)

Syntax

Namespace: FlexCel.Core

public static TDrawingCoordinate FromPoints(Double p)

Parameters

<-> | Parameter | Type | Description
 | p | Double | Value in points (1/72 of an inch).

Returns

The corresponding DrawingCoordinate.

See also

  • TDrawingCoordinate


TDrawingCoordinate.Equals Method | FlexCel Studio for the .NET Framework documentation

TDrawingCoordinate.Equals Method

Returns true if this instance has the same data as the object obj.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TDrawingCoordinate


TDrawingCoordinate.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TDrawingCoordinate.GetHashCode Method

Returns the hashcode for this object

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TDrawingCoordinate


TDrawingCoordinate.ToString Method | FlexCel Studio for the .NET Framework documentation

TDrawingCoordinate.ToString Method

Returns a string representing the measurement in cm.

Syntax

Namespace: FlexCel.Core

public override String ToString()

See also

  • TDrawingCoordinate


TDrawingCoordinate.CompareTo Method | FlexCel Studio for the .NET Framework documentation

TDrawingCoordinate.CompareTo Method

Syntax

Namespace: FlexCel.Core

public Int32 CompareTo(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TDrawingCoordinate


TDrawingCoordinate.Emu Property | FlexCel Studio for the .NET Framework documentation

TDrawingCoordinate.Emu Property

Value of the coordinate in EMUs (English Metric Units)

Syntax

Namespace: FlexCel.Core

public Int64 Emu { get; }

See also

  • TDrawingCoordinate


TDrawingCoordinate.Cm Property | FlexCel Studio for the .NET Framework documentation

TDrawingCoordinate.Cm Property

Value of the coordinate in cm

Syntax

Namespace: FlexCel.Core

public Double Cm { get; }

See also

  • TDrawingCoordinate


TDrawingCoordinate.Inches Property | FlexCel Studio for the .NET Framework documentation

TDrawingCoordinate.Inches Property

Value of the coordinate in inches

Syntax

Namespace: FlexCel.Core

public Double Inches { get; }

See also

  • TDrawingCoordinate


TDrawingCoordinate.Points Property | FlexCel Studio for the .NET Framework documentation

TDrawingCoordinate.Points Property

Value of the coordinate in points

Syntax

Namespace: FlexCel.Core

public Double Points { get; }

See also

  • TDrawingCoordinate


TDrawingCoordinate.Pixels Property | FlexCel Studio for the .NET Framework documentation

TDrawingCoordinate.Pixels Property

Value of the coordinate in pixels

Syntax

Namespace: FlexCel.Core

public Double Pixels { get; }

See also

  • TDrawingCoordinate


TDrawingGradientStop Structure | FlexCel Studio for the .NET Framework documentation

TDrawingGradientStop Structure

Represents one of the points in a Gradient definition for a drawing (autoshapes, charts, etc). Note that Excel cells use a different Gradient definition: TGradientStop

Syntax

Namespace: FlexCel.Core

public struct TDrawingGradientStop

Constructors

Name | Description
TDrawingGradientStop | Creates a new Gradient stop.

Methods

Name | Description
CompareTo | Overloaded CompareTo(Object) CompareTo(TDrawingGradientStop)
Equals | Returns if this struct has the same values as other one.
GetHashCode | Returns the hashcode for this struct.

Operators

Name | Description
Equality | Returns true if both gradient stops are equal.
Inequality | Returns true if both gradient stops are different.
GreaterThan | Returns true if o1 is bigger than o2.
LessThan | Returns true if o1 is less than o2.

Properties

Name | Description
Position | This value must be between 0 and 1, and represents the position in the gradient where the Color in this structure is pure.
Color | Color for this definition.


TDrawingGradientStop.TDrawingGradientStop Constructor | FlexCel Studio for the .NET Framework documentation

TDrawingGradientStop.TDrawingGradientStop Constructor

Creates a new Gradient stop.

Syntax

Namespace: FlexCel.Core

public TDrawingGradientStop(Double aPosition, TDrawingColor aColor)

Parameters

<-> | Parameter | Type | Description
 | aPosition | Double | Position for the stop.
 | aColor | TDrawingColor | Color for the stop.

See also

  • TDrawingGradientStop


TDrawingGradientStop.CompareTo Method | FlexCel Studio for the .NET Framework documentation

TDrawingGradientStop.CompareTo Method

Overloads

  • TDrawingGradientStop.CompareTo(Object)
  • TDrawingGradientStop.CompareTo(TDrawingGradientStop)

TDrawingGradientStop.CompareTo(Object)

Compares 2 instances of this struct.

Syntax

Namespace: FlexCel.Core

public Int32 CompareTo(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TDrawingGradientStop

TDrawingGradientStop.CompareTo(TDrawingGradientStop)

Compares 2 instances of this struct.

Syntax

Namespace: FlexCel.Core

public Int32 CompareTo(TDrawingGradientStop o2)

Parameters

<-> | Parameter | Type | Description
 | o2 | TDrawingGradientStop |

See also

  • TDrawingGradientStop


TDrawingGradientStop.Equals Method | FlexCel Studio for the .NET Framework documentation

TDrawingGradientStop.Equals Method

Returns if this struct has the same values as other one.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TDrawingGradientStop


TDrawingGradientStop.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TDrawingGradientStop.GetHashCode Method

Returns the hashcode for this struct.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TDrawingGradientStop


TDrawingGradientStop.Equality Operator | FlexCel Studio for the .NET Framework documentation

TDrawingGradientStop.Equality Operator

Returns true if both gradient stops are equal.

Syntax

Namespace: FlexCel.Core

public static Boolean op_Equality(TDrawingGradientStop o1, TDrawingGradientStop o2)

Parameters

<-> | Parameter | Type | Description
 | o1 | TDrawingGradientStop | First stop to compare.
 | o2 | TDrawingGradientStop | Second stop to compare.

See also

  • TDrawingGradientStop


TDrawingGradientStop.Inequality Operator | FlexCel Studio for the .NET Framework documentation

TDrawingGradientStop.Inequality Operator

Returns true if both gradient stops are different.

Syntax

Namespace: FlexCel.Core

public static Boolean op_Inequality(TDrawingGradientStop o1, TDrawingGradientStop o2)

Parameters

<-> | Parameter | Type | Description
 | o1 | TDrawingGradientStop | First stop to compare.
 | o2 | TDrawingGradientStop | Second stop to compare.

See also

  • TDrawingGradientStop


TDrawingGradientStop.GreaterThan Operator | FlexCel Studio for the .NET Framework documentation

TDrawingGradientStop.GreaterThan Operator

Returns true if o1 is bigger than o2.

Syntax

Namespace: FlexCel.Core

public static Boolean op_GreaterThan(TDrawingGradientStop o1, TDrawingGradientStop o2)

Parameters

<-> | Parameter | Type | Description
 | o1 | TDrawingGradientStop |
 | o2 | TDrawingGradientStop |

See also

  • TDrawingGradientStop


TDrawingGradientStop.LessThan Operator | FlexCel Studio for the .NET Framework documentation

TDrawingGradientStop.LessThan Operator

Returns true if o1 is less than o2.

Syntax

Namespace: FlexCel.Core

public static Boolean op_LessThan(TDrawingGradientStop o1, TDrawingGradientStop o2)

Parameters

<-> | Parameter | Type | Description
 | o1 | TDrawingGradientStop |
 | o2 | TDrawingGradientStop |

See also

  • TDrawingGradientStop


TDrawingGradientStop.Position Property | FlexCel Studio for the .NET Framework documentation

TDrawingGradientStop.Position Property

This value must be between 0 and 1, and represents the position in the gradient where the Color in this structure is pure.

Syntax

Namespace: FlexCel.Core

public Double Position { get; set; }

See also

  • TDrawingGradientStop


TDrawingGradientStop.Color Property | FlexCel Studio for the .NET Framework documentation

TDrawingGradientStop.Color Property

Color for this definition.

Syntax

Namespace: FlexCel.Core

public TDrawingColor Color { get; set; }

See also

  • TDrawingGradientStop


TDrawingParagraphProperties Structure | FlexCel Studio for the .NET Framework documentation

TDrawingParagraphProperties Structure

Properties of a text paragraph inside a drawing.

Syntax

Namespace: FlexCel.Core

public struct TDrawingParagraphProperties

Constructors

Name | Description
TDrawingParagraph​Properties | Creates a new instance by setting all properties.

Methods

Name | Description
FromAlign | Returns an empty paragraph with a specific align.
CompareTo | Returns -1 if obj is bigger than this, 0 if both strings are the same, and 1 if obj is smaller than this.
GetHashCode | Returns the hashcode of the object.
Equals | Returns true if both instances have the same string and formatting.

Operators

Name | Description
Equality | Returns true if both objects are equal.
Inequality | Returns true if both objects do not have the same value.
LessThan | Returns true is an object is less than the other.
GreaterThan | Returns true is an object is bigger than the other.

Properties

Name | Description
Empty | Returns a paragraph with the default values.
MarL | Specifies the left margin of the paragraph.
MarR | Specifies the right margin of the paragraph.
Lvl | Specifies the particular level text properties that this paragraph follows.
Indent | Specifies the indent size that is applied to the first line of text in the paragraph. An indentation of 0 is considered to be at the same location as marL attribute.
Algn | Specifies the alignment that is to be applied to the paragraph.
DefTabSz | Specifies the default size for a tab character within this paragraph. This attribute should be used to describe the spacing of tabs within the paragraph instead of a leading indentation tab. For indentation tabs there are the marL and indent attributes to assist with this.
Rtl | Specifies whether the text is right-to-left or left-to-right in its flow direction. If null, the value is not known.
EaLnBrk | Specifies whether an East Asian word can be broken in half and wrapped onto the next line without a hyphen being added.
FontAlgn | Determines where vertically on a line of text the actual words are positioned. This deals with vertical placement of the characters with respect to the baselines.
LatinLnBrk | Specifies whether a Latin word can be broken in half and wrapped onto the next line without a hyphen being added.
HangingPunct | Specifies whether punctuation is to be forcefully laid out on a line of text or put on a different line of text.
DefaultTextRun​Properties | Default text properties for the text inside a paragraph.
HasDefaultText​RunProperties | Returns true if the paragraph has defined DefaultTextRun​Properties even if it is empty.
IsEmpty | Returns true if no members are set.


TDrawingParagraphProperties.TDrawingParagraphProperties Constructor | FlexCel Studio for the .NET Framework documentation

TDrawingParagraphProperties.TDrawingParagraphProperties Constructor

Creates a new instance by setting all properties.

Syntax

Namespace: FlexCel.Core

public TDrawingParagraphProperties(Int32 aFMarL, Int32 aFMarR, Int32 aFLvl, TDrawingCoordinate aFIndent, Nullable<TDrawingAlignment> aFAlgn, TDrawingCoordinate aFDefTabSz, Nullable<Boolean> aFRtl, Boolean aFEaLnBrk, TDrawingFontAlign aFFontAlgn, Boolean aFLatinLnBrk, Boolean aFHangingPunct, TDrawingTextProperties aFDefaultTextRunProperties, Boolean aHasDefaultTextRunProperties)

Parameters

<-> | Parameter | Type | Description
 | aFMarL | Int32 |
 | aFMarR | Int32 |
 | aFLvl | Int32 |
 | aFIndent | TDrawingCoordinate |
 | aFAlgn | Nullable<TDrawingAlignment> |
 | aFDefTabSz | TDrawingCoordinate |
 | aFRtl | Nullable<Boolean> |
 | aFEaLnBrk | Boolean |
 | aFFontAlgn | TDrawingFontAlign |
 | aFLatinLnBrk | Boolean |
 | aFHangingPunct | Boolean |
 | aFDefaultTextRunProperties | TDrawingText​Properties |
 | aHasDefaultTextRunProperties | Boolean |

See also

  • TDrawingParagraphProperties


TDrawingParagraphProperties.FromAlign Method | FlexCel Studio for the .NET Framework documentation

TDrawingParagraphProperties.FromAlign Method

Returns an empty paragraph with a specific align.

Syntax

Namespace: FlexCel.Core

public static TDrawingParagraphProperties FromAlign(TDrawingAlignment hAlign)

Parameters

<-> | Parameter | Type | Description
 | hAlign | TDrawingAlignment | Alignment for the paragraph.

See also

  • TDrawingParagraphProperties


TDrawingParagraphProperties.CompareTo Method | FlexCel Studio for the .NET Framework documentation

TDrawingParagraphProperties.CompareTo Method

Returns -1 if obj is bigger than this, 0 if both strings are the same, and 1 if obj is smaller than this.

Syntax

Namespace: FlexCel.Core

public Int32 CompareTo(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TDrawingParagraphProperties


TDrawingParagraphProperties.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TDrawingParagraphProperties.GetHashCode Method

Returns the hashcode of the object.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TDrawingParagraphProperties


TDrawingParagraphProperties.Equals Method | FlexCel Studio for the .NET Framework documentation

TDrawingParagraphProperties.Equals Method

Returns true if both instances have the same string and formatting.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object | Object to compare.

Returns

True if both strings are the same.

See also

  • TDrawingParagraphProperties


TDrawingParagraphProperties.Equality Operator | FlexCel Studio for the .NET Framework documentation

TDrawingParagraphProperties.Equality Operator

Returns true if both objects are equal.

Syntax

Namespace: FlexCel.Core

public static Boolean op_Equality(TDrawingParagraphProperties o1, TDrawingParagraphProperties o2)

Parameters

<-> | Parameter | Type | Description
 | o1 | TDrawingParagraph​Properties | First object to compare.
 | o2 | TDrawingParagraph​Properties | Second object to compare.

See also

  • TDrawingParagraphProperties


TDrawingParagraphProperties.Inequality Operator | FlexCel Studio for the .NET Framework documentation

TDrawingParagraphProperties.Inequality Operator

Returns true if both objects do not have the same value.

Syntax

Namespace: FlexCel.Core

public static Boolean op_Inequality(TDrawingParagraphProperties o1, TDrawingParagraphProperties o2)

Parameters

<-> | Parameter | Type | Description
 | o1 | TDrawingParagraph​Properties | First objects to compare.
 | o2 | TDrawingParagraph​Properties | Second objects to compare.

See also

  • TDrawingParagraphProperties


TDrawingParagraphProperties.LessThan Operator | FlexCel Studio for the .NET Framework documentation

TDrawingParagraphProperties.LessThan Operator

Returns true is an object is less than the other.

Syntax

Namespace: FlexCel.Core

public static Boolean op_LessThan(TDrawingParagraphProperties o1, TDrawingParagraphProperties o2)

Parameters

<-> | Parameter | Type | Description
 | o1 | TDrawingParagraph​Properties | First object to compare.
 | o2 | TDrawingParagraph​Properties | Second object to compare.

See also

  • TDrawingParagraphProperties


TDrawingParagraphProperties.GreaterThan Operator | FlexCel Studio for the .NET Framework documentation

TDrawingParagraphProperties.GreaterThan Operator

Returns true is an object is bigger than the other.

Syntax

Namespace: FlexCel.Core

public static Boolean op_GreaterThan(TDrawingParagraphProperties o1, TDrawingParagraphProperties o2)

Parameters

<-> | Parameter | Type | Description
 | o1 | TDrawingParagraph​Properties | First object to compare.
 | o2 | TDrawingParagraph​Properties | Second object to compare.

See also

  • TDrawingParagraphProperties


TDrawingParagraphProperties.Empty Property | FlexCel Studio for the .NET Framework documentation

TDrawingParagraphProperties.Empty Property

Returns a paragraph with the default values.

Syntax

Namespace: FlexCel.Core

public static TDrawingParagraphProperties Empty { get; }

See also

  • TDrawingParagraphProperties


TDrawingParagraphProperties.MarL Property | FlexCel Studio for the .NET Framework documentation

TDrawingParagraphProperties.MarL Property

Specifies the left margin of the paragraph.

Syntax

Namespace: FlexCel.Core

public Int32 MarL { get; }

See also

  • TDrawingParagraphProperties


TDrawingParagraphProperties.MarR Property | FlexCel Studio for the .NET Framework documentation

TDrawingParagraphProperties.MarR Property

Specifies the right margin of the paragraph.

Syntax

Namespace: FlexCel.Core

public Int32 MarR { get; }

See also

  • TDrawingParagraphProperties


TDrawingParagraphProperties.Lvl Property | FlexCel Studio for the .NET Framework documentation

TDrawingParagraphProperties.Lvl Property

Specifies the particular level text properties that this paragraph follows.

Syntax

Namespace: FlexCel.Core

public Int32 Lvl { get; }

See also

  • TDrawingParagraphProperties


TDrawingParagraphProperties.Indent Property | FlexCel Studio for the .NET Framework documentation

TDrawingParagraphProperties.Indent Property

Specifies the indent size that is applied to the first line of text in the paragraph. An indentation of 0 is considered to be at the same location as marL attribute.

Syntax

Namespace: FlexCel.Core

public TDrawingCoordinate Indent { get; }

See also

  • TDrawingParagraphProperties


TDrawingParagraphProperties.Algn Property | FlexCel Studio for the .NET Framework documentation

TDrawingParagraphProperties.Algn Property

Specifies the alignment that is to be applied to the paragraph.

Syntax

Namespace: FlexCel.Core

public Nullable<TDrawingAlignment> Algn { get; }

See also

  • TDrawingParagraphProperties


TDrawingParagraphProperties.DefTabSz Property | FlexCel Studio for the .NET Framework documentation

TDrawingParagraphProperties.DefTabSz Property

Specifies the default size for a tab character within this paragraph. This attribute should be used to describe the spacing of tabs within the paragraph instead of a leading indentation tab. For indentation tabs there are the marL and indent attributes to assist with this.

Syntax

Namespace: FlexCel.Core

public TDrawingCoordinate DefTabSz { get; }

See also

  • TDrawingParagraphProperties


TDrawingParagraphProperties.Rtl Property | FlexCel Studio for the .NET Framework documentation

TDrawingParagraphProperties.Rtl Property

Specifies whether the text is right-to-left or left-to-right in its flow direction. If null, the value is not known.

Syntax

Namespace: FlexCel.Core

public Nullable<Boolean> Rtl { get; }

See also

  • TDrawingParagraphProperties


TDrawingParagraphProperties.EaLnBrk Property | FlexCel Studio for the .NET Framework documentation

TDrawingParagraphProperties.EaLnBrk Property

Specifies whether an East Asian word can be broken in half and wrapped onto the next line without a hyphen being added.

Syntax

Namespace: FlexCel.Core

public Boolean EaLnBrk { get; }

See also

  • TDrawingParagraphProperties


TDrawingParagraphProperties.FontAlgn Property | FlexCel Studio for the .NET Framework documentation

TDrawingParagraphProperties.FontAlgn Property

Determines where vertically on a line of text the actual words are positioned. This deals with vertical placement of the characters with respect to the baselines.

Syntax

Namespace: FlexCel.Core

public TDrawingFontAlign FontAlgn { get; }

See also

  • TDrawingParagraphProperties


TDrawingParagraphProperties.LatinLnBrk Property | FlexCel Studio for the .NET Framework documentation

TDrawingParagraphProperties.LatinLnBrk Property

Specifies whether a Latin word can be broken in half and wrapped onto the next line without a hyphen being added.

Syntax

Namespace: FlexCel.Core

public Boolean LatinLnBrk { get; }

See also

  • TDrawingParagraphProperties


TDrawingParagraphProperties.HangingPunct Property | FlexCel Studio for the .NET Framework documentation

TDrawingParagraphProperties.HangingPunct Property

Specifies whether punctuation is to be forcefully laid out on a line of text or put on a different line of text.

Syntax

Namespace: FlexCel.Core

public Boolean HangingPunct { get; }

See also

  • TDrawingParagraphProperties


TDrawingParagraphProperties.DefaultTextRunProperties Property | FlexCel Studio for the .NET Framework documentation

TDrawingParagraphProperties.DefaultTextRunProperties Property

Default text properties for the text inside a paragraph.

Syntax

Namespace: FlexCel.Core

public TDrawingTextProperties DefaultTextRunProperties { get; }

See also

  • TDrawingParagraphProperties


TDrawingParagraphProperties.HasDefaultTextRunProperties Property | FlexCel Studio for the .NET Framework documentation

TDrawingParagraphProperties.HasDefaultTextRunProperties Property

Returns true if the paragraph has defined DefaultTextRunProperties even if it is empty.

Syntax

Namespace: FlexCel.Core

public Boolean HasDefaultTextRunProperties { get; }

See also

  • TDrawingParagraphProperties


TDrawingParagraphProperties.IsEmpty Property | FlexCel Studio for the .NET Framework documentation

TDrawingParagraphProperties.IsEmpty Property

Returns true if no members are set.

Syntax

Namespace: FlexCel.Core

public Boolean IsEmpty { get; }

See also

  • TDrawingParagraphProperties


TDrawingPoint Structure | FlexCel Studio for the .NET Framework documentation

TDrawingPoint Structure

A point with x and y coordinates.

Syntax

Namespace: FlexCel.Core

public struct TDrawingPoint

Constructors

Name | Description
TDrawingPoint | Creates a new Drawing point.

Methods

Name | Description
Equals | Returns true if this instance has the same data as the object obj.
GetHashCode | Returns the hashcode for this object
ToString | Returns a string showing the values of the point.

Properties

Name | Description
X | X coordinate.
Y | Y coordinate.


TDrawingPoint.TDrawingPoint Constructor | FlexCel Studio for the .NET Framework documentation

TDrawingPoint.TDrawingPoint Constructor

Creates a new Drawing point.

Syntax

Namespace: FlexCel.Core

public TDrawingPoint(TDrawingCoordinate aX, TDrawingCoordinate aY)

Parameters

<-> | Parameter | Type | Description
 | aX | TDrawingCoordinate | X Coordinate.
 | aY | TDrawingCoordinate | Y Coordinate.

See also

  • TDrawingPoint


TDrawingPoint.Equals Method | FlexCel Studio for the .NET Framework documentation

TDrawingPoint.Equals Method

Returns true if this instance has the same data as the object obj.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TDrawingPoint


TDrawingPoint.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TDrawingPoint.GetHashCode Method

Returns the hashcode for this object

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TDrawingPoint


TDrawingPoint.ToString Method | FlexCel Studio for the .NET Framework documentation

TDrawingPoint.ToString Method

Returns a string showing the values of the point.

Syntax

Namespace: FlexCel.Core

public override String ToString()

See also

  • TDrawingPoint


TDrawingPoint.X Property | FlexCel Studio for the .NET Framework documentation

TDrawingPoint.X Property

X coordinate.

Syntax

Namespace: FlexCel.Core

public TDrawingCoordinate X { get; set; }

See also

  • TDrawingPoint


TDrawingPoint.Y Property | FlexCel Studio for the .NET Framework documentation

TDrawingPoint.Y Property

Y coordinate.

Syntax

Namespace: FlexCel.Core

public TDrawingCoordinate Y { get; set; }

See also

  • TDrawingPoint


TDrawingRelativeRect Structure | FlexCel Studio for the .NET Framework documentation

TDrawingRelativeRect Structure

A rectangle with coordinates used in a drawing.

Syntax

Namespace: FlexCel.Core

public struct TDrawingRelativeRect

Constructors

Name | Description
TDrawingRelativeRect | Creates a new instance.

Methods

Name | Description
Equals | Returns true if both classes contain the same rectangle.
GetHashCode | Returns the hashcode for this object.

Properties

Name | Description
Left | Percentage of the left coordinate. Might be negative.
Top | Percentage of the top coordinate. Might be negative.
Right | Percentage of the right coordinate. Might be negative.
Bottom | Percentage of the bottom coordinate. Might be negative.
Height | Bottom - Top
Width | Right - Left


TDrawingRelativeRect.TDrawingRelativeRect Constructor | FlexCel Studio for the .NET Framework documentation

TDrawingRelativeRect.TDrawingRelativeRect Constructor

Creates a new instance.

Syntax

Namespace: FlexCel.Core

public TDrawingRelativeRect(Double aLeft, Double aTop, Double aRight, Double aBottom)

Parameters

<-> | Parameter | Type | Description
 | aLeft | Double | Percentage of the left coordinate. Might be negative.
 | aTop | Double | Percentage of the top coordinate. Might be negative.
 | aRight | Double | Percentage of the right coordinate. Might be negative.
 | aBottom | Double | Percentage of the bottom coordinate. Might be negative.

See also

  • TDrawingRelativeRect


TDrawingRelativeRect.Equals Method | FlexCel Studio for the .NET Framework documentation

TDrawingRelativeRect.Equals Method

Returns true if both classes contain the same rectangle.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TDrawingRelativeRect


TDrawingRelativeRect.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TDrawingRelativeRect.GetHashCode Method

Returns the hashcode for this object.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TDrawingRelativeRect


TDrawingRelativeRect.Left Property | FlexCel Studio for the .NET Framework documentation

TDrawingRelativeRect.Left Property

Percentage of the left coordinate. Might be negative.

Syntax

Namespace: FlexCel.Core

public Double Left { get; }

See also

  • TDrawingRelativeRect


TDrawingRelativeRect.Top Property | FlexCel Studio for the .NET Framework documentation

TDrawingRelativeRect.Top Property

Percentage of the top coordinate. Might be negative.

Syntax

Namespace: FlexCel.Core

public Double Top { get; }

See also

  • TDrawingRelativeRect


TDrawingRelativeRect.Right Property | FlexCel Studio for the .NET Framework documentation

TDrawingRelativeRect.Right Property

Percentage of the right coordinate. Might be negative.

Syntax

Namespace: FlexCel.Core

public Double Right { get; }

See also

  • TDrawingRelativeRect


TDrawingRelativeRect.Bottom Property | FlexCel Studio for the .NET Framework documentation

TDrawingRelativeRect.Bottom Property

Percentage of the bottom coordinate. Might be negative.

Syntax

Namespace: FlexCel.Core

public Double Bottom { get; }

See also

  • TDrawingRelativeRect


TDrawingRelativeRect.Height Property | FlexCel Studio for the .NET Framework documentation

TDrawingRelativeRect.Height Property

Bottom - Top

Syntax

Namespace: FlexCel.Core

public Double Height { get; }

See also

  • TDrawingRelativeRect


TDrawingRelativeRect.Width Property | FlexCel Studio for the .NET Framework documentation

TDrawingRelativeRect.Width Property

Right - Left

Syntax

Namespace: FlexCel.Core

public Double Width { get; }

See also

  • TDrawingRelativeRect


TDrawingTextAttributes Structure | FlexCel Studio for the .NET Framework documentation

TDrawingTextAttributes Structure

Group of simple attributes for text properties.

Syntax

Namespace: FlexCel.Core

public struct TDrawingTextAttributes

Constructors

Name | Description
TDrawingText​Attributes | Overloaded TDrawingTextAttributes(String, Nullable<Double>) TDrawingTextAttributes(Nullable<Boolean>, String, String, Nullable<Int32>, Nullable<Boolean>, Nullable<Boolean>, Nullable<TDrawingUnderlineStyle>, Nullable<TDrawingTextStrike>, Nullable<Int32>, Nullable<TDrawingTextCapitalization>, Nullable<TDrawingCoordinate>, Nullable<Boolean>, Nullable<Double>, Nullable<Boolean>, Boolean, Boolean, Boolean, Int32, String)

Methods

Name | Description
CompareTo | Returns -1 if obj is bigger than this, 0 if both strings are the same, and 1 if obj is smaller than this.
GetHashCode | Returns the hashcode of the object.
Equals | Returns true if both instances have the same string and formatting.
IsEmpty | Returns true if the attributes are empty

Operators

Name | Description
Equality | Returns true if both objects are equal.
Inequality | Returns true if both objects do not have the same value.
LessThan | Returns true is an object is less than the other.
GreaterThan | Returns true is an object is bigger than the other.

Properties

Name | Description
Empty | Returns the text attributes with the default values.
Kumimoji | Specifies whether the numbers contained within vertical text continue vertically with the text or whether they are to be displayed horizontally while the surrounding characters continue in a vertical fashion. A null value means to use the parent's settings.
Lang | Specifies the language to be used when the generating application is displaying the user interface controls.
AltLang | Specifies the alternate language to use when the generating application is displaying the user interface controls.
Size | Specifies the size of text within a text run. Whole points are specified in increments of 100 starting with 100 being a point size of 1. For instance a font point size of 12 would be 1200 and a font point size of 12.5 would be 1250. A null value means to use the parent's settings.
Bold | Specifies whether a run of text is formatted as bold text. A null value means to use the parent's settings, while false means always that the text is not bold, no matter if it was inside a bold paragraph.
Italic | Specifies whether a run of text is formatted as italic text. A null value means to use the parent's settings.
Underline | Specifies whether a run of text is formatted as underlined text. A null value means to use the parent's settings.
Strike | Specifies whether a run of text is formatted as strikethrough text. A null value means to use the parent's settings.
Kern | Specifies the minimum font size at which character kerning occurs for this text run. Whole points are specified in increments of 100 starting with 100 being a point size of 1. For instance a font point size of 12 would be 1200 and a font point size of 12.5 would be 1250. A null value means to use the parent's settings.
Capitalization | Specifies the capitalization that is to be applied to the text run. This is a render-only modification and does not affect the actual characters stored in the text run. This attribute is also distinct from the toggle function where the actual characters stored in the text run are changed. A null value means to use the parent's settings.
Spacing | Specifies the spacing between characters within a text run. This spacing is specified numerically and should be consistently applied across the entire run of text by the generating application. Whole points are specified in increments of 100 starting with 100 being a point size of 1. For instance a font point size of 12 would be 1200 and a font point size of 12.5 would be 1250. A null value means to use the parent's settings.
NormalizeH | Specifies the normalization of height that is to be applied to the text run. This is a render- only modification and does not affect the actual characters stored in the text run. This attribute is also distinct from the toggle function where the actual characters stored in the text run are changed. A null value means to use the parent's settings.
Baseline | Specifies the baseline for both the superscript and subscript fonts. A null value means to use the parent's settings.
NoProof | Specifies that a run of text has been selected by the user to not be checked for mistakes. A null value means to use the parent's settings.
Dirty | Specifies that the content of a text run has changed since the proofing tools have last been run.
Err | Specifies that when this run of text was checked for spelling, grammar, etc. that a mistake was indeed found.
SmartTagClean | Specifies whether or not a text run has been checked for smart tags.
SmartTagId | Specifies a smart tag identifier for a run of text. This ID is unique throughout the presentation and is used to reference corresponding auxiliary information about the smart tag.
BookmarkLinkTarget | Specifies the link target name that is used to reference to the proper link properties in a custom XML part within the document.


TDrawingTextAttributes.TDrawingTextAttributes Constructor | FlexCel Studio for the .NET Framework documentation

TDrawingTextAttributes.TDrawingTextAttributes Constructor

Overloads

  • TDrawingTextAttributes.TDrawingTextAttributes(String, Nullable<Double>)
  • TDrawingTextAttributes.TDrawingTextAttributes(Nullable<Boolean>, String, String, Nullable<Int32>, Nullable<Boolean>, Nullable<Boolean>, Nullable<TDrawingUnderlineStyle>, Nullable<TDrawingTextStrike>, Nullable<Int32>, Nullable<TDrawingTextCapitalization>, Nullable<TDrawingCoordinate>, Nullable<Boolean>, Nullable<Double>, Nullable<Boolean>, Boolean, Boolean, Boolean, Int32, String)

TDrawingTextAttributes.TDrawingTextAttributes(String, Nullable<Double>)

Creates a new instance with a language.

Syntax

Namespace: FlexCel.Core

public TDrawingTextAttributes(String aLang, Nullable<Double> aBaseline)

Parameters

<-> | Parameter | Type | Description
 | aLang | String |
 | aBaseline | Nullable<Double> |

See also

  • TDrawingTextAttributes

TDrawingTextAttributes.TDrawingTextAttributes(Nullable<Boolean>, String, String, Nullable<Int32>, Nullable<Boolean>, Nullable<Boolean>, Nullable<TDrawingUnderlineStyle>, Nullable<TDrawingTextStrike>, Nullable<Int32>, Nullable<TDrawingTextCapitalization>, Nullable<TDrawingCoordinate>, Nullable<Boolean>, Nullable<Double>, Nullable<Boolean>, Boolean, Boolean, Boolean, Int32, String)

Creates a new instance.

Syntax

Namespace: FlexCel.Core

public TDrawingTextAttributes(Nullable<Boolean> aKumimoji, String aLang, String aAltLang, Nullable<Int32> aSize, Nullable<Boolean> aBold, Nullable<Boolean> aItalic, Nullable<TDrawingUnderlineStyle> aUnderline, Nullable<TDrawingTextStrike> aStrike, Nullable<Int32> aKern, Nullable<TDrawingTextCapitalization> aCapitalization, Nullable<TDrawingCoordinate> aSpacing, Nullable<Boolean> aNormalizeH, Nullable<Double> aBaseline, Nullable<Boolean> aNoProof, Boolean aDirty, Boolean aErr, Boolean aSmartTagClean, Int32 aSmartTagId, String aBookmarkLinkTarget)

Parameters

<-> | Parameter | Type | Description
 | aKumimoji | Nullable<Boolean> |
 | aLang | String |
 | aAltLang | String |
 | aSize | Nullable<Int32> |
 | aBold | Nullable<Boolean> |
 | aItalic | Nullable<Boolean> |
 | aUnderline | Nullable<TDrawingUnderline​Style> |
 | aStrike | Nullable<TDrawingTextStrike> |
 | aKern | Nullable<Int32> |
 | aCapitalization | Nullable<TDrawingText​Capitalization> |
 | aSpacing | Nullable<TDrawingCoordinate> |
 | aNormalizeH | Nullable<Boolean> |
 | aBaseline | Nullable<Double> |
 | aNoProof | Nullable<Boolean> |
 | aDirty | Boolean |
 | aErr | Boolean |
 | aSmartTagClean | Boolean |
 | aSmartTagId | Int32 |
 | aBookmarkLinkTarget | String |

See also

  • TDrawingTextAttributes


TDrawingTextAttributes.CompareTo Method | FlexCel Studio for the .NET Framework documentation

TDrawingTextAttributes.CompareTo Method

Returns -1 if obj is bigger than this, 0 if both strings are the same, and 1 if obj is smaller than this.

Syntax

Namespace: FlexCel.Core

public Int32 CompareTo(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TDrawingTextAttributes


TDrawingTextAttributes.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TDrawingTextAttributes.GetHashCode Method

Returns the hashcode of the object.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TDrawingTextAttributes


TDrawingTextAttributes.Equals Method | FlexCel Studio for the .NET Framework documentation

TDrawingTextAttributes.Equals Method

Returns true if both instances have the same string and formatting.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object | Object to compare.

Returns

True if both strings are the same.

See also

  • TDrawingTextAttributes


TDrawingTextAttributes.IsEmpty Method | FlexCel Studio for the .NET Framework documentation

TDrawingTextAttributes.IsEmpty Method

Returns true if the attributes are empty

Syntax

Namespace: FlexCel.Core

public Boolean IsEmpty()

See also

  • TDrawingTextAttributes


TDrawingTextAttributes.Equality Operator | FlexCel Studio for the .NET Framework documentation

TDrawingTextAttributes.Equality Operator

Returns true if both objects are equal.

Syntax

Namespace: FlexCel.Core

public static Boolean op_Equality(TDrawingTextAttributes o1, TDrawingTextAttributes o2)

Parameters

<-> | Parameter | Type | Description
 | o1 | TDrawingText​Attributes | First object to compare.
 | o2 | TDrawingText​Attributes | Second object to compare.

See also

  • TDrawingTextAttributes


TDrawingTextAttributes.Inequality Operator | FlexCel Studio for the .NET Framework documentation

TDrawingTextAttributes.Inequality Operator

Returns true if both objects do not have the same value.

Syntax

Namespace: FlexCel.Core

public static Boolean op_Inequality(TDrawingTextAttributes o1, TDrawingTextAttributes o2)

Parameters

<-> | Parameter | Type | Description
 | o1 | TDrawingText​Attributes | First objects to compare.
 | o2 | TDrawingText​Attributes | Second objects to compare.

See also

  • TDrawingTextAttributes


TDrawingTextAttributes.LessThan Operator | FlexCel Studio for the .NET Framework documentation

TDrawingTextAttributes.LessThan Operator

Returns true is an object is less than the other.

Syntax

Namespace: FlexCel.Core

public static Boolean op_LessThan(TDrawingTextAttributes o1, TDrawingTextAttributes o2)

Parameters

<-> | Parameter | Type | Description
 | o1 | TDrawingText​Attributes | First object to compare.
 | o2 | TDrawingText​Attributes | Second object to compare.

See also

  • TDrawingTextAttributes


TDrawingTextAttributes.GreaterThan Operator | FlexCel Studio for the .NET Framework documentation

TDrawingTextAttributes.GreaterThan Operator

Returns true is an object is bigger than the other.

Syntax

Namespace: FlexCel.Core

public static Boolean op_GreaterThan(TDrawingTextAttributes o1, TDrawingTextAttributes o2)

Parameters

<-> | Parameter | Type | Description
 | o1 | TDrawingText​Attributes | First object to compare.
 | o2 | TDrawingText​Attributes | Second object to compare.

See also

  • TDrawingTextAttributes


TDrawingTextAttributes.Empty Property | FlexCel Studio for the .NET Framework documentation

TDrawingTextAttributes.Empty Property

Returns the text attributes with the default values.

Syntax

Namespace: FlexCel.Core

public static TDrawingTextAttributes Empty { get; }

See also

  • TDrawingTextAttributes


TDrawingTextAttributes.Kumimoji Property | FlexCel Studio for the .NET Framework documentation

TDrawingTextAttributes.Kumimoji Property

Specifies whether the numbers contained within vertical text continue vertically with the text or whether they are to be displayed horizontally while the surrounding characters continue in a vertical fashion. A null value means to use the parent's settings.

Syntax

Namespace: FlexCel.Core

public Nullable<Boolean> Kumimoji { get; }

See also

  • TDrawingTextAttributes


TDrawingTextAttributes.Lang Property | FlexCel Studio for the .NET Framework documentation

TDrawingTextAttributes.Lang Property

Specifies the language to be used when the generating application is displaying the user interface controls.

Syntax

Namespace: FlexCel.Core

public String Lang { get; }

See also

  • TDrawingTextAttributes


TDrawingTextAttributes.AltLang Property | FlexCel Studio for the .NET Framework documentation

TDrawingTextAttributes.AltLang Property

Specifies the alternate language to use when the generating application is displaying the user interface controls.

Syntax

Namespace: FlexCel.Core

public String AltLang { get; }

See also

  • TDrawingTextAttributes


TDrawingTextAttributes.Size Property | FlexCel Studio for the .NET Framework documentation

TDrawingTextAttributes.Size Property

Specifies the size of text within a text run. Whole points are specified in increments of 100 starting with 100 being a point size of 1. For instance a font point size of 12 would be 1200 and a font point size of 12.5 would be 1250. A null value means to use the parent's settings.

Syntax

Namespace: FlexCel.Core

public Nullable<Int32> Size { get; }

See also

  • TDrawingTextAttributes


TDrawingTextAttributes.Bold Property | FlexCel Studio for the .NET Framework documentation

TDrawingTextAttributes.Bold Property

Specifies whether a run of text is formatted as bold text. A null value means to use the parent's settings, while false means always that the text is not bold, no matter if it was inside a bold paragraph.

Syntax

Namespace: FlexCel.Core

public Nullable<Boolean> Bold { get; }

See also

  • TDrawingTextAttributes


TDrawingTextAttributes.Italic Property | FlexCel Studio for the .NET Framework documentation

TDrawingTextAttributes.Italic Property

Specifies whether a run of text is formatted as italic text. A null value means to use the parent's settings.

Syntax

Namespace: FlexCel.Core

public Nullable<Boolean> Italic { get; }

See also

  • TDrawingTextAttributes


TDrawingTextAttributes.Underline Property | FlexCel Studio for the .NET Framework documentation

TDrawingTextAttributes.Underline Property

Specifies whether a run of text is formatted as underlined text. A null value means to use the parent's settings.

Syntax

Namespace: FlexCel.Core

public Nullable<TDrawingUnderlineStyle> Underline { get; }

See also

  • TDrawingTextAttributes


TDrawingTextAttributes.Strike Property | FlexCel Studio for the .NET Framework documentation

TDrawingTextAttributes.Strike Property

Specifies whether a run of text is formatted as strikethrough text. A null value means to use the parent's settings.

Syntax

Namespace: FlexCel.Core

public Nullable<TDrawingTextStrike> Strike { get; }

See also

  • TDrawingTextAttributes


TDrawingTextAttributes.Kern Property | FlexCel Studio for the .NET Framework documentation

TDrawingTextAttributes.Kern Property

Specifies the minimum font size at which character kerning occurs for this text run. Whole points are specified in increments of 100 starting with 100 being a point size of 1. For instance a font point size of 12 would be 1200 and a font point size of 12.5 would be 1250. A null value means to use the parent's settings.

Syntax

Namespace: FlexCel.Core

public Nullable<Int32> Kern { get; }

See also

  • TDrawingTextAttributes


TDrawingTextAttributes.Capitalization Property | FlexCel Studio for the .NET Framework documentation

TDrawingTextAttributes.Capitalization Property

Specifies the capitalization that is to be applied to the text run. This is a render-only modification and does not affect the actual characters stored in the text run. This attribute is also distinct from the toggle function where the actual characters stored in the text run are changed. A null value means to use the parent's settings.

Syntax

Namespace: FlexCel.Core

public Nullable<TDrawingTextCapitalization> Capitalization { get; }

See also

  • TDrawingTextAttributes


TDrawingTextAttributes.Spacing Property | FlexCel Studio for the .NET Framework documentation

TDrawingTextAttributes.Spacing Property

Specifies the spacing between characters within a text run. This spacing is specified numerically and should be consistently applied across the entire run of text by the generating application. Whole points are specified in increments of 100 starting with 100 being a point size of 1. For instance a font point size of 12 would be 1200 and a font point size of 12.5 would be 1250. A null value means to use the parent's settings.

Syntax

Namespace: FlexCel.Core

public Nullable<TDrawingCoordinate> Spacing { get; }

See also

  • TDrawingTextAttributes


TDrawingTextAttributes.NormalizeH Property | FlexCel Studio for the .NET Framework documentation

TDrawingTextAttributes.NormalizeH Property

Specifies the normalization of height that is to be applied to the text run. This is a render- only modification and does not affect the actual characters stored in the text run. This attribute is also distinct from the toggle function where the actual characters stored in the text run are changed. A null value means to use the parent's settings.

Syntax

Namespace: FlexCel.Core

public Nullable<Boolean> NormalizeH { get; }

See also

  • TDrawingTextAttributes


TDrawingTextAttributes.Baseline Property | FlexCel Studio for the .NET Framework documentation

TDrawingTextAttributes.Baseline Property

Specifies the baseline for both the superscript and subscript fonts. A null value means to use the parent's settings.

Syntax

Namespace: FlexCel.Core

public Nullable<Double> Baseline { get; }

See also

  • TDrawingTextAttributes


TDrawingTextAttributes.NoProof Property | FlexCel Studio for the .NET Framework documentation

TDrawingTextAttributes.NoProof Property

Specifies that a run of text has been selected by the user to not be checked for mistakes. A null value means to use the parent's settings.

Syntax

Namespace: FlexCel.Core

public Nullable<Boolean> NoProof { get; }

See also

  • TDrawingTextAttributes


TDrawingTextAttributes.Dirty Property | FlexCel Studio for the .NET Framework documentation

TDrawingTextAttributes.Dirty Property

Specifies that the content of a text run has changed since the proofing tools have last been run.

Syntax

Namespace: FlexCel.Core

public Boolean Dirty { get; }

See also

  • TDrawingTextAttributes


TDrawingTextAttributes.Err Property | FlexCel Studio for the .NET Framework documentation

TDrawingTextAttributes.Err Property

Specifies that when this run of text was checked for spelling, grammar, etc. that a mistake was indeed found.

Syntax

Namespace: FlexCel.Core

public Boolean Err { get; }

See also

  • TDrawingTextAttributes


TDrawingTextAttributes.SmartTagClean Property | FlexCel Studio for the .NET Framework documentation

TDrawingTextAttributes.SmartTagClean Property

Specifies whether or not a text run has been checked for smart tags.

Syntax

Namespace: FlexCel.Core

public Boolean SmartTagClean { get; }

See also

  • TDrawingTextAttributes


TDrawingTextAttributes.SmartTagId Property | FlexCel Studio for the .NET Framework documentation

TDrawingTextAttributes.SmartTagId Property

Specifies a smart tag identifier for a run of text. This ID is unique throughout the presentation and is used to reference corresponding auxiliary information about the smart tag.

Syntax

Namespace: FlexCel.Core

public Int32 SmartTagId { get; }

See also

  • TDrawingTextAttributes


TDrawingTextAttributes.BookmarkLinkTarget Property | FlexCel Studio for the .NET Framework documentation

TDrawingTextAttributes.BookmarkLinkTarget Property

Specifies the link target name that is used to reference to the proper link properties in a custom XML part within the document.

Syntax

Namespace: FlexCel.Core

public String BookmarkLinkTarget { get; }

See also

  • TDrawingTextAttributes


TDrawingTextParagraph Structure | FlexCel Studio for the .NET Framework documentation

TDrawingTextParagraph Structure

A paragraph in the text inside a drawing. This struct is immutable.

Syntax

Namespace: FlexCel.Core

public struct TDrawingTextParagraph

Constructors

Name Description
TDrawingText​Paragraph Overloaded
 TDrawingTextParagraph(TDrawingTextRun[], TDrawingParagraphProperties, TDrawingTextProperties)
TDrawingTextParagraph(String, TDrawingParagraphProperties, TDrawingTextProperties)
TDrawingTextParagraph(TDrawingTextRun[], TDrawingParagraphProperties, TDrawingTextProperties, String)

Methods

Name | Description
TextRun | Returns a single text run for the paragraph.
Substring | Retrieves a substring from this instance. The substring starts at a specified character position and has a specified length.
ReplaceRun | Returns a new paragraph with the run at position run replaced ny another.
CompareTo | Returns -1 if obj is bigger than this, 0 if both strings are the same, and 1 if obj is smaller than this.
GetHashCode | Returns the hashcode of the object.
Equals | Returns true if both instances have the same string and formatting.
WithNewFieldIds | Returns a new TDrawingText​Paragraph with new field ids if the DrawingTextParagraph has field ids. While FlexCel will do this automatically when you link a shape, you can use this method when creating a new linked shape that requires new field ids.

Operators

Name | Description
Equality | Returns true if both objects are equal.
Inequality | Returns true if both objects do not have the same value.
LessThan | Returns true is an object is less than the other.
GreaterThan | Returns true is an object is bigger than the other.

Properties

Name | Description
Properties | The properties that apply to this paragraph.
EndParagraph​Properties | Properties that apply to new paragraphs that are added after this one.
TextRunCount | Returns the number of runs in the paragraph.
Text | Returns the contents of the paragraph as plain text.
UnknownXml | Contains unknown xml read from an xlsx file. If this property is not empty, then the value here will be used and the rest of properties will be ignored when saving the file.
Runs | Returns all the text runs for this paragraph. This creates a copy of the array of runs, so if possible use TextRun instead to avoid memory allocations.


TDrawingTextParagraph.TDrawingTextParagraph Constructor | FlexCel Studio for the .NET Framework documentation

TDrawingTextParagraph.TDrawingTextParagraph Constructor

Overloads

  • TDrawingTextParagraph.TDrawingTextParagraph(TDrawingTextRun[], TDrawingParagraphProperties, TDrawingTextProperties)
  • TDrawingTextParagraph.TDrawingTextParagraph(String, TDrawingParagraphProperties, TDrawingTextProperties)
  • TDrawingTextParagraph.TDrawingTextParagraph(TDrawingTextRun[], TDrawingParagraphProperties, TDrawingTextProperties, String)

TDrawingTextParagraph.TDrawingTextParagraph(TDrawingTextRun[], TDrawingParagraphProperties, TDrawingTextProperties)

Creates a new TDrawingTextParagraph.

Syntax

Namespace: FlexCel.Core

public TDrawingTextParagraph(TDrawingTextRun[] aRuns, TDrawingParagraphProperties aProperties, TDrawingTextProperties aEndParagraphProperties)

Parameters

<-> | Parameter | Type | Description
 | aRuns | TDrawingTextRun[] |
 | aProperties | TDrawingParagraph​Properties |
 | aEndParagraphProperties | TDrawingText​Properties |

See also

  • TDrawingTextParagraph

TDrawingTextParagraph.TDrawingTextParagraph(String, TDrawingParagraphProperties, TDrawingTextProperties)

Creates a new TDrawingTextParagraph based on a simple string.

Syntax

Namespace: FlexCel.Core

public TDrawingTextParagraph(String s, TDrawingParagraphProperties aProperties, TDrawingTextProperties aEndParagraphProperties)

Parameters

<-> | Parameter | Type | Description
 | s | String |
 | aProperties | TDrawingParagraph​Properties |
 | aEndParagraphProperties | TDrawingText​Properties |

See also

  • TDrawingTextParagraph

TDrawingTextParagraph.TDrawingTextParagraph(TDrawingTextRun[], TDrawingParagraphProperties, TDrawingTextProperties, String)

Creates a new TDrawingTextParagraph instance.

Syntax

Namespace: FlexCel.Core

public TDrawingTextParagraph(TDrawingTextRun[] aRuns, TDrawingParagraphProperties aProperties, TDrawingTextProperties aEndParagraphProperties, String aUnknownXml)

Parameters

<-> | Parameter | Type | Description
 | aRuns | TDrawingTextRun[] |
 | aProperties | TDrawingParagraph​Properties |
 | aEndParagraphProperties | TDrawingText​Properties |
 | aUnknownXml | String |

See also

  • TDrawingTextParagraph


TDrawingTextParagraph.TextRun Method | FlexCel Studio for the .NET Framework documentation

TDrawingTextParagraph.TextRun Method

Returns a single text run for the paragraph.

Syntax

Namespace: FlexCel.Core

public TDrawingTextRun TextRun(Int32 index)

Parameters

<-> | Parameter | Type | Description
 | index | Int32 | Index of the run (0 based)

Returns

Text run for position index.

See also

  • TDrawingTextParagraph


TDrawingTextParagraph.Substring Method | FlexCel Studio for the .NET Framework documentation

TDrawingTextParagraph.Substring Method

Retrieves a substring from this instance. The substring starts at a specified character position and has a specified length.

Syntax

Namespace: FlexCel.Core

public TDrawingTextParagraph Substring(Int32 index, Int32 count)

Parameters

<-> | Parameter | Type | Description
 | index | Int32 | Start of the substring (0 based)
 | count | Int32 | Number of characters to copy.

See also

  • TDrawingTextParagraph


TDrawingTextParagraph.ReplaceRun Method | FlexCel Studio for the .NET Framework documentation

TDrawingTextParagraph.ReplaceRun Method

Returns a new paragraph with the run at position run replaced ny another.

Syntax

Namespace: FlexCel.Core

public TDrawingTextParagraph ReplaceRun(Int32 run, TDrawingTextRun textRun)

Parameters

<-> | Parameter | Type | Description
 | run | Int32 | Index of the run to replace (0 based)
 | textRun | TDrawingTextRun | Run to replace.

See also

  • TDrawingTextParagraph


TDrawingTextParagraph.CompareTo Method | FlexCel Studio for the .NET Framework documentation

TDrawingTextParagraph.CompareTo Method

Returns -1 if obj is bigger than this, 0 if both strings are the same, and 1 if obj is smaller than this.

Syntax

Namespace: FlexCel.Core

public Int32 CompareTo(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TDrawingTextParagraph


TDrawingTextParagraph.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TDrawingTextParagraph.GetHashCode Method

Returns the hashcode of the object.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TDrawingTextParagraph


TDrawingTextParagraph.Equals Method | FlexCel Studio for the .NET Framework documentation

TDrawingTextParagraph.Equals Method

Returns true if both instances have the same string and formatting.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object | Object to compare.

Returns

True if both strings are the same.

See also

  • TDrawingTextParagraph


TDrawingTextParagraph.WithNewFieldIds Method | FlexCel Studio for the .NET Framework documentation

TDrawingTextParagraph.WithNewFieldIds Method

Returns a new TDrawingTextParagraph with new field ids if the DrawingTextParagraph has field ids. While FlexCel will do this automatically when you link a shape, you can use this method when creating a new linked shape that requires new field ids.

Syntax

Namespace: FlexCel.Core

public TDrawingTextParagraph WithNewFieldIds()

See also

  • TDrawingTextParagraph


TDrawingTextParagraph.Equality Operator | FlexCel Studio for the .NET Framework documentation

TDrawingTextParagraph.Equality Operator

Returns true if both objects are equal.

Syntax

Namespace: FlexCel.Core

public static Boolean op_Equality(TDrawingTextParagraph o1, TDrawingTextParagraph o2)

Parameters

<-> | Parameter | Type | Description
 | o1 | TDrawingText​Paragraph | First object to compare.
 | o2 | TDrawingText​Paragraph | Second object to compare.

See also

  • TDrawingTextParagraph


TDrawingTextParagraph.Inequality Operator | FlexCel Studio for the .NET Framework documentation

TDrawingTextParagraph.Inequality Operator

Returns true if both objects do not have the same value.

Syntax

Namespace: FlexCel.Core

public static Boolean op_Inequality(TDrawingTextParagraph o1, TDrawingTextParagraph o2)

Parameters

<-> | Parameter | Type | Description
 | o1 | TDrawingText​Paragraph | First objects to compare.
 | o2 | TDrawingText​Paragraph | Second objects to compare.

See also

  • TDrawingTextParagraph


TDrawingTextParagraph.LessThan Operator | FlexCel Studio for the .NET Framework documentation

TDrawingTextParagraph.LessThan Operator

Returns true is an object is less than the other.

Syntax

Namespace: FlexCel.Core

public static Boolean op_LessThan(TDrawingTextParagraph o1, TDrawingTextParagraph o2)

Parameters

<-> | Parameter | Type | Description
 | o1 | TDrawingText​Paragraph | First object to compare.
 | o2 | TDrawingText​Paragraph | Second object to compare.

See also

  • TDrawingTextParagraph


TDrawingTextParagraph.GreaterThan Operator | FlexCel Studio for the .NET Framework documentation

TDrawingTextParagraph.GreaterThan Operator

Returns true is an object is bigger than the other.

Syntax

Namespace: FlexCel.Core

public static Boolean op_GreaterThan(TDrawingTextParagraph o1, TDrawingTextParagraph o2)

Parameters

<-> | Parameter | Type | Description
 | o1 | TDrawingText​Paragraph | First object to compare.
 | o2 | TDrawingText​Paragraph | Second object to compare.

See also

  • TDrawingTextParagraph


TDrawingTextParagraph.Properties Property | FlexCel Studio for the .NET Framework documentation

TDrawingTextParagraph.Properties Property

The properties that apply to this paragraph.

Syntax

Namespace: FlexCel.Core

public TDrawingParagraphProperties Properties { get; }

See also

  • TDrawingTextParagraph


TDrawingTextParagraph.EndParagraphProperties Property | FlexCel Studio for the .NET Framework documentation

TDrawingTextParagraph.EndParagraphProperties Property

Properties that apply to new paragraphs that are added after this one.

Syntax

Namespace: FlexCel.Core

public TDrawingTextProperties EndParagraphProperties { get; }

See also

  • TDrawingTextParagraph


TDrawingTextParagraph.TextRunCount Property | FlexCel Studio for the .NET Framework documentation

TDrawingTextParagraph.TextRunCount Property

Returns the number of runs in the paragraph.

Syntax

Namespace: FlexCel.Core

public Int32 TextRunCount { get; }

See also

  • TDrawingTextParagraph


TDrawingTextParagraph.Text Property | FlexCel Studio for the .NET Framework documentation

TDrawingTextParagraph.Text Property

Returns the contents of the paragraph as plain text.

Syntax

Namespace: FlexCel.Core

public String Text { get; }

See also

  • TDrawingTextParagraph


TDrawingTextParagraph.UnknownXml Property | FlexCel Studio for the .NET Framework documentation

TDrawingTextParagraph.UnknownXml Property

Contains unknown xml read from an xlsx file. If this property is not empty, then the value here will be used and the rest of properties will be ignored when saving the file.

Syntax

Namespace: FlexCel.Core

public String UnknownXml { get; }

See also

  • TDrawingTextParagraph


TDrawingTextParagraph.Runs Property | FlexCel Studio for the .NET Framework documentation

TDrawingTextParagraph.Runs Property

Returns all the text runs for this paragraph. This creates a copy of the array of runs, so if possible use TextRun instead to avoid memory allocations.

Syntax

Namespace: FlexCel.Core

public TDrawingTextRun[] Runs { get; }

See also

  • TDrawingTextParagraph


TDrawingTextProperties Structure | FlexCel Studio for the .NET Framework documentation

TDrawingTextProperties Structure

Properties of a text run inside a drawing.

Syntax

Namespace: FlexCel.Core

public struct TDrawingTextProperties

Constructors

Name Description
TDrawingText​Properties Overloaded
 TDrawingTextProperties(TFillStyle, TDrawingTextAttributes)
TDrawingTextProperties(TFillStyle, TLineStyle, TEffectProperties, Nullable<TDrawingColor>, TDrawingUnderline, Nullable<TThemeTextFont>, Nullable<TThemeTextFont>, Nullable<TThemeTextFont>, Nullable<TThemeTextFont>, TDrawingHyperlink, TDrawingHyperlink, Boolean, TDrawingTextAttributes)

Methods

Name | Description
CompareTo | Returns -1 if obj is bigger than this, 0 if both strings are the same, and 1 if obj is smaller than this.
GetHashCode | Returns the hashcode of the object.
Equals | Returns true if both instances have the same string and formatting.

Operators

Name | Description
Equality | Returns true if both objects are equal.
Inequality | Returns true if both objects do not have the same value.
LessThan | Returns true is an object is less than the other.
GreaterThan | Returns true is an object is bigger than the other.

Properties

Name | Description
Empty | Returns the text attributes with the default values.
Fill | Fill style for the text.
Line | Line style for the text.
Effects | Effects applied to the text.
Highlight | Highlight color that is present for a run of text.
Underline | Underline fill for the text.
Latin | This element specifies that a Latin font be used for a specific run of text. This font is specified with a typeface attribute much like the others but is specifically classified as a Latin font.
EastAsian | This element specifies that an East Asian font be used for a specific run of text. This font is specified with a typeface attribute much like the others but is specifically classified as an East Asian font.
ComplexScript | This element specifies that a complex script font be used for a specific run of text. This font is specified with a typeface attribute much like the others but is specifically classified as a complex script font.
Symbol | This element specifies that a symbol script font be used for a specific run of text. This font is specified with a typeface attribute much like the others but is specifically classified as a symbol script font.
HyperlinkClick | Specifies the on-click hyperlink information to be applied to a run of text. When the hyperlink text is clicked the link is fetched.
HyperlinkMouseOver | Specifies the mouse-over hyperlink information to be applied to a run of text. When the mouse is hovered over this hyperlink text the link is fetched.
RightToLeft | This element specifies whether the contents of this run shall have right-to-left characteristics.
Attributes | Group of simple attributes applied to the text run.
IsEmpty | Returns true if no members are set.


TDrawingTextProperties.TDrawingTextProperties Constructor | FlexCel Studio for the .NET Framework documentation

TDrawingTextProperties.TDrawingTextProperties Constructor

Overloads

  • TDrawingTextProperties.TDrawingTextProperties(TFillStyle, TDrawingTextAttributes)
  • TDrawingTextProperties.TDrawingTextProperties(TFillStyle, TLineStyle, TEffectProperties, Nullable<TDrawingColor>, TDrawingUnderline, Nullable<TThemeTextFont>, Nullable<TThemeTextFont>, Nullable<TThemeTextFont>, Nullable<TThemeTextFont>, TDrawingHyperlink, TDrawingHyperlink, Boolean, TDrawingTextAttributes)

TDrawingTextProperties.TDrawingTextProperties(TFillStyle, TDrawingTextAttributes)

Creates a new instance.

Syntax

Namespace: FlexCel.Core

public TDrawingTextProperties(TFillStyle aFill, TDrawingTextAttributes aAttributes)

Parameters

<-> | Parameter | Type | Description
 | aFill | TFillStyle |
 | aAttributes | TDrawingText​Attributes |

See also

  • TDrawingTextProperties

TDrawingTextProperties.TDrawingTextProperties(TFillStyle, TLineStyle, TEffectProperties, Nullable<TDrawingColor>, TDrawingUnderline, Nullable<TThemeTextFont>, Nullable<TThemeTextFont>, Nullable<TThemeTextFont>, Nullable<TThemeTextFont>, TDrawingHyperlink, TDrawingHyperlink, Boolean, TDrawingTextAttributes)

Creates a new instance.

Syntax

Namespace: FlexCel.Core

public TDrawingTextProperties(TFillStyle aFill, TLineStyle aLine, TEffectProperties aEffects, Nullable<TDrawingColor> aHighlight, TDrawingUnderline aUnderline, Nullable<TThemeTextFont> aLatin, Nullable<TThemeTextFont> aEastAssian, Nullable<TThemeTextFont> aComplexScript, Nullable<TThemeTextFont> aSymbol, TDrawingHyperlink aHyperlinkClick, TDrawingHyperlink aHyperlinkMouseOver, Boolean aRightToLeft, TDrawingTextAttributes aAttributes)

Parameters

<-> | Parameter | Type | Description
 | aFill | TFillStyle |
 | aLine | TLineStyle |
 | aEffects | TEffectProperties |
 | aHighlight | Nullable<TDrawingColor> |
 | aUnderline | TDrawingUnderline |
 | aLatin | Nullable<TThemeTextFont> |
 | aEastAssian | Nullable<TThemeTextFont> |
 | aComplexScript | Nullable<TThemeTextFont> |
 | aSymbol | Nullable<TThemeTextFont> |
 | aHyperlinkClick | TDrawingHyperlink |
 | aHyperlinkMouseOver | TDrawingHyperlink |
 | aRightToLeft | Boolean |
 | aAttributes | TDrawingText​Attributes |

See also

  • TDrawingTextProperties


TDrawingTextProperties.CompareTo Method | FlexCel Studio for the .NET Framework documentation

TDrawingTextProperties.CompareTo Method

Returns -1 if obj is bigger than this, 0 if both strings are the same, and 1 if obj is smaller than this.

Syntax

Namespace: FlexCel.Core

public Int32 CompareTo(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TDrawingTextProperties


TDrawingTextProperties.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TDrawingTextProperties.GetHashCode Method

Returns the hashcode of the object.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TDrawingTextProperties


TDrawingTextProperties.Equals Method | FlexCel Studio for the .NET Framework documentation

TDrawingTextProperties.Equals Method

Returns true if both instances have the same string and formatting.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object | Object to compare.

Returns

True if both strings are the same.

See also

  • TDrawingTextProperties


TDrawingTextProperties.Equality Operator | FlexCel Studio for the .NET Framework documentation

TDrawingTextProperties.Equality Operator

Returns true if both objects are equal.

Syntax

Namespace: FlexCel.Core

public static Boolean op_Equality(TDrawingTextProperties o1, TDrawingTextProperties o2)

Parameters

<-> | Parameter | Type | Description
 | o1 | TDrawingText​Properties | First object to compare.
 | o2 | TDrawingText​Properties | Second object to compare.

See also

  • TDrawingTextProperties


TDrawingTextProperties.Inequality Operator | FlexCel Studio for the .NET Framework documentation

TDrawingTextProperties.Inequality Operator

Returns true if both objects do not have the same value.

Syntax

Namespace: FlexCel.Core

public static Boolean op_Inequality(TDrawingTextProperties o1, TDrawingTextProperties o2)

Parameters

<-> | Parameter | Type | Description
 | o1 | TDrawingText​Properties | First objects to compare.
 | o2 | TDrawingText​Properties | Second objects to compare.

See also

  • TDrawingTextProperties


TDrawingTextProperties.LessThan Operator | FlexCel Studio for the .NET Framework documentation

TDrawingTextProperties.LessThan Operator

Returns true is an object is less than the other.

Syntax

Namespace: FlexCel.Core

public static Boolean op_LessThan(TDrawingTextProperties o1, TDrawingTextProperties o2)

Parameters

<-> | Parameter | Type | Description
 | o1 | TDrawingText​Properties | First object to compare.
 | o2 | TDrawingText​Properties | Second object to compare.

See also

  • TDrawingTextProperties


TDrawingTextProperties.GreaterThan Operator | FlexCel Studio for the .NET Framework documentation

TDrawingTextProperties.GreaterThan Operator

Returns true is an object is bigger than the other.

Syntax

Namespace: FlexCel.Core

public static Boolean op_GreaterThan(TDrawingTextProperties o1, TDrawingTextProperties o2)

Parameters

<-> | Parameter | Type | Description
 | o1 | TDrawingText​Properties | First object to compare.
 | o2 | TDrawingText​Properties | Second object to compare.

See also

  • TDrawingTextProperties


TDrawingTextProperties.Empty Property | FlexCel Studio for the .NET Framework documentation

TDrawingTextProperties.Empty Property

Returns the text attributes with the default values.

Syntax

Namespace: FlexCel.Core

public static TDrawingTextProperties Empty { get; }

See also

  • TDrawingTextProperties


TDrawingTextProperties.Fill Property | FlexCel Studio for the .NET Framework documentation

TDrawingTextProperties.Fill Property

Fill style for the text.

Syntax

Namespace: FlexCel.Core

public TFillStyle Fill { get; }

See also

  • TDrawingTextProperties


TDrawingTextProperties.Line Property | FlexCel Studio for the .NET Framework documentation

TDrawingTextProperties.Line Property

Line style for the text.

Syntax

Namespace: FlexCel.Core

public TLineStyle Line { get; }

See also

  • TDrawingTextProperties


TDrawingTextProperties.Effects Property | FlexCel Studio for the .NET Framework documentation

TDrawingTextProperties.Effects Property

Effects applied to the text.

Syntax

Namespace: FlexCel.Core

public TEffectProperties Effects { get; }

See also

  • TDrawingTextProperties


TDrawingTextProperties.Highlight Property | FlexCel Studio for the .NET Framework documentation

TDrawingTextProperties.Highlight Property

Highlight color that is present for a run of text.

Syntax

Namespace: FlexCel.Core

public Nullable<TDrawingColor> Highlight { get; }

See also

  • TDrawingTextProperties


TDrawingTextProperties.Underline Property | FlexCel Studio for the .NET Framework documentation

TDrawingTextProperties.Underline Property

Underline fill for the text.

Syntax

Namespace: FlexCel.Core

public TDrawingUnderline Underline { get; }

See also

  • TDrawingTextProperties


TDrawingTextProperties.Latin Property | FlexCel Studio for the .NET Framework documentation

TDrawingTextProperties.Latin Property

This element specifies that a Latin font be used for a specific run of text. This font is specified with a typeface attribute much like the others but is specifically classified as a Latin font.

Syntax

Namespace: FlexCel.Core

public Nullable<TThemeTextFont> Latin { get; }

See also

  • TDrawingTextProperties


TDrawingTextProperties.EastAsian Property | FlexCel Studio for the .NET Framework documentation

TDrawingTextProperties.EastAsian Property

This element specifies that an East Asian font be used for a specific run of text. This font is specified with a typeface attribute much like the others but is specifically classified as an East Asian font.

Syntax

Namespace: FlexCel.Core

public Nullable<TThemeTextFont> EastAsian { get; }

See also

  • TDrawingTextProperties


TDrawingTextProperties.ComplexScript Property | FlexCel Studio for the .NET Framework documentation

TDrawingTextProperties.ComplexScript Property

This element specifies that a complex script font be used for a specific run of text. This font is specified with a typeface attribute much like the others but is specifically classified as a complex script font.

Syntax

Namespace: FlexCel.Core

public Nullable<TThemeTextFont> ComplexScript { get; }

See also

  • TDrawingTextProperties


TDrawingTextProperties.Symbol Property | FlexCel Studio for the .NET Framework documentation

TDrawingTextProperties.Symbol Property

This element specifies that a symbol script font be used for a specific run of text. This font is specified with a typeface attribute much like the others but is specifically classified as a symbol script font.

Syntax

Namespace: FlexCel.Core

public Nullable<TThemeTextFont> Symbol { get; }

See also

  • TDrawingTextProperties


TDrawingTextProperties.HyperlinkClick Property | FlexCel Studio for the .NET Framework documentation

TDrawingTextProperties.HyperlinkClick Property

Specifies the on-click hyperlink information to be applied to a run of text. When the hyperlink text is clicked the link is fetched.

Syntax

Namespace: FlexCel.Core

public TDrawingHyperlink HyperlinkClick { get; }

See also

  • TDrawingTextProperties


TDrawingTextProperties.HyperlinkMouseOver Property | FlexCel Studio for the .NET Framework documentation

TDrawingTextProperties.HyperlinkMouseOver Property

Specifies the mouse-over hyperlink information to be applied to a run of text. When the mouse is hovered over this hyperlink text the link is fetched.

Syntax

Namespace: FlexCel.Core

public TDrawingHyperlink HyperlinkMouseOver { get; }

See also

  • TDrawingTextProperties


TDrawingTextProperties.RightToLeft Property | FlexCel Studio for the .NET Framework documentation

TDrawingTextProperties.RightToLeft Property

This element specifies whether the contents of this run shall have right-to-left characteristics.

Syntax

Namespace: FlexCel.Core

public Boolean RightToLeft { get; }

See also

  • TDrawingTextProperties


TDrawingTextProperties.Attributes Property | FlexCel Studio for the .NET Framework documentation

TDrawingTextProperties.Attributes Property

Group of simple attributes applied to the text run.

Syntax

Namespace: FlexCel.Core

public TDrawingTextAttributes Attributes { get; }

See also

  • TDrawingTextProperties


TDrawingTextProperties.IsEmpty Property | FlexCel Studio for the .NET Framework documentation

TDrawingTextProperties.IsEmpty Property

Returns true if no members are set.

Syntax

Namespace: FlexCel.Core

public Boolean IsEmpty { get; }

See also

  • TDrawingTextProperties


TDrawingTextRun Structure | FlexCel Studio for the .NET Framework documentation

TDrawingTextRun Structure

A rich formatting run used in text inside of a drawing. This struct is immutable.

Syntax

Namespace: FlexCel.Core

public struct TDrawingTextRun

Constructors

Name | Description
TDrawingTextRun | Creates a new Text Run with some text.

Methods

Name | Description
CreateField | Creates a new Text Run with a field.
CompareTo | Returns -1 if obj is bigger than this, 0 if both strings are the same, and 1 if obj is smaller than this.
GetHashCode | Returns the hashcode of the object.
Equals | Returns true if both instances have the same string and formatting.
ToString | String in the text run.
WithNewFieldId | Returns a new TDrawingTextRun with new field ids if the DrawingTextRun has field ids. While FlexCel will do this automatically when you link a shape, you can use this method when creating a new linked shape that requires new field ids.

Operators

Name | Description
Equality | Returns true if both objects are equal.
Inequality | Returns true if both objects do not have the same value.
LessThan | Returns true is an object is less than the other.
GreaterThan | Returns true is an object is bigger than the other.

Properties

Name | Description
Text | String that this text run holds. If this run holds a field, the text should be ignored.
FieldName | Field that this text run holds. If empty, then this run holds text and not a field.
FieldId | Id for the Field that this text run holds. It must be an unique GUID per field which has different linked cells. Two shapes with the same linked cell can share the same FieldId.
IsFieldName | If true, this run contains a field name and not text.
TextProperties | Properties for this text run.
IsBreak | Returns true if this run contains a single line break.


TDrawingTextRun.TDrawingTextRun Constructor | FlexCel Studio for the .NET Framework documentation

TDrawingTextRun.TDrawingTextRun Constructor

Creates a new Text Run with some text.

Syntax

Namespace: FlexCel.Core

public TDrawingTextRun(String aText, TDrawingTextProperties aTextProperties)

Parameters

<-> | Parameter | Type | Description
 | aText | String |
 | aTextProperties | TDrawingText​Properties |

See also

  • TDrawingTextRun


TDrawingTextRun.CreateField Method | FlexCel Studio for the .NET Framework documentation

TDrawingTextRun.CreateField Method

Creates a new Text Run with a field.

Syntax

Namespace: FlexCel.Core

public static TDrawingTextRun CreateField(String aFieldName, String aFieldId, String aFieldText, TDrawingTextProperties aTextProperties)

Parameters

<-> | Parameter | Type | Description
 | aFieldName | String |
 | aFieldId | String |
 | aFieldText | String |
 | aTextProperties | TDrawingText​Properties |

See also

  • TDrawingTextRun


TDrawingTextRun.CompareTo Method | FlexCel Studio for the .NET Framework documentation

TDrawingTextRun.CompareTo Method

Returns -1 if obj is bigger than this, 0 if both strings are the same, and 1 if obj is smaller than this.

Syntax

Namespace: FlexCel.Core

public Int32 CompareTo(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TDrawingTextRun


TDrawingTextRun.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TDrawingTextRun.GetHashCode Method

Returns the hashcode of the object.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TDrawingTextRun


TDrawingTextRun.Equals Method | FlexCel Studio for the .NET Framework documentation

TDrawingTextRun.Equals Method

Returns true if both instances have the same string and formatting.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object | Object to compare.

Returns

True if both strings are the same.

See also

  • TDrawingTextRun


TDrawingTextRun.ToString Method | FlexCel Studio for the .NET Framework documentation

TDrawingTextRun.ToString Method

String in the text run.

Syntax

Namespace: FlexCel.Core

public override String ToString()

See also

  • TDrawingTextRun


TDrawingTextRun.WithNewFieldId Method | FlexCel Studio for the .NET Framework documentation

TDrawingTextRun.WithNewFieldId Method

Returns a new TDrawingTextRun with new field ids if the DrawingTextRun has field ids. While FlexCel will do this automatically when you link a shape, you can use this method when creating a new linked shape that requires new field ids.

Syntax

Namespace: FlexCel.Core

public TDrawingTextRun WithNewFieldId()

See also

  • TDrawingTextRun


TDrawingTextRun.Equality Operator | FlexCel Studio for the .NET Framework documentation

TDrawingTextRun.Equality Operator

Returns true if both objects are equal.

Syntax

Namespace: FlexCel.Core

public static Boolean op_Equality(TDrawingTextRun o1, TDrawingTextRun o2)

Parameters

<-> | Parameter | Type | Description
 | o1 | TDrawingTextRun | First object to compare.
 | o2 | TDrawingTextRun | Second object to compare.

See also

  • TDrawingTextRun


TDrawingTextRun.Inequality Operator | FlexCel Studio for the .NET Framework documentation

TDrawingTextRun.Inequality Operator

Returns true if both objects do not have the same value.

Syntax

Namespace: FlexCel.Core

public static Boolean op_Inequality(TDrawingTextRun o1, TDrawingTextRun o2)

Parameters

<-> | Parameter | Type | Description
 | o1 | TDrawingTextRun | First objects to compare.
 | o2 | TDrawingTextRun | Second objects to compare.

See also

  • TDrawingTextRun


TDrawingTextRun.LessThan Operator | FlexCel Studio for the .NET Framework documentation

TDrawingTextRun.LessThan Operator

Returns true is an object is less than the other.

Syntax

Namespace: FlexCel.Core

public static Boolean op_LessThan(TDrawingTextRun o1, TDrawingTextRun o2)

Parameters

<-> | Parameter | Type | Description
 | o1 | TDrawingTextRun | First object to compare.
 | o2 | TDrawingTextRun | Second object to compare.

See also

  • TDrawingTextRun


TDrawingTextRun.GreaterThan Operator | FlexCel Studio for the .NET Framework documentation

TDrawingTextRun.GreaterThan Operator

Returns true is an object is bigger than the other.

Syntax

Namespace: FlexCel.Core

public static Boolean op_GreaterThan(TDrawingTextRun o1, TDrawingTextRun o2)

Parameters

<-> | Parameter | Type | Description
 | o1 | TDrawingTextRun | First object to compare.
 | o2 | TDrawingTextRun | Second object to compare.

See also

  • TDrawingTextRun


TDrawingTextRun.Text Property | FlexCel Studio for the .NET Framework documentation

TDrawingTextRun.Text Property

String that this text run holds. If this run holds a field, the text should be ignored.

Syntax

Namespace: FlexCel.Core

public String Text { get; }

See also

  • TDrawingTextRun


TDrawingTextRun.FieldName Property | FlexCel Studio for the .NET Framework documentation

TDrawingTextRun.FieldName Property

Field that this text run holds. If empty, then this run holds text and not a field.

Syntax

Namespace: FlexCel.Core

public String FieldName { get; }

See also

  • TDrawingTextRun


TDrawingTextRun.FieldId Property | FlexCel Studio for the .NET Framework documentation

TDrawingTextRun.FieldId Property

Id for the Field that this text run holds. It must be an unique GUID per field which has different linked cells. Two shapes with the same linked cell can share the same FieldId.

Syntax

Namespace: FlexCel.Core

public String FieldId { get; }

See also

  • TDrawingTextRun


TDrawingTextRun.IsFieldName Property | FlexCel Studio for the .NET Framework documentation

TDrawingTextRun.IsFieldName Property

If true, this run contains a field name and not text.

Syntax

Namespace: FlexCel.Core

public Boolean IsFieldName { get; }

See also

  • TDrawingTextRun


TDrawingTextRun.TextProperties Property | FlexCel Studio for the .NET Framework documentation

TDrawingTextRun.TextProperties Property

Properties for this text run.

Syntax

Namespace: FlexCel.Core

public TDrawingTextProperties TextProperties { get; }

See also

  • TDrawingTextRun


TDrawingTextRun.IsBreak Property | FlexCel Studio for the .NET Framework documentation

TDrawingTextRun.IsBreak Property

Returns true if this run contains a single line break.

Syntax

Namespace: FlexCel.Core

public Boolean IsBreak { get; }

See also

  • TDrawingTextRun


TExcelColor Structure | FlexCel Studio for the .NET Framework documentation

TExcelColor Structure

Represents an Excel color. Colors in Excel can be defined in four ways: Automatic Colors, Indexed Colors (for compatibility with Excel 2003 or older), Palette colors, and RGB colors. This Structure is immutable, once you create it you cannot change its members. You need to create a new struct to modify it.

Syntax

Namespace: FlexCel.Core

public struct TExcelColor

Methods

Name Description
CompareTo Returns -1 if obj is more than color, 0 if both colors are the same, and 1 if obj is less than color.
GetHashCode Returns the hashcode of the object.
Equals Returns true if both instances have the same color.
FromArgb Overloaded
 FromArgb(Int32)
FromArgb(Int32, Double)
FromArgb(Byte, Byte, Byte)
FromArgb(Byte, Byte, Byte, Double)
FromIndex Overloaded
 FromIndex(Int32)
FromIndex(Int32, Double)
FromTheme Overloaded
 FromTheme(TThemeColor)
FromTheme(TThemeColor, Double)
FromAutomatic Returns an standard Automatic color.
ToColor Overloaded
 ToColor(IFlexCelPalette)
ToColor(IFlexCelPalette, TUIColor)

Operators

Name | Description
Equality | Returns true if both colors are equal.
Inequality | Returns true if both colors do not have the same value.
LessThan | Returns true is a color is less than the other.
GreaterThan | Returns true is a color is bigger than the other.
Implicit Conversion | Overloaded Implicit conversion from TUIColor to TExcelColor Implicit conversion from Color to TExcelColor

Properties

Name | Description
ColorType | Identifies which kind of color is the one to apply in this structure.
RGB | Returns the color when this structure has an RGB color, as a 0xRRGGBB integer. This property is fully functional with Excel 2007 or newer, older versions will be converted to Indexed color before saving as xls. Note: When reading a color, the value here might not be the final one, since Tint is applied to get the final color. Use ToColor(​​IFlexCel​Palette) method to find out the RGB color stored in this struct. ...[more]
AutomaticFillType | Returns the type of automatic color, if this structure contains an automatic color.
Index | Returns the color when this structure contains an indexed color (1 based). This property is for compatibility with xls files (Excel 2003 or older), but if you are not changing the color palette, even for older files, it is preferred to use RGB or Theme instead. If you try to read the value of this property and ColorType is not the right kind, an Exception will be raised.
Theme | Returns the color if it is one of the entries in the theme palette (1 based). If you try to read the value of this property and ColorType is not the right kind, an Exception will be raised.
Tint | Returns the tint value applied to the color. If tint is supplied, then it is applied to the RGB value of the color to determine the final color applied. The tint value is stored as a double from -1.0 .. 1.0, where -1.0 means 100% darken and 1.0 means 100% lighten. Also, 0.0 means no change.
Automatic | Returns an standard Automatic color.
IsAutomatic | Returns true if this instance has an automatic color.


TExcelColor.CompareTo Method | FlexCel Studio for the .NET Framework documentation

TExcelColor.CompareTo Method

Returns -1 if obj is more than color, 0 if both colors are the same, and 1 if obj is less than color.

Syntax

Namespace: FlexCel.Core

public Int32 CompareTo(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TExcelColor


TExcelColor.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TExcelColor.GetHashCode Method

Returns the hashcode of the object.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TExcelColor


TExcelColor.Equals Method | FlexCel Studio for the .NET Framework documentation

TExcelColor.Equals Method

Returns true if both instances have the same color.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object | Object to compare.

Returns

True if both colors are the same.

See also

  • TExcelColor


TExcelColor.FromArgb Method | FlexCel Studio for the .NET Framework documentation

TExcelColor.FromArgb Method

Overloads

  • TExcelColor.FromArgb(Int32)
  • TExcelColor.FromArgb(Int32, Double)
  • TExcelColor.FromArgb(Byte, Byte, Byte)
  • TExcelColor.FromArgb(Byte, Byte, Byte, Double)

TExcelColor.FromArgb(Int32)

Returns a Color class with the specified rgb color.

Syntax

Namespace: FlexCel.Core

public static TExcelColor FromArgb(Int32 argb)

Parameters

<-> | Parameter | Type | Description
 | argb | Int32 | Color to set.

See also

  • TExcelColor

TExcelColor.FromArgb(Int32, Double)

Returns a Color class with the specified rgb color and with the specified tint.

Syntax

Namespace: FlexCel.Core

public static TExcelColor FromArgb(Int32 argb, Double tint)

Parameters

<-> | Parameter | Type | Description
 | argb | Int32 | Color to set.
 | tint | Double | Tint for the color. If you try to set a value less than -1 it will be stored as -1, and values bigger than 1 as 1. No exceptions will be raised.

See also

  • TExcelColor

TExcelColor.FromArgb(Byte, Byte, Byte)

Returns a Color class with the specified rgb color and with the 0 tint.

Syntax

Namespace: FlexCel.Core

public static TExcelColor FromArgb(Byte r, Byte g, Byte b)

Parameters

<-> | Parameter | Type | Description
 | r | Byte | Red component of the color.
 | g | Byte | Green component of the color.
 | b | Byte | Blue component of the color.

See also

  • TExcelColor

TExcelColor.FromArgb(Byte, Byte, Byte, Double)

Returns a Color class with the specified rgb color and with the specified tint.

Syntax

Namespace: FlexCel.Core

public static TExcelColor FromArgb(Byte r, Byte g, Byte b, Double tint)

Parameters

<-> | Parameter | Type | Description
 | r | Byte | Red component of the color.
 | g | Byte | Green component of the color.
 | b | Byte | Blue component of the color.
 | tint | Double | Tint for the color. If you try to set a value less than -1 it will be stored as -1, and values bigger than 1 as 1. No exceptions will be raised.

See also

  • TExcelColor


TExcelColor.FromIndex Method | FlexCel Studio for the .NET Framework documentation

TExcelColor.FromIndex Method

Overloads

  • TExcelColor.FromIndex(Int32)
  • TExcelColor.FromIndex(Int32, Double)

TExcelColor.FromIndex(Int32)

Returns a color class with a specified color index. For compatibility with old code, you can enter any index here. If the value is less than 1 or more than 56, it will assume automatic color.

Syntax

Namespace: FlexCel.Core

public static TExcelColor FromIndex(Int32 index)

Parameters

<-> | Parameter | Type | Description
 | index | Int32 | Index to the color palette. (1 based)

See also

  • TExcelColor

TExcelColor.FromIndex(Int32, Double)

Returns a color class with a specified color index. For compatibility with old code, you can enter any index here. If the value is less than 1 or more than 56, it will assume automatic color.

Syntax

Namespace: FlexCel.Core

public static TExcelColor FromIndex(Int32 index, Double tint)

Parameters

<-> | Parameter | Type | Description
 | index | Int32 | Index to the color palette. (1 based)
 | tint | Double | Tint for the color. If you try to set a value less than -1 it will be stored as -1, and values bigger than 1 as 1. No exceptions will be raised.

See also

  • TExcelColor


TExcelColor.FromTheme Method | FlexCel Studio for the .NET Framework documentation

TExcelColor.FromTheme Method

Overloads

  • TExcelColor.FromTheme(TThemeColor)
  • TExcelColor.FromTheme(TThemeColor, Double)

TExcelColor.FromTheme(TThemeColor)

Returns a color class with a specified theme color and tint.

Syntax

Namespace: FlexCel.Core

public static TExcelColor FromTheme(TThemeColor themeColor)

Parameters

<-> | Parameter | Type | Description
 | themeColor | TThemeColor | Theme color index.

See also

  • TExcelColor

TExcelColor.FromTheme(TThemeColor, Double)

Returns a color class with a specified theme color and tint.

Syntax

Namespace: FlexCel.Core

public static TExcelColor FromTheme(TThemeColor themeColor, Double tint)

Parameters

<-> | Parameter | Type | Description
 | themeColor | TThemeColor | Theme color index.
 | tint | Double | Tint for the color. If you try to set a value less than -1 it will be stored as -1, and values bigger than 1 as 1. No exceptions will be raised.

See also

  • TExcelColor


TExcelColor.FromAutomatic Method | FlexCel Studio for the .NET Framework documentation

TExcelColor.FromAutomatic Method

Returns an standard Automatic color.

Syntax

Namespace: FlexCel.Core

public static TExcelColor FromAutomatic(TAutomaticColor autoColor)

Parameters

<-> | Parameter | Type | Description
 | autoColor | TAutomaticColor | Type of automatic color.

See also

  • TExcelColor


TExcelColor.ToColor Method | FlexCel Studio for the .NET Framework documentation

TExcelColor.ToColor Method

Overloads

  • TExcelColor.ToColor(IFlexCelPalette)
  • TExcelColor.ToColor(IFlexCelPalette, TUIColor)

TExcelColor.ToColor(IFlexCelPalette)

Returns the value of this class as a system color.

Syntax

Namespace: FlexCel.Core

public TUIColor ToColor(IFlexCelPalette Xls)

Parameters

<-> | Parameter | Type | Description
 | Xls | IFlexCelPalette | Excel file containing the themes and palettes for the color indexes.

See also

  • TExcelColor

TExcelColor.ToColor(IFlexCelPalette, TUIColor)

Returns the value of this class as a system color.

Syntax

Namespace: FlexCel.Core

public TUIColor ToColor(IFlexCelPalette xls, TUIColor automaticColor)

Parameters

<-> | Parameter | Type | Description
 | xls | IFlexCelPalette | Excel file containing the themes and palettes for the color indexes.
 | automaticColor | TUIColor | Color to be returned if this structure has an automatic color.

See also

  • TExcelColor


TExcelColor.Equality Operator | FlexCel Studio for the .NET Framework documentation

TExcelColor.Equality Operator

Returns true if both colors are equal.

Syntax

Namespace: FlexCel.Core

public static Boolean op_Equality(TExcelColor o1, TExcelColor o2)

Parameters

<-> | Parameter | Type | Description
 | o1 | TExcelColor | First color to compare.
 | o2 | TExcelColor | Second color to compare.

See also

  • TExcelColor


TExcelColor.Inequality Operator | FlexCel Studio for the .NET Framework documentation

TExcelColor.Inequality Operator

Returns true if both colors do not have the same value.

Syntax

Namespace: FlexCel.Core

public static Boolean op_Inequality(TExcelColor o1, TExcelColor o2)

Parameters

<-> | Parameter | Type | Description
 | o1 | TExcelColor | First color to compare.
 | o2 | TExcelColor | Second color to compare.

See also

  • TExcelColor


TExcelColor.LessThan Operator | FlexCel Studio for the .NET Framework documentation

TExcelColor.LessThan Operator

Returns true is a color is less than the other.

Syntax

Namespace: FlexCel.Core

public static Boolean op_LessThan(TExcelColor o1, TExcelColor o2)

Parameters

<-> | Parameter | Type | Description
 | o1 | TExcelColor | First color to compare.
 | o2 | TExcelColor | Second color to compare.

See also

  • TExcelColor


TExcelColor.GreaterThan Operator | FlexCel Studio for the .NET Framework documentation

TExcelColor.GreaterThan Operator

Returns true is a color is bigger than the other.

Syntax

Namespace: FlexCel.Core

public static Boolean op_GreaterThan(TExcelColor o1, TExcelColor o2)

Parameters

<-> | Parameter | Type | Description
 | o1 | TExcelColor | First color to compare.
 | o2 | TExcelColor | Second color to compare.

See also

  • TExcelColor


TExcelColor Implicit Conversion Operator | FlexCel Studio for the .NET Framework documentation

TExcelColor Implicit Conversion Operator

Overloads

  • Implicit conversion from TUIColor to TExcelColor
  • Implicit conversion from Color to TExcelColor

Implicit conversion from TUIColor to TExcelColor

Assigns a system color to this instance.

Syntax

Namespace: FlexCel.Core

public static TExcelColor op_Implicit(TUIColor aColor)

Parameters

<-> | Parameter | Type | Description
 | aColor | TUIColor |

See also

  • TExcelColor

Implicit conversion from Color to TExcelColor

Assigns a system color to this instance.

Syntax

Namespace: FlexCel.Core

public static TExcelColor op_Implicit(Color aColor)

Parameters

<-> | Parameter | Type | Description
 | aColor | Color |

See also

  • TExcelColor


TExcelColor.ColorType Property | FlexCel Studio for the .NET Framework documentation

TExcelColor.ColorType Property

Identifies which kind of color is the one to apply in this structure.

Syntax

Namespace: FlexCel.Core

public TColorType ColorType { get; }

See also

  • TExcelColor


TExcelColor.RGB Property | FlexCel Studio for the .NET Framework documentation

TExcelColor.RGB Property

Returns the color when this structure has an RGB color, as a 0xRRGGBB integer. This property is fully functional with Excel 2007 or newer, older versions will be converted to Indexed color before saving as xls.

Note: When reading a color, the value here might not be the final one, since Tint is applied to get the final color. Use ToColor(IFlexCelPalette) method to find out the RGB color stored in this struct.

If you try to read the value of this property and ColorType is not the right kind, an Exception will be raised.

Syntax

Namespace: FlexCel.Core

public Int64 RGB { get; }

See also

  • TExcelColor


TExcelColor.AutomaticFillType Property | FlexCel Studio for the .NET Framework documentation

TExcelColor.AutomaticFillType Property

Returns the type of automatic color, if this structure contains an automatic color.

Syntax

Namespace: FlexCel.Core

public TAutomaticColor AutomaticFillType { get; }

See also

  • TExcelColor


TExcelColor.Index Property | FlexCel Studio for the .NET Framework documentation

TExcelColor.Index Property

Returns the color when this structure contains an indexed color (1 based). This property is for compatibility with xls files (Excel 2003 or older), but if you are not changing the color palette, even for older files, it is preferred to use RGB or Theme instead.

If you try to read the value of this property and ColorType is not the right kind, an Exception will be raised.

Syntax

Namespace: FlexCel.Core

public Int32 Index { get; }

See also

  • TExcelColor


TExcelColor.Theme Property | FlexCel Studio for the .NET Framework documentation

TExcelColor.Theme Property

Returns the color if it is one of the entries in the theme palette (1 based).

If you try to read the value of this property and ColorType is not the right kind, an Exception will be raised.

Syntax

Namespace: FlexCel.Core

public TThemeColor Theme { get; }

See also

  • TExcelColor


TExcelColor.Tint Property | FlexCel Studio for the .NET Framework documentation

TExcelColor.Tint Property

Returns the tint value applied to the color.

If tint is supplied, then it is applied to the RGB value of the color to determine the final color applied.

The tint value is stored as a double from -1.0 .. 1.0, where -1.0 means 100% darken and 1.0 means 100% lighten. Also, 0.0 means no change.

Syntax

Namespace: FlexCel.Core

public Double Tint { get; }

See also

  • TExcelColor


TExcelColor.Automatic Property | FlexCel Studio for the .NET Framework documentation

TExcelColor.Automatic Property

Returns an standard Automatic color.

Syntax

Namespace: FlexCel.Core

public static TExcelColor Automatic { get; }

See also

  • TExcelColor


TExcelColor.IsAutomatic Property | FlexCel Studio for the .NET Framework documentation

TExcelColor.IsAutomatic Property

Returns true if this instance has an automatic color.

Syntax

Namespace: FlexCel.Core

public Boolean IsAutomatic { get; }

See also

  • TExcelColor


TFlxApplyFillPattern Structure | FlexCel Studio for the .NET Framework documentation

TFlxApplyFillPattern Structure

Fill pattern and color for the background of a cell.

Syntax

Namespace: FlexCel.Core

public struct TFlxApplyFillPattern

Constructors

Name | Description
TFlxApplyFillPattern | Creates the record setting all members to true or false.

Methods

Name | Description
SetAllMembers | Sets all members to true or false
Apply | This method will modify existingFormat with the properties from newFormat that are specified on this class

Properties

Name | Description
Pattern | Fill style.
FgColor | Color for the foreground of the pattern.
BgColor | Color for the background of the pattern. If the pattern is solid, has no effect.
Gradient | Defines if to apply a gradient to a cell. Only valid in Excel 2007 or newer.
IsEmpty | Returns true if the format does not apply any setting.


TFlxApplyFillPattern.TFlxApplyFillPattern Constructor | FlexCel Studio for the .NET Framework documentation

TFlxApplyFillPattern.TFlxApplyFillPattern Constructor

Creates the record setting all members to true or false.

Syntax

Namespace: FlexCel.Core

public TFlxApplyFillPattern(Boolean AllTrue)

Parameters

<-> | Parameter | Type | Description
 | AllTrue | Boolean | If true all members will be set to true.

See also

  • TFlxApplyFillPattern


TFlxApplyFillPattern.SetAllMembers Method | FlexCel Studio for the .NET Framework documentation

TFlxApplyFillPattern.SetAllMembers Method

Sets all members to true or false

Syntax

Namespace: FlexCel.Core

public void SetAllMembers(Boolean Value)

Parameters

<-> | Parameter | Type | Description
 | Value | Boolean |

See also

  • TFlxApplyFillPattern


TFlxApplyFillPattern.Apply Method | FlexCel Studio for the .NET Framework documentation

TFlxApplyFillPattern.Apply Method

This method will modify existingFormat with the properties from newFormat that are specified on this class

Syntax

Namespace: FlexCel.Core

public Boolean Apply(ref TFlxFillPattern existingFormat, ref TFlxFillPattern newFormat)

Parameters

<-> | Parameter | Type | Description
ref | existingFormat | TFlxFillPattern | Existing format that will be updated with the properties of newFormat specified.
ref | newFormat | TFlxFillPattern | New format to apply

Returns

True if there was any change on existingFormat, false otherwise.

See also

  • TFlxApplyFillPattern


TFlxApplyFillPattern.Pattern Property | FlexCel Studio for the .NET Framework documentation

TFlxApplyFillPattern.Pattern Property

Fill style.

Syntax

Namespace: FlexCel.Core

public Boolean Pattern { get; set; }

See also

  • TFlxApplyFillPattern


TFlxApplyFillPattern.FgColor Property | FlexCel Studio for the .NET Framework documentation

TFlxApplyFillPattern.FgColor Property

Color for the foreground of the pattern.

Syntax

Namespace: FlexCel.Core

public Boolean FgColor { get; set; }

See also

  • TFlxApplyFillPattern


TFlxApplyFillPattern.BgColor Property | FlexCel Studio for the .NET Framework documentation

TFlxApplyFillPattern.BgColor Property

Color for the background of the pattern. If the pattern is solid, has no effect.

Syntax

Namespace: FlexCel.Core

public Boolean BgColor { get; set; }

See also

  • TFlxApplyFillPattern


TFlxApplyFillPattern.Gradient Property | FlexCel Studio for the .NET Framework documentation

TFlxApplyFillPattern.Gradient Property

Defines if to apply a gradient to a cell. Only valid in Excel 2007 or newer.

Syntax

Namespace: FlexCel.Core

public Boolean Gradient { get; set; }

See also

  • TFlxApplyFillPattern


TFlxApplyFillPattern.IsEmpty Property | FlexCel Studio for the .NET Framework documentation

TFlxApplyFillPattern.IsEmpty Property

Returns true if the format does not apply any setting.

Syntax

Namespace: FlexCel.Core

public Boolean IsEmpty { get; }

See also

  • TFlxApplyFillPattern


TFlxFillPattern Structure | FlexCel Studio for the .NET Framework documentation

TFlxFillPattern Structure

Fill pattern and color for the background of a cell.

Syntax

Namespace: FlexCel.Core

public struct TFlxFillPattern

Fields

Name | Description
Pattern | Fill style.
FgColor | Color for the foreground of the pattern. It is used when the pattern is solid, but not when it is automatic. Important: This color is what you need, in the most common case where the pattern is solid. BgColor is ignored for solid patterns. This can look counterintuitive, but both FgColor and BgColor are colors for the background of the cell (the fill pattern). To change the "foreground color" of a cell, you change the font color, not FgColor. So why are there 2 colors for the background? This is because Excel accepts fill patterns, where for example you might have a fill with a red background and black horizontal lines over it. Fot that case, BgColor would be red and FgColor will be black....[more]
BgColor | Color for the background of the pattern. If the pattern is solid it has no effect, but it is used when pattern is automatic. Important: THIS COLOR IS IGNORED FOR SOLID PATTERNS, which are the most common case. If a pattern is solid you need to use FgColor. Please read the documentation in FgColor for a more complete explanation on why BgColor is ignored.

Methods

Name | Description
Clone | Creates a deep copy of this object.

Properties

Name | Description
Gradient | Gradient definition. This is only valid if Pattern is TFlxPatternStyle.​Gradient.​


TFlxFillPattern.Pattern Field | FlexCel Studio for the .NET Framework documentation

TFlxFillPattern.Pattern Field

Fill style.

Syntax

Namespace: FlexCel.Core

public TFlxPatternStyle Pattern

See also

  • TFlxFillPattern


TFlxFillPattern.FgColor Field | FlexCel Studio for the .NET Framework documentation

TFlxFillPattern.FgColor Field

Color for the foreground of the pattern. It is used when the pattern is solid, but not when it is automatic. Important: This color is what you need, in the most common case where the pattern is solid. BgColor is ignored for solid patterns.

This can look counterintuitive, but both FgColor and BgColor are colors for the background of the cell (the fill pattern). To change the "foreground color" of a cell, you change the font color, not FgColor. So why are there 2 colors for the background? This is because Excel accepts fill patterns, where for example you might have a fill with a red background and black horizontal lines over it. Fot that case, BgColor would be red and FgColor will be black.

But in the most common case, (when Pattern is solid), only one color is needed, and Excel uses the FgColor in this case.

You can think of a solid pattern as a pattern which is painted with the BgColor, and then over this it is painted with the FgColor, so BgColor is not visible.

Syntax

Namespace: FlexCel.Core

public TExcelColor FgColor

See also

  • TFlxFillPattern


TFlxFillPattern.BgColor Field | FlexCel Studio for the .NET Framework documentation

TFlxFillPattern.BgColor Field

Color for the background of the pattern. If the pattern is solid it has no effect, but it is used when pattern is automatic. Important: THIS COLOR IS IGNORED FOR SOLID PATTERNS, which are the most common case. If a pattern is solid you need to use FgColor. Please read the documentation in FgColor for a more complete explanation on why BgColor is ignored.

Syntax

Namespace: FlexCel.Core

public TExcelColor BgColor

See also

  • TFlxFillPattern


TFlxFillPattern.Clone Method | FlexCel Studio for the .NET Framework documentation

TFlxFillPattern.Clone Method

Creates a deep copy of this object.

Syntax

Namespace: FlexCel.Core

public TFlxFillPattern Clone()

See also

  • TFlxFillPattern


TFlxFillPattern.Gradient Property | FlexCel Studio for the .NET Framework documentation

TFlxFillPattern.Gradient Property

Gradient definition. This is only valid if Pattern is TFlxPatternStyle.Gradient.

Syntax

Namespace: FlexCel.Core

public TExcelGradient Gradient { get; set; }

See also

  • TFlxFillPattern


TFlxOneBorder Structure | FlexCel Studio for the .NET Framework documentation

TFlxOneBorder Structure

Border style and color for one of the 4 sides of a cell.

Syntax

Namespace: FlexCel.Core

public struct TFlxOneBorder

Constructors

Name | Description
TFlxOneBorder | Initializes the structure to its default values.

Methods

Name | Description
Equals | Returns true when 2 borders are the same.
GetHashCode | Hash code for the border.

Properties

Name | Description
Style | Border style.
Color | Color of the border.


TFlxOneBorder.TFlxOneBorder Constructor | FlexCel Studio for the .NET Framework documentation

TFlxOneBorder.TFlxOneBorder Constructor

Initializes the structure to its default values.

Syntax

Namespace: FlexCel.Core

public TFlxOneBorder(TFlxBorderStyle aBorderStyle, TExcelColor aColor)

Parameters

<-> | Parameter | Type | Description
 | aBorderStyle | TFlxBorderStyle | See Style
 | aColor | TExcelColor | See Color

See also

  • TFlxOneBorder


TFlxOneBorder.Equals Method | FlexCel Studio for the .NET Framework documentation

TFlxOneBorder.Equals Method

Returns true when 2 borders are the same.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TFlxOneBorder


TFlxOneBorder.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TFlxOneBorder.GetHashCode Method

Hash code for the border.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TFlxOneBorder


TFlxOneBorder.Style Property | FlexCel Studio for the .NET Framework documentation

TFlxOneBorder.Style Property

Border style.

Syntax

Namespace: FlexCel.Core

public TFlxBorderStyle Style { get; set; }

See also

  • TFlxOneBorder


TFlxOneBorder.Color Property | FlexCel Studio for the .NET Framework documentation

TFlxOneBorder.Color Property

Color of the border.

Syntax

Namespace: FlexCel.Core

public TExcelColor Color { get; set; }

See also

  • TFlxOneBorder


TFlxPartialFormat Structure | FlexCel Studio for the .NET Framework documentation

TFlxPartialFormat Structure

This structure holds together the format definition for a cell, and which parts of that format definition should be applied. With this you can apply only parts of the format to a cell.

Syntax

Namespace: FlexCel.Core

public struct TFlxPartialFormat

Fields

Name | Description
Format | Format to apply to the cell.
Apply | Which properties to apply to the cell. For example you might apply only the numeric format defined by Format, but not the cell color.
ExternalBorders | If true and applying the format to a range of cells, only the borders on the outside of the range will be drawn.

Constructors

Name | Description
TFlxPartialFormat | Creates a new TFlxPartialFormat.


TFlxPartialFormat.Format Field | FlexCel Studio for the .NET Framework documentation

TFlxPartialFormat.Format Field

Format to apply to the cell.

Syntax

Namespace: FlexCel.Core

public readonly TFlxFormat Format

See also

  • TFlxPartialFormat


TFlxPartialFormat.Apply Field | FlexCel Studio for the .NET Framework documentation

TFlxPartialFormat.Apply Field

Which properties to apply to the cell. For example you might apply only the numeric format defined by Format, but not the cell color.

Syntax

Namespace: FlexCel.Core

public readonly TFlxApplyFormat Apply

See also

  • TFlxPartialFormat


TFlxPartialFormat.ExternalBorders Field | FlexCel Studio for the .NET Framework documentation

TFlxPartialFormat.ExternalBorders Field

If true and applying the format to a range of cells, only the borders on the outside of the range will be drawn.

Syntax

Namespace: FlexCel.Core

public readonly Boolean ExternalBorders

See also

  • TFlxPartialFormat


TFlxPartialFormat.TFlxPartialFormat Constructor | FlexCel Studio for the .NET Framework documentation

TFlxPartialFormat.TFlxPartialFormat Constructor

Creates a new TFlxPartialFormat.

Syntax

Namespace: FlexCel.Core

public TFlxPartialFormat(TFlxFormat aFormat, TFlxApplyFormat aApply, Boolean aExternalBorders)

Parameters

<-> | Parameter | Type | Description
 | aFormat | TFlxFormat |
 | aApply | TFlxApplyFormat |
 | aExternalBorders | Boolean |

See also

  • TFlxPartialFormat


TFormulaSpan Structure | FlexCel Studio for the .NET Framework documentation

TFormulaSpan Structure

This structure is used in formulas that span more than one cell, like some array formulas, or "what-if" table formulas.

Syntax

Namespace: FlexCel.Core

public struct TFormulaSpan

Constructors

Name | Description
TFormulaSpan | Creates a new TFormulaSpan and sets its values.

Methods

Name | Description
Equals | Returns true of the 2 FormulaSpans are the same.
GetHashCode | Returns the hashcode for this object.

Operators

Name | Description
Equality | This operator is overridden so you can compare this structure directly with ==
Inequality | This operator is overriden so you can compare this structure directly with !=

Properties

Name | Description
RowSpan | How many rows the formula will use.
ColSpan | How many columns the formula will use.
IsTopLeft | Indicates if this is the first formula of the array. Only the formula that is at the top left cell of the group will be used when setting a formula. Other formulas will be ignored, so you can copy formulas in a loop from one place to the other without worring if the cell is at the top left or not.
IsOneCell | Returns true if this formula spans over a single cell. (the most usual case)


TFormulaSpan.TFormulaSpan Constructor | FlexCel Studio for the .NET Framework documentation

TFormulaSpan.TFormulaSpan Constructor

Creates a new TFormulaSpan and sets its values.

Syntax

Namespace: FlexCel.Core

public TFormulaSpan(Int32 aRowSpan, Int32 aColSpan, Boolean aIsTopLeft)

Parameters

<-> | Parameter | Type | Description
 | aRowSpan | Int32 | How many rows the formula will use.
 | aColSpan | Int32 | How many columns the formula will use.
 | aIsTopLeft | Boolean | Indicates if this is the first formula of the array. Only the formula that is at the top left cell of the group will be used when setting a formula. Other formulas will be ignored, so you can copy formulas in a loop from one place to the other without worring if the cell is at the top left or not.

See also

  • TFormulaSpan


TFormulaSpan.Equals Method | FlexCel Studio for the .NET Framework documentation

TFormulaSpan.Equals Method

Returns true of the 2 FormulaSpans are the same.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TFormulaSpan


TFormulaSpan.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TFormulaSpan.GetHashCode Method

Returns the hashcode for this object.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TFormulaSpan


TFormulaSpan.Equality Operator | FlexCel Studio for the .NET Framework documentation

TFormulaSpan.Equality Operator

This operator is overridden so you can compare this structure directly with ==

Syntax

Namespace: FlexCel.Core

public static Boolean op_Equality(TFormulaSpan o1, TFormulaSpan o2)

Parameters

<-> | Parameter | Type | Description
 | o1 | TFormulaSpan |
 | o2 | TFormulaSpan |

See also

  • TFormulaSpan


TFormulaSpan.Inequality Operator | FlexCel Studio for the .NET Framework documentation

TFormulaSpan.Inequality Operator

This operator is overriden so you can compare this structure directly with !=

Syntax

Namespace: FlexCel.Core

public static Boolean op_Inequality(TFormulaSpan o1, TFormulaSpan o2)

Parameters

<-> | Parameter | Type | Description
 | o1 | TFormulaSpan |
 | o2 | TFormulaSpan |

See also

  • TFormulaSpan


TFormulaSpan.RowSpan Property | FlexCel Studio for the .NET Framework documentation

TFormulaSpan.RowSpan Property

How many rows the formula will use.

Syntax

Namespace: FlexCel.Core

public Int32 RowSpan { get; set; }

See also

  • TFormulaSpan


TFormulaSpan.ColSpan Property | FlexCel Studio for the .NET Framework documentation

TFormulaSpan.ColSpan Property

How many columns the formula will use.

Syntax

Namespace: FlexCel.Core

public Int32 ColSpan { get; set; }

See also

  • TFormulaSpan


TFormulaSpan.IsTopLeft Property | FlexCel Studio for the .NET Framework documentation

TFormulaSpan.IsTopLeft Property

Indicates if this is the first formula of the array. Only the formula that is at the top left cell of the group will be used when setting a formula. Other formulas will be ignored, so you can copy formulas in a loop from one place to the other without worring if the cell is at the top left or not.

Syntax

Namespace: FlexCel.Core

public Boolean IsTopLeft { get; set; }

See also

  • TFormulaSpan


TFormulaSpan.IsOneCell Property | FlexCel Studio for the .NET Framework documentation

TFormulaSpan.IsOneCell Property

Returns true if this formula spans over a single cell. (the most usual case)

Syntax

Namespace: FlexCel.Core

public Boolean IsOneCell { get; }

See also

  • TFormulaSpan


TGradientStop Structure | FlexCel Studio for the .NET Framework documentation

TGradientStop Structure

Represents one of the points in a Gradient definition for an Excel cell. Note that drawings (autoshapes, charts, etc) use a different Gradient definition: TDrawingGradientStop

Syntax

Namespace: FlexCel.Core

public struct TGradientStop

Constructors

Name | Description
TGradientStop | Creates a new Gradient stop.

Methods

Name | Description
CompareTo | Compares 2 instances of this struct.
Equals | Returns if this struct has the same values as other one.
GetHashCode | Returns the hashcode for this struct.

Operators

Name | Description
Equality | Returns true if both gradient stops are equal.
Inequality | Returns true if both gradient stops are different.
GreaterThan | Returns true if o1 is bigger than o2.
LessThan | Returns true if o1 is less than o2.

Properties

Name | Description
Position | This value must be between 0 and 1, and represents the position in the gradient where the Color in this structure is pure.
Color | Color for this definition.


TGradientStop.TGradientStop Constructor | FlexCel Studio for the .NET Framework documentation

TGradientStop.TGradientStop Constructor

Creates a new Gradient stop.

Syntax

Namespace: FlexCel.Core

public TGradientStop(Double aPosition, TExcelColor aColor)

Parameters

<-> | Parameter | Type | Description
 | aPosition | Double | Position for the stop.
 | aColor | TExcelColor | Color for the stop.

See also

  • TGradientStop


TGradientStop.CompareTo Method | FlexCel Studio for the .NET Framework documentation

TGradientStop.CompareTo Method

Compares 2 instances of this struct.

Syntax

Namespace: FlexCel.Core

public Int32 CompareTo(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TGradientStop


TGradientStop.Equals Method | FlexCel Studio for the .NET Framework documentation

TGradientStop.Equals Method

Returns if this struct has the same values as other one.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TGradientStop


TGradientStop.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TGradientStop.GetHashCode Method

Returns the hashcode for this struct.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TGradientStop


TGradientStop.Equality Operator | FlexCel Studio for the .NET Framework documentation

TGradientStop.Equality Operator

Returns true if both gradient stops are equal.

Syntax

Namespace: FlexCel.Core

public static Boolean op_Equality(TGradientStop o1, TGradientStop o2)

Parameters

<-> | Parameter | Type | Description
 | o1 | TGradientStop | First stop to compare.
 | o2 | TGradientStop | Second stop to compare.

See also

  • TGradientStop


TGradientStop.Inequality Operator | FlexCel Studio for the .NET Framework documentation

TGradientStop.Inequality Operator

Returns true if both gradient stops are different.

Syntax

Namespace: FlexCel.Core

public static Boolean op_Inequality(TGradientStop o1, TGradientStop o2)

Parameters

<-> | Parameter | Type | Description
 | o1 | TGradientStop | First stop to compare.
 | o2 | TGradientStop | Second stop to compare.

See also

  • TGradientStop


TGradientStop.GreaterThan Operator | FlexCel Studio for the .NET Framework documentation

TGradientStop.GreaterThan Operator

Returns true if o1 is bigger than o2.

Syntax

Namespace: FlexCel.Core

public static Boolean op_GreaterThan(TGradientStop o1, TGradientStop o2)

Parameters

<-> | Parameter | Type | Description
 | o1 | TGradientStop |
 | o2 | TGradientStop |

See also

  • TGradientStop


TGradientStop.LessThan Operator | FlexCel Studio for the .NET Framework documentation

TGradientStop.LessThan Operator

Returns true if o1 is less than o2.

Syntax

Namespace: FlexCel.Core

public static Boolean op_LessThan(TGradientStop o1, TGradientStop o2)

Parameters

<-> | Parameter | Type | Description
 | o1 | TGradientStop |
 | o2 | TGradientStop |

See also

  • TGradientStop


TGradientStop.Position Property | FlexCel Studio for the .NET Framework documentation

TGradientStop.Position Property

This value must be between 0 and 1, and represents the position in the gradient where the Color in this structure is pure.

Syntax

Namespace: FlexCel.Core

public Double Position { get; set; }

See also

  • TGradientStop


TGradientStop.Color Property | FlexCel Studio for the .NET Framework documentation

TGradientStop.Color Property

Color for this definition.

Syntax

Namespace: FlexCel.Core

public TExcelColor Color { get; set; }

See also

  • TGradientStop


THeaderAndFooter Structure | FlexCel Studio for the .NET Framework documentation

THeaderAndFooter Structure

Contains all information about headers and footers in an Excel sheet.

Syntax

Namespace: FlexCel.Core

public struct THeaderAndFooter

Methods

Name | Description
SetAllHeaders | Sets the headers for all the pages to a given string. Note that setting this value will set DiffEvenPages and DiffFirstPage to false. For a description of the possible values of this string, see ExcelFile.PageHeader
SetAllFooters | Sets the footers for all the pages to a given string. Note that setting this value will set DiffEvenPages and DiffFirstPage to false. For a description of the possible values of this string, see ExcelFile.PageHeader
GetHeader | Returns the header for a given page, considering if there are differences in even/odd pages or the first page.
GetFooter | Returns the footer for a given page, considering if there are differences in even/odd pages or the first page.
GetHeaderAnd​Footer​Kind | Returns the kind of footer image for a given page. This method is normally useful to get the correct image for a specific page.
Equals | Returns true if both objects are the same.
GetHashCode | Hashcode for the obeject.

Operators

Name | Description
Equality | Returns true if both structures are the same.
Inequality | Returns true if both structures are different.

Properties

Name | Description
DefaultHeader | Returns or sets the header for all pages that are not even or the first page. If DiffFirstPage is false, then this string also applies to the first page. If DiffEvenPages is false, this string also applies for even pages. For a description of the possible values of this string, see ExcelFile.PageHeader To set a header for all pages, use SetAllHeaders
DefaultFooter | Returns or sets the footer for all pages that are not even or the first page. If DiffFirstPage is false, then this string also applies to the first page. If DiffEvenPages is false, this string also applies for even pages. For a description of the possible values of this string, see ExcelFile.PageHeader To set a footer for all pages, use SetAllFooters
EvenHeader | Header for even pages. Note that this value is valid if and only if DiffEvenPages is true. For a description of the possible values of this string, see ExcelFile.PageHeader If you don't want a different header for even pages, set DiffEvenPages to false or call SetAllHeaders.
EvenFooter | Footer for even pages. Note that this value is valid if and only if DiffEvenPages is true. For a description of the possible values of this string, see ExcelFile.PageHeader If you don't want a different footer for even pages, set DiffEvenPages to false or call SetAllFooters.
FirstHeader | Header for the first page. Note that this value is valid if and only if DiffFirstPage is true. For a description of the possible values of this string, see ExcelFile.PageHeader If you don't want a different header for the first page, set DiffFirstPage to false or call SetAllHeaders.
FirstFooter | Footer for the first page.Note that this value is valid if and only if DiffFirstPage is true. For a description of the possible values of this string, see ExcelFile.PageHeader If you don't want a different footer for the first page, set DiffFirstPage to false or call SetAllFooters.
DiffFirstPage | When true the first page will have a different header and footer from the rest, and it will be specified in FirstHeader and FirstFooter. When false, FirstHeader and FirstFooter have no meaning.
DiffEvenPages | When true even pages will have different headers and footers from odd pages, and headers/footer for even pages will be specified in EvenHeader and EvenFooter. When false, EvenHeader and EvenFooter have no meaning.
ScaleWithDoc | Determines if to scale header and footer with document scaling or not.
AlignMargins | Align header footer margins with page margins. When true, as left/right margins grow and shrink, the header and footer edges stay aligned with the margins. When false, headers and footers are aligned on the paper edges, regardless of margins.


THeaderAndFooter.SetAllHeaders Method | FlexCel Studio for the .NET Framework documentation

THeaderAndFooter.SetAllHeaders Method

Sets the headers for all the pages to a given string. Note that setting this value will set DiffEvenPages and DiffFirstPage to false. For a description of the possible values of this string, see ExcelFile.PageHeader

Syntax

Namespace: FlexCel.Core

public void SetAllHeaders(String value)

Parameters

<-> | Parameter | Type | Description
 | value | String | String with the header.

See also

  • THeaderAndFooter


THeaderAndFooter.SetAllFooters Method | FlexCel Studio for the .NET Framework documentation

THeaderAndFooter.SetAllFooters Method

Sets the footers for all the pages to a given string. Note that setting this value will set DiffEvenPages and DiffFirstPage to false. For a description of the possible values of this string, see ExcelFile.PageHeader

Syntax

Namespace: FlexCel.Core

public void SetAllFooters(String value)

Parameters

<-> | Parameter | Type | Description
 | value | String | Sting with the footer.

See also

  • THeaderAndFooter


THeaderAndFooter.GetHeader Method | FlexCel Studio for the .NET Framework documentation

THeaderAndFooter.GetHeader Method

Returns the header for a given page, considering if there are differences in even/odd pages or the first page.

Syntax

Namespace: FlexCel.Core

public String GetHeader(Int32 currentPage)

Parameters

<-> | Parameter | Type | Description
 | currentPage | Int32 | Page for which you want the headers (1 based)

See also

  • THeaderAndFooter


THeaderAndFooter.GetFooter Method | FlexCel Studio for the .NET Framework documentation

THeaderAndFooter.GetFooter Method

Returns the footer for a given page, considering if there are differences in even/odd pages or the first page.

Syntax

Namespace: FlexCel.Core

public String GetFooter(Int32 currentPage)

Parameters

<-> | Parameter | Type | Description
 | currentPage | Int32 | Page for which you want the footers (1 based)

See also

  • THeaderAndFooter


THeaderAndFooter.GetHeaderAndFooterKind Method | FlexCel Studio for the .NET Framework documentation

THeaderAndFooter.GetHeaderAndFooterKind Method

Returns the kind of footer image for a given page. This method is normally useful to get the correct image for a specific page.

Syntax

Namespace: FlexCel.Core

public THeaderAndFooterKind GetHeaderAndFooterKind(Int32 currentPage)

Parameters

<-> | Parameter | Type | Description
 | currentPage | Int32 | Page for which you want the headers and footers (1 based)

See also

  • THeaderAndFooter


THeaderAndFooter.Equals Method | FlexCel Studio for the .NET Framework documentation

THeaderAndFooter.Equals Method

Returns true if both objects are the same.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • THeaderAndFooter


THeaderAndFooter.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

THeaderAndFooter.GetHashCode Method

Hashcode for the obeject.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • THeaderAndFooter


THeaderAndFooter.Equality Operator | FlexCel Studio for the .NET Framework documentation

THeaderAndFooter.Equality Operator

Returns true if both structures are the same.

Syntax

Namespace: FlexCel.Core

public static Boolean op_Equality(THeaderAndFooter o1, THeaderAndFooter o2)

Parameters

<-> | Parameter | Type | Description
 | o1 | THeaderAndFooter |
 | o2 | THeaderAndFooter |

See also

  • THeaderAndFooter


THeaderAndFooter.Inequality Operator | FlexCel Studio for the .NET Framework documentation

THeaderAndFooter.Inequality Operator

Returns true if both structures are different.

Syntax

Namespace: FlexCel.Core

public static Boolean op_Inequality(THeaderAndFooter o1, THeaderAndFooter o2)

Parameters

<-> | Parameter | Type | Description
 | o1 | THeaderAndFooter |
 | o2 | THeaderAndFooter |

See also

  • THeaderAndFooter


THeaderAndFooter.DefaultHeader Property | FlexCel Studio for the .NET Framework documentation

THeaderAndFooter.DefaultHeader Property

Returns or sets the header for all pages that are not even or the first page. If DiffFirstPage is false, then this string also applies to the first page. If DiffEvenPages is false, this string also applies for even pages. For a description of the possible values of this string, see ExcelFile.PageHeader To set a header for all pages, use SetAllHeaders

Syntax

Namespace: FlexCel.Core

public String DefaultHeader { get; set; }

See also

  • THeaderAndFooter


THeaderAndFooter.DefaultFooter Property | FlexCel Studio for the .NET Framework documentation

THeaderAndFooter.DefaultFooter Property

Returns or sets the footer for all pages that are not even or the first page. If DiffFirstPage is false, then this string also applies to the first page. If DiffEvenPages is false, this string also applies for even pages. For a description of the possible values of this string, see ExcelFile.PageHeader To set a footer for all pages, use SetAllFooters

Syntax

Namespace: FlexCel.Core

public String DefaultFooter { get; set; }

See also

  • THeaderAndFooter


THeaderAndFooter.EvenHeader Property | FlexCel Studio for the .NET Framework documentation

THeaderAndFooter.EvenHeader Property

Header for even pages. Note that this value is valid if and only if DiffEvenPages is true. For a description of the possible values of this string, see ExcelFile.PageHeader If you don't want a different header for even pages, set DiffEvenPages to false or call SetAllHeaders.

Syntax

Namespace: FlexCel.Core

public String EvenHeader { get; set; }

See also

  • THeaderAndFooter


THeaderAndFooter.EvenFooter Property | FlexCel Studio for the .NET Framework documentation

THeaderAndFooter.EvenFooter Property

Footer for even pages. Note that this value is valid if and only if DiffEvenPages is true. For a description of the possible values of this string, see ExcelFile.PageHeader If you don't want a different footer for even pages, set DiffEvenPages to false or call SetAllFooters.

Syntax

Namespace: FlexCel.Core

public String EvenFooter { get; set; }

See also

  • THeaderAndFooter


THeaderAndFooter.FirstHeader Property | FlexCel Studio for the .NET Framework documentation

THeaderAndFooter.FirstHeader Property

Header for the first page. Note that this value is valid if and only if DiffFirstPage is true. For a description of the possible values of this string, see ExcelFile.PageHeader If you don't want a different header for the first page, set DiffFirstPage to false or call SetAllHeaders.

Syntax

Namespace: FlexCel.Core

public String FirstHeader { get; set; }

See also

  • THeaderAndFooter


THeaderAndFooter.FirstFooter Property | FlexCel Studio for the .NET Framework documentation

THeaderAndFooter.FirstFooter Property

Footer for the first page.Note that this value is valid if and only if DiffFirstPage is true. For a description of the possible values of this string, see ExcelFile.PageHeader If you don't want a different footer for the first page, set DiffFirstPage to false or call SetAllFooters.

Syntax

Namespace: FlexCel.Core

public String FirstFooter { get; set; }

See also

  • THeaderAndFooter


THeaderAndFooter.DiffFirstPage Property | FlexCel Studio for the .NET Framework documentation

THeaderAndFooter.DiffFirstPage Property

When true the first page will have a different header and footer from the rest, and it will be specified in FirstHeader and FirstFooter. When false, FirstHeader and FirstFooter have no meaning.

Syntax

Namespace: FlexCel.Core

public Boolean DiffFirstPage { get; set; }

See also

  • THeaderAndFooter


THeaderAndFooter.DiffEvenPages Property | FlexCel Studio for the .NET Framework documentation

THeaderAndFooter.DiffEvenPages Property

When true even pages will have different headers and footers from odd pages, and headers/footer for even pages will be specified in EvenHeader and EvenFooter. When false, EvenHeader and EvenFooter have no meaning.

Syntax

Namespace: FlexCel.Core

public Boolean DiffEvenPages { get; set; }

See also

  • THeaderAndFooter


THeaderAndFooter.ScaleWithDoc Property | FlexCel Studio for the .NET Framework documentation

THeaderAndFooter.ScaleWithDoc Property

Determines if to scale header and footer with document scaling or not.

Syntax

Namespace: FlexCel.Core

public Boolean ScaleWithDoc { get; set; }

See also

  • THeaderAndFooter


THeaderAndFooter.AlignMargins Property | FlexCel Studio for the .NET Framework documentation

THeaderAndFooter.AlignMargins Property

Align header footer margins with page margins. When true, as left/right margins grow and shrink, the header and footer edges stay aligned with the margins. When false, headers and footers are aligned on the paper edges, regardless of margins.

Syntax

Namespace: FlexCel.Core

public Boolean AlignMargins { get; set; }

See also

  • THeaderAndFooter


THSLColor Structure | FlexCel Studio for the .NET Framework documentation

THSLColor Structure

Implements a simple representation of a color in Hue/Saturation/Lum colorspace.

Syntax

Namespace: FlexCel.Core

public struct THSLColor

Constructors

Name | Description
THSLColor | Overloaded THSLColor(TUIColor) THSLColor(Color) THSLColor(Double, Double, Double)

Methods

Name | Description
ToColor | Returns a system color from this instance. This method is only needed in Visual Basic, in C# you can just assign the HslColor to the Color:...[more]
ApplyTint | This method returns the brightness that results from applying tint to brightness.
GetTint | Returns the tint needed to go from originalBrightness to newBrightness. A tint of 0 means no change (OriginalBrightness == NewBrightness), a tint of -1 means NewBrightness = 0, and a tint of 1 means NewBrightness = 1. So this method just does a simple interpolation to find out the needed tint. This method is the inverse of ApplyTint
DistanceSquared | Returns the distance between 2 colors. Not that this is not the euclidean distance, but a distance calculated to improve Hue matching. When converting cell colors, we try to preserve hues, so even a very pale red cell will be converted to bright red and not white or a very pale blue. This make it different from standard color matching as is done when adjusting images to a color palette, and where hue is not as important as here.
Equals | Returns true if both colors are the same.
GetHashCode | Returns a hashcode for the color.
CompareTo | Returns -1 if obj is more than color, 0 if both colors are the same, and 1 if obj is less than color.

Operators

Name | Description
Implicit Conversion | Overloaded Implicit conversion from TUIColor to THSLColor Implicit conversion from THSLColor to TUIColor Implicit conversion from Color to THSLColor Implicit conversion from THSLColor to Color
Equality | Returns true if both colors are equal.
Inequality | Returns true if both colors do not have the same value.
GreaterThan | Returns true if o1 is bigger than o2.
LessThan | Returns true if o1 is less than o2.

Properties

Name | Description
Hue | Color hue. (between 0 and 360)
Sat | Color Saturation. (between 0 and 1)
Lum | Color brightness. (between 0 and 1)
R | Red component in the RGB space.
G | Green component in the RGB space.
B | Blue component in the RGB space.
Empty | Returns an empty color.


THSLColor.THSLColor Constructor | FlexCel Studio for the .NET Framework documentation

THSLColor.THSLColor Constructor

Overloads

  • THSLColor.THSLColor(TUIColor)
  • THSLColor.THSLColor(Color)
  • THSLColor.THSLColor(Double, Double, Double)

THSLColor.THSLColor(TUIColor)

Creates a new instance from a system color.

Syntax

Namespace: FlexCel.Core

public THSLColor(TUIColor rGBColor)

Parameters

<-> | Parameter | Type | Description
 | rGBColor | TUIColor |

See also

  • THSLColor

THSLColor.THSLColor(Color)

Creates a new instance from a system color.

Syntax

Namespace: FlexCel.Core

public THSLColor(Color rGBColor)

Parameters

<-> | Parameter | Type | Description
 | rGBColor | Color |

See also

  • THSLColor

THSLColor.THSLColor(Double, Double, Double)

Creates a Color from the hue, saturation and luminescence.

Syntax

Namespace: FlexCel.Core

public THSLColor(Double aHue, Double aSat, Double aLum)

Parameters

<-> | Parameter | Type | Description
 | aHue | Double | Hue for the color
 | aSat | Double | Saturation for the color.
 | aLum | Double | Luminescence for the color.

See also

  • THSLColor


THSLColor.ToColor Method | FlexCel Studio for the .NET Framework documentation

THSLColor.ToColor Method

Returns a system color from this instance. This method is only needed in Visual Basic, in C# you can just assign the HslColor to the Color:

    TUIColor myColor = hslColor;

Is the same as:

    TUIColor myColor = hslColor.ToColor();

Syntax

Namespace: FlexCel.Core

public TUIColor ToColor()

See also

  • THSLColor


THSLColor.ApplyTint Method | FlexCel Studio for the .NET Framework documentation

THSLColor.ApplyTint Method

This method returns the brightness that results from applying tint to brightness.

Syntax

Namespace: FlexCel.Core

public static Double ApplyTint(Double brightness, Double tint)

Parameters

<-> | Parameter | Type | Description
 | brightness | Double | Brightness of the color (between 0 and 1)
 | tint | Double | Tint of the color (between -1 and 1)

See also

  • THSLColor


THSLColor.GetTint Method | FlexCel Studio for the .NET Framework documentation

THSLColor.GetTint Method

Returns the tint needed to go from originalBrightness to newBrightness. A tint of 0 means no change (OriginalBrightness == NewBrightness), a tint of -1 means NewBrightness = 0, and a tint of 1 means NewBrightness = 1. So this method just does a simple interpolation to find out the needed tint.

This method is the inverse of ApplyTint

Syntax

Namespace: FlexCel.Core

public static Double GetTint(Double originalBrightness, Double newBrightness)

Parameters

<-> | Parameter | Type | Description
 | originalBrightness | Double | Brightness of the original color. (between 0 and 1)
 | newBrightness | Double | Brightness of the new color that we want to produce by applying tint to originalBrightness/>

Returns

The tint we need to apply to go from OriginalBrightness to NewBrigtness.

See also

  • THSLColor


THSLColor.DistanceSquared Method | FlexCel Studio for the .NET Framework documentation

THSLColor.DistanceSquared Method

Returns the distance between 2 colors. Not that this is not the euclidean distance, but a distance calculated to improve Hue matching. When converting cell colors, we try to preserve hues, so even a very pale red cell will be converted to bright red and not white or a very pale blue. This make it different from standard color matching as is done when adjusting images to a color palette, and where hue is not as important as here.

Syntax

Namespace: FlexCel.Core

public static Double DistanceSquared(Double hue1, Double sat1, Double hue2, Double sat2)

Parameters

<-> | Parameter | Type | Description
 | hue1 | Double |
 | sat1 | Double |
 | hue2 | Double |
 | sat2 | Double |

See also

  • THSLColor


THSLColor.Equals Method | FlexCel Studio for the .NET Framework documentation

THSLColor.Equals Method

Returns true if both colors are the same.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • THSLColor


THSLColor.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

THSLColor.GetHashCode Method

Returns a hashcode for the color.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • THSLColor


THSLColor.CompareTo Method | FlexCel Studio for the .NET Framework documentation

THSLColor.CompareTo Method

Returns -1 if obj is more than color, 0 if both colors are the same, and 1 if obj is less than color.

Syntax

Namespace: FlexCel.Core

public Int32 CompareTo(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • THSLColor


THSLColor Implicit Conversion Operator | FlexCel Studio for the .NET Framework documentation

THSLColor Implicit Conversion Operator

Overloads

  • Implicit conversion from TUIColor to THSLColor
  • Implicit conversion from THSLColor to TUIColor
  • Implicit conversion from Color to THSLColor
  • Implicit conversion from THSLColor to Color

Implicit conversion from TUIColor to THSLColor

Assigns a system color to this instance.

Syntax

Namespace: FlexCel.Core

public static THSLColor op_Implicit(TUIColor aColor)

Parameters

<-> | Parameter | Type | Description
 | aColor | TUIColor |

See also

  • THSLColor

Implicit conversion from THSLColor to TUIColor

Assigns this instance to a system color.

Syntax

Namespace: FlexCel.Core

public static TUIColor op_Implicit(THSLColor aColor)

Parameters

<-> | Parameter | Type | Description
 | aColor | THSLColor |

See also

  • THSLColor

Implicit conversion from Color to THSLColor

Assigns a system color to this instance.

Syntax

Namespace: FlexCel.Core

public static THSLColor op_Implicit(Color aColor)

Parameters

<-> | Parameter | Type | Description
 | aColor | Color |

See also

  • THSLColor

Implicit conversion from THSLColor to Color

Assigns this instance to a system color.

Syntax

Namespace: FlexCel.Core

public static Color op_Implicit(THSLColor aColor)

Parameters

<-> | Parameter | Type | Description
 | aColor | THSLColor |

See also

  • THSLColor


THSLColor.Equality Operator | FlexCel Studio for the .NET Framework documentation

THSLColor.Equality Operator

Returns true if both colors are equal.

Syntax

Namespace: FlexCel.Core

public static Boolean op_Equality(THSLColor o1, THSLColor o2)

Parameters

<-> | Parameter | Type | Description
 | o1 | THSLColor | First color to compare.
 | o2 | THSLColor | Second color to compare.

See also

  • THSLColor


THSLColor.Inequality Operator | FlexCel Studio for the .NET Framework documentation

THSLColor.Inequality Operator

Returns true if both colors do not have the same value.

Syntax

Namespace: FlexCel.Core

public static Boolean op_Inequality(THSLColor o1, THSLColor o2)

Parameters

<-> | Parameter | Type | Description
 | o1 | THSLColor | First color to compare.
 | o2 | THSLColor | Second color to compare.

See also

  • THSLColor


THSLColor.GreaterThan Operator | FlexCel Studio for the .NET Framework documentation

THSLColor.GreaterThan Operator

Returns true if o1 is bigger than o2.

Syntax

Namespace: FlexCel.Core

public static Boolean op_GreaterThan(THSLColor o1, THSLColor o2)

Parameters

<-> | Parameter | Type | Description
 | o1 | THSLColor |
 | o2 | THSLColor |

See also

  • THSLColor


THSLColor.LessThan Operator | FlexCel Studio for the .NET Framework documentation

THSLColor.LessThan Operator

Returns true if o1 is less than o2.

Syntax

Namespace: FlexCel.Core

public static Boolean op_LessThan(THSLColor o1, THSLColor o2)

Parameters

<-> | Parameter | Type | Description
 | o1 | THSLColor |
 | o2 | THSLColor |

See also

  • THSLColor


THSLColor.Hue Property | FlexCel Studio for the .NET Framework documentation

THSLColor.Hue Property

Color hue. (between 0 and 360)

Syntax

Namespace: FlexCel.Core

public Double Hue { get; }

See also

  • THSLColor


THSLColor.Sat Property | FlexCel Studio for the .NET Framework documentation

THSLColor.Sat Property

Color Saturation. (between 0 and 1)

Syntax

Namespace: FlexCel.Core

public Double Sat { get; }

See also

  • THSLColor


THSLColor.Lum Property | FlexCel Studio for the .NET Framework documentation

THSLColor.Lum Property

Color brightness. (between 0 and 1)

Syntax

Namespace: FlexCel.Core

public Double Lum { get; }

See also

  • THSLColor


THSLColor.R Property | FlexCel Studio for the .NET Framework documentation

THSLColor.R Property

Red component in the RGB space.

Syntax

Namespace: FlexCel.Core

public Byte R { get; }

See also

  • THSLColor


THSLColor.G Property | FlexCel Studio for the .NET Framework documentation

THSLColor.G Property

Green component in the RGB space.

Syntax

Namespace: FlexCel.Core

public Byte G { get; }

See also

  • THSLColor


THSLColor.B Property | FlexCel Studio for the .NET Framework documentation

THSLColor.B Property

Blue component in the RGB space.

Syntax

Namespace: FlexCel.Core

public Byte B { get; }

See also

  • THSLColor


THSLColor.Empty Property | FlexCel Studio for the .NET Framework documentation

THSLColor.Empty Property

Returns an empty color.

Syntax

Namespace: FlexCel.Core

public static THSLColor Empty { get; }

See also

  • THSLColor


THtmlFixes Structure | FlexCel Studio for the .NET Framework documentation

THtmlFixes Structure

Defines special fixes to the generated files to workaround browser bugs.

Syntax

Namespace: FlexCel.Core

public struct THtmlFixes

Methods

Name | Description
Equals | True if both objects are equal.
GetHashCode | Hash code for the struct.

Properties

Name | Description
IE6Transparent​PngSupport | By default, Internet explorer does not support transparent PNGs. Normally this is not an issue, since Excel does not use much transparency. But if you rely on transparent images and don't want to use gif images instead of png, you can set this property to true. It will add special code to the HTML file to support transparent images in IE6.
Outlook2007Css​Support | Outlook 2007 renders HTML worse than previous versions, since it switched to the Word 2007 rendering engine instead of Internet Explorer to show HTML emails. If you apply this fix, some code will be added to the generated HTML file to improve the display in Outlook 2007. Other browsers will not be affected and will still render the original file. Turn this option on if you plan to email the generated file as an HTML email or to edit them in Word 2007. Note that the pages will not validate with the w3c validator if this option is on.
WordWrapSupport | Some older browsers (and Word 2007) might not support the CSS white-space tag. In this case, if a line longer than a cell cannot be expanded to the right (because there is data in the next cell) it will wrap down instead of being cropped. This fix will cut the text on this cell to the displayable characters. If a letter was displayed by the half on the right, after applying this fix it will not display. This fix is automatically applied when Outlook2007Css​Support ...[more]


THtmlFixes.Equals Method | FlexCel Studio for the .NET Framework documentation

THtmlFixes.Equals Method

True if both objects are equal.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • THtmlFixes


THtmlFixes.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

THtmlFixes.GetHashCode Method

Hash code for the struct.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • THtmlFixes


THtmlFixes.IE6TransparentPngSupport Property | FlexCel Studio for the .NET Framework documentation

THtmlFixes.IE6TransparentPngSupport Property

By default, Internet explorer does not support transparent PNGs. Normally this is not an issue, since Excel does not use much transparency. But if you rely on transparent images and don't want to use gif images instead of png, you can set this property to true. It will add special code to the HTML file to support transparent images in IE6.

Syntax

Namespace: FlexCel.Core

public Boolean IE6TransparentPngSupport { get; set; }

See also

  • THtmlFixes


THtmlFixes.Outlook2007CssSupport Property | FlexCel Studio for the .NET Framework documentation

THtmlFixes.Outlook2007CssSupport Property

Outlook 2007 renders HTML worse than previous versions, since it switched to the Word 2007 rendering engine instead of Internet Explorer to show HTML emails. If you apply this fix, some code will be added to the generated HTML file to improve the display in Outlook 2007. Other browsers will not be affected and will still render the original file. Turn this option on if you plan to email the generated file as an HTML email or to edit them in Word 2007. Note that the pages will not validate with the w3c validator if this option is on.

Syntax

Namespace: FlexCel.Core

public Boolean Outlook2007CssSupport { get; set; }

See also

  • THtmlFixes


THtmlFixes.WordWrapSupport Property | FlexCel Studio for the .NET Framework documentation

THtmlFixes.WordWrapSupport Property

Some older browsers (and Word 2007) might not support the CSS white-space tag. In this case, if a line longer than a cell cannot be expanded to the right (because there is data in the next cell) it will wrap down instead of being cropped. This fix will cut the text on this cell to the displayable characters. If a letter was displayed by the half on the right, after applying this fix it will not display. This fix is automatically applied when Outlook2007CssSupport is selected, so there is normally no reason to apply it. You might get a smaller file with this fix (if you have a lot of hidden text), but the display will not be as accurate as when it is off, so it is recommended to keep it off.

Syntax

Namespace: FlexCel.Core

public Boolean WordWrapSupport { get; set; }

See also

  • THtmlFixes


TLabColor Structure | FlexCel Studio for the .NET Framework documentation

TLabColor Structure

Implements a simple representation of a color in CIE-L*a*b* colorspace. This colorspace is mostly used for finding distances between colors.

Syntax

Namespace: FlexCel.Core

public struct TLabColor

Constructors

Name | Description
TLabColor | Overloaded TLabColor(TUIColor) TLabColor(Color)

Methods

Name | Description
ToColor | Returns a system color from this instance. This method is only needed in Visual Basic, in C# you can just assign the LabColor to the Color:...[more]
DistanceSquared | Returns the euclidean distance squared (DeltaE CIE 1976 squared) between this color and other color.
CMCSquared | Returns the CMC color distance between this color and color2 (distance returned is squared, so you need to get the sqrt if you want the real CMC value). Note that CMC is not symmetric (​Color1.​CMC(​Color2) != Color2.​CMC(​Color1)​, so this color is the one used as reference.
Equals | Returns true if both colors are the same.
GetHashCode | Returns a hashcode for the color.
CompareTo | Returns -1 if obj is more than color, 0 if both colors are the same, and 1 if obj is less than color.

Operators

Name | Description
Implicit Conversion | Overloaded Implicit conversion from TUIColor to TLabColor Implicit conversion from TLabColor to TUIColor Implicit conversion from Color to TLabColor Implicit conversion from TLabColor to Color
Equality | Returns true if both colors are equal.
Inequality | Returns true if both colors do not have the same value.
GreaterThan | Returns true if o1 is bigger than o2.
LessThan | Returns true if o1 is less than o2.

Properties

Name | Description
L0 | L* (Lightness) (Between 0 and 100)
a0 | a* component.
b0 | b* component.
R | Red component in the RGB space.
G | Green component in the RGB space.
B | Blue component in the RGB space.


TLabColor.TLabColor Constructor | FlexCel Studio for the .NET Framework documentation

TLabColor.TLabColor Constructor

Overloads

  • TLabColor.TLabColor(TUIColor)
  • TLabColor.TLabColor(Color)

TLabColor.TLabColor(TUIColor)

Creates a new instance from a system color.

Syntax

Namespace: FlexCel.Core

public TLabColor(TUIColor rGBColor)

Parameters

<-> | Parameter | Type | Description
 | rGBColor | TUIColor |

See also

  • TLabColor

TLabColor.TLabColor(Color)

Creates a new instance from a system color.

Syntax

Namespace: FlexCel.Core

public TLabColor(Color rGBColor)

Parameters

<-> | Parameter | Type | Description
 | rGBColor | Color |

See also

  • TLabColor


TLabColor.ToColor Method | FlexCel Studio for the .NET Framework documentation

TLabColor.ToColor Method

Returns a system color from this instance. This method is only needed in Visual Basic, in C# you can just assign the LabColor to the Color:

    TUIColor myColor = labColor;

Is the same as:

    TUIColor myColor = labColor.ToColor();

Syntax

Namespace: FlexCel.Core

public TUIColor ToColor()

See also

  • TLabColor


TLabColor.DistanceSquared Method | FlexCel Studio for the .NET Framework documentation

TLabColor.DistanceSquared Method

Returns the euclidean distance squared (DeltaE CIE 1976 squared) between this color and other color.

Syntax

Namespace: FlexCel.Core

public Double DistanceSquared(TLabColor Color2)

Parameters

<-> | Parameter | Type | Description
 | Color2 | TLabColor |

See also

  • TLabColor


TLabColor.CMCSquared Method | FlexCel Studio for the .NET Framework documentation

TLabColor.CMCSquared Method

Returns the CMC color distance between this color and color2 (distance returned is squared, so you need to get the sqrt if you want the real CMC value). Note that CMC is not symmetric (Color1.CMC(Color2) != Color2.CMC(Color1), so this color is the one used as reference.

Syntax

Namespace: FlexCel.Core

public Double CMCSquared(TLabColor Color2, Int32 l, Int32 c)

Parameters

<-> | Parameter | Type | Description
 | Color2 | TLabColor | Color that will be compared against this reference.
 | l | Int32 | L parameter for CMC calculation. For acceptability (CMC2:1) this is normally 2, and for perceptibility (CMC1:1) this should be 1.
 | c | Int32 | C parameter for CMC calculation. This is normally 1.

See also

  • TLabColor


TLabColor.Equals Method | FlexCel Studio for the .NET Framework documentation

TLabColor.Equals Method

Returns true if both colors are the same.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TLabColor


TLabColor.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TLabColor.GetHashCode Method

Returns a hashcode for the color.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TLabColor


TLabColor.CompareTo Method | FlexCel Studio for the .NET Framework documentation

TLabColor.CompareTo Method

Returns -1 if obj is more than color, 0 if both colors are the same, and 1 if obj is less than color.

Syntax

Namespace: FlexCel.Core

public Int32 CompareTo(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TLabColor


TLabColor Implicit Conversion Operator | FlexCel Studio for the .NET Framework documentation

TLabColor Implicit Conversion Operator

Overloads

  • Implicit conversion from TUIColor to TLabColor
  • Implicit conversion from TLabColor to TUIColor
  • Implicit conversion from Color to TLabColor
  • Implicit conversion from TLabColor to Color

Implicit conversion from TUIColor to TLabColor

Assigns a system color to this instance.

Syntax

Namespace: FlexCel.Core

public static TLabColor op_Implicit(TUIColor aColor)

Parameters

<-> | Parameter | Type | Description
 | aColor | TUIColor |

See also

  • TLabColor

Implicit conversion from TLabColor to TUIColor

Assigns this instance to a system color.

Syntax

Namespace: FlexCel.Core

public static TUIColor op_Implicit(TLabColor aColor)

Parameters

<-> | Parameter | Type | Description
 | aColor | TLabColor |

See also

  • TLabColor

Implicit conversion from Color to TLabColor

Assigns a system color to this instance.

Syntax

Namespace: FlexCel.Core

public static TLabColor op_Implicit(Color aColor)

Parameters

<-> | Parameter | Type | Description
 | aColor | Color |

See also

  • TLabColor

Implicit conversion from TLabColor to Color

Assigns this instance to a system color.

Syntax

Namespace: FlexCel.Core

public static Color op_Implicit(TLabColor aColor)

Parameters

<-> | Parameter | Type | Description
 | aColor | TLabColor |

See also

  • TLabColor


TLabColor.Equality Operator | FlexCel Studio for the .NET Framework documentation

TLabColor.Equality Operator

Returns true if both colors are equal.

Syntax

Namespace: FlexCel.Core

public static Boolean op_Equality(TLabColor o1, TLabColor o2)

Parameters

<-> | Parameter | Type | Description
 | o1 | TLabColor | First color to compare.
 | o2 | TLabColor | Second color to compare.

See also

  • TLabColor


TLabColor.Inequality Operator | FlexCel Studio for the .NET Framework documentation

TLabColor.Inequality Operator

Returns true if both colors do not have the same value.

Syntax

Namespace: FlexCel.Core

public static Boolean op_Inequality(TLabColor o1, TLabColor o2)

Parameters

<-> | Parameter | Type | Description
 | o1 | TLabColor | First color to compare.
 | o2 | TLabColor | Second color to compare.

See also

  • TLabColor


TLabColor.GreaterThan Operator | FlexCel Studio for the .NET Framework documentation

TLabColor.GreaterThan Operator

Returns true if o1 is bigger than o2.

Syntax

Namespace: FlexCel.Core

public static Boolean op_GreaterThan(TLabColor o1, TLabColor o2)

Parameters

<-> | Parameter | Type | Description
 | o1 | TLabColor |
 | o2 | TLabColor |

See also

  • TLabColor


TLabColor.LessThan Operator | FlexCel Studio for the .NET Framework documentation

TLabColor.LessThan Operator

Returns true if o1 is less than o2.

Syntax

Namespace: FlexCel.Core

public static Boolean op_LessThan(TLabColor o1, TLabColor o2)

Parameters

<-> | Parameter | Type | Description
 | o1 | TLabColor |
 | o2 | TLabColor |

See also

  • TLabColor


TLabColor.L0 Property | FlexCel Studio for the .NET Framework documentation

TLabColor.L0 Property

L* (Lightness) (Between 0 and 100)

Syntax

Namespace: FlexCel.Core

public Double L0 { get; }

See also

  • TLabColor


TLabColor.a0 Property | FlexCel Studio for the .NET Framework documentation

TLabColor.a0 Property

a* component.

Syntax

Namespace: FlexCel.Core

public Double a0 { get; }

See also

  • TLabColor


TLabColor.b0 Property | FlexCel Studio for the .NET Framework documentation

TLabColor.b0 Property

b* component.

Syntax

Namespace: FlexCel.Core

public Double b0 { get; }

See also

  • TLabColor


TLabColor.R Property | FlexCel Studio for the .NET Framework documentation

TLabColor.R Property

Red component in the RGB space.

Syntax

Namespace: FlexCel.Core

public Byte R { get; }

See also

  • TLabColor


TLabColor.G Property | FlexCel Studio for the .NET Framework documentation

TLabColor.G Property

Green component in the RGB space.

Syntax

Namespace: FlexCel.Core

public Byte G { get; }

See also

  • TLabColor


TLabColor.B Property | FlexCel Studio for the .NET Framework documentation

TLabColor.B Property

Blue component in the RGB space.

Syntax

Namespace: FlexCel.Core

public Byte B { get; }

See also

  • TLabColor


TLineArrow Structure | FlexCel Studio for the .NET Framework documentation

TLineArrow Structure

Describes an arrow at the end of a line. This struct is immutable.

Syntax

Namespace: FlexCel.Core

public struct TLineArrow

Constructors

Name | Description
TLineArrow | Creates a new arrow.

Methods

Name | Description
CompareTo | Returns -1, 0 or 1 depending if the objects is smaller, equal or bigger than the other.

Properties

Name | Description
Style | Style of the arrow.
Len | Length of the arrow.
Width | Width of the arrow.
None | Returns a shared instance with no arrow.


TLineArrow.TLineArrow Constructor | FlexCel Studio for the .NET Framework documentation

TLineArrow.TLineArrow Constructor

Creates a new arrow.

Syntax

Namespace: FlexCel.Core

public TLineArrow(TArrowStyle aStyle, TArrowLen aLen, TArrowWidth aWidth)

Parameters

<-> | Parameter | Type | Description
 | aStyle | TArrowStyle | Style of the arrow.
 | aLen | TArrowLen | Length of the arrow.
 | aWidth | TArrowWidth | Width of the arrow.

See also

  • TLineArrow


TLineArrow.CompareTo Method | FlexCel Studio for the .NET Framework documentation

TLineArrow.CompareTo Method

Returns -1, 0 or 1 depending if the objects is smaller, equal or bigger than the other.

Syntax

Namespace: FlexCel.Core

public Int32 CompareTo(TLineArrow obj)

Parameters

<-> | Parameter | Type | Description
 | obj | TLineArrow |

See also

  • TLineArrow


TLineArrow.Style Property | FlexCel Studio for the .NET Framework documentation

TLineArrow.Style Property

Style of the arrow.

Syntax

Namespace: FlexCel.Core

public TArrowStyle Style { get; }

See also

  • TLineArrow


TLineArrow.Len Property | FlexCel Studio for the .NET Framework documentation

TLineArrow.Len Property

Length of the arrow.

Syntax

Namespace: FlexCel.Core

public TArrowLen Len { get; }

See also

  • TLineArrow


TLineArrow.Width Property | FlexCel Studio for the .NET Framework documentation

TLineArrow.Width Property

Width of the arrow.

Syntax

Namespace: FlexCel.Core

public TArrowWidth Width { get; }

See also

  • TLineArrow


TLineArrow.None Property | FlexCel Studio for the .NET Framework documentation

TLineArrow.None Property

Returns a shared instance with no arrow.

Syntax

Namespace: FlexCel.Core

public static TLineArrow None { get; }

See also

  • TLineArrow


TLoopOverUsedRangeParameters Structure | FlexCel Studio for the .NET Framework documentation

TLoopOverUsedRangeParameters Structure

This structure contains the parameters passed in ExcelFile.LoopOverUsedRange

Syntax

Namespace: FlexCel.Core

public struct TLoopOverUsedRangeParameters

Constructors

Name | Description
TLoopOverUsed​Range​Parameters | Creates a new structure with the given parameters.

Properties

Name | Description
Row | Row where the value is (1-based).
Col | Column where the value is (1-based).
Value | Value of the cell at (Row, Column).


TLoopOverUsedRangeParameters.TLoopOverUsedRangeParameters Constructor | FlexCel Studio for the .NET Framework documentation

TLoopOverUsedRangeParameters.TLoopOverUsedRangeParameters Constructor

Creates a new structure with the given parameters.

Syntax

Namespace: FlexCel.Core

public TLoopOverUsedRangeParameters(Int32 aRow, Int32 aCol, Object aValue)

Parameters

<-> | Parameter | Type | Description
 | aRow | Int32 | Row where the value is. (1-based).
 | aCol | Int32 | Column where the value is. (1-based).
 | aValue | Object | Value of the cell at (Row, Column).

See also

  • TLoopOverUsedRangeParameters


TLoopOverUsedRangeParameters.Row Property | FlexCel Studio for the .NET Framework documentation

TLoopOverUsedRangeParameters.Row Property

Row where the value is (1-based).

Syntax

Namespace: FlexCel.Core

public Int32 Row { get; }

See also

  • TLoopOverUsedRangeParameters


TLoopOverUsedRangeParameters.Col Property | FlexCel Studio for the .NET Framework documentation

TLoopOverUsedRangeParameters.Col Property

Column where the value is (1-based).

Syntax

Namespace: FlexCel.Core

public Int32 Col { get; }

See also

  • TLoopOverUsedRangeParameters


TLoopOverUsedRangeParameters.Value Property | FlexCel Studio for the .NET Framework documentation

TLoopOverUsedRangeParameters.Value Property

Value of the cell at (Row, Column).

Syntax

Namespace: FlexCel.Core

public Object Value { get; }

See also

  • TLoopOverUsedRangeParameters


TPoint Structure | FlexCel Studio for the .NET Framework documentation

TPoint Structure

Represents a point on X,Y coordinates. We used instead of System.Drawing.Point because we do not want references to System.Drawing (because .NET 3.0 applications do not need GDI+)

Syntax

Namespace: FlexCel.Core

public struct TPoint

Constructors

Name | Description
TPoint | Creates a new point.

Methods

Name | Description
Equals | True if both objects are equal.
GetHashCode | Hash code for the point.

Operators

Name | Description
Implicit Conversion | Overloaded Implicit conversion from TPoint to Point Implicit conversion from Point to TPoint

Properties

Name | Description
X | X coord.
Y | Y coord.


TPoint.TPoint Constructor | FlexCel Studio for the .NET Framework documentation

TPoint.TPoint Constructor

Creates a new point.

Syntax

Namespace: FlexCel.Core

public TPoint(Int32 aX, Int32 aY)

Parameters

<-> | Parameter | Type | Description
 | aX | Int32 | Coordinates for the X value.
 | aY | Int32 | Coordinates for the Y value.

See also

  • TPoint


TPoint.Equals Method | FlexCel Studio for the .NET Framework documentation

TPoint.Equals Method

True if both objects are equal.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TPoint


TPoint.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TPoint.GetHashCode Method

Hash code for the point.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TPoint


TPoint Implicit Conversion Operator | FlexCel Studio for the .NET Framework documentation

TPoint Implicit Conversion Operator

Overloads

  • Implicit conversion from TPoint to Point
  • Implicit conversion from Point to TPoint

Implicit conversion from TPoint to Point

Converts implicitly between a System.Drawing.Point and a TPoint

Syntax

Namespace: FlexCel.Core

public static Point op_Implicit(TPoint pt)

Parameters

<-> | Parameter | Type | Description
 | pt | TPoint |

See also

  • TPoint

Implicit conversion from Point to TPoint

Converts implicitly between a System.Drawing.Point and a TPoint

Syntax

Namespace: FlexCel.Core

public static TPoint op_Implicit(Point pt)

Parameters

<-> | Parameter | Type | Description
 | pt | Point |

See also

  • TPoint


TPoint.X Property | FlexCel Studio for the .NET Framework documentation

TPoint.X Property

X coord.

Syntax

Namespace: FlexCel.Core

public Int32 X { get; set; }

See also

  • TPoint


TPoint.Y Property | FlexCel Studio for the .NET Framework documentation

TPoint.Y Property

Y coord.

Syntax

Namespace: FlexCel.Core

public Int32 Y { get; set; }

See also

  • TPoint


TPointF Structure | FlexCel Studio for the .NET Framework documentation

TPointF Structure

Platform independent point

Syntax

Namespace: FlexCel.Core

public struct TPointF

Constructors

Name | Description
TPointF | Creates a new Point.

Methods

Name | Description
Equals | True if both objects are equal.
GetHashCode | Hash code for the point.
ToString | String with both coordinates.

Operators

Name | Description
Implicit Conversion | Overloaded Implicit conversion from TPointF to PointF Implicit conversion from PointF to TPointF

Properties

Name | Description
Empty | Returns a TPointF with X = 0 and Y = 0.
X | X coord.
Y | Y coord.


TPointF.TPointF Constructor | FlexCel Studio for the .NET Framework documentation

TPointF.TPointF Constructor

Creates a new Point.

Syntax

Namespace: FlexCel.Core

public TPointF(Double aX, Double aY)

Parameters

<-> | Parameter | Type | Description
 | aX | Double | X coord.
 | aY | Double | Y coord.

See also

  • TPointF


TPointF.Equals Method | FlexCel Studio for the .NET Framework documentation

TPointF.Equals Method

True if both objects are equal.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TPointF


TPointF.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TPointF.GetHashCode Method

Hash code for the point.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TPointF


TPointF.ToString Method | FlexCel Studio for the .NET Framework documentation

TPointF.ToString Method

String with both coordinates.

Syntax

Namespace: FlexCel.Core

public override String ToString()

See also

  • TPointF


TPointF Implicit Conversion Operator | FlexCel Studio for the .NET Framework documentation

TPointF Implicit Conversion Operator

Overloads

  • Implicit conversion from TPointF to PointF
  • Implicit conversion from PointF to TPointF

Implicit conversion from TPointF to PointF

Converts between a PointF and a TPointF

Syntax

Namespace: FlexCel.Core

public static PointF op_Implicit(TPointF p)

Parameters

<-> | Parameter | Type | Description
 | p | TPointF |

See also

  • TPointF

Implicit conversion from PointF to TPointF

Converts between a System.Drawing.PointF and a TPointF

Syntax

Namespace: FlexCel.Core

public static TPointF op_Implicit(PointF p)

Parameters

<-> | Parameter | Type | Description
 | p | PointF |

See also

  • TPointF


TPointF.Empty Property | FlexCel Studio for the .NET Framework documentation

TPointF.Empty Property

Returns a TPointF with X = 0 and Y = 0.

Syntax

Namespace: FlexCel.Core

public static TPointF Empty { get; }

See also

  • TPointF


TPointF.X Property | FlexCel Studio for the .NET Framework documentation

TPointF.X Property

X coord.

Syntax

Namespace: FlexCel.Core

public Double X { get; set; }

See also

  • TPointF


TPointF.Y Property | FlexCel Studio for the .NET Framework documentation

TPointF.Y Property

Y coord.

Syntax

Namespace: FlexCel.Core

public Double Y { get; set; }

See also

  • TPointF


TRTFRun Structure | FlexCel Studio for the .NET Framework documentation

TRTFRun Structure

One RTF run for the text in a cell. FirstChar is the first (base 0) character to apply the format, and FontIndex is the font index for the text

Syntax

Namespace: FlexCel.Core

public struct TRTFRun

Fields

Name | Description
FirstChar | First character on the string where we will apply the font. (0 based)
FontIndex | Font index for this string part.

Constructors

Name | Description
TRTFRun | Creates an RTFRun with the given values.

Methods

Name | Description
ToByteArray | Converts a TRTFRun array into a byte array for serialization.
ToRTFRunArray | Converts a byte array into a TRTFRun array for serialization.
Equals | Determines whether two TRTFRun instances are equal.
GetHashCode | Gets a hashcode for the TRTFRun instance.

Operators

Name | Description
Equality | Determines whether two TRTFRun instances are equal. To be considered equal, they must have the same text and the same formatting. That is, fontindex and firstchar must be equal.
Inequality | Determines whether two TRTFRun instances are different. To be considered equal, they must have the same text and the same formatting. That is, fontindex and firstchar must be equal.


TRTFRun.FirstChar Field | FlexCel Studio for the .NET Framework documentation

TRTFRun.FirstChar Field

First character on the string where we will apply the font. (0 based)

Syntax

Namespace: FlexCel.Core

public Int32 FirstChar

See also

  • TRTFRun


TRTFRun.FontIndex Field | FlexCel Studio for the .NET Framework documentation

TRTFRun.FontIndex Field

Font index for this string part.

Syntax

Namespace: FlexCel.Core

public Int32 FontIndex

See also

  • TRTFRun


TRTFRun.TRTFRun Constructor | FlexCel Studio for the .NET Framework documentation

TRTFRun.TRTFRun Constructor

Creates an RTFRun with the given values.

Syntax

Namespace: FlexCel.Core

public TRTFRun(Int32 aFirstChar, Int32 aFontIndex)

Parameters

<-> | Parameter | Type | Description
 | aFirstChar | Int32 | First character (0 based).
 | aFontIndex | Int32 | Font index.

See also

  • TRTFRun


TRTFRun.ToByteArray Method | FlexCel Studio for the .NET Framework documentation

TRTFRun.ToByteArray Method

Converts a TRTFRun array into a byte array for serialization.

Syntax

Namespace: FlexCel.Core

public static Byte[] ToByteArray(TRTFRun[] runs)

Parameters

<-> | Parameter | Type | Description
 | runs | TRTFRun[] | TRTFRun array

Returns

Serialized byte array

See also

  • TRTFRun


TRTFRun.ToRTFRunArray Method | FlexCel Studio for the .NET Framework documentation

TRTFRun.ToRTFRunArray Method

Converts a byte array into a TRTFRun array for serialization.

Syntax

Namespace: FlexCel.Core

public static TRTFRun[] ToRTFRunArray(Byte[] runs)

Parameters

<-> | Parameter | Type | Description
 | runs | Byte[] | Serialized byte array

Returns

TRTFRun array

See also

  • TRTFRun


TRTFRun.Equals Method | FlexCel Studio for the .NET Framework documentation

TRTFRun.Equals Method

Determines whether two TRTFRun instances are equal.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object | The Object to compare with the current TRTFRun.

Returns

true if the specified Object is equal to the current TRTFRun; otherwise, false.

See also

  • TRTFRun


TRTFRun.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TRTFRun.GetHashCode Method

Gets a hashcode for the TRTFRun instance.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TRTFRun


TRTFRun.Equality Operator | FlexCel Studio for the .NET Framework documentation

TRTFRun.Equality Operator

Determines whether two TRTFRun instances are equal. To be considered equal, they must have the same text and the same formatting. That is, fontindex and firstchar must be equal.

Remarks

Note that 2 TRTFRuns of different files might be equal but refer to different formatting, because FontIndex might point to different fonts.

Syntax

Namespace: FlexCel.Core

public static Boolean op_Equality(TRTFRun b1, TRTFRun b2)

Parameters

<-> | Parameter | Type | Description
 | b1 | TRTFRun | First TRTFRun instance to compare.
 | b2 | TRTFRun | Second TRTFRun instance to compare.

Returns

true if both objects have the same text and the same formatting.

See also

  • TRTFRun


TRTFRun.Inequality Operator | FlexCel Studio for the .NET Framework documentation

TRTFRun.Inequality Operator

Determines whether two TRTFRun instances are different. To be considered equal, they must have the same text and the same formatting. That is, fontindex and firstchar must be equal.

Remarks

Note that 2 TRTFRuns of different files might be equal but refer to different formatting, because FontIndex might point to different fonts.

Syntax

Namespace: FlexCel.Core

public static Boolean op_Inequality(TRTFRun b1, TRTFRun b2)

Parameters

<-> | Parameter | Type | Description
 | b1 | TRTFRun | First TRTFRun instance to compare.
 | b2 | TRTFRun | Second TRTFRun instance to compare.

See also

  • TRTFRun


TScRGBColor Structure | FlexCel Studio for the .NET Framework documentation

TScRGBColor Structure

Implements a simple representation of a color in scRGB colorspace. Components are doubles going from 0 to 1.

Syntax

Namespace: FlexCel.Core

public struct TScRGBColor

Constructors

Name | Description
TScRGBColor | Overloaded TScRGBColor(TUIColor) TScRGBColor(Color) TScRGBColor(Double, Double, Double)

Methods

Name | Description
RGBtoSRGB | Converts a RGB value to sRGB using a gamma of 2.2
SRGBtoRGB | Converts a sRGB value to RGB using a gamma of 2.2
Equals | Returns true if both colors are the same.
GetHashCode | Returns a hashcode for the color.
CompareTo | Returns -1 if obj is more than color, 0 if both colors are the same, and 1 if obj is less than color.

Operators

Name | Description
Implicit Conversion | Overloaded Implicit conversion from TUIColor to TScRGBColor Implicit conversion from TScRGBColor to TUIColor Implicit conversion from Color to TScRGBColor Implicit conversion from TScRGBColor to Color
Equality | Returns true if both colors are equal.
Inequality | Returns true if both colors do not have the same value.
GreaterThan | Returns true if o1 is bigger than o2.
LessThan | Returns true if o1 is less than o2.

Properties

Name | Description
ScR | ScRed component. (between 0 and 1)
ScG | ScGreen component. (between 0 and 1)
ScB | ScBlue component. (between 0 and 1)
R | Red component in the RGB space. (0-255)
G | Green component in the RGB space. (0-255)
B | Blue component in the RGB space. (0-255)
Empty | Returns an empty color.


TScRGBColor.TScRGBColor Constructor | FlexCel Studio for the .NET Framework documentation

TScRGBColor.TScRGBColor Constructor

Overloads

  • TScRGBColor.TScRGBColor(TUIColor)
  • TScRGBColor.TScRGBColor(Color)
  • TScRGBColor.TScRGBColor(Double, Double, Double)

TScRGBColor.TScRGBColor(TUIColor)

Creates a new instance from a system color.

Syntax

Namespace: FlexCel.Core

public TScRGBColor(TUIColor RGBColor)

Parameters

<-> | Parameter | Type | Description
 | RGBColor | TUIColor |

See also

  • TScRGBColor

TScRGBColor.TScRGBColor(Color)

Creates a new instance from a system color.

Syntax

Namespace: FlexCel.Core

public TScRGBColor(Color RGBColor)

Parameters

<-> | Parameter | Type | Description
 | RGBColor | Color |

See also

  • TScRGBColor

TScRGBColor.TScRGBColor(Double, Double, Double)

Creates a Color from the sc components.

Syntax

Namespace: FlexCel.Core

public TScRGBColor(Double scRed, Double scGreen, Double scBlue)

Parameters

<-> | Parameter | Type | Description
 | scRed | Double | Red component. (0-1)
 | scGreen | Double | Green component. (0-1)
 | scBlue | Double | Blue component. (0-1)

See also

  • TScRGBColor


TScRGBColor.RGBtoSRGB Method | FlexCel Studio for the .NET Framework documentation

TScRGBColor.RGBtoSRGB Method

Converts a RGB value to sRGB using a gamma of 2.2

Syntax

Namespace: FlexCel.Core

public static Double RGBtoSRGB(Double component)

Parameters

<-> | Parameter | Type | Description
 | component | Double | R, G or B component of the color.

See also

  • TScRGBColor


TScRGBColor.SRGBtoRGB Method | FlexCel Studio for the .NET Framework documentation

TScRGBColor.SRGBtoRGB Method

Converts a sRGB value to RGB using a gamma of 2.2

Syntax

Namespace: FlexCel.Core

public static Double SRGBtoRGB(Double component)

Parameters

<-> | Parameter | Type | Description
 | component | Double | sR, sG or sB component of the color.

See also

  • TScRGBColor


TScRGBColor.Equals Method | FlexCel Studio for the .NET Framework documentation

TScRGBColor.Equals Method

Returns true if both colors are the same.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TScRGBColor


TScRGBColor.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TScRGBColor.GetHashCode Method

Returns a hashcode for the color.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TScRGBColor


TScRGBColor.CompareTo Method | FlexCel Studio for the .NET Framework documentation

TScRGBColor.CompareTo Method

Returns -1 if obj is more than color, 0 if both colors are the same, and 1 if obj is less than color.

Syntax

Namespace: FlexCel.Core

public Int32 CompareTo(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TScRGBColor


TScRGBColor Implicit Conversion Operator | FlexCel Studio for the .NET Framework documentation

TScRGBColor Implicit Conversion Operator

Overloads

  • Implicit conversion from TUIColor to TScRGBColor
  • Implicit conversion from TScRGBColor to TUIColor
  • Implicit conversion from Color to TScRGBColor
  • Implicit conversion from TScRGBColor to Color

Implicit conversion from TUIColor to TScRGBColor

Assigns a system color to this instance.

Syntax

Namespace: FlexCel.Core

public static TScRGBColor op_Implicit(TUIColor aColor)

Parameters

<-> | Parameter | Type | Description
 | aColor | TUIColor |

See also

  • TScRGBColor

Implicit conversion from TScRGBColor to TUIColor

Assigns this instance to a system color.

Syntax

Namespace: FlexCel.Core

public static TUIColor op_Implicit(TScRGBColor aColor)

Parameters

<-> | Parameter | Type | Description
 | aColor | TScRGBColor |

See also

  • TScRGBColor

Implicit conversion from Color to TScRGBColor

Assigns a system color to this instance.

Syntax

Namespace: FlexCel.Core

public static TScRGBColor op_Implicit(Color aColor)

Parameters

<-> | Parameter | Type | Description
 | aColor | Color |

See also

  • TScRGBColor

Implicit conversion from TScRGBColor to Color

Assigns this instance to a system color.

Syntax

Namespace: FlexCel.Core

public static Color op_Implicit(TScRGBColor aColor)

Parameters

<-> | Parameter | Type | Description
 | aColor | TScRGBColor |

See also

  • TScRGBColor


TScRGBColor.Equality Operator | FlexCel Studio for the .NET Framework documentation

TScRGBColor.Equality Operator

Returns true if both colors are equal.

Syntax

Namespace: FlexCel.Core

public static Boolean op_Equality(TScRGBColor o1, TScRGBColor o2)

Parameters

<-> | Parameter | Type | Description
 | o1 | TScRGBColor | First color to compare.
 | o2 | TScRGBColor | Second color to compare.

See also

  • TScRGBColor


TScRGBColor.Inequality Operator | FlexCel Studio for the .NET Framework documentation

TScRGBColor.Inequality Operator

Returns true if both colors do not have the same value.

Syntax

Namespace: FlexCel.Core

public static Boolean op_Inequality(TScRGBColor o1, TScRGBColor o2)

Parameters

<-> | Parameter | Type | Description
 | o1 | TScRGBColor | First color to compare.
 | o2 | TScRGBColor | Second color to compare.

See also

  • TScRGBColor


TScRGBColor.GreaterThan Operator | FlexCel Studio for the .NET Framework documentation

TScRGBColor.GreaterThan Operator

Returns true if o1 is bigger than o2.

Syntax

Namespace: FlexCel.Core

public static Boolean op_GreaterThan(TScRGBColor o1, TScRGBColor o2)

Parameters

<-> | Parameter | Type | Description
 | o1 | TScRGBColor |
 | o2 | TScRGBColor |

See also

  • TScRGBColor


TScRGBColor.LessThan Operator | FlexCel Studio for the .NET Framework documentation

TScRGBColor.LessThan Operator

Returns true if o1 is less than o2.

Syntax

Namespace: FlexCel.Core

public static Boolean op_LessThan(TScRGBColor o1, TScRGBColor o2)

Parameters

<-> | Parameter | Type | Description
 | o1 | TScRGBColor |
 | o2 | TScRGBColor |

See also

  • TScRGBColor


TScRGBColor.ScR Property | FlexCel Studio for the .NET Framework documentation

TScRGBColor.ScR Property

ScRed component. (between 0 and 1)

Syntax

Namespace: FlexCel.Core

public Double ScR { get; }

See also

  • TScRGBColor


TScRGBColor.ScG Property | FlexCel Studio for the .NET Framework documentation

TScRGBColor.ScG Property

ScGreen component. (between 0 and 1)

Syntax

Namespace: FlexCel.Core

public Double ScG { get; }

See also

  • TScRGBColor


TScRGBColor.ScB Property | FlexCel Studio for the .NET Framework documentation

TScRGBColor.ScB Property

ScBlue component. (between 0 and 1)

Syntax

Namespace: FlexCel.Core

public Double ScB { get; }

See also

  • TScRGBColor


TScRGBColor.R Property | FlexCel Studio for the .NET Framework documentation

TScRGBColor.R Property

Red component in the RGB space. (0-255)

Syntax

Namespace: FlexCel.Core

public Byte R { get; }

See also

  • TScRGBColor


TScRGBColor.G Property | FlexCel Studio for the .NET Framework documentation

TScRGBColor.G Property

Green component in the RGB space. (0-255)

Syntax

Namespace: FlexCel.Core

public Byte G { get; }

See also

  • TScRGBColor


TScRGBColor.B Property | FlexCel Studio for the .NET Framework documentation

TScRGBColor.B Property

Blue component in the RGB space. (0-255)

Syntax

Namespace: FlexCel.Core

public Byte B { get; }

See also

  • TScRGBColor


TScRGBColor.Empty Property | FlexCel Studio for the .NET Framework documentation

TScRGBColor.Empty Property

Returns an empty color.

Syntax

Namespace: FlexCel.Core

public static TScRGBColor Empty { get; }

See also

  • TScRGBColor


TShapeConnector Structure | FlexCel Studio for the .NET Framework documentation

TShapeConnector Structure

Used to link two different shapes with a connector.

Syntax

Namespace: FlexCel.Core

public struct TShapeConnector

Constructors

Name | Description
TShapeConnector | Creates a new ShapeConnector.

Properties

Name | Description
ShapeId | The ID of the shape where this shape is linked. A negative value means the shape is not connected.
AnchorPoint | This integer defines the anchor point used to link the connection. The meaning of this number varies depending in the shape, for example a rectangle can have 4 anchor points (one in each side), while a triangle might have 3.


TShapeConnector.TShapeConnector Constructor | FlexCel Studio for the .NET Framework documentation

TShapeConnector.TShapeConnector Constructor

Creates a new ShapeConnector.

Syntax

Namespace: FlexCel.Core

public TShapeConnector(Int32 aShapeId, Int32 aAnchorPoint)

Parameters

<-> | Parameter | Type | Description
 | aShapeId | Int32 | The ID of the shape where this shape is linked. A negative value means the shape is not connected
 | aAnchorPoint | Int32 | This integer defines the anchor point used to link the connection.

See also

  • TShapeConnector


TShapeConnector.ShapeId Property | FlexCel Studio for the .NET Framework documentation

TShapeConnector.ShapeId Property

The ID of the shape where this shape is linked. A negative value means the shape is not connected.

Syntax

Namespace: FlexCel.Core

public Int32 ShapeId { get; }

See also

  • TShapeConnector


TShapeConnector.AnchorPoint Property | FlexCel Studio for the .NET Framework documentation

TShapeConnector.AnchorPoint Property

This integer defines the anchor point used to link the connection. The meaning of this number varies depending in the shape, for example a rectangle can have 4 anchor points (one in each side), while a triangle might have 3.

Syntax

Namespace: FlexCel.Core

public Int32 AnchorPoint { get; }

See also

  • TShapeConnector


TSVGAttribute Structure | FlexCel Studio for the .NET Framework documentation

TSVGAttribute Structure

Represents an attribute for using in SVG.

Syntax

Namespace: FlexCel.Core

public struct TSVGAttribute

Constructors

Name Description
TSVGAttribute Overloaded
 TSVGAttribute(String, String)
TSVGAttribute(String, String, String)

Methods

Name | Description
Equals | Returns true if obj has the same data as this instance.
GetHashCode | Returns the hashcode of the object.

Operators

Name | Description
Equality | Returns true if both structures are the same.
Inequality | Returns true if both structures are different.

Properties

Name | Description
Name | Name of the SVG attribute.
Value | Value of the SVG attribute.
Namespace | Namespace of the SVG attribute.


TSVGAttribute.TSVGAttribute Constructor | FlexCel Studio for the .NET Framework documentation

TSVGAttribute.TSVGAttribute Constructor

Overloads

  • TSVGAttribute.TSVGAttribute(String, String)
  • TSVGAttribute.TSVGAttribute(String, String, String)

TSVGAttribute.TSVGAttribute(String, String)

Creates a new TSVGAttrigbute with null namespace.

Syntax

Namespace: FlexCel.Core

public TSVGAttribute(String aName, String aValue)

Parameters

<-> | Parameter | Type | Description
 | aName | String |
 | aValue | String |

See also

  • TSVGAttribute

TSVGAttribute.TSVGAttribute(String, String, String)

Creates a new TSVGAttribute.

Syntax

Namespace: FlexCel.Core

public TSVGAttribute(String aName, String aValue, String aNamespace)

Parameters

<-> | Parameter | Type | Description
 | aName | String |
 | aValue | String |
 | aNamespace | String |

See also

  • TSVGAttribute


TSVGAttribute.Equals Method | FlexCel Studio for the .NET Framework documentation

TSVGAttribute.Equals Method

Returns true if obj has the same data as this instance.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TSVGAttribute


TSVGAttribute.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TSVGAttribute.GetHashCode Method

Returns the hashcode of the object.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TSVGAttribute


TSVGAttribute.Equality Operator | FlexCel Studio for the .NET Framework documentation

TSVGAttribute.Equality Operator

Returns true if both structures are the same.

Syntax

Namespace: FlexCel.Core

public static Boolean op_Equality(TSVGAttribute a, TSVGAttribute b)

Parameters

<-> | Parameter | Type | Description
 | a | TSVGAttribute |
 | b | TSVGAttribute |

See also

  • TSVGAttribute


TSVGAttribute.Inequality Operator | FlexCel Studio for the .NET Framework documentation

TSVGAttribute.Inequality Operator

Returns true if both structures are different.

Syntax

Namespace: FlexCel.Core

public static Boolean op_Inequality(TSVGAttribute a, TSVGAttribute b)

Parameters

<-> | Parameter | Type | Description
 | a | TSVGAttribute |
 | b | TSVGAttribute |

See also

  • TSVGAttribute


TSVGAttribute.Name Property | FlexCel Studio for the .NET Framework documentation

TSVGAttribute.Name Property

Name of the SVG attribute.

Syntax

Namespace: FlexCel.Core

public String Name { get; set; }

See also

  • TSVGAttribute


TSVGAttribute.Value Property | FlexCel Studio for the .NET Framework documentation

TSVGAttribute.Value Property

Value of the SVG attribute.

Syntax

Namespace: FlexCel.Core

public String Value { get; set; }

See also

  • TSVGAttribute


TSVGAttribute.Namespace Property | FlexCel Studio for the .NET Framework documentation

TSVGAttribute.Namespace Property

Namespace of the SVG attribute.

Syntax

Namespace: FlexCel.Core

public String Namespace { get; set; }

See also

  • TSVGAttribute


TSVGBlip Structure | FlexCel Studio for the .NET Framework documentation

TSVGBlip Structure

Contains the data of an SVG image, when the blip is of SVG type.

Syntax

Namespace: FlexCel.Core

public struct TSVGBlip

Constructors

Name Description
TSVGBlip Overloaded
 TSVGBlip(Byte[], Boolean)
TSVGBlip(Byte[], String, String, Boolean)

Methods

Name | Description
Clone | Creates a deep-copy of this object.

Properties

Name | Description
ImageFileName | File name which will be used when saving the file inside the xlsx container.
ContentType | Content type for the image, like "image/jpeg".
PictureData | Data of the SVG image. This is normally UTF-8 encoded.
Empty | returns an empty TSVGBlip.
IsEmpty | Returns true if this svg doesn't have data.


TSVGBlip.TSVGBlip Constructor | FlexCel Studio for the .NET Framework documentation

TSVGBlip.TSVGBlip Constructor

Overloads

  • TSVGBlip.TSVGBlip(Byte[], Boolean)
  • TSVGBlip.TSVGBlip(Byte[], String, String, Boolean)

TSVGBlip.TSVGBlip(Byte[], Boolean)

Creates a new TSVGBlip with only the blip data.

Syntax

Namespace: FlexCel.Core

public TSVGBlip(Byte[] aPictureData, Boolean CloneData)

Parameters

<-> | Parameter | Type | Description
 | aPictureData | Byte[] | SVG image data. This is normally utf8-encoded.
 | CloneData | Boolean | If true, aPictureData will be cloned before storing it. If false, aPictureData will be stored directly and it is your responsibility to not use aPictureData anymore.

See also

  • TSVGBlip

TSVGBlip.TSVGBlip(Byte[], String, String, Boolean)

Creates a new TSVGBlip.

Syntax

Namespace: FlexCel.Core

public TSVGBlip(Byte[] aPictureData, String aImageFileName, String aContentType, Boolean CloneData)

Parameters

<-> | Parameter | Type | Description
 | aPictureData | Byte[] | SVG image data. This is normally utf8-encoded.
 | aImageFileName | String | Filename
 | aContentType | String | Type of image. This is a mime type, likely StandardMimeType.Svg
 | CloneData | Boolean | If true, aPictureData will be cloned before storing it. If false, aPictureData will be stored directly and it is your responsibility to not use aPictureData anymore.

See also

  • TSVGBlip


TSVGBlip.Clone Method | FlexCel Studio for the .NET Framework documentation

TSVGBlip.Clone Method

Creates a deep-copy of this object.

Syntax

Namespace: FlexCel.Core

public TSVGBlip Clone()

See also

  • TSVGBlip


TSVGBlip.ImageFileName Property | FlexCel Studio for the .NET Framework documentation

TSVGBlip.ImageFileName Property

File name which will be used when saving the file inside the xlsx container.

Syntax

Namespace: FlexCel.Core

public String ImageFileName { get; }

See also

  • TSVGBlip


TSVGBlip.ContentType Property | FlexCel Studio for the .NET Framework documentation

TSVGBlip.ContentType Property

Content type for the image, like "image/jpeg".

Syntax

Namespace: FlexCel.Core

public String ContentType { get; }

See also

  • TSVGBlip


TSVGBlip.PictureData Property | FlexCel Studio for the .NET Framework documentation

TSVGBlip.PictureData Property

Data of the SVG image. This is normally UTF-8 encoded.

Syntax

Namespace: FlexCel.Core

public Byte[] PictureData { get; }

See also

  • TSVGBlip


TSVGBlip.Empty Property | FlexCel Studio for the .NET Framework documentation

TSVGBlip.Empty Property

returns an empty TSVGBlip.

Syntax

Namespace: FlexCel.Core

public static TSVGBlip Empty { get; }

See also

  • TSVGBlip


TSVGBlip.IsEmpty Property | FlexCel Studio for the .NET Framework documentation

TSVGBlip.IsEmpty Property

Returns true if this svg doesn't have data.

Syntax

Namespace: FlexCel.Core

public Boolean IsEmpty { get; }

See also

  • TSVGBlip


TTableApplyBorders Structure | FlexCel Studio for the .NET Framework documentation

TTableApplyBorders Structure

Determines which parts of the borders will be applied in the Table.

Syntax

Namespace: FlexCel.Core

public struct TTableApplyBorders

Constructors

Name | Description
TTableApplyBorders | Overloaded TTableApplyBorders(Boolean) TTableApplyBorders(Boolean, Boolean, Boolean, Boolean, Boolean, Boolean)

Methods

Name | Description
Equals | Returns true if both objects are the same
GetHashCode | Returns the hashcode of the struct.

Operators

Name | Description
Equality | Returns true if both objects have the same information.
Inequality | Returns true if both objects are different.

Properties

Name | Description
Left | Left border of the full section of the table. Does not apply to the borders of cells inside the section.
Top | Top border of the full section of the table. Does not apply to the borders of cells inside the section.
Right | Right border of the full section of the table. Does not apply to the borders of cells inside the section.
Bottom | Bottom border of the full section of the table. Does not apply to the borders of cells inside the section.
InsideVertical | Vertical borders inside the section of the table. Does not apply to the borders in the exterior of the section.
InsideHorizontal | Horizontal borders inside the section of the table. Does not apply to the borders in the exterior of the section.
IsEmpty | Returns true if the format does not apply any setting.


TTableApplyBorders.TTableApplyBorders Constructor | FlexCel Studio for the .NET Framework documentation

TTableApplyBorders.TTableApplyBorders Constructor

Overloads

  • TTableApplyBorders.TTableApplyBorders(Boolean)
  • TTableApplyBorders.TTableApplyBorders(Boolean, Boolean, Boolean, Boolean, Boolean, Boolean)

TTableApplyBorders.TTableApplyBorders(Boolean)

Creates an Apply Borders setting all members to true or false.

Syntax

Namespace: FlexCel.Core

public TTableApplyBorders(Boolean AllTrue)

Parameters

<-> | Parameter | Type | Description
 | AllTrue | Boolean | If true all members will be set to true. If not, all members will be false.

See also

  • TTableApplyBorders

TTableApplyBorders.TTableApplyBorders(Boolean, Boolean, Boolean, Boolean, Boolean, Boolean)

Creates a new struct setting the members to true or false.

Syntax

Namespace: FlexCel.Core

public TTableApplyBorders(Boolean aLeft, Boolean aTop, Boolean aRight, Boolean aBottom, Boolean aInsideVertical, Boolean aInsideHorizontal)

Parameters

<-> | Parameter | Type | Description
 | aLeft | Boolean | If true, the left border will be applied.
 | aTop | Boolean | If true, the top border will be applied.
 | aRight | Boolean | If true, the right border will be applied.
 | aBottom | Boolean | If true, the bottom border will be applied.
 | aInsideVertical | Boolean | If true, the inside vertical borders will be applied.
 | aInsideHorizontal | Boolean | If true, the inside horizontal borders will be applied.

See also

  • TTableApplyBorders


TTableApplyBorders.Equals Method | FlexCel Studio for the .NET Framework documentation

TTableApplyBorders.Equals Method

Returns true if both objects are the same

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TTableApplyBorders


TTableApplyBorders.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TTableApplyBorders.GetHashCode Method

Returns the hashcode of the struct.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TTableApplyBorders


TTableApplyBorders.Equality Operator | FlexCel Studio for the .NET Framework documentation

TTableApplyBorders.Equality Operator

Returns true if both objects have the same information.

Syntax

Namespace: FlexCel.Core

public static Boolean op_Equality(TTableApplyBorders o1, TTableApplyBorders o2)

Parameters

<-> | Parameter | Type | Description
 | o1 | TTableApplyBorders |
 | o2 | TTableApplyBorders |

See also

  • TTableApplyBorders


TTableApplyBorders.Inequality Operator | FlexCel Studio for the .NET Framework documentation

TTableApplyBorders.Inequality Operator

Returns true if both objects are different.

Syntax

Namespace: FlexCel.Core

public static Boolean op_Inequality(TTableApplyBorders o1, TTableApplyBorders o2)

Parameters

<-> | Parameter | Type | Description
 | o1 | TTableApplyBorders |
 | o2 | TTableApplyBorders |

See also

  • TTableApplyBorders


TTableApplyBorders.Left Property | FlexCel Studio for the .NET Framework documentation

TTableApplyBorders.Left Property

Left border of the full section of the table. Does not apply to the borders of cells inside the section.

Syntax

Namespace: FlexCel.Core

public Boolean Left { get; set; }

See also

  • TTableApplyBorders


TTableApplyBorders.Top Property | FlexCel Studio for the .NET Framework documentation

TTableApplyBorders.Top Property

Top border of the full section of the table. Does not apply to the borders of cells inside the section.

Syntax

Namespace: FlexCel.Core

public Boolean Top { get; set; }

See also

  • TTableApplyBorders


TTableApplyBorders.Right Property | FlexCel Studio for the .NET Framework documentation

TTableApplyBorders.Right Property

Right border of the full section of the table. Does not apply to the borders of cells inside the section.

Syntax

Namespace: FlexCel.Core

public Boolean Right { get; set; }

See also

  • TTableApplyBorders


TTableApplyBorders.Bottom Property | FlexCel Studio for the .NET Framework documentation

TTableApplyBorders.Bottom Property

Bottom border of the full section of the table. Does not apply to the borders of cells inside the section.

Syntax

Namespace: FlexCel.Core

public Boolean Bottom { get; set; }

See also

  • TTableApplyBorders


TTableApplyBorders.InsideVertical Property | FlexCel Studio for the .NET Framework documentation

TTableApplyBorders.InsideVertical Property

Vertical borders inside the section of the table. Does not apply to the borders in the exterior of the section.

Syntax

Namespace: FlexCel.Core

public Boolean InsideVertical { get; set; }

See also

  • TTableApplyBorders


TTableApplyBorders.InsideHorizontal Property | FlexCel Studio for the .NET Framework documentation

TTableApplyBorders.InsideHorizontal Property

Horizontal borders inside the section of the table. Does not apply to the borders in the exterior of the section.

Syntax

Namespace: FlexCel.Core

public Boolean InsideHorizontal { get; set; }

See also

  • TTableApplyBorders


TTableApplyBorders.IsEmpty Property | FlexCel Studio for the .NET Framework documentation

TTableApplyBorders.IsEmpty Property

Returns true if the format does not apply any setting.

Syntax

Namespace: FlexCel.Core

public Boolean IsEmpty { get; }

See also

  • TTableApplyBorders


TTableApplyFill Structure | FlexCel Studio for the .NET Framework documentation

TTableApplyFill Structure

Determines which parts of the pattern will be applied in the table.

Syntax

Namespace: FlexCel.Core

public struct TTableApplyFill

Constructors

Name | Description
TTableApplyFill | Overloaded TTableApplyFill(Boolean) TTableApplyFill(Boolean, Boolean, Boolean)

Methods

Name | Description
Equals | Returns true if both objects are the same
GetHashCode | Returns the hashcode of the struct.

Operators

Name | Description
Equality | Returns true if both objects have the same information.
Inequality | returns true if both objects are the same.

Properties

Name | Description
Pattern | Fill style.
FgColor | Color for the foreground of the pattern.
BgColor | Color for the background of the pattern. If the pattern is solid, has no effect.
IsEmpty | Returns true if the format does not apply any setting.


TTableApplyFill.TTableApplyFill Constructor | FlexCel Studio for the .NET Framework documentation

TTableApplyFill.TTableApplyFill Constructor

Overloads

  • TTableApplyFill.TTableApplyFill(Boolean)
  • TTableApplyFill.TTableApplyFill(Boolean, Boolean, Boolean)

TTableApplyFill.TTableApplyFill(Boolean)

Creates an Apply Fill setting all members to true or false.

Syntax

Namespace: FlexCel.Core

public TTableApplyFill(Boolean AllTrue)

Parameters

<-> | Parameter | Type | Description
 | AllTrue | Boolean | If true all members will be set to true. If not, all members will be false.

See also

  • TTableApplyFill

TTableApplyFill.TTableApplyFill(Boolean, Boolean, Boolean)

Creates a new struct setting the members to true or false.

Syntax

Namespace: FlexCel.Core

public TTableApplyFill(Boolean aStyle, Boolean aFgColor, Boolean aBgColor)

Parameters

<-> | Parameter | Type | Description
 | aStyle | Boolean | If true, the style will be applied.
 | aFgColor | Boolean | If true, the foreground color will be applied.
 | aBgColor | Boolean | If true, the background color will be applied.

See also

  • TTableApplyFill


TTableApplyFill.Equals Method | FlexCel Studio for the .NET Framework documentation

TTableApplyFill.Equals Method

Returns true if both objects are the same

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TTableApplyFill


TTableApplyFill.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TTableApplyFill.GetHashCode Method

Returns the hashcode of the struct.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TTableApplyFill


TTableApplyFill.Equality Operator | FlexCel Studio for the .NET Framework documentation

TTableApplyFill.Equality Operator

Returns true if both objects have the same information.

Syntax

Namespace: FlexCel.Core

public static Boolean op_Equality(TTableApplyFill o1, TTableApplyFill o2)

Parameters

<-> | Parameter | Type | Description
 | o1 | TTableApplyFill |
 | o2 | TTableApplyFill |

See also

  • TTableApplyFill


TTableApplyFill.Inequality Operator | FlexCel Studio for the .NET Framework documentation

TTableApplyFill.Inequality Operator

returns true if both objects are the same.

Syntax

Namespace: FlexCel.Core

public static Boolean op_Inequality(TTableApplyFill o1, TTableApplyFill o2)

Parameters

<-> | Parameter | Type | Description
 | o1 | TTableApplyFill |
 | o2 | TTableApplyFill |

See also

  • TTableApplyFill


TTableApplyFill.Pattern Property | FlexCel Studio for the .NET Framework documentation

TTableApplyFill.Pattern Property

Fill style.

Syntax

Namespace: FlexCel.Core

public Boolean Pattern { get; set; }

See also

  • TTableApplyFill


TTableApplyFill.FgColor Property | FlexCel Studio for the .NET Framework documentation

TTableApplyFill.FgColor Property

Color for the foreground of the pattern.

Syntax

Namespace: FlexCel.Core

public Boolean FgColor { get; set; }

See also

  • TTableApplyFill


TTableApplyFill.BgColor Property | FlexCel Studio for the .NET Framework documentation

TTableApplyFill.BgColor Property

Color for the background of the pattern. If the pattern is solid, has no effect.

Syntax

Namespace: FlexCel.Core

public Boolean BgColor { get; set; }

See also

  • TTableApplyFill


TTableApplyFill.IsEmpty Property | FlexCel Studio for the .NET Framework documentation

TTableApplyFill.IsEmpty Property

Returns true if the format does not apply any setting.

Syntax

Namespace: FlexCel.Core

public Boolean IsEmpty { get; }

See also

  • TTableApplyFill


TTableApplyFont Structure | FlexCel Studio for the .NET Framework documentation

TTableApplyFont Structure

Determines which parts of the font will be applied in the Table.

Syntax

Namespace: FlexCel.Core

public struct TTableApplyFont

Constructors

Name | Description
TTableApplyFont | Overloaded TTableApplyFont(Boolean) TTableApplyFont(Boolean, Boolean, Boolean, Boolean)

Methods

Name | Description
Equals | Returns true if both objects are the same.
GetHashCode | Returns the hashcode of the struct.

Operators

Name | Description
Equality | Returns true if both objects have the same information.
Inequality | returns true if both objects are different.

Properties

Name | Description
Color | Color of the font.
BoldAndItalic | If true, both bold and italic will be applied.
Strikeout | If true, the strikeout style of the font will be used.
Underline | If true, the underline style of the font will be used.
IsEmpty | Returns true if the format does not apply any setting.


TTableApplyFont.TTableApplyFont Constructor | FlexCel Studio for the .NET Framework documentation

TTableApplyFont.TTableApplyFont Constructor

Overloads

  • TTableApplyFont.TTableApplyFont(Boolean)
  • TTableApplyFont.TTableApplyFont(Boolean, Boolean, Boolean, Boolean)

TTableApplyFont.TTableApplyFont(Boolean)

Creates an Apply Font setting all members to true or false.

Syntax

Namespace: FlexCel.Core

public TTableApplyFont(Boolean AllTrue)

Parameters

<-> | Parameter | Type | Description
 | AllTrue | Boolean | If true all members will be set to true. If not, all members will be false.

See also

  • TTableApplyFont

TTableApplyFont.TTableApplyFont(Boolean, Boolean, Boolean, Boolean)

Creates a new struct setting the members to true or false.

Syntax

Namespace: FlexCel.Core

public TTableApplyFont(Boolean aColor, Boolean aBoldAndItalic, Boolean aStrikeout, Boolean aUnderline)

Parameters

<-> | Parameter | Type | Description
 | aColor | Boolean | If true, the font color will be applied.
 | aBoldAndItalic | Boolean | If true, the font bold and italic styles will be applied.
 | aStrikeout | Boolean | If true, the font strikeout style will be applied.
 | aUnderline | Boolean | If true, the font underline will be applied.

See also

  • TTableApplyFont


TTableApplyFont.Equals Method | FlexCel Studio for the .NET Framework documentation

TTableApplyFont.Equals Method

Returns true if both objects are the same.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TTableApplyFont


TTableApplyFont.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TTableApplyFont.GetHashCode Method

Returns the hashcode of the struct.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TTableApplyFont


TTableApplyFont.Equality Operator | FlexCel Studio for the .NET Framework documentation

TTableApplyFont.Equality Operator

Returns true if both objects have the same information.

Syntax

Namespace: FlexCel.Core

public static Boolean op_Equality(TTableApplyFont o1, TTableApplyFont o2)

Parameters

<-> | Parameter | Type | Description
 | o1 | TTableApplyFont |
 | o2 | TTableApplyFont |

See also

  • TTableApplyFont


TTableApplyFont.Inequality Operator | FlexCel Studio for the .NET Framework documentation

TTableApplyFont.Inequality Operator

returns true if both objects are different.

Syntax

Namespace: FlexCel.Core

public static Boolean op_Inequality(TTableApplyFont o1, TTableApplyFont o2)

Parameters

<-> | Parameter | Type | Description
 | o1 | TTableApplyFont |
 | o2 | TTableApplyFont |

See also

  • TTableApplyFont


TTableApplyFont.Color Property | FlexCel Studio for the .NET Framework documentation

TTableApplyFont.Color Property

Color of the font.

Syntax

Namespace: FlexCel.Core

public Boolean Color { get; set; }

See also

  • TTableApplyFont


TTableApplyFont.BoldAndItalic Property | FlexCel Studio for the .NET Framework documentation

TTableApplyFont.BoldAndItalic Property

If true, both bold and italic will be applied.

Syntax

Namespace: FlexCel.Core

public Boolean BoldAndItalic { get; set; }

See also

  • TTableApplyFont


TTableApplyFont.Strikeout Property | FlexCel Studio for the .NET Framework documentation

TTableApplyFont.Strikeout Property

If true, the strikeout style of the font will be used.

Syntax

Namespace: FlexCel.Core

public Boolean Strikeout { get; set; }

See also

  • TTableApplyFont


TTableApplyFont.Underline Property | FlexCel Studio for the .NET Framework documentation

TTableApplyFont.Underline Property

If true, the underline style of the font will be used.

Syntax

Namespace: FlexCel.Core

public Boolean Underline { get; set; }

See also

  • TTableApplyFont


TTableApplyFont.IsEmpty Property | FlexCel Studio for the .NET Framework documentation

TTableApplyFont.IsEmpty Property

Returns true if the format does not apply any setting.

Syntax

Namespace: FlexCel.Core

public Boolean IsEmpty { get; }

See also

  • TTableApplyFont


TTableBorders Structure | FlexCel Studio for the .NET Framework documentation

TTableBorders Structure

Determines which parts of the borders will be applied in the Table.

Syntax

Namespace: FlexCel.Core

public struct TTableBorders

Fields

Name | Description
Left | Left border of the full section of the table. Does not apply to the borders of cells inside the section.
Top | Top border of the full section of the table. Does not apply to the borders of cells inside the section.
Right | Right border of the full section of the table. Does not apply to the borders of cells inside the section.
Bottom | Bottom border of the full section of the table. Does not apply to the borders of cells inside the section.
InsideVertical | Vertical borders inside the section of the table. Does not apply to the borders in the exterior of the section.
InsideHorizontal | Horizontal borders inside the section of the table. Does not apply to the borders in the exterior of the section.

Constructors

Name | Description
TTableBorders | Creates a new struct setting the members.

Methods

Name | Description
Equals | Returns true if both objects are the same
GetHashCode | Returns the hashcode of the struct.

Operators

Name | Description
Equality | Returns true if both objects have the same information.
Inequality | returns true if both objects are different.


TTableBorders.Left Field | FlexCel Studio for the .NET Framework documentation

TTableBorders.Left Field

Left border of the full section of the table. Does not apply to the borders of cells inside the section.

Syntax

Namespace: FlexCel.Core

public TFlxOneBorder Left

See also

  • TTableBorders


TTableBorders.Top Field | FlexCel Studio for the .NET Framework documentation

TTableBorders.Top Field

Top border of the full section of the table. Does not apply to the borders of cells inside the section.

Syntax

Namespace: FlexCel.Core

public TFlxOneBorder Top

See also

  • TTableBorders


TTableBorders.Right Field | FlexCel Studio for the .NET Framework documentation

TTableBorders.Right Field

Right border of the full section of the table. Does not apply to the borders of cells inside the section.

Syntax

Namespace: FlexCel.Core

public TFlxOneBorder Right

See also

  • TTableBorders


TTableBorders.Bottom Field | FlexCel Studio for the .NET Framework documentation

TTableBorders.Bottom Field

Bottom border of the full section of the table. Does not apply to the borders of cells inside the section.

Syntax

Namespace: FlexCel.Core

public TFlxOneBorder Bottom

See also

  • TTableBorders


TTableBorders.InsideVertical Field | FlexCel Studio for the .NET Framework documentation

TTableBorders.InsideVertical Field

Vertical borders inside the section of the table. Does not apply to the borders in the exterior of the section.

Syntax

Namespace: FlexCel.Core

public TFlxOneBorder InsideVertical

See also

  • TTableBorders


TTableBorders.InsideHorizontal Field | FlexCel Studio for the .NET Framework documentation

TTableBorders.InsideHorizontal Field

Horizontal borders inside the section of the table. Does not apply to the borders in the exterior of the section.

Syntax

Namespace: FlexCel.Core

public TFlxOneBorder InsideHorizontal

See also

  • TTableBorders


TTableBorders.TTableBorders Constructor | FlexCel Studio for the .NET Framework documentation

TTableBorders.TTableBorders Constructor

Creates a new struct setting the members.

Syntax

Namespace: FlexCel.Core

public TTableBorders(TFlxOneBorder aLeft, TFlxOneBorder aTop, TFlxOneBorder aRight, TFlxOneBorder aBottom, TFlxOneBorder aInsideVertical, TFlxOneBorder aInsideHorizontal)

Parameters

<-> | Parameter | Type | Description
 | aLeft | TFlxOneBorder | Left border.
 | aTop | TFlxOneBorder | Top border.
 | aRight | TFlxOneBorder | Right border.
 | aBottom | TFlxOneBorder | Bottom border.
 | aInsideVertical | TFlxOneBorder | Interior vertical borders.
 | aInsideHorizontal | TFlxOneBorder | Interior horizontal borders.

See also

  • TTableBorders


TTableBorders.Equals Method | FlexCel Studio for the .NET Framework documentation

TTableBorders.Equals Method

Returns true if both objects are the same

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TTableBorders


TTableBorders.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TTableBorders.GetHashCode Method

Returns the hashcode of the struct.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TTableBorders


TTableBorders.Equality Operator | FlexCel Studio for the .NET Framework documentation

TTableBorders.Equality Operator

Returns true if both objects have the same information.

Syntax

Namespace: FlexCel.Core

public static Boolean op_Equality(TTableBorders o1, TTableBorders o2)

Parameters

<-> | Parameter | Type | Description
 | o1 | TTableBorders |
 | o2 | TTableBorders |

See also

  • TTableBorders


TTableBorders.Inequality Operator | FlexCel Studio for the .NET Framework documentation

TTableBorders.Inequality Operator

returns true if both objects are different.

Syntax

Namespace: FlexCel.Core

public static Boolean op_Inequality(TTableBorders o1, TTableBorders o2)

Parameters

<-> | Parameter | Type | Description
 | o1 | TTableBorders |
 | o2 | TTableBorders |

See also

  • TTableBorders


TTableColumnDefinition Structure | FlexCel Studio for the .NET Framework documentation

TTableColumnDefinition Structure

Contains the definition for a column in an Excel table. This is mostly useful if the table doesn't have headers, since when the table has headers the columns are inferred from the cells where the header is.

Syntax

Namespace: FlexCel.Core

public struct TTableColumnDefinition

Constructors

Name Description
TTableColumn​Definition Overloaded
 TTableColumnDefinition(String, Int32)
TTableColumnDefinition(String, Int32, Nullable<TTableFormula>, Nullable<TTableFormula>, String, String, String, TTotalsRowFunction, String)

Methods

Name | Description
GetHashCode | Hashcode for the column.
Equals | Returns true if obj has the same data as this instance.

Operators

Name | Description
Equality | Returns true if both objects have the same data.
Inequality | Returns true if both objects have different data.

Properties

Name | Description
Name | Name of the column. Note that when the table has a header row, the names will be read from the cells where the column is, not from this name. This property is mostly useful if the table doesn't have headers.
Id | Unique id that identifies this column. It should not change when the column name changes or the column moves its position.
CalculatedColumn​Formula | Stores the formula that is used to perform the calculation for each cell in this column. Note that the column can have different formulas from this one, but this is normally not the case. This formula is also used by Excel to automatically add new formulas when you add new rows to the table. FlexCel doesn't automatically adds this formula to the new rows, you need to set the cells to the formula manually if you want to.
TotalsRowFormula | A custom formula for aggregating values from the column. This formula is only used if TotalsRowFunction is set to "Custom". Additionally, FlexCel will ignore this value when adding a table with totals and read the formula from the cell itself. If the table doesn't have a total row, then this value will be used.
DataCellStyle | Style for the cells in the column, if they don't have a given cell style. This property has more priority than the table cell style, but less than the cell style. This value is used when adding a new empty row as a default for the column.
HeaderRowCellStyle | Style for the header row cell in the column, if it doesn't have a given cell style. This property has more priority than the table header row cell style, but less than the cell style. FlexCel will ignore this value when adding a table and read the style from the cell itself.
TotalsRowCellStyle | Style for the totals row cell in the column, if it doesn't have a given cell style. This property has more priority than the table totals row cell style, but less than the cell style. FlexCel will ignore this value when adding a table with totals and read the formula from the cell itself. If the table doesn't have a total row, then this value will be used.
TotalsRowFunction | An enumeration that specifies what function is used to aggregate the data in a column. When set to custom, the value in TotalsRowFormula is used instead. Additionally, FlexCel will ignore this value when adding a table with totals and read the formula from the cell itself. If the table doesn't have a total row, then this value will be used.
TotalsRowLabel | A String to show in the totals row cell for this column. This is ignored unless TotalsRowFunction is none. Additionally, FlexCel will ignore this value when adding a table with totals and read the formula from the cell itself. If the table doesn't have a total row, then this value will be used.


TTableColumnDefinition.TTableColumnDefinition Constructor | FlexCel Studio for the .NET Framework documentation

TTableColumnDefinition.TTableColumnDefinition Constructor

Overloads

  • TTableColumnDefinition.TTableColumnDefinition(String, Int32)
  • TTableColumnDefinition.TTableColumnDefinition(String, Int32, Nullable<TTableFormula>, Nullable<TTableFormula>, String, String, String, TTotalsRowFunction, String)

TTableColumnDefinition.TTableColumnDefinition(String, Int32)

Creates a new TTableColumnDefinition with a Name and Id.

Syntax

Namespace: FlexCel.Core

public TTableColumnDefinition(String aName, Int32 aId)

Parameters

<-> | Parameter | Type | Description
 | aName | String | Name of the column.
 | aId | Int32 | Id used to identify the column. It must be unique in the table, and it must not change when the column name change or the column moves.

See also

  • TTableColumnDefinition

TTableColumnDefinition.TTableColumnDefinition(String, Int32, Nullable<TTableFormula>, Nullable<TTableFormula>, String, String, String, TTotalsRowFunction, String)

Creates a new TTableColumnDefinition.

Syntax

Namespace: FlexCel.Core

public TTableColumnDefinition(String aName, Int32 aId, Nullable<TTableFormula> aCalculatedColumnFormula, Nullable<TTableFormula> aTotalsRowFormula, String aDataCellStyle, String aHeaderRowCellStyle, String aTotalsRowCellStyle, TTotalsRowFunction aTotalsRowFunction, String aTotalsRowLabel)

Parameters

<-> | Parameter | Type | Description
 | aName | String | Name of the column.
 | aId | Int32 | Id used to identify the column. It must be unique in the table, and it must not change when the column name change or the column moves.
 | aCalculatedColumnFormula | Nullable<TTableFormula> | Stores the formula that is used to perform the calculation for each cell in this column. Note that the column can have different formulas from this one, but this is normally not the case. This formula is also used by Excel to automatically add new formulas when you add new rows to the table. FlexCel doesn't automatically adds this formula to the new rows, you need to set the cells to the formula manually if you want to.
 | aTotalsRowFormula | Nullable<TTableFormula> | A custom formula for aggregating values from the column. This formula is only used if TotalsRowFunction is set to "Custom".
 | aDataCellStyle | String | Style for the cells in the column, if they don't have a given cell style.
 | aHeaderRowCellStyle | String | Style for the header row cell in the column, if it doesn't have a given cell style.
 | aTotalsRowCellStyle | String | Style for the totals row cell in the column, if it doesn't have a given cell style.
 | aTotalsRowFunction | TTotalsRowFunction | An enumeration that specifies what function is used to aggregate the data in a column.
 | aTotalsRowLabel | String | A String to show in the totals row cell for this column. This is ignored unless TotalsRowFunction is none.

See also

  • TTableColumnDefinition


TTableColumnDefinition.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TTableColumnDefinition.GetHashCode Method

Hashcode for the column.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TTableColumnDefinition


TTableColumnDefinition.Equals Method | FlexCel Studio for the .NET Framework documentation

TTableColumnDefinition.Equals Method

Returns true if obj has the same data as this instance.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TTableColumnDefinition


TTableColumnDefinition.Equality Operator | FlexCel Studio for the .NET Framework documentation

TTableColumnDefinition.Equality Operator

Returns true if both objects have the same data.

Syntax

Namespace: FlexCel.Core

public static Boolean op_Equality(TTableColumnDefinition o1, TTableColumnDefinition o2)

Parameters

<-> | Parameter | Type | Description
 | o1 | TTableColumn​Definition |
 | o2 | TTableColumn​Definition |

See also

  • TTableColumnDefinition


TTableColumnDefinition.Inequality Operator | FlexCel Studio for the .NET Framework documentation

TTableColumnDefinition.Inequality Operator

Returns true if both objects have different data.

Syntax

Namespace: FlexCel.Core

public static Boolean op_Inequality(TTableColumnDefinition o1, TTableColumnDefinition o2)

Parameters

<-> | Parameter | Type | Description
 | o1 | TTableColumn​Definition |
 | o2 | TTableColumn​Definition |

See also

  • TTableColumnDefinition


TTableColumnDefinition.Name Property | FlexCel Studio for the .NET Framework documentation

TTableColumnDefinition.Name Property

Name of the column. Note that when the table has a header row, the names will be read from the cells where the column is, not from this name. This property is mostly useful if the table doesn't have headers.

Syntax

Namespace: FlexCel.Core

public String Name { get; }

See also

  • TTableColumnDefinition


TTableColumnDefinition.Id Property | FlexCel Studio for the .NET Framework documentation

TTableColumnDefinition.Id Property

Unique id that identifies this column. It should not change when the column name changes or the column moves its position.

Syntax

Namespace: FlexCel.Core

public Int32 Id { get; }

See also

  • TTableColumnDefinition


TTableColumnDefinition.CalculatedColumnFormula Property | FlexCel Studio for the .NET Framework documentation

TTableColumnDefinition.CalculatedColumnFormula Property

Stores the formula that is used to perform the calculation for each cell in this column. Note that the column can have different formulas from this one, but this is normally not the case. This formula is also used by Excel to automatically add new formulas when you add new rows to the table. FlexCel doesn't automatically adds this formula to the new rows, you need to set the cells to the formula manually if you want to.

Syntax

Namespace: FlexCel.Core

public Nullable<TTableFormula> CalculatedColumnFormula { get; }

See also

  • TTableColumnDefinition


TTableColumnDefinition.TotalsRowFormula Property | FlexCel Studio for the .NET Framework documentation

TTableColumnDefinition.TotalsRowFormula Property

A custom formula for aggregating values from the column. This formula is only used if TotalsRowFunction is set to "Custom". Additionally, FlexCel will ignore this value when adding a table with totals and read the formula from the cell itself. If the table doesn't have a total row, then this value will be used.

Syntax

Namespace: FlexCel.Core

public Nullable<TTableFormula> TotalsRowFormula { get; }

See also

  • TTableColumnDefinition


TTableColumnDefinition.DataCellStyle Property | FlexCel Studio for the .NET Framework documentation

TTableColumnDefinition.DataCellStyle Property

Style for the cells in the column, if they don't have a given cell style. This property has more priority than the table cell style, but less than the cell style. This value is used when adding a new empty row as a default for the column.

Syntax

Namespace: FlexCel.Core

public String DataCellStyle { get; }

See also

  • TTableColumnDefinition


TTableColumnDefinition.HeaderRowCellStyle Property | FlexCel Studio for the .NET Framework documentation

TTableColumnDefinition.HeaderRowCellStyle Property

Style for the header row cell in the column, if it doesn't have a given cell style. This property has more priority than the table header row cell style, but less than the cell style. FlexCel will ignore this value when adding a table and read the style from the cell itself.

Syntax

Namespace: FlexCel.Core

public String HeaderRowCellStyle { get; }

See also

  • TTableColumnDefinition


TTableColumnDefinition.TotalsRowCellStyle Property | FlexCel Studio for the .NET Framework documentation

TTableColumnDefinition.TotalsRowCellStyle Property

Style for the totals row cell in the column, if it doesn't have a given cell style. This property has more priority than the table totals row cell style, but less than the cell style. FlexCel will ignore this value when adding a table with totals and read the formula from the cell itself. If the table doesn't have a total row, then this value will be used.

Syntax

Namespace: FlexCel.Core

public String TotalsRowCellStyle { get; }

See also

  • TTableColumnDefinition


TTableColumnDefinition.TotalsRowFunction Property | FlexCel Studio for the .NET Framework documentation

TTableColumnDefinition.TotalsRowFunction Property

An enumeration that specifies what function is used to aggregate the data in a column. When set to custom, the value in TotalsRowFormula is used instead. Additionally, FlexCel will ignore this value when adding a table with totals and read the formula from the cell itself. If the table doesn't have a total row, then this value will be used.

Syntax

Namespace: FlexCel.Core

public TTotalsRowFunction TotalsRowFunction { get; }

See also

  • TTableColumnDefinition


TTableColumnDefinition.TotalsRowLabel Property | FlexCel Studio for the .NET Framework documentation

TTableColumnDefinition.TotalsRowLabel Property

A String to show in the totals row cell for this column. This is ignored unless TotalsRowFunction is none. Additionally, FlexCel will ignore this value when adding a table with totals and read the formula from the cell itself. If the table doesn't have a total row, then this value will be used.

Syntax

Namespace: FlexCel.Core

public String TotalsRowLabel { get; }

See also

  • TTableColumnDefinition


TTableFont Structure | FlexCel Studio for the .NET Framework documentation

TTableFont Structure

Determines which parts of the font will be applied in the Table.

Syntax

Namespace: FlexCel.Core

public struct TTableFont

Fields

Name | Description
Color | Color of the font.
Style | Style of the font.
Underline | Underline of the font.

Constructors

Name | Description
TTableFont | Creates a new struct setting the members.

Methods

Name | Description
Equals | Returns true if both objects are the same.
GetHashCode | Returns the hashcode of the struct.

Operators

Name | Description
Equality | Returns true if both objects have the same information.
Inequality | returns true if both objects are different.


TTableFont.Color Field | FlexCel Studio for the .NET Framework documentation

TTableFont.Color Field

Color of the font.

Syntax

Namespace: FlexCel.Core

public TExcelColor Color

See also

  • TTableFont


TTableFont.Style Field | FlexCel Studio for the .NET Framework documentation

TTableFont.Style Field

Style of the font.

Syntax

Namespace: FlexCel.Core

public TFlxFontStyles Style

See also

  • TTableFont


TTableFont.Underline Field | FlexCel Studio for the .NET Framework documentation

TTableFont.Underline Field

Underline of the font.

Syntax

Namespace: FlexCel.Core

public TFlxUnderline Underline

See also

  • TTableFont


TTableFont.TTableFont Constructor | FlexCel Studio for the .NET Framework documentation

TTableFont.TTableFont Constructor

Creates a new struct setting the members.

Syntax

Namespace: FlexCel.Core

public TTableFont(Int32 aSize20, TExcelColor aColor, TFlxFontStyles aStyle, TFlxUnderline aUnderline)

Parameters

<-> | Parameter | Type | Description
 | aSize20 | Int32 | Size of the font, multiplied by 20.
 | aColor | TExcelColor | Color of the font.
 | aStyle | TFlxFontStyles | Style of the font.
 | aUnderline | TFlxUnderline | Underline of the font.

See also

  • TTableFont


TTableFont.Equals Method | FlexCel Studio for the .NET Framework documentation

TTableFont.Equals Method

Returns true if both objects are the same.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TTableFont


TTableFont.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TTableFont.GetHashCode Method

Returns the hashcode of the struct.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TTableFont


TTableFont.Equality Operator | FlexCel Studio for the .NET Framework documentation

TTableFont.Equality Operator

Returns true if both objects have the same information.

Syntax

Namespace: FlexCel.Core

public static Boolean op_Equality(TTableFont o1, TTableFont o2)

Parameters

<-> | Parameter | Type | Description
 | o1 | TTableFont |
 | o2 | TTableFont |

See also

  • TTableFont


TTableFont.Inequality Operator | FlexCel Studio for the .NET Framework documentation

TTableFont.Inequality Operator

returns true if both objects are different.

Syntax

Namespace: FlexCel.Core

public static Boolean op_Inequality(TTableFont o1, TTableFont o2)

Parameters

<-> | Parameter | Type | Description
 | o1 | TTableFont |
 | o2 | TTableFont |

See also

  • TTableFont


TTableFormula Structure | FlexCel Studio for the .NET Framework documentation

TTableFormula Structure

Contains the formula for a table total or calculated formula.

Syntax

Namespace: FlexCel.Core

public struct TTableFormula

Constructors

Name | Description
TTableFormula | Creates a new TTableFormula.

Methods

Name | Description
GetHashCode | Hashcode for the formula.
Equals | Returns true if obj has the same data as this instance.

Operators

Name | Description
Equality | Returns true if both objects have the same data.
Inequality | Returns true if both objects have different data.

Properties

Name | Description
Formula | String with the formula.
IsArray | True if it is an array formula, false otherwise.


TTableFormula.TTableFormula Constructor | FlexCel Studio for the .NET Framework documentation

TTableFormula.TTableFormula Constructor

Creates a new TTableFormula.

Syntax

Namespace: FlexCel.Core

public TTableFormula(String aFormula, Boolean aIsArray)

Parameters

<-> | Parameter | Type | Description
 | aFormula | String | String with the formula.
 | aIsArray | Boolean | True if it is an array formula, false otherwise.

See also

  • TTableFormula


TTableFormula.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TTableFormula.GetHashCode Method

Hashcode for the formula.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TTableFormula


TTableFormula.Equals Method | FlexCel Studio for the .NET Framework documentation

TTableFormula.Equals Method

Returns true if obj has the same data as this instance.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TTableFormula


TTableFormula.Equality Operator | FlexCel Studio for the .NET Framework documentation

TTableFormula.Equality Operator

Returns true if both objects have the same data.

Syntax

Namespace: FlexCel.Core

public static Boolean op_Equality(TTableFormula o1, TTableFormula o2)

Parameters

<-> | Parameter | Type | Description
 | o1 | TTableFormula |
 | o2 | TTableFormula |

See also

  • TTableFormula


TTableFormula.Inequality Operator | FlexCel Studio for the .NET Framework documentation

TTableFormula.Inequality Operator

Returns true if both objects have different data.

Syntax

Namespace: FlexCel.Core

public static Boolean op_Inequality(TTableFormula o1, TTableFormula o2)

Parameters

<-> | Parameter | Type | Description
 | o1 | TTableFormula |
 | o2 | TTableFormula |

See also

  • TTableFormula


TTableFormula.Formula Property | FlexCel Studio for the .NET Framework documentation

TTableFormula.Formula Property

String with the formula.

Syntax

Namespace: FlexCel.Core

public String Formula { get; }

See also

  • TTableFormula


TTableFormula.IsArray Property | FlexCel Studio for the .NET Framework documentation

TTableFormula.IsArray Property

True if it is an array formula, false otherwise.

Syntax

Namespace: FlexCel.Core

public Boolean IsArray { get; }

See also

  • TTableFormula


TTableStyle Structure | FlexCel Studio for the .NET Framework documentation

TTableStyle Structure

Defines a table style.

Syntax

Namespace: FlexCel.Core

public struct TTableStyle

Fields

Name | Description
Name | The name of the style.
ShowColumnStripes | If true, the columns will alternate between 2 colors.
ShowFirstColumn | Defines if the first column in the table has the style applied.
ShowLastColumn | Defines if the last column in the table has the style applied.
ShowRowStripes | Defines if the rows will alternate between 2 colors.

Constructors

Name | Description
TTableStyle | Creates a new TTableStyle object.

Methods

Name | Description
Equals | Overloaded Equals(TTableStyle) Equals(Object)
GetHashCode | Returns the hashcode of the object.

Operators

Name | Description
Equality | Returns true if both objects have the same data.
Inequality | Returns true if a and b have different data.


TTableStyle.Name Field | FlexCel Studio for the .NET Framework documentation

TTableStyle.Name Field

The name of the style.

Syntax

Namespace: FlexCel.Core

public readonly String Name

See also

  • TTableStyle


TTableStyle.ShowColumnStripes Field | FlexCel Studio for the .NET Framework documentation

TTableStyle.ShowColumnStripes Field

If true, the columns will alternate between 2 colors.

Syntax

Namespace: FlexCel.Core

public readonly Boolean ShowColumnStripes

See also

  • TTableStyle


TTableStyle.ShowFirstColumn Field | FlexCel Studio for the .NET Framework documentation

TTableStyle.ShowFirstColumn Field

Defines if the first column in the table has the style applied.

Syntax

Namespace: FlexCel.Core

public readonly Boolean ShowFirstColumn

See also

  • TTableStyle


TTableStyle.ShowLastColumn Field | FlexCel Studio for the .NET Framework documentation

TTableStyle.ShowLastColumn Field

Defines if the last column in the table has the style applied.

Syntax

Namespace: FlexCel.Core

public readonly Boolean ShowLastColumn

See also

  • TTableStyle


TTableStyle.ShowRowStripes Field | FlexCel Studio for the .NET Framework documentation

TTableStyle.ShowRowStripes Field

Defines if the rows will alternate between 2 colors.

Syntax

Namespace: FlexCel.Core

public readonly Boolean ShowRowStripes

See also

  • TTableStyle


TTableStyle.TTableStyle Constructor | FlexCel Studio for the .NET Framework documentation

TTableStyle.TTableStyle Constructor

Creates a new TTableStyle object.

Syntax

Namespace: FlexCel.Core

public TTableStyle(String aName, Boolean aShowColumnStripes, Boolean aShowFirstColumn, Boolean aShowLastColumn, Boolean aShowRowStripes)

Parameters

<-> | Parameter | Type | Description
 | aName | String |
 | aShowColumnStripes | Boolean |
 | aShowFirstColumn | Boolean |
 | aShowLastColumn | Boolean |
 | aShowRowStripes | Boolean |

See also

  • TTableStyle


TTableStyle.Equals Method | FlexCel Studio for the .NET Framework documentation

TTableStyle.Equals Method

Overloads

  • TTableStyle.Equals(TTableStyle)
  • TTableStyle.Equals(Object)

TTableStyle.Equals(TTableStyle)

Returns true if both objects are the same.

Syntax

Namespace: FlexCel.Core

public Boolean Equals(TTableStyle b)

Parameters

<-> | Parameter | Type | Description
 | b | TTableStyle |

See also

  • TTableStyle

TTableStyle.Equals(Object)

Returns true if both objects are the same

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TTableStyle


TTableStyle.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TTableStyle.GetHashCode Method

Returns the hashcode of the object.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TTableStyle


TTableStyle.Equality Operator | FlexCel Studio for the .NET Framework documentation

TTableStyle.Equality Operator

Returns true if both objects have the same data.

Syntax

Namespace: FlexCel.Core

public static Boolean op_Equality(TTableStyle a, TTableStyle b)

Parameters

<-> | Parameter | Type | Description
 | a | TTableStyle |
 | b | TTableStyle |

See also

  • TTableStyle


TTableStyle.Inequality Operator | FlexCel Studio for the .NET Framework documentation

TTableStyle.Inequality Operator

Returns true if a and b have different data.

Syntax

Namespace: FlexCel.Core

public static Boolean op_Inequality(TTableStyle a, TTableStyle b)

Parameters

<-> | Parameter | Type | Description
 | a | TTableStyle |
 | b | TTableStyle |

See also

  • TTableStyle


TThemeTextFont Structure | FlexCel Studio for the .NET Framework documentation

TThemeTextFont Structure

The characteristics that define a font.

Syntax

Namespace: FlexCel.Core

public struct TThemeTextFont

Constructors

Name | Description
TThemeTextFont | Overloaded TThemeTextFont(String) TThemeTextFont(String, String, TPitchFamily, TFontCharSet)

Methods

Name | Description
TypefaceName | Returns the actual font name used. Different from Typeface, this property will change the "+mj" and "+mn" strings in the actual major and minor fonts.
CompareTo | Returns -1, 0 or 1 depending if the objects is smaller, equal or bigger than the other.
GetHashCode | Returns a hashcode for the object.

Properties

Name | Description
Typeface | Specifies the typeface, or name of the font that is to be used. The typeface is a string name of the specific font that should be used in rendering the presentation. If this font is not available within the font list of the generating application than font substitution logic should be utilized in order to select an alternate font. This string can also be "+mj-lt" for the major font, and "+mn-lt" for the minor font. To get the typeface name, use TypefaceName
Scheme | Returns the scheme for the font, if there is one.
Panose | Specifies the Panose-1 classification number for the current font. This is a string consisting of 20 hexadecimal digits which defines the Panose-1 font classification
Pitch | Specifies the font pitch as well as the font family for the corresponding font.
CharSet | Specifies the character set which is supported by the parent font. This information can be used in font substitution logic to locate an appropriate substitute font when this font is not available. This information is determined by querying the font when present and shall not be modified when the font is not available.


TThemeTextFont.TThemeTextFont Constructor | FlexCel Studio for the .NET Framework documentation

TThemeTextFont.TThemeTextFont Constructor

Overloads

  • TThemeTextFont.TThemeTextFont(String)
  • TThemeTextFont.TThemeTextFont(String, String, TPitchFamily, TFontCharSet)

TThemeTextFont.TThemeTextFont(String)

Creates a new TThemeTextFont.

Syntax

Namespace: FlexCel.Core

public TThemeTextFont(String aTypeface)

Parameters

<-> | Parameter | Type | Description
 | aTypeface | String | See Typeface

See also

  • TThemeTextFont

TThemeTextFont.TThemeTextFont(String, String, TPitchFamily, TFontCharSet)

Creates a new TThemeTextFont.

Syntax

Namespace: FlexCel.Core

public TThemeTextFont(String aTypeface, String aPanose, TPitchFamily aPitch, TFontCharSet aCharSet)

Parameters

<-> | Parameter | Type | Description
 | aTypeface | String | See Typeface
 | aPanose | String | See Panose
 | aPitch | TPitchFamily | See Pitch
 | aCharSet | TFontCharSet | See CharSet

See also

  • TThemeTextFont


TThemeTextFont.TypefaceName Method | FlexCel Studio for the .NET Framework documentation

TThemeTextFont.TypefaceName Method

Returns the actual font name used. Different from Typeface, this property will change the "+mj" and "+mn" strings in the actual major and minor fonts.

Syntax

Namespace: FlexCel.Core

public String TypefaceName(ExcelFile xls)

Parameters

<-> | Parameter | Type | Description
 | xls | ExcelFile |

See also

  • TThemeTextFont


TThemeTextFont.CompareTo Method | FlexCel Studio for the .NET Framework documentation

TThemeTextFont.CompareTo Method

Returns -1, 0 or 1 depending if the objects is smaller, equal or bigger than the other.

Syntax

Namespace: FlexCel.Core

public Int32 CompareTo(TThemeTextFont obj)

Parameters

<-> | Parameter | Type | Description
 | obj | TThemeTextFont |

See also

  • TThemeTextFont


TThemeTextFont.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TThemeTextFont.GetHashCode Method

Returns a hashcode for the object.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TThemeTextFont


TThemeTextFont.Typeface Property | FlexCel Studio for the .NET Framework documentation

TThemeTextFont.Typeface Property

Specifies the typeface, or name of the font that is to be used. The typeface is a string name of the specific font that should be used in rendering the presentation. If this font is not available within the font list of the generating application than font substitution logic should be utilized in order to select an alternate font. This string can also be "+mj-lt" for the major font, and "+mn-lt" for the minor font. To get the typeface name, use TypefaceName

Syntax

Namespace: FlexCel.Core

public String Typeface { get; }

See also

  • TThemeTextFont


TThemeTextFont.Scheme Property | FlexCel Studio for the .NET Framework documentation

TThemeTextFont.Scheme Property

Returns the scheme for the font, if there is one.

Syntax

Namespace: FlexCel.Core

public TFontScheme Scheme { get; }

See also

  • TThemeTextFont


TThemeTextFont.Panose Property | FlexCel Studio for the .NET Framework documentation

TThemeTextFont.Panose Property

Specifies the Panose-1 classification number for the current font. This is a string consisting of 20 hexadecimal digits which defines the Panose-1 font classification

Syntax

Namespace: FlexCel.Core

public String Panose { get; }

See also

  • TThemeTextFont


TThemeTextFont.Pitch Property | FlexCel Studio for the .NET Framework documentation

TThemeTextFont.Pitch Property

Specifies the font pitch as well as the font family for the corresponding font.

Syntax

Namespace: FlexCel.Core

public TPitchFamily Pitch { get; }

See also

  • TThemeTextFont


TThemeTextFont.CharSet Property | FlexCel Studio for the .NET Framework documentation

TThemeTextFont.CharSet Property

Specifies the character set which is supported by the parent font. This information can be used in font substitution logic to locate an appropriate substitute font when this font is not available. This information is determined by querying the font when present and shall not be modified when the font is not available.

Syntax

Namespace: FlexCel.Core

public TFontCharSet CharSet { get; }

See also

  • TThemeTextFont


TUIColor Structure | FlexCel Studio for the .NET Framework documentation

TUIColor Structure

Represents a color used to draw in a canvas (gdi+, wpf, etc) in a way that is independent of the drawing framework.

Syntax

Namespace: FlexCel.Core

public struct TUIColor

Constructors

Name | Description
TUIColor | Creates a new color with the ARGB components.

Methods

Name Description
FromArgb Overloaded
 FromArgb(Int32, TUIColor)
FromArgb(Int32, Int32, Int32)
FromArgb(Int32, Int32, Int32, Int32)
ToArgb Gets the 32 bit ARGB color from this structure.

Properties

Name | Description
Empty | Returns an empty color. This color isn't valid.
A | Alpha component, between 0 and 255.
R | Red component, between 0 and 255.
G | Green component, between 0 and 255
B | Blue component, between 0 and 255
IsEmpty | Returns true if this color is the same as Empty
IsNamedColor | This method returns always false, TUIColor doesn't support named colors.


TUIColor.TUIColor Constructor | FlexCel Studio for the .NET Framework documentation

TUIColor.TUIColor Constructor

Creates a new color with the ARGB components.

Syntax

Namespace: FlexCel.Core

public TUIColor(Int64 ARGB)

Parameters

<-> | Parameter | Type | Description
 | ARGB | Int64 | Alpha, red, green and blue components as AARRBBGG

See also

  • TUIColor


TUIColor.FromArgb Method | FlexCel Studio for the .NET Framework documentation

TUIColor.FromArgb Method

Overloads

  • TUIColor.FromArgb(Int32, TUIColor)
  • TUIColor.FromArgb(Int32, Int32, Int32)
  • TUIColor.FromArgb(Int32, Int32, Int32, Int32)

TUIColor.FromArgb(Int32, TUIColor)

Returns a color base in other color but with a different transparency.

Syntax

Namespace: FlexCel.Core

public static TUIColor FromArgb(Int32 alpha, TUIColor aColor)

Parameters

<-> | Parameter | Type | Description
 | alpha | Int32 | Alpha value for the new color (between 0 and 255)
 | aColor | TUIColor | Source color.

See also

  • TUIColor

TUIColor.FromArgb(Int32, Int32, Int32)

Creates a color from Red, Green and Blue components without transparency.

Syntax

Namespace: FlexCel.Core

public static TUIColor FromArgb(Int32 red, Int32 green, Int32 blue)

Parameters

<-> | Parameter | Type | Description
 | red | Int32 | Red component, between 0 and 255.
 | green | Int32 | Red component, between 0 and 255.
 | blue | Int32 | Blue component, between 0 and 255.

See also

  • TUIColor

TUIColor.FromArgb(Int32, Int32, Int32, Int32)

Creates a color from Red, Green and Blue components with transparency.

Syntax

Namespace: FlexCel.Core

public static TUIColor FromArgb(Int32 alpha, Int32 red, Int32 green, Int32 blue)

Parameters

<-> | Parameter | Type | Description
 | alpha | Int32 | Alpha component, between 0 (completely transparent) and 255 (completely opaque).
 | red | Int32 | Red component, between 0 and 255.
 | green | Int32 | Red component, between 0 and 255.
 | blue | Int32 | Blue component, between 0 and 255.

See also

  • TUIColor


TUIColor.ToArgb Method | FlexCel Studio for the .NET Framework documentation

TUIColor.ToArgb Method

Gets the 32 bit ARGB color from this structure.

Syntax

Namespace: FlexCel.Core

public Int32 ToArgb()

See also

  • TUIColor


TUIColor.Empty Property | FlexCel Studio for the .NET Framework documentation

TUIColor.Empty Property

Returns an empty color. This color isn't valid.

Syntax

Namespace: FlexCel.Core

public static TUIColor Empty { get; }

See also

  • TUIColor


TUIColor.A Property | FlexCel Studio for the .NET Framework documentation

TUIColor.A Property

Alpha component, between 0 and 255.

Syntax

Namespace: FlexCel.Core

public Byte A { get; }

See also

  • TUIColor


TUIColor.R Property | FlexCel Studio for the .NET Framework documentation

TUIColor.R Property

Red component, between 0 and 255.

Syntax

Namespace: FlexCel.Core

public Byte R { get; }

See also

  • TUIColor


TUIColor.G Property | FlexCel Studio for the .NET Framework documentation

TUIColor.G Property

Green component, between 0 and 255

Syntax

Namespace: FlexCel.Core

public Byte G { get; }

See also

  • TUIColor


TUIColor.B Property | FlexCel Studio for the .NET Framework documentation

TUIColor.B Property

Blue component, between 0 and 255

Syntax

Namespace: FlexCel.Core

public Byte B { get; }

See also

  • TUIColor


TUIColor.IsEmpty Property | FlexCel Studio for the .NET Framework documentation

TUIColor.IsEmpty Property

Returns true if this color is the same as Empty

Syntax

Namespace: FlexCel.Core

public Boolean IsEmpty { get; }

See also

  • TUIColor


TUIColor.IsNamedColor Property | FlexCel Studio for the .NET Framework documentation

TUIColor.IsNamedColor Property

This method returns always false, TUIColor doesn't support named colors.

Syntax

Namespace: FlexCel.Core

public Boolean IsNamedColor { get; }

See also

  • TUIColor


TUIGradientStop Structure | FlexCel Studio for the .NET Framework documentation

TUIGradientStop Structure

A structure describing a gradient point, with its color and position in the gradient.

Syntax

Namespace: FlexCel.Core

public struct TUIGradientStop

Constructors

Name | Description
TUIGradientStop | Creates a new gradient stop.

Properties

Name | Description
Position | Position of the stop in the gradient. Must be between 0 (start of the gradient) and 1 (end of the gradient).
Color | Color for this stop in the gradient.


TUIGradientStop.TUIGradientStop Constructor | FlexCel Studio for the .NET Framework documentation

TUIGradientStop.TUIGradientStop Constructor

Creates a new gradient stop.

Syntax

Namespace: FlexCel.Core

public TUIGradientStop(Double aPosition, TUIColor aColor)

Parameters

<-> | Parameter | Type | Description
 | aPosition | Double | Between 0 and 1
 | aColor | TUIColor | Color for this particular point.

See also

  • TUIGradientStop


TUIGradientStop.Position Property | FlexCel Studio for the .NET Framework documentation

TUIGradientStop.Position Property

Position of the stop in the gradient. Must be between 0 (start of the gradient) and 1 (end of the gradient).

Syntax

Namespace: FlexCel.Core

public Double Position { get; set; }

See also

  • TUIGradientStop


TUIGradientStop.Color Property | FlexCel Studio for the .NET Framework documentation

TUIGradientStop.Color Property

Color for this stop in the gradient.

Syntax

Namespace: FlexCel.Core

public TUIColor Color { get; set; }

See also

  • TUIGradientStop


TUIInterpolationMode Structure | FlexCel Studio for the .NET Framework documentation

TUIInterpolationMode Structure

Interpolation mode. See System.Drawing.InterpolationMode for details.

Syntax

Namespace: FlexCel.Core

public struct TUIInterpolationMode

Properties

Name | Description
FlexCelDefault | Default mode used by FlexCel. You can change this in your application to change how FlexCel will render the images.


TUIInterpolationMode.FlexCelDefault Property | FlexCel Studio for the .NET Framework documentation

TUIInterpolationMode.FlexCelDefault Property

Default mode used by FlexCel. You can change this in your application to change how FlexCel will render the images.

Syntax

Namespace: FlexCel.Core

public static TUIInterpolationMode FlexCelDefault { get; set; }

See also

  • TUIInterpolationMode


TUIRectangle Structure | FlexCel Studio for the .NET Framework documentation

TUIRectangle Structure

A platform independent rectangle. Coordinates are floating point numbers.

Syntax

Namespace: FlexCel.Core

public struct TUIRectangle

Constructors

Name | Description
TUIRectangle | Creates a new UIRectangle with the specified starting point, height and width.

Methods

Name Description
FromLTRB Creates a new rectangle with the specified coordinates.
Inflate Overloaded
 Inflate(Double, Double)
Inflate(TUIRectangle, Double, Double)
Offset Moves the rectangle by (dx, dy), keeping the with and height the same.
Union Returns a new rectangle which contains both of the source rectangles.
MakePositive This method ensures both width adn height are positive. If they are negative, X and Y are moved so the rectangle is the same but with positive dimensions.
Contains Returns true if point is inside the rectangle.
FullyInside Returns true if this rectangle is fully inside other.
FullyOutside Returns true if this rectangle is fully outside other.
ToString Returns a string with the rectangle's data.
Intersect Returns a rectangle which is the intersection of this one and the new one.

Operators

Name | Description
Implicit Conversion | Overloaded Implicit conversion from TUIRectangle to RectangleF Implicit conversion from RectangleF to TUIRectangle

Properties

Name | Description
Empty | Returns a rectangle with X = 0, Y = 0, Width = 0 and Height = 0.
Location | Returns a TPointF with the Left and Top coordinates of the rectangle.
BottomRight | Returns a TPointF with the Right and Bottom coordinates of the rectangle.
X | Left coordinate of the rectangle.
Y | Top coordinate of the rectangle.
Width | Width of the rectangle.
Height | Height of the rectangle.
Top | Top coordinate. This is the same as Y, but it is readonly. (Y is read write).
Left | Left coordinate. This is the same as X, but it is readonly. (X is read write).
Right | Right coordinate.
Bottom | Bottom coordinate.


TUIRectangle.TUIRectangle Constructor | FlexCel Studio for the .NET Framework documentation

TUIRectangle.TUIRectangle Constructor

Creates a new UIRectangle with the specified starting point, height and width.

Syntax

Namespace: FlexCel.Core

public TUIRectangle(Double aX, Double aY, Double aWidth, Double aHeight)

Parameters

<-> | Parameter | Type | Description
 | aX | Double | X coordinate of the rectangle.
 | aY | Double | Y coordinate of the rectangle.
 | aWidth | Double | Width of the rectangle.
 | aHeight | Double | Height of the rectangle

See also

  • TUIRectangle


TUIRectangle.FromLTRB Method | FlexCel Studio for the .NET Framework documentation

TUIRectangle.FromLTRB Method

Creates a new rectangle with the specified coordinates.

Syntax

Namespace: FlexCel.Core

public static TUIRectangle FromLTRB(Double aLeft, Double aTop, Double aRight, Double aBottom)

Parameters

<-> | Parameter | Type | Description
 | aLeft | Double | Left coordinate.
 | aTop | Double | Top coordinate.
 | aRight | Double | Right coordinate.
 | aBottom | Double | Bottom coordinate.

See also

  • TUIRectangle


TUIRectangle.Inflate Method | FlexCel Studio for the .NET Framework documentation

TUIRectangle.Inflate Method

Overloads

  • TUIRectangle.Inflate(Double, Double)
  • TUIRectangle.Inflate(TUIRectangle, Double, Double)

TUIRectangle.Inflate(Double, Double)

Subtracts dx from the left and adds dx to the right. Subtracts dy from the top and adds dy to the bottom.

Syntax

Namespace: FlexCel.Core

public void Inflate(Double dx, Double dy)

Parameters

<-> | Parameter | Type | Description
 | dx | Double | Value to inflate the rectangle in the x direction.
 | dy | Double | Value to inflate the rectangle in the y direction.

See also

  • TUIRectangle

TUIRectangle.Inflate(TUIRectangle, Double, Double)

Inflates the rectangle by (dx, dy). It is similar to the other inflate overload, but this is a static method, it won't modify a rectangle in place.

Syntax

Namespace: FlexCel.Core

public static TUIRectangle Inflate(TUIRectangle sourceRect, Double dx, Double dy)

Parameters

<-> | Parameter | Type | Description
 | sourceRect | TUIRectangle | Rectangle with the original coordinates.
 | dx | Double | X offset to inflate.
 | dy | Double | Y offset to inflate.

See also

  • TUIRectangle


TUIRectangle.Offset Method | FlexCel Studio for the .NET Framework documentation

TUIRectangle.Offset Method

Moves the rectangle by (dx, dy), keeping the with and height the same.

Syntax

Namespace: FlexCel.Core

public void Offset(Double dx, Double dy)

Parameters

<-> | Parameter | Type | Description
 | dx | Double | Offset to move the rectangle in the X direction.
 | dy | Double | Offset to move the rectangle in the Y direction.

See also

  • TUIRectangle


TUIRectangle.Union Method | FlexCel Studio for the .NET Framework documentation

TUIRectangle.Union Method

Returns a new rectangle which contains both of the source rectangles.

Syntax

Namespace: FlexCel.Core

public static TUIRectangle Union(TUIRectangle a, TUIRectangle b)

Parameters

<-> | Parameter | Type | Description
 | a | TUIRectangle | First rectangle.
 | b | TUIRectangle | Second rectangle.

See also

  • TUIRectangle


TUIRectangle.MakePositive Method | FlexCel Studio for the .NET Framework documentation

TUIRectangle.MakePositive Method

This method ensures both width adn height are positive. If they are negative, X and Y are moved so the rectangle is the same but with positive dimensions.

Syntax

Namespace: FlexCel.Core

public void MakePositive()

See also

  • TUIRectangle


TUIRectangle.Contains Method | FlexCel Studio for the .NET Framework documentation

TUIRectangle.Contains Method

Returns true if point is inside the rectangle.

Syntax

Namespace: FlexCel.Core

public Boolean Contains(TPointF point, Double margin)

Parameters

<-> | Parameter | Type | Description
 | point | TPointF | Point to check.
 | margin | Double | an extra margin where a point outside but very near the border is considered inside.

See also

  • TUIRectangle


TUIRectangle.FullyInside Method | FlexCel Studio for the .NET Framework documentation

TUIRectangle.FullyInside Method

Returns true if this rectangle is fully inside other.

Syntax

Namespace: FlexCel.Core

public Boolean FullyInside(TUIRectangle other)

Parameters

<-> | Parameter | Type | Description
 | other | TUIRectangle | Parent rectangle which we want to test we are inside.

See also

  • TUIRectangle


TUIRectangle.FullyOutside Method | FlexCel Studio for the .NET Framework documentation

TUIRectangle.FullyOutside Method

Returns true if this rectangle is fully outside other.

Syntax

Namespace: FlexCel.Core

public Boolean FullyOutside(TUIRectangle other)

Parameters

<-> | Parameter | Type | Description
 | other | TUIRectangle | Parent rectangle which we want to test we are outside.

See also

  • TUIRectangle


TUIRectangle.ToString Method | FlexCel Studio for the .NET Framework documentation

TUIRectangle.ToString Method

Returns a string with the rectangle's data.

Syntax

Namespace: FlexCel.Core

public override String ToString()

See also

  • TUIRectangle


TUIRectangle.Intersect Method | FlexCel Studio for the .NET Framework documentation

TUIRectangle.Intersect Method

Returns a rectangle which is the intersection of this one and the new one.

Syntax

Namespace: FlexCel.Core

public TUIRectangle Intersect(TUIRectangle coords)

Parameters

<-> | Parameter | Type | Description
 | coords | TUIRectangle |

See also

  • TUIRectangle


TUIRectangle Implicit Conversion Operator | FlexCel Studio for the .NET Framework documentation

TUIRectangle Implicit Conversion Operator

Overloads

  • Implicit conversion from TUIRectangle to RectangleF
  • Implicit conversion from RectangleF to TUIRectangle

Implicit conversion from TUIRectangle to RectangleF

Converts implicitly between a System.Drawing.RectangleF and a TUIRectangle.

Syntax

Namespace: FlexCel.Core

public static RectangleF op_Implicit(TUIRectangle r)

Parameters

<-> | Parameter | Type | Description
 | r | TUIRectangle |

See also

  • TUIRectangle

Implicit conversion from RectangleF to TUIRectangle

Converts implicitly between a System.Drawing.RectangleF and a TUIRectangle.

Syntax

Namespace: FlexCel.Core

public static TUIRectangle op_Implicit(RectangleF r)

Parameters

<-> | Parameter | Type | Description
 | r | RectangleF |

See also

  • TUIRectangle


TUIRectangle.Empty Property | FlexCel Studio for the .NET Framework documentation

TUIRectangle.Empty Property

Returns a rectangle with X = 0, Y = 0, Width = 0 and Height = 0.

Syntax

Namespace: FlexCel.Core

public static TUIRectangle Empty { get; }

See also

  • TUIRectangle


TUIRectangle.Location Property | FlexCel Studio for the .NET Framework documentation

TUIRectangle.Location Property

Returns a TPointF with the Left and Top coordinates of the rectangle.

Syntax

Namespace: FlexCel.Core

public TPointF Location { get; }

See also

  • TUIRectangle


TUIRectangle.BottomRight Property | FlexCel Studio for the .NET Framework documentation

TUIRectangle.BottomRight Property

Returns a TPointF with the Right and Bottom coordinates of the rectangle.

Syntax

Namespace: FlexCel.Core

public TPointF BottomRight { get; }

See also

  • TUIRectangle


TUIRectangle.X Property | FlexCel Studio for the .NET Framework documentation

TUIRectangle.X Property

Left coordinate of the rectangle.

Syntax

Namespace: FlexCel.Core

public Double X { get; set; }

See also

  • TUIRectangle


TUIRectangle.Y Property | FlexCel Studio for the .NET Framework documentation

TUIRectangle.Y Property

Top coordinate of the rectangle.

Syntax

Namespace: FlexCel.Core

public Double Y { get; set; }

See also

  • TUIRectangle


TUIRectangle.Width Property | FlexCel Studio for the .NET Framework documentation

TUIRectangle.Width Property

Width of the rectangle.

Syntax

Namespace: FlexCel.Core

public Double Width { get; set; }

See also

  • TUIRectangle


TUIRectangle.Height Property | FlexCel Studio for the .NET Framework documentation

TUIRectangle.Height Property

Height of the rectangle.

Syntax

Namespace: FlexCel.Core

public Double Height { get; set; }

See also

  • TUIRectangle


TUIRectangle.Top Property | FlexCel Studio for the .NET Framework documentation

TUIRectangle.Top Property

Top coordinate. This is the same as Y, but it is readonly. (Y is read write).

Syntax

Namespace: FlexCel.Core

public Double Top { get; }

See also

  • TUIRectangle


TUIRectangle.Left Property | FlexCel Studio for the .NET Framework documentation

TUIRectangle.Left Property

Left coordinate. This is the same as X, but it is readonly. (X is read write).

Syntax

Namespace: FlexCel.Core

public Double Left { get; }

See also

  • TUIRectangle


TUIRectangle.Right Property | FlexCel Studio for the .NET Framework documentation

TUIRectangle.Right Property

Right coordinate.

Syntax

Namespace: FlexCel.Core

public Double Right { get; }

See also

  • TUIRectangle


TUIRectangle.Bottom Property | FlexCel Studio for the .NET Framework documentation

TUIRectangle.Bottom Property

Bottom coordinate.

Syntax

Namespace: FlexCel.Core

public Double Bottom { get; }

See also

  • TUIRectangle


TUISize Structure | FlexCel Studio for the .NET Framework documentation

TUISize Structure

A platform independent Size structure. Width and Height are floating point numbers.

Syntax

Namespace: FlexCel.Core

public struct TUISize

Constructors

Name | Description
TUISize | Creates a new size with the specified width and height.

Operators

Name | Description
Implicit Conversion | Overloaded Implicit conversion from SizeF to TUISize Implicit conversion from TUISize to SizeF

Properties

Name | Description
Empty | Returns a size with width = 0 and height = 0.
Width | Width from the size.
Height | Height from the size.


TUISize.TUISize Constructor | FlexCel Studio for the .NET Framework documentation

TUISize.TUISize Constructor

Creates a new size with the specified width and height.

Syntax

Namespace: FlexCel.Core

public TUISize(Double aWidth, Double aHeight)

Parameters

<-> | Parameter | Type | Description
 | aWidth | Double | Width.
 | aHeight | Double | Height.

See also

  • TUISize


TUISize Implicit Conversion Operator | FlexCel Studio for the .NET Framework documentation

TUISize Implicit Conversion Operator

Overloads

  • Implicit conversion from SizeF to TUISize
  • Implicit conversion from TUISize to SizeF

Implicit conversion from SizeF to TUISize

Converts between a TUISize and a System.Drawing.SizeF

Syntax

Namespace: FlexCel.Core

public static TUISize op_Implicit(SizeF sz)

Parameters

<-> | Parameter | Type | Description
 | sz | SizeF |

See also

  • TUISize

Implicit conversion from TUISize to SizeF

Converts between a TUISize and a System.Drawing.SizeF

Syntax

Namespace: FlexCel.Core

public static SizeF op_Implicit(TUISize sz)

Parameters

<-> | Parameter | Type | Description
 | sz | TUISize |

See also

  • TUISize


TUISize.Empty Property | FlexCel Studio for the .NET Framework documentation

TUISize.Empty Property

Returns a size with width = 0 and height = 0.

Syntax

Namespace: FlexCel.Core

public static TUISize Empty { get; }

See also

  • TUISize


TUISize.Width Property | FlexCel Studio for the .NET Framework documentation

TUISize.Width Property

Width from the size.

Syntax

Namespace: FlexCel.Core

public Double Width { get; set; }

See also

  • TUISize


TUISize.Height Property | FlexCel Studio for the .NET Framework documentation

TUISize.Height Property

Height from the size.

Syntax

Namespace: FlexCel.Core

public Double Height { get; set; }

See also

  • TUISize


TUISmoothingMode Structure | FlexCel Studio for the .NET Framework documentation

TUISmoothingMode Structure

Smoothing mode. See System.Drawing.Drawing2D.SmoothingMode.

Syntax

Namespace: FlexCel.Core

public struct TUISmoothingMode

Properties

Name | Description
FlexCelDefault | Default mode used by FlexCel. You can change this in your application to change the default.


TUISmoothingMode.FlexCelDefault Property | FlexCel Studio for the .NET Framework documentation

TUISmoothingMode.FlexCelDefault Property

Default mode used by FlexCel. You can change this in your application to change the default.

Syntax

Namespace: FlexCel.Core

public static TUISmoothingMode FlexCelDefault { get; set; }

See also

  • TUISmoothingMode


TUITextDecoration Structure | FlexCel Studio for the .NET Framework documentation

TUITextDecoration Structure

Defines appearance of decorative lines used in text, like underline or strikeout.

Syntax

Namespace: FlexCel.Core

public struct TUITextDecoration

Constructors

Name | Description
TUITextDecoration | Overloaded TUITextDecoration(TUIUnderline) TUITextDecoration(TUIStrikeout) TUITextDecoration(TUIUnderline, TUIStrikeout)

Methods

Name | Description
Equals | Returns true if both objects are the same.
GetHashCode | Returns the hashcode of the object.
WithUnderline | Returns a copy of the record with a different underline.
WithStrikeout | Returns a copy of the record with a different strikeout.

Operators

Name | Description
Equality | Returns true if both objects have the same data.
Inequality | Returns true if both objects have different data.

Properties

Name | Description
Underline | Defines the style of text underlining.
Strikeout | Defines the style of text strikeout.
IsEmpty | Returns true if the structure has no underline or strikeout.


TUITextDecoration.TUITextDecoration Constructor | FlexCel Studio for the .NET Framework documentation

TUITextDecoration.TUITextDecoration Constructor

Overloads

  • TUITextDecoration.TUITextDecoration(TUIUnderline)
  • TUITextDecoration.TUITextDecoration(TUIStrikeout)
  • TUITextDecoration.TUITextDecoration(TUIUnderline, TUIStrikeout)

TUITextDecoration.TUITextDecoration(TUIUnderline)

Creates a new TextDecoration with the given underline and no strikeout.

Syntax

Namespace: FlexCel.Core

public TUITextDecoration(TUIUnderline aUnderline)

Parameters

<-> | Parameter | Type | Description
 | aUnderline | TUIUnderline |

See also

  • TUITextDecoration

TUITextDecoration.TUITextDecoration(TUIStrikeout)

Creates a new TextDecoration with the given strikeout and no underline.

Syntax

Namespace: FlexCel.Core

public TUITextDecoration(TUIStrikeout aStrikeout)

Parameters

<-> | Parameter | Type | Description
 | aStrikeout | TUIStrikeout |

See also

  • TUITextDecoration

TUITextDecoration.TUITextDecoration(TUIUnderline, TUIStrikeout)

Creates a new TextDecoration with the given underline and strikeout values.

Syntax

Namespace: FlexCel.Core

public TUITextDecoration(TUIUnderline aUnderline, TUIStrikeout aStrikeout)

Parameters

<-> | Parameter | Type | Description
 | aUnderline | TUIUnderline |
 | aStrikeout | TUIStrikeout |

See also

  • TUITextDecoration


TUITextDecoration.Equals Method | FlexCel Studio for the .NET Framework documentation

TUITextDecoration.Equals Method

Returns true if both objects are the same.

Syntax

Namespace: FlexCel.Core

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TUITextDecoration


TUITextDecoration.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TUITextDecoration.GetHashCode Method

Returns the hashcode of the object.

Syntax

Namespace: FlexCel.Core

public override Int32 GetHashCode()

See also

  • TUITextDecoration


TUITextDecoration.WithUnderline Method | FlexCel Studio for the .NET Framework documentation

TUITextDecoration.WithUnderline Method

Returns a copy of the record with a different underline.

Syntax

Namespace: FlexCel.Core

public TUITextDecoration WithUnderline(TUIUnderline underlineType)

Parameters

<-> | Parameter | Type | Description
 | underlineType | TUIUnderline | New underline type.

See also

  • TUITextDecoration


TUITextDecoration.WithStrikeout Method | FlexCel Studio for the .NET Framework documentation

TUITextDecoration.WithStrikeout Method

Returns a copy of the record with a different strikeout.

Syntax

Namespace: FlexCel.Core

public TUITextDecoration WithStrikeout(TUIStrikeout strikeoutType)

Parameters

<-> | Parameter | Type | Description
 | strikeoutType | TUIStrikeout | New strikeout type.

See also

  • TUITextDecoration


TUITextDecoration.Equality Operator | FlexCel Studio for the .NET Framework documentation

TUITextDecoration.Equality Operator

Returns true if both objects have the same data.

Syntax

Namespace: FlexCel.Core

public static Boolean op_Equality(TUITextDecoration a, TUITextDecoration b)

Parameters

<-> | Parameter | Type | Description
 | a | TUITextDecoration |
 | b | TUITextDecoration |

See also

  • TUITextDecoration


TUITextDecoration.Inequality Operator | FlexCel Studio for the .NET Framework documentation

TUITextDecoration.Inequality Operator

Returns true if both objects have different data.

Syntax

Namespace: FlexCel.Core

public static Boolean op_Inequality(TUITextDecoration a, TUITextDecoration b)

Parameters

<-> | Parameter | Type | Description
 | a | TUITextDecoration |
 | b | TUITextDecoration |

See also

  • TUITextDecoration


TUITextDecoration.Underline Property | FlexCel Studio for the .NET Framework documentation

TUITextDecoration.Underline Property

Defines the style of text underlining.

Syntax

Namespace: FlexCel.Core

public TUIUnderline Underline { get; }

See also

  • TUITextDecoration


TUITextDecoration.Strikeout Property | FlexCel Studio for the .NET Framework documentation

TUITextDecoration.Strikeout Property

Defines the style of text strikeout.

Syntax

Namespace: FlexCel.Core

public TUIStrikeout Strikeout { get; }

See also

  • TUITextDecoration


TUITextDecoration.IsEmpty Property | FlexCel Studio for the .NET Framework documentation

TUITextDecoration.IsEmpty Property

Returns true if the structure has no underline or strikeout.

Syntax

Namespace: FlexCel.Core

public Boolean IsEmpty { get; }

See also

  • TUITextDecoration


TXlsChartLabelPosition Structure | FlexCel Studio for the .NET Framework documentation

TXlsChartLabelPosition Structure

Stores a label position in the format used in xls files. The numbers can have many different meanings depending on where they are applied.

Syntax

Namespace: FlexCel.Core

public struct TXlsChartLabelPosition

Fields

Name | Description
PointIs0to4000 | If true, then the meaning of Point is always 0 means the left coordinate of the parent and 4000 the right. When false, the value of point is specific to the use.
Point | Stores the position of the label, in ways specific to the label. Is PointIs0to4000 is true, then this value is always integers between 0 and 4000.

Constructors

Name | Description
TXlsChartLabel​Position | Creates a new label position.


TXlsChartLabelPosition.PointIs0to4000 Field | FlexCel Studio for the .NET Framework documentation

TXlsChartLabelPosition.PointIs0to4000 Field

If true, then the meaning of Point is always 0 means the left coordinate of the parent and 4000 the right. When false, the value of point is specific to the use.

Syntax

Namespace: FlexCel.Core

public readonly Boolean PointIs0to4000

See also

  • TXlsChartLabelPosition


TXlsChartLabelPosition.Point Field | FlexCel Studio for the .NET Framework documentation

TXlsChartLabelPosition.Point Field

Stores the position of the label, in ways specific to the label. Is PointIs0to4000 is true, then this value is always integers between 0 and 4000.

Syntax

Namespace: FlexCel.Core

public readonly TPoint Point

See also

  • TXlsChartLabelPosition


TXlsChartLabelPosition.TXlsChartLabelPosition Constructor | FlexCel Studio for the .NET Framework documentation

TXlsChartLabelPosition.TXlsChartLabelPosition Constructor

Creates a new label position.

Syntax

Namespace: FlexCel.Core

public TXlsChartLabelPosition(Boolean aPointIs0To4000, TPoint aPoint)

Parameters

<-> | Parameter | Type | Description
 | aPointIs0To4000 | Boolean |
 | aPoint | TPoint |

See also

  • TXlsChartLabelPosition


TZippyFileInfo Structure | FlexCel Studio for the .NET Framework documentation

TZippyFileInfo Structure

Stores information for a single file inside the zip file.

Syntax

Namespace: FlexCel.Core

public struct TZippyFileInfo

Fields

Name | Description
FileName | Full name for the file, as explained in TZippyReader.​Get​File​Name. You can use TZippyReader.​Extract​File​Name to get the filename without the path.
CompressionMode | How the file was stored in the zip file.
FileDateTime | Date and time the file was stored.
UncompressedSize | Size of the file uncompressed.
CompressedSize | Size of the compressed file.


TZippyFileInfo.FileName Field | FlexCel Studio for the .NET Framework documentation

TZippyFileInfo.FileName Field

Full name for the file, as explained in TZippyReader.GetFileName. You can use TZippyReader.ExtractFileName to get the filename without the path.

Syntax

Namespace: FlexCel.Core

public String FileName

See also

  • TZippyFileInfo


TZippyFileInfo.CompressionMode Field | FlexCel Studio for the .NET Framework documentation

TZippyFileInfo.CompressionMode Field

How the file was stored in the zip file.

Syntax

Namespace: FlexCel.Core

public TCompressionMode CompressionMode

See also

  • TZippyFileInfo


TZippyFileInfo.FileDateTime Field | FlexCel Studio for the .NET Framework documentation

TZippyFileInfo.FileDateTime Field

Date and time the file was stored.

Syntax

Namespace: FlexCel.Core

public DateTime FileDateTime

See also

  • TZippyFileInfo


TZippyFileInfo.UncompressedSize Field | FlexCel Studio for the .NET Framework documentation

TZippyFileInfo.UncompressedSize Field

Size of the file uncompressed.

Syntax

Namespace: FlexCel.Core

public Int64 UncompressedSize

See also

  • TZippyFileInfo


TZippyFileInfo.CompressedSize Field | FlexCel Studio for the .NET Framework documentation

TZippyFileInfo.CompressedSize Field

Size of the compressed file.

Syntax

Namespace: FlexCel.Core

public Int64 CompressedSize

See also

  • TZippyFileInfo


IEmbeddedObjects Interface | FlexCel Studio for the .NET Framework documentation

IEmbeddedObjects Interface

Use this interface to read or write Embedded drawing objects inside other object.

Syntax

Namespace: FlexCel.Core

public interface IEmbeddedObjects;

Methods

Name | Description
GetObjectProperties Returns information on an object and all of its children.
SetObjectText Overloaded
 SetObjectText(Int32, String, String)
SetObjectText(Int32, String, TRichString)
SetObjectText(Int32, String, TDrawingRichString)
DeleteObject Overloaded
 DeleteObject(Int32)
DeleteObject(Int32, String)
GetImage Returns an image and its type.
Note that for SVG images, xlsx files store both a PNG and SVG image. In those cases, for backward compatibility reasons, this method will return the PNG image. To get the SVG, call GetImageAlternate
HasImageAlternate | Returns true if the image has an alternate representation. This currently happens only with SVG images, which have a PNG base and an SVG alternate. If the image has an alternate, you can get the data with GetImageAlternate
GetImageAlternate Returns an image and its type. Currently this method is the same as GetImage for all images except SVG.
For SVG images, xlsx files store both a PNG and SVG image. In those cases, this method will return the SVG image. To get the PNG, call GetImage
AddImageAlternate Adds an image to the active sheet.
Currently this method is only needed for SVG images, since SVG images are stored as both PNG and SVG inside the xlsx file. This method allows you to supply both images.
GetImageProperties Returns image position and size.
DeleteImage Deletes the image at position imageIndex.
GetShapeLinkedCell Returns the cell that is linked to the shape or image. If the object isn't linked, this method will return null.
Note that when you change the value in the cell linked to this object, the value of the object will change.
Also note that this method applies to shapes like a rectangle or circle, or an image. Objects like a combobox won't be reported by this method.
SetShapeLinkedCell Links the shape or image to a cell, if the shape can be linked. To unlink the cell, make linkedCell null.
Note that this method applies to shapes like a rectangle or a circle, or an image, not to the link of a forms object like a combobox or a radiobutton.
ImageIndexTo​Object​Path Returns the absolute object path for an image, given an image index. Note that this method can be slow if there are many objects in the file.
Whenever possible, prefer the methods that take directly an imageIndex instead of converting the imageIndex to an objectPath.

Properties

Name | Description
ObjectCount | The number of objects that are embedded inside this object.
ImageCount | The number of images in the object.


IEmbeddedObjects.GetObjectProperties Method | FlexCel Studio for the .NET Framework documentation

IEmbeddedObjects.GetObjectProperties Method

Returns information on an object and all of its children.

Syntax

Namespace: FlexCel.Core

public abstract TShapeProperties GetObjectProperties(Int32 objectIndex, Boolean GetShapeOptions)

Parameters

<-> | Parameter | Type | Description
 | objectIndex | Int32 | Index of the object (1-based)
 | GetShapeOptions | Boolean | When true, shape options will be retrieved. As this can be a slow operation, only specify true when you really need those options.

See also

  • IEmbeddedObjects


IEmbeddedObjects.SetObjectText Method | FlexCel Studio for the .NET Framework documentation

IEmbeddedObjects.SetObjectText Method

Overloads

  • IEmbeddedObjects.SetObjectText(Int32, String, String)
  • IEmbeddedObjects.SetObjectText(Int32, String, TRichString)
  • IEmbeddedObjects.SetObjectText(Int32, String, TDrawingRichString)

IEmbeddedObjects.SetObjectText(Int32, String, String)

Changes the text inside an object of this object.

Syntax

Namespace: FlexCel.Core

public abstract void SetObjectText(Int32 objectIndex, String objectPath, String text)

Parameters

<-> | Parameter | Type | Description
 | objectIndex | Int32 | Index of the object, between 1 and ObjectCount
 | objectPath | String | Index to the child object you want to change the text. If it is a simple object, you can use String.Empty here, if not you need to get the ObjectPath from GetObjectProperties If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"
 | text | String | Text you want to use. Use null to delete text from an AutoShape.

See also

  • IEmbeddedObjects

IEmbeddedObjects.SetObjectText(Int32, String, TRichString)

Changes the text inside an object of this object.

Syntax

Namespace: FlexCel.Core

public abstract void SetObjectText(Int32 objectIndex, String objectPath, TRichString text)

Parameters

<-> | Parameter | Type | Description
 | objectIndex | Int32 | Index of the object, between 1 and ObjectCount
 | objectPath | String | Index to the child object you want to change the text. If it is a simple object, you can use String.Empty here, if not you need to get the ObjectPath from GetObjectProperties If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"
 | text | TRichString | Text you want to use. Use null to delete text from an AutoShape.

See also

  • IEmbeddedObjects

IEmbeddedObjects.SetObjectText(Int32, String, TDrawingRichString)

Changes the text inside an object of this object.

Syntax

Namespace: FlexCel.Core

public abstract void SetObjectText(Int32 objectIndex, String objectPath, TDrawingRichString text)

Parameters

<-> | Parameter | Type | Description
 | objectIndex | Int32 | Index of the object, between 1 and ObjectCount
 | objectPath | String | Index to the child object you want to change the text. If it is a simple object, you can use String.Empty here, if not you need to get the ObjectPath from GetObjectProperties If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"
 | text | TDrawingRichString | Text you want to use. Use null to delete text from an AutoShape.

See also

  • IEmbeddedObjects


IEmbeddedObjects.DeleteObject Method | FlexCel Studio for the .NET Framework documentation

IEmbeddedObjects.DeleteObject Method

Overloads

  • IEmbeddedObjects.DeleteObject(Int32)
  • IEmbeddedObjects.DeleteObject(Int32, String)

IEmbeddedObjects.DeleteObject(Int32)

Deletes the graphic object at objectIndex. Use it with care, there are some graphics objects you don't want to remove (like comment boxes when you don't delete the associated comment.)

Syntax

Namespace: FlexCel.Core

public abstract void DeleteObject(Int32 objectIndex)

Parameters

<-> | Parameter | Type | Description
 | objectIndex | Int32 | Index of the object (1 based).

See also

  • IEmbeddedObjects

IEmbeddedObjects.DeleteObject(Int32, String)

Deletes the graphic object at objectIndex. Use it with care, there are some graphics objects you don't want to remove (like comment boxes when you don't delete the associated comment.)

Syntax

Namespace: FlexCel.Core

public abstract void DeleteObject(Int32 objectIndex, String objectPath)

Parameters

<-> | Parameter | Type | Description
 | objectIndex | Int32 | Index of the object (1 based).
 | objectPath | String | Index to the child object you want to change the property. If it is a simple object, you can use String.Empty here, if not you need to get the ObjectPath from GetObjectProperties If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"

See also

  • IEmbeddedObjects


IEmbeddedObjects.GetImage Method | FlexCel Studio for the .NET Framework documentation

IEmbeddedObjects.GetImage Method

Returns an image and its type. Note that for SVG images, xlsx files store both a PNG and SVG image. In those cases, for backward compatibility reasons, this method will return the PNG image. To get the SVG, call GetImageAlternate

Syntax

Namespace: FlexCel.Core

public abstract void GetImage(Int32 imageIndex, String objectPath, ref TXlsImgType imageType, Stream outStream, Boolean usesObjectIndex)

Parameters

<-> | Parameter | Type | Description
 | imageIndex | Int32 | Index of the image. (1 based)
 | objectPath | String | Object path to the image when it is a grouped image. For toplevel images you can use String.Empty. In other case, you need to use the value returned by GetObjectProperties If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"
ref | imageType | TXlsImgType | Returns the image type for the data returned. (If it is a bmp, jpg or other)
 | outStream | Stream | Stream where the image data will be copied.
 | usesObjectIndex | Boolean | If false (the default) then imageIndex is an index to the list of images. When true imageIndex is an index to the list of all objects in the sheet. When you have the object id, you can avoid calling ObjectIndexToImageIndex which is a slow method, by setting this parameter to true.

See also

  • IEmbeddedObjects


IEmbeddedObjects.HasImageAlternate Method | FlexCel Studio for the .NET Framework documentation

IEmbeddedObjects.HasImageAlternate Method

Returns true if the image has an alternate representation. This currently happens only with SVG images, which have a PNG base and an SVG alternate. If the image has an alternate, you can get the data with GetImageAlternate

Syntax

Namespace: FlexCel.Core

public abstract Boolean HasImageAlternate(Int32 imageIndex, String objectPath, Boolean usesObjectIndex)

Parameters

<-> | Parameter | Type | Description
 | imageIndex | Int32 | Index of the image. (1 based)
 | objectPath | String | Object path to the image when it is a grouped image. For toplevel images you can use String.Empty. In other case, you need to use the value returned by GetObjectProperties Important: ObjectPath is ignored if usesObjectIndex is false. If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3" You might also use the name of the image as object path, like in xls.GetImage(-1, "@myimage", ref imageType, ImageStream, true)
 | usesObjectIndex | Boolean | If false then imageIndex is an index to the list of images. When true imageIndex is an index to the list of all objects in the sheet.

See also

  • IEmbeddedObjects


IEmbeddedObjects.GetImageAlternate Method | FlexCel Studio for the .NET Framework documentation

IEmbeddedObjects.GetImageAlternate Method

Returns an image and its type. Currently this method is the same as GetImage for all images except SVG. For SVG images, xlsx files store both a PNG and SVG image. In those cases, this method will return the SVG image. To get the PNG, call GetImage

Syntax

Namespace: FlexCel.Core

public abstract void GetImageAlternate(Int32 imageIndex, String objectPath, out TXlsImgType imageType, Stream outStream, Boolean usesObjectIndex)

Parameters

<-> | Parameter | Type | Description
 | imageIndex | Int32 | Index of the image. (1 based)
 | objectPath | String | Object path to the image when it is a grouped image. For toplevel images you can use String.Empty. In other case, you need to use the value returned by GetObjectProperties If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"
out | imageType | TXlsImgType | Returns the image type for the data returned. (If it is a bmp, jpg or other)
 | outStream | Stream | Stream where the image data will be copied.
 | usesObjectIndex | Boolean | If false (the default) then imageIndex is an index to the list of images. When true imageIndex is an index to the list of all objects in the sheet. When you have the object id, you can avoid calling ObjectIndexToImageIndex which is a slow method, by setting this parameter to true.

See also

  • IEmbeddedObjects


IEmbeddedObjects.AddImageAlternate Method | FlexCel Studio for the .NET Framework documentation

IEmbeddedObjects.AddImageAlternate Method

Adds an image to the active sheet. Currently this method is only needed for SVG images, since SVG images are stored as both PNG and SVG inside the xlsx file. This method allows you to supply both images.

Syntax

Namespace: FlexCel.Core

public abstract void AddImageAlternate(Byte[] PNGData, TImageProperties imageProperties, TSVGBlip aSVGBlip)

Parameters

<-> | Parameter | Type | Description
 | PNGData | Byte[] | Image data for the PNG file that will be used as a backup for the SVG. This data must be in PNG file format.
 | imageProperties | TImageProperties | Image Properties.
 | aSVGBlip | TSVGBlip | Data for the SVG image to be added.

See also

  • IEmbeddedObjects


IEmbeddedObjects.GetImageProperties Method | FlexCel Studio for the .NET Framework documentation

IEmbeddedObjects.GetImageProperties Method

Returns image position and size.

Syntax

Namespace: FlexCel.Core

public abstract TImageProperties GetImageProperties(Int32 imageIndex)

Parameters

<-> | Parameter | Type | Description
 | imageIndex | Int32 | Index of the image (1 based)

Returns

Image position and size.

See also

  • IEmbeddedObjects


IEmbeddedObjects.DeleteImage Method | FlexCel Studio for the .NET Framework documentation

IEmbeddedObjects.DeleteImage Method

Deletes the image at position imageIndex.

Syntax

Namespace: FlexCel.Core

public abstract void DeleteImage(Int32 imageIndex)

Parameters

<-> | Parameter | Type | Description
 | imageIndex | Int32 | Index of the image to delete. (1 based)

See also

  • IEmbeddedObjects


IEmbeddedObjects.GetShapeLinkedCell Method | FlexCel Studio for the .NET Framework documentation

IEmbeddedObjects.GetShapeLinkedCell Method

Returns the cell that is linked to the shape or image. If the object isn't linked, this method will return null. Note that when you change the value in the cell linked to this object, the value of the object will change. Also note that this method applies to shapes like a rectangle or circle, or an image. Objects like a combobox won't be reported by this method.

Remarks

Images behave differently from shapes: A linked shape will change its text with the value of the cells. A linked image will change its image, to be an screenshot of the selected range. Finally, a linked object like a combobox will modify the selected item depending on the linked cell.

Syntax

Namespace: FlexCel.Core

public abstract String GetShapeLinkedCell(Int32 objectIndex, String objectPath)

Parameters

<-> | Parameter | Type | Description
 | objectIndex | Int32 | Index of the object (1 based)
 | objectPath | String | Index to the child object you want to change the property. If it is a simple object, you can use String.Empty here, if not you need to get the ObjectPath from GetObjectProperties If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"

Returns

The cell address or name which this shape is linked to, or null if it isn't linked.

See also

  • IEmbeddedObjects


IEmbeddedObjects.SetShapeLinkedCell Method | FlexCel Studio for the .NET Framework documentation

IEmbeddedObjects.SetShapeLinkedCell Method

Links the shape or image to a cell, if the shape can be linked. To unlink the cell, make linkedCell null. Note that this method applies to shapes like a rectangle or a circle, or an image, not to the link of a forms object like a combobox or a radiobutton.

Remarks

Images behave differently from shapes: A linked shape will change its text with the value of the cells. A linked image will change its image, to be an screenshot of the selected range. Finally, a linked object like a combobox will modify the selected item depending on the linked cell.

Syntax

Namespace: FlexCel.Core

public abstract void SetShapeLinkedCell(Int32 objectIndex, String objectPath, String linkedCell)

Parameters

<-> | Parameter | Type | Description
 | objectIndex | Int32 | Index of the object (1 based)
 | objectPath | String | Index to the child object you want to change the property. If it is a simple object, you can use String.Empty here, if not you need to get the ObjectPath from GetObjectProperties If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"
 | linkedCell | String | Cell that will be linked to the shape. To unlink the shape, make this parameter null. Note that this can be a single cell like "A3" or a name like "myName". You can't use a complex formula here like "A1&A2"

See also

  • IEmbeddedObjects


IEmbeddedObjects.ImageIndexToObjectPath Method | FlexCel Studio for the .NET Framework documentation

IEmbeddedObjects.ImageIndexToObjectPath Method

Returns the absolute object path for an image, given an image index. Note that this method can be slow if there are many objects in the file. Whenever possible, prefer the methods that take directly an imageIndex instead of converting the imageIndex to an objectPath.

Syntax

Namespace: FlexCel.Core

public abstract String ImageIndexToObjectPath(Int32 imageIndex)

Parameters

<-> | Parameter | Type | Description
 | imageIndex | Int32 | Image index on the image array.

Returns

Image index on the total objects array.

See also

  • IEmbeddedObjects


IEmbeddedObjects.ObjectCount Property | FlexCel Studio for the .NET Framework documentation

IEmbeddedObjects.ObjectCount Property

The number of objects that are embedded inside this object.

Syntax

Namespace: FlexCel.Core

public abstract Int32 ObjectCount { get; }

See also

  • IEmbeddedObjects


IEmbeddedObjects.ImageCount Property | FlexCel Studio for the .NET Framework documentation

IEmbeddedObjects.ImageCount Property

The number of images in the object.

Syntax

Namespace: FlexCel.Core

public abstract Int32 ImageCount { get; }

See also

  • IEmbeddedObjects


IFlexCelFontList Interface | FlexCel Studio for the .NET Framework documentation

IFlexCelFontList Interface

Interface for passing font information. Internal use.

Syntax

Namespace: FlexCel.Core

public interface IFlexCelFontList;

Methods

Name | Description
GetFont | Returns the font definition for a given font index.
AddFont | Adds a new Font.

Properties

Name | Description
FontCount | Fonts in the document.


IFlexCelFontList.GetFont Method | FlexCel Studio for the .NET Framework documentation

IFlexCelFontList.GetFont Method

Returns the font definition for a given font index.

Syntax

Namespace: FlexCel.Core

public abstract TFlxFont GetFont(Int32 fontIndex)

Parameters

<-> | Parameter | Type | Description
 | fontIndex | Int32 | Font index. 0-based

Returns

Font definition

See also

  • IFlexCelFontList


IFlexCelFontList.AddFont Method | FlexCel Studio for the .NET Framework documentation

IFlexCelFontList.AddFont Method

Adds a new Font.

Syntax

Namespace: FlexCel.Core

public abstract Int32 AddFont(TFlxFont aFont)

Parameters

<-> | Parameter | Type | Description
 | aFont | TFlxFont |

See also

  • IFlexCelFontList


IFlexCelFontList.FontCount Property | FlexCel Studio for the .NET Framework documentation

IFlexCelFontList.FontCount Property

Fonts in the document.

Syntax

Namespace: FlexCel.Core

public abstract Int32 FontCount { get; }

See also

  • IFlexCelFontList


IFlexCelPalette Interface | FlexCel Studio for the .NET Framework documentation

IFlexCelPalette Interface

Interface for passing palette and theme information. XlsFile implements IFlexCelPalette, so you can pass any XlsFile object whenever you need to use this interface.

Syntax

Namespace: FlexCel.Core

public interface IFlexCelPalette;

Methods

Name | Description
NearestColorTheme | Returns the most similar entry on the theme palette for a given color.
NearestColorIndex | Returns the most similar entry on the excel palette for a given color.
GetColorTheme | Returns a color from the active theme palette, including semantic colors. Only has effect in Excel 2007. To get the full theme, look at ExcelFile.GetTheme
GetColorPalette | Returns a color from the color palette. This method will throw an exception if its "index" parameter is bigger than ExcelFile.​Color​Palette​Count, (for example, for an automatic color). To get the real color, use ExcelFile.​Get​Color​Palette(​​Int32, TUIColor)
PaletteContainsColor | Returns true if the internal color palette contains the exact specified color. Note that Excel 2007 doesn't use the color palette, so this method is not needed there.
GetTheme | This is an advanced method, that allows you to get the full theme in use. Normally you will just want to replace colors, and you can do this with ExcelFile.​Set​Color​Theme(​​TPrimary​Theme​Color, TDrawingColor) and ExcelFile.​Get​Color​Theme(​​TPrimary​Theme​Color) ...[more]
GetThemeNoClone | Internal use. This won't clone the internal structure for more performance.
GetColorPalette​Version | Internal use. Every time the palette changes, the number returned is incremented.

Properties

Name | Description
ColorPaletteCount | The number of entries on an Excel color palette. This is always 56.


IFlexCelPalette.NearestColorTheme Method | FlexCel Studio for the .NET Framework documentation

IFlexCelPalette.NearestColorTheme Method

Returns the most similar entry on the theme palette for a given color.

Syntax

Namespace: FlexCel.Core

public abstract TThemeColor NearestColorTheme(TUIColor value, out Double tint)

Parameters

<-> | Parameter | Type | Description
 | value | TUIColor | Color we want to use.
out | tint | Double | Returns the tint to apply to the theme color.

Returns

Most similar color on the theme palette.

See also

  • IFlexCelPalette


IFlexCelPalette.NearestColorIndex Method | FlexCel Studio for the .NET Framework documentation

IFlexCelPalette.NearestColorIndex Method

Returns the most similar entry on the excel palette for a given color.

Syntax

Namespace: FlexCel.Core

public abstract Int32 NearestColorIndex(TUIColor value)

Parameters

<-> | Parameter | Type | Description
 | value | TUIColor | Color we want to use.

Returns

Most similar color on the Excel palette.

See also

  • IFlexCelPalette


IFlexCelPalette.GetColorTheme Method | FlexCel Studio for the .NET Framework documentation

IFlexCelPalette.GetColorTheme Method

Returns a color from the active theme palette, including semantic colors. Only has effect in Excel 2007.

To get the full theme, look at ExcelFile.GetTheme

Syntax

Namespace: FlexCel.Core

public abstract TDrawingColor GetColorTheme(TThemeColor themeColor)

Parameters

<-> | Parameter | Type | Description
 | themeColor | TThemeColor | Color of the theme to get.

Returns

Color for the given theme.

See also

  • IFlexCelPalette


IFlexCelPalette.GetColorPalette Method | FlexCel Studio for the .NET Framework documentation

IFlexCelPalette.GetColorPalette Method

Returns a color from the color palette. This method will throw an exception if its "index" parameter is bigger than ExcelFile.ColorPaletteCount, (for example, for an automatic color). To get the real color, use ExcelFile.GetColorPalette(Int32, TUIColor)

Syntax

Namespace: FlexCel.Core

public abstract TUIColor GetColorPalette(Int32 index)

Parameters

<-> | Parameter | Type | Description
 | index | Int32 | Index of the entry to return. Must be 1<=index<=ExcelFile.ColorPaletteCount

Returns

Color at position index.

See also

  • IFlexCelPalette


IFlexCelPalette.PaletteContainsColor Method | FlexCel Studio for the .NET Framework documentation

IFlexCelPalette.PaletteContainsColor Method

Returns true if the internal color palette contains the exact specified color. Note that Excel 2007 doesn't use the color palette, so this method is not needed there.

Syntax

Namespace: FlexCel.Core

public abstract Boolean PaletteContainsColor(TExcelColor value)

Parameters

<-> | Parameter | Type | Description
 | value | TExcelColor | Color to check.

Returns

True if color is defined.

See also

  • IFlexCelPalette


IFlexCelPalette.GetTheme Method | FlexCel Studio for the .NET Framework documentation

IFlexCelPalette.GetTheme Method

This is an advanced method, that allows you to get the full theme in use. Normally you will just want to replace colors, and you can do this with ExcelFile.SetColorTheme(TPrimaryThemeColor, TDrawingColor) and ExcelFile.GetColorTheme(TPrimaryThemeColor) methods. Much of the functionality in a theme applies to PowerPoint, not Excel.

Syntax

Namespace: FlexCel.Core

public abstract TTheme GetTheme()

See also

  • IFlexCelPalette


IFlexCelPalette.GetThemeNoClone Method | FlexCel Studio for the .NET Framework documentation

IFlexCelPalette.GetThemeNoClone Method

Internal use. This won't clone the internal structure for more performance.

Syntax

Namespace: FlexCel.Core

public abstract TTheme GetThemeNoClone()

See also

  • IFlexCelPalette


IFlexCelPalette.GetColorPaletteVersion Method | FlexCel Studio for the .NET Framework documentation

IFlexCelPalette.GetColorPaletteVersion Method

Internal use. Every time the palette changes, the number returned is incremented.

Syntax

Namespace: FlexCel.Core

public abstract Int32 GetColorPaletteVersion()

See also

  • IFlexCelPalette


IFlexCelPalette.ColorPaletteCount Property | FlexCel Studio for the .NET Framework documentation

IFlexCelPalette.ColorPaletteCount Property

The number of entries on an Excel color palette. This is always 56.

Syntax

Namespace: FlexCel.Core

public abstract Int32 ColorPaletteCount { get; }

See also

  • IFlexCelPalette


IHtmlFontEvent Interface | FlexCel Studio for the .NET Framework documentation

IHtmlFontEvent Interface

Provides a method to customize the fonts used in the HTML methods.

Syntax

Namespace: FlexCel.Core

public interface IHtmlFontEvent;

Methods

Name | Description
DoHtmlFont | Method to be called each time a new font is used.


IHtmlFontEvent.DoHtmlFont Method | FlexCel Studio for the .NET Framework documentation

IHtmlFontEvent.DoHtmlFont Method

Method to be called each time a new font is used.

Syntax

Namespace: FlexCel.Core

public abstract void DoHtmlFont(HtmlFontEventArgs e)

Parameters

<-> | Parameter | Type | Description
 | e | HtmlFontEventArgs |

See also

  • IHtmlFontEvent


IRowColSize Interface | FlexCel Studio for the .NET Framework documentation

IRowColSize Interface

Interface for row heights and columns widths. XlsFile implements this interface, so you can pass an XlsFile object anytime you need to pass this interface.

Syntax

Namespace: FlexCel.Core

public interface IRowColSize;

Methods

Name | Description
DefaultRowHeight​Visual | The default height for empty rows, in Excel internal units. (1/20th of a point). Different from ExcelFile.​Default​RowHeight this property returns the actual row height as Excel will show it, considering ExcelFile.​Default​RowHidden and ExcelFile.​Default​RowHeight​Automatic. See Excel Internal Units for more information in Excel internal units.
IsEmptyRow | True if the specified row does not have any cells, nor any format on it. In short, this row has never been used.
GetRowHeight | Returns the current Row height, in Excel internal units. (1/20th of a point) See Excel Internal Units for more information in Excel internal units.
GetColWidth | Returns the current Column width, in Excel internal units. (Character width of font 0 / 256) See Excel Internal Units for more information in Excel internal units.
GetCachedFont0 | This method is used by FlexCel itself, you shouldn't call it directly.
SetCachedFont0 | This method is used by FlexCel itself, you shouldn't call it directly.

Properties

Name | Description
DefaultColWidth | The default width for empty columns, in Excel internal units. (Character width of font 0 / 256) See Excel Internal Units for more information in Excel internal units.
ShowFormulaText | When true, the formula text will be displayed instead of the formula value. You can also set this option with ExcelFile.​Sheet​Options This property can work in different windows depending on the value of ExcelFile.​Active​Window
GetDefaultFont | Returns Excel standard font for an empty cell.
WidthCorrection | Factor to multiply default column widths. See remarks for a detailed explanation.
HeightCorrection | Factor to multiply default row heights. See remarks for a detailed explanation.
ScreenScaling | This property lets you specify the screen scaling that FlexCel will assume for reading xlsx files in percent. (default is 100 which means 100%). The values can be between 100 and 500. Column widths in xlsx files which don't have a fixed column width set will be different in different screen resolutions. So we need to know which resolution to emulate in order to read those files correctly. You will probably want to leave this property to the default value of 100, but you can change it if needed. ...[more]


IRowColSize.DefaultRowHeightVisual Method | FlexCel Studio for the .NET Framework documentation

IRowColSize.DefaultRowHeightVisual Method

The default height for empty rows, in Excel internal units. (1/20th of a point). Different from ExcelFile.DefaultRowHeight this property returns the actual row height as Excel will show it, considering ExcelFile.DefaultRowHidden and ExcelFile.DefaultRowHeightAutomatic. See Excel Internal Units for more information in Excel internal units.

Remarks

Use FlxConsts.RowMult to convert the internal units to pixels.

Syntax

Namespace: FlexCel.Core

public abstract Int32 DefaultRowHeightVisual(Boolean useDefaultRowHeightAutomatic)

Parameters

<-> | Parameter | Type | Description
 | useDefaultRowHeightAutomatic | Boolean | If false, the property ExcelFile.DefaultRowHeightAutomatic will be ignored and considered false. In many cases you will prefer to use the default row height stored in the file, even if DefaultRowHeightAutomatic is true.

Examples

    double RowHeightInPixels = xls.GetRowHeight(Row) / FlxConsts.RowMult;

See also

  • IRowColSize


IRowColSize.IsEmptyRow Method | FlexCel Studio for the .NET Framework documentation

IRowColSize.IsEmptyRow Method

True if the specified row does not have any cells, nor any format on it. In short, this row has never been used.

Syntax

Namespace: FlexCel.Core

public abstract Boolean IsEmptyRow(Int32 row)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row to test (1-based)

See also

  • IRowColSize


IRowColSize.GetRowHeight Method | FlexCel Studio for the .NET Framework documentation

IRowColSize.GetRowHeight Method

Returns the current Row height, in Excel internal units. (1/20th of a point) See Excel Internal Units for more information in Excel internal units.

Remarks

Use FlxConsts.RowMult to convert the internal units to pixels.

Syntax

Namespace: FlexCel.Core

public abstract Int32 GetRowHeight(Int32 row, Boolean HiddenIsZero)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row Index (1 based)
 | HiddenIsZero | Boolean | If true, the height returned for a hidden row will be 0 and not its real height.

Returns

Row height in internal excel units.

Examples

    double RowHeightInPixels = xls.GetRowHeight(Row) / FlxConsts.RowMult;

See also

  • IRowColSize


IRowColSize.GetColWidth Method | FlexCel Studio for the .NET Framework documentation

IRowColSize.GetColWidth Method

Returns the current Column width, in Excel internal units. (Character width of font 0 / 256) See Excel Internal Units for more information in Excel internal units.

Remarks

Use ExcelMetrics.ColMult to convert the internal units to pixels.

Syntax

Namespace: FlexCel.Core

public abstract Int32 GetColWidth(Int32 col, Boolean HiddenIsZero)

Parameters

<-> | Parameter | Type | Description
 | col | Int32 | Column Index (1 based)
 | HiddenIsZero | Boolean | If true, the width returned for a hidden column will be 0 and not its real width.

Returns

Column width in internal excel units.(Character width of font 0 / 256)

Examples

    double ColWidthInPixels = xls.GetColWidth(Col) / ExcelMetrics.ColMult(xls);

See also

  • IRowColSize


IRowColSize.GetCachedFont0 Method | FlexCel Studio for the .NET Framework documentation

IRowColSize.GetCachedFont0 Method

This method is used by FlexCel itself, you shouldn't call it directly.

Syntax

Namespace: FlexCel.Core

public abstract TCachedFontWidth GetCachedFont0()

See also

  • IRowColSize


IRowColSize.SetCachedFont0 Method | FlexCel Studio for the .NET Framework documentation

IRowColSize.SetCachedFont0 Method

This method is used by FlexCel itself, you shouldn't call it directly.

Syntax

Namespace: FlexCel.Core

public abstract void SetCachedFont0(TCachedFontWidth aFont)

Parameters

<-> | Parameter | Type | Description
 | aFont | TCachedFontWidth |

See also

  • IRowColSize


IRowColSize.DefaultColWidth Property | FlexCel Studio for the .NET Framework documentation

IRowColSize.DefaultColWidth Property

The default width for empty columns, in Excel internal units. (Character width of font 0 / 256) See Excel Internal Units for more information in Excel internal units.

Remarks

Use ExcelMetrics.ColMult to convert the internal units to pixels.

Syntax

Namespace: FlexCel.Core

public abstract Int32 DefaultColWidth { get; set; }

Examples

    double ColWidthInPixels = xls.GetColWidth(Col) / ExcelMetrics.ColMult(xls);

See also

  • IRowColSize


IRowColSize.ShowFormulaText Property | FlexCel Studio for the .NET Framework documentation

IRowColSize.ShowFormulaText Property

When true, the formula text will be displayed instead of the formula value. You can also set this option with ExcelFile.SheetOptions This property can work in different windows depending on the value of ExcelFile.ActiveWindow

Syntax

Namespace: FlexCel.Core

public abstract Boolean ShowFormulaText { get; set; }

See also

  • IRowColSize


IRowColSize.GetDefaultFont Property | FlexCel Studio for the .NET Framework documentation

IRowColSize.GetDefaultFont Property

Returns Excel standard font for an empty cell.

Syntax

Namespace: FlexCel.Core

public abstract TFlxFont GetDefaultFont { get; }

See also

  • IRowColSize


IRowColSize.WidthCorrection Property | FlexCel Studio for the .NET Framework documentation

IRowColSize.WidthCorrection Property

Factor to multiply default column widths. See remarks for a detailed explanation.

Remarks

Excel does not print the same things to all printers (or even the same printer with another resolution). Depending on the driver and resolution, printed columns and rows will be a little smaller or bigger.

FlexCel uses .NET framework to print, and so it is resolution independent, it will always print the same no matter where. So FlexCel is tuned to print like Excel on a 600 dpi generic printer. This will probably be ok for most uses, but in some cases might cause FlexCel to print an Extra page with only one column or row.

You can use this property and ExcelFile.HeightCorrection to manually fine tune FlexCel printing, previewing and exporting to PDF to make it smaller or larger. A normal value for this property might be 1.05 or 0.99, but don't use it unless you really need to.

Syntax

Namespace: FlexCel.Core

public abstract Double WidthCorrection { get; set; }

Examples

To calculate the exact HeightCorrection and WidthCorrection for your printer create a new Excel sheet, make column A wide (almost a sheet wide) and row 1 larger (almost a sheet tall). Set the borders around cell A1 to a solid line. Now, print this file from Excel and from FlexCel (you can use the PrintPreview demo for this) and compare the 2 resulting boxes. If for example the Excel printed box is 1.2 cm wide and FlexCel is 1.4, WidthCorrection should be 1.4/1.2. (A larger WidthCorrection means a smaller box).

See also

  • IRowColSize


IRowColSize.HeightCorrection Property | FlexCel Studio for the .NET Framework documentation

IRowColSize.HeightCorrection Property

Factor to multiply default row heights. See remarks for a detailed explanation.

Remarks

Excel does not print the same things to all printers (or even the same printer with another resolution). Depending on the driver and resolution, printed columns and rows will be a little smaller or bigger.

FlexCel uses .NET framework to print, and so it is resolution independent, it will always print the same no matter where. So FlexCel is tuned to print like Excel on a 600 dpi generic printer. This will probably be ok for most uses, but in some cases might cause FlexCel to print an Extra page with only one column or row.

You can use this property and ExcelFile.WidthCorrection to manually fine tune FlexCel printing, previewing and exporting to PDF to make it smaller or larger. A normal value for this property might be 1.05 or 0.99, but don't use it unless you really need to.

Syntax

Namespace: FlexCel.Core

public abstract Double HeightCorrection { get; set; }

Examples

To calculate the exact HeightCorrection and WidthCorrection for your printer create a new Excel sheet, make column A wide (almost a sheet wide) and row 1 larger (almost a sheet tall). Set the borders around cell A1 to a solid line. Now, print this file from Excel and from FlexCel (you can use the PrintPreview demo for this) and compare the 2 resulting boxes. If for example the Excel printed box is 1.2 cm wide and FlexCel is 1.4, WidthCorrection should be 1.4/1.2. (A larger WidthCorrection means a smaller box)

See also

  • IRowColSize


IRowColSize.ScreenScaling Property | FlexCel Studio for the .NET Framework documentation

IRowColSize.ScreenScaling Property

This property lets you specify the screen scaling that FlexCel will assume for reading xlsx files in percent. (default is 100 which means 100%). The values can be between 100 and 500.

Column widths in xlsx files which don't have a fixed column width set will be different in different screen resolutions. So we need to know which resolution to emulate in order to read those files correctly. You will probably want to leave this property to the default value of 100, but you can change it if needed.

For more information, please read https://www.tmssoftware.com/site/blog.asp?post=311

Syntax

Namespace: FlexCel.Core

public abstract Int32 ScreenScaling { get; set; }

See also

  • IRowColSize


IStackedOptions Interface | FlexCel Studio for the .NET Framework documentation

IStackedOptions Interface

Interface for charts that can be stacked.

Syntax

Namespace: FlexCel.Core

public interface IStackedOptions;

Properties

Name | Description
StackedMode | Stacked mode for a series.


IStackedOptions.StackedMode Property | FlexCel Studio for the .NET Framework documentation

IStackedOptions.StackedMode Property

Stacked mode for a series.

Syntax

Namespace: FlexCel.Core

public abstract TStackedMode StackedMode { get; set; }

See also

  • IStackedOptions


IUserDefinedFunctionAggregator Interface | FlexCel Studio for the .NET Framework documentation

IUserDefinedFunctionAggregator Interface

This interface is passed to methods that will process the workbook. Implement your own custom decendant to create new functions.

Syntax

Namespace: FlexCel.Core

public interface IUserDefinedFunctionAggregator;

Methods

Name | Description
Process | Implement this method to do something for every value in the range. Note: You can abort the processing (for example if there is an error) by returning false in this function, and the error value in the "error" parameter. But, Excel normally doesn't behave this way. Excel will normally first check all values to see if there is an error, and only then if no cell was a #Err! value, do other checks (for example negative parameters). So, for this to be 100% like Excel, you always need to return true in this function, and check for other errors only after all values have been processed. If you don't care about returning the exact error message Excel returns, you can return the error directly here while you are processing the values and speed up things (since other values won't be processed after you know the first error).


IUserDefinedFunctionAggregator.Process Method | FlexCel Studio for the .NET Framework documentation

IUserDefinedFunctionAggregator.Process Method

Implement this method to do something for every value in the range. Note: You can abort the processing (for example if there is an error) by returning false in this function, and the error value in the "error" parameter. But, Excel normally doesn't behave this way. Excel will normally first check all values to see if there is an error, and only then if no cell was a #Err! value, do other checks (for example negative parameters). So, for this to be 100% like Excel, you always need to return true in this function, and check for other errors only after all values have been processed. If you don't care about returning the exact error message Excel returns, you can return the error directly here while you are processing the values and speed up things (since other values won't be processed after you know the first error).

Syntax

Namespace: FlexCel.Core

public abstract Boolean Process(Double value, out TFlxFormulaErrorValue error)

Parameters

<-> | Parameter | Type | Description
 | value | Double | Value that will be processed.
out | error | TFlxFormulaError​Value | Return an error here when the method returns false. If the method returns true, this parameter is undefined.

Returns

False if you want to abort, true to continue.

See also

  • IUserDefinedFunctionAggregator


ColumnImportType Enumeration | FlexCel Studio for the .NET Framework documentation

ColumnImportType Enumeration

Handles how to convert a column from text when importing a text file.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
General | 0 | Try to convert it to a number, a date, etc.
Text | 1 | Keep the column as text, even if it can be converted to a number or other things.
Skip | 2 | Do not import this column.


CondFmtError Enumeration | FlexCel Studio for the .NET Framework documentation

CondFmtError Enumeration

Errors that might happen in a conditional format.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
NoError | 0 | No error was found.
NullRange | 1 | There are no ranges.
NullRules | 2 | There are no rules.
TopLessThan0 | 3 | One range has a Top less than 0;
BottomMoreThanMax | 4 | One range has bottom bigger than the maximum rows allowed in a sheet.
BottomLessThanTop | 5 | One range has the top bigger than the bottom.
LeftLessThan0 | 6 | One range has a Left less than 0;
RightMoreThanMax | 7 | One range has right bigger than the maximum columns allowed in a sheet.
RightLessThanLeft | 8 | One range has the left bigger than the right.
PriorityMustBeBiggerThanZero | 9 | Priority must be bigger than 0.
IconSetMustHaveIconCountLess1Values | 10 | An iconset must have a list of values with a count of the number of icons -1. So if the iconset has 3 icons, the values must be 2.
IconSetCantBeNone | 11 | You can't specify an iconset of none. An iconset of none can only be used in custom icons.
ColorScalesMustHaveAtLeast2Values | 12 | A color scale must have at least 2 values.
ColorScalesMustHaveTheSameNumberOfValuesAndColors | 13 | The number of colors in the color scale must be the same as the number of values.


FlexCelClipboardFormat Enumeration | FlexCel Studio for the .NET Framework documentation

FlexCelClipboardFormat Enumeration

The file fomats that FlexCel can natively put in the clipboard.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
Text | 0 | File will be copied as text.
Xls | 1 | File will be copied as xls (BIFF8)
Html | 2 | File will be copied as HTML. Note that if you need more control about the type of html generated, you can use FlexCelHtmlExport.ExportToClipboard.


FlexCelError Enumeration | FlexCel Studio for the .NET Framework documentation

FlexCelError Enumeration

An enumeration of all possible FlexCel non fatal errors that can be logged.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
Undefined | 0 | This error should never happen.
XlsTooManyPageBreaks | 256 | There are more page breaks in this page than the maximum allowed, and page breaks over this maximum are being ignored. You can control if you want a "real" exception here with the ExcelFile.ErrorActions and FlexCelReport.ErrorActions properties.
RowHeightTooBig | 257 |
XlsxInvalidName | 258 | A corrupt xlsx file can have invalid names. If ExcelFile.ErrorActions is set to the correct value, those names will be imported as #REF! instead of rising an Exception.
XlsxMissingPart | 259 | The file has references to other parts that don't exist. For example, an image might be referenced in a sheet, but the actual image data missing from the file. If ExcelFile.ErrorActions is set to the correct value, those parts will be ignored.
RenderMetafile | 512 | There was a GDI+ error trying to draw or print a metafile. It will be rendered as a bitmap.
RenderCorruptImage | 513 | The image could not be rendered by GDI+.
RenderErrorDrawingImage | 514 | An image could not be drawn. This error normally happens in .NET 1.1 if vj# is not installed.
RenderGenericPreview | 515 | A generic error when drawing the preview.
PdfFontNotFound | 768 | The font was not found in the system. A substitute font will be used for the rendering, and it might not look the same. If you are seeing this message in a server, make sure the server has the same fonts installed as the machine where you developed the application.
PdfGlyphNotInFont | 769 | FlexCel is trying to render a character that is not in the font or the fallback fonts. This character will show as an empty square in the generated PDF file. Normally this means that Excel is replacing fonts, for example Arial with MS Mincho, and to fix this error you should provide a suitable list of Fallback fonts. Look at 'Dealing with missing fonts and glyphs' in the Pdf Exporting Guide for more information.
PdfUsedFallbackFont | 770 | FlexCel is trying to render a character that is not in the font, but it is in the fallback font list. This character will be drawn with the fallback font. Normally this means that Excel is replacing fonts, for example Arial with MS Mincho. Look at 'Dealing with missing fonts and glyphs' in the Pdf Exporting Guide for more information.
PdfFauxBoldOrItalics | 771 | The font you are trying to use does not have a "bold" or "italic" variation, and we will use "faux" font created by making the normal font heavier or slanting it to the right. This normally results in lower quality text that might not look good. We recommend that you use fonts that have italics and bold variations. If you want to avoid FlexCel creating faux bold or italic, you can set FlexCelPdfExport.UseFauxStyles = false. But even if you set that property off, this warning will still appear in FlexCelTrace. Look at 'Dealing with missing fonts and glyphs' in the Pdf Exporting Guide for more information.
PdfCorruptFontInFontFolder | 772 | The "Fonts" folder in this machine has a file that could not be parsed by FlexCel and is probably corrupt. While this will not affect FlexCel in any way, you might want to look at the "Font" folder and remove this font, since it can make windows slower.
PdfFontLicenseDoesntAllowEmbedding | 773 | Trying to embed a font which is not licensed to be embedded.
HtmlSaveSharingViolation | 1024 | There was a sharing violation when trying to save an html file, and FlexCelHtmlExport.IgnoreSharingViolations is true. Normally this just means two parallel threads trying to write the same file and can be safely ignored.
MalformedUrl | 1280 | A malformed Url was detected in the xls file and was not exported. An example of this might be: "mailto:test@test@test".
RecoveryInvalidName | 1536 | A name couldn't be loaded.
RecoveryInvalidFormulaTokens | 1537 | A formula can't be read.
RecoveryInvalidFormat | 1538 | The format is invalid.


FlexCelGraphicFramework Enumeration | FlexCel Studio for the .NET Framework documentation

FlexCelGraphicFramework Enumeration

Defines the Graphics Framework that FlexCel will use to render files to images or PDF. Only works in .NET 5+. You can change it by setting the property FlexCelConfig.GraphicFramework

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
SkiaSharp | 0 | FlexCel will use SKIASharp for its graphics. This has the advantage of having the exact same results in every platform (Windows, macOS, etc), and the disadvantage of an extra dependency required to SKIA. It also might not support platform-only functionality like Window's EMF files.
Native | 1 | FlexCel will use the native graphics engine for the OS. That is GDI+ for Windows, CoreGraphics for iOS/macOS, Native Skia for Android, and Skia for the rest.


FlxErr Enumeration | FlexCel Studio for the .NET Framework documentation

FlxErr Enumeration

Error Codes used in Exceptions.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
ErrInternal | 0 | Unexpected error
ErrInvalidCellValue | 1 | Can't convert the object into a valid value.
ErrNotConnected | 2 | Adapter's "Connect" Method has not been called.
ErrInvalidRow | 3 | Trying to access to an invalid row.
ErrInvalidColumn | 4 | Trying to access to an invalid column.
ErrInvalidValue | 5 | Generic out of range error. Params for this message should be taken from FlxParam.
ErrInvalidValue2 | 6 | Generic out of range error when there are no objects to index.
ErrInvalidValue3 | 7 | Generic out of range error when the specific value is invalid.
ErrDataSetNotFound | 8 | Can't find a dataset for a named range.
ErrInvalidSheet | 9 | Sheet name does not exist.
ErrFormulaTooLong | 10 | Formula is longer than 0xFFFF
ErrNotAString | 11 | When parsing a formula and expecting a string.
ErrUnterminatedString | 12 | A string missing the ending "
ErrUnexpectedId | 13 | A formula with an invalid identifier.
ErrUnexpectedChar | 14 | A formula with an invalid character.
ErrInvalidTable | 15 | A table doesn't exist inside a formula.
ErrTableNotFound | 16 | Table doesn't exist.
ErrMissingParen | 17 | A missing parenthesis.
ErrMissingSquareBracket | 18 | A missing square bracket.
ErrInvalidNumberOfParams | 19 | Invalid number of parameters for the function.
ErrUnexpectedEof | 20 | Unexpected end of formula.
ErrFormulaStart | 21 | Formula must start with "="
ErrFormulaInvalid | 22 | Formula is invalid.
ErrFilterInvalid | 23 | Filter is invalid.
ErrFunctionNotFound | 24 | Function on the formula does not exist.
ErrCircularReference | 25 | A formula refers to itself.
ErrInvalidRef | 26 | An invalid cell reference. A valid one is "A1"
ErrInvalidRef2 | 27 | An invalid cell reference. If it is trying to add a reference to an external name, it might be missing a workspace.
ErrInvalidRange | 28 | An invalid range reference. A valid one is "A1:A2"
ErrInvalidRangeRef | 29 | The name defining band "{0}" has a negative number of rows or columns. Verify it has absolute references ($A$1:$B$2) instead of relative ($A$1:B2)
ErrMissingEOT | 30 | An invalid End of tag (for example, <#...>>)
ErrMissingArgs | 31 | Missing arguments for a function.
ErrTooMuchArgs | 32 | Too much arguments on a function.
ErrArgsMustBeEven | 33 | The number of arguments must be multiple of 2.
ErrReadAfterEOF | 34 | Reading after the end of a datatable.
ErrReadBeforeBOF | 35 | Reading before the beginning of a datatable.
ErrIntersectingRanges | 36 | 2 data ranges intersect on a report.
ErrEqualRanges | 37 | 2 data ranges are the same, and FlexCel can't figure out which one is the master and which one the detail.
ErrUndefinedFunction | 38 | Function is not defined on file FunctionNames.resx
ErrUndefinedId | 39 | Id is not defined on file xxxx
ErrInvalidFormat | 40 | Invalid format on report.
ErrFormatAlreadyExists | 41 | Format was already defined in the config sheet.
ErrExpressionAlreadyExists | 42 | Expression was already defined in the config sheet.
ErrColumNotFound | 43 | Column does not exits.
ErrPropertyNotFound | 44 | The property does not exist.
ErrMemberNotFound | 45 | Dataset does not have a field.
ErrDataSetNotInRange | 46 | Dataset is not inside any named range.
ErrInvalidImage | 47 | Image is invalid.
ErrCreatingImage | 48 | Error trying to create an empty image. Probably out of memory.
ErrOnIncludeReport | 49 | Error in an included report.
ErrTooManyNestedIncludes | 50 | Too many nested includes, probably one file is recursively including itself.
ErrTooManyNestedObjects | 51 | Too many nested objects.
ErrCantFindNamedRange | 52 | Cannot find the included named range.
ErrUnknownRangeType | 53 | Range is not __, _, I_ or II_
ErrNotSupportedOnTrial | 54 | This feature is not supported on non commercial version of FlexCel.
ErrUndefinedUserFunction | 55 | User defined function implementation is null.
ErrUndefinedUserFormat | 56 | User defined format implementation is null.
ErrDataSetNotFoundInConfig | 57 | Can't find a dataset for a configsheet.
ErrDataSetNotFoundInExpression | 58 | Can't find a dataset for an expression on the sheet.
ErrCantChangeRecalcMode | 59 | RecalcMode can only be changed when no file is open.
ErrWorkbookNull | 60 | Workbook can't be null on this version of the method.
ErrCompression | 61 | Error with the compression engine.
ErrInvalidRelationshipNullValues | 62 | A relationship is invalid.
ErrInvalidRelationship2Tables | 63 | A relationship is invalid.
ErrInvalidRelationshipFields | 64 | A relationship is invalid.
ErrInvalidRelationshipDatasetNull | 65 | A relationship is invalid.
ErrInvalidManualRelationshipDatasetNull | 66 | A relationship is invalid.
ErrInvalidManualRelationshipFieldCount | 67 | A relationship is invalid.
ErrInvalidRelationship2Fields | 68 | A relationship is invalid.
ErrInvalidSql2Params | 69 | SQL function should have only 2 parameters.
ErrInvalidSplit2Params | 70 | SPLIT function should have only 2 parameters.
ErrInvalidSplitCount | 71 | Second parameter of a split function must be a positive integer.
ErrInvalidTop2Params | 72 | TOP function should have only 2 parameters.
ErrInvalidTopCount | 73 | Second parameter of a TOP function must be a positive integer.
ErrInvalidMin23Params | 74 | ATLEAST function should have 2, 3 or 4 parameters.
ErrInvalidMinCount | 75 | Second parameter of an ATLEAST function must be a positive integer.
ErrInvalidMultipleOf | 76 | Fourth parameter of an ATLEAST function must be a positive integer.
ErrInvalidNRows1Param | 77 | ROWS function should have only 1 parameter.
ErrInvalidNRowsCount | 78 | Parameter of a ROWS function must be a positive integer.
ErrInvalidColumns1Param | 79 | COLUMNS function should have only 1 parameter.
ErrInvalidJoinTableCount | 80 | JOIN function should have at least 2 parameters.
ErrInvalidUnionTableCount | 81 | UNION function should have at least 2 parameters.
ErrInvalidSqlParen | 82 | Missing closing parenthesis.
ErrInvalidSplitParen | 83 | Missing closing parenthesis.
ErrInvalidTopParen | 84 | Missing closing parenthesis.
ErrInvalidAtLeastParen | 85 | Missing closing parenthesis.
ErrInvalidNRowsParen | 86 | Missing closing parenthesis.
ErrInvalidColumnsParen | 87 | Missing closing parenthesis.
ErrInvalidJoinParen | 88 | Missing closing parenthesis.
ErrInvalidUnionParen | 89 | Missing closing parenthesis.
ErrInvalidUserTableParen | 90 | Missing closing parenthesis.
ErrInvalidSqlAdapterNotFound | 91 | Adapter not found.
ErrInvalidSqlAdapterNoSelect | 92 | The adapter has not SQL select command defined.
ErrInvalidSqlString | 93 | SQL string contains invalid characters.
ErrDataSetNull | 94 | DataSet should not be null.
ErrAdapterNull | 95 | Adapter should not be null.
ErrSQLCommandNull | 96 | SQL command should not be null.
ErrInvalidFilterParen | 97 | Missing parenthesis.
ErrOnConfigTables | 98 | Error reading config tables.
ErrInvalidDistinctParams | 99 | Parameters for distinct filter should not be null.
ErrInvalidSqlParams | 100 | Parameters for SQL parameters should not be null.
ErrSqlParameterNotFound | 101 | The parameter for a direct sql query was not found.
ErrEofReached | 102 | EofReached
ErrArrayNotSquared | 103 | All rows on an array must have the same number of columns.
ErrInvalidCols | 104 | The columns on an array must be between 1 and 256
ErrInvalidRows | 105 | The rows on an array must be between 1 and 65536
ErrInvalidErrorCode | 106 | Invalid error code
ErrEmptyFolder | 107 | The folder does not contain any file of the needed type.
ErrPDFFontFolderDoesntExist | 108 | The folder for fonts doesn't exist.
ErrNotASinglePDFFontFolderExists | 109 | None of the folders for fonts exist.
ErrTiffEncoderNotFound | 110 | Cannot find a Tiff Encoder.
ErrInvalidImageFormat | 111 | Invalid image format.
ErrInvalidHtmlParam | 112 | Invalid parameter for html tag.
ErrInvalidRowColParameters | 113 | Invalid parameter for rowheight or columnwidth tag.
ErrInvalidRowColParameters2 | 114 | Invalid second parameter for rowheight or columnwidth tag.
ErrInvalidRowColParameters3 | 115 | Invalid third parameter for rowheight or columnwidth tag.
ErrInvalidRowColParameters4 | 116 | Invalid fourth parameter for rowheight or columnwidth tag.
ErrInvalidRefTag | 117 | Invalid parameter for ref tag, 1 parameter version.
ErrInvalidRefTag2 | 118 | Invalid parameter for ref tag, 2 parameter version.
ErrInvalidRefTag3 | 119 | Invalid parameter for ref tag, 3 parameter version.
ErrInvalidGlobalAdjustment | 120 | Invalid parameter on Autofit settings tag.
ErrInvalidGlobalAdjustmentFixed | 121 | Invalid parameter on Autofit settings tag.
ErrInvalidGlobalAutofit | 122 | Invalid adjustment on Autofit settings tag.
ErrInvalidAutoFitMerged | 123 | Invalid Merge mode.
ErrSplitNeedsOneAndOnlyOneDetail | 124 | When using Splitted tables, the detail must directly follow the master.
ErrSplitNeedsOnlyOneMaster | 125 | A table cannot be assigned to 2 different splits masters.
ErrUserTableEventNotAssigned | 126 | The template has User table tags, but there is no UserTable event assigned to the report.
ErrTableDoesNotSupportFilter | 127 | This is a virtual table, and it didn't define the methods needed to filter it.
ErrTableDoesNotSupportTag | 128 | This is a virtual table, and it didn't define the methods needed to support this tag.
ErrTableDoesNotSupportTagConfig | 129 | This is a virtual table, and it didn't define the methods needed to support this tag.
ErrTableDoesNotSupportMasterDetail | 130 | This is a virtual table, and it didn't define the methods needed to support master detail relationships.
ErrTableDoesNotSupportLookup | 131 | This is a virtual table, and it didn't define the methods needed to be used as a Lookpup source.
ErrInvalidEncodingForMIME | 132 | The encoding con not be used to create a MIME file.
ErrBeginExportNotCalled | 133 | Before exporting a sheet you need to call BeginExport
ErrBeginPrintNotCalled | 134 | Before printing a sheet you need to call BeginPrint
ErrNoDuplicatedPreprocess | 135 | A preprocess tag must not be nested.
ErrInvalidDefinedGlobal | 136 | If the Defined tag has 2 parameters, the second must be GLOBAL or LOCAL.
ErrInvalidRowColDelete | 137 | Invalid parameters for delete row/col
ErrNeedsUnmanaged | 138 | The operation needs unmanaged permissions in order to complete.
ErrInvalidApplyTag | 139 | A format definition in the config sheet is not valid.
ErrAtCell | 140 | Error at cell n.
CellError | 141 | Message that will be written in a cell when there is an error in a report and FlexCelReport.ErrorsInResultFile is true.
ErrInvalidIncludeStatic | 142 | Invalid parameter for include.
ErrInvalidIncludeRowCol | 143 | Invalid parameter for include.
ErrInvalidAutoPageBreaksPercent | 144 | Invalid value in the percent of page used in an automatic page break tag.
ErrInvalidAutoPageBreaksPageScale | 145 | Invalid PageScale in automatic page break tag.
ErrInvalidImgPosParameter | 146 | Invalid parameter for a ImgPos tag.
ErrInvalidImgFitParameter | 147 | Invalid parameter for a ImgFit tag.
ErrDuplicatedLinkedFile | 148 | Trying to add an xls file that already exists to a Workspace collection.
ErrInvalidAggParameter | 149 | Aggregate must be "SUM", "COUNT", "AVG", "MAX" or "MIN"
ErrAggFilterMustReturnABooleanValue | 150 | An agreggate filter must return a boolean value.
ErrFilterMustReturnABooleanValue | 151 | A filter must return a boolean value.
ErrFontNotFound | 152 | Font was not found in the system.
ErrGlyphNotFound | 153 | Font doesn't contain the character.
ErrUsedFallbackFont | 154 | Font is missing a character and a fallback font was used instead.
ErrFauxBoldOrItalic | 155 | Font doesn't have italic or bold variant.
ErrFontNotSupported | 156 | Font is not supported.
ErrInvalidEmptyName | 157 | Name cannot be empty.
ErrNameTooLong | 158 | Name is too long.
ErrStyleDoesntExists | 159 | Named style doesn't exists.
ErrStyleAlreadyExists | 160 | Style already exists.
ErrCantRenameBuiltInStyle | 161 | Built-in styles can't be renamed.
ErrCantDeleteBuiltInStyle | 162 | Built-in styles can't be deleted.
ErrCantAddStyleFormats | 163 | Style formats have to be added using SetStyle method, not with addformat.
ErrCantMixCellAndStyleFormats | 164 | You can't replace a cell format with a style format or viceversa.
ErrInvalidColorType | 165 | ColorType is of the wrong type.
ErrInvalidColorValue | 166 | Value for the color is outside bounds.
ErrInvalidColorEnum | 167 | Value must be one of the enum, and can't be none.
ErrStringConstantInFormulaTooLong | 168 | String constant in formula is too long. (max 255 chars)
ErrNoBorderColorSet | 169 | When you set a border style different from none, then the border color must be set too.
ErrCantUseThemeColorsInsideATheme | 170 | You can use a themed color to define a color inside a theme.
ErrNullParameter | 171 | Parameter can't be null.
ErrNullOrEmptyParameter | 172 | Parameter can't be null or empty.
ErrRangeNameAlreadyExists | 173 | The name for the range already exists.
ErrInvalidName | 174 | Name is invalid.
ErrInvalidEnum | 175 | Enum must exist.
ErrInvalidLinQDetail | 176 | Detail table doesn't have a parent.
ErrInvalidSortString | 177 | The sort string is not supported.
ErrEmptyKeyNames | 178 | The keys in a lookup can't be empty.
ErrValuesAndKeysMismatch | 179 | Keys and values in a lookup must have the same number of elements.
ErrDatasetDoesntSupportWhere | 180 | When using LINQ, FlexCel implements filters by calling a "Where(string)" method in the data table. If the table doesn't have a "Where(string)" method, FlexCel can't filter the records.
ErrInvalidReportRowCount | 181 | The count of records in a table is different from the actual number of records when reading the data. This means that someone else has inserted or deleted records while this report was running. To avoid this issue, make sure you run the report with isolation level = SNAPSHOT.
ErrInvalidFilterDateTime | 182 | Dates in filters must be written as "yyy-dd-mm hh:mm:ss"
ErrInvalidXlsxFile | 183 | Invalid xlsx file.
ErrInvalidContentType | 184 | File doesn't have a valid content-type
ErrInvalidZip | 185 | Invalid zip file.
ErrCompressionNotSupported | 186 | Compression mode not supported.
ErrReadingOutOfBounds | 187 | Trying to read after the end of the stream.
ErrInvalidLocalHeader | 188 | Invalid local header in the zip file.
ErrZipNameTooLong | 189 | File name is too long.
ErrInvalidIndex | 190 | Invalid Index.
ErrCantRead | 191 | Can't read from a compression stream.
ErrCantSeek | 192 | Can't seek in a compression stream.
ErrMustSpecifyFolder | 193 | You must specify a folder to compress.
ErrValueIsNotOfType | 194 | Value is not of the expected type.
ErrNoPagesToPrint | 195 | There are no pages to print.
ErrFontNotLicensed | 196 | The font licensing doesn't allow embedding.
ErrFormatConditionCantBeNull | 197 | The format condition can't be null.
ErrInvalidTypeForShapeOption | 198 | The shape option is a wrong type.
InvalidShapeGeomXML | 199 | The XML defining a shapegeom must start with shapeGeom.
InvalidShapeGeomXML2 | 200 | The XML defining a shapegeom must follow shapeGeom with custGeom or prstGeom.
ErrStructRefNoColumn | 201 | The column referenced in the structured reference can't be found.
ErrEmptyTableStyleName | 202 | The name of a table style can't be empty.
ErrTableStyleDoesntExist | 203 | The table style name does not exist.
ErrTableStyleAlreadyExists | 204 | The table style name already exists.
ErrCantSaveStrictXlsm | 205 | Strict xlsx files don't support macros.
ErrReportTableNeedsTwoRows | 206 | Tables used as datasources of a report need at least 2 rows.
ErrEmptyStack | 207 | The stack is empty and it is not possible to pop an element.
ErrEmptyArrayMember | 208 | Arrays in formulas can't have empty elements.
ErrInvalidArrayMember | 209 | Invalid element in a formula array.
ErrCantInsertAChartInANotWorksheet | 210 | Charts can only be inserted in normal sheets.
ErrInvalidLambdaParameterName | 211 | Lambda parameter names can't start with a number, or be a valid cell reference, etc.
ErrRepeatedLambdaParameter | 212 | You can't define the same parameter twice in a Lambda expression or a LET function.
MustHaveAtLeastOneWindow | 213 | A workbook must have at least one window.
ErrRequiredLambdaParameterAfterOptional | 214 | A required lambda parameter cannot come after an optional one.
ErrInvalid3DRef | 215 | Invalid 3D reference.
ErrInvalidSheetVisibleParameters | 216 | Invalid parameter for sheet visible tag.
ErrFontInvalid | 217 | The font has invalid height or width.


FlxMessage Enumeration | FlexCel Studio for the .NET Framework documentation

FlxMessage Enumeration

Some custom strings.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
CustomPageSize | 0 | Name of a custom page size.
TxtSeries | 1 | Text that will be shown on chart legends when no data is assigned.
TxtDefaultTimeAMString | 2 | Default text to show when AM time string is set to empty on the regional settings dialog from the control panel. When the default is empty, Excel defaults to AM, while .NET defaults to an empty string. As we want to behave the same as Excel, we provide this constant here.
TxtDefaultTimePMString | 3 | Default text to show when PM time string is set to empty on the regional settings dialog from the control panel. When the default is empty, Excel defaults to PM, while .NET defaults to an empty string. As we want to behave the same as Excel, we provide this constant here.


FlxParam Enumeration | FlexCel Studio for the .NET Framework documentation

FlxParam Enumeration

Parameter names that can go into an "invalid params" error message.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
ActiveSheet | 0 | ActiveSheet
SheetFrom | 1 | SheetFrom
SheetDest | 2 | SheetDest
SheetCount | 3 | SheetCount
CellMergedIndex | 4 | CellMergedIndex
NamedRangeIndex | 5 | NamedRangeIndex
ImageIndex | 6 | ImageIndex
ObjectIndex | 7 | ObjectIndex
CommentIndex | 8 | CommentIndex
SourceSheet | 9 | SourceSheet
HyperLinkIndex | 10 | HyperLinkIndex
OutlineLevel | 11 | OutlineLevel
IgnoreCase | 12 | IgnoreCase
AutoShapeIndex | 13 | AutoShapeIndex
ChartIndex | 14 | ChartIndex
SeriesIndex | 15 | SeriesIndex
ConditionalFormatIndex | 16 | ConditionalFormatIndex
PercentOfUsedSheet | 17 | PercentOfUsedSheet
Level | 18 | Level
PageScale | 19 | PageScale
DataValidationIndex | 20 | DataValidationIndex
FormatIndex | 21 | FormatIndex
NumberOfThreads | 22 | NumberOfThreads
Index | 23 | Index
FirstSheetVisible | 24 | FirstSheetVisible
ScreenScaling | 25 | ScreenScaling
Position | 26 | Position
SubchartPos | 27 | SubchartPos
AxisIndex | 28 | AxisIndex
Window | 29 | Window
SheetIndex | 30 | Sheet index.


ImageColorDepth Enumeration | FlexCel Studio for the .NET Framework documentation

ImageColorDepth Enumeration

Number of colors for the exported images.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
TrueColor | 0 | 24 bits per pixel, no alpha channel.
TrueColorAlpha | 1 | 32 bits per pixel, 8R, 8G, 8B and 8Alpha.
Color256 | 5 | 8 bits per pixel, 256 colors.
BlackAndWhite | 10 | 1 bit per pixel, 2 colors (black and white).


ImageExportType Enumeration | FlexCel Studio for the .NET Framework documentation

ImageExportType Enumeration

Defines how you want to export the sheet.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
Png | 0 | Export as png image. Only the first page of the Excel active sheet will be exported.
Gif | 12 | Export as gif file. Only the first page of the Excel active sheet will be exported.
Jpeg | 13 | Export as jpg file. Only the first page of the Excel active sheet will be exported.
Tiff | 14 | Export as multipage tiff.
Fax | 15 | Export as a black and white multipage tiff ccitt3 compatible with standard fax.
Fax4 | 16 | Export as a black and white multipage tiff ccitt4 compatible with standard fax.


InternalNameRange Enumeration | FlexCel Studio for the .NET Framework documentation

InternalNameRange Enumeration

List of internal range names. On Excel, internal range names like "Print_Area" are stored as a 1 character string. This is the list of the names and their value. You can convert an InternalNameRange into a string by casting it to a char, or by calling TXlsNamedRange.GetInternalName

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
Consolidate_Area | 0 | Consolidate_Area
Auto_Open | 1 | Auto_Open
Auto_Close | 2 | Auto_Close
Extract | 3 | Extract
Database | 4 | Database
Criteria | 5 | Criteria
Print_Area | 6 | Print_Area
Print_Titles | 7 | Print_Titles
Recorder | 8 | Recorder
Data_Form | 9 | Data_Form
Auto_Activate | 10 | Auto_Activate
Auto_Deactivate | 11 | Auto_Deactivate
Sheet_Title | 12 | Sheet_Title
Filter_DataBase | 13 | Used in AutoFilters.

Examples

To get the print range on the ActiveSheet, use:

    TXlsNamedRange printArea = xls.GetNamedRange(TXlsNamedRange.GetInternalName(InternalNameRange.Print_Area), xls.ActiveSheet);


TArrowLen Enumeration | FlexCel Studio for the .NET Framework documentation

TArrowLen Enumeration

The length of an arrow head.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
Small | 0 | Small.
Medium | 1 | Medium.
Large | 2 | Large.


TArrowStyle Enumeration | FlexCel Studio for the .NET Framework documentation

TArrowStyle Enumeration

Style of an arrow.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
None | 0 | No arrow.
Normal | 1 | Normal arrow.
Stealth | 2 | Stealth arrow.
Diamond | 3 | Diamond-shaped arrow.
Oval | 4 | Oval shaped arrow.
Open | 5 | Line arrow. (no fill)


TArrowWidth Enumeration | FlexCel Studio for the .NET Framework documentation

TArrowWidth Enumeration

Preset width for an arrow.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
Small | 0 | Small.
Medium | 1 | Medium.
Large | 2 | Large.


TAutofitMerged Enumeration | FlexCel Studio for the .NET Framework documentation

TAutofitMerged Enumeration

Specifies how a merged cell will be autofitted. For example, if you have a merged cell from row 1 to 4, You might want to increase the size of the first row, the second, the last, or every row a little.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
None | 0 | Merged cells with more than one row will not be autofitted when autofitting rows, and merged cells with more than one column will not be autofitted when autofitting rows.
OnLastCell | 1 | Autofit will change the size of the last row of the merged cell when autofitting rows, or the last column when autofitting columns.
OnLastCellMinusOne | 2 | Autofit will change the size of the row before the last row of the merged cell when autofitting rows, or the column before the last column when autofitting columns.
OnLastCellMinusTwo | 3 | Autofit will change the size of 2 rows before the last row of the merged cell when autofitting rows, or 2 columns before the last column when autofitting columns.
OnLastCellMinusThree | 4 | Autofit will change the size of 3 rows before the last row of the merged cell when autofitting rows, or 3 columns before the last column when autofitting columns.
OnLastCellMinusFour | 5 | Autofit will change the size of 4 rows before the last row of the merged cell when autofitting rows, or 4 columns before the last column when autofitting columns.
OnFirstCell | 6 | Autofit will change the size of the first row of the merged cell when autofitting rows, or the first column when autofitting columns.
OnSecondCell | 7 | Autofit will change the size of the second row of the merged cell when autofitting rows, or the second column when autofitting columns.
OnThirdCell | 8 | Autofit will change the size of the third row of the merged cell when autofitting rows, or the third column when autofitting columns.
OnFourthCell | 9 | Autofit will change the size of the fourth row of the merged cell when autofitting rows, or the fourth column when autofitting columns.
OnFifthCell | 10 | Autofit will change the size of the fifth row of the merged cell when autofitting rows, or the fifth column when autofitting columns.
Balanced | 11 | Autofit will change the height every row in the merged cell by the same amount.


TAutomaticColor Enumeration | FlexCel Studio for the .NET Framework documentation

TAutomaticColor Enumeration

A list of special colors that depend on the user settings in windows.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
None | 0 | No Automatic color is applied.
DefaultForeground | 1 | Default foreground color. This is the window text color in the sheet display
DefaultBackground | 2 | Default background color. This is the window background color in the sheet display and is the default background color for a cell.
DefaultChartForeground | 3 | Default chart foreground color. This is the window text color in the chart display
DefaultChartBackground | 4 | Default chart background color. This is the window background color in the chart display.
ChartNeutralColor | 5 | Chart neutral color (Black)
TooltipTextColor | 6 | ToolTip text color. This is the automatic font color for comments
SheetTab | 7 | Sheet tab color.
Font | 8 | Font automatic color. This is the window text color.
WindowFrame | 9 | This color is not in the list of automatic colors, but might happen in a file.
BtnFace | 10 | This color is not in the list of automatic colors, but might happen in a file.
BtnText | 11 | This color is not in the list of automatic colors, but might happen in a file.
BtnHighlight | 12 | This color is not in the list of automatic colors, but might happen in a file.
BtnShadow | 13 | This color is not in the list of automatic colors, but might happen in a file.
Highlight | 14 | This color is not in the list of automatic colors, but might happen in a file.
WindowText | 15 | This color is not in the list of automatic colors, but might happen in a file.
ScrollBar | 16 | This color is not in the list of automatic colors, but might happen in a file.
ScrollBarInvert | 17 | This color is not in the list of automatic colors, but might happen in a file.
Window2 | 18 | This color is not in the list of automatic colors, but might happen in a file.
WindowFrame2 | 19 | This color is not in the list of automatic colors, but might happen in a file.
InfoBk | 20 | This color is not in the list of automatic colors, but might happen in a file.


TAxisLabelPosition Enumeration | FlexCel Studio for the .NET Framework documentation

TAxisLabelPosition Enumeration

Position of the labels on the axis.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
None | 0 | This axis has no labels.
LowEnd | 1 | Labels go at the left of the chart, or to the bottom if axis is vertical.
HighEnd | 2 | Labels go at the right of the chart, or to the top if axis is vertical.
NextToAxis | 3 | Labels go next the axis, not to the chart.


TAxisType Enumeration | FlexCel Studio for the .NET Framework documentation

TAxisType Enumeration

Type of axis.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
Category | 0 | Category Axis.
Value | 1 | Value Axis.
Series | 2 | Series Axis.


TBackgroundMode Enumeration | FlexCel Studio for the .NET Framework documentation

TBackgroundMode Enumeration

How to draw backgrounds of text.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
Automatic | 0 | This is equivalent to transparent.
Transparent | 1 | Text will be drawn transparently.
Opaque | 2 | Text will be drawn on a box.


TBlipCompression Enumeration | FlexCel Studio for the .NET Framework documentation

TBlipCompression Enumeration

This type specifies the amount of compression that has been used for a particular picture.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
None | 0 | No compression used.
Email | 1 | Compressed for email.
Screen | 2 | Compressed for screen viewing.
Print | 3 | Compressed for printing.
HQPrint | 4 | Compressed for high quality printing.


TBlipTransformType Enumeration | FlexCel Studio for the .NET Framework documentation

TBlipTransformType Enumeration

The type of transform applied to an image.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
Unknown | 0 | A transform which FlexCel currently doesn't know about.
ColorChange | 1 | Change one color to another.
AlphaModFix | 2 | Change the opacity of the image.


TBubbleSizeType Enumeration | FlexCel Studio for the .NET Framework documentation

TBubbleSizeType Enumeration

What the bubble size means.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
None | 0 | Not used.
BubbleSizeIsArea | 1 | Bubble size represents the area.
BubbleSizeIsWidth | 2 | Bubble size represents the width.


TBuiltInStyle Enumeration | FlexCel Studio for the .NET Framework documentation

TBuiltInStyle Enumeration

Enumerator with all built-in styles in Excel.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
Normal | 0 | Normal style, used in all non formatted cells.
RowLevel | 1 | Style used in row outlines.
ColLevel | 2 | Style used in column outlines.
Comma | 3 | Built-in Style.
Currency | 4 | Built-in Style.
Percent | 5 | Built-in Style.
Comma0 | 6 | Built-in Style.
Currency0 | 7 | Built-in Style.
Hyperlink | 8 | Built-in Style.
Followed_Hyperlink | 9 | Built-in Style.
Note | 10 | Standard style (not actually built in).
Warning_Text | 11 | Standard style (not actually built in).
Emphasis_1 | 12 | Standard style (not actually built in).
Emphasis_2 | 13 | Standard style (not actually built in).
Emphasis_3 | 14 | Standard style (not actually built in).
Title | 15 | Standard style (not actually built in).
Heading_1 | 16 | Standard style (not actually built in).
Heading_2 | 17 | Standard style (not actually built in).
Heading_3 | 18 | Standard style (not actually built in).
Heading_4 | 19 | Standard style (not actually built in).
Input | 20 | Standard style (not actually built in).
Output | 21 | Standard style (not actually built in).
Calculation | 22 | Standard style (not actually built in).
Check_Cell | 23 | Standard style (not actually built in).
Linked_Cell | 24 | Standard style (not actually built in).
Total | 25 | Standard style (not actually built in).
Good | 26 | Standard style (not actually built in).
Bad | 27 | Standard style (not actually built in).
Neutral | 28 | Standard style (not actually built in).
Accent1 | 29 | Standard style (not actually built in).
Accent1_20_percent | 30 | Standard style (not actually built in).
Accent1_40_percent | 31 | Standard style (not actually built in).
Accent1_60_percent | 32 | Standard style (not actually built in).
Accent2 | 33 | Standard style (not actually built in).
Accent2_20_percent | 34 | Standard style (not actually built in).
Accent2_40_percent | 35 | Standard style (not actually built in).
Accent2_60_percent | 36 | Standard style (not actually built in).
Accent3 | 37 | Standard style (not actually built in).
Accent3_20_percent | 38 | Standard style (not actually built in).
Accent3_40_percent | 39 | Standard style (not actually built in).
Accent3_60_percent | 40 | Standard style (not actually built in).
Accent4 | 41 | Standard style (not actually built in).
Accent4_20_percent | 42 | Standard style (not actually built in).
Accent4_40_percent | 43 | Standard style (not actually built in).
Accent4_60_percent | 44 | Standard style (not actually built in).
Accent5 | 45 | Standard style (not actually built in).
Accent5_20_percent | 46 | Standard style (not actually built in).
Accent5_40_percent | 47 | Standard style (not actually built in).
Accent5_60_percent | 48 | Standard style (not actually built in).
Accent6 | 49 | Standard style (not actually built in).
Accent6_20_percent | 50 | Standard style (not actually built in).
Accent6_40_percent | 51 | Standard style (not actually built in).
Accent6_60_percent | 52 | Standard style (not actually built in).
Explanatory_Text | 53 | Standard style (not actually built in).


TCategoryAxisOptions Enumeration | FlexCel Studio for the .NET Framework documentation

TCategoryAxisOptions Enumeration

Options for a Category Axis.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
None | 0 | All magnitudes will be manual.
AutoMin | 1 | Use automatic minimum.
AutoMax | 2 | Use automatic maximum.
AutoMajor | 4 | Use automatic major units.
AutoMinor | 8 | Use automatic minor units.
DateAxis | 16 | This is a date Axis.
AutoBase | 32 | Use automatic base unit.
AutoCrossDate | 64 | Use automatic date crossing point.
AutoDate | 128 | Use automatic date settings.


TCellIndentationRendering Enumeration | FlexCel Studio for the .NET Framework documentation

TCellIndentationRendering Enumeration

Defines how FlexCel renders cell indentation when exporting to pdf or printing.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
ScaleIndentationWithPrintScale | 0 | The cell indentation is made smaller when the print scale is smaller and vice-versa. This is the most logical setting, but it is not how Excel behaves. See 'Cell indentation' in the Api Developer Guide
DontScaleIndentationWithPrintScale | 1 | Keep the absolute value of cell indentation fixed in inches/cm when scaling the sheet. This is the mode in which FlexCel 6.23 and older behaved.
DontScaleIndentationWithPrintScaleExceptWhenPrintHeadings | 2 | Behaves like DontScaleIndentationWithPrintScale if "Print Headings" is false, and like ScaleIndentationWithPrintScale if "Print Headings" is true. This is how Excel behaves.


TCellType Enumeration | FlexCel Studio for the .NET Framework documentation

TCellType Enumeration

Values we can write on a cell

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
Number | 0 | Double precision number.
DateTime | 1 | Not a real type (it is a number).
String | 2 | An unicode string. Might be formatted.
Bool | 3 | Boolean.
Error | 4 | Error code
Empty | 5 | Blank cell.
Formula | 6 | A formula.
Unknown | 7 | The .NET type does not map to any Excel type. (for example a class)


TCfvoType Enumeration | FlexCel Studio for the .NET Framework documentation

TCfvoType Enumeration

Type of a Value-Object for a conditional format.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
Num | 0 | A number.
Percent | 1 | The minimum value in the range of cells that the conditional formatting rule applies to plus X percent of the difference between the maximum and minimum values in the range of cells that the conditional formatting rule applies to.
Max | 2 | The maximum value from the range of cells that the conditional formatting rule applies to.
Min | 3 | The minimum value from the range of cells that the conditional formatting rule applies to.
Formula | 4 | A formula.
Percentile | 5 | The minimum value of the cell that is in the X percentile of the range of cells that the conditional formatting rule applies to.
AutoMin | 6 | Only available in Excel 2010 or newer. The smaller of zero or the minimum value from the range of cells that the conditional formatting rule applies to.
AutoMax | 7 | Only available in Excel 2010 or newer. The larger of zero or the maximum value from the range of cells that the conditional formatting rule applies to.


TChartAxisPos Enumeration | FlexCel Studio for the .NET Framework documentation

TChartAxisPos Enumeration

Axis postion.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
Left | 0 | Axis goes at left of the chart.
Top | 1 | Axis goes on top of the chart.
Right | 2 | Axis goes to the right of the chart.
Bottom | 3 | Axis goes to the bottom of the chart.


TChartErrorBarBarType Enumeration | FlexCel Studio for the .NET Framework documentation

TChartErrorBarBarType Enumeration

Specifies the possible ways to draw an error bar.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
None | 0 | No error bars are drawn.
Both | 1 | Specifies that error bars shall be shown in the positive and negative directions.
Plus | 2 | Specifies that error bars shall be shown in the positive direction only.
Minus | 3 | Specifies that error bars shall be shown in the negative direction only.


TChartErrorBarDirection Enumeration | FlexCel Studio for the .NET Framework documentation

TChartErrorBarDirection Enumeration

Direction of an Error bar in a chart.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
Vertical | 0 | Error bars are vertical.
Horizontal | 1 | Error bars are horizontal.


TChartErrorBarErrorType Enumeration | FlexCel Studio for the .NET Framework documentation

TChartErrorBarErrorType Enumeration

Error amount type for the error bar.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
None | 0 | No error.
Percentage | 1 | Error bars show a percentage.
FixedValue | 2 | Error bars show a fixed value.
StdDev | 3 | Error bars show the standard deviation.
Custom | 4 | Error bars show a formula.
StdErr | 5 | Error bars show the standard error.


TChartLabelPositionMode Enumeration | FlexCel Studio for the .NET Framework documentation

TChartLabelPositionMode Enumeration

How coordinates are stored for a label when it is manually positioned.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
MDFX | 0 | Relative position to the chart, in points.
MDABS | 1 | Absolute width and height in points; can only be applied to the mdBotRt field of Pos
MDPARENT | 2 | Owner of Pos determines how to interpret the position data.
MDKTH | 3 | Offset to default position, in 1/1000 th of the plot area size.
MDCHART | 5 | Relative position to the chart, in SPRC.


TChartLayoutMode Enumeration | FlexCel Studio for the .NET Framework documentation

TChartLayoutMode Enumeration

Specifies how the coordinates of a chart rectangle apply.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
Auto | 0 | The coordinates have no meaning, the value will be calculated automatically
Factor | 1 | Specifies that the Width or Height shall be interpreted as the Width or Height of the chart element.
Edge | 2 | Specifies that the Width or Height shall be interpreted as the Right or Bottom of the chart element.


TChartLayoutTarget Enumeration | FlexCel Studio for the .NET Framework documentation

TChartLayoutTarget Enumeration

Defines if the coordinates of the enclosing rectangle include the axis marks and labels.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
Outer | 0 | Specifies that the plot area size shall determine the size of the plot area, the tick marks, and the axis labels.
Inner | 1 | Specifies that the plot area size shall determine the size of the plot area, not including the tick marks and axis labels.


TChartLegendPlacement Enumeration | FlexCel Studio for the .NET Framework documentation

TChartLegendPlacement Enumeration

Position of the legend inside the chart.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
Bottom | 0 | At bottom.
Corner | 1 | At the corner.
Top | 2 | At the top.
Right | 3 | At the right.
Left | 4 | At the left.
NotDocked | 7 | The legend is not docked inside the chart area.


TChartLineStyle Enumeration | FlexCel Studio for the .NET Framework documentation

TChartLineStyle Enumeration

Line styles for a chart object.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
Solid | 0 | Solid line.
Dash | 1 | Dashed line.
Dot | 2 | Dotted line.
DashDot | 3 | Dash-dot line.
DashDotDot | 4 | Dash dot dot line.
None | 5 | No line.
DarkGray | 6 | Dark gray line.
MediumGray | 7 | Medium gray line.
LightGray | 8 | Light gray line.


TChartLineWeight Enumeration | FlexCel Studio for the .NET Framework documentation

TChartLineWeight Enumeration

Different widths for chart lines. Since Excel 2007 this isn't used anymore, as you can use arbitrary line widths.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
Hair | -1 | Minimum width.
Narrow | 0 | Single width.
Medium | 1 | Double width.
Wide | 2 | Triple width.


TChartMarkerType Enumeration | FlexCel Studio for the .NET Framework documentation

TChartMarkerType Enumeration

Kind of marker.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
None | 0 | No marker.
Square | 1 | Square.
Diamond | 2 | Diamond.
Triangle | 3 | Up triangle.
X | 4 | X sign.
Star | 5 | Star.
DowJones | 6 | Dow jones symbol. (small horizontal line)
StandardDeviation | 7 | Standard deviation symbol. (big horizontal line)
Circle | 8 | Circle.
Plus | 9 | Plus sign.
Image | 10 | The marker is an image, with no shape but the shape of the picture. You might also use a picture with the other options, and the picture will be inside a circle, a diamond, etc. This option also doesn't take in account marker size, it uses the size of the image.


TChartRadarStyle Enumeration | FlexCel Studio for the .NET Framework documentation

TChartRadarStyle Enumeration

Style for the radar chart.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
Standard | 0 | Specifies that the radar chart shall have lines but no markers and no fill.
Marker | 1 | Specifies that the radar chart shall have lines and markers but no fill.
Filled | 2 | Specifies that the radar chart shall be filled and have lines but no markers.


TChartTrendlineType Enumeration | FlexCel Studio for the .NET Framework documentation

TChartTrendlineType Enumeration

Defines the type of trendline.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
Exponential | 0 | A best-fit line that matches an exponential curve of type "y = a * b^x".
Linear | 1 | A best-fit straight line that is used with simple linear data sets. The equation is "y = a * x + b"
Logarithmic | 2 | A best-fit curved line that matches a logarithmic curve. The equation is "y = a * log(x) + b"
MovingAverage | 3 | Moving average trendline. It will adapt depending on the period you choose.
Polynomial | 4 | A best-fit curve generated with a polynomial of order n like "y = a * x^2 + b * x + c".
Power | 5 | A curve matching "y = a * x^b".


TChartType Enumeration | FlexCel Studio for the .NET Framework documentation

TChartType Enumeration

Chart style.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
Unknown | 0 | FlexCel cannot determine the chart type.
Area | 1 | Area chart.
Bar | 2 | Bar chart.
Line | 3 | Line chart.
Pie | 4 | Pie chart.
Radar | 5 | Radar chart.
Scatter | 6 | Scatter chart.
Surface | 7 | Surface chart.
Stock | 8 | Stock chart.
Bubble | 9 | Bubble chart.


TCheckboxState Enumeration | FlexCel Studio for the .NET Framework documentation

TCheckboxState Enumeration

Possible values of a checkbox in a sheet.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
Unchecked | 0 | Checkbox is not checked.
Checked | 1 | Checkbox is checked.
Indeterminate | 2 | Checkbox is not set. An indeterminate control generally has a shaded appearance.


TClippingStyle Enumeration | FlexCel Studio for the .NET Framework documentation

TClippingStyle Enumeration

Can be used to clip into a region instead of drawing on it.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
None | 0 | Normal draw, this will draw the image.
Include | 1 | This will include the region into the clipping area, no image will be drawn.
Exclude | 2 | This will exclude the region from the clipping area, no image will be drawn.


TCollapseChildrenMode Enumeration | FlexCel Studio for the .NET Framework documentation

TCollapseChildrenMode Enumeration

Determines how the children of the node of an outline will be when the node is collapsed or expanded.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
DontModify | 0 | Children nodes will be kept in the state they already were. If they were collapsed they will still be collapsed after collpasing or expanding the parent. Same if they were expanded.
Collapsed | 1 | All children nodes of collapsed parents will be collapsed, and will show collapsed when you expand the parent.
Expanded | 2 | All children nodes of collapsed parents will be expanded, and will show expanded when you expand the parent.


TColorTransformType Enumeration | FlexCel Studio for the .NET Framework documentation

TColorTransformType Enumeration

List of transformations that can be done to a color.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
Tint | 0 | Yields a lighter version of its input color. A 10% tint is 10% of the input color combined with 90% white.
Shade | 1 | Yields a darker version of its input color. A 10% shade is 10% of the input color combined with 90% black.
Complement | 2 | Yields the complement of its input color. For example, the complement of red is green.
Inverse | 3 | Yields the inverse of its input color. For example, the inverse of red (1,0,0) is cyan (0,1,1).
Gray | 4 | Yields a grayscale of its input color, taking into relative intensities of the red, green, and blue primaries.
Alpha | 5 | Yields its input color with the specified opacity, but with its color unchanged.
AlphaOff | 6 | Yields a more or less opaque version of its input color. An alpha offset never increases the alpha beyond 100% or decreases below 0%; i.e., the result of the transform pins the alpha to the range of [0%,100%]. A 10% alpha offset increases a 50% opacity to 60%. A -10% alpha offset decreases a 50% opacity to 40%.
AlphaMod | 7 | Yields a more or less opaque version of its input color. An alpha modulate never increases the alpha beyond 100%. A 200% alpha modulate makes a input color twice as opaque as before. A 50% alpha modulate makes a input color half as opaque as before.
Hue | 8 | Yields the input color with the specified hue, but with its saturation and luminance unchanged.
HueOff | 9 | Yields the input color with its hue shifted, but with its saturation and luminance unchanged.
HueMod | 10 | Yields the input color with its hue modulated by the given percentage.
Sat | 11 | Yields the input color with the specified saturation, but with its hue and luminance unchanged. Typically saturation values fall in the range [0%, 100%].
SatOff | 12 | Yields the input color with its saturation shifted, but with its hue and luminance unchanged.
SatMod | 13 | Yields the input color with its saturation modulated by the given percentage. A 50% saturation modulate reduces the saturation by half. A 200% saturation modulate doubles the saturation.
Lum | 14 | Yields the input color with the specified luminance, but with its hue and saturation unchanged. Typically, luminance values fall in the range [0%,100%].
LumOff | 15 | Yields the input color with its luminance shifted, but with its hue and saturation unchanged.
LumMod | 16 | Yields the input color with its luminance modulated by the given percentage. A 50% luminance modulate reduces the luminance by half. A 200% luminance modulate doubles the luminance.
Red | 17 | Yields the input color with the specified red component, but with its green and blue components unchanged.
RedOff | 18 | Yields the input color with its red component shifted, but with its green and blue components unchanged.
RedMod | 19 | Yields the input color with its red component modulated by the given percentage. A 50% red modulate reduces the red component by half. A 200% red modulate doubles the red component.
Green | 20 | Yields the input color with the specified green component, but with its red and blue components unchanged.
GreenOff | 21 | Yields the input color with its green component shifted, but with its red and blue components unchanged.
GreenMod | 22 | Yields the input color with its green component modulated by the given percentage. A 50% green modulate reduces the green component by half. A 200% green modulate doubles the green component.
Blue | 23 | Yields the input color with the specified blue component, but with its red and green components unchanged.
BlueOff | 24 | Yields the input color with its blue component shifted, but with its red and green components unchanged.
BlueMod | 25 | Yields the input color with its blue component modulated by the given percentage. A 50% blue modulate reduces the blue component by half. A 200% blue modulate doubles the blue component.
Gamma | 26 | Yields the sRGB gamma shift of its input color.
InvGamma | 27 | Yields the inverse sRGB gamma shift of its input color.


TColorType Enumeration | FlexCel Studio for the .NET Framework documentation

TColorType Enumeration

Defines which one of the values stored in a TExcelColor structure is the one that must be used.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
Automatic | 0 | Color is Automatic.
RGB | 1 | The structure contains an indexed color.
Theme | 2 | The structure contains a themed color.
Indexed | 3 | The structure contains an indexed color.


TCompoundLineType Enumeration | FlexCel Studio for the .NET Framework documentation

TCompoundLineType Enumeration

Type of line.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
Single | 0 | A single line with normal width.
Double | 1 | A double line, both with normal width.
ThickThin | 2 | A double line, first think and the other thin.
ThinThick | 3 | A double line, first think and the other thick.
Triple | 4 | A triple line, Thin, thick and thin.


TCompressionMode Enumeration | FlexCel Studio for the .NET Framework documentation

TCompressionMode Enumeration

How the fields inside the zip file will be compressed. Zippy supports only both most used methods, Store and Deflate.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
cmAutomatic | -1 | When you specify automatic, the compression mode will be set depending in the extension of the file being added.
cmStored | 0 | File is stored without compressing. When creating files, use this mode to store already compressed files like a png.
cmDeflated | 8 | File will be stored with standard zip compression.


TCondFmtIconSet Enumeration | FlexCel Studio for the .NET Framework documentation

TCondFmtIconSet Enumeration

Different icon sets used in conditional formatting.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
None | 0 | No icon set.
Set3Arrows | 1 | 3 Arrows.
Set3ArrowsGray | 2 | 3ArrowsGray.
Set3Flags | 3 | 3Flags.
Set3TrafficLights1 | 4 | 3TrafficLights1.
Set3TrafficLights2 | 5 | 3TrafficLights2.
Set3Signs | 6 | 3Signs.
Set3Symbols | 7 | 3Symbols.
Set3Symbols2 | 8 | 3Symbols2.
Set4Arrows | 9 | 4Arrows.
Set4ArrowsGray | 10 | 4ArrowsGray.
Set4RedToBlack | 11 | 4RedToBlack.
Set4Rating | 12 | 4Rating.
Set4TrafficLights | 13 | 4TrafficLights.
Set5Arrows | 14 | 5Arrows.
Set5ArrowsGray | 15 | 5ArrowsGray.
Set5Rating | 16 | 5Rating.
Set5Quarters | 17 | 5Quarters.
Set3Triangles | 18 | 3Triangles.
Set3Stars | 19 | 3Stars.
Set5Boxes | 20 | 5Boxes.


TConditionalFormatKind Enumeration | FlexCel Studio for the .NET Framework documentation

TConditionalFormatKind Enumeration

Defines which kind of conditional formatting the rule contains.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
Expression | 0 | When the formula is true, then the conditional format is applied.
CellIs | 1 | Compares the cell with another cell.
ColorScale | 2 | The rule is a color scale.
DataBar | 3 | The rule is data bars.
IconSet | 4 | The rule uses an icon set.
TopN | 5 | The rule is a top N.
UniqueValues | 6 | The rule highlights unique values.
DuplicateValues | 7 | The rule highlights duplicated values.
ContainsText | 8 | The rule highlights cells that contain some text.
NotContainsText | 9 | The rule highlights cells that doesn't contain some text.
BeginsWith | 10 | The rule highlights cells that beign with some text.
EndsWith | 11 | The rule highlights cells that end with some text.
ContainsBlanks | 12 | The rule highlights empty cells.
NotContainsBlanks | 13 | The rule highlights non empty cells.
ContainsErrors | 14 | The rule highlights cells that contain errors.
NotContainsErrors | 15 | The rule highlights cells that don't contain errors.
TimePeriod | 16 | The rule highlights dates inside a range.
AboveAverage | 17 | This rule highlights cells which are above or below average.


TConditionType Enumeration | FlexCel Studio for the .NET Framework documentation

TConditionType Enumeration

A list of conditional operators that you can apply in a Conditional format.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
NoComparison | 0 | Always evaluates to false.
Between | 1 | Value between Formula1 and Formula2.
NotBetween | 2 | Value not between Formula1 and Formula2.
Equal | 3 | Value equal to Formula1.
NotEqual | 4 | Value not equal to Formula1.
GreaterThan | 5 | Value Greater than Formula1.
LessThan | 6 | Less than Formula1.
GreaterOrEqual | 7 | Greater or Equal than Formula1.
LessOrEqual | 8 | Less or Equal than Formula1.


TContentTransferEncoding Enumeration | FlexCel Studio for the .NET Framework documentation

TContentTransferEncoding Enumeration

Defines how a part of a MIME message will be coded.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
QuotedPrintable | 0 | Use the Quoted Printable algorithm (RFC 2045 section 6.7). You will normally use this encoding for text. When using this option, you need to write the part content using TMimeWriter.WriteQuotedPrintable or a similar method.
Base64 | 1 | Use base64 algorithm (RFC 2045 section 6.7). You would normally use this encoding for binary files. When using this option, you need to write the part content using TMimeWriter.WriteBase64 or a similar method.


TDataBarAxisPosition Enumeration | FlexCel Studio for the .NET Framework documentation

TDataBarAxisPosition Enumeration

Axis position for the databar.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
Automatic | 0 | The axis position is calculated automatically.
Middle | 1 | The axis is at the middle of the cell.
None | 2 | The databar has no axis and negative values will go in the same direction as positive values.


TDataBarDirection Enumeration | FlexCel Studio for the .NET Framework documentation

TDataBarDirection Enumeration

The direction of the databar.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
Context | 0 | Direction determined by context.
LeftToRight | 1 | Direction is Left to Right.
RightToLeft | 2 | Direction is Right to Left.


TDataBindingLoadMode Enumeration | FlexCel Studio for the .NET Framework documentation

TDataBindingLoadMode Enumeration

Specifies the loading mode of an XML Map databinding.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
None | 0 |
Normal | 1 |
DelayLoad | 2 |
Asynchronous | 3 |
ObjectModel | 4 |


TDataConnectionCredentialMethod Enumeration | FlexCel Studio for the .NET Framework documentation

TDataConnectionCredentialMethod Enumeration

Credentials method used for server access.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
Integrated | 0 | Integrated authentication.
None | 1 | Use no credentials at all.
Stored | 2 | Use stored credentials.
Prompt | 3 | Prompt for credentials.


TDataConnectionFieldType Enumeration | FlexCel Studio for the .NET Framework documentation

TDataConnectionFieldType Enumeration

These are the possible data types to use when importing text into the SpreadsheetML document. Strings are converted to these data types in the worksheet.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
General | 0 | The SpreadsheetML application decides the best fit data type based on the content.
Text | 1 | Field contains text.
MonthDayYear | 2 | Field contains a date in the order: month, day, year.
DayMonthYear | 3 | Field contains a date in the order: day, month, year.
YearMonthDay | 4 | Field contains a date in the order: year, month, day.
MonthYearDay | 5 | Field contains a date in the order: month, year, day.
DayYearMonth | 6 | Field contains a date in the order: day, year, month.
YearDayMonth | 7 | Field contains a date in the order: year, day, month.
Skip | 8 | Don't import this field at all.
EastAsianYearMonthDay | 9 | Field contains an East Asian date in the order: EA era year, month, day.


TDataConnectionFileType Enumeration | FlexCel Studio for the .NET Framework documentation

TDataConnectionFileType Enumeration

The file type being used for text import.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
Mac | 0 | Macintosh.
Windows | 1 | Windows (ANSI).
Dos | 2 | DOS.
Linux | 3 | Linux.
Other | 4 | A non specified OS.


TDataConnectionHtmlFormat Enumeration | FlexCel Studio for the .NET Framework documentation

TDataConnectionHtmlFormat Enumeration

How to handle formatting from the HTML source.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
None | 0 | Bring data in as unformatted text (setting data types still occurs).
RTF | 1 | Translate HTML formatting to rich text formatting on the data brought into the worksheet.
All | 2 | Transfer all HTML formatting into the worksheet along with the data.


TDataConnectionParameterType Enumeration | FlexCel Studio for the .NET Framework documentation

TDataConnectionParameterType Enumeration

Specifies how a parameter is refreshed.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
Prompt | 0 | Prompt the user on each refresh for a parameter value.
Value | 1 | Use a constant value on each refresh for the parameter value.
Cell | 2 | Get the parameter value from a cell on each refresh.


TDataConnectionQualifier Enumeration | FlexCel Studio for the .NET Framework documentation

TDataConnectionQualifier Enumeration

Qualifier to use to denote string data types in when text is imported from an external file.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
DoubleQuote | 0 | Double quote (").
SingleQuote | 1 | Single quote (').
None | 2 | No text string qualifier used.


TDataConnectionReconnectionMethod Enumeration | FlexCel Studio for the .NET Framework documentation

TDataConnectionReconnectionMethod Enumeration

How to reconnect when a connection fails.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
Unknown | 0 | Invalid value. This value shouldn't happen on a file.
AsRequired | 1 | On refresh use the existing connection information. If the existing information cannot be used to establish a connection, get updated connection information, if available from the external connection file.
Always | 2 | On every refresh get updated connection information from the external connection file, if available, and use that instead of the existing connection information. In this case the data refresh will fail if the external connection file is unavailable.
Never | 3 | Never get updated connection information from the external connection file even if it is available and even if the existing connection information cannot be used.


TDataConnectionType Enumeration | FlexCel Studio for the .NET Framework documentation

TDataConnectionType Enumeration

Represents a connection type. This enumeration lists the documented values, but there could be other values peresent in the file.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
Unknown | 0 | Invalid value. This value shouldn't happen on a file.
ODBC | 1 | ODBC-based source.
CustomDAO | 2 | Custom data connection source. This value is application-defined, but in Office it is used for DAO connections.
CustomApplicationDefined | 3 | Custom data connection source. This value is application-defined, but in Office it is used for application defined connection files.
WebQuery | 4 | A Web Query.
CustomOLEDB | 5 | Custom data connection source. This value is application-defined, but in Office it is used for OLEDB connections.
Text | 6 | Text-based source.
CustomADO | 7 | Custom data connection source. This value is application-defined, but in Office it is used for ADO connections.
CustomDSP | 8 | Custom data connection source. This value is application-defined, but in Office it is used for DSP connections.


TDataLabelPosition Enumeration | FlexCel Studio for the .NET Framework documentation

TDataLabelPosition Enumeration

Defines where a label is displayed on a chart.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
Automatic | 0 | Label is placed on the default position. This is AutoPie for Pie charts, Right for Line Charts, Outside for BarCharts and Center for Stacked Bar charts.
Outside | 1 | Label is outside the data. Applies to Bar, pie charts.
Inside | 2 | Label is inside the data. Applies to Bar, pie charts.
Center | 3 | Label is centered on the data. Applies to Bar, line, pie charts.
Axis | 4 | Label is placed on the Axis. Applies to Bar charts.
Above | 5 | Label is placed Above the data. Applies to Line charts.
Below | 6 | Label is placed Below the data. Applies to Line charts.
Left | 7 | Label is placed Left of the data. Applies to Line charts.
Right | 8 | Label is placed Right of the data. Applies to Line charts.
AutoPie | 9 | Label is placed automatically on the chart. This applies to Pie charts, and it is equivalent to TDataLabelPosition.Automatic.
Any | 10 | Label has been manually moved and it is placed at an arbitrary place.


TDataValidationConditionType Enumeration | FlexCel Studio for the .NET Framework documentation

TDataValidationConditionType Enumeration

Defines the condition used in the data validation box.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
Between | 0 | Value must be between TDataValidationInfo.FirstFormula and TDataValidationInfo.SecondFormula.
NotBetween | 1 | Value must be not between TDataValidationInfo.FirstFormula and TDataValidationInfo.SecondFormula.
EqualTo | 2 | Value must be equal to TDataValidationInfo.FirstFormula.
NotEqualTo | 3 | Value must be different from TDataValidationInfo.FirstFormula.
GreaterThan | 4 | Value must be greater than TDataValidationInfo.FirstFormula.
LessThan | 5 | Value must be less than TDataValidationInfo.FirstFormula.
GreaterThanOrEqualTo | 6 | Value must be greater than or equal to TDataValidationInfo.FirstFormula.
LessThanOrEqualTo | 7 | Value must be less than or equal to TDataValidationInfo.FirstFormula.


TDataValidationDataType Enumeration | FlexCel Studio for the .NET Framework documentation

TDataValidationDataType Enumeration

Possible types of data validation.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
AnyValue | 0 | All values are allowed.
WholeNumber | 1 | The value must be an integer.
Decimal | 2 | The value must be a decimal.
List | 3 | The value must be in the list.
Date | 4 | The value must be a Date.
Time | 5 | The value must be a Time.
TextLenght | 6 | The value will be validated depending on the text length.
Custom | 7 | The value will be validated depending on the results of a formula.


TDataValidationIcon Enumeration | FlexCel Studio for the .NET Framework documentation

TDataValidationIcon Enumeration

Icon to be displayed in the error box of a data validation action. Note that this not only affects the icon used, but the possible values. An information icon will allow you to enter an invalid value in a cell, a stop icon will not.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
Stop | 0 | Stop icon. ( a red circle with a cross). When selected, invalid values cannot be entered into the cell.
Warning | 1 | Warning icon. ( a yellow triangle with an exclamation sign). When selected and there is an invalid entry, you get an error dialog allowing to cancel the operation, enter the invalid value anyway or re edit the cell.
Information | 2 | Information icon. (a text ballon with an "i" inside). When selected and there is an invalid entry, a waning will be shown but the invalid data can be entered anyway.


TDataValidationImeMode Enumeration | FlexCel Studio for the .NET Framework documentation

TDataValidationImeMode Enumeration

The IME (input method editor) mode enforced by a data validation.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
NoControl | 0 | IME Mode Not Controlled. Data validation does not control the IME control's mode.
Off | 1 | IME Off. Forces the IME control to be off when first selecting the cell (goes to direct cell input mode).
On | 2 | IME On. Forces the IME control to be on when first selecting the cell.
Disabled | 3 | IME mode is disabled. Forces the IME control to be disabled when this cell is selected.
Hiragana | 4 | Hiragana IME Mode. Forces the IME control to be on and in Hiragana input mode when first selecting the cell. Applies when the application's language is Japanese and a Japanese IME control is selected
FullKatakana | 5 | Full Katakana IME Mode. Forces the IME control to be on and in full-width Katakana input mode when first selecting the cell. Applies when the application's language is Japanese and a Japanese IME control is selected.
HalfKatakana | 6 | Half-Width Katakana. Forces the IME control to be on and in half-width Katakana input mode when first selecting the cell. Applies when the application's language is Japanese and a Japanese IME control is selected.
FullAlpha | 7 | Full-Width Alpha-Numeric IME Mode. Forces the IME control to be on and in full-width alpha-numeric input mode when the cell is first selected.
HalfAlpha | 8 | Half Alpha IME. Forces the IME control to be on and in half-width alpha-numeric input mode when the cell is first selected.
FullHangul | 9 | Full Width Hangul. Forces the IME control to be on and in full-width Hangul input mode when first selecting the cell. Applies when the application's language is Korean and a Korean IME control is selected.
HalfHangul | 10 | Half-Width Hangul IME Mode. Forces the IME control to be on and in half-width Hangul input mode when first selecting the cell. Applies when the application's language is Korean and a Korean IME control is selected.


TDateUnits Enumeration | FlexCel Studio for the .NET Framework documentation

TDateUnits Enumeration

Date units for a date axis.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
Days | 0 | Units are days.
Months | 1 | Units are months.
Years | 2 | Units are years.


TDocumentCustomPropertyType Enumeration | FlexCel Studio for the .NET Framework documentation

TDocumentCustomPropertyType Enumeration

Defines which kind of property is a custom property.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
String | 0 | property is a string.
Double | 1 | Property is a double.
Long | 2 | Property is a long.
Boolean | 3 | Property is a boolean.
DateTime | 4 | Property is a date time.
Blob | 5 | Property is a byte array. The byte array is encoded in base64.
Unknown | 6 | The property is something else. Note that Excel won't recognize properties with other data types than the ones in this enumeration, but you can write any variant as a custom property. When the type is unknown, the real type is stored in the PropTypeStr field.


TDrawingAlignment Enumeration | FlexCel Studio for the .NET Framework documentation

TDrawingAlignment Enumeration

Specifies the alignment types for text in a drawing.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
Left | 0 | Align text to the left margin.
Center | 1 | Align text in the center.
Right | 2 | Align text to the right margin.
Justified | 3 | Align text so that it is justified across the whole line. It is smart in the sense that it does not justify sentences which are short.
JustLow | 4 | Aligns the text with an adjusted kashida length for Arabic text.
Distributed | 5 | Distributes the text words across an entire text line.
ThaiDist | 6 | Distributes Thai text specially, because each character is treated as a word.


TDrawingColorType Enumeration | FlexCel Studio for the .NET Framework documentation

TDrawingColorType Enumeration

Defines the kind of colors that might be stored inside a color definition in a drawing or a theme.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
HSL | 0 | Hue, Saturation, Luminance.
Preset | 1 | Color is from the list in TPresetColor.
RGB | 2 | RGB expressed as components. Components are in the range 0-255
scRGB | 3 | scRGB color mode. Components are in the range 0-1.
System | 4 | System color. This is defined by windows, for example the color of the active caption.
Theme | 5 | Links to a theme color. You can't use this value when defining the theme colors themselves.


TDrawingFontAlign Enumeration | FlexCel Studio for the .NET Framework documentation

TDrawingFontAlign Enumeration

Different types of font alignment.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
Automatic | 0 | When the text flow is horizontal or simple vertical same as fontBaseline but for other vertical modes same as fontCenter.
Top | 1 | The letters are anchored to the top baseline of a single line.
Center | 2 | The letters are anchored between the two baselines of a single line.
BaseLine | 3 | The letters are anchored to the bottom baseline of a single line.
Bottom | 4 | The letters are anchored to the very bottom of a single line. This is different than the bottom baseline because of letters such as "g," "q," "y," etc.


TDrawingPattern Enumeration | FlexCel Studio for the .NET Framework documentation

TDrawingPattern Enumeration

Different types of patterns for filling an Excel 2007 object. This is different from the patterns to fill a cell.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
pct5 | 0 | pct5
pct10 | 1 | pct10
pct20 | 2 | pct20
pct25 | 3 | pct25
pct30 | 4 | pct30
pct40 | 5 | pct40
pct50 | 6 | pct50
pct60 | 7 | pct60
pct70 | 8 | pct70
pct75 | 9 | pct75
pct80 | 10 | pct80
pct90 | 11 | pct90
horz | 12 | horz
vert | 13 | vert
ltHorz | 14 | ltHorz
ltVert | 15 | ltVert
dkHorz | 16 | dkHorz
dkVert | 17 | dkVert
narHorz | 18 | narHorz
narVert | 19 | narVert
dashHorz | 20 | dashHorz
dashVert | 21 | dashVert
cross | 22 | cross
dnDiag | 23 | dnDiag
upDiag | 24 | upDiag
ltDnDiag | 25 | ltDnDiag
ltUpDiag | 26 | ltUpDiag
dkDnDiag | 27 | dkDnDiag
dkUpDiag | 28 | dkUpDiag
wdDnDiag | 29 | wdDnDiag
wdUpDiag | 30 | wdUpDiag
dashDnDiag | 31 | dashDnDiag
dashUpDiag | 32 | dashUpDiag
diagCross | 33 | diagCross
smCheck | 34 | smCheck
lgCheck | 35 | lgCheck
smGrid | 36 | smGrid
lgGrid | 37 | lgGrid
dotGrid | 38 | dotGrid
smConfetti | 39 | smConfetti
lgConfetti | 40 | lgConfetti
horzBrick | 41 | horzBrick
diagBrick | 42 | diagBrick
solidDmnd | 43 | solidDmnd
openDmnd | 44 | openDmnd
dotDmnd | 45 | dotDmnd
plaid | 46 | plaid
sphere | 47 | sphere
weave | 48 | weave
divot | 49 | divot
shingle | 50 | shingle
wave | 51 | wave
trellis | 52 | trellis
zigZag | 53 | zigZag


TDrawingRectAlign Enumeration | FlexCel Studio for the .NET Framework documentation

TDrawingRectAlign Enumeration

How to position two rectangles relative to each other.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
TopLeft | 0 | Align at the top left.
Top | 1 | Align at the top.
TopRight | 2 | Align at the top right.
Left | 3 | Align at the left.
Center | 4 | Align at the center.
Right | 5 | Align at the right.
BottomLeft | 6 | Align at the bottom left.
Bottom | 7 | Align at the bottom.
BottomRight | 8 | Align at the bottom right.


TDrawingTextCapitalization Enumeration | FlexCel Studio for the .NET Framework documentation

TDrawingTextCapitalization Enumeration

how text is capitalized when rendered.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
None | 0 | No capitalization.
Small | 1 | Apply small caps to the text. All letters are converted to lower case.
All | 2 | Apply all caps on the text. All lower case letters are converted to upper case even though they are stored differently in the backing store.


TDrawingTextStrike Enumeration | FlexCel Studio for the .NET Framework documentation

TDrawingTextStrike Enumeration

How the text is stroke out.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
None | 0 | No strike is applied to the text.
Single | 1 | A single strike is applied to the text.
Double | 2 | A double strike is applied to the text.


TDrawingUnderlineStyle Enumeration | FlexCel Studio for the .NET Framework documentation

TDrawingUnderlineStyle Enumeration

Possible underline types in a drawing.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
None | 0 | No underline.
Words | 1 | Underline just the words and not the spaces between them.
Single | 2 | Underline the text with a single line of normal thickness.
Double | 3 | Underline the text with two lines of normal thickness.
Heavy | 4 | Underline the text with a single, thick line.
Dotted | 5 | Underline the text with a single, dotted line of normal thickness.
DottedHeavy | 6 | Underline the text with a single, thick dotted line.
Dash | 7 | Underline the text with a single, dashed line of normal thickness.
DashHeavy | 8 | Underline the text with a single, thick dashed line.
DashLong | 9 | Underline the text with a single line of normal thickness consisting of long dashes.
DashLongHeavy | 10 | Underline the text with a single thick line consisting of long dashes.
DotDash | 11 | Underline the text with a single line consisting of alternating dots and dashes of normal thcikness.
DotDashHeavy | 12 | Underline the text with a single thick line consisting of alternating dots and dashes.
DotDotDash | 13 | Underline the text with a single line of normal thickness consisting of repeating two dots and dashes.
DotDotDashHeavy | 14 | Underline the text with a single thick line consisting of repeating two dots and dashes.
Wavy | 15 | Underline the text with a single wavy line of normal thickness.
WavyHeavy | 16 | Underline the text with a single, thick wavy line.
WavyDouble | 17 | Underline the text with two wavy lines of normal thickness.


TEncryptionAlgorithm Enumeration | FlexCel Studio for the .NET Framework documentation

TEncryptionAlgorithm Enumeration

Encryption algorithms supported in xlsx encrypted files.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
AES_128 | 0 | AES 128. This is the default in Excel 2007/2010
AES_192 | 1 | AES 192
AES_256 | 2 | AES 256


TEncryptionType Enumeration | FlexCel Studio for the .NET Framework documentation

TEncryptionType Enumeration

How the file is encrypted. This applies only to xls files. Xlsx files are encrypted using the Agile xlsx encryption.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
Xor | 0 | Excel 95 XOR encryption.
Standard | 1 | Excel 97/2000 encryption.
Strong | 2 | Excel XP/2003 encryption. Note that despite the name, this mode has multiple known vulnerabilities and it is just marginally better than TEncryptionType.Standard. Both use RC4 algorithm to encrypt, which is weak. If you need files to be really secure, you need to use xlsx (which supports AES), not xls.


TEnterStyle Enumeration | FlexCel Studio for the .NET Framework documentation

TEnterStyle Enumeration

Defines how characters will be converted when encoding a string as Html.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
Br | 0 | Enter characters in the input string will be converted to <br> tags. Multiple spaces will be converted to &nbsp; entities.
Char10 | 1 | Enter characters in the input string will be converted to &#0A; entities. Multiple spaces will be not converted.
Ignore | 2 | Enter and multiple spaces will be ignored.
Legacy2003Xml | 3 | This is a "pseudo xml" that is used to write the object texts. No entities more than the ones allowed in xml are used, breaks are <br /> and multiple spaces are the actual char 160, instead of &nbsp; which isn't allowed in xml.


TEscherConnectorType Enumeration | FlexCel Studio for the .NET Framework documentation

TEscherConnectorType Enumeration

The type of connector.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
Straight | 0 | A straight connector.
Bent | 1 | An elbow-shaped connector.
Curved | 2 | A curved connector.
None | 3 | No connector.


TExcelFileErrorActions Enumeration | FlexCel Studio for the .NET Framework documentation

TExcelFileErrorActions Enumeration

Enumerates what to do on different FlexCel error situations.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
None | 0 | FlexCel will try to recover from most errors.
ErrorOnTooManyPageBreaks | 1 | When true and the number of manual pagebreaks is bigger than the maximum Excel allows, an Exception will be raised. When false, the page break will be silently omitted. Note that This exception is raised when saving the file as xls, when you are exporting your report to PDF or images, all page breaks will be used.
ErrorOnFormulaConstantTooLong | 2 | When true, FlexCel will complain when you try to set a formula that has a string constant bigger than 255 characters. For example, the formula: '="very long string that has more than 255 characters...." & "other string" ' would raise an Exception, since Excel won't allow it. Note that you can still use ' =a1 & "other string" ' where the cell A1 has the value: "very long string that has more than 255 characters....". this restriction applies only to inline strings. Note that when this property is false you will still get the error, but only when saving to xls, xlsx or other file formats that don't support longer strings. (this error is too important to be ignored)
ErrorOnRowHeightTooBig | 4 | When true and the row height is bigger than the maximum allowed by Excel, you will get an Exception.
ErrorOnXlsxInvalidName | 8 | If this is true and the xlsx file contains an invalid name, an exception will be thrown.
ErrorOnXlsxMissingPart | 16 | If this is true and the xlsx file contains a missing part (like an image), an exception will be thrown.
ErrorOnXlsxInvalidFormula | 32 | If this is true and the file contains an invalid formula, an exception will be thrown.
ErrorOnXlsxInvalidHyperlink | 64 | If this is true and the file contains invalid hyperlinks, an exception will be thrown.
All | 127 | Sets all error actions together.


TExcelFileFormat Enumeration | FlexCel Studio for the .NET Framework documentation

TExcelFileFormat Enumeration

Different Excel versions create different empty xls/xlsx files. For example an empty xls file created by Excel 2003 will have "Arial" as its default font, and one created by Excel 2007 will have "Calibri". By default, when you call ExcelFile.NewFile FlexCel will create a file that is similar to what Excel 2003 would create. This is fine, but if you want to start for example from an empty Excel 2007 file, you can do so by calling NewFile() with this enumeration.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
v2003 | 0 | Empty files will be created as if they were created by Excel 2003. The default font is Arial.
v2007 | 1 | Empty files will be created as if they were created by Excel 2007. The default font is Calibri.
v2010 | 2 | Empty files will be created as if they were created by Excel 2010. The default font is Calibri.
v2013 | 3 | Empty files will be created as if they were created by Excel 2013. The default font is Calibri.
v2016 | 4 | Empty files will be created as if they were created by Excel 2016. The default font is Calibri.
v2019 | 5 | Empty files will be created as if they were created by Excel 2019. The default font is Calibri.
v2021 | 6 | Empty files will be created as if they were created by Excel 2021. The default font is Calibri.
v2023 | 7 | Empty files will be created as if they were created by Excel 365 after July 2023. The default font is Aptos.


TExcelVersion Enumeration | FlexCel Studio for the .NET Framework documentation

TExcelVersion Enumeration

Defines which Excel version FlexCel is targeting. Note that while on v2007 you still can make xls 97 spreadsheets.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
v2007 | 0 | Excel 2007 and up. This version has a grid of 1048576 rows x 16384 columns.
v97_2003 | 1 | Versions from Excel 97 to Excel 2003. Those versions have a grid limited by 65536 rows x 255 columns.


TExcludedRecords Enumeration | FlexCel Studio for the .NET Framework documentation

TExcludedRecords Enumeration

A list of records that might not be saved into a file when using ExcelFile.SaveForHashing(Stream)

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
None | 0 | This includes all records, including the write access. It is not recommended to use this setting, because write access will change every time you save a file with a different user.
WriteAccess | 1 | This is a stamp that is saved to the file each time it is saved, identifying the current user. You normally won't want to save this record, so you should specify this value.
CellSelection | 2 | If you specify CellSelection, the selected cells will be ignored.
SheetSelected | 4 | If you specify SheetSelected, the active sheet will be ignored.
Version | 8 | If you specify Version, the version of Excel used to save the file will be ignored. (Note that version might change in an Excel Service Pack).
All | 15 | This excludes all records in this enumeration. This is the most recommended option.


TFileFormats Enumeration | FlexCel Studio for the .NET Framework documentation

TFileFormats Enumeration

Supported file formats to read and write files.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
Automatic | 0 | Automatically detect the type of the file when opening files. If used when saving, FlexCel will choose whether to use xls or xlsx depending on the file extension (when saving to a file) or the value of ExcelFile.DefaultFileFormat when saving to a stream or when the format can't be determined from the extension.
Xls | 1 | Excel 97-2000-XP-2003
Text | 2 | Delimiter separated values. Depending on the delimiter, this can be csv, tab delimited text, etc.
Pxl | 3 | Pocket Excel 1.0 or 2.0
Xlsx | 4 | Excel 2007 standard file format. Note that this is *not* a macro enabled file format. If you want to save a file with macros, you need to use Xlsm instead.
Xlsm | 5 | Excel 2007 macro enabled file format.


TFillStyleType Enumeration | FlexCel Studio for the .NET Framework documentation

TFillStyleType Enumeration

Stores the different kind of fill styles for an autoshape or drawing.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
NoFill | 0 | No fill associated with the shape.
Solid | 1 | Shape is filled with a solid color.
Gradient | 2 | Shape is filled with a gradient.
Blip | 3 | Shape is filled with an image.
Pattern | 4 | Shape is filled with a pattern.
Group | 5 | The shape is part of a group, and should inherit its parent fill style.


TFillType Enumeration | FlexCel Studio for the .NET Framework documentation

TFillType Enumeration

Type of fill for an autoshape. (In xls files)

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
Solid | 0 | Fill with a solid color
Pattern | 1 | Fill with a pattern (bitmap)
Texture | 2 | A texture (pattern with its own color map)
Picture | 3 | Center a picture in the shape
Shade | 4 | Shade from start to end points
ShadeCenter | 5 | Shade from bounding rectangle to end point
ShadeShape | 6 | Shade from shape outline to end point
ShadeScale | 7 | Similar to msofillShade, but the fillAngle is additionally scaled by the aspect ratio of the shape. If shape is square, it is the same as msofillShade.
ShadeTitle | 8 | special type - shade to title --- for PP
Background | 9 | the background fill color/pattern


TFlexCelImageHorizAlign Enumeration | FlexCel Studio for the .NET Framework documentation

TFlexCelImageHorizAlign Enumeration

Sets how an image is aligned inside a box.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
Left | 0 | Aligned at the left of the box.
Center | 1 | Centered inside the box.
Right | 2 | Aligned at the right of the box.


TFlexCelImageVertAlign Enumeration | FlexCel Studio for the .NET Framework documentation

TFlexCelImageVertAlign Enumeration

How an image is aligned inside a box.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
Top | 0 | Aligned to the top of the box.
Center | 1 | Centered in the box.
Bottom | 2 | Aligned at the bottom of the box.


TFlipMode Enumeration | FlexCel Studio for the .NET Framework documentation

TFlipMode Enumeration

How an image will be flipped when filling a pattern.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
None | 0 | Image will not be flipped.
X | 1 | Tiles are flipped horizontally.
Y | 2 | Tiles are flipped vertically.
XY | 3 | Tiles are flipped horizontally and vertically.


TFlxAnchorType Enumeration | FlexCel Studio for the .NET Framework documentation

TFlxAnchorType Enumeration

How an image behaves when inserting/copying rows/columns

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
MoveAndResize | 0 | Move and resize the image with the sheet.
MoveAndDontResize | 2 | Move the image when inserting/copying, but keep its size.
DontMoveAndDontResize | 3 | Keep the image fixed on the sheet.


TFlxBorderStyle Enumeration | FlexCel Studio for the .NET Framework documentation

TFlxBorderStyle Enumeration

Cell border style.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
None | 0 | None
Thin | 1 | Thin
Medium | 2 | Medium
Dashed | 3 | Dashed
Dotted | 4 | Dotted
Thick | 5 | Thick
Double | 6 | Double
Hair | 7 | Hair
Medium_dashed | 8 | Medium_dashed
Dash_dot | 9 | Dash_dot
Medium_dash_dot | 10 | Medium_dash_dot
Dash_dot_dot | 11 | Dash_dot_dot
Medium_dash_dot_dot | 12 | Medium_dash_dot_dot
Slanted_dash_dot | 13 | Slanted_dash_dot


TFlxDiagonalBorder Enumeration | FlexCel Studio for the .NET Framework documentation

TFlxDiagonalBorder Enumeration

Diagonal border style.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
None | 0 | No diagonal line.
DiagDown | 1 | A line going from left-top to right-bottom.
DiagUp | 2 | A line going from left-bottom to right-top.
Both | 3 | A diagonal cross.


TFlxFontStyles Enumeration | FlexCel Studio for the .NET Framework documentation

TFlxFontStyles Enumeration

Font style. You can "or" on "and" it to get the actual styles. For example, to set style to bold+italic, you should use TFlxFontStyles.Bold | TFlxFontStyles.Italic. to check if style includes italic, use ((Style & TFlxFontStyles.Italic)!=0)

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
None | 0 | Normal font.
Bold | 1 | Bold font.
Italic | 2 | Italic font.
StrikeOut | 4 | Stroke out font.
Superscript | 8 | Superscript font.
Subscript | 16 | Subscript font.
Outline | 32 | Outlined font. Excel currently ignores this setting.
Shadow | 64 | Font has a shadow. Excel currently ignores this setting.
Condense | 128 | Condensed font, for backwards compatibility. Excel ignores this setting.
Extend | 256 | Extended font, for backwards compatibility. Excel ignores this setting.


TFlxFormulaErrorValue Enumeration | FlexCel Studio for the .NET Framework documentation

TFlxFormulaErrorValue Enumeration

Error codes for cells on excel

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
ErrNull | 0 | Null Value
ErrDiv0 | 7 | Division by 0
ErrValue | 15 | Invalid Value
ErrRef | 23 | Invalid or deleted cell reference
ErrName | 29 | Invalid name
ErrNum | 36 | Invalid number
ErrNA | 42 | Not available
ErrGettingData | 43 | Intended to indicate when a cell reference cannot be evaluated because the value for the cell has not been retrieved or calculated.
ErrCalc | 48 | Missing parameters for a lambda function.
ErrSpill | 49 | An array formula can't spill to adjacent cells because those cells have data.
ErrField | 50 | A field in a structured datatype doesn't exist.


TFlxInsertMode Enumeration | FlexCel Studio for the .NET Framework documentation

TFlxInsertMode Enumeration

Inserting mode. Important: This enumeration is also used when deleting ranges. When deleting, Down means Up and Right means Left.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
NoneDown | 0 | Cells will not be inserted but just overwrite existing ones. If count is >0, additional ranges will be copied down. When deleting, this mode will clear the cells and not move anything.
NoneRight | 1 | Cells will not be inserted but just overwrite existing ones. If count is >0, additional ranges will be copied right. When deleting, this mode will clear the cells and not move anything.
ShiftRowDown | 2 | Inserts whole rows. Moves all destination rows down. When deleting, moves cells up.
ShiftColRight | 3 | Inserts whole columns. Moves all destination columns to the right. When deleting, moves columns to the right of the deleted columns to the left.
ShiftRangeDown | 4 | Moves all destination cells down. This WON'T move the whole row, only cells on the range. When deleting, moves cells up.
ShiftRangeRight | 5 | Moves all destination cells to the right. This WON'T move the whole column, only cells on the range. When deleting, moves cells to the left.


TFlxPatternStyle Enumeration | FlexCel Studio for the .NET Framework documentation

TFlxPatternStyle Enumeration

Pattern style.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
Automatic | 0 | Automatic
None | 1 | None
Solid | 2 | Solid
Gray50 | 3 | Gray50
Gray75 | 4 | Gray75
Gray25 | 5 | Gray25
Horizontal | 6 | Horizontal
Vertical | 7 | Vertical
Down | 8 | Down
Up | 9 | Up
Checker | 10 | Diagonal hatch.
SemiGray75 | 11 | bold diagonal.
LightHorizontal | 12 | thin horz lines
LightVertical | 13 | thin vert lines
LightDown | 14 | thin \ lines
LightUp | 15 | thin / lines
Grid | 16 | thin horz hatch
CrissCross | 17 | thin diag
Gray16 | 18 | 12.5 % gray
Gray8 | 19 | 6.25 % gray
Gradient | 40 | The fill style will be a TExcelGradient.


TFlxReadingOrder Enumeration | FlexCel Studio for the .NET Framework documentation

TFlxReadingOrder Enumeration

Reading order for a cell.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
Context | 0 | Reading order defined by the context.
LeftToRight | 1 | Left to right.
RightToLeft | 2 | Right to left.


TFlxUnderline Enumeration | FlexCel Studio for the .NET Framework documentation

TFlxUnderline Enumeration

Underline type.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
None | 0 | No underline.
Single | 1 | Simple underline.
Double | 2 | Double underline.
SingleAccounting | 3 | Underlines at the bottom of the cell.
DoubleAccounting | 4 | Double underline at the bottom of the cell.


TFmReturnType Enumeration | FlexCel Studio for the .NET Framework documentation

TFmReturnType Enumeration

Formula return types... A value, an array or a reference.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
Value | 0 | Formula returns a value.
Ref | 1 | Formula returns a reference.
Array | 2 | Formula returns an array.


TFontCharSet Enumeration | FlexCel Studio for the .NET Framework documentation

TFontCharSet Enumeration

Character set for a font as defined in the DrawingML standard.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
Ansi | 0 | Specifies the ANSI character set. (IANA name iso-8859-1)
Default | 1 | Specifies the default character set.
Symbol | 2 | Specifies the Symbol character set. This value specifies that the characters in the Unicode private use area (U+FF00 to U+FFFF) of the font should be used to display characters in the range U+0000 to U+00FF.
Macintosh | 77 | Specifies a Macintosh (Standard Roman) character set. (IANA name macintosh)
Jis | 128 | Specifies the JIS character set. (IANA name shift_jis)
Hangul | 129 | Specifies the Hangul character set. (IANA name ks_c_5601-1987)
Johab | 130 | Specifies a Johab character set. (IANA name KS C-5601-1992)
GB2312 | 134 | Specifies the GB-2312 character set. (IANA name GBK)
Big5 | 136 | Specifies the Chinese Big Five character set. (IANA name Big5) ECMA-376 Part 1
Greek | 161 | Specifies a Greek character set. (IANA name windows-1253)
Turkish | 162 | Specifies a Turkish character set. (IANA name iso-8859-9)
Vietnamese | 163 | Specifies a Vietnamese character set. (IANA name windows-1258)
Hebrew | 177 | Specifies a Hebrew character set. (IANA name windows-1255)
Arabic | 178 | Specifies an Arabic character set. (IANA name windows-1256)
Baltic | 186 | Specifies a Baltic character set. (IANA name windows-1257)
Russian | 204 | Specifies a Russian character set. (IANA name windows-1251)
Thai | 222 | Specifies a Thai character set. (IANA name windows-874)
EasternEuropean | 238 | Specifies an Eastern European character set. (IANA name windows-1250)
OEM | 255 | Specifies an OEM character set not defined by ECMA-376.


TFontScheme Enumeration | FlexCel Studio for the .NET Framework documentation

TFontScheme Enumeration

Specifies the scheme to which a font belongs in the theme. This attribute is only valid in Excel 2007 or newer.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
None | 0 | Font is not a theme font and is not linked to the theme. When you change the theme of the spreadsheet, "None" fonts will remain unchanged.
Minor | 1 | The font is a minor font for the scheme. This is the font that shows (Body) at the right of the font selector box in Excel. Whenever you change the theme of the spreadsheet, all minor fonts in all cells will change to reflect the new minor font in the theme.
Major | 2 | The font is a major font for the scheme. This is the font that shows (Headings) at the right of the font selector box in Excel. Whenever you change the theme of the spreadsheet, all major fonts in all cells will change to reflect the new major font in the theme.


TFormattingType Enumeration | FlexCel Studio for the .NET Framework documentation

TFormattingType Enumeration

The elements here are different types of fill/effects/etc that can be applied to an object. Currently Excel only defines 3 types, but more can be added in future specifications. Newer types can be accessed by casting an int to TFormattingType. (for example "(TFormattingType)5" would refer to a now non existing formatting type)

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
Subtle | 0 | Subtle formatting type.
Moderate | 1 | Moderate formatting type.
Intense | 2 | Intense formatting type.


TFormulaToken Enumeration | FlexCel Studio for the .NET Framework documentation

TFormulaToken Enumeration

Known token on a formula. They are not supposed to be localized, but they can be by editing formulamsg.resx

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
fmErrStart | 0 | '#';
fmTrue | 1 | 'TRUE';
fmFalse | 2 | 'FALSE';
fmStartFormula | 3 | '=' // as in =a1*2 or {=1+2}
fmFormulaDecimal | 4 | '.' as in '1.2'
fmFormulaThousands | 5 | ',' as in '1,300'
fmFunctionSep | 6 | ',' Argument separator on a function. For example, if fmFunctionSep=';' we should write "Max(a1;a2)" If you want to localize this, you could use fmFunctionSep=ListSeparator
fmUnion | 7 | ',' as in "=a1, b2"
fmIntersect | 8 | ' ' as in a1 a2
fmOpenArray | 9 | '{';
fmCloseArray | 10 | '}';
fmOpenParen | 11 | '(';
fmCloseParen | 12 | ')';
fmArrayRowSep | 13 | '/' Separates 2 rows on an array. It is '\' in spanish
fmArrayColSep | 14 | ',' Separates 2 columns on an array. Ex: {1,2}. It is ';' in spanish If you want to localize this, you could use fmArrayColSep=ListSeparator
fmAbsoluteRef | 15 | '$' as in $A$3
fmRangeSep | 16 | ':' as in A1:A3
fmSingleQuote | 17 | ' (as in 'Sheet 1'!A1
fmExternalRef | 18 | '!' as in Sheet1!a1
fmWorkbookOpen | 19 | '[' as in c:\[book1.xls]Sheet1!a1
fmWorkbookClose | 20 | ']';
fmTableText | 21 | 'TABLE';
fmPlus | 22 | '+';
fmMinus | 23 | '-';
fmMul | 24 | '*';
fmDiv | 25 | '/';
fmPower | 26 | '^';
fmPercent | 27 | '%';
fmStr | 28 | '"';
fmAnd | 29 | '&';
fmLT | 30 | '<';
fmLE | 31 | '<=';
fmEQ | 32 | '=';
fmGE | 33 | '>=';
fmGT | 34 | '>';
fmNE | 35 | '<>';
fmR1C1_R | 36 | 'R' in R1C1 notation as in R1C2
fmR1C1_C | 37 | 'C' in R1C1 notation as in R1C2
fmR1C1RelativeRefStart | 38 | '[' in R1C1 notation as in R[1]C[-2]
fmR1C1RelativeRefEnd | 39 | ']' in R1C1 notation as in R[1]C[-2]


TFullRecalcOnLoadMode Enumeration | FlexCel Studio for the .NET Framework documentation

TFullRecalcOnLoadMode Enumeration

Defines how FlexCel will save the files so they will be recalculated or not when you open them in Excel.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
Automatic | 0 | Will set the file to do a full recalc on load only if the file wasn't recalculated by FlexCel.
AlwaysRecalc | 1 | Will set the file to always do a full recalculation when opened in Excel.
NeverRecalc | 2 | Will set the file to not do a full recalculation when opening the file.


TFunctionGroup Enumeration | FlexCel Studio for the .NET Framework documentation

TFunctionGroup Enumeration

Specifies the function group index if the defined name refers to a function. The function group defines the general category for the function. This attribute is used when there is an add-in or other code project associated with the file.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
None | 0 | Not defined. Don't use.
Financial | 1 | Financial
DateAndTime | 2 | Date and Time
MathAndTrig | 3 | Math and Trig.
Statistical | 4 | Statistical.
LookupAndReference | 5 | Lookup and Reference.
Database | 6 | Database.
Text | 7 | Text.
Logical | 8 | Logical.
Information | 9 | Information.
Commands | 10 | Commands.
Customizing | 11 | Customizing.
MacroControl | 12 | Macro Control.
DDE_External | 13 | DDE / External.
UserDefined | 14 | User Defined.
Engineering | 15 | Engineering.
Cube | 16 | Cube.


TGradientType Enumeration | FlexCel Studio for the .NET Framework documentation

TGradientType Enumeration

The type of gradient stored inside a TExcelGradient object.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
Linear | 0 | Linear gradient.
Rectangular | 1 | Rectangular gradient.


THeaderAndFooterKind Enumeration | FlexCel Studio for the .NET Framework documentation

THeaderAndFooterKind Enumeration

Different kinds of headers and footers depending on which pages they apply.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
Default | 0 | This applies to all headers and footers that don't have a dedicated definition.
FirstPage | 1 | This applies to the header and footer of the first pages, when it is defined different than the others.
EvenPages | 2 | This applies to the headers and footes of even pages, when they are different than odd pages.


THeaderAndFooterPos Enumeration | FlexCel Studio for the .NET Framework documentation

THeaderAndFooterPos Enumeration

Different sections on a header or footer.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
HeaderLeft | 0 | Left section on the header.
HeaderCenter | 1 | Center section on the header.
HeaderRight | 2 | Right section on the header.
FooterLeft | 3 | Left section on the footer.
FooterCenter | 4 | Center section on the footer.
FooterRight | 5 | Right section on the footer.


THFlxAlignment Enumeration | FlexCel Studio for the .NET Framework documentation

THFlxAlignment Enumeration

Horizontal Alignment on a cell.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
general | 0 | General Alignment. (Text to the left, numbers to the right and Errors and booleans centered)
left | 1 | Aligned to the left.
center | 2 | Horizontally centered on the cell.
right | 3 | Aligned to the right.
fill | 4 | Repeat the text to fill the cell width.
justify | 5 | Justify with spaces the text so it fills the cell width.
center_across_selection | 6 | Centered on a group of cells.
distributed | 7 | Justified.


THidePrintObjects Enumeration | FlexCel Studio for the .NET Framework documentation

THidePrintObjects Enumeration

Enumeration defining which objects should not be printed or exported to pdf. You can 'or' more than one option together. For example, to not print images and not comments, you should specify: THidePrintObjects.Images | THidePrintOption.Comments

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
None | 0 | Print and Export everything.
Images | 1 | Do not print or export images to pdf.
Comments | 2 | Do not export Comments to pdf. Note that if the Excel file is configured to print "Comments as displayed" then those comments will be exported as images even if this option is false. Use THidePrintObjects.Images to control those comments, as they are considered images. Or just set ExcelFile.PrintComments to be something different than "Comments as displayed".
Hyperlynks | 4 | Do not export Hyperlinks to pdf.
Headers | 8 | Do not print or export to pdf the Headers.
Footers | 16 | Do not print or export to pdf the Footers.
HeadersAndFooters | 24 | Do not export headers nor footers. This is the same as specifying TPrintOptions.Headers and TPrintOptions.Footers.
PageBreaks | 32 | Do not export page breaks. This property only applies to html exports.


THtmlFileFormat Enumeration | FlexCel Studio for the .NET Framework documentation

THtmlFileFormat Enumeration

How the html page will be saved.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
Html | 0 | File will be saved as an html file with external images.
MHtml | 1 | File will be saved in MHTML (Mime HTML) file format with all the data inside a single file. This format is the one used to encode emails.


THtmlStyle Enumeration | FlexCel Studio for the .NET Framework documentation

THtmlStyle Enumeration

Defines the way html is generated.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
Simple | 0 | Only HTML 3.2 tags (like <b>) will be used.
Css | 1 | Cascading style sheets will be used.


THtmlVersion Enumeration | FlexCel Studio for the .NET Framework documentation

THtmlVersion Enumeration

Defines the HTML version that will be used when exporting.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
Html_401 | 0 | The HTML generated will be 4.01 strict. See http://www.w3.org/TR/html401/
XHTML_10 | 1 | HTML generated will be XHTML 1.0. See http://www.w3.org/TR/xhtml1/
Html_32 | 2 | Html generated will be compatible with 3.2, and not have any CSS applied. Useful for when you want simple html markup and don't worry too much about exact looking. Many properties in FlexCelHtmlExport (like ie6 transparent png support) will be ignored in this mode.
Html_5 | 3 | The html generated will use specific stuff from HTML5, like the ability to rotate text or embed images.


THyperLinkType Enumeration | FlexCel Studio for the .NET Framework documentation

THyperLinkType Enumeration

Possible types of cell hyperlinks.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
URL | 0 | Web, file or mail URL. (like http://, file://, mailto://, ftp://)
LocalFile | 1 | A file on the local disk. Not an url or unc file.
UNC | 2 | Universal Naming convention. For example: \\server\path\file.ext
CurrentWorkbook | 3 | An hyperlink inside the current file.


TIgnoredErrors Enumeration | FlexCel Studio for the .NET Framework documentation

TIgnoredErrors Enumeration

Specifies what kind of errors Excel will ignore for ranges of cells. "Errors" in a spreadsheet are the green triangles that appear in the top left corner of the cell, like "Number stored as text".

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
None | 0 | Don't ignore any error.
CalculatedColumn | 1 | Ignore errors when cells contain a formula different from the calculated column.
EmptyCellReference | 2 | Ignore errors of formulas pointing to empty cell references.
EvalError | 4 | Ignore errors of formulas which result in an error like #N/A!
Formula | 8 | Ignore erors when a fomrula isn't similar to the other formulas in the region.
FormulaRange | 16 | Ignore errors when a formula doesn't reference all cells in a range.
ListDataValidation | 32 | Ignore errors when the cell value doesn't comply with the data validation rules.
NumberStoredAsText | 64 | Ignore errors of numbers stored as text.
TwoDigitTextYear | 128 | Ignore errors when formulas contain text formatted cells with years represented as 2 digits.
UnlockedFormula | 256 | Ignore errors when unlocked cells contain formulas.


TImageNaming Enumeration | FlexCel Studio for the .NET Framework documentation

TImageNaming Enumeration

Defines how images will be automatically named by FlexCel, when you do not supply a better name.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
Default | 0 | The image will be named using standard naming, in a format similar to "filename_image_n.png"
Guid | 1 | The image will be named using a GUID. This ensures that any image will be unique even if you have many users requesting the same file at the same time. (Default naming will use the same name for all the users, so images would be overwritten). As a downside, everytime an image is called a new file will be created, so you can get a lot of images just from a user refreshing a page.


TJpegOrientation Enumeration | FlexCel Studio for the .NET Framework documentation

TJpegOrientation Enumeration

Specifies the rotation of a JPEG image.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
Normal | 0 | Image is not rotated. Corresponds to JPEG orientation 1, or no JPEG orientation present.
FlipHorizontal | 1 | Image is mirrored horizontally. Corresponds to JPEG orientation 2.
Rotate180 | 2 | Image is rotated 180 degrees. Corresponds to JPEG orientation 3.
FlipVertical | 3 | Image is mirrored vertically. Corresponds to JPEG orientation 4.
FlipHorizontalAndRotate270CW | 4 | Image is rotated 270 degrees clockwise and then mirrored horizontally. Corresponds to JPEG orientation 5.
Rotate90CW | 5 | Image is rotated 90 degrees clockwise. Corresponds to JPEG orientation 6.
FlipHorizontalAndRotate90CW | 6 | Image is rotated 90 degrees clockwise and then mirrored horizontally. Corresponds to JPEG orientation 7.
Rotate270CW | 7 | Image is rotated 270 degrees clockwise. Corresponds to JPEG orientation 6.


TLabelDataValue Enumeration | FlexCel Studio for the .NET Framework documentation

TLabelDataValue Enumeration

Defines what information a DataLabel should show.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
Manual | 0 | This label has a manually entered value.
SeriesInfo | 1 | This label shows the values and/or categories of the series.


TLineCap Enumeration | FlexCel Studio for the .NET Framework documentation

TLineCap Enumeration

How the line ends.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
Round | 0 | Rounded ends. Semi-circle protrudes by half line width.
Square | 1 | Square protrudes by half line width.
Flat | 2 | Line ends at end point.


TLineDashing Enumeration | FlexCel Studio for the .NET Framework documentation

TLineDashing Enumeration

Line style (dashes, solid, etc).

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
Solid | 0 | Solid (continuous) pen.
DashSys | 1 | PS_DASH system dash style.
DotSys | 2 | PS_DOT system dash style.
DashDotSys | 3 | PS_DASHDOT system dash style.
DashDotDotSys | 4 | PS_DASHDOTDOT system dash style.
DotGEL | 5 | square dot style.
DashGEL | 6 | dash style.
LongDashGEL | 7 | long dash style.
DashDotGEL | 8 | dash short dash.
LongDashDotGEL | 9 | long dash short dash.
LongDashDotDotGEL | 10 | long dash short dash short dash.


TLineJoin Enumeration | FlexCel Studio for the .NET Framework documentation

TLineJoin Enumeration

How a line joins with the next

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
Bevel | 0 | Bevel.
Miter | 1 | Miter.
Round | 2 | Round.


TLinkOption Enumeration | FlexCel Studio for the .NET Framework documentation

TLinkOption Enumeration

Specifies to which object the label is linked to.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
None | 0 | Not used. It means the label is not linked.
ChartTitle | 1 | This is the chart title.
YAxisTitle | 2 | This is the caption for the Y-Axis.
XAxisTitle | 3 | This is the caption for the X-Axis.
DataLabel | 4 | This is a Data Label, linked to a series or a point in the series.
ZAxisTitle | 7 | This is the caption for the Z-Axis.


TListBoxSelectionType Enumeration | FlexCel Studio for the .NET Framework documentation

TListBoxSelectionType Enumeration

Types of selection allowed in a listbox.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
Single | 0 | The list control is only allowed to have one selected item.
Multi | 1 | The list control is allowed to have multiple items selected by clicking on each item.
Extend | 2 | The list control is allowed to have multiple items selected by holding the CTRL key and clicking on each item.


TMultipartType Enumeration | FlexCel Studio for the .NET Framework documentation

TMultipartType Enumeration

Different ways to define a multipart archive.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
Related | 0 | Parts inside this container are related, for example this message could contain an HTML file and its external images.
Alternative | 1 | Parts inside this container are an alternative one from the other. For example, a message could be sent in HTML and plain Text, once inside a different MIME part, and the mail reader should chose the best alternative of the parts to display.
Mixed | 2 | Parts inside this MIME container are not related, e.g. different attachments.
Digest | 3 | A compilation of messages, used in forwarded emails.
Signed | 4 | A part containing files and one signature.


TObjectType Enumeration | FlexCel Studio for the .NET Framework documentation

TObjectType Enumeration

A type of object. Do not confuse this with a type of shape ( TShapeType ) This does not describe the shape form (like if it is a rectangle or a circle) but the shape kind (for example if it is a comment, an image or an autoshape)

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
Undefined | -1 | Unknown object type.
Group | 0 |
Line | 1 |
Rectangle | 2 |
Oval | 3 |
Arc | 4 |
Chart | 5 |
Text | 6 |
Button | 7 |
Picture | 8 | An image inserted on Excel
Polygon | 9 |
CheckBox | 11 |
OptionButton | 12 |
EditBox | 13 |
Label | 14 |
DialogBox | 15 |
Spinner | 16 |
ScrollBar | 17 |
ListBox | 18 |
GroupBox | 19 |
ComboBox | 20 |
Comment | 25 |
MicrosoftOfficeDrawing | 30 |


TOperator Enumeration | FlexCel Studio for the .NET Framework documentation

TOperator Enumeration

Operators that can be found inside a formula

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
Nop | 0 | No operator
Neg | 19 | -
Percent | 20 | %
Power | 7 | ^
Mul | 5 | *
Div | 6 | /
Add | 3 | +
Sub | 4 | -
Concat | 8 | &
GE | 12 | greater or equal
LE | 10 | less or equal
NE | 14 | Not equal
EQ | 11 | =
LT | 9 | less than
GT | 13 | greater than
UPlus | 18 | Unary plus.


TOverlayBlendMode Enumeration | FlexCel Studio for the .NET Framework documentation

TOverlayBlendMode Enumeration

Overlay blend modes.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
Over | 0 | Overlay.
Mult | 1 | Multiply.
Screen | 2 | Screen.
Darken | 3 | Darken.
Lighten | 4 | Lighten.


TPanePosition Enumeration | FlexCel Studio for the .NET Framework documentation

TPanePosition Enumeration

Position on a pane when window is split

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
LowerRight | 0 | Lower-right corner.
UpperRight | 1 | Upper-right corner.
LowerLeft | 2 | Lower-left corner.
UpperLeft | 3 | Upper left corner. This is the default when you have only one pane.


TPaperSize Enumeration | FlexCel Studio for the .NET Framework documentation

TPaperSize Enumeration

Pre-defined Page sizes. For Printer specific page-sizes, see TPrinterDriverSettings Note that a printer specific page size might have a value that is not on this enumeration.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
Undefined | 0 | Not defined.
Letter | 1 | Letter - 81/2"" x 11""
Lettersmall | 2 | Letter small - 81/2"" x 11""
Tabloid | 3 | Tabloid - 11"" x 17""
Ledger | 4 | Ledger - 17"" x 11""
Legal | 5 | Legal - 81/2"" x 14""
Statement | 6 | Statement - 51/2"" x 81/2""
Executive | 7 | Executive - 71/4"" x 101/2""
A3 | 8 | A3 - 297mm x 420mm
A4 | 9 | A4 - 210mm x 297mm
A4small | 10 | A4 small - 210mm x 297mm
A5 | 11 | A5 - 148mm x 210mm
B4_JIS | 12 | B4 (JIS) - 257mm x 364mm
B5_JIS | 13 | B5 (JIS) - 182mm x 257mm
Folio | 14 | Folio - 81/2"" x 13""
Quarto | 15 | Quarto - 215mm x 275mm
s10x14 | 16 | 10x14 - 10"" x 14""
s11x17 | 17 | 11x17 - 11"" x 17""
Note | 18 | Note - 81/2"" x 11""
Envelope9 | 19 | Envelope #9 - 37/8"" x 87/8""
Envelope10 | 20 | Envelope #10 - 41/8"" x 91/2""
Envelope11 | 21 | Envelope #11 - 41/2"" x 103/8""
Envelope12 | 22 | Envelope #12 - 43/4"" x 11""
Envelope14 | 23 | Envelope #14 - 5"" x 111/2""
C | 24 | C - 17"" x 22""
D | 25 | D - 22"" x 34""
E | 26 | E - 34"" x 44""
EnvelopeDL | 27 | Envelope DL - 110mm x 220mm
EnvelopeC5 | 28 | Envelope C5 - 162mm x 229mm
EnvelopeC3 | 29 | Envelope C3 - 324mm x 458mm
EnvelopeC4 | 30 | Envelope C4 - 229mm x 324mm
EnvelopeC6 | 31 | Envelope C6 - 114mm x 162mm
EnvelopeC6_C5 | 32 | Envelope C6/C5 - 114mm x 229mm
B4_ISO | 33 | B4 (ISO) - 250mm x 353mm
B5_ISO | 34 | B5 (ISO) - 176mm x 250mm
B6_ISO | 35 | B6 (ISO) - 125mm x 176mm
EnvelopeItaly | 36 | Envelope Italy - 110mm x 230mm
EnvelopeMonarch | 37 | Envelope Monarch - 37/8"" x 71/2""
s63_4Envelope | 38 | 63/4 Envelope - 35/8"" x 61/2""
USStandardFanfold | 39 | US Standard Fanfold - 147/8"" x 11""
GermanStdFanfold | 40 | German Std. Fanfold - 81/2"" x 12""
GermanLegalFanfold | 41 | German Legal Fanfold - 81/2"" x 13""
B4_ISO_2 | 42 | B4 (ISO) - 250mm x 353mm
JapanesePostcard | 43 | Japanese Postcard - 100mm x 148mm
s9x11 | 44 | 9x11 - 9"" x 11""
s10x11 | 45 | 10x11 - 10"" x 11""
s15x11 | 46 | 15x11 - 15"" x 11""
EnvelopeInvite | 47 | Envelope Invite - 220mm x 220mm
LetterExtra | 50 | Letter Extra - 91/2"" x 12""
LegalExtra | 51 | Legal Extra - 91/2"" x 15""
TabloidExtra | 52 | Tabloid Extra - 1111/16"" x 18""
A4Extra | 53 | A4 Extra - 235mm x 322mm
LetterTransverse | 54 | Letter Transverse - 81/2"" x 11""
A4Transverse | 55 | A4 Transverse - 210mm x 297mm
LetterExtraTransv | 56 | Letter Extra Transv. - 91/2"" x 12""
SuperA_A4 | 57 | Super A/A4 - 227mm x 356mm
SuperB_A3 | 58 | Super B/A3 - 305mm x 487mm
LetterPlus | 59 | Letter Plus - 812"" x 1211/16""
A4Plus | 60 | A4 Plus - 210mm x 330mm
A5Transverse | 61 | A5 Transverse - 148mm x 210mm
B5_JIS_Transverse | 62 | B5 (JIS) Transverse - 182mm x 257mm
A3Extra | 63 | A3 Extra - 322mm x 445mm
A5Extra | 64 | A5 Extra - 174mm x 235mm
B5_ISO_Extra | 65 | B5 (ISO) Extra - 201mm x 276mm
A2 | 66 | A2 - 420mm x 594mm
A3Transverse | 67 | A3 Transverse - 297mm x 420mm
A3ExtraTransverse | 68 | A3 Extra Transverse - 322mm x 445mm
DblJapanesePostcard | 69 | Dbl. Japanese Postcard - 200mm x 148mm
A6 | 70 | A6 - 105mm x 148mm
LetterRotated | 75 | Letter Rotated - 11"" x 81/2""
A3Rotated | 76 | A3 Rotated - 420mm x 297mm
A4Rotated | 77 | A4 Rotated - 297mm x 210mm
A5Rotated | 78 | A5 Rotated - 210mm x 148mm
B4_JIS_Rotated | 79 | B4 (JIS) Rotated - 364mm x 257mm
B5_JIS_Rotated | 80 | B5 (JIS) Rotated - 257mm x 182mm
JapanesePostcardRot | 81 | Japanese Postcard Rot. - 148mm x 100mm
DblJapPostcardRot | 82 | Dbl. Jap. Postcard Rot. - 148mm x 200mm
A6Rotated | 83 | A6 Rotated - 148mm x 105mm
B6_JIS | 88 | B6 (JIS) - 128mm x 182mm
B6_JIS_Rotated | 89 | B6 (JIS) Rotated - 182mm x 128mm
s12x11 | 90 | 12x11 - 12"" x 11""


TPathShadeType Enumeration | FlexCel Studio for the .NET Framework documentation

TPathShadeType Enumeration

Enumerates the different gradient modes for a Path gradient.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
Shape | 0 | Gradient follows the shape. If the shape is a circle it will be circular; if it is a star then it will be a star-shaped path.
Circle | 1 | Gradient follows a circular path.
Rect | 2 | Gradient follows a rectangular path.


TPenAlignment Enumeration | FlexCel Studio for the .NET Framework documentation

TPenAlignment Enumeration

Specifies the alignment to be used for the underline stroke.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
Center | 0 | Center pen (line drawn at center of path stroke).
Inset | 1 | Inset pen (the pen is aligned on the inside of the edge of the path).


TPitchFamily Enumeration | FlexCel Studio for the .NET Framework documentation

TPitchFamily Enumeration

Pitch family for a font.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
DEFAULT_PITCH__UNKNOWN_FONT_FAMILY | 0 | DEFAULT PITCH + UNKNOWN FONT FAMILY
FIXED_PITCH__UNKNOWN_FONT_FAMILY | 1 | FIXED PITCH + UNKNOWN FONT FAMILY
VARIABLE_PITCH__UNKNOWN_FONT_FAMILY | 2 | VARIABLE PITCH + UNKNOWN FONT FAMILY
DEFAULT_PITCH__ROMAN_FONT_FAMILY | 16 | DEFAULT PITCH + ROMAN FONT FAMILY
FIXED_PITCH__ROMAN_FONT_FAMILY | 17 | FIXED PITCH + ROMAN FONT FAMILY
VARIABLE_PITCH__ROMAN_FONT_FAMILY | 18 | VARIABLE PITCH + ROMAN FONT FAMILY
DEFAULT_PITCH__SWISS_FONT_FAMILY | 32 | DEFAULT PITCH + SWISS FONT FAMILY
FIXED_PITCH__SWISS_FONT_FAMILY | 33 | FIXED PITCH + SWISS FONT FAMILY
VARIABLE_PITCH__SWISS_FONT_FAMILY | 34 | VARIABLE PITCH + SWISS FONT FAMILY
DEFAULT_PITCH__MODERN_FONT_FAMILY | 48 | DEFAULT PITCH + MODERN FONT FAMILY
FIXED_PITCH__MODERN_FONT_FAMILY | 49 | FIXED PITCH + MODERN FONT FAMILY
VARIABLE_PITCH__MODERN_FONT_FAMILY | 50 | VARIABLE PITCH + MODERN FONT FAMILY
DEFAULT_PITCH__SCRIPT_FONT_FAMILY | 64 | DEFAULT PITCH + SCRIPT FONT FAMILY
FIXED_PITCH__SCRIPT_FONT_FAMILY | 65 | FIXED PITCH + SCRIPT FONT FAMILY
VARIABLE_PITCH__SCRIPT_FONT_FAMILY | 66 | VARIABLE PITCH + SCRIPT FONT FAMILY
DEFAULT_PITCH__DECORATIVE_FONT_FAMILY | 80 | DEFAULT PITCH + DECORATIVE FONT FAMILY
FIXED_PITCH__DECORATIVE_FONT_FAMILY | 81 | FIXED PITCH + DECORATIVE FONT FAMILY
VARIABLE_PITCH__DECORATIVE_FONT_FAMILY | 82 | VARIABLE PITCH + DECORATIVE FONT FAMILY


TPlotEmptyCells Enumeration | FlexCel Studio for the .NET Framework documentation

TPlotEmptyCells Enumeration

Defines how empty cells will be plotted in the chart.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
NotPlotted | 0 | The cell will not be plotted. There will be a gap in the chart.
Zero | 1 | The cell will be plotted with value = 0.
Interpolated | 2 | The cell will be plotted with value interpolated between its nearest points.


TPresetColor Enumeration | FlexCel Studio for the .NET Framework documentation

TPresetColor Enumeration

Preset colors.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
None | 0 | Color is not specified.
AliceBlue | 1 | Specifies a color with RGB value (240,248,255)
AntiqueWhite | 2 | Specifies a color with RGB value (250,235,215)
Aqua | 3 | Specifies a color with RGB value (0,255,255)
Aquamarine | 4 | Specifies a color with RGB value (127,255,212)
Azure | 5 | Specifies a color with RGB value (240,255,255)
Beige | 6 | Specifies a color with RGB value (245,245,220)
Bisque | 7 | Specifies a color with RGB value (255,228,196)
Black | 8 | Specifies a color with RGB value (0,0,0)
BlanchedAlmond | 9 | Specifies a color with RGB value (255,235,205)
Blue | 10 | Specifies a color with RGB value (0,0,255)
BlueViolet | 11 | Specifies a color with RGB value (138,43,226)
Brown | 12 | Specifies a color with RGB value (165,42,42)
BurlyWood | 13 | Specifies a color with RGB value (222,184,135)
CadetBlue | 14 | Specifies a color with RGB value (95,158,160)
Chartreuse | 15 | Specifies a color with RGB value (127,255,0)
Chocolate | 16 | Specifies a color with RGB value (210,105,30)
Coral | 17 | Specifies a color with RGB value (255,127,80)
CornflowerBlue | 18 | Specifies a color with RGB value (100,149,237)
Cornsilk | 19 | Specifies a color with RGB value (255,248,220)
Crimson | 20 | Specifies a color with RGB value (220,20,60)
Cyan | 21 | Specifies a color with RGB value (0,255,255)
DeepPink | 22 | Specifies a color with RGB value (255,20,147)
DeepSkyBlue | 23 | Specifies a color with RGB value (0,191,255)
DimGray | 24 | Specifies a color with RGB value (105,105,105)
DkBlue | 25 | Specifies a color with RGB value (0,0,139)
DkCyan | 26 | Specifies a color with RGB value (0,139,139)
DkGoldenrod | 27 | Specifies a color with RGB value (184,134,11)
DkGray | 28 | Specifies a color with RGB value (169,169,169)
DkGreen | 29 | Specifies a color with RGB value (0,100,0)
DkKhaki | 30 | Specifies a color with RGB value (189,183,107)
DkMagenta | 31 | Specifies a color with RGB value (139,0,139)
DkOliveGreen | 32 | Specifies a color with RGB value (85,107,47)
DkOrange | 33 | Specifies a color with RGB value (255,140,0)
DkOrchid | 34 | Specifies a color with RGB value (153,50,204)
DkRed | 35 | Specifies a color with RGB value (139,0,0)
DkSalmon | 36 | Specifies a color with RGB value (233,150,122)
DkSeaGreen | 37 | Specifies a color with RGB value (143,188,139)
DkSlateBlue | 38 | Specifies a color with RGB value (72,61,139)
DkSlateGray | 39 | Specifies a color with RGB value (47,79,79)
DkTurquoise | 40 | Specifies a color with RGB value (0,206,209)
DkViolet | 41 | Specifies a color with RGB value (148,0,211)
DodgerBlue | 42 | Specifies a color with RGB value (30,144,255)
Firebrick | 43 | Specifies a color with RGB value (178,34,34)
FloralWhite | 44 | Specifies a color with RGB value (255,250,240)
ForestGreen | 45 | Specifies a color with RGB value (34,139,34)
Fuchsia | 46 | Specifies a color with RGB value (255,0,255)
Gainsboro | 47 | Specifies a color with RGB value (220,220,220)
GhostWhite | 48 | Specifies a color with RGB value (248,248,255)
Gold | 49 | Specifies a color with RGB value (255,215,0)
Goldenrod | 50 | Specifies a color with RGB value (218,165,32)
Gray | 51 | Specifies a color with RGB value (128,128,128)
Green | 52 | Specifies a color with RGB value (0,128,0)
GreenYellow | 53 | Specifies a color with RGB value (173,255,47)
Honeydew | 54 | Specifies a color with RGB value (240,255,240)
HotPink | 55 | Specifies a color with RGB value (255,105,180)
IndianRed | 56 | Specifies a color with RGB value (205,92,92)
Indigo | 57 | Specifies a color with RGB value (75,0,130)
Ivory | 58 | Specifies a color with RGB value (255,255,240)
Khaki | 59 | Specifies a color with RGB value (240,230,140)
Lavender | 60 | Specifies a color with RGB value (230,230,250)
LavenderBlush | 61 | Specifies a color with RGB value (255,240,245)
LawnGreen | 62 | Specifies a color with RGB value (124,252,0)
LemonChiffon | 63 | Specifies a color with RGB value (255,250,205)
Lime | 64 | Specifies a color with RGB value (0,255,0)
LimeGreen | 65 | Specifies a color with RGB value (50,205,50)
Linen | 66 | Specifies a color with RGB value (250,240,230)
LtBlue | 67 | Specifies a color with RGB value (173,216,230)
LtCoral | 68 | Specifies a color with RGB value (240,128,128)
LtCyan | 69 | Specifies a color with RGB value (224,255,255)
LtGoldenrodYellow | 70 | Specifies a color with RGB value (250,250,120)
LtGray | 71 | Specifies a color with RGB value (211,211,211)
LtGreen | 72 | Specifies a color with RGB value (144,238,144)
LtPink | 73 | Specifies a color with RGB value (255,182,193)
LtSalmon | 74 | Specifies a color with RGB value (255,160,122)
LtSeaGreen | 75 | Specifies a color with RGB value (32,178,170)
LtSkyBlue | 76 | Specifies a color with RGB value (135,206,250)
LtSlateGray | 77 | Specifies a color with RGB value (119,136,153)
LtSteelBlue | 78 | Specifies a color with RGB value (176,196,222)
LtYellow | 79 | Specifies a color with RGB value (255,255,224)
Magenta | 80 | Specifies a color with RGB value (255,0,255)
Maroon | 81 | Specifies a color with RGB value (128,0,0)
MedAquamarine | 82 | Specifies a color with RGB value (102,205,170)
MedBlue | 83 | Specifies a color with RGB value (0,0,205)
MedOrchid | 84 | Specifies a color with RGB value (186,85,211)
MedPurple | 85 | Specifies a color with RGB value (147,112,219)
MedSeaGreen | 86 | Specifies a color with RGB value (60,179,113)
MedSlateBlue | 87 | Specifies a color with RGB value (123,104,238)
MedSpringGreen | 88 | Specifies a color with RGB value (0,250,154)
MedTurquoise | 89 | Specifies a color with RGB value (72,209,204)
MedVioletRed | 90 | Specifies a color with RGB value (199,21,133)
MidnightBlue | 91 | Specifies a color with RGB value (25,25,112)
MintCream | 92 | Specifies a color with RGB value (245,255,250)
MistyRose | 93 | Specifies a color with RGB value (255,228,225)
Moccasin | 94 | Specifies a color with RGB value (255,228,181)
NavajoWhite | 95 | Specifies a color with RGB value (255,222,173)
Navy | 96 | Specifies a color with RGB value (0,0,128)
OldLace | 97 | Specifies a color with RGB value (253,245,230)
Olive | 98 | Specifies a color with RGB value (128,128,0)
OliveDrab | 99 | Specifies a color with RGB value (107,142,35)
Orange | 100 | Specifies a color with RGB value (255,165,0)
OrangeRed | 101 | Specifies a color with RGB value (255,69,0)
Orchid | 102 | Specifies a color with RGB value (218,112,214)
PaleGoldenrod | 103 | Specifies a color with RGB value (238,232,170)
PaleGreen | 104 | Specifies a color with RGB value (152,251,152)
PaleTurquoise | 105 | Specifies a color with RGB value (175,238,238)
PaleVioletRed | 106 | Specifies a color with RGB value (219,112,147)
PapayaWhip | 107 | Specifies a color with RGB value (255,239,213)
PeachPuff | 108 | Specifies a color with RGB value (255,218,185)
Peru | 109 | Specifies a color with RGB value (205,133,63)
Pink | 110 | Specifies a color with RGB value (255,192,203)
Plum | 111 | Specifies a color with RGB value (221,160,221)
PowderBlue | 112 | Specifies a color with RGB value (176,224,230)
Purple | 113 | Specifies a color with RGB value (128,0,128)
Red | 114 | Specifies a color with RGB value (255,0,0)
RosyBrown | 115 | Specifies a color with RGB value (188,143,143)
RoyalBlue | 116 | Specifies a color with RGB value (65,105,225)
SaddleBrown | 117 | Specifies a color with RGB value (139,69,19)
Salmon | 118 | Specifies a color with RGB value (250,128,114)
SandyBrown | 119 | Specifies a color with RGB value (244,164,96)
SeaGreen | 120 | Specifies a color with RGB value (46,139,87)
SeaShell | 121 | Specifies a color with RGB value (255,245,238)
Sienna | 122 | Specifies a color with RGB value (160,82,45)
Silver | 123 | Specifies a color with RGB value (192,192,192)
SkyBlue | 124 | Specifies a color with RGB value (135,206,235)
SlateBlue | 125 | Specifies a color with RGB value (106,90,205)
SlateGray | 126 | Specifies a color with RGB value (112,128,144)
Snow | 127 | Specifies a color with RGB value (255,250,250)
SpringGreen | 128 | Specifies a color with RGB value (0,255,127)
SteelBlue | 129 | Specifies a color with RGB value (70,130,180)
Tan | 130 | Specifies a color with RGB value (210,180,140)
Teal | 131 | Specifies a color with RGB value (0,128,128)
Thistle | 132 | Specifies a color with RGB value (216,191,216)
Tomato | 133 | Specifies a color with RGB value (255,99,71)
Turquoise | 134 | Specifies a color with RGB value (64,224,208)
Violet | 135 | Specifies a color with RGB value (238,130,238)
Wheat | 136 | Specifies a color with RGB value (245,222,179)
White | 137 | Specifies a color with RGB value (255,255,255)
WhiteSmoke | 138 | Specifies a color with RGB value (245,245,245)
Yellow | 139 | Specifies a color with RGB value (255,255,0)
YellowGreen | 140 | Specifies a color with RGB value (154,205,50)


TPresetShadowEffectType Enumeration | FlexCel Studio for the .NET Framework documentation

TPresetShadowEffectType Enumeration

Types of preset shadow.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
TopLeftDropShadow | 0 | Drop shadow in the top-left corner.
TopRightDropShadow | 1 | Drop shadow in the top-right corner.
BackLeftPerspectiveShadow | 2 | Perspective shadow in the back pointing left.
BackRightPerspectiveShadow | 3 | Perspective shadow in the back pointing right.
BottomLeftDropShadow | 4 | Drop shadow in the bottom-left corner.
BottomRightDropShadow | 5 | Drop shadow in the bottom-right corner.
FrontLeftPerspectiveShadow | 6 | Perspective shadow in the front pointing left.
FrontRightPerspectiveShadow | 7 | Perspective shadow in the front pointing right.
TopLeftSmallDropShadow | 8 | Small drop shadow in the top-left corner.
TopLeftLargeDropShadow | 9 | Large drop shadow in the top-left corner.
BackLeftLongPerspectiveShadow | 10 | Long perspective shadow in the back pointing left.
BackRightLongPerspectiveShadow | 11 | Long perspective shadow in the back pointing right.
TopLeftDoubleDropShadow | 12 | Double drop shadow in the top-left corner.
BottomRightSmallDropShadow | 13 | Small drop shadow in the bottom-right corner.
FrontLeftLongPerspectiveShadow | 14 | Long perspective shadow in the front pointing left.
FrontRightLongPerspectiveShadow | 15 | Long perspective shadow in the front pointing right.
OuterBoxShadow3D | 16 | 3D Outer Box Shadow.
InnerBoxShadow3D | 17 | 3D Inner Box Shadow.
BackCenterPerspectiveShadow | 18 | Perspective shadow in the back to the center.
FrontBottomShadow | 19 | Perspective shadow in the front at the bottom.


TPrimaryThemeColor Enumeration | FlexCel Studio for the .NET Framework documentation

TPrimaryThemeColor Enumeration

Specifies one of the 12 theme colors. Does not include semantic colors, which are in TThemeColor

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
Light1 | 0 | Main color for backgrounds in Theme.
Dark1 | 1 | Main color for foregrounds in Theme.
Light2 | 2 | Secondary color for backgrounds in Theme..
Dark2 | 3 | Secondary color for foregrounds in Theme.
Accent1 | 4 | Accent1 Theme.
Accent2 | 5 | Accent2 Theme.
Accent3 | 6 | Accent3 Theme.
Accent4 | 7 | Accent4 Theme.
Accent5 | 8 | Accent5 Theme.
Accent6 | 9 | Accent6 Theme.
HyperLink | 10 | HyperLink Theme.
FollowedHyperLink | 11 | FollowedHyperLink Theme.


TPrintComments Enumeration | FlexCel Studio for the .NET Framework documentation

TPrintComments Enumeration

Determines how the comments will be displayed when printing.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
None | 0 | Comments won't be printed.
AtEndOfSheet | 1 | Comments will be printed at the end of the sheet.
AsDisplayed | 2 | Comments will be printed as they show in the page. If they are closed, they won't print, but if they are open they will.


TPrintErrors Enumeration | FlexCel Studio for the .NET Framework documentation

TPrintErrors Enumeration

Determines how to print the errors when printing or exporting a sheet.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
AsDisplayed | 0 | Errors will print as they are displayed in the sheet.
AsBlanks | 1 | Errors will not print.
AsDashes | 2 | Errors will print as "--"
AsNA | 3 | All errors will print as #N/A


TPrintOptions Enumeration | FlexCel Studio for the .NET Framework documentation

TPrintOptions Enumeration

How the sheet should be printed. You can mix value together by and'ing and or'ing the flags. See the example to see how to set or clear one specific value of the enumeration.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
None | 0 | All options cleared.
LeftToRight | 1 | Print over, then down. You can change this by using xls.PrintOverThenDown.
Orientation | 2 | 0= landscape, 1=portrait. You can change this by using xls.PrintLandscape.
NoPls | 4 | if 1, then PaperSize, Scale, Res, VRes, Copies, and Landscape data have not been obtained from the printer, so they are not valid. MAKE SURE YOU MAKE THIS BIT = 0 *BEFORE* CHANGING ANY OTHER OPTION. THEY WILL NOT CHANGE IF THIS IS NOT SET.
NoColor | 8 | 1= Black and white. You can change this by using xls.PrintBlackAndWhite.
Draft | 16 | 1= Draft quality. You can change this by using xls.PrintDraftQuality.
Notes | 32 | 1= Print Notes. Use xls.PrintComments instead.
NoOrient | 64 | 1=orientation not set
UsePage | 128 | 1=use custom starting page number. Use xls.PrintFirstPageNumber to set this instead.

Examples

Here we will show how to set the page orientation to landscape or portrait. You can do this simply by using

    xls.PrintLandscape = true;

but if you wanted to do it with PrintOptions, you would do the following:

    // Remember that you can always do xls.PrintLandscape = true instead of this code.
    if (Landscape)
        xls.PrintOptions &= ~(TPrintOptions.Orientation | TPrintOptions.NoPls);
    else
    {
        //ALWAYS SET NOPLS TO 0 BEFORE CHANGING THE OTHER OPTIONS.
        xls.PrintOptions &= ~TPrintOptions.NoPls;
        xls.PrintOptions |= TPrintOptions.Orientation;
    }


TPropertyId Enumeration | FlexCel Studio for the .NET Framework documentation

TPropertyId Enumeration

Standard properties of an ole file. There are two different sets of properties, the standard ones (properties that exist for any file) and the extended ones (properties that exist for Ms Office documents)

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
None | 0 | This is not a valid property. It will do nothing.
CoreCodePage | 1 | The codepage used to save the extended properties themselves. This value is used by FlexCel to read the other strings in the properties, but shouldn't be of use for normal users.
Title | 2 | Document Title. (Standard property)
Subject | 3 | Document Subject. (Standard property)
Author | 4 | Author. (Standard property)
Keywords | 5 | Keywords. (Standard property)
Comments | 6 | Comments. (Standard property)
Template | 7 | Template. (Standard property)
LastSavedBy | 8 | Last user to save the file. (Standard property). Note: Unless you set this property explicitly with XlsFile.DocumentProperties.SetStandardProperty, FlexCel will save the creator instead. This is because you don't normally want to save the last user who modified a template.
RevisionNumber | 9 | Revision number. (Standard property). Note:While this is a string and Windows Explorer will allow you to set any value here, Excel will report any file with a revision which is not an integer as invalid.
TotalEditingTime | 10 | Total editing time. (Standard property)
LastPrinted | 11 | Last printed date. (Standard property)
CreateTimeDate | 12 | Date of created in UTC time. (Standard property). Note: Unless you set this property explicitly, FlexCel will save the current time as the creation date. If you are creating a new file this is what you want. But if you are modifying and existing file and want to preserve the original creation date, you need to explicitly set ths property.
LastSavedTimeDate | 13 | Date last saved. (Standard property)
NumberOfPages | 14 | Number of pages. (Standard property)
NumberOfWords | 15 | Number of words. (Standard property)
NumberOfCharacters | 16 | Number of characters. (Standard property)
Thumbnail | 17 | Thumbnail image. (Standard property)
NameOfCreatingApplication | 18 | Application that created the file. (Standard property)
Security | 19 | Security. (Standard property)
ExtendedCodePage | 65536 | The codepage used to save the extended properties themselves. This value is used by FlexCel to read the other strings in the properties, but shouldn't be of use for normal users.
Category | 65537 | A text string typed by the user that indicates what category the file belongs to (memo, proposal, and so on). It is useful for finding files of same type. (Extended property)
PresentationTarget | 65538 | Target format for presentation (35mm, printer, video, and so on). (Extended property)
Bytes | 65539 | Number of bytes. (Extended property)
Lines | 65540 | Number of lines. (Extended property)
Paragraphs | 65541 | Number of paragraphs. (Extended property)
Slides | 65542 | Number of slides. (Extended property)
Notes | 65543 | Number of pages that contain notes. (Extended property)
HiddenSlides | 65544 | Number of slides that are hidden. (Extended property)
MMClips | 65545 | Number of sound or video clips. (Extended property)
ScaleCrop | 65546 | Set to True (-1) when scaling of the thumbnail is desired. If not set, cropping is desired. (Extended property)
HeadingPairs | 65547 | Internally used property indicating the grouping of different document parts and the number of items in each group. The titles of the document parts are stored in the TitlesofParts property. The HeadingPairs property is stored as a vector of variants, in repeating pairs of VT_LPSTR (or VT_LPWSTR) and VT_I4 values. The VT_LPSTR value represents a heading name, and the VT_I4 value indicates the count of document parts under that heading. (Extended property)
TitlesofParts | 65548 | Names of document parts. (Extended property)
Manager | 65549 | Manager of the project. (Extended property)
Company | 65550 | Company name. (Extended property)
LinksUpToDate | 65551 | Boolean value to indicate whether the custom links are hampered by excessive noise, for all applications. (Extended property)
CharacterCountWithSpaces | 65552 | Estimate of the number of characters in the document including whitespace.
SharedDoc | 65554 | This property must be false.
LinksBase | 65555 | Base URL for links.
Hyperlinks | 65556 | Not saved here. This property must not be written.
HyperlinksChanged | 65557 | True if the links were changed outside the application and must be updated.
AppVersion | 65558 | Version of the application that wrote the file. The 2 high order bytes are the major version, and the 2 lower bytes the minor version.
DigitalSignature | 65559 | Data on the VBA digital signature if the file has a macro digitally signed.
ContentType | 65561 | String that specifies the content type of the file.
Status | 65562 | Status of the document.
Language | 65563 | Language of the document. Should be absent.
Version | 65564 | Version of the document. Should be absent.


TProtectionType Enumeration | FlexCel Studio for the .NET Framework documentation

TProtectionType Enumeration

Indicates how a sheet will be protected.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
All | 0 | All things will be protected.
None | 1 | Nothing will be protected.


TQEncodeMetaInfo Enumeration | FlexCel Studio for the .NET Framework documentation

TQEncodeMetaInfo Enumeration

Defines how a string returned by Q-Encode will be handled.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
None | 0 | This will return the raw Q-Encoded string, without "=?charset?encoding?" at the beginning or "?=" at the end.
Always | 1 | This will always return the Q-Encoded string with "=?charset?encoding?" at the beginning and "?=" at the end.
OnlyIfNeeded | 2 | This will return the string with "=?charset?encoding?" only if the original string has special characters that need encoding, if not it will return the original string without encoding.


TRangeCopyMode Enumeration | FlexCel Studio for the .NET Framework documentation

TRangeCopyMode Enumeration

What we do with the cells when we call InsertAndCopyRange.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
All | 0 | Will copy all (values, ranges, images, formulas, etc).
OnlyFormulas | 1 | Will copy all except values. Useful when you are going to replace those values anyway.
None | 2 | Won't copy anything. Only inserts.
OnlyFormulasAndNoObjects | 3 | Will copy all except values and objects (like images). Useful when you are going to replace those values anyway.
AllIncludingDontMoveAndSizeObjects | 4 | Will copy all objects, including those that are marked as "do not copy" in the file. You will normally not want to use this.
Formats | 5 | Will copy cell formatting, but not cell contents. Images and objects will be copied too.


TRangeOp Enumeration | FlexCel Studio for the .NET Framework documentation

TRangeOp Enumeration

Operation between ranges.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
Union | 0 | An union of the 2 ranges.
Intersection | 1 | The intersection of the 2 ranges.
Range | 2 | Creates a range from the Left-Top and Right-Bottom coordinates provided by the opearnds.


TRecalcMode Enumeration | FlexCel Studio for the .NET Framework documentation

TRecalcMode Enumeration

Sets how the excel file will be recalculated. Normally FlexCel calculates a file only before saving and when you explicitly call ExcelFile.Recalc(Boolean). With this enum you can change that behavior.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
Smart | 0 | The file will be recalculated before saving, *only* if there are any changes on the file. This mode is the recommended, because it allows you to open and save a file (for example to remove a password) without modifying the formula results. If you modify any value on the sheet, a recalculation will be done to get the new values.
Forced | 1 | The file will *always* be recalculated before saving. Use it if you are loading files that might not be recalculated, to make sure they will. If you open a not calculated file on Smart mode and then save it without modifying anything, it will remain not calculated.
Manual | 2 | The file will *never* be recalculated by FlexCel (Except if you do a forced recalc: XlsFile.Recalc(true). All formula results will be set to null and formulas will be modified so Excel recalculates them when you open the file. If you are only using Excel to open the generated files the result will be the same as with a recalculated file, but if you try to open it with a viewer you won't see the formula results. You should not need to use manual recalculation. The only case where it might be useful is if you are setting the formula results yourself and don't want FlexCel to change them when it saves.
OnEveryChange | 3 | The file will be recalculated each time a value changes on the sheet. Do not use this mode on normal files, as it can be really slow!! This option could be of use for an interactive viewer.


TRecalcVersion Enumeration | FlexCel Studio for the .NET Framework documentation

TRecalcVersion Enumeration

Identifies how FlexCel will identify itself in the generated file, in order to recalculate.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
AlwaysRecalc | 0 | If you choose this option, Excel will always recalculate the full file on open, and ask for saving changes when closing the file.
SameAsInputFile | 1 | FlexCel will write the same information that was in the original file it opened. Note that if you create a file with XlsFile.NewFile, then the version will be the version you specify in the NewFile parameters. By default, this is Excel 2003.
LatestKnownExcelVersion | 2 | This will use the latest Excel version that FlexCel is aware of. Note that when you update FlexCel to a newer version, the recalculating version might change if it adds support for newer Excel versions.
Excel2003 | 3 | The file will be identified as if it was saved by Excel 2003. Any newer Excel version opening the file will recalculate the file on open, and ask to save changes when closing.
Excel2007 | 4 | The file will be identified as if it was saved by Excel 2007. Any newer Excel version opening the file will recalculate the file on open, and ask to save changes when closing.
Excel2010 | 5 | The file will be identified as if it was saved by Excel 2010. Any newer Excel version opening the file will recalculate the file on open, and ask to save changes when closing.
Excel2013 | 6 | The file will be identified as if it was saved by Excel 2013. Any newer Excel version opening the file will recalculate the file on open, and ask to save changes when closing.
Excel2016 | 7 | The file will be identified as if it was saved by Excel 2016. Any newer Excel version opening the file will recalculate the file on open, and ask to save changes when closing.
Excel2019 | 8 | The file will be identified as if it was saved by Excel 2019. Any newer Excel version opening the file will recalculate the file on open, and ask to save changes when closing.
Excel2021 | 9 | The file will be identified as if it was saved by Excel 2021. Any newer Excel version opening the file will recalculate the file on open, and ask to save changes when closing.
Excel2023 | 10 | The file will be identified as if it was saved by Excel 365 after July 2023. Any newer Excel version opening the file will recalculate the file on open, and ask to save changes when closing.


TReferenceStyle Enumeration | FlexCel Studio for the .NET Framework documentation

TReferenceStyle Enumeration

Use this enumerator in the property ExcelFile.FormulaReferenceStyle to specify the reference mode that FlexCel will use when you enter formulas as text or when it returns the formula text.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
A1 | 0 | Standard A1 mode. Uses letters for the columns and numbers for the rows.
R1C1 | 1 | R1C1 style. Uses numbers for both columns and rows.


TShapeOption Enumeration | FlexCel Studio for the .NET Framework documentation

TShapeOption Enumeration

Many different configuration options for a shape.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
None | 0 | Not defined.
Rotation | 4 | Rotation in 1/65536 degrees.
LockRotation | 119 | No rotation
fLockAspectRatio | 120 | Don't allow changes in aspect ratio
fLockPosition | 121 | Don't allow the shape to be moved
fLockAgainstSelect | 122 | Shape may not be selected
fLockCropping | 123 | No cropping this shape
fLockVertices | 124 | Edit Points not allowed
fLockText | 125 | Do not edit text
fLockAdjustHandles | 126 | Do not adjust
fLockAgainstGrouping | 127 | Do not group this shape
lTxid | 128 | id for the text, value determined by the host
dxTextLeft | 129 | margins relative to shape's inscribed text rectangle (in EMUs) 1/10 inch
dyTextTop | 130 | margins relative to shape's inscribed text rectangle (in EMUs) 1/20 inch
dxTextRight | 131 | margins relative to shape's inscribed text rectangle (in EMUs) 1/10 inch
dyTextBottom | 132 | margins relative to shape's inscribed text rectangle (in EMUs) 1/20 inch
WrapText | 133 | Wrap text at shape margins
scaleText | 134 | Text zoom/scale (used if fFitTextToShape)
anchorText | 135 | How to anchor the text
txflTextFlow | 136 | Text flow
cdirFont | 137 | Font rotation
hspNext | 138 | ID of the next shape (used by Word for linked textboxes)
txdir | 139 | Bi-Di Text direction
fSelectText | 187 | TRUE if single click selects text, FALSE if two clicks
fAutoTextMargin | 188 | use host's margin calculations
fRotateText | 189 | Rotate text with shape
fFitShapeToText | 190 | Size shape to fit text size
fFitTextToShape | 191 | Size text to fit shape size
gtextUNICODE | 192 | UNICODE text string
gtextRTF | 193 | RTF text string
gtextAlign | 194 | alignment on curve
gtextSize | 195 | default point size
gtextSpacing | 196 | fixed point 16.16
gtextFont | 197 | font family name
gtextFReverseRows | 240 | Reverse row order
fGtext | 241 | Has text effect
gtextFVertical | 242 | Rotate characters
gtextFKern | 243 | Kern characters
gtextFTight | 244 | Tightening or tracking
gtextFStretch | 245 | Stretch to fit shape
gtextFShrinkFit | 246 | Char bounding box
gtextFBestFit | 247 | Scale text-on-path
gtextFNormalize | 248 | Stretch char height
gtextFDxMeasure | 249 | Do not measure along path
gtextFBold | 250 | Bold font
gtextFItalic | 251 | Italic font
gtextFUnderline | 252 | Underline font
gtextFShadow | 253 | Shadow font
gtextFSmallcaps | 254 | Small caps font
gtextFStrikethrough | 255 | Strike through font
cropFromTop | 256 | 16.16 fraction times total image width or height, as appropriate.
cropFromBottom | 257 | 16.16 fraction times total image width or height, as appropriate.
cropFromLeft | 258 | 16.16 fraction times total image width or height, as appropriate.
cropFromRight | 259 | 16.16 fraction times total image width or height, as appropriate.
pib | 260 | Blip to display
pibName | 261 | Blip file name
pibFlags | 262 | Blip flags
pictureTransparent | 263 | transparent color (none if ~0UL)
pictureContrast | 264 | contrast setting
pictureBrightness | 265 | brightness setting
pictureGamma | 266 | 16.16 gamma
pictureId | 267 | Host-defined ID for OLE objects (usually a pointer)
pictureDblCrMod | 268 | Modification used if shape has double shadow
pibPrintName | 272 | Blip file name
pibPrintFlags | 273 | Blip flags
fNoHitTestPicture | 316 | Do not hit test the picture
pictureGray | 317 | grayscale display
pictureBiLevel | 318 | bi-level display
pictureActive | 319 | Server is active (OLE objects only)
geoLeft | 320 | Defines the G (geometry) coordinate space.
geoTop | 321 |
geoRight | 322 |
geoBottom | 323 |
shapePath | 324 |
pVertices | 325 |
pSegmentInfo | 326 |
adjustValue | 327 | Adjustment values corresponding to the positions of the adjust handles of the shape. The number of values used and their allowable ranges vary from shape type to shape type.
adjust2Value | 328 | Adjustment values corresponding to the positions of the adjust handles of the shape. The number of values used and their allowable ranges vary from shape type to shape type.
adjust3Value | 329 | Adjustment values corresponding to the positions of the adjust handles of the shape. The number of values used and their allowable ranges vary from shape type to shape type.
adjust4Value | 330 | Adjustment values corresponding to the positions of the adjust handles of the shape. The number of values used and their allowable ranges vary from shape type to shape type.
adjust5Value | 331 | Adjustment values corresponding to the positions of the adjust handles of the shape. The number of values used and their allowable ranges vary from shape type to shape type.
adjust6Value | 332 | Adjustment values corresponding to the positions of the adjust handles of the shape. The number of values used and their allowable ranges vary from shape type to shape type.
adjust7Value | 333 | Adjustment values corresponding to the positions of the adjust handles of the shape. The number of values used and their allowable ranges vary from shape type to shape type.
adjust8Value | 334 | Adjustment values corresponding to the positions of the adjust handles of the shape. The number of values used and their allowable ranges vary from shape type to shape type.
adjust9Value | 335 | Adjustment values corresponding to the positions of the adjust handles of the shape. The number of values used and their allowable ranges vary from shape type to shape type.
adjust10Value | 336 | Adjustment values corresponding to the positions of the adjust handles of the shape. The number of values used and their allowable ranges vary from shape type to shape type.
pConnectionSites | 337 | This property specifies an array of connection sites that a user can use to make a link between shapes.
pConnectionSitesDir | 338 | This property specifies an array of angles corresponding to the connection sites in the pConnectionSites_complex property that are used to determine the direction that a connector links to the corresponding connection site.
xLimo | 339 | This property specifies an x coordinate above which limousine scaling is used in the horizontal direction. This means that points whose x coordinate is greater than xLimo have their x coordinates incremented rather than linearly scaled.
yLimo | 340 | This property specifies an y coordinate above which limousine scaling is used in the vertical direction. This means that points whose y coordinate is greater than yLimo have their y coordinates incremented rather than linearly scaled.
pAdjustHandles | 341 | This property specifies an array of adjust handles which allow a user to manipulate the geometry of this shape.
pGuides | 342 | Array of guide formula for the shape which specify how the geometry of the shape changes as the adjust handles are dragged.
pInscribe | 343 | This property specifies an array of rectangles specifying how text should be inscribed within this shape.
fShadowOK | 378 | Shadow may be set
f3DOK | 379 | 3D may be set
fLineOK | 380 | Line style may be set
fGtextOK | 381 | Text effect (WordArt) supported
fFillShadeShapeOK | 382 |
fFillOK | 383 | OK to fill the shape through the UI or VBAs
fillType | 384 | Type of fill
fillColor | 385 | Foreground color
fillOpacity | 386 | Fixed 16.16
fillBackColor | 387 | Background color
fillBackOpacity | 388 | Shades only
fillCrMod | 389 | Modification for BW views
fillBlip | 390 | Pattern/texture
fillBlipName | 391 | Blip file name
fillBlipFlags | 392 | Blip flags
fillWidth | 393 | How big (A units) to make a metafile texture.
fillHeight | 394 |
fillAngle | 395 | Fade angle - degrees in 16.16
fillFocus | 396 | Linear shaded fill focus percent
fillToLeft | 397 | Fraction 16.16
fillToTop | 398 | Fraction 16.16
fillToRight | 399 | Fraction 16.16
fillToBottom | 400 | Fraction 16.16
fillRectLeft | 401 | For shaded fills, use the specified rectangle instead of the shape's bounding rect to define how large the fade is going to be.
fillRectTop | 402 |
fillRectRight | 403 |
fillRectBottom | 404 |
fillDztype | 405 |
fillShadePreset | 406 | Special shades
fillShadeColors | 407 | a preset array of colors
fillOriginX | 408 |
fillOriginY | 409 |
fillShapeOriginX | 410 |
fillShapeOriginY | 411 |
fillShadeType | 412 | Type of shading, if a shaded (gradient) fill.
fFilled | 443 | Is shape filled?
fHitTestFill | 444 | Should we hit test fill?
fillShape | 445 | Register pattern on shape
fillUseRect | 446 | Use the large rect?
fNoFillHitTest | 447 | Hit test a shape as though filled
lineColor | 448 | Color of line
lineOpacity | 449 | Not implemented
lineBackColor | 450 | Background color
lineCrMod | 451 | Modification for BW views
lineType | 452 | Type of line
lineFillBlip | 453 | Pattern/texture
lineFillBlipName | 454 | Blip file name
lineFillBlipFlags | 455 | Blip flags
lineFillWidth | 456 | How big (A units) to make a metafile texture.
lineFillHeight | 457 |
lineFillDztype | 458 | How to interpret fillWidth/Height numbers.
lineWidth | 459 | A units; 1pt == 12700 EMUs
lineMiterLimit | 460 | ratio (16.16) of width
lineStyle | 461 | Draw parallel lines?
lineDashing | 462 | Can be overridden by:
lineDashStyle | 463 | As Win32 ExtCreatePen
lineStartArrowhead | 464 | Arrow at start
lineEndArrowhead | 465 | Arrow at end
lineStartArrowWidth | 466 | Arrow at start
lineStartArrowLength | 467 | Arrow at end
lineEndArrowWidth | 468 | Arrow at start
lineEndArrowLength | 469 | Arrow at end
lineJoinStyle | 470 | How to join lines
lineEndCapStyle | 471 | How to end lines
lineColorExt | 473 | Extended foreground color
fInsetPen | 505 | Inset line.
fInsetPenOK | 506 | Allow inset line if prop. is set
fArrowheadsOK | 507 | Allow arrowheads if prop. is set
fLine | 508 | Any line?
fHitTestLine | 509 | Should we hit test lines?
lineFillShape | 510 | Register pattern on shape
fNoLineDrawDash | 511 | Draw a dashed line if no line
shadowType | 512 | Type of effect
shadowColor | 513 | Foreground color
shadowHighlight | 514 | Embossed color
shadowCrMod | 515 | Modification for BW views
shadowOpacity | 516 | Fixed 16.16
shadowOffsetX | 517 | Offset shadow
shadowOffsetY | 518 | Offset shadow
shadowSecondOffsetX | 519 | Double offset shadow
shadowSecondOffsetY | 520 | Double offset shadow
shadowScaleXToX | 521 | 16.16
shadowScaleYToX | 522 | 16.16
shadowScaleXToY | 523 | 16.16
shadowScaleYToY | 524 | 16.16
shadowPerspectiveX | 525 | 16.16 / weight
shadowPerspectiveY | 526 | 16.16 / weight
shadowWeight | 527 | scaling factor
shadowOriginX | 528 |
shadowOriginY | 529 |
fShadow | 574 | Any shadow?
fshadowObscured | 575 | Excel5-style shadow
perspectiveType | 576 | Where transform applies
perspectiveOffsetX | 577 | The LONG values define a transformation matrix, effectively, each value is scaled by the perspectiveWeight parameter.
perspectiveOffsetY | 578 |
perspectiveScaleXToX | 579 |
perspectiveScaleYToX | 580 |
perspectiveScaleXToY | 581 |
perspectiveScaleYToY | 582 |
perspectivePerspectiveX | 583 |
perspectivePerspectiveY | 584 |
perspectiveWeight | 585 | Scaling factor
perspectiveOriginX | 586 |
perspectiveOriginY | 587 |
fPerspective | 639 | On/off
c3DSpecularAmt | 640 | Fixed-point 16.16
c3DDiffuseAmt | 641 | Fixed-point 16.16
c3DShininess | 642 | Default gives OK results
c3DEdgeThickness | 643 | Specular edge thickness
c3DExtrudeForward | 644 | Distance of extrusion in EMUs
c3DExtrudeBackward | 645 |
c3DExtrudePlane | 646 | Extrusion direction
c3DExtrusionColor | 647 | Basic color of extruded part of shape; the lighting model used will determine the exact shades used when rendering.
c3DCrMod | 648 | Modification for BW views
f3D | 700 | Does this shape have a 3D effect?
fc3DMetallic | 701 | Use metallic specularity?
fc3DUseExtrusionColor | 702 |
fc3DLightFace | 703 |
c3DYRotationAngle | 704 | degrees (16.16) about y axis
c3DXRotationAngle | 705 | degrees (16.16) about x axis
c3DRotationAxisX | 706 | These specify the rotation axis; only their relative magnitudes matter.
c3DRotationAxisY | 707 |
c3DRotationAxisZ | 708 |
c3DRotationAngle | 709 | degrees (16.16) about axis
c3DRotationCenterX | 710 | rotation center x (16.16 or g-units)
c3DRotationCenterY | 711 | rotation center y (16.16 or g-units)
c3DRotationCenterZ | 712 | rotation center z (absolute (emus))
c3DRenderMode | 713 | Full,wireframe, or bcube
c3DTolerance | 714 | pixels (16.16)
c3DXViewpoint | 715 | X view point (emus)
c3DYViewpoint | 716 | Y view point (emus)
c3DZViewpoint | 717 | Z view distance (emus)
c3DOriginX | 718 |
c3DOriginY | 719 |
c3DSkewAngle | 720 | degree (16.16) skew angle
c3DSkewAmount | 721 | Percentage skew amount
c3DAmbientIntensity | 722 | Fixed point intensity
c3DKeyX | 723 | Key light source direction; only their relative
c3DKeyY | 724 | Key light source direction; only their relative
c3DKeyZ | 725 | magnitudes matter
c3DKeyIntensity | 726 | Fixed point intensity
c3DFillX | 727 | Fill light source direction; only their relative
c3DFillY | 728 | Fill light source direction; only their relative
c3DFillZ | 729 | magnitudes matter
c3DFillIntensity | 730 | Fixed point intensity
fc3DConstrainRotation | 763 |
fc3DRotationCenterAuto | 764 |
fc3DParallel | 765 | Parallel projection?
fc3DKeyHarsh | 766 | Is key lighting harsh?
fc3DFillHarsh | 767 |
hspMaster | 769 | master shape
cxstyle | 771 | Type of connector
bWMode | 772 | Settings for modifications to be made when in different forms of black-and-white mode.
bWModePureBW | 773 |
bWModeBW | 774 |
wzEquationXML | 780 | This property is present if the shape represents an equation generated by Office 2007 or later. The property is a string of XML representing a Word 2003 XML document. The original equation is stored within the oMathPara tag within the document.
fOleIcon | 826 | For OLE objects, whether the object is in icon form
fPreferRelativeResize | 827 | For UI only. Prefer relative resizing.
fLockShapeType | 828 | Lock the shape type (don't allow Change Shape)
fInitiator | 829 | Specifies if the shape must be processed by a rules engine.
fDeleteAttachedObject | 830 |
fBackground | 831 | If TRUE, this is the background shape.
spcot | 832 | Callout type (TwoSegment)
dxyCalloutGap | 833 | Distance from box to first point.(EMUs) (1/12 inch)
spcoa | 834 | Callout angle (Any)
spcod | 835 | Callout drop type (Specified)
dxyCalloutDropSpecified | 836 | if msospcodSpecified, the actual drop distance (9 points)
dxyCalloutLengthSpecified | 837 | if fCalloutLengthSpecified, the actual distance (0)
fCallout | 889 | Is the shape a callout? (FALSE)
fCalloutAccentBar | 890 | does callout have accent bar? (FALSE)
fCalloutTextBorder | 891 | does callout have a text border? (TRUE)
fCalloutMinusX | 892 | (FALSE)
fCalloutMinusY | 893 | FALSE
fCalloutDropAuto | 894 | If true, then we occasionally invert the drop distance (FALSE)
fCalloutLengthSpecified | 895 | if true, we look at dxyCalloutLengthSpecified (FALSE)
wzName | 896 | Shape Name (present only if explicitly set)
wzDescription | 897 | Alternate text
pihlShape | 898 | The hyperlink in the shape.
pWrapPolygonVertices | 899 | The polygon that text will be wrapped around (Word)
dxWrapDistLeft | 900 | Left wrapping distance from text (Word)
dyWrapDistTop | 901 | Top wrapping distance from text (Word)
dxWrapDistRight | 902 | Right wrapping distance from text (Word)
dyWrapDistBottom | 903 | Bottom wrapping distance from text (Word)
lidRegroup | 904 | Regroup ID
hyperlinkHint | 909 | Hint used in the hyperlink.
tableRowProperties | 928 | This property specifies the minimum sizes of the rows in a table.
xlsxShapeDefinition | 937 | This record has an xlsx/xml definition of the shape.
fLayoutInCell | 944 | Specifies if the shape is inside a table cell.
fIsBullet | 945 | Specifies if the shape is a bullet.
fStandardHR | 946 | Specifies if the horizontal rule doesn't contain a picture.
fNoshadeHR | 947 | Specifies if a horizontal ruler uses a color without shading.
fHorizRule | 948 | Specifies if the shape is a horizontal ruler.
fUserDrawn | 949 | If true the shape is drawn by the user.
fAllowOverlap | 950 | True if the shape can overlap another shape.
fReallyHidden | 951 | Only applies to script anchors.
fScriptAnchor | 952 | True if shape is a script anchor.
fEditedWrap | 953 | Has the wrap polygon been edited?
fBehindDocument | 954 | Word-only (shape is behind text)
fOnDblClickNotify | 955 | Notify client on a double click
fIsButton | 956 | A button shape (i.e., clicking performs an action). Set for shapes with attached hyperlinks or macros.
fOneD | 957 | 1D adjustment
fHidden | 958 | Do not display
fPrint | 959 | Print this shape
pRelationTbl | 1284 | This property specifies relationships in a diagram.
dgmConstrainBounds | 1288 | Diagram constrain bounds
lineLeftDashStyle | 1359 | Custom dash style of the line.
lineTopDashStyle | 1423 | Custom dash style of the line.
lineRightDashStyle | 1487 | Custom dash style of the line.
lineBottomDashStyle | 1551 | Custom dash style of the line.


TShapeOptionType Enumeration | FlexCel Studio for the .NET Framework documentation

TShapeOptionType Enumeration

Returns the type of option type.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
FixedPoint | 0 | A fixed point number stored as 16.16.
SignedInt | 1 | An integer value.
UnsignedInt | 2 | A positive integer value.
Hyperlink | 3 | An Hyperlink
Bool | 4 | A boolean
String | 5 | A string.
ByteArray | 6 | An array of bytes.
Image | 7 | An image
Unknown | 8 | Unknown property


TShapePresetGuideType Enumeration | FlexCel Studio for the .NET Framework documentation

TShapePresetGuideType Enumeration

Internal use.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
Pr_cd | 0 | m/n of a Circle ('mcdn') - The units here are in 60,000ths of a degree.
Pr_b | 1 | Shape Bottom Edge ('b') - Constant value of "h" This is the bottom edge of the shape and since the top edge of the shape is considered the 0 point, the bottom edge is thus the shape height.
Pr_h | 2 | Shape Height ('h') This is the variable height of the shape defined in the shape properties. This value is received from the shape transform listed within the spPr element.
Pr_hc | 3 | Horizontal Center ('hc') - Calculated value of "*/ w 1.0 2.0" This is the horizontal center of the shape which is just the width divided by 2.
Pr_hd | 4 | 1/n of Shape Height ('hdn') - Calculated value of "*/ h 1.0 n.0" This is 1/n the shape height.
Pr_l | 5 | Shape Left Edge ('l') - Constant value of "0" This is the left edge of the shape and the left edge of the shape is considered the horizontal 0 point.
Pr_ls | 6 | Longest Side of Shape ('ls') - Calculated value of "max w h" This is the longest side of the shape. This value is either the width or the height depending on which is greater.
Pr_r | 7 | Shape Right Edge ('r') - Constant value of "w" This is the right edge of the shape and since the left edge of the shape is considered the 0 point, the right edge is thus the shape width.
Pr_ss | 8 | Shortest Side of Shape ('ss') - Calculated value of "min w h" This is the shortest side of the shape. This value is either the width or the height depending on which is smaller.
Pr_ssd | 9 | 1/n Shortest Side of Shape ('ssdn') - Calculated value of "*/ ss 1.0 n.0"
Pr_t | 10 | Shape Top Edge ('t') - Constant value of "0" This is the top edge of the shape and the top edge of the shape is considered the vertical 0 point.
Pr_vc | 11 | Vertical Center of Shape ('vc') - Calculated value of "*/ h 1.0 2.0" This is the vertical center of the shape which is just the height divided by 2.
Pr_w | 12 | Shape Width ('w') This is the variable width of the shape defined in the shape properties. This value is received from the shape transform listed within the spPr element.
Pr_wd | 13 | 1/n of Shape Width ('wdn') - Calculated value of "*/ w 1.0 n.0" This is 1/n the shape width.


TShapeType Enumeration | FlexCel Studio for the .NET Framework documentation

TShapeType Enumeration

Enumeration with the different shapes.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
NotPrimitive | 0 |
Rectangle | 1 |
RoundRectangle | 2 |
Ellipse | 3 |
Diamond | 4 |
IsocelesTriangle | 5 |
RightTriangle | 6 |
Parallelogram | 7 |
Trapezoid | 8 |
Hexagon | 9 |
Octagon | 10 |
Plus | 11 |
Star | 12 |
Arrow | 13 |
ThickArrow | 14 |
HomePlate | 15 |
Cube | 16 |
Balloon | 17 |
Seal | 18 |
Arc | 19 |
Line | 20 |
Plaque | 21 |
Can | 22 |
Donut | 23 |
TextSimple | 24 |
TextOctagon | 25 |
TextHexagon | 26 |
TextCurve | 27 |
TextWave | 28 |
TextRing | 29 |
TextOnCurve | 30 |
TextOnRing | 31 |
StraightConnector1 | 32 |
BentConnector2 | 33 |
BentConnector3 | 34 |
BentConnector4 | 35 |
BentConnector5 | 36 |
CurvedConnector2 | 37 |
CurvedConnector3 | 38 |
CurvedConnector4 | 39 |
CurvedConnector5 | 40 |
Callout1 | 41 |
Callout2 | 42 |
Callout3 | 43 |
AccentCallout1 | 44 |
AccentCallout2 | 45 |
AccentCallout3 | 46 |
BorderCallout1 | 47 |
BorderCallout2 | 48 |
BorderCallout3 | 49 |
AccentBorderCallout1 | 50 |
AccentBorderCallout2 | 51 |
AccentBorderCallout3 | 52 |
Ribbon | 53 |
Ribbon2 | 54 |
Chevron | 55 |
Pentagon | 56 |
NoSmoking | 57 |
Seal8 | 58 |
Seal16 | 59 |
Seal32 | 60 |
WedgeRectCallout | 61 |
WedgeRRectCallout | 62 |
WedgeEllipseCallout | 63 |
Wave | 64 |
FoldedCorner | 65 |
LeftArrow | 66 |
DownArrow | 67 |
UpArrow | 68 |
LeftRightArrow | 69 |
UpDownArrow | 70 |
IrregularSeal1 | 71 |
IrregularSeal2 | 72 |
LightningBolt | 73 |
Heart | 74 |
PictureFrame | 75 |
QuadArrow | 76 |
LeftArrowCallout | 77 |
RightArrowCallout | 78 |
UpArrowCallout | 79 |
DownArrowCallout | 80 |
LeftRightArrowCallout | 81 |
UpDownArrowCallout | 82 |
QuadArrowCallout | 83 |
Bevel | 84 |
LeftBracket | 85 |
RightBracket | 86 |
LeftBrace | 87 |
RightBrace | 88 |
LeftUpArrow | 89 |
BentUpArrow | 90 |
BentArrow | 91 |
Seal24 | 92 |
StripedRightArrow | 93 |
NotchedRightArrow | 94 |
BlockArc | 95 |
SmileyFace | 96 |
VerticalScroll | 97 |
HorizontalScroll | 98 |
CircularArrow | 99 |
NotchedCircularArrow | 100 |
UturnArrow | 101 |
CurvedRightArrow | 102 |
CurvedLeftArrow | 103 |
CurvedUpArrow | 104 |
CurvedDownArrow | 105 |
CloudCallout | 106 |
EllipseRibbon | 107 |
EllipseRibbon2 | 108 |
FlowChartProcess | 109 |
FlowChartDecision | 110 |
FlowChartInputOutput | 111 |
FlowChartPredefinedProcess | 112 |
FlowChartInternalStorage | 113 |
FlowChartDocument | 114 |
FlowChartMultidocument | 115 |
FlowChartTerminator | 116 |
FlowChartPreparation | 117 |
FlowChartManualInput | 118 |
FlowChartManualOperation | 119 |
FlowChartConnector | 120 |
FlowChartPunchedCard | 121 |
FlowChartPunchedTape | 122 |
FlowChartSummingJunction | 123 |
FlowChartOr | 124 |
FlowChartCollate | 125 |
FlowChartSort | 126 |
FlowChartExtract | 127 |
FlowChartMerge | 128 |
FlowChartOfflineStorage | 129 |
FlowChartOnlineStorage | 130 |
FlowChartMagneticTape | 131 |
FlowChartMagneticDisk | 132 |
FlowChartMagneticDrum | 133 |
FlowChartDisplay | 134 |
FlowChartDelay | 135 |
TextPlainText | 136 |
TextStop | 137 |
TextTriangle | 138 |
TextTriangleInverted | 139 |
TextChevron | 140 |
TextChevronInverted | 141 |
TextRingInside | 142 |
TextRingOutside | 143 |
TextArchUpCurve | 144 |
TextArchDownCurve | 145 |
TextCircleCurve | 146 |
TextButtonCurve | 147 |
TextArchUpPour | 148 |
TextArchDownPour | 149 |
TextCirclePour | 150 |
TextButtonPour | 151 |
TextCurveUp | 152 |
TextCurveDown | 153 |
TextCascadeUp | 154 |
TextCascadeDown | 155 |
TextWave1 | 156 |
TextWave2 | 157 |
TextWave3 | 158 |
TextWave4 | 159 |
TextInflate | 160 |
TextDeflate | 161 |
TextInflateBottom | 162 |
TextDeflateBottom | 163 |
TextInflateTop | 164 |
TextDeflateTop | 165 |
TextDeflateInflate | 166 |
TextDeflateInflateDeflate | 167 |
TextFadeRight | 168 |
TextFadeLeft | 169 |
TextFadeUp | 170 |
TextFadeDown | 171 |
TextSlantUp | 172 |
TextSlantDown | 173 |
TextCanUp | 174 |
TextCanDown | 175 |
FlowChartAlternateProcess | 176 |
FlowChartOffpageConnector | 177 |
Callout90 | 178 |
AccentCallout90 | 179 |
BorderCallout90 | 180 |
AccentBorderCallout90 | 181 |
LeftRightUpArrow | 182 |
Sun | 183 |
Moon | 184 |
BracketPair | 185 |
BracePair | 186 |
Seal4 | 187 |
DoubleWave | 188 |
ActionButtonBlank | 189 |
ActionButtonHome | 190 |
ActionButtonHelp | 191 |
ActionButtonInformation | 192 |
ActionButtonForwardNext | 193 |
ActionButtonBackPrevious | 194 |
ActionButtonEnd | 195 |
ActionButtonBeginning | 196 |
ActionButtonReturn | 197 |
ActionButtonDocument | 198 |
ActionButtonSound | 199 |
ActionButtonMovie | 200 |
HostControl | 201 |
TextBox | 202 |
LineInv | 1000 |
NonIsoscelesTrapezoid | 1001 |
Heptagon | 1002 |
Decagon | 1003 |
Dodecagon | 1004 |
Star6 | 1006 |
Star7 | 1007 |
Star8 | 1008 |
Star10 | 1009 |
Star12 | 1010 |
Round1Rect | 1011 |
Round2SameRect | 1012 |
Round2DiagRect | 1013 |
SnipRoundRect | 1014 |
Snip1Rect | 1015 |
Snip2SameRect | 1016 |
Snip2DiagRect | 1017 |
Teardrop | 1018 |
PieWedge | 1019 |
Pie | 1020 |
RightArrow | 1021 |
LeftCircularArrow | 1022 |
LeftRightCircularArrow | 1023 |
Frame | 1024 |
HalfFrame | 1025 |
Corner | 1026 |
DiagStripe | 1027 |
Chord | 1028 |
Cloud | 1029 |
LeftRightRibbon | 1030 |
Gear6 | 1031 |
Gear9 | 1032 |
Funnel | 1033 |
MathPlus | 1034 |
MathMinus | 1035 |
MathMultiply | 1036 |
MathDivide | 1037 |
MathEqual | 1038 |
MathNotEqual | 1039 |
CornerTabs | 1040 |
SquareTabs | 1041 |
PlaqueTabs | 1042 |
ChartX | 1043 |
ChartStar | 1044 |
ChartPlus | 1045 |
SwooshArrow | 1046 |
Trapezoid2007 | 1047 |
Nil | 4095 |


TSheetCalcMode Enumeration | FlexCel Studio for the .NET Framework documentation

TSheetCalcMode Enumeration

How the file will be calculated by Excel. This enum doesn't affect FlexCel recalculation.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
Manual | 0 | Manual recalculation.
Automatic | 1 | Automatic recalculation.
AutomaticExceptTables | 2 | Automatic recalculation without tables.


TSheetOptions Enumeration | FlexCel Studio for the .NET Framework documentation

TSheetOptions Enumeration

General options for a sheet. In Excel, this settings are located in Tools->Options->View in the "Window options" box. Most of this options can be set with dedicated methods in ExcelFile, but this type allows to set them all at once, or copy them from other file. This options apply only to the active sheet. For options that apply to all the sheets see TSheetWindowOptions

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
None | 0 | No option is selected.
ShowFormulaText | 1 | If 1, Excel will show formula text instead of formula results. This is the same as calling ExcelFile.ShowFormulaText
ShowGridLines | 2 | If 0 Excel will hide the gridlines, if 1 it will show them. This is the same as calling ExcelFile.ShowGridLines
ShowRowAndColumnHeaders | 4 | if 0 Excel will hide the "A", "B"... column headers and "1", "2" ... row Headers. This is the same as calling ExcelFile.ShowGridHeadings
ZeroValues | 16 | If 1 Excel will show formulas with result in 0 as 0. If not, Excel will show formulas that result in 0 as empty. This is the same as calling ExcelFile.HideZeroValues
AutomaticGridLineColors | 32 | If 1, the color of gridlines will be gray. If 0 it will be the color specified at ExcelFile.GridLinesColor. Note that calling ExcelFile.GridLinesColor will automatically set this property to 0.
RightToLeft | 64 | If 1, the sheet is Right to left. This is the same as calling ExcelFile.SheetIsRightToLeft
OutlineSymbols | 128 | If 1, Excel will show the outline symbols (+/-) when there are grouped rows or columns.
PageBreakView | 2048 | If 1 Excel will show the page breaks.


TSheetType Enumeration | FlexCel Studio for the .NET Framework documentation

TSheetType Enumeration

Sheet types

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
Worksheet | 0 | Normal WorkSheet.
Chart | 1 | Chart Sheet
Dialog | 2 | An Excel 5.0 dialog sheet.
Macro | 3 | An Excel 4.0 Macro sheet.
Other | 4 | Something we don't support. It shouldn't happen.


TSheetViewType Enumeration | FlexCel Studio for the .NET Framework documentation

TSheetViewType Enumeration

The page mode of a sheet. You select this in Excel by changing the icons at the bottom right, or from the ribbon, in the "View" tab.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
Normal | 0 | Normal spreadsheet mode.
PageLayout | 1 | A preview of where pages will break when the document is printed.
PageBreakPreview | 2 | Document as it will appear on the printed page.


TSheetWindowOptions Enumeration | FlexCel Studio for the .NET Framework documentation

TSheetWindowOptions Enumeration

General options for how sheets display. In Excel, this settings are located in Tools->Options->View in the "Window options" box. This options apply only to all the sheets. For options that apply only to the active sheet see TSheetOptions

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
None | 0 | No option is selected.
HideWindow | 1 | If true, the workbook window will be hidden. You will need to go to Window->Unhide to see it.
MinimizeWindow | 2 | If true, the workbook window will be minimized.
ShowHorizontalScrollBar | 8 | If false, the horizontal scroll bar will be hidden.
ShowVerticalScrollBar | 16 | If false, the vertical scroll bar will be hidden.
ShowSheetTabBar | 32 | If false, the bar with sheet names at the bottom will be hidden.


TSortFormulaMode Enumeration | FlexCel Studio for the .NET Framework documentation

TSortFormulaMode Enumeration

Defines how FlexCel will sort a range of cells, when you call XlsFile.Sort. You will normally want to specify "MoveFormulas", but for huge amounts of data where you know formulas won't matter, you might choose the "ExcelLike" mode. Note that Excel itself doesn't adapt correctly the formulas when sorting, and it works like the ExcelLike mode.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
MoveFormulas | 0 | All formulas will remain pointing to the right places after the sort. This is the correct thing to do, and you will normally want to use this mode, unless it is too slow.
ExcelLike | 1 | Formulas that are outside the range being sorted won't change. So if you are sorting for example the range A1:B10, and have a formula in A20: = A1, after sorting A20 will still be A1, and not reference the cell it used to reference. Formulas inside the range being sorted that point to different rows will not keep pointing to the same row. If for example in A1 you have =A2 and the sorting moves row 1 to 5, then the formula will be =A6, instead of pointing to the place where row 2 moved. This method is faster than the "MoveFormulas" approach, and it is the method Excel itself uses. If you don't have formulas pointing to other places in the row being moved, this method can be much faster.


TSortOrder Enumeration | FlexCel Studio for the .NET Framework documentation

TSortOrder Enumeration

The sort order for a sort operation.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
Ascending | 0 | Sort ascending.
Descending | 1 | Sort descending.


TStackedMode Enumeration | FlexCel Studio for the .NET Framework documentation

TStackedMode Enumeration

Way the series stack one to the other. This does not apply to all chart types.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
Standard | 0 | Data is not Stacked. Each series is drawn after the other along the z-axis.
Clustered | 1 | Data is not Stacked. Each series is drawn after the other along the x/y-axis. If only applies to bar or column charts, where each bar is drawn one after the other around the axis. A 3D bar chart can be either standard (where each bar is drawn along the z axis), or Clustered (where each bar is drawn along the x axis).
Stacked | 2 | Data is Stacked. (for example in stacked bar chart)
Stacked100 | 3 | Data is stacked and normalized to 100%. (This is a 100% stacked bar/column chart)


TStructRefSection Enumeration | FlexCel Studio for the .NET Framework documentation

TStructRefSection Enumeration

This enum contains the possible values that can go into a structured reference. You can combine multiple values, but not all combinations make sense. For example #Data + #Headers it fine, but #All + #Headers is just #All.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
None | 0 | Nothing.
All | 1 | The structured reference applies to the whole table. This is equivalent to [#All].
Headers | 2 | The structured reference applies to the headers of the table. This is equivalent to [#Headers].
Data | 4 | The structured reference applies to data (all the table without headers or totals) of the table. This is equivalent to [#Data].
Totals | 8 | The structured reference applies to the totals row of the table. This is equivalent to [#Totals].
ThisRow | 16 | The structured reference applies to the row of the table where the reference is. This is equivalent to @ or [#This row].


TStyleCategory Enumeration | FlexCel Studio for the .NET Framework documentation

TStyleCategory Enumeration

Category to which a cell style belongs. This is only valid for Excel 2007 or newer.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
Custom | 0 | Custom style.
GoodBadNeutral | 1 | Good, bad, neutral style.
DataModel | 2 | Data model style.
TitleHeading | 3 | Title and heading style.
ThemedCell | 4 | Themed cell style. (ACCENT styles)
NumberFormat | 5 | Number format style.


TSVGExportType Enumeration | FlexCel Studio for the .NET Framework documentation

TSVGExportType Enumeration

Customized what data will be included in an svg file.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
All | 0 | The SVG created will have everything, including the xml declaration and the svg tag.
NoXmlDeclaration | 1 | The SVG created will not have an xml declaration. Use this one to embed the svg in other documents.


TSystemColor Enumeration | FlexCel Studio for the .NET Framework documentation

TSystemColor Enumeration

System colors.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
None | 0 | Color is not specified.
DkShadow3d | 1 | Specifies a Dark shadow color for three-dimensional display elements.
Light3d | 2 | Specifies a Light color for three-dimensional display elements (for edges facing the light source).
ActiveBorder | 3 | Specifies an Active Window Border Color.
ActiveCaption | 4 | Specifies the active window title bar color. In particular the left side color in the color gradient of an active window's title bar if the gradient effect is enabled.
AppWorkspace | 5 | Specifies the Background color of multiple document interface (MDI) applications.
Background | 6 | Specifies the desktop background color.
BtnFace | 7 | Specifies the face color for three-dimensional display elements and for dialog box backgrounds.
BtnHighlight | 8 | Specifies the highlight color for three-dimensional display elements (for edges facing the light source).
BtnShadow | 9 | Specifies the shadow color for three-dimensional display elements (for edges facing away from the light source).
BtnText | 10 | Specifies the color of text on push buttons.
CaptionText | 11 | Specifies the color of text in the caption, size box, and scroll bar arrow box.
GradientActiveCaption | 12 | Specifies the right side color in the color gradient of an active window's title bar.
GradientInactiveCaption | 13 | Specifies the right side color in the color gradient of an inactive window's title bar.
GrayText | 14 | Specifies a grayed (disabled) text. This color is set to 0 if the current display driver does not support a solid gray color.
Highlight | 15 | Specifies the color of Item(s) selected in a control.
HighlightText | 16 | Specifies the text color of item(s) selected in a control.
HotLight | 17 | Specifies the color for a hyperlink or hot-tracked item.
InactiveBorder | 18 | Specifies the color of the Inactive window border.
InactiveCaption | 19 | Specifies the color of the Inactive window caption. Specifies the left side color in the color gradient of an inactive window's title bar if the gradient effect is enabled.
InactiveCaptionText | 20 | Specifies the color of text in an inactive caption.
InfoBk | 21 | Specifies the background color for tooltip controls.
InfoText | 22 | Specifies the text color for tooltip controls.
Menu | 23 | Specifies the menu background color.
MenuBar | 24 | Specifies the background color for the menu bar when menus appear as flat menus.
MenuHighlight | 25 | Specifies the color used to highlight menu items when the menu appears as a flat menu.
MenuText | 26 | Specifies the color of Text in menus.
ScrollBar | 27 | Specifies the scroll bar gray area color.
Window | 28 | Specifies window background color.
WindowFrame | 29 | Specifies the window frame color.
WindowText | 30 | Specifies the color of text in windows.


TTableStyleType Enumeration | FlexCel Studio for the .NET Framework documentation

TTableStyleType Enumeration

Defines the part of the table for which a tablestyle applies.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
WholeTable | 0 |
HeaderRow | 1 |
TotalRow | 2 |
FirstColumn | 3 |
LastColumn | 4 |
FirstRowStripe | 5 |
SecondRowStripe | 6 |
FirstColumnStripe | 7 |
SecondColumnStripe | 8 |
FirstHeaderCell | 9 |
LastHeaderCell | 10 |
FirstTotalCell | 11 |
LastTotalCell | 12 |
FirstSubtotalColumn | 13 |
SecondSubtotalColumn | 14 |
ThirdSubtotalColumn | 15 |
FirstSubtotalRow | 16 |
SecondSubtotalRow | 17 |
ThirdSubtotalRow | 18 |
BlankRow | 19 |
FirstColumnSubheading | 20 |
SecondColumnSubheading | 21 |
ThirdColumnSubheading | 22 |
FirstRowSubheading | 23 |
SecondRowSubheading | 24 |
ThirdRowSubheading | 25 |
PageFieldLabels | 26 |
PageFieldValues | 27 |


TTextHorzOverflow Enumeration | FlexCel Studio for the .NET Framework documentation

TTextHorzOverflow Enumeration

How the text in a shape will overflow horizontally once there is no more room for it.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
Overflow | 0 | Text will not be clipped, and it will overflow outside the shape.
Clip | 1 | Text will be clipped, and there will be no indication that there is more text outside the area.


TTextRotation Enumeration | FlexCel Studio for the .NET Framework documentation

TTextRotation Enumeration

Text direction for objects like comments, that allow rotation, but only in 90 degrees.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
Normal | 0 | Text is not rotated.
Rotated90Degrees | 1 | Text is rotated 90 degrees counterclockwise.
RotatedMinus90Degrees | 2 | Text is rotated 90 degrees clockwise.
Vertical | 3 | Text is written in vertical layout, a character below the other.


TTextVertOverflow Enumeration | FlexCel Studio for the .NET Framework documentation

TTextVertOverflow Enumeration

How the text in a shape will overflow vertically once there is no more room for it. Note that from the Excel UI, you can only set both Vert overflow and Horizontal overflow at the same time.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
Overflow | 0 | Text will not be clipped, and it will overflow outside the shape.
Clip | 1 | Text will be clipped, and there will be no indication that there is more text outside the area.
Ellipsis | 2 | Text will be clipped, but there will be an ellipsis to indicate that the text continues after the clip.


TThemeColor Enumeration | FlexCel Studio for the .NET Framework documentation

TThemeColor Enumeration

Specifies one of the 12 theme colors, or one of the 4 semantic colors. In cells, Excel doesn't use semantic colors, but in drawings they can be used, even if the Excel UI only allows one type of color.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
None | -1 | No theme color.
Light1 | 0 | Main color for backgrounds in Theme. Normally it is better to use the semantic variation of this theme: Background1.
Dark1 | 1 | Main color for foregrounds in Theme. Normally it is better to use the semantic variation of this theme: Foreground1.
Light2 | 2 | Secondary color for backgrounds in Theme. Normally it is better to use the semantic variation of this theme: Background2.
Dark2 | 3 | Secondary color for foregrounds in Theme. Normally it is better to use the semantic variation of this theme: Foreground2.
Accent1 | 4 | Accent1 Theme.
Accent2 | 5 | Accent2 Theme.
Accent3 | 6 | Accent3 Theme.
Accent4 | 7 | Accent4 Theme.
Accent5 | 8 | Accent5 Theme.
Accent6 | 9 | Accent6 Theme.
HyperLink | 10 | HyperLink Theme.
FollowedHyperLink | 11 | FollowedHyperLink Theme.
Background1 | 256 | Primary semantic color for the background. This color isn't a real theme color and normally it is mapped to Light1. In cells it doesn't matter what you use: Background1 or Light1 as both are mapped internally to Light1. But in drawings Excel allows both types of themes even if they normally are the same.
Foreground1 | 257 | Primary semantic color for the foreground. This color isn't a real theme color and normally it is mapped to Dark1. In cells it doesn't matter what you use: Forground1 or Dark1 as both are mapped internally to Dark1. But in drawings Excel allows both types of themes even if they normally are the same.
Background2 | 258 | Secondary semantic color for the background. This color isn't a real theme color and normally it is mapped to Light2. In cells it doesn't matter what you use: Background2 or Light2 as both are mapped internally to Light2. But in drawings Excel allows both types of themes even if they normally are the same.
Foreground2 | 259 | Secondary semantic color for the foreground. This color isn't a real theme color and normally it is mapped to Dark2. In cells it doesn't matter what you use: Forground2 or Dark2 as both are mapped internally to Dark2. But in drawings Excel allows both types of themes even if they normally are the same.


TTickType Enumeration | FlexCel Studio for the .NET Framework documentation

TTickType Enumeration

Ticks for an axis.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
None | 0 | No Ticks.
Inside | 1 | Inside axis line.
Outside | 2 | Outside axis line.
Cross | 3 | Crosses the axis line.


TTimePeriod Enumeration | FlexCel Studio for the .NET Framework documentation

TTimePeriod Enumeration

A time period for conditional format.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
Today | 0 | Today.
Yesterday | 1 | Yesterday.
Tomorrow | 2 | Tomorrow.
Last7Days | 3 | Last7Days.
ThisMonth | 4 | ThisMonth.
LastMonth | 5 | LastMonth.
NextMonth | 6 | NextMonth.
ThisWeek | 7 | ThisWeek.
LastWeek | 8 | LastWeek.
NextWeek | 9 | NextWeek.


TTokenType Enumeration | FlexCel Studio for the .NET Framework documentation

TTokenType Enumeration

Enumerates the different kind of tokens you can find in a formula

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
CellAddress | 0 | A single cell address in the same sheet or to other sheet. See also CellRange for other tokens that can contain addresses.
RelativeCellAddress | 1 | A cell address relative to the cell where the formula is. This token is used mostly in names.
CellRange | 2 | A range of cells. See CellAddress for single cell references.
RelativeCellRange | 3 | A cell range relative to the cell where the formula is. This token is used mostly in names.
FunctionToken | 4 | A function like "Sum" or "If"
OperatorToken | 5 | An operator like "+" or "-"
RangeOp | 6 | Operator in ranges, like "Union" or "Intersection"
Whitespace | 7 | Whitespace like " "
Parenthesis | 8 | A parenthesis surrounding the last token. Note that this token is not used in the formula (since RPN doesn't need parenthesis) but it is there so Excel can display them.
Name | 9 | A named range
Data | 10 | Constant data, like "Hello" and 1 in the formula: "=IF(A1 = 1,,"Hello")"
DataArray | 11 | An array of constant data.
MissingArgument | 12 | A missing argument for a function. For example the second parameter in the formula: "=IF(A1 = 1,,"Hello")"
ReferenceError | 13 | A token representing a reference to a cell or range that doesn't exist.
StructuredReference | 14 | A reference to a Table.
LambdaCallName | 15 | When you call a name like "=MyName(5)" and MyName has a lambda function.
LambdaParameterReference | 16 | A reference to a parameter inside a LET or LAMBDA function.
LambdaParameterDefinition | 17 | A definition of a parameter inside a LET or LAMBDA function.
Unsupported | 18 | This token is not supported by FlexCel.


TTokenWhitespaceCharacter Enumeration | FlexCel Studio for the .NET Framework documentation

TTokenWhitespaceCharacter Enumeration

Character used in the whitespace.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
Space | 0 | Whitespace consists of character 32 (space).
LineFeed | 1 | Whitespace consists of character 10 (line feed).


TTokenWhitespacePosition Enumeration | FlexCel Studio for the .NET Framework documentation

TTokenWhitespacePosition Enumeration

Specifies where the whitespace is added in relation to the next token.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
BeforeToken | 0 | This is the normal case. Whitespace is added before the next token. The only case where this option is not used is in the case of parentheses.
BeforeOpenParenthesis | 1 | A parenthesis token covers 2 different parentheses: the open and close ones. So for parentheses, we need 2 different cases for whitespace. BeforeOpenParenthesis is for the spaces before the opening parenthesis. You would use it for example in the formula '= ("hello")'
BeforeClosingParenthesis | 2 | A parenthesis token covers 2 different parentheses: the open and close ones. So for parentheses, we need 2 different cases for whitespace. BeforeClosingParenthesis is for the spaces before the closing parenthesis. You would use it for example in the formula '=("hello" )'


TTotalsRowFunction Enumeration | FlexCel Studio for the .NET Framework documentation

TTotalsRowFunction Enumeration

Type of function used to summarize a table column.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
None | 0 | No total row.
Sum | 1 | Sum of the values.
Min | 2 | Minimum value of the column.
Max | 3 | Maximum value of the column.
Average | 4 | Mean value of the column.
Count | 5 | Count of non-empty cells in the column.
CountNums | 6 | Count of cells that contain numbers.
StdDev | 7 | Standard deviation for the column.
Variance | 8 | Variance for the column.
Custom | 9 | A custom function that is determined by a formula.


TUIDashStyle Enumeration | FlexCel Studio for the .NET Framework documentation

TUIDashStyle Enumeration

Platform independent line style.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
Solid | 0 | Specifies a solid line.
Dot | 1 | Specifies a line consisting of dots.
SmallDash | 2 | Specifies a line consisting of small dashes, smaller than dashes but longer than dots.
Dash | 3 | Specifies a line consisting of dashes.
DashDot | 4 | Specifies a line consisting of a repeating pattern of dash-dot.
LongDash | 5 | Specifies a line consisting of big dashes.
LongDashDot | 6 | Specifies a line consisting of a repeating pattern of large dashes and dots.
LongDashDotDot | 7 | Specifies a line consisting of a repeating pattern of large dash-dot-dot.


TUIFontStyle Enumeration | FlexCel Studio for the .NET Framework documentation

TUIFontStyle Enumeration

The different styles a font can have.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
Regular | 0 | Normal Font.
Bold | 1 | Bold Font.
Italic | 2 | Italic Font.


TUIHatchStyle Enumeration | FlexCel Studio for the .NET Framework documentation

TUIHatchStyle Enumeration

Specifies the different patterns available.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
Horizontal | 0 | A pattern of horizontal lines.
Vertical | 1 | A pattern of vertical lines.
ForwardDiagonal | 2 | A pattern of lines on a diagonal from upper left to lower right.
BackwardDiagonal | 3 | A pattern of lines on a diagonal from upper right to lower left.
Cross | 4 | Specifies horizontal and vertical lines that cross.
DiagonalCross | 5 | A pattern of crisscross diagonal lines.
Percent05 | 6 | Specifies a 5-percent hatch. The ratio of foreground color to background color is 5:95.
Percent10 | 7 | Specifies a 10-percent hatch. The ratio of foreground color to background color is 10:90.
Percent20 | 8 | Specifies a 20-percent hatch. The ratio of foreground color to background color is 20:80.
Percent25 | 9 | Specifies a 25-percent hatch. The ratio of foreground color to background color is 25:75.
Percent30 | 10 | Specifies a 30-percent hatch. The ratio of foreground color to background color is 30:70.
Percent40 | 11 | Specifies a 40-percent hatch. The ratio of foreground color to background color is 40:60.
Percent50 | 12 | Specifies a 50-percent hatch. The ratio of foreground color to background color is 50:50.
Percent60 | 13 | Specifies a 60-percent hatch. The ratio of foreground color to background color is 60:40.
Percent70 | 14 | Specifies a 70-percent hatch. The ratio of foreground color to background color is 70:30.
Percent75 | 15 | Specifies a 75-percent hatch. The ratio of foreground color to background color is 75:25.
Percent80 | 16 | Specifies a 80-percent hatch. The ratio of foreground color to background color is 80:100.
Percent90 | 17 | Specifies a 90-percent hatch. The ratio of foreground color to background color is 90:10.
LightDownwardDiagonal | 18 |
LightUpwardDiagonal | 19 |
DarkDownwardDiagonal | 20 |
DarkUpwardDiagonal | 21 |
WideDownwardDiagonal | 22 |
WideUpwardDiagonal | 23 |
LightVertical | 24 |
LightHorizontal | 25 |
NarrowVertical | 26 |
NarrowHorizontal | 27 |
DarkVertical | 28 |
DarkHorizontal | 29 |
DashedDownwardDiagonal | 30 |
DashedUpwardDiagonal | 31 |
DashedHorizontal | 32 |
DashedVertical | 33 |
SmallConfetti | 34 | Specifies a hatch that has the appearance of confetti.
LargeConfetti | 35 |
ZigZag | 36 | Specifies horizontal lines that are composed of zigzags.
Wave | 37 | Specifies horizontal lines that are composed of tildes.
DiagonalBrick | 38 |
HorizontalBrick | 39 | Specifies a hatch that has the appearance of horizontally layered bricks.
Weave | 40 | Specifies a hatch that has the appearance of a woven material.
Plaid | 41 | Specifies a hatch that has the appearance of a plaid material.
Divot | 42 | Specifies a hatch that has the appearance of divots.
DottedGrid | 43 |
DottedDiamond | 44 |
Shingle | 45 | that slant to the right from top points to bottom points.
Trellis | 46 | Specifies a hatch that has the appearance of a trellis.
Sphere | 47 | Specifies a hatch that has the appearance of spheres laid adjacent to one another.
SmallGrid | 48 |
SmallCheckerBoard | 49 | Specifies a hatch that has the appearance of a checkerboard.
LargeCheckerBoard | 50 |
OutlinedDiamond | 51 |
SolidDiamond | 52 | Specifies a hatch that has the appearance of a checkerboard placed diagonally.


TUIStrikeout Enumeration | FlexCel Studio for the .NET Framework documentation

TUIStrikeout Enumeration

Defines if the text is stroke out. Currently there is only an style of strike out, which is a single strikeout.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
None | 0 | Text is not stroke out.
Single | 1 | Text has a single strike.


TUIUnderline Enumeration | FlexCel Studio for the .NET Framework documentation

TUIUnderline Enumeration

Type of underline in the text.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
None | 0 | No underline.
Single | 1 | Single underline.
Double | 2 | Double underline.


TUnsupportedFormulaErrorType Enumeration | FlexCel Studio for the .NET Framework documentation

TUnsupportedFormulaErrorType Enumeration

Types of error that might happen while recalculating.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
FormulaTooComplex | 0 | FlexCel was not able to parse the formula.
MissingFunction | 1 | There is a function on the formula that is not implemented by FlexCel.
FunctionalityNotImplemented | 2 | The function is supported, but not with those arguments.
CircularReference | 3 | There is a circular reference on this cell.
ExternalReference | 4 | The file in the external reference was not found.


TUserDefinedFunctionLocation Enumeration | FlexCel Studio for the .NET Framework documentation

TUserDefinedFunctionLocation Enumeration

Defines where the custom function is located, if inside a macro in the same file, or inside a macro in an external file.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
External | 0 | The custom function is defined in an external file or addin. Whenever you add this function to a workbook, references will be created to an external function.
Internal | 1 | The custom function is defined inside the same file where the formula is. Whenever you add this function to a workbook, references will be created to a macro in the same file.


TUserDefinedFunctionScope Enumeration | FlexCel Studio for the .NET Framework documentation

TUserDefinedFunctionScope Enumeration

Defines how custom functions are added to the recalculation engine. If a function is defined in both Global and Local scope, Local scope will be used.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
Global | 0 | Function will be added for all instances of FlexCel. You will normally use this setting only once at the beginning of your application.
Local | 1 | Functions will be available only for the instance where they were added. Use this option if you might have different custom functions with the same name in different spreadsheets, and adding the function globally would clash. You will normally use this setting when adding the formulas after creating the ExcelFile instances.


TValueAxisOptions Enumeration | FlexCel Studio for the .NET Framework documentation

TValueAxisOptions Enumeration

Options for a Value Axis.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
None | 0 | All magnitudes will be manual.
AutoMin | 1 | Use automatic minimum.
AutoMax | 2 | Use automatic maximum.
AutoMajor | 4 | Use automatic major units.
AutoMinor | 8 | Use automatic minor units.
AutoCross | 16 | Use automatic crossing point.
LogScale | 32 | Use logarithmic scale.
Reverse | 64 | Values will be in reverse order.
MaxCross | 128 | The category Axis will cross at the maximum value.


TVFlxAlignment Enumeration | FlexCel Studio for the .NET Framework documentation

TVFlxAlignment Enumeration

Vertical Alignment on a cell.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
top | 0 | Aligned to the top.
center | 1 | Vertically centered on the cell.
bottom | 2 | Aligned to the bottom.
justify | 3 | Justified on the cell.
distributed | 4 | Distributed on the cell.


TXlsBiffVersion Enumeration | FlexCel Studio for the .NET Framework documentation

TXlsBiffVersion Enumeration

The specific Excel version that FlexCel will emulate when reading and saving files.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
Excel2007 | 0 | FlexCel will identify itself as Excel 2007 in the generated xls files.
Excel2003 | 1 | FlexCel will identify itself as Excel 2003 in the generated xls files. It will also ignore the extra information written by Excel 2007 when reading xls files created with it.


TXlsImgType Enumeration | FlexCel Studio for the .NET Framework documentation

TXlsImgType Enumeration

Possible image types on an excel sheet.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
Emf | 0 | Enhanced Windows Metafile. This is a Vectorial image format. It is only rendered when using a GDI+ graphics backend (That is "classic" .NET framework or .NET 5+ in Windows with FlexCelConfig.GraphicFramework set to native. ).
Wmf | 1 | Windows Metafile. This is a Vectorial image format. It is only rendered when using a GDI+ graphics backend (That is "classic" .NET framework or .NET 5+ in Windows with FlexCelConfig.GraphicFramework set to native. ).
Jpeg | 2 | JPEG Image. This is a lossy compressed bitmap, best suited for photos.
Png | 3 | Portable Network Graphics. This is a lossless compressed bitmap, best suited for text.
Bmp | 4 | Windows Bitmap. As this is not compressed, don't use it except for really small images.
Pict | 5 | Macintosh PICT. This won't be rendered by FlexCel, and you shouldn't add images in this format. This file format was used in the original macOS, and has been deprecated since OSX.
Tiff | 6 | Tiff Image: http://partners.adobe.com/public/developer/tiff/index.html#spec This is NOT supported in xls file format, only xlsx. It is only rendered when using a GDI+ graphics backend (That is "classic" .NET framework or .NET 5+ in Windows with FlexCelConfig.GraphicFramework set to native. ).
Gif | 7 | Gif Image. This is NOT supported in xls file format, only xlsx. It is reasonably supported in graphics backends, but whenever possible you should prefer using PNGs. Almost the only use case for gif images is for animated gifs.
Svg | 8 | SVG Image. This is a vectorial vector, only supported in Excel 2019+ or Excel 365. As older Excels don't support SVG, Excel saves both a PNG image for them and an SVG image for the newer formats. When adding an SVG with the API, you need to supply both the SVG and the backup PNG. For more information see S V G Files Inside Xlsx Files.
Unknown | 9 | Unsupported image format.


TXlsSheetVisible Enumeration | FlexCel Studio for the .NET Framework documentation

TXlsSheetVisible Enumeration

Sheet visibility.

Syntax

Namespace: FlexCel.Core

Members

Name | Value | Description
Hidden | 0 | Sheet is hidden, can be shown by the user with excel.
VeryHidden | 1 | Sheet is hidden, only way to show it is with a macro. (user can't see it with excel)
Visible | 2 | Sheet is visible to the user.


CultureCreatingEventHandler Delegate | FlexCel Studio for the .NET Framework documentation

CultureCreatingEventHandler Delegate

Delegate for CultureCreating events. Return null to use the culture that would have been used had this event not be assigned.

Syntax

Namespace: FlexCel.Core

public delegate void CultureCreatingEventHandler(CultureCreatingEventArgs e)

Parameters

<-> | Parameter | Type | Description
 | e | CultureCreating​Event​Args |


FlexCelErrorEventHandler Delegate | FlexCel Studio for the .NET Framework documentation

FlexCelErrorEventHandler Delegate

Delegate for ErrorInfo events.

Syntax

Namespace: FlexCel.Core

public delegate void FlexCelErrorEventHandler(TFlexCelErrorInfo e)

Parameters

<-> | Parameter | Type | Description
 | e | TFlexCelErrorInfo |


FontCreatedEventHandler Delegate | FlexCel Studio for the .NET Framework documentation

FontCreatedEventHandler Delegate

Delegate for FontCreated events.

Syntax

Namespace: FlexCel.Core

public delegate void FontCreatedEventHandler(FontCreatedEventArgs e)

Parameters

<-> | Parameter | Type | Description
 | e | FontCreatedEventArgs |


FontCreatingEventHandler Delegate | FlexCel Studio for the .NET Framework documentation

FontCreatingEventHandler Delegate

Delegate for FontCreating events.

Syntax

Namespace: FlexCel.Core

public delegate void FontCreatingEventHandler(FontCreatingEventArgs e)

Parameters

<-> | Parameter | Type | Description
 | e | FontCreating​Event​Args |


HtmlFontEventHandler Delegate | FlexCel Studio for the .NET Framework documentation

HtmlFontEventHandler Delegate

Delegate used to specify which fonts to use on a page.

Syntax

Namespace: FlexCel.Core

public delegate void HtmlFontEventHandler(Object sender, HtmlFontEventArgs e)

Parameters

<-> | Parameter | Type | Description
 | sender | Object |
 | e | HtmlFontEventArgs |


LoadLinkedFileEventHandler Delegate | FlexCel Studio for the .NET Framework documentation

LoadLinkedFileEventHandler Delegate

Delegate for LoadLinkedFile event.

Syntax

Namespace: FlexCel.Core

public delegate void LoadLinkedFileEventHandler(Object sender, LoadLinkedFileEventArgs e)

Parameters

<-> | Parameter | Type | Description
 | sender | Object |
 | e | LoadLinkedFile​Event​Args |


OnPasswordEventHandler Delegate | FlexCel Studio for the .NET Framework documentation

OnPasswordEventHandler Delegate

This event fires when opening an encrypted file and no password has been supplied.

Syntax

Namespace: FlexCel.Core

public delegate void OnPasswordEventHandler(OnPasswordEventArgs e)

Parameters

<-> | Parameter | Type | Description
 | e | OnPasswordEventArgs |


OnSheetNameEventHandler Delegate | FlexCel Studio for the .NET Framework documentation

OnSheetNameEventHandler Delegate

Delegate used to specify which name to use for every sheet when exporting multiple sheets to multiple files.

Syntax

Namespace: FlexCel.Core

public delegate void OnSheetNameEventHandler(Object sender, OnSheetNameEventArgs e)

Parameters

<-> | Parameter | Type | Description
 | sender | Object |
 | e | OnSheetNameEventArgs |


VirtualCellEndReadingEventHandler Delegate | FlexCel Studio for the .NET Framework documentation

VirtualCellEndReadingEventHandler Delegate

Delegate for virtual cell reads. This delegate is called after the full file has been read.

Syntax

Namespace: FlexCel.Core

public delegate void VirtualCellEndReadingEventHandler(Object sender, VirtualCellEndReadingEventArgs e)

Parameters

<-> | Parameter | Type | Description
 | sender | Object | Excel file that has been loaded. At the time this event is called, it is fully loaded.
 | e | VirtualCellEnd​Reading​Event​Args | Arguments for the event.


VirtualCellReadEventHandler Delegate | FlexCel Studio for the .NET Framework documentation

VirtualCellReadEventHandler Delegate

Delegate for virtual cell reads.

Syntax

Namespace: FlexCel.Core

public delegate void VirtualCellReadEventHandler(Object sender, VirtualCellReadEventArgs e)

Parameters

<-> | Parameter | Type | Description
 | sender | Object | Excel file from where we are reading. Remember that the file is not fully loaded when this event is called, so you are not likely to be able to use this parameter.
 | e | VirtualCellRead​Event​Args | Contains the value of the cell we are reading.


VirtualCellStartReadingEventHandler Delegate | FlexCel Studio for the .NET Framework documentation

VirtualCellStartReadingEventHandler Delegate

Delegate for virtual cell reads. It is called before we start reading the file, but after sheet names are known.

Syntax

Namespace: FlexCel.Core

public delegate void VirtualCellStartReadingEventHandler(Object sender, VirtualCellStartReadingEventArgs e)

Parameters

<-> | Parameter | Type | Description
 | sender | Object | Excel file from where we are reading. Remember that the file is not fully loaded when this event is called, so you are not likely to be able to use this parameter.
 | e | VirtualCellStart​Reading​Event​Args | Arguments for the event.


FlexCel.Draw Namespace | FlexCel Studio for the .NET Framework documentation

FlexCel.Draw Namespace

This namespace encapsulates native drawing routines for each platform FlexCel supports, in a cross platform way.

Classes

Name | Description
FloydSteinbergDither | Converts a true color image to black and white using Floyd-Steinberg dithering. Needs UNMANAGED permissions in order to process the bits of the image.
GdipBitmapConstructor | An utility class to create bitmaps and wrap the error in a FlexCelException. Internal use.
OctreeQuantizer | Reduce the number of colors of an image. This class needs UNMANAGED permissions in order to be able to modify the bits in the image.
Quantizer | A generic implementation for any Color Quantizer.
TGdipUIFont | Represents a font used for drawing in a pdf/gdi+/wpf/winrt canvas.
TGdipUIGraphics | An implementation of a GDI+ Graphics.
TGdipUIHatchBrush | A GDI+ Hatch brush.
TGdipUIImage | Encapsulation of a System.​Drawing.​Image.​
TGdipUIImage​Attributes | Class encapsulating GDI+ image attributes.
TGdipUILinear​Gradient​Brush | A class encapsulating a GDI+ linear gradient.
TGdipUIMulti​Page​Parameters | Parameters for GDI+
TGdipUIPathGradient​Brush | Class encapsulating a GDI+ Path gradient.
TGdipUIPen | Encapsulation of a GDI+ pen
TGdipUISolidBrush | Encapsulates a native solid brush.
TGdipUITextureBrush | An encapsulation of a GDI+ TextureBrush.

Interfaces

Name | Description
IGdipUIBrush | Allows to get the handle of the actual GDI+ brush for all the different brushes.


FloydSteinbergDither Class | FlexCel Studio for the .NET Framework documentation

FloydSteinbergDither Class

Converts a true color image to black and white using Floyd-Steinberg dithering. Needs UNMANAGED permissions in order to process the bits of the image.

Syntax

Namespace: FlexCel.Draw

public static class FloydSteinbergDither

Methods

Name | Description
ConvertToBlack​AndWhite | Overloaded ConvertToBlackAndWhite(Bitmap, Bitmap) ConvertToBlackAndWhite(Bitmap)


FloydSteinbergDither.ConvertToBlackAndWhite Method | FlexCel Studio for the .NET Framework documentation

FloydSteinbergDither.ConvertToBlackAndWhite Method

Overloads

  • FloydSteinbergDither.ConvertToBlackAndWhite(Bitmap, Bitmap)
  • FloydSteinbergDither.ConvertToBlackAndWhite(Bitmap)

FloydSteinbergDither.ConvertToBlackAndWhite(Bitmap, Bitmap)

Converts a true color image to black and white, using Floyd-Steinberg error diffusion.

Syntax

Namespace: FlexCel.Draw

public static void ConvertToBlackAndWhite(Bitmap Source, Bitmap Result)

Parameters

<-> | Parameter | Type | Description
 | Source | Bitmap | Image to convert. Must be on Format32bppPArgb.
 | Result | Bitmap | Here we will draw the converted image. Must be Format1bppIndexed and have the same size as Source.

See also

  • FloydSteinbergDither

FloydSteinbergDither.ConvertToBlackAndWhite(Bitmap)

Converts a true color image to black and white, using Floyd-Steinberg error diffusion.

Syntax

Namespace: FlexCel.Draw

public static Bitmap ConvertToBlackAndWhite(Bitmap Source)

Parameters

<-> | Parameter | Type | Description
 | Source | Bitmap | The image we want to convert. Must be on Format32bppPArgb

Returns

The converted black and white image.

See also

  • FloydSteinbergDither


GdipBitmapConstructor Class | FlexCel Studio for the .NET Framework documentation

GdipBitmapConstructor Class

An utility class to create bitmaps and wrap the error in a FlexCelException. Internal use.

Syntax

Namespace: FlexCel.Draw

public static class GdipBitmapConstructor

Methods

Name Description
CreateBitmap Overloaded
 CreateBitmap(Int32, Int32)
CreateBitmap(Int32, Int32, PixelFormat, Double, Double)


GdipBitmapConstructor.CreateBitmap Method | FlexCel Studio for the .NET Framework documentation

GdipBitmapConstructor.CreateBitmap Method

Overloads

  • GdipBitmapConstructor.CreateBitmap(Int32, Int32)
  • GdipBitmapConstructor.CreateBitmap(Int32, Int32, PixelFormat, Double, Double)

GdipBitmapConstructor.CreateBitmap(Int32, Int32)

Returns a new bitmap.

Syntax

Namespace: FlexCel.Draw

public static Bitmap CreateBitmap(Int32 width, Int32 height)

Parameters

<-> | Parameter | Type | Description
 | width | Int32 | Width of the bitmap in pixels.
 | height | Int32 | Height of the bitmap in pixels.

See also

  • GdipBitmapConstructor

GdipBitmapConstructor.CreateBitmap(Int32, Int32, PixelFormat, Double, Double)

Creates a bitmap.

Syntax

Namespace: FlexCel.Draw

public static Bitmap CreateBitmap(Int32 width, Int32 height, PixelFormat aPixelFormat, Double hres, Double vres)

Parameters

<-> | Parameter | Type | Description
 | width | Int32 | Width of the bitmap in pixels.
 | height | Int32 | Height of the bitmap in pixels.
 | aPixelFormat | PixelFormat | Pixel Format.
 | hres | Double | Horizontal resolution of the image
 | vres | Double | Vertical resolution of the image

See also

  • GdipBitmapConstructor


OctreeQuantizer Class | FlexCel Studio for the .NET Framework documentation

OctreeQuantizer Class

Reduce the number of colors of an image. This class needs UNMANAGED permissions in order to be able to modify the bits in the image.

Syntax

Namespace: FlexCel.Draw

public class OctreeQuantizer: Quantizer

Constructors

Name | Description
OctreeQuantizer | Constructs the octree quantizer.

Methods

Name | Description
ConvertTo256Colors | Overloaded ConvertTo256Colors(Image, Bitmap) ConvertTo256Colors(Image)
InitialQuantizePixel | Process the pixel in the first pass of the algorithm
QuantizePixel | Override this to process the pixel in the second pass of the algorithm
GetPalette | Retrieve the palette for the quantized image


OctreeQuantizer.OctreeQuantizer Constructor | FlexCel Studio for the .NET Framework documentation

OctreeQuantizer.OctreeQuantizer Constructor

Constructs the octree quantizer.

Remarks

The Octree quantizer is a two pass algorithm. The initial pass sets up the octree, the second pass quantizes a color based on the nodes in the tree

Syntax

Namespace: FlexCel.Draw

public OctreeQuantizer(Int32 maxColors, Int32 maxColorBits)

Parameters

<-> | Parameter | Type | Description
 | maxColors | Int32 | The maximum number of colors to return
 | maxColorBits | Int32 | The number of significant bits

See also

  • OctreeQuantizer


OctreeQuantizer.ConvertTo256Colors Method | FlexCel Studio for the .NET Framework documentation

OctreeQuantizer.ConvertTo256Colors Method

Overloads

  • OctreeQuantizer.ConvertTo256Colors(Image, Bitmap)
  • OctreeQuantizer.ConvertTo256Colors(Image)

OctreeQuantizer.ConvertTo256Colors(Image, Bitmap)

Converts an image to 256 colors.

Syntax

Namespace: FlexCel.Draw

public static void ConvertTo256Colors(Image Source, Bitmap Result)

Parameters

<-> | Parameter | Type | Description
 | Source | Image | Image we want to convert.
 | Result | Bitmap | Converted image.

See also

  • OctreeQuantizer

OctreeQuantizer.ConvertTo256Colors(Image)

Converts an image to 256 colors.

Syntax

Namespace: FlexCel.Draw

public static Bitmap ConvertTo256Colors(Image Source)

Parameters

<-> | Parameter | Type | Description
 | Source | Image | Image we want to convert.

Returns

Converted image.

See also

  • OctreeQuantizer


OctreeQuantizer.InitialQuantizePixel Method | FlexCel Studio for the .NET Framework documentation

OctreeQuantizer.InitialQuantizePixel Method

Process the pixel in the first pass of the algorithm

Remarks

This function need only be overridden if your quantize algorithm needs two passes, such as an Octree quantizer.

Syntax

Namespace: FlexCel.Draw

protected override void InitialQuantizePixel(Int32 pixel)

Parameters

<-> | Parameter | Type | Description
 | pixel | Int32 | The pixel to quantize

See also

  • OctreeQuantizer


OctreeQuantizer.QuantizePixel Method | FlexCel Studio for the .NET Framework documentation

OctreeQuantizer.QuantizePixel Method

Override this to process the pixel in the second pass of the algorithm

Syntax

Namespace: FlexCel.Draw

protected override Byte QuantizePixel(Int32 pixel)

Parameters

<-> | Parameter | Type | Description
 | pixel | Int32 | The pixel to quantize

Returns

The quantized value

See also

  • OctreeQuantizer


OctreeQuantizer.GetPalette Method | FlexCel Studio for the .NET Framework documentation

OctreeQuantizer.GetPalette Method

Retrieve the palette for the quantized image

Syntax

Namespace: FlexCel.Draw

protected override ColorPalette GetPalette(ColorPalette original)

Parameters

<-> | Parameter | Type | Description
 | original | ColorPalette | Any old palette, this is overwritten

Returns

The new color palette

See also

  • OctreeQuantizer


Quantizer Class | FlexCel Studio for the .NET Framework documentation

Quantizer Class

A generic implementation for any Color Quantizer.

Syntax

Namespace: FlexCel.Draw

public abstract class Quantizer

Constructors

Name | Description
Quantizer | Constructs the quantizer.

Methods

Name | Description
Quantize | Quantize an image and return the resulting Result bitmap
FirstPass | Execute the first pass through the pixels in the image
SecondPass | Execute a second pass through the bitmap
InitialQuantizePixel | Override this to process the pixel in the first pass of the algorithm
QuantizePixel | Override this to process the pixel in the second pass of the algorithm
GetPalette | Retrieve the palette for the quantized image


Quantizer.Quantizer Constructor | FlexCel Studio for the .NET Framework documentation

Quantizer.Quantizer Constructor

Constructs the quantizer.

Remarks

If you construct this class with a true value for singlePass, then the code will, when quantizing your image, only call the 'QuantizeImage' function. If two passes are required, the code will call 'InitialQuantizeImage' and then 'QuantizeImage'.

Syntax

Namespace: FlexCel.Draw

protected Quantizer(Boolean singlePass)

Parameters

<-> | Parameter | Type | Description
 | singlePass | Boolean | If true, the quantization only needs to loop through the Source pixels once

See also

  • Quantizer


Quantizer.Quantize Method | FlexCel Studio for the .NET Framework documentation

Quantizer.Quantize Method

Quantize an image and return the resulting Result bitmap

Syntax

Namespace: FlexCel.Draw

public void Quantize(Image Source, Bitmap Result)

Parameters

<-> | Parameter | Type | Description
 | Source | Image | The image to quantize
 | Result | Bitmap | A quantized version of the image

See also

  • Quantizer


Quantizer.FirstPass Method | FlexCel Studio for the .NET Framework documentation

Quantizer.FirstPass Method

Execute the first pass through the pixels in the image

Syntax

Namespace: FlexCel.Draw

protected internal virtual void FirstPass(BitmapData sourceData, Int32 width, Int32 height)

Parameters

<-> | Parameter | Type | Description
 | sourceData | BitmapData | The Source data
 | width | Int32 | The width in pixels of the image
 | height | Int32 | The height in pixels of the image

See also

  • Quantizer


Quantizer.SecondPass Method | FlexCel Studio for the .NET Framework documentation

Quantizer.SecondPass Method

Execute a second pass through the bitmap

Syntax

Namespace: FlexCel.Draw

protected internal virtual void SecondPass(BitmapData sourceData, Bitmap Result, Int32 width, Int32 height, Rectangle bounds)

Parameters

<-> | Parameter | Type | Description
 | sourceData | BitmapData | The Source bitmap, locked into memory
 | Result | Bitmap | The Result bitmap
 | width | Int32 | The width in pixels of the image
 | height | Int32 | The height in pixels of the image
 | bounds | Rectangle | The bounding rectangle

See also

  • Quantizer


Quantizer.InitialQuantizePixel Method | FlexCel Studio for the .NET Framework documentation

Quantizer.InitialQuantizePixel Method

Override this to process the pixel in the first pass of the algorithm

Remarks

This function need only be overridden if your quantize algorithm needs two passes, such as an Octree quantizer.

Syntax

Namespace: FlexCel.Draw

protected virtual void InitialQuantizePixel(Int32 pixel)

Parameters

<-> | Parameter | Type | Description
 | pixel | Int32 | The pixel to quantize

See also

  • Quantizer


Quantizer.QuantizePixel Method | FlexCel Studio for the .NET Framework documentation

Quantizer.QuantizePixel Method

Override this to process the pixel in the second pass of the algorithm

Syntax

Namespace: FlexCel.Draw

protected abstract Byte QuantizePixel(Int32 pixel)

Parameters

<-> | Parameter | Type | Description
 | pixel | Int32 | The pixel to quantize

Returns

The quantized value

See also

  • Quantizer


Quantizer.GetPalette Method | FlexCel Studio for the .NET Framework documentation

Quantizer.GetPalette Method

Retrieve the palette for the quantized image

Syntax

Namespace: FlexCel.Draw

protected abstract ColorPalette GetPalette(ColorPalette original)

Parameters

<-> | Parameter | Type | Description
 | original | ColorPalette | Any old palette, this is overrwritten

Returns

The new color palette

See also

  • Quantizer


TGdipUIFont Class | FlexCel Studio for the .NET Framework documentation

TGdipUIFont Class

Represents a font used for drawing in a pdf/gdi+/wpf/winrt canvas.

Syntax

Namespace: FlexCel.Draw

public class TGdipUIFont: TUIFont

Methods

Name | Description
GetHeight | Overloaded GetHeight(Int32) GetHeight(Graphics)
GetWidth | Returns the width of a string in device-independent pixels at dpi resolution when written in the current font.
FontLinespacing | Returns the linespacing for the font.
FontDescent | Returns the font descent.
GetStyle | Overloaded GetStyle(TUIFontStyle) GetStyle(FontStyle)
Dispose | Override this method to dispose your own objects in your descending classes.

Properties

Name | Description
Name | Name of the font.
SizeInPoints | Size in points of the font.
Style | Style of the font (bold, italics, etc).
Handle | Native GDI+ object.
FontFamily | Fontfamily.
NativeStyle | Native font style.


TGdipUIFont.GetHeight Method | FlexCel Studio for the .NET Framework documentation

TGdipUIFont.GetHeight Method

Overloads

  • TGdipUIFont.GetHeight(Int32)
  • TGdipUIFont.GetHeight(Graphics)

TGdipUIFont.GetHeight(Int32)

Height of the font for a given resolution.

Syntax

Namespace: FlexCel.Draw

public override Double GetHeight(Int32 dpi)

Parameters

<-> | Parameter | Type | Description
 | dpi | Int32 | Resolution.

See also

  • TGdipUIFont

TGdipUIFont.GetHeight(Graphics)

Calculates the height in a given canvas.

Syntax

Namespace: FlexCel.Draw

public Single GetHeight(Graphics Canvas)

Parameters

<-> | Parameter | Type | Description
 | Canvas | Graphics |

See also

  • TGdipUIFont


TGdipUIFont.GetWidth Method | FlexCel Studio for the .NET Framework documentation

TGdipUIFont.GetWidth Method

Returns the width of a string in device-independent pixels at dpi resolution when written in the current font.

Syntax

Namespace: FlexCel.Draw

public override Double GetWidth(String aText, Int32 dpi, TFlxReadingOrder aReadingOrder)

Parameters

<-> | Parameter | Type | Description
 | aText | String | Text we want to measure.
 | dpi | Int32 | Dpi to measure the string.
 | aReadingOrder | TFlxReadingOrder | Reading order for the document where the string is.

See also

  • TGdipUIFont


TGdipUIFont.FontLinespacing Method | FlexCel Studio for the .NET Framework documentation

TGdipUIFont.FontLinespacing Method

Returns the linespacing for the font.

Syntax

Namespace: FlexCel.Draw

public override Double FontLinespacing()

See also

  • TGdipUIFont


TGdipUIFont.FontDescent Method | FlexCel Studio for the .NET Framework documentation

TGdipUIFont.FontDescent Method

Returns the font descent.

Syntax

Namespace: FlexCel.Draw

public override Double FontDescent()

See also

  • TGdipUIFont


TGdipUIFont.GetStyle Method | FlexCel Studio for the .NET Framework documentation

TGdipUIFont.GetStyle Method

Overloads

  • TGdipUIFont.GetStyle(TUIFontStyle)
  • TGdipUIFont.GetStyle(FontStyle)

TGdipUIFont.GetStyle(TUIFontStyle)

Converts the font style.

Syntax

Namespace: FlexCel.Draw

public static FontStyle GetStyle(TUIFontStyle fs)

Parameters

<-> | Parameter | Type | Description
 | fs | TUIFontStyle |

See also

  • TGdipUIFont

TGdipUIFont.GetStyle(FontStyle)

Converts the font style.

Syntax

Namespace: FlexCel.Draw

public static TUIFontStyle GetStyle(FontStyle fs)

Parameters

<-> | Parameter | Type | Description
 | fs | FontStyle |

See also

  • TGdipUIFont


TGdipUIFont.Dispose Method | FlexCel Studio for the .NET Framework documentation

TGdipUIFont.Dispose Method

Override this method to dispose your own objects in your descending classes.

Syntax

Namespace: FlexCel.Draw

protected override void Dispose(Boolean disposing)

Parameters

<-> | Parameter | Type | Description
 | disposing | Boolean | If true, this is a direct call to Dispose(), and you need to dispose both managed and unmanaged resources. If false, this is called by the finalizer, and you only need to release unmanaged resources.

See also

  • TGdipUIFont


TGdipUIFont.Name Property | FlexCel Studio for the .NET Framework documentation

TGdipUIFont.Name Property

Name of the font.

Syntax

Namespace: FlexCel.Draw

public override String Name { get; }

See also

  • TGdipUIFont


TGdipUIFont.SizeInPoints Property | FlexCel Studio for the .NET Framework documentation

TGdipUIFont.SizeInPoints Property

Size in points of the font.

Syntax

Namespace: FlexCel.Draw

public override Double SizeInPoints { get; }

See also

  • TGdipUIFont


TGdipUIFont.Style Property | FlexCel Studio for the .NET Framework documentation

TGdipUIFont.Style Property

Style of the font (bold, italics, etc).

Syntax

Namespace: FlexCel.Draw

public override TUIFontStyle Style { get; }

See also

  • TGdipUIFont


TGdipUIFont.Handle Property | FlexCel Studio for the .NET Framework documentation

TGdipUIFont.Handle Property

Native GDI+ object.

Syntax

Namespace: FlexCel.Draw

public Font Handle { get; }

See also

  • TGdipUIFont


TGdipUIFont.FontFamily Property | FlexCel Studio for the .NET Framework documentation

TGdipUIFont.FontFamily Property

Fontfamily.

Syntax

Namespace: FlexCel.Draw

public FontFamily FontFamily { get; }

See also

  • TGdipUIFont


TGdipUIFont.NativeStyle Property | FlexCel Studio for the .NET Framework documentation

TGdipUIFont.NativeStyle Property

Native font style.

Syntax

Namespace: FlexCel.Draw

public FontStyle NativeStyle { get; }

See also

  • TGdipUIFont


TGdipUIGraphics Class | FlexCel Studio for the .NET Framework documentation

TGdipUIGraphics Class

An implementation of a GDI+ Graphics.

Syntax

Namespace: FlexCel.Draw

public class TGdipUIGraphics: TUIGraphics

Constructors

Name | Description
TGdipUIGraphics | Creates a new instance.

Methods

Name | Description
Dispose | Override this method to dispose your own objects in your descending classes.
Clear | Clears the image to a color.
SetMode | Sets the interpolation and smoothing modes.

Properties

Name | Description
Handle | System.​Drawing.​Handle encapsulated by this object.


TGdipUIGraphics.TGdipUIGraphics Constructor | FlexCel Studio for the .NET Framework documentation

TGdipUIGraphics.TGdipUIGraphics Constructor

Creates a new instance.

Syntax

Namespace: FlexCel.Draw

public TGdipUIGraphics(Graphics aGraphics, Boolean aNeedsDispose)

Parameters

<-> | Parameter | Type | Description
 | aGraphics | Graphics | Graphics that this object will use.
 | aNeedsDispose | Boolean | If true, this object will take ownership of aGraphics, and aGraphics will be disposed when this object is disposed.

See also

  • TGdipUIGraphics


TGdipUIGraphics.Dispose Method | FlexCel Studio for the .NET Framework documentation

TGdipUIGraphics.Dispose Method

Override this method to dispose your own objects in your descending classes.

Syntax

Namespace: FlexCel.Draw

protected override void Dispose(Boolean disposing)

Parameters

<-> | Parameter | Type | Description
 | disposing | Boolean | If true, this is a direct call to Dispose(), and you need to dispose both managed and unmanaged resources. If false, this is called by the finalizer, and you only need to release unmanaged resources.

See also

  • TGdipUIGraphics


TGdipUIGraphics.Clear Method | FlexCel Studio for the .NET Framework documentation

TGdipUIGraphics.Clear Method

Clears the image to a color.

Syntax

Namespace: FlexCel.Draw

public override void Clear(TUIColor aColor)

Parameters

<-> | Parameter | Type | Description
 | aColor | TUIColor | Color to fill the image.

See also

  • TGdipUIGraphics


TGdipUIGraphics.SetMode Method | FlexCel Studio for the .NET Framework documentation

TGdipUIGraphics.SetMode Method

Sets the interpolation and smoothing modes.

Syntax

Namespace: FlexCel.Draw

public override void SetMode(TUIInterpolationMode aInterpolationMode, TUISmoothingMode aSmoothingMode)

Parameters

<-> | Parameter | Type | Description
 | aInterpolationMode | TUIInterpolationMode |
 | aSmoothingMode | TUISmoothingMode |

See also

  • TGdipUIGraphics


TGdipUIGraphics.Handle Property | FlexCel Studio for the .NET Framework documentation

TGdipUIGraphics.Handle Property

System.Drawing.Handle encapsulated by this object.

Syntax

Namespace: FlexCel.Draw

public Graphics Handle { get; }

See also

  • TGdipUIGraphics


TGdipUIHatchBrush Class | FlexCel Studio for the .NET Framework documentation

TGdipUIHatchBrush Class

A GDI+ Hatch brush.

Syntax

Namespace: FlexCel.Draw

public class TGdipUIHatchBrush: TUIHatchBrush, IGdipUIBrush

Constructors

Name | Description
TGdipUIHatchBrush | Creates a new UIHatchBrush which encapsulates an existing GDI+ HatchBrush. Note that if you are encapsulating a brush from Brushes.Color class, you need to pass false in aNeedsDispose, since this class shouldn't dispose the brush when disposing the class.

Methods

Name | Description
GetHatchStyle | Overloaded GetHatchStyle(TUIHatchStyle) GetHatchStyle(HatchStyle)
Dispose | Override this method to dispose your own objects in your descending classes.

Properties

Name | Description
ForegroundColor | Foreground color for the pattern.
BackgroundColor | Background color for the pattern.
HatchStyle | Hatch style for the pattern.
Handle | Native brush.


TGdipUIHatchBrush.TGdipUIHatchBrush Constructor | FlexCel Studio for the .NET Framework documentation

TGdipUIHatchBrush.TGdipUIHatchBrush Constructor

Creates a new UIHatchBrush which encapsulates an existing GDI+ HatchBrush. Note that if you are encapsulating a brush from Brushes.Color class, you need to pass false in aNeedsDispose, since this class shouldn't dispose the brush when disposing the class.

Syntax

Namespace: FlexCel.Draw

public TGdipUIHatchBrush(HatchBrush aBrush, Boolean aNeedsDispose)

Parameters

<-> | Parameter | Type | Description
 | aBrush | HatchBrush | GDI+ brush which will define this brush.
 | aNeedsDispose | Boolean | If true, this class will own the GDI+ brush, and dispose it when you dispose the class. If false, the GDI+ brush will not be disposed when disposing this class. If you are using a brush from Brushes class, you should set this to false. We don't want to dispose system brushes.

See also

  • TGdipUIHatchBrush


TGdipUIHatchBrush.GetHatchStyle Method | FlexCel Studio for the .NET Framework documentation

TGdipUIHatchBrush.GetHatchStyle Method

Overloads

  • TGdipUIHatchBrush.GetHatchStyle(TUIHatchStyle)
  • TGdipUIHatchBrush.GetHatchStyle(HatchStyle)

TGdipUIHatchBrush.GetHatchStyle(TUIHatchStyle)

Converts the hatch style.

Syntax

Namespace: FlexCel.Draw

public HatchStyle GetHatchStyle(TUIHatchStyle hs)

Parameters

<-> | Parameter | Type | Description
 | hs | TUIHatchStyle |

See also

  • TGdipUIHatchBrush

TGdipUIHatchBrush.GetHatchStyle(HatchStyle)

Converts the hatch style.

Syntax

Namespace: FlexCel.Draw

public TUIHatchStyle GetHatchStyle(HatchStyle hs)

Parameters

<-> | Parameter | Type | Description
 | hs | HatchStyle |

See also

  • TGdipUIHatchBrush


TGdipUIHatchBrush.Dispose Method | FlexCel Studio for the .NET Framework documentation

TGdipUIHatchBrush.Dispose Method

Override this method to dispose your own objects in your descending classes.

Syntax

Namespace: FlexCel.Draw

protected override void Dispose(Boolean disposing)

Parameters

<-> | Parameter | Type | Description
 | disposing | Boolean | If true, this is a direct call to Dispose(), and you need to dispose both managed and unmanaged resources. If false, this is called by the finalizer, and you only need to release unmanaged resources.

See also

  • TGdipUIHatchBrush


TGdipUIHatchBrush.ForegroundColor Property | FlexCel Studio for the .NET Framework documentation

TGdipUIHatchBrush.ForegroundColor Property

Foreground color for the pattern.

Syntax

Namespace: FlexCel.Draw

public override TUIColor ForegroundColor { get; }

See also

  • TGdipUIHatchBrush


TGdipUIHatchBrush.BackgroundColor Property | FlexCel Studio for the .NET Framework documentation

TGdipUIHatchBrush.BackgroundColor Property

Background color for the pattern.

Syntax

Namespace: FlexCel.Draw

public override TUIColor BackgroundColor { get; }

See also

  • TGdipUIHatchBrush


TGdipUIHatchBrush.HatchStyle Property | FlexCel Studio for the .NET Framework documentation

TGdipUIHatchBrush.HatchStyle Property

Hatch style for the pattern.

Syntax

Namespace: FlexCel.Draw

public override TUIHatchStyle HatchStyle { get; }

See also

  • TGdipUIHatchBrush


TGdipUIHatchBrush.Handle Property | FlexCel Studio for the .NET Framework documentation

TGdipUIHatchBrush.Handle Property

Native brush.

Syntax

Namespace: FlexCel.Draw

public Brush Handle { get; }

See also

  • TGdipUIHatchBrush


TGdipUIImage Class | FlexCel Studio for the .NET Framework documentation

TGdipUIImage Class

Encapsulation of a System.Drawing.Image.

Syntax

Namespace: FlexCel.Draw

public class TGdipUIImage: TUIImage

Constructors

Name | Description
TGdipUIImage | Overloaded TGdipUIImage(Stream) TGdipUIImage(Image, Boolean)

Methods

Name | Description
Save | Saves the image to a stream, in the specified format.
RasterizeWMF | Converts a vectorial metafile int a bitmap.
ConvertToBWDither | Converts the image to Black and White, using Floyd steinberg dithering. Original image must be a bitmap.
ConvertToBiLevel | Converts the image to blackandwhite, but just setting the colors to white/black, not by ussing diffussion like floyd steinberg.
ConvertToGrayscale | Converts the image to shades of gray.
ConvertTo256Colors | Converts the image to 256 indexed colors.
RasterMetafile | Converts a vectorial metafile to a bitmap.
Dispose | Override this method to dispose your own objects in your descending classes.
AdjustImage | Adjust brightness and contrast of an image.
MakeImageGray | Converts an image to grayscale.
MakeTransparent | Makes an image transparent.
ColorImage | Colors an image.
SaveStart | Starts saving a multi page image.
Clone | Returns a deep copy of the image.

Properties

Name | Description
Width | Width of the image in device-dependent pixels.
Height | Height of the image in device-dependent pixels.
WidthInPoints | Width of the image in Points (1/72 of an inch)
HeightInPoints | Height of the image in Points (1/72 of an inch)
RawFormat | Format of the image.
IsMetafile | Returns true if the file is a WMF or EMF file.
Is8bitGrayscale | Returns true if the image has 256 shades of gray.
Handle | Returns the image encapsulated by this object.


TGdipUIImage.TGdipUIImage Constructor | FlexCel Studio for the .NET Framework documentation

TGdipUIImage.TGdipUIImage Constructor

Overloads

  • TGdipUIImage.TGdipUIImage(Stream)
  • TGdipUIImage.TGdipUIImage(Image, Boolean)

TGdipUIImage.TGdipUIImage(Stream)

Creates a new UIImage from a stream.

Syntax

Namespace: FlexCel.Draw

public TGdipUIImage(Stream aStream)

Parameters

<-> | Parameter | Type | Description
 | aStream | Stream |

See also

  • TGdipUIImage

TGdipUIImage.TGdipUIImage(Image, Boolean)

Creates a new UIImage which encapsulates an existing GDI+ Image.

Syntax

Namespace: FlexCel.Draw

public TGdipUIImage(Image aImage, Boolean aNeedsDispose)

Parameters

<-> | Parameter | Type | Description
 | aImage | Image | GDI+ image which will define this image.
 | aNeedsDispose | Boolean | If true, this class will own the GDI+ image, and dispose it when you dispose the class. If false, the GDI+ image will not be disposed when disposing this class.

See also

  • TGdipUIImage


TGdipUIImage.Save Method | FlexCel Studio for the .NET Framework documentation

TGdipUIImage.Save Method

Saves the image to a stream, in the specified format.

Syntax

Namespace: FlexCel.Draw

public override TXlsImgType Save(Stream outMs, TXlsImgType ImgType)

Parameters

<-> | Parameter | Type | Description
 | outMs | Stream |
 | ImgType | TXlsImgType |

Returns

The actual file format in which the file was saved. It might not be possible to save in the required format, and a different one might be used.

See also

  • TGdipUIImage


TGdipUIImage.RasterizeWMF Method | FlexCel Studio for the .NET Framework documentation

TGdipUIImage.RasterizeWMF Method

Converts a vectorial metafile int a bitmap.

Syntax

Namespace: FlexCel.Draw

public static Image RasterizeWMF(Image Source)

Parameters

<-> | Parameter | Type | Description
 | Source | Image |

See also

  • TGdipUIImage


TGdipUIImage.ConvertToBWDither Method | FlexCel Studio for the .NET Framework documentation

TGdipUIImage.ConvertToBWDither Method

Converts the image to Black and White, using Floyd steinberg dithering. Original image must be a bitmap.

Syntax

Namespace: FlexCel.Draw

public override TUIImage ConvertToBWDither()

See also

  • TGdipUIImage


TGdipUIImage.ConvertToBiLevel Method | FlexCel Studio for the .NET Framework documentation

TGdipUIImage.ConvertToBiLevel Method

Converts the image to blackandwhite, but just setting the colors to white/black, not by ussing diffussion like floyd steinberg.

Syntax

Namespace: FlexCel.Draw

public override TUIImage ConvertToBiLevel()

See also

  • TGdipUIImage


TGdipUIImage.ConvertToGrayscale Method | FlexCel Studio for the .NET Framework documentation

TGdipUIImage.ConvertToGrayscale Method

Converts the image to shades of gray.

Syntax

Namespace: FlexCel.Draw

public override TUIImage ConvertToGrayscale()

See also

  • TGdipUIImage


TGdipUIImage.ConvertTo256Colors Method | FlexCel Studio for the .NET Framework documentation

TGdipUIImage.ConvertTo256Colors Method

Converts the image to 256 indexed colors.

Syntax

Namespace: FlexCel.Draw

public override TUIImage ConvertTo256Colors()

See also

  • TGdipUIImage


TGdipUIImage.RasterMetafile Method | FlexCel Studio for the .NET Framework documentation

TGdipUIImage.RasterMetafile Method

Converts a vectorial metafile to a bitmap.

Syntax

Namespace: FlexCel.Draw

public override TUIImage RasterMetafile(TUIRectangle Coords)

Parameters

<-> | Parameter | Type | Description
 | Coords | TUIRectangle |

See also

  • TGdipUIImage


TGdipUIImage.Dispose Method | FlexCel Studio for the .NET Framework documentation

TGdipUIImage.Dispose Method

Override this method to dispose your own objects in your descending classes.

Syntax

Namespace: FlexCel.Draw

protected override void Dispose(Boolean disposing)

Parameters

<-> | Parameter | Type | Description
 | disposing | Boolean | If true, this is a direct call to Dispose(), and you need to dispose both managed and unmanaged resources. If false, this is called by the finalizer, and you only need to release unmanaged resources.

See also

  • TGdipUIImage


TGdipUIImage.AdjustImage Method | FlexCel Studio for the .NET Framework documentation

TGdipUIImage.AdjustImage Method

Adjust brightness and contrast of an image.

Syntax

Namespace: FlexCel.Draw

public static void AdjustImage(ref ImageAttributes imgAtt, Int32 brightness, Int32 contrast)

Parameters

<-> | Parameter | Type | Description
ref | imgAtt | ImageAttributes |
 | brightness | Int32 |
 | contrast | Int32 |

See also

  • TGdipUIImage


TGdipUIImage.MakeImageGray Method | FlexCel Studio for the .NET Framework documentation

TGdipUIImage.MakeImageGray Method

Converts an image to grayscale.

Syntax

Namespace: FlexCel.Draw

public static void MakeImageGray(ref ImageAttributes imgAtt, TUIColor shadowColor)

Parameters

<-> | Parameter | Type | Description
ref | imgAtt | ImageAttributes |
 | shadowColor | TUIColor |

See also

  • TGdipUIImage


TGdipUIImage.MakeTransparent Method | FlexCel Studio for the .NET Framework documentation

TGdipUIImage.MakeTransparent Method

Makes an image transparent.

Syntax

Namespace: FlexCel.Draw

public static void MakeTransparent(ref ImageAttributes imgAtt, Double Opacity)

Parameters

<-> | Parameter | Type | Description
ref | imgAtt | ImageAttributes |
 | Opacity | Double |

See also

  • TGdipUIImage


TGdipUIImage.ColorImage Method | FlexCel Studio for the .NET Framework documentation

TGdipUIImage.ColorImage Method

Colors an image.

Syntax

Namespace: FlexCel.Draw

public static void ColorImage(ref ImageAttributes imgAtt, TUIColor bgColor, TUIColor fgColor)

Parameters

<-> | Parameter | Type | Description
ref | imgAtt | ImageAttributes |
 | bgColor | TUIColor |
 | fgColor | TUIColor |

See also

  • TGdipUIImage


TGdipUIImage.SaveStart Method | FlexCel Studio for the .NET Framework documentation

TGdipUIImage.SaveStart Method

Starts saving a multi page image.

Syntax

Namespace: FlexCel.Draw

public override TUIMultiPageSaver SaveStart(Stream outStream, ImageExportType ExportType, Int32 totalPages)

Parameters

<-> | Parameter | Type | Description
 | outStream | Stream | Stream where the image will be saved.
 | ExportType | ImageExportType | Format for the exported images.
 | totalPages | Int32 | Number of pages to export.

Returns

Image state that will be used when saving the other pages.

See also

  • TGdipUIImage


TGdipUIImage.Clone Method | FlexCel Studio for the .NET Framework documentation

TGdipUIImage.Clone Method

Returns a deep copy of the image.

Syntax

Namespace: FlexCel.Draw

public TUIImage Clone()

See also

  • TGdipUIImage


TGdipUIImage.Width Property | FlexCel Studio for the .NET Framework documentation

TGdipUIImage.Width Property

Width of the image in device-dependent pixels.

Syntax

Namespace: FlexCel.Draw

public override Double Width { get; }

See also

  • TGdipUIImage


TGdipUIImage.Height Property | FlexCel Studio for the .NET Framework documentation

TGdipUIImage.Height Property

Height of the image in device-dependent pixels.

Syntax

Namespace: FlexCel.Draw

public override Double Height { get; }

See also

  • TGdipUIImage


TGdipUIImage.WidthInPoints Property | FlexCel Studio for the .NET Framework documentation

TGdipUIImage.WidthInPoints Property

Width of the image in Points (1/72 of an inch)

Syntax

Namespace: FlexCel.Draw

public override Double WidthInPoints { get; }

See also

  • TGdipUIImage


TGdipUIImage.HeightInPoints Property | FlexCel Studio for the .NET Framework documentation

TGdipUIImage.HeightInPoints Property

Height of the image in Points (1/72 of an inch)

Syntax

Namespace: FlexCel.Draw

public override Double HeightInPoints { get; }

See also

  • TGdipUIImage


TGdipUIImage.RawFormat Property | FlexCel Studio for the .NET Framework documentation

TGdipUIImage.RawFormat Property

Format of the image.

Syntax

Namespace: FlexCel.Draw

public override TXlsImgType RawFormat { get; }

See also

  • TGdipUIImage


TGdipUIImage.IsMetafile Property | FlexCel Studio for the .NET Framework documentation

TGdipUIImage.IsMetafile Property

Returns true if the file is a WMF or EMF file.

Syntax

Namespace: FlexCel.Draw

public override Boolean IsMetafile { get; }

See also

  • TGdipUIImage


TGdipUIImage.Is8bitGrayscale Property | FlexCel Studio for the .NET Framework documentation

TGdipUIImage.Is8bitGrayscale Property

Returns true if the image has 256 shades of gray.

Syntax

Namespace: FlexCel.Draw

public override Boolean Is8bitGrayscale { get; }

See also

  • TGdipUIImage


TGdipUIImage.Handle Property | FlexCel Studio for the .NET Framework documentation

TGdipUIImage.Handle Property

Returns the image encapsulated by this object.

Syntax

Namespace: FlexCel.Draw

public Image Handle { get; }

See also

  • TGdipUIImage


TGdipUIImageAttributes Class | FlexCel Studio for the .NET Framework documentation

TGdipUIImageAttributes Class

Class encapsulating GDI+ image attributes.

Syntax

Namespace: FlexCel.Draw

public class TGdipUIImageAttributes: TUIImageAttributes

Methods

Name | Description
Dispose | Override this method to dispose your own objects in your descending classes.

Properties

Name | Description
Handle | Returns the encapsulated ImageAttributes.


TGdipUIImageAttributes.Dispose Method | FlexCel Studio for the .NET Framework documentation

TGdipUIImageAttributes.Dispose Method

Override this method to dispose your own objects in your descending classes.

Syntax

Namespace: FlexCel.Draw

protected override void Dispose(Boolean disposing)

Parameters

<-> | Parameter | Type | Description
 | disposing | Boolean | If true, this is a direct call to Dispose(), and you need to dispose both managed and unmanaged resources. If false, this is called by the finalizer, and you only need to release unmanaged resources.

See also

  • TGdipUIImageAttributes


TGdipUIImageAttributes.Handle Property | FlexCel Studio for the .NET Framework documentation

TGdipUIImageAttributes.Handle Property

Returns the encapsulated ImageAttributes.

Syntax

Namespace: FlexCel.Draw

public ImageAttributes Handle { get; }

See also

  • TGdipUIImageAttributes


TGdipUILinearGradientBrush Class | FlexCel Studio for the .NET Framework documentation

TGdipUILinearGradientBrush Class

A class encapsulating a GDI+ linear gradient.

Syntax

Namespace: FlexCel.Draw

public class TGdipUILinearGradientBrush: TUILinearGradientBrush, IGdipUIBrush

Constructors

Name | Description
TGdipUILinear​Gradient​Brush | Creates a new UILinearGradient​Brush which encapsulates an existing GDI+ LinearGradient​Brush. Note that if you are encapsulating a brush from Brushes.Color class, you need to pass false in aNeedsDispose, since this class shouldn't dispose the brush when disposing the class.

Methods

Name | Description
InvertBlend | Inverts the colors of the gradient.
Dispose | Override this method to dispose your own objects in your descending classes.

Properties

Name | Description
Rectangle | Rectangle that defines the gradient.
TransformElements | Transform matrix.
InterpolationColors | Colors that define the gradient.
Handle | Brush encapsulated by this instance.


TGdipUILinearGradientBrush.TGdipUILinearGradientBrush Constructor | FlexCel Studio for the .NET Framework documentation

TGdipUILinearGradientBrush.TGdipUILinearGradientBrush Constructor

Creates a new UILinearGradientBrush which encapsulates an existing GDI+ LinearGradientBrush. Note that if you are encapsulating a brush from Brushes.Color class, you need to pass false in aNeedsDispose, since this class shouldn't dispose the brush when disposing the class.

Syntax

Namespace: FlexCel.Draw

public TGdipUILinearGradientBrush(LinearGradientBrush aBrush, Boolean aNeedsDispose)

Parameters

<-> | Parameter | Type | Description
 | aBrush | LinearGradientBrush | GDI+ brush which will define this brush.
 | aNeedsDispose | Boolean | If true, this class will own the GDI+ brush, and dispose it when you dispose the class. If false, the GDI+ brush will not be disposed when disposing this class. If you are using a brush from Brushes class, you should set this to false. We don't want to dispose system brushes.

See also

  • TGdipUILinearGradientBrush


TGdipUILinearGradientBrush.InvertBlend Method | FlexCel Studio for the .NET Framework documentation

TGdipUILinearGradientBrush.InvertBlend Method

Inverts the colors of the gradient.

Syntax

Namespace: FlexCel.Draw

public override void InvertBlend()

See also

  • TGdipUILinearGradientBrush


TGdipUILinearGradientBrush.Dispose Method | FlexCel Studio for the .NET Framework documentation

TGdipUILinearGradientBrush.Dispose Method

Override this method to dispose your own objects in your descending classes.

Syntax

Namespace: FlexCel.Draw

protected override void Dispose(Boolean disposing)

Parameters

<-> | Parameter | Type | Description
 | disposing | Boolean | If true, this is a direct call to Dispose(), and you need to dispose both managed and unmanaged resources. If false, this is called by the finalizer, and you only need to release unmanaged resources.

See also

  • TGdipUILinearGradientBrush


TGdipUILinearGradientBrush.Rectangle Property | FlexCel Studio for the .NET Framework documentation

TGdipUILinearGradientBrush.Rectangle Property

Rectangle that defines the gradient.

Syntax

Namespace: FlexCel.Draw

public override TUIRectangle Rectangle { get; }

See also

  • TGdipUILinearGradientBrush


TGdipUILinearGradientBrush.TransformElements Property | FlexCel Studio for the .NET Framework documentation

TGdipUILinearGradientBrush.TransformElements Property

Transform matrix.

Syntax

Namespace: FlexCel.Draw

public override Double[] TransformElements { get; }

See also

  • TGdipUILinearGradientBrush


TGdipUILinearGradientBrush.InterpolationColors Property | FlexCel Studio for the .NET Framework documentation

TGdipUILinearGradientBrush.InterpolationColors Property

Colors that define the gradient.

Syntax

Namespace: FlexCel.Draw

public override TUIColorBlend InterpolationColors { get; set; }

See also

  • TGdipUILinearGradientBrush


TGdipUILinearGradientBrush.Handle Property | FlexCel Studio for the .NET Framework documentation

TGdipUILinearGradientBrush.Handle Property

Brush encapsulated by this instance.

Syntax

Namespace: FlexCel.Draw

public Brush Handle { get; }

See also

  • TGdipUILinearGradientBrush


TGdipUIMultiPageParameters Class | FlexCel Studio for the .NET Framework documentation

TGdipUIMultiPageParameters Class

Parameters for GDI+

Syntax

Namespace: FlexCel.Draw

public class TGdipUIMultiPageParameters: TUIMultiPageSaver

Constructors

Name | Description
TGdipUIMulti​Page​Parameters | Creates a new Multipage saver for GDI+

Methods

Name | Description
SaveAdd | Adds a new image to a multi page image.
SaveEnd | Finish a multipage image.
Dispose | Closes the Multipage saver.


TGdipUIMultiPageParameters.TGdipUIMultiPageParameters Constructor | FlexCel Studio for the .NET Framework documentation

TGdipUIMultiPageParameters.TGdipUIMultiPageParameters Constructor

Creates a new Multipage saver for GDI+

Syntax

Namespace: FlexCel.Draw

public TGdipUIMultiPageParameters(Stream outStream, Int32 ParamCount, ImageExportType ExportType, Image aImage)

Parameters

<-> | Parameter | Type | Description
 | outStream | Stream |
 | ParamCount | Int32 |
 | ExportType | ImageExportType |
 | aImage | Image |

See also

  • TGdipUIMultiPageParameters


TGdipUIMultiPageParameters.SaveAdd Method | FlexCel Studio for the .NET Framework documentation

TGdipUIMultiPageParameters.SaveAdd Method

Adds a new image to a multi page image.

Syntax

Namespace: FlexCel.Draw

public override void SaveAdd(TUIImage imageToAdd)

Parameters

<-> | Parameter | Type | Description
 | imageToAdd | TUIImage | Image that will be added to the multipage image.

See also

  • TGdipUIMultiPageParameters


TGdipUIMultiPageParameters.SaveEnd Method | FlexCel Studio for the .NET Framework documentation

TGdipUIMultiPageParameters.SaveEnd Method

Finish a multipage image.

Syntax

Namespace: FlexCel.Draw

public override void SaveEnd()

See also

  • TGdipUIMultiPageParameters


TGdipUIMultiPageParameters.Dispose Method | FlexCel Studio for the .NET Framework documentation

TGdipUIMultiPageParameters.Dispose Method

Closes the Multipage saver.

Syntax

Namespace: FlexCel.Draw

protected override void Dispose(Boolean disposing)

Parameters

<-> | Parameter | Type | Description
 | disposing | Boolean |

See also

  • TGdipUIMultiPageParameters


TGdipUIPathGradientBrush Class | FlexCel Studio for the .NET Framework documentation

TGdipUIPathGradientBrush Class

Class encapsulating a GDI+ Path gradient.

Syntax

Namespace: FlexCel.Draw

public class TGdipUIPathGradientBrush: TUIPathGradientBrush, IGdipUIBrush

Constructors

Name | Description
TGdipUIPathGradient​Brush | Creates a new UIPathGradientBrush which encapsulates an existing GDI+ PathGradientBrush. Note that if you are encapsulating a brush from Brushes.Color class, you need to pass false in aNeedsDispose, since this class shouldn't dispose the brush when disposing the class.

Methods

Name | Description
InvertBlend | Inverts the colors of the gradient.
Dispose | Override this method to dispose your own objects in your descending classes.

Properties

Name | Description
IsRectangular | If true, this gradient is rectangular, else it is radial.
Rectangle | Rectangle that defines the gradient.
TransformElements | Transform matrix.
InterpolationColors | Colors that define the gradient.
CenterPoint | Center of the gradient.
CenterColor | Color for the center of the gradient.
SurroundColor | Colors on the ouside of the path.
Handle | Brush encapsulated by this instance.


TGdipUIPathGradientBrush.TGdipUIPathGradientBrush Constructor | FlexCel Studio for the .NET Framework documentation

TGdipUIPathGradientBrush.TGdipUIPathGradientBrush Constructor

Creates a new UIPathGradientBrush which encapsulates an existing GDI+ PathGradientBrush. Note that if you are encapsulating a brush from Brushes.Color class, you need to pass false in aNeedsDispose, since this class shouldn't dispose the brush when disposing the class.

Syntax

Namespace: FlexCel.Draw

public TGdipUIPathGradientBrush(PathGradientBrush aBrush, Boolean aNeedsDispose)

Parameters

<-> | Parameter | Type | Description
 | aBrush | PathGradientBrush | GDI+ brush which will define this brush.
 | aNeedsDispose | Boolean | If true, this class will own the GDI+ brush, and dispose it when you dispose the class. If false, the GDI+ brush will not be disposed when disposing this class. If you are using a brush from Brushes class, you should set this to false. We don't want to dispose system brushes.

See also

  • TGdipUIPathGradientBrush


TGdipUIPathGradientBrush.InvertBlend Method | FlexCel Studio for the .NET Framework documentation

TGdipUIPathGradientBrush.InvertBlend Method

Inverts the colors of the gradient.

Syntax

Namespace: FlexCel.Draw

public override void InvertBlend()

See also

  • TGdipUIPathGradientBrush


TGdipUIPathGradientBrush.Dispose Method | FlexCel Studio for the .NET Framework documentation

TGdipUIPathGradientBrush.Dispose Method

Override this method to dispose your own objects in your descending classes.

Syntax

Namespace: FlexCel.Draw

protected override void Dispose(Boolean disposing)

Parameters

<-> | Parameter | Type | Description
 | disposing | Boolean | If true, this is a direct call to Dispose(), and you need to dispose both managed and unmanaged resources. If false, this is called by the finalizer, and you only need to release unmanaged resources.

See also

  • TGdipUIPathGradientBrush


TGdipUIPathGradientBrush.IsRectangular Property | FlexCel Studio for the .NET Framework documentation

TGdipUIPathGradientBrush.IsRectangular Property

If true, this gradient is rectangular, else it is radial.

Syntax

Namespace: FlexCel.Draw

public override Boolean IsRectangular { get; }

See also

  • TGdipUIPathGradientBrush


TGdipUIPathGradientBrush.Rectangle Property | FlexCel Studio for the .NET Framework documentation

TGdipUIPathGradientBrush.Rectangle Property

Rectangle that defines the gradient.

Syntax

Namespace: FlexCel.Draw

public override TUIRectangle Rectangle { get; }

See also

  • TGdipUIPathGradientBrush


TGdipUIPathGradientBrush.TransformElements Property | FlexCel Studio for the .NET Framework documentation

TGdipUIPathGradientBrush.TransformElements Property

Transform matrix.

Syntax

Namespace: FlexCel.Draw

public override Double[] TransformElements { get; }

See also

  • TGdipUIPathGradientBrush


TGdipUIPathGradientBrush.InterpolationColors Property | FlexCel Studio for the .NET Framework documentation

TGdipUIPathGradientBrush.InterpolationColors Property

Colors that define the gradient.

Syntax

Namespace: FlexCel.Draw

public override TUIColorBlend InterpolationColors { get; set; }

See also

  • TGdipUIPathGradientBrush


TGdipUIPathGradientBrush.CenterPoint Property | FlexCel Studio for the .NET Framework documentation

TGdipUIPathGradientBrush.CenterPoint Property

Center of the gradient.

Syntax

Namespace: FlexCel.Draw

public override TPointF CenterPoint { get; }

See also

  • TGdipUIPathGradientBrush


TGdipUIPathGradientBrush.CenterColor Property | FlexCel Studio for the .NET Framework documentation

TGdipUIPathGradientBrush.CenterColor Property

Color for the center of the gradient.

Syntax

Namespace: FlexCel.Draw

public override TUIColor CenterColor { get; set; }

See also

  • TGdipUIPathGradientBrush


TGdipUIPathGradientBrush.SurroundColor Property | FlexCel Studio for the .NET Framework documentation

TGdipUIPathGradientBrush.SurroundColor Property

Colors on the ouside of the path.

Syntax

Namespace: FlexCel.Draw

public override TUIColor SurroundColor { get; set; }

See also

  • TGdipUIPathGradientBrush


TGdipUIPathGradientBrush.Handle Property | FlexCel Studio for the .NET Framework documentation

TGdipUIPathGradientBrush.Handle Property

Brush encapsulated by this instance.

Syntax

Namespace: FlexCel.Draw

public Brush Handle { get; }

See also

  • TGdipUIPathGradientBrush


TGdipUIPen Class | FlexCel Studio for the .NET Framework documentation

TGdipUIPen Class

Encapsulation of a GDI+ pen

Syntax

Namespace: FlexCel.Draw

public class TGdipUIPen: TUIPen

Constructors

Name | Description
TGdipUIPen | Creates a new UIPen which encapsulates an existing GDI+ Pen. Note that if you are encapsulating a pen from Pens.Color class, you need to pass false in aNeedsDispose, since this class shouldn't dispose the pen when disposing the class.

Methods

Name | Description
GetDashPattern | Converts the dashstyle.
GetStyle | Converts the dashstyle.
Dispose | Override this method to dispose your own objects in your descending classes.

Properties

Name | Description
Color | Gets or sets the color of the pen.
Width | Gets or sets the width of the pen.
DashStyle | Gets or sets the style of the pen.
LineCap | Gets or sets the line cap of the pen.
LineJoin | Gets or sets the line join for the pen.
MiterLimit | Gets or sets the miter limit for the pen.
HeadArrow | Defines a start arrow for the lines.
TailArrow | Defines a start arrow for the lines.
Handle | Returns the encapsulated Pen object.


TGdipUIPen.TGdipUIPen Constructor | FlexCel Studio for the .NET Framework documentation

TGdipUIPen.TGdipUIPen Constructor

Creates a new UIPen which encapsulates an existing GDI+ Pen. Note that if you are encapsulating a pen from Pens.Color class, you need to pass false in aNeedsDispose, since this class shouldn't dispose the pen when disposing the class.

Syntax

Namespace: FlexCel.Draw

public TGdipUIPen(Pen aPen, Boolean aNeedsDispose)

Parameters

<-> | Parameter | Type | Description
 | aPen | Pen | GDI+ pen which will define this pen.
 | aNeedsDispose | Boolean | If true, this class will own the GDI+ pen, and dispose it when you dispose the class. If false, the GDI+ pen will not be disposed when disposing this class. If you are using a pen from Pens class, you should set this to false. We don't want to dispose system pens.

See also

  • TGdipUIPen


TGdipUIPen.GetDashPattern Method | FlexCel Studio for the .NET Framework documentation

TGdipUIPen.GetDashPattern Method

Converts the dashstyle.

Syntax

Namespace: FlexCel.Draw

public static Single[] GetDashPattern(TUIDashStyle value, TLineCap lineCap)

Parameters

<-> | Parameter | Type | Description
 | value | TUIDashStyle |
 | lineCap | TLineCap |

See also

  • TGdipUIPen


TGdipUIPen.GetStyle Method | FlexCel Studio for the .NET Framework documentation

TGdipUIPen.GetStyle Method

Converts the dashstyle.

Syntax

Namespace: FlexCel.Draw

public static TUIDashStyle GetStyle(DashStyle value)

Parameters

<-> | Parameter | Type | Description
 | value | DashStyle |

See also

  • TGdipUIPen


TGdipUIPen.Dispose Method | FlexCel Studio for the .NET Framework documentation

TGdipUIPen.Dispose Method

Override this method to dispose your own objects in your descending classes.

Syntax

Namespace: FlexCel.Draw

protected override void Dispose(Boolean disposing)

Parameters

<-> | Parameter | Type | Description
 | disposing | Boolean | If true, this is a direct call to Dispose(), and you need to dispose both managed and unmanaged resources. If false, this is called by the finalizer, and you only need to release unmanaged resources.

See also

  • TGdipUIPen


TGdipUIPen.Color Property | FlexCel Studio for the .NET Framework documentation

TGdipUIPen.Color Property

Gets or sets the color of the pen.

Syntax

Namespace: FlexCel.Draw

public override TUIColor Color { get; set; }

See also

  • TGdipUIPen


TGdipUIPen.Width Property | FlexCel Studio for the .NET Framework documentation

TGdipUIPen.Width Property

Gets or sets the width of the pen.

Syntax

Namespace: FlexCel.Draw

public override Double Width { get; set; }

See also

  • TGdipUIPen


TGdipUIPen.DashStyle Property | FlexCel Studio for the .NET Framework documentation

TGdipUIPen.DashStyle Property

Gets or sets the style of the pen.

Syntax

Namespace: FlexCel.Draw

public override TUIDashStyle DashStyle { get; set; }

See also

  • TGdipUIPen


TGdipUIPen.LineCap Property | FlexCel Studio for the .NET Framework documentation

TGdipUIPen.LineCap Property

Gets or sets the line cap of the pen.

Syntax

Namespace: FlexCel.Draw

public override TLineCap LineCap { get; set; }

See also

  • TGdipUIPen


TGdipUIPen.LineJoin Property | FlexCel Studio for the .NET Framework documentation

TGdipUIPen.LineJoin Property

Gets or sets the line join for the pen.

Syntax

Namespace: FlexCel.Draw

public override TLineJoin LineJoin { get; set; }

See also

  • TGdipUIPen


TGdipUIPen.MiterLimit Property | FlexCel Studio for the .NET Framework documentation

TGdipUIPen.MiterLimit Property

Gets or sets the miter limit for the pen.

Syntax

Namespace: FlexCel.Draw

public override Double MiterLimit { get; set; }

See also

  • TGdipUIPen


TGdipUIPen.HeadArrow Property | FlexCel Studio for the .NET Framework documentation

TGdipUIPen.HeadArrow Property

Defines a start arrow for the lines.

Syntax

Namespace: FlexCel.Draw

public override TLineArrow HeadArrow { get; set; }

See also

  • TGdipUIPen


TGdipUIPen.TailArrow Property | FlexCel Studio for the .NET Framework documentation

TGdipUIPen.TailArrow Property

Defines a start arrow for the lines.

Syntax

Namespace: FlexCel.Draw

public override TLineArrow TailArrow { get; set; }

See also

  • TGdipUIPen


TGdipUIPen.Handle Property | FlexCel Studio for the .NET Framework documentation

TGdipUIPen.Handle Property

Returns the encapsulated Pen object.

Syntax

Namespace: FlexCel.Draw

public Pen Handle { get; }

See also

  • TGdipUIPen


TGdipUISolidBrush Class | FlexCel Studio for the .NET Framework documentation

TGdipUISolidBrush Class

Encapsulates a native solid brush.

Syntax

Namespace: FlexCel.Draw

public class TGdipUISolidBrush: TUISolidBrush, IGdipUIBrush

Constructors

Name | Description
TGdipUISolidBrush | Creates a new UISolidBrush which encapsulates an existing GDI+ SolidBrush. Note that if you are encapsulating a brush from Brushes.Color class, you need to pass false in aNeedsDispose, since this class shouldn't dispose the brush when disposing the class.

Methods

Name | Description
Dispose | Override this method to dispose your own objects in your descending classes.

Properties

Name | Description
Color | Returns the color of the brush.
Handle | System.​Drawing.​Brush encapsulated by this object.


TGdipUISolidBrush.TGdipUISolidBrush Constructor | FlexCel Studio for the .NET Framework documentation

TGdipUISolidBrush.TGdipUISolidBrush Constructor

Creates a new UISolidBrush which encapsulates an existing GDI+ SolidBrush. Note that if you are encapsulating a brush from Brushes.Color class, you need to pass false in aNeedsDispose, since this class shouldn't dispose the brush when disposing the class.

Syntax

Namespace: FlexCel.Draw

public TGdipUISolidBrush(SolidBrush aBrush, Boolean aNeedsDispose)

Parameters

<-> | Parameter | Type | Description
 | aBrush | SolidBrush | GDI+ brush which will define this brush.
 | aNeedsDispose | Boolean | If true, this class will own the GDI+ brush, and dispose it when you dispose the class. If false, the GDI+ brush will not be disposed when disposing this class. If you are using a brush from Brushes class, you should set this to false. We don't want to dispose system brushes.

See also

  • TGdipUISolidBrush


TGdipUISolidBrush.Dispose Method | FlexCel Studio for the .NET Framework documentation

TGdipUISolidBrush.Dispose Method

Override this method to dispose your own objects in your descending classes.

Syntax

Namespace: FlexCel.Draw

protected override void Dispose(Boolean disposing)

Parameters

<-> | Parameter | Type | Description
 | disposing | Boolean | If true, this is a direct call to Dispose(), and you need to dispose both managed and unmanaged resources. If false, this is called by the finalizer, and you only need to release unmanaged resources.

See also

  • TGdipUISolidBrush


TGdipUISolidBrush.Color Property | FlexCel Studio for the .NET Framework documentation

TGdipUISolidBrush.Color Property

Returns the color of the brush.

Syntax

Namespace: FlexCel.Draw

public override TUIColor Color { get; }

See also

  • TGdipUISolidBrush


TGdipUISolidBrush.Handle Property | FlexCel Studio for the .NET Framework documentation

TGdipUISolidBrush.Handle Property

System.Drawing.Brush encapsulated by this object.

Syntax

Namespace: FlexCel.Draw

public Brush Handle { get; }

See also

  • TGdipUISolidBrush


TGdipUITextureBrush Class | FlexCel Studio for the .NET Framework documentation

TGdipUITextureBrush Class

An encapsulation of a GDI+ TextureBrush.

Syntax

Namespace: FlexCel.Draw

public class TGdipUITextureBrush: TUITextureBrush, IGdipUIBrush

Constructors

Name | Description
TGdipUITextureBrush | Creates a new UITextureBrush which encapsulates an existing GDI+ TextureBrush. Note that if you are encapsulating a brush from Brushes.Color class, you need to pass false in aNeedsDispose, since this class shouldn't dispose the brush when disposing the class.

Methods

Name | Description
Dispose | Override this method to dispose your own objects in your descending classes.

Properties

Name | Description
Image | Image used to paint the brush.
TransformElements | Transform matrix.
Handle | System.​Graphics.​Brush encapsulated by this instance.


TGdipUITextureBrush.TGdipUITextureBrush Constructor | FlexCel Studio for the .NET Framework documentation

TGdipUITextureBrush.TGdipUITextureBrush Constructor

Creates a new UITextureBrush which encapsulates an existing GDI+ TextureBrush. Note that if you are encapsulating a brush from Brushes.Color class, you need to pass false in aNeedsDispose, since this class shouldn't dispose the brush when disposing the class.

Syntax

Namespace: FlexCel.Draw

public TGdipUITextureBrush(TextureBrush aBrush, Boolean aNeedsDispose)

Parameters

<-> | Parameter | Type | Description
 | aBrush | TextureBrush | GDI+ brush which will define this brush.
 | aNeedsDispose | Boolean | If true, this class will own the GDI+ brush, and dispose it when you dispose the class. If false, the GDI+ brush will not be disposed when disposing this class. If you are using a brush from Brushes class, you should set this to false. We don't want to dispose system brushes.

See also

  • TGdipUITextureBrush


TGdipUITextureBrush.Dispose Method | FlexCel Studio for the .NET Framework documentation

TGdipUITextureBrush.Dispose Method

Override this method to dispose your own objects in your descending classes.

Syntax

Namespace: FlexCel.Draw

protected override void Dispose(Boolean disposing)

Parameters

<-> | Parameter | Type | Description
 | disposing | Boolean | If true, this is a direct call to Dispose(), and you need to dispose both managed and unmanaged resources. If false, this is called by the finalizer, and you only need to release unmanaged resources.

See also

  • TGdipUITextureBrush


TGdipUITextureBrush.Image Property | FlexCel Studio for the .NET Framework documentation

TGdipUITextureBrush.Image Property

Image used to paint the brush.

Syntax

Namespace: FlexCel.Draw

public override TUIImage Image { get; }

See also

  • TGdipUITextureBrush


TGdipUITextureBrush.TransformElements Property | FlexCel Studio for the .NET Framework documentation

TGdipUITextureBrush.TransformElements Property

Transform matrix.

Syntax

Namespace: FlexCel.Draw

public override Double[] TransformElements { get; }

See also

  • TGdipUITextureBrush


TGdipUITextureBrush.Handle Property | FlexCel Studio for the .NET Framework documentation

TGdipUITextureBrush.Handle Property

System.Graphics.Brush encapsulated by this instance.

Syntax

Namespace: FlexCel.Draw

public Brush Handle { get; }

See also

  • TGdipUITextureBrush


IGdipUIBrush Interface | FlexCel Studio for the .NET Framework documentation

IGdipUIBrush Interface

Allows to get the handle of the actual GDI+ brush for all the different brushes.

Syntax

Namespace: FlexCel.Draw

public interface IGdipUIBrush;

Properties

Name | Description
Handle | Actual GDI+ object.


IGdipUIBrush.Handle Property | FlexCel Studio for the .NET Framework documentation

IGdipUIBrush.Handle Property

Actual GDI+ object.

Syntax

Namespace: FlexCel.Draw

public abstract Brush Handle { get; }

See also

  • IGdipUIBrush


FlexCel.Pdf Namespace | FlexCel Studio for the .NET Framework documentation

FlexCel.Pdf Namespace

Classes for native PDF support. This namespace implements a small PDF export API that can be used on its own or to convert an xls/x file to PDF.

Classes

Name | Description
FlexCelPdfException | Exception thrown when an exception on the PDF engine happens.
FontEmbedEventArgs | Arguments passed on FlexCelPdfExport.​OnFont​Embed. Use this event to specify which fonts to embed and which fonts to ignore. Note that unicode fonts will be embedded no matter what you say here.
GetFontDataEventArgs | Arguments passed on FlexCelPdfExport.​Get​Font​Data. Use this event to provide font information for embedding.
GetFontFolder​Event​Args | Arguments passed on FlexCelPdfExport.​Get​Font​Folder. Use this event to provide font information for embedding.
PdfMessages | FlexCel Native PDF Constants. It reads the resources from the active locale, and returns the correct string. If your language is not supported and you feel like translating the messages, please send us a copy. We will include it on the next FlexCel version. To add a new language:...[more]
PdfWriter | A simple class for creating PDF files. It will not hold contents into memory, so it can be used with little memory.
TBookmark | An entry on the Bookmark list for a PDF file.
TBookmarkList | A list of bookmarks.
TBuiltInSigner​Factory | This class will create instances of the Built-in signer.
TPdfAttachmentWriter | Class used to write the file contents of one attachment into a PDF file.
TPdfCommentProperties | Properties for a PDF comment.
TPdfDestination | Represents a destination inside a PDF document.
TPdfPng | A class for reading a PNG image. Mostly for internal use, but it can return some very basic information on a PNG file too.
TPdfProperties | Encapsulates the document properties for the PDF file.
TPdfSignature | Describes a non visible signature for a PDF file. For a visible signature, use TPdfVisibleSignature
TPdfSigner | Represents an abstract class to create a pdf PKCS7 DER encoded signature. Descend from this class to create your own SignerFactory implementations.
TPdfSignerFactory | Override this factory when creating your own TPdfSigner class, so it is returned here.
TPdfVisibleSignature | Describes a visible signature in a PDF file. For an invisible signature, see TPdfSignature.
TPngInformation | Basic information about a PNG file.

Interfaces

Name | Description
IPdfPageTagger | Implement this interface in order to tag a pdf file created by TPdfWriter. This interface will be called after every page is generated. Note that FlexCelPdfExport already implements it so there is no need to define it again.
IPdfRoleTag | Implement this interface in order to add roles to the structure tree.
IPdfTagActions | Events that allow you to tag a pdf document.
IPdfTagger | Base interface for tagging pdf documents.
IPdfTeardownTagger | Implement this interface in order to tag a pdf file created by TPdfWriter. This interface will be called after every the document is finished, and allows youto write global tags. Note that FlexCelPdfExport already implements it so there is no need to define it again.

Enumerations

Name | Description
PdfErr | Error Codes. We use this and not actual strings to make sure all are correctly spelled.
TBookmarkStyle | This enum indicates the text style for a bookmark entry. You can combine the entries by or'ing them together.
TFontEmbed | The way fonts will be embedded on the resulting pdf file.
TFontMapping | How fonts will be replaced on the generated PDF file.
TFontSubset | Determines if full fonts will be embedded in the generated pdf files, or only the characters being used.
TPageLayout | Viewer settings when the document is opened for the first time.
TPageLayoutDisplay | How the pages will display when the document is opened for the first time.
TPdfAllowedChanges | Changes allowed in a signed PDF document.
TPdfAttachmentKind | Specifies how the attached file relates to the pdf file. It is required by PDF/A3
TPdfCommentIcon | Icon for a pdf comment
TPdfCommentType | Different types of comments.
TPdfFontFolder​NotFound​Action | Determines what FlexCel should do when a font folder doesn't exist.
TPdfToken | Tokens for creating a PDF file. Internal use.
TPdfType | The variant of pdf that will be created.
TPdfVersion | Specifies the version of PDF that FlexCel will generate.
TTagMode | Specifies how the document will be tagged.
TUnlicensedFont​Action | Determines what to do when trying to embed a font that isn't licensed for embedding.
TZoomOptions | Zoom options for a PDF destination.

Delegates

Name | Description
FontEmbedEvent​Handler | Delegate for reading the font data.
GetFontDataEvent​Handler | Delegate for reading the font data.
GetFontFolder​Event​Handler | Delegate for reading the font data.
TPdfAttachment​Data​Provider​Delegate | Delegate used to attach files to a pdf file.


FlexCelPdfException Class | FlexCel Studio for the .NET Framework documentation

FlexCelPdfException Class

Exception thrown when an exception on the PDF engine happens.

Syntax

Namespace: FlexCel.Pdf

public class FlexCelPdfException: FlexCelException

Constructors

Name | Description
FlexCelPdfException | Overloaded FlexCelPdfException FlexCelPdfException(String) FlexCelPdfException(String, PdfErr) FlexCelPdfException(String, Exception) FlexCelPdfException(String, PdfErr, Exception)

Properties

Name | Description
ErrorCode | Error code on the Exception.


FlexCelPdfException.FlexCelPdfException Constructor | FlexCel Studio for the .NET Framework documentation

FlexCelPdfException.FlexCelPdfException Constructor

Overloads

  • FlexCelPdfException.FlexCelPdfException
  • FlexCelPdfException.FlexCelPdfException(String)
  • FlexCelPdfException.FlexCelPdfException(String, PdfErr)
  • FlexCelPdfException.FlexCelPdfException(String, Exception)
  • FlexCelPdfException.FlexCelPdfException(String, PdfErr, Exception)

FlexCelPdfException.FlexCelPdfException

Creates a new FlexCelPdfException

Syntax

Namespace: FlexCel.Pdf

public FlexCelPdfException()

See also

  • FlexCelPdfException

FlexCelPdfException.FlexCelPdfException(String)

Creates a new FlexCelPdfException with an error message.

Syntax

Namespace: FlexCel.Pdf

public FlexCelPdfException(String message)

Parameters

<-> | Parameter | Type | Description
 | message | String | Error Message

See also

  • FlexCelPdfException

FlexCelPdfException.FlexCelPdfException(String, PdfErr)

Creates a new FlexCelPdfException with an error message and an exception code.

Syntax

Namespace: FlexCel.Pdf

public FlexCelPdfException(String message, PdfErr aErrorCode)

Parameters

<-> | Parameter | Type | Description
 | message | String | Error Message
 | aErrorCode | PdfErr | Error code of the exception.

See also

  • FlexCelPdfException

FlexCelPdfException.FlexCelPdfException(String, Exception)

Creates a nested Exception.

Syntax

Namespace: FlexCel.Pdf

public FlexCelPdfException(String message, Exception inner)

Parameters

<-> | Parameter | Type | Description
 | message | String | Error Message.
 | inner | Exception | Inner Exception.

See also

  • FlexCelPdfException

FlexCelPdfException.FlexCelPdfException(String, PdfErr, Exception)

Creates a nested Exception.

Syntax

Namespace: FlexCel.Pdf

public FlexCelPdfException(String message, PdfErr aErrorCode, Exception inner)

Parameters

<-> | Parameter | Type | Description
 | message | String | Error Message.
 | aErrorCode | PdfErr | Error code of the exception.
 | inner | Exception | Inner Exception.

See also

  • FlexCelPdfException


FlexCelPdfException.ErrorCode Property | FlexCel Studio for the .NET Framework documentation

FlexCelPdfException.ErrorCode Property

Error code on the Exception.

Syntax

Namespace: FlexCel.Pdf

public PdfErr ErrorCode { get; }

See also

  • FlexCelPdfException


FontEmbedEventArgs Class | FlexCel Studio for the .NET Framework documentation

FontEmbedEventArgs Class

Arguments passed on FlexCelPdfExport.OnFontEmbed. Use this event to specify which fonts to embed and which fonts to ignore. Note that unicode fonts will be embedded no matter what you say here.

Syntax

Namespace: FlexCel.Pdf

public class FontEmbedEventArgs: EventArgs

Constructors

Name | Description
FontEmbedEventArgs | Creates a new Argument.

Properties

Name | Description
InputFont | The font for which you need to return the data.
Embed | Return true if you want to embed this font, false if you don't want to. If you don't modify this value, the default will be used.


FontEmbedEventArgs.FontEmbedEventArgs Constructor | FlexCel Studio for the .NET Framework documentation

FontEmbedEventArgs.FontEmbedEventArgs Constructor

Creates a new Argument.

Syntax

Namespace: FlexCel.Pdf

public FontEmbedEventArgs(TUIFont aInputFont, Boolean aEmbed)

Parameters

<-> | Parameter | Type | Description
 | aInputFont | TUIFont |
 | aEmbed | Boolean |

See also

  • FontEmbedEventArgs


FontEmbedEventArgs.InputFont Property | FlexCel Studio for the .NET Framework documentation

FontEmbedEventArgs.InputFont Property

The font for which you need to return the data.

Syntax

Namespace: FlexCel.Pdf

public TUIFont InputFont { get; }

See also

  • FontEmbedEventArgs


FontEmbedEventArgs.Embed Property | FlexCel Studio for the .NET Framework documentation

FontEmbedEventArgs.Embed Property

Return true if you want to embed this font, false if you don't want to. If you don't modify this value, the default will be used.

Syntax

Namespace: FlexCel.Pdf

public Boolean Embed { get; set; }

See also

  • FontEmbedEventArgs


GetFontDataEventArgs Class | FlexCel Studio for the .NET Framework documentation

GetFontDataEventArgs Class

Arguments passed on FlexCelPdfExport.GetFontData. Use this event to provide font information for embedding.

Syntax

Namespace: FlexCel.Pdf

public class GetFontDataEventArgs: EventArgs

Constructors

Name | Description
GetFontDataEventArgs | Creates a new Argument.

Properties

Name | Description
FontData | Return the full font file as a byte array here.
Applied | Set Applied = false if the font is not being processed by the event.
InputFont | The font for which you need to return the data.


GetFontDataEventArgs.GetFontDataEventArgs Constructor | FlexCel Studio for the .NET Framework documentation

GetFontDataEventArgs.GetFontDataEventArgs Constructor

Creates a new Argument.

Syntax

Namespace: FlexCel.Pdf

public GetFontDataEventArgs(TUIFont aFont)

Parameters

<-> | Parameter | Type | Description
 | aFont | TUIFont |

See also

  • GetFontDataEventArgs


GetFontDataEventArgs.FontData Property | FlexCel Studio for the .NET Framework documentation

GetFontDataEventArgs.FontData Property

Return the full font file as a byte array here.

Syntax

Namespace: FlexCel.Pdf

public Byte[] FontData { get; set; }

See also

  • GetFontDataEventArgs


GetFontDataEventArgs.Applied Property | FlexCel Studio for the .NET Framework documentation

GetFontDataEventArgs.Applied Property

Set Applied = false if the font is not being processed by the event.

Syntax

Namespace: FlexCel.Pdf

public Boolean Applied { get; set; }

See also

  • GetFontDataEventArgs


GetFontDataEventArgs.InputFont Property | FlexCel Studio for the .NET Framework documentation

GetFontDataEventArgs.InputFont Property

The font for which you need to return the data.

Syntax

Namespace: FlexCel.Pdf

public TUIFont InputFont { get; }

See also

  • GetFontDataEventArgs


GetFontFolderEventArgs Class | FlexCel Studio for the .NET Framework documentation

GetFontFolderEventArgs Class

Arguments passed on FlexCelPdfExport.GetFontFolder. Use this event to provide font information for embedding.

Syntax

Namespace: FlexCel.Pdf

public class GetFontFolderEventArgs: EventArgs

Constructors

Name | Description
GetFontFolder​Event​Args | Creates a new Argument.

Properties

Name | Description
FontPath | Return here the font path to the "Fonts" folder where ttf files are located. FlexCel will search in the folder you return here, and in **all subfolders** of that folder for ttf files. In Android, we use a "@folder" syntax to refer to assets. So for example to specify that the fonts are in the "fonts" folder asset, return "@fonts" here. If the fonts are in a normal folder, just return the folder. You can return more than one folder here, separating them with semicolons (;). So you could for example return the string 'c:​\font1folder;​c:​\font2folder' and FlexCel will search inside font1folder and font2folder. ...[more]
Applied | Set Applied = false if the font is not being processed by the event, and FlexCel should try to find the font path for the font as if the event wasn't assigned.
InputFont | The font for which you need to return the data.


GetFontFolderEventArgs.GetFontFolderEventArgs Constructor | FlexCel Studio for the .NET Framework documentation

GetFontFolderEventArgs.GetFontFolderEventArgs Constructor

Creates a new Argument.

Syntax

Namespace: FlexCel.Pdf

public GetFontFolderEventArgs(TUIFont aFont, String aPath)

Parameters

<-> | Parameter | Type | Description
 | aFont | TUIFont |
 | aPath | String |

See also

  • GetFontFolderEventArgs


GetFontFolderEventArgs.FontPath Property | FlexCel Studio for the .NET Framework documentation

GetFontFolderEventArgs.FontPath Property

Return here the font path to the "Fonts" folder where ttf files are located.

FlexCel will search in the folder you return here, and in **all subfolders** of that folder for ttf files.

In Android, we use a "@folder" syntax to refer to assets. So for example to specify that the fonts are in the "fonts" folder asset, return "@fonts" here. If the fonts are in a normal folder, just return the folder.

You can return more than one folder here, separating them with semicolons (;). So you could for example return the string 'c:\font1folder;c:\font2folder' and FlexCel will search inside font1folder and font2folder.

Note: In FlexCel 6 we've changed this name from "FontFolder" to "FontPath" because the behavior changed, so you code won't compile and you get a chance to fix the FontFolder references. In FlexCel 5 or older, after specifying the path, FlexCel would append "..\Fonts" to whatever you specified, unless a variable "AppendFontFolder" was true. In FlexCel 6 we've simplified this in order to comply with all the possible font folders in different OSs. Now "FontPath" is the actual font path, FlexCel won't add anything to it.

When replacing FontFolder by FontPath in your app, make sure to Add "..\Fonts" if needed, as FontPath won't add it.

Syntax

Namespace: FlexCel.Pdf

public String FontPath { get; set; }

See also

  • GetFontFolderEventArgs


GetFontFolderEventArgs.Applied Property | FlexCel Studio for the .NET Framework documentation

GetFontFolderEventArgs.Applied Property

Set Applied = false if the font is not being processed by the event, and FlexCel should try to find the font path for the font as if the event wasn't assigned.

Syntax

Namespace: FlexCel.Pdf

public Boolean Applied { get; set; }

See also

  • GetFontFolderEventArgs


GetFontFolderEventArgs.InputFont Property | FlexCel Studio for the .NET Framework documentation

GetFontFolderEventArgs.InputFont Property

The font for which you need to return the data.

Syntax

Namespace: FlexCel.Pdf

public TUIFont InputFont { get; }

See also

  • GetFontFolderEventArgs


PdfMessages Class | FlexCel Studio for the .NET Framework documentation

PdfMessages Class

FlexCel Native PDF Constants. It reads the resources from the active locale, and returns the correct string. If your language is not supported and you feel like translating the messages, please send us a copy. We will include it on the next FlexCel version.

To add a new language:

  1. Copy the file pdfmsg.resx to your language (for example, pdfmsg.es.resx to translate to spanish)
  2. Edit the new file and change the messages.
  3. Add the .resx file to the FlexCel project

Syntax

Namespace: FlexCel.Pdf

public static class PdfMessages

Methods

Name Description
GetString Reruns a string based on the PdfErr enumerator, formatted with args.
This method is used to get an Exception error message.
ThrowException Overloaded
 ThrowException(PdfErr, Object[])
ThrowException(Exception, PdfErr, Object[])


PdfMessages.GetString Method | FlexCel Studio for the .NET Framework documentation

PdfMessages.GetString Method

Reruns a string based on the PdfErr enumerator, formatted with args. This method is used to get an Exception error message.

Syntax

Namespace: FlexCel.Pdf

public static String GetString(PdfErr ResName, params Object[] args)

Parameters

<-> | Parameter | Type | Description
 | ResName | PdfErr | Error Code.
params | args | Object[] | Parameters for this error.

See also

  • PdfMessages


PdfMessages.ThrowException Method | FlexCel Studio for the .NET Framework documentation

PdfMessages.ThrowException Method

Overloads

  • PdfMessages.ThrowException(PdfErr, Object[])
  • PdfMessages.ThrowException(Exception, PdfErr, Object[])

PdfMessages.ThrowException(PdfErr, Object[])

Throws a standard FlexCelPdfException.

Syntax

Namespace: FlexCel.Pdf

public static void ThrowException(PdfErr ResName, params Object[] args)

Parameters

<-> | Parameter | Type | Description
 | ResName | PdfErr | Error Code.
params | args | Object[] | Parameters for this error.

See also

  • PdfMessages

PdfMessages.ThrowException(Exception, PdfErr, Object[])

Throws a standard FlexCelPdfException with innerException.

Syntax

Namespace: FlexCel.Pdf

public static void ThrowException(Exception e, PdfErr ResName, params Object[] args)

Parameters

<-> | Parameter | Type | Description
 | e | Exception | Inner exception.
 | ResName | PdfErr | Error Code.
params | args | Object[] | Parameters for this error.

See also

  • PdfMessages


PdfWriter Class | FlexCel Studio for the .NET Framework documentation

PdfWriter Class

A simple class for creating PDF files. It will not hold contents into memory, so it can be used with little memory.

Remarks

This class is not intended for providing a complete API for writing PDFs, only what is necessary to create them from xls files. Even when this class could be used standalone, on most cases FlexCelPdfExport should be used.

Syntax

Namespace: FlexCel.Pdf

public class PdfWriter

Constructors

Name | Description
PdfWriter | Creates a new PDF file instance.

Methods

Name | Description
BeginDoc Call this method before starting the output.
It will initialize a new page. After this you can call DrawString(​​String, TUIFont, TUIBrush, Double, Double), NewPage, etc.
Always end the document with a call to EndDoc and then remember to close the stream.
EndDoc Always call this method to write the final part of a pdf file.
NewPage Closes the active page and creates a new one. All following commands will go to the new page.
DrawString Overloaded
 DrawString(String, TUIFont, TUIBrush, Double, Double)
DrawString(String, TUIFont, TUITextDecoration, TUIBrush, Double, Double)
DrawString(String, TUIFont, TUIPen, TUIBrush, Double, Double)
DrawString(String, TUIFont, TUITextDecoration, TUIPen, TUIBrush, Double, Double)
Hyperlink Overloaded
 Hyperlink(Double, Double, Double, Double, String)
Hyperlink(Double, Double, Double, Double, Uri)
Hyperlink(Double, Double, Double, Double, Int32, Double, Double)
Comment Creates a comment on the pdf file.
GetBookmarks Returns all the bookmarks on the file. Note that this will return a COPY of the bookmarks, so changing them will not change them in the file. You need to use SetBookmarks to replace the new list.
SetBookmarks Replaces the bookmarks on the file with other list. The new list will be copied, so you can change the old list after setting it and it will not affect the file.
AddBookmark Adds a new bookmark to the document.
MeasureString | Returns the size of a string in points * Scale. (1/72 of an inch * Scale)
FontHeight | Returns the font height on points * Scale. (1/72 of an inch * Scale)
FontLinespacing | Returns the font white space on points * Scale. (1/72 of an inch * Scale)
FontDescent | Returns the font height on points * Scale. (1/72 of an inch * Scale)
DrawLine Draws a line on the current page.
DrawLines Draws an array of line connecting pairs of points.
FillRectangle Fills the interior of a rectangle specified by a pair of coordinates, a width, and a height.
No line is drawn around the rectangle.
DrawRectangle Draws a rectangle specified by a coordinate pair, a width, and a height.
DrawAndFillRectangle Draws and fills a rectangle specified by a coordinate pair, a width, and a height.
DrawAndFillBeziers Draws and/or fills a bezier path. If Brush is not null, the shape will be closed for filling.
DrawAndFillMulti​Beziers Draws and/or fills a bezier path.
DrawAndFillPolygon Draws and/or fills a polygon. The shape will be closed.
IntersectClipRegion Intersects the current clipping region with the new one.
There is no command to reset or expand a clipping region, you need to use SaveState and RestoreState
ClipRectangle Intersect the clip region with a rectangle specified by a pair of coordinates, a width, and a height.
ClipPolygon Intersects the clipping area with a polygon.
ClipBeziers Intersects the clipping area with a bezier region.
ClipMultiBeziers Intersects the clipping area with multiple bezier regions.
DrawImage Overloaded
 DrawImage(TUIImage, TUIRectangle, Stream)
DrawImage(TUIImage, TUIRectangle, Stream, Int64, Boolean)
Rotate Rotates the canvas around point (x,y).
ScaleBy Overloaded
 ScaleBy(Double, Double)
ScaleBy(Double, Double, Double, Double)
GetMatrix Returns the drawing matrix in use. The elements in this matrix are similar to the ones returned by "System.​Drawing.​Drawing2D.​Matrix.​Elements" and have the same meaning.
Important remark. This matrix is the real one, and does not consider things like YAxisGrowsDown or Scale. You will probably want to use Transform(​​TPointF) to find out the coordinates of a point.
Transform Overloaded
 Transform(TPointF)
Transform(TPointF, Double[])
SaveState Saves the current graphic state. Be sure to always call RestoreState each time you call this method.
RestoreState Restores the graphic state saved by a SaveState call.
Sign Signs the pdf documents with the specified TPdfSignature or TPdfVisibleSignature.
Note: This method must be called before calling BeginDoc
TagContentBegin | Marks the start of a content tag inside a stream. Must be finished with a call to TagContentEnd
TagContentEnd | Ends marking content which started with TagContentBegin
AttachFile Overloaded
 AttachFile(String, String, String, TPdfAttachmentKind)
AttachFile(String, String, String, DateTime, TPdfAttachmentKind, TPdfAttachmentDataProviderDelegate)
ClearAttachments Removes all existing attachments in the writer.

Properties

Name Description
Compress Set it to true to compress the text on the generated pdf file.
Properties Properties of the PDF file.
PageSize Page size of the active page. You can change it *before* calling NewPage() and it will change for the new sheets.
Note that once NewPage() (or BeginDoc() for the first page) is called, the page size will remain constant for that page.
This property must be changed before.
YAxisGrowsDown When true, the y axis origin corresponds to the upper corner of a sheet and bigger Y coordinates will move down on the paper. This is the standard GDI+ behavior.
When false, the Y origin is at the bottom and it grows up into the page. This is the standard PDF behavior.
AddFontDescent When false, (the default) text base will be at the y coordinate. For example, DrawString(..., y=100,...) will draw a string with its base at 100. Font descent (for example the lower part of a "p") will be below 100, and the ascent (the upper part) will be above. This is the standard PDF behavior.
When true, all text will be drawn above the y coordinate. (both ascent and descent).
This is the standard GDI+ behavior, when StringFormat.​Line​Alignment=​String​Alignment.​Far.​
Scale A scale factor to change X and Y coordinates. When Scale=1, the using is the point (1/72 of an inch).
Font size is not affected by scale, it is always in points.
PdfType Defines the type of pdf being created. Note that if you set this property to other value than standard, other properties might be ignored. For example, when creating a PDF/A file all fonts must be embedded so the value of the FontEmbed property will be ignored.
UnlicensedFontAction Defines what to do when a font has a license that doesn't allow embedding, and you are trying to embed the font.
UnlicensedReplacement​Font When trying to embed a font that isn't licensed for embedding, and UnlicensedFontAction is TUnlicensedFont​Action.​Replace this property specifies the font that will be used to replace it. If null or empty, Arial will be used.
PdfVersion Defines the version of pdf being created. For maximum compatibility you can choose PDF 1.4. (Acrobat 5.0, but can be opened by any version of Acrobat, even if version less than 1.4 won't have all the features).
Choosing PDF 1.6 (Acrobat 7) allows for more compression and smaller files, but you'll need Acrobat 7 or newer to see the files. Older versions won't be able to open it at all.

Note that this value will be ignored if you are creating PDFA-1 (as it requires PDF1-4). Also for signing, FlexCel requires PDF1-6.
EmbedColorProfile If true, a color profile will be embedded in the generated pdf files. An embedded color profile can increase the size of the generated file in some kilobytes, and it isn't required or needed, so you'll normally want to keep this property false. For PDF/A, it is required, but when you set the PdfType to PDF/A the color profile will always be included anyway, and this property will be ignored.
FontEmbed Determines what fonts will be embedded on the generated pdf.
Note that when using UNICODE fonts WILL BE EMBEDDED no matter the value of this property. Also if creating PDF/A files.
FontSubset When FontEmbed is set to embed the fonts, this setting determines if the full font will be embedded, or only the characters used in the document. If the full font is embedded the resulting file will be larger, but it will be possible to edit it with a third party tool once it has been generated.
FontMapping Determines how fonts will be replaced on the generated pdf. Pdf comes with 4 standard font families, Serif, Sans-Serif, Monospace and Symbol. You can use for example the standard Helvetica instead of Arial and do not worry about embedding the font.
Kerning By default, pdf does not do any kerning with the fonts. This is, on the string "AVANT", it won't compensate the spaces between "A" and "V". (they should be smaller) If you turn this property on, FlexCel will calculate the kerning and add it to the generated file.
The result file will be a little bigger because of the kerning info on all strings, but it will also look a little better.
UseFauxStyles When a font doesn't have a bold, italic or bold-italic variant, FlexCel can't export bold, italic or bold-italic characters to the pdf respectively. When this property is true (the default), FlexCel will try to "fake" those missing styles by using a wider pen width for the characters to simulate bold, or doing a slant transform to simulate italics.

The results of a simulated bold or italic can be not great, so if you prefer that FlexCel doesn't try to simulate bold or italics, then you can set this property to false. If this property is false and the font you are using doesn't have bold or italics variants, then the pdf won't show bold or italics for that font.
...[more]
FallbackFonts A semicolon (;) separated list of font names to try when a character is not found in the used font.

When a character is not found in a font, it will display as an empty square by default. By setting this property, FlexCel will try to find a font that supports this character in this list, and if found, use that font to render the character.
FallbackFontsBold A semicolon (;) separated list of font names similar to FallbackFonts that will be used only for bold fonts.

If you fallback fonts already contain bold variants, you don't need to set this property.
This property is only if you want to use different font fallbacks for bold fonts and regular fonts.
FallbackFontsItalic A semicolon (;) separated list of font names similar to FallbackFonts that will be used only for italic fonts.

If you fallback fonts already contain italic variants, you don't need to set this property.
This property is only if you want to use different font fallbacks for italic fonts and regular fonts.
FallbackFonts​Bold​Italic A semicolon (;) separated list of font names similar to FallbackFonts that will be used only for fonts which are both bold and italic.

If you fallback fonts already contain bold-italic variants, you don't need to set this property.
This property is only if you want to use different font fallbacks for bold-italic fonts and regular fonts.
GetFontData Use this event if you want to provide your own font information for embedding for a particular instance.
Note that if you don't assign this event, GetFontDataGlobal will be used instead.
If GetFontData and GetFontDataGlobal are not assigned the default method will be used, and this will try to find the font on the Fonts folder. To change the font folder, use GetFontFolder event
GetFontDataGlobal Use this event if you want to provide your own font information for embedding for the full application.
Note that if you assign GetFontData for a particular object instance it will be used instead.
Important: This event isn't thread safe or guarded by any lock. You should set it once when your application starts and never modify it. For changing a particular instance, use GetFontData instead. If you aren't sure, use GetFontData
GetFontFolder Use this event if you want to provide your own font information for embedding for a particular object instance.

For changing the font folder for the full application, use GetFontFolderGlobal instead.
Normally FlexCel will search for fonts on [System]\Fonts folder and %localappdata%​\Microsoft\Windows\Fonts. If your fonts are in other location, you can tell FlexCel where they are here. If you prefer just to give FlexCel the full data on the font, you can use...[more]
GetFontFolderGlobal Use this event if you want to provide your own font folder for the full application.
Note that if you assign GetFontFolder for a particular object instance it will be used instead.
Important: This event isn't thread safe or guarded by any lock. You should set it once when your application starts and never modify it. For changing a particular instance, use GetFontFolder instead. If you aren't sure, use GetFontFolder
Note that you can return more than one path by separating them with semicolons. For example if you return "c:​\fonts1;​c:​\fonts2" FlexCel will search both in fonts1 and fonts2. Every folder you specify here must have at least one font.
...[more]
OnFontEmbed Use this event if you want to manually specify which fonts to embed into the pdf document.
Note that this applies for a single PdfWriter instance, to set it for the full application, use OnFontEmbedGlobal
OnFontEmbedGlobal Use this event if you want to manually specify which fonts to embed into the pdf document for the full application.
Note that if you assign OnFontEmbed for a particular object instance it will be used instead.
Important: This event isn't thread safe or guarded by any lock. You should set it once when your application starts and never modify it. For changing a particular instance, use OnFontEmbed instead. If you aren't sure, use OnFontEmbed ...[more]
OnFontFolderNotFound This property determines how FlexCel behaves when one of the folders you specify in GetFontFolder doesn't exist.
Note that this applies for a single PdfWriter instance, to set it for the full application, use OnFontFolder​NotFound​Global
OnFontFolder​NotFound​Global This property determines how FlexCel behaves when one of the folders you specify in GetFontFolder doesn't exist.
Important: This event isn't thread safe or guarded by any lock. You should set it once when your application starts and never modify it. For changing a particular instance, use OnFontFolderNotFound instead. If you aren't sure, use OnFontFolderNotFound
PageLayout Sets the default page layout when opening the document.
PageLayoutDisplay Sets the default page display layout when opening the document.
InitialZoomAndPage Sets the default zoom and initial page when opening the document.
TagActions Implement this interface in order to define the tags.


PdfWriter.PdfWriter Constructor | FlexCel Studio for the .NET Framework documentation

PdfWriter.PdfWriter Constructor

Creates a new PDF file instance.

Syntax

Namespace: FlexCel.Pdf

public PdfWriter()

See also

  • PdfWriter


PdfWriter.BeginDoc Method | FlexCel Studio for the .NET Framework documentation

PdfWriter.BeginDoc Method

Call this method before starting the output. It will initialize a new page. After this you can call DrawString(String, TUIFont, TUIBrush, Double, Double), NewPage, etc. Always end the document with a call to EndDoc and then remember to close the stream.

Syntax

Namespace: FlexCel.Pdf

public void BeginDoc(Stream aDataStream)

Parameters

<-> | Parameter | Type | Description
 | aDataStream | Stream |

See also

  • PdfWriter


PdfWriter.EndDoc Method | FlexCel Studio for the .NET Framework documentation

PdfWriter.EndDoc Method

Always call this method to write the final part of a pdf file.

Syntax

Namespace: FlexCel.Pdf

public void EndDoc()

See also

  • PdfWriter


PdfWriter.NewPage Method | FlexCel Studio for the .NET Framework documentation

PdfWriter.NewPage Method

Closes the active page and creates a new one. All following commands will go to the new page.

Syntax

Namespace: FlexCel.Pdf

public void NewPage()

See also

  • PdfWriter


PdfWriter.DrawString Method | FlexCel Studio for the .NET Framework documentation

PdfWriter.DrawString Method

Overloads

  • PdfWriter.DrawString(String, TUIFont, TUIBrush, Double, Double)
  • PdfWriter.DrawString(String, TUIFont, TUITextDecoration, TUIBrush, Double, Double)
  • PdfWriter.DrawString(String, TUIFont, TUIPen, TUIBrush, Double, Double)
  • PdfWriter.DrawString(String, TUIFont, TUITextDecoration, TUIPen, TUIBrush, Double, Double)

PdfWriter.DrawString(String, TUIFont, TUIBrush, Double, Double)

Writes a string to the current page. This overload doesn't do text decorations like underline or strike-through.

Syntax

Namespace: FlexCel.Pdf

public void DrawString(String s, TUIFont aFont, TUIBrush aBrush, Double x, Double y)

Parameters

<-> | Parameter | Type | Description
 | s | String | String to write.
 | aFont | TUIFont | Font to draw the text.
 | aBrush | TUIBrush | Brush used for Color.
 | x | Double | X coord. (default from bottom left)
 | y | Double | Y coord. (default from bottom left. Might change with YAxisGrowsDown value)

See also

  • PdfWriter

PdfWriter.DrawString(String, TUIFont, TUITextDecoration, TUIBrush, Double, Double)

Writes a string to the current page.

Syntax

Namespace: FlexCel.Pdf

public void DrawString(String s, TUIFont aFont, TUITextDecoration aTextDecoration, TUIBrush aBrush, Double x, Double y)

Parameters

<-> | Parameter | Type | Description
 | s | String | String to write.
 | aFont | TUIFont | Font to draw the text.
 | aTextDecoration | TUITextDecoration | Text decorations, like underline or strikeout.
 | aBrush | TUIBrush | Brush used for Color.
 | x | Double | X coord. (default from bottom left)
 | y | Double | Y coord. (default from bottom left. Might change with YAxisGrowsDown value)

See also

  • PdfWriter

PdfWriter.DrawString(String, TUIFont, TUIPen, TUIBrush, Double, Double)

Writes a string to the current page. . This overload doesn't do text decorations like underline or strike-through.

Syntax

Namespace: FlexCel.Pdf

public void DrawString(String s, TUIFont aFont, TUIPen aPen, TUIBrush aBrush, Double x, Double y)

Parameters

<-> | Parameter | Type | Description
 | s | String | String to write.
 | aFont | TUIFont | Font to draw the text.
 | aPen | TUIPen | Pen to draw the text outline. If null, no outline will be drawn.
 | aBrush | TUIBrush | Brush used for Color. If null, only the outline will be drawn.
 | x | Double | X coord. (default from bottom left)
 | y | Double | Y coord. (default from bottom left. Might change with YAxisGrowsDown value)

See also

  • PdfWriter

PdfWriter.DrawString(String, TUIFont, TUITextDecoration, TUIPen, TUIBrush, Double, Double)

Writes a string to the current page.

Syntax

Namespace: FlexCel.Pdf

public void DrawString(String s, TUIFont aFont, TUITextDecoration aTextDecoration, TUIPen aPen, TUIBrush aBrush, Double x, Double y)

Parameters

<-> | Parameter | Type | Description
 | s | String | String to write.
 | aFont | TUIFont | Font to draw the text.
 | aTextDecoration | TUITextDecoration | Underlines and strikeouts of the text.
 | aPen | TUIPen | Pen to draw the text outline. If null, no outline will be drawn.
 | aBrush | TUIBrush | Brush used for Color. If null, only the outline will be drawn.
 | x | Double | X coord. (default from bottom left)
 | y | Double | Y coord. (default from bottom left. Might change with YAxisGrowsDown value)

See also

  • PdfWriter


PdfWriter.Hyperlink Method | FlexCel Studio for the .NET Framework documentation

PdfWriter.Hyperlink Method

Overloads

  • PdfWriter.Hyperlink(Double, Double, Double, Double, String)
  • PdfWriter.Hyperlink(Double, Double, Double, Double, Uri)
  • PdfWriter.Hyperlink(Double, Double, Double, Double, Int32, Double, Double)

PdfWriter.Hyperlink(Double, Double, Double, Double, String)

Creates an Hyperlink on the selected region with the specified Url.

Syntax

Namespace: FlexCel.Pdf

public void Hyperlink(Double x, Double y, Double width, Double height, String url)

Parameters

<-> | Parameter | Type | Description
 | x | Double | x coord.
 | y | Double | y coord.
 | width | Double | Width of the region.
 | height | Double | Height of the region.
 | url | String | Url where to navigate to.

See also

  • PdfWriter

PdfWriter.Hyperlink(Double, Double, Double, Double, Uri)

Creates an Hyperlink on the selected region with the specified Url.

Syntax

Namespace: FlexCel.Pdf

public void Hyperlink(Double x, Double y, Double width, Double height, Uri url)

Parameters

<-> | Parameter | Type | Description
 | x | Double | x coord.
 | y | Double | y coord.
 | width | Double | Width of the region.
 | height | Double | Height of the region.
 | url | Uri | Url where to navigate to.

See also

  • PdfWriter

PdfWriter.Hyperlink(Double, Double, Double, Double, Int32, Double, Double)

Creates a local Hyperlink on the selected region to another page of the pdf document.

Syntax

Namespace: FlexCel.Pdf

public void Hyperlink(Double x, Double y, Double width, Double height, Int32 pageDest, Double xDest, Double yDest)

Parameters

<-> | Parameter | Type | Description
 | x | Double | x coord.
 | y | Double | y coord.
 | width | Double | Width of the region.
 | height | Double | Height of the region.
 | pageDest | Int32 | Page where the hyperlink will go.
 | xDest | Double | X offset from the start of the page for the destination.
 | yDest | Double | Y offset from the start of the page for the destination.

See also

  • PdfWriter


PdfWriter.Comment Method | FlexCel Studio for the .NET Framework documentation

PdfWriter.Comment Method

Creates a comment on the pdf file.

Syntax

Namespace: FlexCel.Pdf

public void Comment(Double x, Double y, Double width, Double height, String comment, TPdfCommentProperties commentProperties)

Parameters

<-> | Parameter | Type | Description
 | x | Double | x coord.
 | y | Double | y coord.
 | width | Double | Width of the region.
 | height | Double | Height of the region.
 | comment | String | Text to put into the comment.
 | commentProperties | TPdfCommentProperties | Properties for the comment.

See also

  • PdfWriter


PdfWriter.GetBookmarks Method | FlexCel Studio for the .NET Framework documentation

PdfWriter.GetBookmarks Method

Returns all the bookmarks on the file. Note that this will return a COPY of the bookmarks, so changing them will not change them in the file. You need to use SetBookmarks to replace the new list.

Syntax

Namespace: FlexCel.Pdf

public TBookmarkList GetBookmarks()

See also

  • PdfWriter


PdfWriter.SetBookmarks Method | FlexCel Studio for the .NET Framework documentation

PdfWriter.SetBookmarks Method

Replaces the bookmarks on the file with other list. The new list will be copied, so you can change the old list after setting it and it will not affect the file.

Syntax

Namespace: FlexCel.Pdf

public void SetBookmarks(TBookmarkList bookmarks)

Parameters

<-> | Parameter | Type | Description
 | bookmarks | TBookmarkList | List to replace. If null, bookmarks will be cleared.

See also

  • PdfWriter


PdfWriter.AddBookmark Method | FlexCel Studio for the .NET Framework documentation

PdfWriter.AddBookmark Method

Adds a new bookmark to the document.

Syntax

Namespace: FlexCel.Pdf

public void AddBookmark(TBookmark bookmark)

Parameters

<-> | Parameter | Type | Description
 | bookmark | TBookmark |

See also

  • PdfWriter


PdfWriter.MeasureString Method | FlexCel Studio for the .NET Framework documentation

PdfWriter.MeasureString Method

Returns the size of a string in points * Scale. (1/72 of an inch * Scale)

Syntax

Namespace: FlexCel.Pdf

public TUISize MeasureString(String text, TUIFont aFont)

Parameters

<-> | Parameter | Type | Description
 | text | String | String to measure.
 | aFont | TUIFont | Font to measure

Returns

Size of the string in points.

See also

  • PdfWriter


PdfWriter.FontHeight Method | FlexCel Studio for the .NET Framework documentation

PdfWriter.FontHeight Method

Returns the font height on points * Scale. (1/72 of an inch * Scale)

Syntax

Namespace: FlexCel.Pdf

public Double FontHeight(TUIFont aFont)

Parameters

<-> | Parameter | Type | Description
 | aFont | TUIFont | Font to measure.

Returns

Font height.

See also

  • PdfWriter


PdfWriter.FontLinespacing Method | FlexCel Studio for the .NET Framework documentation

PdfWriter.FontLinespacing Method

Returns the font white space on points * Scale. (1/72 of an inch * Scale)

Syntax

Namespace: FlexCel.Pdf

public Double FontLinespacing(TUIFont aFont)

Parameters

<-> | Parameter | Type | Description
 | aFont | TUIFont | Font to measure.

Returns

The blank space between lines.

See also

  • PdfWriter


PdfWriter.FontDescent Method | FlexCel Studio for the .NET Framework documentation

PdfWriter.FontDescent Method

Returns the font height on points * Scale. (1/72 of an inch * Scale)

Syntax

Namespace: FlexCel.Pdf

public Double FontDescent(TUIFont aFont)

Parameters

<-> | Parameter | Type | Description
 | aFont | TUIFont | Font to measure.

Returns

Font height.

See also

  • PdfWriter


PdfWriter.DrawLine Method | FlexCel Studio for the .NET Framework documentation

PdfWriter.DrawLine Method

Draws a line on the current page.

Syntax

Namespace: FlexCel.Pdf

public void DrawLine(TUIPen aPen, Double x1, Double y1, Double x2, Double y2)

Parameters

<-> | Parameter | Type | Description
 | aPen | TUIPen | Pen used to draw the line. Width and color are used.
 | x1 | Double |
 | y1 | Double |
 | x2 | Double |
 | y2 | Double |

See also

  • PdfWriter


PdfWriter.DrawLines Method | FlexCel Studio for the .NET Framework documentation

PdfWriter.DrawLines Method

Draws an array of line connecting pairs of points.

Syntax

Namespace: FlexCel.Pdf

public void DrawLines(TUIPen aPen, TPointF[] points)

Parameters

<-> | Parameter | Type | Description
 | aPen | TUIPen | The pen to draw the lines.
 | points | TPointF[] | An array of points. Its length must be more than 2.

See also

  • PdfWriter


PdfWriter.FillRectangle Method | FlexCel Studio for the .NET Framework documentation

PdfWriter.FillRectangle Method

Fills the interior of a rectangle specified by a pair of coordinates, a width, and a height. No line is drawn around the rectangle.

Syntax

Namespace: FlexCel.Pdf

public void FillRectangle(TUIBrush aBrush, Double x1, Double y1, Double width, Double height)

Parameters

<-> | Parameter | Type | Description
 | aBrush | TUIBrush | Brush to fill.
 | x1 | Double |
 | y1 | Double |
 | width | Double |
 | height | Double |

See also

  • PdfWriter


PdfWriter.DrawRectangle Method | FlexCel Studio for the .NET Framework documentation

PdfWriter.DrawRectangle Method

Draws a rectangle specified by a coordinate pair, a width, and a height.

Syntax

Namespace: FlexCel.Pdf

public void DrawRectangle(TUIPen aPen, Double x1, Double y1, Double width, Double height)

Parameters

<-> | Parameter | Type | Description
 | aPen | TUIPen | Pen for the line.
 | x1 | Double |
 | y1 | Double |
 | width | Double |
 | height | Double |

See also

  • PdfWriter


PdfWriter.DrawAndFillRectangle Method | FlexCel Studio for the .NET Framework documentation

PdfWriter.DrawAndFillRectangle Method

Draws and fills a rectangle specified by a coordinate pair, a width, and a height.

Syntax

Namespace: FlexCel.Pdf

public void DrawAndFillRectangle(TUIPen aPen, TUIBrush aBrush, Double x1, Double y1, Double width, Double height)

Parameters

<-> | Parameter | Type | Description
 | aPen | TUIPen | Pen for the line. Might be null.
 | aBrush | TUIBrush | Brush for the fill. Might be null.
 | x1 | Double |
 | y1 | Double |
 | width | Double |
 | height | Double |

See also

  • PdfWriter


PdfWriter.DrawAndFillBeziers Method | FlexCel Studio for the .NET Framework documentation

PdfWriter.DrawAndFillBeziers Method

Draws and/or fills a bezier path. If Brush is not null, the shape will be closed for filling.

Syntax

Namespace: FlexCel.Pdf

public void DrawAndFillBeziers(TUIPen aPen, TUIBrush aBrush, TPointF[] aPoints, Boolean aClosePath)

Parameters

<-> | Parameter | Type | Description
 | aPen | TUIPen | Pen for the outline. If null, no outline will be drawn.
 | aBrush | TUIBrush | Brush for filling. If null, the shape will not be filled.
 | aPoints | TPointF[] | Array of points for the curve. See GDI+ DrawBeziers function for more information.
 | aClosePath | Boolean | If true, the path will be closed. Note that a closed path is different from an open path with same start and end points, because the closed path won't have linecaps at the end.

See also

  • PdfWriter


PdfWriter.DrawAndFillMultiBeziers Method | FlexCel Studio for the .NET Framework documentation

PdfWriter.DrawAndFillMultiBeziers Method

Draws and/or fills a bezier path.

Syntax

Namespace: FlexCel.Pdf

public void DrawAndFillMultiBeziers(TUIPen aPen, TUIBrush aBrush, TPointF[][] aPoints, Boolean[] aClosePath)

Parameters

<-> | Parameter | Type | Description
 | aPen | TUIPen | Pen for the outline. If null, no outline will be drawn.
 | aBrush | TUIBrush | Brush for filling. If null, the shape will not be filled.
 | aPoints | TPointF[][] | Array of array of points for the curves. See GDI+ DrawBeziers function for more information.
 | aClosePath | Boolean[] | If true, the path will be closed. Note that a closed path is different from an open path with same start and end points, because the closed path won't have linecaps at the end.

See also

  • PdfWriter


PdfWriter.DrawAndFillPolygon Method | FlexCel Studio for the .NET Framework documentation

PdfWriter.DrawAndFillPolygon Method

Draws and/or fills a polygon. The shape will be closed.

Syntax

Namespace: FlexCel.Pdf

public void DrawAndFillPolygon(TUIPen aPen, TUIBrush aBrush, TPointF[] aPoints)

Parameters

<-> | Parameter | Type | Description
 | aPen | TUIPen | Pen for the outline. If null, no outline will be drawn.
 | aBrush | TUIBrush | Brush for filling. If null, the shape will not be filled.
 | aPoints | TPointF[] | Array of points for the polygon.

See also

  • PdfWriter


PdfWriter.IntersectClipRegion Method | FlexCel Studio for the .NET Framework documentation

PdfWriter.IntersectClipRegion Method

Intersects the current clipping region with the new one. There is no command to reset or expand a clipping region, you need to use SaveState and RestoreState

Syntax

Namespace: FlexCel.Pdf

public void IntersectClipRegion(TUIRectangle Rect)

Parameters

<-> | Parameter | Type | Description
 | Rect | TUIRectangle |

See also

  • PdfWriter


PdfWriter.ClipRectangle Method | FlexCel Studio for the .NET Framework documentation

PdfWriter.ClipRectangle Method

Intersect the clip region with a rectangle specified by a pair of coordinates, a width, and a height.

Syntax

Namespace: FlexCel.Pdf

public void ClipRectangle(Double x1, Double y1, Double width, Double height, Boolean exclude)

Parameters

<-> | Parameter | Type | Description
 | x1 | Double |
 | y1 | Double |
 | width | Double |
 | height | Double |
 | exclude | Boolean | When true, all region OUTSIDE the rectangle will be intersected with the current clipping region.

See also

  • PdfWriter


PdfWriter.ClipPolygon Method | FlexCel Studio for the .NET Framework documentation

PdfWriter.ClipPolygon Method

Intersects the clipping area with a polygon.

Syntax

Namespace: FlexCel.Pdf

public void ClipPolygon(TPointF[] aPoints, Boolean exclude)

Parameters

<-> | Parameter | Type | Description
 | aPoints | TPointF[] | Array of points for the polygon.
 | exclude | Boolean | When true, all region OUTSIDE the polygon will be intersected with the current clipping region.

See also

  • PdfWriter


PdfWriter.ClipBeziers Method | FlexCel Studio for the .NET Framework documentation

PdfWriter.ClipBeziers Method

Intersects the clipping area with a bezier region.

Syntax

Namespace: FlexCel.Pdf

public void ClipBeziers(TPointF[] aPoints, Boolean exclude)

Parameters

<-> | Parameter | Type | Description
 | aPoints | TPointF[] | Array of points for the curve. See GDI+ DrawBeziers function for more information.
 | exclude | Boolean | When true, all region OUTSIDE the region will be intersected with the current clipping region.

See also

  • PdfWriter


PdfWriter.ClipMultiBeziers Method | FlexCel Studio for the .NET Framework documentation

PdfWriter.ClipMultiBeziers Method

Intersects the clipping area with multiple bezier regions.

Syntax

Namespace: FlexCel.Pdf

public void ClipMultiBeziers(Boolean exclude, params TPointF[][] aPoints)

Parameters

<-> | Parameter | Type | Description
 | exclude | Boolean | When true, all region OUTSIDE the region will be intersected with the current clipping region.
params | aPoints | TPointF[][] | Array of points for the curve. See GDI+ DrawBeziers function for more information.

See also

  • PdfWriter


PdfWriter.DrawImage Method | FlexCel Studio for the .NET Framework documentation

PdfWriter.DrawImage Method

Overloads

  • PdfWriter.DrawImage(TUIImage, TUIRectangle, Stream)
  • PdfWriter.DrawImage(TUIImage, TUIRectangle, Stream, Int64, Boolean)

PdfWriter.DrawImage(TUIImage, TUIRectangle, Stream)

Draws an image on the canvas. Image can be any type, but all except jpeg will be converted to PNG.

Syntax

Namespace: FlexCel.Pdf

public void DrawImage(TUIImage image, TUIRectangle rect, Stream imageData)

Parameters

<-> | Parameter | Type | Description
 | image | TUIImage | Image to insert. If it is not JPEG or PNG, it will be converted to PNG.
 | rect | TUIRectangle | Rectangle where the image will be.
 | imageData | Stream | Stream with the raw image data. Not required, might be null.

See also

  • PdfWriter

PdfWriter.DrawImage(TUIImage, TUIRectangle, Stream, Int64, Boolean)

Draws an image on the canvas. Image can be any type, but all except jpeg will be converted to PNG.

Syntax

Namespace: FlexCel.Pdf

public void DrawImage(TUIImage image, TUIRectangle rect, Stream imageData, Int64 transparentColor, Boolean defaultToJpg)

Parameters

<-> | Parameter | Type | Description
 | image | TUIImage | Image to insert. If it is not JPEG or PNG, it will be converted to PNG.
 | rect | TUIRectangle | Rectangle where the image will be.
 | imageData | Stream | Stream with the raw image data. Not required, might be null.
 | transparentColor | Int64 | Color to make transparent. To specify no transparent color use FlxConsts.NoTransparentColor
 | defaultToJpg | Boolean | When true and the image is not on a supported format (or imageData==null) the image will be converted to JPG. If false, the image will be converted to PNG.

See also

  • PdfWriter


PdfWriter.Rotate Method | FlexCel Studio for the .NET Framework documentation

PdfWriter.Rotate Method

Rotates the canvas around point (x,y).

Syntax

Namespace: FlexCel.Pdf

public void Rotate(Double x, Double y, Double Alpha)

Parameters

<-> | Parameter | Type | Description
 | x | Double | Point where the canvas is rotated.
 | y | Double | Point where the canvas is rotated.
 | Alpha | Double | Angle in degrees.

See also

  • PdfWriter


PdfWriter.ScaleBy Method | FlexCel Studio for the .NET Framework documentation

PdfWriter.ScaleBy Method

Overloads

  • PdfWriter.ScaleBy(Double, Double)
  • PdfWriter.ScaleBy(Double, Double, Double, Double)

PdfWriter.ScaleBy(Double, Double)

Scales the canvas. It premultiplies the matrix, to keep the correct order.

Syntax

Namespace: FlexCel.Pdf

public void ScaleBy(Double xScale, Double yScale)

Parameters

<-> | Parameter | Type | Description
 | xScale | Double | X Scale
 | yScale | Double | Y Scale

See also

  • PdfWriter

PdfWriter.ScaleBy(Double, Double, Double, Double)

Scales the canvas around a point. This is necessary when using negative scales to flip the image.

Syntax

Namespace: FlexCel.Pdf

public void ScaleBy(Double x, Double y, Double xScale, Double yScale)

Parameters

<-> | Parameter | Type | Description
 | x | Double | Point where the canvas is scaled.
 | y | Double | Point where the canvas is scaled.
 | xScale | Double | X Scale
 | yScale | Double | Y Scale

See also

  • PdfWriter


PdfWriter.GetMatrix Method | FlexCel Studio for the .NET Framework documentation

PdfWriter.GetMatrix Method

Returns the drawing matrix in use. The elements in this matrix are similar to the ones returned by "System.Drawing.Drawing2D.Matrix.Elements" and have the same meaning. Important remark. This matrix is the real one, and does not consider things like YAxisGrowsDown or Scale. You will probably want to use Transform(TPointF) to find out the coordinates of a point.

Syntax

Namespace: FlexCel.Pdf

public Double[] GetMatrix()

See also

  • PdfWriter


PdfWriter.Transform Method | FlexCel Studio for the .NET Framework documentation

PdfWriter.Transform Method

Overloads

  • PdfWriter.Transform(TPointF)
  • PdfWriter.Transform(TPointF, Double[])

PdfWriter.Transform(TPointF)

Transforms the point according to the current transformation Matrix. See GetMatrix to get the actual matrix.

Syntax

Namespace: FlexCel.Pdf

public TPointF Transform(TPointF p)

Parameters

<-> | Parameter | Type | Description
 | p | TPointF | Point you want to map to the user coordinates.

See also

  • PdfWriter

PdfWriter.Transform(TPointF, Double[])

Transforms the point according to the given transformation Matrix.

Syntax

Namespace: FlexCel.Pdf

public TPointF Transform(TPointF p, Double[] aDrawingMatrix)

Parameters

<-> | Parameter | Type | Description
 | p | TPointF | Point you want to map to the user coordinates.
 | aDrawingMatrix | Double[] | Matrix to use.

See also

  • PdfWriter


PdfWriter.SaveState Method | FlexCel Studio for the .NET Framework documentation

PdfWriter.SaveState Method

Saves the current graphic state. Be sure to always call RestoreState each time you call this method.

Syntax

Namespace: FlexCel.Pdf

public void SaveState()

See also

  • PdfWriter


PdfWriter.RestoreState Method | FlexCel Studio for the .NET Framework documentation

PdfWriter.RestoreState Method

Restores the graphic state saved by a SaveState call.

Syntax

Namespace: FlexCel.Pdf

public void RestoreState()

See also

  • PdfWriter


PdfWriter.Sign Method | FlexCel Studio for the .NET Framework documentation

PdfWriter.Sign Method

Signs the pdf documents with the specified TPdfSignature or TPdfVisibleSignature. Note: This method must be called before calling BeginDoc

Syntax

Namespace: FlexCel.Pdf

public void Sign(TPdfSignature aSignature)

Parameters

<-> | Parameter | Type | Description
 | aSignature | TPdfSignature | Signature used for signing. Set it to null to stop signing the next documents.

See also

  • PdfWriter


PdfWriter.TagContentBegin Method | FlexCel Studio for the .NET Framework documentation

PdfWriter.TagContentBegin Method

Marks the start of a content tag inside a stream. Must be finished with a call to TagContentEnd

Syntax

Namespace: FlexCel.Pdf

public void TagContentBegin(String tag, Int32 mcid, String atts)

Parameters

<-> | Parameter | Type | Description
 | tag | String | Name of the tag. It might be "P", "Clip", "Artifact", etc.
 | mcid | Int32 | Identifier for the tag. MCID must be unique in each page. If negative, no MCID will be written: This can be used in artifacts for example.
 | atts | String | Attributes other than mcid. If null or empty, no attributes will be written

See also

  • PdfWriter


PdfWriter.TagContentEnd Method | FlexCel Studio for the .NET Framework documentation

PdfWriter.TagContentEnd Method

Ends marking content which started with TagContentBegin

Syntax

Namespace: FlexCel.Pdf

public void TagContentEnd()

See also

  • PdfWriter


PdfWriter.AttachFile Method | FlexCel Studio for the .NET Framework documentation

PdfWriter.AttachFile Method

Overloads

  • PdfWriter.AttachFile(String, String, String, TPdfAttachmentKind)
  • PdfWriter.AttachFile(String, String, String, DateTime, TPdfAttachmentKind, TPdfAttachmentDataProviderDelegate)

PdfWriter.AttachFile(String, String, String, TPdfAttachmentKind)

Attachs a file to the pdf file. You can attach files at any time while creating the pdf, but the file will be read only when you call EndDoc. The files that are in the list at the moment of calling EndDoc are the ones that will be saved, and they contents of the files will be read then.

You can remove all the attachments in the file by calling ClearAttachments.

Syntax

Namespace: FlexCel.Pdf

public void AttachFile(String fileName, String mimeType, String description, TPdfAttachmentKind attachmentKind)

Parameters

<-> | Parameter | Type | Description
 | fileName | String | Name on disk of the file to attach. This will also be the name of the file in the pdf. If you want to specify a different name in the pdf than the name on disk, use AttachFile(String, String, String, DateTime, TPdfAttachmentKind, TPdfAttachmentDataProviderDelegate)
 | mimeType | String | Mime type of the file being attached. You can use StandardMimeType for predefined types. Note that while this might be null or Empty for standard pdf files, for PDF/A3 mime type is required. If you don't know the mime type, you must specify StandardMimeType.OctectStream.
 | description | String | Description of the file that the pdf reader will show in the attachment pane. While not required by PDF/A-3, it is recommended to provide a description for the file.
 | attachmentKind | TPdfAttachmentKind | How the attachment relates to the pdf file. This is required by PDF/A-3.

See also

  • PdfWriter

PdfWriter.AttachFile(String, String, String, DateTime, TPdfAttachmentKind, TPdfAttachmentDataProviderDelegate)

Attachs a file to the pdf file. You can attach files at any time while creating the pdf, but the file will be read only when you call EndDoc. The files that are in the list at the moment of calling EndDoc are the ones that will be saved, and they contents of the files will be read then.

You can remove all the attachments in the file by calling ClearAttachments.

Syntax

Namespace: FlexCel.Pdf

public void AttachFile(String fileName, String mimeType, String description, DateTime modificationTimeLocalTimeZone, TPdfAttachmentKind attachmentKind, TPdfAttachmentDataProviderDelegate dataProvider)

Parameters

<-> | Parameter | Type | Description
 | fileName | String | Name that will be used for the file in the pdf.
 | mimeType | String | Mime type of the file being attached. You can use StandardMimeType for predefined types. Note that while this might be null or Empty for standard pdf files, for PDF/A3 mime type is required. If you don't know the mime type, you must specify StandardMimeType.OctectStream.
 | description | String | Description of the file that the pdf reader will show in the attachment pane. While not required by PDF/A-3, it is recommended to provide a description for the file.
 | modificationTimeLocalTimeZone | DateTime | Modification date of the attachment file in the local time zone. Use DateTime.MinValue to not write a modification date for the file.
 | attachmentKind | TPdfAttachmentKind | How the attachment relates to the pdf file. This is required by PDF/A-3.
 | dataProvider | TPdfAttachment​Data​Provider​Delegate | This can be a delegate or lambda expression that will load the data for the file when actually embedding it. This action will be called at the moment of embedding and must provide the data for the file.

See also

  • PdfWriter


PdfWriter.ClearAttachments Method | FlexCel Studio for the .NET Framework documentation

PdfWriter.ClearAttachments Method

Removes all existing attachments in the writer.

Syntax

Namespace: FlexCel.Pdf

public void ClearAttachments()

See also

  • PdfWriter


PdfWriter.Compress Property | FlexCel Studio for the .NET Framework documentation

PdfWriter.Compress Property

Set it to true to compress the text on the generated pdf file.

Syntax

Namespace: FlexCel.Pdf

public Boolean Compress { get; set; }

See also

  • PdfWriter


PdfWriter.Properties Property | FlexCel Studio for the .NET Framework documentation

PdfWriter.Properties Property

Properties of the PDF file.

Syntax

Namespace: FlexCel.Pdf

public TPdfProperties Properties { get; set; }

See also

  • PdfWriter


PdfWriter.PageSize Property | FlexCel Studio for the .NET Framework documentation

PdfWriter.PageSize Property

Page size of the active page. You can change it *before* calling NewPage() and it will change for the new sheets. Note that once NewPage() (or BeginDoc() for the first page) is called, the page size will remain constant for that page. This property must be changed before.

Syntax

Namespace: FlexCel.Pdf

public TPaperDimensions PageSize { get; set; }

See also

  • PdfWriter


PdfWriter.YAxisGrowsDown Property | FlexCel Studio for the .NET Framework documentation

PdfWriter.YAxisGrowsDown Property

When true, the y axis origin corresponds to the upper corner of a sheet and bigger Y coordinates will move down on the paper. This is the standard GDI+ behavior. When false, the Y origin is at the bottom and it grows up into the page. This is the standard PDF behavior.

Syntax

Namespace: FlexCel.Pdf

public Boolean YAxisGrowsDown { get; set; }

See also

  • PdfWriter


PdfWriter.AddFontDescent Property | FlexCel Studio for the .NET Framework documentation

PdfWriter.AddFontDescent Property

When false, (the default) text base will be at the y coordinate. For example, DrawString(..., y=100,...) will draw a string with its base at 100. Font descent (for example the lower part of a "p") will be below 100, and the ascent (the upper part) will be above. This is the standard PDF behavior. When true, all text will be drawn above the y coordinate. (both ascent and descent). This is the standard GDI+ behavior, when StringFormat.LineAlignment=StringAlignment.Far.

Syntax

Namespace: FlexCel.Pdf

public Boolean AddFontDescent { get; set; }

See also

  • PdfWriter


PdfWriter.Scale Property | FlexCel Studio for the .NET Framework documentation

PdfWriter.Scale Property

A scale factor to change X and Y coordinates. When Scale=1, the using is the point (1/72 of an inch). Font size is not affected by scale, it is always in points.

Syntax

Namespace: FlexCel.Pdf

public Double Scale { get; set; }

See also

  • PdfWriter


PdfWriter.PdfType Property | FlexCel Studio for the .NET Framework documentation

PdfWriter.PdfType Property

Defines the type of pdf being created. Note that if you set this property to other value than standard, other properties might be ignored. For example, when creating a PDF/A file all fonts must be embedded so the value of the FontEmbed property will be ignored.

Syntax

Namespace: FlexCel.Pdf

public TPdfType PdfType { get; set; }

See also

  • PdfWriter


PdfWriter.UnlicensedFontAction Property | FlexCel Studio for the .NET Framework documentation

PdfWriter.UnlicensedFontAction Property

Defines what to do when a font has a license that doesn't allow embedding, and you are trying to embed the font.

Syntax

Namespace: FlexCel.Pdf

public TUnlicensedFontAction UnlicensedFontAction { get; set; }

See also

  • PdfWriter


PdfWriter.UnlicensedReplacementFont Property | FlexCel Studio for the .NET Framework documentation

PdfWriter.UnlicensedReplacementFont Property

When trying to embed a font that isn't licensed for embedding, and UnlicensedFontAction is TUnlicensedFontAction.Replace this property specifies the font that will be used to replace it. If null or empty, Arial will be used.

Syntax

Namespace: FlexCel.Pdf

public String UnlicensedReplacementFont { get; set; }

See also

  • PdfWriter


PdfWriter.PdfVersion Property | FlexCel Studio for the .NET Framework documentation

PdfWriter.PdfVersion Property

Defines the version of pdf being created. For maximum compatibility you can choose PDF 1.4. (Acrobat 5.0, but can be opened by any version of Acrobat, even if version less than 1.4 won't have all the features). Choosing PDF 1.6 (Acrobat 7) allows for more compression and smaller files, but you'll need Acrobat 7 or newer to see the files. Older versions won't be able to open it at all.

Note that this value will be ignored if you are creating PDFA-1 (as it requires PDF1-4). Also for signing, FlexCel requires PDF1-6.

Syntax

Namespace: FlexCel.Pdf

public TPdfVersion PdfVersion { get; set; }

See also

  • PdfWriter


PdfWriter.EmbedColorProfile Property | FlexCel Studio for the .NET Framework documentation

PdfWriter.EmbedColorProfile Property

If true, a color profile will be embedded in the generated pdf files. An embedded color profile can increase the size of the generated file in some kilobytes, and it isn't required or needed, so you'll normally want to keep this property false. For PDF/A, it is required, but when you set the PdfType to PDF/A the color profile will always be included anyway, and this property will be ignored.

Syntax

Namespace: FlexCel.Pdf

public Boolean EmbedColorProfile { get; set; }

See also

  • PdfWriter


PdfWriter.FontEmbed Property | FlexCel Studio for the .NET Framework documentation

PdfWriter.FontEmbed Property

Determines what fonts will be embedded on the generated pdf. Note that when using UNICODE fonts WILL BE EMBEDDED no matter the value of this property. Also if creating PDF/A files.

Syntax

Namespace: FlexCel.Pdf

public TFontEmbed FontEmbed { get; set; }

See also

  • PdfWriter


PdfWriter.FontSubset Property | FlexCel Studio for the .NET Framework documentation

PdfWriter.FontSubset Property

When FontEmbed is set to embed the fonts, this setting determines if the full font will be embedded, or only the characters used in the document. If the full font is embedded the resulting file will be larger, but it will be possible to edit it with a third party tool once it has been generated.

Syntax

Namespace: FlexCel.Pdf

public TFontSubset FontSubset { get; set; }

See also

  • PdfWriter


PdfWriter.FontMapping Property | FlexCel Studio for the .NET Framework documentation

PdfWriter.FontMapping Property

Determines how fonts will be replaced on the generated pdf. Pdf comes with 4 standard font families, Serif, Sans-Serif, Monospace and Symbol. You can use for example the standard Helvetica instead of Arial and do not worry about embedding the font.

Syntax

Namespace: FlexCel.Pdf

public TFontMapping FontMapping { get; set; }

See also

  • PdfWriter


PdfWriter.Kerning Property | FlexCel Studio for the .NET Framework documentation

PdfWriter.Kerning Property

By default, pdf does not do any kerning with the fonts. This is, on the string "AVANT", it won't compensate the spaces between "A" and "V". (they should be smaller) If you turn this property on, FlexCel will calculate the kerning and add it to the generated file. The result file will be a little bigger because of the kerning info on all strings, but it will also look a little better.

Syntax

Namespace: FlexCel.Pdf

public Boolean Kerning { get; set; }

See also

  • PdfWriter


PdfWriter.UseFauxStyles Property | FlexCel Studio for the .NET Framework documentation

PdfWriter.UseFauxStyles Property

When a font doesn't have a bold, italic or bold-italic variant, FlexCel can't export bold, italic or bold-italic characters to the pdf respectively. When this property is true (the default), FlexCel will try to "fake" those missing styles by using a wider pen width for the characters to simulate bold, or doing a slant transform to simulate italics.

The results of a simulated bold or italic can be not great, so if you prefer that FlexCel doesn't try to simulate bold or italics, then you can set this property to false. If this property is false and the font you are using doesn't have bold or italics variants, then the pdf won't show bold or italics for that font.

You can use FlexCelTrace to know when FlexCel is using faux bolds or italics.

Syntax

Namespace: FlexCel.Pdf

public Boolean UseFauxStyles { get; set; }

See also

  • PdfWriter


PdfWriter.FallbackFonts Property | FlexCel Studio for the .NET Framework documentation

PdfWriter.FallbackFonts Property

A semicolon (;) separated list of font names to try when a character is not found in the used font.

When a character is not found in a font, it will display as an empty square by default. By setting this property, FlexCel will try to find a font that supports this character in this list, and if found, use that font to render the character.

Syntax

Namespace: FlexCel.Pdf

public String FallbackFonts { get; set; }

Examples

You might set this property to "MS MINCHO;Arial Unicode MS". If a cell with font "Arial" has a character that is not in the "Arial" font, FlexCel will try to find the character first in MS Mincho, and if not found, in Arial Unicode.

If it can find it in any of the fallback fonts, it will use that font in the pdf file.

See also

  • PdfWriter


PdfWriter.FallbackFontsBold Property | FlexCel Studio for the .NET Framework documentation

PdfWriter.FallbackFontsBold Property

A semicolon (;) separated list of font names similar to FallbackFonts that will be used only for bold fonts.

If you fallback fonts already contain bold variants, you don't need to set this property. This property is only if you want to use different font fallbacks for bold fonts and regular fonts.

Syntax

Namespace: FlexCel.Pdf

public String FallbackFontsBold { get; set; }

See also

  • PdfWriter


PdfWriter.FallbackFontsItalic Property | FlexCel Studio for the .NET Framework documentation

PdfWriter.FallbackFontsItalic Property

A semicolon (;) separated list of font names similar to FallbackFonts that will be used only for italic fonts.

If you fallback fonts already contain italic variants, you don't need to set this property. This property is only if you want to use different font fallbacks for italic fonts and regular fonts.

Syntax

Namespace: FlexCel.Pdf

public String FallbackFontsItalic { get; set; }

See also

  • PdfWriter


PdfWriter.FallbackFontsBoldItalic Property | FlexCel Studio for the .NET Framework documentation

PdfWriter.FallbackFontsBoldItalic Property

A semicolon (;) separated list of font names similar to FallbackFonts that will be used only for fonts which are both bold and italic.

If you fallback fonts already contain bold-italic variants, you don't need to set this property. This property is only if you want to use different font fallbacks for bold-italic fonts and regular fonts.

Syntax

Namespace: FlexCel.Pdf

public String FallbackFontsBoldItalic { get; set; }

See also

  • PdfWriter


PdfWriter.GetFontData Property | FlexCel Studio for the .NET Framework documentation

PdfWriter.GetFontData Property

Use this event if you want to provide your own font information for embedding for a particular instance. Note that if you don't assign this event, GetFontDataGlobal will be used instead. If GetFontData and GetFontDataGlobal are not assigned the default method will be used, and this will try to find the font on the Fonts folder. To change the font folder, use GetFontFolder event

Syntax

Namespace: FlexCel.Pdf

public GetFontDataEventHandler GetFontData { get; set; }

See also

  • PdfWriter


PdfWriter.GetFontDataGlobal Property | FlexCel Studio for the .NET Framework documentation

PdfWriter.GetFontDataGlobal Property

Use this event if you want to provide your own font information for embedding for the full application. Note that if you assign GetFontData for a particular object instance it will be used instead. Important: This event isn't thread safe or guarded by any lock. You should set it once when your application starts and never modify it. For changing a particular instance, use GetFontData instead. If you aren't sure, use GetFontData

Syntax

Namespace: FlexCel.Pdf

public static GetFontDataEventHandler GetFontDataGlobal { get; set; }

See also

  • PdfWriter


PdfWriter.GetFontFolder Property | FlexCel Studio for the .NET Framework documentation

PdfWriter.GetFontFolder Property

Use this event if you want to provide your own font information for embedding for a particular object instance.

For changing the font folder for the full application, use GetFontFolderGlobal instead. Normally FlexCel will search for fonts on [System]\Fonts folder and %localappdata%\Microsoft\Windows\Fonts. If your fonts are in other location, you can tell FlexCel where they are here. If you prefer just to give FlexCel the full data on the font, you can use GetFontData event instead.

Note that you can return more than one path by separating them with semicolons. For example if you return "c:\fonts1;c:\fonts2" FlexCel will search both in fonts1 and fonts2. Every folder you specify here must have at least one font.

FlexCel will search in the folders you return here, and in **all subfolders** of that folders for ttf files.

In Android, we use a "@folder" syntax to refer to assets. So for example to specify that the fonts are in the "fonts" folder asset, return "@fonts" here. If the fonts are in a normal folder, just return the folder.

Remarks

FlexCel by default won't try to scan folders if the graphics library used by FlexCel returns the TTF tables directly. If you are using SKIA or CoreGraphics, this event might not be called. To ensure this event is called no matter what underlying graphics engine is used, you will need to set FlexCelConfig.ForcePdfFontsFromDisk to true.

Syntax

Namespace: FlexCel.Pdf

public GetFontFolderEventHandler GetFontFolder { get; set; }

Examples

The following code will setup a GetFontFolder event that searches for a font first in c:\MyFonts, and if the font isn't there, it will search in the default FlexCel search path:

    PdfWriter pdf = new PdfWriter();

    pdf.GetFontFolder += (sender, e) =>
    {
        e.FontPath = "c:\\MyFonts;" + e.FontPath;
    };

    // Note: If the font is in c:\MyFonts, you need to tell the Operating System
    // to search in that folder too.
    using (TUIFont MyFont = TUIFont.Create("MyFont", 12))
    {
        using (TUISolidBrush redBrush = TUISolidBrush.Create(Colors.Red))
        {
            pdf.DrawString("Hello", MyFont, redBrush, 100, 100);
        }
    }

See also

  • PdfWriter


PdfWriter.GetFontFolderGlobal Property | FlexCel Studio for the .NET Framework documentation

PdfWriter.GetFontFolderGlobal Property

Use this event if you want to provide your own font folder for the full application. Note that if you assign GetFontFolder for a particular object instance it will be used instead. Important: This event isn't thread safe or guarded by any lock. You should set it once when your application starts and never modify it. For changing a particular instance, use GetFontFolder instead. If you aren't sure, use GetFontFolder Note that you can return more than one path by separating them with semicolons. For example if you return "c:\fonts1;c:\fonts2" FlexCel will search both in fonts1 and fonts2. Every folder you specify here must have at least one font.

FlexCel will search in the folders you return here, and in **all subfolders** of that folders for ttf files.

In Android, we use a "@folder" syntax to refer to assets. So for example to specify that the fonts are in the "fonts" folder asset, return "@fonts" here. If the fonts are in a normal folder, just return the folder.

Syntax

Namespace: FlexCel.Pdf

public static GetFontFolderEventHandler GetFontFolderGlobal { get; set; }

See also

  • PdfWriter


PdfWriter.OnFontEmbed Property | FlexCel Studio for the .NET Framework documentation

PdfWriter.OnFontEmbed Property

Use this event if you want to manually specify which fonts to embed into the pdf document. Note that this applies for a single PdfWriter instance, to set it for the full application, use OnFontEmbedGlobal

Syntax

Namespace: FlexCel.Pdf

public FontEmbedEventHandler OnFontEmbed { get; set; }

See also

  • PdfWriter


PdfWriter.OnFontEmbedGlobal Property | FlexCel Studio for the .NET Framework documentation

PdfWriter.OnFontEmbedGlobal Property

Use this event if you want to manually specify which fonts to embed into the pdf document for the full application. Note that if you assign OnFontEmbed for a particular object instance it will be used instead. Important: This event isn't thread safe or guarded by any lock. You should set it once when your application starts and never modify it. For changing a particular instance, use OnFontEmbed instead. If you aren't sure, use OnFontEmbed

Syntax

Namespace: FlexCel.Pdf

public static FontEmbedEventHandler OnFontEmbedGlobal { get; set; }

See also

  • PdfWriter


PdfWriter.OnFontFolderNotFound Property | FlexCel Studio for the .NET Framework documentation

PdfWriter.OnFontFolderNotFound Property

This property determines how FlexCel behaves when one of the folders you specify in GetFontFolder doesn't exist. Note that this applies for a single PdfWriter instance, to set it for the full application, use OnFontFolderNotFoundGlobal

Syntax

Namespace: FlexCel.Pdf

public TPdfFontFolderNotFoundAction OnFontFolderNotFound { get; set; }

See also

  • PdfWriter


PdfWriter.OnFontFolderNotFoundGlobal Property | FlexCel Studio for the .NET Framework documentation

PdfWriter.OnFontFolderNotFoundGlobal Property

This property determines how FlexCel behaves when one of the folders you specify in GetFontFolder doesn't exist. Important: This event isn't thread safe or guarded by any lock. You should set it once when your application starts and never modify it. For changing a particular instance, use OnFontFolderNotFound instead. If you aren't sure, use OnFontFolderNotFound

Syntax

Namespace: FlexCel.Pdf

public TPdfFontFolderNotFoundAction OnFontFolderNotFoundGlobal { get; set; }

See also

  • PdfWriter


PdfWriter.PageLayout Property | FlexCel Studio for the .NET Framework documentation

PdfWriter.PageLayout Property

Sets the default page layout when opening the document.

Syntax

Namespace: FlexCel.Pdf

public TPageLayout PageLayout { get; set; }

See also

  • PdfWriter


PdfWriter.PageLayoutDisplay Property | FlexCel Studio for the .NET Framework documentation

PdfWriter.PageLayoutDisplay Property

Sets the default page display layout when opening the document.

Syntax

Namespace: FlexCel.Pdf

public TPageLayoutDisplay PageLayoutDisplay { get; set; }

See also

  • PdfWriter


PdfWriter.InitialZoomAndPage Property | FlexCel Studio for the .NET Framework documentation

PdfWriter.InitialZoomAndPage Property

Sets the default zoom and initial page when opening the document.

Syntax

Namespace: FlexCel.Pdf

public TPdfDestination InitialZoomAndPage { get; set; }

See also

  • PdfWriter


PdfWriter.TagActions Property | FlexCel Studio for the .NET Framework documentation

PdfWriter.TagActions Property

Implement this interface in order to define the tags.

Syntax

Namespace: FlexCel.Pdf

public IPdfTagActions TagActions { get; set; }

See also

  • PdfWriter


TBookmark Class | FlexCel Studio for the .NET Framework documentation

TBookmark Class

An entry on the Bookmark list for a PDF file.

Syntax

Namespace: FlexCel.Pdf

public class TBookmark: ICloneable

Constructors

Name Description
TBookmark Overloaded
 TBookmark(String, TPdfDestination, Boolean)
TBookmark(String, TPdfDestination, Boolean, TUIColor, TBookmarkStyle)

Methods

Name | Description
AddChild | Adds a new child of this bookmark on the outline.
Child | Returns one child of the current bookmark.
AllOpenCount | Returns a list of all open children of this bookmark. Mostly for internal use.
Clone | Returns a deep copy of this object.

Properties

Name | Description
Title | Title of the bookmark item.
Destination | Page where the bookmark points to.
ChildrenCollapsed | If true, all children of this bookmark will be collapsed.
TextColor | Text color for the bookmark entry.
TextStyle | Text style for the bookmark entry.
ChildCount | Returns the number of children of this bookmark.


TBookmark.TBookmark Constructor | FlexCel Studio for the .NET Framework documentation

TBookmark.TBookmark Constructor

Overloads

  • TBookmark.TBookmark(String, TPdfDestination, Boolean)
  • TBookmark.TBookmark(String, TPdfDestination, Boolean, TUIColor, TBookmarkStyle)

TBookmark.TBookmark(String, TPdfDestination, Boolean)

Creates a new TBookmark instance.

Syntax

Namespace: FlexCel.Pdf

public TBookmark(String aTitle, TPdfDestination aDestination, Boolean aChildrenCollapsed)

Parameters

<-> | Parameter | Type | Description
 | aTitle | String | Title of the bookmark item.
 | aDestination | TPdfDestination | Page where the bookmark points to.
 | aChildrenCollapsed | Boolean | If true all children from this bookmark will be collapsed.

See also

  • TBookmark

TBookmark.TBookmark(String, TPdfDestination, Boolean, TUIColor, TBookmarkStyle)

Creates a new TBookmark instance.

Syntax

Namespace: FlexCel.Pdf

public TBookmark(String aTitle, TPdfDestination aDestination, Boolean aChildrenCollapsed, TUIColor aTextColor, TBookmarkStyle aTextStyle)

Parameters

<-> | Parameter | Type | Description
 | aTitle | String | Title of the bookmark item.
 | aDestination | TPdfDestination | Page where the bookmark points to.
 | aChildrenCollapsed | Boolean | If true all children from this bookmark will be collapsed.
 | aTextColor | TUIColor | Text color for the bookmark entry.
 | aTextStyle | TBookmarkStyle | Text style for the bookmark entry.

See also

  • TBookmark


TBookmark.AddChild Method | FlexCel Studio for the .NET Framework documentation

TBookmark.AddChild Method

Adds a new child of this bookmark on the outline.

Syntax

Namespace: FlexCel.Pdf

public void AddChild(TBookmark child)

Parameters

<-> | Parameter | Type | Description
 | child | TBookmark | Child bookmark to add.

See also

  • TBookmark


TBookmark.Child Method | FlexCel Studio for the .NET Framework documentation

TBookmark.Child Method

Returns one child of the current bookmark.

Syntax

Namespace: FlexCel.Pdf

public TBookmark Child(Int32 i)

Parameters

<-> | Parameter | Type | Description
 | i | Int32 | Number of child to get.

Returns

i-th Child of the bookmark.

See also

  • TBookmark


TBookmark.AllOpenCount Method | FlexCel Studio for the .NET Framework documentation

TBookmark.AllOpenCount Method

Returns a list of all open children of this bookmark. Mostly for internal use.

Syntax

Namespace: FlexCel.Pdf

public Int32 AllOpenCount()

See also

  • TBookmark


TBookmark.Clone Method | FlexCel Studio for the .NET Framework documentation

TBookmark.Clone Method

Returns a deep copy of this object.

Syntax

Namespace: FlexCel.Pdf

public Object Clone()

See also

  • TBookmark


TBookmark.Title Property | FlexCel Studio for the .NET Framework documentation

TBookmark.Title Property

Title of the bookmark item.

Syntax

Namespace: FlexCel.Pdf

public String Title { get; set; }

See also

  • TBookmark


TBookmark.Destination Property | FlexCel Studio for the .NET Framework documentation

TBookmark.Destination Property

Page where the bookmark points to.

Syntax

Namespace: FlexCel.Pdf

public TPdfDestination Destination { get; set; }

See also

  • TBookmark


TBookmark.ChildrenCollapsed Property | FlexCel Studio for the .NET Framework documentation

TBookmark.ChildrenCollapsed Property

If true, all children of this bookmark will be collapsed.

Syntax

Namespace: FlexCel.Pdf

public Boolean ChildrenCollapsed { get; set; }

See also

  • TBookmark


TBookmark.TextColor Property | FlexCel Studio for the .NET Framework documentation

TBookmark.TextColor Property

Text color for the bookmark entry.

Syntax

Namespace: FlexCel.Pdf

public TUIColor TextColor { get; set; }

See also

  • TBookmark


TBookmark.TextStyle Property | FlexCel Studio for the .NET Framework documentation

TBookmark.TextStyle Property

Text style for the bookmark entry.

Syntax

Namespace: FlexCel.Pdf

public TBookmarkStyle TextStyle { get; set; }

See also

  • TBookmark


TBookmark.ChildCount Property | FlexCel Studio for the .NET Framework documentation

TBookmark.ChildCount Property

Returns the number of children of this bookmark.

Syntax

Namespace: FlexCel.Pdf

public Int32 ChildCount { get; }

See also

  • TBookmark


TBookmarkList Class | FlexCel Studio for the .NET Framework documentation

TBookmarkList Class

A list of bookmarks.

Syntax

Namespace: FlexCel.Pdf

public class TBookmarkList: ICloneable, IEnumerable<TBookmark>

Constructors

Name | Description
TBookmarkList | Creates a new instance of TBookmarkList.

Methods

Name | Description
Add | Adds a new bookmark to the list.
Clear | Removes all items on the list.
RemoveAt | Removes item at position index on the list.
AllOpenCount | Returns the count of all open bookmarks in all levels.
GetEnumerator | An enumerator for this collection.
Clone | Returns a deep copy of this object.

Properties

Name | Description
this[] | Returns item at position index on the list.
Count | Number of items on the list.


TBookmarkList.TBookmarkList Constructor | FlexCel Studio for the .NET Framework documentation

TBookmarkList.TBookmarkList Constructor

Creates a new instance of TBookmarkList.

Syntax

Namespace: FlexCel.Pdf

public TBookmarkList()

See also

  • TBookmarkList


TBookmarkList.Add Method | FlexCel Studio for the .NET Framework documentation

TBookmarkList.Add Method

Adds a new bookmark to the list.

Syntax

Namespace: FlexCel.Pdf

public TBookmark Add(TBookmark bookmark)

Parameters

<-> | Parameter | Type | Description
 | bookmark | TBookmark |

See also

  • TBookmarkList


TBookmarkList.Clear Method | FlexCel Studio for the .NET Framework documentation

TBookmarkList.Clear Method

Removes all items on the list.

Syntax

Namespace: FlexCel.Pdf

public void Clear()

See also

  • TBookmarkList


TBookmarkList.RemoveAt Method | FlexCel Studio for the .NET Framework documentation

TBookmarkList.RemoveAt Method

Removes item at position index on the list.

Syntax

Namespace: FlexCel.Pdf

public void RemoveAt(Int32 index)

Parameters

<-> | Parameter | Type | Description
 | index | Int32 | Position where to remove the bookmark.

See also

  • TBookmarkList


TBookmarkList.AllOpenCount Method | FlexCel Studio for the .NET Framework documentation

TBookmarkList.AllOpenCount Method

Returns the count of all open bookmarks in all levels.

Syntax

Namespace: FlexCel.Pdf

public Int32 AllOpenCount()

See also

  • TBookmarkList


TBookmarkList.GetEnumerator Method | FlexCel Studio for the .NET Framework documentation

TBookmarkList.GetEnumerator Method

An enumerator for this collection.

Syntax

Namespace: FlexCel.Pdf

public IEnumerator GetEnumerator()

See also

  • TBookmarkList


TBookmarkList.Clone Method | FlexCel Studio for the .NET Framework documentation

TBookmarkList.Clone Method

Returns a deep copy of this object.

Syntax

Namespace: FlexCel.Pdf

public Object Clone()

See also

  • TBookmarkList


TBookmarkList.this[] Property | FlexCel Studio for the .NET Framework documentation

TBookmarkList.this[] Property

Returns item at position index on the list.

Syntax

Namespace: FlexCel.Pdf

public TBookmark this[] { get; set; }

See also

  • TBookmarkList


TBookmarkList.Count Property | FlexCel Studio for the .NET Framework documentation

TBookmarkList.Count Property

Number of items on the list.

Syntax

Namespace: FlexCel.Pdf

public Int32 Count { get; }

See also

  • TBookmarkList


TBuiltInSignerFactory Class | FlexCel Studio for the .NET Framework documentation

TBuiltInSignerFactory Class

This class will create instances of the Built-in signer.

Syntax

Namespace: FlexCel.Pdf

public class TBuiltInSignerFactory: TPdfSignerFactory

Constructors

Name | Description
TBuiltInSigner​Factory | Creates a new instance of this class.

Methods

Name | Description
CreateSigner | Creates a new Builtin Signer.


TBuiltInSignerFactory.TBuiltInSignerFactory Constructor | FlexCel Studio for the .NET Framework documentation

TBuiltInSignerFactory.TBuiltInSignerFactory Constructor

Creates a new instance of this class.

Syntax

Namespace: FlexCel.Pdf

public TBuiltInSignerFactory(CmsSigner aSigner)

Parameters

<-> | Parameter | Type | Description
 | aSigner | CmsSigner | CmsSigner used to sign the pdf files.

See also

  • TBuiltInSignerFactory


TBuiltInSignerFactory.CreateSigner Method | FlexCel Studio for the .NET Framework documentation

TBuiltInSignerFactory.CreateSigner Method

Creates a new Builtin Signer.

Syntax

Namespace: FlexCel.Pdf

public override TPdfSigner CreateSigner()

See also

  • TBuiltInSignerFactory


TPdfAttachmentWriter Class | FlexCel Studio for the .NET Framework documentation

TPdfAttachmentWriter Class

Class used to write the file contents of one attachment into a PDF file.

Syntax

Namespace: FlexCel.Pdf

public class TPdfAttachmentWriter

Methods

Name | Description
Write | Overloaded Write(Byte[]) Write(Stream) Write(Byte[], Int32, Int32)

Properties

Name | Description
BytesWritten | Returns how many bytes have been written into the stream.
FileName | Gets the name of the file.


TPdfAttachmentWriter.Write Method | FlexCel Studio for the .NET Framework documentation

TPdfAttachmentWriter.Write Method

Overloads

  • TPdfAttachmentWriter.Write(Byte[])
  • TPdfAttachmentWriter.Write(Stream)
  • TPdfAttachmentWriter.Write(Byte[], Int32, Int32)

TPdfAttachmentWriter.Write(Byte[])

Writes a byte array into the file.

Syntax

Namespace: FlexCel.Pdf

public void Write(Byte[] data)

Parameters

<-> | Parameter | Type | Description
 | data | Byte[] | Data to be written.

See also

  • TPdfAttachmentWriter

TPdfAttachmentWriter.Write(Stream)

Writes an stream into the file.

Syntax

Namespace: FlexCel.Pdf

public void Write(Stream data)

Parameters

<-> | Parameter | Type | Description
 | data | Stream | Stream with the data that will be written. Make sure it is at the correct position.

See also

  • TPdfAttachmentWriter

TPdfAttachmentWriter.Write(Byte[], Int32, Int32)

Writes part of a byte array into the file.

Syntax

Namespace: FlexCel.Pdf

public void Write(Byte[] data, Int32 offset, Int32 count)

Parameters

<-> | Parameter | Type | Description
 | data | Byte[] | Data to be written.
 | offset | Int32 | Offset in Data of the first byte to be written.
 | count | Int32 | Numbers of bytes to be written.

See also

  • TPdfAttachmentWriter


TPdfAttachmentWriter.BytesWritten Property | FlexCel Studio for the .NET Framework documentation

TPdfAttachmentWriter.BytesWritten Property

Returns how many bytes have been written into the stream.

Syntax

Namespace: FlexCel.Pdf

public Int64 BytesWritten { get; }

See also

  • TPdfAttachmentWriter


TPdfAttachmentWriter.FileName Property | FlexCel Studio for the .NET Framework documentation

TPdfAttachmentWriter.FileName Property

Gets the name of the file.

Syntax

Namespace: FlexCel.Pdf

public String FileName { get; }

See also

  • TPdfAttachmentWriter


TPdfCommentProperties Class | FlexCel Studio for the .NET Framework documentation

TPdfCommentProperties Class

Properties for a PDF comment.

Syntax

Namespace: FlexCel.Pdf

public class TPdfCommentProperties

Constructors

Name | Description
TPdfCommentProperties | Overloaded TPdfCommentProperties(TPdfCommentProperties) TPdfCommentProperties(TPdfCommentType, TPdfCommentIcon, Double, TUIColor, TUIColor)

Properties

Name | Description
CommentType | Type of comment.
Icon | Icon for the comment. Only visible if CommentType is Text
Opacity | A value between 0 and 1 specifying the opacity of the note.
BackgroundColor | Background color for the comment. Only visible if CommentType is NOT Text
LineColor | Line color for the comment. Only visible if CommentType is NOT Text


TPdfCommentProperties.TPdfCommentProperties Constructor | FlexCel Studio for the .NET Framework documentation

TPdfCommentProperties.TPdfCommentProperties Constructor

Overloads

  • TPdfCommentProperties.TPdfCommentProperties(TPdfCommentProperties)
  • TPdfCommentProperties.TPdfCommentProperties(TPdfCommentType, TPdfCommentIcon, Double, TUIColor, TUIColor)

TPdfCommentProperties.TPdfCommentProperties(TPdfCommentProperties)

Creates a new TPdfCommentProperties instance based on the data from another instance.

Syntax

Namespace: FlexCel.Pdf

public TPdfCommentProperties(TPdfCommentProperties aProps)

Parameters

<-> | Parameter | Type | Description
 | aProps | TPdfCommentProperties |

See also

  • TPdfCommentProperties

TPdfCommentProperties.TPdfCommentProperties(TPdfCommentType, TPdfCommentIcon, Double, TUIColor, TUIColor)

Creates a new instance of a comment object.

Syntax

Namespace: FlexCel.Pdf

public TPdfCommentProperties(TPdfCommentType aCommentType, TPdfCommentIcon aIcon, Double aOpacity, TUIColor aBackgroundColor, TUIColor aLineColor)

Parameters

<-> | Parameter | Type | Description
 | aCommentType | TPdfCommentType |
 | aIcon | TPdfCommentIcon |
 | aOpacity | Double |
 | aBackgroundColor | TUIColor |
 | aLineColor | TUIColor |

See also

  • TPdfCommentProperties


TPdfCommentProperties.CommentType Property | FlexCel Studio for the .NET Framework documentation

TPdfCommentProperties.CommentType Property

Type of comment.

Syntax

Namespace: FlexCel.Pdf

public TPdfCommentType CommentType { get; set; }

See also

  • TPdfCommentProperties


TPdfCommentProperties.Icon Property | FlexCel Studio for the .NET Framework documentation

TPdfCommentProperties.Icon Property

Icon for the comment. Only visible if CommentType is Text

Syntax

Namespace: FlexCel.Pdf

public TPdfCommentIcon Icon { get; set; }

See also

  • TPdfCommentProperties


TPdfCommentProperties.Opacity Property | FlexCel Studio for the .NET Framework documentation

TPdfCommentProperties.Opacity Property

A value between 0 and 1 specifying the opacity of the note.

Syntax

Namespace: FlexCel.Pdf

public Double Opacity { get; set; }

See also

  • TPdfCommentProperties


TPdfCommentProperties.BackgroundColor Property | FlexCel Studio for the .NET Framework documentation

TPdfCommentProperties.BackgroundColor Property

Background color for the comment. Only visible if CommentType is NOT Text

Syntax

Namespace: FlexCel.Pdf

public TUIColor BackgroundColor { get; set; }

See also

  • TPdfCommentProperties


TPdfCommentProperties.LineColor Property | FlexCel Studio for the .NET Framework documentation

TPdfCommentProperties.LineColor Property

Line color for the comment. Only visible if CommentType is NOT Text

Syntax

Namespace: FlexCel.Pdf

public TUIColor LineColor { get; set; }

See also

  • TPdfCommentProperties


TPdfDestination Class | FlexCel Studio for the .NET Framework documentation

TPdfDestination Class

Represents a destination inside a PDF document.

Syntax

Namespace: FlexCel.Pdf

public class TPdfDestination: ICloneable

Constructors

Name Description
TPdfDestination Overloaded
 TPdfDestination(Int32)
TPdfDestination(Int32, TZoomOptions)
TPdfDestination(Int32, Double, Double, Double)

Methods

Name | Description
Clone | Returns a deep copy of this object.

Properties

Name | Description
PageNumber | Page where the destination will point to. (1 based)
ZoomOptions | Zoom options for this destination.
X | X offset of the page in points from the left. A negative number means keep the default. This value is only used if ZoomOptions is Zoom.
Y | Y offset of the page in points from the top. A negative number means keep the default. This value is only used if ZoomOptions is Zoom.
Zoom | Zoom to show at the destination. A negative or 0 number means keep the default. This value is only used if ZoomOptions is Zoom.


TPdfDestination.TPdfDestination Constructor | FlexCel Studio for the .NET Framework documentation

TPdfDestination.TPdfDestination Constructor

Overloads

  • TPdfDestination.TPdfDestination(Int32)
  • TPdfDestination.TPdfDestination(Int32, TZoomOptions)
  • TPdfDestination.TPdfDestination(Int32, Double, Double, Double)

TPdfDestination.TPdfDestination(Int32)

Creates a new TPdfDestination instance.

Syntax

Namespace: FlexCel.Pdf

public TPdfDestination(Int32 aPageNumber)

Parameters

<-> | Parameter | Type | Description
 | aPageNumber | Int32 | Page where the destination points to. (1 based)

See also

  • TPdfDestination

TPdfDestination.TPdfDestination(Int32, TZoomOptions)

Creates a new TPdfDestination instance.

Syntax

Namespace: FlexCel.Pdf

public TPdfDestination(Int32 aPageNumber, TZoomOptions aZoomOptions)

Parameters

<-> | Parameter | Type | Description
 | aPageNumber | Int32 | Page where the destination points to. (1 based)
 | aZoomOptions | TZoomOptions | Zoom options for this destination.

See also

  • TPdfDestination

TPdfDestination.TPdfDestination(Int32, Double, Double, Double)

Creates a new TPdfDestination instance with ZoomOptions = Zoom and the needed parameters.

Syntax

Namespace: FlexCel.Pdf

public TPdfDestination(Int32 aPageNumber, Double aX, Double aY, Double aZoom)

Parameters

<-> | Parameter | Type | Description
 | aPageNumber | Int32 | Page where the destination points to. (1 based)
 | aX | Double | X offset in points from the left.
 | aY | Double | Y offset in points from the top.
 | aZoom | Double | Zoom to display in the destination.

See also

  • TPdfDestination


TPdfDestination.Clone Method | FlexCel Studio for the .NET Framework documentation

TPdfDestination.Clone Method

Returns a deep copy of this object.

Syntax

Namespace: FlexCel.Pdf

public Object Clone()

See also

  • TPdfDestination


TPdfDestination.PageNumber Property | FlexCel Studio for the .NET Framework documentation

TPdfDestination.PageNumber Property

Page where the destination will point to. (1 based)

Syntax

Namespace: FlexCel.Pdf

public Int32 PageNumber { get; set; }

See also

  • TPdfDestination


TPdfDestination.ZoomOptions Property | FlexCel Studio for the .NET Framework documentation

TPdfDestination.ZoomOptions Property

Zoom options for this destination.

Syntax

Namespace: FlexCel.Pdf

public TZoomOptions ZoomOptions { get; set; }

See also

  • TPdfDestination


TPdfDestination.X Property | FlexCel Studio for the .NET Framework documentation

TPdfDestination.X Property

X offset of the page in points from the left. A negative number means keep the default. This value is only used if ZoomOptions is Zoom.

Syntax

Namespace: FlexCel.Pdf

public Double X { get; set; }

See also

  • TPdfDestination


TPdfDestination.Y Property | FlexCel Studio for the .NET Framework documentation

TPdfDestination.Y Property

Y offset of the page in points from the top. A negative number means keep the default. This value is only used if ZoomOptions is Zoom.

Syntax

Namespace: FlexCel.Pdf

public Double Y { get; set; }

See also

  • TPdfDestination


TPdfDestination.Zoom Property | FlexCel Studio for the .NET Framework documentation

TPdfDestination.Zoom Property

Zoom to show at the destination. A negative or 0 number means keep the default. This value is only used if ZoomOptions is Zoom.

Syntax

Namespace: FlexCel.Pdf

public Double Zoom { get; set; }

See also

  • TPdfDestination


TPdfPng Class | FlexCel Studio for the .NET Framework documentation

TPdfPng Class

A class for reading a PNG image. Mostly for internal use, but it can return some very basic information on a PNG file too.

Syntax

Namespace: FlexCel.Pdf

public static class TPdfPng

Methods

Name | Description
GetPngInfo | Returns the basic information on a png file. Null if the file is not PNG.


TPdfPng.GetPngInfo Method | FlexCel Studio for the .NET Framework documentation

TPdfPng.GetPngInfo Method

Returns the basic information on a png file. Null if the file is not PNG.

Syntax

Namespace: FlexCel.Pdf

public static TPngInformation GetPngInfo(Stream PngImageData)

Parameters

<-> | Parameter | Type | Description
 | PngImageData | Stream | Stream with the image data.

Returns

Null if the image is invalid, or the image properties otherwise.

See also

  • TPdfPng


TPdfProperties Class | FlexCel Studio for the .NET Framework documentation

TPdfProperties Class

Encapsulates the document properties for the PDF file.

Syntax

Namespace: FlexCel.Pdf

public class TPdfProperties

Constructors

Name | Description
TPdfProperties | Overloaded TPdfProperties TPdfProperties(String, String, String, String, String) TPdfProperties(String, String, String, String, String, String)

Properties

Name | Description
Title | Document title.
Author | Document author.
Subject | Document subject.
Keywords | Keywords to search on the document.
Creator | Application that created the document.
Language | Language identifier specifying the natural language for the document. This should be a standard specifier like "en-US". Note that the language will be used by text-to-speech engines to read text out loud, so it is recommended to set this property. You can see a list of languages here: http:​//​msdn.​microsoft.​com/​en-​us/​library/​ee825488(​v=​cs.​20)​.aspx ...[more]


TPdfProperties.TPdfProperties Constructor | FlexCel Studio for the .NET Framework documentation

TPdfProperties.TPdfProperties Constructor

Overloads

  • TPdfProperties.TPdfProperties
  • TPdfProperties.TPdfProperties(String, String, String, String, String)
  • TPdfProperties.TPdfProperties(String, String, String, String, String, String)

TPdfProperties.TPdfProperties

Creates a new instance of the class. All properties are set to empty.

Syntax

Namespace: FlexCel.Pdf

public TPdfProperties()

See also

  • TPdfProperties

TPdfProperties.TPdfProperties(String, String, String, String, String)

Creates a new instance of the class with given properties.

Syntax

Namespace: FlexCel.Pdf

public TPdfProperties(String aTitle, String aAuthor, String aSubject, String aKeywords, String aCreator)

Parameters

<-> | Parameter | Type | Description
 | aTitle | String | Document title.
 | aAuthor | String | Document author.
 | aSubject | String | Document subject.
 | aKeywords | String | Keywords to search on the document.
 | aCreator | String | Application that created the document.

See also

  • TPdfProperties

TPdfProperties.TPdfProperties(String, String, String, String, String, String)

Creates a new instance of the class with given properties.

Syntax

Namespace: FlexCel.Pdf

public TPdfProperties(String aTitle, String aAuthor, String aSubject, String aKeywords, String aCreator, String aLanguage)

Parameters

<-> | Parameter | Type | Description
 | aTitle | String | Document title.
 | aAuthor | String | Document author.
 | aSubject | String | Document subject.
 | aKeywords | String | Keywords to search on the document.
 | aCreator | String | Application that created the document.
 | aLanguage | String | Language identifier specifying the natural language for the document. This should be a standard specifier like "en-US". Note that the language will be used by text-to-speech engines to read text out loud, so it is recommended to set this property.

See also

  • TPdfProperties


TPdfProperties.Title Property | FlexCel Studio for the .NET Framework documentation

TPdfProperties.Title Property

Document title.

Syntax

Namespace: FlexCel.Pdf

public String Title { get; set; }

See also

  • TPdfProperties


TPdfProperties.Author Property | FlexCel Studio for the .NET Framework documentation

TPdfProperties.Author Property

Document author.

Syntax

Namespace: FlexCel.Pdf

public String Author { get; set; }

See also

  • TPdfProperties


TPdfProperties.Subject Property | FlexCel Studio for the .NET Framework documentation

TPdfProperties.Subject Property

Document subject.

Syntax

Namespace: FlexCel.Pdf

public String Subject { get; set; }

See also

  • TPdfProperties


TPdfProperties.Keywords Property | FlexCel Studio for the .NET Framework documentation

TPdfProperties.Keywords Property

Keywords to search on the document.

Syntax

Namespace: FlexCel.Pdf

public String Keywords { get; set; }

See also

  • TPdfProperties


TPdfProperties.Creator Property | FlexCel Studio for the .NET Framework documentation

TPdfProperties.Creator Property

Application that created the document.

Syntax

Namespace: FlexCel.Pdf

public String Creator { get; set; }

See also

  • TPdfProperties


TPdfProperties.Language Property | FlexCel Studio for the .NET Framework documentation

TPdfProperties.Language Property

Language identifier specifying the natural language for the document. This should be a standard specifier like "en-US".

Note that the language will be used by text-to-speech engines to read text out loud, so it is recommended to set this property.

You can see a list of languages here: http://msdn.microsoft.com/en-us/library/ee825488(v=cs.20).aspx

Syntax

Namespace: FlexCel.Pdf

public String Language { get; set; }

See also

  • TPdfProperties


TPdfSignature Class | FlexCel Studio for the .NET Framework documentation

TPdfSignature Class

Describes a non visible signature for a PDF file. For a visible signature, use TPdfVisibleSignature

Syntax

Namespace: FlexCel.Pdf

public class TPdfSignature

Constructors

Name | Description
TPdfSignature | Creates an invisible signature. For a visible signature, create a TPdfVisibleSignature class.

Properties

Name | Description
SignerFactory | Object that implements the actual signing.
Name | Name to be given to the signature. This will be displayed in the "signatures" tab, and acrobat normally names it "Signature". It cannot be null. Note: Signature names cannot contain dots. An exception will be thrown if you try to enter a name with a dot here.
Reason | The reason for the signing, such as "I agree...". Leave it null if you do not want to specify a reason.
Location | The CPU host name or physical location of the signing. Leave it null for not specifying a location.
ContactInfo | Information provided by the signer to enable a recipient to contact the signer to verify the signature; for example, a phone number.
SignDate | Sign Date. Use DateTime.MinValue to use the current date.
AllowedChanges | Specifies which changes are allowed in the signed pdf.


TPdfSignature.TPdfSignature Constructor | FlexCel Studio for the .NET Framework documentation

TPdfSignature.TPdfSignature Constructor

Creates an invisible signature. For a visible signature, create a TPdfVisibleSignature class.

Syntax

Namespace: FlexCel.Pdf

public TPdfSignature(TPdfSignerFactory aSignerFactory, String aName, String aReason, String aLocation, String aContactInfo)

Parameters

<-> | Parameter | Type | Description
 | aSignerFactory | TPdfSignerFactory | See SignerFactory
 | aName | String | See Name
 | aReason | String | See Reason
 | aLocation | String | See Location
 | aContactInfo | String | See ContactInfo

See also

  • TPdfSignature


TPdfSignature.SignerFactory Property | FlexCel Studio for the .NET Framework documentation

TPdfSignature.SignerFactory Property

Object that implements the actual signing.

Syntax

Namespace: FlexCel.Pdf

public TPdfSignerFactory SignerFactory { get; set; }

See also

  • TPdfSignature


TPdfSignature.Name Property | FlexCel Studio for the .NET Framework documentation

TPdfSignature.Name Property

Name to be given to the signature. This will be displayed in the "signatures" tab, and acrobat normally names it "Signature". It cannot be null. Note: Signature names cannot contain dots. An exception will be thrown if you try to enter a name with a dot here.

Syntax

Namespace: FlexCel.Pdf

public String Name { get; set; }

See also

  • TPdfSignature


TPdfSignature.Reason Property | FlexCel Studio for the .NET Framework documentation

TPdfSignature.Reason Property

The reason for the signing, such as "I agree...". Leave it null if you do not want to specify a reason.

Syntax

Namespace: FlexCel.Pdf

public String Reason { get; set; }

See also

  • TPdfSignature


TPdfSignature.Location Property | FlexCel Studio for the .NET Framework documentation

TPdfSignature.Location Property

The CPU host name or physical location of the signing. Leave it null for not specifying a location.

Syntax

Namespace: FlexCel.Pdf

public String Location { get; set; }

See also

  • TPdfSignature


TPdfSignature.ContactInfo Property | FlexCel Studio for the .NET Framework documentation

TPdfSignature.ContactInfo Property

Information provided by the signer to enable a recipient to contact the signer to verify the signature; for example, a phone number.

Syntax

Namespace: FlexCel.Pdf

public String ContactInfo { get; set; }

See also

  • TPdfSignature


TPdfSignature.SignDate Property | FlexCel Studio for the .NET Framework documentation

TPdfSignature.SignDate Property

Sign Date. Use DateTime.MinValue to use the current date.

Syntax

Namespace: FlexCel.Pdf

public DateTime SignDate { get; set; }

See also

  • TPdfSignature


TPdfSignature.AllowedChanges Property | FlexCel Studio for the .NET Framework documentation

TPdfSignature.AllowedChanges Property

Specifies which changes are allowed in the signed pdf.

Syntax

Namespace: FlexCel.Pdf

public TPdfAllowedChanges AllowedChanges { get; set; }

See also

  • TPdfSignature


TPdfSigner Class | FlexCel Studio for the .NET Framework documentation

TPdfSigner Class

Represents an abstract class to create a pdf PKCS7 DER encoded signature. Descend from this class to create your own SignerFactory implementations.

Syntax

Namespace: FlexCel.Pdf

public abstract class TPdfSigner: IDisposable

Destructors

Name | Description
Finalize | Finalizer for the class.

Methods

Name | Description
Write | This method is called each time new data is added to the pdf. When overwriting this method, use it to incrementally calculate the hash of the data.
GetSignature | This method is called only once at the end of the pdf creation. It should release all handles and temporary memory used to calculate the data hash, and return a PKCS7 DER-encoded signature.
EstimateLength | Returns the estimated length for the data that will be returned in GetSignature. Note that this method will be called before finishing the pdf, so you still don't know what the final signature will be. You can return a number larger than what GetSignature will return at the end of the pdf creation, but never smaller.
Dispose | Overloaded Dispose Dispose(Boolean)


TPdfSigner.Finalize Destructor | FlexCel Studio for the .NET Framework documentation

TPdfSigner.Finalize Destructor

Finalizer for the class.

Syntax

Namespace: FlexCel.Pdf

protected void Finalize()

See also

  • TPdfSigner


TPdfSigner.Write Method | FlexCel Studio for the .NET Framework documentation

TPdfSigner.Write Method

This method is called each time new data is added to the pdf. When overwriting this method, use it to incrementally calculate the hash of the data.

Syntax

Namespace: FlexCel.Pdf

public abstract void Write(Byte[] buffer, Int32 offset, Int32 count)

Parameters

<-> | Parameter | Type | Description
 | buffer | Byte[] | Data written to the pdf.
 | offset | Int32 | Offset in buffer where to start writing data.
 | count | Int32 | Number of bytes from buffer that will be written.

See also

  • TPdfSigner


TPdfSigner.GetSignature Method | FlexCel Studio for the .NET Framework documentation

TPdfSigner.GetSignature Method

This method is called only once at the end of the pdf creation. It should release all handles and temporary memory used to calculate the data hash, and return a PKCS7 DER-encoded signature.

Syntax

Namespace: FlexCel.Pdf

public abstract Byte[] GetSignature()

See also

  • TPdfSigner


TPdfSigner.EstimateLength Method | FlexCel Studio for the .NET Framework documentation

TPdfSigner.EstimateLength Method

Returns the estimated length for the data that will be returned in GetSignature. Note that this method will be called before finishing the pdf, so you still don't know what the final signature will be. You can return a number larger than what GetSignature will return at the end of the pdf creation, but never smaller.

Syntax

Namespace: FlexCel.Pdf

public abstract Int32 EstimateLength()

See also

  • TPdfSigner


TPdfSigner.Dispose Method | FlexCel Studio for the .NET Framework documentation

TPdfSigner.Dispose Method

Overloads

  • TPdfSigner.Dispose
  • TPdfSigner.Dispose(Boolean)

TPdfSigner.Dispose

Disposes this instance.

Syntax

Namespace: FlexCel.Pdf

public void Dispose()

See also

  • TPdfSigner

TPdfSigner.Dispose(Boolean)

Override this method to dispose your own objects in your descending classes.

Syntax

Namespace: FlexCel.Pdf

protected virtual void Dispose(Boolean disposing)

Parameters

<-> | Parameter | Type | Description
 | disposing | Boolean | If true, this is a direct call to Dispose(), and you need to dispose both managed and unmanaged resources. If false, this is called by the finalizer, and you only need to release unmanaged resources.

See also

  • TPdfSigner


TPdfSignerFactory Class | FlexCel Studio for the .NET Framework documentation

TPdfSignerFactory Class

Override this factory when creating your own TPdfSigner class, so it is returned here.

Syntax

Namespace: FlexCel.Pdf

public abstract class TPdfSignerFactory

Methods

Name | Description
CreateSigner | This method should return an instance of your customized TPdfSigner class.


TPdfSignerFactory.CreateSigner Method | FlexCel Studio for the .NET Framework documentation

TPdfSignerFactory.CreateSigner Method

This method should return an instance of your customized TPdfSigner class.

Syntax

Namespace: FlexCel.Pdf

public abstract TPdfSigner CreateSigner()

See also

  • TPdfSignerFactory


TPdfVisibleSignature Class | FlexCel Studio for the .NET Framework documentation

TPdfVisibleSignature Class

Describes a visible signature in a PDF file. For an invisible signature, see TPdfSignature.

Syntax

Namespace: FlexCel.Pdf

public class TPdfVisibleSignature: TPdfSignature

Constructors

Name | Description
TPdfVisibleSignature | Creates a new visible signature for a PDF file.

Properties

Name | Description
Page | Page where the signature will go. (1 based). Use 0 to place the signature at the last page.
Rect | Rectangle where the signature will go in the page. It is measured in points (1/72 of an inch) from the left lower corner of the page.
ImageData | The image that will be shown in the signature as an array of bytes.


TPdfVisibleSignature.TPdfVisibleSignature Constructor | FlexCel Studio for the .NET Framework documentation

TPdfVisibleSignature.TPdfVisibleSignature Constructor

Creates a new visible signature for a PDF file.

Syntax

Namespace: FlexCel.Pdf

public TPdfVisibleSignature(TPdfSignerFactory aSignerFactory, String aName, String aReason, String aLocation, String aContactInfo, Int32 aPage, TUIRectangle aRect, Byte[] aImageData)

Parameters

<-> | Parameter | Type | Description
 | aSignerFactory | TPdfSignerFactory | See TPdfSignature.SignerFactory
 | aName | String | See TPdfSignature.Name
 | aReason | String | See TPdfSignature.Reason
 | aLocation | String | See TPdfSignature.Location
 | aContactInfo | String | See TPdfSignature.ContactInfo
 | aPage | Int32 | See Page
 | aRect | TUIRectangle | See Rect
 | aImageData | Byte[] | See ImageData

See also

  • TPdfVisibleSignature


TPdfVisibleSignature.Page Property | FlexCel Studio for the .NET Framework documentation

TPdfVisibleSignature.Page Property

Page where the signature will go. (1 based). Use 0 to place the signature at the last page.

Syntax

Namespace: FlexCel.Pdf

public Int32 Page { get; set; }

See also

  • TPdfVisibleSignature


TPdfVisibleSignature.Rect Property | FlexCel Studio for the .NET Framework documentation

TPdfVisibleSignature.Rect Property

Rectangle where the signature will go in the page. It is measured in points (1/72 of an inch) from the left lower corner of the page.

Syntax

Namespace: FlexCel.Pdf

public TUIRectangle Rect { get; set; }

See also

  • TPdfVisibleSignature


TPdfVisibleSignature.ImageData Property | FlexCel Studio for the .NET Framework documentation

TPdfVisibleSignature.ImageData Property

The image that will be shown in the signature as an array of bytes.

Syntax

Namespace: FlexCel.Pdf

public Byte[] ImageData { get; set; }

See also

  • TPdfVisibleSignature


TPngInformation Class | FlexCel Studio for the .NET Framework documentation

TPngInformation Class

Basic information about a PNG file.

Syntax

Namespace: FlexCel.Pdf

public sealed class TPngInformation

Constructors

Name | Description
TPngInformation | Creates a new TPngInformation class.

Properties

Name | Description
Height | Height of the image on pixels.
Width | Width of the image on pixels.
BitDepth | Bith depth of the image.
ColorType | Png ColorType (See png reference for more information)
CompressionMethod | Png Compression method (See png reference for more information)
HorizontalResolution | Horizontal resolution of the image in dpi. If the image doesn't have resolution information, this value will be 0.
VerticalResolution | Vertical resolution of the image in dpi. If the image doesn't have resolution information, this value will be 0.


TPngInformation.TPngInformation Constructor | FlexCel Studio for the .NET Framework documentation

TPngInformation.TPngInformation Constructor

Creates a new TPngInformation class.

Syntax

Namespace: FlexCel.Pdf

public TPngInformation()

See also

  • TPngInformation


TPngInformation.Height Property | FlexCel Studio for the .NET Framework documentation

TPngInformation.Height Property

Height of the image on pixels.

Syntax

Namespace: FlexCel.Pdf

public Int64 Height { get; set; }

See also

  • TPngInformation


TPngInformation.Width Property | FlexCel Studio for the .NET Framework documentation

TPngInformation.Width Property

Width of the image on pixels.

Syntax

Namespace: FlexCel.Pdf

public Int64 Width { get; set; }

See also

  • TPngInformation


TPngInformation.BitDepth Property | FlexCel Studio for the .NET Framework documentation

TPngInformation.BitDepth Property

Bith depth of the image.

Syntax

Namespace: FlexCel.Pdf

public Byte BitDepth { get; set; }

See also

  • TPngInformation


TPngInformation.ColorType Property | FlexCel Studio for the .NET Framework documentation

TPngInformation.ColorType Property

Png ColorType (See png reference for more information)

Syntax

Namespace: FlexCel.Pdf

public Byte ColorType { get; set; }

See also

  • TPngInformation


TPngInformation.CompressionMethod Property | FlexCel Studio for the .NET Framework documentation

TPngInformation.CompressionMethod Property

Png Compression method (See png reference for more information)

Syntax

Namespace: FlexCel.Pdf

public Byte CompressionMethod { get; set; }

See also

  • TPngInformation


TPngInformation.HorizontalResolution Property | FlexCel Studio for the .NET Framework documentation

TPngInformation.HorizontalResolution Property

Horizontal resolution of the image in dpi. If the image doesn't have resolution information, this value will be 0.

Syntax

Namespace: FlexCel.Pdf

public Double HorizontalResolution { get; set; }

See also

  • TPngInformation


TPngInformation.VerticalResolution Property | FlexCel Studio for the .NET Framework documentation

TPngInformation.VerticalResolution Property

Vertical resolution of the image in dpi. If the image doesn't have resolution information, this value will be 0.

Syntax

Namespace: FlexCel.Pdf

public Double VerticalResolution { get; set; }

See also

  • TPngInformation


IPdfPageTagger Interface | FlexCel Studio for the .NET Framework documentation

IPdfPageTagger Interface

Implement this interface in order to tag a pdf file created by TPdfWriter. This interface will be called after every page is generated. Note that FlexCelPdfExport already implements it so there is no need to define it again.

Syntax

Namespace: FlexCel.Pdf

public interface IPdfPageTagger;

Methods

Name | Description
AddContentTag | Adds a new tag to the structure tree, with a child which was added with TagContentBegin/​Tag​Content​End.​


IPdfPageTagger.AddContentTag Method | FlexCel Studio for the .NET Framework documentation

IPdfPageTagger.AddContentTag Method

Adds a new tag to the structure tree, with a child which was added with TagContentBegin/TagContentEnd.

Syntax

Namespace: FlexCel.Pdf

public abstract void AddContentTag(Int32 objId, Int32 parentObjId, Int32 childMcId, String name, String altText)

Parameters

<-> | Parameter | Type | Description
 | objId | Int32 | Id of the object being inserted. Get a value with GetObjectIds(int)
 | parentObjId | Int32 | Id of the object which is parent to this one, in order to create the tag tree. Use a negative number if the tag derives directly from the root.
 | childMcId | Int32 | The id used in TagContentBegin/TagContentEnd.
 | name | String | Name of the tag.
 | altText | String | Alt text for the tag, if applicable. Use null or empty if there is no Alt text.

See also

  • IPdfPageTagger


IPdfRoleTag Interface | FlexCel Studio for the .NET Framework documentation

IPdfRoleTag Interface

Implement this interface in order to add roles to the structure tree.

Syntax

Namespace: FlexCel.Pdf

public interface IPdfRoleTag;

Methods

Name | Description
AddRole | Adds a new role.


IPdfRoleTag.AddRole Method | FlexCel Studio for the .NET Framework documentation

IPdfRoleTag.AddRole Method

Adds a new role.

Syntax

Namespace: FlexCel.Pdf

public abstract void AddRole(String name, String map)

Parameters

<-> | Parameter | Type | Description
 | name | String | Name of the new role.
 | map | String | Existing role which will be used to map name.

See also

  • IPdfRoleTag


IPdfTagActions Interface | FlexCel Studio for the .NET Framework documentation

IPdfTagActions Interface

Events that allow you to tag a pdf document.

Syntax

Namespace: FlexCel.Pdf

public interface IPdfTagActions;

Methods

Name | Description
TagsInPage | This event will be called after each page is completed, and allows you to specify the tags for the page. All tags in the page should be defined here.
TagsTeardown | This event will be called before finalizing the document, and allows you to specify the global tags on it.
DefineRoles | This event allows you to define alias roles.


IPdfTagActions.TagsInPage Method | FlexCel Studio for the .NET Framework documentation

IPdfTagActions.TagsInPage Method

This event will be called after each page is completed, and allows you to specify the tags for the page. All tags in the page should be defined here.

Syntax

Namespace: FlexCel.Pdf

public abstract void TagsInPage(Int32 pageNumber, IPdfPageTagger tagger)

Parameters

<-> | Parameter | Type | Description
 | pageNumber | Int32 | Page that we are currently exporting.
 | tagger | IPdfPageTagger | Object for setting up the tags.

See also

  • IPdfTagActions


IPdfTagActions.TagsTeardown Method | FlexCel Studio for the .NET Framework documentation

IPdfTagActions.TagsTeardown Method

This event will be called before finalizing the document, and allows you to specify the global tags on it.

Syntax

Namespace: FlexCel.Pdf

public abstract void TagsTeardown(IPdfTeardownTagger tagger)

Parameters

<-> | Parameter | Type | Description
 | tagger | IPdfTeardownTagger | Object for setting up the tags.

See also

  • IPdfTagActions


IPdfTagActions.DefineRoles Method | FlexCel Studio for the .NET Framework documentation

IPdfTagActions.DefineRoles Method

This event allows you to define alias roles.

Syntax

Namespace: FlexCel.Pdf

public abstract void DefineRoles(IPdfRoleTag role)

Parameters

<-> | Parameter | Type | Description
 | role | IPdfRoleTag | Use this object to define new roles.

See also

  • IPdfTagActions


IPdfTagger Interface | FlexCel Studio for the .NET Framework documentation

IPdfTagger Interface

Base interface for tagging pdf documents.

Syntax

Namespace: FlexCel.Pdf

public interface IPdfTagger;

Methods

Name | Description
GetObjectIds | Reserves count Ids from the file, so you can use them to define your tags. IMPORTANT: You must use all the Ids you reserve.
AddStructTag | Adds a new tag to the structure tree.


IPdfTagger.GetObjectIds Method | FlexCel Studio for the .NET Framework documentation

IPdfTagger.GetObjectIds Method

Reserves count Ids from the file, so you can use them to define your tags. IMPORTANT: You must use all the Ids you reserve.

Syntax

Namespace: FlexCel.Pdf

public abstract Int32 GetObjectIds(Int32 count)

Parameters

<-> | Parameter | Type | Description
 | count | Int32 | Number of Ids to reserve.

Returns

First reserved Id.

See also

  • IPdfTagger


IPdfTagger.AddStructTag Method | FlexCel Studio for the .NET Framework documentation

IPdfTagger.AddStructTag Method

Adds a new tag to the structure tree.

Syntax

Namespace: FlexCel.Pdf

public abstract void AddStructTag(Int32 objId, Int32 parentObjId, IEnumerable<Int32> childrenObjIds, String name, String altText)

Parameters

<-> | Parameter | Type | Description
 | objId | Int32 | Id of the object being inserted. Get a value with GetObjectIds
 | parentObjId | Int32 | Id of the object which is parent to this one, in order to create the tag tree. Use a negative number if the tag derives directly from the root.
 | childrenObjIds | IEnumerable<Int32> | A list of the children tags, to create the Tag tree.
 | name | String | Name of the tag.
 | altText | String | Alt text for the tag, if applicable. Use null or empty if there is no Alt text.

See also

  • IPdfTagger


IPdfTeardownTagger Interface | FlexCel Studio for the .NET Framework documentation

IPdfTeardownTagger Interface

Implement this interface in order to tag a pdf file created by TPdfWriter. This interface will be called after every the document is finished, and allows youto write global tags. Note that FlexCelPdfExport already implements it so there is no need to define it again.

Syntax

Namespace: FlexCel.Pdf

public interface IPdfTeardownTagger;


PdfErr Enumeration | FlexCel Studio for the .NET Framework documentation

PdfErr Enumeration

Error Codes. We use this and not actual strings to make sure all are correctly spelled.

Syntax

Namespace: FlexCel.Pdf

Members

Name | Value | Description
ErrInternal | 0 | Internal error.
ErrInvalidPngImage | 1 | The png image is corrupt, invalid, or not in a format FlexCel can understand.
ErrInvalidPageSize | 2 | This PaperKind is not supported. Please use a custom Paper size.
ErrInvalidFont | 3 | The font file for this font is invalid.
ErrFontNotFound | 4 | The font was not found.
ErrFontNotSupported | 5 | The font is not supported by FlexCel. Not a CCF or Truetype font.
ErrInvalidPageNumber | 6 | Invalid page number.
ErrTryingToSignStartedDocument | 7 | A pdf file must be signed before calling BeginDoc.
ErrNoDotsInSigName | 8 | Signature names cannot contain dots.
ErrSigningLengthToSmall | 9 | The estimated size for the signature was smaller than the final size.
ErrUnassingedSignerFactory | 10 | There is no signer associated with the signature.
ErrInvalidAllowedChanges | 11 | AllowedChanges value is invalid.
CannotAttachFilesInPDFA1OrA2 | 12 | A PDF/A-1 or PDF/A-2 file can't have attached files. Use PDF/A-3 for allowing embedding files.
ErrInvalidUnicodeConversion | 13 | A glyph in the pdf file cannot be mapped back to an Unicode character.


TBookmarkStyle Enumeration | FlexCel Studio for the .NET Framework documentation

TBookmarkStyle Enumeration

This enum indicates the text style for a bookmark entry. You can combine the entries by or'ing them together.

Syntax

Namespace: FlexCel.Pdf

Members

Name | Value | Description
None | 0 | Normal text.
Italic | 1 | Italic text.
Bold | 2 | Bold text.


TFontEmbed Enumeration | FlexCel Studio for the .NET Framework documentation

TFontEmbed Enumeration

The way fonts will be embedded on the resulting pdf file.

Syntax

Namespace: FlexCel.Pdf

Members

Name | Value | Description
None | 0 | No font will be embedded. The result file will be smaller, but the file might not look fine on a computer without the font installed. It is recommended that you embed the fonts.
Embed | 1 | All fonts will be embedded. The file will be larger than when not embedding fonts, but it will print on any computer. Note that you can control which fonts to embed and which not with the OnFontEmbed event.
OnlySymbolFonts | 2 | This is a compromise between embedding all fonts and not embedding them. It will only embed fonts with symbols, and leave normal fonts not embedded.


TFontMapping Enumeration | FlexCel Studio for the .NET Framework documentation

TFontMapping Enumeration

How fonts will be replaced on the generated PDF file.

Syntax

Namespace: FlexCel.Pdf

Members

Name | Value | Description
ReplaceStandardFonts | 0 | Arial will be replaced with Helvetica, Times new roman with Times and True type Courier with PS1 Courier. All other fonts will remain unchanged.
ReplaceAllFonts | 1 | Serif fonts will be mapped to Times, MonoSpace to Courier, Sans-Serif to Helvetica and Symbol fonts to Symbol. Using this option you can get the smallest file sizes and 100% portability, but the resulting file will only use those fonts. Use it with care, specially if you use symbol fonts.
DontReplaceFonts | 2 | All actual fonts will be used. If you use this option and do not embed fonts, the fonts will look bad on computers without them installed. If you embed fonts, files will be larger.


TFontSubset Enumeration | FlexCel Studio for the .NET Framework documentation

TFontSubset Enumeration

Determines if full fonts will be embedded in the generated pdf files, or only the characters being used.

Syntax

Namespace: FlexCel.Pdf

Members

Name | Value | Description
DontSubset | 0 | All characters of the font will be embedded into the file. This setting creates bigger files, but they can be edited after generated.
Subset | 1 | Only characters actually used by the document will be embedded into the file. This will create smaller files than embedding the full font, but it will be difficult to edit the document once it has been created.


TPageLayout Enumeration | FlexCel Studio for the .NET Framework documentation

TPageLayout Enumeration

Viewer settings when the document is opened for the first time.

Syntax

Namespace: FlexCel.Pdf

Members

Name | Value | Description
None | 0 | Keep the layout as defined by the user.
Outlines | 1 | Show the Outlines pane when opening the document.
Thumbs | 2 | Show the thumbs pane when opening the document.
FullScreen | 3 | Open the document in FullScreen mode.
OptionalContent | 4 | Show the optional content group panel.
AttachmentPanel | 5 | Show the attachments panel.


TPageLayoutDisplay Enumeration | FlexCel Studio for the .NET Framework documentation

TPageLayoutDisplay Enumeration

How the pages will display when the document is opened for the first time.

Syntax

Namespace: FlexCel.Pdf

Members

Name | Value | Description
None | 0 | Don't specify any setting: Open the document as defined in the viewer.
SinglePage | 1 | Display one page at a time.
OneColumnContinuous | 2 | Display the pages in one continuous column.
TwoColumnContinuousLeft | 3 | Display the pages in two continuous columns, with odd-numbered pages on the left.
TwoColumnContinuousRight | 4 | Display the pages in two continuous columns, with odd-numbered pages on the right.
TwoPageLeft | 5 | Display the pages two at a time, with odd-numbered pages on the left.
TwoPageRight | 6 | Display the pages two at a time, with odd-numbered pages on the right.


TPdfAllowedChanges Enumeration | FlexCel Studio for the .NET Framework documentation

TPdfAllowedChanges Enumeration

Changes allowed in a signed PDF document.

Syntax

Namespace: FlexCel.Pdf

Members

Name | Value | Description
None | 0 | No changes to the document are permitted; any change to the document invalidates the signature.
FillingForms_PageTemplates_Signing | 1 | Permitted changes are filling in forms, instantiating page templates, and signing; other changes invalidate the signature.
FillingForms_PageTemplates_Signing_Annotations | 2 | Permitted are filling in forms, instantiating page templates, and signing, as well as annotation creation, deletion, and modification; other changes invalidate the signature


TPdfAttachmentKind Enumeration | FlexCel Studio for the .NET Framework documentation

TPdfAttachmentKind Enumeration

Specifies how the attached file relates to the pdf file. It is required by PDF/A3

Syntax

Namespace: FlexCel.Pdf

Members

Name | Value | Description
Source | 0 | Data is the source for the pdf.
Data | 1 | Supporting data for the pdf.
Alternative | 2 | Alternative data.
Supplement | 3 | Data that suplements the data in the pdf.
Unspecified | 4 | Unspecified.


TPdfCommentIcon Enumeration | FlexCel Studio for the .NET Framework documentation

TPdfCommentIcon Enumeration

Icon for a pdf comment

Syntax

Namespace: FlexCel.Pdf

Members

Name | Value | Description
Comment | 0 | A callout icon.
Help | 1 | A ? inside a circle icon.
Insert | 2 | A triangle icon.
Key | 3 | A key icon.
NewParagraph | 4 | A small triangle icon.
Note | 5 | A sheet of paper icon.
Paragraph | 6 | A "Pi" icon.


TPdfCommentType Enumeration | FlexCel Studio for the .NET Framework documentation

TPdfCommentType Enumeration

Different types of comments.

Syntax

Namespace: FlexCel.Pdf

Members

Name | Value | Description
Text | 0 | An icon that will show the comment.
Square | 1 | A rectangle including the comment.
Circle | 2 | A Circle or ellipsis including the comment.


TPdfFontFolderNotFoundAction Enumeration | FlexCel Studio for the .NET Framework documentation

TPdfFontFolderNotFoundAction Enumeration

Determines what FlexCel should do when a font folder doesn't exist.

Syntax

Namespace: FlexCel.Pdf

Members

Name | Value | Description
DefaultBehavior | 0 | This event won't change how the action is handled. If you set for example a static property to "Error" and an instance property to "DefaultBehavior", the final result will be "Error". If all properties are set to DefaultBehavior, this property will work as "Ignore"
Ignore | 1 | FlexCel will ignore the folders that don't exist, and keep searching the other font folders you specified. Note that at least one folder in the list of folders must exist, or FlexCel will raise an error anyway.
Error | 2 | FlexCel will throw an exception if any folder doesn't exist.


TPdfToken Enumeration | FlexCel Studio for the .NET Framework documentation

TPdfToken Enumeration

Tokens for creating a PDF file. Internal use.

Syntax

Namespace: FlexCel.Pdf

Members

Name | Value | Description
Header14 | 0 | Pdf header for acrobat 5.
Header16 | 1 | Pdf header for acrobat 7.
Header17 | 2 | Pdf header for acrobat 8.
HeaderComment | 3 | Comment with more than 4 bytes>128.
OpenString | 4 | (
CloseString | 5 | )
EscapeString | 6 | \
StartDictionary | 7 | <<
EndDictionary | 8 | >>
NullText | 9 | null
XRef | 10 | XRef section.
XRefName | 11 | /XRef
Trailer | 12 | Begin of a trailer section.
StartXRef | 13 | XRef subsection inside trailer.
Eof | 14 | Last line of the file.
SizeName | 15 | Size keyword.
RootName | 16 | Root keyword.
InfoName | 17 | Info Keyword.
TypeName | 18 | /Type
KidsName | 19 | /Kids
CountName | 20 | /Count
FirstName | 21 | /First
LastName | 22 | /Last
Obj | 23 | Indirect object
EndObj | 24 | End of an indirect object.
CallObj | 25 | A call to an indirect object.
LengthName | 26 | /length
Length1Name | 27 |
Stream | 28 | stream
EndStream | 29 | endstream
PagesName | 30 | Pages
PageName | 31 | Page
ContentsName | 32 | /Contents
AnnotsName | 33 |
AnnotName | 34 |
ParentName | 35 | /Parent
CatalogName | 36 | Catalog
OpenArray | 37 | [
CloseArray | 38 | ]
TitleName | 39 |
AuthorName | 40 |
SubjectName | 41 |
KeywordsName | 42 |
CreatorName | 43 |
ProducerName | 44 |
CreationDateName | 45 |
Producer | 46 | Producer of the document.
FilterName | 47 |
SubFilterName | 48 |
FlateDecodeName | 49 |
ResourcesName | 50 |
FontName | 51 |
FontPrefix | 52 |
ImgPrefix | 53 |
PatternPrefix | 54 |
HatchPrefix | 55 |
GradientPrefix | 56 |
GStatePrefix | 57 |
SubtypeName | 58 |
TrueTypeName | 59 |
BaseFontName | 60 |
FontNameName | 61 |
FontBBoxName | 62 |
FirstCharName | 63 |
LastCharName | 64 |
EncodingName | 65 |
WinAnsiEncodingName | 66 |
Bold | 67 |
Italic | 68 |
BoldItalic | 69 |
PsBold | 70 |
PsItalic | 71 |
PsBoldItalic | 72 |
PsOblique | 73 |
PsBoldOblique | 74 |
PsCourier | 75 |
PsHelvetica | 76 |
PsTimes | 77 |
PsRoman | 78 |
PsSymbol | 79 |
StTimes | 80 |
StHelvetica | 81 |
StArial | 82 |
StTimesNewRoman | 83 |
StCourier | 84 |
StCourierNew | 85 |
StMicrosoftSansSerif | 86 |
StMicrosoftSerif | 87 |
StFixedFonts | 88 |
StSerifFonts | 89 |
StSymbolFonts | 90 |
CIDFontType0Name | 91 |
CIDFontType2Name | 92 |
Type0Name | 93 |
Type1Name | 94 |
DescendantFontsName | 95 |
IdentityHName | 96 |
CIDSystemInfo | 97 |
CIDToGIDMap | 98 |
CIDSetName | 99 |
CommandFont | 100 |
CommandBeginText | 101 |
CommandEndText | 102 |
CommandSetBrushColor | 103 |
CommandSetPenColor | 104 |
CommandSetAlphaBrush | 105 |
CommandSetAlphaPen | 106 |
CommandTextMove | 107 |
CommandTextMatrix | 108 |
CommandTextWrite | 109 |
CommandTextRendering | 110 |
CommandTextKerningWrite | 111 |
CommandMove | 112 |
CommandLineToAndStroke | 113 |
CommandLineTo | 114 |
CommandBezier | 115 |
CommandLineWidth | 116 |
CommandLineCap | 117 |
CommandLineJoin | 118 |
CommandMiterLimit | 119 |
CommandSetLineStyle | 120 |
CommandFillPath | 121 |
CommandFillAndStroke | 122 |
CommandStroke | 123 |
CommandCloseAndStroke | 124 |
CommandClipPath | 125 |
CommandClipPathEvenOddRule | 126 |
CommandRectangle | 127 |
CommandClosePath | 128 |
CommandDo | 129 |
Commandscn | 130 |
Commandcs | 131 |
Commandgs | 132 |
XObjectName | 133 |
ImageName | 134 |
FormName | 135 |
PatternName | 136 |
ExtGStateName | 137 |
WidthName | 138 |
WidthsName | 139 |
HeightName | 140 |
DCTDecodeName | 141 |
BitsPerComponentName | 142 |
WName | 143 |
DWName | 144 |
ColorSpaceName | 145 |
DeviceRGBName | 146 |
DeviceGrayName | 147 |
MatteName | 148 |
MediaBoxName | 149 |
FontDescriptorName | 150 |
FlagsName | 151 |
FontAscentName | 152 |
FontDescentName | 153 |
FontFile2Name | 154 |
FontFile3Name | 155 |
CIDFontOpenTypeName | 156 |
CIDFontType0CName | 157 |
ItalicAngleName | 158 |
CapHeightName | 159 |
StemVName | 160 |
ToUnicodeName | 161 |
ToUnicodeData | 162 |
ToUnicodeData2 | 163 |
PredictorName | 164 |
IndexedName | 165 |
ColorsName | 166 |
ColumnsName | 167 |
DecodeParmsName | 168 |
MaskName | 169 |
SMaskName | 170 |
ImageMaskName | 171 |
FontFolder | 172 | Windows font folder.
UserFontFolder | 173 | Windows local font folder. Since windows 10 1809, it is possible to install fonts in %userprofile%\AppData\Local\Microsoft\Windows\Fonts
UpDir | 174 |
LinuxFontFolder | 175 |
TTFExtension | 176 |
TTCExtension | 177 |
OTFExtension | 178 |
FamilyItalic | 179 |
FamilyOblique | 180 |
FamilyBold | 181 |
beginbfchar | 182 |
endbfchar | 183 |
beginbfrange | 184 |
endbfrange | 185 |
LinkName | 186 |
RectName | 187 |
AName | 188 |
MName | 189 |
LinkData | 190 |
BorderName | 191 |
Border0 | 192 |
NameName | 193 |
TextName | 194 |
CAName | 195 |
ICName | 196 |
BSName | 197 |
PatternTypeName | 198 |
PaintTypeName | 199 |
TilingTypeName | 200 |
XStepName | 201 |
YStepName | 202 |
BBoxName | 203 |
PatternColorSpacePrefix | 204 |
MatrixName | 205 |
ShadingName | 206 |
ShadingTypeName | 207 |
CoordsName | 208 |
FunctionName | 209 |
FunctionTypeName | 210 |
DomainName | 211 |
RangeName | 212 |
C0Name | 213 |
C1Name | 214 |
NName | 215 |
ExtendName | 216 |
FunctionsName | 217 |
BoundsName | 218 |
EncodeName | 219 |
AlphaName | 220 |
LuminosityName | 221 |
GName | 222 |
SName | 223 |
CSName | 224 |
GroupName | 225 |
TransparencyName | 226 |
OutlinesName | 227 |
PrevName | 228 |
NextName | 229 |
CName | 230 |
FName | 231 |
PageModeName | 232 |
PageLayoutName | 233 |
UseOutlinesName | 234 |
UseThumbsName | 235 |
FullScreenName | 236 |
UseOCName | 237 |
UseAttachmentsName | 238 |
SinglePageName | 239 |
OneColumnName | 240 |
TwoColumnLeftName | 241 |
TwoColumnRightName | 242 |
TwoPageLeftName | 243 |
TwoPageRightName | 244 |
OpenActionName | 245 |
DestName | 246 |
FitName | 247 |
FitHName | 248 |
FitVName | 249 |
XYZName | 250 |
TrueText | 251 |
FalseText | 252 |
AcroFormName | 253 |
FieldsName | 254 |
SigFlagsName | 255 |
SigName | 256 |
VName | 257 |
WidgetName | 258 |
PName | 259 |
TName | 260 |
FTName | 261 |
FfName | 262 |
LocationName | 263 |
ReasonName | 264 |
ContactInfoName | 265 |
APName | 266 |
ByteRangeName | 267 |
adbe_pkcs7_detachedName | 268 |
Adobe_PPKLiteName | 269 |
ReferenceName | 270 |
TransformMethodName | 271 |
TransformParamsName | 272 |
DocMDPName | 273 |
FieldMDPName | 274 |
MD5Name | 275 |
SigRefName | 276 |
V1_2Name | 277 |
DigestMethodName | 278 |
PermsName | 279 |
NamesName | 280 |
DigestValueName | 281 |
DigestLocationName | 282 |
IDName | 283 |
FormTypeName | 284 |
ImageCName | 285 |
ImageIName | 286 |
ImageBName | 287 |
ProcSetName | 288 |
PDFName | 289 |
FRMName | 290 |
n0Name | 291 |
n2Name | 292 |
BitsPerSampleName | 293 |
StructTreeRootName | 294 |
KName | 295 |
PgName | 296 |
RoleMapName | 297 |
AltName | 298 |
ParentTreeName | 299 |
ParentTreeNextKeyName | 300 |
MCIDName | 301 |
CommandBDC | 302 |
CommandEMC | 303 |
MarkInfoName | 304 |
MarkedName | 305 |
StructParentsName | 306 |
NumsName | 307 |
StructElemName | 308 |
OutputIntentName | 309 |
OutputIntentsName | 310 |
GTS_PDFA1Name | 311 |
OutputConditionIdentifierName | 312 |
sRGBId | 313 |
RegistryNameName | 314 |
DestOutputProfileName | 315 |
MetadataName | 316 |
XMLName | 317 |
LangName | 318 |
EmbeddedFilesName | 319 |
LimitsName | 320 |
FilespecName | 321 |
UFName | 322 |
DescName | 323 |
EFName | 324 |
EmbeddedFileName | 325 |
ModDateName | 326 |
ParamsName | 327 |
AFRelationshipName | 328 |
AlternativeName | 329 |
DataName | 330 |
SourceName | 331 |
SupplementName | 332 |
UnspecifiedName | 333 |
AFName | 334 |
ObjStmName | 335 |
AssetId | 336 | '@': Used by android assets.
None | 337 |


TPdfType Enumeration | FlexCel Studio for the .NET Framework documentation

TPdfType Enumeration

The variant of pdf that will be created.

Syntax

Namespace: FlexCel.Pdf

Members

Name | Value | Description
Standard | 0 | A normal pdf file.
PDFA1 | 1 | PDF/A-1a or b (http://en.wikipedia.org/?title=PDF/A) Note that PDF/A-1 generates larger files than PDF/A-2, and also doesn't support transparency. But PDF/A-1 is a more commonly used standard at the time of writing this documentation.
PDFA2 | 2 | PDF/A-2a or b. FlexCel will create smaller files in PDF/A-2 mode than in PDF/A-1 mode, so if possible you should try to use PDF/A-2 instead of A1. A2 also supports transparency. In FlexCel case, FlexCel can also sign PDF/A-2 files, but no PDF/A-1.
PDFA3 | 3 | PDF/A-3. Note that the only difference with PDF/A2 is the ability to embed other files inside the PDF file.


TPdfVersion Enumeration | FlexCel Studio for the .NET Framework documentation

TPdfVersion Enumeration

Specifies the version of PDF that FlexCel will generate.

Syntax

Namespace: FlexCel.Pdf

Members

Name | Value | Description
v14 | 0 | The files will be in Pdf 1.4 format (Acrobat 5). Older Acrobat versions will still able to open the file, but might miss features like transparency.
v16 | 1 | The files will be in Pdf 1.6 format (Acrobat 7). This allows for smaller files, but older Acrobat versions won't be able to open the file at all. You'll need Acrobat 7 or newer to see them.
v17 | 2 | The files will be in Pdf 1.7 format (Acrobat 8). You need Pdf 1.7 to sign files with SHA512. Since SHA1 is deprecated for signing, FlexCel will automatically choose v17 if the document is signed, no matter which version you manually select.


TTagMode Enumeration | FlexCel Studio for the .NET Framework documentation

TTagMode Enumeration

Specifies how the document will be tagged.

Syntax

Namespace: FlexCel.Pdf

Members

Name | Value | Description
Full | 0 | Document will be tagged with all tags.
None | 1 | Document will not be tagged.


TUnlicensedFontAction Enumeration | FlexCel Studio for the .NET Framework documentation

TUnlicensedFontAction Enumeration

Determines what to do when trying to embed a font that isn't licensed for embedding.

Syntax

Namespace: FlexCel.Pdf

Members

Name | Value | Description
Error | 0 | If the font doesn't have a valid license, FlexCel will throw an exception and won't complete the exporting.
Replace | 1 | If the font doesn't have a valid license, FlexCel will replace it by the font specified in the UnlicensedFontReplacement property.
Ignore | 2 | FlexCel won't look at the licensing of the font, and embed it anyway. Note that to use this option, you need to have a copyright agreement to distribute the font with its owner. Also note that in PDF/A mode this option is similar to Error and an Exception will be thrown. This is because PDF/A doesn't allow to embed fonts which don't have the correct license, and the document wouldn't validate.


TZoomOptions Enumeration | FlexCel Studio for the .NET Framework documentation

TZoomOptions Enumeration

Zoom options for a PDF destination.

Syntax

Namespace: FlexCel.Pdf

Members

Name | Value | Description
None | 0 | None, leave the zoom unchanged.
Fit | 1 | Display the page with its contents magnified just enough to fit the entire page within the window both horizontally and vertically. If the required horizontal and vertical magnification factors are different, use the smaller of the two, centering the page within the window in the other dimension.
FitH | 2 | Display the page with the vertical coordinate top positioned at the top edge of the window and the contents of the page magnified just enough to fit the entire width of the page within the window.
FitV | 3 | Display the page with the horizontal coordinate left positioned at the left edge of the window and the contents of the page magnified just enough to fit the entire height of the page within the window.
Zoom | 4 | Display the page with the coordinates (left, top) posi- tioned at the upper-left corner of the window and the contents of the page magnified by the factor zoom. A negative value for any of the parameters left, top, or zoom specifies that the current value of that parameter is to be retained un- changed. A zoom value of 0 has the same meaning as a negative value.


FontEmbedEventHandler Delegate | FlexCel Studio for the .NET Framework documentation

FontEmbedEventHandler Delegate

Delegate for reading the font data.

Syntax

Namespace: FlexCel.Pdf

public delegate void FontEmbedEventHandler(Object sender, FontEmbedEventArgs e)

Parameters

<-> | Parameter | Type | Description
 | sender | Object |
 | e | FontEmbedEventArgs |


GetFontDataEventHandler Delegate | FlexCel Studio for the .NET Framework documentation

GetFontDataEventHandler Delegate

Delegate for reading the font data.

Syntax

Namespace: FlexCel.Pdf

public delegate void GetFontDataEventHandler(Object sender, GetFontDataEventArgs e)

Parameters

<-> | Parameter | Type | Description
 | sender | Object |
 | e | GetFontDataEventArgs |


GetFontFolderEventHandler Delegate | FlexCel Studio for the .NET Framework documentation

GetFontFolderEventHandler Delegate

Delegate for reading the font data.

Syntax

Namespace: FlexCel.Pdf

public delegate void GetFontFolderEventHandler(Object sender, GetFontFolderEventArgs e)

Parameters

<-> | Parameter | Type | Description
 | sender | Object |
 | e | GetFontFolder​Event​Args |


TPdfAttachmentDataProviderDelegate Delegate | FlexCel Studio for the .NET Framework documentation

TPdfAttachmentDataProviderDelegate Delegate

Delegate used to attach files to a pdf file.

Syntax

Namespace: FlexCel.Pdf

public delegate void TPdfAttachmentDataProviderDelegate(TPdfAttachmentWriter writer)

Parameters

<-> | Parameter | Type | Description
 | writer | TPdfAttachmentWriter | Object used to write the attachment data into the file.


FlexCel.Render Namespace | FlexCel Studio for the .NET Framework documentation

FlexCel.Render Namespace

Classes related to rendering an Excel sheet so you can display it on the screen, print it or export it to other file formats.

Classes

Name | Description
FlexCelHtmlExport | A component for exporting an Excel file to HTML.
FlexCelHtmlExport​Progress | Indicates how much of the report has been generated.
FlexCelImgExport | A component for exporting an Excel file to an image. It can return an image object, or the actual bytes of a specific file format. (like gif, tiff or png)
FlexCelPdfExport | A component for exporting an Excel file to PDF.
FlexCelPdfExport​Progress | Indicates how much of the report has been generated.
FlexCelPrintDocument | A PrintDocument descendant that can be used to print and preview an Excel document.
FlexCelSVGExport | A component for exporting an Excel file to an SVG (Scalable Vector Graphics) image.
GetBookmarkInformation​Args | Arguments passed on FlexCelPdfExport.​Get​Bookmark​Information,
ImageInformation​Event​Args | Arguments passed on FlexCelHtmlExport.​OnGet​Image​Information,
ImgPaintEventArgs | Arguments passed on Paint events.
NamedRangeExport​Event​Args | Arguments passed on FlexCelHtmlExport.​OnNamed​Range​Export,
PageEventArgs | Arguments passed on FlexCelPdfExport.​Before​Generate​Page, FlexCelPdfExport.​Before​NewPage and FlexCelPdfExport.​After​Generate​Page
PrintHardMargins​Event​Args | Arguments passed on FlexCelPrint​Document.​Get​Printer​Hard​Margins.
SaveImageEventArgs | Arguments passed on FlexCelHtmlExport.​OnSave​Image,
SheetSelector​Entry​Event​Args | Arguments passed on FlexCel.​Render.​TStandard​Sheet​Selector.​OnSheet​Selector​Entry.
SVGExportParameters | Parameters used when exporting to SVG.
TCssInformation | Encapsulates the information needed to create external CSS files. Note that if you use the same TCssInformation instance to create different html files, the CSS file created will be only one.
TGeneratedFiles | An object containing all the files generated in the export.
THtmlExtraInfo | Stores extra data to write in the HTML file.
TImgExportInfo | Holds information needed to export the pages, so it is only calculated once.
TOneImgExportInfo | Holds information needed to export one of the workbook sheets, so it is only calculated once.
TPartialExportState | This class is used to save the needed information to partially export a file.
TSheetSelector | Abstract class to implement a Sheet Selector. Derive from this class for example to implement tabs with images. For a standard implementation using CSS Tabs and divs, use TStandardSheet​Selector
TSheetSelectorLink | Holds the sheet name in Excel and in the file.
TStandardSheet​Selector | Implements a standard sheet selector (with CSS tabs) that will allow you to change the page when exporting multiple sheets. You can customize its default behavior by altering the CSS properties, or by inheriting from it and replacing the virtual methods. If you want to create a completely new type of sheet selector, derive it from TSheetSelector instead of this class.
TStandardSheet​Selector​Styles | Holds the styles for one of the positions of a TStandardSheet​Selector.

Enumerations

Name | Description
THtmlImageFormat | Possible values in which we can save an image when exporting to HTML.
TSheetSelector​Position | Where to place the tabs for selecting a sheet when exporting multiple sheets. You might combine more than one, for example, to have tabs at the top and bottom: C#: TSheetSelector​Position.​Top | TSheetSelector​Position.​Bottom VB.NET, Delphi.NET: TSheetSelector​Position.​Top or TSheetSelector​Position.​Bottom

Delegates

Name | Description
GetBookmarkInformation​Event​Handler | This event will happen each time a PDF bookmark is automatically added by FlexCel. You can use it to customize the bookmark, for example change the font color or style.
ImageInformation​Event​Handler | Delegate used to specify where to store the images on a page.
NamedRangeExport​Event​Handler | Delegate used to customize exporting of named ranges on a page.
PageEventHandler | Generic delegate for After/Before page events.
PaintEventHandler | Delegate for Paint events.
PrintHardMargins​Event​Handler | Delegate for getting the printer physical margins.
SaveImageEvent​Handler | Delegate used to specify where to store the images on a page.
SheetSelector​Entry​Event​Handler | Delegate used to specify how the Sheet Selector will be like.


FlexCelHtmlExport Class | FlexCel Studio for the .NET Framework documentation

FlexCelHtmlExport Class

A component for exporting an Excel file to HTML.

Syntax

Namespace: FlexCel.Render

public class FlexCelHtmlExport: Component, IHtmlFontEvent

Constructors

Name | Description
FlexCelHtmlExport | Overloaded FlexCelHtmlExport FlexCelHtmlExport(ExcelFile) FlexCelHtmlExport(ExcelFile, Boolean)

Methods

Name | Description
OnGetImageInformation Replace this event when creating a custom descendant of FlexCelHtmlExport.
OnSaveImage Replace this event when creating a custom descendant of FlexCelHtmlExport.
OnHtmlFont Replace this event when creating a custom descendant of FlexCelHtmlExport.
OnNamedRangeExport Replace this event when creating a custom descendant of FlexCelHtmlExport.
Cancel Cancels a running export. This method is equivalent to setting Canceled = true.
Export Overloaded
 Export(String, String)
Export(TextWriter, String, TCssInformation)
Export(String, String, TCssInformation)
Export(String, String, String)
ExportToClipboard​Format | Exports the file in the format expected by the CT_HTML clipboard format: https:​//​msdn.​microsoft.​com/​en-​us/​library/​windows/​desktop/​ms649015(​v=​vs.​85)​.aspx
ExportAllVisible​Sheets​AsTabs Overloaded
 ExportAllVisibleSheetsAsTabs(String, String, String, String, String, TSheetSelector)
ExportAllVisibleSheetsAsTabs(String, String, String, String, String, TSheetSelector, OnSheetNameEventHandler)
ExportAllVisible​Sheets​AsOne​Html​File Overloaded
 ExportAllVisibleSheetsAsOneHtmlFile(String, String, String, String)
ExportAllVisibleSheetsAsOneHtmlFile(TextWriter, String, String, String, String)
ReplaceSeparator​Macros This method is for internal use. It will replace the sheet name, pos and count macros in a sheet separator.
PartialExportAdd Overloaded
 PartialExportAdd(TPartialExportState, String, String)
PartialExportAdd(TPartialExportState, String, String, Boolean)
DoHtmlFont This method is for internal use.

Properties

Name | Description
Canceled | If true the export has been canceled with Cancel method. You can't set this variable to false, and setting it true is the same as calling Cancel.
Progress | Progress of the export. This variable can be accessed from other thread or from the OnProgress event.
Workbook | The ExcelFile to export.
HidePrintObjects | Select which kind of objects should not be exported to html. By default we do *not* export headers and footers, since they are normally not what you want when exporting to HTML.
HtmlVersion | Version of the HTML generated.
HtmlFileFormat | Format of the HTML file to be generated.
ClassPrefix | Prefix to be appended to all CSS classes. For example, if you set it to "test", CSS classes will be named like ".test1234". Normally you do not need to change this property, but if you need to insert multiple Excel files in the same HTML page, you need to ensure all classes have an unique ClassPrefix.
FixIE6Transparent​PngSupport | By default, Internet explorer does not support transparent PNGs. Normally this is not an issue, since Excel does not use much transparency. But if you rely on transparent images and don't want to use gif images instead of png, you can set this property to true. It will add special code to the HTML file to support transparent images in IE6. Note: If setting this property to false, you might want to set ImageBackground to Colors.White instead of TUIColor.Empty to ensure images have no transparent background.
FixOutlook2007Css​Support | Outlook 2007 renders HTML worse than previous versions, since it switched to the Word 2007 rendering engine instead of Internet Explorer to show HTML emails. If you apply this fix, some code will be added to the generated HTML file to improve the display in Outlook 2007. Other browsers will not be affected and will still render the original file. Turn this option on if you plan to email the generated file as an HTML email or to edit them in Word 2007. Note that the pages will not validate with the w3c validator if this option is on.
FixIE6WordWrap​Support | Some older browsers (and Word 2007) might not support the CSS white-space tag. In this case, if a line longer than a cell cannot be expanded to the right (because there is data in the next cell) it will wrap down instead of being cropped. This fix will cut the text on this cell to the displayable characters. If a letter was displayed by the half on the right, after applying this fix it will not display. This fix is automatically applied when FixOutlook2007Css​Support ...[more]
UseContentId | When exporting to MHTML, some mail clients might have problems understanding the newer "Content-Location" header to show the images. When this property is true, we will use the older "Content-Id" header that is better supported than Content Location in the mime headers to reference the images. You are strongly encouraged to keep this property true in order to maximize the number of mail readers compatible. When Exporting to HTML (not MHTML), this property has no effect.
HeadingWidth | Width in points of the left gutter when printing row numbers and column names.
HeadingStyle | Style definition for the gutter cells when printing row numbers or column names. This text must be a valid CSS style definition, without including the braces ("{}").
PrintRangeLeft | First column to print (1 based). if this or any other PrintRange property is 0, the range will be automatically calculated.
PrintRangeTop | First row to print (1 based). if this or any other PrintRange property is 0, the range will be automatically calculated.
PrintRangeRight | Last column to print (1 based). if this or any other PrintRange property is 0, the range will be automatically calculated.
PrintRangeBottom | Last row to print (1 based). if this or any other PrintRange property is 0, the range will be automatically calculated.
AllowOverwriting​Files | Determines if FlexCel will automatically delete existing HTML and image files or not.
IgnoreSharing​Violations | When this property is true and the component tries to write any file that is locked by other thread, it will not raise an error and just assume the other thread will write the correct image. You will normally want to have this true, so you can have many threads writing to the same file without issues. Note that when AllowOverwriting​Files is false, this property has no effect.
VerticalTextAsImages | When true and text is vertical, FlexCel will replace the text with an image in order to show it correctly in HTML. When false, text will be rendered normally without rotation. Note that when using HTML5 this property is ignored, since HTML5 allows text rotation.
ExportNamedRanges | When true FlexCel will insert a span in the first cell of every named range with "id" = the name of the range. You can access then this with javascript. For a fine grain control of how names are exported, you can use NamedRangeExport event.
LinksInNewWindow | If true, the links will be exported with a target=_blank attribute so they open in a new window.
BackgroundColor | Background color for empty cells. This is White by default, but you migth want to make it TUIColor.Empty if you want the cells to not cover the background.
BaseUrl | If this property is not null, all hyperlinks stating with this value will be converted to relative links, by removing this string from them. Hyperlinks in Excel must be absolute by default, so this property is a way to get relative hyperlinks. For example, if BaseUrl is "https:​//​www.​tmssoftware.​com/​" and an Excel file has a link "https:​//​www.​tmssoftware.​com/​test.​html" the link in the generated HTML file will be "test.html"
UsePrintScale | If false (the default) the print scale of the sheet will be ignored when exporting to html. If true, sheets will be exported honoring the zoom of the page.Note that if PrintToFit is true, then this value will be ignored and zoom will be 100%.
ImageResolution | Resolution for the exported images. The bigger the resolution, the bigger the image size and quality. Use 96 for standard screen resolution.
SavedImagesFormat | File format in which the images will be saved. Note that Ie6 does not support transparency in PNGs by default, so if you have transparent images and you want to make you page compatible with IE6, you should save as gif or use FixIE6Transparent​PngSupport
SmoothingMode | This affects how the images, charts, etc are rendered for the image file. Some modes will look a little blurred but with better quality. Consult the .NET framework documentation on SmoothingMode for more information
InterpolationMode | This affects how the images, charts, etc are rendered for the image file. Some modes will look a little blurred but with better quality. Consult the .NET framework documentation on SmoothingMode for more information
AntiAliased | This affects how the text is rendered for example when exporting a chart. Some modes will look a little blurred but with better quality. Consult the .NET framework documentation on SmoothingMode for more information
ImageBackground | When this property is set to TUIColor.Empty (the default), images will be rendered with a transparent background. While this is the normal behavior, sometimes you might not want transparent images (for example to support Internet Explorer 6 without setting FixIE6Transparent​PngSupport to true), and then you could use Colors.White here.
RasterizeSVGImages | If false (the default) then FlexCel will export SVG images inside the Excel file as SVG images inside the generated HTML. If true, FlexCel will convert the SVG images to PNG and embed the PNG inside the HTML. This might be more accurate specially if the embedded SVG uses fonts that might not be present in the client machine. See S V G Files Inside Xlsx Files for more information.
ImageNaming | This property defines how the images will be named by FlexCel. You can always override the name using the GetImageInformation event.
EmbedImages | If true, images will be embedded in the HTML file using base64 encoded data uris as defined in http:​//​tools.​ietf.​org/​html/​rfc2397
ExtraInfo | Extra information to be added to the HTML file.
GeneratedFiles | Contains all the generated files by the component. Note that it might contain files not actually generated, if an error happened while trying to create them.
HasSaveImageEvent | Override this property when creating your own OnSaveImage descendant. This method should return true if there is any event attached to it.

Events

Name | Description
GetImageInformation | Use this event to customize where to save the images when exporting to HTML.
SaveImage | Use this event to save the images into other place. Note that this event only fires when saving HTML, not MTHML.
HtmlFont | Use this event to customize the fonts used in the exported file.
NamedRangeExport | Use this event to customize how a named range if exported to the HTML file. Note that for this event to be called, you first need to set ExportNamedRanges = true. If you want to change the id that will be exported or exclude certain named from being exported, you can do so here.


FlexCelHtmlExport.FlexCelHtmlExport Constructor | FlexCel Studio for the .NET Framework documentation

FlexCelHtmlExport.FlexCelHtmlExport Constructor

Overloads

  • FlexCelHtmlExport.FlexCelHtmlExport
  • FlexCelHtmlExport.FlexCelHtmlExport(ExcelFile)
  • FlexCelHtmlExport.FlexCelHtmlExport(ExcelFile, Boolean)

FlexCelHtmlExport.FlexCelHtmlExport

Creates a new FlexCelHtmlExport instance.

Syntax

Namespace: FlexCel.Render

public FlexCelHtmlExport()

See also

  • FlexCelHtmlExport

FlexCelHtmlExport.FlexCelHtmlExport(ExcelFile)

Creates a new FlexCelHtmlExport and assigns it to an ExcelFile.

Syntax

Namespace: FlexCel.Render

public FlexCelHtmlExport(ExcelFile aWorkbook)

Parameters

<-> | Parameter | Type | Description
 | aWorkbook | ExcelFile | ExcelFile containing the data this component will export.

See also

  • FlexCelHtmlExport

FlexCelHtmlExport.FlexCelHtmlExport(ExcelFile, Boolean)

Creates a new FlexCelHtmlExport and assigns it to an ExcelFile, setting AllowOverwritingFiles to the desired value.

Syntax

Namespace: FlexCel.Render

public FlexCelHtmlExport(ExcelFile aWorkbook, Boolean aAllowOverwritingFiles)

Parameters

<-> | Parameter | Type | Description
 | aWorkbook | ExcelFile | ExcelFile containing the data this component will export.
 | aAllowOverwritingFiles | Boolean | When true, existing files will be overwritten.

See also

  • FlexCelHtmlExport


FlexCelHtmlExport.OnGetImageInformation Method | FlexCel Studio for the .NET Framework documentation

FlexCelHtmlExport.OnGetImageInformation Method

Replace this event when creating a custom descendant of FlexCelHtmlExport.

Syntax

Namespace: FlexCel.Render

protected internal virtual void OnGetImageInformation(ImageInformationEventArgs e)

Parameters

<-> | Parameter | Type | Description
 | e | ImageInformation​Event​Args |

See also

  • FlexCelHtmlExport


FlexCelHtmlExport.OnSaveImage Method | FlexCel Studio for the .NET Framework documentation

FlexCelHtmlExport.OnSaveImage Method

Replace this event when creating a custom descendant of FlexCelHtmlExport.

Syntax

Namespace: FlexCel.Render

protected internal virtual void OnSaveImage(SaveImageEventArgs e)

Parameters

<-> | Parameter | Type | Description
 | e | SaveImageEventArgs |

See also

  • FlexCelHtmlExport


FlexCelHtmlExport.OnHtmlFont Method | FlexCel Studio for the .NET Framework documentation

FlexCelHtmlExport.OnHtmlFont Method

Replace this event when creating a custom descendant of FlexCelHtmlExport.

Syntax

Namespace: FlexCel.Render

protected virtual void OnHtmlFont(HtmlFontEventArgs e)

Parameters

<-> | Parameter | Type | Description
 | e | HtmlFontEventArgs |

See also

  • FlexCelHtmlExport


FlexCelHtmlExport.OnNamedRangeExport Method | FlexCel Studio for the .NET Framework documentation

FlexCelHtmlExport.OnNamedRangeExport Method

Replace this event when creating a custom descendant of FlexCelHtmlExport.

Syntax

Namespace: FlexCel.Render

protected internal virtual void OnNamedRangeExport(NamedRangeExportEventArgs e)

Parameters

<-> | Parameter | Type | Description
 | e | NamedRangeExport​Event​Args |

See also

  • FlexCelHtmlExport


FlexCelHtmlExport.Cancel Method | FlexCel Studio for the .NET Framework documentation

FlexCelHtmlExport.Cancel Method

Cancels a running export. This method is equivalent to setting Canceled = true.

Syntax

Namespace: FlexCel.Render

public void Cancel()

See also

  • FlexCelHtmlExport


FlexCelHtmlExport.Export Method | FlexCel Studio for the .NET Framework documentation

FlexCelHtmlExport.Export Method

Overloads

  • FlexCelHtmlExport.Export(String, String)
  • FlexCelHtmlExport.Export(TextWriter, String, TCssInformation)
  • FlexCelHtmlExport.Export(String, String, TCssInformation)
  • FlexCelHtmlExport.Export(String, String, String)

FlexCelHtmlExport.Export(String, String)

Exports the active sheet of the the associated xls workbook to a file. CSS will be saved internally in the file.

Syntax

Namespace: FlexCel.Render

public void Export(String htmlFileName, String relativeImagePath)

Parameters

<-> | Parameter | Type | Description
 | htmlFileName | String | File name of the html file to be created.
 | relativeImagePath | String | Folder where images will be stored, relative to the main file. If for example htmlFileName is "c:\reports\html\index.htm" and relativeImagePath is "images", images will be saved in folder "c:\reports\html\images". If this parameter is null or empty, images will be saved in the same folder as the html file.

See also

  • FlexCelHtmlExport

FlexCelHtmlExport.Export(TextWriter, String, TCssInformation)

Exports the active sheet of the associated xls workbook to a TextWriter. Note that you need to supply the stream for saving the images in the GetImageInformation event (if you want to save the images).

Syntax

Namespace: FlexCel.Render

public void Export(TextWriter html, String fileName, TCssInformation css)

Parameters

<-> | Parameter | Type | Description
 | html | TextWriter | TextWriter where the result will be written.
 | fileName | String | FileName used to generate the supporting files. If you leave it null, no images will be saved as there will not be filename for them.
 | css | TCssInformation | Use this parameter to store all CSS information in an external file. Set it to null if you want to store the CSS inside the HTML file. If you want to share the CSS between multiple files, make sure you pass the same css parameter to all Export calls.

See also

  • FlexCelHtmlExport

FlexCelHtmlExport.Export(String, String, TCssInformation)

Exports the active sheet of the the associated xls workbook to a file.

Syntax

Namespace: FlexCel.Render

public void Export(String htmlFileName, String relativeImagePath, TCssInformation css)

Parameters

<-> | Parameter | Type | Description
 | htmlFileName | String | File name of the html file to be created.
 | relativeImagePath | String | Folder where images will be stored, relative to the main file. If for example htmlFileName is "c:\reports\html\index.htm" and relativeImagePath is "images", images will be saved in folder "c:\reports\html\images". If this parameter is null or empty, images will be saved in the same folder as the html file.
 | css | TCssInformation | Use this parameter to store all CSS information in an external file. Set it to null if you want to store the CSS inside the HTML file. If you want to share the CSS between multiple files, make sure you pass the same css parameter to all Export calls.

See also

  • FlexCelHtmlExport

FlexCelHtmlExport.Export(String, String, String)

Exports the active sheet of the the associated xls workbook to a file.

Syntax

Namespace: FlexCel.Render

public void Export(String htmlFileName, String relativeImagePath, String relativeCssFileName)

Parameters

<-> | Parameter | Type | Description
 | htmlFileName | String | File name of the html file to be created.
 | relativeImagePath | String | Folder where images will be stored, relative to the main file. If for example htmlFileName is "c:\reports\html\index.htm" and relativeImagePath is "images", images will be saved in folder "c:\reports\html\images". If this parameter is null or empty, images will be saved in the same folder as the html file.
 | relativeCssFileName | String | Name for the Css file, with a path relative to the htmlPath. If you set it to null, no css file created and the css will be stored inside each HTML file. If for example htmlpath is "c:\reports" and relativeCssFileName is "css\data.css" the css file will be saved in "c:\reports\css\data.css"

See also

  • FlexCelHtmlExport


FlexCelHtmlExport.ExportToClipboardFormat Method | FlexCel Studio for the .NET Framework documentation

FlexCelHtmlExport.ExportToClipboardFormat Method

Exports the file in the format expected by the CT_HTML clipboard format: https://msdn.microsoft.com/en-us/library/windows/desktop/ms649015(v=vs.85).aspx

Syntax

Namespace: FlexCel.Render

public void ExportToClipboardFormat(Stream resultStream)

Parameters

<-> | Parameter | Type | Description
 | resultStream | Stream | Stream where the html will be exported.

See also

  • FlexCelHtmlExport


FlexCelHtmlExport.ExportAllVisibleSheetsAsTabs Method | FlexCel Studio for the .NET Framework documentation

FlexCelHtmlExport.ExportAllVisibleSheetsAsTabs Method

Overloads

  • FlexCelHtmlExport.ExportAllVisibleSheetsAsTabs(String, String, String, String, String, TSheetSelector)
  • FlexCelHtmlExport.ExportAllVisibleSheetsAsTabs(String, String, String, String, String, TSheetSelector, OnSheetNameEventHandler)

FlexCelHtmlExport.ExportAllVisibleSheetsAsTabs(String, String, String, String, String, TSheetSelector)

This method will export all the visible sheets on an xls file to an html file, writing each sheet in a different file. This is equivalent to calling Export on every sheet.

Syntax

Namespace: FlexCel.Render

public void ExportAllVisibleSheetsAsTabs(String htmlPath, String htmlFileNamePrefix, String htmlFileNamePostfix, String relativeImagePath, String relativeCssFileName, TSheetSelector sheetSelector)

Parameters

<-> | Parameter | Type | Description
 | htmlPath | String | Path where html files will be stored. (one per sheet in the workbook)
 | htmlFileNamePrefix | String | This is a string that will be added to every file generated, at the beggining of the filename. For example, if htlmFileNamePrefix = "test_" and htmlFileNamePostfix = ".html", "sheet1" will be exported as "test_sheet1.html". If generating a single file (MHTML format), htmlFileNamePrefix + htmlFileNamePostFix will be used, without a sheet name. Note that you can change the sheetname to some other string in the OnSheetName event, so the final name will be htmlFileNamePrefix + "string returned in OnSheetName" + htmlFileNamePostfix.
 | htmlFileNamePostfix | String | This is a string that will be added to every file generated, at the end of the filename. Make sure you include the extension here. For example, if htlmFileNamePrefix = "test_" and htmlFileNamePostfix = ".html", "sheet1" will be exported as "test_sheet1.html" If generating a single file (MHTML format), htmlFileNamePrefix + htmlFileNamePostFix will be used, without a sheet name.
 | relativeImagePath | String | Folder where images will be stored, relative to the htmlPath. If for example htmlPath is "c:\reports\html" and relativeImagePath is "images", images will be saved in folder "c:\reports\html\images". If this parameter is null or empty, images will be saved in the same folder as the html files.
 | relativeCssFileName | String | Name for the Css file, with a path relative to the htmlPath. Note that the css will be shared among all sheets, so only one file will be created. if you set it to null, no css file created and the css will be stored inside each HTML file. It is recommended that you provide an extenal name here, so the CSS is shared webpages are smaller. If for example htmlpath is "c:\reports" and relativeCssFileName is "css\data.css" the css file will be saved in "c:\reports\css\data.css"
 | sheetSelector | TSheetSelector | Information about how to draw the tabs that will allow you to switch between the sheets. Set it to null if you do not want to include a sheet selector.

See also

  • FlexCelHtmlExport

FlexCelHtmlExport.ExportAllVisibleSheetsAsTabs(String, String, String, String, String, TSheetSelector, OnSheetNameEventHandler)

This method will export all the visible sheets on an xls file to an html file, writing each sheet in a different file. This is equivalent to calling Export on every sheet.

Syntax

Namespace: FlexCel.Render

public void ExportAllVisibleSheetsAsTabs(String htmlPath, String htmlFileNamePrefix, String htmlFileNamePostfix, String relativeImagePath, String relativeCssFileName, TSheetSelector sheetSelector, OnSheetNameEventHandler OnSheetName)

Parameters

<-> | Parameter | Type | Description
 | htmlPath | String | Path where html files will be stored. (one per sheet in the workbook)
 | htmlFileNamePrefix | String | This is a string that will be added to every file generated, at the beggining of the filename. For example, if htlmFileNamePrefix = "test_" and htmlFileNamePostfix = ".html", "sheet1" will be exported as "test_sheet1.html". If generating a single file (MHTML format), htmlFileNamePrefix + htmlFileNamePostFix will be used, without a sheet name. Note that you can change the sheetname to some other string in the OnSheetName event, so the final name will be htmlFileNamePrefix + "string returned in OnSheetName" + htmlFileNamePostfix.
 | htmlFileNamePostfix | String | This is a string that will be added to every file generated, at the end of the filename. Make sure you include the extension here. For example, if htlmFileNamePrefix = "test_" and htmlFileNamePostfix = ".html", "sheet1" will be exported as "test_sheet1.html" If generating a single file (MHTML format), htmlFileNamePrefix + htmlFileNamePostFix will be used, without a sheet name.
 | relativeImagePath | String | Folder where images will be stored, relative to the htmlPath. If for example htmlPath is "c:\reports\html" and relativeImagePath is "images", images will be saved in folder "c:\reports\html\images". If this parameter is null or empty, images will be saved in the same folder as the html files.
 | relativeCssFileName | String | Name for the Css file, with a path relative to the htmlPath. Note that the css will be shared among all sheets, so only one file will be created. if you set it to null, no css file created and the css will be stored inside each HTML file. It is recommended that you provide an extenal name here, so the CSS is shared webpages are smaller. If for example htmlpath is "c:\reports" and relativeCssFileName is "css\data.css" the css file will be saved in "c:\reports\css\data.css"
 | sheetSelector | TSheetSelector | Information about how to draw the tabs that will allow you to switch between the sheets. Set it to null if you do not want to include a sheet selector.
 | OnSheetName | OnSheetNameEvent​Handler | Use this event to customize the filename for the created files, and use something different than the sheet name.

See also

  • FlexCelHtmlExport


FlexCelHtmlExport.ExportAllVisibleSheetsAsOneHtmlFile Method | FlexCel Studio for the .NET Framework documentation

FlexCelHtmlExport.ExportAllVisibleSheetsAsOneHtmlFile Method

Overloads

  • FlexCelHtmlExport.ExportAllVisibleSheetsAsOneHtmlFile(String, String, String, String)
  • FlexCelHtmlExport.ExportAllVisibleSheetsAsOneHtmlFile(TextWriter, String, String, String, String)

FlexCelHtmlExport.ExportAllVisibleSheetsAsOneHtmlFile(String, String, String, String)

Exports all visible sheets in an xls file one after the other in the same html file.

Syntax

Namespace: FlexCel.Render

public void ExportAllVisibleSheetsAsOneHtmlFile(String htmlFileName, String relativeImagePath, String relativeCssFileName, String sheetSeparator)

Parameters

<-> | Parameter | Type | Description
 | htmlFileName | String | Path where the generated html file will be stored.
 | relativeImagePath | String | Folder where images will be stored, relative to the path in htmlFileName. If for example htmlFileName is "c:\reports\html\test.htm" and relativeImagePath is "images", images will be saved in folder "c:\reports\html\images". If this parameter is null or empty, images will be saved in the same folder as the html file.
 | relativeCssFileName | String | Name for the Css file, with a path relative to the htmlFileName Path. if you set it to null, no css file created and the css will be stored inside each HTML file. If for example htmlFileName is "c:\reports\test.htm" and relativeCssFileName is "css\data.css" the css file will be saved in "c:\reports\css\data.css"
 | sheetSeparator | String | An HTML string to write between all the different sheets being exported. You can use for example <hr /> here to add a horizontal line. You can also use the special macros <#SheetName>, <#SheetCount>, <#SheetPos> <#PrevSheetName> and <#PrevSheetPos> here to enter the current sheet name, the number of sheets and the current sheet respectively. The macros are case insensitive, you can enter them in any combination of upper and lower case.

See also

  • FlexCelHtmlExport

FlexCelHtmlExport.ExportAllVisibleSheetsAsOneHtmlFile(TextWriter, String, String, String, String)

Exports all visible sheets in an xls file one after the other in the same html stream.

Syntax

Namespace: FlexCel.Render

public void ExportAllVisibleSheetsAsOneHtmlFile(TextWriter html, String htmlFileName, String relativeImagePath, String relativeCssFileName, String sheetSeparator)

Parameters

<-> | Parameter | Type | Description
 | html | TextWriter | Stream where the HTML file will be saved.
 | htmlFileName | String | The filename itself won't be used (since the html file is saved to a stream), but it will tell the path where the generated extra files (for example images) will be stored, and also the way images are named.
 | relativeImagePath | String | Folder where images will be stored, relative to the path in htmlFileName. If for example htmlFileName is "c:\reports\html\test.htm" and relativeImagePath is "images", images will be saved in folder "c:\reports\html\images". If this parameter is null or empty, images will be saved in the same folder as the html file.
 | relativeCssFileName | String | Name for the Css file, with a path relative to the htmlFileName Path. if you set it to null, no css file created and the css will be stored inside each HTML file. If for example htmlFileName is "c:\reports\test.htm" and relativeCssFileName is "css\data.css" the css file will be saved in "c:\reports\css\data.css"
 | sheetSeparator | String | An HTML string to write between all the different sheets being exported. You can use for example <hr /><p>Sheet <#SheetName></p> here to add a horizontal line. You can also use the special macros <#SheetName>, <#SheetCount> and <#SheetPos> here to enter the current sheet name, the number of sheets and the current sheet respectively. The macros are case insensitive, you can enter them in any combination of upper and lower case.

See also

  • FlexCelHtmlExport


FlexCelHtmlExport.ReplaceSeparatorMacros Method | FlexCel Studio for the .NET Framework documentation

FlexCelHtmlExport.ReplaceSeparatorMacros Method

This method is for internal use. It will replace the sheet name, pos and count macros in a sheet separator.

Syntax

Namespace: FlexCel.Render

public static String ReplaceSeparatorMacros(ExcelFile Work, Int32 i, String Separator)

Parameters

<-> | Parameter | Type | Description
 | Work | ExcelFile |
 | i | Int32 |
 | Separator | String |

See also

  • FlexCelHtmlExport


FlexCelHtmlExport.PartialExportAdd Method | FlexCel Studio for the .NET Framework documentation

FlexCelHtmlExport.PartialExportAdd Method

Overloads

  • FlexCelHtmlExport.PartialExportAdd(TPartialExportState, String, String)
  • FlexCelHtmlExport.PartialExportAdd(TPartialExportState, String, String, Boolean)

FlexCelHtmlExport.PartialExportAdd(TPartialExportState, String, String)

This method is designed to export a part of the HTML inside other HTML file. You should call this method once for every file you wish to export, in order to let FlexCel consolidate the needed CSS classes and information into the partialExportState parameter. Once you have "filled" the partialExportState object with all the information on files you wish to export, you can call the methods in partialExportState to write the CSS or body parts of the HTML file.

Note that this overload version will automatically save the images to disk when needed. If for any reason you do not want to save the images, use the overload with SaveImagesToDisk parameter.

Remarks

This method does *not* clear the generated files array, so you have more control over it. If you want to use it, you need to call the clear method yourself before the first PartialExportAdd.

Syntax

Namespace: FlexCel.Render

public void PartialExportAdd(TPartialExportState partialExportState, String htmlFileName, String relativeImagePath)

Parameters

<-> | Parameter | Type | Description
 | partialExportState | TPartialExportState | Object where we will collect all the css and needed information on the files being exported. Call this method once for every sheet you want to export, using the same partialExportState parameter.
 | htmlFileName | String | Name of the stored html file. This affects the path where images will be saved, and also the way images will be named.
 | relativeImagePath | String | Path relative to the path of htmlFileName, where images will be stored.

See also

  • FlexCelHtmlExport

FlexCelHtmlExport.PartialExportAdd(TPartialExportState, String, String, Boolean)

This method is designed to export a part of the HTML inside other HTML file. You should call this method once for every file you wish to export, in order to let FlexCel consolidate the needed CSS classes and information into the partialExportState parameter. Once you have "filled" the partialExportState object with all the information on files you wish to export, you can call the methods in partialExportState to write the CSS or body parts of the HTML file.

Remarks

This method does *not* clear the generated files array, so you have more control over it. If you want to use it, you need to call the clear method yourself before the first PartialExportAdd.

Syntax

Namespace: FlexCel.Render

public void PartialExportAdd(TPartialExportState partialExportState, String htmlFileName, String relativeImagePath, Boolean SaveImagesToDisk)

Parameters

<-> | Parameter | Type | Description
 | partialExportState | TPartialExportState | Object where we will collect all the css and needed information on the files being exported. Call this method once for every sheet you want to export, using the same partialExportState parameter.
 | htmlFileName | String | Name of the stored html file. This affects the path where images will be saved, and also the way images will be named.
 | relativeImagePath | String | Path relative to the path of htmlFileName, where images will be stored.
 | SaveImagesToDisk | Boolean | When true, any image found in the file will be saved to disk (to relative imagepath) as the file is added. If false, the links for the image will be written but no image will be saved to disk, you have to do this yourself. Note that when saving MHTML files this parameter doesn't matter, since images will not be saved to disk anyway.

See also

  • FlexCelHtmlExport


FlexCelHtmlExport.DoHtmlFont Method | FlexCel Studio for the .NET Framework documentation

FlexCelHtmlExport.DoHtmlFont Method

This method is for internal use.

Syntax

Namespace: FlexCel.Render

public void DoHtmlFont(HtmlFontEventArgs e)

Parameters

<-> | Parameter | Type | Description
 | e | HtmlFontEventArgs |

See also

  • FlexCelHtmlExport


FlexCelHtmlExport.Canceled Property | FlexCel Studio for the .NET Framework documentation

FlexCelHtmlExport.Canceled Property

If true the export has been canceled with Cancel method. You can't set this variable to false, and setting it true is the same as calling Cancel.

Syntax

Namespace: FlexCel.Render

public Boolean Canceled { get; set; }

See also

  • FlexCelHtmlExport


FlexCelHtmlExport.Progress Property | FlexCel Studio for the .NET Framework documentation

FlexCelHtmlExport.Progress Property

Progress of the export. This variable can be accessed from other thread or from the OnProgress event.

Syntax

Namespace: FlexCel.Render

public FlexCelHtmlExportProgress Progress { get; }

See also

  • FlexCelHtmlExport


FlexCelHtmlExport.Workbook Property | FlexCel Studio for the .NET Framework documentation

FlexCelHtmlExport.Workbook Property

The ExcelFile to export.

Syntax

Namespace: FlexCel.Render

public ExcelFile Workbook { get; set; }

See also

  • FlexCelHtmlExport


FlexCelHtmlExport.HidePrintObjects Property | FlexCel Studio for the .NET Framework documentation

FlexCelHtmlExport.HidePrintObjects Property

Select which kind of objects should not be exported to html. By default we do *not* export headers and footers, since they are normally not what you want when exporting to HTML.

Syntax

Namespace: FlexCel.Render

public THidePrintObjects HidePrintObjects { get; set; }

See also

  • FlexCelHtmlExport


FlexCelHtmlExport.HtmlVersion Property | FlexCel Studio for the .NET Framework documentation

FlexCelHtmlExport.HtmlVersion Property

Version of the HTML generated.

Syntax

Namespace: FlexCel.Render

public THtmlVersion HtmlVersion { get; set; }

See also

  • FlexCelHtmlExport


FlexCelHtmlExport.HtmlFileFormat Property | FlexCel Studio for the .NET Framework documentation

FlexCelHtmlExport.HtmlFileFormat Property

Format of the HTML file to be generated.

Syntax

Namespace: FlexCel.Render

public THtmlFileFormat HtmlFileFormat { get; set; }

See also

  • FlexCelHtmlExport


FlexCelHtmlExport.ClassPrefix Property | FlexCel Studio for the .NET Framework documentation

FlexCelHtmlExport.ClassPrefix Property

Prefix to be appended to all CSS classes. For example, if you set it to "test", CSS classes will be named like ".test1234". Normally you do not need to change this property, but if you need to insert multiple Excel files in the same HTML page, you need to ensure all classes have an unique ClassPrefix.

Syntax

Namespace: FlexCel.Render

public String ClassPrefix { get; set; }

See also

  • FlexCelHtmlExport


FlexCelHtmlExport.FixIE6TransparentPngSupport Property | FlexCel Studio for the .NET Framework documentation

FlexCelHtmlExport.FixIE6TransparentPngSupport Property

By default, Internet explorer does not support transparent PNGs. Normally this is not an issue, since Excel does not use much transparency. But if you rely on transparent images and don't want to use gif images instead of png, you can set this property to true. It will add special code to the HTML file to support transparent images in IE6.

Note: If setting this property to false, you might want to set ImageBackground to Colors.White instead of TUIColor.Empty to ensure images have no transparent background.

Syntax

Namespace: FlexCel.Render

public Boolean FixIE6TransparentPngSupport { get; set; }

See also

  • FlexCelHtmlExport


FlexCelHtmlExport.FixOutlook2007CssSupport Property | FlexCel Studio for the .NET Framework documentation

FlexCelHtmlExport.FixOutlook2007CssSupport Property

Outlook 2007 renders HTML worse than previous versions, since it switched to the Word 2007 rendering engine instead of Internet Explorer to show HTML emails. If you apply this fix, some code will be added to the generated HTML file to improve the display in Outlook 2007. Other browsers will not be affected and will still render the original file. Turn this option on if you plan to email the generated file as an HTML email or to edit them in Word 2007. Note that the pages will not validate with the w3c validator if this option is on.

Syntax

Namespace: FlexCel.Render

public Boolean FixOutlook2007CssSupport { get; set; }

See also

  • FlexCelHtmlExport


FlexCelHtmlExport.FixIE6WordWrapSupport Property | FlexCel Studio for the .NET Framework documentation

FlexCelHtmlExport.FixIE6WordWrapSupport Property

Some older browsers (and Word 2007) might not support the CSS white-space tag. In this case, if a line longer than a cell cannot be expanded to the right (because there is data in the next cell) it will wrap down instead of being cropped. This fix will cut the text on this cell to the displayable characters. If a letter was displayed by the half on the right, after applying this fix it will not display. This fix is automatically applied when FixOutlook2007CssSupport is selected, so there is normally no reason to apply it. You might get a smaller file with this fix (if you have a lots of hidden text), but the display will not be as accurate as when it is off, so it is reccomended to keep it off.

Syntax

Namespace: FlexCel.Render

public Boolean FixIE6WordWrapSupport { get; set; }

See also

  • FlexCelHtmlExport


FlexCelHtmlExport.UseContentId Property | FlexCel Studio for the .NET Framework documentation

FlexCelHtmlExport.UseContentId Property

When exporting to MHTML, some mail clients might have problems understanding the newer "Content-Location" header to show the images. When this property is true, we will use the older "Content-Id" header that is better supported than Content Location in the mime headers to reference the images. You are strongly encouraged to keep this property true in order to maximize the number of mail readers compatible. When Exporting to HTML (not MHTML), this property has no effect.

Syntax

Namespace: FlexCel.Render

public Boolean UseContentId { get; set; }

See also

  • FlexCelHtmlExport


FlexCelHtmlExport.HeadingWidth Property | FlexCel Studio for the .NET Framework documentation

FlexCelHtmlExport.HeadingWidth Property

Width in points of the left gutter when printing row numbers and column names.

Syntax

Namespace: FlexCel.Render

public Double HeadingWidth { get; set; }

See also

  • FlexCelHtmlExport


FlexCelHtmlExport.HeadingStyle Property | FlexCel Studio for the .NET Framework documentation

FlexCelHtmlExport.HeadingStyle Property

Style definition for the gutter cells when printing row numbers or column names. This text must be a valid CSS style definition, without including the braces ("{}").

Syntax

Namespace: FlexCel.Render

public String HeadingStyle { get; set; }

Examples

If you specify "color:red;font-weight:bold" in this property, text will be red and bold.

See also

  • FlexCelHtmlExport


FlexCelHtmlExport.PrintRangeLeft Property | FlexCel Studio for the .NET Framework documentation

FlexCelHtmlExport.PrintRangeLeft Property

First column to print (1 based). if this or any other PrintRange property is 0, the range will be automatically calculated.

Syntax

Namespace: FlexCel.Render

public Int32 PrintRangeLeft { get; set; }

See also

  • FlexCelHtmlExport


FlexCelHtmlExport.PrintRangeTop Property | FlexCel Studio for the .NET Framework documentation

FlexCelHtmlExport.PrintRangeTop Property

First row to print (1 based). if this or any other PrintRange property is 0, the range will be automatically calculated.

Syntax

Namespace: FlexCel.Render

public Int32 PrintRangeTop { get; set; }

See also

  • FlexCelHtmlExport


FlexCelHtmlExport.PrintRangeRight Property | FlexCel Studio for the .NET Framework documentation

FlexCelHtmlExport.PrintRangeRight Property

Last column to print (1 based). if this or any other PrintRange property is 0, the range will be automatically calculated.

Syntax

Namespace: FlexCel.Render

public Int32 PrintRangeRight { get; set; }

See also

  • FlexCelHtmlExport


FlexCelHtmlExport.PrintRangeBottom Property | FlexCel Studio for the .NET Framework documentation

FlexCelHtmlExport.PrintRangeBottom Property

Last row to print (1 based). if this or any other PrintRange property is 0, the range will be automatically calculated.

Syntax

Namespace: FlexCel.Render

public Int32 PrintRangeBottom { get; set; }

See also

  • FlexCelHtmlExport


FlexCelHtmlExport.AllowOverwritingFiles Property | FlexCel Studio for the .NET Framework documentation

FlexCelHtmlExport.AllowOverwritingFiles Property

Determines if FlexCel will automatically delete existing HTML and image files or not.

Syntax

Namespace: FlexCel.Render

public Boolean AllowOverwritingFiles { get; set; }

See also

  • FlexCelHtmlExport


FlexCelHtmlExport.IgnoreSharingViolations Property | FlexCel Studio for the .NET Framework documentation

FlexCelHtmlExport.IgnoreSharingViolations Property

When this property is true and the component tries to write any file that is locked by other thread, it will not raise an error and just assume the other thread will write the correct image. You will normally want to have this true, so you can have many threads writing to the same file without issues. Note that when AllowOverwritingFiles is false, this property has no effect.

Syntax

Namespace: FlexCel.Render

public Boolean IgnoreSharingViolations { get; set; }

See also

  • FlexCelHtmlExport


FlexCelHtmlExport.VerticalTextAsImages Property | FlexCel Studio for the .NET Framework documentation

FlexCelHtmlExport.VerticalTextAsImages Property

When true and text is vertical, FlexCel will replace the text with an image in order to show it correctly in HTML. When false, text will be rendered normally without rotation. Note that when using HTML5 this property is ignored, since HTML5 allows text rotation.

Syntax

Namespace: FlexCel.Render

public Boolean VerticalTextAsImages { get; set; }

See also

  • FlexCelHtmlExport


FlexCelHtmlExport.ExportNamedRanges Property | FlexCel Studio for the .NET Framework documentation

FlexCelHtmlExport.ExportNamedRanges Property

When true FlexCel will insert a span in the first cell of every named range with "id" = the name of the range. You can access then this with javascript. For a fine grain control of how names are exported, you can use NamedRangeExport event.

Syntax

Namespace: FlexCel.Render

public Boolean ExportNamedRanges { get; set; }

See also

  • FlexCelHtmlExport


FlexCelHtmlExport.LinksInNewWindow Property | FlexCel Studio for the .NET Framework documentation

FlexCelHtmlExport.LinksInNewWindow Property

If true, the links will be exported with a target=_blank attribute so they open in a new window.

Syntax

Namespace: FlexCel.Render

public Boolean LinksInNewWindow { get; set; }

See also

  • FlexCelHtmlExport


FlexCelHtmlExport.BackgroundColor Property | FlexCel Studio for the .NET Framework documentation

FlexCelHtmlExport.BackgroundColor Property

Background color for empty cells. This is White by default, but you migth want to make it TUIColor.Empty if you want the cells to not cover the background.

Syntax

Namespace: FlexCel.Render

public TUIColor BackgroundColor { get; set; }

See also

  • FlexCelHtmlExport


FlexCelHtmlExport.BaseUrl Property | FlexCel Studio for the .NET Framework documentation

FlexCelHtmlExport.BaseUrl Property

If this property is not null, all hyperlinks stating with this value will be converted to relative links, by removing this string from them.

Hyperlinks in Excel must be absolute by default, so this property is a way to get relative hyperlinks.

For example, if BaseUrl is "https://www.tmssoftware.com/" and an Excel file has a link "https://www.tmssoftware.com/test.html" the link in the generated HTML file will be "test.html"

Syntax

Namespace: FlexCel.Render

public String BaseUrl { get; set; }

See also

  • FlexCelHtmlExport


FlexCelHtmlExport.UsePrintScale Property | FlexCel Studio for the .NET Framework documentation

FlexCelHtmlExport.UsePrintScale Property

If false (the default) the print scale of the sheet will be ignored when exporting to html. If true, sheets will be exported honoring the zoom of the page.Note that if PrintToFit is true, then this value will be ignored and zoom will be 100%.

Syntax

Namespace: FlexCel.Render

public Boolean UsePrintScale { get; set; }

See also

  • FlexCelHtmlExport


FlexCelHtmlExport.ImageResolution Property | FlexCel Studio for the .NET Framework documentation

FlexCelHtmlExport.ImageResolution Property

Resolution for the exported images. The bigger the resolution, the bigger the image size and quality. Use 96 for standard screen resolution.

Syntax

Namespace: FlexCel.Render

public Double ImageResolution { get; set; }

See also

  • FlexCelHtmlExport


FlexCelHtmlExport.SavedImagesFormat Property | FlexCel Studio for the .NET Framework documentation

FlexCelHtmlExport.SavedImagesFormat Property

File format in which the images will be saved. Note that Ie6 does not support transparency in PNGs by default, so if you have transparent images and you want to make you page compatible with IE6, you should save as gif or use FixIE6TransparentPngSupport

Syntax

Namespace: FlexCel.Render

public THtmlImageFormat SavedImagesFormat { get; set; }

See also

  • FlexCelHtmlExport


FlexCelHtmlExport.SmoothingMode Property | FlexCel Studio for the .NET Framework documentation

FlexCelHtmlExport.SmoothingMode Property

This affects how the images, charts, etc are rendered for the image file. Some modes will look a little blurred but with better quality. Consult the .NET framework documentation on SmoothingMode for more information

Syntax

Namespace: FlexCel.Render

public TUISmoothingMode SmoothingMode { get; set; }

See also

  • FlexCelHtmlExport


FlexCelHtmlExport.InterpolationMode Property | FlexCel Studio for the .NET Framework documentation

FlexCelHtmlExport.InterpolationMode Property

This affects how the images, charts, etc are rendered for the image file. Some modes will look a little blurred but with better quality. Consult the .NET framework documentation on SmoothingMode for more information

Syntax

Namespace: FlexCel.Render

public TUIInterpolationMode InterpolationMode { get; set; }

See also

  • FlexCelHtmlExport


FlexCelHtmlExport.AntiAliased Property | FlexCel Studio for the .NET Framework documentation

FlexCelHtmlExport.AntiAliased Property

This affects how the text is rendered for example when exporting a chart. Some modes will look a little blurred but with better quality. Consult the .NET framework documentation on SmoothingMode for more information

Syntax

Namespace: FlexCel.Render

public Boolean AntiAliased { get; set; }

See also

  • FlexCelHtmlExport


FlexCelHtmlExport.ImageBackground Property | FlexCel Studio for the .NET Framework documentation

FlexCelHtmlExport.ImageBackground Property

When this property is set to TUIColor.Empty (the default), images will be rendered with a transparent background. While this is the normal behavior, sometimes you might not want transparent images (for example to support Internet Explorer 6 without setting FixIE6TransparentPngSupport to true), and then you could use Colors.White here.

Syntax

Namespace: FlexCel.Render

public TUIColor ImageBackground { get; set; }

See also

  • FlexCelHtmlExport


FlexCelHtmlExport.RasterizeSVGImages Property | FlexCel Studio for the .NET Framework documentation

FlexCelHtmlExport.RasterizeSVGImages Property

If false (the default) then FlexCel will export SVG images inside the Excel file as SVG images inside the generated HTML. If true, FlexCel will convert the SVG images to PNG and embed the PNG inside the HTML. This might be more accurate specially if the embedded SVG uses fonts that might not be present in the client machine. See S V G Files Inside Xlsx Files for more information.

Remarks

Even when this property is false, there might be cases where FlexCel rasterizes the image anyway. This can happen if the image has effects, like for example a color overlay, which we need to apply. Only images without effects will be rendered as SVG.

It is worth noting that this property only applies to images stored as SVG inside the xlsx file. If you want to render charts as SVG, change SavedImagesFormat instead.

Syntax

Namespace: FlexCel.Render

public virtual Boolean RasterizeSVGImages { get; set; }

See also

  • FlexCelHtmlExport


FlexCelHtmlExport.ImageNaming Property | FlexCel Studio for the .NET Framework documentation

FlexCelHtmlExport.ImageNaming Property

This property defines how the images will be named by FlexCel. You can always override the name using the GetImageInformation event.

Syntax

Namespace: FlexCel.Render

public TImageNaming ImageNaming { get; set; }

See also

  • FlexCelHtmlExport


FlexCelHtmlExport.EmbedImages Property | FlexCel Studio for the .NET Framework documentation

FlexCelHtmlExport.EmbedImages Property

If true, images will be embedded in the HTML file using base64 encoded data uris as defined in http://tools.ietf.org/html/rfc2397

Syntax

Namespace: FlexCel.Render

public Boolean EmbedImages { get; set; }

See also

  • FlexCelHtmlExport


FlexCelHtmlExport.ExtraInfo Property | FlexCel Studio for the .NET Framework documentation

FlexCelHtmlExport.ExtraInfo Property

Extra information to be added to the HTML file.

Syntax

Namespace: FlexCel.Render

public THtmlExtraInfo ExtraInfo { get; }

See also

  • FlexCelHtmlExport


FlexCelHtmlExport.GeneratedFiles Property | FlexCel Studio for the .NET Framework documentation

FlexCelHtmlExport.GeneratedFiles Property

Contains all the generated files by the component. Note that it might contain files not actually generated, if an error happened while trying to create them.

Syntax

Namespace: FlexCel.Render

public TGeneratedFiles GeneratedFiles { get; }

See also

  • FlexCelHtmlExport


FlexCelHtmlExport.HasSaveImageEvent Property | FlexCel Studio for the .NET Framework documentation

FlexCelHtmlExport.HasSaveImageEvent Property

Override this property when creating your own OnSaveImage descendant. This method should return true if there is any event attached to it.

Syntax

Namespace: FlexCel.Render

public virtual Boolean HasSaveImageEvent { get; }

See also

  • FlexCelHtmlExport


FlexCelHtmlExport.GetImageInformation Event | FlexCel Studio for the .NET Framework documentation

FlexCelHtmlExport.GetImageInformation Event

Use this event to customize where to save the images when exporting to HTML.

Syntax

Namespace: FlexCel.Render

public ImageInformationEventHandler GetImageInformation

See also

  • FlexCelHtmlExport


FlexCelHtmlExport.SaveImage Event | FlexCel Studio for the .NET Framework documentation

FlexCelHtmlExport.SaveImage Event

Use this event to save the images into other place. Note that this event only fires when saving HTML, not MTHML.

Syntax

Namespace: FlexCel.Render

public SaveImageEventHandler SaveImage

See also

  • FlexCelHtmlExport


FlexCelHtmlExport.HtmlFont Event | FlexCel Studio for the .NET Framework documentation

FlexCelHtmlExport.HtmlFont Event

Use this event to customize the fonts used in the exported file.

Syntax

Namespace: FlexCel.Render

public HtmlFontEventHandler HtmlFont

See also

  • FlexCelHtmlExport


FlexCelHtmlExport.NamedRangeExport Event | FlexCel Studio for the .NET Framework documentation

FlexCelHtmlExport.NamedRangeExport Event

Use this event to customize how a named range if exported to the HTML file. Note that for this event to be called, you first need to set ExportNamedRanges = true. If you want to change the id that will be exported or exclude certain named from being exported, you can do so here.

Syntax

Namespace: FlexCel.Render

public NamedRangeExportEventHandler NamedRangeExport

See also

  • FlexCelHtmlExport


FlexCelHtmlExportProgress Class | FlexCel Studio for the .NET Framework documentation

FlexCelHtmlExportProgress Class

Indicates how much of the report has been generated.

Syntax

Namespace: FlexCel.Render

public class FlexCelHtmlExportProgress

Properties

Name | Description
Row | The row that is being written.
TotalRows | The total number of rows exporting.
SheetNumber | The sheet we are exporting.


FlexCelHtmlExportProgress.Row Property | FlexCel Studio for the .NET Framework documentation

FlexCelHtmlExportProgress.Row Property

The row that is being written.

Syntax

Namespace: FlexCel.Render

public Int32 Row { get; }

See also

  • FlexCelHtmlExportProgress


FlexCelHtmlExportProgress.TotalRows Property | FlexCel Studio for the .NET Framework documentation

FlexCelHtmlExportProgress.TotalRows Property

The total number of rows exporting.

Syntax

Namespace: FlexCel.Render

public Int32 TotalRows { get; }

See also

  • FlexCelHtmlExportProgress


FlexCelHtmlExportProgress.SheetNumber Property | FlexCel Studio for the .NET Framework documentation

FlexCelHtmlExportProgress.SheetNumber Property

The sheet we are exporting.

Syntax

Namespace: FlexCel.Render

public Int32 SheetNumber { get; }

See also

  • FlexCelHtmlExportProgress


FlexCelImgExport Class | FlexCel Studio for the .NET Framework documentation

FlexCelImgExport Class

A component for exporting an Excel file to an image. It can return an image object, or the actual bytes of a specific file format. (like gif, tiff or png)

Syntax

Namespace: FlexCel.Render

public class FlexCelImgExport: Component

Constructors

Name | Description
FlexCelImgExport | Overloaded FlexCelImgExport FlexCelImgExport(ExcelFile) FlexCelImgExport(ExcelFile, Boolean)

Methods

Name Description
OnBeforePaint Replace this event when creating a custom descendant of FlexCelImgExport.
OnAfterPaint Replace this event when creating a custom descendant of FlexCelImgExport.
ExportNext Overloaded
 ExportNext(TUIGraphics, TImgExportInfo)
ExportNext(Stream, ImageColorDepth, TXlsImgType, TImgExportInfo)
ExportNext(String, ImageColorDepth, TXlsImgType, TImgExportInfo)
ExportNext(Stream, PixelFormat, ImageFormat, TImgExportInfo)
ExportNext(String, PixelFormat, ImageFormat, TImgExportInfo)
TotalPages Return the pages to print. This is a costly operation, so cache the results.
GetRealPageSize Overloaded
 GetRealPageSize
GetRealPageSize(Int32)
GetFirstPage​Export​Info Returns information needed for exporting multiple pages on one sheet. You normally don't need to use this method, but you can use it to speed up multiple displays.
SaveAsImage Overloaded
 SaveAsImage(String, ImageExportType, ImageColorDepth)
SaveAsImage(Stream, ImageExportType, ImageColorDepth)

Properties

Name | Description
Workbook | The ExcelFile to print.
HidePrintObjects | Select which kind of objects should not be printed or exported to the image.
ExportSheetBackground​Images | If false (the default) then the background images in the sheet won't be exported. Note that Excel doesn't print or export background images, and when it shows them on the screen they look the same no matter the sheet zoom. When you set this to true we will try to export the image, but it will grow and shrink when you zoom, making it look different from what Excel shows.
PrintRangeLeft | First column to print (1 based). if this or any other PrintRange property is 0, the range will be automatically calculated.
PrintRangeTop | First row to print (1 based). if this or any other PrintRange property is 0, the range will be automatically calculated.
PrintRangeRight | Last column to print (1 based). if this or any other PrintRange property is 0, the range will be automatically calculated.
PrintRangeBottom | Last row to print (1 based). if this or any other PrintRange property is 0, the range will be automatically calculated.
PageSize | Image page size. Set it to null to use the paper size on the xls file.
AllowOverwriting​Files | Determines if FlexCel will automatically delete existing image files or not.
Resolution | "The default resolution on pixels per inch for the rendered images. For the screen, this is 96."
AllVisibleSheets | If true, All visible sheets on the workbook will be printed. See ResetPageNumber​OnEach​Sheet for behavior of the page number when printing multiple sheets.
ResetPageNumber​OnEach​Sheet | This property only makes sense when AllVisibleSheets is true. On that case, if this property is true each sheet of the workbook will have the page number reset. For example if the xls file has 2 sheets and each has 3 pages: When ResetPageNumber​OnEach​Sheet = true then footers will look like "Page 1 of 3". If false, they will look like "Page 5 of 6"

Events

Name | Description
BeforePaint | Fires before drawing the image, allowing to modify it or to modify the XlsFile associated.
AfterPaint | Fires after the image has been drawn, allowing to modify it.


FlexCelImgExport.FlexCelImgExport Constructor | FlexCel Studio for the .NET Framework documentation

FlexCelImgExport.FlexCelImgExport Constructor

Overloads

  • FlexCelImgExport.FlexCelImgExport
  • FlexCelImgExport.FlexCelImgExport(ExcelFile)
  • FlexCelImgExport.FlexCelImgExport(ExcelFile, Boolean)

FlexCelImgExport.FlexCelImgExport

Creates a new FlexCelImgExport instance.

Syntax

Namespace: FlexCel.Render

public FlexCelImgExport()

See also

  • FlexCelImgExport

FlexCelImgExport.FlexCelImgExport(ExcelFile)

Creates a new FlexCelImgExport and assigns it to an ExcelFile.

Syntax

Namespace: FlexCel.Render

public FlexCelImgExport(ExcelFile aWorkbook)

Parameters

<-> | Parameter | Type | Description
 | aWorkbook | ExcelFile | ExcelFile containing the data this component will export.

See also

  • FlexCelImgExport

FlexCelImgExport.FlexCelImgExport(ExcelFile, Boolean)

Creates a new FlexCelImgExport and assigns it to an ExcelFile, setting AllowOverwritingFiles to the desired value.

Syntax

Namespace: FlexCel.Render

public FlexCelImgExport(ExcelFile aWorkbook, Boolean aAllowOverwritingFiles)

Parameters

<-> | Parameter | Type | Description
 | aWorkbook | ExcelFile | ExcelFile containing the data this component will export.
 | aAllowOverwritingFiles | Boolean | When true, existing files will be overwritten.

See also

  • FlexCelImgExport


FlexCelImgExport.OnBeforePaint Method | FlexCel Studio for the .NET Framework documentation

FlexCelImgExport.OnBeforePaint Method

Replace this event when creating a custom descendant of FlexCelImgExport.

Syntax

Namespace: FlexCel.Render

protected virtual void OnBeforePaint(ImgPaintEventArgs e)

Parameters

<-> | Parameter | Type | Description
 | e | ImgPaintEventArgs |

See also

  • FlexCelImgExport


FlexCelImgExport.OnAfterPaint Method | FlexCel Studio for the .NET Framework documentation

FlexCelImgExport.OnAfterPaint Method

Replace this event when creating a custom descendant of FlexCelImgExport.

Syntax

Namespace: FlexCel.Render

protected virtual void OnAfterPaint(ImgPaintEventArgs e)

Parameters

<-> | Parameter | Type | Description
 | e | ImgPaintEventArgs |

See also

  • FlexCelImgExport


FlexCelImgExport.ExportNext Method | FlexCel Studio for the .NET Framework documentation

FlexCelImgExport.ExportNext Method

Overloads

  • FlexCelImgExport.ExportNext(TUIGraphics, TImgExportInfo)
  • FlexCelImgExport.ExportNext(Stream, ImageColorDepth, TXlsImgType, TImgExportInfo)
  • FlexCelImgExport.ExportNext(String, ImageColorDepth, TXlsImgType, TImgExportInfo)
  • FlexCelImgExport.ExportNext(Stream, PixelFormat, ImageFormat, TImgExportInfo)
  • FlexCelImgExport.ExportNext(String, PixelFormat, ImageFormat, TImgExportInfo)

FlexCelImgExport.ExportNext(TUIGraphics, TImgExportInfo)

Exports the associated xls workbook to a graphics stream. You need to provide a Graphics object with the correct dimensions. (To get the needed dimensions, use GetRealPageSize

Syntax

Namespace: FlexCel.Render

public Boolean ExportNext(TUIGraphics imgData, ref TImgExportInfo exportInfo)

Parameters

<-> | Parameter | Type | Description
 | imgData | TUIGraphics | Graphics where the image will be stored. Set it to null to skip the page.
ref | exportInfo | TImgExportInfo | Information needed to export, cached for speed. The first time you call this method (or when you change xls.ActiveSheet), make exportInfo=null

See also

  • FlexCelImgExport

FlexCelImgExport.ExportNext(Stream, ImageColorDepth, TXlsImgType, TImgExportInfo)

Exports the associated xls workbook to a stream.

Syntax

Namespace: FlexCel.Render

public Boolean ExportNext(Stream imgStream, ImageColorDepth colorDepth, TXlsImgType imgFormat, ref TImgExportInfo exportInfo)

Parameters

<-> | Parameter | Type | Description
 | imgStream | Stream | Stream where the image will be exported.
 | colorDepth | ImageColorDepth | Number of colors for the image.
 | imgFormat | TXlsImgType | Format for the saved image
ref | exportInfo | TImgExportInfo | Information needed to export, cached for speed. The first time you call this method (or when you change xls.ActiveSheet), make exportInfo=null

See also

  • FlexCelImgExport

FlexCelImgExport.ExportNext(String, ImageColorDepth, TXlsImgType, TImgExportInfo)

Exports the associated xls workbook to a file.

Syntax

Namespace: FlexCel.Render

public Boolean ExportNext(String fileName, ImageColorDepth colorDepth, TXlsImgType imgFormat, ref TImgExportInfo exportInfo)

Parameters

<-> | Parameter | Type | Description
 | fileName | String | File to export.
 | colorDepth | ImageColorDepth | Number of colors for the image.
 | imgFormat | TXlsImgType | Format for the saved image
ref | exportInfo | TImgExportInfo | Information needed to export, cached for speed. The first time you call this method (or when you change xls.ActiveSheet), make exportInfo=null

See also

  • FlexCelImgExport

FlexCelImgExport.ExportNext(Stream, PixelFormat, ImageFormat, TImgExportInfo)

Exports the associated xls workbook to a stream.

Syntax

Namespace: FlexCel.Render

public Boolean ExportNext(Stream imgStream, PixelFormat format, ImageFormat imgFormat, ref TImgExportInfo exportInfo)

Parameters

<-> | Parameter | Type | Description
 | imgStream | Stream | Stream where the image will be exported.
 | format | PixelFormat | Pixel depth for the created image.
 | imgFormat | ImageFormat | Format for the saved image
ref | exportInfo | TImgExportInfo | Information needed to export, cached for speed. The first time you call this method (or when you change xls.ActiveSheet), make exportInfo=null

See also

  • FlexCelImgExport

FlexCelImgExport.ExportNext(String, PixelFormat, ImageFormat, TImgExportInfo)

Exports the associated xls workbook to a file.

Syntax

Namespace: FlexCel.Render

public Boolean ExportNext(String fileName, PixelFormat format, ImageFormat imgFormat, ref TImgExportInfo exportInfo)

Parameters

<-> | Parameter | Type | Description
 | fileName | String | File to export.
 | format | PixelFormat | Pixel depth for the created image.
 | imgFormat | ImageFormat | Format for the saved image
ref | exportInfo | TImgExportInfo | Information needed to export, cached for speed. The first time you call this method (or when you change xls.ActiveSheet), make exportInfo=null

See also

  • FlexCelImgExport


FlexCelImgExport.TotalPages Method | FlexCel Studio for the .NET Framework documentation

FlexCelImgExport.TotalPages Method

Return the pages to print. This is a costly operation, so cache the results.

Syntax

Namespace: FlexCel.Render

public Int32 TotalPages()

See also

  • FlexCelImgExport


FlexCelImgExport.GetRealPageSize Method | FlexCel Studio for the .NET Framework documentation

FlexCelImgExport.GetRealPageSize Method

Overloads

  • FlexCelImgExport.GetRealPageSize
  • FlexCelImgExport.GetRealPageSize(Int32)

FlexCelImgExport.GetRealPageSize

Returns the page dimensions for the active sheet. You can use it to create a bitmap to export the data.

Syntax

Namespace: FlexCel.Render

public TPaperDimensions GetRealPageSize()

See also

  • FlexCelImgExport

FlexCelImgExport.GetRealPageSize(Int32)

Returns the page dimensions for a sheet. You can use it to create a bitmap to export the data.

Syntax

Namespace: FlexCel.Render

public TPaperDimensions GetRealPageSize(Int32 ActiveSheet)

Parameters

<-> | Parameter | Type | Description
 | ActiveSheet | Int32 |

See also

  • FlexCelImgExport


FlexCelImgExport.GetFirstPageExportInfo Method | FlexCel Studio for the .NET Framework documentation

FlexCelImgExport.GetFirstPageExportInfo Method

Returns information needed for exporting multiple pages on one sheet. You normally don't need to use this method, but you can use it to speed up multiple displays.

Syntax

Namespace: FlexCel.Render

public TImgExportInfo GetFirstPageExportInfo()

See also

  • FlexCelImgExport


FlexCelImgExport.SaveAsImage Method | FlexCel Studio for the .NET Framework documentation

FlexCelImgExport.SaveAsImage Method

Overloads

  • FlexCelImgExport.SaveAsImage(String, ImageExportType, ImageColorDepth)
  • FlexCelImgExport.SaveAsImage(Stream, ImageExportType, ImageColorDepth)

FlexCelImgExport.SaveAsImage(String, ImageExportType, ImageColorDepth)

Saves the current Excel file as an image file.

Syntax

Namespace: FlexCel.Render

public void SaveAsImage(String fileName, ImageExportType exportFormat, ImageColorDepth ColorDepth)

Parameters

<-> | Parameter | Type | Description
 | fileName | String | File where the image will be saved.
 | exportFormat | ImageExportType | Image format.
 | ColorDepth | ImageColorDepth | Color depth for the image, if applicable. Some formats (like fax, that is monochrome) do not allow different color depths.

See also

  • FlexCelImgExport

FlexCelImgExport.SaveAsImage(Stream, ImageExportType, ImageColorDepth)

Saves the current Excel file on an image stream.

Syntax

Namespace: FlexCel.Render

public void SaveAsImage(Stream fileStream, ImageExportType exportFormat, ImageColorDepth ColorDepth)

Parameters

<-> | Parameter | Type | Description
 | fileStream | Stream | Stream where the image will be saved.
 | exportFormat | ImageExportType | Image format.
 | ColorDepth | ImageColorDepth | Color depth for the image, if applicable. Some formats (like fax, that is monochrome) do not allow different color depots.

See also

  • FlexCelImgExport


FlexCelImgExport.Workbook Property | FlexCel Studio for the .NET Framework documentation

FlexCelImgExport.Workbook Property

The ExcelFile to print.

Syntax

Namespace: FlexCel.Render

public ExcelFile Workbook { get; set; }

See also

  • FlexCelImgExport


FlexCelImgExport.HidePrintObjects Property | FlexCel Studio for the .NET Framework documentation

FlexCelImgExport.HidePrintObjects Property

Select which kind of objects should not be printed or exported to the image.

Syntax

Namespace: FlexCel.Render

public THidePrintObjects HidePrintObjects { get; set; }

See also

  • FlexCelImgExport


FlexCelImgExport.ExportSheetBackgroundImages Property | FlexCel Studio for the .NET Framework documentation

FlexCelImgExport.ExportSheetBackgroundImages Property

If false (the default) then the background images in the sheet won't be exported. Note that Excel doesn't print or export background images, and when it shows them on the screen they look the same no matter the sheet zoom. When you set this to true we will try to export the image, but it will grow and shrink when you zoom, making it look different from what Excel shows.

Syntax

Namespace: FlexCel.Render

public virtual Boolean ExportSheetBackgroundImages { get; set; }

See also

  • FlexCelImgExport


FlexCelImgExport.PrintRangeLeft Property | FlexCel Studio for the .NET Framework documentation

FlexCelImgExport.PrintRangeLeft Property

First column to print (1 based). if this or any other PrintRange property is 0, the range will be automatically calculated.

Syntax

Namespace: FlexCel.Render

public Int32 PrintRangeLeft { get; set; }

See also

  • FlexCelImgExport


FlexCelImgExport.PrintRangeTop Property | FlexCel Studio for the .NET Framework documentation

FlexCelImgExport.PrintRangeTop Property

First row to print (1 based). if this or any other PrintRange property is 0, the range will be automatically calculated.

Syntax

Namespace: FlexCel.Render

public Int32 PrintRangeTop { get; set; }

See also

  • FlexCelImgExport


FlexCelImgExport.PrintRangeRight Property | FlexCel Studio for the .NET Framework documentation

FlexCelImgExport.PrintRangeRight Property

Last column to print (1 based). if this or any other PrintRange property is 0, the range will be automatically calculated.

Syntax

Namespace: FlexCel.Render

public Int32 PrintRangeRight { get; set; }

See also

  • FlexCelImgExport


FlexCelImgExport.PrintRangeBottom Property | FlexCel Studio for the .NET Framework documentation

FlexCelImgExport.PrintRangeBottom Property

Last row to print (1 based). if this or any other PrintRange property is 0, the range will be automatically calculated.

Syntax

Namespace: FlexCel.Render

public Int32 PrintRangeBottom { get; set; }

See also

  • FlexCelImgExport


FlexCelImgExport.PageSize Property | FlexCel Studio for the .NET Framework documentation

FlexCelImgExport.PageSize Property

Image page size. Set it to null to use the paper size on the xls file.

Syntax

Namespace: FlexCel.Render

public TPaperDimensions PageSize { get; set; }

See also

  • FlexCelImgExport


FlexCelImgExport.AllowOverwritingFiles Property | FlexCel Studio for the .NET Framework documentation

FlexCelImgExport.AllowOverwritingFiles Property

Determines if FlexCel will automatically delete existing image files or not.

Syntax

Namespace: FlexCel.Render

public Boolean AllowOverwritingFiles { get; set; }

See also

  • FlexCelImgExport


FlexCelImgExport.Resolution Property | FlexCel Studio for the .NET Framework documentation

FlexCelImgExport.Resolution Property

"The default resolution on pixels per inch for the rendered images. For the screen, this is 96."

Syntax

Namespace: FlexCel.Render

public Double Resolution { get; set; }

See also

  • FlexCelImgExport


FlexCelImgExport.AllVisibleSheets Property | FlexCel Studio for the .NET Framework documentation

FlexCelImgExport.AllVisibleSheets Property

If true, All visible sheets on the workbook will be printed. See ResetPageNumberOnEachSheet for behavior of the page number when printing multiple sheets.

Syntax

Namespace: FlexCel.Render

public Boolean AllVisibleSheets { get; set; }

See also

  • FlexCelImgExport


FlexCelImgExport.ResetPageNumberOnEachSheet Property | FlexCel Studio for the .NET Framework documentation

FlexCelImgExport.ResetPageNumberOnEachSheet Property

This property only makes sense when AllVisibleSheets is true. On that case, if this property is true each sheet of the workbook will have the page number reset. For example if the xls file has 2 sheets and each has 3 pages: When ResetPageNumberOnEachSheet = true then footers will look like "Page 1 of 3". If false, they will look like "Page 5 of 6"

Syntax

Namespace: FlexCel.Render

public Boolean ResetPageNumberOnEachSheet { get; set; }

See also

  • FlexCelImgExport


FlexCelImgExport.BeforePaint Event | FlexCel Studio for the .NET Framework documentation

FlexCelImgExport.BeforePaint Event

Fires before drawing the image, allowing to modify it or to modify the XlsFile associated.

Syntax

Namespace: FlexCel.Render

public PaintEventHandler BeforePaint

See also

  • FlexCelImgExport


FlexCelImgExport.AfterPaint Event | FlexCel Studio for the .NET Framework documentation

FlexCelImgExport.AfterPaint Event

Fires after the image has been drawn, allowing to modify it.

Syntax

Namespace: FlexCel.Render

public PaintEventHandler AfterPaint

See also

  • FlexCelImgExport


FlexCelPdfExport Class | FlexCel Studio for the .NET Framework documentation

FlexCelPdfExport Class

A component for exporting an Excel file to PDF.

Syntax

Namespace: FlexCel.Render

public class FlexCelPdfExport: Component

Fields

Name | Description
FPdfStream | Stream where the file will be saved. You can use this in a derived class to write your own data to the stream.
FCompress | If true, the file will be compressed. This property is just for derived classes, for normal cases use Compress
FProperties | Only for use in derived classes. Use Properties instead.
PdfCanvas | Writer where the pdf commands will be sent. Only for use in derived classes.
FPrintRange | Only for use in derived classes. Use "PrintRangeLeft/​Top/​Right/​Bottom" instead.
FPageSize | Only for use in derived classes. Use PageSize instead.
FFontEmbed | Only for use in derived classes. Use FontEmbed instead.
FFontSubset | Only for use in derived classes. Use FontSubset instead.
FFontMapping | Only for use in derived classes. Use FontMapping instead.
FFallbackFonts | Only for use in derived classes. Use FallbackFonts instead.
FFallbackFontsBold | Only for use in derived classes. Use FallbackFontsBold instead.
FFallbackFontsItalic | Only for use in derived classes. Use FallbackFontsItalic instead.
FFallbackFonts​Bold​Italic | Only for use in derived classes. Use FallbackFonts​Bold​Italic instead.
OnFontFolderNotFound | This property determines how FlexCel behaves when one of the folders you specify in GetFontFolder doesn't exist. Note that this property applies only to this object. To change the property for the full application, use PdfWriter.​OnFont​Folder​NotFound​Global

Constructors

Name | Description
FlexCelPdfExport | Overloaded FlexCelPdfExport FlexCelPdfExport(ExcelFile) FlexCelPdfExport(ExcelFile, Boolean)

Methods

Name | Description
OnBeforeNewPage | Replace this event when creating a custom descendant of FlexCelPdfExport. See also BeforeNewPage
OnBeforeGeneratePage | Replace this event when creating a custom descendant of FlexCelPdfExport. See also BeforeGeneratePage
OnAfterGeneratePage | Replace this event when creating a custom descendant of FlexCelPdfExport. See also AfterGeneratePage
OnGetBookmark​Information Replace this event when creating a custom descendant of FlexCelPdfExport.
Cancel Cancels a running export. This method is equivalent to setting Canceled = true.
Export Overloaded
 Export(Stream)
Export(String)
BeginExport Initializes the PDF exporting to a new file. After calling this method you can call ExportSheet to export different xls files to the same pdf, or ExportAllVisible​Sheets(​​Boolean, String).
You should always end the document with a call to EndExport
EndExport | Writes the trailer information on a PDF file. Always call this method after calling BeginExport
Dispose Disposes the class and disposes all unmanaged objects owned by it.
CalcPrintArea Calculates the actual spreadsheet range that will be printed. This is given by: 1)If you specified non zero values on PrintRange, this will be used.
2)If any value in PrintRange is zero and there is a Print Area defined on the spreadsheet, the Print Area will be used.
3)If there is no PrintRange and no Print Area defined, the visible cells on the sheet will be printed.
TotalPagesInSheet Returns the number of pages that the active sheet will use when exported to pdf.
ExportSheet Overloaded
 ExportSheet
ExportSheet(Int32, Int32)
ExportSheet(Int32, Int32, Int32, Int32)
ExportAllVisible​Sheets Overloaded
 ExportAllVisibleSheets(Boolean, String)
ExportAllVisibleSheets(String, Boolean, String)
Sign Signs the pdf documents with the specified TPdfSignature or TPdfVisibleSignature.
Note: This method must be called before calling BeginExport
AttachFile Overloaded
 AttachFile(String, String, String, TPdfAttachmentKind)
AttachFile(String, String, String, DateTime, TPdfAttachmentKind, TPdfAttachmentDataProviderDelegate)
ClearAttachments Removes all existing attachments in the writer.

Properties

Name | Description
Canceled | If true the export has been canceled with Cancel method. You can't set this variable to false, and setting it true is the same as calling Cancel.
Progress | Progress of the export. This variable can be accessed from other thread, or from the AfterGeneratePage event.
Workbook | The ExcelFile to print.
TagMode | If TagMode is full (the default), the generated file will be tagged. Tagged pdfs provide better accesibility support, but the files can be significantly bigger and take a little longer to create. If you prefer smaller files even if not accessible, turn this option off. Note that when creating PDF/A files with PdfType this property defines if the file is PDF/A-na or PDF/A-nb. This is because PDF/A-1a and PDF/A-2a require tagged files, so if this option is true the geneated files will be "a". If this option is false, then the generated files will be "b" which is a less strict standard and doesn't require tagging. To reduce file size, you might want to set...[more]
PdfType | Defines the type of pdf being created. Note that if you set this property to other value than standard, other properties might be ignored. For example, when creating a PDF/A file all fonts must be embedded so the value of the FontEmbed property will be ignored. See the TagMode property to determine if the file will be PDF/A-na or PDF/A-nb. If tagging is true (the default) the generated files will be "a". If not, they will be "b", since b doesn't require tagging.
PdfVersion | Defines the version of pdf being created. For maximum compatibility you can choose PDF 1.4. (Acrobat 5.0, but can be opened by any version of Acrobat, even if version less than 1.4 won't have all the features). Choosing PDF 1.6 (Acrobat 7) allows for more compression and smaller files, but you'll need Acrobat 7 or newer to see the files. Older versions won't be able to open it at all. Note that this value might be ignored if you are creating PDFA-1 (as it requires PDF1-4). Also for signing, FlexCel requires PDF1-7.
UnlicensedFontAction | Defines what to do when a font has a license that doesn't allow embedding, and you are trying to embed the font.
UnlicensedReplacement​Font | When trying to embed a font that isn't licensed for embedding, and UnlicensedFontAction is TUnlicensedFont​Action.​Replace this property specifies the font that will be used to replace it. If null or empty, Arial will be used.
HidePrintObjects | Select which kind of objects should not be printed or exported to pdf.
ExportSheetBackground​Images | If false (the default) then the background images in the sheet won't be exported. Note that Excel doesn't print or export background images, and when it shows them on the screen they look the same no matter the sheet zoom. When you set this to true we will try to export the image, but it will grow and shrink when you zoom, making it look different from what Excel shows.
Compress | When true, the pdf file will be compressed.
Kerning | By default, pdf does not do any kerning with the fonts. This is, on the string "AVANT", it won't compensate the spaces between "A" and "V". (they should be smaller) If you turn this property on, FlexCel will calculate the kerning and add it to the generated file. The result file will be a little bigger because of the kerning info on all strings, but it will also look a little better.
UseFauxStyles | When a font doesn't have a bold, italic or bold-italic variant, FlexCel can't export bold, italic or bold-italic characters to the pdf respectively. When this property is true (the default), FlexCel will try to "fake" those missing styles by using a wider pen width for the characters to simulate bold, or doing a slant transform to simulate italics. The results of a simulated bold or italic can be not great, so if you prefer that FlexCel doesn't try to simulate bold or italics, then you can set this property to false. If this property is false and the font you are using doesn't have bold or italics variants, then the pdf won't show bold or italics for that font. ...[more]
Properties | Pdf file properties. Note that if UseExcelProperties is true and the values are null or empty, the properties from the exported workbook will be used.
UseExcelProperties | When this property is true, the properties of the Excel file will be used when the property is null or empty.
PrintRangeLeft | First column to print (1 based). if this or any other PrintRange property is 0, the range will be automatically calculated.
PrintRangeTop | First row to print (1 based). if this or any other PrintRange property is 0, the range will be automatically calculated.
PrintRangeRight | Last column to print (1 based). if this or any other PrintRange property is 0, the range will be automatically calculated.
PrintRangeBottom | Last row to print (1 based). if this or any other PrintRange property is 0, the range will be automatically calculated.
PageSize | Pdf page size. Set it to null to use the paper size on the xls file.
AllowOverwriting​Files | Determines if FlexCel will automatically delete existing pdf files or not.
FontEmbed | Determines what fonts will be embedded on the generated pdf. Note that when using UNICODE, fonts will be embedded anyway, no matter what this setting is.
FontSubset | Determines if the full font will be embedded or only the characters used, when embedding fonts.
FontMapping | Determines how fonts will be replaced on the generated pdf. Pdf comes with 4 standard font families, Serif, Sans-Serif, Monospace and Symbol. You can use for example the standard Helvetica instead of Arial and do not worry about embedding the font.
FallbackFonts | A semicolon (;) separated list of font names to try when a character is not found in the used font. When a character is not found in a font, it will display as an empty square by default. By setting this property, FlexCel will try to find a font that supports this character in this list, and if found, use that font to render the character.
FallbackFontsBold | A semicolon (;) separated list of font names to try when a character is not found in the used font and the font is bold. This property is only used for bold fonts, and has higher priority than FallbackFonts for bold fonts. It allows you to specify different fallback fonts for bold and not bold characters. Important: This property is only needed if the fonts in FallbackFonts don't have bold variants. If your fallback fonts come with bold variants, there is not need to set this property.
FallbackFontsItalic | A semicolon (;) separated list of font names to try when a character is not found in the used font and the font is italic. This property is only used for italic fonts, and has higher priority than FallbackFonts for italic fonts. It allows you to specify different fallback fonts for italic and not italic characters. Important: This property is only needed if the fonts in FallbackFonts don't have italic variants. If your fallback fonts come with italic variants, there is not need to set this property.
FallbackFonts​Bold​Italic | A semicolon (;) separated list of font names to try when a character is not found in the used font and the font is bold and italic. This property is only used for fonts which are both bold and italic, and has higher priority than FallbackFonts, FallbackFontsBold and FallbackFontsItalic for bold-italic fonts. It allows you to specify different fallback fonts for bold-italic and not bold-italic characters. Important: ...[more]
PageLayout | Sets the default page layout when opening the document.
PageLayoutDisplay | Sets the default page display layout when opening the document.
InitialZoomAndPage | Sets the default zoom and initial page when opening the document.
CurrentPage | Returns the next page that we are going to print.
CurrentPageInSheet | Returns the next page we are going to print, on the current sheet. When not printing more than one sheet, it is equivalent to CurrentPage

Events

Name | Description
BeforeNewPage | Fires before each new page is generated on the pdf. You can use this event to change the pagesize for the new sheet.
BeforeGeneratePage | Fires after each new page is generated on the pdf, but before any content is written to the page. (The page is blank) You can use this event to add a watermark or a background image.
AfterGeneratePage | Fires after each new page is generated on the pdf, and after all content is written to the page. (The page is written) You can use this event to add some text or images on top of the page contents.
GetFontData | Use this event if you want to provide your own font information for embedding. Note that if you don't assign this event, the default method will be used, and this will try to find the font on the Fonts folder. To change the font folder, use GetFontFolder event Note that this property applies only to this object. To change the property for the full application, use PdfWriter.​Get​Font​Data​Global ...[more]
GetFontFolder | Use this event if you want to provide your own font information for embedding. Normally FlexCel will search for fonts on [System]\Fonts folder and %localappdata%​\Microsoft\Windows\Fonts. If your fonts are in other location, you can tell FlexCel where they are here. If you prefer just to give FlexCel the full data on the font, you can use GetFontData event instead. Note that this property applies only to this object. To change the property for the full application, use...[more]
OnFontEmbed | Use this event if you want to manually specify which fonts to embed into the pdf document. Note that this property applies only to this object. To change the property for the full application, use PdfWriter.​OnFont​Embed​Global
GetBookmarkInformation | Use this event to customize what goes inside the bookmarks when exporting multiple sheets of an xls file.


FlexCelPdfExport.FPdfStream Field | FlexCel Studio for the .NET Framework documentation

FlexCelPdfExport.FPdfStream Field

Stream where the file will be saved. You can use this in a derived class to write your own data to the stream.

Syntax

Namespace: FlexCel.Render

protected Stream FPdfStream

See also

  • FlexCelPdfExport


FlexCelPdfExport.FCompress Field | FlexCel Studio for the .NET Framework documentation

FlexCelPdfExport.FCompress Field

If true, the file will be compressed. This property is just for derived classes, for normal cases use Compress

Syntax

Namespace: FlexCel.Render

protected Boolean FCompress

See also

  • FlexCelPdfExport


FlexCelPdfExport.FProperties Field | FlexCel Studio for the .NET Framework documentation

FlexCelPdfExport.FProperties Field

Only for use in derived classes. Use Properties instead.

Syntax

Namespace: FlexCel.Render

protected TPdfProperties FProperties

See also

  • FlexCelPdfExport


FlexCelPdfExport.PdfCanvas Field | FlexCel Studio for the .NET Framework documentation

FlexCelPdfExport.PdfCanvas Field

Writer where the pdf commands will be sent. Only for use in derived classes.

Syntax

Namespace: FlexCel.Render

protected PdfWriter PdfCanvas

See also

  • FlexCelPdfExport


FlexCelPdfExport.FPrintRange Field | FlexCel Studio for the .NET Framework documentation

FlexCelPdfExport.FPrintRange Field

Only for use in derived classes. Use "PrintRangeLeft/Top/Right/Bottom" instead.

Syntax

Namespace: FlexCel.Render

protected TXlsCellRange FPrintRange

See also

  • FlexCelPdfExport


FlexCelPdfExport.FPageSize Field | FlexCel Studio for the .NET Framework documentation

FlexCelPdfExport.FPageSize Field

Only for use in derived classes. Use PageSize instead.

Syntax

Namespace: FlexCel.Render

protected TPaperDimensions FPageSize

See also

  • FlexCelPdfExport


FlexCelPdfExport.FFontEmbed Field | FlexCel Studio for the .NET Framework documentation

FlexCelPdfExport.FFontEmbed Field

Only for use in derived classes. Use FontEmbed instead.

Syntax

Namespace: FlexCel.Render

protected TFontEmbed FFontEmbed

See also

  • FlexCelPdfExport


FlexCelPdfExport.FFontSubset Field | FlexCel Studio for the .NET Framework documentation

FlexCelPdfExport.FFontSubset Field

Only for use in derived classes. Use FontSubset instead.

Syntax

Namespace: FlexCel.Render

protected TFontSubset FFontSubset

See also

  • FlexCelPdfExport


FlexCelPdfExport.FFontMapping Field | FlexCel Studio for the .NET Framework documentation

FlexCelPdfExport.FFontMapping Field

Only for use in derived classes. Use FontMapping instead.

Syntax

Namespace: FlexCel.Render

protected TFontMapping FFontMapping

See also

  • FlexCelPdfExport


FlexCelPdfExport.FFallbackFonts Field | FlexCel Studio for the .NET Framework documentation

FlexCelPdfExport.FFallbackFonts Field

Only for use in derived classes. Use FallbackFonts instead.

Syntax

Namespace: FlexCel.Render

protected String FFallbackFonts

See also

  • FlexCelPdfExport


FlexCelPdfExport.FFallbackFontsBold Field | FlexCel Studio for the .NET Framework documentation

FlexCelPdfExport.FFallbackFontsBold Field

Only for use in derived classes. Use FallbackFontsBold instead.

Syntax

Namespace: FlexCel.Render

protected String FFallbackFontsBold

See also

  • FlexCelPdfExport


FlexCelPdfExport.FFallbackFontsItalic Field | FlexCel Studio for the .NET Framework documentation

FlexCelPdfExport.FFallbackFontsItalic Field

Only for use in derived classes. Use FallbackFontsItalic instead.

Syntax

Namespace: FlexCel.Render

protected String FFallbackFontsItalic

See also

  • FlexCelPdfExport


FlexCelPdfExport.FFallbackFontsBoldItalic Field | FlexCel Studio for the .NET Framework documentation

FlexCelPdfExport.FFallbackFontsBoldItalic Field

Only for use in derived classes. Use FallbackFontsBoldItalic instead.

Syntax

Namespace: FlexCel.Render

protected String FFallbackFontsBoldItalic

See also

  • FlexCelPdfExport


FlexCelPdfExport.OnFontFolderNotFound Field | FlexCel Studio for the .NET Framework documentation

FlexCelPdfExport.OnFontFolderNotFound Field

This property determines how FlexCel behaves when one of the folders you specify in GetFontFolder doesn't exist. Note that this property applies only to this object. To change the property for the full application, use PdfWriter.OnFontFolderNotFoundGlobal

Syntax

Namespace: FlexCel.Render

public TPdfFontFolderNotFoundAction OnFontFolderNotFound

See also

  • FlexCelPdfExport


FlexCelPdfExport.FlexCelPdfExport Constructor | FlexCel Studio for the .NET Framework documentation

FlexCelPdfExport.FlexCelPdfExport Constructor

Overloads

  • FlexCelPdfExport.FlexCelPdfExport
  • FlexCelPdfExport.FlexCelPdfExport(ExcelFile)
  • FlexCelPdfExport.FlexCelPdfExport(ExcelFile, Boolean)

FlexCelPdfExport.FlexCelPdfExport

Creates a new FlexCelPdfExport instance.

Syntax

Namespace: FlexCel.Render

public FlexCelPdfExport()

See also

  • FlexCelPdfExport

FlexCelPdfExport.FlexCelPdfExport(ExcelFile)

Creates a new FlexCelPdfExport and assigns it to an ExcelFile.

Syntax

Namespace: FlexCel.Render

public FlexCelPdfExport(ExcelFile aWorkbook)

Parameters

<-> | Parameter | Type | Description
 | aWorkbook | ExcelFile | ExcelFile containing the data this component will export.

See also

  • FlexCelPdfExport

FlexCelPdfExport.FlexCelPdfExport(ExcelFile, Boolean)

Creates a new FlexCelPdfExport and assigns it to an ExcelFile, setting AllowOverwritingFiles to the desired value.

Syntax

Namespace: FlexCel.Render

public FlexCelPdfExport(ExcelFile aWorkbook, Boolean aAllowOverwritingFiles)

Parameters

<-> | Parameter | Type | Description
 | aWorkbook | ExcelFile | ExcelFile containing the data this component will export.
 | aAllowOverwritingFiles | Boolean | When true, existing files will be overwritten.

See also

  • FlexCelPdfExport


FlexCelPdfExport.OnBeforeNewPage Method | FlexCel Studio for the .NET Framework documentation

FlexCelPdfExport.OnBeforeNewPage Method

Replace this event when creating a custom descendant of FlexCelPdfExport. See also BeforeNewPage

Syntax

Namespace: FlexCel.Render

protected virtual void OnBeforeNewPage(PageEventArgs e)

Parameters

<-> | Parameter | Type | Description
 | e | PageEventArgs |

See also

  • FlexCelPdfExport


FlexCelPdfExport.OnBeforeGeneratePage Method | FlexCel Studio for the .NET Framework documentation

FlexCelPdfExport.OnBeforeGeneratePage Method

Replace this event when creating a custom descendant of FlexCelPdfExport. See also BeforeGeneratePage

Syntax

Namespace: FlexCel.Render

protected virtual void OnBeforeGeneratePage(PageEventArgs e)

Parameters

<-> | Parameter | Type | Description
 | e | PageEventArgs |

See also

  • FlexCelPdfExport


FlexCelPdfExport.OnAfterGeneratePage Method | FlexCel Studio for the .NET Framework documentation

FlexCelPdfExport.OnAfterGeneratePage Method

Replace this event when creating a custom descendant of FlexCelPdfExport. See also AfterGeneratePage

Syntax

Namespace: FlexCel.Render

protected virtual void OnAfterGeneratePage(PageEventArgs e)

Parameters

<-> | Parameter | Type | Description
 | e | PageEventArgs |

See also

  • FlexCelPdfExport


FlexCelPdfExport.OnGetBookmarkInformation Method | FlexCel Studio for the .NET Framework documentation

FlexCelPdfExport.OnGetBookmarkInformation Method

Replace this event when creating a custom descendant of FlexCelPdfExport.

Syntax

Namespace: FlexCel.Render

protected virtual void OnGetBookmarkInformation(GetBookmarkInformationArgs e)

Parameters

<-> | Parameter | Type | Description
 | e | GetBookmarkInformation​Args |

See also

  • FlexCelPdfExport


FlexCelPdfExport.Cancel Method | FlexCel Studio for the .NET Framework documentation

FlexCelPdfExport.Cancel Method

Cancels a running export. This method is equivalent to setting Canceled = true.

Syntax

Namespace: FlexCel.Render

public void Cancel()

See also

  • FlexCelPdfExport


FlexCelPdfExport.Export Method | FlexCel Studio for the .NET Framework documentation

FlexCelPdfExport.Export Method

Overloads

  • FlexCelPdfExport.Export(Stream)
  • FlexCelPdfExport.Export(String)

FlexCelPdfExport.Export(Stream)

Exports the active sheet of the associated xls workbook to a stream.

Remarks

This method is a shortcut for calling BeginExport/ ExportSheet/EndExport.

Syntax

Namespace: FlexCel.Render

public void Export(Stream pdfStream)

Parameters

<-> | Parameter | Type | Description
 | pdfStream | Stream | Stream where the result will be written.

See also

  • FlexCelPdfExport

FlexCelPdfExport.Export(String)

Exports the active sheet of the associated xls workbook to a file.

Remarks

This method is a shortcut for calling BeginExport/ ExportSheet/EndExport.

Syntax

Namespace: FlexCel.Render

public void Export(String fileName)

Parameters

<-> | Parameter | Type | Description
 | fileName | String | File to export.

See also

  • FlexCelPdfExport


FlexCelPdfExport.BeginExport Method | FlexCel Studio for the .NET Framework documentation

FlexCelPdfExport.BeginExport Method

Initializes the PDF exporting to a new file. After calling this method you can call ExportSheet to export different xls files to the same pdf, or ExportAllVisibleSheets(Boolean, String). You should always end the document with a call to EndExport

Syntax

Namespace: FlexCel.Render

public void BeginExport(Stream pdfStream)

Parameters

<-> | Parameter | Type | Description
 | pdfStream | Stream | Stream that will contain the new pdf file.

See also

  • FlexCelPdfExport


FlexCelPdfExport.EndExport Method | FlexCel Studio for the .NET Framework documentation

FlexCelPdfExport.EndExport Method

Writes the trailer information on a PDF file. Always call this method after calling BeginExport

Syntax

Namespace: FlexCel.Render

public void EndExport()

See also

  • FlexCelPdfExport


FlexCelPdfExport.Dispose Method | FlexCel Studio for the .NET Framework documentation

FlexCelPdfExport.Dispose Method

Disposes the class and disposes all unmanaged objects owned by it.

Syntax

Namespace: FlexCel.Render

protected override void Dispose(Boolean disposing)

Parameters

<-> | Parameter | Type | Description
 | disposing | Boolean |

See also

  • FlexCelPdfExport


FlexCelPdfExport.CalcPrintArea Method | FlexCel Studio for the .NET Framework documentation

FlexCelPdfExport.CalcPrintArea Method

Calculates the actual spreadsheet range that will be printed. This is given by: 1)If you specified non zero values on PrintRange, this will be used. 2)If any value in PrintRange is zero and there is a Print Area defined on the spreadsheet, the Print Area will be used. 3)If there is no PrintRange and no Print Area defined, the visible cells on the sheet will be printed.

Syntax

Namespace: FlexCel.Render

public TXlsCellRange CalcPrintArea()

See also

  • FlexCelPdfExport


FlexCelPdfExport.TotalPagesInSheet Method | FlexCel Studio for the .NET Framework documentation

FlexCelPdfExport.TotalPagesInSheet Method

Returns the number of pages that the active sheet will use when exported to pdf.

Syntax

Namespace: FlexCel.Render

public Int32 TotalPagesInSheet()

See also

  • FlexCelPdfExport


FlexCelPdfExport.ExportSheet Method | FlexCel Studio for the .NET Framework documentation

FlexCelPdfExport.ExportSheet Method

Overloads

  • FlexCelPdfExport.ExportSheet
  • FlexCelPdfExport.ExportSheet(Int32, Int32)
  • FlexCelPdfExport.ExportSheet(Int32, Int32, Int32, Int32)

FlexCelPdfExport.ExportSheet

Exports the activesheet on the current XlsFile.

Syntax

Namespace: FlexCel.Render

public void ExportSheet()

See also

  • FlexCelPdfExport

FlexCelPdfExport.ExportSheet(Int32, Int32)

Exports the active sheet on the current XlsFile. You can define which is the first page to print and the global count of pages, so the page numbers on headers and footers of the excel file correspond with the actual pages on the pdf.

Syntax

Namespace: FlexCel.Render

public void ExportSheet(Int32 startPageToDisplay, Int32 totalPagesToDisplay)

Parameters

<-> | Parameter | Type | Description
 | startPageToDisplay | Int32 | First page that the headers and footers on the xls file will show. If you are exporting only one sheet to the pdf file, this can be 1. If you are exporting more than one sheet to the same pdf file, you will want to set StartPage to the actual page on the pdf.
 | totalPagesToDisplay | Int32 | The total number of pages to display on Excel headers and footers. If you are exporting only one sheet to the pdf file, set it to -1, and it will be calculated automatically. If not, please supply here the total number of pages the file will have so FlexCel can show footers like "page 1 of 50"

See also

  • FlexCelPdfExport

FlexCelPdfExport.ExportSheet(Int32, Int32, Int32, Int32)

Exports the active sheet on the current XlsFile. You can define which is the first page to print and the global count of pages, so the page numbers on headers and footers of the excel file correspond with the actual pages on the pdf.

Syntax

Namespace: FlexCel.Render

public void ExportSheet(Int32 startPageToDisplay, Int32 totalPagesToDisplay, Int32 startPageToExport, Int32 totalPagesToExport)

Parameters

<-> | Parameter | Type | Description
 | startPageToDisplay | Int32 | First page that the headers and footers on the xls file will show. If you are exporting only one sheet to the pdf file, this can be 1. If you are exporting more than one sheet to the same pdf file, you will want to set StartPage to the actual page on the pdf.
 | totalPagesToDisplay | Int32 | The total number of pages to display on Excel headers and footers. If you are exporting only one sheet to the pdf file, set it to -1, and it will be calculated automatically. If not, please supply here the total number of pages the file will have so FlexCel can show footers like "page 1 of 50"
 | startPageToExport | Int32 | First page on the file to export (first page is 1).
 | totalPagesToExport | Int32 | How many pages will be exported. If you specify a negative number here (the default), all pages from startPageToExport will be exported.

See also

  • FlexCelPdfExport


FlexCelPdfExport.ExportAllVisibleSheets Method | FlexCel Studio for the .NET Framework documentation

FlexCelPdfExport.ExportAllVisibleSheets Method

Overloads

  • FlexCelPdfExport.ExportAllVisibleSheets(Boolean, String)
  • FlexCelPdfExport.ExportAllVisibleSheets(String, Boolean, String)

FlexCelPdfExport.ExportAllVisibleSheets(Boolean, String)

This method will export all the visible sheets on an xls file to pdf. Different than calling ExportSheet for each sheet, this method can keep the page number growing on each sheet, without resetting it.

Syntax

Namespace: FlexCel.Render

public virtual void ExportAllVisibleSheets(Boolean resetPageNumberOnEachSheet, String bookmarkName)

Parameters

<-> | Parameter | Type | Description
 | resetPageNumberOnEachSheet | Boolean | If true, each new sheet will reset the page number shown on Excel headers and footers.
 | bookmarkName | String | If not null, each sheet will be added as an entry on the Bookmarks in the pdf file, under the name specified here. If you want the Bookmark window to be visible when you open the pdf file, set PdfWriter.PageLayout = TPageLayout Also, use the GetBookmarkInformation event to further customize what goes in each of the entries.

See also

  • FlexCelPdfExport

FlexCelPdfExport.ExportAllVisibleSheets(String, Boolean, String)

This method will export all the visible sheets on an xls file to pdf. This method is a shortcut for creating a filestream, calling BeginExport on the filestream, calling ExportAllVisibleSheets(Boolean, String) and then calling EndExport.

Syntax

Namespace: FlexCel.Render

public virtual void ExportAllVisibleSheets(String fileName, Boolean resetPageNumberOnEachSheet, String bookmarkName)

Parameters

<-> | Parameter | Type | Description
 | fileName | String | File where the file will be saved.
 | resetPageNumberOnEachSheet | Boolean | If true, each new sheet will reset the page number shown on Excel headers and footers.
 | bookmarkName | String | If not null, each sheet will be added as an entry on the Bookmarks in the pdf file, under the name specified here. If you want the Bookmark window to be visible when you open the pdf file, set PdfWriter.PageLayout = TPageLayout Also, use the GetBookmarkInformation event to further customize what goes in each of the entries.

See also

  • FlexCelPdfExport


FlexCelPdfExport.Sign Method | FlexCel Studio for the .NET Framework documentation

FlexCelPdfExport.Sign Method

Signs the pdf documents with the specified TPdfSignature or TPdfVisibleSignature. Note: This method must be called before calling BeginExport

Syntax

Namespace: FlexCel.Render

public void Sign(TPdfSignature aSignature)

Parameters

<-> | Parameter | Type | Description
 | aSignature | TPdfSignature | Signature used for signing. Set it to null to stop signing the next documents.

See also

  • FlexCelPdfExport


FlexCelPdfExport.AttachFile Method | FlexCel Studio for the .NET Framework documentation

FlexCelPdfExport.AttachFile Method

Overloads

  • FlexCelPdfExport.AttachFile(String, String, String, TPdfAttachmentKind)
  • FlexCelPdfExport.AttachFile(String, String, String, DateTime, TPdfAttachmentKind, TPdfAttachmentDataProviderDelegate)

FlexCelPdfExport.AttachFile(String, String, String, TPdfAttachmentKind)

Attachs a file to the pdf file. You can attach files at any time while creating the pdf, but the file will be read only when you call EndExport. The files that are in the list at the moment of calling EndExport are the ones that will be saved, and they contents of the files will be read then.

You can remove all the attachments in the file by calling ClearAttachments.

Syntax

Namespace: FlexCel.Render

public void AttachFile(String fileName, String mimeType, String description, TPdfAttachmentKind attachmentKind)

Parameters

<-> | Parameter | Type | Description
 | fileName | String | Name on disk of the file to attach. This will also be the name of the file in the pdf. If you want to specify a different name in the pdf than the name on disk, use AttachFile(String, String, String, DateTime, TPdfAttachmentKind, TPdfAttachmentDataProviderDelegate)
 | mimeType | String | Mime type of the file being attached. You can use StandardMimeType for predefined types. Note that while this might be null or Empty for standard pdf files, for PDF/A3 mime type is required. If you don't know the mime type, you must specify StandardMimeType.OctectStream.
 | description | String | Description of the file that the pdf reader will show in the attachment pane. While not required by PDF/A-3, it is recommended to provide a description for the file.
 | attachmentKind | TPdfAttachmentKind | How the attachment relates to the pdf file. This is required by PDF/A-3.

See also

  • FlexCelPdfExport

FlexCelPdfExport.AttachFile(String, String, String, DateTime, TPdfAttachmentKind, TPdfAttachmentDataProviderDelegate)

Attachs a file to the pdf file. You can attach files at any time while creating the pdf, but the file will be read only when you call EndExport. The files that are in the list at the moment of calling EndExport are the ones that will be saved, and they contents of the files will be read then.

You can remove all the attachments in the file by calling ClearAttachments.

Syntax

Namespace: FlexCel.Render

public void AttachFile(String fileName, String mimeType, String description, DateTime modificationTimeLocalTimeZone, TPdfAttachmentKind attachmentKind, TPdfAttachmentDataProviderDelegate dataProvider)

Parameters

<-> | Parameter | Type | Description
 | fileName | String | Name that will be used for the file in the pdf.
 | mimeType | String | Mime type of the file being attached. You can use StandardMimeType for predefined types. Note that while this might be null or Empty for standard pdf files, for PDF/A3 mime type is required. If you don't know the mime type, you must specify StandardMimeType.OctectStream.
 | description | String | Description of the file that the pdf reader will show in the attachment pane. While not required by PDF/A-3, it is recommended to provide a description for the file.
 | modificationTimeLocalTimeZone | DateTime | Modification date of the attachment file in the local time zone. Use DateTime.MinValue to not write a modification date for the file.
 | attachmentKind | TPdfAttachmentKind | How the attachment relates to the pdf file. This is required by PDF/A-3.
 | dataProvider | TPdfAttachment​Data​Provider​Delegate | This can be a delegate or lambda expression that will load the data for the file when actually embedding it. This action will be called at the moment of embedding and must provide the data for the file.

See also

  • FlexCelPdfExport


FlexCelPdfExport.ClearAttachments Method | FlexCel Studio for the .NET Framework documentation

FlexCelPdfExport.ClearAttachments Method

Removes all existing attachments in the writer.

Syntax

Namespace: FlexCel.Render

public void ClearAttachments()

See also

  • FlexCelPdfExport


FlexCelPdfExport.Canceled Property | FlexCel Studio for the .NET Framework documentation

FlexCelPdfExport.Canceled Property

If true the export has been canceled with Cancel method. You can't set this variable to false, and setting it true is the same as calling Cancel.

Syntax

Namespace: FlexCel.Render

public Boolean Canceled { get; set; }

See also

  • FlexCelPdfExport


FlexCelPdfExport.Progress Property | FlexCel Studio for the .NET Framework documentation

FlexCelPdfExport.Progress Property

Progress of the export. This variable can be accessed from other thread, or from the AfterGeneratePage event.

Syntax

Namespace: FlexCel.Render

public FlexCelPdfExportProgress Progress { get; }

See also

  • FlexCelPdfExport


FlexCelPdfExport.Workbook Property | FlexCel Studio for the .NET Framework documentation

FlexCelPdfExport.Workbook Property

The ExcelFile to print.

Syntax

Namespace: FlexCel.Render

public virtual ExcelFile Workbook { get; set; }

See also

  • FlexCelPdfExport


FlexCelPdfExport.TagMode Property | FlexCel Studio for the .NET Framework documentation

FlexCelPdfExport.TagMode Property

If TagMode is full (the default), the generated file will be tagged. Tagged pdfs provide better accesibility support, but the files can be significantly bigger and take a little longer to create. If you prefer smaller files even if not accessible, turn this option off. Note that when creating PDF/A files with PdfType this property defines if the file is PDF/A-na or PDF/A-nb. This is because PDF/A-1a and PDF/A-2a require tagged files, so if this option is true the geneated files will be "a". If this option is false, then the generated files will be "b" which is a less strict standard and doesn't require tagging. To reduce file size, you might want to set PdfVersion to a value bigger than 1_4, since this will allow FlexCel to use better compression not available in PDF 1.4.

Syntax

Namespace: FlexCel.Render

public TTagMode TagMode { get; set; }

See also

  • FlexCelPdfExport


FlexCelPdfExport.PdfType Property | FlexCel Studio for the .NET Framework documentation

FlexCelPdfExport.PdfType Property

Defines the type of pdf being created. Note that if you set this property to other value than standard, other properties might be ignored. For example, when creating a PDF/A file all fonts must be embedded so the value of the FontEmbed property will be ignored. See the TagMode property to determine if the file will be PDF/A-na or PDF/A-nb. If tagging is true (the default) the generated files will be "a". If not, they will be "b", since b doesn't require tagging.

Syntax

Namespace: FlexCel.Render

public TPdfType PdfType { get; set; }

See also

  • FlexCelPdfExport


FlexCelPdfExport.PdfVersion Property | FlexCel Studio for the .NET Framework documentation

FlexCelPdfExport.PdfVersion Property

Defines the version of pdf being created. For maximum compatibility you can choose PDF 1.4. (Acrobat 5.0, but can be opened by any version of Acrobat, even if version less than 1.4 won't have all the features). Choosing PDF 1.6 (Acrobat 7) allows for more compression and smaller files, but you'll need Acrobat 7 or newer to see the files. Older versions won't be able to open it at all.

Note that this value might be ignored if you are creating PDFA-1 (as it requires PDF1-4). Also for signing, FlexCel requires PDF1-7.

Syntax

Namespace: FlexCel.Render

public TPdfVersion PdfVersion { get; set; }

See also

  • FlexCelPdfExport


FlexCelPdfExport.UnlicensedFontAction Property | FlexCel Studio for the .NET Framework documentation

FlexCelPdfExport.UnlicensedFontAction Property

Defines what to do when a font has a license that doesn't allow embedding, and you are trying to embed the font.

Syntax

Namespace: FlexCel.Render

public TUnlicensedFontAction UnlicensedFontAction { get; set; }

See also

  • FlexCelPdfExport


FlexCelPdfExport.UnlicensedReplacementFont Property | FlexCel Studio for the .NET Framework documentation

FlexCelPdfExport.UnlicensedReplacementFont Property

When trying to embed a font that isn't licensed for embedding, and UnlicensedFontAction is TUnlicensedFontAction.Replace this property specifies the font that will be used to replace it. If null or empty, Arial will be used.

Syntax

Namespace: FlexCel.Render

public String UnlicensedReplacementFont { get; set; }

See also

  • FlexCelPdfExport


FlexCelPdfExport.HidePrintObjects Property | FlexCel Studio for the .NET Framework documentation

FlexCelPdfExport.HidePrintObjects Property

Select which kind of objects should not be printed or exported to pdf.

Syntax

Namespace: FlexCel.Render

public virtual THidePrintObjects HidePrintObjects { get; set; }

See also

  • FlexCelPdfExport


FlexCelPdfExport.ExportSheetBackgroundImages Property | FlexCel Studio for the .NET Framework documentation

FlexCelPdfExport.ExportSheetBackgroundImages Property

If false (the default) then the background images in the sheet won't be exported. Note that Excel doesn't print or export background images, and when it shows them on the screen they look the same no matter the sheet zoom. When you set this to true we will try to export the image, but it will grow and shrink when you zoom, making it look different from what Excel shows.

Syntax

Namespace: FlexCel.Render

public virtual Boolean ExportSheetBackgroundImages { get; set; }

See also

  • FlexCelPdfExport


FlexCelPdfExport.Compress Property | FlexCel Studio for the .NET Framework documentation

FlexCelPdfExport.Compress Property

When true, the pdf file will be compressed.

Syntax

Namespace: FlexCel.Render

public Boolean Compress { get; set; }

See also

  • FlexCelPdfExport


FlexCelPdfExport.Kerning Property | FlexCel Studio for the .NET Framework documentation

FlexCelPdfExport.Kerning Property

By default, pdf does not do any kerning with the fonts. This is, on the string "AVANT", it won't compensate the spaces between "A" and "V". (they should be smaller) If you turn this property on, FlexCel will calculate the kerning and add it to the generated file. The result file will be a little bigger because of the kerning info on all strings, but it will also look a little better.

Syntax

Namespace: FlexCel.Render

public Boolean Kerning { get; set; }

See also

  • FlexCelPdfExport


FlexCelPdfExport.UseFauxStyles Property | FlexCel Studio for the .NET Framework documentation

FlexCelPdfExport.UseFauxStyles Property

When a font doesn't have a bold, italic or bold-italic variant, FlexCel can't export bold, italic or bold-italic characters to the pdf respectively. When this property is true (the default), FlexCel will try to "fake" those missing styles by using a wider pen width for the characters to simulate bold, or doing a slant transform to simulate italics.

The results of a simulated bold or italic can be not great, so if you prefer that FlexCel doesn't try to simulate bold or italics, then you can set this property to false. If this property is false and the font you are using doesn't have bold or italics variants, then the pdf won't show bold or italics for that font.

You can use FlexCelTrace to know when FlexCel is using faux bolds or italics.

Syntax

Namespace: FlexCel.Render

public Boolean UseFauxStyles { get; set; }

See also

  • FlexCelPdfExport


FlexCelPdfExport.Properties Property | FlexCel Studio for the .NET Framework documentation

FlexCelPdfExport.Properties Property

Pdf file properties. Note that if UseExcelProperties is true and the values are null or empty, the properties from the exported workbook will be used.

Syntax

Namespace: FlexCel.Render

public TPdfProperties Properties { get; set; }

See also

  • FlexCelPdfExport


FlexCelPdfExport.UseExcelProperties Property | FlexCel Studio for the .NET Framework documentation

FlexCelPdfExport.UseExcelProperties Property

When this property is true, the properties of the Excel file will be used when the property is null or empty.

Syntax

Namespace: FlexCel.Render

public Boolean UseExcelProperties { get; set; }

See also

  • FlexCelPdfExport


FlexCelPdfExport.PrintRangeLeft Property | FlexCel Studio for the .NET Framework documentation

FlexCelPdfExport.PrintRangeLeft Property

First column to print (1 based). if this or any other PrintRange property is 0, the range will be automatically calculated.

Syntax

Namespace: FlexCel.Render

public Int32 PrintRangeLeft { get; set; }

See also

  • FlexCelPdfExport


FlexCelPdfExport.PrintRangeTop Property | FlexCel Studio for the .NET Framework documentation

FlexCelPdfExport.PrintRangeTop Property

First row to print (1 based). if this or any other PrintRange property is 0, the range will be automatically calculated.

Syntax

Namespace: FlexCel.Render

public Int32 PrintRangeTop { get; set; }

See also

  • FlexCelPdfExport


FlexCelPdfExport.PrintRangeRight Property | FlexCel Studio for the .NET Framework documentation

FlexCelPdfExport.PrintRangeRight Property

Last column to print (1 based). if this or any other PrintRange property is 0, the range will be automatically calculated.

Syntax

Namespace: FlexCel.Render

public Int32 PrintRangeRight { get; set; }

See also

  • FlexCelPdfExport


FlexCelPdfExport.PrintRangeBottom Property | FlexCel Studio for the .NET Framework documentation

FlexCelPdfExport.PrintRangeBottom Property

Last row to print (1 based). if this or any other PrintRange property is 0, the range will be automatically calculated.

Syntax

Namespace: FlexCel.Render

public Int32 PrintRangeBottom { get; set; }

See also

  • FlexCelPdfExport


FlexCelPdfExport.PageSize Property | FlexCel Studio for the .NET Framework documentation

FlexCelPdfExport.PageSize Property

Pdf page size. Set it to null to use the paper size on the xls file.

Syntax

Namespace: FlexCel.Render

public TPaperDimensions PageSize { get; set; }

See also

  • FlexCelPdfExport


FlexCelPdfExport.AllowOverwritingFiles Property | FlexCel Studio for the .NET Framework documentation

FlexCelPdfExport.AllowOverwritingFiles Property

Determines if FlexCel will automatically delete existing pdf files or not.

Syntax

Namespace: FlexCel.Render

public Boolean AllowOverwritingFiles { get; set; }

See also

  • FlexCelPdfExport


FlexCelPdfExport.FontEmbed Property | FlexCel Studio for the .NET Framework documentation

FlexCelPdfExport.FontEmbed Property

Determines what fonts will be embedded on the generated pdf. Note that when using UNICODE, fonts will be embedded anyway, no matter what this setting is.

Syntax

Namespace: FlexCel.Render

public TFontEmbed FontEmbed { get; set; }

See also

  • FlexCelPdfExport


FlexCelPdfExport.FontSubset Property | FlexCel Studio for the .NET Framework documentation

FlexCelPdfExport.FontSubset Property

Determines if the full font will be embedded or only the characters used, when embedding fonts.

Syntax

Namespace: FlexCel.Render

public TFontSubset FontSubset { get; set; }

See also

  • FlexCelPdfExport


FlexCelPdfExport.FontMapping Property | FlexCel Studio for the .NET Framework documentation

FlexCelPdfExport.FontMapping Property

Determines how fonts will be replaced on the generated pdf. Pdf comes with 4 standard font families, Serif, Sans-Serif, Monospace and Symbol. You can use for example the standard Helvetica instead of Arial and do not worry about embedding the font.

Syntax

Namespace: FlexCel.Render

public TFontMapping FontMapping { get; set; }

See also

  • FlexCelPdfExport


FlexCelPdfExport.FallbackFonts Property | FlexCel Studio for the .NET Framework documentation

FlexCelPdfExport.FallbackFonts Property

A semicolon (;) separated list of font names to try when a character is not found in the used font.

When a character is not found in a font, it will display as an empty square by default. By setting this property, FlexCel will try to find a font that supports this character in this list, and if found, use that font to render the character.

Syntax

Namespace: FlexCel.Render

public String FallbackFonts { get; set; }

See also

  • FlexCelPdfExport


FlexCelPdfExport.FallbackFontsBold Property | FlexCel Studio for the .NET Framework documentation

FlexCelPdfExport.FallbackFontsBold Property

A semicolon (;) separated list of font names to try when a character is not found in the used font and the font is bold.

This property is only used for bold fonts, and has higher priority than FallbackFonts for bold fonts. It allows you to specify different fallback fonts for bold and not bold characters.

Important: This property is only needed if the fonts in FallbackFonts don't have bold variants. If your fallback fonts come with bold variants, there is not need to set this property.

Syntax

Namespace: FlexCel.Render

public String FallbackFontsBold { get; set; }

See also

  • FlexCelPdfExport


FlexCelPdfExport.FallbackFontsItalic Property | FlexCel Studio for the .NET Framework documentation

FlexCelPdfExport.FallbackFontsItalic Property

A semicolon (;) separated list of font names to try when a character is not found in the used font and the font is italic.

This property is only used for italic fonts, and has higher priority than FallbackFonts for italic fonts. It allows you to specify different fallback fonts for italic and not italic characters.

Important: This property is only needed if the fonts in FallbackFonts don't have italic variants. If your fallback fonts come with italic variants, there is not need to set this property.

Syntax

Namespace: FlexCel.Render

public String FallbackFontsItalic { get; set; }

See also

  • FlexCelPdfExport


FlexCelPdfExport.FallbackFontsBoldItalic Property | FlexCel Studio for the .NET Framework documentation

FlexCelPdfExport.FallbackFontsBoldItalic Property

A semicolon (;) separated list of font names to try when a character is not found in the used font and the font is bold and italic.

This property is only used for fonts which are both bold and italic, and has higher priority than FallbackFonts, FallbackFontsBold and FallbackFontsItalic for bold-italic fonts. It allows you to specify different fallback fonts for bold-italic and not bold-italic characters.

Important: This property is only needed if the fonts in FallbackFonts don't have bold-italic variants. If your fallback fonts come bold-with italic variants, there is not need to set this property.

Syntax

Namespace: FlexCel.Render

public String FallbackFontsBoldItalic { get; set; }

See also

  • FlexCelPdfExport


FlexCelPdfExport.PageLayout Property | FlexCel Studio for the .NET Framework documentation

FlexCelPdfExport.PageLayout Property

Sets the default page layout when opening the document.

Syntax

Namespace: FlexCel.Render

public TPageLayout PageLayout { get; set; }

See also

  • FlexCelPdfExport


FlexCelPdfExport.PageLayoutDisplay Property | FlexCel Studio for the .NET Framework documentation

FlexCelPdfExport.PageLayoutDisplay Property

Sets the default page display layout when opening the document.

Syntax

Namespace: FlexCel.Render

public TPageLayoutDisplay PageLayoutDisplay { get; set; }

See also

  • FlexCelPdfExport


FlexCelPdfExport.InitialZoomAndPage Property | FlexCel Studio for the .NET Framework documentation

FlexCelPdfExport.InitialZoomAndPage Property

Sets the default zoom and initial page when opening the document.

Syntax

Namespace: FlexCel.Render

public TPdfDestination InitialZoomAndPage { get; set; }

See also

  • FlexCelPdfExport


FlexCelPdfExport.CurrentPage Property | FlexCel Studio for the .NET Framework documentation

FlexCelPdfExport.CurrentPage Property

Returns the next page that we are going to print.

Syntax

Namespace: FlexCel.Render

public Int32 CurrentPage { get; }

See also

  • FlexCelPdfExport


FlexCelPdfExport.CurrentPageInSheet Property | FlexCel Studio for the .NET Framework documentation

FlexCelPdfExport.CurrentPageInSheet Property

Returns the next page we are going to print, on the current sheet. When not printing more than one sheet, it is equivalent to CurrentPage

Syntax

Namespace: FlexCel.Render

public Int32 CurrentPageInSheet { get; }

See also

  • FlexCelPdfExport


FlexCelPdfExport.BeforeNewPage Event | FlexCel Studio for the .NET Framework documentation

FlexCelPdfExport.BeforeNewPage Event

Fires before each new page is generated on the pdf. You can use this event to change the pagesize for the new sheet.

Syntax

Namespace: FlexCel.Render

public PageEventHandler BeforeNewPage

See also

  • FlexCelPdfExport


FlexCelPdfExport.BeforeGeneratePage Event | FlexCel Studio for the .NET Framework documentation

FlexCelPdfExport.BeforeGeneratePage Event

Fires after each new page is generated on the pdf, but before any content is written to the page. (The page is blank) You can use this event to add a watermark or a background image.

Syntax

Namespace: FlexCel.Render

public PageEventHandler BeforeGeneratePage

See also

  • FlexCelPdfExport


FlexCelPdfExport.AfterGeneratePage Event | FlexCel Studio for the .NET Framework documentation

FlexCelPdfExport.AfterGeneratePage Event

Fires after each new page is generated on the pdf, and after all content is written to the page. (The page is written) You can use this event to add some text or images on top of the page contents.

Syntax

Namespace: FlexCel.Render

public PageEventHandler AfterGeneratePage

See also

  • FlexCelPdfExport


FlexCelPdfExport.GetFontData Event | FlexCel Studio for the .NET Framework documentation

FlexCelPdfExport.GetFontData Event

Use this event if you want to provide your own font information for embedding. Note that if you don't assign this event, the default method will be used, and this will try to find the font on the Fonts folder. To change the font folder, use GetFontFolder event

Note that this property applies only to this object. To change the property for the full application, use PdfWriter.GetFontDataGlobal

Syntax

Namespace: FlexCel.Render

public GetFontDataEventHandler GetFontData

See also

  • FlexCelPdfExport


FlexCelPdfExport.GetFontFolder Event | FlexCel Studio for the .NET Framework documentation

FlexCelPdfExport.GetFontFolder Event

Use this event if you want to provide your own font information for embedding. Normally FlexCel will search for fonts on [System]\Fonts folder and %localappdata%\Microsoft\Windows\Fonts. If your fonts are in other location, you can tell FlexCel where they are here. If you prefer just to give FlexCel the full data on the font, you can use GetFontData event instead.

Note that this property applies only to this object. To change the property for the full application, use PdfWriter.GetFontFolderGlobal

Syntax

Namespace: FlexCel.Render

public GetFontFolderEventHandler GetFontFolder

Examples

The following code will setup a GetFontFolder event that searches for a font first in c:\MyFonts, and if the font isn't there, it will search in the default FlexCel search path:

    using (FlexCelPdfExport pdf = new FlexCelPdfExport(xls, true))
    {
        pdf.GetFontFolder += (sender, e) =>
        {
            e.FontPath = "c:\\MyFonts;" + e.FontPath;
        };

        pdf.Export("result.pdf");
    }

See also

  • FlexCelPdfExport


FlexCelPdfExport.OnFontEmbed Event | FlexCel Studio for the .NET Framework documentation

FlexCelPdfExport.OnFontEmbed Event

Use this event if you want to manually specify which fonts to embed into the pdf document.

Note that this property applies only to this object. To change the property for the full application, use PdfWriter.OnFontEmbedGlobal

Syntax

Namespace: FlexCel.Render

public FontEmbedEventHandler OnFontEmbed

See also

  • FlexCelPdfExport


FlexCelPdfExport.GetBookmarkInformation Event | FlexCel Studio for the .NET Framework documentation

FlexCelPdfExport.GetBookmarkInformation Event

Use this event to customize what goes inside the bookmarks when exporting multiple sheets of an xls file.

Syntax

Namespace: FlexCel.Render

public GetBookmarkInformationEventHandler GetBookmarkInformation

See also

  • FlexCelPdfExport


FlexCelPdfExportProgress Class | FlexCel Studio for the .NET Framework documentation

FlexCelPdfExportProgress Class

Indicates how much of the report has been generated.

Syntax

Namespace: FlexCel.Render

public class FlexCelPdfExportProgress

Properties

Name | Description
Page | The page that is being written.
TotalPage | The total number of pages exporting.


FlexCelPdfExportProgress.Page Property | FlexCel Studio for the .NET Framework documentation

FlexCelPdfExportProgress.Page Property

The page that is being written.

Syntax

Namespace: FlexCel.Render

public Int32 Page { get; }

See also

  • FlexCelPdfExportProgress


FlexCelPdfExportProgress.TotalPage Property | FlexCel Studio for the .NET Framework documentation

FlexCelPdfExportProgress.TotalPage Property

The total number of pages exporting.

Syntax

Namespace: FlexCel.Render

public Int32 TotalPage { get; }

See also

  • FlexCelPdfExportProgress


FlexCelPrintDocument Class | FlexCel Studio for the .NET Framework documentation

FlexCelPrintDocument Class

A PrintDocument descendant that can be used to print and preview an Excel document.

Syntax

Namespace: FlexCel.Render

public class FlexCelPrintDocument: PrintDocument

Constructors

Name | Description
FlexCelPrintDocument | Overloaded FlexCelPrintDocument FlexCelPrintDocument(ExcelFile)

Methods

Name | Description
OnGetPrinter​Hard​Margins | Replace this event when creating a custom descendant of FlexCelPrint​Document.​
OnBeginPrint | Raises the BeginPrint event. It is called after the Print method is called and before the first page of the document prints.
OnEndPrint | Raises the EndPrint event. It is called after the Print method has finished.
OnBeforePrintPage | Replace this event when creating a custom descendant of FlexCelPrint​Document.​
OnQueryPageSettings | Overrides the standard method to change landscape or portrait settings when AllVisibleSheets is true. You can override this method on a descendant class to change the behavior./>
OnPrintPage | Raises the PrintDocument.​Print​Page event. It is called before a page prints.

Properties

Name | Description
Workbook | The ExcelFile to print.
HidePrintObjects | Select which kind of objects should not be printed or exported to pdf.
ExportSheetBackground​Images | If false (the default) then the background images in the sheet won't be printed. Note that Excel doesn't print background images, and when it shows them on the screen they look the same no matter the sheet zoom. When you set this to true we will try to print the image, but it will grow and shrink when you zoom, making it look different from what Excel shows.
AntiAliasedText | When true, the text will be antialiased. Depending on the device display might look better, but it consumes more processor time.
PrintRangeLeft | First column to print (1 based). if this or any other PrintRange property is 0, the range will be automatically calculated.
PrintRangeTop | First row to print (1 based). if this or any other PrintRange property is 0, the range will be automatically calculated.
PrintRangeRight | Last column to print (1 based). if this or any other PrintRange property is 0, the range will be automatically calculated.
PrintRangeBottom | Last row to print (1 based). if this or any other PrintRange property is 0, the range will be automatically calculated.
AllVisibleSheets | If true, All visible sheets on the workbook will be printed. See ResetPageNumber​OnEach​Sheet for behavior of the page number when printing multiple sheets.
ResetPageNumber​OnEach​Sheet | This property only makes sense when AllVisibleSheets is true. On that case, if this property is true each sheet of the workbook will have the page number reset. For example if the xls file has 2 sheets and each has 3 pages: When ResetPageNumber​OnEach​Sheet = true then footers will look like "Page 1 of 3". If false, they will look like "Page 5 of 6"
CurrentPage | Returns the next page that we are going to print.
CurrentPageInSheet | Returns the next page we are going to print, on the current sheet. When not printing more than one sheet, it is equivalent to CurrentPage

Events

Name | Description
GetPrinterHard​Margins | On .NET there is no way to get the actual physical margins of a printer without a p/invoke. As FlexCel doesn't contain p/invokes (in order to be portable to any platform), it will try to guess the best value for them by averaging the printer visible clip area. If you are not getting good results, you can let FlexCel know the real printer margins on this event. Normally, you would call GetDeviceCaps for this.
BeforePrintPage | Fires before printing each sheet, so you can print and set up your own stuff before FlexCel renders the page.


FlexCelPrintDocument.FlexCelPrintDocument Constructor | FlexCel Studio for the .NET Framework documentation

FlexCelPrintDocument.FlexCelPrintDocument Constructor

Overloads

  • FlexCelPrintDocument.FlexCelPrintDocument
  • FlexCelPrintDocument.FlexCelPrintDocument(ExcelFile)

FlexCelPrintDocument.FlexCelPrintDocument

Creates a new FlexCelPrintDocument instance.

Syntax

Namespace: FlexCel.Render

public FlexCelPrintDocument()

See also

  • FlexCelPrintDocument

FlexCelPrintDocument.FlexCelPrintDocument(ExcelFile)

Creates a new FlexCelPrintDocument and assigns it to an ExcelFile.

Syntax

Namespace: FlexCel.Render

public FlexCelPrintDocument(ExcelFile aWorkbook)

Parameters

<-> | Parameter | Type | Description
 | aWorkbook | ExcelFile | ExcelFile containing the data this PrintDocument will print.

See also

  • FlexCelPrintDocument


FlexCelPrintDocument.OnGetPrinterHardMargins Method | FlexCel Studio for the .NET Framework documentation

FlexCelPrintDocument.OnGetPrinterHardMargins Method

Replace this event when creating a custom descendant of FlexCelPrintDocument.

Syntax

Namespace: FlexCel.Render

protected virtual void OnGetPrinterHardMargins(PrintHardMarginsEventArgs e)

Parameters

<-> | Parameter | Type | Description
 | e | PrintHardMargins​Event​Args |

See also

  • FlexCelPrintDocument


FlexCelPrintDocument.OnBeginPrint Method | FlexCel Studio for the .NET Framework documentation

FlexCelPrintDocument.OnBeginPrint Method

Raises the BeginPrint event. It is called after the Print method is called and before the first page of the document prints.

Remarks

This method is overridden to print an Excel document. Before doing its own initialization, it will call PrintDocument.OnBeginPrint" so you can do your own.

Syntax

Namespace: FlexCel.Render

protected override void OnBeginPrint(PrintEventArgs e)

Parameters

<-> | Parameter | Type | Description
 | e | PrintEventArgs | A PrintEventArgs that contains the event data.

See also

  • FlexCelPrintDocument


FlexCelPrintDocument.OnEndPrint Method | FlexCel Studio for the .NET Framework documentation

FlexCelPrintDocument.OnEndPrint Method

Raises the EndPrint event. It is called after the Print method has finished.

Remarks

This method is overridden to print an Excel document.

Syntax

Namespace: FlexCel.Render

protected override void OnEndPrint(PrintEventArgs e)

Parameters

<-> | Parameter | Type | Description
 | e | PrintEventArgs | A PrintEventArgs that contains the event data.

See also

  • FlexCelPrintDocument


FlexCelPrintDocument.OnBeforePrintPage Method | FlexCel Studio for the .NET Framework documentation

FlexCelPrintDocument.OnBeforePrintPage Method

Replace this event when creating a custom descendant of FlexCelPrintDocument.

Syntax

Namespace: FlexCel.Render

protected virtual void OnBeforePrintPage(PrintPageEventArgs e)

Parameters

<-> | Parameter | Type | Description
 | e | PrintPageEventArgs |

See also

  • FlexCelPrintDocument


FlexCelPrintDocument.OnQueryPageSettings Method | FlexCel Studio for the .NET Framework documentation

FlexCelPrintDocument.OnQueryPageSettings Method

Overrides the standard method to change landscape or portrait settings when AllVisibleSheets is true. You can override this method on a descendant class to change the behavior./>

Syntax

Namespace: FlexCel.Render

protected override void OnQueryPageSettings(QueryPageSettingsEventArgs e)

Parameters

<-> | Parameter | Type | Description
 | e | QueryPageSettingsEventArgs | Arguments of the event.

See also

  • FlexCelPrintDocument


FlexCelPrintDocument.OnPrintPage Method | FlexCel Studio for the .NET Framework documentation

FlexCelPrintDocument.OnPrintPage Method

Raises the PrintDocument.PrintPage event. It is called before a page prints.

Remarks

This method is overridden to print an Excel document. After doing its own work, it will call PrintDocument.PrintPage so you can draw your own thing over it.

Syntax

Namespace: FlexCel.Render

protected override void OnPrintPage(PrintPageEventArgs e)

Parameters

<-> | Parameter | Type | Description
 | e | PrintPageEventArgs | A PrintPageEventArgs that contains the event data.

See also

  • FlexCelPrintDocument


FlexCelPrintDocument.Workbook Property | FlexCel Studio for the .NET Framework documentation

FlexCelPrintDocument.Workbook Property

The ExcelFile to print.

Syntax

Namespace: FlexCel.Render

public ExcelFile Workbook { get; set; }

See also

  • FlexCelPrintDocument


FlexCelPrintDocument.HidePrintObjects Property | FlexCel Studio for the .NET Framework documentation

FlexCelPrintDocument.HidePrintObjects Property

Select which kind of objects should not be printed or exported to pdf.

Syntax

Namespace: FlexCel.Render

public THidePrintObjects HidePrintObjects { get; set; }

See also

  • FlexCelPrintDocument


FlexCelPrintDocument.ExportSheetBackgroundImages Property | FlexCel Studio for the .NET Framework documentation

FlexCelPrintDocument.ExportSheetBackgroundImages Property

If false (the default) then the background images in the sheet won't be printed. Note that Excel doesn't print background images, and when it shows them on the screen they look the same no matter the sheet zoom. When you set this to true we will try to print the image, but it will grow and shrink when you zoom, making it look different from what Excel shows.

Syntax

Namespace: FlexCel.Render

public virtual Boolean ExportSheetBackgroundImages { get; set; }

See also

  • FlexCelPrintDocument


FlexCelPrintDocument.AntiAliasedText Property | FlexCel Studio for the .NET Framework documentation

FlexCelPrintDocument.AntiAliasedText Property

When true, the text will be antialiased. Depending on the device display might look better, but it consumes more processor time.

Syntax

Namespace: FlexCel.Render

public Boolean AntiAliasedText { get; set; }

See also

  • FlexCelPrintDocument


FlexCelPrintDocument.PrintRangeLeft Property | FlexCel Studio for the .NET Framework documentation

FlexCelPrintDocument.PrintRangeLeft Property

First column to print (1 based). if this or any other PrintRange property is 0, the range will be automatically calculated.

Syntax

Namespace: FlexCel.Render

public Int32 PrintRangeLeft { get; set; }

See also

  • FlexCelPrintDocument


FlexCelPrintDocument.PrintRangeTop Property | FlexCel Studio for the .NET Framework documentation

FlexCelPrintDocument.PrintRangeTop Property

First row to print (1 based). if this or any other PrintRange property is 0, the range will be automatically calculated.

Syntax

Namespace: FlexCel.Render

public Int32 PrintRangeTop { get; set; }

See also

  • FlexCelPrintDocument


FlexCelPrintDocument.PrintRangeRight Property | FlexCel Studio for the .NET Framework documentation

FlexCelPrintDocument.PrintRangeRight Property

Last column to print (1 based). if this or any other PrintRange property is 0, the range will be automatically calculated.

Syntax

Namespace: FlexCel.Render

public Int32 PrintRangeRight { get; set; }

See also

  • FlexCelPrintDocument


FlexCelPrintDocument.PrintRangeBottom Property | FlexCel Studio for the .NET Framework documentation

FlexCelPrintDocument.PrintRangeBottom Property

Last row to print (1 based). if this or any other PrintRange property is 0, the range will be automatically calculated.

Syntax

Namespace: FlexCel.Render

public Int32 PrintRangeBottom { get; set; }

See also

  • FlexCelPrintDocument


FlexCelPrintDocument.AllVisibleSheets Property | FlexCel Studio for the .NET Framework documentation

FlexCelPrintDocument.AllVisibleSheets Property

If true, All visible sheets on the workbook will be printed. See ResetPageNumberOnEachSheet for behavior of the page number when printing multiple sheets.

Syntax

Namespace: FlexCel.Render

public Boolean AllVisibleSheets { get; set; }

See also

  • FlexCelPrintDocument


FlexCelPrintDocument.ResetPageNumberOnEachSheet Property | FlexCel Studio for the .NET Framework documentation

FlexCelPrintDocument.ResetPageNumberOnEachSheet Property

This property only makes sense when AllVisibleSheets is true. On that case, if this property is true each sheet of the workbook will have the page number reset. For example if the xls file has 2 sheets and each has 3 pages: When ResetPageNumberOnEachSheet = true then footers will look like "Page 1 of 3". If false, they will look like "Page 5 of 6"

Syntax

Namespace: FlexCel.Render

public Boolean ResetPageNumberOnEachSheet { get; set; }

See also

  • FlexCelPrintDocument


FlexCelPrintDocument.CurrentPage Property | FlexCel Studio for the .NET Framework documentation

FlexCelPrintDocument.CurrentPage Property

Returns the next page that we are going to print.

Syntax

Namespace: FlexCel.Render

public Int32 CurrentPage { get; }

See also

  • FlexCelPrintDocument


FlexCelPrintDocument.CurrentPageInSheet Property | FlexCel Studio for the .NET Framework documentation

FlexCelPrintDocument.CurrentPageInSheet Property

Returns the next page we are going to print, on the current sheet. When not printing more than one sheet, it is equivalent to CurrentPage

Syntax

Namespace: FlexCel.Render

public Int32 CurrentPageInSheet { get; }

See also

  • FlexCelPrintDocument


FlexCelPrintDocument.GetPrinterHardMargins Event | FlexCel Studio for the .NET Framework documentation

FlexCelPrintDocument.GetPrinterHardMargins Event

On .NET there is no way to get the actual physical margins of a printer without a p/invoke. As FlexCel doesn't contain p/invokes (in order to be portable to any platform), it will try to guess the best value for them by averaging the printer visible clip area. If you are not getting good results, you can let FlexCel know the real printer margins on this event. Normally, you would call GetDeviceCaps for this.

Remarks

See the printpreview demo to see how this event can be used.

Syntax

Namespace: FlexCel.Render

public PrintHardMarginsEventHandler GetPrinterHardMargins

See also

  • FlexCelPrintDocument


FlexCelPrintDocument.BeforePrintPage Event | FlexCel Studio for the .NET Framework documentation

FlexCelPrintDocument.BeforePrintPage Event

Fires before printing each sheet, so you can print and set up your own stuff before FlexCel renders the page.

Syntax

Namespace: FlexCel.Render

public PrintPageEventHandler BeforePrintPage

See also

  • FlexCelPrintDocument


FlexCelSVGExport Class | FlexCel Studio for the .NET Framework documentation

FlexCelSVGExport Class

A component for exporting an Excel file to an SVG (Scalable Vector Graphics) image.

Syntax

Namespace: FlexCel.Render

public class FlexCelSVGExport: Component

Fields

Name | Description
FCompress | If true, the file will be compressed. This property is just for derived classes, for normal cases use Compress

Constructors

Name | Description
FlexCelSVGExport | Overloaded FlexCelSVGExport FlexCelSVGExport(ExcelFile) FlexCelSVGExport(ExcelFile, Boolean)

Methods

Name | Description
SaveAsImage | Saves the current Excel file on an SVG image stream.

Properties

Name | Description
Workbook | The ExcelFile to print.
Compress | When true, the pdf file will be compressed.
HidePrintObjects | Select which kind of objects should not be printed or exported to the image.
ExportSheetBackground​Images | If false (the default) then the background images in the sheet won't be exported. Note that Excel doesn't print or export background images, and when it shows them on the screen they look the same no matter the sheet zoom. When you set this to true we will try to export the image, but it will grow and shrink when you zoom, making it look different from what Excel shows.
RasterizeSVGImages | If false (the default) then FlexCel will export SVG images inside the Excel file as SVG images inside the generated SVG. If true, FlexCel will convert the SVG images to PNG and embed the PNG inside the SVG. This might be more accurate specially if the embedded SVG uses fonts that might not be present in the client machine. See S V G Files Inside Xlsx Files for more information.
PrintRangeLeft | First column to print (1 based). if this or any other PrintRange property is 0, the range will be automatically calculated.
PrintRangeTop | First row to print (1 based). if this or any other PrintRange property is 0, the range will be automatically calculated.
PrintRangeRight | Last column to print (1 based). if this or any other PrintRange property is 0, the range will be automatically calculated.
PrintRangeBottom | Last row to print (1 based). if this or any other PrintRange property is 0, the range will be automatically calculated.
PageSize | Image page size. Set it to null to use the paper size on the xls file.
AllowOverwriting​Files | Determines if FlexCel will automatically delete existing image files or not.
AllVisibleSheets | If true, all visible sheets on the workbook will be printed. See ResetPageNumber​OnEach​Sheet for behavior of the page number when printing multiple sheets.
ResetPageNumber​OnEach​Sheet | This property only makes sense when AllVisibleSheets is true. On that case, if this property is true each sheet of the workbook will have the page number reset. For example if the xls file has 2 sheets and each has 3 pages: When ResetPageNumber​OnEach​Sheet = true then footers will look like "Page 1 of 3". If false, they will look like "Page 5 of 6"
ExportType | How much of the svg will be exported.
Encoding | Encoding used to generate the SVG file. If null, UTF8 without BOM will be used.
IdPrefix | Prefix to be used in all definitions inside the svg file. For normal SVG files you can leave this null, but if you are embedding the files inside an html file, you need to ensure every image has unique identifiers. All SVG identifiers from different images inside an html file must be unique.
LinksInNewWindow | IF true, links will be exported to open in a new window. (using the show=new attribute in svg links)


FlexCelSVGExport.FCompress Field | FlexCel Studio for the .NET Framework documentation

FlexCelSVGExport.FCompress Field

If true, the file will be compressed. This property is just for derived classes, for normal cases use Compress

Syntax

Namespace: FlexCel.Render

protected Boolean FCompress

See also

  • FlexCelSVGExport


FlexCelSVGExport.FlexCelSVGExport Constructor | FlexCel Studio for the .NET Framework documentation

FlexCelSVGExport.FlexCelSVGExport Constructor

Overloads

  • FlexCelSVGExport.FlexCelSVGExport
  • FlexCelSVGExport.FlexCelSVGExport(ExcelFile)
  • FlexCelSVGExport.FlexCelSVGExport(ExcelFile, Boolean)

FlexCelSVGExport.FlexCelSVGExport

Creates a new FlexCelSVGExport instance.

Syntax

Namespace: FlexCel.Render

public FlexCelSVGExport()

See also

  • FlexCelSVGExport

FlexCelSVGExport.FlexCelSVGExport(ExcelFile)

Creates a new FlexCelSVGExport and assigns it to an ExcelFile.

Syntax

Namespace: FlexCel.Render

public FlexCelSVGExport(ExcelFile aWorkbook)

Parameters

<-> | Parameter | Type | Description
 | aWorkbook | ExcelFile | ExcelFile containing the data this component will export.

See also

  • FlexCelSVGExport

FlexCelSVGExport.FlexCelSVGExport(ExcelFile, Boolean)

Creates a new FlexCelSVGExport and assigns it to an ExcelFile, setting AllowOverwritingFiles to the desired value.

Syntax

Namespace: FlexCel.Render

public FlexCelSVGExport(ExcelFile aWorkbook, Boolean aAllowOverwritingFiles)

Parameters

<-> | Parameter | Type | Description
 | aWorkbook | ExcelFile | ExcelFile containing the data this component will export.
 | aAllowOverwritingFiles | Boolean | When true, existing files will be overwritten.

See also

  • FlexCelSVGExport


FlexCelSVGExport.SaveAsImage Method | FlexCel Studio for the .NET Framework documentation

FlexCelSVGExport.SaveAsImage Method

Saves the current Excel file on an SVG image stream.

Syntax

Namespace: FlexCel.Render

public void SaveAsImage(Action<SVGExportParameters> saveParameters)

Parameters

<-> | Parameter | Type | Description
 | saveParameters | Action<SVGExportParameters> | Action that will be called once for every page to export. When this action is called you can assign a file name for the image, a title and description, cancel the export, etc.

See also

  • FlexCelSVGExport


FlexCelSVGExport.Workbook Property | FlexCel Studio for the .NET Framework documentation

FlexCelSVGExport.Workbook Property

The ExcelFile to print.

Syntax

Namespace: FlexCel.Render

public ExcelFile Workbook { get; set; }

See also

  • FlexCelSVGExport


FlexCelSVGExport.Compress Property | FlexCel Studio for the .NET Framework documentation

FlexCelSVGExport.Compress Property

When true, the pdf file will be compressed.

Syntax

Namespace: FlexCel.Render

public Boolean Compress { get; set; }

See also

  • FlexCelSVGExport


FlexCelSVGExport.HidePrintObjects Property | FlexCel Studio for the .NET Framework documentation

FlexCelSVGExport.HidePrintObjects Property

Select which kind of objects should not be printed or exported to the image.

Syntax

Namespace: FlexCel.Render

public THidePrintObjects HidePrintObjects { get; set; }

See also

  • FlexCelSVGExport


FlexCelSVGExport.ExportSheetBackgroundImages Property | FlexCel Studio for the .NET Framework documentation

FlexCelSVGExport.ExportSheetBackgroundImages Property

If false (the default) then the background images in the sheet won't be exported. Note that Excel doesn't print or export background images, and when it shows them on the screen they look the same no matter the sheet zoom. When you set this to true we will try to export the image, but it will grow and shrink when you zoom, making it look different from what Excel shows.

Syntax

Namespace: FlexCel.Render

public virtual Boolean ExportSheetBackgroundImages { get; set; }

See also

  • FlexCelSVGExport


FlexCelSVGExport.RasterizeSVGImages Property | FlexCel Studio for the .NET Framework documentation

FlexCelSVGExport.RasterizeSVGImages Property

If false (the default) then FlexCel will export SVG images inside the Excel file as SVG images inside the generated SVG. If true, FlexCel will convert the SVG images to PNG and embed the PNG inside the SVG. This might be more accurate specially if the embedded SVG uses fonts that might not be present in the client machine. See S V G Files Inside Xlsx Files for more information.

Remarks

Even when this property is false, there might be cases where FlexCel rasterizes the image anyway. This can happen if the image has effects, like for example a color overlay, which we need to apply. Only images without effects will be rendered as SVG.

Syntax

Namespace: FlexCel.Render

public virtual Boolean RasterizeSVGImages { get; set; }

See also

  • FlexCelSVGExport


FlexCelSVGExport.PrintRangeLeft Property | FlexCel Studio for the .NET Framework documentation

FlexCelSVGExport.PrintRangeLeft Property

First column to print (1 based). if this or any other PrintRange property is 0, the range will be automatically calculated.

Syntax

Namespace: FlexCel.Render

public Int32 PrintRangeLeft { get; set; }

See also

  • FlexCelSVGExport


FlexCelSVGExport.PrintRangeTop Property | FlexCel Studio for the .NET Framework documentation

FlexCelSVGExport.PrintRangeTop Property

First row to print (1 based). if this or any other PrintRange property is 0, the range will be automatically calculated.

Syntax

Namespace: FlexCel.Render

public Int32 PrintRangeTop { get; set; }

See also

  • FlexCelSVGExport


FlexCelSVGExport.PrintRangeRight Property | FlexCel Studio for the .NET Framework documentation

FlexCelSVGExport.PrintRangeRight Property

Last column to print (1 based). if this or any other PrintRange property is 0, the range will be automatically calculated.

Syntax

Namespace: FlexCel.Render

public Int32 PrintRangeRight { get; set; }

See also

  • FlexCelSVGExport


FlexCelSVGExport.PrintRangeBottom Property | FlexCel Studio for the .NET Framework documentation

FlexCelSVGExport.PrintRangeBottom Property

Last row to print (1 based). if this or any other PrintRange property is 0, the range will be automatically calculated.

Syntax

Namespace: FlexCel.Render

public Int32 PrintRangeBottom { get; set; }

See also

  • FlexCelSVGExport


FlexCelSVGExport.PageSize Property | FlexCel Studio for the .NET Framework documentation

FlexCelSVGExport.PageSize Property

Image page size. Set it to null to use the paper size on the xls file.

Syntax

Namespace: FlexCel.Render

public TPaperDimensions PageSize { get; set; }

See also

  • FlexCelSVGExport


FlexCelSVGExport.AllowOverwritingFiles Property | FlexCel Studio for the .NET Framework documentation

FlexCelSVGExport.AllowOverwritingFiles Property

Determines if FlexCel will automatically delete existing image files or not.

Syntax

Namespace: FlexCel.Render

public Boolean AllowOverwritingFiles { get; set; }

See also

  • FlexCelSVGExport


FlexCelSVGExport.AllVisibleSheets Property | FlexCel Studio for the .NET Framework documentation

FlexCelSVGExport.AllVisibleSheets Property

If true, all visible sheets on the workbook will be printed. See ResetPageNumberOnEachSheet for behavior of the page number when printing multiple sheets.

Syntax

Namespace: FlexCel.Render

public Boolean AllVisibleSheets { get; set; }

See also

  • FlexCelSVGExport


FlexCelSVGExport.ResetPageNumberOnEachSheet Property | FlexCel Studio for the .NET Framework documentation

FlexCelSVGExport.ResetPageNumberOnEachSheet Property

This property only makes sense when AllVisibleSheets is true. On that case, if this property is true each sheet of the workbook will have the page number reset. For example if the xls file has 2 sheets and each has 3 pages: When ResetPageNumberOnEachSheet = true then footers will look like "Page 1 of 3". If false, they will look like "Page 5 of 6"

Syntax

Namespace: FlexCel.Render

public Boolean ResetPageNumberOnEachSheet { get; set; }

See also

  • FlexCelSVGExport


FlexCelSVGExport.ExportType Property | FlexCel Studio for the .NET Framework documentation

FlexCelSVGExport.ExportType Property

How much of the svg will be exported.

Syntax

Namespace: FlexCel.Render

public TSVGExportType ExportType { get; set; }

See also

  • FlexCelSVGExport


FlexCelSVGExport.Encoding Property | FlexCel Studio for the .NET Framework documentation

FlexCelSVGExport.Encoding Property

Encoding used to generate the SVG file. If null, UTF8 without BOM will be used.

Syntax

Namespace: FlexCel.Render

public Encoding Encoding { get; set; }

See also

  • FlexCelSVGExport


FlexCelSVGExport.IdPrefix Property | FlexCel Studio for the .NET Framework documentation

FlexCelSVGExport.IdPrefix Property

Prefix to be used in all definitions inside the svg file. For normal SVG files you can leave this null, but if you are embedding the files inside an html file, you need to ensure every image has unique identifiers. All SVG identifiers from different images inside an html file must be unique.

Syntax

Namespace: FlexCel.Render

public String IdPrefix { get; set; }

See also

  • FlexCelSVGExport


FlexCelSVGExport.LinksInNewWindow Property | FlexCel Studio for the .NET Framework documentation

FlexCelSVGExport.LinksInNewWindow Property

IF true, links will be exported to open in a new window. (using the show=new attribute in svg links)

Syntax

Namespace: FlexCel.Render

public Boolean LinksInNewWindow { get; set; }

See also

  • FlexCelSVGExport


GetBookmarkInformationArgs Class | FlexCel Studio for the .NET Framework documentation

GetBookmarkInformationArgs Class

Arguments passed on FlexCelPdfExport.GetBookmarkInformation,

Syntax

Namespace: FlexCel.Render

public class GetBookmarkInformationArgs: EventArgs

Constructors

Name | Description
GetBookmarkInformation​Args | Creates a new Argument.

Properties

Name | Description
File | The file with the pdf data.
CurrentPage | Page currently printing. 0 means the global bookmark parent of all the sheets.
CurrentPageInSheet | Page currently printing, relative to the active sheet.
Bookmark | Bookmark that we are about to include.


GetBookmarkInformationArgs.GetBookmarkInformationArgs Constructor | FlexCel Studio for the .NET Framework documentation

GetBookmarkInformationArgs.GetBookmarkInformationArgs Constructor

Creates a new Argument.

Syntax

Namespace: FlexCel.Render

public GetBookmarkInformationArgs(PdfWriter aPdfWriter, Int32 aCurrentPage, Int32 aCurrentPageInSheet, TBookmark aBookmark)

Parameters

<-> | Parameter | Type | Description
 | aPdfWriter | PdfWriter | The file we are processing.
 | aCurrentPage | Int32 | The page that is being generated. 0 means the global bookmark parent of all the sheets.
 | aCurrentPageInSheet | Int32 | The page that is being generated, relative to the sheet.
 | aBookmark | TBookmark | Bookmark that we are about to include. you can customize it on this event.

See also

  • GetBookmarkInformationArgs


GetBookmarkInformationArgs.File Property | FlexCel Studio for the .NET Framework documentation

GetBookmarkInformationArgs.File Property

The file with the pdf data.

Syntax

Namespace: FlexCel.Render

public PdfWriter File { get; }

See also

  • GetBookmarkInformationArgs


GetBookmarkInformationArgs.CurrentPage Property | FlexCel Studio for the .NET Framework documentation

GetBookmarkInformationArgs.CurrentPage Property

Page currently printing. 0 means the global bookmark parent of all the sheets.

Syntax

Namespace: FlexCel.Render

public Int32 CurrentPage { get; }

See also

  • GetBookmarkInformationArgs


GetBookmarkInformationArgs.CurrentPageInSheet Property | FlexCel Studio for the .NET Framework documentation

GetBookmarkInformationArgs.CurrentPageInSheet Property

Page currently printing, relative to the active sheet.

Syntax

Namespace: FlexCel.Render

public Int32 CurrentPageInSheet { get; }

See also

  • GetBookmarkInformationArgs


GetBookmarkInformationArgs.Bookmark Property | FlexCel Studio for the .NET Framework documentation

GetBookmarkInformationArgs.Bookmark Property

Bookmark that we are about to include.

Syntax

Namespace: FlexCel.Render

public TBookmark Bookmark { get; }

See also

  • GetBookmarkInformationArgs


ImageInformationEventArgs Class | FlexCel Studio for the .NET Framework documentation

ImageInformationEventArgs Class

Arguments passed on FlexCelHtmlExport.OnGetImageInformation,

Syntax

Namespace: FlexCel.Render

public class ImageInformationEventArgs: EventArgs

Constructors

Name | Description
ImageInformation​Event​Args | Creates a new Argument.

Properties

Name | Description
Workbook | ExcelFile with the image, positioned in the sheet that we are rendering. Make sure if you modify ActiveSheet of this instance to restore it back to the original value before exiting the event.
ObjectIndex | Object index of the object being rendered. You can use xls.​Get​Object(​object​Index) to get the object properties, or you can use this property to attach an unique number in the sheet to the image filename. If the image is not an object (for example it is a rotated text) this property will be -1.
ShapeProps | Shape properties of the object being rendered. You can use them to get the name of the object, its size, etc. If the image is not an object (for example it is a rotated text) this property will be null.
ImageStream | The stream where the images will be saved. Keep it null to store the image as a file using ImageFile. When saving as MHTML this parameter does nothing, since all images will be saved in the same MTHML stream.
ImageFile | The file where the image will be saved. If ImageStream is not null, this property will do nothing. If both this property and ImageStream are null, the image will not be saved. When saving as MHTML this parameter does nothing, since all images will be saved in the same MTHML stream.
ImageLink | The link that will be inserted in the html file. Change it if you change the default image location. Set it to null to not add a link to this image in the generated html file. If you want to avoid exporting all images, you can use THidePrintObjects for that. But if you just want to avoid exporting one image in a file, you can do it by setting ImageStream, ImageFile and this property to null.
ImageLinkNeeds​Escaping | If true (the default) the link you provide in ImageLink is not escaped and will be escaped by FlexCel. So for example, the link "http://my site" will be escaped to "http:​//​my%​20site"​.​ If the link you provided was already escaped, then set this variable to false.
AlternateText | Alternate text for the image, to show in the "ALT" tag when a browser cannot display images. By default this is set to the text in the box "Alternative Text" in the web tab on the image properties. If no Alternative text is supplied in the file, the image name will be used here.
HyperLink | Hyperlink where the image will point to. This is automatically read from the image hyperlink if it has one, but you can modify, delete or add a new hyperlink for any image with this property.
HyperLinkTitle | Hyperlink title if the image has an hyperlink.
SavedImageFormat | File format in which to save this image. Do not modify it to keep the default format. Important: If you want to render the charts as SVG objects instead of PNG bitmaps, you need to set this property to THtmlImageFormat.​Svg.​


ImageInformationEventArgs.ImageInformationEventArgs Constructor | FlexCel Studio for the .NET Framework documentation

ImageInformationEventArgs.ImageInformationEventArgs Constructor

Creates a new Argument.

Syntax

Namespace: FlexCel.Render

public ImageInformationEventArgs(ExcelFile aWorkbook, Int32 aObjectIndex, TShapeProperties aShapeProps, Stream aImageStream, String aImageFile, String aImageLink, String aAlternateText, String aHyperLink, String aHyperLinkTitle, THtmlImageFormat aSavedImageFormat)

Parameters

<-> | Parameter | Type | Description
 | aWorkbook | ExcelFile | See Workbook
 | aObjectIndex | Int32 | See ObjectIndex
 | aShapeProps | TShapeProperties | See ShapeProps
 | aImageStream | Stream | See ImageStream
 | aImageFile | String | See ImageFile
 | aImageLink | String | See ImageLink
 | aAlternateText | String | See AlternateText
 | aHyperLink | String | See HyperLink
 | aHyperLinkTitle | String | See HyperLinkTitle
 | aSavedImageFormat | THtmlImageFormat | See SavedImageFormat

See also

  • ImageInformationEventArgs


ImageInformationEventArgs.Workbook Property | FlexCel Studio for the .NET Framework documentation

ImageInformationEventArgs.Workbook Property

ExcelFile with the image, positioned in the sheet that we are rendering. Make sure if you modify ActiveSheet of this instance to restore it back to the original value before exiting the event.

Syntax

Namespace: FlexCel.Render

public ExcelFile Workbook { get; }

See also

  • ImageInformationEventArgs


ImageInformationEventArgs.ObjectIndex Property | FlexCel Studio for the .NET Framework documentation

ImageInformationEventArgs.ObjectIndex Property

Object index of the object being rendered. You can use xls.GetObject(objectIndex) to get the object properties, or you can use this property to attach an unique number in the sheet to the image filename. If the image is not an object (for example it is a rotated text) this property will be -1.

Syntax

Namespace: FlexCel.Render

public Int32 ObjectIndex { get; }

See also

  • ImageInformationEventArgs


ImageInformationEventArgs.ShapeProps Property | FlexCel Studio for the .NET Framework documentation

ImageInformationEventArgs.ShapeProps Property

Shape properties of the object being rendered. You can use them to get the name of the object, its size, etc. If the image is not an object (for example it is a rotated text) this property will be null.

Syntax

Namespace: FlexCel.Render

public TShapeProperties ShapeProps { get; }

See also

  • ImageInformationEventArgs


ImageInformationEventArgs.ImageStream Property | FlexCel Studio for the .NET Framework documentation

ImageInformationEventArgs.ImageStream Property

The stream where the images will be saved. Keep it null to store the image as a file using ImageFile. When saving as MHTML this parameter does nothing, since all images will be saved in the same MTHML stream.

Syntax

Namespace: FlexCel.Render

public Stream ImageStream { get; set; }

See also

  • ImageInformationEventArgs


ImageInformationEventArgs.ImageFile Property | FlexCel Studio for the .NET Framework documentation

ImageInformationEventArgs.ImageFile Property

The file where the image will be saved. If ImageStream is not null, this property will do nothing. If both this property and ImageStream are null, the image will not be saved. When saving as MHTML this parameter does nothing, since all images will be saved in the same MTHML stream.

Syntax

Namespace: FlexCel.Render

public String ImageFile { get; set; }

See also

  • ImageInformationEventArgs


ImageInformationEventArgs.ImageLink Property | FlexCel Studio for the .NET Framework documentation

ImageInformationEventArgs.ImageLink Property

The link that will be inserted in the html file. Change it if you change the default image location. Set it to null to not add a link to this image in the generated html file. If you want to avoid exporting all images, you can use THidePrintObjects for that. But if you just want to avoid exporting one image in a file, you can do it by setting ImageStream, ImageFile and this property to null.

Syntax

Namespace: FlexCel.Render

public String ImageLink { get; set; }

See also

  • ImageInformationEventArgs


ImageInformationEventArgs.ImageLinkNeedsEscaping Property | FlexCel Studio for the .NET Framework documentation

ImageInformationEventArgs.ImageLinkNeedsEscaping Property

If true (the default) the link you provide in ImageLink is not escaped and will be escaped by FlexCel. So for example, the link "http://my site" will be escaped to "http://my%20site". If the link you provided was already escaped, then set this variable to false.

Syntax

Namespace: FlexCel.Render

public Boolean ImageLinkNeedsEscaping { get; set; }

See also

  • ImageInformationEventArgs


ImageInformationEventArgs.AlternateText Property | FlexCel Studio for the .NET Framework documentation

ImageInformationEventArgs.AlternateText Property

Alternate text for the image, to show in the "ALT" tag when a browser cannot display images. By default this is set to the text in the box "Alternative Text" in the web tab on the image properties. If no Alternative text is supplied in the file, the image name will be used here.

Syntax

Namespace: FlexCel.Render

public String AlternateText { get; set; }

See also

  • ImageInformationEventArgs


ImageInformationEventArgs.HyperLink Property | FlexCel Studio for the .NET Framework documentation

ImageInformationEventArgs.HyperLink Property

Hyperlink where the image will point to. This is automatically read from the image hyperlink if it has one, but you can modify, delete or add a new hyperlink for any image with this property.

Syntax

Namespace: FlexCel.Render

public String HyperLink { get; set; }

See also

  • ImageInformationEventArgs


ImageInformationEventArgs.HyperLinkTitle Property | FlexCel Studio for the .NET Framework documentation

ImageInformationEventArgs.HyperLinkTitle Property

Hyperlink title if the image has an hyperlink.

Syntax

Namespace: FlexCel.Render

public String HyperLinkTitle { get; set; }

See also

  • ImageInformationEventArgs


ImageInformationEventArgs.SavedImageFormat Property | FlexCel Studio for the .NET Framework documentation

ImageInformationEventArgs.SavedImageFormat Property

File format in which to save this image. Do not modify it to keep the default format. Important: If you want to render the charts as SVG objects instead of PNG bitmaps, you need to set this property to THtmlImageFormat.Svg.

Syntax

Namespace: FlexCel.Render

public THtmlImageFormat SavedImageFormat { get; set; }

See also

  • ImageInformationEventArgs


ImgPaintEventArgs Class | FlexCel Studio for the .NET Framework documentation

ImgPaintEventArgs Class

Arguments passed on Paint events.

Syntax

Namespace: FlexCel.Render

public class ImgPaintEventArgs: EventArgs

Constructors

Name | Description
ImgPaintEventArgs | Creates a new Argument.

Properties

Name | Description
Graphics | Gets the graphics used to paint.
PageBounds | Gets the rectangle in which to paint.
CurrentPage | Gets the current page number.
CurrentPageInSheet | Gets the current page number, relative to the active sheet.
TotalPages | Gets the total number of pages available to export.


ImgPaintEventArgs.ImgPaintEventArgs Constructor | FlexCel Studio for the .NET Framework documentation

ImgPaintEventArgs.ImgPaintEventArgs Constructor

Creates a new Argument.

Syntax

Namespace: FlexCel.Render

public ImgPaintEventArgs(TUIGraphics aGraphics, TUIRectangle aPageBounds, Int32 aCurrentPage, Int32 aCurrentPageInSheet, Int32 aTotalPages)

Parameters

<-> | Parameter | Type | Description
 | aGraphics | TUIGraphics | Gets the graphics used to paint.
 | aPageBounds | TUIRectangle | Gets the rectangle in which to paint.
 | aCurrentPage | Int32 | The page we are printing.
 | aCurrentPageInSheet | Int32 | The page we are printing, relative to the current sheet.
 | aTotalPages | Int32 | The total number of pages we have available to export.

See also

  • ImgPaintEventArgs


ImgPaintEventArgs.Graphics Property | FlexCel Studio for the .NET Framework documentation

ImgPaintEventArgs.Graphics Property

Gets the graphics used to paint.

Syntax

Namespace: FlexCel.Render

public TUIGraphics Graphics { get; }

See also

  • ImgPaintEventArgs


ImgPaintEventArgs.PageBounds Property | FlexCel Studio for the .NET Framework documentation

ImgPaintEventArgs.PageBounds Property

Gets the rectangle in which to paint.

Syntax

Namespace: FlexCel.Render

public TUIRectangle PageBounds { get; }

See also

  • ImgPaintEventArgs


ImgPaintEventArgs.CurrentPage Property | FlexCel Studio for the .NET Framework documentation

ImgPaintEventArgs.CurrentPage Property

Gets the current page number.

Syntax

Namespace: FlexCel.Render

public Int32 CurrentPage { get; }

See also

  • ImgPaintEventArgs


ImgPaintEventArgs.CurrentPageInSheet Property | FlexCel Studio for the .NET Framework documentation

ImgPaintEventArgs.CurrentPageInSheet Property

Gets the current page number, relative to the active sheet.

Syntax

Namespace: FlexCel.Render

public Int32 CurrentPageInSheet { get; }

See also

  • ImgPaintEventArgs


ImgPaintEventArgs.TotalPages Property | FlexCel Studio for the .NET Framework documentation

ImgPaintEventArgs.TotalPages Property

Gets the total number of pages available to export.

Syntax

Namespace: FlexCel.Render

public Int32 TotalPages { get; }

See also

  • ImgPaintEventArgs


NamedRangeExportEventArgs Class | FlexCel Studio for the .NET Framework documentation

NamedRangeExportEventArgs Class

Arguments passed on FlexCelHtmlExport.OnNamedRangeExport,

Syntax

Namespace: FlexCel.Render

public class NamedRangeExportEventArgs: EventArgs

Constructors

Name | Description
NamedRangeExport​Event​Args | Creates a new Argument.

Properties

Name | Description
Workbook | ExcelFile with the name, positioned in the sheet that we are rendering. Make sure if you modify ActiveSheet of this instance to restore it back to the original value before exiting the event.
Sheet | Sheet index (1 based) of the html cell we are exporting.
Row | Row index (1 based) of the html cell we are exporting. This number should be the same as the first row in the NamedRange.
Col | Column index (1 based) of the html cell we are exporting. This number should be the same as the first column in the NamedRange.
NamedRange | Named range that is being exported.
NameId | This property is by default the same as NamedRange.Name. If you want to change the id of the span that will be exported to HTML, change it to the new value. To not export this name, set it to null.


NamedRangeExportEventArgs.NamedRangeExportEventArgs Constructor | FlexCel Studio for the .NET Framework documentation

NamedRangeExportEventArgs.NamedRangeExportEventArgs Constructor

Creates a new Argument.

Syntax

Namespace: FlexCel.Render

public NamedRangeExportEventArgs(ExcelFile aWorkbook, Int32 aSheet, Int32 aRow, Int32 aCol, TXlsNamedRange aNamedRange, String aNameId)

Parameters

<-> | Parameter | Type | Description
 | aWorkbook | ExcelFile |
 | aSheet | Int32 |
 | aRow | Int32 |
 | aCol | Int32 |
 | aNamedRange | TXlsNamedRange |
 | aNameId | String |

See also

  • NamedRangeExportEventArgs


NamedRangeExportEventArgs.Workbook Property | FlexCel Studio for the .NET Framework documentation

NamedRangeExportEventArgs.Workbook Property

ExcelFile with the name, positioned in the sheet that we are rendering. Make sure if you modify ActiveSheet of this instance to restore it back to the original value before exiting the event.

Syntax

Namespace: FlexCel.Render

public ExcelFile Workbook { get; }

See also

  • NamedRangeExportEventArgs


NamedRangeExportEventArgs.Sheet Property | FlexCel Studio for the .NET Framework documentation

NamedRangeExportEventArgs.Sheet Property

Sheet index (1 based) of the html cell we are exporting.

Syntax

Namespace: FlexCel.Render

public Int32 Sheet { get; }

See also

  • NamedRangeExportEventArgs


NamedRangeExportEventArgs.Row Property | FlexCel Studio for the .NET Framework documentation

NamedRangeExportEventArgs.Row Property

Row index (1 based) of the html cell we are exporting. This number should be the same as the first row in the NamedRange.

Syntax

Namespace: FlexCel.Render

public Int32 Row { get; }

See also

  • NamedRangeExportEventArgs


NamedRangeExportEventArgs.Col Property | FlexCel Studio for the .NET Framework documentation

NamedRangeExportEventArgs.Col Property

Column index (1 based) of the html cell we are exporting. This number should be the same as the first column in the NamedRange.

Syntax

Namespace: FlexCel.Render

public Int32 Col { get; }

See also

  • NamedRangeExportEventArgs


NamedRangeExportEventArgs.NamedRange Property | FlexCel Studio for the .NET Framework documentation

NamedRangeExportEventArgs.NamedRange Property

Named range that is being exported.

Syntax

Namespace: FlexCel.Render

public TXlsNamedRange NamedRange { get; }

See also

  • NamedRangeExportEventArgs


NamedRangeExportEventArgs.NameId Property | FlexCel Studio for the .NET Framework documentation

NamedRangeExportEventArgs.NameId Property

This property is by default the same as NamedRange.Name. If you want to change the id of the span that will be exported to HTML, change it to the new value. To not export this name, set it to null.

Syntax

Namespace: FlexCel.Render

public String NameId { get; set; }

See also

  • NamedRangeExportEventArgs


PageEventArgs Class | FlexCel Studio for the .NET Framework documentation

PageEventArgs Class

Arguments passed on FlexCelPdfExport.BeforeGeneratePage, FlexCelPdfExport.BeforeNewPage and FlexCelPdfExport.AfterGeneratePage

Syntax

Namespace: FlexCel.Render

public class PageEventArgs: EventArgs

Constructors

Name | Description
PageEventArgs | Creates a new Argument.

Properties

Name | Description
PdfExport | The FlexCelPdfExport component doing the export.
Workbook | ExcelFile we are exporting. Note that this might be a light clone of the workbook assigned to the FlexCelPdfExport component, so it might be different.
File | The file with the pdf data.
CurrentPage | Page currently printing.
CurrentPageInSheet | Page currently printing on the sheet printing.
CurrentSheet | Sheet that is currently being printed.


PageEventArgs.PageEventArgs Constructor | FlexCel Studio for the .NET Framework documentation

PageEventArgs.PageEventArgs Constructor

Creates a new Argument.

Syntax

Namespace: FlexCel.Render

public PageEventArgs(FlexCelPdfExport aPdfExport, ExcelFile aWorkbook, Int32 aCurrentSheet, PdfWriter aPdfWriter, Int32 aCurrentPage, Int32 aCurrentPageInSheet)

Parameters

<-> | Parameter | Type | Description
 | aPdfExport | FlexCelPdfExport | The PdfExport component which is doing the export.
 | aWorkbook | ExcelFile | Excel file that is being exported.
 | aCurrentSheet | Int32 | Sheet that we are currently exporting.
 | aPdfWriter | PdfWriter | The file we are processing.
 | aCurrentPage | Int32 | The page that is being generated.
 | aCurrentPageInSheet | Int32 | The page in the current sheet that is being generated.

See also

  • PageEventArgs


PageEventArgs.PdfExport Property | FlexCel Studio for the .NET Framework documentation

PageEventArgs.PdfExport Property

The FlexCelPdfExport component doing the export.

Syntax

Namespace: FlexCel.Render

public FlexCelPdfExport PdfExport { get; }

See also

  • PageEventArgs


PageEventArgs.Workbook Property | FlexCel Studio for the .NET Framework documentation

PageEventArgs.Workbook Property

ExcelFile we are exporting. Note that this might be a light clone of the workbook assigned to the FlexCelPdfExport component, so it might be different.

Syntax

Namespace: FlexCel.Render

public ExcelFile Workbook { get; }

See also

  • PageEventArgs


PageEventArgs.File Property | FlexCel Studio for the .NET Framework documentation

PageEventArgs.File Property

The file with the pdf data.

Syntax

Namespace: FlexCel.Render

public PdfWriter File { get; }

See also

  • PageEventArgs


PageEventArgs.CurrentPage Property | FlexCel Studio for the .NET Framework documentation

PageEventArgs.CurrentPage Property

Page currently printing.

Syntax

Namespace: FlexCel.Render

public Int32 CurrentPage { get; }

See also

  • PageEventArgs


PageEventArgs.CurrentPageInSheet Property | FlexCel Studio for the .NET Framework documentation

PageEventArgs.CurrentPageInSheet Property

Page currently printing on the sheet printing.

Syntax

Namespace: FlexCel.Render

public Int32 CurrentPageInSheet { get; }

See also

  • PageEventArgs


PageEventArgs.CurrentSheet Property | FlexCel Studio for the .NET Framework documentation

PageEventArgs.CurrentSheet Property

Sheet that is currently being printed.

Syntax

Namespace: FlexCel.Render

public Int32 CurrentSheet { get; }

See also

  • PageEventArgs


PrintHardMarginsEventArgs Class | FlexCel Studio for the .NET Framework documentation

PrintHardMarginsEventArgs Class

Arguments passed on FlexCelPrintDocument.GetPrinterHardMargins.

Syntax

Namespace: FlexCel.Render

public class PrintHardMarginsEventArgs: EventArgs

Constructors

Name | Description
PrintHardMargins​Event​Args | Creates a new Argument.

Properties

Name | Description
XMargin | The X printer physical margin in inches / 100.
YMargin | The Y printer physical margin in inches / 100.
Graphics | Graphics context you can use to call GetHdc()


PrintHardMarginsEventArgs.PrintHardMarginsEventArgs Constructor | FlexCel Studio for the .NET Framework documentation

PrintHardMarginsEventArgs.PrintHardMarginsEventArgs Constructor

Creates a new Argument.

Syntax

Namespace: FlexCel.Render

public PrintHardMarginsEventArgs(Graphics aGraphics, Double aXMargin, Double aYMargin)

Parameters

<-> | Parameter | Type | Description
 | aGraphics | Graphics |
 | aXMargin | Double |
 | aYMargin | Double |

See also

  • PrintHardMarginsEventArgs


PrintHardMarginsEventArgs.XMargin Property | FlexCel Studio for the .NET Framework documentation

PrintHardMarginsEventArgs.XMargin Property

The X printer physical margin in inches / 100.

Syntax

Namespace: FlexCel.Render

public Double XMargin { get; set; }

See also

  • PrintHardMarginsEventArgs


PrintHardMarginsEventArgs.YMargin Property | FlexCel Studio for the .NET Framework documentation

PrintHardMarginsEventArgs.YMargin Property

The Y printer physical margin in inches / 100.

Syntax

Namespace: FlexCel.Render

public Double YMargin { get; set; }

See also

  • PrintHardMarginsEventArgs


PrintHardMarginsEventArgs.Graphics Property | FlexCel Studio for the .NET Framework documentation

PrintHardMarginsEventArgs.Graphics Property

Graphics context you can use to call GetHdc()

Syntax

Namespace: FlexCel.Render

public Graphics Graphics { get; set; }

See also

  • PrintHardMarginsEventArgs


SaveImageEventArgs Class | FlexCel Studio for the .NET Framework documentation

SaveImageEventArgs Class

Arguments passed on FlexCelHtmlExport.OnSaveImage,

Syntax

Namespace: FlexCel.Render

public class SaveImageEventArgs: EventArgs

Constructors

Name | Description
SaveImageEventArgs | Creates a new Argument.

Properties

Name | Description
Workbook | ExcelFile with the image, positioned in the sheet that we are rendering. Make sure if you modify ActiveSheet of this instance to restore it back to the original value before exiting the event.
ObjectIndex | Object index of the object being rendered. You can use xls.​Get​Object(​object​Index) to get the object properties. If the image is not an object (for example it is a rotated text) this property will be -1.
ShapeProps | Shape properties of the object being rendered. You can use them to get the name of the object, its size, etc. If the image is not an object (for example it is a rotated text) this property will be null.
ImageFile | The file where the image is expected to be saved.
ImageLink | The link that will be inserted in the html file.
AlternateText | Alternate text for the image, to show in the "ALT" tag when a browser cannot display images. By default this is set to the text in the box "Alternative Text" in the web tab on the image properties. If no Alternative text is supplied in the file, the image name will be used here.
SavedImageFormat | File format in which the image is.
ImageToSave | Image that will be saved. You can use it to save it yourself. Note that when saving as SVG, this will be null.
Processed | Set this property to true if you have taken care of saving the image, and FlexCel does not need to save it. If you just used this event to get information on the image being saved, but would like to keep the normal flux, set it to false.


SaveImageEventArgs.SaveImageEventArgs Constructor | FlexCel Studio for the .NET Framework documentation

SaveImageEventArgs.SaveImageEventArgs Constructor

Creates a new Argument.

Syntax

Namespace: FlexCel.Render

public SaveImageEventArgs(ExcelFile aWorkbook, Int32 aObjectIndex, TShapeProperties aShapeProps, String aImageFile, String aImageLink, String aAlternateText, THtmlImageFormat aSavedImageFormat, TUIImage aImageToSave)

Parameters

<-> | Parameter | Type | Description
 | aWorkbook | ExcelFile | See Workbook
 | aObjectIndex | Int32 | See ObjectIndex
 | aShapeProps | TShapeProperties | See ShapeProps
 | aImageFile | String | See ImageFile
 | aImageLink | String | See ImageLink
 | aAlternateText | String | See AlternateText
 | aSavedImageFormat | THtmlImageFormat | See SavedImageFormat
 | aImageToSave | TUIImage | See ImageToSave

See also

  • SaveImageEventArgs


SaveImageEventArgs.Workbook Property | FlexCel Studio for the .NET Framework documentation

SaveImageEventArgs.Workbook Property

ExcelFile with the image, positioned in the sheet that we are rendering. Make sure if you modify ActiveSheet of this instance to restore it back to the original value before exiting the event.

Syntax

Namespace: FlexCel.Render

public ExcelFile Workbook { get; }

See also

  • SaveImageEventArgs


SaveImageEventArgs.ObjectIndex Property | FlexCel Studio for the .NET Framework documentation

SaveImageEventArgs.ObjectIndex Property

Object index of the object being rendered. You can use xls.GetObject(objectIndex) to get the object properties. If the image is not an object (for example it is a rotated text) this property will be -1.

Syntax

Namespace: FlexCel.Render

public Int32 ObjectIndex { get; }

See also

  • SaveImageEventArgs


SaveImageEventArgs.ShapeProps Property | FlexCel Studio for the .NET Framework documentation

SaveImageEventArgs.ShapeProps Property

Shape properties of the object being rendered. You can use them to get the name of the object, its size, etc. If the image is not an object (for example it is a rotated text) this property will be null.

Syntax

Namespace: FlexCel.Render

public TShapeProperties ShapeProps { get; }

See also

  • SaveImageEventArgs


SaveImageEventArgs.ImageFile Property | FlexCel Studio for the .NET Framework documentation

SaveImageEventArgs.ImageFile Property

The file where the image is expected to be saved.

Syntax

Namespace: FlexCel.Render

public String ImageFile { get; }

See also

  • SaveImageEventArgs


SaveImageEventArgs.ImageLink Property | FlexCel Studio for the .NET Framework documentation

SaveImageEventArgs.ImageLink Property

The link that will be inserted in the html file.

Syntax

Namespace: FlexCel.Render

public String ImageLink { get; }

See also

  • SaveImageEventArgs


SaveImageEventArgs.AlternateText Property | FlexCel Studio for the .NET Framework documentation

SaveImageEventArgs.AlternateText Property

Alternate text for the image, to show in the "ALT" tag when a browser cannot display images. By default this is set to the text in the box "Alternative Text" in the web tab on the image properties. If no Alternative text is supplied in the file, the image name will be used here.

Syntax

Namespace: FlexCel.Render

public String AlternateText { get; }

See also

  • SaveImageEventArgs


SaveImageEventArgs.SavedImageFormat Property | FlexCel Studio for the .NET Framework documentation

SaveImageEventArgs.SavedImageFormat Property

File format in which the image is.

Syntax

Namespace: FlexCel.Render

public THtmlImageFormat SavedImageFormat { get; }

See also

  • SaveImageEventArgs


SaveImageEventArgs.ImageToSave Property | FlexCel Studio for the .NET Framework documentation

SaveImageEventArgs.ImageToSave Property

Image that will be saved. You can use it to save it yourself. Note that when saving as SVG, this will be null.

Syntax

Namespace: FlexCel.Render

public TUIImage ImageToSave { get; }

See also

  • SaveImageEventArgs


SaveImageEventArgs.Processed Property | FlexCel Studio for the .NET Framework documentation

SaveImageEventArgs.Processed Property

Set this property to true if you have taken care of saving the image, and FlexCel does not need to save it. If you just used this event to get information on the image being saved, but would like to keep the normal flux, set it to false.

Syntax

Namespace: FlexCel.Render

public Boolean Processed { get; set; }

See also

  • SaveImageEventArgs


SheetSelectorEntryEventArgs Class | FlexCel Studio for the .NET Framework documentation

SheetSelectorEntryEventArgs Class

Arguments passed on FlexCel.Render.TStandardSheetSelector.OnSheetSelectorEntry.

Syntax

Namespace: FlexCel.Render

public class SheetSelectorEntryEventArgs: EventArgs

Constructors

Name | Description
SheetSelector​Entry​Event​Args | Creates a new Argument.

Properties

Name | Description
Workbook | ExcelFile we are drawing the sheet selector in, positioned in the sheet that we are rendering. Make sure if you modify ActiveSheet of this instance to restore it back to the original value before exiting the event.
ActiveSheet | Sheet index of the entry. This is equivalent to Workbook.ActiveSheet
RenderingSheet | Sheet we are currently rendering. You can compare if (RenderingSheet == ActiveSheet) to highlight the active sheet when drawing the selector.
Link | Place where this entry should link to.
EntryText | Text that will be written in this cell of the selector.
LinkNeedsEscaping | If true (the default) the link you provide in Link is not escaped and will be escaped by FlexCel. So for example, the link "http://my site" will be escaped to "http:​//​my%​20site"​.​ If the link you provided was already escaped, then set this variable to false.


SheetSelectorEntryEventArgs.SheetSelectorEntryEventArgs Constructor | FlexCel Studio for the .NET Framework documentation

SheetSelectorEntryEventArgs.SheetSelectorEntryEventArgs Constructor

Creates a new Argument.

Syntax

Namespace: FlexCel.Render

public SheetSelectorEntryEventArgs(ExcelFile aWorkbook, Int32 aActiveSheet, Int32 aRenderingSheet, String aLink, String aEntryText)

Parameters

<-> | Parameter | Type | Description
 | aWorkbook | ExcelFile | See Workbook
 | aActiveSheet | Int32 | See ActiveSheet
 | aRenderingSheet | Int32 | See RenderingSheet
 | aLink | String | See Link
 | aEntryText | String | See EntryText

See also

  • SheetSelectorEntryEventArgs


SheetSelectorEntryEventArgs.Workbook Property | FlexCel Studio for the .NET Framework documentation

SheetSelectorEntryEventArgs.Workbook Property

ExcelFile we are drawing the sheet selector in, positioned in the sheet that we are rendering. Make sure if you modify ActiveSheet of this instance to restore it back to the original value before exiting the event.

Syntax

Namespace: FlexCel.Render

public ExcelFile Workbook { get; }

See also

  • SheetSelectorEntryEventArgs


SheetSelectorEntryEventArgs.ActiveSheet Property | FlexCel Studio for the .NET Framework documentation

SheetSelectorEntryEventArgs.ActiveSheet Property

Sheet index of the entry. This is equivalent to Workbook.ActiveSheet

Syntax

Namespace: FlexCel.Render

public Int32 ActiveSheet { get; }

See also

  • SheetSelectorEntryEventArgs


SheetSelectorEntryEventArgs.RenderingSheet Property | FlexCel Studio for the .NET Framework documentation

SheetSelectorEntryEventArgs.RenderingSheet Property

Sheet we are currently rendering. You can compare if (RenderingSheet == ActiveSheet) to highlight the active sheet when drawing the selector.

Syntax

Namespace: FlexCel.Render

public Int32 RenderingSheet { get; }

See also

  • SheetSelectorEntryEventArgs


SheetSelectorEntryEventArgs.Link Property | FlexCel Studio for the .NET Framework documentation

SheetSelectorEntryEventArgs.Link Property

Place where this entry should link to.

Syntax

Namespace: FlexCel.Render

public String Link { get; set; }

See also

  • SheetSelectorEntryEventArgs


SheetSelectorEntryEventArgs.EntryText Property | FlexCel Studio for the .NET Framework documentation

SheetSelectorEntryEventArgs.EntryText Property

Text that will be written in this cell of the selector.

Syntax

Namespace: FlexCel.Render

public String EntryText { get; set; }

See also

  • SheetSelectorEntryEventArgs


SheetSelectorEntryEventArgs.LinkNeedsEscaping Property | FlexCel Studio for the .NET Framework documentation

SheetSelectorEntryEventArgs.LinkNeedsEscaping Property

If true (the default) the link you provide in Link is not escaped and will be escaped by FlexCel. So for example, the link "http://my site" will be escaped to "http://my%20site". If the link you provided was already escaped, then set this variable to false.

Syntax

Namespace: FlexCel.Render

public Boolean LinkNeedsEscaping { get; set; }

See also

  • SheetSelectorEntryEventArgs


SVGExportParameters Class | FlexCel Studio for the .NET Framework documentation

SVGExportParameters Class

Parameters used when exporting to SVG.

Syntax

Namespace: FlexCel.Render

public class SVGExportParameters

Properties

Name | Description
Workbook | Excel file that we are exporting. Note that this is a LightClone() of the original ExcelFile that was passed to the export, and might have a different active sheet. If you need to access the file from the export action, use this parameter and not the original ExcelFile.
PageNumber | Page number we are currently exporting.
SheetPageNumber | Page number in the sheet we are exporting. Different from PageNumber, this value is local to the current sheet, and it is reset every time we export a different sheet. If you are exporting a single sheet (​FlexCel​SVGExport.​All​Visible​Sheets is false), then this variable will have the same value as PageNumber
TotalPages | Total number of pages to export.
TotalPagesInSheet | Number of pages in the sheet we are exporting. Different from TotalPages, this value is local to the current sheet, and it is reset every time we export a different sheet. If you are exporting a single sheet (​FlexCel​SVGExport.​All​Visible​Sheets is false), then this variable will have the same value as TotalPages
FileStream | Stream where the image will be saved. If you leave it null, the image won't be saved to a stream.
FileName | Filename where the image will be saved. If you leave it null or empty, the image won't be saved to a file.
Canceled | Set this property to true to cancel the export process.
Title | Title to be saved with the image. If null or empty, the svg image will have no title tag.
Description | Description to be saved with the image. If null or empty, the svg image will have no description tag.
ExtraSVGAttributes | Extra attributes that will be added to the <svg> definition. Keep it null to not add any extra attribute.


SVGExportParameters.Workbook Property | FlexCel Studio for the .NET Framework documentation

SVGExportParameters.Workbook Property

Excel file that we are exporting. Note that this is a LightClone() of the original ExcelFile that was passed to the export, and might have a different active sheet. If you need to access the file from the export action, use this parameter and not the original ExcelFile.

Syntax

Namespace: FlexCel.Render

public ExcelFile Workbook { get; }

See also

  • SVGExportParameters


SVGExportParameters.PageNumber Property | FlexCel Studio for the .NET Framework documentation

SVGExportParameters.PageNumber Property

Page number we are currently exporting.

Syntax

Namespace: FlexCel.Render

public Int32 PageNumber { get; }

See also

  • SVGExportParameters


SVGExportParameters.SheetPageNumber Property | FlexCel Studio for the .NET Framework documentation

SVGExportParameters.SheetPageNumber Property

Page number in the sheet we are exporting. Different from PageNumber, this value is local to the current sheet, and it is reset every time we export a different sheet. If you are exporting a single sheet (FlexCelSVGExport.AllVisibleSheets is false), then this variable will have the same value as PageNumber

Syntax

Namespace: FlexCel.Render

public Int32 SheetPageNumber { get; }

See also

  • SVGExportParameters


SVGExportParameters.TotalPages Property | FlexCel Studio for the .NET Framework documentation

SVGExportParameters.TotalPages Property

Total number of pages to export.

Syntax

Namespace: FlexCel.Render

public Int32 TotalPages { get; }

See also

  • SVGExportParameters


SVGExportParameters.TotalPagesInSheet Property | FlexCel Studio for the .NET Framework documentation

SVGExportParameters.TotalPagesInSheet Property

Number of pages in the sheet we are exporting. Different from TotalPages, this value is local to the current sheet, and it is reset every time we export a different sheet. If you are exporting a single sheet (FlexCelSVGExport.AllVisibleSheets is false), then this variable will have the same value as TotalPages

Syntax

Namespace: FlexCel.Render

public Int32 TotalPagesInSheet { get; }

See also

  • SVGExportParameters


SVGExportParameters.FileStream Property | FlexCel Studio for the .NET Framework documentation

SVGExportParameters.FileStream Property

Stream where the image will be saved. If you leave it null, the image won't be saved to a stream.

Syntax

Namespace: FlexCel.Render

public Stream FileStream { get; set; }

See also

  • SVGExportParameters


SVGExportParameters.FileName Property | FlexCel Studio for the .NET Framework documentation

SVGExportParameters.FileName Property

Filename where the image will be saved. If you leave it null or empty, the image won't be saved to a file.

Syntax

Namespace: FlexCel.Render

public String FileName { get; set; }

See also

  • SVGExportParameters


SVGExportParameters.Canceled Property | FlexCel Studio for the .NET Framework documentation

SVGExportParameters.Canceled Property

Set this property to true to cancel the export process.

Syntax

Namespace: FlexCel.Render

public Boolean Canceled { get; set; }

See also

  • SVGExportParameters


SVGExportParameters.Title Property | FlexCel Studio for the .NET Framework documentation

SVGExportParameters.Title Property

Title to be saved with the image. If null or empty, the svg image will have no title tag.

Syntax

Namespace: FlexCel.Render

public String Title { get; set; }

See also

  • SVGExportParameters


SVGExportParameters.Description Property | FlexCel Studio for the .NET Framework documentation

SVGExportParameters.Description Property

Description to be saved with the image. If null or empty, the svg image will have no description tag.

Syntax

Namespace: FlexCel.Render

public String Description { get; set; }

See also

  • SVGExportParameters


SVGExportParameters.ExtraSVGAttributes Property | FlexCel Studio for the .NET Framework documentation

SVGExportParameters.ExtraSVGAttributes Property

Extra attributes that will be added to the <svg> definition. Keep it null to not add any extra attribute.

Syntax

Namespace: FlexCel.Render

public IEnumerable<TSVGAttribute> ExtraSVGAttributes { get; set; }

See also

  • SVGExportParameters


TCssInformation Class | FlexCel Studio for the .NET Framework documentation

TCssInformation Class

Encapsulates the information needed to create external CSS files. Note that if you use the same TCssInformation instance to create different html files, the CSS file created will be only one.

Syntax

Namespace: FlexCel.Render

public class TCssInformation

Constructors

Name Description
TCssInformation Overloaded
 TCssInformation(TextWriter, String)
TCssInformation(TextWriter, String, Boolean)

Properties

Name | Description
Data | HtmlTextWriter where an external CSS file will be stored. If null, no CSS file will be created. A link to a CSS file might be still included if you set the Url to a non null value.
Url | URL of the css file that will be linked to this file. If null, no CSS file will be created and all CSS information will be stored inside the html file.
UrlNeedsEscaping | If true (the default) the link you provide in Url is not escaped and will be escaped by FlexCel. So for example, the link "http://my site" will be escaped to "http:​//​my%​20site"​.​ If the link you provided was already escaped, then set this variable to false.


TCssInformation.TCssInformation Constructor | FlexCel Studio for the .NET Framework documentation

TCssInformation.TCssInformation Constructor

Overloads

  • TCssInformation.TCssInformation(TextWriter, String)
  • TCssInformation.TCssInformation(TextWriter, String, Boolean)

TCssInformation.TCssInformation(TextWriter, String)

Creates a new instance of TCssInformation.

Syntax

Namespace: FlexCel.Render

public TCssInformation(TextWriter aData, String aUrl)

Parameters

<-> | Parameter | Type | Description
 | aData | TextWriter | HtmlTextWriter where an external CSS file will be stored. If null, no CSS file will be created. A link to a CSS file might be still included if you set the Url to a non null value.
 | aUrl | String | URL of the css file that will be linked to this file. If null, all css information will be stored inside the html file.

See also

  • TCssInformation

TCssInformation.TCssInformation(TextWriter, String, Boolean)

Creates a new instance of TCssInformation.

Syntax

Namespace: FlexCel.Render

public TCssInformation(TextWriter aData, String aUrl, Boolean aUrlNeedsEscaping)

Parameters

<-> | Parameter | Type | Description
 | aData | TextWriter | HtmlTextWriter where an external CSS file will be stored. If null, no CSS file will be created. A link to a CSS file might be still included if you set the Url to a non null value.
 | aUrl | String | URL of the css file that will be linked to this file. If null, all css information will be stored inside the html file.
 | aUrlNeedsEscaping | Boolean | If true the link you provide in aUrl is not escaped and will be escaped by FlexCel.

See also

  • TCssInformation


TCssInformation.Data Property | FlexCel Studio for the .NET Framework documentation

TCssInformation.Data Property

HtmlTextWriter where an external CSS file will be stored. If null, no CSS file will be created. A link to a CSS file might be still included if you set the Url to a non null value.

Syntax

Namespace: FlexCel.Render

public TextWriter Data { get; }

See also

  • TCssInformation


TCssInformation.Url Property | FlexCel Studio for the .NET Framework documentation

TCssInformation.Url Property

URL of the css file that will be linked to this file. If null, no CSS file will be created and all CSS information will be stored inside the html file.

Syntax

Namespace: FlexCel.Render

public String Url { get; }

See also

  • TCssInformation


TCssInformation.UrlNeedsEscaping Property | FlexCel Studio for the .NET Framework documentation

TCssInformation.UrlNeedsEscaping Property

If true (the default) the link you provide in Url is not escaped and will be escaped by FlexCel. So for example, the link "http://my site" will be escaped to "http://my%20site". If the link you provided was already escaped, then set this variable to false.

Syntax

Namespace: FlexCel.Render

public Boolean UrlNeedsEscaping { get; }

See also

  • TCssInformation


TGeneratedFiles Class | FlexCel Studio for the .NET Framework documentation

TGeneratedFiles Class

An object containing all the files generated in the export.

Syntax

Namespace: FlexCel.Render

public class TGeneratedFiles

Methods

Name | Description
GetHtmlFiles | Name of the html files generated.
GetImageFiles | Name of the image files generated.
GetCssFiles | Name of the css files generated.
Clear | Clears all the files in the object.


TGeneratedFiles.GetHtmlFiles Method | FlexCel Studio for the .NET Framework documentation

TGeneratedFiles.GetHtmlFiles Method

Name of the html files generated.

Syntax

Namespace: FlexCel.Render

public String[] GetHtmlFiles()

See also

  • TGeneratedFiles


TGeneratedFiles.GetImageFiles Method | FlexCel Studio for the .NET Framework documentation

TGeneratedFiles.GetImageFiles Method

Name of the image files generated.

Syntax

Namespace: FlexCel.Render

public String[] GetImageFiles()

See also

  • TGeneratedFiles


TGeneratedFiles.GetCssFiles Method | FlexCel Studio for the .NET Framework documentation

TGeneratedFiles.GetCssFiles Method

Name of the css files generated.

Syntax

Namespace: FlexCel.Render

public String[] GetCssFiles()

See also

  • TGeneratedFiles


TGeneratedFiles.Clear Method | FlexCel Studio for the .NET Framework documentation

TGeneratedFiles.Clear Method

Clears all the files in the object.

Syntax

Namespace: FlexCel.Render

public void Clear()

See also

  • TGeneratedFiles


THtmlExtraInfo Class | FlexCel Studio for the .NET Framework documentation

THtmlExtraInfo Class

Stores extra data to write in the HTML file.

Syntax

Namespace: FlexCel.Render

public class THtmlExtraInfo

Properties

Name | Description
Title | Title of the HTML file. If left null, the title of the page will be used.
Meta | Extra strings to be added in the meta section of the header. You could specify keywords here, for example.
HeadStart | Extra strings to be added after the opening <head> tag.
HeadEnd | Extra strings to be added before the closing </head> tag.
BodyStart | Extra strings to be added after the opening <body> tag and before the table data.
BodyEnd | Extra strings to be added before the closing </body> tag and after the table data.
PrintAreaSeparator | Extra strings to be added after each section of a non-contiguous print area has been exported. Note that normally print areas are square, and in that case this property has no effect. This property only works when the print area has more than one section.


THtmlExtraInfo.Title Property | FlexCel Studio for the .NET Framework documentation

THtmlExtraInfo.Title Property

Title of the HTML file. If left null, the title of the page will be used.

Syntax

Namespace: FlexCel.Render

public String Title { get; set; }

See also

  • THtmlExtraInfo


THtmlExtraInfo.Meta Property | FlexCel Studio for the .NET Framework documentation

THtmlExtraInfo.Meta Property

Extra strings to be added in the meta section of the header. You could specify keywords here, for example.

Syntax

Namespace: FlexCel.Render

public String[] Meta { get; set; }

See also

  • THtmlExtraInfo


THtmlExtraInfo.HeadStart Property | FlexCel Studio for the .NET Framework documentation

THtmlExtraInfo.HeadStart Property

Extra strings to be added after the opening <head> tag.

Syntax

Namespace: FlexCel.Render

public String[] HeadStart { get; set; }

See also

  • THtmlExtraInfo


THtmlExtraInfo.HeadEnd Property | FlexCel Studio for the .NET Framework documentation

THtmlExtraInfo.HeadEnd Property

Extra strings to be added before the closing </head> tag.

Syntax

Namespace: FlexCel.Render

public String[] HeadEnd { get; set; }

See also

  • THtmlExtraInfo


THtmlExtraInfo.BodyStart Property | FlexCel Studio for the .NET Framework documentation

THtmlExtraInfo.BodyStart Property

Extra strings to be added after the opening <body> tag and before the table data.

Syntax

Namespace: FlexCel.Render

public String[] BodyStart { get; set; }

See also

  • THtmlExtraInfo


THtmlExtraInfo.BodyEnd Property | FlexCel Studio for the .NET Framework documentation

THtmlExtraInfo.BodyEnd Property

Extra strings to be added before the closing </body> tag and after the table data.

Syntax

Namespace: FlexCel.Render

public String[] BodyEnd { get; set; }

See also

  • THtmlExtraInfo


THtmlExtraInfo.PrintAreaSeparator Property | FlexCel Studio for the .NET Framework documentation

THtmlExtraInfo.PrintAreaSeparator Property

Extra strings to be added after each section of a non-contiguous print area has been exported. Note that normally print areas are square, and in that case this property has no effect. This property only works when the print area has more than one section.

Syntax

Namespace: FlexCel.Render

public String[] PrintAreaSeparator { get; set; }

See also

  • THtmlExtraInfo


TImgExportInfo Class | FlexCel Studio for the .NET Framework documentation

TImgExportInfo Class

Holds information needed to export the pages, so it is only calculated once.

Syntax

Namespace: FlexCel.Render

public class TImgExportInfo

Constructors

Name | Description
TImgExportInfo | Creates a new TImgExportInfo. You shouldn't need to create instances of this directly.

Methods

Name | Description
Sheet | Returns the Image export info for one of the sheets.
TotalLogicalPages | Returns the total count of pages if ResetPageNumber​OnEach​Sheet is false, or the page count for the current sheet if true.
Clone | Returns a deep copy of a TImgExportInfo. This method will work even if the source object is null.

Properties

Name | Description
SheetCount | Return the count of the sheets on the workbook.
CurrentSheet | Sheet that is being printed.
NextSheet | Sheet of the next page to print.
CurrentPage | Last page printed.
TotalPages | Total pages to print for all the sheets.
ActiveSheet | TImageInfo for the active sheet.


TImgExportInfo.TImgExportInfo Constructor | FlexCel Studio for the .NET Framework documentation

TImgExportInfo.TImgExportInfo Constructor

Creates a new TImgExportInfo. You shouldn't need to create instances of this directly.

Syntax

Namespace: FlexCel.Render

public TImgExportInfo()

See also

  • TImgExportInfo


TImgExportInfo.Sheet Method | FlexCel Studio for the .NET Framework documentation

TImgExportInfo.Sheet Method

Returns the Image export info for one of the sheets.

Syntax

Namespace: FlexCel.Render

public TOneImgExportInfo Sheet(Int32 index)

Parameters

<-> | Parameter | Type | Description
 | index | Int32 | Sheet on the list (1 based).

See also

  • TImgExportInfo


TImgExportInfo.TotalLogicalPages Method | FlexCel Studio for the .NET Framework documentation

TImgExportInfo.TotalLogicalPages Method

Returns the total count of pages if ResetPageNumberOnEachSheet is false, or the page count for the current sheet if true.

Syntax

Namespace: FlexCel.Render

public Int32 TotalLogicalPages(Boolean ResetPageNumberOnEachSheet)

Parameters

<-> | Parameter | Type | Description
 | ResetPageNumberOnEachSheet | Boolean |

See also

  • TImgExportInfo


TImgExportInfo.Clone Method | FlexCel Studio for the .NET Framework documentation

TImgExportInfo.Clone Method

Returns a deep copy of a TImgExportInfo. This method will work even if the source object is null.

Syntax

Namespace: FlexCel.Render

public static TImgExportInfo Clone(TImgExportInfo source)

Parameters

<-> | Parameter | Type | Description
 | source | TImgExportInfo |

See also

  • TImgExportInfo


TImgExportInfo.SheetCount Property | FlexCel Studio for the .NET Framework documentation

TImgExportInfo.SheetCount Property

Return the count of the sheets on the workbook.

Syntax

Namespace: FlexCel.Render

public Int32 SheetCount { get; }

See also

  • TImgExportInfo


TImgExportInfo.CurrentSheet Property | FlexCel Studio for the .NET Framework documentation

TImgExportInfo.CurrentSheet Property

Sheet that is being printed.

Syntax

Namespace: FlexCel.Render

public Int32 CurrentSheet { get; set; }

See also

  • TImgExportInfo


TImgExportInfo.NextSheet Property | FlexCel Studio for the .NET Framework documentation

TImgExportInfo.NextSheet Property

Sheet of the next page to print.

Syntax

Namespace: FlexCel.Render

public Int32 NextSheet { get; }

See also

  • TImgExportInfo


TImgExportInfo.CurrentPage Property | FlexCel Studio for the .NET Framework documentation

TImgExportInfo.CurrentPage Property

Last page printed.

Syntax

Namespace: FlexCel.Render

public Int32 CurrentPage { get; }

See also

  • TImgExportInfo


TImgExportInfo.TotalPages Property | FlexCel Studio for the .NET Framework documentation

TImgExportInfo.TotalPages Property

Total pages to print for all the sheets.

Syntax

Namespace: FlexCel.Render

public Int32 TotalPages { get; }

See also

  • TImgExportInfo


TImgExportInfo.ActiveSheet Property | FlexCel Studio for the .NET Framework documentation

TImgExportInfo.ActiveSheet Property

TImageInfo for the active sheet.

Syntax

Namespace: FlexCel.Render

public TOneImgExportInfo ActiveSheet { get; }

See also

  • TImgExportInfo


TOneImgExportInfo Class | FlexCel Studio for the .NET Framework documentation

TOneImgExportInfo Class

Holds information needed to export one of the workbook sheets, so it is only calculated once.

Syntax

Namespace: FlexCel.Render

public class TOneImgExportInfo

Methods

Name | Description
Clone | Clones a TImageExportInfo even if it is null.

Properties

Name | Description
TotalPages | Total pages on the ActiveSheet.
CurrentPrintArea | Area that is currently being printed. A print area might consist in many independent areas.
PaintClipRect | Coordinates to print. One per every isolated range in the print area of the sheet.
PagePrintRange | Range that has been printed. Note that before printing, the values here are invalid and you should use PrintRanges
PageBounds | Limits of the page in inches/100.
PrintRanges | Range that will be printed. One per every isolated range in the print area of the sheet.
ZoomUsed | The final zoom that will be used in the sheet after applying print to fit or other factors.
PrintRange | Range that will be printed. When the print area is composed of different non contiguous parts you should use PrintRanges to get all the parts.
CurrentPage | Last page printed on this sheet.


TOneImgExportInfo.Clone Method | FlexCel Studio for the .NET Framework documentation

TOneImgExportInfo.Clone Method

Clones a TImageExportInfo even if it is null.

Syntax

Namespace: FlexCel.Render

public static TOneImgExportInfo Clone(TOneImgExportInfo source)

Parameters

<-> | Parameter | Type | Description
 | source | TOneImgExportInfo |

See also

  • TOneImgExportInfo


TOneImgExportInfo.TotalPages Property | FlexCel Studio for the .NET Framework documentation

TOneImgExportInfo.TotalPages Property

Total pages on the ActiveSheet.

Syntax

Namespace: FlexCel.Render

public Int32 TotalPages { get; }

See also

  • TOneImgExportInfo


TOneImgExportInfo.CurrentPrintArea Property | FlexCel Studio for the .NET Framework documentation

TOneImgExportInfo.CurrentPrintArea Property

Area that is currently being printed. A print area might consist in many independent areas.

Syntax

Namespace: FlexCel.Render

public Int32 CurrentPrintArea { get; }

See also

  • TOneImgExportInfo


TOneImgExportInfo.PaintClipRect Property | FlexCel Studio for the .NET Framework documentation

TOneImgExportInfo.PaintClipRect Property

Coordinates to print. One per every isolated range in the print area of the sheet.

Syntax

Namespace: FlexCel.Render

public TUIRectangle[] PaintClipRect { get; }

See also

  • TOneImgExportInfo


TOneImgExportInfo.PagePrintRange Property | FlexCel Studio for the .NET Framework documentation

TOneImgExportInfo.PagePrintRange Property

Range that has been printed. Note that before printing, the values here are invalid and you should use PrintRanges

Syntax

Namespace: FlexCel.Render

public TXlsCellRange PagePrintRange { get; }

See also

  • TOneImgExportInfo


TOneImgExportInfo.PageBounds Property | FlexCel Studio for the .NET Framework documentation

TOneImgExportInfo.PageBounds Property

Limits of the page in inches/100.

Syntax

Namespace: FlexCel.Render

public TUIRectangle PageBounds { get; }

See also

  • TOneImgExportInfo


TOneImgExportInfo.PrintRanges Property | FlexCel Studio for the .NET Framework documentation

TOneImgExportInfo.PrintRanges Property

Range that will be printed. One per every isolated range in the print area of the sheet.

Syntax

Namespace: FlexCel.Render

public TXlsCellRange[] PrintRanges { get; }

See also

  • TOneImgExportInfo


TOneImgExportInfo.ZoomUsed Property | FlexCel Studio for the .NET Framework documentation

TOneImgExportInfo.ZoomUsed Property

The final zoom that will be used in the sheet after applying print to fit or other factors.

Syntax

Namespace: FlexCel.Render

public Double ZoomUsed { get; }

See also

  • TOneImgExportInfo


TOneImgExportInfo.PrintRange Property | FlexCel Studio for the .NET Framework documentation

TOneImgExportInfo.PrintRange Property

Range that will be printed. When the print area is composed of different non contiguous parts you should use PrintRanges to get all the parts.

Syntax

Namespace: FlexCel.Render

public TXlsCellRange PrintRange { get; }

See also

  • TOneImgExportInfo


TOneImgExportInfo.CurrentPage Property | FlexCel Studio for the .NET Framework documentation

TOneImgExportInfo.CurrentPage Property

Last page printed on this sheet.

Syntax

Namespace: FlexCel.Render

public Int32 CurrentPage { get; }

See also

  • TOneImgExportInfo


TPartialExportState Class | FlexCel Studio for the .NET Framework documentation

TPartialExportState Class

This class is used to save the needed information to partially export a file.

Syntax

Namespace: FlexCel.Render

public class TPartialExportState

Constructors

Name | Description
TPartialExportState | Creates a new instance of TPartialExport​State.​

Methods

Name | Description
SaveCss | Overloaded SaveCss(TextWriter) SaveCss(TextWriter, Boolean)
SaveRelevantHeaders | This method is a middle ground between SaveCss(​​Text​Writer) and SaveFullHeaders. It will output only the headers that you need to add to an existing HTML file in order to include the body in the body part. This means that the tags like <html> are not included.
SaveFullHeaders | This method will output the full HTML headers needed to create an HTML file with the information in this object. If you wish to mix the output of the file with existing headers, you can use SaveRelevantHeaders instead to get only the relevant information to mix in the headers, or SaveCss(​​Text​Writer) to get only the CSS classes that need to be put in the header.
StartBody | Starts writing a body declaration. After calling this method, you should call SaveBody for the parts you want to save, and end up with a call to EndHtmlFile
EndHtmlFile | Writes the "</body>" end tag in the html file and the head/html end tags. It also finalizes the parts when saving to MHTML.
SaveBody | Use this method to output the body information on this object to an HTML page.
GetImage | Returns one of the images for one of the saved sheets.

Properties

Name | Description
BodyCount | Number of parts added to this object.


TPartialExportState.TPartialExportState Constructor | FlexCel Studio for the .NET Framework documentation

TPartialExportState.TPartialExportState Constructor

Creates a new instance of TPartialExportState.

Syntax

Namespace: FlexCel.Render

public TPartialExportState(TextWriter aCssData, String aCssUrl)

Parameters

<-> | Parameter | Type | Description
 | aCssData | TextWriter | TextWriter where an external CSS file will be stored. If null, no CSS file will be created, even when a link to a external file might.
 | aCssUrl | String | URL of the css file that will be linked to this file. If null, all css information will be stored inside the html file.

See also

  • TPartialExportState


TPartialExportState.SaveCss Method | FlexCel Studio for the .NET Framework documentation

TPartialExportState.SaveCss Method

Overloads

  • TPartialExportState.SaveCss(TextWriter)
  • TPartialExportState.SaveCss(TextWriter, Boolean)

TPartialExportState.SaveCss(TextWriter)

Use this method to output the CSS information on this object to the header of an HTML page. If you are using en external StyleSheet, this method will output a link to it, or if you are using an internal one it will output the actual classes. This overload will write the classes inside a <style> tag. To avoid writing the style tags, use the overload SaveCss(TextWriter, Boolean)

Syntax

Namespace: FlexCel.Render

public void SaveCss(TextWriter writer)

Parameters

<-> | Parameter | Type | Description
 | writer | TextWriter | Writer where you are going to write the information.

See also

  • TPartialExportState

TPartialExportState.SaveCss(TextWriter, Boolean)

Use this method to output the CSS information on this object to the header of an HTML page. If you are using en external StyleSheet, this method will output a link to it, or if you are using an internal one it will output the actual classes.

Syntax

Namespace: FlexCel.Render

public void SaveCss(TextWriter writer, Boolean includeStyleDefinition)

Parameters

<-> | Parameter | Type | Description
 | writer | TextWriter | Writer where you are going to write the information.
 | includeStyleDefinition | Boolean | If true, the css classes will be inside a <style> tag. If false, only the actual classes will be written. This parameter has no effect if the StyleSheet is external.

See also

  • TPartialExportState


TPartialExportState.SaveRelevantHeaders Method | FlexCel Studio for the .NET Framework documentation

TPartialExportState.SaveRelevantHeaders Method

This method is a middle ground between SaveCss(TextWriter) and SaveFullHeaders. It will output only the headers that you need to add to an existing HTML file in order to include the body in the body part. This means that the tags like <html> are not included.

Syntax

Namespace: FlexCel.Render

public void SaveRelevantHeaders(TextWriter writer)

Parameters

<-> | Parameter | Type | Description
 | writer | TextWriter |

See also

  • TPartialExportState


TPartialExportState.SaveFullHeaders Method | FlexCel Studio for the .NET Framework documentation

TPartialExportState.SaveFullHeaders Method

This method will output the full HTML headers needed to create an HTML file with the information in this object. If you wish to mix the output of the file with existing headers, you can use SaveRelevantHeaders instead to get only the relevant information to mix in the headers, or SaveCss(TextWriter) to get only the CSS classes that need to be put in the header.

Syntax

Namespace: FlexCel.Render

public void SaveFullHeaders(TextWriter writer, String htmlFileName)

Parameters

<-> | Parameter | Type | Description
 | writer | TextWriter | Writer where you are going to write the information.
 | htmlFileName | String | File name of the file you are generating. There is no need to supply this parameter, it is only to add extra information to the generated file. You can leave it null.

See also

  • TPartialExportState


TPartialExportState.StartBody Method | FlexCel Studio for the .NET Framework documentation

TPartialExportState.StartBody Method

Starts writing a body declaration. After calling this method, you should call SaveBody for the parts you want to save, and end up with a call to EndHtmlFile

Syntax

Namespace: FlexCel.Render

public void StartBody(TextWriter writer)

Parameters

<-> | Parameter | Type | Description
 | writer | TextWriter | TextWriter where we are going to save the results.

See also

  • TPartialExportState


TPartialExportState.EndHtmlFile Method | FlexCel Studio for the .NET Framework documentation

TPartialExportState.EndHtmlFile Method

Writes the "</body>" end tag in the html file and the head/html end tags. It also finalizes the parts when saving to MHTML.

Syntax

Namespace: FlexCel.Render

public void EndHtmlFile(TextWriter writer)

Parameters

<-> | Parameter | Type | Description
 | writer | TextWriter | TextWriter where we are going to save the results.

See also

  • TPartialExportState


TPartialExportState.SaveBody Method | FlexCel Studio for the .NET Framework documentation

TPartialExportState.SaveBody Method

Use this method to output the body information on this object to an HTML page.

Syntax

Namespace: FlexCel.Render

public void SaveBody(TextWriter writer, Int32 index, String relativeImagePath)

Parameters

<-> | Parameter | Type | Description
 | writer | TextWriter | Writer where you are going to write the information.
 | index | Int32 | Index of the part that you wish to write. It must be 1 <= index <= BodyCount
 | relativeImagePath | String | Image path relative to the main file where the images will be saved. Note that this path does not apply to normal images. This is used for example to save the rotated text as images if this option is enabled.

See also

  • TPartialExportState


TPartialExportState.GetImage Method | FlexCel Studio for the .NET Framework documentation

TPartialExportState.GetImage Method

Returns one of the images for one of the saved sheets.

Syntax

Namespace: FlexCel.Render

public TUIImage GetImage(Int32 bodyIndex, Int32 imageIndex)

Parameters

<-> | Parameter | Type | Description
 | bodyIndex | Int32 | Index of the document where you want to retrieve the images. (1 based)
 | imageIndex | Int32 | Image index in the document. (1 based)

See also

  • TPartialExportState


TPartialExportState.BodyCount Property | FlexCel Studio for the .NET Framework documentation

TPartialExportState.BodyCount Property

Number of parts added to this object.

Syntax

Namespace: FlexCel.Render

public Int32 BodyCount { get; }

See also

  • TPartialExportState


TSheetSelector Class | FlexCel Studio for the .NET Framework documentation

TSheetSelector Class

Abstract class to implement a Sheet Selector. Derive from this class for example to implement tabs with images. For a standard implementation using CSS Tabs and divs, use TStandardSheetSelector

Syntax

Namespace: FlexCel.Render

public abstract class TSheetSelector

Constructors

Name | Description
TSheetSelector | Constructs a new TSheetSelector instance.

Methods

Name | Description
GetHtmlSheet​Name​From​Excel | Returns the html sheet name from the Excel sheet name. Returns empty if the sheet doesn't exist.
WriteLn | Use this method to write a line inside the stream when overriding this class.
EncodeAsHtml | This method will encode an string so it is valid html. For example, it will replace "&" by "&amp;" in the text.
AfterDrawOne​Sheet​Selector | Use this method to customize actions to do before the SheetSelector is drawn. In the TStandardSheet​Selector implementation, this method is used to add a table for layout if TStandardSheet​Selector.​Layout​Table is true. Note that this method is called once for each of the possible positions of Reference, even if you do not need to draw a selector in that position. The order in which this method will be called is: Top, Left, Right, Bottom.
BeforeDrawOne​Sheet​Selector | Use this method to customize actions to do after the SheetSelector is drawn. In the TStandardSheet​Selector implementation, this method is used to add a table for layout if TStandardSheet​Selector.​Layout​Table is true. Note that this method is called once for each of the possible positions of Reference, even if you do not need to draw a selector in that position. The order in which this method will be called is: Top, Left, Right, Bottom.
DrawOneSheetSelector | Override this method on a child class if you want to completely customize how the Sheet Selector is drawn. Normally when deriving from TStandardSheet​Selector you can just change the CSS properties of this class to customize the SheetSelector, but you can use this if you want to provide a completely different selector. You can use the Links collection to know which hyperlinks to place in each place. Note that different from BeforeDrawOne​Sheet​Selector ...[more]
WriteCssClasses | This method is in charge of writing the style definitions in the header of the html file. Note that when deriving from TStandardSheet​Selector you normally do not need to override this method, you can just change the CSS properties of this class. You can override this method if you want full control on how to export the classes.

Properties

Name | Description
SheetSelector​Position | An enumerator defining all the positions where the SheetSelector will be drawn.Read it to know where to draw the selector.
Links | A list of links that should go in the sheet selector, one per tab. Use them when creating your own sheet selector to know where to point the link in the tabs to.


TSheetSelector.TSheetSelector Constructor | FlexCel Studio for the .NET Framework documentation

TSheetSelector.TSheetSelector Constructor

Constructs a new TSheetSelector instance.

Syntax

Namespace: FlexCel.Render

protected TSheetSelector(TSheetSelectorPosition position)

Parameters

<-> | Parameter | Type | Description
 | position | TSheetSelector​Position | Position where the Sheet selector will be placed. Remember you can 'or' together many values on the enumeration to for example have a selector at the top and at the bottom.

See also

  • TSheetSelector


TSheetSelector.GetHtmlSheetNameFromExcel Method | FlexCel Studio for the .NET Framework documentation

TSheetSelector.GetHtmlSheetNameFromExcel Method

Returns the html sheet name from the Excel sheet name. Returns empty if the sheet doesn't exist.

Syntax

Namespace: FlexCel.Render

public virtual String GetHtmlSheetNameFromExcel(String excelSheetName)

Parameters

<-> | Parameter | Type | Description
 | excelSheetName | String | Sheet name in Excel.

See also

  • TSheetSelector


TSheetSelector.WriteLn Method | FlexCel Studio for the .NET Framework documentation

TSheetSelector.WriteLn Method

Use this method to write a line inside the stream when overriding this class.

Syntax

Namespace: FlexCel.Render

public void WriteLn(String s)

Parameters

<-> | Parameter | Type | Description
 | s | String |

See also

  • TSheetSelector


TSheetSelector.EncodeAsHtml Method | FlexCel Studio for the .NET Framework documentation

TSheetSelector.EncodeAsHtml Method

This method will encode an string so it is valid html. For example, it will replace "&" by "&amp;" in the text.

Syntax

Namespace: FlexCel.Render

public String EncodeAsHtml(String s)

Parameters

<-> | Parameter | Type | Description
 | s | String | String that you want to encode.

Returns

Encoded string.

See also

  • TSheetSelector


TSheetSelector.AfterDrawOneSheetSelector Method | FlexCel Studio for the .NET Framework documentation

TSheetSelector.AfterDrawOneSheetSelector Method

Use this method to customize actions to do before the SheetSelector is drawn. In the TStandardSheetSelector implementation, this method is used to add a table for layout if TStandardSheetSelector.LayoutTable is true. Note that this method is called once for each of the possible positions of Reference, even if you do not need to draw a selector in that position. The order in which this method will be called is: Top, Left, Right, Bottom.

Syntax

Namespace: FlexCel.Render

public abstract void AfterDrawOneSheetSelector(TSheetSelectorPosition Reference)

Parameters

<-> | Parameter | Type | Description
 | Reference | TSheetSelector​Position | The position of the SheetSelector that is being created. you can use SheetSelectorPosition to know if this is one of the selectors you need to render.

See also

  • TSheetSelector


TSheetSelector.BeforeDrawOneSheetSelector Method | FlexCel Studio for the .NET Framework documentation

TSheetSelector.BeforeDrawOneSheetSelector Method

Use this method to customize actions to do after the SheetSelector is drawn. In the TStandardSheetSelector implementation, this method is used to add a table for layout if TStandardSheetSelector.LayoutTable is true. Note that this method is called once for each of the possible positions of Reference, even if you do not need to draw a selector in that position. The order in which this method will be called is: Top, Left, Right, Bottom.

Syntax

Namespace: FlexCel.Render

public abstract void BeforeDrawOneSheetSelector(TSheetSelectorPosition Reference)

Parameters

<-> | Parameter | Type | Description
 | Reference | TSheetSelector​Position | The position of the SheetSelector that is being created. you can use SheetSelectorPosition to know if this is one of the selectors you need to render.

See also

  • TSheetSelector


TSheetSelector.DrawOneSheetSelector Method | FlexCel Studio for the .NET Framework documentation

TSheetSelector.DrawOneSheetSelector Method

Override this method on a child class if you want to completely customize how the Sheet Selector is drawn. Normally when deriving from TStandardSheetSelector you can just change the CSS properties of this class to customize the SheetSelector, but you can use this if you want to provide a completely different selector. You can use the Links collection to know which hyperlinks to place in each place. Note that different from BeforeDrawOneSheetSelector, this method is only called for the positions where the selector has to be rendered.

Syntax

Namespace: FlexCel.Render

public abstract void DrawOneSheetSelector(ExcelFile xls, TSheetSelectorPosition Position)

Parameters

<-> | Parameter | Type | Description
 | xls | ExcelFile | ExcelFile we are exporting. It is positioned on the sheet we are exporting, but its active sheet can be changed on this method and there is no need to restore it. It will be restored by the framework.
 | Position | TSheetSelector​Position | Position where the sheet selector will be placed. Note that this method will always be called with only one value, but it might be called more than once if constants in the TSheetSelectorPosition enumeration are or'ed together.

See also

  • TSheetSelector


TSheetSelector.WriteCssClasses Method | FlexCel Studio for the .NET Framework documentation

TSheetSelector.WriteCssClasses Method

This method is in charge of writing the style definitions in the header of the html file. Note that when deriving from TStandardSheetSelector you normally do not need to override this method, you can just change the CSS properties of this class. You can override this method if you want full control on how to export the classes.

Syntax

Namespace: FlexCel.Render

public abstract void WriteCssClasses()

See also

  • TSheetSelector


TSheetSelector.SheetSelectorPosition Property | FlexCel Studio for the .NET Framework documentation

TSheetSelector.SheetSelectorPosition Property

An enumerator defining all the positions where the SheetSelector will be drawn.Read it to know where to draw the selector.

Syntax

Namespace: FlexCel.Render

protected TSheetSelectorPosition SheetSelectorPosition { get; }

See also

  • TSheetSelector


TSheetSelector.Links Property | FlexCel Studio for the .NET Framework documentation

TSheetSelector.Links Property

A list of links that should go in the sheet selector, one per tab. Use them when creating your own sheet selector to know where to point the link in the tabs to.

Syntax

Namespace: FlexCel.Render

public IReadOnlyList<TSheetSelectorLink> Links { get; }

See also

  • TSheetSelector


TSheetSelectorLink Class | FlexCel Studio for the .NET Framework documentation

TSheetSelectorLink Class

Holds the sheet name in Excel and in the file.

Syntax

Namespace: FlexCel.Render

public class TSheetSelectorLink

Constructors

Name | Description
TSheetSelectorLink | Creates a new sheet selector link.

Properties

Name | Description
ExcelSheetName | Name of the sheet in the Excel file.
HtmlSheetName | Name of the sheet in the html file.


TSheetSelectorLink.TSheetSelectorLink Constructor | FlexCel Studio for the .NET Framework documentation

TSheetSelectorLink.TSheetSelectorLink Constructor

Creates a new sheet selector link.

Syntax

Namespace: FlexCel.Render

public TSheetSelectorLink(String aExcelSheetName, String aHtmlSheetName)

Parameters

<-> | Parameter | Type | Description
 | aExcelSheetName | String | Name of the sheet in the Excel file.
 | aHtmlSheetName | String | Name of the sheet in the html file.

See also

  • TSheetSelectorLink


TSheetSelectorLink.ExcelSheetName Property | FlexCel Studio for the .NET Framework documentation

TSheetSelectorLink.ExcelSheetName Property

Name of the sheet in the Excel file.

Syntax

Namespace: FlexCel.Render

public String ExcelSheetName { get; }

See also

  • TSheetSelectorLink


TSheetSelectorLink.HtmlSheetName Property | FlexCel Studio for the .NET Framework documentation

TSheetSelectorLink.HtmlSheetName Property

Name of the sheet in the html file.

Syntax

Namespace: FlexCel.Render

public String HtmlSheetName { get; }

See also

  • TSheetSelectorLink


TStandardSheetSelector Class | FlexCel Studio for the .NET Framework documentation

TStandardSheetSelector Class

Implements a standard sheet selector (with CSS tabs) that will allow you to change the page when exporting multiple sheets. You can customize its default behavior by altering the CSS properties, or by inheriting from it and replacing the virtual methods. If you want to create a completely new type of sheet selector, derive it from TSheetSelector instead of this class.

Syntax

Namespace: FlexCel.Render

public class TStandardSheetSelector: TSheetSelector

Constructors

Name | Description
TStandardSheet​Selector | Constructs a new TStandardSheet​Selector instance.

Methods

Name | Description
OnSheetSelectorEntry | Replace this event when creating a custom descendant of TStandardSheet​Selector.​
BeforeDrawOne​Sheet​Selector | This method is overriden to add a table for layout when LayoutTable is true. See the documentation in TSheetSelector.​Before​Draw​OneSheet​Selector for more information on this method.
AfterDrawOne​Sheet​Selector | This method is overridden to add a table for layout when LayoutTable is true. See the documentation in TSheetSelector.​After​Draw​OneSheet​Selector for more information on this method.
DrawOneSheetSelector | This method overrides the abstract parent to provide a CSS implementation for tabs. Override this method on a child class if you want to completely customize how the Sheet Selector is drawn. Normally you can just change the CSS properties of this class to customize the SheetSelector, but you can use this if you want to provide a completely different selector. You can use the TSheetSelector.Links collection to know which hyperlinks to place in each place.
ReplaceMacros | This is an utility method that will replace all the <#...> macros inside a tag by its values. Normally you do not need to call this method, since it is called automatically by WriteOneCssRule
WriteOneCssRule | This method is an utility to write one rule in a TStandarSheet​Selector​Styles class.
WriteOneCssClass | This method is an utility to write all the classes of an TStandardSheet​Selector​Styles class.
WriteCssClasses | This method is in charge of writing the style definitions in the header of the html file. Note that you normally do not need to override this method, you can just change the CSS properties of this class. You can override this method if you want full control on how to export the classes.

Properties

Name | Description
CssGeneral | Style to be applied to the selector. This is a general setting, you can later further customize the style when the selector is at the Left, Top, Right or Bottom with the corresponding CssWhenLeft, CssWhenTop, CssWhenRight and CssWhenBottom properties.
CssWhenLeft | Specific style to be applied to the selector when it goes at the left. This style will override the style you specify with CssGeneral
CssWhenTop | Specific style to be applied to the selector when it goes at the top. This style will override the style you specify with CssGeneral
CssWhenRight | Specific style to be applied to the selector when it goes at the right. This style will override the style you specify with CssGeneral
CssWhenBottom | Specific style to be applied to the selector when it goes at the bottom. This style will override the style you specify with CssGeneral
CssStyleSheetContent | Style to be applied to the sheet content.
CssStyleLayoutTable | Style to be applied to the layout table if LayoutTable is true.
CssTags | This property has a list of Macros that you can use in the CSS definitions. You can reference this value in the CSS properties by using <#variable> For example, you could set a Macro "Mycolor" with CssTags.​Add(​"mycolor"​, "red"); and then define a CssProperty: CssWhenTop.Main = "background-​color:​<​#​mycolor>​"; This method by default contains the following Macros:...[more] You can modify those Macros or add your own definitions here and use them when defining your CSS. ...[more]
LayoutTable | When this property is true (the default), both selectors at the left and at the right will be layed out in a table. This has the advantage that block will not wrap down when resizing the window. But if you would prefer not to use tables for layout, you can turn this property off, and the layout will be pure CSS (and it will wrap down when there is not enough space). If you do not have a selector in the left or the right this property does nothing.
UseSheetTabColors | When true (the default) and the sheets have a tab color defined in Excel, FlexCel will use this color to render the sheet tabs. If false, the default tab color will be used. Note that if the sheets don't have a color defined in Excel, also the default tab color will be used.

Events

Name | Description
SheetSelectorEntry | Use this event to customize the text and link on the individual tabs. The tab style itself must be modified with the CSS properties.


TStandardSheetSelector.TStandardSheetSelector Constructor | FlexCel Studio for the .NET Framework documentation

TStandardSheetSelector.TStandardSheetSelector Constructor

Constructs a new TStandardSheetSelector instance.

Syntax

Namespace: FlexCel.Render

public TStandardSheetSelector(TSheetSelectorPosition position)

Parameters

<-> | Parameter | Type | Description
 | position | TSheetSelector​Position | Position where the Sheet selector will be placed. Remember you can 'or' together many values on the enumeration to for example have a selector at the top and at the bottom.

See also

  • TStandardSheetSelector


TStandardSheetSelector.OnSheetSelectorEntry Method | FlexCel Studio for the .NET Framework documentation

TStandardSheetSelector.OnSheetSelectorEntry Method

Replace this event when creating a custom descendant of TStandardSheetSelector.

Syntax

Namespace: FlexCel.Render

protected virtual void OnSheetSelectorEntry(SheetSelectorEntryEventArgs e)

Parameters

<-> | Parameter | Type | Description
 | e | SheetSelector​Entry​Event​Args |

See also

  • TStandardSheetSelector


TStandardSheetSelector.BeforeDrawOneSheetSelector Method | FlexCel Studio for the .NET Framework documentation

TStandardSheetSelector.BeforeDrawOneSheetSelector Method

This method is overriden to add a table for layout when LayoutTable is true. See the documentation in TSheetSelector.BeforeDrawOneSheetSelector for more information on this method.

Syntax

Namespace: FlexCel.Render

public override void BeforeDrawOneSheetSelector(TSheetSelectorPosition Reference)

Parameters

<-> | Parameter | Type | Description
 | Reference | TSheetSelector​Position |

See also

  • TStandardSheetSelector


TStandardSheetSelector.AfterDrawOneSheetSelector Method | FlexCel Studio for the .NET Framework documentation

TStandardSheetSelector.AfterDrawOneSheetSelector Method

This method is overridden to add a table for layout when LayoutTable is true. See the documentation in TSheetSelector.AfterDrawOneSheetSelector for more information on this method.

Syntax

Namespace: FlexCel.Render

public override void AfterDrawOneSheetSelector(TSheetSelectorPosition Reference)

Parameters

<-> | Parameter | Type | Description
 | Reference | TSheetSelector​Position |

See also

  • TStandardSheetSelector


TStandardSheetSelector.DrawOneSheetSelector Method | FlexCel Studio for the .NET Framework documentation

TStandardSheetSelector.DrawOneSheetSelector Method

This method overrides the abstract parent to provide a CSS implementation for tabs. Override this method on a child class if you want to completely customize how the Sheet Selector is drawn. Normally you can just change the CSS properties of this class to customize the SheetSelector, but you can use this if you want to provide a completely different selector. You can use the TSheetSelector.Links collection to know which hyperlinks to place in each place.

Syntax

Namespace: FlexCel.Render

public override void DrawOneSheetSelector(ExcelFile xls, TSheetSelectorPosition Position)

Parameters

<-> | Parameter | Type | Description
 | xls | ExcelFile | ExcelFile we are exporting. It is positioned on the sheet we are exporting, but its active sheet can be changed on this method and there is no need to restore it. It will be restored by the framework.
 | Position | TSheetSelector​Position | Position where the sheet selector will be placed. Note that this method will always be called with only one value, but it might be called more than once if constants in the TSheetSelectorPosition enumeration are or'ed together.

See also

  • TStandardSheetSelector


TStandardSheetSelector.ReplaceMacros Method | FlexCel Studio for the .NET Framework documentation

TStandardSheetSelector.ReplaceMacros Method

This is an utility method that will replace all the <#...> macros inside a tag by its values. Normally you do not need to call this method, since it is called automatically by WriteOneCssRule

Syntax

Namespace: FlexCel.Render

protected String ReplaceMacros(String s)

Parameters

<-> | Parameter | Type | Description
 | s | String |

See also

  • TStandardSheetSelector


TStandardSheetSelector.WriteOneCssRule Method | FlexCel Studio for the .NET Framework documentation

TStandardSheetSelector.WriteOneCssRule Method

This method is an utility to write one rule in a TStandarSheetSelectorStyles class.

Syntax

Namespace: FlexCel.Render

protected void WriteOneCssRule(String Selector, String Rule, String SubSelector)

Parameters

<-> | Parameter | Type | Description
 | Selector | String | A string with the style for the class. It can contain Macros (<#...>) and they will be replaced when writing the rule.
 | Rule | String | Name of the rule.
 | SubSelector | String | A string to be added at the end of the rule name.

See also

  • TStandardSheetSelector


TStandardSheetSelector.WriteOneCssClass Method | FlexCel Studio for the .NET Framework documentation

TStandardSheetSelector.WriteOneCssClass Method

This method is an utility to write all the classes of an TStandardSheetSelectorStyles class.

Syntax

Namespace: FlexCel.Render

protected void WriteOneCssClass(TStandardSheetSelectorStyles Selector, String subSelector)

Parameters

<-> | Parameter | Type | Description
 | Selector | TStandardSheet​Selector​Styles | Collection of rules to write.
 | subSelector | String | A string that will be added at the end of every rule name.

See also

  • TStandardSheetSelector


TStandardSheetSelector.WriteCssClasses Method | FlexCel Studio for the .NET Framework documentation

TStandardSheetSelector.WriteCssClasses Method

This method is in charge of writing the style definitions in the header of the html file. Note that you normally do not need to override this method, you can just change the CSS properties of this class. You can override this method if you want full control on how to export the classes.

Syntax

Namespace: FlexCel.Render

public override void WriteCssClasses()

See also

  • TStandardSheetSelector


TStandardSheetSelector.CssGeneral Property | FlexCel Studio for the .NET Framework documentation

TStandardSheetSelector.CssGeneral Property

Style to be applied to the selector. This is a general setting, you can later further customize the style when the selector is at the Left, Top, Right or Bottom with the corresponding CssWhenLeft, CssWhenTop, CssWhenRight and CssWhenBottom properties.

Syntax

Namespace: FlexCel.Render

public TStandardSheetSelectorStyles CssGeneral { get; }

See also

  • TStandardSheetSelector


TStandardSheetSelector.CssWhenLeft Property | FlexCel Studio for the .NET Framework documentation

TStandardSheetSelector.CssWhenLeft Property

Specific style to be applied to the selector when it goes at the left. This style will override the style you specify with CssGeneral

Syntax

Namespace: FlexCel.Render

public TStandardSheetSelectorStyles CssWhenLeft { get; }

See also

  • TStandardSheetSelector


TStandardSheetSelector.CssWhenTop Property | FlexCel Studio for the .NET Framework documentation

TStandardSheetSelector.CssWhenTop Property

Specific style to be applied to the selector when it goes at the top. This style will override the style you specify with CssGeneral

Syntax

Namespace: FlexCel.Render

public TStandardSheetSelectorStyles CssWhenTop { get; }

See also

  • TStandardSheetSelector


TStandardSheetSelector.CssWhenRight Property | FlexCel Studio for the .NET Framework documentation

TStandardSheetSelector.CssWhenRight Property

Specific style to be applied to the selector when it goes at the right. This style will override the style you specify with CssGeneral

Syntax

Namespace: FlexCel.Render

public TStandardSheetSelectorStyles CssWhenRight { get; }

See also

  • TStandardSheetSelector


TStandardSheetSelector.CssWhenBottom Property | FlexCel Studio for the .NET Framework documentation

TStandardSheetSelector.CssWhenBottom Property

Specific style to be applied to the selector when it goes at the bottom. This style will override the style you specify with CssGeneral

Syntax

Namespace: FlexCel.Render

public TStandardSheetSelectorStyles CssWhenBottom { get; }

See also

  • TStandardSheetSelector


TStandardSheetSelector.CssStyleSheetContent Property | FlexCel Studio for the .NET Framework documentation

TStandardSheetSelector.CssStyleSheetContent Property

Style to be applied to the sheet content.

Syntax

Namespace: FlexCel.Render

public String CssStyleSheetContent { get; set; }

See also

  • TStandardSheetSelector


TStandardSheetSelector.CssStyleLayoutTable Property | FlexCel Studio for the .NET Framework documentation

TStandardSheetSelector.CssStyleLayoutTable Property

Style to be applied to the layout table if LayoutTable is true.

Syntax

Namespace: FlexCel.Render

public String CssStyleLayoutTable { get; set; }

See also

  • TStandardSheetSelector


TStandardSheetSelector.CssTags Property | FlexCel Studio for the .NET Framework documentation

TStandardSheetSelector.CssTags Property

This property has a list of Macros that you can use in the CSS definitions. You can reference this value in the CSS properties by using <#variable>

For example, you could set a Macro "Mycolor" with CssTags.Add("mycolor", "red"); and then define a CssProperty: CssWhenTop.Main = "background-color:<#mycolor>";

This method by default contains the following Macros:

  • width: Width of the selector when it is on the right or on the left.
  • bordercolor: Color for the borders.
  • pagecolor: Color of the page. This is normally white, and will be used in the color of the active tab, so it blends with the page background.
  • activetabfg: Color for the text in the active tab. The default is black.
  • unselectedtabbg: Color for the background of the unselected tabs. The default is gray, so the active tab stands out.
  • unselectedtabfg: Color for the text in the unselected tabs.
  • hoverbg: Color for the unselected tab when you hover the mouse over it.
  • hoverfg: Color for the text of the unselected tab when you hover the mouse over it.

You can modify those Macros or add your own definitions here and use them when defining your CSS.

Note that the variables are not case sensitive. You can write them in any combination of lowercase and uppercase.

Syntax

Namespace: FlexCel.Render

public Dictionary<String, String> CssTags { get; }

See also

  • TStandardSheetSelector


TStandardSheetSelector.LayoutTable Property | FlexCel Studio for the .NET Framework documentation

TStandardSheetSelector.LayoutTable Property

When this property is true (the default), both selectors at the left and at the right will be layed out in a table. This has the advantage that block will not wrap down when resizing the window. But if you would prefer not to use tables for layout, you can turn this property off, and the layout will be pure CSS (and it will wrap down when there is not enough space). If you do not have a selector in the left or the right this property does nothing.

Syntax

Namespace: FlexCel.Render

public Boolean LayoutTable { get; set; }

See also

  • TStandardSheetSelector


TStandardSheetSelector.UseSheetTabColors Property | FlexCel Studio for the .NET Framework documentation

TStandardSheetSelector.UseSheetTabColors Property

When true (the default) and the sheets have a tab color defined in Excel, FlexCel will use this color to render the sheet tabs. If false, the default tab color will be used. Note that if the sheets don't have a color defined in Excel, also the default tab color will be used.

Syntax

Namespace: FlexCel.Render

public Boolean UseSheetTabColors { get; set; }

See also

  • TStandardSheetSelector


TStandardSheetSelector.SheetSelectorEntry Event | FlexCel Studio for the .NET Framework documentation

TStandardSheetSelector.SheetSelectorEntry Event

Use this event to customize the text and link on the individual tabs. The tab style itself must be modified with the CSS properties.

Syntax

Namespace: FlexCel.Render

public SheetSelectorEntryEventHandler SheetSelectorEntry

See also

  • TStandardSheetSelector


TStandardSheetSelectorStyles Class | FlexCel Studio for the .NET Framework documentation

TStandardSheetSelectorStyles Class

Holds the styles for one of the positions of a TStandardSheetSelector.

Syntax

Namespace: FlexCel.Render

public class TStandardSheetSelectorStyles

Properties

Name | Description
Main | Style to be applied to the whole Selector.
ActiveTab | Style to be applied to the Active tab.
UnselectedTab | Style to be applied to a tab when it is not the Active one.
UnselectedTabHover | Style to be applied to an unselected tab when you hover the mouse over it.
Links | Style to be applied to the links in the unselected tabs. Note that the active tab does not have a link.
ActiveText | Style to be applied to the text of the selected tab.
List | Style of the list used for the different entries in the selector. this defaults to "list-style: none", but you can use something like "list-style: upper-roman inside" to for example place roman number on each text.


TStandardSheetSelectorStyles.Main Property | FlexCel Studio for the .NET Framework documentation

TStandardSheetSelectorStyles.Main Property

Style to be applied to the whole Selector.

Syntax

Namespace: FlexCel.Render

public String Main { get; set; }

See also

  • TStandardSheetSelectorStyles


TStandardSheetSelectorStyles.ActiveTab Property | FlexCel Studio for the .NET Framework documentation

TStandardSheetSelectorStyles.ActiveTab Property

Style to be applied to the Active tab.

Syntax

Namespace: FlexCel.Render

public String ActiveTab { get; set; }

See also

  • TStandardSheetSelectorStyles


TStandardSheetSelectorStyles.UnselectedTab Property | FlexCel Studio for the .NET Framework documentation

TStandardSheetSelectorStyles.UnselectedTab Property

Style to be applied to a tab when it is not the Active one.

Syntax

Namespace: FlexCel.Render

public String UnselectedTab { get; set; }

See also

  • TStandardSheetSelectorStyles


TStandardSheetSelectorStyles.UnselectedTabHover Property | FlexCel Studio for the .NET Framework documentation

TStandardSheetSelectorStyles.UnselectedTabHover Property

Style to be applied to an unselected tab when you hover the mouse over it.

Syntax

Namespace: FlexCel.Render

public String UnselectedTabHover { get; set; }

See also

  • TStandardSheetSelectorStyles


TStandardSheetSelectorStyles.Links Property | FlexCel Studio for the .NET Framework documentation

TStandardSheetSelectorStyles.Links Property

Style to be applied to the links in the unselected tabs. Note that the active tab does not have a link.

Syntax

Namespace: FlexCel.Render

public String Links { get; set; }

See also

  • TStandardSheetSelectorStyles


TStandardSheetSelectorStyles.ActiveText Property | FlexCel Studio for the .NET Framework documentation

TStandardSheetSelectorStyles.ActiveText Property

Style to be applied to the text of the selected tab.

Syntax

Namespace: FlexCel.Render

public String ActiveText { get; set; }

See also

  • TStandardSheetSelectorStyles


TStandardSheetSelectorStyles.List Property | FlexCel Studio for the .NET Framework documentation

TStandardSheetSelectorStyles.List Property

Style of the list used for the different entries in the selector. this defaults to "list-style: none", but you can use something like "list-style: upper-roman inside" to for example place roman number on each text.

Syntax

Namespace: FlexCel.Render

public String List { get; set; }

See also

  • TStandardSheetSelectorStyles


THtmlImageFormat Enumeration | FlexCel Studio for the .NET Framework documentation

THtmlImageFormat Enumeration

Possible values in which we can save an image when exporting to HTML.

Syntax

Namespace: FlexCel.Render

Members

Name | Value | Description
Png | 0 | Save image as PNG. Note that transparency in PNG is not supported in ie6 unless you apply a fix.
Gif | 1 | Save image as GIF. Image will be converted to 256 colors.
Jpeg | 2 | Save image as JPEG. Note that transparency is not supported in JPEG.
Svg | 3 | Save image as SVG. SVG is a vectorial format supported by most modern browsers, and it allows smooth scaling of charts or autoshapes when zooming in high-dpi/retina devices.


TSheetSelectorPosition Enumeration | FlexCel Studio for the .NET Framework documentation

TSheetSelectorPosition Enumeration

Where to place the tabs for selecting a sheet when exporting multiple sheets. You might combine more than one, for example, to have tabs at the top and bottom: C#: TSheetSelectorPosition.Top | TSheetSelectorPosition.Bottom VB.NET, Delphi.NET: TSheetSelectorPosition.Top or TSheetSelectorPosition.Bottom

Syntax

Namespace: FlexCel.Render

Members

Name | Value | Description
None | 0 | Do not add tabs for the sheets.
Left | 1 | Add the tabs at the left of the html document.
Right | 2 | Add the tabs at the right of the html document.
Top | 4 | Add the tabs at the top of the html document.
Bottom | 8 | Add the tabs at the bottom of the html document.


GetBookmarkInformationEventHandler Delegate | FlexCel Studio for the .NET Framework documentation

GetBookmarkInformationEventHandler Delegate

This event will happen each time a PDF bookmark is automatically added by FlexCel. You can use it to customize the bookmark, for example change the font color or style.

Syntax

Namespace: FlexCel.Render

public delegate void GetBookmarkInformationEventHandler(Object sender, GetBookmarkInformationArgs e)

Parameters

<-> | Parameter | Type | Description
 | sender | Object |
 | e | GetBookmarkInformation​Args |


ImageInformationEventHandler Delegate | FlexCel Studio for the .NET Framework documentation

ImageInformationEventHandler Delegate

Delegate used to specify where to store the images on a page.

Syntax

Namespace: FlexCel.Render

public delegate void ImageInformationEventHandler(Object sender, ImageInformationEventArgs e)

Parameters

<-> | Parameter | Type | Description
 | sender | Object |
 | e | ImageInformation​Event​Args |


NamedRangeExportEventHandler Delegate | FlexCel Studio for the .NET Framework documentation

NamedRangeExportEventHandler Delegate

Delegate used to customize exporting of named ranges on a page.

Syntax

Namespace: FlexCel.Render

public delegate void NamedRangeExportEventHandler(Object sender, NamedRangeExportEventArgs e)

Parameters

<-> | Parameter | Type | Description
 | sender | Object |
 | e | NamedRangeExport​Event​Args |


PageEventHandler Delegate | FlexCel Studio for the .NET Framework documentation

PageEventHandler Delegate

Generic delegate for After/Before page events.

Syntax

Namespace: FlexCel.Render

public delegate void PageEventHandler(Object sender, PageEventArgs e)

Parameters

<-> | Parameter | Type | Description
 | sender | Object |
 | e | PageEventArgs |


PaintEventHandler Delegate | FlexCel Studio for the .NET Framework documentation

PaintEventHandler Delegate

Delegate for Paint events.

Syntax

Namespace: FlexCel.Render

public delegate void PaintEventHandler(Object sender, ImgPaintEventArgs e)

Parameters

<-> | Parameter | Type | Description
 | sender | Object |
 | e | ImgPaintEventArgs |


PrintHardMarginsEventHandler Delegate | FlexCel Studio for the .NET Framework documentation

PrintHardMarginsEventHandler Delegate

Delegate for getting the printer physical margins.

Syntax

Namespace: FlexCel.Render

public delegate void PrintHardMarginsEventHandler(Object sender, PrintHardMarginsEventArgs e)

Parameters

<-> | Parameter | Type | Description
 | sender | Object |
 | e | PrintHardMargins​Event​Args |


SaveImageEventHandler Delegate | FlexCel Studio for the .NET Framework documentation

SaveImageEventHandler Delegate

Delegate used to specify where to store the images on a page.

Syntax

Namespace: FlexCel.Render

public delegate void SaveImageEventHandler(Object sender, SaveImageEventArgs e)

Parameters

<-> | Parameter | Type | Description
 | sender | Object |
 | e | SaveImageEventArgs |


SheetSelectorEntryEventHandler Delegate | FlexCel Studio for the .NET Framework documentation

SheetSelectorEntryEventHandler Delegate

Delegate used to specify how the Sheet Selector will be like.

Syntax

Namespace: FlexCel.Render

public delegate void SheetSelectorEntryEventHandler(Object sender, SheetSelectorEntryEventArgs e)

Parameters

<-> | Parameter | Type | Description
 | sender | Object |
 | e | SheetSelector​Entry​Event​Args |


FlexCel.Report Namespace | FlexCel Studio for the .NET Framework documentation

FlexCel.Report Namespace

Components for creating Excel reports based on a template.

Classes

Name | Description
CustomizeChart​Event​Args | Arguments passed on FlexCelReport.​Customize​Chart
FlexCelReport | Component for creating reports on Excel based on a template. It will read an xls file, replace tags with data read from a database or memory, and save a new file with the data.
FlexCelReport​Progress | Indicates how much of the report has been generated.
GenerateEventArgs | Arguments passed on FlexCelReport.​Before​Generate​Workbook, FlexCelReport.​After​Generate​Workbook, FlexCelReport.​Before​Generate​Sheet and FlexCelReport.​After​Generate​Sheet
GetImageData​Event​Args | Arguments passed on FlexCelReport.​Get​Image​Data
GetIncludeEventArgs | Arguments passed on FlexCelReport.​Get​Include
LoadTableEventArgs | Arguments passed on FlexCelReport.​Load​Table
ReportTag | Tags used in reports.
TFieldExpressions<​T> | A class to store compiled expressions to access fields in a TLinqDataTable. This is faster than reading the field values with reflection. Field expressions will be created on demand, so if you never use a field, an expression for it won't be created.
TFlexCelUserFormat | A class used to define a cell format in code, that you can call from a report.
TFlexCelUserFunction | A class used to define a FlexCel user function, that you can call from a report.
TLinqDataTable<T> | An implementation of a VirtualDataTable using IEnumerator and Linq. This class is abstract so to use it you should inherit from it and override the needed methods. In normal cases you won't need to override this class, as FlexCel already has an implementation of it that deals with IEnumerator tables. Inheriting from this class is only for very special cases.
TLinqDataTable​State<​T> | This class implements support for Linq queries in FlexCelReport. Inherit this class if you want to implement some non-standard Linq query provider. For normal cases, you don't need to do anything since FlexCel already implements a descendant of this class with the default functionality.
TLinqFieldDefinitions<​T> | Holds a list of field definitions, used to find the fields in classes available to the report.
TMasterDetailLink | A parent table and a parent field used on a master-detail relationship.
TOneCellValue | A list of TOneSectionValue. Has a parsed version of what is on a cell.
TRelation | A data relation between two tables. Different from standard .NET datarelations, this class is not tied to ADO.NET, and allows you to specify relationships between any arbitrary VirtualDataTable objects.
TSplitLink | Specifies a "Split" relation between two tables.
UserTableEventArgs | Arguments passed on FlexCelReport.​User​Table
VirtualDataTable | Base class for a table used on FlexCelReport. Inherit from this class and VirtualDataTable​State to create your custom sources of data. Make sure you read 'Appendix virtual datasets' in the Reports Developer Guide for more information.
VirtualDataTable​State | A table that corresponds to a band on the report. Make sure you read 'Appendix virtual datasets' in the Reports Developer Guide for more information.

Structures

Name | Description
TLookupField​Definition | Encapsulates the data for a lookup tag in a report.

Interfaces

Name | Description
ILinqDataTable | Interface for generic methods in ILinqDataTable.
ILinqDataTableState | This interface is used by TLinqDataTableState for calling generic methods.

Enumerations

Name | Description
ApplyFormatTagEnum | Configuration strings used in applying a part of a format. Internal use.
ConfigTagEnum | Configuration strings. Internal use.
FlexCelReport​Progress​Phase | Phase of the report we are in.
TAggregateType | Enumeration with the different kind of aggregations that can be done in a FlexCelReport.
TDeleteEmptyBands | Defines how bands will be removed when they have 0 records.
TDisposeMode | Indicates if FlexCel must dispose a table after it is done using it.
TErrorActions | Enumerates what to do on different FlexCel error situations.
TSqlParametersType | How the parameters for Direct SQL queries are. Change it only if your database uses positional parameters and it is not ODBC or OLEDB.
TValueType | All the things we can find on a cell.

Delegates

Name | Description
CustomizeChart​Event​Handler | Delegate for CustomizeChart event.
GenerateEventHandler | Generic delegate for After/Before generate events.
GetImageData​Event​Handler | Delegate for GetImageData event.
GetIncludeEvent​Handler | Delegate for GetInclude event.
LoadTableEvent​Handler | Delegate for LoadTable event.
UserTableEvent​Handler | Delegate for UserTable event.


CustomizeChartEventArgs Class | FlexCel Studio for the .NET Framework documentation

CustomizeChartEventArgs Class

Arguments passed on FlexCelReport.CustomizeChart

Syntax

Namespace: FlexCel.Report

public class CustomizeChartEventArgs: EventArgs

Constructors

Name | Description
CustomizeChart​Event​Args | Creates a new Argument.

Properties

Name | Description
File | The file with the chart.
Chart | Chart that is being processed. Modify its properties in this event.
ChartName | Name of the chart. If this is a chart sheet, then it is the name of the sheet. Otherwise is the name of the object.


CustomizeChartEventArgs.CustomizeChartEventArgs Constructor | FlexCel Studio for the .NET Framework documentation

CustomizeChartEventArgs.CustomizeChartEventArgs Constructor

Creates a new Argument.

Syntax

Namespace: FlexCel.Report

public CustomizeChartEventArgs(ExcelFile aExcelFile, ExcelChart aChart, String aChartName)

Parameters

<-> | Parameter | Type | Description
 | aExcelFile | ExcelFile | The ExcelFile that has the chart.
 | aChart | ExcelChart | Chart being processed. You can modify its properties in this event.
 | aChartName | String | Name of the chart.

See also

  • CustomizeChartEventArgs


CustomizeChartEventArgs.File Property | FlexCel Studio for the .NET Framework documentation

CustomizeChartEventArgs.File Property

The file with the chart.

Syntax

Namespace: FlexCel.Report

public ExcelFile File { get; }

See also

  • CustomizeChartEventArgs


CustomizeChartEventArgs.Chart Property | FlexCel Studio for the .NET Framework documentation

CustomizeChartEventArgs.Chart Property

Chart that is being processed. Modify its properties in this event.

Syntax

Namespace: FlexCel.Report

public ExcelChart Chart { get; }

See also

  • CustomizeChartEventArgs


CustomizeChartEventArgs.ChartName Property | FlexCel Studio for the .NET Framework documentation

CustomizeChartEventArgs.ChartName Property

Name of the chart. If this is a chart sheet, then it is the name of the sheet. Otherwise is the name of the object.

Syntax

Namespace: FlexCel.Report

public String ChartName { get; }

See also

  • CustomizeChartEventArgs


FlexCelReport Class | FlexCel Studio for the .NET Framework documentation

FlexCelReport Class

Component for creating reports on Excel based on a template. It will read an xls file, replace tags with data read from a database or memory, and save a new file with the data.

Syntax

Namespace: FlexCel.Report

public class FlexCelReport: Component

Constructors

Name | Description
FlexCelReport | Overloaded FlexCelReport FlexCelReport(Boolean)

Methods

Name | Description
Run Overloaded
 Run(ExcelFile)
Run(String, String)
Run(Stream, Stream)
Run(Stream, Stream, TFileFormats)
Cancel Cancels a running report. This method is equivalent to setting Canceled = true.
AddTable Overloaded
 AddTable(DataSet)
AddTable(String, DataTable)
AddTable(String, DataView)
AddTable(DataSet, TDisposeMode)
AddTable(String, VirtualDataTable)
AddTable<T>(String, IEnumerable<T>)
AddTable(String, DataTable, TDisposeMode)
AddTable(String, DataView, TDisposeMode)
AddTable(String, VirtualDataTable, TDisposeMode)
AddTable<T>(String, IEnumerable<T>, TDisposeMode)
ClearTables Clear the collection of tables available to the report.
GetTable Returns the VirtualDataTable with the specified name that was added to the report.
AddConnection Overloaded
 AddConnection(String, IDbDataAdapter, CultureInfo)
AddConnection(String, IDbDataAdapter, CultureInfo, Boolean)
AddConnection(String, IDbCommand, CultureInfo, Boolean)
ClearConnections Clear the collection of connections available to the report.
AddSqlParameter Adds an SQL parameter to use from the template on the DIRECT SQL commands.
Note that the parameter must have a name even if you are using positional parameters ("?") because on the template you should always write named parameters.
ClearParameters Clear the collection of SQL parameters available to the report.
SetValue Sets a variable for the report.
ClearValues | Destroys all variables on the report. To add new variables, use SetValue
SetExpression Sets a user-defined expression to be used in the report. Different from SetValue this method will evaluate the <#tags> in "value". This allows you to provide formula functionality to end users, and to reuse the same report for different formulas.
ClearExpressions | Destroys all user-defined expressions on the report. To add new expressions, use SetExpression
SetUserFunction Adds a new user defined function to be used with the report.
For information on how to create the user function, see TFlexCelUserFunction
ClearUserFunctions | Destroys all user defined functions on the report. To add new functions, use SetUserFunction
SetUserFormat Adds a new user defined format to be used with the report.
For information on how to create the user format function, see TFlexCelUserFormat
ClearUserFormats | Destroys all user defined formats on the report. To add new formats, use SetUserFormat
AddRelationship Overloaded
 AddRelationship(String, String, String, String)
AddRelationship(String, String, String[], String[])
ClearRelationships Clears all relationships added by AddRelationship(​​String, String, String, String).
OnBeforeReadTemplate | Replace this event when creating a custom descendant of FlexCelReport. See also BeforeReadTemplate
OnBeforeGenerate​Workbook | Replace this event when creating a custom descendant of FlexCelReport. See also BeforeGenerate​Workbook
OnAfterGenerate​Workbook | Replace this event when creating a custom descendant of FlexCelReport. See also AfterGenerate​Workbook
OnBeforeGenerate​Sheet | Replace this event when creating a custom descendant of FlexCelReport. See also BeforeGenerateSheet
OnAfterGenerateSheet | Replace this event when creating a custom descendant of FlexCelReport. See also AfterGenerateSheet
OnGetImageData | Replace this event when creating a custom descendant of FlexCelReport. See also GetImageData
OnCustomizeChart | Replace this event when creating a custom descendant of FlexCelReport. See also CustomizeChart
OnGetInclude | Replace this event when creating a custom descendant of FlexCelReport. See also GetInclude
OnUserTable | Replace this event when creating a custom descendant of FlexCelReport. See also UserTable
OnLoadTable | Replace this event when creating a custom descendant of FlexCelReport. See also LoadTable
Dispose Override this instance when creating descendants of FlexCelReport.
Remember to always call base.​Dispose(​disposing)​.​

Properties

Name | Description
Canceled | If true the report has been canceled with Cancel method. You can't set this variable to false, and setting it true is the same as calling Cancel.
Progress | Progress of the report. This variable must be accessed from other thread.
DeleteEmptyRanges | This property is obsolete. Use DeleteEmptyBands instead. Determines if FlexCel will delete or just clear ranges with empty datasets (0 records).
DeleteEmptyBands​Fixed | Determines if FlexCel will delete or just clear ranges with empty datasets (0 records), for FIXED bands. Note that normally you don't want Fixed bands to delete rows, so this property defaults to TDeleteEmpty​Bands.​Clear​Data​Only.
DeleteEmptyBands | Determines if FlexCel will delete or just clear ranges with empty datasets (0 records). Note that this property doesn't apply to FIXED bands, those are controlled with DeleteEmptyBands​Fixed
UseExcelTables​AsBands | Determines if FlexCel will use Tables named as "__table__" or similar as band definitions.
RenameExcelTables​Used​AsBands | Determines if FlexCel will rename Tables used as band definitions after the report is run to remove the extra "__" in the name.
AllowOverwriting​Files | Determines if FlexCel will automatically delete existing files or not.
ResetCellSelections | When true, all sheets will selections will be reset to A1. This way, you do not need to care about setting the correct selection when editing the template.
HtmlMode | When true, FlexCel will interpret the text as HTML, and honor the tags that it can understand. Note that when in HtmlMode, many consecutive spaces will be interpreted as one, and carriage returns will be interpreted as spaces. To enter real carriage returns you need to enter a <br> tag (unless the text is inside <pre> tags). Also & symbols need to be escaped. For more info on HTML syntax supported, see ExcelFile.​Set​Cell​From​Html(​​Int32, Int32, String, Int32) ...[more]
DisableSQLValidation | If false (the default) FlexCelReport will only allow DirectSQL queries that begin with "SELECT", to avoid people doing inserts or deletes from the config sheet. If true, FlexCelReport will pass the DirectSQL queries you write in the config sheet directly to the server. Caution: Setting this property to true might have security implications. Take a look at the remarks.
EnterFormulas | When true, FlexCel will try to enter any string starting with "=" as a formula instead of text. If this property is true, any string you enter that starts with "=" must be a valid formula, or an error will be raised. When you know a priori which cells will have formulas, you might want to use the <#formula> tag instead.
TryToConvertStrings | When true, FlexCel will try to convert strings to numbers or dates before entering them into the cells. USE THIS PROPERTY WITH CARE! You shouldn't normally need to use this property, since FlexCel automatically enters numbers or dates in the DataSets as number or dates in the Excel file. If you need to use this property, it means that data in your database is stored as strings when they should not be. So the correct fix is to fix the columns you know should have numbers to have numbers, NOT to use this property. This is just a workaround when you can't do anything else about it....[more]
ExpressionRecursion​Limit | Defines how much nesting you can have in Expressions before FlexCel throws an error. You might have an expression like <#A> which is defined based in another expression <#B> which in turn is defined based in another one that finally might come back to <#A> As it is not possible for FlexCel to know if the recursion will finish or loop forever, it will try until it reaches the limit you set here. Note that a too big limit could cause a stack overflow.
RecalcMode | Determines if the report will be recalculated before saving. See ExcelFile.RecalcMode for more info.
RecalcVersion | Before changing this property, look at ExcelFile.​Recalc​Version Determines if the formulas will be recalculated when Excel opens them.
ErrorActions | Determines if FlexCel will throw Exceptions or just ignore errors on specific situations. When the errors are ignored, they will be logged into the FlexCelTrace class.
ErrorsInResultFile | When true and there is an error reading cells in the template or writing the cells in the report, the error message will be written in the corresponding cell on the generated report. No Exception will be thrown. You can use this property to DEBUG reports, as it provides an easy way to see all errors at once in the place they are produced. But is it recommended that you leave this property FALSE in production, or you could create xls files with error messages inside. See also DebugExpressions ...[more]
DebugExpressions | Set this value to true if you want to analyze how FlexCel is evaluating the tags in a file. When true, a full stack trace will be written in the cell instead of the tag values. See 'Debugging reports' in the Reports Designer Guide for information on how to use those stack traces.
DebugIntelligent​Page​Breaks | Set this value to true if you want to analyze how FlexCel is setting up the intelligent page breaks. When this property is true, FlexCel will add one row at the top of the spreadsheet (if the sheet has keeptogether column ranges), and one column at the left of the spreadsheet (if the sheet has keeptogether row ranges). This row and column will show the levels of keeptogether in the respective column and row. See 'Debugging intelligent page breaks' in the Reports Designer Guide ...[more]
SqlParameterReplace | Format string for replacing the standard parameter names on DIRECT SQL commands. You can leave it empty for ODBC, OLEDB or SQLSERVER databases. See Also SqlParametersType
SqlParametersType | Type of parameters for the database. Positional parameters are the ones where you write "?" on the sql, and positional are when you write a name, like "@employee" or ":orderid". See Also SqlParameterReplace
SemiAbsolute​References | When this property is set to true, absolute references to cells inside bands being copied will be treated as relative. This way, if you have "=$A$1" inside a band and cell A1 is also inside the band, it will change to A2,A3..etc when the band is copied down. This can be useful in a master-detail report, where you want the cells in the detail to point to a fixed cell inside every record of the master. See ExcelFile.​Semi​Absolute​References ...[more]
UseLegacyLookup | When true, FlexCel will use DataViews to do lookups in DataSets, instead of using its own internal lookup algorithm. Only set this property to true if you have legacy reports that break when you use the internal lookup algorithm, because they depended in bugs in the DataView lookup implementation. For all new code, keep this property false.

Events

Name | Description
BeforeReadTemplate | Fires before starting to generate the report and before the template has been loaded. It allows you to provide the template password if you are using one.
BeforeGenerate​Workbook | Fires before starting to generate the report but after the template has been loaded. It allows to do some in-place modifications to the template before generating the report.
AfterGenerate​Workbook | Fires After the report has been fully generated but is not saved. Allows to do last clean up things before saving the report.
BeforeGenerateSheet | Fires Before each sheet on the file is generated.
AfterGenerateSheet | Fires After each sheet on the file is generated.
GetImageData | Fires before an image is saved to the report. Use it if the image is on a proprietary format on the database, to return a format FlexCel can understand.
CustomizeChart | Fires for each chart in each sheet, after the report has been generated. Allows to do custom modifications to the charts, like for example setting series colors.
GetInclude | Fires before including a file with <#include>. Use it if you want to provide an alternative path for the file, of if you want to read the include file from a different place, for example a database or an embedded resource.
UserTable | Fires on each <#USER TABLE> tag in the config sheet, allowing to add your own datasets to the report.
LoadTable | Fires whenever an undefined table is called, allowing to load your own datasets in demand to the report. For more control, you might use User Tables. Look at the example for more information.


FlexCelReport.FlexCelReport Constructor | FlexCel Studio for the .NET Framework documentation

FlexCelReport.FlexCelReport Constructor

Overloads

  • FlexCelReport.FlexCelReport
  • FlexCelReport.FlexCelReport(Boolean)

FlexCelReport.FlexCelReport

Creates a new FlexCelReport component.

Syntax

Namespace: FlexCel.Report

public FlexCelReport()

See also

  • FlexCelReport

FlexCelReport.FlexCelReport(Boolean)

Creates a new FlexCelReport component and sets the desired Overwrite mode for files.

Syntax

Namespace: FlexCel.Report

public FlexCelReport(Boolean aAllowOverwritingFiles)

Parameters

<-> | Parameter | Type | Description
 | aAllowOverwritingFiles | Boolean | If false, FlexCelReport will never overwrite an existing file, and you have to delete it before creating it again.

See also

  • FlexCelReport
  • AllowOverwritingFiles


FlexCelReport.Run Method | FlexCel Studio for the .NET Framework documentation

FlexCelReport.Run Method

Overloads

  • FlexCelReport.Run(ExcelFile)
  • FlexCelReport.Run(String, String)
  • FlexCelReport.Run(Stream, Stream)
  • FlexCelReport.Run(Stream, Stream, TFileFormats)

FlexCelReport.Run(ExcelFile)

Executes the report, reading from an ExcelFile and writing the results to it again.

Remarks

Note that RecalcMode, SemiAbsoluteReferences RecalcVersion and AllowOverwritingFiles values used will be the ones on aWorkbook, not the ones on this report.

Syntax

Namespace: FlexCel.Report

public void Run(ExcelFile aWorkbook)

Parameters

<-> | Parameter | Type | Description
 | aWorkbook | ExcelFile | ExcelFile that contains the template file, and that will contain the generated file once this method runs.

See also

  • FlexCelReport

FlexCelReport.Run(String, String)

Executes the report, reading from a file and writing to a file.

Syntax

Namespace: FlexCel.Report

public void Run(String templateFileName, String outFileName)

Parameters

<-> | Parameter | Type | Description
 | templateFileName | String | File with the template to use.
 | outFileName | String | File to create.

See also

  • FlexCelReport

FlexCelReport.Run(Stream, Stream)

Executes the report, reading from a stream and writing to a stream.

Syntax

Namespace: FlexCel.Report

public void Run(Stream templateStream, Stream outStream)

Parameters

<-> | Parameter | Type | Description
 | templateStream | Stream | Stream with the template.
 | outStream | Stream | Stream where the result will be written.

See also

  • FlexCelReport

FlexCelReport.Run(Stream, Stream, TFileFormats)

Executes the report, reading from a stream and writing to a stream.

Syntax

Namespace: FlexCel.Report

public void Run(Stream templateStream, Stream outStream, TFileFormats fileFormat)

Parameters

<-> | Parameter | Type | Description
 | templateStream | Stream | Stream with the template.
 | outStream | Stream | Stream where the result will be written.
 | fileFormat | TFileFormats | File format in which the resulting file will be saved.

See also

  • FlexCelReport


FlexCelReport.Cancel Method | FlexCel Studio for the .NET Framework documentation

FlexCelReport.Cancel Method

Cancels a running report. This method is equivalent to setting Canceled = true.

Syntax

Namespace: FlexCel.Report

public void Cancel()

See also

  • FlexCelReport


FlexCelReport.AddTable Method | FlexCel Studio for the .NET Framework documentation

FlexCelReport.AddTable Method

Overloads

  • FlexCelReport.AddTable(DataSet)
  • FlexCelReport.AddTable(String, DataTable)
  • FlexCelReport.AddTable(String, DataView)
  • FlexCelReport.AddTable(DataSet, TDisposeMode)
  • FlexCelReport.AddTable(String, VirtualDataTable)
  • FlexCelReport.AddTable<T>(String, IEnumerable<T>)
  • FlexCelReport.AddTable(String, DataTable, TDisposeMode)
  • FlexCelReport.AddTable(String, DataView, TDisposeMode)
  • FlexCelReport.AddTable(String, VirtualDataTable, TDisposeMode)
  • FlexCelReport.AddTable<T>(String, IEnumerable<T>, TDisposeMode)

FlexCelReport.AddTable(DataSet)

Use this method to load all tables on a dataset at once. This is equivalent to calling AddTable(String, DataTable) for each of the tables on the dataset.

Syntax

Namespace: FlexCel.Report

public void AddTable(DataSet tables)

Parameters

<-> | Parameter | Type | Description
 | tables | DataSet | Dataset containing the tables to add.

Examples

See AddTable(String, DataTable) for an example.

See also

  • FlexCelReport

FlexCelReport.AddTable(String, DataTable)

Use this method to tell FlexCel which DataTables or DataViews are available for the report. Note: If you don't know the tables before running the report (and you are not using User Tables or Direct SQL) you can use the LoadTable event to load them in demand instead of using AddTable. This way you will only load the tables you need.

Syntax

Namespace: FlexCel.Report

public void AddTable(String tableName, DataTable table)

Parameters

<-> | Parameter | Type | Description
 | tableName | String | Name that the table will have on the report.
 | table | DataTable | Table that will be available to the report.

Examples

To allow a report to use Customers and Orders tables, you can use the code:

    flexCelReport.AddTable("Customers", CustomersDataTable); //Add datatable Customers to the report.
    flexCelReport.AddTable("Orders", OrdersDataView); //Add dataview OrdersDataView to the report.
    flexCelReport.AddTable(MyDataSet); //Add all the tables on MyDataSet to the report.

See also

  • FlexCelReport

FlexCelReport.AddTable(String, DataView)

Use this method to tell FlexCel which DataTables or DataViews are available for the report. Note: If you don't know the tables before running the report (and you are not using User Tables or Direct SQL) you can use the LoadTable event to load them in demand instead of using AddTable. This way you will only load the tables you need.

Syntax

Namespace: FlexCel.Report

public void AddTable(String tableName, DataView table)

Parameters

<-> | Parameter | Type | Description
 | tableName | String | Name that the table will have on the report.
 | table | DataView | Table that will be available to the report.

Examples

To allow a report to use Customers and Orders tables, you can use the code:

    flexCelReport.AddTable("Customers", CustomersDataTable); //Add datatable Customers to the report.
    flexCelReport.AddTable("Orders", OrdersDataView); //Add dataview OrdersDataView to the report.
    flexCelReport.AddTable(MyDataSet); //Add all the tables on MyDataSet to the report.

See also

  • FlexCelReport

FlexCelReport.AddTable(DataSet, TDisposeMode)

Use this method to load all tables on a dataset at once. When disposeMode is DoNotDispose, this is equivalent to calling AddTable(String, DataTable) for each of the tables on the dataset. If disposeMode is DisposeTable, this will make the same as calling AddTable() with disposeTable equal to false for each table on the dataset. And when finished all the dataset will be disposed.

Syntax

Namespace: FlexCel.Report

public void AddTable(DataSet tables, TDisposeMode disposeMode)

Parameters

<-> | Parameter | Type | Description
 | tables | DataSet | Dataset containing the tables to add.
 | disposeMode | TDisposeMode | When disposeMode is TDisposeMode.DisposeTable, FlexCel will take care of disposing this dataset after running the report. Use it when adding datasets created on the fly, so you do not have to dispose them yourself.

Examples

See AddTable(String, DataTable) for an example.

See also

  • FlexCelReport

FlexCelReport.AddTable(String, VirtualDataTable)

Use this method to add any custom object as a datasource for FlexCel. Make sure to read 'Appendix virtual datasets' in the Reports Developer Guide.

Syntax

Namespace: FlexCel.Report

public void AddTable(String tableName, VirtualDataTable table)

Parameters

<-> | Parameter | Type | Description
 | tableName | String | Name that the table will have on the report.
 | table | VirtualDataTable | Table that will be available in the report.

See also

  • FlexCelReport

FlexCelReport.AddTable<T>(String, IEnumerable<T>)

Use this method to add any IEnumerable as a datasource for FlexCel. You can use this method to add LINQ tables.

Syntax

Namespace: FlexCel.Report

public void AddTable<T>(String tableName, IEnumerable<T> table)

Parameters

<-> | Parameter | Type | Description
 | tableName | String | Name that the table will have on the report.
 | table | IEnumerable<T> | Table that will be available in the report.

Type Parameters

Type Parameter | Description
T | Type of table being inserted. It must implement IEnumerable.

See also

  • FlexCelReport

FlexCelReport.AddTable(String, DataTable, TDisposeMode)

Use this method to tell FlexCel which DataTables or DataViews are available for the report. Note: If you don't know the tables before running the report (and you are not using User Tables or Direct SQL) you can use the LoadTable event to load them in demand instead of using AddTable. This way you will only load the tables you need.

Syntax

Namespace: FlexCel.Report

public void AddTable(String tableName, DataTable table, TDisposeMode disposeMode)

Parameters

<-> | Parameter | Type | Description
 | tableName | String | Name that the table will have on the report.
 | table | DataTable | Table that will be available to the report.
 | disposeMode | TDisposeMode | When disposeMode is TDisposeMode.DisposeTable, FlexCel will take care of disposing this table after running the report. Use it when adding tables created on the fly, so you do not have to dispose them yourself.

Examples

To allow a report to use Customers and Orders tables, you can use the code:

    flexCelReport.AddTable("Customers", CustomersDataTable); //Add datatable Customers to the report.
    flexCelReport.AddTable("Orders", OrdersDataView); //Add dataview OrdersDataView to the report.
    flexCelReport.AddTable(MyDataSet); //Add all the tables on MyDataSet to the report.

See also

  • FlexCelReport

FlexCelReport.AddTable(String, DataView, TDisposeMode)

Use this method to tell FlexCel which DataTables or DataViews are available for the report. Note: If you don't know the tables before running the report (and you are not using User Tables or Direct SQL) you can use the LoadTable event to load them in demand instead of using AddTable. This way you will only load the tables you need.

Syntax

Namespace: FlexCel.Report

public void AddTable(String tableName, DataView table, TDisposeMode disposeMode)

Parameters

<-> | Parameter | Type | Description
 | tableName | String | Name that the table will have on the report.
 | table | DataView | Table that will be available to the report.
 | disposeMode | TDisposeMode | When disposeMode is TDisposeMode.DisposeTable, FlexCel will take care of disposing this table after running the report. Use it when adding tables created on the fly, so you do not have to dispose them yourself.

Examples

To allow a report to use Customers and Orders tables, you can use the code:

    flexCelReport.AddTable("Customers", CustomersDataTable); //Add datatable Customers to the report.
    flexCelReport.AddTable("Orders", OrdersDataView); //Add dataview OrdersDataView to the report.
    flexCelReport.AddTable(MyDataSet); //Add all the tables on MyDataSet to the report.

See also

  • FlexCelReport

FlexCelReport.AddTable(String, VirtualDataTable, TDisposeMode)

Use this method to add any custom object as a datasource for FlexCel. Make sure to read 'Appendix virtual datasets' in the Reports Developer Guide.

Syntax

Namespace: FlexCel.Report

public void AddTable(String tableName, VirtualDataTable table, TDisposeMode disposeMode)

Parameters

<-> | Parameter | Type | Description
 | tableName | String | Name that the table will have on the report.
 | table | VirtualDataTable | Table that will be available in the report.
 | disposeMode | TDisposeMode | When disposeMode is TDisposeMode.DisposeTable, FlexCel will take care of disposing this table after running the report. Use it when adding tables created on the fly, so you do not have to dispose them yourself.

See also

  • FlexCelReport

FlexCelReport.AddTable<T>(String, IEnumerable<T>, TDisposeMode)

Use this method to add any IEnumerable as a datasource for FlexCel. You can use this method to add LINQ tables.

Syntax

Namespace: FlexCel.Report

public void AddTable<T>(String tableName, IEnumerable<T> table, TDisposeMode disposeMode)

Parameters

<-> | Parameter | Type | Description
 | tableName | String | Name that the table will have on the report.
 | table | IEnumerable<T> | Table that will be available in the report.
 | disposeMode | TDisposeMode | When disposeMode is TDisposeMode.DisposeTable, FlexCel will take care of disposing this table after running the report. Use it when adding tables created on the fly, so you do not have to dispose them yourself.

Type Parameters

Type Parameter | Description
T | Type of the table.

See also

  • FlexCelReport


FlexCelReport.ClearTables Method | FlexCel Studio for the .NET Framework documentation

FlexCelReport.ClearTables Method

Clear the collection of tables available to the report.

Syntax

Namespace: FlexCel.Report

public void ClearTables()

See also

  • FlexCelReport


FlexCelReport.GetTable Method | FlexCel Studio for the .NET Framework documentation

FlexCelReport.GetTable Method

Returns the VirtualDataTable with the specified name that was added to the report.

Syntax

Namespace: FlexCel.Report

public VirtualDataTable GetTable(String tableName)

Parameters

<-> | Parameter | Type | Description
 | tableName | String | Name of the table to retrieve.

See also

  • FlexCelReport


FlexCelReport.AddConnection Method | FlexCel Studio for the .NET Framework documentation

FlexCelReport.AddConnection Method

Overloads

  • FlexCelReport.AddConnection(String, IDbDataAdapter, CultureInfo)
  • FlexCelReport.AddConnection(String, IDbDataAdapter, CultureInfo, Boolean)
  • FlexCelReport.AddConnection(String, IDbCommand, CultureInfo, Boolean)

FlexCelReport.AddConnection(String, IDbDataAdapter, CultureInfo)

Adds an adapter to use from the template on the DIRECT SQL commands. For security reasons, make sure this adapter ONLY GRANTS READONLY ACCESS TO THE DATA

Syntax

Namespace: FlexCel.Report

public void AddConnection(String connectionName, IDbDataAdapter adapter, CultureInfo locale)

Parameters

<-> | Parameter | Type | Description
 | connectionName | String | This is the name you will use on the template to refer to this adapter.
 | adapter | IDbDataAdapter | The adapter that will be used.
 | locale | CultureInfo | The locale for the created tables.

See also

  • FlexCelReport

FlexCelReport.AddConnection(String, IDbDataAdapter, CultureInfo, Boolean)

Adds an adapter to use from the template on the DIRECT SQL commands. For security reasons, make sure this adapter ONLY GRANTS READONLY ACCESS TO THE DATA

Syntax

Namespace: FlexCel.Report

public void AddConnection(String connectionName, IDbDataAdapter adapter, CultureInfo locale, Boolean caseSensitive)

Parameters

<-> | Parameter | Type | Description
 | connectionName | String | This is the name you will use on the template to refer to this adapter.
 | adapter | IDbDataAdapter | The adapter that will be used.
 | locale | CultureInfo | The locale for the created tables.
 | caseSensitive | Boolean | When true strings will be case sensitive, and "a" will be different from "A"

See also

  • FlexCelReport

FlexCelReport.AddConnection(String, IDbCommand, CultureInfo, Boolean)

Adds an SQL command to use from the template on the DIRECT SQL commands. For security reasons, make sure this adapter ONLY GRANTS READONLY ACCESS TO THE DATA

Remarks

You will usually want to use AddConnection(String, IDbDataAdapter, CultureInfo) instead. This method is provided for the cases where there is no DataAdapter in the technology you are using. (as is currently the case with Microsoft.Data.SQLite)

Syntax

Namespace: FlexCel.Report

public void AddConnection(String connectionName, IDbCommand command, CultureInfo locale, Boolean caseSensitive)

Parameters

<-> | Parameter | Type | Description
 | connectionName | String | This is the name you will use on the template to refer to this command.
 | command | IDbCommand | The select command that will be used.
 | locale | CultureInfo | The locale for the created tables.
 | caseSensitive | Boolean | When true strings will be case sensitive, and "a" will be different from "A"

See also

  • FlexCelReport


FlexCelReport.ClearConnections Method | FlexCel Studio for the .NET Framework documentation

FlexCelReport.ClearConnections Method

Clear the collection of connections available to the report.

Syntax

Namespace: FlexCel.Report

public void ClearConnections()

See also

  • FlexCelReport


FlexCelReport.AddSqlParameter Method | FlexCel Studio for the .NET Framework documentation

FlexCelReport.AddSqlParameter Method

Adds an SQL parameter to use from the template on the DIRECT SQL commands. Note that the parameter must have a name even if you are using positional parameters ("?") because on the template you should always write named parameters.

Syntax

Namespace: FlexCel.Report

public void AddSqlParameter(String parameterName, IDbDataParameter parameter)

Parameters

<-> | Parameter | Type | Description
 | parameterName | String | The name of the parameter without special symbols, as it is written on the DIRECT SQL string. This might be different from the real parameter name. For example, on SQL Server, parameterName might be "MyParameter" while parameter.ParameterName would be "@MyParameter"
 | parameter | IDbDataParameter | The parameter to add.

See also

  • FlexCelReport


FlexCelReport.ClearParameters Method | FlexCel Studio for the .NET Framework documentation

FlexCelReport.ClearParameters Method

Clear the collection of SQL parameters available to the report.

Syntax

Namespace: FlexCel.Report

public void ClearParameters()

See also

  • FlexCelReport


FlexCelReport.SetValue Method | FlexCel Studio for the .NET Framework documentation

FlexCelReport.SetValue Method

Sets a variable for the report.

Syntax

Namespace: FlexCel.Report

public void SetValue(String name, Object value)

Parameters

<-> | Parameter | Type | Description
 | name | String | Name of the variable to set. Case insensitive.
 | value | Object | Value of the variable.

Examples

You can define a variable "CurrentDate" on the following way:

    flexCelReport.SetValue("CurrentDate", DateTime.Now);

Then, if you write <#CurrentDate> on a cell, the date will be shown. Note that the name is case insensitive, so both "CURRENTDATE" and "currentdate" refer to the same variable.

See also

  • FlexCelReport


FlexCelReport.ClearValues Method | FlexCel Studio for the .NET Framework documentation

FlexCelReport.ClearValues Method

Destroys all variables on the report. To add new variables, use SetValue

Syntax

Namespace: FlexCel.Report

public void ClearValues()

See also

  • FlexCelReport


FlexCelReport.SetExpression Method | FlexCel Studio for the .NET Framework documentation

FlexCelReport.SetExpression Method

Sets a user-defined expression to be used in the report. Different from SetValue this method will evaluate the <#tags> in "value". This allows you to provide formula functionality to end users, and to reuse the same report for different formulas.

Syntax

Namespace: FlexCel.Report

public void SetExpression(String name, Object value)

Parameters

<-> | Parameter | Type | Description
 | name | String | Name of the expression to set. Case insensitive.
 | value | Object | Value of the expression.

Examples

You could ask the user for an expression in an edit box, and then before running the report do:

    flexCelReport.SetExpression("MyExpression", EditBox.Text);

Then, if you write <#MyExpresion> on a cell, the expression will be evaluated and entered into the cell. If the user enters "<#evaluate(<#Order.Amount> * <#Order.Vat>)>" in the edit box, this formula will be evaluated into the cell. The user can write any <#tag> that could be used in an expression defined directly in the template.

See also

  • FlexCelReport


FlexCelReport.ClearExpressions Method | FlexCel Studio for the .NET Framework documentation

FlexCelReport.ClearExpressions Method

Destroys all user-defined expressions on the report. To add new expressions, use SetExpression

Syntax

Namespace: FlexCel.Report

public void ClearExpressions()

See also

  • FlexCelReport


FlexCelReport.SetUserFunction Method | FlexCel Studio for the .NET Framework documentation

FlexCelReport.SetUserFunction Method

Adds a new user defined function to be used with the report. For information on how to create the user function, see TFlexCelUserFunction

Syntax

Namespace: FlexCel.Report

public void SetUserFunction(String name, TFlexCelUserFunction functionImplementation)

Parameters

<-> | Parameter | Type | Description
 | name | String | Name that the function will have on the report. Case insensitive.
 | functionImplementation | TFlexCelUserFunction | An implementation of the user function.

Examples

You can define a function "MF" on the following way:

    MyUserFunction myFuncImpl = new MyUserFunction(); //The MyUserFunction class implements an user defined function.
    flexCelReport.SetUserFunction("MF", myFuncImpl); //The name used in Excel will be =MF().

Then, if you write <#MF(param1, param2... paramn)> on a cell, the function will be called and the result shown. Note that the name is case insensitive, so both "MF" and "mf" refer to the same function.

See also

  • FlexCelReport


FlexCelReport.ClearUserFunctions Method | FlexCel Studio for the .NET Framework documentation

FlexCelReport.ClearUserFunctions Method

Destroys all user defined functions on the report. To add new functions, use SetUserFunction

Syntax

Namespace: FlexCel.Report

public void ClearUserFunctions()

See also

  • FlexCelReport


FlexCelReport.SetUserFormat Method | FlexCel Studio for the .NET Framework documentation

FlexCelReport.SetUserFormat Method

Adds a new user defined format to be used with the report. For information on how to create the user format function, see TFlexCelUserFormat

Syntax

Namespace: FlexCel.Report

public void SetUserFormat(String name, TFlexCelUserFormat formatImplementation)

Parameters

<-> | Parameter | Type | Description
 | name | String | Name that the format will have on the report. Case insensitive.
 | formatImplementation | TFlexCelUserFormat | An implementation of the user format.

Examples

You can define a format "MFMT" on the following way:

    MyUserFormat myFormatImpl = new MyUserFormat(); //The MyUserFormat class implements an user defined format.
    flexCelReport.SetUserFormat("MFMT", myFormatImpl); //The name used in Excel will be =MFMT().

Then, if you define the format in the config sheet, you can use it inside <#format cell> tags. Note that the name is case insensitive, so both "MFMT" and "mfmt" refer to the same format.

See also

  • FlexCelReport


FlexCelReport.ClearUserFormats Method | FlexCel Studio for the .NET Framework documentation

FlexCelReport.ClearUserFormats Method

Destroys all user defined formats on the report. To add new formats, use SetUserFormat

Syntax

Namespace: FlexCel.Report

public void ClearUserFormats()

See also

  • FlexCelReport


FlexCelReport.AddRelationship Method | FlexCel Studio for the .NET Framework documentation

FlexCelReport.AddRelationship Method

Overloads

  • FlexCelReport.AddRelationship(String, String, String, String)
  • FlexCelReport.AddRelationship(String, String, String[], String[])

FlexCelReport.AddRelationship(String, String, String, String)

Adds a relationship between two tables. Note that if your tables are datasets, or come from Entity Framework, or your master detail tables are nested, you probably don't need to call this method. FlexCel will detect the relationships automatically and use them. This method is only for when you have custom data with no DataRelationships (as in a dataset) and where detail tables are not nested to the master (as in Entity Framework).

Remarks

You might use this method before adding the tables with AddTable. Tables must exist when running the report, not when adding the relationship.

Syntax

Namespace: FlexCel.Report

public void AddRelationship(String masterTable, String detailTable, String masterKeyFields, String detailKeyFields)

Parameters

<-> | Parameter | Type | Description
 | masterTable | String | Master table for the relationship.
 | detailTable | String | Detail table for the relationship.
 | masterKeyFields | String | Key fields in the master table that relate with the key fields in the detail table. Must not be null, and normally will be an array with a single field. It must be the same length as detailKeyFields/>
 | detailKeyFields | String | Key fields in the detail table that relate with the key fields in the master table. Must not be null, and normally will be an array with a single field.

See also

  • FlexCelReport

FlexCelReport.AddRelationship(String, String, String[], String[])

Adds a relationship between two tables. Note that if your tables are datasets, or come from Entity Framework, or your master detail tables are nested, you probably don't need to call this method. FlexCel will detect the relationships automatically and use them. This method is only for when you have custom data with no DataRelationships (as in a dataset) and where detail tables are not nested to the master (as in Entity Framework).

Remarks

You might use this method before adding the tables with AddTable. Tables must exist when running the report, not when adding the relationship.

Syntax

Namespace: FlexCel.Report

public void AddRelationship(String masterTable, String detailTable, String[] masterKeyFields, String[] detailKeyFields)

Parameters

<-> | Parameter | Type | Description
 | masterTable | String | Master table for the relationship.
 | detailTable | String | Detail table for the relationship.
 | masterKeyFields | String[] | Key fields in the master table that relate with the key fields in the detail table. Must not be null, and normally will be an array with a single field. It must be the same length as detailKeyFields/>
 | detailKeyFields | String[] | Key fields in the detail table that relate with the key fields in the master table. Must not be null, and normally will be an array with a single field.

See also

  • FlexCelReport


FlexCelReport.ClearRelationships Method | FlexCel Studio for the .NET Framework documentation

FlexCelReport.ClearRelationships Method

Clears all relationships added by AddRelationship(String, String, String, String).

Syntax

Namespace: FlexCel.Report

public void ClearRelationships()

See also

  • FlexCelReport


FlexCelReport.OnBeforeReadTemplate Method | FlexCel Studio for the .NET Framework documentation

FlexCelReport.OnBeforeReadTemplate Method

Replace this event when creating a custom descendant of FlexCelReport. See also BeforeReadTemplate

Syntax

Namespace: FlexCel.Report

protected virtual void OnBeforeReadTemplate(GenerateEventArgs e)

Parameters

<-> | Parameter | Type | Description
 | e | GenerateEventArgs |

See also

  • FlexCelReport


FlexCelReport.OnBeforeGenerateWorkbook Method | FlexCel Studio for the .NET Framework documentation

FlexCelReport.OnBeforeGenerateWorkbook Method

Replace this event when creating a custom descendant of FlexCelReport. See also BeforeGenerateWorkbook

Syntax

Namespace: FlexCel.Report

protected virtual void OnBeforeGenerateWorkbook(GenerateEventArgs e)

Parameters

<-> | Parameter | Type | Description
 | e | GenerateEventArgs |

See also

  • FlexCelReport


FlexCelReport.OnAfterGenerateWorkbook Method | FlexCel Studio for the .NET Framework documentation

FlexCelReport.OnAfterGenerateWorkbook Method

Replace this event when creating a custom descendant of FlexCelReport. See also AfterGenerateWorkbook

Syntax

Namespace: FlexCel.Report

protected virtual void OnAfterGenerateWorkbook(GenerateEventArgs e)

Parameters

<-> | Parameter | Type | Description
 | e | GenerateEventArgs |

See also

  • FlexCelReport


FlexCelReport.OnBeforeGenerateSheet Method | FlexCel Studio for the .NET Framework documentation

FlexCelReport.OnBeforeGenerateSheet Method

Replace this event when creating a custom descendant of FlexCelReport. See also BeforeGenerateSheet

Syntax

Namespace: FlexCel.Report

protected virtual void OnBeforeGenerateSheet(GenerateEventArgs e)

Parameters

<-> | Parameter | Type | Description
 | e | GenerateEventArgs |

See also

  • FlexCelReport


FlexCelReport.OnAfterGenerateSheet Method | FlexCel Studio for the .NET Framework documentation

FlexCelReport.OnAfterGenerateSheet Method

Replace this event when creating a custom descendant of FlexCelReport. See also AfterGenerateSheet

Syntax

Namespace: FlexCel.Report

protected virtual void OnAfterGenerateSheet(GenerateEventArgs e)

Parameters

<-> | Parameter | Type | Description
 | e | GenerateEventArgs |

See also

  • FlexCelReport


FlexCelReport.OnGetImageData Method | FlexCel Studio for the .NET Framework documentation

FlexCelReport.OnGetImageData Method

Replace this event when creating a custom descendant of FlexCelReport. See also GetImageData

Syntax

Namespace: FlexCel.Report

protected virtual void OnGetImageData(GetImageDataEventArgs e)

Parameters

<-> | Parameter | Type | Description
 | e | GetImageData​Event​Args |

See also

  • FlexCelReport


FlexCelReport.OnCustomizeChart Method | FlexCel Studio for the .NET Framework documentation

FlexCelReport.OnCustomizeChart Method

Replace this event when creating a custom descendant of FlexCelReport. See also CustomizeChart

Syntax

Namespace: FlexCel.Report

protected virtual void OnCustomizeChart(CustomizeChartEventArgs e)

Parameters

<-> | Parameter | Type | Description
 | e | CustomizeChart​Event​Args |

See also

  • FlexCelReport


FlexCelReport.OnGetInclude Method | FlexCel Studio for the .NET Framework documentation

FlexCelReport.OnGetInclude Method

Replace this event when creating a custom descendant of FlexCelReport. See also GetInclude

Syntax

Namespace: FlexCel.Report

protected internal virtual void OnGetInclude(GetIncludeEventArgs e)

Parameters

<-> | Parameter | Type | Description
 | e | GetIncludeEventArgs |

See also

  • FlexCelReport


FlexCelReport.OnUserTable Method | FlexCel Studio for the .NET Framework documentation

FlexCelReport.OnUserTable Method

Replace this event when creating a custom descendant of FlexCelReport. See also UserTable

Syntax

Namespace: FlexCel.Report

protected virtual void OnUserTable(UserTableEventArgs e)

Parameters

<-> | Parameter | Type | Description
 | e | UserTableEventArgs |

See also

  • FlexCelReport


FlexCelReport.OnLoadTable Method | FlexCel Studio for the .NET Framework documentation

FlexCelReport.OnLoadTable Method

Replace this event when creating a custom descendant of FlexCelReport. See also LoadTable

Syntax

Namespace: FlexCel.Report

protected virtual void OnLoadTable(LoadTableEventArgs e)

Parameters

<-> | Parameter | Type | Description
 | e | LoadTableEventArgs |

See also

  • FlexCelReport


FlexCelReport.Dispose Method | FlexCel Studio for the .NET Framework documentation

FlexCelReport.Dispose Method

Override this instance when creating descendants of FlexCelReport. Remember to always call base.Dispose(disposing).

Syntax

Namespace: FlexCel.Report

protected override void Dispose(Boolean disposing)

Parameters

<-> | Parameter | Type | Description
 | disposing | Boolean |

See also

  • FlexCelReport


FlexCelReport.Canceled Property | FlexCel Studio for the .NET Framework documentation

FlexCelReport.Canceled Property

If true the report has been canceled with Cancel method. You can't set this variable to false, and setting it true is the same as calling Cancel.

Syntax

Namespace: FlexCel.Report

public Boolean Canceled { get; set; }

See also

  • FlexCelReport


FlexCelReport.Progress Property | FlexCel Studio for the .NET Framework documentation

FlexCelReport.Progress Property

Progress of the report. This variable must be accessed from other thread.

Syntax

Namespace: FlexCel.Report

public FlexCelReportProgress Progress { get; }

See also

  • FlexCelReport


FlexCelReport.DeleteEmptyRanges Property | FlexCel Studio for the .NET Framework documentation

FlexCelReport.DeleteEmptyRanges Property

This property is obsolete. Use DeleteEmptyBands instead. Determines if FlexCel will delete or just clear ranges with empty datasets (0 records).

Syntax

Namespace: FlexCel.Report

public Boolean DeleteEmptyRanges { get; set; }

See also

  • FlexCelReport


FlexCelReport.DeleteEmptyBandsFixed Property | FlexCel Studio for the .NET Framework documentation

FlexCelReport.DeleteEmptyBandsFixed Property

Determines if FlexCel will delete or just clear ranges with empty datasets (0 records), for FIXED bands. Note that normally you don't want Fixed bands to delete rows, so this property defaults to TDeleteEmptyBands.ClearDataOnly.

Syntax

Namespace: FlexCel.Report

public TDeleteEmptyBands DeleteEmptyBandsFixed { get; set; }

See also

  • FlexCelReport
  • DeleteEmptyBands


FlexCelReport.DeleteEmptyBands Property | FlexCel Studio for the .NET Framework documentation

FlexCelReport.DeleteEmptyBands Property

Determines if FlexCel will delete or just clear ranges with empty datasets (0 records). Note that this property doesn't apply to FIXED bands, those are controlled with DeleteEmptyBandsFixed

Syntax

Namespace: FlexCel.Report

public TDeleteEmptyBands DeleteEmptyBands { get; set; }

See also

  • FlexCelReport
  • DeleteEmptyBandsFixed


FlexCelReport.UseExcelTablesAsBands Property | FlexCel Studio for the .NET Framework documentation

FlexCelReport.UseExcelTablesAsBands Property

Determines if FlexCel will use Tables named as "__table__" or similar as band definitions.

Syntax

Namespace: FlexCel.Report

public Boolean UseExcelTablesAsBands { get; set; }

See also

  • FlexCelReport


FlexCelReport.RenameExcelTablesUsedAsBands Property | FlexCel Studio for the .NET Framework documentation

FlexCelReport.RenameExcelTablesUsedAsBands Property

Determines if FlexCel will rename Tables used as band definitions after the report is run to remove the extra "__" in the name.

Syntax

Namespace: FlexCel.Report

public Boolean RenameExcelTablesUsedAsBands { get; set; }

See also

  • FlexCelReport


FlexCelReport.AllowOverwritingFiles Property | FlexCel Studio for the .NET Framework documentation

FlexCelReport.AllowOverwritingFiles Property

Determines if FlexCel will automatically delete existing files or not.

Syntax

Namespace: FlexCel.Report

public Boolean AllowOverwritingFiles { get; set; }

See also

  • FlexCelReport


FlexCelReport.ResetCellSelections Property | FlexCel Studio for the .NET Framework documentation

FlexCelReport.ResetCellSelections Property

When true, all sheets will selections will be reset to A1. This way, you do not need to care about setting the correct selection when editing the template.

Syntax

Namespace: FlexCel.Report

public Boolean ResetCellSelections { get; set; }

See also

  • FlexCelReport


FlexCelReport.HtmlMode Property | FlexCel Studio for the .NET Framework documentation

FlexCelReport.HtmlMode Property

When true, FlexCel will interpret the text as HTML, and honor the tags that it can understand. Note that when in HtmlMode, many consecutive spaces will be interpreted as one, and carriage returns will be interpreted as spaces. To enter real carriage returns you need to enter a <br> tag (unless the text is inside <pre> tags). Also & symbols need to be escaped. For more info on HTML syntax supported, see ExcelFile.SetCellFromHtml(Int32, Int32, String, Int32) Note that the <#HTML> tag can overwrite the Html behavior on a cell by cell basis.

Syntax

Namespace: FlexCel.Report

public Boolean HtmlMode { get; set; }

See also

  • FlexCelReport


FlexCelReport.DisableSQLValidation Property | FlexCel Studio for the .NET Framework documentation

FlexCelReport.DisableSQLValidation Property

If false (the default) FlexCelReport will only allow DirectSQL queries that begin with "SELECT", to avoid people doing inserts or deletes from the config sheet. If true, FlexCelReport will pass the DirectSQL queries you write in the config sheet directly to the server. Caution: Setting this property to true might have security implications. Take a look at the remarks.

Remarks

You can disable the SQL validation if for example you want to read data from stored procedures in SQL Server. While most databases will allow you to do a Select from a stored procedure, in SQL server you'll need to call "EXEC". For example:

sql(conn; exec GetOrders)

But note that if you disable SQL validation, you'll be letting the user run any arbitrary stored procedure in the server, or insert, update or delete records. In both cases, either with SQL validation true or false, you'll want to give the users a readonly connection with permissions only to the objects they need so they can't modify stuff in the database with the template. But if you disable SQL validation, then there is one less barrier to users modifying data in the database from the report.

Syntax

Namespace: FlexCel.Report

public Boolean DisableSQLValidation { get; set; }

See also

  • FlexCelReport


FlexCelReport.EnterFormulas Property | FlexCel Studio for the .NET Framework documentation

FlexCelReport.EnterFormulas Property

When true, FlexCel will try to enter any string starting with "=" as a formula instead of text. If this property is true, any string you enter that starts with "=" must be a valid formula, or an error will be raised. When you know a priori which cells will have formulas, you might want to use the <#formula> tag instead.

Syntax

Namespace: FlexCel.Report

public Boolean EnterFormulas { get; set; }

See also

  • FlexCelReport


FlexCelReport.TryToConvertStrings Property | FlexCel Studio for the .NET Framework documentation

FlexCelReport.TryToConvertStrings Property

When true, FlexCel will try to convert strings to numbers or dates before entering them into the cells. USE THIS PROPERTY WITH CARE! You shouldn't normally need to use this property, since FlexCel automatically enters numbers or dates in the DataSets as number or dates in the Excel file. If you need to use this property, it means that data in your database is stored as strings when they should not be. So the correct fix is to fix the columns you know should have numbers to have numbers, NOT to use this property. This is just a workaround when you can't do anything else about it.

Note also that this method is not efficient since it has to "guess" what a string might be if anything, and it might be wrong. Also, it might have issues with locales: Does the string "1/2/2008" means January 2 or February 1? Depends on the locale.

Remarks

If you have a single field which is a string but you want converted, you can write <#evaluate(VALUE(<#db.StringValue>))> in the cell you want converted and keep this property false.

Syntax

Namespace: FlexCel.Report

public Boolean TryToConvertStrings { get; set; }

See also

  • FlexCelReport


FlexCelReport.ExpressionRecursionLimit Property | FlexCel Studio for the .NET Framework documentation

FlexCelReport.ExpressionRecursionLimit Property

Defines how much nesting you can have in Expressions before FlexCel throws an error. You might have an expression like <#A> which is defined based in another expression <#B> which in turn is defined based in another one that finally might come back to <#A> As it is not possible for FlexCel to know if the recursion will finish or loop forever, it will try until it reaches the limit you set here. Note that a too big limit could cause a stack overflow.

Syntax

Namespace: FlexCel.Report

public Int32 ExpressionRecursionLimit { get; set; }

See also

  • FlexCelReport


FlexCelReport.RecalcMode Property | FlexCel Studio for the .NET Framework documentation

FlexCelReport.RecalcMode Property

Determines if the report will be recalculated before saving. See ExcelFile.RecalcMode for more info.

Syntax

Namespace: FlexCel.Report

public TRecalcMode RecalcMode { get; set; }

See also

  • FlexCelReport


FlexCelReport.RecalcVersion Property | FlexCel Studio for the .NET Framework documentation

FlexCelReport.RecalcVersion Property

Before changing this property, look at ExcelFile.RecalcVersion Determines if the formulas will be recalculated when Excel opens them.

Syntax

Namespace: FlexCel.Report

public TRecalcVersion RecalcVersion { get; set; }

See also

  • FlexCelReport


FlexCelReport.ErrorActions Property | FlexCel Studio for the .NET Framework documentation

FlexCelReport.ErrorActions Property

Determines if FlexCel will throw Exceptions or just ignore errors on specific situations. When the errors are ignored, they will be logged into the FlexCelTrace class.

Syntax

Namespace: FlexCel.Report

public TErrorActions ErrorActions { get; set; }

See also

  • FlexCelReport


FlexCelReport.ErrorsInResultFile Property | FlexCel Studio for the .NET Framework documentation

FlexCelReport.ErrorsInResultFile Property

When true and there is an error reading cells in the template or writing the cells in the report, the error message will be written in the corresponding cell on the generated report. No Exception will be thrown.

You can use this property to DEBUG reports, as it provides an easy way to see all errors at once in the place they are produced. But is it recommended that you leave this property FALSE in production, or you could create xls files with error messages inside. See also DebugExpressions

Remarks

You can also set this property in the template, by writing <#ErrorsInResultFile> in the expressions column in the config sheet.

Syntax

Namespace: FlexCel.Report

public Boolean ErrorsInResultFile { get; set; }

See also

  • FlexCelReport


FlexCelReport.DebugExpressions Property | FlexCel Studio for the .NET Framework documentation

FlexCelReport.DebugExpressions Property

Set this value to true if you want to analyze how FlexCel is evaluating the tags in a file. When true, a full stack trace will be written in the cell instead of the tag values. See 'Debugging reports' in the Reports Designer Guide for information on how to use those stack traces.

Remarks

You can also set this property in the template, by writing <#Debug> in the expressions column in the config sheet. Debug in the template will set both this property and ErrorsInResultFile to true.

Syntax

Namespace: FlexCel.Report

public Boolean DebugExpressions { get; set; }

See also

  • FlexCelReport


FlexCelReport.DebugIntelligentPageBreaks Property | FlexCel Studio for the .NET Framework documentation

FlexCelReport.DebugIntelligentPageBreaks Property

Set this value to true if you want to analyze how FlexCel is setting up the intelligent page breaks. When this property is true, FlexCel will add one row at the top of the spreadsheet (if the sheet has keeptogether column ranges), and one column at the left of the spreadsheet (if the sheet has keeptogether row ranges). This row and column will show the levels of keeptogether in the respective column and row. See 'Debugging intelligent page breaks' in the Reports Designer Guide for more information.

Remarks

You can also set this property in the template, by writing <#Debug Intelligent Page Breaks> in the expressions column in the config sheet.

Syntax

Namespace: FlexCel.Report

public Boolean DebugIntelligentPageBreaks { get; set; }

See also

  • FlexCelReport


FlexCelReport.SqlParameterReplace Property | FlexCel Studio for the .NET Framework documentation

FlexCelReport.SqlParameterReplace Property

Format string for replacing the standard parameter names on DIRECT SQL commands. You can leave it empty for ODBC, OLEDB or SQLSERVER databases. See Also SqlParametersType

Remarks

On ADO.NET sql parameters can be defined on multiple ways, depending on the database you use. For example, SQL Server will use "@ParamName", while OLEDB will use "?" as parameter id. But, to keep templates database independent, you will always use "@ParamName" notation on the Direct SQL commands you write on templates. When using OLEDB, ODBC or SqlSever, FlexCel knows how to replace the correct parameters on the SQL on templates, but for more generic databases you might need to use this property. This is a standard .NET format string, where {0} will be replaced by the parameter name. For example, on Oracle database you might need to set this value to ":{0}" (without quotes) that will translate on ":ParamName"

Syntax

Namespace: FlexCel.Report

public String SqlParameterReplace { get; set; }

Examples

On oracle databases, you can set this property to ":{0}" (without quotes) It will create parameters of type ":ParamName".

See also

  • FlexCelReport


FlexCelReport.SqlParametersType Property | FlexCel Studio for the .NET Framework documentation

FlexCelReport.SqlParametersType Property

Type of parameters for the database. Positional parameters are the ones where you write "?" on the sql, and positional are when you write a name, like "@employee" or ":orderid". See Also SqlParameterReplace

Syntax

Namespace: FlexCel.Report

public TSqlParametersType SqlParametersType { get; set; }

See also

  • FlexCelReport


FlexCelReport.SemiAbsoluteReferences Property | FlexCel Studio for the .NET Framework documentation

FlexCelReport.SemiAbsoluteReferences Property

When this property is set to true, absolute references to cells inside bands being copied will be treated as relative. This way, if you have "=$A$1" inside a band and cell A1 is also inside the band, it will change to A2,A3..etc when the band is copied down. This can be useful in a master-detail report, where you want the cells in the detail to point to a fixed cell inside every record of the master. See ExcelFile.SemiAbsoluteReferences for more information.

Remarks

You can also set this property in the template, by writing <#Semi Absolute References> or <#Absolute References> in the expressions column in the config sheet.

Syntax

Namespace: FlexCel.Report

public Boolean SemiAbsoluteReferences { get; set; }

See also

  • FlexCelReport


FlexCelReport.UseLegacyLookup Property | FlexCel Studio for the .NET Framework documentation

FlexCelReport.UseLegacyLookup Property

When true, FlexCel will use DataViews to do lookups in DataSets, instead of using its own internal lookup algorithm. Only set this property to true if you have legacy reports that break when you use the internal lookup algorithm, because they depended in bugs in the DataView lookup implementation. For all new code, keep this property false.

Syntax

Namespace: FlexCel.Report

public static Boolean UseLegacyLookup { get; set; }

See also

  • FlexCelReport


FlexCelReport.BeforeReadTemplate Event | FlexCel Studio for the .NET Framework documentation

FlexCelReport.BeforeReadTemplate Event

Fires before starting to generate the report and before the template has been loaded. It allows you to provide the template password if you are using one.

Syntax

Namespace: FlexCel.Report

public GenerateEventHandler BeforeReadTemplate

See also

  • FlexCelReport


FlexCelReport.BeforeGenerateWorkbook Event | FlexCel Studio for the .NET Framework documentation

FlexCelReport.BeforeGenerateWorkbook Event

Fires before starting to generate the report but after the template has been loaded. It allows to do some in-place modifications to the template before generating the report.

Syntax

Namespace: FlexCel.Report

public GenerateEventHandler BeforeGenerateWorkbook

See also

  • FlexCelReport


FlexCelReport.AfterGenerateWorkbook Event | FlexCel Studio for the .NET Framework documentation

FlexCelReport.AfterGenerateWorkbook Event

Fires After the report has been fully generated but is not saved. Allows to do last clean up things before saving the report.

Syntax

Namespace: FlexCel.Report

public GenerateEventHandler AfterGenerateWorkbook

See also

  • FlexCelReport


FlexCelReport.BeforeGenerateSheet Event | FlexCel Studio for the .NET Framework documentation

FlexCelReport.BeforeGenerateSheet Event

Fires Before each sheet on the file is generated.

Syntax

Namespace: FlexCel.Report

public GenerateEventHandler BeforeGenerateSheet

See also

  • FlexCelReport


FlexCelReport.AfterGenerateSheet Event | FlexCel Studio for the .NET Framework documentation

FlexCelReport.AfterGenerateSheet Event

Fires After each sheet on the file is generated.

Syntax

Namespace: FlexCel.Report

public GenerateEventHandler AfterGenerateSheet

See also

  • FlexCelReport


FlexCelReport.GetImageData Event | FlexCel Studio for the .NET Framework documentation

FlexCelReport.GetImageData Event

Fires before an image is saved to the report. Use it if the image is on a proprietary format on the database, to return a format FlexCel can understand.

Syntax

Namespace: FlexCel.Report

public GetImageDataEventHandler GetImageData

See also

  • FlexCelReport


FlexCelReport.CustomizeChart Event | FlexCel Studio for the .NET Framework documentation

FlexCelReport.CustomizeChart Event

Fires for each chart in each sheet, after the report has been generated. Allows to do custom modifications to the charts, like for example setting series colors.

Syntax

Namespace: FlexCel.Report

public CustomizeChartEventHandler CustomizeChart

Examples

Imagine you want to set the maximum of the x-axis so it ends exactly at the maximum point in your chart.

You can use the following code to do it:

    using (FlexCelReport flexcelReport = new FlexCelReport(true))
    {
        flexcelReport.CustomizeChart += (sender, args) =>
        {
            var axis = args.Chart.GetChartAxis();
            for (int i = 0; i < axis.Length; i++)
            {
                if (axis[i].CategoryAxis != null)
                {
                    //MaxValueForAxis is a method that returns the value we want to set for the Axis.
                    ((TValueAxis)axis[i].CategoryAxis).Max = MaxValueForAxis();
                    ((TValueAxis)axis[i].CategoryAxis).AxisOptions &= ~TValueAxisOptions.AutoMax;
                }
                args.Chart.SetChartAxis(axis[i]);
            }
        };
        flexcelReport.Run("Template.xlsx", "Result.xlsx");
    }

Imagine you want to set each series color to a specific value.

You can use the following code to do it:

    using (FlexCelReport flexcelReport = new FlexCelReport(true))
    {
        flexcelReport.CustomizeChart += (sender, e) =>
        {
            if (e.ChartName == "ChartIWantToModify")
            {
                //In this event we will set the colors of the series depending on the product.
                //Let's imagine each product has an associated color that we want to use for its series.
                //The method ColorForProducts returns the color we want to give to that series.
                for (int subChart = 1; subChart <= e.Chart.SubchartCount; subChart++)
                {
                    for (int series = 1; series <= e.Chart.SeriesInSubchart(subChart); series++)
                    {
                        var seriesDef = e.Chart.GetSeriesInSubchart(subChart, series, true, true, true);
                        var seriesOptions = seriesDef.Options[-1];
                        seriesOptions.FillOptions = new ChartSeriesFillOptions(
                            new TShapeFill(true, new TSolidFill(ColorForProduct(series))), null, false, false);
                        seriesOptions.LineOptions = new ChartSeriesLineOptions(
                            new TShapeLine(true, new TLineStyle(new TSolidFill(ColorForProduct(series)))), false);
                        e.Chart.SetSeriesInSubchart(subChart, series, seriesDef);
                    }
                }
            }

        };
        flexcelReport.Run("Template.xlsx", "Result.xlsx");
    }

See also

  • FlexCelReport


FlexCelReport.GetInclude Event | FlexCel Studio for the .NET Framework documentation

FlexCelReport.GetInclude Event

Fires before including a file with <#include>. Use it if you want to provide an alternative path for the file, of if you want to read the include file from a different place, for example a database or an embedded resource.

Remarks

If the including file is a real file (not an stream) and FileName is relative, it will be relative to the including file path.

Syntax

Namespace: FlexCel.Report

public GetIncludeEventHandler GetInclude

See also

  • FlexCelReport


FlexCelReport.UserTable Event | FlexCel Studio for the .NET Framework documentation

FlexCelReport.UserTable Event

Fires on each <#USER TABLE> tag in the config sheet, allowing to add your own datasets to the report.

Syntax

Namespace: FlexCel.Report

public UserTableEventHandler UserTable

See also

  • FlexCelReport


FlexCelReport.LoadTable Event | FlexCel Studio for the .NET Framework documentation

FlexCelReport.LoadTable Event

Fires whenever an undefined table is called, allowing to load your own datasets in demand to the report. For more control, you might use User Tables. Look at the example for more information.

Syntax

Namespace: FlexCel.Report

public LoadTableEventHandler LoadTable

Examples

If you are running a report and don't know beforehand which tables it uses, you can use the following event:

    using (FlexCelReport flexcelReport = new FlexCelReport(true))
    {
        flexcelReport.LoadTable += (sender, e) =>
        {
            //Here GetTable is a method that returns the table to insert with our data.
            flexcelReport.AddTable(e.TableName, GetTable(e.TableName), TDisposeMode.DisposeAfterRun);
        };

        flexcelReport.Run("Template.xlsx", "Result.xlsx");
    }

Instead of using fr.AddTable for all used tables before running the report. If you need tables on demand, you might also look at User Tables or Direct SQL.

See also

  • FlexCelReport


FlexCelReportProgress Class | FlexCel Studio for the .NET Framework documentation

FlexCelReportProgress Class

Indicates how much of the report has been generated.

Syntax

Namespace: FlexCel.Report

public class FlexCelReportProgress

Properties

Name | Description
Phase | Phase of the report.
Counter | A meaningless counter that is increased from time to time. It is not possible to know what is the final count.
Sheet | The Sheet we are working on.


FlexCelReportProgress.Phase Property | FlexCel Studio for the .NET Framework documentation

FlexCelReportProgress.Phase Property

Phase of the report.

Syntax

Namespace: FlexCel.Report

public FlexCelReportProgressPhase Phase { get; }

See also

  • FlexCelReportProgress


FlexCelReportProgress.Counter Property | FlexCel Studio for the .NET Framework documentation

FlexCelReportProgress.Counter Property

A meaningless counter that is increased from time to time. It is not possible to know what is the final count.

Syntax

Namespace: FlexCel.Report

public Int32 Counter { get; }

See also

  • FlexCelReportProgress


FlexCelReportProgress.Sheet Property | FlexCel Studio for the .NET Framework documentation

FlexCelReportProgress.Sheet Property

The Sheet we are working on.

Syntax

Namespace: FlexCel.Report

public Int32 Sheet { get; }

See also

  • FlexCelReportProgress


GenerateEventArgs Class | FlexCel Studio for the .NET Framework documentation

GenerateEventArgs Class

Arguments passed on FlexCelReport.BeforeGenerateWorkbook, FlexCelReport.AfterGenerateWorkbook, FlexCelReport.BeforeGenerateSheet and FlexCelReport.AfterGenerateSheet

Syntax

Namespace: FlexCel.Report

public class GenerateEventArgs: EventArgs

Constructors

Name | Description
GenerateEventArgs | Creates a new Argument.

Properties

Name | Description
File | The file with the report data.


GenerateEventArgs.GenerateEventArgs Constructor | FlexCel Studio for the .NET Framework documentation

GenerateEventArgs.GenerateEventArgs Constructor

Creates a new Argument.

Syntax

Namespace: FlexCel.Report

public GenerateEventArgs(ExcelFile aExcelFile)

Parameters

<-> | Parameter | Type | Description
 | aExcelFile | ExcelFile | The file we are processing.

See also

  • GenerateEventArgs


GenerateEventArgs.File Property | FlexCel Studio for the .NET Framework documentation

GenerateEventArgs.File Property

The file with the report data.

Syntax

Namespace: FlexCel.Report

public ExcelFile File { get; }

See also

  • GenerateEventArgs


GetImageDataEventArgs Class | FlexCel Studio for the .NET Framework documentation

GetImageDataEventArgs Class

Arguments passed on FlexCelReport.GetImageData

Syntax

Namespace: FlexCel.Report

public class GetImageDataEventArgs: EventArgs

Constructors

Name | Description
GetImageData​Event​Args | Creates a new Argument.

Properties

Name | Description
File | The file with the report data.
ImageName | The name of the image on the Excel sheet. Use it to identify it.
ImageData | The data of the image. You can modify it to return another image format.
Height | The height of the image in pixels. Change it to resize the image.
Width | The width of the image in pixels. Change it to resize the image.


GetImageDataEventArgs.GetImageDataEventArgs Constructor | FlexCel Studio for the .NET Framework documentation

GetImageDataEventArgs.GetImageDataEventArgs Constructor

Creates a new Argument.

Syntax

Namespace: FlexCel.Report

public GetImageDataEventArgs(ExcelFile aExcelFile, String aImageName, Byte[] aImageData, Double aHeight, Double aWidth)

Parameters

<-> | Parameter | Type | Description
 | aExcelFile | ExcelFile | The file we are processing.
 | aImageName | String | The name of the image on the Excel sheet. Use it to identify it.
 | aImageData | Byte[] | The image data.
 | aHeight | Double | The height of the image in pixels. Change it to resize the image.
 | aWidth | Double | The width of the image in pixels. Change it to resize the image.

See also

  • GetImageDataEventArgs


GetImageDataEventArgs.File Property | FlexCel Studio for the .NET Framework documentation

GetImageDataEventArgs.File Property

The file with the report data.

Syntax

Namespace: FlexCel.Report

public ExcelFile File { get; }

See also

  • GetImageDataEventArgs


GetImageDataEventArgs.ImageName Property | FlexCel Studio for the .NET Framework documentation

GetImageDataEventArgs.ImageName Property

The name of the image on the Excel sheet. Use it to identify it.

Syntax

Namespace: FlexCel.Report

public String ImageName { get; set; }

See also

  • GetImageDataEventArgs


GetImageDataEventArgs.ImageData Property | FlexCel Studio for the .NET Framework documentation

GetImageDataEventArgs.ImageData Property

The data of the image. You can modify it to return another image format.

Syntax

Namespace: FlexCel.Report

public Byte[] ImageData { get; set; }

See also

  • GetImageDataEventArgs


GetImageDataEventArgs.Height Property | FlexCel Studio for the .NET Framework documentation

GetImageDataEventArgs.Height Property

The height of the image in pixels. Change it to resize the image.

Syntax

Namespace: FlexCel.Report

public Double Height { get; set; }

See also

  • GetImageDataEventArgs


GetImageDataEventArgs.Width Property | FlexCel Studio for the .NET Framework documentation

GetImageDataEventArgs.Width Property

The width of the image in pixels. Change it to resize the image.

Syntax

Namespace: FlexCel.Report

public Double Width { get; set; }

See also

  • GetImageDataEventArgs


GetIncludeEventArgs Class | FlexCel Studio for the .NET Framework documentation

GetIncludeEventArgs Class

Arguments passed on FlexCelReport.GetInclude

Syntax

Namespace: FlexCel.Report

public class GetIncludeEventArgs: EventArgs

Constructors

Name | Description
GetIncludeEventArgs | Creates a new Argument.

Properties

Name | Description
File | The file with the report.
FileName | File we are trying to include. you can modify it to point to other place. If the including file is a real file (not an stream) and FileName is relative, it will be relative to the including file path.
IncludeData | Here you can return the included file as an array of bytes. If you return null, the filename will be used to search for a file on the disk. If the including file is a real file (not an stream) and FileName is relative, it will be relative to the including file path.


GetIncludeEventArgs.GetIncludeEventArgs Constructor | FlexCel Studio for the .NET Framework documentation

GetIncludeEventArgs.GetIncludeEventArgs Constructor

Creates a new Argument.

Syntax

Namespace: FlexCel.Report

public GetIncludeEventArgs(ExcelFile aExcelFile, String aFileName, Byte[] aIncludeData)

Parameters

<-> | Parameter | Type | Description
 | aExcelFile | ExcelFile | The ExcelFile that has the report doing the include.
 | aFileName | String | File that we are trying to include.
 | aIncludeData | Byte[] | The included file as an array of bytes. If you return null, the file will be searched on disk.

See also

  • GetIncludeEventArgs


GetIncludeEventArgs.File Property | FlexCel Studio for the .NET Framework documentation

GetIncludeEventArgs.File Property

The file with the report.

Syntax

Namespace: FlexCel.Report

public ExcelFile File { get; }

See also

  • GetIncludeEventArgs


GetIncludeEventArgs.FileName Property | FlexCel Studio for the .NET Framework documentation

GetIncludeEventArgs.FileName Property

File we are trying to include. you can modify it to point to other place. If the including file is a real file (not an stream) and FileName is relative, it will be relative to the including file path.

Syntax

Namespace: FlexCel.Report

public String FileName { get; set; }

See also

  • GetIncludeEventArgs


GetIncludeEventArgs.IncludeData Property | FlexCel Studio for the .NET Framework documentation

GetIncludeEventArgs.IncludeData Property

Here you can return the included file as an array of bytes. If you return null, the filename will be used to search for a file on the disk. If the including file is a real file (not an stream) and FileName is relative, it will be relative to the including file path.

Syntax

Namespace: FlexCel.Report

public Byte[] IncludeData { get; set; }

See also

  • GetIncludeEventArgs


LoadTableEventArgs Class | FlexCel Studio for the .NET Framework documentation

LoadTableEventArgs Class

Arguments passed on FlexCelReport.LoadTable

Syntax

Namespace: FlexCel.Report

public class LoadTableEventArgs: EventArgs

Constructors

Name | Description
LoadTableEventArgs | Creates a new Argument.

Properties

Name | Description
TableName | The table that needs to be loaded on demand.


LoadTableEventArgs.LoadTableEventArgs Constructor | FlexCel Studio for the .NET Framework documentation

LoadTableEventArgs.LoadTableEventArgs Constructor

Creates a new Argument.

Syntax

Namespace: FlexCel.Report

public LoadTableEventArgs(String aTableName)

Parameters

<-> | Parameter | Type | Description
 | aTableName | String | The table that needs to be loaded on demand.

See also

  • LoadTableEventArgs


LoadTableEventArgs.TableName Property | FlexCel Studio for the .NET Framework documentation

LoadTableEventArgs.TableName Property

The table that needs to be loaded on demand.

Syntax

Namespace: FlexCel.Report

public String TableName { get; }

See also

  • LoadTableEventArgs


ReportTag Class | FlexCel Studio for the .NET Framework documentation

ReportTag Class

Tags used in reports.

Syntax

Namespace: FlexCel.Report

public static class ReportTag

Methods

Name | Description
TryGetTag | All available tags.
TryGetTagParams | Number of params for all available tags.
ConfigTag | Returns a particular configuration tag.
ConfigTagParams | Returns the parameters for a particular configuration tag.

Properties

Name | Description
StrOpen | Open a Tag.
StrOpenHLink | **WARNING**Excel2003 does not let you write this either on hyperlinks, so use StrOpenHLink2. Open an Hyperlink Tag. As we can't use # on hyperlink texts, this gives an alternative.
StrOpenHLink2 | Open an Hyperlink Tag. As we can't use # on hyperlink texts, this gives an alternative.
StrClose | Close a Tag.
StrCloseHLink | Close an Hyperlink Tag. As we can't use # on hyperlink texts, this gives an alternative.
ParamDelim | Function delimiter. (for example: "<#if(xx ; yy ; zz)>
StrOpenParen | Open Parenthesis.
StrCloseParen | Close Parenthesis.
StrQuote | Quote.
DbSeparator | "."
StrFullDs | "*"
StrFullDsCaptions | "**"
StrDeleteLastRow | "X"
StrDontInsertRanges | "FIXED"
StrDataSetAlias | "ALIAS"
StrDataSetAlias2 | "..ALIAS.."
StrExcludeSheet | "."
Relationship​Separator | "->"
InternalDB | "_​_​#​#​INT_​RNAL_​"
StrRowCountColumn | "#RecordCount"
StrRowPosColumn | "#RecordPos"
StrShow | "Show"
StrHide | "Hide"
StrVeryHide | "Very Hide"
StrAutofit | "Autofit"
StrAutofitOn | "All"
StrAutofitOff | "Selected"
StrKeepAutofit | "Keep"
StrDontKeepAutofit | "Fixed"
StrAutofitModeFirst | "First"
StrAutofitModeLast | "Last"
StrAutofitModeNone | "None"
StrAutofitMode​Balanced | "Balanced"
StrDefinedLocal | "Local"
StrDefinedGlobal | "Global"
StrRelativeDelete | "Relative"
StrFullDelete | "Full"
StrStaticInclude | "Static"
StrDynamicInclude | "Dynamic"
StrCopyRows | "R"
StrCopyCols | "C"
StrCopyRowsAndCols | "RC"
StrAlignLeft | "LEFT"
StrAlignCenter | "Center"
StrAlignRight | "Right"
StrAlignTop | "Top"
StrAlignBottom | "Bottom"
StrInRow | "InRow"
StrInCol | "InCol"
StrDontGrow | "DontGrow"
StrDontShrink | "DontShrink"
StrAggSum | "Sum"
StrAggAvg | "Avg"
StrAggMax | "Max"
StrAggMin | "Min"
StrAggCount | "Count"
StrDbStart | "["
StrDbEnd | "]"
RowRange1 | Range delimiter.
RowFull1 | Range delimiter.
RowRange2 | Range delimiter.
RowFull2 | Range delimiter.
ColRange1 | Range delimiter.
ColFull1 | Range delimiter.
ColRange2 | Range delimiter.
ColFull2 | Range delimiter.
CrossTabRange1 | Range delimiter.
CrossTabRange2 | Range delimiter.
CrossTabFull1 | Range delimiter.
CrossTabFull2 | Range delimiter.
KeepRowsTogether | Named Range starting with KeepRows_
KeepColsTogether | Named Range starting with KeepColumns_
StrEndKeepTogether | End of tag for keeprowstogether and keepcolstogether
TagTableKeys | List of tag ids.
StrEqual | =
StrConfigSheet | CONFIG
StrDebug | DEBUG
StrErrorsInResult​File | ERRORSINRESULTFILE
StrDebugIntelligent​Page​Breaks | DEBUGINTELLIGENTPAGEBREAKS
StrSemiAbsolute​References | SEMIABSOLUTEREFERENCES
StrAbsoluteReferences | ABSOLUTEREFERENCES
SwapSeries | SWAP SERIES


ReportTag.TryGetTag Method | FlexCel Studio for the .NET Framework documentation

ReportTag.TryGetTag Method

All available tags.

Syntax

Namespace: FlexCel.Report

public static Boolean TryGetTag(String TagId, out TValueType ResultValue)

Parameters

<-> | Parameter | Type | Description
 | TagId | String |
out | ResultValue | TValueType |

See also

  • ReportTag


ReportTag.TryGetTagParams Method | FlexCel Studio for the .NET Framework documentation

ReportTag.TryGetTagParams Method

Number of params for all available tags.

Syntax

Namespace: FlexCel.Report

public static Boolean TryGetTagParams(String key, out Int32 ResultValue)

Parameters

<-> | Parameter | Type | Description
 | key | String |
out | ResultValue | Int32 |

See also

  • ReportTag


ReportTag.ConfigTag Method | FlexCel Studio for the .NET Framework documentation

ReportTag.ConfigTag Method

Returns a particular configuration tag.

Syntax

Namespace: FlexCel.Report

public static String ConfigTag(ConfigTagEnum tag)

Parameters

<-> | Parameter | Type | Description
 | tag | ConfigTagEnum |

See also

  • ReportTag


ReportTag.ConfigTagParams Method | FlexCel Studio for the .NET Framework documentation

ReportTag.ConfigTagParams Method

Returns the parameters for a particular configuration tag.

Syntax

Namespace: FlexCel.Report

public static String ConfigTagParams(ConfigTagEnum tag)

Parameters

<-> | Parameter | Type | Description
 | tag | ConfigTagEnum |

See also

  • ReportTag


ReportTag.StrOpen Property | FlexCel Studio for the .NET Framework documentation

ReportTag.StrOpen Property

Open a Tag.

Syntax

Namespace: FlexCel.Report

public static String StrOpen { get; }

See also

  • ReportTag


ReportTag.StrOpenHLink Property | FlexCel Studio for the .NET Framework documentation

ReportTag.StrOpenHLink Property

**WARNING**Excel2003 does not let you write this either on hyperlinks, so use StrOpenHLink2. Open an Hyperlink Tag. As we can't use # on hyperlink texts, this gives an alternative.

Syntax

Namespace: FlexCel.Report

public static String StrOpenHLink { get; }

See also

  • ReportTag


ReportTag.StrOpenHLink2 Property | FlexCel Studio for the .NET Framework documentation

ReportTag.StrOpenHLink2 Property

Open an Hyperlink Tag. As we can't use # on hyperlink texts, this gives an alternative.

Syntax

Namespace: FlexCel.Report

public static String StrOpenHLink2 { get; }

See also

  • ReportTag


ReportTag.StrClose Property | FlexCel Studio for the .NET Framework documentation

ReportTag.StrClose Property

Close a Tag.

Syntax

Namespace: FlexCel.Report

public static String StrClose { get; }

See also

  • ReportTag


ReportTag.StrCloseHLink Property | FlexCel Studio for the .NET Framework documentation

ReportTag.StrCloseHLink Property

Close an Hyperlink Tag. As we can't use # on hyperlink texts, this gives an alternative.

Syntax

Namespace: FlexCel.Report

public static String StrCloseHLink { get; }

See also

  • ReportTag


ReportTag.ParamDelim Property | FlexCel Studio for the .NET Framework documentation

ReportTag.ParamDelim Property

Function delimiter. (for example: "<#if(xx ; yy ; zz)>

Syntax

Namespace: FlexCel.Report

public static Char ParamDelim { get; }

See also

  • ReportTag


ReportTag.StrOpenParen Property | FlexCel Studio for the .NET Framework documentation

ReportTag.StrOpenParen Property

Open Parenthesis.

Syntax

Namespace: FlexCel.Report

public static Char StrOpenParen { get; }

See also

  • ReportTag


ReportTag.StrCloseParen Property | FlexCel Studio for the .NET Framework documentation

ReportTag.StrCloseParen Property

Close Parenthesis.

Syntax

Namespace: FlexCel.Report

public static Char StrCloseParen { get; }

See also

  • ReportTag


ReportTag.StrQuote Property | FlexCel Studio for the .NET Framework documentation

ReportTag.StrQuote Property

Quote.

Syntax

Namespace: FlexCel.Report

public static Char StrQuote { get; }

See also

  • ReportTag


ReportTag.DbSeparator Property | FlexCel Studio for the .NET Framework documentation

ReportTag.DbSeparator Property

"."

Syntax

Namespace: FlexCel.Report

public static String DbSeparator { get; }

See also

  • ReportTag


ReportTag.StrFullDs Property | FlexCel Studio for the .NET Framework documentation

ReportTag.StrFullDs Property

"*"

Syntax

Namespace: FlexCel.Report

public static String StrFullDs { get; }

See also

  • ReportTag


ReportTag.StrFullDsCaptions Property | FlexCel Studio for the .NET Framework documentation

ReportTag.StrFullDsCaptions Property

"**"

Syntax

Namespace: FlexCel.Report

public static String StrFullDsCaptions { get; }

See also

  • ReportTag


ReportTag.StrDeleteLastRow Property | FlexCel Studio for the .NET Framework documentation

ReportTag.StrDeleteLastRow Property

"X"

Syntax

Namespace: FlexCel.Report

public static String StrDeleteLastRow { get; }

See also

  • ReportTag


ReportTag.StrDontInsertRanges Property | FlexCel Studio for the .NET Framework documentation

ReportTag.StrDontInsertRanges Property

"FIXED"

Syntax

Namespace: FlexCel.Report

public static String StrDontInsertRanges { get; }

See also

  • ReportTag


ReportTag.StrDataSetAlias Property | FlexCel Studio for the .NET Framework documentation

ReportTag.StrDataSetAlias Property

"ALIAS"

Syntax

Namespace: FlexCel.Report

public static String StrDataSetAlias { get; }

See also

  • ReportTag


ReportTag.StrDataSetAlias2 Property | FlexCel Studio for the .NET Framework documentation

ReportTag.StrDataSetAlias2 Property

"..ALIAS.."

Syntax

Namespace: FlexCel.Report

public static String StrDataSetAlias2 { get; }

See also

  • ReportTag


ReportTag.StrExcludeSheet Property | FlexCel Studio for the .NET Framework documentation

ReportTag.StrExcludeSheet Property

"."

Syntax

Namespace: FlexCel.Report

public static String StrExcludeSheet { get; }

See also

  • ReportTag


ReportTag.RelationshipSeparator Property | FlexCel Studio for the .NET Framework documentation

ReportTag.RelationshipSeparator Property

"->"

Syntax

Namespace: FlexCel.Report

public static String RelationshipSeparator { get; }

See also

  • ReportTag


ReportTag.InternalDB Property | FlexCel Studio for the .NET Framework documentation

ReportTag.InternalDB Property

"__##INT_RNAL_"

Syntax

Namespace: FlexCel.Report

public static String InternalDB { get; }

See also

  • ReportTag


ReportTag.StrRowCountColumn Property | FlexCel Studio for the .NET Framework documentation

ReportTag.StrRowCountColumn Property

"#RecordCount"

Syntax

Namespace: FlexCel.Report

public static String StrRowCountColumn { get; }

See also

  • ReportTag


ReportTag.StrRowPosColumn Property | FlexCel Studio for the .NET Framework documentation

ReportTag.StrRowPosColumn Property

"#RecordPos"

Syntax

Namespace: FlexCel.Report

public static String StrRowPosColumn { get; }

See also

  • ReportTag


ReportTag.StrShow Property | FlexCel Studio for the .NET Framework documentation

ReportTag.StrShow Property

"Show"

Syntax

Namespace: FlexCel.Report

public static String StrShow { get; }

See also

  • ReportTag


ReportTag.StrHide Property | FlexCel Studio for the .NET Framework documentation

ReportTag.StrHide Property

"Hide"

Syntax

Namespace: FlexCel.Report

public static String StrHide { get; }

See also

  • ReportTag


ReportTag.StrVeryHide Property | FlexCel Studio for the .NET Framework documentation

ReportTag.StrVeryHide Property

"Very Hide"

Syntax

Namespace: FlexCel.Report

public static String StrVeryHide { get; }

See also

  • ReportTag


ReportTag.StrAutofit Property | FlexCel Studio for the .NET Framework documentation

ReportTag.StrAutofit Property

"Autofit"

Syntax

Namespace: FlexCel.Report

public static String StrAutofit { get; }

See also

  • ReportTag


ReportTag.StrAutofitOn Property | FlexCel Studio for the .NET Framework documentation

ReportTag.StrAutofitOn Property

"All"

Syntax

Namespace: FlexCel.Report

public static String StrAutofitOn { get; }

See also

  • ReportTag


ReportTag.StrAutofitOff Property | FlexCel Studio for the .NET Framework documentation

ReportTag.StrAutofitOff Property

"Selected"

Syntax

Namespace: FlexCel.Report

public static String StrAutofitOff { get; }

See also

  • ReportTag


ReportTag.StrKeepAutofit Property | FlexCel Studio for the .NET Framework documentation

ReportTag.StrKeepAutofit Property

"Keep"

Syntax

Namespace: FlexCel.Report

public static String StrKeepAutofit { get; }

See also

  • ReportTag


ReportTag.StrDontKeepAutofit Property | FlexCel Studio for the .NET Framework documentation

ReportTag.StrDontKeepAutofit Property

"Fixed"

Syntax

Namespace: FlexCel.Report

public static String StrDontKeepAutofit { get; }

See also

  • ReportTag


ReportTag.StrAutofitModeFirst Property | FlexCel Studio for the .NET Framework documentation

ReportTag.StrAutofitModeFirst Property

"First"

Syntax

Namespace: FlexCel.Report

public static String StrAutofitModeFirst { get; }

See also

  • ReportTag


ReportTag.StrAutofitModeLast Property | FlexCel Studio for the .NET Framework documentation

ReportTag.StrAutofitModeLast Property

"Last"

Syntax

Namespace: FlexCel.Report

public static String StrAutofitModeLast { get; }

See also

  • ReportTag


ReportTag.StrAutofitModeNone Property | FlexCel Studio for the .NET Framework documentation

ReportTag.StrAutofitModeNone Property

"None"

Syntax

Namespace: FlexCel.Report

public static String StrAutofitModeNone { get; }

See also

  • ReportTag


ReportTag.StrAutofitModeBalanced Property | FlexCel Studio for the .NET Framework documentation

ReportTag.StrAutofitModeBalanced Property

"Balanced"

Syntax

Namespace: FlexCel.Report

public static String StrAutofitModeBalanced { get; }

See also

  • ReportTag


ReportTag.StrDefinedLocal Property | FlexCel Studio for the .NET Framework documentation

ReportTag.StrDefinedLocal Property

"Local"

Syntax

Namespace: FlexCel.Report

public static String StrDefinedLocal { get; }

See also

  • ReportTag


ReportTag.StrDefinedGlobal Property | FlexCel Studio for the .NET Framework documentation

ReportTag.StrDefinedGlobal Property

"Global"

Syntax

Namespace: FlexCel.Report

public static String StrDefinedGlobal { get; }

See also

  • ReportTag


ReportTag.StrRelativeDelete Property | FlexCel Studio for the .NET Framework documentation

ReportTag.StrRelativeDelete Property

"Relative"

Syntax

Namespace: FlexCel.Report

public static String StrRelativeDelete { get; }

See also

  • ReportTag


ReportTag.StrFullDelete Property | FlexCel Studio for the .NET Framework documentation

ReportTag.StrFullDelete Property

"Full"

Syntax

Namespace: FlexCel.Report

public static String StrFullDelete { get; }

See also

  • ReportTag


ReportTag.StrStaticInclude Property | FlexCel Studio for the .NET Framework documentation

ReportTag.StrStaticInclude Property

"Static"

Syntax

Namespace: FlexCel.Report

public static String StrStaticInclude { get; }

See also

  • ReportTag


ReportTag.StrDynamicInclude Property | FlexCel Studio for the .NET Framework documentation

ReportTag.StrDynamicInclude Property

"Dynamic"

Syntax

Namespace: FlexCel.Report

public static String StrDynamicInclude { get; }

See also

  • ReportTag


ReportTag.StrCopyRows Property | FlexCel Studio for the .NET Framework documentation

ReportTag.StrCopyRows Property

"R"

Syntax

Namespace: FlexCel.Report

public static String StrCopyRows { get; }

See also

  • ReportTag


ReportTag.StrCopyCols Property | FlexCel Studio for the .NET Framework documentation

ReportTag.StrCopyCols Property

"C"

Syntax

Namespace: FlexCel.Report

public static String StrCopyCols { get; }

See also

  • ReportTag


ReportTag.StrCopyRowsAndCols Property | FlexCel Studio for the .NET Framework documentation

ReportTag.StrCopyRowsAndCols Property

"RC"

Syntax

Namespace: FlexCel.Report

public static String StrCopyRowsAndCols { get; }

See also

  • ReportTag


ReportTag.StrAlignLeft Property | FlexCel Studio for the .NET Framework documentation

ReportTag.StrAlignLeft Property

"LEFT"

Syntax

Namespace: FlexCel.Report

public static String StrAlignLeft { get; }

See also

  • ReportTag


ReportTag.StrAlignCenter Property | FlexCel Studio for the .NET Framework documentation

ReportTag.StrAlignCenter Property

"Center"

Syntax

Namespace: FlexCel.Report

public static String StrAlignCenter { get; }

See also

  • ReportTag


ReportTag.StrAlignRight Property | FlexCel Studio for the .NET Framework documentation

ReportTag.StrAlignRight Property

"Right"

Syntax

Namespace: FlexCel.Report

public static String StrAlignRight { get; }

See also

  • ReportTag


ReportTag.StrAlignTop Property | FlexCel Studio for the .NET Framework documentation

ReportTag.StrAlignTop Property

"Top"

Syntax

Namespace: FlexCel.Report

public static String StrAlignTop { get; }

See also

  • ReportTag


ReportTag.StrAlignBottom Property | FlexCel Studio for the .NET Framework documentation

ReportTag.StrAlignBottom Property

"Bottom"

Syntax

Namespace: FlexCel.Report

public static String StrAlignBottom { get; }

See also

  • ReportTag


ReportTag.StrInRow Property | FlexCel Studio for the .NET Framework documentation

ReportTag.StrInRow Property

"InRow"

Syntax

Namespace: FlexCel.Report

public static String StrInRow { get; }

See also

  • ReportTag


ReportTag.StrInCol Property | FlexCel Studio for the .NET Framework documentation

ReportTag.StrInCol Property

"InCol"

Syntax

Namespace: FlexCel.Report

public static String StrInCol { get; }

See also

  • ReportTag


ReportTag.StrDontGrow Property | FlexCel Studio for the .NET Framework documentation

ReportTag.StrDontGrow Property

"DontGrow"

Syntax

Namespace: FlexCel.Report

public static String StrDontGrow { get; }

See also

  • ReportTag


ReportTag.StrDontShrink Property | FlexCel Studio for the .NET Framework documentation

ReportTag.StrDontShrink Property

"DontShrink"

Syntax

Namespace: FlexCel.Report

public static String StrDontShrink { get; }

See also

  • ReportTag


ReportTag.StrAggSum Property | FlexCel Studio for the .NET Framework documentation

ReportTag.StrAggSum Property

"Sum"

Syntax

Namespace: FlexCel.Report

public static String StrAggSum { get; }

See also

  • ReportTag


ReportTag.StrAggAvg Property | FlexCel Studio for the .NET Framework documentation

ReportTag.StrAggAvg Property

"Avg"

Syntax

Namespace: FlexCel.Report

public static String StrAggAvg { get; }

See also

  • ReportTag


ReportTag.StrAggMax Property | FlexCel Studio for the .NET Framework documentation

ReportTag.StrAggMax Property

"Max"

Syntax

Namespace: FlexCel.Report

public static String StrAggMax { get; }

See also

  • ReportTag


ReportTag.StrAggMin Property | FlexCel Studio for the .NET Framework documentation

ReportTag.StrAggMin Property

"Min"

Syntax

Namespace: FlexCel.Report

public static String StrAggMin { get; }

See also

  • ReportTag


ReportTag.StrAggCount Property | FlexCel Studio for the .NET Framework documentation

ReportTag.StrAggCount Property

"Count"

Syntax

Namespace: FlexCel.Report

public static String StrAggCount { get; }

See also

  • ReportTag


ReportTag.StrDbStart Property | FlexCel Studio for the .NET Framework documentation

ReportTag.StrDbStart Property

"["

Syntax

Namespace: FlexCel.Report

public static String StrDbStart { get; }

See also

  • ReportTag


ReportTag.StrDbEnd Property | FlexCel Studio for the .NET Framework documentation

ReportTag.StrDbEnd Property

"]"

Syntax

Namespace: FlexCel.Report

public static String StrDbEnd { get; }

See also

  • ReportTag


ReportTag.RowRange1 Property | FlexCel Studio for the .NET Framework documentation

ReportTag.RowRange1 Property

Range delimiter.

Syntax

Namespace: FlexCel.Report

public static String RowRange1 { get; }

See also

  • ReportTag


ReportTag.RowFull1 Property | FlexCel Studio for the .NET Framework documentation

ReportTag.RowFull1 Property

Range delimiter.

Syntax

Namespace: FlexCel.Report

public static String RowFull1 { get; }

See also

  • ReportTag


ReportTag.RowRange2 Property | FlexCel Studio for the .NET Framework documentation

ReportTag.RowRange2 Property

Range delimiter.

Syntax

Namespace: FlexCel.Report

public static String RowRange2 { get; }

See also

  • ReportTag


ReportTag.RowFull2 Property | FlexCel Studio for the .NET Framework documentation

ReportTag.RowFull2 Property

Range delimiter.

Syntax

Namespace: FlexCel.Report

public static String RowFull2 { get; }

See also

  • ReportTag


ReportTag.ColRange1 Property | FlexCel Studio for the .NET Framework documentation

ReportTag.ColRange1 Property

Range delimiter.

Syntax

Namespace: FlexCel.Report

public static String ColRange1 { get; }

See also

  • ReportTag


ReportTag.ColFull1 Property | FlexCel Studio for the .NET Framework documentation

ReportTag.ColFull1 Property

Range delimiter.

Syntax

Namespace: FlexCel.Report

public static String ColFull1 { get; }

See also

  • ReportTag


ReportTag.ColRange2 Property | FlexCel Studio for the .NET Framework documentation

ReportTag.ColRange2 Property

Range delimiter.

Syntax

Namespace: FlexCel.Report

public static String ColRange2 { get; }

See also

  • ReportTag


ReportTag.ColFull2 Property | FlexCel Studio for the .NET Framework documentation

ReportTag.ColFull2 Property

Range delimiter.

Syntax

Namespace: FlexCel.Report

public static String ColFull2 { get; }

See also

  • ReportTag


ReportTag.CrossTabRange1 Property | FlexCel Studio for the .NET Framework documentation

ReportTag.CrossTabRange1 Property

Range delimiter.

Syntax

Namespace: FlexCel.Report

public static String CrossTabRange1 { get; }

See also

  • ReportTag


ReportTag.CrossTabRange2 Property | FlexCel Studio for the .NET Framework documentation

ReportTag.CrossTabRange2 Property

Range delimiter.

Syntax

Namespace: FlexCel.Report

public static String CrossTabRange2 { get; }

See also

  • ReportTag


ReportTag.CrossTabFull1 Property | FlexCel Studio for the .NET Framework documentation

ReportTag.CrossTabFull1 Property

Range delimiter.

Syntax

Namespace: FlexCel.Report

public static String CrossTabFull1 { get; }

See also

  • ReportTag


ReportTag.CrossTabFull2 Property | FlexCel Studio for the .NET Framework documentation

ReportTag.CrossTabFull2 Property

Range delimiter.

Syntax

Namespace: FlexCel.Report

public static String CrossTabFull2 { get; }

See also

  • ReportTag


ReportTag.KeepRowsTogether Property | FlexCel Studio for the .NET Framework documentation

ReportTag.KeepRowsTogether Property

Named Range starting with KeepRows_

Syntax

Namespace: FlexCel.Report

public static String KeepRowsTogether { get; }

See also

  • ReportTag


ReportTag.KeepColsTogether Property | FlexCel Studio for the .NET Framework documentation

ReportTag.KeepColsTogether Property

Named Range starting with KeepColumns_

Syntax

Namespace: FlexCel.Report

public static String KeepColsTogether { get; }

See also

  • ReportTag


ReportTag.StrEndKeepTogether Property | FlexCel Studio for the .NET Framework documentation

ReportTag.StrEndKeepTogether Property

End of tag for keeprowstogether and keepcolstogether

Syntax

Namespace: FlexCel.Report

public static String StrEndKeepTogether { get; }

See also

  • ReportTag


ReportTag.TagTableKeys Property | FlexCel Studio for the .NET Framework documentation

ReportTag.TagTableKeys Property

List of tag ids.

Syntax

Namespace: FlexCel.Report

public static ICollection<String> TagTableKeys { get; }

See also

  • ReportTag


ReportTag.StrEqual Property | FlexCel Studio for the .NET Framework documentation

ReportTag.StrEqual Property

=

Syntax

Namespace: FlexCel.Report

public static String StrEqual { get; }

See also

  • ReportTag


ReportTag.StrConfigSheet Property | FlexCel Studio for the .NET Framework documentation

ReportTag.StrConfigSheet Property

CONFIG

Syntax

Namespace: FlexCel.Report

public static String StrConfigSheet { get; }

See also

  • ReportTag


ReportTag.StrDebug Property | FlexCel Studio for the .NET Framework documentation

ReportTag.StrDebug Property

DEBUG

Syntax

Namespace: FlexCel.Report

public static String StrDebug { get; }

See also

  • ReportTag


ReportTag.StrErrorsInResultFile Property | FlexCel Studio for the .NET Framework documentation

ReportTag.StrErrorsInResultFile Property

ERRORSINRESULTFILE

Syntax

Namespace: FlexCel.Report

public static String StrErrorsInResultFile { get; }

See also

  • ReportTag


ReportTag.StrDebugIntelligentPageBreaks Property | FlexCel Studio for the .NET Framework documentation

ReportTag.StrDebugIntelligentPageBreaks Property

DEBUGINTELLIGENTPAGEBREAKS

Syntax

Namespace: FlexCel.Report

public static String StrDebugIntelligentPageBreaks { get; }

See also

  • ReportTag


ReportTag.StrSemiAbsoluteReferences Property | FlexCel Studio for the .NET Framework documentation

ReportTag.StrSemiAbsoluteReferences Property

SEMIABSOLUTEREFERENCES

Syntax

Namespace: FlexCel.Report

public static String StrSemiAbsoluteReferences { get; }

See also

  • ReportTag


ReportTag.StrAbsoluteReferences Property | FlexCel Studio for the .NET Framework documentation

ReportTag.StrAbsoluteReferences Property

ABSOLUTEREFERENCES

Syntax

Namespace: FlexCel.Report

public static String StrAbsoluteReferences { get; }

See also

  • ReportTag


ReportTag.SwapSeries Property | FlexCel Studio for the .NET Framework documentation

ReportTag.SwapSeries Property

SWAP SERIES

Syntax

Namespace: FlexCel.Report

public static String SwapSeries { get; }

See also

  • ReportTag


TFieldExpressions<T> Class | FlexCel Studio for the .NET Framework documentation

TFieldExpressions<T> Class

A class to store compiled expressions to access fields in a TLinqDataTable. This is faster than reading the field values with reflection. Field expressions will be created on demand, so if you never use a field, an expression for it won't be created.

Syntax

Namespace: FlexCel.Report

public class TFieldExpressions<T>

Type Parameters

Type Parameter | Description
T | Type of the expression.

Constructors

Name | Description
TFieldExpressions | Creates a new instance and assigns it to an array of PropertyInfo.

Methods

Name | Description
GetNestedProp | Gets a compiled expression for a nested property
GetNestedProp​Expression<​Q> | Gets an expression for a nested property.

Properties

Name | Description
this[] | Gets the compiled expression for the needed field.


TFieldExpressions<T>.TFieldExpressions Constructor | FlexCel Studio for the .NET Framework documentation

TFieldExpressions<T>.TFieldExpressions Constructor

Creates a new instance and assigns it to an array of PropertyInfo.

Syntax

Namespace: FlexCel.Report

public TFieldExpressions(PropertyInfo[] aFields)

Parameters

<-> | Parameter | Type | Description
 | aFields | PropertyInfo[] |

See also

  • TFieldExpressions


TFieldExpressions<T>.GetNestedProp Method | FlexCel Studio for the .NET Framework documentation

TFieldExpressions<T>.GetNestedProp Method

Gets a compiled expression for a nested property

Syntax

Namespace: FlexCel.Report

public static Func<T, Object> GetNestedProp(PropertyInfo[] Props)

Parameters

<-> | Parameter | Type | Description
 | Props | PropertyInfo[] |

See also

  • TFieldExpressions


TFieldExpressions<T>.GetNestedPropExpression<Q> Method | FlexCel Studio for the .NET Framework documentation

TFieldExpressions<T>.GetNestedPropExpression<Q> Method

Gets an expression for a nested property.

Syntax

Namespace: FlexCel.Report

public static Expression GetNestedPropExpression<Q>(PropertyInfo[] Props, ParameterExpression x)

Parameters

<-> | Parameter | Type | Description
 | Props | PropertyInfo[] |
 | x | ParameterExpression |

Type Parameters

Type Parameter | Description
Q |

See also

  • TFieldExpressions


TFieldExpressions.this[] Property | FlexCel Studio for the .NET Framework documentation

TFieldExpressions.this[] Property

Gets the compiled expression for the needed field.

Syntax

Namespace: FlexCel.Report

public Func<T, Object> this[] { get; }

See also

  • TFieldExpressions


TFlexCelUserFormat Class | FlexCel Studio for the .NET Framework documentation

TFlexCelUserFormat Class

A class used to define a cell format in code, that you can call from a report.

Remarks

To Create a User format:

  1. Create a new class derived from TFlexCelUserFormat.
  2. Override the method Evaluate.
  3. Add the new user format to the report using FlexCelReport.SetUserFormat.

Syntax

Namespace: FlexCel.Report

public abstract class TFlexCelUserFormat

Methods

Name | Description
Evaluate | Override this method on a derived class to implement your own defined function.

Examples

To define a user format that will format the cell according to the first parameter you pass to the function, you would: 1) Define the class:

    public class MyUserFormat : TFlexCelUserFormat
    {
        public override TFlxPartialFormat Evaluate(ExcelFile workbook, TXlsCellRange range, object[] parameters)
        {
            if (parameters == null || parameters.Length > 1)
                throw new ArgumentException("Invalid number of parameters for user defined format \"MyUserFormat\"");
            int color = Convert.ToInt32(parameters[0]);

            TFlxFormat Format = workbook.GetDefaultFormat;
            Format.FillPattern.FgColor = TExcelColor.FromArgb(color);
            Format.FillPattern.BgColor = TExcelColor.Automatic;
            Format.FillPattern.Pattern = TFlxPatternStyle.Solid;

            TFlxApplyFormat Apply = new TFlxApplyFormat();
            Apply.FillPattern.SetAllMembers(true);

            return new TFlxPartialFormat(Format, Apply, false);
        }

    }

2) Add the function to the report.

    MyUserFormat myFormatImpl = new MyUserFormat(); //The MyUserFormat class implements an user defined format.
    flexCelReport.SetUserFormat("MFMT", myFormatImpl); //The name used in Excel will be =MFMT().

3) Now, you can write "<#format cell(MFMT;255)>" on a cell in the template, and it will painted blue.


TFlexCelUserFormat.Evaluate Method | FlexCel Studio for the .NET Framework documentation

TFlexCelUserFormat.Evaluate Method

Override this method on a derived class to implement your own defined function.

Syntax

Namespace: FlexCel.Report

public abstract TFlxPartialFormat Evaluate(ExcelFile workbook, TXlsCellRange rangeToFormat, Object[] parameters)

Parameters

<-> | Parameter | Type | Description
 | workbook | ExcelFile | File where we are setting the format.
 | rangeToFormat | TXlsCellRange | Range of cells being formatted. Note that it might be a full row or column if using Format Row or Format Column.
 | parameters | Object[] | An array of objects.

Returns

The derived class should return the value of the function on the return parameter.

See also

  • TFlexCelUserFormat


TFlexCelUserFunction Class | FlexCel Studio for the .NET Framework documentation

TFlexCelUserFunction Class

A class used to define a FlexCel user function, that you can call from a report.

Remarks

To Create a User function:

  1. Create a new class derived from TFlexCelUserFunction.
  2. Override the method Evaluate.
  3. Add the new user function to the report using FlexCelReport.SetUserFunction.

Syntax

Namespace: FlexCel.Report

public abstract class TFlexCelUserFunction

Methods

Name | Description
Evaluate | Override this method on a derived class to implement your own defined function.

Examples

To define a user function that returns "One" for param = 1; "Two" for param = 2 and "Unknown" on any other case: 1) Define the class:

    public class MyUserFunction : TFlexCelUserFunction
    {
        public override object Evaluate(object[] parameters)
        {
            if (parameters == null || parameters.Length != 1)
                throw new ArgumentException("Invalid number of parameters for user defined function \"MyUserFunction\"");
            int p = Convert.ToInt32(parameters[0]);

            switch (p)
            {
                case 1: return "One";
                case 2: return "Two";
            }
            return "Unknown";
        }

    }

2) Add the function to the report.

    MyUserFunction myFuncImpl = new MyUserFunction(); //The MyUserFunction class implements an user defined function.
    flexCelReport.SetUserFunction("MF", myFuncImpl); //The name used in Excel will be =MF().

3) Now, you can write "<#MF(1)>" on a template, and it will be replaced by "One".


TFlexCelUserFunction.Evaluate Method | FlexCel Studio for the .NET Framework documentation

TFlexCelUserFunction.Evaluate Method

Override this method on a derived class to implement your own defined function.

Syntax

Namespace: FlexCel.Report

public abstract Object Evaluate(Object[] parameters)

Parameters

<-> | Parameter | Type | Description
 | parameters | Object[] | An array of objects.

Returns

The derived class should return the value of the function on the return parameter.

See also

  • TFlexCelUserFunction


TLinqDataTable<T> Class | FlexCel Studio for the .NET Framework documentation

TLinqDataTable<T> Class

An implementation of a VirtualDataTable using IEnumerator and Linq. This class is abstract so to use it you should inherit from it and override the needed methods. In normal cases you won't need to override this class, as FlexCel already has an implementation of it that deals with IEnumerator tables. Inheriting from this class is only for very special cases.

Syntax

Namespace: FlexCel.Report

public abstract class TLinqDataTable<T>: VirtualDataTable, ILinqDataTable

Type Parameters

Type Parameter | Description
T | Type of the class which is used as base for this datatable.

Constructors

Name Description
TLinqDataTable Overloaded
 TLinqDataTable(String, VirtualDataTable, IQueryable<T>)
TLinqDataTable(String, VirtualDataTable, IQueryable<T>, TLinqDataTable<T>, String[])

Methods

Name | Description
CreateNewDataTable | Override this method when inheriting from this class to return the correct object. To do so, you will need to create a constructor in your class with parameters (aTableName, aCreator, aOrigTable, aFilters), call the inherited constructor in this class with the same parameters, and then in this method create a new instance of your class with the above constructor.
FindOrigTableName | Original name of the table. This will be used in relationships.
GetColumn | Returns a column identifier that you can later use on VirtualDataTable​State.​Get​Value(​​Int32). Return -1 if the column does not exist, and make sure this search is case insensitive.
GetColumnName | Returns the column name for a column identifier. This method is the reverse of VirtualDataTable.​Get​Column
GetColumnCaption | Returns the column caption for a column identifier. This method is used on generic dataset to write the header column. For most uses, VirtualDataTable.​Get​Column​Name will be used.
FilterData | This method should return a new VirtualDataTable instance with the data filtered. If RowFilter is null, this method should return a copy of the dataset with a different name. Note that you might have the same data with different states, so this method might be called more than once.
GetDetail | Override this method if the table has linked tables that you can use for master detail relationships instead of normal relationships. This is the case for example in Entity Framework.
HasDetail | Returns true if the database has a linked datatable with name dataTableName.
GetRelationWith | Override this method if the datatable has intrinsic relationships that you want to use. For example DataSets have DataRelationships, or Entity Framework tables are related as properties from the master to the detail. All those relationships that are not explicitly defined in the report should be returned here.
GetDistinct | Override this method to return a new VirtualDataSet with unique values. Note that the returned dataset will not have all the columns this one has, only the ones defined on "filterFields"
Dispose | Override this method on derived classes.

Properties

Name | Description
Data | Data on this table. It might be null, if this table is linked to another.
Filters | An array of filter strings that must be applied to this dataset.
Fields | Field definitions.
Locale | Locale for this dataset. This might be needed to create datatables with data and the same locale.
ColumnCount | Returns the number of columns of the table.


TLinqDataTable<T>.TLinqDataTable Constructor | FlexCel Studio for the .NET Framework documentation

TLinqDataTable<T>.TLinqDataTable Constructor

Overloads

  • TLinqDataTable<T>.TLinqDataTable(String, VirtualDataTable, IQueryable<T>)
  • TLinqDataTable<T>.TLinqDataTable(String, VirtualDataTable, IQueryable<T>, TLinqDataTable<T>, String[])

TLinqDataTable<T>.TLinqDataTable(String, VirtualDataTable, IQueryable<T>)

Creates a new table with "tablename" name and a source data. Data can't be null when using this constructor.

Syntax

Namespace: FlexCel.Report

protected TLinqDataTable(String aTableName, VirtualDataTable aCreatedBy, IQueryable<T> aData)

Parameters

<-> | Parameter | Type | Description
 | aTableName | String | Name of the table that will be created.
 | aCreatedBy | VirtualDataTable | Table that created this table (via a filter, distinct, etc), or null if this table wasn't created from another VirtualDataTable.
 | aData | IQueryable<T> | Data. Can't be null in this particular constructor.

See also

  • TLinqDataTable

TLinqDataTable<T>.TLinqDataTable(String, VirtualDataTable, IQueryable<T>, TLinqDataTable<T>, String[])

This constructor is used to create a nested detail table. Data might be null when calling this constructor when it will be read from the master table every time the master record changes. IMPORTANT: When creating a descendant of this class, you always need to provide this constructor as it will be called automatically when creating filtered of detail tables.

Syntax

Namespace: FlexCel.Report

protected TLinqDataTable(String aTableName, VirtualDataTable aCreatedBy, IQueryable<T> aData, TLinqDataTable<T> aOrigTable, String[] aFilters)

Parameters

<-> | Parameter | Type | Description
 | aTableName | String | Name for the new table.
 | aCreatedBy | VirtualDataTable | Table that created this table (via a filter, distinct, etc), or null if this table wasn't created from another VirtualDataTable.
 | aData | IQueryable<T> | Data for the table. Might be null if in a master-detail relationship.
 | aOrigTable | TLinqDataTable<T> | Real table from where the data comes. We will use this to find the relationships.
 | aFilters | String[] | A string with all the filters that need to be applied to this table.

See also

  • TLinqDataTable


TLinqDataTable<T>.CreateNewDataTable Method | FlexCel Studio for the .NET Framework documentation

TLinqDataTable<T>.CreateNewDataTable Method

Override this method when inheriting from this class to return the correct object. To do so, you will need to create a constructor in your class with parameters (aTableName, aCreator, aOrigTable, aFilters), call the inherited constructor in this class with the same parameters, and then in this method create a new instance of your class with the above constructor.

Syntax

Namespace: FlexCel.Report

protected abstract VirtualDataTable CreateNewDataTable(String aTableName, VirtualDataTable aCreatedBy, IQueryable<T> aData, TLinqDataTable<T> aOrigTable, String[] aFilters)

Parameters

<-> | Parameter | Type | Description
 | aTableName | String | Name for the new table.
 | aCreatedBy | VirtualDataTable | Table that created this table (via a filter, distinct, etc), or null if this table wasn't created from another VirtualDataTable.
 | aData | IQueryable<T> | Data for the table. Might be null if in a master detail relationship.
 | aOrigTable | TLinqDataTable<T> | Real table from where the data comes. We will use this to find the relationships.
 | aFilters | String[] | A string with all the filters that need to be applied to this table.

Returns

A new instance of the class.

See also

  • TLinqDataTable


TLinqDataTable<T>.FindOrigTableName Method | FlexCel Studio for the .NET Framework documentation

TLinqDataTable<T>.FindOrigTableName Method

Original name of the table. This will be used in relationships.

Syntax

Namespace: FlexCel.Report

public String FindOrigTableName()

See also

  • TLinqDataTable


TLinqDataTable<T>.GetColumn Method | FlexCel Studio for the .NET Framework documentation

TLinqDataTable<T>.GetColumn Method

Returns a column identifier that you can later use on VirtualDataTableState.GetValue(Int32). Return -1 if the column does not exist, and make sure this search is case insensitive.

Syntax

Namespace: FlexCel.Report

public override Int32 GetColumn(String columnName)

Parameters

<-> | Parameter | Type | Description
 | columnName | String | Name of the column to search.

Returns

Column identifier if found, -1 if not found.

See also

  • TLinqDataTable


TLinqDataTable<T>.GetColumnName Method | FlexCel Studio for the .NET Framework documentation

TLinqDataTable<T>.GetColumnName Method

Returns the column name for a column identifier. This method is the reverse of VirtualDataTable.GetColumn

Syntax

Namespace: FlexCel.Report

public override String GetColumnName(Int32 columnIndex)

Parameters

<-> | Parameter | Type | Description
 | columnIndex | Int32 | Column index returned by VirtualDataTable.GetColumn

Returns

The name of the column at columnIndex. If the columnIndex is not valid it should throw an Exception, since this method will only be called for columnIndexes returned by VirtualDataTable.GetColumn

See also

  • TLinqDataTable


TLinqDataTable<T>.GetColumnCaption Method | FlexCel Studio for the .NET Framework documentation

TLinqDataTable<T>.GetColumnCaption Method

Returns the column caption for a column identifier. This method is used on generic dataset to write the header column. For most uses, VirtualDataTable.GetColumnName will be used.

Syntax

Namespace: FlexCel.Report

public override String GetColumnCaption(Int32 columnIndex)

Parameters

<-> | Parameter | Type | Description
 | columnIndex | Int32 | Column index returned by VirtualDataTable.GetColumn

Returns

The name of the column at columnIndex. If the columnIndex is not valid it should throw an Exception, since this method will only be called for columnIndexes returned by VirtualDataTable.GetColumn

See also

  • TLinqDataTable


TLinqDataTable<T>.FilterData Method | FlexCel Studio for the .NET Framework documentation

TLinqDataTable<T>.FilterData Method

This method should return a new VirtualDataTable instance with the data filtered. If RowFilter is null, this method should return a copy of the dataset with a different name. Note that you might have the same data with different states, so this method might be called more than once.

Remarks

You do not need to implement this method if you do not want to let users create new filtered datasets on the config sheet.

Syntax

Namespace: FlexCel.Report

public override VirtualDataTable FilterData(String newDataName, String rowFilter)

Parameters

<-> Parameter Type Description
newDataName String How this new VirtualDataSet will be named. This is what the user wrote on the config sheet, when creating a filtered dataset. Note that as with all the VirtualDataSets, this name is meaningless except for error messages.
rowFilter String Filter for the new data. This can be null, an empty string, or whatever the user wrote on the "filter" column on the config sheet. Note that if the Filter is "distinct()" this method will not be called, but VirtualDataTable.GetDistinct instead.
This method will not be called if the filter is "Split()" either.

Returns

A new VirtualDataTable with the filtered data and the new name.

See also

  • TLinqDataTable


TLinqDataTable<T>.GetDetail Method | FlexCel Studio for the .NET Framework documentation

TLinqDataTable<T>.GetDetail Method

Override this method if the table has linked tables that you can use for master detail relationships instead of normal relationships. This is the case for example in Entity Framework.

Syntax

Namespace: FlexCel.Report

public override VirtualDataTable GetDetail(String dataTableName, VirtualDataTable dataTable)

Parameters

<-> | Parameter | Type | Description
 | dataTableName | String | Name of the detail dataset we are looking for.
 | dataTable | VirtualDataTable | Detail dataset that we are looking for.

Returns

The dataset if it is a detail dataset, null otherwise.

See also

  • TLinqDataTable


TLinqDataTable<T>.HasDetail Method | FlexCel Studio for the .NET Framework documentation

TLinqDataTable<T>.HasDetail Method

Returns true if the database has a linked datatable with name dataTableName.

Syntax

Namespace: FlexCel.Report

public Boolean HasDetail(String dataTableName)

Parameters

<-> | Parameter | Type | Description
 | dataTableName | String | Name for the linked datatable that we are searching for.

See also

  • TLinqDataTable


TLinqDataTable<T>.GetRelationWith Method | FlexCel Studio for the .NET Framework documentation

TLinqDataTable<T>.GetRelationWith Method

Override this method if the datatable has intrinsic relationships that you want to use. For example DataSets have DataRelationships, or Entity Framework tables are related as properties from the master to the detail. All those relationships that are not explicitly defined in the report should be returned here.

Syntax

Namespace: FlexCel.Report

public override TRelation GetRelationWith(VirtualDataTable aDetail)

Parameters

<-> | Parameter | Type | Description
 | aDetail | VirtualDataTable | Detail table from where we want to get the relationship.

See also

  • TLinqDataTable


TLinqDataTable<T>.GetDistinct Method | FlexCel Studio for the .NET Framework documentation

TLinqDataTable<T>.GetDistinct Method

Override this method to return a new VirtualDataSet with unique values. Note that the returned dataset will not have all the columns this one has, only the ones defined on "filterFields"

Remarks

You do not need to implement this method if you do not want to let users create "Distinct()" filters on the config sheet.

Syntax

Namespace: FlexCel.Report

public override VirtualDataTable GetDistinct(String newDataName, Int32[] filterFields)

Parameters

<-> | Parameter | Type | Description
 | newDataName | String | How this new VirtualDataSet will be named. This is what the user wrote on the config sheet, when creating the distinct dataset. Note that as with all the VirtualDataSets, this name is meaningless except for error messages.
 | filterFields | Int32[] | Fields where to apply the "distinct" condition.

Returns

A new VirtualDataTable with the filtered data and the new name.

See also

  • TLinqDataTable


TLinqDataTable<T>.Dispose Method | FlexCel Studio for the .NET Framework documentation

TLinqDataTable<T>.Dispose Method

Override this method on derived classes.

Syntax

Namespace: FlexCel.Report

protected override void Dispose(Boolean disposing)

Parameters

<-> | Parameter | Type | Description
 | disposing | Boolean |

See also

  • TLinqDataTable


TLinqDataTable.Data Property | FlexCel Studio for the .NET Framework documentation

TLinqDataTable.Data Property

Data on this table. It might be null, if this table is linked to another.

Syntax

Namespace: FlexCel.Report

protected IQueryable<T> Data { get; set; }

See also

  • TLinqDataTable


TLinqDataTable.Filters Property | FlexCel Studio for the .NET Framework documentation

TLinqDataTable.Filters Property

An array of filter strings that must be applied to this dataset.

Syntax

Namespace: FlexCel.Report

protected String[] Filters { get; set; }

See also

  • TLinqDataTable


TLinqDataTable.Fields Property | FlexCel Studio for the .NET Framework documentation

TLinqDataTable.Fields Property

Field definitions.

Syntax

Namespace: FlexCel.Report

protected TLinqFieldDefinitions<T> Fields { get; set; }

See also

  • TLinqDataTable


TLinqDataTable.Locale Property | FlexCel Studio for the .NET Framework documentation

TLinqDataTable.Locale Property

Locale for this dataset. This might be needed to create datatables with data and the same locale.

Syntax

Namespace: FlexCel.Report

public override CultureInfo Locale { get; }

See also

  • TLinqDataTable


TLinqDataTable.ColumnCount Property | FlexCel Studio for the .NET Framework documentation

TLinqDataTable.ColumnCount Property

Returns the number of columns of the table.

Syntax

Namespace: FlexCel.Report

public override Int32 ColumnCount { get; }

See also

  • TLinqDataTable


TLinqDataTableState<T> Class | FlexCel Studio for the .NET Framework documentation

TLinqDataTableState<T> Class

This class implements support for Linq queries in FlexCelReport. Inherit this class if you want to implement some non-standard Linq query provider. For normal cases, you don't need to do anything since FlexCel already implements a descendant of this class with the default functionality.

Syntax

Namespace: FlexCel.Report

public abstract class TLinqDataTableState<T>: VirtualDataTableState, IDisposable, ILinqDataTableState

Type Parameters

Type Parameter | Description
T | Type of the object that will be enumerated.

Constructors

Name | Description
TLinqDataTableState | Creates a new LinqDataTable​State.​

Methods

Name Description
SortData Sorts the data according to SortStr.
SortDataByField<Q> This method is used by the current SortData implementation, and it creates an expression to sort the data.
TryAggregate This method is used by the "AGGREGATE" tag in a FlexCel report to calculate the maximum/​minimum/​average/​etc of the values in the table. If you don't implement this method, FlexCel will still calculate those values by looping through the dataset, but if you have a faster way to do it (like with a "select max(field) from table") then implement this method and return true.
Eof Returns true when at the end of the table.
GetValue Overloaded
 GetValue(Int32)
GetValue(Int32, Int32)
MoveFirst This method is called when we want to move to the first record.
You can always know the current record with VirtualDataTable​State.​Position
MoveNext This method is called when we want to move to the next record.
You can always know the current record with VirtualDataTable​State.​Position
GetDetail<Q> Returns a detail table. This is used in master-detail relationships to get the nested table for the detail band.
MoveMasterRecord This method will be called each time that the master datasource moves its position. Use it to filter the data returned if this is used on a master-detail relationship.
GetFilterAction This method returns a function that can be used to filter the data. This implementation calls SqlFilter when rowFilter starts with "@", or calls [SimpleFilter](SimpleFilter.md) when rowFilter doesn't start with "@". You might want to replace this method by a different one that filters in a different way.
SimpleFilter This method is called by GetFilterAction when the rowFilter doesn't start with "@"\.<br />It will do a simple parse of the rowFilter string, allowing "AND" "OR" "()" and equality comparisons.
SqlFilter This method is called by GetFilterAction when the rowFilter starts with "@"\. When overriding [GetFilterAction](GetFilterAction.md) you might want to call this method if rowfilter starts with "@"\.<br /><br /><br />This implementation tries to find a "Where(string)" method in the data and call it.
FilteredRowCount This method will be called when a Split master wants to know how many records its detail has. For example, if the detail has 30 records and the split is at 10, the Split master will call this method to find out that it has to return 3 on its own record count.
You need to filter the data here depending on the master detail relationships, but not on the splitLink.
Dispose Override this method on derived classes.

Properties

Name | Description
Data | Data for the table. Note that this might change in a master-detail report, every time the master changes its active record, Data in the detail will change to the records for the master.
Fields | A list of then public fields in the datatype.
Filters | A list of filter strings that must be applied to the data.
SplitLink | Split link.
RowCount | Returns the number of rows available on the dataset, for the current state. Note that this method can be called many times, so it should be fast. Use a cache if necessary. Do *not* use something like "return select count(*) from table" here, it would be too slow.


TLinqDataTableState<T>.TLinqDataTableState Constructor | FlexCel Studio for the .NET Framework documentation

TLinqDataTableState<T>.TLinqDataTableState Constructor

Creates a new LinqDataTableState.

Syntax

Namespace: FlexCel.Report

protected TLinqDataTableState(VirtualDataTable aTableData, IQueryable<T> aData, TLinqFieldDefinitions<T> aFields, String[] aFilters, String sort, TMasterDetailLink[] masterDetailLinks, TSplitLink splitLink)

Parameters

<-> | Parameter | Type | Description
 | aTableData | VirtualDataTable |
 | aData | IQueryable<T> |
 | aFields | TLinqFieldDefinitions<T> |
 | aFilters | String[] |
 | sort | String |
 | masterDetailLinks | TMasterDetailLink[] |
 | splitLink | TSplitLink |

See also

  • TLinqDataTableState


TLinqDataTableState<T>.SortData Method | FlexCel Studio for the .NET Framework documentation

TLinqDataTableState<T>.SortData Method

Sorts the data according to SortStr.

Syntax

Namespace: FlexCel.Report

public virtual void SortData(String SortStr)

Parameters

<-> | Parameter | Type | Description
 | SortStr | String | Sort string the user wrote in the report.

See also

  • TLinqDataTableState


TLinqDataTableState<T>.SortDataByField<Q> Method | FlexCel Studio for the .NET Framework documentation

TLinqDataTableState<T>.SortDataByField<Q> Method

This method is used by the current SortData implementation, and it creates an expression to sort the data.

Syntax

Namespace: FlexCel.Report

public void SortDataByField<Q>(Int32 SortField, Boolean First, Boolean Descending)

Parameters

<-> | Parameter | Type | Description
 | SortField | Int32 |
 | First | Boolean |
 | Descending | Boolean |

Type Parameters

Type Parameter | Description
Q |

See also

  • TLinqDataTableState


TLinqDataTableState<T>.TryAggregate Method | FlexCel Studio for the .NET Framework documentation

TLinqDataTableState<T>.TryAggregate Method

This method is used by the "AGGREGATE" tag in a FlexCel report to calculate the maximum/minimum/average/etc of the values in the table. If you don't implement this method, FlexCel will still calculate those values by looping through the dataset, but if you have a faster way to do it (like with a "select max(field) from table") then implement this method and return true.

Syntax

Namespace: FlexCel.Report

public override Boolean TryAggregate(TAggregateType aggregateType, Int32 colIndex, out Object resultValue)

Parameters

<-> | Parameter | Type | Description
 | aggregateType | TAggregateType | Which operation to do on the dataset. (Max/Min/etc)
 | colIndex | Int32 | Index of the field in which we want to aggregate.
out | resultValue | Object | Returns the result of the operation in the dataset. It should be null, a double or a datetime.

Returns

True if this method is implemented, false if not. Note that even if we return false here, FlexCel will still calculate the aggregate by looping through all the records.

See also

  • TLinqDataTableState


TLinqDataTableState<T>.Eof Method | FlexCel Studio for the .NET Framework documentation

TLinqDataTableState<T>.Eof Method

Returns true when at the end of the table.

Syntax

Namespace: FlexCel.Report

public override Boolean Eof()

See also

  • TLinqDataTableState


TLinqDataTableState<T>.GetValue Method | FlexCel Studio for the .NET Framework documentation

TLinqDataTableState<T>.GetValue Method

Overloads

  • TLinqDataTableState<T>.GetValue(Int32)
  • TLinqDataTableState<T>.GetValue(Int32, Int32)

TLinqDataTableState<T>.GetValue(Int32)

Returns the value for row VirtualDataTableState.Position, at the column "column"

Syntax

Namespace: FlexCel.Report

public override Object GetValue(Int32 column)

Parameters

<-> | Parameter | Type | Description
 | column | Int32 | Column identifier returned by VirtualDataTable.GetColumn

See also

  • TLinqDataTableState

TLinqDataTableState<T>.GetValue(Int32, Int32)

Returns the value for row "row", at the column "column". You need to overload this method only if you want to support DBValue tag.

Syntax

Namespace: FlexCel.Report

public override Object GetValue(Int32 row, Int32 column)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row identifier (0 based)
 | column | Int32 | Column identifier returned by VirtualDataTable.GetColumn

See also

  • TLinqDataTableState


TLinqDataTableState<T>.MoveFirst Method | FlexCel Studio for the .NET Framework documentation

TLinqDataTableState<T>.MoveFirst Method

This method is called when we want to move to the first record. You can always know the current record with VirtualDataTableState.Position

Syntax

Namespace: FlexCel.Report

public override void MoveFirst()

See also

  • TLinqDataTableState


TLinqDataTableState<T>.MoveNext Method | FlexCel Studio for the .NET Framework documentation

TLinqDataTableState<T>.MoveNext Method

This method is called when we want to move to the next record. You can always know the current record with VirtualDataTableState.Position

Syntax

Namespace: FlexCel.Report

public override void MoveNext()

See also

  • TLinqDataTableState


TLinqDataTableState<T>.GetDetail<Q> Method | FlexCel Studio for the .NET Framework documentation

TLinqDataTableState<T>.GetDetail<Q> Method

Returns a detail table. This is used in master-detail relationships to get the nested table for the detail band.

Syntax

Namespace: FlexCel.Report

public IEnumerable<Q> GetDetail<Q>(TLinqDataTable<Q> Detail, out Boolean IsEmptyList)

Parameters

<-> | Parameter | Type | Description
 | Detail | TLinqDataTable<Q> | Detail data table calling this method.
out | IsEmptyList | Boolean | Return true if the enumerator has 0 records.

Type Parameters

Type Parameter | Description
Q | Type of the parameter.

See also

  • TLinqDataTableState


TLinqDataTableState<T>.MoveMasterRecord Method | FlexCel Studio for the .NET Framework documentation

TLinqDataTableState<T>.MoveMasterRecord Method

This method will be called each time that the master datasource moves its position. Use it to filter the data returned if this is used on a master-detail relationship.

Remarks

You do not need to implement this method if you are not using Master-Detail or Split relationships.

Syntax

Namespace: FlexCel.Report

public override void MoveMasterRecord(TMasterDetailLink[] masterDetailLinks, TSplitLink splitLink)

Parameters

<-> | Parameter | Type | Description
 | masterDetailLinks | TMasterDetailLink[] | List of all the master tables that are related to this one. If there are no parents on this VirtualDataTableState, this will be an empty array, not null. Use it on VirtualDataTableState.GetValue(Int32) to filter the data and then return only the records that satisfy the master-detail relationships on VirtualDataTableState.GetValue(Int32)
 | splitLink | TSplitLink | Parent Split table if this dataset is on a Split relationship, or null if there is none. Use it to know how many records you should retun on VirtualDataTableState.RowCount. Note that a table might be on Master-Detail relationship *and* split relationship. In this case you need to first filter the records that are on the master detail relationship, and then apply the split to them.

See also

  • TLinqDataTableState


TLinqDataTableState<T>.GetFilterAction Method | FlexCel Studio for the .NET Framework documentation

TLinqDataTableState<T>.GetFilterAction Method

This method returns a function that can be used to filter the data. This implementation calls SqlFilter when rowFilter starts with "@", or calls [SimpleFilter](SimpleFilter.md) when rowFilter doesn't start with "@". You might want to replace this method by a different one that filters in a different way.

Syntax

Namespace: FlexCel.Report

public virtual Func<IQueryable, IQueryable> GetFilterAction(String rowFilter)

Parameters

<-> | Parameter | Type | Description
 | rowFilter | String | String with the filter as the user wrote it in the report.

See also

  • TLinqDataTableState


TLinqDataTableState<T>.SimpleFilter Method | FlexCel Studio for the .NET Framework documentation

TLinqDataTableState<T>.SimpleFilter Method

This method is called by GetFilterAction when the rowFilter doesn't start with "@"\. It will do a simple parse of the rowFilter string, allowing "AND" "OR" "()" and equality comparisons.

Syntax

Namespace: FlexCel.Report

public Func<IQueryable, IQueryable> SimpleFilter(String rowFilter)

Parameters

<-> | Parameter | Type | Description
 | rowFilter | String |

See also

  • TLinqDataTableState


TLinqDataTableState<T>.SqlFilter Method | FlexCel Studio for the .NET Framework documentation

TLinqDataTableState<T>.SqlFilter Method

This method is called by GetFilterAction when the rowFilter starts with "@"\. When overriding [GetFilterAction](GetFilterAction.md) you might want to call this method if rowfilter starts with "@".

This implementation tries to find a "Where(string)" method in the data and call it.

Syntax

Namespace: FlexCel.Report

public Func<IQueryable, IQueryable> SqlFilter(String rowFilter)

Parameters

<-> | Parameter | Type | Description
 | rowFilter | String |

See also

  • TLinqDataTableState


TLinqDataTableState<T>.FilteredRowCount Method | FlexCel Studio for the .NET Framework documentation

TLinqDataTableState<T>.FilteredRowCount Method

This method will be called when a Split master wants to know how many records its detail has. For example, if the detail has 30 records and the split is at 10, the Split master will call this method to find out that it has to return 3 on its own record count. You need to filter the data here depending on the master detail relationships, but not on the splitLink.

Remarks

You do not need to implement this method if you are not using Split relationships.

Syntax

Namespace: FlexCel.Report

public override Int32 FilteredRowCount(TMasterDetailLink[] masterDetailLinks)

Parameters

<-> | Parameter | Type | Description
 | masterDetailLinks | TMasterDetailLink[] | List of all the master tables that are related to this one. If there are no parents on this VirtualDataTableState, this will be an empty array, not null.

Returns

The count of records for a specific position of the master datasets.

See also

  • TLinqDataTableState


TLinqDataTableState<T>.Dispose Method | FlexCel Studio for the .NET Framework documentation

TLinqDataTableState<T>.Dispose Method

Override this method on derived classes.

Syntax

Namespace: FlexCel.Report

protected override void Dispose(Boolean disposing)

Parameters

<-> | Parameter | Type | Description
 | disposing | Boolean |

See also

  • TLinqDataTableState


TLinqDataTableState.Data Property | FlexCel Studio for the .NET Framework documentation

TLinqDataTableState.Data Property

Data for the table. Note that this might change in a master-detail report, every time the master changes its active record, Data in the detail will change to the records for the master.

Syntax

Namespace: FlexCel.Report

protected IQueryable<T> Data { get; }

See also

  • TLinqDataTableState


TLinqDataTableState.Fields Property | FlexCel Studio for the .NET Framework documentation

TLinqDataTableState.Fields Property

A list of then public fields in the datatype.

Syntax

Namespace: FlexCel.Report

protected TLinqFieldDefinitions<T> Fields { get; set; }

See also

  • TLinqDataTableState


TLinqDataTableState.Filters Property | FlexCel Studio for the .NET Framework documentation

TLinqDataTableState.Filters Property

A list of filter strings that must be applied to the data.

Syntax

Namespace: FlexCel.Report

protected String[] Filters { get; set; }

See also

  • TLinqDataTableState


TLinqDataTableState.SplitLink Property | FlexCel Studio for the .NET Framework documentation

TLinqDataTableState.SplitLink Property

Split link.

Syntax

Namespace: FlexCel.Report

protected TSplitLink SplitLink { get; set; }

See also

  • TLinqDataTableState


TLinqDataTableState.RowCount Property | FlexCel Studio for the .NET Framework documentation

TLinqDataTableState.RowCount Property

Returns the number of rows available on the dataset, for the current state. Note that this method can be called many times, so it should be fast. Use a cache if necessary. Do *not* use something like "return select count(*) from table" here, it would be too slow.

Syntax

Namespace: FlexCel.Report

public override Int32 RowCount { get; }

See also

  • TLinqDataTableState


TLinqFieldDefinitions<T> Class | FlexCel Studio for the .NET Framework documentation

TLinqFieldDefinitions<T> Class

Holds a list of field definitions, used to find the fields in classes available to the report.

Syntax

Namespace: FlexCel.Report

public class TLinqFieldDefinitions<T>

Type Parameters

Type Parameter | Description
T | Type of the field definition.

Constructors

Name | Description
TLinqFieldDefinitions | Creates and initializes all the fields in the class.

Methods

Name | Description
TryGetColumn | Returns the index for a field given its name. Note that for nested fields, this number might be bigger than ColumnCount
ContainsColumn Returns true if the dataset contains a given column.
GetColumn | Returns the index for a field given its name. Note that for nested fields, this number might be bigger than ColumnCount
GetColumnName | Returns the name for a field given its index. Note that for nested fields, this number might be bigger than ColumnCount
GetValue Returns the value of the field for a given object.
GetProperties Overloaded
 GetProperties(Int32)
GetProperties(String, String)

Properties

Name | Description
Fields | Type definitions for the properties of the class this table holds.
ExtraFields | Definitions added on runtime, to support nested fields like Employee.Name
ExtraProperties | Properties for nested field.
FieldExpressions | A list of compiled field expressions that can be used to find the values of the fields without using reflection.
ExtraExpressions | Expressions added at runtime, to support nested properties like a.b.c
FieldsByName | A dictionary to find the field position in the Fields or ExtraFields array given its name.
ExtraNames | Returns the nested fields with dots, like field1.field2.
ColumnCount | Number of first-class fields in the class. (doesn't include nested ones like "Employee.Name")
this[] | Returns the properties of the field at index.


TLinqFieldDefinitions<T>.TLinqFieldDefinitions Constructor | FlexCel Studio for the .NET Framework documentation

TLinqFieldDefinitions<T>.TLinqFieldDefinitions Constructor

Creates and initializes all the fields in the class.

Syntax

Namespace: FlexCel.Report

public TLinqFieldDefinitions()

See also

  • TLinqFieldDefinitions


TLinqFieldDefinitions<T>.TryGetColumn Method | FlexCel Studio for the .NET Framework documentation

TLinqFieldDefinitions<T>.TryGetColumn Method

Returns the index for a field given its name. Note that for nested fields, this number might be bigger than ColumnCount

Syntax

Namespace: FlexCel.Report

public Boolean TryGetColumn(String columnName, out Int32 ResultValue)

Parameters

<-> | Parameter | Type | Description
 | columnName | String | Column we are searching for.
out | ResultValue | Int32 | Index for the column.

Returns

True if the column exists.

See also

  • TLinqFieldDefinitions


TLinqFieldDefinitions<T>.ContainsColumn Method | FlexCel Studio for the .NET Framework documentation

TLinqFieldDefinitions<T>.ContainsColumn Method

Returns true if the dataset contains a given column.

Syntax

Namespace: FlexCel.Report

public Boolean ContainsColumn(String columnName)

Parameters

<-> | Parameter | Type | Description
 | columnName | String |

See also

  • TLinqFieldDefinitions


TLinqFieldDefinitions<T>.GetColumn Method | FlexCel Studio for the .NET Framework documentation

TLinqFieldDefinitions<T>.GetColumn Method

Returns the index for a field given its name. Note that for nested fields, this number might be bigger than ColumnCount

Syntax

Namespace: FlexCel.Report

public Int32 GetColumn(String columnName)

Parameters

<-> | Parameter | Type | Description
 | columnName | String | Column we are searching for.

See also

  • TLinqFieldDefinitions


TLinqFieldDefinitions<T>.GetColumnName Method | FlexCel Studio for the .NET Framework documentation

TLinqFieldDefinitions<T>.GetColumnName Method

Returns the name for a field given its index. Note that for nested fields, this number might be bigger than ColumnCount

Syntax

Namespace: FlexCel.Report

public String GetColumnName(Int32 columnIndex)

Parameters

<-> | Parameter | Type | Description
 | columnIndex | Int32 | Column we are searching for.

See also

  • TLinqFieldDefinitions


TLinqFieldDefinitions<T>.GetValue Method | FlexCel Studio for the .NET Framework documentation

TLinqFieldDefinitions<T>.GetValue Method

Returns the value of the field for a given object.

Syntax

Namespace: FlexCel.Report

public Object GetValue(T obj, Int32 column)

Parameters

<-> | Parameter | Type | Description
 | obj | T |
 | column | Int32 |

See also

  • TLinqFieldDefinitions


TLinqFieldDefinitions<T>.GetProperties Method | FlexCel Studio for the .NET Framework documentation

TLinqFieldDefinitions<T>.GetProperties Method

Overloads

  • TLinqFieldDefinitions<T>.GetProperties(Int32)
  • TLinqFieldDefinitions<T>.GetProperties(String, String)

TLinqFieldDefinitions<T>.GetProperties(Int32)

Returns the properties for a nested or not nested fields.

Syntax

Namespace: FlexCel.Report

public PropertyInfo[] GetProperties(Int32 column)

Parameters

<-> | Parameter | Type | Description
 | column | Int32 | Position of the filed to get the properties.

See also

  • TLinqFieldDefinitions

TLinqFieldDefinitions<T>.GetProperties(String, String)

Returns the properties for a nested or not nested fields.

Syntax

Namespace: FlexCel.Report

public PropertyInfo[] GetProperties(String fieldName, String tableName)

Parameters

<-> | Parameter | Type | Description
 | fieldName | String | Name of the filed to get the properties.
 | tableName | String | Name of the table that holds the field.

See also

  • TLinqFieldDefinitions


TLinqFieldDefinitions.Fields Property | FlexCel Studio for the .NET Framework documentation

TLinqFieldDefinitions.Fields Property

Type definitions for the properties of the class this table holds.

Syntax

Namespace: FlexCel.Report

public PropertyInfo[] Fields { get; set; }

See also

  • TLinqFieldDefinitions


TLinqFieldDefinitions.ExtraFields Property | FlexCel Studio for the .NET Framework documentation

TLinqFieldDefinitions.ExtraFields Property

Definitions added on runtime, to support nested fields like Employee.Name

Syntax

Namespace: FlexCel.Report

public IList<PropertyInfo> ExtraFields { get; set; }

See also

  • TLinqFieldDefinitions


TLinqFieldDefinitions.ExtraProperties Property | FlexCel Studio for the .NET Framework documentation

TLinqFieldDefinitions.ExtraProperties Property

Properties for nested field.

Syntax

Namespace: FlexCel.Report

public IList<IList> ExtraProperties { get; set; }

See also

  • TLinqFieldDefinitions


TLinqFieldDefinitions.FieldExpressions Property | FlexCel Studio for the .NET Framework documentation

TLinqFieldDefinitions.FieldExpressions Property

A list of compiled field expressions that can be used to find the values of the fields without using reflection.

Syntax

Namespace: FlexCel.Report

protected TFieldExpressions<T> FieldExpressions { get; set; }

See also

  • TLinqFieldDefinitions


TLinqFieldDefinitions.ExtraExpressions Property | FlexCel Studio for the .NET Framework documentation

TLinqFieldDefinitions.ExtraExpressions Property

Expressions added at runtime, to support nested properties like a.b.c

Syntax

Namespace: FlexCel.Report

protected IList<Func> ExtraExpressions { get; set; }

See also

  • TLinqFieldDefinitions


TLinqFieldDefinitions.FieldsByName Property | FlexCel Studio for the .NET Framework documentation

TLinqFieldDefinitions.FieldsByName Property

A dictionary to find the field position in the Fields or ExtraFields array given its name.

Syntax

Namespace: FlexCel.Report

protected Dictionary<String, Int32> FieldsByName { get; set; }

See also

  • TLinqFieldDefinitions


TLinqFieldDefinitions.ExtraNames Property | FlexCel Studio for the .NET Framework documentation

TLinqFieldDefinitions.ExtraNames Property

Returns the nested fields with dots, like field1.field2.

Syntax

Namespace: FlexCel.Report

protected IList<String> ExtraNames { get; set; }

See also

  • TLinqFieldDefinitions


TLinqFieldDefinitions.ColumnCount Property | FlexCel Studio for the .NET Framework documentation

TLinqFieldDefinitions.ColumnCount Property

Number of first-class fields in the class. (doesn't include nested ones like "Employee.Name")

Syntax

Namespace: FlexCel.Report

public Int32 ColumnCount { get; }

See also

  • TLinqFieldDefinitions


TLinqFieldDefinitions.this[] Property | FlexCel Studio for the .NET Framework documentation

TLinqFieldDefinitions.this[] Property

Returns the properties of the field at index.

Syntax

Namespace: FlexCel.Report

public PropertyInfo this[] { get; }

See also

  • TLinqFieldDefinitions


TMasterDetailLink Class | FlexCel Studio for the .NET Framework documentation

TMasterDetailLink Class

A parent table and a parent field used on a master-detail relationship.

Syntax

Namespace: FlexCel.Report

public class TMasterDetailLink

Constructors

Name | Description
TMasterDetailLink | Creates a new instance of TMasterDetailLink with the given values.

Properties

Name | Description
ParentDataSource | A table that is acting as a master on a master detail relationship.
ParentField | Column index of the key that acts as primary key on the relationship.
ChildFieldName | Column name on the detail dataset that is related with ParentField


TMasterDetailLink.TMasterDetailLink Constructor | FlexCel Studio for the .NET Framework documentation

TMasterDetailLink.TMasterDetailLink Constructor

Creates a new instance of TMasterDetailLink with the given values.

Syntax

Namespace: FlexCel.Report

public TMasterDetailLink(VirtualDataTableState aParentDataSource, Int32 aParentField, String aChildFieldName)

Parameters

<-> | Parameter | Type | Description
 | aParentDataSource | VirtualDataTable​State | See ParentDataSource
 | aParentField | Int32 | See ParentField
 | aChildFieldName | String | See ChildFieldName

See also

  • TMasterDetailLink


TMasterDetailLink.ParentDataSource Property | FlexCel Studio for the .NET Framework documentation

TMasterDetailLink.ParentDataSource Property

A table that is acting as a master on a master detail relationship.

Syntax

Namespace: FlexCel.Report

public VirtualDataTableState ParentDataSource { get; }

See also

  • TMasterDetailLink


TMasterDetailLink.ParentField Property | FlexCel Studio for the .NET Framework documentation

TMasterDetailLink.ParentField Property

Column index of the key that acts as primary key on the relationship.

Syntax

Namespace: FlexCel.Report

public Int32 ParentField { get; }

See also

  • TMasterDetailLink


TMasterDetailLink.ChildFieldName Property | FlexCel Studio for the .NET Framework documentation

TMasterDetailLink.ChildFieldName Property

Column name on the detail dataset that is related with ParentField

Syntax

Namespace: FlexCel.Report

public String ChildFieldName { get; }

See also

  • TMasterDetailLink


TOneCellValue Class | FlexCel Studio for the .NET Framework documentation

TOneCellValue Class

A list of TOneSectionValue. Has a parsed version of what is on a cell.

Syntax

Namespace: FlexCel.Report

public class TOneCellValue: IDisposable

Methods

Name | Description
Dispose | Overloaded Dispose Dispose(Boolean)


TOneCellValue.Dispose Method | FlexCel Studio for the .NET Framework documentation

TOneCellValue.Dispose Method

Overloads

  • TOneCellValue.Dispose
  • TOneCellValue.Dispose(Boolean)

TOneCellValue.Dispose

Frees the resources of the cell.

Syntax

Namespace: FlexCel.Report

public void Dispose()

See also

  • TOneCellValue

TOneCellValue.Dispose(Boolean)

Disposes the resources of the cell.

Syntax

Namespace: FlexCel.Report

protected virtual void Dispose(Boolean isDisposing)

Parameters

<-> | Parameter | Type | Description
 | isDisposing | Boolean |

See also

  • TOneCellValue


TRelation Class | FlexCel Studio for the .NET Framework documentation

TRelation Class

A data relation between two tables. Different from standard .NET datarelations, this class is not tied to ADO.NET, and allows you to specify relationships between any arbitrary VirtualDataTable objects.

Syntax

Namespace: FlexCel.Report

public class TRelation

Constructors

Name | Description
TRelation | Creates a new relation with the given values.

Properties

Name | Description
ParentColumns | And array of colum indexes on the Master table that are related to the detail ChildColumns[0] is related to ParentColumns[0], ChildColumns[1] to ParentColunns[1], and so on.
ChildColumns | And array of colum indexes on the Detail table that are related to the master. ChildColumns[0] is related to ParentColumns[0], ChildColumns[1] to ParentColunns[1], and so on.
ParentTable | Table that acts as a master on a Master-Detail relationship.
ChildTable | Table that acts as a detail on a Master-Detail relationship.


TRelation.TRelation Constructor | FlexCel Studio for the .NET Framework documentation

TRelation.TRelation Constructor

Creates a new relation with the given values.

Syntax

Namespace: FlexCel.Report

public TRelation(VirtualDataTable aParentTable, VirtualDataTable aChildTable, Int32[] aParentColumns, Int32[] aChildColumns)

Parameters

<-> | Parameter | Type | Description
 | aParentTable | VirtualDataTable | See ParentTable
 | aChildTable | VirtualDataTable | See ChildTable
 | aParentColumns | Int32[] | See ParentColumns
 | aChildColumns | Int32[] | See ChildColumns

See also

  • TRelation


TRelation.ParentColumns Property | FlexCel Studio for the .NET Framework documentation

TRelation.ParentColumns Property

And array of colum indexes on the Master table that are related to the detail ChildColumns[0] is related to ParentColumns[0], ChildColumns[1] to ParentColunns[1], and so on.

Syntax

Namespace: FlexCel.Report

public Int32[] ParentColumns { get; }

See also

  • TRelation


TRelation.ChildColumns Property | FlexCel Studio for the .NET Framework documentation

TRelation.ChildColumns Property

And array of colum indexes on the Detail table that are related to the master. ChildColumns[0] is related to ParentColumns[0], ChildColumns[1] to ParentColunns[1], and so on.

Syntax

Namespace: FlexCel.Report

public Int32[] ChildColumns { get; }

See also

  • TRelation


TRelation.ParentTable Property | FlexCel Studio for the .NET Framework documentation

TRelation.ParentTable Property

Table that acts as a master on a Master-Detail relationship.

Syntax

Namespace: FlexCel.Report

public VirtualDataTable ParentTable { get; }

See also

  • TRelation


TRelation.ChildTable Property | FlexCel Studio for the .NET Framework documentation

TRelation.ChildTable Property

Table that acts as a detail on a Master-Detail relationship.

Syntax

Namespace: FlexCel.Report

public VirtualDataTable ChildTable { get; }

See also

  • TRelation


TSplitLink Class | FlexCel Studio for the .NET Framework documentation

TSplitLink Class

Specifies a "Split" relation between two tables.

Syntax

Namespace: FlexCel.Report

public class TSplitLink

Constructors

Name | Description
TSplitLink | Create a new TSplitLink with the given values.

Properties

Name | Description
SplitCount | Split the detail every "SplitCount" number of records. If for example Splitcount is 5 and the detail table has 14 registers, it should be split as 5 records, 5 records, 4 records.
ParentDataSource | Table that acts as a parent on the split relationship. Read its VirtualDataTable​State.​Position to know which group of splitted records to return.


TSplitLink.TSplitLink Constructor | FlexCel Studio for the .NET Framework documentation

TSplitLink.TSplitLink Constructor

Create a new TSplitLink with the given values.

Syntax

Namespace: FlexCel.Report

public TSplitLink(VirtualDataTableState aParentDataSource, Int32 aSplitCount)

Parameters

<-> | Parameter | Type | Description
 | aParentDataSource | VirtualDataTable​State | See ParentDataSource
 | aSplitCount | Int32 | See SplitCount

See also

  • TSplitLink


TSplitLink.SplitCount Property | FlexCel Studio for the .NET Framework documentation

TSplitLink.SplitCount Property

Split the detail every "SplitCount" number of records. If for example Splitcount is 5 and the detail table has 14 registers, it should be split as 5 records, 5 records, 4 records.

Syntax

Namespace: FlexCel.Report

public Int32 SplitCount { get; }

See also

  • TSplitLink


TSplitLink.ParentDataSource Property | FlexCel Studio for the .NET Framework documentation

TSplitLink.ParentDataSource Property

Table that acts as a parent on the split relationship. Read its VirtualDataTableState.Position to know which group of splitted records to return.

Syntax

Namespace: FlexCel.Report

public VirtualDataTableState ParentDataSource { get; }

See also

  • TSplitLink


UserTableEventArgs Class | FlexCel Studio for the .NET Framework documentation

UserTableEventArgs Class

Arguments passed on FlexCelReport.UserTable

Syntax

Namespace: FlexCel.Report

public class UserTableEventArgs: EventArgs

Constructors

Name | Description
UserTableEventArgs | Creates a new Argument.

Properties

Name | Description
TableName | The value written on the cell "Table name" on the config sheet. You can use it as an extra parameter.
Parameters | The parameters on the <#User Table(parameters)> tag.


UserTableEventArgs.UserTableEventArgs Constructor | FlexCel Studio for the .NET Framework documentation

UserTableEventArgs.UserTableEventArgs Constructor

Creates a new Argument.

Syntax

Namespace: FlexCel.Report

public UserTableEventArgs(String aTableName, String aParameters)

Parameters

<-> | Parameter | Type | Description
 | aTableName | String | The value written on the cell "Table name" on the config sheet. You can use it as an extra parameter.
 | aParameters | String | The parameters passed on the <#User Table(parameters)> tag.

See also

  • UserTableEventArgs


UserTableEventArgs.TableName Property | FlexCel Studio for the .NET Framework documentation

UserTableEventArgs.TableName Property

The value written on the cell "Table name" on the config sheet. You can use it as an extra parameter.

Syntax

Namespace: FlexCel.Report

public String TableName { get; }

See also

  • UserTableEventArgs


UserTableEventArgs.Parameters Property | FlexCel Studio for the .NET Framework documentation

UserTableEventArgs.Parameters Property

The parameters on the <#User Table(parameters)> tag.

Syntax

Namespace: FlexCel.Report

public String Parameters { get; }

See also

  • UserTableEventArgs


VirtualDataTable Class | FlexCel Studio for the .NET Framework documentation

VirtualDataTable Class

Base class for a table used on FlexCelReport. Inherit from this class and VirtualDataTableState to create your custom sources of data. Make sure you read 'Appendix virtual datasets' in the Reports Developer Guide for more information.

Syntax

Namespace: FlexCel.Report

public abstract class VirtualDataTable: IDisposable

Constructors

Name | Description
VirtualDataTable | Creates a new virtual datatable instance and assigns a name to it.

Methods

Name | Description
CreateState | Creates a VirtualDataSetState to be used in a report. Make sure you override this method on your derived classes and point it to the correct VirtualDataSet descendant.
FullDataSetColumn​Count | Returns the columns in the table for a full dataset. Normally this is the same as ColumnCount but your implementation might choose to hide some of the fields available in the full ColumnCount when dumping all fields. If you change this method, you need also to review GetFullDataSetColumn so it returns the correct column for the dataset.
GetFullDataSetColumn | Maps a normal column to a Full Dataset column, in case you aren't outputting the same fields for full datasets as the fields available for a report. If you are outputting all the fields, then this returns Column.
GetFullDataSetMapId | Returns an id you can use to map a column name + * to something you can use in GetFullDataSetColumn
GetColumn | Returns a column identifier that you can later use on VirtualDataTable​State.​Get​Value(​​Int32). Return -1 if the column does not exist, and make sure this search is case insensitive.
GetColumnName | Returns the column name for a column identifier. This method is the reverse of GetColumn
GetColumnCaption | Returns the column caption for a column identifier. This method is used on generic dataset to write the header column. For most uses, GetColumnName will be used.
FilterData | This method should return a new VirtualDataTable instance with the data filtered. If RowFilter is null, this method should return a copy of the dataset with a different name. Note that you might have the same data with different states, so this method might be called more than once.
GetDistinct | Override this method to return a new VirtualDataSet with unique values. Note that the returned dataset will not have all the columns this one has, only the ones defined on "filterFields"
GetDetail | Override this method if the table has linked tables that you can use for master detail relationships instead of normal relationships. This is the case for example in Entity Framework.
GetRelationWith | Override this method if the datatable has intrinsic relationships that you want to use. For example DataSets have DataRelationships, or Entity Framework tables are related as properties from the master to the detail. All those relationships that are not explicitly defined in the report should be returned here.
Lookup | Looks for a key on this dataset and returns the corresponding value. Note: Remember that VirtualDataSet is stateless, so if you use any caching here, make sure you appropiately lock() this method so there is no possibility of one thread reading the cache when the other is updating it.
Dispose | Overloaded Dispose Dispose(Boolean)

Properties

Name | Description
TableName | Name for the virtual data table. Note that this name is *not* used anywhere in FlexCel code, except to report errors. The Table names that are used on reports are the ones in VirtualDataTable​State
Locale | Locale for this dataset. This might be needed to create datatables with data and the same locale.
ColumnCount | Returns the number of columns of the table.
CreatedBy | Returns the table that created this one (by a filter, distinct, etc), or null if this table was not created from another VirtualDataTable.


VirtualDataTable.VirtualDataTable Constructor | FlexCel Studio for the .NET Framework documentation

VirtualDataTable.VirtualDataTable Constructor

Creates a new virtual datatable instance and assigns a name to it.

Syntax

Namespace: FlexCel.Report

protected VirtualDataTable(String aTableName, VirtualDataTable aCreatedBy)

Parameters

<-> | Parameter | Type | Description
 | aTableName | String | Name for the virtual data table. Note that this name is *not* used anywhere in FlexCel code, except to report errors. The Table names that are used on reports are the ones in VirtualDataTableState
 | aCreatedBy | VirtualDataTable | Table that created this table (via a filter, distinct, etc), or null if this table wasn't created from another VirtualDataTable.

See also

  • VirtualDataTable


VirtualDataTable.CreateState Method | FlexCel Studio for the .NET Framework documentation

VirtualDataTable.CreateState Method

Creates a VirtualDataSetState to be used in a report. Make sure you override this method on your derived classes and point it to the correct VirtualDataSet descendant.

Syntax

Namespace: FlexCel.Report

public abstract VirtualDataTableState CreateState(String sort, TMasterDetailLink[] masterDetailLinks, TSplitLink splitLink)

Parameters

<-> | Parameter | Type | Description
 | sort | String | A string showing how to sort this dataset. This string might be null, empty, or whatever the user wrote on the config sheet.
 | masterDetailLinks | TMasterDetailLink[] | A list of the the master datatables and relation fields on the bands outside this one. You can pass this parameter to the VirtualDataSetState so it can create indexes on the required fields. This parameter will be an empty array if no master detail relationships apply to the VirtualDataSetState, but it will not be null.
 | splitLink | TSplitLink | A link to a parent Split datasource with the number of records to split, or null if there is no parent split datasource.

See also

  • VirtualDataTable


VirtualDataTable.FullDataSetColumnCount Method | FlexCel Studio for the .NET Framework documentation

VirtualDataTable.FullDataSetColumnCount Method

Returns the columns in the table for a full dataset. Normally this is the same as ColumnCount but your implementation might choose to hide some of the fields available in the full ColumnCount when dumping all fields. If you change this method, you need also to review GetFullDataSetColumn so it returns the correct column for the dataset.

Syntax

Namespace: FlexCel.Report

public virtual Int32 FullDataSetColumnCount(Int32 ColumnMapIndex)

Parameters

<-> | Parameter | Type | Description
 | ColumnMapIndex | Int32 | This is the column map index returned by GetFullDataSetMapId.

See also

  • VirtualDataTable


VirtualDataTable.GetFullDataSetColumn Method | FlexCel Studio for the .NET Framework documentation

VirtualDataTable.GetFullDataSetColumn Method

Maps a normal column to a Full Dataset column, in case you aren't outputting the same fields for full datasets as the fields available for a report. If you are outputting all the fields, then this returns Column.

Syntax

Namespace: FlexCel.Report

public virtual Int32 GetFullDataSetColumn(Int32 Column, Int32 ColumnMapIndex)

Parameters

<-> | Parameter | Type | Description
 | Column | Int32 | Column we want to map.
 | ColumnMapIndex | Int32 | An id that you can use to map the column. This value will be the one returned by GetFullDataSetMapId

See also

  • VirtualDataTable


VirtualDataTable.GetFullDataSetMapId Method | FlexCel Studio for the .NET Framework documentation

VirtualDataTable.GetFullDataSetMapId Method

Returns an id you can use to map a column name + * to something you can use in GetFullDataSetColumn

Syntax

Namespace: FlexCel.Report

public virtual Int32 GetFullDataSetMapId(String Column)

Parameters

<-> | Parameter | Type | Description
 | Column | String | We will pass here the full name of the column up to but not including the * or **. This might be empty or somehting...something.*

See also

  • VirtualDataTable


VirtualDataTable.GetColumn Method | FlexCel Studio for the .NET Framework documentation

VirtualDataTable.GetColumn Method

Returns a column identifier that you can later use on VirtualDataTableState.GetValue(Int32). Return -1 if the column does not exist, and make sure this search is case insensitive.

Syntax

Namespace: FlexCel.Report

public abstract Int32 GetColumn(String columnName)

Parameters

<-> | Parameter | Type | Description
 | columnName | String | Name of the column to search.

Returns

Column identifier if found, -1 if not found.

See also

  • VirtualDataTable


VirtualDataTable.GetColumnName Method | FlexCel Studio for the .NET Framework documentation

VirtualDataTable.GetColumnName Method

Returns the column name for a column identifier. This method is the reverse of GetColumn

Syntax

Namespace: FlexCel.Report

public abstract String GetColumnName(Int32 columnIndex)

Parameters

<-> | Parameter | Type | Description
 | columnIndex | Int32 | Column index returned by GetColumn

Returns

The name of the column at columnIndex. If the columnIndex is not valid it should throw an Exception, since this method will only be called for columnIndexes returned by GetColumn

See also

  • VirtualDataTable


VirtualDataTable.GetColumnCaption Method | FlexCel Studio for the .NET Framework documentation

VirtualDataTable.GetColumnCaption Method

Returns the column caption for a column identifier. This method is used on generic dataset to write the header column. For most uses, GetColumnName will be used.

Syntax

Namespace: FlexCel.Report

public abstract String GetColumnCaption(Int32 columnIndex)

Parameters

<-> | Parameter | Type | Description
 | columnIndex | Int32 | Column index returned by GetColumn

Returns

The name of the column at columnIndex. If the columnIndex is not valid it should throw an Exception, since this method will only be called for columnIndexes returned by GetColumn

See also

  • VirtualDataTable


VirtualDataTable.FilterData Method | FlexCel Studio for the .NET Framework documentation

VirtualDataTable.FilterData Method

This method should return a new VirtualDataTable instance with the data filtered. If RowFilter is null, this method should return a copy of the dataset with a different name. Note that you might have the same data with different states, so this method might be called more than once.

Remarks

You do not need to implement this method if you do not want to let users create new filtered datasets on the config sheet.

Syntax

Namespace: FlexCel.Report

public virtual VirtualDataTable FilterData(String newDataName, String rowFilter)

Parameters

<-> Parameter Type Description
newDataName String How this new VirtualDataSet will be named. This is what the user wrote on the config sheet, when creating a filtered dataset. Note that as with all the VirtualDataSets, this name is meaningless except for error messages.
rowFilter String Filter for the new data. This can be null, an empty string, or whatever the user wrote on the "filter" column on the config sheet. Note that if the Filter is "distinct()" this method will not be called, but GetDistinct instead.
This method will not be called if the filter is "Split()" either.

Returns

A new VirtualDataTable with the filtered data and the new name.

See also

  • VirtualDataTable


VirtualDataTable.GetDistinct Method | FlexCel Studio for the .NET Framework documentation

VirtualDataTable.GetDistinct Method

Override this method to return a new VirtualDataSet with unique values. Note that the returned dataset will not have all the columns this one has, only the ones defined on "filterFields"

Remarks

You do not need to implement this method if you do not want to let users create "Distinct()" filters on the config sheet.

Syntax

Namespace: FlexCel.Report

public virtual VirtualDataTable GetDistinct(String newDataName, Int32[] filterFields)

Parameters

<-> | Parameter | Type | Description
 | newDataName | String | How this new VirtualDataSet will be named. This is what the user wrote on the config sheet, when creating the distinct dataset. Note that as with all the VirtualDataSets, this name is meaningless except for error messages.
 | filterFields | Int32[] | Fields where to apply the "distinct" condition.

Returns

A new VirtualDataTable with the filtered data and the new name.

See also

  • VirtualDataTable


VirtualDataTable.GetDetail Method | FlexCel Studio for the .NET Framework documentation

VirtualDataTable.GetDetail Method

Override this method if the table has linked tables that you can use for master detail relationships instead of normal relationships. This is the case for example in Entity Framework.

Syntax

Namespace: FlexCel.Report

public virtual VirtualDataTable GetDetail(String dataTableName, VirtualDataTable dataTable)

Parameters

<-> | Parameter | Type | Description
 | dataTableName | String | Name of the detail dataset we are looking for.
 | dataTable | VirtualDataTable | Detail dataset that we are looking for.

Returns

The dataset if it is a detail dataset, null otherwise.

See also

  • VirtualDataTable


VirtualDataTable.GetRelationWith Method | FlexCel Studio for the .NET Framework documentation

VirtualDataTable.GetRelationWith Method

Override this method if the datatable has intrinsic relationships that you want to use. For example DataSets have DataRelationships, or Entity Framework tables are related as properties from the master to the detail. All those relationships that are not explicitly defined in the report should be returned here.

Syntax

Namespace: FlexCel.Report

public virtual TRelation GetRelationWith(VirtualDataTable aDetail)

Parameters

<-> | Parameter | Type | Description
 | aDetail | VirtualDataTable | Detail table from where we want to get the relationship.

See also

  • VirtualDataTable


VirtualDataTable.Lookup Method | FlexCel Studio for the .NET Framework documentation

VirtualDataTable.Lookup Method

Looks for a key on this dataset and returns the corresponding value. Note: Remember that VirtualDataSet is stateless, so if you use any caching here, make sure you appropiately lock() this method so there is no possibility of one thread reading the cache when the other is updating it.

Remarks

You do not need to implement this method unless you want to provide an optimized routine. There is a default implementation which will look at all the records, cache them in a hash table, and use that for lookup. This default implementation should be enough in most cases.

Syntax

Namespace: FlexCel.Report

public virtual Object Lookup(TLookupFieldDefinition LookupFields, Object[] keyValues, String sort)

Parameters

<-> | Parameter | Type | Description
 | LookupFields | TLookupField​Definition | Fields used to do the lookup.
 | keyValues | Object[] | A list of the values for the keys, that you should use to locate the right record.
 | sort | String | How the data is sorted. This is relevant for TOP tables where not all data is available.

Returns

The value at "column" , for the record where the columns on "keyNames" have the "keyValues" values. If there is more than one record where "keyNames" is equal to "keyValues" you might opt to throw an Exception or just return any of the valid values, depending on the behavior you want for lookup.

See also

  • VirtualDataTable


VirtualDataTable.Dispose Method | FlexCel Studio for the .NET Framework documentation

VirtualDataTable.Dispose Method

Overloads

  • VirtualDataTable.Dispose
  • VirtualDataTable.Dispose(Boolean)

VirtualDataTable.Dispose

Dispose whatever is needed on the children here.

Syntax

Namespace: FlexCel.Report

public void Dispose()

See also

  • VirtualDataTable

VirtualDataTable.Dispose(Boolean)

Override this method on derived classes.

Syntax

Namespace: FlexCel.Report

protected virtual void Dispose(Boolean disposing)

Parameters

<-> | Parameter | Type | Description
 | disposing | Boolean |

See also

  • VirtualDataTable


VirtualDataTable.TableName Property | FlexCel Studio for the .NET Framework documentation

VirtualDataTable.TableName Property

Name for the virtual data table. Note that this name is *not* used anywhere in FlexCel code, except to report errors. The Table names that are used on reports are the ones in VirtualDataTableState

Syntax

Namespace: FlexCel.Report

public String TableName { get; }

See also

  • VirtualDataTable


VirtualDataTable.Locale Property | FlexCel Studio for the .NET Framework documentation

VirtualDataTable.Locale Property

Locale for this dataset. This might be needed to create datatables with data and the same locale.

Syntax

Namespace: FlexCel.Report

public abstract CultureInfo Locale { get; }

See also

  • VirtualDataTable


VirtualDataTable.ColumnCount Property | FlexCel Studio for the .NET Framework documentation

VirtualDataTable.ColumnCount Property

Returns the number of columns of the table.

Syntax

Namespace: FlexCel.Report

public abstract Int32 ColumnCount { get; }

See also

  • VirtualDataTable


VirtualDataTable.CreatedBy Property | FlexCel Studio for the .NET Framework documentation

VirtualDataTable.CreatedBy Property

Returns the table that created this one (by a filter, distinct, etc), or null if this table was not created from another VirtualDataTable.

Syntax

Namespace: FlexCel.Report

public VirtualDataTable CreatedBy { get; }

See also

  • VirtualDataTable


VirtualDataTableState Class | FlexCel Studio for the .NET Framework documentation

VirtualDataTableState Class

A table that corresponds to a band on the report. Make sure you read 'Appendix virtual datasets' in the Reports Developer Guide for more information.

Syntax

Namespace: FlexCel.Report

public abstract class VirtualDataTableState: IDisposable

Constructors

Name | Description
VirtualDataTable​State | Constructs a new VirtualDataTable​State with the specified name. Note that you will not call this constructor directly, new VirtualDataTable​State instances will be created only by VirtualDataTable.​Create​State

Destructors

Name | Description
Finalize | Finalizer for the class.

Methods

Name Description
TryAggregate This method is used by the "AGGREGATE" tag in a FlexCel report to calculate the maximum/​minimum/​average/​etc of the values in the table. If you don't implement this method, FlexCel will still calculate those values by looping through the dataset, but if you have a faster way to do it (like with a "select max(field) from table") then implement this method and return true.
Eof This method returns if we have reached the last record in the table. The default implementation just sees if Position = RowCount. If RowCount is slow and you have a faster way to know if you are at the end, override this method.
GetValue Overloaded
 GetValue(Int32)
GetValue(Int32, Int32)
MoveFirst This method is called when we want to move to the first record.
You can always know the current record with Position
MoveNext This method is called when we want to move to the next record.
You can always know the current record with Position
MoveMasterRecord This method will be called each time that the master datasource moves its position. Use it to filter the data returned if this is used on a master-detail relationship.
FilteredRowCount This method will be called when a Split master wants to know how many records its detail has. For example, if the detail has 30 records and the split is at 10, the Split master will call this method to find out that it has to return 3 on its own record count.
You need to filter the data here depending on the master detail relationships, but not on the splitLink.
Dispose Overloaded
 Dispose
Dispose(Boolean)

Properties

Name | Description
TableData | The VirtualDataTable that created this instance.
Position | Returns the active row on the table. (0 based) You should use this value to return the values on GetValue(​​Int32)
TableName | Returns the table name assigned on the template to this dataset. Note that this name is the one on the bands in the template.
RowCount | Returns the number of rows available on the dataset, for the current state. Note that this method can be called many times, so it should be fast. Use a cache if necessary. Do *not* use something like "return select count(*) from table" here, it would be too slow.


VirtualDataTableState.VirtualDataTableState Constructor | FlexCel Studio for the .NET Framework documentation

VirtualDataTableState.VirtualDataTableState Constructor

Constructs a new VirtualDataTableState with the specified name. Note that you will not call this constructor directly, new VirtualDataTableState instances will be created only by VirtualDataTable.CreateState

Syntax

Namespace: FlexCel.Report

protected VirtualDataTableState(VirtualDataTable aTableData)

Parameters

<-> | Parameter | Type | Description
 | aTableData | VirtualDataTable | VirtualDataTable that created this instance.

See also

  • VirtualDataTableState


VirtualDataTableState.Finalize Destructor | FlexCel Studio for the .NET Framework documentation

VirtualDataTableState.Finalize Destructor

Finalizer for the class.

Syntax

Namespace: FlexCel.Report

protected void Finalize()

See also

  • VirtualDataTableState


VirtualDataTableState.TryAggregate Method | FlexCel Studio for the .NET Framework documentation

VirtualDataTableState.TryAggregate Method

This method is used by the "AGGREGATE" tag in a FlexCel report to calculate the maximum/minimum/average/etc of the values in the table. If you don't implement this method, FlexCel will still calculate those values by looping through the dataset, but if you have a faster way to do it (like with a "select max(field) from table") then implement this method and return true.

Syntax

Namespace: FlexCel.Report

public virtual Boolean TryAggregate(TAggregateType aggregateType, Int32 colIndex, out Object resultValue)

Parameters

<-> | Parameter | Type | Description
 | aggregateType | TAggregateType | Which operation to do on the dataset. (Max/Min/etc)
 | colIndex | Int32 | Index of the field in which we want to aggregate.
out | resultValue | Object | Returns the result of the operation in the dataset. It should be null, a double or a datetime.

Returns

True if this method is implemented, false if not. Note that even if we return false here, FlexCel will still calculate the aggregate by looping through all the records.

See also

  • VirtualDataTableState


VirtualDataTableState.Eof Method | FlexCel Studio for the .NET Framework documentation

VirtualDataTableState.Eof Method

This method returns if we have reached the last record in the table. The default implementation just sees if Position = RowCount. If RowCount is slow and you have a faster way to know if you are at the end, override this method.

Syntax

Namespace: FlexCel.Report

public virtual Boolean Eof()

See also

  • VirtualDataTableState


VirtualDataTableState.GetValue Method | FlexCel Studio for the .NET Framework documentation

VirtualDataTableState.GetValue Method

Overloads

  • VirtualDataTableState.GetValue(Int32)
  • VirtualDataTableState.GetValue(Int32, Int32)

VirtualDataTableState.GetValue(Int32)

Returns the value for row Position, at the column "column"

Syntax

Namespace: FlexCel.Report

public abstract Object GetValue(Int32 column)

Parameters

<-> | Parameter | Type | Description
 | column | Int32 | Column identifier returned by VirtualDataTable.GetColumn

See also

  • VirtualDataTableState

VirtualDataTableState.GetValue(Int32, Int32)

Returns the value for row "row", at the column "column". You need to overload this method only if you want to support DBValue tag.

Syntax

Namespace: FlexCel.Report

public abstract Object GetValue(Int32 row, Int32 column)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row identifier (0 based)
 | column | Int32 | Column identifier returned by VirtualDataTable.GetColumn

See also

  • VirtualDataTableState


VirtualDataTableState.MoveFirst Method | FlexCel Studio for the .NET Framework documentation

VirtualDataTableState.MoveFirst Method

This method is called when we want to move to the first record. You can always know the current record with Position

Syntax

Namespace: FlexCel.Report

public virtual void MoveFirst()

See also

  • VirtualDataTableState


VirtualDataTableState.MoveNext Method | FlexCel Studio for the .NET Framework documentation

VirtualDataTableState.MoveNext Method

This method is called when we want to move to the next record. You can always know the current record with Position

Syntax

Namespace: FlexCel.Report

public abstract void MoveNext()

See also

  • VirtualDataTableState


VirtualDataTableState.MoveMasterRecord Method | FlexCel Studio for the .NET Framework documentation

VirtualDataTableState.MoveMasterRecord Method

This method will be called each time that the master datasource moves its position. Use it to filter the data returned if this is used on a master-detail relationship.

Remarks

You do not need to implement this method if you are not using Master-Detail or Split relationships.

Syntax

Namespace: FlexCel.Report

public virtual void MoveMasterRecord(TMasterDetailLink[] masterDetailLinks, TSplitLink splitLink)

Parameters

<-> | Parameter | Type | Description
 | masterDetailLinks | TMasterDetailLink[] | List of all the master tables that are related to this one. If there are no parents on this VirtualDataTableState, this will be an empty array, not null. Use it on GetValue(Int32) to filter the data and then return only the records that satisfy the master-detail relationships on GetValue(Int32)
 | splitLink | TSplitLink | Parent Split table if this dataset is on a Split relationship, or null if there is none. Use it to know how many records you should retun on RowCount. Note that a table might be on Master-Detail relationship *and* split relationship. In this case you need to first filter the records that are on the master detail relationship, and then apply the split to them.

See also

  • VirtualDataTableState


VirtualDataTableState.FilteredRowCount Method | FlexCel Studio for the .NET Framework documentation

VirtualDataTableState.FilteredRowCount Method

This method will be called when a Split master wants to know how many records its detail has. For example, if the detail has 30 records and the split is at 10, the Split master will call this method to find out that it has to return 3 on its own record count. You need to filter the data here depending on the master detail relationships, but not on the splitLink.

Remarks

You do not need to implement this method if you are not using Split relationships.

Syntax

Namespace: FlexCel.Report

public virtual Int32 FilteredRowCount(TMasterDetailLink[] masterDetailLinks)

Parameters

<-> | Parameter | Type | Description
 | masterDetailLinks | TMasterDetailLink[] | List of all the master tables that are related to this one. If there are no parents on this VirtualDataTableState, this will be an empty array, not null.

Returns

The count of records for a specific position of the master datasets.

See also

  • VirtualDataTableState


VirtualDataTableState.Dispose Method | FlexCel Studio for the .NET Framework documentation

VirtualDataTableState.Dispose Method

Overloads

  • VirtualDataTableState.Dispose
  • VirtualDataTableState.Dispose(Boolean)

VirtualDataTableState.Dispose

Dispose whatever is needed on the children here.

Syntax

Namespace: FlexCel.Report

public void Dispose()

See also

  • VirtualDataTableState

VirtualDataTableState.Dispose(Boolean)

Override this method on derived classes.

Syntax

Namespace: FlexCel.Report

protected virtual void Dispose(Boolean disposing)

Parameters

<-> | Parameter | Type | Description
 | disposing | Boolean |

See also

  • VirtualDataTableState


VirtualDataTableState.TableData Property | FlexCel Studio for the .NET Framework documentation

VirtualDataTableState.TableData Property

The VirtualDataTable that created this instance.

Syntax

Namespace: FlexCel.Report

public VirtualDataTable TableData { get; }

See also

  • VirtualDataTableState


VirtualDataTableState.Position Property | FlexCel Studio for the .NET Framework documentation

VirtualDataTableState.Position Property

Returns the active row on the table. (0 based) You should use this value to return the values on GetValue(Int32)

Syntax

Namespace: FlexCel.Report

public virtual Int32 Position { get; }

See also

  • VirtualDataTableState


VirtualDataTableState.TableName Property | FlexCel Studio for the .NET Framework documentation

VirtualDataTableState.TableName Property

Returns the table name assigned on the template to this dataset. Note that this name is the one on the bands in the template.

Syntax

Namespace: FlexCel.Report

public String TableName { get; }

See also

  • VirtualDataTableState


VirtualDataTableState.RowCount Property | FlexCel Studio for the .NET Framework documentation

VirtualDataTableState.RowCount Property

Returns the number of rows available on the dataset, for the current state. Note that this method can be called many times, so it should be fast. Use a cache if necessary. Do *not* use something like "return select count(*) from table" here, it would be too slow.

Syntax

Namespace: FlexCel.Report

public abstract Int32 RowCount { get; }

See also

  • VirtualDataTableState


TLookupFieldDefinition Structure | FlexCel Studio for the .NET Framework documentation

TLookupFieldDefinition Structure

Encapsulates the data for a lookup tag in a report.

Syntax

Namespace: FlexCel.Report

public struct TLookupFieldDefinition

Constructors

Name | Description
TLookupField​Definition | Creates a new lookupfield definition. Fields will be copied.

Methods

Name | Description
GetHashCode | Returns the hash code of this object.
Equals | Returns true if both structs are the same.

Operators

Name | Description
Equality | Returns true if both structs are the same.
Inequality | Returns true if both structs are different.

Properties

Name | Description
KeyFields | The key fields in the lookup.
ResultField | The result field for the lookup.
OriginalKeyFields​Definition | The key fields definition as it is written in the lookup tag. You will normally not need this data.


TLookupFieldDefinition.TLookupFieldDefinition Constructor | FlexCel Studio for the .NET Framework documentation

TLookupFieldDefinition.TLookupFieldDefinition Constructor

Creates a new lookupfield definition. Fields will be copied.

Syntax

Namespace: FlexCel.Report

public TLookupFieldDefinition(Int32[] aKeyFields, Int32 aResultField, String aOriginalKeyFieldsDefinition)

Parameters

<-> | Parameter | Type | Description
 | aKeyFields | Int32[] | A list of fields to be used in the key. The array will be copied so you can reuse it.
 | aResultField | Int32 | The field to be returned from the lookup.
 | aOriginalKeyFieldsDefinition | String | The key fields definition as it is written in the lookup tag. You will normally not need this data.

See also

  • TLookupFieldDefinition


TLookupFieldDefinition.GetHashCode Method | FlexCel Studio for the .NET Framework documentation

TLookupFieldDefinition.GetHashCode Method

Returns the hash code of this object.

Syntax

Namespace: FlexCel.Report

public override Int32 GetHashCode()

See also

  • TLookupFieldDefinition


TLookupFieldDefinition.Equals Method | FlexCel Studio for the .NET Framework documentation

TLookupFieldDefinition.Equals Method

Returns true if both structs are the same.

Syntax

Namespace: FlexCel.Report

public override Boolean Equals(Object obj)

Parameters

<-> | Parameter | Type | Description
 | obj | Object |

See also

  • TLookupFieldDefinition


TLookupFieldDefinition.Equality Operator | FlexCel Studio for the .NET Framework documentation

TLookupFieldDefinition.Equality Operator

Returns true if both structs are the same.

Syntax

Namespace: FlexCel.Report

public static Boolean op_Equality(TLookupFieldDefinition a1, TLookupFieldDefinition a2)

Parameters

<-> | Parameter | Type | Description
 | a1 | TLookupField​Definition |
 | a2 | TLookupField​Definition |

See also

  • TLookupFieldDefinition


TLookupFieldDefinition.Inequality Operator | FlexCel Studio for the .NET Framework documentation

TLookupFieldDefinition.Inequality Operator

Returns true if both structs are different.

Syntax

Namespace: FlexCel.Report

public static Boolean op_Inequality(TLookupFieldDefinition a1, TLookupFieldDefinition a2)

Parameters

<-> | Parameter | Type | Description
 | a1 | TLookupField​Definition |
 | a2 | TLookupField​Definition |

See also

  • TLookupFieldDefinition


TLookupFieldDefinition.KeyFields Property | FlexCel Studio for the .NET Framework documentation

TLookupFieldDefinition.KeyFields Property

The key fields in the lookup.

Syntax

Namespace: FlexCel.Report

public Int32[] KeyFields { get; }

See also

  • TLookupFieldDefinition


TLookupFieldDefinition.ResultField Property | FlexCel Studio for the .NET Framework documentation

TLookupFieldDefinition.ResultField Property

The result field for the lookup.

Syntax

Namespace: FlexCel.Report

public Int32 ResultField { get; }

See also

  • TLookupFieldDefinition


TLookupFieldDefinition.OriginalKeyFieldsDefinition Property | FlexCel Studio for the .NET Framework documentation

TLookupFieldDefinition.OriginalKeyFieldsDefinition Property

The key fields definition as it is written in the lookup tag. You will normally not need this data.

Syntax

Namespace: FlexCel.Report

public String OriginalKeyFieldsDefinition { get; }

See also

  • TLookupFieldDefinition


ILinqDataTable Interface | FlexCel Studio for the .NET Framework documentation

ILinqDataTable Interface

Interface for generic methods in ILinqDataTable.

Syntax

Namespace: FlexCel.Report

public interface ILinqDataTable;

Methods

Name | Description
HasDetail | Returns true if the database has a linked datatable with name dataTableName.
FindOrigTableName | Returns the base table this one is created from. This is used in relationships, to find out the relationships of the master table.


ILinqDataTable.HasDetail Method | FlexCel Studio for the .NET Framework documentation

ILinqDataTable.HasDetail Method

Returns true if the database has a linked datatable with name dataTableName.

Syntax

Namespace: FlexCel.Report

public abstract Boolean HasDetail(String dataTableName)

Parameters

<-> | Parameter | Type | Description
 | dataTableName | String | Name for the linked datatable that we are searching for.

See also

  • ILinqDataTable


ILinqDataTable.FindOrigTableName Method | FlexCel Studio for the .NET Framework documentation

ILinqDataTable.FindOrigTableName Method

Returns the base table this one is created from. This is used in relationships, to find out the relationships of the master table.

Syntax

Namespace: FlexCel.Report

public abstract String FindOrigTableName()

See also

  • ILinqDataTable


ILinqDataTableState Interface | FlexCel Studio for the .NET Framework documentation

ILinqDataTableState Interface

This interface is used by TLinqDataTableState for calling generic methods.

Syntax

Namespace: FlexCel.Report

public interface ILinqDataTableState;

Methods

Name | Description
GetDetail<Q> | Returns a detail table. This is used in master-detail relationships to get the nested table for the detail band.


ILinqDataTableState.GetDetail<Q> Method | FlexCel Studio for the .NET Framework documentation

ILinqDataTableState.GetDetail<Q> Method

Returns a detail table. This is used in master-detail relationships to get the nested table for the detail band.

Syntax

Namespace: FlexCel.Report

public abstract IEnumerable<Q> GetDetail<Q>(TLinqDataTable<Q> Detail, out Boolean IsEmptyList)

Parameters

<-> | Parameter | Type | Description
 | Detail | TLinqDataTable<Q> | Detail data table calling this method.
out | IsEmptyList | Boolean | Return true if the enumerator has 0 records.

Type Parameters

Type Parameter | Description
Q |

See also

  • ILinqDataTableState


ApplyFormatTagEnum Enumeration | FlexCel Studio for the .NET Framework documentation

ApplyFormatTagEnum Enumeration

Configuration strings used in applying a part of a format. Internal use.

Syntax

Namespace: FlexCel.Report

Members

Name | Value | Description
All | 0 |
Border | 1 |
BorderLeft | 2 |
BorderRight | 3 |
BorderTop | 4 |
BorderBottom | 5 |
BorderExterior | 6 |
Font | 7 |
FontFamily | 8 |
FontSize | 9 |
FontColor | 10 |
FontStyle | 11 |
FontUnderline | 12 |
NumericFormat | 13 |
Background | 14 |
BackgroundPattern | 15 |
BackgroundColor | 16 |
TextAlign | 17 |
TextAlignHoriz | 18 |
TextAlignVert | 19 |
Locked | 20 |
Hidden | 21 |
TextWrap | 22 |
ShrinkToFit | 23 |
Rotation | 24 |
TextIndent | 25 |


ConfigTagEnum Enumeration | FlexCel Studio for the .NET Framework documentation

ConfigTagEnum Enumeration

Configuration strings. Internal use.

Syntax

Namespace: FlexCel.Report

Members

Name | Value | Description
SQL | 0 | SQL tag.
Relationship | 1 | Relationship tag.
Distinct | 2 | Distinct filter.
SQLParam | 3 | Identifier for sql parameters on the config sheet.
Split | 4 | Split Tag on config sheet.
UserTable | 5 | User table tag on config sheet.
Top | 6 | Top n records in a dataset.
NRows | 7 | An empty table with n rows.
Columns | 8 | A table with the columns of other table.
AtLeast | 9 | A table that has at least N rows.
Join | 10 | A table generated from joining the columns of multiple tables.
Union | 11 | A table generated by adding the rows of multiple tables.


FlexCelReportProgressPhase Enumeration | FlexCel Studio for the .NET Framework documentation

FlexCelReportProgressPhase Enumeration

Phase of the report we are in.

Syntax

Namespace: FlexCel.Report

Members

Name | Value | Description
NotRunning | 0 | Report is inactive.
ReadTemplate | 1 | Reading and parsing the template.
OrganizeData | 2 | Organizing the data on the template.
CopyStructure | 3 | Inserting the needed rows/ranges for the report.
FillData | 4 | Replacing the tags with the new values.
FinalCleanup | 5 | Fixing pagebreak or delete rows tags.
Done | 6 | Report has finished.


TAggregateType Enumeration | FlexCel Studio for the .NET Framework documentation

TAggregateType Enumeration

Enumeration with the different kind of aggregations that can be done in a FlexCelReport.

Syntax

Namespace: FlexCel.Report

Members

Name | Value | Description
Sum | 0 | Sum all values.
Average | 1 | Average all values.
Max | 2 | Max of all values.
Min | 3 | Minimum of all values.
Count | 4 | Count of all values.


TDeleteEmptyBands Enumeration | FlexCel Studio for the .NET Framework documentation

TDeleteEmptyBands Enumeration

Defines how bands will be removed when they have 0 records.

Syntax

Namespace: FlexCel.Report

Members

Name | Value | Description
MoveRangeUp | 0 | All the sheet will be moved up, and the rows of the band will disappear.
ClearDataOnly | 1 | The cells in the sheet won't move, but the data in the cells will be cleared. Formats of the cell will remain.
ClearDataAndFormats | 2 | The cells in the sheet won't move, but all data and formats in the cells will be cleared.


TDisposeMode Enumeration | FlexCel Studio for the .NET Framework documentation

TDisposeMode Enumeration

Indicates if FlexCel must dispose a table after it is done using it.

Syntax

Namespace: FlexCel.Report

Members

Name | Value | Description
DoNotDispose | 0 | FlexCel will not dispose the table. Use this option for example when adding a table that was created on the designer.
DisposeAfterRun | 1 | FlexCel will dispose this table after it has finish using it. Use this option when adding temporary datasets, so you do not have to take care of disposing the table yourself.


TErrorActions Enumeration | FlexCel Studio for the .NET Framework documentation

TErrorActions Enumeration

Enumerates what to do on different FlexCel error situations.

Syntax

Namespace: FlexCel.Report

Members

Name | Value | Description
None | 0 | FlexCel will try to recover from most errors.
ErrorOnTooManyPageBreaks | 1 | When true and the number of manual pagebreaks is bigger than the maximum Excel allows, an Exception will be raised. When false, the page break will be silently omitted.


TSqlParametersType Enumeration | FlexCel Studio for the .NET Framework documentation

TSqlParametersType Enumeration

How the parameters for Direct SQL queries are. Change it only if your database uses positional parameters and it is not ODBC or OLEDB.

Syntax

Namespace: FlexCel.Report

Members

Name | Value | Description
Automatic | 0 | FlexCel will try to guess the correct type. Currently it will return Positional for ODBC and OLEDB Parameters and Named for everything else.
Named | 1 | Parameter is named. For example, "@param1" or ":Param2"
Positional | 2 | Name of parameter is not important, and we only care about position. For example "?"


TValueType Enumeration | FlexCel Studio for the .NET Framework documentation

TValueType Enumeration

All the things we can find on a cell.

Syntax

Namespace: FlexCel.Report

Members

Name | Value | Description
Const | 0 | A constant value, like 2 or "a".
DataSet | 1 | A value from a Dataset. This tag is written as "<#DataTable.Column>
Property | 2 | A report variable, like <#Variable>
FullDataSet | 3 | A dataset with "*"
FullDataSetCaptions | 4 | Captions for a full dataset.
IF | 5 | An #IF construct
IFS | 6 | An #IFS construct
SWITCH | 7 | A #SWITCH construct
Include | 8 | An include Tag.
Equal | 9 | A #= tag
DeleteSheet | 10 | A #Delete sheet
SheetVisible | 11 | A #Sheet visible tag.
ConfigSheet | 12 | #Config
DeleteRange | 13 | #Delete Range
DeleteRow | 14 | #Delete row
DeleteCol | 15 | Delete Column
FormatCell | 16 | Format cell
FormatRow | 17 | Format row
FormatCol | 18 | Format column
FormatRange | 19 | Format range
HPageBreak | 20 | Horizontal page break
VPageBreak | 21 | Vertical page break
Comment | 22 | This one will not really be stored.
Evaluate | 23 | An expression that will be evaluated
ImgSize | 24 | Only used inside images, to specify its zoom in % and its aspect ratio.
ImgPos | 25 | Only used inside images, to specify its position inside the cell.
ImgFit | 26 | Only used inside images, to specify how to modify the containing cells to hold the image.
ImgDelete | 27 | Only used inside images, to delete an image.
Lookup | 28 | A lookup field. Parameters are: DataBase, KeyFields, KeyValues, ResultField.
Array | 29 | An array of values. Useful for example as the KeyValues argument of the Lookup field.
Regex | 30 | A regular expression replace.
MergeRange | 31 | A cell that will be merged.
Formula | 32 | The contents of this cell should be entered as formula.
ColumnWidth | 33 | Adjusts the column width to a specified value.
RowHeight | 34 | Adjusts the row height to a specified value.
Html | 35 | Defines if the cell has HTML formatted data or not.
Ref | 36 | The parameter is considered a reference and will be changed when copying the ranges.
AutofitSettings | 37 | Sets autofit settings for the whole sheet.
Defined | 38 | Returns true if the expression is defined.
DefinedFormat | 39 | Returns true if the format is defined.
Preprocess | 40 | An expression that will be pre evaluated and used to modify the template.
AutoPageBreaks | 41 | FlexCel should automatically calculate the page breaks in this sheet.
Aggregate | 42 | Does an operation like sum or average over a dataset.
List | 43 | Concatenates all values in a dataset as a list.
DbValue | 44 | Gets the value of a dataset given a row or a column.
Hyperlink | 45 | Creates a link for the cell.
SwapChartSeries | 46 | Swaps rows and columns in the chart data definition.


CustomizeChartEventHandler Delegate | FlexCel Studio for the .NET Framework documentation

CustomizeChartEventHandler Delegate

Delegate for CustomizeChart event.

Syntax

Namespace: FlexCel.Report

public delegate void CustomizeChartEventHandler(Object sender, CustomizeChartEventArgs e)

Parameters

<-> | Parameter | Type | Description
 | sender | Object |
 | e | CustomizeChart​Event​Args |


GenerateEventHandler Delegate | FlexCel Studio for the .NET Framework documentation

GenerateEventHandler Delegate

Generic delegate for After/Before generate events.

Syntax

Namespace: FlexCel.Report

public delegate void GenerateEventHandler(Object sender, GenerateEventArgs e)

Parameters

<-> | Parameter | Type | Description
 | sender | Object |
 | e | GenerateEventArgs |


GetImageDataEventHandler Delegate | FlexCel Studio for the .NET Framework documentation

GetImageDataEventHandler Delegate

Delegate for GetImageData event.

Syntax

Namespace: FlexCel.Report

public delegate void GetImageDataEventHandler(Object sender, GetImageDataEventArgs e)

Parameters

<-> | Parameter | Type | Description
 | sender | Object |
 | e | GetImageData​Event​Args |


GetIncludeEventHandler Delegate | FlexCel Studio for the .NET Framework documentation

GetIncludeEventHandler Delegate

Delegate for GetInclude event.

Syntax

Namespace: FlexCel.Report

public delegate void GetIncludeEventHandler(Object sender, GetIncludeEventArgs e)

Parameters

<-> | Parameter | Type | Description
 | sender | Object |
 | e | GetIncludeEventArgs |


LoadTableEventHandler Delegate | FlexCel Studio for the .NET Framework documentation

LoadTableEventHandler Delegate

Delegate for LoadTable event.

Syntax

Namespace: FlexCel.Report

public delegate void LoadTableEventHandler(Object sender, LoadTableEventArgs e)

Parameters

<-> | Parameter | Type | Description
 | sender | Object |
 | e | LoadTableEventArgs |


UserTableEventHandler Delegate | FlexCel Studio for the .NET Framework documentation

UserTableEventHandler Delegate

Delegate for UserTable event.

Syntax

Namespace: FlexCel.Report

public delegate void UserTableEventHandler(Object sender, UserTableEventArgs e)

Parameters

<-> | Parameter | Type | Description
 | sender | Object |
 | e | UserTableEventArgs |


FlexCel.AddinFunctions Namespace | FlexCel Studio for the .NET Framework documentation

FlexCel.AddinFunctions Namespace

This is a namespace with commonly used Excel Addin functions that will be used by FlexCel when recalculating. While the functions defined here are not part of the Excel 2003 internal functions, they are often used as they are included in the default "addin packs" in Excel. They also might be built-in in newer Excel releases.

Classes

Name | Description
BaseBinHexImpl | Base conversion class for implementing Bin2Hex, Dec2Bin, etc.
BaseBondsImpl | Implements the basics for Bond functions, like CoupDays, CoupDaysNC, CoupDayBS, CoupNCD, CoupNum, CoupPCD.
BaseGCDLCM | A base implementation for both GCD and LCM
BaseWorkDaysImpl | Implements the basis for WorkDays and NetWorkDays Excel functions. Look at Excel documentation for more information.
Bin2DecImpl | Implements the Bin2Dec Excel function. Look at Excel documentation for more information.
Bin2HexImpl | Implements the Bin2Hex Excel function. Look at Excel documentation for more information.
Bin2OctImpl | Implements the Bin2Oct Excel function. Look at Excel documentation for more information.
ConvertImpl | Implements the Convert Excel function. Look at Excel documentation for more information.
CoupDaysBSImpl | Implements the CoupDaysBS Excel function. Look at Excel documentation for more information.
CoupDaysImpl | Implements the CoupDays Excel function. Look at Excel documentation for more information.
CoupDaysNCImpl | Implements the CoupDaysNC Excel function. Look at Excel documentation for more information.
CoupNCDImpl | Implements the CoupNCD Excel function. Look at Excel documentation for more information.
CoupNumImpl | Implements the CoupNum Excel function. Look at Excel documentation for more information.
CoupPCDImpl | Implements the CoupPCD Excel function. Look at Excel documentation for more information.
Dec2BinImpl | Implements the Dec2Bin Excel function. Look at Excel documentation for more information.
Dec2HexImpl | Implements the Dec2Hex Excel function. Look at Excel documentation for more information.
Dec2OctImpl | Implements the Dec2Oct Excel function. Look at Excel documentation for more information.
DeltaImpl | Implements the Delta Excel function. Look at Excel documentation for more information.
DollarDeImpl | Implements the DollarDe Excel function. Look at Excel documentation for more information.
DollarFrImpl | Implements the DollarDe Excel function. Look at Excel documentation for more information.
DurationImpl | Implements the Duration and MDuration addin functions. Returns the [modified] Macauley duration for a security with an assumed par value of $100.
EDateImpl | Implements the EDate addin function. Returns the serial number that represents the date that is the indicated number of months before or after a specified date (the start_date). Use EDATE to calculate maturity dates or due dates that fall on the same day of the month as the date of issue.
EffectImpl | Implements the Effect Excel function. Look at Excel documentation for more information.
EOMonthImpl | Implements the EOMonth Excel function. Look at Excel documentation for more information.
FactDoubleImpl | Implements the FactDouble Excel function. Look at Excel documentation for more information.
GcdImpl | Implements the GCD Excel function. Look at Excel documentation for more information.
GeStepImpl | Implements the GeStep Excel function. Look at Excel documentation for more information.
Hex2BinImpl | Implements the Hex2Bin Excel function. Look at Excel documentation for more information.
Hex2DecImpl | Implements the Hex2Dec Excel function. Look at Excel documentation for more information.
Hex2OctImpl | Implements the Hex2Oct Excel function. Look at Excel documentation for more information.
IsEvenImpl | Implements the IsEven Excel function. Look at Excel documentation for more information.
IsOddImpl | Implements the IsOdd Excel function. Look at Excel documentation for more information.
LcmImpl | Implements the LCM Excel function. Look at Excel documentation for more information.
MRoundImpl | Implements the MRound Excel function. Look at Excel documentation for more information.
MultinomialImpl | Implements the Multinomial Excel function. Look at Excel documentation for more information.
NetWorkDaysImpl | Implements the NetWorkDays Excel function. Look at Excel documentation for more information.
NominalImpl | Implements the Nominal Excel function. Look at Excel documentation for more information.
Oct2BinImpl | Implements the Oct2Bin Excel function. Look at Excel documentation for more information.
Oct2DecImpl | Implements the Oct2Dec Excel function. Look at Excel documentation for more information.
Oct2HexImpl | Implements the Oct2Hex Excel function. Look at Excel documentation for more information.
QuotientImpl | Implements the Quotient Excel function. Look at Excel documentation for more information.
RandBetweenImpl | Implements the Quotient Excel function. Look at Excel documentation for more information.
SeriesSumImpl | Implements the SeriesSum Excel function. Look at Excel documentation for more information.
SqrtPiImpl | Implements the Quotient Excel function. Look at Excel documentation for more information.
WeekNumImpl | Implements the Weeknum Excel function. Look at Excel documentation for more information.
WorkDayImpl | Implements the WorkDay Excel function. Look at Excel documentation for more information.
XIRRImpl | Implements the XIRR Excel function. Look at Excel documentation for more information.
XNPVImpl | Implements the XNPV Excel function. Look at Excel documentation for more information.
YearFracImpl | Implements the YearFrac Excel function. Look at Excel documentation for more information.

Enumerations

Name | Description
TDayCountBasis | Enumerates different Basis parameters for financial functions like Duration.


BaseBinHexImpl Class | FlexCel Studio for the .NET Framework documentation

BaseBinHexImpl Class

Base conversion class for implementing Bin2Hex, Dec2Bin, etc.

Syntax

Namespace: FlexCel.AddinFunctions

public abstract class BaseBinHexImpl: TUserDefinedFunction

Constructors

Name | Description
BaseBinHexImpl | Creates a new object.

Methods

Name | Description
Evaluate | Evaluates the function.
Calc | Calculates the result depending on the specific function.


BaseBinHexImpl.BaseBinHexImpl Constructor | FlexCel Studio for the .NET Framework documentation

BaseBinHexImpl.BaseBinHexImpl Constructor

Creates a new object.

Syntax

Namespace: FlexCel.AddinFunctions

protected BaseBinHexImpl(String aName, Boolean aHasPlaces, Boolean aNeedsStrings)

Parameters

<-> | Parameter | Type | Description
 | aName | String |
 | aHasPlaces | Boolean |
 | aNeedsStrings | Boolean |

See also

  • BaseBinHexImpl


BaseBinHexImpl.Evaluate Method | FlexCel Studio for the .NET Framework documentation

BaseBinHexImpl.Evaluate Method

Evaluates the function.

Syntax

Namespace: FlexCel.AddinFunctions

public override Object Evaluate(TUdfEventArgs arguments, Object[] parameters)

Parameters

<-> | Parameter | Type | Description
 | arguments | TUdfEventArgs |
 | parameters | Object[] |

See also

  • BaseBinHexImpl


BaseBinHexImpl.Calc Method | FlexCel Studio for the .NET Framework documentation

BaseBinHexImpl.Calc Method

Calculates the result depending on the specific function.

Syntax

Namespace: FlexCel.AddinFunctions

protected abstract Object Calc(String num, Double dnum, Int32 Places)

Parameters

<-> | Parameter | Type | Description
 | num | String |
 | dnum | Double |
 | Places | Int32 |

See also

  • BaseBinHexImpl


BaseBondsImpl Class | FlexCel Studio for the .NET Framework documentation

BaseBondsImpl Class

Implements the basics for Bond functions, like CoupDays, CoupDaysNC, CoupDayBS, CoupNCD, CoupNum, CoupPCD.

Syntax

Namespace: FlexCel.AddinFunctions

public abstract class BaseBondsImpl: TUserDefinedFunction

Constructors

Name | Description
BaseBondsImpl | Creates a new implementation.

Methods

Name | Description
Evaluate | Evaluates the function. Look At Excel docs for parameters.
Calc | Calculates the result depending on the specific function.
PrevCoupon | Returns the previous coupon for a given coupon.
NextCoupon | Returns the next coupon after settlement date.
LevelDayOfMonth | Makes the day in bonddate be as big Maturity date as possible.
LastDayOfMonth | Returns the last day of a month.
IsEOM | Returns true if the date is the end of month.


BaseBondsImpl.BaseBondsImpl Constructor | FlexCel Studio for the .NET Framework documentation

BaseBondsImpl.BaseBondsImpl Constructor

Creates a new implementation.

Syntax

Namespace: FlexCel.AddinFunctions

protected BaseBondsImpl(String aName)

Parameters

<-> | Parameter | Type | Description
 | aName | String |

See also

  • BaseBondsImpl


BaseBondsImpl.Evaluate Method | FlexCel Studio for the .NET Framework documentation

BaseBondsImpl.Evaluate Method

Evaluates the function. Look At Excel docs for parameters.

Syntax

Namespace: FlexCel.AddinFunctions

public override Object Evaluate(TUdfEventArgs arguments, Object[] parameters)

Parameters

<-> | Parameter | Type | Description
 | arguments | TUdfEventArgs |
 | parameters | Object[] |

See also

  • BaseBondsImpl


BaseBondsImpl.Calc Method | FlexCel Studio for the .NET Framework documentation

BaseBondsImpl.Calc Method

Calculates the result depending on the specific function.

Syntax

Namespace: FlexCel.AddinFunctions

protected abstract Object Calc(DateTime SettlementDate, DateTime MaturityDate, Double Frequency, TDayCountBasis Basis)

Parameters

<-> | Parameter | Type | Description
 | SettlementDate | DateTime |
 | MaturityDate | DateTime |
 | Frequency | Double |
 | Basis | TDayCountBasis |

See also

  • BaseBondsImpl


BaseBondsImpl.PrevCoupon Method | FlexCel Studio for the .NET Framework documentation

BaseBondsImpl.PrevCoupon Method

Returns the previous coupon for a given coupon.

Syntax

Namespace: FlexCel.AddinFunctions

protected static DateTime PrevCoupon(DateTime endDate, DateTime MaturityDate, Double Frequency)

Parameters

<-> | Parameter | Type | Description
 | endDate | DateTime | Date of the coupon we want to find.
 | MaturityDate | DateTime | Maturity date.
 | Frequency | Double | Frequency

See also

  • BaseBondsImpl


BaseBondsImpl.NextCoupon Method | FlexCel Studio for the .NET Framework documentation

BaseBondsImpl.NextCoupon Method

Returns the next coupon after settlement date.

Syntax

Namespace: FlexCel.AddinFunctions

protected static DateTime NextCoupon(DateTime SettlementDate, DateTime MaturityDate, Double Frequency)

Parameters

<-> | Parameter | Type | Description
 | SettlementDate | DateTime |
 | MaturityDate | DateTime |
 | Frequency | Double |

See also

  • BaseBondsImpl


BaseBondsImpl.LevelDayOfMonth Method | FlexCel Studio for the .NET Framework documentation

BaseBondsImpl.LevelDayOfMonth Method

Makes the day in bonddate be as big Maturity date as possible.

Syntax

Namespace: FlexCel.AddinFunctions

protected static DateTime LevelDayOfMonth(DateTime BondDate, DateTime MaturityDate)

Parameters

<-> | Parameter | Type | Description
 | BondDate | DateTime |
 | MaturityDate | DateTime |

See also

  • BaseBondsImpl


BaseBondsImpl.LastDayOfMonth Method | FlexCel Studio for the .NET Framework documentation

BaseBondsImpl.LastDayOfMonth Method

Returns the last day of a month.

Syntax

Namespace: FlexCel.AddinFunctions

protected internal static DateTime LastDayOfMonth(DateTime BondDate)

Parameters

<-> | Parameter | Type | Description
 | BondDate | DateTime |

See also

  • BaseBondsImpl


BaseBondsImpl.IsEOM Method | FlexCel Studio for the .NET Framework documentation

BaseBondsImpl.IsEOM Method

Returns true if the date is the end of month.

Syntax

Namespace: FlexCel.AddinFunctions

protected static Boolean IsEOM(DateTime SettlementDate)

Parameters

<-> | Parameter | Type | Description
 | SettlementDate | DateTime |

See also

  • BaseBondsImpl


BaseGCDLCM Class | FlexCel Studio for the .NET Framework documentation

BaseGCDLCM Class

A base implementation for both GCD and LCM

Syntax

Namespace: FlexCel.AddinFunctions

public abstract class BaseGCDLCM: TUserDefinedFunction

Constructors

Name | Description
BaseGCDLCM | Creates a new instance of the class.

Methods

Name | Description
Evaluate | Evaluates the function. Look At Excel docs for parameters.


BaseGCDLCM.BaseGCDLCM Constructor | FlexCel Studio for the .NET Framework documentation

BaseGCDLCM.BaseGCDLCM Constructor

Creates a new instance of the class.

Syntax

Namespace: FlexCel.AddinFunctions

protected BaseGCDLCM(String aName)

Parameters

<-> | Parameter | Type | Description
 | aName | String |

See also

  • BaseGCDLCM


BaseGCDLCM.Evaluate Method | FlexCel Studio for the .NET Framework documentation

BaseGCDLCM.Evaluate Method

Evaluates the function. Look At Excel docs for parameters.

Syntax

Namespace: FlexCel.AddinFunctions

public override Object Evaluate(TUdfEventArgs arguments, Object[] parameters)

Parameters

<-> | Parameter | Type | Description
 | arguments | TUdfEventArgs |
 | parameters | Object[] |

See also

  • BaseGCDLCM


BaseWorkDaysImpl Class | FlexCel Studio for the .NET Framework documentation

BaseWorkDaysImpl Class

Implements the basis for WorkDays and NetWorkDays Excel functions. Look at Excel documentation for more information.

Syntax

Namespace: FlexCel.AddinFunctions

public abstract class BaseWorkDaysImpl: TUserDefinedFunction

Fields

Name | Description
Intl | Internal use.

Constructors

Name | Description
BaseWorkDaysImpl | Creates a new implementation.


BaseWorkDaysImpl.Intl Field | FlexCel Studio for the .NET Framework documentation

BaseWorkDaysImpl.Intl Field

Internal use.

Syntax

Namespace: FlexCel.AddinFunctions

protected Boolean Intl

See also

  • BaseWorkDaysImpl


BaseWorkDaysImpl.BaseWorkDaysImpl Constructor | FlexCel Studio for the .NET Framework documentation

BaseWorkDaysImpl.BaseWorkDaysImpl Constructor

Creates a new implementation.

Syntax

Namespace: FlexCel.AddinFunctions

protected BaseWorkDaysImpl(Boolean aIntl, String aName)

Parameters

<-> | Parameter | Type | Description
 | aIntl | Boolean |
 | aName | String |

See also

  • BaseWorkDaysImpl


Bin2DecImpl Class | FlexCel Studio for the .NET Framework documentation

Bin2DecImpl Class

Implements the Bin2Dec Excel function. Look at Excel documentation for more information.

Syntax

Namespace: FlexCel.AddinFunctions

public class Bin2DecImpl: BaseBinHexImpl

Constructors

Name | Description
Bin2DecImpl | Creates a new implementation.

Methods

Name | Description
Calc | Implement this method to specialize BaseBinHexImpl class.


Bin2DecImpl.Bin2DecImpl Constructor | FlexCel Studio for the .NET Framework documentation

Bin2DecImpl.Bin2DecImpl Constructor

Creates a new implementation.

Syntax

Namespace: FlexCel.AddinFunctions

public Bin2DecImpl()

See also

  • Bin2DecImpl


Bin2DecImpl.Calc Method | FlexCel Studio for the .NET Framework documentation

Bin2DecImpl.Calc Method

Implement this method to specialize BaseBinHexImpl class.

Syntax

Namespace: FlexCel.AddinFunctions

protected override Object Calc(String num, Double dnum, Int32 Places)

Parameters

<-> | Parameter | Type | Description
 | num | String |
 | dnum | Double |
 | Places | Int32 |

See also

  • Bin2DecImpl


Bin2HexImpl Class | FlexCel Studio for the .NET Framework documentation

Bin2HexImpl Class

Implements the Bin2Hex Excel function. Look at Excel documentation for more information.

Syntax

Namespace: FlexCel.AddinFunctions

public class Bin2HexImpl: BaseBinHexImpl

Constructors

Name | Description
Bin2HexImpl | Creates a new implementation.

Methods

Name | Description
Calc | Implement this method to specialize BaseBinHexImpl class.


Bin2HexImpl.Bin2HexImpl Constructor | FlexCel Studio for the .NET Framework documentation

Bin2HexImpl.Bin2HexImpl Constructor

Creates a new implementation.

Syntax

Namespace: FlexCel.AddinFunctions

public Bin2HexImpl()

See also

  • Bin2HexImpl


Bin2HexImpl.Calc Method | FlexCel Studio for the .NET Framework documentation

Bin2HexImpl.Calc Method

Implement this method to specialize BaseBinHexImpl class.

Syntax

Namespace: FlexCel.AddinFunctions

protected override Object Calc(String num, Double dnum, Int32 Places)

Parameters

<-> | Parameter | Type | Description
 | num | String |
 | dnum | Double |
 | Places | Int32 |

See also

  • Bin2HexImpl


Bin2OctImpl Class | FlexCel Studio for the .NET Framework documentation

Bin2OctImpl Class

Implements the Bin2Oct Excel function. Look at Excel documentation for more information.

Syntax

Namespace: FlexCel.AddinFunctions

public class Bin2OctImpl: BaseBinHexImpl

Constructors

Name | Description
Bin2OctImpl | Creates a new implementation.

Methods

Name | Description
Calc | Implement this method to specialize BaseBinHexImpl class.


Bin2OctImpl.Bin2OctImpl Constructor | FlexCel Studio for the .NET Framework documentation

Bin2OctImpl.Bin2OctImpl Constructor

Creates a new implementation.

Syntax

Namespace: FlexCel.AddinFunctions

public Bin2OctImpl()

See also

  • Bin2OctImpl


Bin2OctImpl.Calc Method | FlexCel Studio for the .NET Framework documentation

Bin2OctImpl.Calc Method

Implement this method to specialize BaseBinHexImpl class.

Syntax

Namespace: FlexCel.AddinFunctions

protected override Object Calc(String num, Double dnum, Int32 Places)

Parameters

<-> | Parameter | Type | Description
 | num | String |
 | dnum | Double |
 | Places | Int32 |

See also

  • Bin2OctImpl


ConvertImpl Class | FlexCel Studio for the .NET Framework documentation

ConvertImpl Class

Implements the Convert Excel function. Look at Excel documentation for more information.

Syntax

Namespace: FlexCel.AddinFunctions

public class ConvertImpl: TUserDefinedFunction

Constructors

Name | Description
ConvertImpl | Creates a new implementation.

Methods

Name | Description
Evaluate | Evaluates the function. Look At Excel docs for parameters.


ConvertImpl.ConvertImpl Constructor | FlexCel Studio for the .NET Framework documentation

ConvertImpl.ConvertImpl Constructor

Creates a new implementation.

Syntax

Namespace: FlexCel.AddinFunctions

public ConvertImpl()

See also

  • ConvertImpl


ConvertImpl.Evaluate Method | FlexCel Studio for the .NET Framework documentation

ConvertImpl.Evaluate Method

Evaluates the function. Look At Excel docs for parameters.

Syntax

Namespace: FlexCel.AddinFunctions

public override Object Evaluate(TUdfEventArgs arguments, Object[] parameters)

Parameters

<-> | Parameter | Type | Description
 | arguments | TUdfEventArgs |
 | parameters | Object[] |

See also

  • ConvertImpl


CoupDaysBSImpl Class | FlexCel Studio for the .NET Framework documentation

CoupDaysBSImpl Class

Implements the CoupDaysBS Excel function. Look at Excel documentation for more information.

Syntax

Namespace: FlexCel.AddinFunctions

public class CoupDaysBSImpl: BaseBondsImpl

Constructors

Name | Description
CoupDaysBSImpl | Creates a new implementation.

Methods

Name | Description
Calc | Override this method to specialize BaseBondsImpl
CalcCoupDaysBS | See Excel docs for description of this function.


CoupDaysBSImpl.CoupDaysBSImpl Constructor | FlexCel Studio for the .NET Framework documentation

CoupDaysBSImpl.CoupDaysBSImpl Constructor

Creates a new implementation.

Syntax

Namespace: FlexCel.AddinFunctions

public CoupDaysBSImpl()

See also

  • CoupDaysBSImpl


CoupDaysBSImpl.Calc Method | FlexCel Studio for the .NET Framework documentation

CoupDaysBSImpl.Calc Method

Override this method to specialize BaseBondsImpl

Syntax

Namespace: FlexCel.AddinFunctions

protected override Object Calc(DateTime SettlementDate, DateTime MaturityDate, Double Frequency, TDayCountBasis Basis)

Parameters

<-> | Parameter | Type | Description
 | SettlementDate | DateTime |
 | MaturityDate | DateTime |
 | Frequency | Double |
 | Basis | TDayCountBasis |

See also

  • CoupDaysBSImpl


CoupDaysBSImpl.CalcCoupDaysBS Method | FlexCel Studio for the .NET Framework documentation

CoupDaysBSImpl.CalcCoupDaysBS Method

See Excel docs for description of this function.

Syntax

Namespace: FlexCel.AddinFunctions

public static Double CalcCoupDaysBS(DateTime SettlementDate, DateTime MaturityDate, Double Frequency, TDayCountBasis Basis)

Parameters

<-> | Parameter | Type | Description
 | SettlementDate | DateTime | See Excel.
 | MaturityDate | DateTime | See Excel.
 | Frequency | Double | See Excel.
 | Basis | TDayCountBasis | See Excel.

See also

  • CoupDaysBSImpl


CoupDaysImpl Class | FlexCel Studio for the .NET Framework documentation

CoupDaysImpl Class

Implements the CoupDays Excel function. Look at Excel documentation for more information.

Syntax

Namespace: FlexCel.AddinFunctions

public class CoupDaysImpl: BaseBondsImpl

Constructors

Name | Description
CoupDaysImpl | Creates a new implementation.

Methods

Name | Description
Calc | Override this method to specialize BaseBondsImpl
CalcCoupDays | See Excel docs for description of this function.


CoupDaysImpl.CoupDaysImpl Constructor | FlexCel Studio for the .NET Framework documentation

CoupDaysImpl.CoupDaysImpl Constructor

Creates a new implementation.

Syntax

Namespace: FlexCel.AddinFunctions

public CoupDaysImpl()

See also

  • CoupDaysImpl


CoupDaysImpl.Calc Method | FlexCel Studio for the .NET Framework documentation

CoupDaysImpl.Calc Method

Override this method to specialize BaseBondsImpl

Syntax

Namespace: FlexCel.AddinFunctions

protected override Object Calc(DateTime SettlementDate, DateTime MaturityDate, Double Frequency, TDayCountBasis Basis)

Parameters

<-> | Parameter | Type | Description
 | SettlementDate | DateTime |
 | MaturityDate | DateTime |
 | Frequency | Double |
 | Basis | TDayCountBasis |

See also

  • CoupDaysImpl


CoupDaysImpl.CalcCoupDays Method | FlexCel Studio for the .NET Framework documentation

CoupDaysImpl.CalcCoupDays Method

See Excel docs for description of this function.

Syntax

Namespace: FlexCel.AddinFunctions

public static Double CalcCoupDays(DateTime SettlementDate, DateTime MaturityDate, Double Frequency, TDayCountBasis Basis)

Parameters

<-> | Parameter | Type | Description
 | SettlementDate | DateTime | See Excel.
 | MaturityDate | DateTime | See Excel.
 | Frequency | Double | See Excel.
 | Basis | TDayCountBasis | See Excel.

See also

  • CoupDaysImpl


CoupDaysNCImpl Class | FlexCel Studio for the .NET Framework documentation

CoupDaysNCImpl Class

Implements the CoupDaysNC Excel function. Look at Excel documentation for more information.

Syntax

Namespace: FlexCel.AddinFunctions

public class CoupDaysNCImpl: BaseBondsImpl

Constructors

Name | Description
CoupDaysNCImpl | Creates a new implementation.

Methods

Name | Description
Calc | Override this method to specialize BaseBondsImpl
CalcCoupDaysNC | See Excel docs for description of this function.


CoupDaysNCImpl.CoupDaysNCImpl Constructor | FlexCel Studio for the .NET Framework documentation

CoupDaysNCImpl.CoupDaysNCImpl Constructor

Creates a new implementation.

Syntax

Namespace: FlexCel.AddinFunctions

public CoupDaysNCImpl()

See also

  • CoupDaysNCImpl


CoupDaysNCImpl.Calc Method | FlexCel Studio for the .NET Framework documentation

CoupDaysNCImpl.Calc Method

Override this method to specialize BaseBondsImpl

Syntax

Namespace: FlexCel.AddinFunctions

protected override Object Calc(DateTime SettlementDate, DateTime MaturityDate, Double Frequency, TDayCountBasis Basis)

Parameters

<-> | Parameter | Type | Description
 | SettlementDate | DateTime |
 | MaturityDate | DateTime |
 | Frequency | Double |
 | Basis | TDayCountBasis |

See also

  • CoupDaysNCImpl


CoupDaysNCImpl.CalcCoupDaysNC Method | FlexCel Studio for the .NET Framework documentation

CoupDaysNCImpl.CalcCoupDaysNC Method

See Excel docs for description of this function.

Syntax

Namespace: FlexCel.AddinFunctions

public static Object CalcCoupDaysNC(DateTime SettlementDate, DateTime MaturityDate, Double Frequency, TDayCountBasis Basis)

Parameters

<-> | Parameter | Type | Description
 | SettlementDate | DateTime | See Excel.
 | MaturityDate | DateTime | See Excel.
 | Frequency | Double | See Excel.
 | Basis | TDayCountBasis | See Excel.

See also

  • CoupDaysNCImpl


CoupNCDImpl Class | FlexCel Studio for the .NET Framework documentation

CoupNCDImpl Class

Implements the CoupNCD Excel function. Look at Excel documentation for more information.

Syntax

Namespace: FlexCel.AddinFunctions

public class CoupNCDImpl: BaseBondsImpl

Constructors

Name | Description
CoupNCDImpl | Creates a new implementation.

Methods

Name | Description
Calc | Override this method to specialize BaseBondsImpl
CalcCoupNCD | See Excel docs for description of this function.


CoupNCDImpl.CoupNCDImpl Constructor | FlexCel Studio for the .NET Framework documentation

CoupNCDImpl.CoupNCDImpl Constructor

Creates a new implementation.

Syntax

Namespace: FlexCel.AddinFunctions

public CoupNCDImpl()

See also

  • CoupNCDImpl


CoupNCDImpl.Calc Method | FlexCel Studio for the .NET Framework documentation

CoupNCDImpl.Calc Method

Override this method to specialize BaseBondsImpl

Syntax

Namespace: FlexCel.AddinFunctions

protected override Object Calc(DateTime SettlementDate, DateTime MaturityDate, Double Frequency, TDayCountBasis Basis)

Parameters

<-> | Parameter | Type | Description
 | SettlementDate | DateTime |
 | MaturityDate | DateTime |
 | Frequency | Double |
 | Basis | TDayCountBasis |

See also

  • CoupNCDImpl


CoupNCDImpl.CalcCoupNCD Method | FlexCel Studio for the .NET Framework documentation

CoupNCDImpl.CalcCoupNCD Method

See Excel docs for description of this function.

Syntax

Namespace: FlexCel.AddinFunctions

public static Object CalcCoupNCD(DateTime SettlementDate, DateTime MaturityDate, Double Frequency, TDayCountBasis Basis)

Parameters

<-> | Parameter | Type | Description
 | SettlementDate | DateTime | See Excel.
 | MaturityDate | DateTime | See Excel.
 | Frequency | Double | See Excel.
 | Basis | TDayCountBasis | See Excel.

See also

  • CoupNCDImpl


CoupNumImpl Class | FlexCel Studio for the .NET Framework documentation

CoupNumImpl Class

Implements the CoupNum Excel function. Look at Excel documentation for more information.

Syntax

Namespace: FlexCel.AddinFunctions

public class CoupNumImpl: BaseBondsImpl

Constructors

Name | Description
CoupNumImpl | Creates a new implementation.

Methods

Name | Description
Calc | Override this method to specialize BaseBondsImpl
CalcCoupNum | See Excel docs for description of this function.


CoupNumImpl.CoupNumImpl Constructor | FlexCel Studio for the .NET Framework documentation

CoupNumImpl.CoupNumImpl Constructor

Creates a new implementation.

Syntax

Namespace: FlexCel.AddinFunctions

public CoupNumImpl()

See also

  • CoupNumImpl


CoupNumImpl.Calc Method | FlexCel Studio for the .NET Framework documentation

CoupNumImpl.Calc Method

Override this method to specialize BaseBondsImpl

Syntax

Namespace: FlexCel.AddinFunctions

protected override Object Calc(DateTime SettlementDate, DateTime MaturityDate, Double Frequency, TDayCountBasis Basis)

Parameters

<-> | Parameter | Type | Description
 | SettlementDate | DateTime |
 | MaturityDate | DateTime |
 | Frequency | Double |
 | Basis | TDayCountBasis |

See also

  • CoupNumImpl


CoupNumImpl.CalcCoupNum Method | FlexCel Studio for the .NET Framework documentation

CoupNumImpl.CalcCoupNum Method

See Excel docs for description of this function.

Syntax

Namespace: FlexCel.AddinFunctions

public static Double CalcCoupNum(DateTime SettlementDate, DateTime MaturityDate, Double Frequency, TDayCountBasis Basis)

Parameters

<-> | Parameter | Type | Description
 | SettlementDate | DateTime | See Excel.
 | MaturityDate | DateTime | See Excel.
 | Frequency | Double | See Excel.
 | Basis | TDayCountBasis | See Excel.

See also

  • CoupNumImpl


CoupPCDImpl Class | FlexCel Studio for the .NET Framework documentation

CoupPCDImpl Class

Implements the CoupPCD Excel function. Look at Excel documentation for more information.

Syntax

Namespace: FlexCel.AddinFunctions

public class CoupPCDImpl: BaseBondsImpl

Constructors

Name | Description
CoupPCDImpl | Creates a new implementation.

Methods

Name | Description
Calc | Override this method to specialize BaseBondsImpl
CalcCoupPCD | See Excel docs for description of this function.


CoupPCDImpl.CoupPCDImpl Constructor | FlexCel Studio for the .NET Framework documentation

CoupPCDImpl.CoupPCDImpl Constructor

Creates a new implementation.

Syntax

Namespace: FlexCel.AddinFunctions

public CoupPCDImpl()

See also

  • CoupPCDImpl


CoupPCDImpl.Calc Method | FlexCel Studio for the .NET Framework documentation

CoupPCDImpl.Calc Method

Override this method to specialize BaseBondsImpl

Syntax

Namespace: FlexCel.AddinFunctions

protected override Object Calc(DateTime SettlementDate, DateTime MaturityDate, Double Frequency, TDayCountBasis Basis)

Parameters

<-> | Parameter | Type | Description
 | SettlementDate | DateTime |
 | MaturityDate | DateTime |
 | Frequency | Double |
 | Basis | TDayCountBasis |

See also

  • CoupPCDImpl


CoupPCDImpl.CalcCoupPCD Method | FlexCel Studio for the .NET Framework documentation

CoupPCDImpl.CalcCoupPCD Method

See Excel docs for description of this function.

Syntax

Namespace: FlexCel.AddinFunctions

public static Object CalcCoupPCD(DateTime SettlementDate, DateTime MaturityDate, Double Frequency, TDayCountBasis Basis)

Parameters

<-> | Parameter | Type | Description
 | SettlementDate | DateTime | See Excel.
 | MaturityDate | DateTime | See Excel.
 | Frequency | Double | See Excel.
 | Basis | TDayCountBasis | See Excel.

See also

  • CoupPCDImpl


Dec2BinImpl Class | FlexCel Studio for the .NET Framework documentation

Dec2BinImpl Class

Implements the Dec2Bin Excel function. Look at Excel documentation for more information.

Syntax

Namespace: FlexCel.AddinFunctions

public class Dec2BinImpl: BaseBinHexImpl

Constructors

Name | Description
Dec2BinImpl | Creates a new implementation.

Methods

Name | Description
Calc | Implement this method to specialize BaseBinHexImpl class.


Dec2BinImpl.Dec2BinImpl Constructor | FlexCel Studio for the .NET Framework documentation

Dec2BinImpl.Dec2BinImpl Constructor

Creates a new implementation.

Syntax

Namespace: FlexCel.AddinFunctions

public Dec2BinImpl()

See also

  • Dec2BinImpl


Dec2BinImpl.Calc Method | FlexCel Studio for the .NET Framework documentation

Dec2BinImpl.Calc Method

Implement this method to specialize BaseBinHexImpl class.

Syntax

Namespace: FlexCel.AddinFunctions

protected override Object Calc(String num, Double dnum, Int32 Places)

Parameters

<-> | Parameter | Type | Description
 | num | String |
 | dnum | Double |
 | Places | Int32 |

See also

  • Dec2BinImpl


Dec2HexImpl Class | FlexCel Studio for the .NET Framework documentation

Dec2HexImpl Class

Implements the Dec2Hex Excel function. Look at Excel documentation for more information.

Syntax

Namespace: FlexCel.AddinFunctions

public class Dec2HexImpl: BaseBinHexImpl

Constructors

Name | Description
Dec2HexImpl | Creates a new implementation.

Methods

Name | Description
Calc | Implement this method to specialize BaseBinHexImpl class.


Dec2HexImpl.Dec2HexImpl Constructor | FlexCel Studio for the .NET Framework documentation

Dec2HexImpl.Dec2HexImpl Constructor

Creates a new implementation.

Syntax

Namespace: FlexCel.AddinFunctions

public Dec2HexImpl()

See also

  • Dec2HexImpl


Dec2HexImpl.Calc Method | FlexCel Studio for the .NET Framework documentation

Dec2HexImpl.Calc Method

Implement this method to specialize BaseBinHexImpl class.

Syntax

Namespace: FlexCel.AddinFunctions

protected override Object Calc(String num, Double dnum, Int32 Places)

Parameters

<-> | Parameter | Type | Description
 | num | String |
 | dnum | Double |
 | Places | Int32 |

See also

  • Dec2HexImpl


Dec2OctImpl Class | FlexCel Studio for the .NET Framework documentation

Dec2OctImpl Class

Implements the Dec2Oct Excel function. Look at Excel documentation for more information.

Syntax

Namespace: FlexCel.AddinFunctions

public class Dec2OctImpl: BaseBinHexImpl

Constructors

Name | Description
Dec2OctImpl | Creates a new implementation.

Methods

Name | Description
Calc | Implement this method to specialize BaseBinHexImpl class.


Dec2OctImpl.Dec2OctImpl Constructor | FlexCel Studio for the .NET Framework documentation

Dec2OctImpl.Dec2OctImpl Constructor

Creates a new implementation.

Syntax

Namespace: FlexCel.AddinFunctions

public Dec2OctImpl()

See also

  • Dec2OctImpl


Dec2OctImpl.Calc Method | FlexCel Studio for the .NET Framework documentation

Dec2OctImpl.Calc Method

Implement this method to specialize BaseBinHexImpl class.

Syntax

Namespace: FlexCel.AddinFunctions

protected override Object Calc(String num, Double dnum, Int32 Places)

Parameters

<-> | Parameter | Type | Description
 | num | String |
 | dnum | Double |
 | Places | Int32 |

See also

  • Dec2OctImpl


DeltaImpl Class | FlexCel Studio for the .NET Framework documentation

DeltaImpl Class

Implements the Delta Excel function. Look at Excel documentation for more information.

Syntax

Namespace: FlexCel.AddinFunctions

public class DeltaImpl: TUserDefinedFunction

Constructors

Name | Description
DeltaImpl | Creates a new implementation.

Methods

Name | Description
Evaluate | Evaluates the function. Look At Excel docs for parameters.


DeltaImpl.DeltaImpl Constructor | FlexCel Studio for the .NET Framework documentation

DeltaImpl.DeltaImpl Constructor

Creates a new implementation.

Syntax

Namespace: FlexCel.AddinFunctions

public DeltaImpl()

See also

  • DeltaImpl


DeltaImpl.Evaluate Method | FlexCel Studio for the .NET Framework documentation

DeltaImpl.Evaluate Method

Evaluates the function. Look At Excel docs for parameters.

Syntax

Namespace: FlexCel.AddinFunctions

public override Object Evaluate(TUdfEventArgs arguments, Object[] parameters)

Parameters

<-> | Parameter | Type | Description
 | arguments | TUdfEventArgs |
 | parameters | Object[] |

See also

  • DeltaImpl


DollarDeImpl Class | FlexCel Studio for the .NET Framework documentation

DollarDeImpl Class

Implements the DollarDe Excel function. Look at Excel documentation for more information.

Syntax

Namespace: FlexCel.AddinFunctions

public class DollarDeImpl: TUserDefinedFunction

Constructors

Name | Description
DollarDeImpl | Creates a new implementation.

Methods

Name | Description
Evaluate | Evaluates the function. Look At Excel docs for parameters.


DollarDeImpl.DollarDeImpl Constructor | FlexCel Studio for the .NET Framework documentation

DollarDeImpl.DollarDeImpl Constructor

Creates a new implementation.

Syntax

Namespace: FlexCel.AddinFunctions

public DollarDeImpl()

See also

  • DollarDeImpl


DollarDeImpl.Evaluate Method | FlexCel Studio for the .NET Framework documentation

DollarDeImpl.Evaluate Method

Evaluates the function. Look At Excel docs for parameters.

Syntax

Namespace: FlexCel.AddinFunctions

public override Object Evaluate(TUdfEventArgs arguments, Object[] parameters)

Parameters

<-> | Parameter | Type | Description
 | arguments | TUdfEventArgs |
 | parameters | Object[] |

See also

  • DollarDeImpl


DollarFrImpl Class | FlexCel Studio for the .NET Framework documentation

DollarFrImpl Class

Implements the DollarDe Excel function. Look at Excel documentation for more information.

Syntax

Namespace: FlexCel.AddinFunctions

public class DollarFrImpl: TUserDefinedFunction

Constructors

Name | Description
DollarFrImpl | Creates a new implementation.

Methods

Name | Description
Evaluate | Evaluates the function. Look At Excel docs for parameters.


DollarFrImpl.DollarFrImpl Constructor | FlexCel Studio for the .NET Framework documentation

DollarFrImpl.DollarFrImpl Constructor

Creates a new implementation.

Syntax

Namespace: FlexCel.AddinFunctions

public DollarFrImpl()

See also

  • DollarFrImpl


DollarFrImpl.Evaluate Method | FlexCel Studio for the .NET Framework documentation

DollarFrImpl.Evaluate Method

Evaluates the function. Look At Excel docs for parameters.

Syntax

Namespace: FlexCel.AddinFunctions

public override Object Evaluate(TUdfEventArgs arguments, Object[] parameters)

Parameters

<-> | Parameter | Type | Description
 | arguments | TUdfEventArgs |
 | parameters | Object[] |

See also

  • DollarFrImpl


DurationImpl Class | FlexCel Studio for the .NET Framework documentation

DurationImpl Class

Implements the Duration and MDuration addin functions. Returns the [modified] Macauley duration for a security with an assumed par value of $100.

Syntax

Namespace: FlexCel.AddinFunctions

public class DurationImpl: TUserDefinedFunction

Constructors

Name | Description
DurationImpl | Creates a new Duration/MDuration implementation.

Methods

Name | Description
Evaluate | Evaluates the DURATION/MDURATION function. Look At Excel docs for parameters.
Calc | Duration/MDuration implementation. You can call this method on its own.


DurationImpl.DurationImpl Constructor | FlexCel Studio for the .NET Framework documentation

DurationImpl.DurationImpl Constructor

Creates a new Duration/MDuration implementation.

Syntax

Namespace: FlexCel.AddinFunctions

public DurationImpl(Boolean aModified)

Parameters

<-> | Parameter | Type | Description
 | aModified | Boolean |

See also

  • DurationImpl


DurationImpl.Evaluate Method | FlexCel Studio for the .NET Framework documentation

DurationImpl.Evaluate Method

Evaluates the DURATION/MDURATION function. Look At Excel docs for parameters.

Syntax

Namespace: FlexCel.AddinFunctions

public override Object Evaluate(TUdfEventArgs arguments, Object[] parameters)

Parameters

<-> | Parameter | Type | Description
 | arguments | TUdfEventArgs |
 | parameters | Object[] |

See also

  • DurationImpl


DurationImpl.Calc Method | FlexCel Studio for the .NET Framework documentation

DurationImpl.Calc Method

Duration/MDuration implementation. You can call this method on its own.

Syntax

Namespace: FlexCel.AddinFunctions

public static Object Calc(Boolean Modified, DateTime SettlementDate, DateTime MaturityDate, Double CouponRate, Double Yield, Double Frequency, TDayCountBasis Basis)

Parameters

<-> | Parameter | Type | Description
 | Modified | Boolean | If true, we return MDuration, if not, Duration.
 | SettlementDate | DateTime | See Excel.
 | MaturityDate | DateTime | See Excel.
 | CouponRate | Double | See Excel.
 | Yield | Double | See Excel.
 | Frequency | Double | See Excel.
 | Basis | TDayCountBasis | See Excel.

See also

  • DurationImpl


EDateImpl Class | FlexCel Studio for the .NET Framework documentation

EDateImpl Class

Implements the EDate addin function. Returns the serial number that represents the date that is the indicated number of months before or after a specified date (the start_date). Use EDATE to calculate maturity dates or due dates that fall on the same day of the month as the date of issue.

Syntax

Namespace: FlexCel.AddinFunctions

public class EDateImpl: TUserDefinedFunction

Constructors

Name | Description
EDateImpl | Creates a new EDate implementation.

Methods

Name | Description
Evaluate | Evaluates the EDate function.


EDateImpl.EDateImpl Constructor | FlexCel Studio for the .NET Framework documentation

EDateImpl.EDateImpl Constructor

Creates a new EDate implementation.

Syntax

Namespace: FlexCel.AddinFunctions

public EDateImpl()

See also

  • EDateImpl


EDateImpl.Evaluate Method | FlexCel Studio for the .NET Framework documentation

EDateImpl.Evaluate Method

Evaluates the EDate function.

Syntax

Namespace: FlexCel.AddinFunctions

public override Object Evaluate(TUdfEventArgs arguments, Object[] parameters)

Parameters

<-> | Parameter | Type | Description
 | arguments | TUdfEventArgs |
 | parameters | Object[] |

See also

  • EDateImpl


EffectImpl Class | FlexCel Studio for the .NET Framework documentation

EffectImpl Class

Implements the Effect Excel function. Look at Excel documentation for more information.

Syntax

Namespace: FlexCel.AddinFunctions

public class EffectImpl: TUserDefinedFunction

Constructors

Name | Description
EffectImpl | Creates a new implementation.

Methods

Name | Description
Evaluate | Evaluates the function. Look At Excel docs for parameters.


EffectImpl.EffectImpl Constructor | FlexCel Studio for the .NET Framework documentation

EffectImpl.EffectImpl Constructor

Creates a new implementation.

Syntax

Namespace: FlexCel.AddinFunctions

public EffectImpl()

See also

  • EffectImpl


EffectImpl.Evaluate Method | FlexCel Studio for the .NET Framework documentation

EffectImpl.Evaluate Method

Evaluates the function. Look At Excel docs for parameters.

Syntax

Namespace: FlexCel.AddinFunctions

public override Object Evaluate(TUdfEventArgs arguments, Object[] parameters)

Parameters

<-> | Parameter | Type | Description
 | arguments | TUdfEventArgs |
 | parameters | Object[] |

See also

  • EffectImpl


EOMonthImpl Class | FlexCel Studio for the .NET Framework documentation

EOMonthImpl Class

Implements the EOMonth Excel function. Look at Excel documentation for more information.

Syntax

Namespace: FlexCel.AddinFunctions

public class EOMonthImpl: TUserDefinedFunction

Constructors

Name | Description
EOMonthImpl | Creates a new implementation.

Methods

Name | Description
Evaluate | Evaluates the function. Look At Excel docs for parameters.


EOMonthImpl.EOMonthImpl Constructor | FlexCel Studio for the .NET Framework documentation

EOMonthImpl.EOMonthImpl Constructor

Creates a new implementation.

Syntax

Namespace: FlexCel.AddinFunctions

public EOMonthImpl()

See also

  • EOMonthImpl


EOMonthImpl.Evaluate Method | FlexCel Studio for the .NET Framework documentation

EOMonthImpl.Evaluate Method

Evaluates the function. Look At Excel docs for parameters.

Syntax

Namespace: FlexCel.AddinFunctions

public override Object Evaluate(TUdfEventArgs arguments, Object[] parameters)

Parameters

<-> | Parameter | Type | Description
 | arguments | TUdfEventArgs |
 | parameters | Object[] |

See also

  • EOMonthImpl


FactDoubleImpl Class | FlexCel Studio for the .NET Framework documentation

FactDoubleImpl Class

Implements the FactDouble Excel function. Look at Excel documentation for more information.

Syntax

Namespace: FlexCel.AddinFunctions

public class FactDoubleImpl: TUserDefinedFunction

Constructors

Name | Description
FactDoubleImpl | Creates a new implementation.

Methods

Name | Description
Evaluate | Evaluates the function. Look At Excel docs for parameters.


FactDoubleImpl.FactDoubleImpl Constructor | FlexCel Studio for the .NET Framework documentation

FactDoubleImpl.FactDoubleImpl Constructor

Creates a new implementation.

Syntax

Namespace: FlexCel.AddinFunctions

public FactDoubleImpl()

See also

  • FactDoubleImpl


FactDoubleImpl.Evaluate Method | FlexCel Studio for the .NET Framework documentation

FactDoubleImpl.Evaluate Method

Evaluates the function. Look At Excel docs for parameters.

Syntax

Namespace: FlexCel.AddinFunctions

public override Object Evaluate(TUdfEventArgs arguments, Object[] parameters)

Parameters

<-> | Parameter | Type | Description
 | arguments | TUdfEventArgs |
 | parameters | Object[] |

See also

  • FactDoubleImpl


GcdImpl Class | FlexCel Studio for the .NET Framework documentation

GcdImpl Class

Implements the GCD Excel function. Look at Excel documentation for more information.

Syntax

Namespace: FlexCel.AddinFunctions

public class GcdImpl: BaseGCDLCM

Constructors

Name | Description
GcdImpl | Creates a new implementation.


GcdImpl.GcdImpl Constructor | FlexCel Studio for the .NET Framework documentation

GcdImpl.GcdImpl Constructor

Creates a new implementation.

Syntax

Namespace: FlexCel.AddinFunctions

public GcdImpl()

See also

  • GcdImpl


GeStepImpl Class | FlexCel Studio for the .NET Framework documentation

GeStepImpl Class

Implements the GeStep Excel function. Look at Excel documentation for more information.

Syntax

Namespace: FlexCel.AddinFunctions

public class GeStepImpl: TUserDefinedFunction

Constructors

Name | Description
GeStepImpl | Creates a new implementation.

Methods

Name | Description
Evaluate | Evaluates the function. Look At Excel docs for parameters.


GeStepImpl.GeStepImpl Constructor | FlexCel Studio for the .NET Framework documentation

GeStepImpl.GeStepImpl Constructor

Creates a new implementation.

Syntax

Namespace: FlexCel.AddinFunctions

public GeStepImpl()

See also

  • GeStepImpl


GeStepImpl.Evaluate Method | FlexCel Studio for the .NET Framework documentation

GeStepImpl.Evaluate Method

Evaluates the function. Look At Excel docs for parameters.

Syntax

Namespace: FlexCel.AddinFunctions

public override Object Evaluate(TUdfEventArgs arguments, Object[] parameters)

Parameters

<-> | Parameter | Type | Description
 | arguments | TUdfEventArgs |
 | parameters | Object[] |

See also

  • GeStepImpl


Hex2BinImpl Class | FlexCel Studio for the .NET Framework documentation

Hex2BinImpl Class

Implements the Hex2Bin Excel function. Look at Excel documentation for more information.

Syntax

Namespace: FlexCel.AddinFunctions

public class Hex2BinImpl: BaseBinHexImpl

Constructors

Name | Description
Hex2BinImpl | Creates a new implementation.

Methods

Name | Description
Calc | Implement this method to specialize BaseBinHexImpl class.


Hex2BinImpl.Hex2BinImpl Constructor | FlexCel Studio for the .NET Framework documentation

Hex2BinImpl.Hex2BinImpl Constructor

Creates a new implementation.

Syntax

Namespace: FlexCel.AddinFunctions

public Hex2BinImpl()

See also

  • Hex2BinImpl


Hex2BinImpl.Calc Method | FlexCel Studio for the .NET Framework documentation

Hex2BinImpl.Calc Method

Implement this method to specialize BaseBinHexImpl class.

Syntax

Namespace: FlexCel.AddinFunctions

protected override Object Calc(String num, Double dnum, Int32 Places)

Parameters

<-> | Parameter | Type | Description
 | num | String |
 | dnum | Double |
 | Places | Int32 |

See also

  • Hex2BinImpl


Hex2DecImpl Class | FlexCel Studio for the .NET Framework documentation

Hex2DecImpl Class

Implements the Hex2Dec Excel function. Look at Excel documentation for more information.

Syntax

Namespace: FlexCel.AddinFunctions

public class Hex2DecImpl: BaseBinHexImpl

Constructors

Name | Description
Hex2DecImpl | Creates a new implementation.

Methods

Name | Description
Calc | Implement this method to specialize BaseBinHexImpl class.


Hex2DecImpl.Hex2DecImpl Constructor | FlexCel Studio for the .NET Framework documentation

Hex2DecImpl.Hex2DecImpl Constructor

Creates a new implementation.

Syntax

Namespace: FlexCel.AddinFunctions

public Hex2DecImpl()

See also

  • Hex2DecImpl


Hex2DecImpl.Calc Method | FlexCel Studio for the .NET Framework documentation

Hex2DecImpl.Calc Method

Implement this method to specialize BaseBinHexImpl class.

Syntax

Namespace: FlexCel.AddinFunctions

protected override Object Calc(String num, Double dnum, Int32 Places)

Parameters

<-> | Parameter | Type | Description
 | num | String |
 | dnum | Double |
 | Places | Int32 |

See also

  • Hex2DecImpl


Hex2OctImpl Class | FlexCel Studio for the .NET Framework documentation

Hex2OctImpl Class

Implements the Hex2Oct Excel function. Look at Excel documentation for more information.

Syntax

Namespace: FlexCel.AddinFunctions

public class Hex2OctImpl: BaseBinHexImpl

Constructors

Name | Description
Hex2OctImpl | Creates a new implementation.

Methods

Name | Description
Calc | Implement this method to specialize BaseBinHexImpl class.


Hex2OctImpl.Hex2OctImpl Constructor | FlexCel Studio for the .NET Framework documentation

Hex2OctImpl.Hex2OctImpl Constructor

Creates a new implementation.

Syntax

Namespace: FlexCel.AddinFunctions

public Hex2OctImpl()

See also

  • Hex2OctImpl


Hex2OctImpl.Calc Method | FlexCel Studio for the .NET Framework documentation

Hex2OctImpl.Calc Method

Implement this method to specialize BaseBinHexImpl class.

Syntax

Namespace: FlexCel.AddinFunctions

protected override Object Calc(String num, Double dnum, Int32 Places)

Parameters

<-> | Parameter | Type | Description
 | num | String |
 | dnum | Double |
 | Places | Int32 |

See also

  • Hex2OctImpl


IsEvenImpl Class | FlexCel Studio for the .NET Framework documentation

IsEvenImpl Class

Implements the IsEven Excel function. Look at Excel documentation for more information.

Syntax

Namespace: FlexCel.AddinFunctions

public class IsEvenImpl: TUserDefinedFunction

Constructors

Name | Description
IsEvenImpl | Creates a new implementation.

Methods

Name | Description
Evaluate | Evaluates the function. Look At Excel docs for parameters.


IsEvenImpl.IsEvenImpl Constructor | FlexCel Studio for the .NET Framework documentation

IsEvenImpl.IsEvenImpl Constructor

Creates a new implementation.

Syntax

Namespace: FlexCel.AddinFunctions

public IsEvenImpl()

See also

  • IsEvenImpl


IsEvenImpl.Evaluate Method | FlexCel Studio for the .NET Framework documentation

IsEvenImpl.Evaluate Method

Evaluates the function. Look At Excel docs for parameters.

Syntax

Namespace: FlexCel.AddinFunctions

public override Object Evaluate(TUdfEventArgs arguments, Object[] parameters)

Parameters

<-> | Parameter | Type | Description
 | arguments | TUdfEventArgs |
 | parameters | Object[] |

See also

  • IsEvenImpl


IsOddImpl Class | FlexCel Studio for the .NET Framework documentation

IsOddImpl Class

Implements the IsOdd Excel function. Look at Excel documentation for more information.

Syntax

Namespace: FlexCel.AddinFunctions

public class IsOddImpl: TUserDefinedFunction

Constructors

Name | Description
IsOddImpl | Creates a new implementation.

Methods

Name | Description
Evaluate | Evaluates the function. Look At Excel docs for parameters.


IsOddImpl.IsOddImpl Constructor | FlexCel Studio for the .NET Framework documentation

IsOddImpl.IsOddImpl Constructor

Creates a new implementation.

Syntax

Namespace: FlexCel.AddinFunctions

public IsOddImpl()

See also

  • IsOddImpl


IsOddImpl.Evaluate Method | FlexCel Studio for the .NET Framework documentation

IsOddImpl.Evaluate Method

Evaluates the function. Look At Excel docs for parameters.

Syntax

Namespace: FlexCel.AddinFunctions

public override Object Evaluate(TUdfEventArgs arguments, Object[] parameters)

Parameters

<-> | Parameter | Type | Description
 | arguments | TUdfEventArgs |
 | parameters | Object[] |

See also

  • IsOddImpl


LcmImpl Class | FlexCel Studio for the .NET Framework documentation

LcmImpl Class

Implements the LCM Excel function. Look at Excel documentation for more information.

Syntax

Namespace: FlexCel.AddinFunctions

public class LcmImpl: BaseGCDLCM

Constructors

Name | Description
LcmImpl | Creates a new implementation.


LcmImpl.LcmImpl Constructor | FlexCel Studio for the .NET Framework documentation

LcmImpl.LcmImpl Constructor

Creates a new implementation.

Syntax

Namespace: FlexCel.AddinFunctions

public LcmImpl()

See also

  • LcmImpl


MRoundImpl Class | FlexCel Studio for the .NET Framework documentation

MRoundImpl Class

Implements the MRound Excel function. Look at Excel documentation for more information.

Syntax

Namespace: FlexCel.AddinFunctions

public class MRoundImpl: TUserDefinedFunction

Constructors

Name | Description
MRoundImpl | Creates a new implementation.

Methods

Name | Description
Evaluate | Evaluates the function. Look At Excel docs for parameters.


MRoundImpl.MRoundImpl Constructor | FlexCel Studio for the .NET Framework documentation

MRoundImpl.MRoundImpl Constructor

Creates a new implementation.

Syntax

Namespace: FlexCel.AddinFunctions

public MRoundImpl()

See also

  • MRoundImpl


MRoundImpl.Evaluate Method | FlexCel Studio for the .NET Framework documentation

MRoundImpl.Evaluate Method

Evaluates the function. Look At Excel docs for parameters.

Syntax

Namespace: FlexCel.AddinFunctions

public override Object Evaluate(TUdfEventArgs arguments, Object[] parameters)

Parameters

<-> | Parameter | Type | Description
 | arguments | TUdfEventArgs |
 | parameters | Object[] |

See also

  • MRoundImpl


MultinomialImpl Class | FlexCel Studio for the .NET Framework documentation

MultinomialImpl Class

Implements the Multinomial Excel function. Look at Excel documentation for more information.

Syntax

Namespace: FlexCel.AddinFunctions

public class MultinomialImpl: TUserDefinedFunction

Constructors

Name | Description
MultinomialImpl | Creates a new implementation.

Methods

Name | Description
Evaluate | Evaluates the function. Look At Excel docs for parameters.


MultinomialImpl.MultinomialImpl Constructor | FlexCel Studio for the .NET Framework documentation

MultinomialImpl.MultinomialImpl Constructor

Creates a new implementation.

Syntax

Namespace: FlexCel.AddinFunctions

public MultinomialImpl()

See also

  • MultinomialImpl


MultinomialImpl.Evaluate Method | FlexCel Studio for the .NET Framework documentation

MultinomialImpl.Evaluate Method

Evaluates the function. Look At Excel docs for parameters.

Syntax

Namespace: FlexCel.AddinFunctions

public override Object Evaluate(TUdfEventArgs arguments, Object[] parameters)

Parameters

<-> | Parameter | Type | Description
 | arguments | TUdfEventArgs |
 | parameters | Object[] |

See also

  • MultinomialImpl


NetWorkDaysImpl Class | FlexCel Studio for the .NET Framework documentation

NetWorkDaysImpl Class

Implements the NetWorkDays Excel function. Look at Excel documentation for more information.

Syntax

Namespace: FlexCel.AddinFunctions

public class NetWorkDaysImpl: BaseWorkDaysImpl

Constructors

Name | Description
NetWorkDaysImpl | Creates a new implementation.

Methods

Name | Description
Evaluate | Evaluates the function. Look At Excel docs for parameters.


NetWorkDaysImpl.NetWorkDaysImpl Constructor | FlexCel Studio for the .NET Framework documentation

NetWorkDaysImpl.NetWorkDaysImpl Constructor

Creates a new implementation.

Syntax

Namespace: FlexCel.AddinFunctions

public NetWorkDaysImpl(Boolean aIntl)

Parameters

<-> | Parameter | Type | Description
 | aIntl | Boolean |

See also

  • NetWorkDaysImpl


NetWorkDaysImpl.Evaluate Method | FlexCel Studio for the .NET Framework documentation

NetWorkDaysImpl.Evaluate Method

Evaluates the function. Look At Excel docs for parameters.

Syntax

Namespace: FlexCel.AddinFunctions

public override Object Evaluate(TUdfEventArgs arguments, Object[] parameters)

Parameters

<-> | Parameter | Type | Description
 | arguments | TUdfEventArgs |
 | parameters | Object[] |

See also

  • NetWorkDaysImpl


NominalImpl Class | FlexCel Studio for the .NET Framework documentation

NominalImpl Class

Implements the Nominal Excel function. Look at Excel documentation for more information.

Syntax

Namespace: FlexCel.AddinFunctions

public class NominalImpl: TUserDefinedFunction

Constructors

Name | Description
NominalImpl | Creates a new implementation.

Methods

Name | Description
Evaluate | Evaluates the function. Look At Excel docs for parameters.


NominalImpl.NominalImpl Constructor | FlexCel Studio for the .NET Framework documentation

NominalImpl.NominalImpl Constructor

Creates a new implementation.

Syntax

Namespace: FlexCel.AddinFunctions

public NominalImpl()

See also

  • NominalImpl


NominalImpl.Evaluate Method | FlexCel Studio for the .NET Framework documentation

NominalImpl.Evaluate Method

Evaluates the function. Look At Excel docs for parameters.

Syntax

Namespace: FlexCel.AddinFunctions

public override Object Evaluate(TUdfEventArgs arguments, Object[] parameters)

Parameters

<-> | Parameter | Type | Description
 | arguments | TUdfEventArgs |
 | parameters | Object[] |

See also

  • NominalImpl


Oct2BinImpl Class | FlexCel Studio for the .NET Framework documentation

Oct2BinImpl Class

Implements the Oct2Bin Excel function. Look at Excel documentation for more information.

Syntax

Namespace: FlexCel.AddinFunctions

public class Oct2BinImpl: BaseBinHexImpl

Constructors

Name | Description
Oct2BinImpl | Creates a new implementation.

Methods

Name | Description
Calc | Implement this method to specialize BaseBinHexImpl class.


Oct2BinImpl.Oct2BinImpl Constructor | FlexCel Studio for the .NET Framework documentation

Oct2BinImpl.Oct2BinImpl Constructor

Creates a new implementation.

Syntax

Namespace: FlexCel.AddinFunctions

public Oct2BinImpl()

See also

  • Oct2BinImpl


Oct2BinImpl.Calc Method | FlexCel Studio for the .NET Framework documentation

Oct2BinImpl.Calc Method

Implement this method to specialize BaseBinHexImpl class.

Syntax

Namespace: FlexCel.AddinFunctions

protected override Object Calc(String num, Double dnum, Int32 Places)

Parameters

<-> | Parameter | Type | Description
 | num | String |
 | dnum | Double |
 | Places | Int32 |

See also

  • Oct2BinImpl


Oct2DecImpl Class | FlexCel Studio for the .NET Framework documentation

Oct2DecImpl Class

Implements the Oct2Dec Excel function. Look at Excel documentation for more information.

Syntax

Namespace: FlexCel.AddinFunctions

public class Oct2DecImpl: BaseBinHexImpl

Constructors

Name | Description
Oct2DecImpl | Creates a new implementation.

Methods

Name | Description
Calc | Implement this method to specialize BaseBinHexImpl class.


Oct2DecImpl.Oct2DecImpl Constructor | FlexCel Studio for the .NET Framework documentation

Oct2DecImpl.Oct2DecImpl Constructor

Creates a new implementation.

Syntax

Namespace: FlexCel.AddinFunctions

public Oct2DecImpl()

See also

  • Oct2DecImpl


Oct2DecImpl.Calc Method | FlexCel Studio for the .NET Framework documentation

Oct2DecImpl.Calc Method

Implement this method to specialize BaseBinHexImpl class.

Syntax

Namespace: FlexCel.AddinFunctions

protected override Object Calc(String num, Double dnum, Int32 Places)

Parameters

<-> | Parameter | Type | Description
 | num | String |
 | dnum | Double |
 | Places | Int32 |

See also

  • Oct2DecImpl


Oct2HexImpl Class | FlexCel Studio for the .NET Framework documentation

Oct2HexImpl Class

Implements the Oct2Hex Excel function. Look at Excel documentation for more information.

Syntax

Namespace: FlexCel.AddinFunctions

public class Oct2HexImpl: BaseBinHexImpl

Constructors

Name | Description
Oct2HexImpl | Creates a new implementation.

Methods

Name | Description
Calc | Implement this method to specialize BaseBinHexImpl class.


Oct2HexImpl.Oct2HexImpl Constructor | FlexCel Studio for the .NET Framework documentation

Oct2HexImpl.Oct2HexImpl Constructor

Creates a new implementation.

Syntax

Namespace: FlexCel.AddinFunctions

public Oct2HexImpl()

See also

  • Oct2HexImpl


Oct2HexImpl.Calc Method | FlexCel Studio for the .NET Framework documentation

Oct2HexImpl.Calc Method

Implement this method to specialize BaseBinHexImpl class.

Syntax

Namespace: FlexCel.AddinFunctions

protected override Object Calc(String num, Double dnum, Int32 Places)

Parameters

<-> | Parameter | Type | Description
 | num | String |
 | dnum | Double |
 | Places | Int32 |

See also

  • Oct2HexImpl


QuotientImpl Class | FlexCel Studio for the .NET Framework documentation

QuotientImpl Class

Implements the Quotient Excel function. Look at Excel documentation for more information.

Syntax

Namespace: FlexCel.AddinFunctions

public class QuotientImpl: TUserDefinedFunction

Constructors

Name | Description
QuotientImpl | Creates a new implementation.

Methods

Name | Description
Evaluate | Evaluates the function. Look At Excel docs for parameters.


QuotientImpl.QuotientImpl Constructor | FlexCel Studio for the .NET Framework documentation

QuotientImpl.QuotientImpl Constructor

Creates a new implementation.

Syntax

Namespace: FlexCel.AddinFunctions

public QuotientImpl()

See also

  • QuotientImpl


QuotientImpl.Evaluate Method | FlexCel Studio for the .NET Framework documentation

QuotientImpl.Evaluate Method

Evaluates the function. Look At Excel docs for parameters.

Syntax

Namespace: FlexCel.AddinFunctions

public override Object Evaluate(TUdfEventArgs arguments, Object[] parameters)

Parameters

<-> | Parameter | Type | Description
 | arguments | TUdfEventArgs |
 | parameters | Object[] |

See also

  • QuotientImpl


RandBetweenImpl Class | FlexCel Studio for the .NET Framework documentation

RandBetweenImpl Class

Implements the Quotient Excel function. Look at Excel documentation for more information.

Syntax

Namespace: FlexCel.AddinFunctions

public class RandBetweenImpl: TUserDefinedFunction

Constructors

Name | Description
RandBetweenImpl | Creates a new implementation.

Methods

Name | Description
Evaluate | Evaluates the function. Look At Excel docs for parameters.


RandBetweenImpl.RandBetweenImpl Constructor | FlexCel Studio for the .NET Framework documentation

RandBetweenImpl.RandBetweenImpl Constructor

Creates a new implementation.

Syntax

Namespace: FlexCel.AddinFunctions

public RandBetweenImpl()

See also

  • RandBetweenImpl


RandBetweenImpl.Evaluate Method | FlexCel Studio for the .NET Framework documentation

RandBetweenImpl.Evaluate Method

Evaluates the function. Look At Excel docs for parameters.

Syntax

Namespace: FlexCel.AddinFunctions

public override Object Evaluate(TUdfEventArgs arguments, Object[] parameters)

Parameters

<-> | Parameter | Type | Description
 | arguments | TUdfEventArgs |
 | parameters | Object[] |

See also

  • RandBetweenImpl


SeriesSumImpl Class | FlexCel Studio for the .NET Framework documentation

SeriesSumImpl Class

Implements the SeriesSum Excel function. Look at Excel documentation for more information.

Syntax

Namespace: FlexCel.AddinFunctions

public class SeriesSumImpl: TUserDefinedFunction

Constructors

Name | Description
SeriesSumImpl | Creates a new implementation.

Methods

Name | Description
Evaluate | Evaluates the function. Look At Excel docs for parameters.


SeriesSumImpl.SeriesSumImpl Constructor | FlexCel Studio for the .NET Framework documentation

SeriesSumImpl.SeriesSumImpl Constructor

Creates a new implementation.

Syntax

Namespace: FlexCel.AddinFunctions

public SeriesSumImpl()

See also

  • SeriesSumImpl


SeriesSumImpl.Evaluate Method | FlexCel Studio for the .NET Framework documentation

SeriesSumImpl.Evaluate Method

Evaluates the function. Look At Excel docs for parameters.

Syntax

Namespace: FlexCel.AddinFunctions

public override Object Evaluate(TUdfEventArgs arguments, Object[] parameters)

Parameters

<-> | Parameter | Type | Description
 | arguments | TUdfEventArgs |
 | parameters | Object[] |

See also

  • SeriesSumImpl


SqrtPiImpl Class | FlexCel Studio for the .NET Framework documentation

SqrtPiImpl Class

Implements the Quotient Excel function. Look at Excel documentation for more information.

Syntax

Namespace: FlexCel.AddinFunctions

public class SqrtPiImpl: TUserDefinedFunction

Constructors

Name | Description
SqrtPiImpl | Creates a new implementation.

Methods

Name | Description
Evaluate | Evaluates the function. Look At Excel docs for parameters.


SqrtPiImpl.SqrtPiImpl Constructor | FlexCel Studio for the .NET Framework documentation

SqrtPiImpl.SqrtPiImpl Constructor

Creates a new implementation.

Syntax

Namespace: FlexCel.AddinFunctions

public SqrtPiImpl()

See also

  • SqrtPiImpl


SqrtPiImpl.Evaluate Method | FlexCel Studio for the .NET Framework documentation

SqrtPiImpl.Evaluate Method

Evaluates the function. Look At Excel docs for parameters.

Syntax

Namespace: FlexCel.AddinFunctions

public override Object Evaluate(TUdfEventArgs arguments, Object[] parameters)

Parameters

<-> | Parameter | Type | Description
 | arguments | TUdfEventArgs |
 | parameters | Object[] |

See also

  • SqrtPiImpl


WeekNumImpl Class | FlexCel Studio for the .NET Framework documentation

WeekNumImpl Class

Implements the Weeknum Excel function. Look at Excel documentation for more information.

Syntax

Namespace: FlexCel.AddinFunctions

public class WeekNumImpl: TUserDefinedFunction

Constructors

Name | Description
WeekNumImpl | Creates a new implementation.

Methods

Name | Description
Evaluate | Evaluates the function. Look At Excel docs for parameters.


WeekNumImpl.WeekNumImpl Constructor | FlexCel Studio for the .NET Framework documentation

WeekNumImpl.WeekNumImpl Constructor

Creates a new implementation.

Syntax

Namespace: FlexCel.AddinFunctions

public WeekNumImpl()

See also

  • WeekNumImpl


WeekNumImpl.Evaluate Method | FlexCel Studio for the .NET Framework documentation

WeekNumImpl.Evaluate Method

Evaluates the function. Look At Excel docs for parameters.

Syntax

Namespace: FlexCel.AddinFunctions

public override Object Evaluate(TUdfEventArgs arguments, Object[] parameters)

Parameters

<-> | Parameter | Type | Description
 | arguments | TUdfEventArgs |
 | parameters | Object[] |

See also

  • WeekNumImpl


WorkDayImpl Class | FlexCel Studio for the .NET Framework documentation

WorkDayImpl Class

Implements the WorkDay Excel function. Look at Excel documentation for more information.

Syntax

Namespace: FlexCel.AddinFunctions

public class WorkDayImpl: BaseWorkDaysImpl

Constructors

Name | Description
WorkDayImpl | Creates a new implementation.

Methods

Name | Description
Evaluate | Evaluates the function. Look At Excel docs for parameters.


WorkDayImpl.WorkDayImpl Constructor | FlexCel Studio for the .NET Framework documentation

WorkDayImpl.WorkDayImpl Constructor

Creates a new implementation.

Syntax

Namespace: FlexCel.AddinFunctions

public WorkDayImpl(Boolean aIntl)

Parameters

<-> | Parameter | Type | Description
 | aIntl | Boolean |

See also

  • WorkDayImpl


WorkDayImpl.Evaluate Method | FlexCel Studio for the .NET Framework documentation

WorkDayImpl.Evaluate Method

Evaluates the function. Look At Excel docs for parameters.

Syntax

Namespace: FlexCel.AddinFunctions

public override Object Evaluate(TUdfEventArgs arguments, Object[] parameters)

Parameters

<-> | Parameter | Type | Description
 | arguments | TUdfEventArgs |
 | parameters | Object[] |

See also

  • WorkDayImpl


XIRRImpl Class | FlexCel Studio for the .NET Framework documentation

XIRRImpl Class

Implements the XIRR Excel function. Look at Excel documentation for more information.

Syntax

Namespace: FlexCel.AddinFunctions

public class XIRRImpl: TUserDefinedFunction

Constructors

Name | Description
XIRRImpl | Creates a new implementation.

Methods

Name | Description
Evaluate | Evaluates the function. Look At Excel docs for parameters.


XIRRImpl.XIRRImpl Constructor | FlexCel Studio for the .NET Framework documentation

XIRRImpl.XIRRImpl Constructor

Creates a new implementation.

Syntax

Namespace: FlexCel.AddinFunctions

public XIRRImpl()

See also

  • XIRRImpl


XIRRImpl.Evaluate Method | FlexCel Studio for the .NET Framework documentation

XIRRImpl.Evaluate Method

Evaluates the function. Look At Excel docs for parameters.

Syntax

Namespace: FlexCel.AddinFunctions

public override Object Evaluate(TUdfEventArgs arguments, Object[] parameters)

Parameters

<-> | Parameter | Type | Description
 | arguments | TUdfEventArgs |
 | parameters | Object[] |

See also

  • XIRRImpl


XNPVImpl Class | FlexCel Studio for the .NET Framework documentation

XNPVImpl Class

Implements the XNPV Excel function. Look at Excel documentation for more information.

Syntax

Namespace: FlexCel.AddinFunctions

public class XNPVImpl: TUserDefinedFunction

Constructors

Name | Description
XNPVImpl | Creates a new implementation.

Methods

Name | Description
Evaluate | Evaluates the function. Look At Excel docs for parameters.


XNPVImpl.XNPVImpl Constructor | FlexCel Studio for the .NET Framework documentation

XNPVImpl.XNPVImpl Constructor

Creates a new implementation.

Syntax

Namespace: FlexCel.AddinFunctions

public XNPVImpl()

See also

  • XNPVImpl


XNPVImpl.Evaluate Method | FlexCel Studio for the .NET Framework documentation

XNPVImpl.Evaluate Method

Evaluates the function. Look At Excel docs for parameters.

Syntax

Namespace: FlexCel.AddinFunctions

public override Object Evaluate(TUdfEventArgs arguments, Object[] parameters)

Parameters

<-> | Parameter | Type | Description
 | arguments | TUdfEventArgs |
 | parameters | Object[] |

See also

  • XNPVImpl


YearFracImpl Class | FlexCel Studio for the .NET Framework documentation

YearFracImpl Class

Implements the YearFrac Excel function. Look at Excel documentation for more information.

Syntax

Namespace: FlexCel.AddinFunctions

public class YearFracImpl: TUserDefinedFunction

Constructors

Name | Description
YearFracImpl | Creates a new implementation.

Methods

Name | Description
Evaluate | Evaluates the function. Look At Excel docs for parameters.
CalcYearFrac | See Excel docs for description of this function.


YearFracImpl.YearFracImpl Constructor | FlexCel Studio for the .NET Framework documentation

YearFracImpl.YearFracImpl Constructor

Creates a new implementation.

Syntax

Namespace: FlexCel.AddinFunctions

public YearFracImpl()

See also

  • YearFracImpl


YearFracImpl.Evaluate Method | FlexCel Studio for the .NET Framework documentation

YearFracImpl.Evaluate Method

Evaluates the function. Look At Excel docs for parameters.

Syntax

Namespace: FlexCel.AddinFunctions

public override Object Evaluate(TUdfEventArgs arguments, Object[] parameters)

Parameters

<-> | Parameter | Type | Description
 | arguments | TUdfEventArgs |
 | parameters | Object[] |

See also

  • YearFracImpl


YearFracImpl.CalcYearFrac Method | FlexCel Studio for the .NET Framework documentation

YearFracImpl.CalcYearFrac Method

See Excel docs for description of this function.

Syntax

Namespace: FlexCel.AddinFunctions

public static Double CalcYearFrac(DateTime Date1, DateTime Date2, TDayCountBasis Basis)

Parameters

<-> | Parameter | Type | Description
 | Date1 | DateTime |
 | Date2 | DateTime |
 | Basis | TDayCountBasis |

See also

  • YearFracImpl


TDayCountBasis Enumeration | FlexCel Studio for the .NET Framework documentation

TDayCountBasis Enumeration

Enumerates different Basis parameters for financial functions like Duration.

Syntax

Namespace: FlexCel.AddinFunctions

Members

Name | Value | Description
UsPsa30_360 | 0 | US method (NASD), 12 months of 30 days each
ActualActual | 1 | Actual number of days in months, actual number of days in year
Actual360 | 2 | Actual number of days in month, year has 360 days
Actual365 | 3 | Actual number of days in month, year has 365 days
Europ30_360 | 4 | European method, 12 months of 30 days each


FlexCel.XlsAdapter Namespace | FlexCel Studio for the .NET Framework documentation

FlexCel.XlsAdapter Namespace

Native API for reading/writing Excel files.

Classes

Name | Description
ETokenException | Exception thrown when an error parsing a formula happens.
FlexCelXlsAdapter​Exception | Exception thrown when an exception on the XlsAdapter engine happens.
XlsBaseChart | Implements common functionality in an ExcelChart interface for xls or xlsx charts.
XlsChart | Implements an ExcelChart interface for charts in xls files.
XlsFile | This is the FlexCel Native Engine. Use this class to natively read or write an Excel 2 or newer file.
XlsxChart | Implements an ExcelChart interface for charts in xlsx files.

Enumerations

Name | Description
XlsErr | Error Codes. We use this and not actual strings to make sure all are correctly spelled.


ETokenException Class | FlexCel Studio for the .NET Framework documentation

ETokenException Class

Exception thrown when an error parsing a formula happens.

Syntax

Namespace: FlexCel.XlsAdapter

public class ETokenException: FlexCelXlsAdapterException

Constructors

Name | Description
ETokenException | Overloaded ETokenException ETokenException(Int32) ETokenException(String) ETokenException(String, Exception)

Properties

Name | Description
Token | Formula token with the error.


ETokenException.ETokenException Constructor | FlexCel Studio for the .NET Framework documentation

ETokenException.ETokenException Constructor

Overloads

  • ETokenException.ETokenException
  • ETokenException.ETokenException(Int32)
  • ETokenException.ETokenException(String)
  • ETokenException.ETokenException(String, Exception)

ETokenException.ETokenException

Creates an empty ETokenException.

Syntax

Namespace: FlexCel.XlsAdapter

public ETokenException()

See also

  • ETokenException

ETokenException.ETokenException(Int32)

Creates a new ETokenException for a specific Token.

Syntax

Namespace: FlexCel.XlsAdapter

public ETokenException(Int32 aToken)

Parameters

<-> | Parameter | Type | Description
 | aToken | Int32 |

See also

  • ETokenException

ETokenException.ETokenException(String)

Creates a new ETokenException with a message.

Syntax

Namespace: FlexCel.XlsAdapter

public ETokenException(String message)

Parameters

<-> | Parameter | Type | Description
 | message | String |

See also

  • ETokenException

ETokenException.ETokenException(String, Exception)

Creates a nested Exception.

Syntax

Namespace: FlexCel.XlsAdapter

public ETokenException(String message, Exception inner)

Parameters

<-> | Parameter | Type | Description
 | message | String | Error Message.
 | inner | Exception | Inner Exception.

See also

  • ETokenException


ETokenException.Token Property | FlexCel Studio for the .NET Framework documentation

ETokenException.Token Property

Formula token with the error.

Syntax

Namespace: FlexCel.XlsAdapter

public Int32 Token { get; }

See also

  • ETokenException


FlexCelXlsAdapterException Class | FlexCel Studio for the .NET Framework documentation

FlexCelXlsAdapterException Class

Exception thrown when an exception on the XlsAdapter engine happens.

Syntax

Namespace: FlexCel.XlsAdapter

public class FlexCelXlsAdapterException: FlexCelException

Constructors

Name | Description
FlexCelXlsAdapter​Exception | Overloaded FlexCelXlsAdapterException FlexCelXlsAdapterException(String) FlexCelXlsAdapterException(String, XlsErr) FlexCelXlsAdapterException(String, Exception)

Properties

Name | Description
ErrorCode | Error code on the Exception.


FlexCelXlsAdapterException.FlexCelXlsAdapterException Constructor | FlexCel Studio for the .NET Framework documentation

FlexCelXlsAdapterException.FlexCelXlsAdapterException Constructor

Overloads

  • FlexCelXlsAdapterException.FlexCelXlsAdapterException
  • FlexCelXlsAdapterException.FlexCelXlsAdapterException(String)
  • FlexCelXlsAdapterException.FlexCelXlsAdapterException(String, XlsErr)
  • FlexCelXlsAdapterException.FlexCelXlsAdapterException(String, Exception)

FlexCelXlsAdapterException.FlexCelXlsAdapterException

Creates a new FlexCelXlsAdapterException

Syntax

Namespace: FlexCel.XlsAdapter

public FlexCelXlsAdapterException()

See also

  • FlexCelXlsAdapterException

FlexCelXlsAdapterException.FlexCelXlsAdapterException(String)

Creates a new FlexCelXlsAdapterException with an error message.

Syntax

Namespace: FlexCel.XlsAdapter

public FlexCelXlsAdapterException(String message)

Parameters

<-> | Parameter | Type | Description
 | message | String | Error Message.

See also

  • FlexCelXlsAdapterException

FlexCelXlsAdapterException.FlexCelXlsAdapterException(String, XlsErr)

Creates a new FlexCelXlsAdapterException with an error message and an exception code.

Syntax

Namespace: FlexCel.XlsAdapter

public FlexCelXlsAdapterException(String message, XlsErr aErrorCode)

Parameters

<-> | Parameter | Type | Description
 | message | String | Error Message
 | aErrorCode | XlsErr | Error code of the exception.

See also

  • FlexCelXlsAdapterException

FlexCelXlsAdapterException.FlexCelXlsAdapterException(String, Exception)

Creates a nested Exception.

Syntax

Namespace: FlexCel.XlsAdapter

public FlexCelXlsAdapterException(String message, Exception inner)

Parameters

<-> | Parameter | Type | Description
 | message | String | Error Message.
 | inner | Exception | Inner Exception.

See also

  • FlexCelXlsAdapterException


FlexCelXlsAdapterException.ErrorCode Property | FlexCel Studio for the .NET Framework documentation

FlexCelXlsAdapterException.ErrorCode Property

Error code on the Exception.

Syntax

Namespace: FlexCel.XlsAdapter

public XlsErr ErrorCode { get; }

See also

  • FlexCelXlsAdapterException


XlsBaseChart Class | FlexCel Studio for the .NET Framework documentation

XlsBaseChart Class

Implements common functionality in an ExcelChart interface for xls or xlsx charts.

Syntax

Namespace: FlexCel.XlsAdapter

public abstract class XlsBaseChart: ExcelChart

Fields

Name | Description
Workbook | Workbook holding the chart.
CurrentSheet | Identifier of the current sheet.
FDefaultFont | Default font.
FDefaultLabelFont | Default font for labels.
FDefaultAxisFont | Default font for Axis.
FDefaultTitleFont | Default font for the chart title.
FDefaultAxis​Title​Font | Default font for the chart axis title.
FVerticalFontScaling | Vertical font scaling.
FHorizontalFont​Scaling | Horizontal font scaling.

Methods

Name | Description
DoAfterConstruction | This method will be called after the chart has been created.
CheckConnected | Checks if the chart is already loaded.
CheckRange | Checks if a parameter is in the range.
CheckRangeObjPath | Checks if an ObjPath is in the range.
CheckRangeObj​Path​OrImage​Index | Checks that a range or path are between bounds. Internal use.
GetImageProperties | Returns image position and size.
HasImageAlternate | Returns true if the image has an alternate representation. This currently happens only with SVG images, which have a PNG base and an SVG alternate. If the image has an alternate, you can get the data with ExcelChart.​Get​Image​Alternate
AddImage | Adds an image to the active sheet. Note that for SVG images, xlsx files store both a PNG and SVG image. To enter an SVG image, use ExcelChart.​Add​Image​Alternate
AddImageAlternate | Adds an image to the active sheet. Currently this method is only needed for SVG images, since SVG images are stored as both PNG and SVG inside the xlsx file. This method allows you to supply both images.
DeleteImage | Deletes the image at position imageIndex. Note that if the image is grouped, this will remove the full group. To remove a particular image inside a group, use ExcelChart.​Delete​Object(​​Int32, String).
ClearImage | Clears the image at position imageIndex, leaving an empty white box.
AddAutoShape | Adds an autoshape to an existing embedded chart. Note that the coordinates for the shape are in chart coords, meaning that only row1, row2, col1 and col2 are used, and they represent the percentage in 1/4000 of the coordinate. So 0 means the top and left of the parent chart, and 4000 means the bottom and right of the parent chart.
SetShapeLinkedCell | Links the shape or image to a cell, if the shape can be linked. To unlink the cell, make linkedCell null. Note that this method applies to shapes like a rectangle or a circle, or an image, not to the link of a forms object like a combobox or a radiobutton.
GetShapeLinkedCell | Returns the cell that is linked to the shape or image. If the object isn't linked, this method will return null. Note that when you change the value in the cell linked to this object, the value of the object will change. Also note that this method applies to shapes like a rectangle or circle, or an image. Objects like a combobox won't be reported by this method.
ImageIndexTo​Object​Path | Returns the absolute object path for an image, given an image index. Note that this method can be slow if there are many objects in the file. Whenever possible, prefer the methods that take directly an imageIndex instead of converting the imageIndex to an objectPath.

Properties

Name | Description
DefaultFont | Returns the default font for all text in the chart that does not have a font defined.
DefaultLabelFont | Returns the default font for all labels in the chart that do not have a font defined.
DefaultAxisFont | Returns the default font for the Axis in the chart that do not have a font defined.
DefaultAxisTitleFont | Returns the default font for the Axis title in the chart that do not have a font defined.
DefaultTitleFont | Returns the default font for the Title in the chart that do not have a font defined.
ImageCount | The number of images in the chart.


XlsBaseChart.Workbook Field | FlexCel Studio for the .NET Framework documentation

XlsBaseChart.Workbook Field

Workbook holding the chart.

Syntax

Namespace: FlexCel.XlsAdapter

protected readonly ExcelFile Workbook

See also

  • XlsBaseChart


XlsBaseChart.CurrentSheet Field | FlexCel Studio for the .NET Framework documentation

XlsBaseChart.CurrentSheet Field

Identifier of the current sheet.

Syntax

Namespace: FlexCel.XlsAdapter

protected Guid CurrentSheet

See also

  • XlsBaseChart


XlsBaseChart.FDefaultFont Field | FlexCel Studio for the .NET Framework documentation

XlsBaseChart.FDefaultFont Field

Default font.

Syntax

Namespace: FlexCel.XlsAdapter

protected TFlxChartFont FDefaultFont

See also

  • XlsBaseChart


XlsBaseChart.FDefaultLabelFont Field | FlexCel Studio for the .NET Framework documentation

XlsBaseChart.FDefaultLabelFont Field

Default font for labels.

Syntax

Namespace: FlexCel.XlsAdapter

protected TFlxChartFont FDefaultLabelFont

See also

  • XlsBaseChart


XlsBaseChart.FDefaultAxisFont Field | FlexCel Studio for the .NET Framework documentation

XlsBaseChart.FDefaultAxisFont Field

Default font for Axis.

Syntax

Namespace: FlexCel.XlsAdapter

protected TFlxChartFont FDefaultAxisFont

See also

  • XlsBaseChart


XlsBaseChart.FDefaultTitleFont Field | FlexCel Studio for the .NET Framework documentation

XlsBaseChart.FDefaultTitleFont Field

Default font for the chart title.

Syntax

Namespace: FlexCel.XlsAdapter

protected TFlxChartFont FDefaultTitleFont

See also

  • XlsBaseChart


XlsBaseChart.FDefaultAxisTitleFont Field | FlexCel Studio for the .NET Framework documentation

XlsBaseChart.FDefaultAxisTitleFont Field

Default font for the chart axis title.

Syntax

Namespace: FlexCel.XlsAdapter

protected TFlxChartFont FDefaultAxisTitleFont

See also

  • XlsBaseChart


XlsBaseChart.FVerticalFontScaling Field | FlexCel Studio for the .NET Framework documentation

XlsBaseChart.FVerticalFontScaling Field

Vertical font scaling.

Syntax

Namespace: FlexCel.XlsAdapter

protected Double FVerticalFontScaling

See also

  • XlsBaseChart


XlsBaseChart.FHorizontalFontScaling Field | FlexCel Studio for the .NET Framework documentation

XlsBaseChart.FHorizontalFontScaling Field

Horizontal font scaling.

Syntax

Namespace: FlexCel.XlsAdapter

protected Double FHorizontalFontScaling

See also

  • XlsBaseChart


XlsBaseChart.DoAfterConstruction Method | FlexCel Studio for the .NET Framework documentation

XlsBaseChart.DoAfterConstruction Method

This method will be called after the chart has been created.

Syntax

Namespace: FlexCel.XlsAdapter

protected void DoAfterConstruction(Boolean IsXlsxChart)

Parameters

<-> | Parameter | Type | Description
 | IsXlsxChart | Boolean |

See also

  • XlsBaseChart


XlsBaseChart.CheckConnected Method | FlexCel Studio for the .NET Framework documentation

XlsBaseChart.CheckConnected Method

Checks if the chart is already loaded.

Syntax

Namespace: FlexCel.XlsAdapter

protected void CheckConnected()

See also

  • XlsBaseChart


XlsBaseChart.CheckRange Method | FlexCel Studio for the .NET Framework documentation

XlsBaseChart.CheckRange Method

Checks if a parameter is in the range.

Syntax

Namespace: FlexCel.XlsAdapter

protected static void CheckRange(Int32 val, Int32 lowest, Int32 highest, FlxParam paramName)

Parameters

<-> | Parameter | Type | Description
 | val | Int32 |
 | lowest | Int32 |
 | highest | Int32 |
 | paramName | FlxParam |

See also

  • XlsBaseChart


XlsBaseChart.CheckRangeObjPath Method | FlexCel Studio for the .NET Framework documentation

XlsBaseChart.CheckRangeObjPath Method

Checks if an ObjPath is in the range.

Syntax

Namespace: FlexCel.XlsAdapter

protected static void CheckRangeObjPath(String ObjPath, Int32 val, Int32 lowest, Int32 highest, FlxParam paramName)

Parameters

<-> | Parameter | Type | Description
 | ObjPath | String |
 | val | Int32 |
 | lowest | Int32 |
 | highest | Int32 |
 | paramName | FlxParam |

See also

  • XlsBaseChart


XlsBaseChart.CheckRangeObjPathOrImageIndex Method | FlexCel Studio for the .NET Framework documentation

XlsBaseChart.CheckRangeObjPathOrImageIndex Method

Checks that a range or path are between bounds. Internal use.

Syntax

Namespace: FlexCel.XlsAdapter

protected void CheckRangeObjPathOrImageIndex(Int32 imageIndex, Boolean usesObjectIndex, String objectPath)

Parameters

<-> | Parameter | Type | Description
 | imageIndex | Int32 |
 | usesObjectIndex | Boolean |
 | objectPath | String |

See also

  • XlsBaseChart


XlsBaseChart.GetImageProperties Method | FlexCel Studio for the .NET Framework documentation

XlsBaseChart.GetImageProperties Method

Returns image position and size.

Syntax

Namespace: FlexCel.XlsAdapter

public override TImageProperties GetImageProperties(Int32 imageIndex, Boolean usesObjectIndex, String objectPath)

Parameters

<-> | Parameter | Type | Description
 | imageIndex | Int32 | Index of the image (1 based)
 | usesObjectIndex | Boolean | If false (the default) then imageIndex is an index to the list of images. When true imageIndex is an index to the list of all objects in the sheet.
 | objectPath | String | Path to the object, when the object is grouped with others. This parameter only has meaning if usesObjectIndex is true. If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"

Returns

Image position and size.

See also

  • XlsBaseChart


XlsBaseChart.HasImageAlternate Method | FlexCel Studio for the .NET Framework documentation

XlsBaseChart.HasImageAlternate Method

Returns true if the image has an alternate representation. This currently happens only with SVG images, which have a PNG base and an SVG alternate. If the image has an alternate, you can get the data with ExcelChart.GetImageAlternate

Syntax

Namespace: FlexCel.XlsAdapter

public override Boolean HasImageAlternate(Int32 imageIndex, String objectPath, Boolean usesObjectIndex)

Parameters

<-> | Parameter | Type | Description
 | imageIndex | Int32 | Index of the image. (1 based)
 | objectPath | String | Object path to the image when it is a grouped image. For toplevel images you can use String.Empty. In other case, you need to use the value returned by ExcelChart.GetObjectProperties Important: ObjectPath is ignored if usesObjectIndex is false. If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3" You might also use the name of the image as object path, like in xls.GetImage(-1, "@myimage", ref imageType, ImageStream, true)
 | usesObjectIndex | Boolean | If false then imageIndex is an index to the list of images. When true imageIndex is an index to the list of all objects in the sheet.

See also

  • XlsBaseChart


XlsBaseChart.AddImage Method | FlexCel Studio for the .NET Framework documentation

XlsBaseChart.AddImage Method

Adds an image to the active sheet. Note that for SVG images, xlsx files store both a PNG and SVG image. To enter an SVG image, use ExcelChart.AddImageAlternate

Syntax

Namespace: FlexCel.XlsAdapter

public override void AddImage(Byte[] data, TXlsImgType imageType, TImageProperties imageProperties)

Parameters

<-> | Parameter | Type | Description
 | data | Byte[] | byte array with the image data.
 | imageType | TXlsImgType | Type of image you are inserting (bmp, jpg, etc).
 | imageProperties | TImageProperties | Placement and other properties of the image.

See also

  • XlsBaseChart


XlsBaseChart.AddImageAlternate Method | FlexCel Studio for the .NET Framework documentation

XlsBaseChart.AddImageAlternate Method

Adds an image to the active sheet. Currently this method is only needed for SVG images, since SVG images are stored as both PNG and SVG inside the xlsx file. This method allows you to supply both images.

Syntax

Namespace: FlexCel.XlsAdapter

public override void AddImageAlternate(Byte[] PNGData, TImageProperties imageProperties, TSVGBlip aSVGBlip)

Parameters

<-> | Parameter | Type | Description
 | PNGData | Byte[] | Image data for the PNG file that will be used as a backup for the SVG. This data must be in PNG file format.
 | imageProperties | TImageProperties | Image Properties.
 | aSVGBlip | TSVGBlip | Data for the SVG image to be added.

See also

  • XlsBaseChart


XlsBaseChart.DeleteImage Method | FlexCel Studio for the .NET Framework documentation

XlsBaseChart.DeleteImage Method

Deletes the image at position imageIndex. Note that if the image is grouped, this will remove the full group. To remove a particular image inside a group, use ExcelChart.DeleteObject(Int32, String).

Syntax

Namespace: FlexCel.XlsAdapter

public override void DeleteImage(Int32 imageIndex, Boolean usesObjectIndex, String objectPath)

Parameters

<-> | Parameter | Type | Description
 | imageIndex | Int32 | Index of the image to delete. (1 based)
 | usesObjectIndex | Boolean | If false (the default) then imageIndex is an index to the list of images. When true imageIndex is an index to the list of all objects in the sheet.
 | objectPath | String | Path to the object, when the object is grouped with others. This parameter only has meaning if usesObjectIndex is true. If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"

See also

  • XlsBaseChart


XlsBaseChart.ClearImage Method | FlexCel Studio for the .NET Framework documentation

XlsBaseChart.ClearImage Method

Clears the image at position imageIndex, leaving an empty white box.

Syntax

Namespace: FlexCel.XlsAdapter

public override void ClearImage(Int32 imageIndex, Boolean usesObjectIndex, String objectPath)

Parameters

<-> | Parameter | Type | Description
 | imageIndex | Int32 | Index of the image to clear. (1 based)
 | usesObjectIndex | Boolean | If false (the default) then imageIndex is an index to the list of images. When true imageIndex is an index to the list of all objects in the sheet.
 | objectPath | String | Path to the object, when the object is grouped with others. This parameter only has meaning if usesObjectIndex is true. If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"

See also

  • XlsBaseChart


XlsBaseChart.AddAutoShape Method | FlexCel Studio for the .NET Framework documentation

XlsBaseChart.AddAutoShape Method

Adds an autoshape to an existing embedded chart. Note that the coordinates for the shape are in chart coords, meaning that only row1, row2, col1 and col2 are used, and they represent the percentage in 1/4000 of the coordinate. So 0 means the top and left of the parent chart, and 4000 means the bottom and right of the parent chart.

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 AddAutoShape(TShapeProperties shapeOptions)

Parameters

<-> | Parameter | Type | Description
 | shapeOptions | TShapeProperties |

Returns

The object index of the new shape.

See also

  • XlsBaseChart


XlsBaseChart.SetShapeLinkedCell Method | FlexCel Studio for the .NET Framework documentation

XlsBaseChart.SetShapeLinkedCell Method

Links the shape or image to a cell, if the shape can be linked. To unlink the cell, make linkedCell null. Note that this method applies to shapes like a rectangle or a circle, or an image, not to the link of a forms object like a combobox or a radiobutton.

Remarks

Images behave differently from shapes: A linked shape will change its text with the value of the cells. A linked image will change its image, to be an screenshot of the selected range. Finally, a linked object like a combobox will modify the selected item depending on the linked cell.

Syntax

Namespace: FlexCel.XlsAdapter

public override void SetShapeLinkedCell(Int32 objectIndex, String objectPath, String linkedCell)

Parameters

<-> | Parameter | Type | Description
 | objectIndex | Int32 | Index of the object (1 based)
 | objectPath | String | Index to the child object you want to change the property. If it is a simple object, you can use String.Empty here, if not you need to get the ObjectPath from ExcelChart.GetObjectProperties If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"
 | linkedCell | String | Cell that will be linked to the shape. To unlink the shape, make this parameter null. Note that this can be a single cell like "A3" or a name like "myName". You can't use a complex formula here like "A1&A2"

See also

  • XlsBaseChart


XlsBaseChart.GetShapeLinkedCell Method | FlexCel Studio for the .NET Framework documentation

XlsBaseChart.GetShapeLinkedCell Method

Returns the cell that is linked to the shape or image. If the object isn't linked, this method will return null. Note that when you change the value in the cell linked to this object, the value of the object will change. Also note that this method applies to shapes like a rectangle or circle, or an image. Objects like a combobox won't be reported by this method.

Remarks

Images behave differently from shapes: A linked shape will change its text with the value of the cells. A linked image will change its image, to be an screenshot of the selected range. Finally, a linked object like a combobox will modify the selected item depending on the linked cell.

Syntax

Namespace: FlexCel.XlsAdapter

public override String GetShapeLinkedCell(Int32 objectIndex, String objectPath)

Parameters

<-> | Parameter | Type | Description
 | objectIndex | Int32 | Index of the object (1 based)
 | objectPath | String | Index to the child object you want to change the property. If it is a simple object, you can use String.Empty here, if not you need to get the ObjectPath from ExcelChart.GetObjectProperties If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"

Returns

The cell address or name which this shape is linked to, or null if it isn't linked.

See also

  • XlsBaseChart


XlsBaseChart.ImageIndexToObjectPath Method | FlexCel Studio for the .NET Framework documentation

XlsBaseChart.ImageIndexToObjectPath Method

Returns the absolute object path for an image, given an image index. Note that this method can be slow if there are many objects in the file. Whenever possible, prefer the methods that take directly an imageIndex instead of converting the imageIndex to an objectPath.

Syntax

Namespace: FlexCel.XlsAdapter

public override String ImageIndexToObjectPath(Int32 imageIndex)

Parameters

<-> | Parameter | Type | Description
 | imageIndex | Int32 | Image index on the image array.

Returns

Image index on the total objects array.

See also

  • XlsBaseChart


XlsBaseChart.DefaultFont Property | FlexCel Studio for the .NET Framework documentation

XlsBaseChart.DefaultFont Property

Returns the default font for all text in the chart that does not have a font defined.

Syntax

Namespace: FlexCel.XlsAdapter

public override TFlxChartFont DefaultFont { get; set; }

See also

  • XlsBaseChart


XlsBaseChart.DefaultLabelFont Property | FlexCel Studio for the .NET Framework documentation

XlsBaseChart.DefaultLabelFont Property

Returns the default font for all labels in the chart that do not have a font defined.

Syntax

Namespace: FlexCel.XlsAdapter

public override TFlxChartFont DefaultLabelFont { get; }

See also

  • XlsBaseChart


XlsBaseChart.DefaultAxisFont Property | FlexCel Studio for the .NET Framework documentation

XlsBaseChart.DefaultAxisFont Property

Returns the default font for the Axis in the chart that do not have a font defined.

Syntax

Namespace: FlexCel.XlsAdapter

public override TFlxChartFont DefaultAxisFont { get; }

See also

  • XlsBaseChart


XlsBaseChart.DefaultAxisTitleFont Property | FlexCel Studio for the .NET Framework documentation

XlsBaseChart.DefaultAxisTitleFont Property

Returns the default font for the Axis title in the chart that do not have a font defined.

Syntax

Namespace: FlexCel.XlsAdapter

public override TFlxChartFont DefaultAxisTitleFont { get; }

See also

  • XlsBaseChart


XlsBaseChart.DefaultTitleFont Property | FlexCel Studio for the .NET Framework documentation

XlsBaseChart.DefaultTitleFont Property

Returns the default font for the Title in the chart that do not have a font defined.

Syntax

Namespace: FlexCel.XlsAdapter

public override TFlxChartFont DefaultTitleFont { get; }

See also

  • XlsBaseChart


XlsBaseChart.ImageCount Property | FlexCel Studio for the .NET Framework documentation

XlsBaseChart.ImageCount Property

The number of images in the chart.

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 ImageCount { get; }

See also

  • XlsBaseChart


XlsChart Class | FlexCel Studio for the .NET Framework documentation

XlsChart Class

Implements an ExcelChart interface for charts in xls files.

Syntax

Namespace: FlexCel.XlsAdapter

public class XlsChart: XlsBaseChart

Methods

Name Description
SeriesInSubchart Returns the number of series on each subchart. Note that this property only works in xlsx files: In xls files it will always return 0.
AddSubchart Adds a new subchart to the existing chart. Note that if the current active subchart is empty, this method will not add a new subchart, but replace the empty one. In that case, ExcelChart.​Subchart​Count won't change.

This method only works in xlsx files, not xls.
SetChartOptions Sets the chart options of a specific subchart inside the chart. Note that while a chart can have multiple subcharts inside (for example one pie subchart and one line subchart), normally there is only one subchart and so the SubchartPos parameter is normally 1.
AddSeries Adds a series to the chart.
DeleteSeries Deletes the series at position index.
GetSeries Returns a series definition.
GetSeriesInSubchart Returns a series definition for a given subchart. Note: This method only works in xlsx files.
SetSeries Sets a Series value. Note that for xlsx charts, this will change the **data range** and the **options** of the series. If you only want to change the data range, pass null options to the method.
SetSeriesInSubchart Sets a Series value. Note that for xlsx charts, this will change the **data range** and the **options** of the series. If you only want to change the data range, pass null options to the method.
GetBubbleSeries Returns the bubble definition for a series when in a bubble chart.
SetBubbleSeries Sets a Series value. Note that for xlsx charts, this will change the **data range** and the **options** of the series. If you only want to change the data range, pass null options to the method.
GetChartAxis Returns the axis information for this chart. Note that this might be more than one, if the chart has a secondary axis.
SetChartAxis Sets the options for either the primary or secondary pair of axis.
GetDataLabels Returns all the labels for the chart. Note that Axis have their labels defined inside their own definition.
SetDataLabels Changes the labels for the chart. You should always get the values with ExcelChart.​Get​Data​Labels, modify them, and change them back with this method.
GetDataLabelsRange Returns the range of cells for a "Label Contains: " "Value from Cells" option in the labels.
Note that for this to work, you also need to use the string [CELLRANGE] in the label definition.
SetDataLabelsRange Sets the range of cells for a "Label Contains: " "Value from Cells" option in the labels.
Note that for this to work, you also need to use the string [CELLRANGE] in the label definition.
GetTitle Returns the title of the chart.
SetTitle Sets the title of the chart. This method is only implemented for xlsx charts.
GetChartLegend Information about the Legend of the chart.
SetChartLegend Sets the legend properties.
RemoveChartLegend Removes the Legend from the chart.
GetTrendline Gets a trendline for a chart. This method is only implemented for xlsx charts.
SetTrendline Gets a trendline for a chart. This method is only implemented for xlsx charts.
GetObjectProperties An object embedded inside a chart.
SetObjectText Overloaded
 SetObjectText(Int32, String, String)
SetObjectText(Int32, String, TRichString)
SetObjectText(Int32, String, TDrawingRichString)
DeleteObject Overloaded
 DeleteObject(Int32)
DeleteObject(Int32, String)
GetImage Returns an image and its type.
Note that for SVG images, xlsx files store both a PNG and SVG image. In those cases, for backward compatibility reasons, this method will return the PNG image. To get the SVG, call ExcelChart.​Get​Image​Alternate
GetImageAlternate Returns an image and its type. Currently this method is the same as ExcelChart.GetImage for all images except SVG.
For SVG images, xlsx files store both a PNG and SVG image. In those cases, this method will return the SVG image. To get the PNG, call ExcelChart.GetImage

Properties

Name | Description
IsXlsxChart | Returns true if the chart is defined inside an xlsx file instead of xls. While both charts in xls and xlsx files are mostly compatible, some behaviors can change depending on what type of chart this is. For example, if the first series in an xls chart is pie, it won't draw gridlines even if the second isn't. In xlsx charts, if another series is not pie, Excel will draw the gridlines.
Style | This is a number between 1 and 48 which defines many standard properties for the chart, like the default line width for the series or the legend. The default style is 2.
SubchartCount | A chart can have multiple subcharts inside: For example one bar chart and one pie chart. This method returns how many subcharts you have inside the main chart. Note that this property only works in xlsx files: In xls files it will always return 1.
Background | Returns the chart background if there is one defined, or null if there is none.
PlotArea | Returns or sets the plot area definition for the chart. Note: Setting the plot area only works in xlsx files.
PlotEmptyCells | Defines how null cells will be plotted on the chart.
ShowDataInHidden​Rows​AndCols | Defines if hidden rows and columns will be used when plotting values.
ChartOptions | Returns the type of chart and the options specific for that kind of chart. There might be more than one ChartOptions returned, since you can mix more than one type of chart on a simple chart. (One for each series). You need to look at the series ChartOptionsIndex to know to which one it refers.
Chart3DOptions | Returns the 3D options for the chart, or null if the chart isn't 3D.
Floor | The floor in a 3D-chart.
SideWall | The wall next to the y-axis in a 3D-chart.
BackWall | The wall at the back of a 3D-chart
SeriesCount | Returns the count of series on this chart.
ObjectCount | The number of objects that are embedded inside this chart.


XlsChart.SeriesInSubchart Method | FlexCel Studio for the .NET Framework documentation

XlsChart.SeriesInSubchart Method

Returns the number of series on each subchart. Note that this property only works in xlsx files: In xls files it will always return 0.

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 SeriesInSubchart(Int32 subchartPos)

Parameters

<-> | Parameter | Type | Description
 | subchartPos | Int32 | Number of the subchart. (1 based)

See also

  • XlsChart


XlsChart.AddSubchart Method | FlexCel Studio for the .NET Framework documentation

XlsChart.AddSubchart Method

Adds a new subchart to the existing chart. Note that if the current active subchart is empty, this method will not add a new subchart, but replace the empty one. In that case, ExcelChart.SubchartCount won't change.

This method only works in xlsx files, not xls.

Syntax

Namespace: FlexCel.XlsAdapter

public override void AddSubchart(TChartType chartType, Int32 axisIndex)

Parameters

<-> | Parameter | Type | Description
 | chartType | TChartType | Type of subchart added. If it is the same as the current chart type, it won't be added.
 | axisIndex | Int32 | It can be 0 if the axis of this subchart will be the primary pair of axis, or 1 if they are the secondary pair.

See also

  • XlsChart


XlsChart.SetChartOptions Method | FlexCel Studio for the .NET Framework documentation

XlsChart.SetChartOptions Method

Sets the chart options of a specific subchart inside the chart. Note that while a chart can have multiple subcharts inside (for example one pie subchart and one line subchart), normally there is only one subchart and so the SubchartPos parameter is normally 1.

Syntax

Namespace: FlexCel.XlsAdapter

public override void SetChartOptions(Int32 subchartPos, TChartOptions options)

Parameters

<-> | Parameter | Type | Description
 | subchartPos | Int32 | Position of the subchart (1 based)
 | options | TChartOptions | Options to set in the subchart.

See also

  • XlsChart


XlsChart.AddSeries Method | FlexCel Studio for the .NET Framework documentation

XlsChart.AddSeries Method

Adds a series to the chart.

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 AddSeries(ChartSeries value)

Parameters

<-> | Parameter | Type | Description
 | value | ChartSeries | Definition of the new series

Returns

Index of the newly added series.

See also

  • XlsChart


XlsChart.DeleteSeries Method | FlexCel Studio for the .NET Framework documentation

XlsChart.DeleteSeries Method

Deletes the series at position index.

Syntax

Namespace: FlexCel.XlsAdapter

public override void DeleteSeries(Int32 index)

Parameters

<-> | Parameter | Type | Description
 | index | Int32 |

See also

  • XlsChart


XlsChart.GetSeries Method | FlexCel Studio for the .NET Framework documentation

XlsChart.GetSeries Method

Returns a series definition.

Syntax

Namespace: FlexCel.XlsAdapter

public override ChartSeries GetSeries(Int32 index, Boolean getDefinitions, Boolean getValues, Boolean getOptions)

Parameters

<-> | Parameter | Type | Description
 | index | Int32 | Index of the series you want to return. (1 based)
 | getDefinitions | Boolean | If false, this method will not return the series formulas, so it will be a little faster.
 | getValues | Boolean | If false, this method will not return the series values, so it will be a little faster and use less memory.
 | getOptions | Boolean | If false, this method will not return the series options.

Returns

series description.

See also

  • XlsChart


XlsChart.GetSeriesInSubchart Method | FlexCel Studio for the .NET Framework documentation

XlsChart.GetSeriesInSubchart Method

Returns a series definition for a given subchart. Note: This method only works in xlsx files.

Syntax

Namespace: FlexCel.XlsAdapter

public override ChartSeries GetSeriesInSubchart(Int32 subchart, Int32 indexInSubchart, Boolean getDefinitions, Boolean getValues, Boolean getOptions)

Parameters

<-> | Parameter | Type | Description
 | subchart | Int32 | Subchart where we want to get the series from. (1 based)
 | indexInSubchart | Int32 | Index of the series you want to return in the given subchart. (1 based)
 | getDefinitions | Boolean | If false, this method will not return the series formulas, so it will be a little faster.
 | getValues | Boolean | If false, this method will not return the series values, so it will be a little faster and use less memory.
 | getOptions | Boolean | If false, this method will not return the series options.

Returns

series description.

See also

  • XlsChart


XlsChart.SetSeries Method | FlexCel Studio for the .NET Framework documentation

XlsChart.SetSeries Method

Sets a Series value. Note that for xlsx charts, this will change the **data range** and the **options** of the series. If you only want to change the data range, pass null options to the method.

Syntax

Namespace: FlexCel.XlsAdapter

public override void SetSeries(Int32 index, ChartSeries value)

Parameters

<-> | Parameter | Type | Description
 | index | Int32 | Index of the series to set.(1 based)
 | value | ChartSeries | Series definition.

See also

  • XlsChart


XlsChart.SetSeriesInSubchart Method | FlexCel Studio for the .NET Framework documentation

XlsChart.SetSeriesInSubchart Method

Sets a Series value. Note that for xlsx charts, this will change the **data range** and the **options** of the series. If you only want to change the data range, pass null options to the method.

Syntax

Namespace: FlexCel.XlsAdapter

public override void SetSeriesInSubchart(Int32 subchart, Int32 indexInSubchart, ChartSeries value)

Parameters

<-> | Parameter | Type | Description
 | subchart | Int32 | Subchart where we want to set the series. (1 based)
 | indexInSubchart | Int32 | Index of the series to set inside the subchart.(1 based)
 | value | ChartSeries | Series definition.

See also

  • XlsChart


XlsChart.GetBubbleSeries Method | FlexCel Studio for the .NET Framework documentation

XlsChart.GetBubbleSeries Method

Returns the bubble definition for a series when in a bubble chart.

Syntax

Namespace: FlexCel.XlsAdapter

public override ChartBubbleSeries GetBubbleSeries(Int32 index, Boolean getDefinitions, Boolean getValues)

Parameters

<-> | Parameter | Type | Description
 | index | Int32 | Index of the series with the bubbles you want to return. (1 based)
 | getDefinitions | Boolean | If false, this method will not return the bubble formulas, so it will be a little faster.
 | getValues | Boolean | If false, this method will not return the bubble values, so it will be a little faster and use less memory.

Returns

Bubble descriptions.

See also

  • XlsChart


XlsChart.SetBubbleSeries Method | FlexCel Studio for the .NET Framework documentation

XlsChart.SetBubbleSeries Method

Sets a Series value. Note that for xlsx charts, this will change the **data range** and the **options** of the series. If you only want to change the data range, pass null options to the method.

Syntax

Namespace: FlexCel.XlsAdapter

public override void SetBubbleSeries(Int32 index, ChartBubbleSeries bubbleSeries)

Parameters

<-> | Parameter | Type | Description
 | index | Int32 | Index of the series with the bubbles you want to set. (1 based)
 | bubbleSeries | ChartBubbleSeries | The bubble series definition.

See also

  • XlsChart


XlsChart.GetChartAxis Method | FlexCel Studio for the .NET Framework documentation

XlsChart.GetChartAxis Method

Returns the axis information for this chart. Note that this might be more than one, if the chart has a secondary axis.

Syntax

Namespace: FlexCel.XlsAdapter

public override TChartAxis[] GetChartAxis()

See also

  • XlsChart


XlsChart.SetChartAxis Method | FlexCel Studio for the .NET Framework documentation

XlsChart.SetChartAxis Method

Sets the options for either the primary or secondary pair of axis.

Syntax

Namespace: FlexCel.XlsAdapter

public override void SetChartAxis(TChartAxis axis)

Parameters

<-> | Parameter | Type | Description
 | axis | TChartAxis | Pair of axis we want to set the options.

See also

  • XlsChart


XlsChart.GetDataLabels Method | FlexCel Studio for the .NET Framework documentation

XlsChart.GetDataLabels Method

Returns all the labels for the chart. Note that Axis have their labels defined inside their own definition.

Syntax

Namespace: FlexCel.XlsAdapter

public override TDataLabel[] GetDataLabels()

See also

  • XlsChart


XlsChart.SetDataLabels Method | FlexCel Studio for the .NET Framework documentation

XlsChart.SetDataLabels Method

Changes the labels for the chart. You should always get the values with ExcelChart.GetDataLabels, modify them, and change them back with this method.

Syntax

Namespace: FlexCel.XlsAdapter

public override void SetDataLabels(TDataLabel[] labels)

Parameters

<-> | Parameter | Type | Description
 | labels | TDataLabel[] | New labels for the chart.

See also

  • XlsChart


XlsChart.GetDataLabelsRange Method | FlexCel Studio for the .NET Framework documentation

XlsChart.GetDataLabelsRange Method

Returns the range of cells for a "Label Contains: " "Value from Cells" option in the labels. Note that for this to work, you also need to use the string [CELLRANGE] in the label definition.

Syntax

Namespace: FlexCel.XlsAdapter

public override TDataLabelsRange GetDataLabelsRange(Int32 chartIndex, Int32 seriesIndex)

Parameters

<-> | Parameter | Type | Description
 | chartIndex | Int32 | Index of the chart (1 based). Must be bigger than 0 and less-or-equal than ExcelChart.SubchartCount
 | seriesIndex | Int32 | Index of the series in the chart (1 based). Must be bigger than 0 and less-or-equal than ExcelChart.SeriesInSubchart

See also

  • XlsChart


XlsChart.SetDataLabelsRange Method | FlexCel Studio for the .NET Framework documentation

XlsChart.SetDataLabelsRange Method

Sets the range of cells for a "Label Contains: " "Value from Cells" option in the labels. Note that for this to work, you also need to use the string [CELLRANGE] in the label definition.

Syntax

Namespace: FlexCel.XlsAdapter

public override void SetDataLabelsRange(Int32 chartIndex, Int32 seriesIndex, TDataLabelsRange value)

Parameters

<-> | Parameter | Type | Description
 | chartIndex | Int32 | Index of the chart (1 based). Must be bigger than 0 and less-or-equal than ExcelChart.SubchartCount
 | seriesIndex | Int32 | Index of the series in the chart (1 based). Must be bigger than 0 and less-or-equal than ExcelChart.SeriesInSubchart
 | value | TDataLabelsRange | Value of the range for the series.

See also

  • XlsChart


XlsChart.GetTitle Method | FlexCel Studio for the .NET Framework documentation

XlsChart.GetTitle Method

Returns the title of the chart.

Syntax

Namespace: FlexCel.XlsAdapter

public override TDataLabel GetTitle()

See also

  • XlsChart


XlsChart.SetTitle Method | FlexCel Studio for the .NET Framework documentation

XlsChart.SetTitle Method

Sets the title of the chart. This method is only implemented for xlsx charts.

Syntax

Namespace: FlexCel.XlsAdapter

public override void SetTitle(TDataLabel value)

Parameters

<-> | Parameter | Type | Description
 | value | TDataLabel |

See also

  • XlsChart


XlsChart.GetChartLegend Method | FlexCel Studio for the .NET Framework documentation

XlsChart.GetChartLegend Method

Information about the Legend of the chart.

Syntax

Namespace: FlexCel.XlsAdapter

public override TChartLegend GetChartLegend()

See also

  • XlsChart


XlsChart.SetChartLegend Method | FlexCel Studio for the .NET Framework documentation

XlsChart.SetChartLegend Method

Sets the legend properties.

Syntax

Namespace: FlexCel.XlsAdapter

public override void SetChartLegend(TChartLegend value)

Parameters

<-> | Parameter | Type | Description
 | value | TChartLegend |

See also

  • XlsChart


XlsChart.RemoveChartLegend Method | FlexCel Studio for the .NET Framework documentation

XlsChart.RemoveChartLegend Method

Removes the Legend from the chart.

Syntax

Namespace: FlexCel.XlsAdapter

public override void RemoveChartLegend()

See also

  • XlsChart


XlsChart.GetTrendline Method | FlexCel Studio for the .NET Framework documentation

XlsChart.GetTrendline Method

Gets a trendline for a chart. This method is only implemented for xlsx charts.

Syntax

Namespace: FlexCel.XlsAdapter

public override TChartTrendline GetTrendline(Int32 chartIndex, Int32 seriesIndex)

Parameters

<-> | Parameter | Type | Description
 | chartIndex | Int32 | Index of the chart (1 based). Must be bigger than 0 and less-or-equal than ExcelChart.SubchartCount
 | seriesIndex | Int32 | Index of the series in the chart (1 based). Must be bigger than 0 and less-or-equal than ExcelChart.SeriesInSubchart

Returns

The trendline definition if there is one, null otherwise. For xls charts this method will always return null.

See also

  • XlsChart


XlsChart.SetTrendline Method | FlexCel Studio for the .NET Framework documentation

XlsChart.SetTrendline Method

Gets a trendline for a chart. This method is only implemented for xlsx charts.

Syntax

Namespace: FlexCel.XlsAdapter

public override void SetTrendline(Int32 chartIndex, Int32 seriesIndex, TChartTrendline trendline)

Parameters

<-> | Parameter | Type | Description
 | chartIndex | Int32 | Index of the chart (1 based). Must be bigger than 0 and less-or-equal than ExcelChart.SubchartCount
 | seriesIndex | Int32 | Index of the series in the chart (1 based). Must be bigger than 0 and less-or-equal than ExcelChart.SeriesInSubchart
 | trendline | TChartTrendline | Trendline definition.

See also

  • XlsChart


XlsChart.GetObjectProperties Method | FlexCel Studio for the .NET Framework documentation

XlsChart.GetObjectProperties Method

An object embedded inside a chart.

Syntax

Namespace: FlexCel.XlsAdapter

public override TShapeProperties GetObjectProperties(Int32 objectIndex, Boolean GetShapeOptions)

Parameters

<-> | Parameter | Type | Description
 | objectIndex | Int32 | Index of the object, between 1 and ExcelChart.ObjectCount
 | GetShapeOptions | Boolean | When true, shape options will be retrieved. As this can be a slow operation, only specify true when you really need those options.

Returns

The properties for the embedded object.

See also

  • XlsChart


XlsChart.SetObjectText Method | FlexCel Studio for the .NET Framework documentation

XlsChart.SetObjectText Method

Overloads

  • XlsChart.SetObjectText(Int32, String, String)
  • XlsChart.SetObjectText(Int32, String, TRichString)
  • XlsChart.SetObjectText(Int32, String, TDrawingRichString)

XlsChart.SetObjectText(Int32, String, String)

Sets the text for an autoshape. If the object does not accept text, this method will do nothing. This version of the method will only modify the text of the object, and preserve the existing formatting in the object if there was one.

Syntax

Namespace: FlexCel.XlsAdapter

public override void SetObjectText(Int32 objectIndex, String objectPath, String text)

Parameters

<-> | Parameter | Type | Description
 | objectIndex | Int32 | Index of the object (1-based)
 | objectPath | String | Index to the child object you want to change the text. If it is a simple object, you can use String.Empty here, if not you need to get the ObjectPath from ExcelChart.GetObjectProperties If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"
 | text | String | Text you want to use. Use null to delete text from an AutoShape.

See also

  • XlsChart

XlsChart.SetObjectText(Int32, String, TRichString)

Sets the text for an autoshape. If the object does not accept text, this method will do nothing. This version of the method will only modify the rich string properties of the object text, and preserve those things not available in a TRichString like wordArt effects.

Syntax

Namespace: FlexCel.XlsAdapter

public override void SetObjectText(Int32 objectIndex, String objectPath, TRichString text)

Parameters

<-> | Parameter | Type | Description
 | objectIndex | Int32 | Index of the object (1-based)
 | objectPath | String | Index to the child object you want to change the text. If it is a simple object, you can use String.Empty here, if not you need to get the ObjectPath from ExcelChart.GetObjectProperties If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"
 | text | TRichString | Text you want to use. Use null to delete text from an AutoShape.

See also

  • XlsChart

XlsChart.SetObjectText(Int32, String, TDrawingRichString)

Changes the text inside an object of the chart.

Syntax

Namespace: FlexCel.XlsAdapter

public override void SetObjectText(Int32 objectIndex, String objectPath, TDrawingRichString text)

Parameters

<-> | Parameter | Type | Description
 | objectIndex | Int32 | Index of the object, between 1 and ExcelChart.ObjectCount
 | objectPath | String | Index to the child object you want to change the text. If it is a simple object, you can use String.Empty here, if not you need to get the ObjectPath from ExcelChart.GetObjectProperties If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"
 | text | TDrawingRichString | Text you want to use. Use null to delete text from an AutoShape.

See also

  • XlsChart


XlsChart.DeleteObject Method | FlexCel Studio for the .NET Framework documentation

XlsChart.DeleteObject Method

Overloads

  • XlsChart.DeleteObject(Int32)
  • XlsChart.DeleteObject(Int32, String)

XlsChart.DeleteObject(Int32)

Deletes the graphic object at objectIndex. Use it with care, there are some graphics objects you don't want to remove (like comment boxes when you don't delete the associated comment.)

Syntax

Namespace: FlexCel.XlsAdapter

public override void DeleteObject(Int32 objectIndex)

Parameters

<-> | Parameter | Type | Description
 | objectIndex | Int32 | Index of the object (1 based).

See also

  • XlsChart

XlsChart.DeleteObject(Int32, String)

Deletes the graphic object at objectIndex. Use it with care, there are some graphics objects you don't want to remove (like comment boxes when you don't delete the associated comment.)

Syntax

Namespace: FlexCel.XlsAdapter

public override void DeleteObject(Int32 objectIndex, String objectPath)

Parameters

<-> | Parameter | Type | Description
 | objectIndex | Int32 | Index of the object (1 based).
 | objectPath | String | Index to the child object you want to change the property. If it is a simple object, you can use String.Empty here, if not you need to get the ObjectPath from ExcelChart.GetObjectProperties If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"

See also

  • XlsChart


XlsChart.GetImage Method | FlexCel Studio for the .NET Framework documentation

XlsChart.GetImage Method

Returns an image and its type. Note that for SVG images, xlsx files store both a PNG and SVG image. In those cases, for backward compatibility reasons, this method will return the PNG image. To get the SVG, call ExcelChart.GetImageAlternate

Syntax

Namespace: FlexCel.XlsAdapter

public override void GetImage(Int32 imageIndex, String objectPath, ref TXlsImgType imageType, Stream outStream, Boolean usesObjectIndex)

Parameters

<-> | Parameter | Type | Description
 | imageIndex | Int32 | Index of the image. (1 based)
 | objectPath | String | Object path to the image when it is a grouped image. For toplevel images you can use String.Empty. In other case, you need to use the value returned by ExcelChart.GetObjectProperties If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"
ref | imageType | TXlsImgType | Returns the image type for the data returned. (If it is a bmp, jpg or other)
 | outStream | Stream | Stream where the image data will be copied.
 | usesObjectIndex | Boolean | If false (the default) then imageIndex is an index to the list of images. When true imageIndex is an index to the list of all objects in the sheet. When you have the object id, you can avoid calling ObjectIndexToImageIndex which is a slow method, by setting this parameter to true.

See also

  • XlsChart


XlsChart.GetImageAlternate Method | FlexCel Studio for the .NET Framework documentation

XlsChart.GetImageAlternate Method

Returns an image and its type. Currently this method is the same as ExcelChart.GetImage for all images except SVG. For SVG images, xlsx files store both a PNG and SVG image. In those cases, this method will return the SVG image. To get the PNG, call ExcelChart.GetImage

Syntax

Namespace: FlexCel.XlsAdapter

public override void GetImageAlternate(Int32 imageIndex, String objectPath, out TXlsImgType imageType, Stream outStream, Boolean usesObjectIndex)

Parameters

<-> | Parameter | Type | Description
 | imageIndex | Int32 | Index of the image. (1 based)
 | objectPath | String | Object path to the image when it is a grouped image. For toplevel images you can use String.Empty. In other case, you need to use the value returned by ExcelChart.GetObjectProperties If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"
out | imageType | TXlsImgType | Returns the image type for the data returned. (If it is a bmp, jpg or other)
 | outStream | Stream | Stream where the image data will be copied.
 | usesObjectIndex | Boolean | If false (the default) then imageIndex is an index to the list of images. When true imageIndex is an index to the list of all objects in the sheet. When you have the object id, you can avoid calling ObjectIndexToImageIndex which is a slow method, by setting this parameter to true.

See also

  • XlsChart


XlsChart.IsXlsxChart Property | FlexCel Studio for the .NET Framework documentation

XlsChart.IsXlsxChart Property

Returns true if the chart is defined inside an xlsx file instead of xls. While both charts in xls and xlsx files are mostly compatible, some behaviors can change depending on what type of chart this is. For example, if the first series in an xls chart is pie, it won't draw gridlines even if the second isn't. In xlsx charts, if another series is not pie, Excel will draw the gridlines.

Syntax

Namespace: FlexCel.XlsAdapter

public override Boolean IsXlsxChart { get; }

See also

  • XlsChart


XlsChart.Style Property | FlexCel Studio for the .NET Framework documentation

XlsChart.Style Property

This is a number between 1 and 48 which defines many standard properties for the chart, like the default line width for the series or the legend. The default style is 2.

Syntax

Namespace: FlexCel.XlsAdapter

public override ChartStyle Style { get; set; }

See also

  • XlsChart


XlsChart.SubchartCount Property | FlexCel Studio for the .NET Framework documentation

XlsChart.SubchartCount Property

A chart can have multiple subcharts inside: For example one bar chart and one pie chart. This method returns how many subcharts you have inside the main chart. Note that this property only works in xlsx files: In xls files it will always return 1.

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 SubchartCount { get; }

See also

  • XlsChart


XlsChart.Background Property | FlexCel Studio for the .NET Framework documentation

XlsChart.Background Property

Returns the chart background if there is one defined, or null if there is none.

Syntax

Namespace: FlexCel.XlsAdapter

public override TChartFrameOptions Background { get; set; }

See also

  • XlsChart


XlsChart.PlotArea Property | FlexCel Studio for the .NET Framework documentation

XlsChart.PlotArea Property

Returns or sets the plot area definition for the chart. Note: Setting the plot area only works in xlsx files.

Syntax

Namespace: FlexCel.XlsAdapter

public override TChartPlotArea PlotArea { get; set; }

See also

  • XlsChart


XlsChart.PlotEmptyCells Property | FlexCel Studio for the .NET Framework documentation

XlsChart.PlotEmptyCells Property

Defines how null cells will be plotted on the chart.

Syntax

Namespace: FlexCel.XlsAdapter

public override TPlotEmptyCells PlotEmptyCells { get; set; }

See also

  • XlsChart


XlsChart.ShowDataInHiddenRowsAndCols Property | FlexCel Studio for the .NET Framework documentation

XlsChart.ShowDataInHiddenRowsAndCols Property

Defines if hidden rows and columns will be used when plotting values.

Syntax

Namespace: FlexCel.XlsAdapter

public override Boolean ShowDataInHiddenRowsAndCols { get; set; }

See also

  • XlsChart


XlsChart.ChartOptions Property | FlexCel Studio for the .NET Framework documentation

XlsChart.ChartOptions Property

Returns the type of chart and the options specific for that kind of chart. There might be more than one ChartOptions returned, since you can mix more than one type of chart on a simple chart. (One for each series). You need to look at the series ChartOptionsIndex to know to which one it refers.

Syntax

Namespace: FlexCel.XlsAdapter

public override TChartOptions[] ChartOptions { get; }

See also

  • XlsChart


XlsChart.Chart3DOptions Property | FlexCel Studio for the .NET Framework documentation

XlsChart.Chart3DOptions Property

Returns the 3D options for the chart, or null if the chart isn't 3D.

Syntax

Namespace: FlexCel.XlsAdapter

public override TChart3DOptions Chart3DOptions { get; }

See also

  • XlsChart


XlsChart.Floor Property | FlexCel Studio for the .NET Framework documentation

XlsChart.Floor Property

The floor in a 3D-chart.

Syntax

Namespace: FlexCel.XlsAdapter

public override ChartWallOptions Floor { get; }

See also

  • XlsChart


XlsChart.SideWall Property | FlexCel Studio for the .NET Framework documentation

XlsChart.SideWall Property

The wall next to the y-axis in a 3D-chart.

Syntax

Namespace: FlexCel.XlsAdapter

public override ChartWallOptions SideWall { get; }

See also

  • XlsChart


XlsChart.BackWall Property | FlexCel Studio for the .NET Framework documentation

XlsChart.BackWall Property

The wall at the back of a 3D-chart

Syntax

Namespace: FlexCel.XlsAdapter

public override ChartWallOptions BackWall { get; }

See also

  • XlsChart


XlsChart.SeriesCount Property | FlexCel Studio for the .NET Framework documentation

XlsChart.SeriesCount Property

Returns the count of series on this chart.

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 SeriesCount { get; }

See also

  • XlsChart


XlsChart.ObjectCount Property | FlexCel Studio for the .NET Framework documentation

XlsChart.ObjectCount Property

The number of objects that are embedded inside this chart.

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 ObjectCount { get; }

See also

  • XlsChart


XlsFile Class | FlexCel Studio for the .NET Framework documentation

XlsFile Class

This is the FlexCel Native Engine. Use this class to natively read or write an Excel 2 or newer file.

Remarks

Note that most arrays here are 1-based and not 0-based, to follow the convention used on Excel Automation. So, if you are using C# or C++, your loops should look like:

    for (int i = 1; i <= SomeProperty.Count; i++)

and not

    for (int i = 0; i < SomeProperty.Count; i++)

Syntax

Namespace: FlexCel.XlsAdapter

public class XlsFile: ExcelFile

Constructors

Name | Description
XlsFile | Overloaded XlsFile XlsFile(Boolean) XlsFile(String) XlsFile(String, Boolean) XlsFile(Int32, Boolean) XlsFile(Stream, Boolean) XlsFile(Int32, TExcelFileFormat, Boolean)

Methods

Name | Description
AddWindow Adds a new window to the file. Note that this isn't a new sheet, but another view of the workbook. Most Excel documents have only one window.
DeleteWindow Deletes a window from the file. Note that this isn't a sheet, but another view of the workbook. Most Excel documents have only one window.
GetBuiltInFormat | Returns one of the 49 built in formats Excel supports. For more information see SetBuiltInFormat
SetBuiltInFormat Excel has 49 predefined formats which aren't stored in the xls/x file, only the format id is stored.

When opening the file in Excel, the cells formatted with those internal formats will be formatted according to the language and version of Excel, not all of them return the same. For example, some Excel versions will display format 38 as "#,##0 ;[Red](#,##0) " (negative numbers in parenthesis) while others will display the same format 38 as "#,##0 _$;[Red]-#,##0 _$" (negative numbers have "-" sign)....[more]
NewFile Creates a new empty file, with the specified number of sheets.
NewFileStatic This method creates a new file in without virtual calls, so it can be called from a constructor.
Open Overloaded
 Open(String, TFileFormats, Char, Int32, Int32, ColumnImportType[], String[], Encoding, Boolean)
Open(Stream, TFileFormats, Char, Int32, Int32, ColumnImportType[], String[], Encoding, Boolean)
Import Overloaded
 Import(TextReader, Int32, Int32, Int32[], ColumnImportType[], String[])
Import(TextReader, Int32, Int32, Char, Char, ColumnImportType[], String[])
Save Overloaded
 Save(String, TFileFormats, Char, Encoding)
Save(Stream, TFileFormats, Char, Encoding)
SaveForHashing This method will save the file in a format that will remain the same if the file is not modified. Normal xls files contain TimeStamp fields that might be modified when the file is downloaded or just copied.

While you will not be able to load the file saved, you might use this method to create a hash of a file and compare it to others to know if something changed.
Export Overloaded
 Export(TextWriter, TXlsCellRange, Char, Boolean, String)
Export(TextWriter, TXlsCellRange, Int32, Int32[], Boolean, Boolean, String)
GetSheetIndex Finds a sheet name on the workbook and returns its index.
Depending on the "throwException" parameter, this method will raise an exception or return -1 if the sheet does not exist.
To change the active sheet by the name, use ExcelFile.​Active​Sheet​ByName. See also ExcelFile.​Get​Sheet​Name
GetSheetName Returns the sheet name for a given index.
To change the active sheet by the name, use ExcelFile.​Active​Sheet​ByName. See also ExcelFile.​Get​Sheet​Index(​​String)
GetSheetIndexFromID Returns the ActiveSheet for a stored ExcelFile.SheetID.
You can use this method together with ExcelFile.SheetID to save and restore an ActiveSheet when you are adding or removing sheets.

If the sheet ID doesn't exist, this method will return 0.
GetSheetVisible Returns if a given sheet is visible.
AddChartSheet Adds a chart sheet to the file. You can then add series and customize the returned ExcelChart object.
Note that as this is a chart sheet, the anchor is ignored.
The ActiveSheet after adding the chart will be set to the newly inserted chart.

Important: This method only works in xlsx files.
InsertAndCopySheets Overloaded
 InsertAndCopySheets(Int32[], Int32, ExcelFile)
InsertAndCopySheets(Int32, Int32, Int32, ExcelFile)
ClearSheet Clears all data on the active sheet, but does not delete it.
DeleteSheet Deletes sheet aSheet and aSheetCount-1 sheets more to the right.
It will change all formula references to that sheet to invalid, and might change the active sheet so it remains valid.
GetSheetSelected Returns true if a sheet is selected, false otherwise. Note that you might select many sheets in Excel by shift or ctrl-clicking the sheet tabs. Also note that when changing the ExcelFile.​Active​Sheet, the sheet selected will be reset to the active sheet.
So if you want to find out which sheets are selected in a file, you should call this method after opening the file but before changing the active sheet.
This property can work in different windows depending on the value of...[more]
SetSheetSelected | This method will set a sheet tab as selected. Note that this is different from ExcelFile.​Active​Sheet in that you might have only a single active sheet, but you might select many tabs by ctrl-clicking them. Also note that whenever you change the ExcelFile.​Active​Sheet, the selected sheets will be reset to the active sheet only. So if you want to save a file with more than one selected sheet, you should call this method...[more]
GetSheetType Returns the sheet type for a given sheet.
HasHPageBreak True if the sheet has a Manual Horizontal page break on the row.
HasVPageBreak True if the sheet has a Manual Vertical page break on the column.
InsertHPageBreak Inserts a Horizontal Page Break at the specified row. If there is one already, it will do nothing.
If the number of pagebreaks is bigger than the maximum Excel can admit, it will add it anyway, but you might get an exception when saving the file as xls. Exporting as images or PDF will use those additional page breaks.
To control what to do when there are too many page breaks, see ExcelFile.​Error​Actions
InsertVPageBreak Inserts a Vertical Page Break at the specified column. If there is one already, it will do nothing.
If the number of pagebreaks is bigger than the maximum Excel can admit, it will add it anyway, but you might get an exception when saving the file as xls. Exporting as images or PDF will use those additional page breaks.
To control what to do when there are too many page breaks, see ExcelFile.​Error​Actions
DeleteHPageBreak Deletes all manual page breaks at row. If there is no manual page break on row, this method will do nothing.
DeleteVPageBreak Deletes all manual page breaks at col. If there is no manual page break on col, this method will do nothing.
ClearPageBreaks Deletes all manual page breaks on the active sheet.
KeepRowsTogether Tells FlexCel that it must try to keep together the rows between row1 and row2 (inclusive) when printing.
This method does nothing to the resulting Excel file since this is not an Excel feature. To actually do something, you need to call ExcelFile.​Auto​Page​Breaks after calling this method.
KeepColsTogether Tells FlexCel that it must try to keep together the columns between col1 and col2 (inclusive) when printing.
This method does nothing to the resulting Excel file since this is not an Excel feature. To actually do something, you need to call ExcelFile.​Auto​Page​Breaks after calling this method.
GetKeepRowsTogether Returns the value of level for a row as set in ExcelFile.​Keep​Rows​Together. Note that the last value of a "keep together" range is 0.
For example, if you set KeepRowsTogether(1, 3, 8, true); GetKeepRowsTogether will return 8 for rows 1 and 2, and 0 for row 3.
GetKeepColsTogether Returns the value of level for a column as set in ExcelFile.​Keep​Cols​Together. Note that the last value of a "keep together" range is 0.
For example, if you set KeepColsTogether(1, 3, 8, true); GetKeepColsTogether will return 8 for columns 1 and 2, and 0 for column 3.
HasKeepRowsTogether Returns true if there is any row marked as keeptogether in the sheet.
This method traverses every row to find out, so it can be somehow slow and you should not call it too often.
HasKeepColsTogether Returns true if there is any column marked as keeptogether in the sheet.
This method traverses every column to find out, so it can be somehow slow and you should not call it too often.
DumpKeepRows​Together​Levels This method is used for debugging intelligent page breaks (see 'Intelligent page breaks' in the Api Developer Guide.
It will read the keep-together level for every row ad write it at the column "col". Note that the contents of col will be overwritten.
DumpKeepCols​Together​Levels This method is used for debugging intelligent page breaks (see 'Intelligent page breaks' in the Api Developer Guide.
It will read the keep-together level for every column and writer it the row "row". Note that the contents of row will be overwritten.
AutoPageBreaks Overloaded
 AutoPageBreaks(Int32, Int32)
AutoPageBreaks(Int32, TUIRectangle)
GetCellValue Overloaded
 GetCellValue(Int32, Int32, Int32)
GetCellValue(Int32, Int32, Int32, Int32)
GetCellValueIndexed Reads a Cell Value and Format, using a column index for faster access. Normal GetCellValue(row, col) has to search for the column on a sorted list. If you are looping from 1 to ExcelFile.​Col​Count​InRow(​​Int32) this method is faster.
SetCellValue Overloaded
 SetCellValue(Int32, Int32, Object, Int32)
SetCellValue(Int32, Int32, Int32, Object, Int32)
ConvertString | Converts a string into the best datatype (a boolean, a number, etc)
SetCellFromString Converts a string to the best datatype, and the enters it into a cell.
GetStringFromCell This method will return a rich string that is formatted similar to the way Excel shows it.
For example, if you have "1.0" on a cell, and the cell is formatted as exponential, this method will return "1.0e+1" It might also change the color depending on the value and format. (for example, red for negative numbers) Conditional formats are not applied, you need to call ExcelFile.​Conditionally​Modify​Format(​​TFlx​Format, Int32, Int32, Boolean, TDrawingConditional​Format) ...[more]
SetCellFromHtml Enters an HTML formatted string into a cell, and tries to match the Excel formats with the HTML formatting tags.
Note that the rich text inside Excel is more limited than xls (you are limited to only changing font attributes), so many tags from the HTML tags might be ignored. Whenever a tag is not understood or cannot be mapped into Excel, it will just be omitted. For a list of supported tags, see the Remarks section.
GetHtmlFromCell Returns the contents of formatted cell as HTML.
Conditional formats are not applied (unless includeCellFormatting is true): you need to call ExcelFile.​Conditionally​Modify​Format(​​TFlx​Format, Int32, Int32, Boolean, TDrawingConditional​Format) to the cell style to get the cell with cf applied.
If...[more]
CopyCell Copies one cell from one workbook to another. If the cell has a formula, it will be offset so it matches the new destination.
Note: You will normally not need this method. To copy a range of cells from a workbook to another use ExcelFile.​Insert​AndCopy​Range(​​TXls​Cell​Range, Int32, Int32, Int32, TFlxInsertMode, TRangeCopyMode, ExcelFile, Int32) ...[more]
GetFormat | Returns the format definition for a given format index. Note that this method will only return Cell formats. If you want to read a Style format, use ExcelFile.​Get​Style(​​Int32)
AddFormat Adds a new format to the Excel format list. If it already exists, it doesn't add a new one, so you can use this method for searching too.
SetFormat Sets the font definition for a given format index. Normally it is of not use, (you should use AddFont or AddFormat instead) but could be used to change the default format. (using SetFormat(0, fmt); ). This method will change style XFs and CellXfs, depending if aFormat is a StyleXF or a CellXF.
GetFont Returns the font definition for a given font index.
SetFont | Sets the font definition for a given font index. Normally it is of not use, (you should use AddFont or AddFormat instead) but could be used to change the default font format. (using SetFont(0, font); )
AddFont Adds a new font to the excel font list. If it already exists, it doesn't add a new one, so you can use this method for searching too.
SetCellFormat Overloaded
 SetCellFormat(Int32, Int32, Int32)
SetCellFormat(Int32, Int32, Int32, Int32, Int32)
SetCellFormat(Int32, Int32, Int32, Int32, TFlxFormat, TFlxApplyFormat, Boolean)
GetCellFormat Overloaded
 GetCellFormat(Int32, Int32)
GetCellFormat(Int32, Int32, Int32)
Conditionally​Modify​Format Modifies the format of the specified cell if it has a conditional format active.
Returns a modified format with the applied conditional format if there was any change, null otherwise.
GetConditionalFormat One of the entries on the conditional format list of this file.
SetConditionalFormat Modifies one of the conditional format rules in the sheet.
AddConditionalFormat Adds a conditional format for a range of cells.
ClearConditional​Formats​InSheet Removes all conditional formats in the active sheet.
RemoveConditional​Format Removes the conditional format at position index.
GetStyleName Gets the name of the style at position index. (1 based).
GetStyle Overloaded
 GetStyle(Int32)
GetStyle(String, Boolean)
RenameStyle Renames an existing style. Note that this might be a user-defined style, you can't rename built-in styles.
SetStyle Modifies an existing style if name already exists, or creates a new style if it doesn't.
DeleteStyle Returns a named style for the workbook.
GetBuiltInStyleName Returns the name for a built-in style.
TryGetBuiltIn​Style​Type Tries to convert a string into an built-in style identifier. Will return true if styleName can be converted, false otherwise.
CellMergedBounds Merged Range where the cell is.
MergeCells Merges a number of cells into one.
UnMergeCells Unmerges the range of cells. The coordinates have to be exact, if there is no merged cell with the exact coordinates, nothing will be done. If you want to unmerge all cells inside a range, use ExcelFile.​UnMerge​AllCells​InRange instead.
UnMergeAllCells​InRange This method will unmerge all the cells that are inside a range of cells.
CellMergedList The Merged cell at position index on the mergedcell list.
CellMergedNext Use this method to enumerate all merged cells in a sheet.
GetRowCount Number of rows actually used on a given sheet.
GetColCount Number of columns actually used on a given sheet.
IsEmptyRow True if the specified row does not have any cells, nor any format on it.
In short, this row has never been used.
IsNotFormattedCol True if the specified column does not have any format applied on it.
GetRowFormat Overloaded
 GetRowFormat(Int32)
GetRowFormat(Int32, Int32)
SetRowFormat Overloaded
 SetRowFormat(Int32, Int32, Boolean)
SetRowFormat(Int32, TFlxFormat, TFlxApplyFormat, Boolean)
GetColFormat Overloaded
 GetColFormat(Int32)
GetColFormat(Int32, Int32)
SetColFormat Overloaded
 SetColFormat(Int32, Int32, Boolean)
SetColFormat(Int32, Int32, Int32, Boolean)
SetColFormat(Int32, TFlxFormat, TFlxApplyFormat, Boolean)
GetRowOptions Returns all Row options at once (if the row is autosize, if it is hidden, etc).
SetRowOptions Sets all Row options at once (if the row is autosize, if it is hidden, etc).
GetColOptions Returns all Column options at once (if the column is hidden, etc).
SetColOptions Sets all Column options at once (if the column is hidden, etc).
GetRowHeight Overloaded
 GetRowHeight(Int32)
GetRowHeight(Int32, Int32, Boolean)
SetRowHeight Sets the current Row height, in Excel internal units. (1/20th of a point) See Excel Internal Units for more information in Excel internal units.
GetColWidth Overloaded
 GetColWidth(Int32)
GetColWidth(Int32, Boolean)
GetColWidth(Int32, Int32, Boolean)
SetColWidth Overloaded
 SetColWidth(Int32, Int32)
SetColWidth(Int32, Int32, Int32)
DefaultRowHeight​Visual The default height for empty rows, in Excel internal units. (1/20th of a point). Different from ExcelFile.​Default​RowHeight this property returns the actual row height as Excel will show it, considering ExcelFile.​Default​RowHidden and ExcelFile.​Default​RowHeight​Automatic.
See Excel Internal Units ...[more]
GetRowHidden Overloaded
 GetRowHidden(Int32)
GetRowHidden(Int32, Int32)
SetRowHidden Hides or shows a specific row.
GetColHidden Returns true if the column is hidden.
SetColHidden Overloaded
 SetColHidden(Int32, Boolean)
SetColHidden(Int32, Int32, Boolean)
GetAutoRowHeight Returns if the row is adjusting its size to the cell (the default) or if it has a fixed height.
SetAutoRowHeight Sets the current row to automatically autosize to the biggest cell or not.
AutofitRow Autofits a range of rows so they adapt their height to show all the text inside. Note that due to GDI+ / GDI incompatibilities, the height calculated by FlexCel will not be exactly the same than the one calculated by Excel. So when you open this workbook in Excel, Excel will re calculate the row heights to what it believes is best.
You can change this behavior specifying keepHeightAutomatic = false.
See also Fine Tuning Row Autofitting
AutofitCol Autofits a range of columns so they adapt their width to show all the text inside.
AutofitRowsOn​Workbook Autofits all the rows on all sheets on a workbook that are set to autofit so they adapt their height to show all the text inside.
Note that due to GDI+ / GDI incompatibilities, the heights calculated by FlexCel will not be exactly the same than the ones calculated by Excel. So when you open this workbook in Excel, Excel might re calculate the row heights to what it believes is best.
You can change this behavior specifying keepSizesAutomatic = false.
See also Fine Tuning Row Autofitting ...[more]
MarkRowForAutofit | Marks a row as candidate for future autofit. Note that this method will NOT change anything on the file. It just "marks" the row so you can use it later with ExcelFile.​Autofit​Marked​Rows​AndCols(​​Boolean, Boolean, Double). To change the actual autofit status on the xls file, use ExcelFile.​Set​Auto​RowHeight ...[more]
MarkColForAutofit Marks a column as candidate for future autofit. Note that this method will NOT change anything on the file. It just "marks" the column so you can use it later with ExcelFile.​Autofit​Marked​Rows​AndCols(​​Boolean, Boolean, Double).
IsRowMarkedFor​Autofit Returns true is a row is marked for autofit.
IsColMarkedFor​Autofit Returns true is a column is marked for autofit.
AutofitMarked​Rows​AndCols Autofits all the rows and columns on a sheet that have been previously marked with the ExcelFile.​Mark​RowFor​Autofit(​​Int32, Boolean, Double) and ExcelFile.​Mark​ColFor​Autofit(​​Int32, Boolean, Double) methods.
AutofitComment Will return the resized anchor so the size of the comment is enough to fit all the text inside.
ColCountInRow Overloaded
 ColCountInRow(Int32)
ColCountInRow(Int32, Int32)
ColFromIndex Overloaded
 ColFromIndex(Int32, Int32)
ColFromIndex(Int32, Int32, Int32)
ColToIndex Overloaded
 ColToIndex(Int32, Int32)
ColToIndex(Int32, Int32, Int32)
CopyColFormats Copies the column definitions, that is formats, widths, hidden/visible, etc from one workbook or sheet to another.
GetColumnBlocks This method returns a list of blocks of column information, grouped by columns that have the same properties.
Since an xlsx file can have 16384 columns, querying every one of them might be slow. With this method, if columns from 5 to 16384 are hidden, you will get a single block with firstCol = 5 and lastCol = 16384 that is hidden. If you used ExcelFile.​Get​ColHidden instead you would have to call it 16384 times to get the same information.
GetColorPalette Returns a color from the color palette. This method will throw an exception if its "index" parameter is bigger than ExcelFile.​Color​Palette​Count, (for example, for an automatic color).
To get the real color, use ExcelFile.​Get​Color​Palette(​​Int32, TUIColor)
SetColorPalette Changes a color on the Excel color palette.
NearestColorIndex Overloaded
 NearestColorIndex(TUIColor)
NearestColorIndex(TUIColor, Boolean[])
PaletteContainsColor Returns true if the internal color palette contains the exact specified color. Note that Excel 2007 doesn't use the color palette, so this method is not needed there.
OptimizeColorPalette Changes the colors in the color palette so they can represent better the colors in use. This method will change the colors not used in the palette by colors used in the sheet. If there are more unique colors in the sheet than the 56 available in the palette, only the first colors will be changed.

When FlexCel saves an xls file, it saves the color information twice: The real color for Excel 2007 and newer, and the indexed color for older Excel versions. This method optimizes the palette of indexed colors so they look better in Excel 2003 or older. It doesn't effect Excel 2007 or newer at all.
GetColorPalette​Version Internal use. Every time the palette changes, the number returned is incremented.
GetColorTheme Overloaded
 GetColorTheme(TThemeColor)
GetColorTheme(TPrimaryThemeColor)
SetColorTheme Overloaded
 SetColorTheme(TThemeColor, TDrawingColor)
SetColorTheme(TPrimaryThemeColor, TDrawingColor)
NearestColorTheme Returns the most similar entry on the theme palette for a given color.
GetThemeFont Gets the major of minor font scheme in the theme.
SetThemeFont Sets either the minor or the major font for the theme.
GetTheme | This is an advanced method, that allows you to get the full theme in use. Normally you will just want to replace colors, and you can do this with ExcelFile.​Set​Color​Theme(​​TPrimary​Theme​Color, TDrawingColor) and ExcelFile.​Get​Color​Theme(​​TPrimary​Theme​Color) ...[more]
GetThemeNoClone Internal use. This won't clone the internal structure for more performance.
SetTheme | This is an advanced method, that allows you to set the full theme in use. Normally you will just want to replace colors, and you can do this with ExcelFile.​Set​Color​Theme(​​TPrimary​Theme​Color, TDrawingColor) and ExcelFile.​Get​Color​Theme(​​TPrimary​Theme​Color) ...[more]
GetNamedRange Overloaded
 GetNamedRange(Int32)
GetNamedRange(String, Int32)
GetNamedRange(String, Int32, Int32)
FindNamedRange | Returns the index (1 based) on the list of named ranges for a given name and local sheet. If the range is not found, this method will return -1 You could use ExcelFile.​Get​Named​Range(​​Int32) to get the name definition, or directly call ExcelFile.​Get​Named​Range(​​String, Int32, Int32) ...[more]
SetNamedRange Overloaded
 SetNamedRange(TXlsNamedRange)
SetNamedRange(Int32, TXlsNamedRange)
DeleteNamedRange Deletes the name at the specified position. Important: If the name you are trying to delete is referenced by any formula/​chart/​whatever in your file, the name will not actually be deleted but hidden.

You won't see the name in Excel or in the formula, but it will be there and you can see it from FlexCel.
You can use ExcelFile.​Get​Used​Named​Ranges to learn if a range might be deleted.

Also, note that if you later delete the formulas that reference those ranges FlexCel will remove those hanging ranges when saving. ...[more]
GetUsedNamedRanges Returns an array of booleans where each value indicates if the name at position "i-1" is used by any formula, chart, or object in the file. If the name is in use, it can't be deleted. Note that the index here is Zero-based, different from all other Name indexes in FlexCel, because arrays in C# are always 0-based. So UsedRange[0] corresponds to GetNamedRange(1) and so on.
CopyToClipboard​Format Copies a range on the active sheet to a clipboard stream, on the specified format.
PasteFromText​Clipboard​Format Pastes the clipboard contents beginning on cells row, col.
PasteFromXls​Clipboard​Format Pastes the clipboard contents beginning on cells row, col, with the option to convert formulas to their values.
GetPageHeader​AndFooter This method will return all the headers and footers in a sheet.
SetPageHeader​AndFooter | This method will set all the headers and footers in a sheet. If you want a simple header or footer for all the pages, you might want to use ExcelFile.PageHeader and ExcelFile.PageFooter
FillPageHeader​OrFooter Given a Page Header or footer string including macros (like [FileName] or [PageNo]), this method will return the strings that go into the left, right and middle sections.
GetPageHeader​OrFooter​AsHtml Converts a section of a page header or footer into an HTML string.
GetHeaderOrFooter​Image This method returns the images associated to a given section of the header or footer.
There can be only one image per section, and you refer it from the header string (see ExcelFile.PageHeader and ExcelFile.PageFooter) by writing &G.
NOTE THAT YOU CAN ONLY USE HEADER AND FOOTER GRAPHICS ON EXCEL XP AND NEWER. Excel 2000 and 97 will still open the file, but they will show no graphics.
GetHeaderOrFooter​Image​Properties Returns the image position and size.
SetHeaderOrFooter​Image This method sets the image associated to a given section of the header or footer.
There can be only one image per section, and you refer it from the header string (see ExcelFile.PageHeader and ExcelFile.PageFooter) by writing &G.
NOTE THAT YOU CAN ONLY USE HEADER AND FOOTER GRAPHICS ON EXCEL XP AND NEWER. Excel 2000 and 97 will still open the file, but they will show no graphics.
ALSO, NOTE that only setting the image will not display it. You need to write &G in the corresponding...[more]
GetPrintMargins Gets the Margins on the active sheet.
SetPrintMargins Sets the Margins on the active sheet.
GetPrinterDriver​Settings Returns printer driver settings. This method is not intended to be used alone, but together with ExcelFile.​Set​Printer​Driver​Settings to copy printer driver information from a file to another.
SetPrinterDriver​Settings Sets printer driver information. This method is not intended to be used alone, but together with ExcelFile.​Get​Printer​Driver​Settings to copy printer driver information from a file to another.
SetImage Sets the image data and / or image properties of an existing image.
Note that for SVG images, xlsx files store both a PNG and SVG image. To enter an SVG image, use ExcelFile.​Set​Image​Alternate
SetImageAlternate Sets the image data and / or image properties of an existing image.
Currently this method is only needed for SVG images, since SVG images are stored as both PNG and SVG inside the xlsx file. This method allows you to supply both images.
SetImageProperties Sets the image properties of an existing image.
GetImageName Returns the image name at position imageIndex.
HasImageAlternate | Returns true if the image has an alternate representation. This currently happens only with SVG images, which have a PNG base and an SVG alternate. If the image has an alternate, you can get the data with ExcelFile.​Get​Image​Alternate
GetImageProperties Returns image position and size.
AddImage Adds an image to the active sheet.
Note that for SVG images, xlsx files store both a PNG and SVG image. To enter an SVG image, use ExcelFile.​Add​Image​Alternate
AddImageAlternate Adds an image to the active sheet.
Currently this method is only needed for SVG images, since SVG images are stored as both PNG and SVG inside the xlsx file. This method allows you to supply both images.
DeleteImage Deletes the image at position imageIndex. Note that if the image is grouped, this will remove the full group.
To remove a particular image inside a group, use ExcelFile.​Delete​Object(​​Int32, String).
ClearImage Clears the image at position imageIndex, leaving an empty white box.
SetSheetBackground Sets the sheet background for the active sheet. Set it to null to remove the background.
GetSheetBackground Gets the sheet background for the active sheet. It will return null if there isn't any background in the sheet.
ImageIndexTo​Object​Index Returns the general index on the object list for an image. You can use then this index on SendToBack, for example.
Note that if the image is in a group, this method will return the first object index for the group that contains the image.
If you want to get the object path to the image instead, look at ExcelFile.​Image​Index​ToObject​Path
ObjectIndexTo​Image​Index Returns the index on the image collection of an object. Note that this method is slow when there are many images, so use it sparingly.
ImageIndexTo​Object​Path Returns the absolute object path for an image, given an image index. Note that this method can be slow if there are many objects in the file.
Whenever possible, prefer the methods that take directly an imageIndex instead of converting the imageIndex to an objectPath.
ObjectPathTo​Image​Index Returns the index on the image collection of an object. Note that this method is slow when there are many images, so use it sparingly.
Whenever possible, prefer the methods that take directly an objectPath instead of converting the objectPath to an imageIndex.
GetObjectName Returns the name of the object at objectIndex position.
GetObjectShapeId Returns the shape id of the object at objectIndex position. Shape Ids are internal identifiers for the shape, that you can use to uniquely identify a shape.
Note that the shape id can change when you load the file, once it is loaded, it will remain the same for the shape lifetime.
FindObjectPath Finds an object by its name, and returns the ObjectPath you need to use this object.
Note that if there is more than an object with the same name in the sheet, this method will return null.
FindObjectByShapeId Finds an object given its internal shape id, and returns the object index you need to access the same object in FlexCel.
GetObjectAnchor Returns the placement of the object.
SetObjectAnchor Sets the object placement.
GetObjectProperties Returns information on an object and all of its children. If the shape doesn't exist, this method returns null.
GetObjectProperties​ByShapeId Returns information on an object and all of its children and parents.

Note: This method always returns a top level object. If you ask for a shape id of a shape that is contained inside other group, this method will return the first level group containing other groups that contain the shape.

Note 2:This method is mostly for internal use. Shape ids are not guaranteed to be preserved when saving and reloading a file, so this method should only be used while editing the file with shape ids retrieved from the XlsFile object, not hardcoded shape ids. To get the object properties for a known shape in a file, give it a name and call...[more]
SetObjectText Overloaded
 SetObjectText(Int32, String, String)
SetObjectText(Int32, String, TRichString)
SetObjectText(Int32, String, TDrawingRichString)
SetObjectName Sets the name for an autoshape.
SetObjectProperty Overloaded
 SetObjectProperty(Int32, String, TShapeOption, Int64)
SetObjectProperty(Int32, String, TShapeOption, Double)
SetObjectProperty(Int32, String, TShapeOption, Boolean)
SetObjectProperty(Int32, String, TShapeOption, String)
SetObjectProperty(Int32, String, TShapeOption, TDrawingHyperlink)
SetObjectProperty(Int32, String, TShapeOption, Int32, Boolean)
SetObjectProperties Sets all the properties of the shape. This allows for more complete control than ExcelFile.​Set​Object​Property(​​Int32, String, TShapeOption, String) beause it can specify for example a xlsx fill using a theme color, instead of simple RGB fills.
AddAutoShape Adds an autoshape to the sheet. You can add shapes to a worksheet, or to a chart sheet.
For an example on how to add a shape, please create a shape in Excel, then open the file with APIMate and look at the generated code.
DeleteObject | Deletes the graphic object at objectIndex. Use it with care, there are some graphics objects you don't want to remove (like comment boxes when you don't delete the associated comment.)
GetObjectsInRange Returns a list with all the objects that are completely inside a range of cells.
GetObjectLinkedCell Returns the cell that is linked to the object. If the object isn't an object that can be linked or it isn't linked, this method will return null.
Note that when you change the value in the cell linked to this object, the value of the object will change.

The sheet returned in the TCellAddress might be null, in which case the reference is to a cell in the same sheet, or it might contain another sheet name.

Also note that this applies to form objects. To get the link of a shape like a circle or rectangle, use...[more]
GetShapeLinkedCell Returns the cell that is linked to the shape or image. If the object isn't linked, this method will return null.
Note that when you change the value in the cell linked to this object, the value of the object will change.
Also note that this method applies to shapes like a rectangle or circle, or an image. To get the link of a forms object like a combobox or a radiobutton use ExcelFile.​Get​Object​Linked​Cell instead.
SetObjectLinkedCell Links the object to a cell, if the object can be linked. If the object is a radio button then all the other radio buttons in the group will be linked to the same cell, so when the cell changes the radio buttons too, and vice-versa. To unlink the cell, make linkedCell null.
SetShapeLinkedCell Links the shape or image to a cell, if the shape can be linked. To unlink the cell, make linkedCell null.
Note that this method applies to shapes like a rectangle or circle, or images. To change the link of a forms object like a combobox or a radiobutton use ExcelFile.​Set​Object​Linked​Cell instead.
GetObjectInputRange Returns the input range for the object.
If the object isn't a combobox or listbox, or it doesn't have an input range, this method will return null.
Note that when you change the value in the cell linked to this object, the value of the object will change.

The sheet in the TCellAddresses returned might be null, in which case the reference is to a cell in the same sheet, or it might contain another sheet name.
SetObjectInputRange Sets the input range for a ListBox or a ComboBox. When applied to other objects, this method does nothing.
GetObjectMacro Returns the macro associated with an object, or null if there is no macro associated.
SetObjectMacro Associates an object with a macro. While this will normally be used in buttons, you can associate macros to almost any object.
GetCheckboxState Gets the value of a checkbox in the active sheet. Note that this only works for checkboxes added through the Forms toolbar. It won't return the values of ActiveX checkboxes.
SetCheckboxState Sets the value of a checkbox in the active sheet. Note that this only works for checkboxes added through the Forms toolbar. It won't return the values of ActiveX checkboxes.
GetCheckboxLinked​Cell OBSOLETE: Use ExcelFile.​Get​Object​Linked​Cell instead.

Returns the cell that is linked to the checkbox. If the object isn't a checkbox or it isn't linked, this method will return null. Note that when you change the value in the cell linked to this checkbox, the value of the checkbox will change.

The sheet returned in the TCellAddress might be null, in which case the reference is to a cell in the same sheet, or it might contain another sheet name.
SetCheckboxLinked​Cell OBSOLETE: Use ExcelFile.​Set​Object​Linked​Cell instead.

Links the checkbox to a cell, so when the cell changes the checkbox changes too, and vice-versa. To unlink the cell, make linkedCell null.
AddCheckbox Adds a checkbox to the active sheet.
GetRadioButtonState Gets if a radio button in the active sheet is selected or not. Note that this only works for radio buttons added through the Forms toolbar. It won't return the values of ActiveX radio buttons.
SetRadioButtonState | Sets the value of a radio button in the active sheet. Note that this only works for radio buttons added through the Forms toolbar. It won't return the values of ActiveX radio buttons
AddRadioButton Adds a radio button to the active sheet. Call ExcelFile.​Add​Group​Box(​​TClient​Anchor, TRichString) to insert a group box for grouping the radio buttons.
AddGroupBox Adds a Group box to the active sheet. Call ExcelFile.​Add​Radio​Button(​​TClient​Anchor, TRichString) to insert radio buttons inside the group box.
GetObjectSelection Gets the selected item in an object from the "Forms" palette. It can be a combobox or a listbox.
0 means no selection, 1 the first item in the list. Note that this only works for objects added through the Forms toolbar. It won't return the values of ActiveX objects.
SetObjectSelection Sets the selected item of an object from the "Forms" palette. It can be a combobox, a listbox, a spinbox or a scrollbar. Note that this only works for objects added through the Forms toolbar. It won't return the values of ActiveX objects.
GetObjectSpin​Properties Returns maximum, minimum and increment in any control that has a spin or dropdown, like a listbox, combobox, spinner or scrollbar.
SetObjectSpin​Properties Sets the spin properties of an object. You should apply this only to scrollbars and spinners.
GetObjectSpinValue Returns the current selected value of a scrollbar.
SetObjectSpinValue Sets the position in a scrollbar object. If the object is linked to a cell, the cell will be updated.
AddComboBox Adds a ComboBox to the active sheet.
AddListBox Adds a ListBox to the active sheet.
AddButton Adds a button to the sheet, with the associated macro.
AddLabel Adds a Label to the active sheet.
AddSpinner Adds a Spinner to the active sheet.
AddScrollBar Adds a ScrollBar to the active sheet.
RenderObject This method renders any object (chart, image, autoshape, etc) into an image, and returns it.
RenderCells This method renders a range of cells into an image, and returns it.

No objects will be drawn on the cells, you can use ExcelFile.​Render​Object(​​Int32) to draw those.

Important note: By default this method will only render the text inside the cell, not the borders or cell fills or anything else. If you want to export an xls file to images, you need to set the parameter "exportObjects" to true, or use...[more]
CellRangeDimensions Returns the height and width that would be used by a range of cells (in Points, or 1/72 inches).
RenderObjectAsSVG Overloaded
 RenderObjectAsSVG(Int32, Double, TShapeProperties, TUIColor, TSVGExportType, String, String, String, IEnumerable<TSVGAttribute>, Encoding, Boolean, TPointF, TUIRectangle)
RenderObjectAsSVG(Stream, Int32, Double, TShapeProperties, TUIColor, TSVGExportType, String, String, String, IEnumerable<TSVGAttribute>, Encoding, Boolean, TPointF, TUIRectangle)
SendToBack Sends the graphical object to the bottom layer on the display (z-order) position. It will show below and will be covered by all other objects on the sheet.
BringToFront Sends the graphical object to the top layer on the display (z-order) position. It will show above and will cover all other objects on the sheet.
SendForward Sends the graphical object one layer up on the display (z-order) position. It will show above and will cover the image at objectIndex+1.
SendBack Sends the graphical object one layer down. It will show below and will be covered by image at objectIndex-1.
CommentRowCount Maximum row index including comments.
CommentCountRow Number of comments on a given row.
GetCommentRow Returns the comment at position commentIndex on the specified row.
GetCommentRowCol | Returns the column for comment at position commentIndex
GetComment Returns the comment at the specified row and column, or an empty string if there is no comment on that cell.
SetCommentRow Changes the properties (text and position of the popup) for an existing comment at commentIndex.
To delete a comment, set a "new TRichString()" as the "value" param. To add a new comment, use ExcelFile.​Set​Comment(​​Int32, Int32, TRichString).
SetComment Sets or deletes a comment at the specified cell.
GetCommentPropertiesRow | Returns the comment properties for the popup at position commentIndex
GetCommentProperties Gets the popup placement for an existing comment. If there is not a comment on cell (row,col), this will return null.
SetCommentPropertiesRow Sets the comment properties at the specified index.
SetCommentProperties Sets the popup placement for an existing comment. If there is not a comment on cell (row,col), this will create an empty one.
LightClone Returns a copy of this ExcelFile object with the same backing data, so the cells in both objects are the same.
Using a light clone allows you to read from a single ExcelFile in two different threads, since while the data is the same (so you don't use twice the memory as a real clone would), you can have separate activesheets in both. So one thread can be reading from the "original" file with ActiveSheet = 1, and the other thread could be reading from the light clone with activeSheet = 3.
InsertAndCopyRange Inserts and/or copies a range of cells from one place to another.

This method is one of the most important on FlexCel API, and it allows you to copy ranges of cells from one place to another, adapting the formulas, images and everything as Excel would do it.
DeleteRange Overloaded
 DeleteRange(TXlsCellRange, TFlxInsertMode)
DeleteRange(Int32, Int32, TXlsCellRange, TFlxInsertMode, Boolean)
MoveRange Moves a range of cells, the same way Excel does it. All references pointing to the old range will be relocated to the new, and all existing references to the new range will be relocated to #ref.
ClearDataValidation Overloaded
 ClearDataValidation
ClearDataValidation(TXlsCellRange)
AddDataValidation Adds a new Data Validation to a specified range.
GetDataValidation Returns the validation information for a specific cell. If the cell has no Data Validation associated, this method returns null.
GetDataValidation​Info Returns the data validation information for an entry of the index.
There are 2 ways you can access the data validation information on a sheet:...[more]
GetDataValidation​Ranges Returns a list of ranges for which a data validation definition applies.
There are 2 ways you can access the data validation information on a sheet:...[more]
CheckDataValidation Overloaded
 CheckDataValidation(Int32, Int32)
CheckDataValidation(Int32, Int32, Object, Boolean)
CheckDataValidations​InSheet Checks if all the cells in the active sheet inside data validations have values that are valid according to the data validation specifications.
CheckDataValidations​InWorkbook Checks if all the cells in the file inside data validations have values that are valid according to the data validation specifications.
GetHyperLink Returns the hyperlink at position index on the list.
SetHyperLink Modifies an existing Hyperlink. Use ExcelFile.​Add​Hyper​Link to add a new one.
GetHyperLink​Cell​Range Returns the cell range a hyperlink refers to.
SetHyperLink​Cell​Range Changes the cells an hyperlink is linked to.
AddHyperLink Adds a new hyperlink to the Active sheet. Use ExcelFile.​Set​Hyper​Link to modify an existing one.
DeleteHyperLink Deletes an existing hyperlink.
LoopHyperLinks Loops over the list of existing hyperlinks in the active sheet which are at least partially contained in range, and executes action for each one of those links. This can be faster than looping over all hyperlinks in a page if you have thousands, since this method uses spatial indexing.
GetRowOutlineLevel Returns the Outline level for a row.
SetRowOutlineLevel Sets the Outline level for a row range.
GetColOutlineLevel Returns the Outline level for a column.
SetColOutlineLevel Sets the Outline level for a column range.
CollapseOutlineRows Collapses or expands the row outlines in a sheet to the specified level. It is equivalent to pressing the numbers at the top of the outline gutter in Excel.
CollapseOutlineCols Collapses or expands the column outlines in a sheet to the specified level. It is equivalent to pressing the numbers at the top of the outline gutter in Excel.
IsOutlineNodeRow Returns true when the row is the one that is used for collapsing an outline. (it has a "+" at the left).
IsOutlineNodeCol Returns true when the column is the one that is used for collapsing an outline. (it has a "+" at the top).
IsOutlineNode​CollapsedRow Returns true when the row is an outline node (it has a "+" at the left) and it is closed (all children are hidden).
IsOutlineNode​CollapsedCol Returns true when the column is an outline node (it has a "+" at the top) and it is closed (all children are hidden).
CollapseOutline​NodeRow Use this method to collapse a node of the outline. If the row is not a node (ExcelFile.​IsOutline​NodeRow is false) this method does nothing.
While this method allows a better control of the rows expanded and collapsed, you will normally use ExcelFile.​Collapse​Outline​Rows(​​Int32, TCollapseChildren​Mode) ...[more]
CollapseOutline​NodeCol Use this method to collapse a node of the outline. If the column is not a node (ExcelFile.​IsOutline​NodeCol is false) this method does nothing.
While this method allows a better control of the columns expanded and collapsed, you will normally use ExcelFile.​Collapse​Outline​Cols(​​Int32, TCollapseChildren​Mode) ...[more]
SubtotalDefault​English​String Returns the english string that Excel uses to refer to Sums, averages, et. when you use the Subtotal command. You can use the result of this method together with ExcelFile.Subtotal to specify the text for totals.
Subtotal This method works like the "Subtotal" command in Excel in the "Data" tab of the ribbon. It will take a number of cells and group them by similar values, adding a subtotal formula every new different value and a grand total at the end.
It will also add outlines at the right.
SelectCells | Selects a group of cells on a given pane. If you just want to select just one cell, you can use the simpler method ExcelFile.SelectCell This property can work in different windows depending on the value of ExcelFile.​Active​Window
GetSelectedCells Returns the selected ranges on a sheet.
This property can work in different windows depending on the value of ExcelFile.​Active​Window
ScrollWindow Scrolls the window to a specified place.
This property can work in different windows depending on the value of ExcelFile.​Active​Window
GetWindowScroll Returns the window scroll for a specified pane.
This property can work in different windows depending on the value of ExcelFile.​Active​Window
FreezePanes | This command is equivalent to Menu-​>Window-​>Freeze Panes. It will freeze the rows and columns above and to the left from cell. Note that because Excel works this way, when you ExcelFile.​Split​Window the panes are suppressed and vice-versa See also ExcelFile.​Get​Frozen​Panes This property can work in different windows depending on the value of ExcelFile.​Active​Window ...[more]
GetFrozenPanes Returns the cell that is freezing the window, "A1" if no panes are frozen.
See also ExcelFile.​Freeze​Panes This property can work in different windows depending on the value of ExcelFile.​Active​Window
SplitWindow | This command is equivalent to Menu-​>Window-​>Split. It will split the window in 4 regions. Note that because Excel works this way, when you ExcelFile.​Freeze​Panes the windows are unsplitted and vice-versa See also ExcelFile.​Get​Split​Window This property can work in different windows depending on the value of ExcelFile.​Active​Window ...[more]
GetSplitWindow Returns the horizontal and vertical offsets for the split windows. Zero means no split.
See also ExcelFile.​Split​Window This property can work in different windows depending on the value of ExcelFile.​Active​Window
GetDataConnections Returns the data connections in the file. Use ExcelFile.​Set​Data​Connections to change the connections in the file.
SetDataConnections Sets the data connections in the file.
GetChart Returns a chart from an object position and path. If the object does not contain a chart, it returns null.
Note that charts can be first-level objects (in chart sheets), or they can be embedded inside other objects, that can be themselves embedded inside other objects. So you need to recursively look inside all objects to see if there are charts anywhere.

Look at the example in this topic to see how to get all charts in a sheet.
AddChart This method will add a chart to the active sheet. You can then add series and customize the returned ExcelChart object.

Important: This method only works in xlsx files.
Find Finds a value inside a cell and returns the position for the cell, or null if nothing was found.
Replace Replaces the instances of oldValue by newValue in the active sheet, and allows to specify the cell format and value for every replaced cell.
Sort Sorts a range on the current sheet.
SetAutoFilter Sets the AutoFilter in the Active sheet to point to the range specified.
Note: You will normally want to use ExcelFile.​Set​Auto​Filter(​​Int32, Int32, Int32), since that is the common way to set autofilters. The last row shouldn't matter, so it will addapt automatically when you add rows.
If you specify the last row, then the range will still grow to include all data, but it will include at least the last row you specify, even if it is blank."/>
RemoveAutoFilter Removes the AutoFilter from the active sheet. If there is no AutoFilter in the sheet, this method does nothing.
HasAutoFilter Overloaded
 HasAutoFilter
HasAutoFilter(Int32, Int32)
GetAutoFilterRange Returns the range of cells with AutoFilter in the Active sheet, or null if there is not AutoFilter.
Recalc When ExcelFile.RecalcMode is manual, use this method to force a recalculation of the spreadsheet.
RecalcAndVerify Use this method to validate a file. FlexCel does not support all the range of functions from Excel when recalculating, so unknown functions will return "#NAME?" errors. Using this function you can validate your user worksheets and see if all the formulas they use are supported.
RecalcCell This method will recalculate a single cell and all of it's dependencies, but not the whole workbook.

USE THIS METHOD WITH CARE! You will normally want to simply call ExcelFile.Recalc or just save the file and let FlexCel calculate the workbook for you.
This method is for rare situations where you are making thousands of recalculations and the speed of Recalc is not enough, and you have a big part of the spreadsheet that you know that didn't change....[more]
StartBatchRecalc​Cells This method tells FlexCel that you are going to call multiple times ExcelFile.RecalcCell without changing any data in the spreadsheet. This way, FlexCel won't keep recalculating the same supporting cells each time you call RecalcCells.

Always match this call with a call to ExcelFile.​End​Batch​Recalc​Cells.
EndBatchRecalcCells This method ends the batch started by ExcelFile.​Start​Batch​Recalc​Cells and goes back to normal mode.
RecalcExpression Calculates the value of any formula and returns the result. The expression must be a valid Excel formula, it must start with "=", and cell references that don't specify a sheet (like for example "=A2") will refer to the active sheet. Cells used by the formula will be recalculated as needed too.

You can use this method as a simple calculator, or to calculate things like the sum of a range of cells in the spreadsheet. Look at the example for more information on how to use it.

Note that we will consider the expression to be located in the cell A1 of the Active sheet. So for example "=ROW()" will return 1, and "=A2" will return the value of A2 in the active sheet.
RecalcRange This method recalculates a formula that returns a range, and returns the cells that compose it. Note that normally ranges are a single rectangle (like in "=A1:B2"), and in this case this method will return a single element in the array.
But you might have a formula like "=A1:A10, C6:C7" which will return two different ranges. In this case, the returned array will have more than one TCellAddressRange.
If the formula doesn't resolve to a range or group of ranges, this method will return null.
OffsetRelative​Formula Use this method to know the actual formula that applies to a cell when the formula is relative.
In some places, mostly data validations and names, Excel returns relative formulas.

So for example you might have a name with a definition of "=Sheet1!A2" when you are positioned at cell A1. If you now move the cursor to cell A2 in Excel, the name definition will be "=Sheet1!A3" since the reference is relative to the cell where the cursor is. If you retrieve the name formula with FlexCel, as FlexCel doesn't have a cursor, it will always return the canonical formula as if you were positioned at A1. If you want to know the real formula when you are positioned at A2, you need to call this method with cellRow =3, cellCol = 1 and expression = "=Sheet1!A2". It will return "=Sheet1!A3".
RecalcRelative​Formula Use this method to know the value of a formula that applies to a cell when the formula is relative.
In some places, mostly data validations and names, Excel returns relative formulas.

So for example you might have a name with a definition of "=Sheet1!A2" when you are positioned at cell A1. If you now move the cursor to cell A2 in Excel, the name definition will be "=Sheet1!A3" since the reference is relative to the cell where the cursor is. If you use ExcelFile.​Recalc​Expression(​​String) ...[more]
GetWhatIfTableList Returns a list of the upper cells of the What-if tables in the page. You can then use ExcelFile.​Get​What​IfTable to get the definition of each one.
GetWhatIfTable Returns the range of cells that make the what-if table that starts at aRow and aCol.
If there is no What-if table at aRow, aCol, this method returns null.

If both the returned rowInputCell and colInputCell are null, this means this table points to deleted references.
SetWhatIfTable Creates an Excel What-if table in the range of cells specified by Range. Calling this method is the same as setting a cell value with a TFormula where TFormula.Span has more than one cell, and TFormula.Text is something like "{​=TABLE(​,A4)​}​". The parameters for the =TABLE function are rowInputCell and colInputCell, and they look the same a Excel will show them.
GetLink Gets the external link at position i.
SetLink Changes the external link at position i for a new value. Note that you can't add new links with this method, external links are added automatically when you add formulas that reference other worksheets. This method is only to change existing links to point to other place. All formulas pointing to the old link will point to the new.

Note that the replacing filename should have the same sheets as the original, or the formulas might break.
ConvertFormulas​ToValues Use it to convert formulas to their values. It can be useful if for example you are copying the sheet to another workbook, and you don't want any references to it. NOTE: You will probably want to use ExcelFile.​Convert​External​Names​ToRef​Errors(​​Boolean) too, to convert named ranges besides the formulas.

Also note that if you want to convert a whole file, you need to call ConvertFormulas​ToValues in every sheet.
ConvertExternal​Names​ToRef​Errors Use it to convert the external names in a sheet to #REF! . It can be useful when you need to remove all external links in a file.
NOTE: You will probably want to use ExcelFile.​Convert​Formulas​ToValues(​​Boolean) too.
GetCachedFont0 This method is used by FlexCel itself, you shouldn't call it directly.
SetCachedFont0 This method is used by FlexCel itself, you shouldn't call it directly.
AddUserDefined​Function Adds a custom formula function to the FlexCel recalculation engine. Note that this formulas are only valid for Excel custom formulas, not for internal ones.
For example, you could define "EDATE" since it is a custom formula defined in the Analysis Addin, but you cannot redefine "SUM".
Note that if a custom formula with the name already exists, it will be replaced. Names are Case insensitive ("Date" is the same as "DATE").

Also note that some user defined functions come already built in FlexCel, so you might not need to define them.
For more information on adding Custom Formulas make sure you read...[more]
ClearUserDefined​Functions Removes all the custom formula functions from the FlexCel recalculation engine.
RemoveUserDefined​Function Removes a single function from the FlexCel recalculation engine. If the function doesn't exist, this method will return false.
EvaluateUser​Defined​Function Evaluates a custom function you have added earlier with ExcelFile.​Add​User​Defined​Function. You will not normally need to call this method, but it could be used for testing.
If the function has not been added with ExcelFile.​Add​User​Defined​Function, this method will return TFlxFormulaError​Value.​Err​Name ...[more]
IsDefinedFunction Returns true if the Custom formula function has been added to the FlexCel recalculating engine.
Note that internal functions are not returned by this method, but user defined functions pre-defined in FlexCel will be.
RemoveMacros If the file has macros, this method will remove them.
HasMacros Returns true if the file has any macros.
IsSharedWorkbook Returns true is this is a shared workbook. This method only will return true for xls files, since FlexCel doesn't load tracking changes in xlsx files.
UnshareWorkbook Removes the "track changes" information of the workbook and unshares the workbook. This is only needed for xls files, as FlexCel doesn't save tracking changes in xlsx files, and the feature is deprecated in Excel.
HasWebAddinTaskPanes Returns true if the file has any task pane web add-in. Note that this only applies to task pane addins. The content addins are just objects in the sheet.
RemoveWebAddin​Task​Panes | Removes all task pane web add-ins from the file. Note that this will only remove the task pane addins. You can remove the content addins by removing the corresponding objects in the sheet with ExcelFile.​Delete​Object(​​Int32)
GetCustomTableStyle Overloaded
 GetCustomTableStyle(String)
GetCustomTableStyle(Int32)
HasCustomTableStyle Returns true if the workbook has a custom table style with name "name".
SetCustomTableStyle Adds a new or replaces an existing table style.
RenameCustom​Table​Style Renames an existing custom table style. Note that this method won't change the table styles from existing tables from oldName to newName. So after renaming a table style, you should loop in all the tables in the workbook which use that table style, and manually rename their custom table styles too.
DeleteCustom​Table​Style Overloaded
 DeleteCustomTableStyle(Int32)
DeleteCustomTableStyle(String)
DeleteAllCustom​Table​Styles​InWorkbook Deletes all custom table styles in the workbook.
GetTable Overloaded
 GetTable(Int32)
GetTable(String, Boolean)
GetTableSheet Returns the sheet number of the table, or raises an exception if the table doesn't exist.
HasTable Returns true if the table exists in the file.
GetTableName If there is a table in the cell at (row, col) then this method will return the name of the table. If not it will return an empty string.
GetTableAtCell If there is a table in the cell at (row, col) then this method will return the table definition. If not it will return null.
AddTable Adds a table to the active sheet.
SetTable Changes an existing table. The table to change is given by the table name in aTable.
Note that this method won't change the name of the table. To do so, you need to call ExcelFile.​Rename​Table
RenameTable Renames an existing table to a new name, renaming also all references to that table. Note that the final name of the table might not be the name you specified in newName, if newName already existed. You need to check the result of this method to know the actual name which the table was renamed to.
DeleteTable Deletes a table from the workbook, based on its name. Note that the table might not be in the active sheet.
Note also that this will only delete the table itself, but not the data inside.
DeleteAllTables​InSheet Removes all the tables in the active sheet. The contents are not removed, only the table itself.
PivotTableCount​InSheet Returns the number of pivot tables in the active sheet.
AddCustomXmlPart | Adds a custom XML part to the file, as described in https:​//​msdn.​microsoft.​com/​en-​us/​library/​bb608618.​aspx
GetCustomXmlPart | Returns the part at the given position. (1 based)
RemoveCustomXmlPart | Deletes the part at the given position. ( 1 based)
SetXmlMap Sets the XML Maps in the file. This is equivalent to going to the "Developer" tab in Excel and then clicking in Source in the XML section.

Set it to null to remove the XML Maps in the file.
GetXmlMap | Returns the XML Maps in the file if it has any, or null if there are no XML Maps. Note that the map returned is a copy, so modifying it won't modify the map in the file. To modify the map in the file you need to get it with ExcelFile.GetXmlMap, modify it, then set it with ExcelFile.SetXmlMap
GetFormulaTokens Returns the formula of a cell as an RPN list of tokens that you can use to analyze it. If the cell doesn't have a formula, then this method will return null.

Note that the result is an RPN expression, so for example the formula "= 1 * 2 + 3" would be returned as "1, 2, *, 3, +". While the formula "= 1 * (2 + 3)" would be returned as "1, 2, 3, +, *"

See Using Tokens for more information.
GetTokens Returns the tokens for a formula in text form. See ExcelFile.​Get​Formula​Tokens(​​Int32, Int32) for more information.
SetFormulaTokens | Sets a cell with the formula specified by its tokens. Normally you will get the tokens by modifying the result of ExcelFile.​Get​Formula​Tokens(​​Int32, Int32)
SetTokens | This method converts a list of tokens in the corresponding string. Normally you get the tokens from ExcelFile.GetTokens or ExcelFile.​Get​Formula​Tokens(​​Int32, Int32)

Properties

Name | Description
IsXltTemplate | Determines if the file is a template (xlt format instead of xls, xltx instead of xlsx, or xltm instead of xlsm). Both file formats are nearly identical, but there is an extra record needed so the file is a proper xlt template. Note that when saving to a file, FlexCel can detect if this is a template from the extension, and so if you save to *.xlt, *.xltx or *.xltm the file will be saved as template, even if this property is false. When saving to a stream, you need to set this property correctly because FlexCel can't guess it from the filename.
ActiveWindow | Gets or sets the active windows to which some sheet and workbook options like zoom will apply. (1 based) Note that spreadsheets normally have a single Window, so this value will most likely be 1 and should stay that way. If you are working with multiple spreadsheet windows, you can change this property to change the sheet options of a particular window. The properties that apply to a specific window and are affected by this property mention it on their docs.
WindowCount | Returns the number of windows in the file. Note that this isn't the sheet count, but the number of views of the workbook. Most Excel documents have only one window.
ActiveSheetFor​Active​Window | Gets or sets the active sheet for the ExcelFile.​Active​Window. Note that this won't change the active sheet for FlexCel when you enter a value, you still need to call ExcelFile.​Active​Sheet for that. This property will only change the sheet that is active in that window when you open the file in Excel. Setting this property will also unselect the other sheets. If you want to select multiple sheets, make sure to select them *after* setting the ActiveSheetFor​Active​Window.​
ExcelFileFormat | Empty files created by different versions of Excel can have different characteristics. For example, the default font in an Excel 2003 file is Arial, while the default in 2007 is Calibri, and in 2023 it is Aptos. This property returns the version of file that is loaded into FlexCel. When calling ExcelFile.​New​File(​​Int32, TExcelFileFormat) or when opening a new file, FlexCel will update the value of this property.
XlsxExtraCompatibility | By default, FlexCel creates xlsx files that conform to the published xlsx spec, but are not necessarily the same as a file Excel would create. FlexCel might use different prefixes, etc, as the ones Excel choose to use. While this is ok, some third party tools might have problems opening the xlsx files if they are not exactly as Excel would create them. If you are having issues with third party tools and the xlsx files created by FlexCel, you can try setting this property to true. Note: setting this property to true might result in files that contain invalid Ids, because the Ids are used by FlexCel and Excel. This is a very unlikely possibility, but the risk is there. If possible, it is best to keep this property false.
XlsxCompatibility​Convert​Indexed​Colors​ToRGB | By default, if an xls or xlsx file has indexed colors or if you set an indexed color with the FlexCelAPI, FlexCel will save those colors as indexed in the final file. This is correct and the default, but LibreOffice/​Open​Office at the time of this writing (version 6.2) won't understand indexed colors in xlsx files. So if you have xlsx files with indexed colors that you want to display correctly in Libre/OpenOffice, you must turn this property on.
StrictOpenXml | Read this file to know if the xlsx file loaded by FlexCel is a normal xlsx file or a "Strict Open XML file". Set this property to make FlexCel save as strict or normal open xlsx file. This property has no effect in xls files, only in xlsx. If you are not sure about what a strict open xml file is, just keep this property false and FlexCel will output normal xlsx files. IMPORTANT:FlexCel works by preserving a lot of stuff it doesn't know about, and that stuff might be valid in normal files and invalid in strict files or vice-versa. So if you open an strict file and save it as normal, or open a normal file and save it as strict, it might happen that FlexCel preserves some records or namespaces that are not allowed in the new format. Given this, you shouldn't use this property to change the type of existing files, except for simple files or files that you created yourself with...[more]
ActiveFileName | The file we are working on. When we save the file with another name, it changes. When we open a stream, it is set to "". This value is also used to get the text of Headers and Footers (when using the filename macro). When using the filename macro on headers/footers, make sure you set this value to what you want.
ActiveSheet | The Sheet where we are working on, 1-based(First sheet is 1, not 0). Always set this property before working on a file. You can read or write this value.
ActiveSheetByName | The sheet where we are working on, referred by name instead of by index. To change the active sheet name, use ExcelFile.SheetName
SheetCount | The number of sheets on the file.
SheetCountVisible | Number of visible sheets in the file.
SheetName | Reads and changes the name of the active sheet. To switch to another sheet by its name, use ExcelFile.​Active​Sheet​ByName
SheetCodeName | Returns or sets the codename of a sheet, that is an unique identifier assigned to the sheet when it is created. Codenames are useful because they never change once the file is created, and they are what macros reference. Very important! We don't support changing codenames if the file has macros, because we can't modify the required macros to use the modified codename. Also, Excel 2003 or older will ignore the codename if the file doesn't have macros. Excel 2007 or newer will preserve the codenames even if the file doesn't have macros. ...[more]
SheetID | Returns an unique identifier for the active sheet. This is a value that is only used by FlexCel, and you can use it together with ExcelFile.​Get​Sheet​Index​FromID to retrieve a sheet after deleting or adding sheets. While normally you can use ExcelFile.​Active​Sheet to store and retrieve a sheet, if you plan to delete or add sheets before restoring the active sheet, the stored ActiveSheet could become invalid....[more]
SheetVisible | Sets the visibility of the active sheet.
SheetZoom | Reads/Writes the zoom of the current sheet. Note that this property refers to the zoom in the current page view mode. If you are for example in Page Break Preview mode, this would be the zoom for Page Break Preview. You can change of page view mode and the zoom for all of the modes with ExcelFile.SheetView This property can work in different windows depending on the value of ExcelFile.​Active​Window ...[more]
FirstSheetVisible | This is the first sheet that will be visible in the bar of sheet tabs at the bottom. Normally you will want this to be 1. Note that every time you change ExcelFile.​Active​Sheet this value gets reset, because it makes no sense to preserve it. If you want to change it, change it before saving. The same way, to read it, read it just after opening the file. Please also note that if the first sheet you select is hidden, FlexCel will ignore this value and select a visible sheet. (otherwise Excel would crash) This property can work in different windows depending on the value of...[more]
SheetTabColor | Reads/Writes the color of the current sheet tab. TExcelColor.​Automatic to specify no color.
SheetView | Returns and sets the page view mode with their corresponding zooms. Note that changing the zoom here changes ExcelFile.SheetZoom This property can work in different windows depending on the value of ExcelFile.​Active​Window
SheetIsRightToLeft | If true then the sheet goes from right to left, with A1 starting at the top right of the page. You can also set this option with ExcelFile.​Sheet​Options
ShowGridLines | True if the gray grid lines are shown on the Active sheet. You can also set this option with ExcelFile.​Sheet​Options This property can work in different windows depending on the value of ExcelFile.​Active​Window
ShowGridHeadings | True is the column headings ("A", "B", etc) and row headings ("1", "2", etc) are shown. You can also set this option with ExcelFile.​Sheet​Options by changing TSheetOptions.​Show​RowAnd​Column​Headers This property can work in different windows depending on the value of ExcelFile.​Active​Window
ShowFormulaText | When true, the formula text will be displayed instead of the formula value. You can also set this option with ExcelFile.​Sheet​Options This property can work in different windows depending on the value of ExcelFile.​Active​Window
GridLinesColor | Color of the grid separator lines. This property can work in different windows depending on the value of ExcelFile.​Active​Window
HideZeroValues | When true number 0 will be shown as empty. You can also set this option with ExcelFile.​Sheet​Options This property can work in different windows depending on the value of ExcelFile.​Active​Window
SheetType | Use this property to know it the ExcelFile.​Active​Sheet is a worksheet, a chart sheet or other.
SheetOptions | This property groups a lot of properties of the sheet, like for example if it is showing formula texts or the results. Most of this properties can be changed directly from XlsFile, but this method allows you to change them all together, or to easily copy the options from one file to another. Look also at ExcelFile.​Sheet​Window​Options for options that affect all sheets. This property can work in different windows depending on the value of...[more]
SheetWindowOptions | This property groups a lot of properties of all the sheets in the workbook, like for example if the sheet tab bar at the bottom is visible. Look also at ExcelFile.​Sheet​Options for options that affect only the active sheet. This property can work in different windows depending on the value of ExcelFile.​Active​Window
HPageBreakCount | The number of horizontal page breaks in the active sheet.
VPageBreakCount | The number of vertical page breaks in the active sheet.
AllowEntering​Empty​Strings | By default, FlexCel won't allow you to enter empty or null strings into a cell; it will create a blank record instead. If for any reason you need to enter actual empty strings (which might be confusing to the Excel user) set this property to true.
AllowEntering​Unknown​Functions​AndNames | Whenever you try to use an unknown function in a formula, like "=MYFUNCTION()", FlexCel will raise an Exception. Same happens with unknown names. This is normally the expected behavior, so you don't enter a misspelled name by mistake, and you can add used defined function to FlexCel so it understands it. But in some cases, you might want to allow any function to be entered, no matter if is known or not: Excel behaves this way. For those cases, set this property to true. The unknown functions will return #NAME? as formula result.
FormatCount | Number of custom formats defined in all the file. When calling GetFormat(XF), 0<​=XF<​Format​Count.​
GetDefaultFont | Returns Excel standard font for an empty cell.
GetDefaultFont​Normal​Style | Returns Excel font for the "normal" style. This style is used to draw the row and column headings.
FontCount | Number of fonts defined in all the sheet. When calling GetFont(​font​Index)​, 0<​=font​Index<​Format​Count.​
ConditionalFormat​Count | Returns the number of conditional format blocks on the list. You can use this value to loop on them and retrieve the individual ones with ExcelFile.​Get​Conditional​Format
StyleCount | Returns the number of named styles in the file.
CellMergedListCount | For using with ExcelFile.​Cell​Merged​List on a loop: for (int i=1;i <= CellMergedList​Count;​i+​+​) DoSomething(​Cell​Merged​List(​i)​)​.​.​.​
RowCount | Number of rows actually used on the sheet.
ColCount | Number of columns actually used on the active sheet, including formatted columns. You will normally want to use ExcelFile.​Col​Count​Only​Data instead. Note that this method is slow as it needs to loop over all the rows to find out the biggest used column. Never use it in a loop like "for (int col = 1; col <= xls.ColCount; col++)". Instead try to use ExcelFile.​Col​Count​InRow(​​Int32) ...[more]
ColFormatCount | Returns the number of formatted columns in the file. Note that in xlsx files this number can be very big.
ColCountOnlyData | While ExcelFile.ColCount will return the maximum column including both data and formatted columns, this method doesn't include formatted columns, only cells with data, and it is normally what you need to use. Important: This method includes blank formatted cells. See The Maximum Used Column On A Sheet
DefaultRowHeight | The default height for empty rows, in Excel internal units. (1/20th of a point). IMPORTANT: For this property to have any effect, you also need to set ExcelFile.​Default​RowHeight​Automatic = false. To get the real default row height Excel will use when ExcelFile.​Default​RowHeight​Automatic = true or ExcelFile.​Default​RowHidden ...[more]
DefaultRowHeight​Automatic | When this property is true, the row height for empty rows is calculated with the height of the "Normal" font and will change if you change the Normal style. When false, the value in ExcelFile.​Default​RowHeight will be used.
DefaultRowHidden | When this property is true, rows with no data are hidden by default. Note that this property only affects the visibility of empty rows. If for example row 6 is empty and you have this property true, then row 6 will be hidden. But if you write any value in a cell in row 6, then the row won't be empty anymore, and it won't be hidden anymore either.
DefaultColWidth | The default width for empty columns, in Excel internal units. (Character width of font 0 / 256) See Excel Internal Units for more information in Excel internal units.
GetUsedPaletteColors | Returns a list of the used colors on the palette. You can use it as an entry to ExcelFile.​Nearest​Color​Index(​​TUIColor) to modify the palette.
NamedRangeCount | The count of all named ranges on the file.
PageHeader | Page header on the active sheet. Note that this property sets the same header for the all the pages. In Excel 2007 or newer you can set a different header for the first page, or odd/even pages. If you want to control these options, see ExcelFile.​Get​Page​Header​AndFooter and ExcelFile.​Set​Page​Header​AndFooter. A page header is a string that contains the text for the 3 parts of the header....[more]
PageFooter | Page footer on the active sheet. For a description on the format of the string, see ExcelFile.PageHeader
PrintGridLines | True if the gray grid lines are printed when printing the spreadsheet.
PrintHeadings | When true the row and column labels (A,B...etc for columns, 1,2... for rows) will be printed.
PrintHCentered | When true the sheet will print horizontally centered on the page.
PrintVCentered | When true the sheet will print vertically centered on the page.
PrintToFit | If true, sheet will be configured to fit on ExcelFile.​Print​Number​OfHorizontal​Pages x ExcelFile.​Print​Number​OfVertical​Pages.
PrintCopies | Number of copies to print.
PrintXResolution | Horizontal printer resolution on DPI.
PrintYResolution | Vertical printer resolution on DPI.
PrintOptions | All print options in a single place. You will normally want to set individual properties like ExcelFile.​Print​Landscape
PrintOptions​Initialized​From​Printer | If this property is false, then Excel has not read the printer options from the printer, and ExcelFile.​Print​Landscape, ExcelFile.​Print​Paper​Size, ExcelFile.PrintScale, ExcelFile.​Print​XResolution, ExcelFile.​Print​YResolution ...[more]
PrintLandscape | If true, page will be printed landscape, else portrait. This property modifies ExcelFile.​Print​Options
PrintBlackAndWhite | If true, page will be printed in "Excel Black and White". Important: This property doesn't mean that the file will be printed in black and white. Instead it means the option in the Page Setup dialog: https:​//​support.​microsoft.​com/​en-​us/​office/​page-​setup-​71c20d94-​b13e-​48fd-​9800-​cedd1fec6da3 Basically, when you select this option no background will be printed, and all foreground colors will be black. So if you have a cell with a black background and a white font, it will print as white background with a black font. ...[more]
PrintOverThenDown | If true, the pages will be printed to the right, then down. Otherwise pages will be printed down, then to the right. This property modifies ExcelFile.​Print​Options
PrintDraftQuality | If true, the pages will be printed in draft quality. This property modifies ExcelFile.​Print​Options
PrintScale | Percent to grow/shrink the sheet when printing. 100 means a page scale of 100%.
PrintFirstPageNumber | Page number that will be assigned to the first sheet when printing. (So it will show in page headers/footers). You might set this value to null to keep the page automatic. Also, the value returned here will be null it this value is not set (Set to Automatic)
PrintNumberOf​Horizontal​Pages | If set, the sheet will be printed on at most this number of horizontal pages. Use 0 to have unlimited horizontal pages while still limiting the vertical pages with ExcelFile.​Print​Number​OfVertical​Pages. (see 'Preparing for printing' in the Api Developer Guide)
PrintNumberOf​Vertical​Pages | If set, the sheet will be printed on at most this number of vertical pages. Use 0 to have unlimited vertical pages while still limiting the horizontal pages with ExcelFile.​Print​Number​OfHorizontal​Pages. (see 'Preparing for printing' in the Api Developer Guide)
PrintPaperSize | Pre-defined standard paper size. If you want to set up a printer specific paper size, see ExcelFile.​Set​Printer​Driver​Settings
PrintPaperDimensions | Returns the dimensions for the selected paper. See also ExcelFile.​Print​Paper​Size.
PrintErrors | Determines how the errors will be printed.
PrintComments | Determines how the comments will be printed.
ImageCount | The number of images in the active sheet.
ObjectCount | Count of all graphical objects on the sheet. They can be charts, images, shapes, etc.
DataValidationCount | Returns the number of DataValidation structures in the active sheet. There are 2 ways you can access the data validation information on a sheet:...[more]
HyperLinkCount | The count of hyperlinks on the active sheet
OutlineSummary​Rows​Below​Detail | Determines whether the summary rows should be below or above details on outline.
OutlineSummary​Cols​Right​ToDetail | Determines whether the summary columns should be right to or left to the details on outline.
OutlineAutomatic​Styles | This handles the setting of Automatic Styles inside the outline options.
ChartCount | Returns the count of charts on this sheet. Please take note that this method will not return the number of embedded objects with charts inside in a sheet, but just the number of charts in the sheet. In simpler terms, this method will return 0 for all worksheets, and 1 for all chart sheets. This is not a very useful method, but it needs to be this way to be consistent with ExcelFile.GetChart. So, looping like this:...[more]
OptionsDates1904 | Excel has 2 different date systems. On windows systems it uses 1900 based dates, and on old Macintosh systems it uses 1904 dates. You can change this on Excel under Options, and this property allows you to know and change which format is being used. See https:​//​support.​microsoft.​com/​en-​us/​help/​214330/​differences-​between-​the-​1900-​and-​the-​1904-​date-​system-​in-​excel
OptionsR1C1 | Use this property to change the reference system used in the file. Note that this option only changes how Excel and FlexCel will display the file. Internally, the formulas will always be stored in A1 format, and converted by Excel to and from R1C1 if this property is true. FlexCel will also use this property to render the file when it is set to print formulas. Also, this property doesn't change how FlexCel will parse or return the formula text in the cells or names. By default, even if this property is true, you will need to enter the formulas in FlexCel in A1 mode. To change the entry mode in FlexCel, please use...[more]
OptionsSaveExternal​Link​Values | This property has the value of the corresponding option on Excel options.
OptionsPrecision​AsDisplayed | This property has the value of the corresponding option on Excel options.
OptionsMultithread​Recalc | Number of threads that can be used at the same time by Excel when recalculating. Set it to 0 to disable multithread recalculation, and to -1 to let Excel decide the best number of threads to use. The maximum value for this property is 1024. This option only applies to Excel 2007 or newer.
OptionsForce​Full​Recalc | If true, Excel will do full recalculations of the spreadsheet when you change a cell. If false, only the cells that depend on the cell being changed will be recalculated. This option only applies to Excel 2007 or newer.
OptionsFullRecalc​OnLoad | This property tells you if the open file wasn't recalculated when saved. If true, the workbook doesn't have recalculated values and will be recalculated when open in Excel. This option only applies to xlsx files. Note that if you open a file which has FullRecalcOnLoad = true in FlexCel, recalculate it and save it, FlexCel will save the file with FullRecalcOnLoad = false. To change what FlexCel writes in FullRecalcOnLoad when saving, change ExcelFile.​Options​Full​Recalc​OnLoad​Mode ...[more]
OptionsFullRecalc​OnLoad​Mode | Defines how FlexCel will identify the files it creates to be calculated by Excel when it opens them.
OptionsRecalc​Circular​References | If true, Excel and FlexCel will do iterative calculating over cells with circular references, until ExcelFile.​Options​Recalc​MaxIterations is reached or the difference is less than ExcelFile.​Options​Recalc​MaxChange
OptionsRecalc​MaxIterations | Maximum number of iterations when calculating circular references (ExcelFile.​Options​Recalc​Circular​References is true),
OptionsRecalc​MaxChange | Maximum difference between 2 iterations when calculating circular references (ExcelFile.​Options​Recalc​Circular​References is true),
OptionsAutoCompress​Pictures | If true, Excel will try to compress the pictures to keep sizes down. This option only applies to Excel 2007 or newer.
OptionsForce​UseCheck​Compatibility | When the option ExcelFile.​Options​Check​Compatibility is true, Excel will refuse to austosave the file. To avoid a confusing situation where Excel refuses to autosave the file and shows a vague warning about an "older file format", ExcelFile.​Options​Check​Compatibility is ignored by FlexCel. In order to force FlexCel to save ExcelFile.​Options​Check​Compatibility ...[more]
OptionsCheck​Compatibility | Whether the "Check for compatibility" dialog will pop up when saving as xls in Excel 2007 or newer. This option only applies to Excel 2007 or newer. Important: When this option is true, Excel will refuse to enable "Autosave" and upload the files to OneDrive (Autosave is the first option in the title bar in Excel 2019). If true, you will get a message: "How do I turn on Autosave? Before Autosave can save your file, you need to fix the following: This file was created in an older file format. Please select File > Save As to update the file format."...[more]
OptionsBackup | Defines whether to save a backup copy of the workbook or not.
OptionsRecalcMode | Reads and writes the recalculating options in the file. Note that this only affects the file and how Excel will recalculate, not how FlexCel does its recalculation. FlexCel ignores this setting and uses ExcelFile.RecalcMode instead.
RecalcMode | Set this property to change how the file will be recalculated. Note that this affects only how FlexCel recalculates the file, but not how Excel will recalculate it. It doesn't change anything in the generated file. To change the options for the file, use ExcelFile.​Options​Recalc​Mode instead.
RecalcVersion | Defines which version of Excel recalculation engine will be saved in the file. This affects how Excel will recalculate the file on open. If you set this property for example to Excel2007, then any Excel version newer than Excel 2007 will recalculate all formulas when you load the file, so it will modify the workbook and will ask for saving changes when closing. Even if you just open and close the file. Note that this will only happen if there are formulas on the sheet. If there are any formulas that FlexCel can't recalculate, you should set this property to AlwaysRecalc. For example, if you have the formula:...[more] ...[more]
NeedsRecalc | Internal use.
Recalculating | Internal use.
LinkCount | Returns the number of external links for the file. You can access those links with ExcelFile.GetLink and ExcelFile.SetLink
HeightCorrection | Factor to multiply default row heights. See remarks for a detailed explanation.
FileFormatWhenOpened | Returns the file format that the file had when it was opened. If the file was created with ExcelFile.NewFile, the file format when opened is xls.
Linespacing | A Linespacing of 1 means use the standard GDI+ linespace when a cell has more than one line. A linespace of 2 would mean double linespacing, and 0.5 would mean half linespacing. Normally linespacing in Excel is a little bigger than linespacing in GDI+, so you can use this property to fine tune what you need. This property doesn't alter the Excel file in any way. It is only used when rendering.
WidthCorrection | Factor to multiply default column widths. See remarks for a detailed explanation.
CellMarginFactor | This property can be used to add a margin to the cells when rendering, so text is rendered smaller and can have more line breaks. The default value of 1.0 means normal cells. The bigger this value, the bigger the margins and the smaller the real cell width for rendering the text. You might want to make this value a little larger than 1 if autofitting and Excel is wrapping text that FlexCel fits into one line.
CellIndentation​Rendering | Excel doesn't adapt the cell indentation when changing the print scale. This means that if a cell indentation is 0.1 inches at 100% print scale, it will also be 0.1 inches at 50% print scale. This will break the layout of your files when changing the print scaling, and so by default FlexCel won't behave like Excel here and make the indentation half the size if printing at half the scale. If you want to mimic the exact Excel behavior, set this property to true. See 'Cell indentation' in the Api Developer Guide ...[more]
HeadingColWidth | Width that will be used by the added column with row numbers when ExcelFile.​Print​Headings is true. The default value (0) means to use an automatic value which is fine if you don't have too many rows to print. A positive value will make the column wider or narrower. A negative value will auto-calculate the width depending in the number of rows and normal font of the spreadsheet.
HeadingRowHeight | Height that will be used by the added row with column headers when ExcelFile.​Print​Headings is true. The default value (0) means to use an automatic value which is fine with normal fonts. A positive value will make the column wider or narrower.A negative value will auto-calculate the height depending in the normal font of the spreadsheet.
ScreenScaling | This property lets you specify the screen scaling that FlexCel will assume for reading xlsx files in percent. (default is 100 which means 100%). The values can be between 100 and 500. Column widths in xlsx files which don't have a fixed column width set will be different in different screen resolutions. So we need to know which resolution to emulate in order to read those files correctly. You will probably want to leave this property to the default value of 100, but you can change it if needed. ...[more]
CustomTableStyle​Count | Returns the number of custom tables styles defined in the workbook.
TableCountInWorkbook | Returns the number of tables in the whole workbook. (Not just the active sheet)
TableCountInSheet | Returns the number of tables in the active sheet. Use ExcelFile.​Get​Table(​​Int32) to retrieve the tables in the sheet.
CustomXmlPartCount | Returns the number of custom xml parts in the active document.


XlsFile.XlsFile Constructor | FlexCel Studio for the .NET Framework documentation

XlsFile.XlsFile Constructor

Overloads

  • XlsFile.XlsFile
  • XlsFile.XlsFile(Boolean)
  • XlsFile.XlsFile(String)
  • XlsFile.XlsFile(String, Boolean)
  • XlsFile.XlsFile(Int32, Boolean)
  • XlsFile.XlsFile(Stream, Boolean)
  • XlsFile.XlsFile(Int32, TExcelFileFormat, Boolean)

XlsFile.XlsFile

Creates a new XlsFile. After creating an XlsFile with this constructor, you need to either open or create a new file.

Syntax

Namespace: FlexCel.XlsAdapter

public XlsFile()

See also

  • XlsFile

XlsFile.XlsFile(Boolean)

Creates a new XlsFile and sets the desired Overwriting mode for files. After creating an XlsFile with this constructor, you need to either open or create a new file.

Syntax

Namespace: FlexCel.XlsAdapter

public XlsFile(Boolean aAllowOverwritingFiles)

Parameters

<-> | Parameter | Type | Description
 | aAllowOverwritingFiles | Boolean | When true calling "Save" will overwrite existing files. See ExcelFile.AllowOverwritingFiles

See also

  • XlsFile

XlsFile.XlsFile(String)

Creates a new XlsFile and opens the desired file.

Syntax

Namespace: FlexCel.XlsAdapter

public XlsFile(String aFileName)

Parameters

<-> | Parameter | Type | Description
 | aFileName | String | Name of the file to open.

See also

  • XlsFile

XlsFile.XlsFile(String, Boolean)

Creates a new XlsFile and opens the desired file. Sets the desired Overwriting mode for files.

Syntax

Namespace: FlexCel.XlsAdapter

public XlsFile(String aFileName, Boolean aAllowOverwritingFiles)

Parameters

<-> | Parameter | Type | Description
 | aFileName | String | Name of the file to open.
 | aAllowOverwritingFiles | Boolean | When true calling "Save" will overwrite existing files. See ExcelFile.AllowOverwritingFiles

See also

  • XlsFile

XlsFile.XlsFile(Int32, Boolean)

Creates a new XlsFile and creates a new empty file with the desired number of sheets.

Syntax

Namespace: FlexCel.XlsAdapter

public XlsFile(Int32 aSheetCount, Boolean aAllowOverwritingFiles)

Parameters

<-> | Parameter | Type | Description
 | aSheetCount | Int32 | Number of sheets for the new empty file.
 | aAllowOverwritingFiles | Boolean | When true calling "Save" will overwrite existing files. See ExcelFile.AllowOverwritingFiles

See also

  • XlsFile

XlsFile.XlsFile(Stream, Boolean)

Creates a new XlsFile and opens the desired file from a stream. Sets the desired Overwriting mode for files.

Syntax

Namespace: FlexCel.XlsAdapter

public XlsFile(Stream aStream, Boolean aAllowOverwritingFiles)

Parameters

<-> | Parameter | Type | Description
 | aStream | Stream | Stream with the file to open.
 | aAllowOverwritingFiles | Boolean | When true calling "Save" will overwrite existing files. See ExcelFile.AllowOverwritingFiles

See also

  • XlsFile

XlsFile.XlsFile(Int32, TExcelFileFormat, Boolean)

Creates a new XlsFile and creates a new empty file with the desired number of sheets and file format.

Syntax

Namespace: FlexCel.XlsAdapter

public XlsFile(Int32 aSheetCount, TExcelFileFormat aFileFormat, Boolean aAllowOverwritingFiles)

Parameters

<-> | Parameter | Type | Description
 | aSheetCount | Int32 | Number of sheets for the new empty file.
 | aFileFormat | TExcelFileFormat | Version of Excel used to create the new file. Different version can have different default fonts, column widths, etc.
 | aAllowOverwritingFiles | Boolean | When true calling "Save" will overwrite existing files. See ExcelFile.AllowOverwritingFiles

See also

  • XlsFile


XlsFile.AddWindow Method | FlexCel Studio for the .NET Framework documentation

XlsFile.AddWindow Method

Adds a new window to the file. Note that this isn't a new sheet, but another view of the workbook. Most Excel documents have only one window.

Syntax

Namespace: FlexCel.XlsAdapter

public override void AddWindow()

See also

  • XlsFile


XlsFile.DeleteWindow Method | FlexCel Studio for the .NET Framework documentation

XlsFile.DeleteWindow Method

Deletes a window from the file. Note that this isn't a sheet, but another view of the workbook. Most Excel documents have only one window.

Syntax

Namespace: FlexCel.XlsAdapter

public override void DeleteWindow(Int32 windowIndex)

Parameters

<-> | Parameter | Type | Description
 | windowIndex | Int32 | Index of the window to delete (1-based)

See also

  • XlsFile


XlsFile.GetBuiltInFormat Method | FlexCel Studio for the .NET Framework documentation

XlsFile.GetBuiltInFormat Method

Returns one of the 49 built in formats Excel supports. For more information see SetBuiltInFormat

Syntax

Namespace: FlexCel.XlsAdapter

public static String GetBuiltInFormat(Int32 formatIndex)

Parameters

<-> | Parameter | Type | Description
 | formatIndex | Int32 | Index of the format we want to retrieve.

See also

  • XlsFile


XlsFile.SetBuiltInFormat Method | FlexCel Studio for the .NET Framework documentation

XlsFile.SetBuiltInFormat Method

Excel has 49 predefined formats which aren't stored in the xls/x file, only the format id is stored.

When opening the file in Excel, the cells formatted with those internal formats will be formatted according to the language and version of Excel, not all of them return the same. For example, some Excel versions will display format 38 as "#,##0 ;[Red](#,##0) " (negative numbers in parenthesis) while others will display the same format 38 as "#,##0 _$;[Red]-#,##0 _$" (negative numbers have "-" sign).

FlexCel by default comes with the following formats defined, which correspond to an English Excel 2010:

ID | Format code
1 | 0
2 | 0.00
3 | #,##0
4 | #,##0.00
9 | 0%
10 | 0.00%
11 | 0.00E+00
12 | # ?/?
13 | # ??/??
14 | Value read from the Windows Settings, and corresponds to formats marked with an "*" in Excel. It is something like "mm/dd/yyyy" or "dd/mm/yyyy" depending on your Windows locale. You can't change this value from here, as it is automatically generated from your Windows settings. If you want to change it, change the Locale of your app instead.
15 | d-mmm-yy
16 | d-mmm
17 | mmm-yy
18 | h:mm AM/PM
19 | h:mm:ss AM/PM
20 | h:mm
21 | h:mm:ss
22 | Value read from the Windows Settings, and corresponds to formats marked with an "*" in Excel. It is something like "mm/dd/yyyy h:mm" or "dd/mm/yyyy h:mm" depending on your Windows locale. You can't change this value from here, as it is automatically generated from your Windows settings. If you want to change it, change the Locale of your app instead.
37 | #,##0 _$;-#,##0 _$
38 | #,##0 _$;[Red]-#,##0 _$
39 | #,##0.00 _$;-#,##0.00 _$
40 | #,##0.00 _$;[Red]-#,##0.00 _$
45 | mm:ss
46 | [h]:mm:ss
47 | mmss.0
48 | ##0.0E+0

When you export to pdf/html, print, or render the spreadsheet in any way, FlexCel will use the formats above to display the cells with those built in ids. If you want to make FlexCel behave like a different Excel version or language, you might change those values.

Note that in general, if you care about the cell formats looking the same in all Excel versions, you should avoid using built in formats. While changing this array will change how FlexCel renders those formats, a user with a different Excel version will still see whatever that Excel version defines for the format id.

This method doesn't change anything in the generated xls/x files, it will only change how the generated pdf/html files look. This method also affects all threads and XlsFile objects, it is a global setting which you probably shouldn't change; but if you want to change it, you should do so when starting your application.

Syntax

Namespace: FlexCel.XlsAdapter

public static void SetBuiltInFormat(Int32 formatIndex, String format)

Parameters

<-> | Parameter | Type | Description
 | formatIndex | Int32 | Format index to modify. Must be one of the formats in the table above.
 | format | String | String specifying the format you want to use with the built in format index.

See also

  • XlsFile


XlsFile.NewFile Method | FlexCel Studio for the .NET Framework documentation

XlsFile.NewFile Method

Creates a new empty file, with the specified number of sheets.

Remarks

The file created will have empty properties, (author, description, etc). If you want to create a more personalized file when you call NewFile (for example with a given Author, or the sheets names on your language), there are 2 options:

  1. Don't use NewFile, but open an existing file you can modify.
  2. Or, you can replace the files "EmptyWorkbook.xls", "EmptyWorkbook2007.xls" and "EmptyWorkbook2010.xls" (on xlsadapter folder) with your own and recompile.

Syntax

Namespace: FlexCel.XlsAdapter

public override void NewFile(Int32 aSheetCount, TExcelFileFormat fileFormat)

Parameters

<-> | Parameter | Type | Description
 | aSheetCount | Int32 | Number of sheets for the new file.
 | fileFormat | TExcelFileFormat | Different Excel versions save different empty files. By default, FlexCel will create a new file that looks like a file created by Excel 2003, but you can change the version of the new file created with this parameter.

See also

  • XlsFile


XlsFile.NewFileStatic Method | FlexCel Studio for the .NET Framework documentation

XlsFile.NewFileStatic Method

This method creates a new file in without virtual calls, so it can be called from a constructor.

Syntax

Namespace: FlexCel.XlsAdapter

protected void NewFileStatic(Int32 aSheetCount, TExcelFileFormat fileFormat)

Parameters

<-> | Parameter | Type | Description
 | aSheetCount | Int32 |
 | fileFormat | TExcelFileFormat |

See also

  • XlsFile


XlsFile.Open Method | FlexCel Studio for the .NET Framework documentation

XlsFile.Open Method

Overloads

  • XlsFile.Open(String, TFileFormats, Char, Int32, Int32, ColumnImportType[], String[], Encoding, Boolean)
  • XlsFile.Open(Stream, TFileFormats, Char, Int32, Int32, ColumnImportType[], String[], Encoding, Boolean)

XlsFile.Open(String, TFileFormats, Char, Int32, Int32, ColumnImportType[], String[], Encoding, Boolean)

Loads a new Spreadsheet from disk, on one of the specified formats.

Syntax

Namespace: FlexCel.XlsAdapter

public override void Open(String fileName, TFileFormats fileFormat, Char delimiter, Int32 firstRow, Int32 firstCol, ColumnImportType[] columnFormats, String[] dateFormats, Encoding fileEncoding, Boolean detectEncodingFromByteOrderMarks)

Parameters

<-> | Parameter | Type | Description
 | fileName | String | File to open
 | fileFormat | TFileFormats | List with possible file formats to try
 | delimiter | Char | Delimiter used to separate columns, if the format is TFileFormats.Text
 | firstRow | Int32 | First row where we will copy the cells on the new sheet, for TFileFormats.Text
 | firstCol | Int32 | First column where we will copy the cells on the new sheet, for TFileFormats.Text
 | columnFormats | ColumnImportType[] | An array of ColumnImportType elements, telling how each column should be imported.
 | dateFormats | String[] | A list of formats allowed for dates and times, when opening text files. Windows is a little liberal in what it thinks can be a date, and it can convert things like "1.2" into dates. By setting this property, you can ensure the dates are only in the formats you expect. If you leave it null, we will trust "DateTime.TryParse" to guess the correct values. This value has no meaning in normal xls files, only text files.
 | fileEncoding | Encoding | Encoding used by the file we are reading, when opening a Text-delimited file (csv or txt). If you specify an encoding for xls95 files, it will overwrite the default encoding specified in the file, and this can be used to read buggy or corrupted xls95 files. But in general for xls95 you should keep this parameter null. This parameter has no effect on xls 97 files or xlsx. If null when reading text files, it is assumed to be Encoding.UTF8.
 | detectEncodingFromByteOrderMarks | Boolean | This parameter only applies when reading Text files. It is the same on the constructor of a StreamReader, and it says if BOM must be used at the beginning of the file. It defaults to true.

See also

  • XlsFile

XlsFile.Open(Stream, TFileFormats, Char, Int32, Int32, ColumnImportType[], String[], Encoding, Boolean)

Loads a new Spreadsheet from a stream, on one of the specified formats.

Syntax

Namespace: FlexCel.XlsAdapter

public override void Open(Stream aStream, TFileFormats fileFormat, Char delimiter, Int32 firstRow, Int32 firstCol, ColumnImportType[] columnFormats, String[] dateFormats, Encoding fileEncoding, Boolean detectEncodingFromByteOrderMarks)

Parameters

<-> | Parameter | Type | Description
 | aStream | Stream | Stream to open, must be a seekable stream. Verify it is on the correct position.
 | fileFormat | TFileFormats | List with possible file formats to try.
 | delimiter | Char | Delimiter used to separate columns, if the format is TFileFormats.Text
 | firstRow | Int32 | First row where we will copy the cells on the new sheet, for TFileFormats.Text
 | firstCol | Int32 | First column where we will copy the cells on the new sheet, for TFileFormats.Text
 | columnFormats | ColumnImportType[] | An array of ColumnImportType elements, telling how each column should be imported. See the example for more information on how to use it.
 | dateFormats | String[] | A list of formats allowed for dates and times, when opening text files. Windows is a little liberal in what it thinks can be a date, and it can convert things like "1.2" into dates. By setting this property, you can ensure the dates are only in the formats you expect. If you leave it null, we will trust "DateTime.TryParse" to guess the correct values. This value has no meaning in normal xls files, only text files.
 | fileEncoding | Encoding | Encoding used by the file we are reading, when opening a Text-delimited file (csv or txt). If you specify an encoding for xls95 files, it will overwrite the default encoding specified in the file, and this can be used to read buggy or corrupted xls95 files. But in general for xls95 you should keep this parameter null. This parameter has no effect on xls 97 files or xlsx. If null when reading text files, it is assumed to be Encoding.UTF8.
 | detectEncodingFromByteOrderMarks | Boolean | This parameter only applies when reading Text files. It is the same on the constructor of a StreamReader, and it says if BOM must be used at the beginning of the file. It defaults to true.

Examples

Imagine you have a file with 20 columns, and column 2 has numbers you want to be imported as text (like phone numbers), and you don't want to import column 10.

You can use the following code to do it:

    ColumnImportType[] ColTypes = new ColumnImportType[10]; //You just need to define 10 items, all other columns after 10 will be imported with default formatting.
    ColTypes[1] = ColumnImportType.Text; //Import whatever is in column 2 as text.
    ColTypes[9] = ColumnImportType.Skip; //don't import column 10.

    ExcelFile xls = new XlsFile(true); //Create a new file.
    xls.Open("csv.csv", TFileFormats.Text, ',', 1, 1, ColTypes); //Import the csv text.

See also

  • XlsFile


XlsFile.Import Method | FlexCel Studio for the .NET Framework documentation

XlsFile.Import Method

Overloads

  • XlsFile.Import(TextReader, Int32, Int32, Int32[], ColumnImportType[], String[])
  • XlsFile.Import(TextReader, Int32, Int32, Char, Char, ColumnImportType[], String[])

XlsFile.Import(TextReader, Int32, Int32, Int32[], ColumnImportType[], String[])

Imports a text file (fixed length columns) into the current sheet. Note that this method won't clear any existing data.

Syntax

Namespace: FlexCel.XlsAdapter

public override void Import(TextReader aTextReader, Int32 firstRow, Int32 firstCol, Int32[] columnWidths, ColumnImportType[] columnFormats, String[] dateFormats)

Parameters

<-> | Parameter | Type | Description
 | aTextReader | TextReader | StreamReader with the text to import.
 | firstRow | Int32 | Row in the Active sheet where we will start importing the text file.
 | firstCol | Int32 | Column in the Active sheet where we will start importing the text file.
 | columnWidths | Int32[] | An array with the column widths for every column you want to import.
 | columnFormats | ColumnImportType[] | An array of ColumnImportType elements, telling how each column should be imported. See the example in ExcelFile.Open(Stream, TFileFormats, Char, Int32, Int32, ColumnImportType[]) for more information on how to use it.
 | dateFormats | String[] | A list of formats allowed for dates and times, when opening text files. Windows is a little liberal in what it thinks can be a date, and it can convert things like "1.2" into dates. By setting this property, you can ensure the dates are only in the formats you expect. If you leave it null, we will trust "DateTime.TryParse" to guess the correct values. This value has no meaning in normal xls files, only text files.

See also

  • XlsFile

XlsFile.Import(TextReader, Int32, Int32, Char, Char, ColumnImportType[], String[])

Imports a text file (character-delimited columns) into the current sheet. Note that this method won't clear any existing data.

Syntax

Namespace: FlexCel.XlsAdapter

public override void Import(TextReader aTextReader, Int32 firstRow, Int32 firstCol, Char delimiter, Char textQualifier, ColumnImportType[] columnFormats, String[] dateFormats)

Parameters

<-> | Parameter | Type | Description
 | aTextReader | TextReader | TextReader with the text to import.
 | firstRow | Int32 | Row in the Active sheet where we will start importing the text file.
 | firstCol | Int32 | Column in the Active sheet where we will start importing the text file.
 | delimiter | Char | Character used to separate columns.
 | textQualifier | Char | Character used to quote strings when they contain the delimiter. This is normally the double quote (") but you might change it by a single quote or any other character. Use a char 0 if the original file isn't quoted.
 | columnFormats | ColumnImportType[] | An array of ColumnImportType elements, telling how each column should be imported. See the example in ExcelFile.Open(Stream, TFileFormats, Char, Int32, Int32, ColumnImportType[]) for more information on how to use it.
 | dateFormats | String[] | A list of formats allowed for dates and times, when opening text files. Windows is a little liberal in what it thinks can be a date, and it can convert things like "1.2" into dates. By setting this property, you can ensure the dates are only in the formats you expect. If you leave it null, we will trust "DateTime.TryParse" to guess the correct values. This value has no meaning in normal xls files, only text files.

See also

  • XlsFile


XlsFile.Save Method | FlexCel Studio for the .NET Framework documentation

XlsFile.Save Method

Overloads

  • XlsFile.Save(String, TFileFormats, Char, Encoding)
  • XlsFile.Save(Stream, TFileFormats, Char, Encoding)

XlsFile.Save(String, TFileFormats, Char, Encoding)

Saves the file to a disk.

Syntax

Namespace: FlexCel.XlsAdapter

public override void Save(String fileName, TFileFormats fileFormat, Char delimiter, Encoding fileEncoding)

Parameters

<-> | Parameter | Type | Description
 | fileName | String | File to save. If ExcelFile.AllowOverwritingFiles is false, then fileName MUST NOT exist.
 | fileFormat | TFileFormats | File format. Automatic will try to guess it from the filename, if present.
 | delimiter | Char | Delimiter to use if FileFormat is TFileFormats.Text
 | fileEncoding | Encoding | Encoding for the generated file, when writing a Text-delimited file (csv or txt). This parameter has no effect on xls/x files. If omitted, new UTF8Encoding(false) will be used. Note that to create a file with BOM (byte order marker) you need to specify an encoding here, the same as you do with a StreamWriter.

See also

  • XlsFile

XlsFile.Save(Stream, TFileFormats, Char, Encoding)

Saves the file to a stream.

Syntax

Namespace: FlexCel.XlsAdapter

public override void Save(Stream aStream, TFileFormats fileFormat, Char delimiter, Encoding fileEncoding)

Parameters

<-> | Parameter | Type | Description
 | aStream | Stream | Stream where to save the file. Must be a seekable stream.
 | fileFormat | TFileFormats | File format. Automatic will try to guess it from the filename, if present.
 | delimiter | Char | Delimiter to use if FileFormat is TFileFormats.Text
 | fileEncoding | Encoding | Encoding for the generated file, when writing a Text-delimited file (csv or txt). This parameter has no effect on xls files. If omitted, new UTF8Encoding(false) will be used. Note that to create a file with BOM (byte order marker) you need to specify an encoding here, the same as you do with a StreamWriter.

See also

  • XlsFile


XlsFile.SaveForHashing Method | FlexCel Studio for the .NET Framework documentation

XlsFile.SaveForHashing Method

This method will save the file in a format that will remain the same if the file is not modified. Normal xls files contain TimeStamp fields that might be modified when the file is downloaded or just copied.

While you will not be able to load the file saved, you might use this method to create a hash of a file and compare it to others to know if something changed.

Remarks

This method will not save the file in any readable format, and the file format might change between FlexCel versions. The only thing it guarantees is that the hashes for 2 identical xls files will be the same, for the same FlexCel version. Once you upgrade version, hashes might have to be rebuilt.

Also note that this method is useful to detect changes when the file is not edited in Excel. If you open the file in Excel and save it again, Excel will change a lot of reserved bits, and the files will be too different for this method to have the same hashes. This is only to detect changes when copying or downloading an xls file. If you want to compare just cell contents, you might compare the files saved as CSV.

Syntax

Namespace: FlexCel.XlsAdapter

public override void SaveForHashing(Stream aStream, TExcludedRecords excludedRecords)

Parameters

<-> | Parameter | Type | Description
 | aStream | Stream | Stream where the file will be saved. You will probably want to hash this stream to store the corresponding hash.
 | excludedRecords | TExcludedRecords | A list with all the records you don't wish to include in the saved file (like for example cell selection). You will normally will want to specify TExcludedRecords.All here, but you can OR different members of the TExcludedRecords enumerations for more control on what is saved.

Examples

The following method will calculate the hash for an existing file:

    static byte[] GetHash(string FileName)
    {
        XlsFile xls = new XlsFile(FileName);
        using (System.Security.Cryptography.SHA256CryptoServiceProvider hasher = new System.Security.Cryptography.SHA256CryptoServiceProvider())
        {
            using (MemoryStream ms = new MemoryStream())
            {
                xls.SaveForHashing(ms); //Save the file in a format without timestamps
                                        //or other data that might change from save to save.
                                        //Note that the saved file is invalid, but we only care about its hash.
                ms.Position = 0;
                return hasher.ComputeHash(ms); //Compute the hash of the file.
            }
        }
    }

See also

  • XlsFile


XlsFile.Export Method | FlexCel Studio for the .NET Framework documentation

XlsFile.Export Method

Overloads

  • XlsFile.Export(TextWriter, TXlsCellRange, Char, Boolean, String)
  • XlsFile.Export(TextWriter, TXlsCellRange, Int32, Int32[], Boolean, Boolean, String)

XlsFile.Export(TextWriter, TXlsCellRange, Char, Boolean, String)

Exports a range of cells from the active sheet into a text file (character delimited columns).

Syntax

Namespace: FlexCel.XlsAdapter

public override void Export(TextWriter aTextWriter, TXlsCellRange range, Char delimiter, Boolean exportHiddenRowsOrColumns, String newLine)

Parameters

<-> | Parameter | Type | Description
 | aTextWriter | TextWriter | TextWriter where we want to save the file.
 | range | TXlsCellRange | Range of cells to export. If you want to export the full sheet, set it to null.
 | delimiter | Char | Character used to delimit the fields in the exported file. You might normally use a comma (',') or a tab here.
 | exportHiddenRowsOrColumns | Boolean | If true, hidden rows and columns will be exported. If false, they will be ignored.
 | newLine | String | String used to separate lines. If not specified, this will be the string used in the OS.

See also

  • XlsFile

XlsFile.Export(TextWriter, TXlsCellRange, Int32, Int32[], Boolean, Boolean, String)

Exports a range of cells from the active sheet into a text file (fixed length columns).

Syntax

Namespace: FlexCel.XlsAdapter

public override void Export(TextWriter aTextWriter, TXlsCellRange range, Int32 charactersForFirstColumn, Int32[] columnWidths, Boolean exportHiddenRowsOrColumns, Boolean exportTextOutsideCells, String newLine)

Parameters

<-> | Parameter | Type | Description
 | aTextWriter | TextWriter | TextWriter where we want to save the file.
 | range | TXlsCellRange | Range of cells to export. If you want to export the full sheet, set it to null.
 | charactersForFirstColumn | Int32 | This value only has effect if columnWidths is null. It will specify how many characters to use for the first column, and all other columns will be determined according to their ratio with the first. For example, if the first column is 150 pixels wide and you specify "8" for this parameter, the first column will be padded to 8 characters when exporting. If the second column is 300 pixels wide, then it will be padded to 16 characters and so on. As this might not be 100% exact and depend in pixel measurements, you might want to specify columnWidths parameter instead of using this one. Note: Setting this parameter to a negative value will assume the text in the columns is already padded, and won't attempt to do any padding. Use this value if your data is padded in the spreadsheet itself.
 | columnWidths | Int32[] | Array with the number of characters that will be assigned to every column when exporting. Supplying this array allows you to specify exactly how many characters you want for every field, and that might be really necessary to interop with other applications. But you can also leave this parameter null and specify "charactersForFirstColumn" to let FlexCel calculate how many characters to apply for every field.
 | exportHiddenRowsOrColumns | Boolean | If true, hidden rows and columns will be exported. If false, they will be ignored.
 | exportTextOutsideCells | Boolean | If true and the cell text spans over more than one empty cell to the right, that text will be exported. When false (the default) only text that fits in the cell will be exported. When this value is true the printout will look better, but it will not be possible to reimport the data as the columns are lost.
 | newLine | String | String used to separate lines in the output. If omitted, we will use the OS new line separator.

See also

  • XlsFile


XlsFile.GetSheetIndex Method | FlexCel Studio for the .NET Framework documentation

XlsFile.GetSheetIndex Method

Finds a sheet name on the workbook and returns its index. Depending on the "throwException" parameter, this method will raise an exception or return -1 if the sheet does not exist. To change the active sheet by the name, use ExcelFile.ActiveSheetByName. See also ExcelFile.GetSheetName

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 GetSheetIndex(String sheetName, Boolean throwException)

Parameters

<-> | Parameter | Type | Description
 | sheetName | String | Sheet you want to find.
 | throwException | Boolean | When sheetName does not exist, having throwException = true will raise an Exception. throwException = false will return -1 if the sheet is not found.

See also

  • XlsFile


XlsFile.GetSheetName Method | FlexCel Studio for the .NET Framework documentation

XlsFile.GetSheetName Method

Returns the sheet name for a given index. To change the active sheet by the name, use ExcelFile.ActiveSheetByName. See also ExcelFile.GetSheetIndex(String)

Syntax

Namespace: FlexCel.XlsAdapter

public override String GetSheetName(Int32 sheetIndex)

Parameters

<-> | Parameter | Type | Description
 | sheetIndex | Int32 |

See also

  • XlsFile


XlsFile.GetSheetIndexFromID Method | FlexCel Studio for the .NET Framework documentation

XlsFile.GetSheetIndexFromID Method

Returns the ActiveSheet for a stored ExcelFile.SheetID. You can use this method together with ExcelFile.SheetID to save and restore an ActiveSheet when you are adding or removing sheets.

If the sheet ID doesn't exist, this method will return 0.

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 GetSheetIndexFromID(Guid aSheetID)

Parameters

<-> | Parameter | Type | Description
 | aSheetID | Guid |

See also

  • XlsFile


XlsFile.GetSheetVisible Method | FlexCel Studio for the .NET Framework documentation

XlsFile.GetSheetVisible Method

Returns if a given sheet is visible.

Syntax

Namespace: FlexCel.XlsAdapter

public override TXlsSheetVisible GetSheetVisible(Int32 sheet)

Parameters

<-> | Parameter | Type | Description
 | sheet | Int32 | Sheet index (1 based)

See also

  • XlsFile


XlsFile.AddChartSheet Method | FlexCel Studio for the .NET Framework documentation

XlsFile.AddChartSheet Method

Adds a chart sheet to the file. You can then add series and customize the returned ExcelChart object. Note that as this is a chart sheet, the anchor is ignored. The ActiveSheet after adding the chart will be set to the newly inserted chart.

Important: This method only works in xlsx files.

Syntax

Namespace: FlexCel.XlsAdapter

public override ExcelChart AddChartSheet(Int32 insertBefore, TChartType chartType, ChartStyle aChartStyle, Boolean roundedCorners, Boolean print, Boolean isLocked)

Parameters

<-> | Parameter | Type | Description
 | insertBefore | Int32 | The sheet before which we will insert (1 based). This might be SheetCount + 1, to insert at the end of the Workbook.
 | chartType | TChartType | Kind of chart created. Note that you can have more than one type of chart in the same chart, so this just sets the base chart type. You can add other chart types over it.
 | aChartStyle | ChartStyle | Theme of the chart. This is a number between 1 and 48 which defines many standard properties for the chart, like the default line width for the series or the legend. The default style is 2.
 | roundedCorners | Boolean | If true, the chart will have rounded corners.
 | print | Boolean | True if the chart should be printed.
 | isLocked | Boolean | True if the chart is locked.

See also

  • XlsFile


XlsFile.InsertAndCopySheets Method | FlexCel Studio for the .NET Framework documentation

XlsFile.InsertAndCopySheets Method

Overloads

  • XlsFile.InsertAndCopySheets(Int32[], Int32, ExcelFile)
  • XlsFile.InsertAndCopySheets(Int32, Int32, Int32, ExcelFile)

XlsFile.InsertAndCopySheets(Int32[], Int32, ExcelFile)

Inserts and copies all the sheets in the "CopyFrom" array, before InsertBefore into another workbook.

Remarks

When copying sheets from another file, the algorithm used is not so efficient as when copying from the same file.

Use this version of the method only when copying from 2 different files. If you have for example a formula "=Sheet2!A1" in Sheet1, and another formula "=Sheet1!A1" in Sheet2, you need to use this method to copy them, as Copying them one by one (with the standard ExcelFile.InsertAndCopySheets(Int32, Int32, Int32, ExcelFile) method) will return an error of formula references not found.

You can also use ExcelFile.ConvertFormulasToValues(Boolean) method to avoid formulas before copying between workbooks.

Syntax

Namespace: FlexCel.XlsAdapter

public override void InsertAndCopySheets(Int32[] copyFrom, Int32 insertBefore, ExcelFile sourceWorkbook)

Parameters

<-> | Parameter | Type | Description
 | copyFrom | Int32[] | The sheet index of all the sheets we are copying from (1 based).
 | insertBefore | Int32 | The sheet before which we will insert (1 based). This might be SheetCount+1, to insert at the end of the Workbook.
 | sourceWorkbook | ExcelFile | Workbook from where the sheet will be copied from. On this overloaded version it cannot be null.

See also

  • XlsFile

XlsFile.InsertAndCopySheets(Int32, Int32, Int32, ExcelFile)

Inserts and copies sheet "CopyFrom", SheetCount times before InsertBefore. If sourceWorkbook is not null, sheets will be copied from another file. To insert empty sheets, set CopyFrom=0.

Remarks

When copying sheets from another file, the algorithm used is not so efficient as when copying from the same file. Whenever possible, don't copy from different files.

Syntax

Namespace: FlexCel.XlsAdapter

public override void InsertAndCopySheets(Int32 copyFrom, Int32 insertBefore, Int32 aSheetCount, ExcelFile sourceWorkbook)

Parameters

<-> | Parameter | Type | Description
 | copyFrom | Int32 | The sheet index of the sheet we are copying from (1 based). Set it to 0 to insert Empty sheets.
 | insertBefore | Int32 | The sheet before which we will insert (1 based). This might be SheetCount+1, to insert at the end of the Workbook.
 | aSheetCount | Int32 | How many times the sheet copyFrom will be copied. Note that this is **not** the last sheet to be copied, but how many times a single sheet will be copied instead. This means that for example InsertAndCopySheets(3, 1, 7) will insert 7 copies of sheet 3, not copy sheets 3 to 10. To copy multiple sheets see ExcelFile.InsertAndCopySheets(Int32[], Int32, ExcelFile)
 | sourceWorkbook | ExcelFile | Workbook from where the sheet will be copied from. Null to copy from the same file.

See also

  • XlsFile


XlsFile.ClearSheet Method | FlexCel Studio for the .NET Framework documentation

XlsFile.ClearSheet Method

Clears all data on the active sheet, but does not delete it.

Syntax

Namespace: FlexCel.XlsAdapter

public override void ClearSheet()

See also

  • XlsFile
  • ExcelFile.DeleteSheet(Int32, Int32)


XlsFile.DeleteSheet Method | FlexCel Studio for the .NET Framework documentation

XlsFile.DeleteSheet Method

Deletes sheet aSheet and aSheetCount-1 sheets more to the right. It will change all formula references to that sheet to invalid, and might change the active sheet so it remains valid.

Syntax

Namespace: FlexCel.XlsAdapter

public override void DeleteSheet(Int32 aSheet, Int32 aSheetCount)

Parameters

<-> | Parameter | Type | Description
 | aSheet | Int32 | First sheet to delete (1-based).
 | aSheetCount | Int32 | The number of sheets to delete.

See also

  • XlsFile
  • ExcelFile.ClearSheet


XlsFile.GetSheetSelected Method | FlexCel Studio for the .NET Framework documentation

XlsFile.GetSheetSelected Method

Returns true if a sheet is selected, false otherwise. Note that you might select many sheets in Excel by shift or ctrl-clicking the sheet tabs. Also note that when changing the ExcelFile.ActiveSheet, the sheet selected will be reset to the active sheet. So if you want to find out which sheets are selected in a file, you should call this method after opening the file but before changing the active sheet. This property can work in different windows depending on the value of ExcelFile.ActiveWindow

Syntax

Namespace: FlexCel.XlsAdapter

public override Boolean GetSheetSelected(Int32 sheetIndex)

Parameters

<-> | Parameter | Type | Description
 | sheetIndex | Int32 | Sheet index for the tab we want to know if it is selected. 1 based.

Returns

True is the sheet is selected, false otherwise.

See also

  • XlsFile


XlsFile.SetSheetSelected Method | FlexCel Studio for the .NET Framework documentation

XlsFile.SetSheetSelected Method

This method will set a sheet tab as selected. Note that this is different from ExcelFile.ActiveSheet in that you might have only a single active sheet, but you might select many tabs by ctrl-clicking them. Also note that whenever you change the ExcelFile.ActiveSheet, the selected sheets will be reset to the active sheet only. So if you want to save a file with more than one selected sheet, you should call this method after the last call to activesheet. This property can work in different windows depending on the value of ExcelFile.ActiveWindow

Syntax

Namespace: FlexCel.XlsAdapter

public override void SetSheetSelected(Int32 sheetIndex, Boolean selected)

Parameters

<-> | Parameter | Type | Description
 | sheetIndex | Int32 | Sheet index for the sheet we want to select or unselect.(1 based)
 | selected | Boolean | If true the sheet will be selected, otherwise it will be unselected.

See also

  • XlsFile


XlsFile.GetSheetType Method | FlexCel Studio for the .NET Framework documentation

XlsFile.GetSheetType Method

Returns the sheet type for a given sheet.

Syntax

Namespace: FlexCel.XlsAdapter

public override TSheetType GetSheetType(Int32 sheet)

Parameters

<-> | Parameter | Type | Description
 | sheet | Int32 | Sheet 1 based.

See also

  • XlsFile


XlsFile.HasHPageBreak Method | FlexCel Studio for the .NET Framework documentation

XlsFile.HasHPageBreak Method

True if the sheet has a Manual Horizontal page break on the row.

Syntax

Namespace: FlexCel.XlsAdapter

public override Boolean HasHPageBreak(Int32 row)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row to check. Note that row can be 0, and this would mean a page break before row 1. (which Excel will ignore)

See also

  • XlsFile


XlsFile.HasVPageBreak Method | FlexCel Studio for the .NET Framework documentation

XlsFile.HasVPageBreak Method

True if the sheet has a Manual Vertical page break on the column.

Syntax

Namespace: FlexCel.XlsAdapter

public override Boolean HasVPageBreak(Int32 col)

Parameters

<-> | Parameter | Type | Description
 | col | Int32 | Column to check Note that column can be 0, and this would mean a page break before column 1. (which Excel will ignore)

See also

  • XlsFile


XlsFile.InsertHPageBreak Method | FlexCel Studio for the .NET Framework documentation

XlsFile.InsertHPageBreak Method

Inserts a Horizontal Page Break at the specified row. If there is one already, it will do nothing. If the number of pagebreaks is bigger than the maximum Excel can admit, it will add it anyway, but you might get an exception when saving the file as xls. Exporting as images or PDF will use those additional page breaks. To control what to do when there are too many page breaks, see ExcelFile.ErrorActions

Syntax

Namespace: FlexCel.XlsAdapter

public override void InsertHPageBreak(Int32 row, Boolean aGoesAfter)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row where to insert the page break. All row numbers are 1-based, and the breaks occur after the row. Note that row can be 0, and this would mean a page break before row 1. (which Excel will ignore)
 | aGoesAfter | Boolean | This is used by FlexCelReport to add page breaks that behave as if they affected the next row, not the row at the top.

See also

  • XlsFile


XlsFile.InsertVPageBreak Method | FlexCel Studio for the .NET Framework documentation

XlsFile.InsertVPageBreak Method

Inserts a Vertical Page Break at the specified column. If there is one already, it will do nothing. If the number of pagebreaks is bigger than the maximum Excel can admit, it will add it anyway, but you might get an exception when saving the file as xls. Exporting as images or PDF will use those additional page breaks. To control what to do when there are too many page breaks, see ExcelFile.ErrorActions

Syntax

Namespace: FlexCel.XlsAdapter

public override void InsertVPageBreak(Int32 col, Boolean aGoesAfter)

Parameters

<-> | Parameter | Type | Description
 | col | Int32 | Column where to insert the page break All column numbers are 1-based, and the breaks occur after the column. Note that col can be 0, and this would mean a page break before column 1. (which Excel will ignore)
 | aGoesAfter | Boolean | This is used by FlexCelReport to add page breaks that behave as if they affected the next column, not the column to the left.

See also

  • XlsFile


XlsFile.DeleteHPageBreak Method | FlexCel Studio for the .NET Framework documentation

XlsFile.DeleteHPageBreak Method

Deletes all manual page breaks at row. If there is no manual page break on row, this method will do nothing.

Syntax

Namespace: FlexCel.XlsAdapter

public override void DeleteHPageBreak(Int32 row)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row where to delete the Page break. Note that row can be 0, and this would mean a page break before row 1. (which Excel will ignore)

See also

  • XlsFile


XlsFile.DeleteVPageBreak Method | FlexCel Studio for the .NET Framework documentation

XlsFile.DeleteVPageBreak Method

Deletes all manual page breaks at col. If there is no manual page break on col, this method will do nothing.

Syntax

Namespace: FlexCel.XlsAdapter

public override void DeleteVPageBreak(Int32 col)

Parameters

<-> | Parameter | Type | Description
 | col | Int32 | Column where to delete the Page break. Note that col can be 0, and this would mean a page break before column 1. (which Excel will ignore)

See also

  • XlsFile


XlsFile.ClearPageBreaks Method | FlexCel Studio for the .NET Framework documentation

XlsFile.ClearPageBreaks Method

Deletes all manual page breaks on the active sheet.

Syntax

Namespace: FlexCel.XlsAdapter

public override void ClearPageBreaks()

See also

  • XlsFile


XlsFile.KeepRowsTogether Method | FlexCel Studio for the .NET Framework documentation

XlsFile.KeepRowsTogether Method

Tells FlexCel that it must try to keep together the rows between row1 and row2 (inclusive) when printing. This method does nothing to the resulting Excel file since this is not an Excel feature. To actually do something, you need to call ExcelFile.AutoPageBreaks after calling this method.

Syntax

Namespace: FlexCel.XlsAdapter

public override void KeepRowsTogether(Int32 row1, Int32 row2, Int32 level, Boolean replaceBiggerLevels)

Parameters

<-> | Parameter | Type | Description
 | row1 | Int32 | First row of the group you want to keep together.
 | row2 | Int32 | Last row of the group you want to keep together.
 | level | Int32 | Set this parameter to 0 to remove the condition to keep rows together. Any bigger than zero value will mean that the rows must be kept together. You can use more than one level to tell FlexCel to try to keep different groups together. If all rows cannot be kept together in one page, FlexCel will try to keep as much rows with higher levels as possible. See the example for more information.
 | replaceBiggerLevels | Boolean | If true, all existing level values in the row range will be replaced. If false, the new level values will be written only if they are bigger than the existing ones. You can use the false setting to set many values in any order. For example, if you first call KeepRowsTogether(2, 3, 5, false) and then KeepRowsTogether(1, 10, 1, false), rows 2 and 3 will keep the level in 5. If you did so with this parameter true, the second call would replace the levels of rows 2 and 3 to level 1, making all row levels between 1 and 10 equal to 1.

Examples

If you call:

    xls.KeepColsTogether(1, 10, 1, true);
    xls.KeepColsTogether(3, 4, 2, true);

This will define two groups. FlexCel will try to keep rows 1 to 10 in one page. But if this is impossible, it will try to keep at least rows 3 and 4 together.

Values of the "level" parameter mean the strongness of the link. Rows with higher level values have a stronger link, and if it is impossible to keep all rows together, FlexCel will try to keep the higher level rows.

In this case, Rows 3 and 4 have a higher level, so if rows 1 to 10 cannot be kept together in one page, FlexCel will try to keep at least rows 3 and 4. Normally you will want to use higher level values completely inside groups with lower levels. If we called:

    xls.KeepRowsTogether(1, 10, 1, true);
    xls.KeepRowsTogether(3, 4, 1, true);

The second call would do nothing, since the level is the same, and rows 1 to 10 are already linked.

See also

  • XlsFile


XlsFile.KeepColsTogether Method | FlexCel Studio for the .NET Framework documentation

XlsFile.KeepColsTogether Method

Tells FlexCel that it must try to keep together the columns between col1 and col2 (inclusive) when printing. This method does nothing to the resulting Excel file since this is not an Excel feature. To actually do something, you need to call ExcelFile.AutoPageBreaks after calling this method.

Syntax

Namespace: FlexCel.XlsAdapter

public override void KeepColsTogether(Int32 col1, Int32 col2, Int32 level, Boolean replaceBiggerLevels)

Parameters

<-> | Parameter | Type | Description
 | col1 | Int32 | First column of the group you want to keep together.
 | col2 | Int32 | Last column of the group you want to keep together.
 | level | Int32 | Set this parameter to 0 to remove the condition to keep columns together. Any bigger than zero value will mean that the rows must be kept together. You can use more than one level to tell FlexCel to try to keep different groups together, If all columns cannot be kept together in one page, FlexCel will try to keep as much columns with higher levels as possible. See the example for more information.
 | replaceBiggerLevels | Boolean | If true, all existing level values in the column range will be replaced. If false, the new level values will be written only if they are bigger than the existing ones. You can use the false setting to set many values in any order. For example, if you first call KeepColsTogether(2, 3, 5, false) and then KeepColsTogether(1, 10, 1, false), columns 2 and 3 will keep the level in 5. If you did so with this parameter true, the second call would replace the levels of columns 2 and 3 to level 1, making all column levels between 1 and 10 equal to 1.

Examples

If you call:

    xls.KeepColsTogether(1, 10, 1, true);
    xls.KeepColsTogether(3, 4, 2, true);

This will define two groups. FlexCel will try to keep columns 1 to 10 in one page. But if this is impossible, it will try to keep at least columns 3 and 4 together.

Values of the "level" parameter mean the strongness of the link. Columns with higher level values have a stronger link, and if it is impossible to keep all columns together, FlexCel will try to keep the higher level columns.

In this case, Columns 3 and 4 have a higher level, so if columns 1 to 10 cannot be kept together in one page, FlexCel will try to keep at least columns 3 and 4. Normally you will want to use higher level values completely inside groups with lower levels. If we called:

    xls.KeepRowsTogether(1, 10, 1, true);
    xls.KeepRowsTogether(3, 4, 1, true);

The second call would do nothing, since the level is the same, and columns 1 to 10 are already linked.

See also

  • XlsFile


XlsFile.GetKeepRowsTogether Method | FlexCel Studio for the .NET Framework documentation

XlsFile.GetKeepRowsTogether Method

Returns the value of level for a row as set in ExcelFile.KeepRowsTogether. Note that the last value of a "keep together" range is 0. For example, if you set KeepRowsTogether(1, 3, 8, true); GetKeepRowsTogether will return 8 for rows 1 and 2, and 0 for row 3.

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 GetKeepRowsTogether(Int32 row)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row index. (1 based)

Returns

The Keep together level of the row.

See also

  • XlsFile


XlsFile.GetKeepColsTogether Method | FlexCel Studio for the .NET Framework documentation

XlsFile.GetKeepColsTogether Method

Returns the value of level for a column as set in ExcelFile.KeepColsTogether. Note that the last value of a "keep together" range is 0. For example, if you set KeepColsTogether(1, 3, 8, true); GetKeepColsTogether will return 8 for columns 1 and 2, and 0 for column 3.

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 GetKeepColsTogether(Int32 col)

Parameters

<-> | Parameter | Type | Description
 | col | Int32 | Column index. (1 based)

Returns

The Keep together level of the column.

See also

  • XlsFile


XlsFile.HasKeepRowsTogether Method | FlexCel Studio for the .NET Framework documentation

XlsFile.HasKeepRowsTogether Method

Returns true if there is any row marked as keeptogether in the sheet. This method traverses every row to find out, so it can be somehow slow and you should not call it too often.

Syntax

Namespace: FlexCel.XlsAdapter

public override Boolean HasKeepRowsTogether()

See also

  • XlsFile


XlsFile.HasKeepColsTogether Method | FlexCel Studio for the .NET Framework documentation

XlsFile.HasKeepColsTogether Method

Returns true if there is any column marked as keeptogether in the sheet. This method traverses every column to find out, so it can be somehow slow and you should not call it too often.

Syntax

Namespace: FlexCel.XlsAdapter

public override Boolean HasKeepColsTogether()

See also

  • XlsFile


XlsFile.DumpKeepRowsTogetherLevels Method | FlexCel Studio for the .NET Framework documentation

XlsFile.DumpKeepRowsTogetherLevels Method

This method is used for debugging intelligent page breaks (see 'Intelligent page breaks' in the Api Developer Guide. It will read the keep-together level for every row ad write it at the column "col". Note that the contents of col will be overwritten.

Syntax

Namespace: FlexCel.XlsAdapter

public override void DumpKeepRowsTogetherLevels(Int32 col, Int32 XF)

Parameters

<-> | Parameter | Type | Description
 | col | Int32 | Column where the keep-together levels will be written (1 based). Existing data in the column will be overwritten.
 | XF | Int32 | Format for the cells that will be written.

See also

  • XlsFile


XlsFile.DumpKeepColsTogetherLevels Method | FlexCel Studio for the .NET Framework documentation

XlsFile.DumpKeepColsTogetherLevels Method

This method is used for debugging intelligent page breaks (see 'Intelligent page breaks' in the Api Developer Guide. It will read the keep-together level for every column and writer it the row "row". Note that the contents of row will be overwritten.

Syntax

Namespace: FlexCel.XlsAdapter

public override void DumpKeepColsTogetherLevels(Int32 row, Int32 XF)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row where the keep-together levels will be written (1 based). Existing data in the row will be overwritten.
 | XF | Int32 | Format for the cells that will be written.

See also

  • XlsFile


XlsFile.AutoPageBreaks Method | FlexCel Studio for the .NET Framework documentation

XlsFile.AutoPageBreaks Method

Overloads

  • XlsFile.AutoPageBreaks(Int32, Int32)
  • XlsFile.AutoPageBreaks(Int32, TUIRectangle)

XlsFile.AutoPageBreaks(Int32, Int32)

This method will create manual page breaks in the sheet to try to keep together the rows and columns marked with ExcelFile.KeepRowsTogether and ExcelFile.KeepColsTogether. It might be desirable to clear all manual page breaks (with ExcelFile.ClearPageBreaks) before calling this method, so it has more freedom to place the new ones. If you call this method twice without removing the old page breaks, it will add the page breaks to the existing ones.

Syntax

Namespace: FlexCel.XlsAdapter

public override void AutoPageBreaks(Int32 PercentOfUsedSheet, Int32 PageScale)

Parameters

<-> | Parameter | Type | Description
 | PercentOfUsedSheet | Int32 | Percentage of the sheet that must be used in any page when fitting the rows and columns. A value of zero means that no part of the sheet must be used, so FlexCel might add a page break after a single row in a page, leaving it almost completely blank. A value of 50% means that half of the page must be used. This means that FlexCel will add a page break only if there is 50% of the current page already used. A value of 100% will do nothing, since the sheet must be completely used, and so FlexCel can never add a page break.
 | PageScale | Int32 | This parameter must be between 50 and 100, and means how much smaller page will be considered in order to calculate the page breaks. A value of 100 means that the size used in the calculation will be the real size of the page, and while this will always work fine when exporting to PDF or exporting to images, when printing from Excel might result in a page break that is placed a little after where it should go and an empty page for certain printers. (Page size in Excel is different for different printers) Normally a value around 95 is the recommended value for this parameter. If you need to do a finer grain adjustment, you can use ExcelFile.AutoPageBreaks(Int32, TUIRectangle).

See also

  • XlsFile

XlsFile.AutoPageBreaks(Int32, TUIRectangle)

This method will create manual page breaks in the sheet to try to keep together the rows and columns marked with ExcelFile.KeepRowsTogether and ExcelFile.KeepColsTogether. It might be desirable to clear all manual page breaks (with ExcelFile.ClearPageBreaks) before calling this method, so it has more freedom to place the new ones. If you call this method twice without removing the old page breaks, it will add the page breaks to the existing ones.

Syntax

Namespace: FlexCel.XlsAdapter

public override void AutoPageBreaks(Int32 PercentOfUsedSheet, TUIRectangle PageBounds)

Parameters

<-> | Parameter | Type | Description
 | PercentOfUsedSheet | Int32 | Percentage of the sheet that must be used in any page when fitting the rows and columns. A value of zero means that no part of the sheet must be used, so FlexCel might add a page break after a single row in a page, leaving it almost completely blank. A value of 50% means that half of the page must be used. This means that FlexCel will add a page break only if there is 50% of the current page already used. A value of 100% will do nothing, since the sheet must be completely used, and so FlexCel can never add a page break.
 | PageBounds | TUIRectangle | You can customize a custom page size here. If width or height of this parameter is 0, the paper size specified in the file will be used. There is normally no need to set this parameter, unless you want to fine tune the results.

See also

  • XlsFile


XlsFile.GetCellValue Method | FlexCel Studio for the .NET Framework documentation

XlsFile.GetCellValue Method

Overloads

  • XlsFile.GetCellValue(Int32, Int32, Int32)
  • XlsFile.GetCellValue(Int32, Int32, Int32, Int32)

XlsFile.GetCellValue(Int32, Int32, Int32)

Reads a Cell Value and Format.

Syntax

Namespace: FlexCel.XlsAdapter

public override Object GetCellValue(Int32 row, Int32 col, ref Int32 XF)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row, 1 based.
 | col | Int32 | Column, 1 based.
ref | XF | Int32 | XF format.

Returns

Object with the value. It can be null, a double, a string, a boolean, a TFormula, a TFlxFormulaErrorValue or a TRichString. Dates are returned as doubles. See the Reading Files demo to know how to use each type of the objects returned.

See also

  • XlsFile

XlsFile.GetCellValue(Int32, Int32, Int32, Int32)

Reads a Cell Value and Format from a sheet that is not the active sheet.

Syntax

Namespace: FlexCel.XlsAdapter

public override Object GetCellValue(Int32 sheet, Int32 row, Int32 col, ref Int32 XF)

Parameters

<-> | Parameter | Type | Description
 | sheet | Int32 | Sheet where is the cell you want to get the value.
 | row | Int32 | Row, 1 based.
 | col | Int32 | Column, 1 based.
ref | XF | Int32 | XF format.

Returns

Object with the value. It can be null, a double, a string, a boolean, a TFormula, a TFlxFormulaErrorValue or a TRichString. Dates are returned as doubles. See the Reading Files demo to know how to use each type of the objects returned.

See also

  • XlsFile


XlsFile.GetCellValueIndexed Method | FlexCel Studio for the .NET Framework documentation

XlsFile.GetCellValueIndexed Method

Reads a Cell Value and Format, using a column index for faster access. Normal GetCellValue(row, col) has to search for the column on a sorted list. If you are looping from 1 to ExcelFile.ColCountInRow(Int32) this method is faster.

Syntax

Namespace: FlexCel.XlsAdapter

public override Object GetCellValueIndexed(Int32 sheet, Int32 row, Int32 colIndex, ref Int32 XF)

Parameters

<-> | Parameter | Type | Description
 | sheet | Int32 | Sheet where the cell is, 1 based.
 | row | Int32 | Row, 1 based.
 | colIndex | Int32 | Column index, 1 based.
ref | XF | Int32 | XF format.

Returns

Object with the value. It can be null, a double, a string, a boolean, a TFormula, a TFlxFormulaErrorValue or a TRichString. Dates are returned as doubles. See the Reading Files demo to know how to use each type of the objects returned.

See also

  • XlsFile


XlsFile.SetCellValue Method | FlexCel Studio for the .NET Framework documentation

XlsFile.SetCellValue Method

Overloads

  • XlsFile.SetCellValue(Int32, Int32, Object, Int32)
  • XlsFile.SetCellValue(Int32, Int32, Int32, Object, Int32)

XlsFile.SetCellValue(Int32, Int32, Object, Int32)

Sets the value and format on a cell.

Remarks

This method will enter the datatype of the object you pass to it. For example, if you set value="1" the string "1" will be entered on the cell. To convert a string to the best representation (on this case a number), use ExcelFile.SetCellFromString(Int32, Int32, TRichString, Int32) To enter a HTML formatted string, use ExcelFile.SetCellFromHtml(Int32, Int32, String, Int32)

Syntax

Namespace: FlexCel.XlsAdapter

public override void SetCellValue(Int32 row, Int32 col, Object value, Int32 XF)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row, 1 based.
 | col | Int32 | Column, 1 based.
 | value | Object | Value to set.
 | XF | Int32 | Format to Set. You normally get this number with ExcelFile.AddFormat function. Use -1 to keep format unchanged.

See also

  • XlsFile

XlsFile.SetCellValue(Int32, Int32, Int32, Object, Int32)

Sets the value on a cell.

Remarks

This method will enter the datatype of the object you pass to it. For example, if you set value="1" the string "1" will be entered on the cell. To convert a string to the best representation (on this case a number), use ExcelFile.SetCellFromString(Int32, Int32, TRichString, Int32). To enter a HTML formatted string, use ExcelFile.SetCellFromHtml(Int32, Int32, String, Int32)

Syntax

Namespace: FlexCel.XlsAdapter

public override void SetCellValue(Int32 sheet, Int32 row, Int32 col, Object value, Int32 XF)

Parameters

<-> | Parameter | Type | Description
 | sheet | Int32 | Sheet number, 1 based
 | row | Int32 | Row, 1 based.
 | col | Int32 | Column, 1 based.
 | value | Object | Value to set.
 | XF | Int32 | Format to Set. You normally get this number with ExcelFile.AddFormat function. Use -1 to keep format unchanged.

See also

  • XlsFile


XlsFile.ConvertString Method | FlexCel Studio for the .NET Framework documentation

XlsFile.ConvertString Method

Converts a string into the best datatype (a boolean, a number, etc)

Remarks

See ExcelFile.SetCellFromString(Int32, Int32, TRichString, Int32) for more information.

Syntax

Namespace: FlexCel.XlsAdapter

public override Object ConvertString(TRichString value, ref Int32 XF, String[] dateFormats)

Parameters

<-> | Parameter | Type | Description
 | value | TRichString | RichString to convert.
ref | XF | Int32 | XF of the cell. It might be modified, for example, if you are entering a date.
 | dateFormats | String[] | A list of formats allowed for dates and times. Windows is a little liberal in what it thinks can be a date, and it can convert things like "1.2" into dates. By setting this property, you can ensure the dates are only in the formats you expect. If you leave it null, we will trust "DateTime.TryParse" to guess the correct values.

Returns

value converted to the best datatype.

See also

  • XlsFile


XlsFile.SetCellFromString Method | FlexCel Studio for the .NET Framework documentation

XlsFile.SetCellFromString Method

Converts a string to the best datatype, and the enters it into a cell.

Remarks

When using ExcelFile.SetCellValue(Int32, Int32, Object) to set a cell value, you have to know the datatype you want to enter. That is, if you have a string s = "1/1/2002" and call SetCellValue(1, 1, s); the cell A1 will end up with a string "1/1/2002" and not with a date. The same if you have a string holding a number.

SetCellFromString tries to solve this problem. When you call SetCellFromString(1, 1, s) it will look:

  1. If s contains a valid number: If it does, it will enter the number into the cell, and not the string s
  2. If s contains a boolean: If s equals the words "TRUE" or "FALSE" (or whatever you define on the constants TxtTrue and TxtFalse) it will enter the boolean into the cell
  3. If s contains a date: If s is a valid date (according to your windows settings, or with a list of allowed date/time formats) it will enter a number into the cell and format the cell as a date. (see 'Date cells' in the Api Developer Guide)
  4. In any other case, it will enter the string s into the cell.

Syntax

Namespace: FlexCel.XlsAdapter

public override void SetCellFromString(Int32 sheet, Int32 row, Int32 col, TRichString value, Int32 XF, String[] dateFormats)

Parameters

<-> | Parameter | Type | Description
 | sheet | Int32 | Sheet where the cell is (1 based)
 | row | Int32 | Cell Row (1 based)
 | col | Int32 | Cell Column (1 based)
 | value | TRichString | Value to enter into the cell.
 | XF | Int32 | New XF of the cell. It can be modified, i.e. if you enter a date, the XF will be converted to a Date XF.
 | dateFormats | String[] | A list of formats allowed for dates and times. Windows is a little liberal in what it thinks can be a date, and it can convert things like "1.2" into dates. By setting this property, you can ensure the dates are only in the formats you expect. If you leave it null, we will trust "DateTime.TryParse" to guess the correct values.

See also

  • XlsFile


XlsFile.GetStringFromCell Method | FlexCel Studio for the .NET Framework documentation

XlsFile.GetStringFromCell Method

This method will return a rich string that is formatted similar to the way Excel shows it. For example, if you have "1.0" on a cell, and the cell is formatted as exponential, this method will return "1.0e+1" It might also change the color depending on the value and format. (for example, red for negative numbers) Conditional formats are not applied, you need to call ExcelFile.ConditionallyModifyFormat(TFlxFormat, Int32, Int32, Boolean, TDrawingConditionalFormat) to the cell style for that.

Syntax

Namespace: FlexCel.XlsAdapter

public override TRichString GetStringFromCell(Int32 sheet, Int32 row, Int32 col, ref Int32 XF, ref TUIColor aColor, Boolean ignorePrintErrors)

Parameters

<-> | Parameter | Type | Description
 | sheet | Int32 | Sheet where the cell is (1 based).
 | row | Int32 | Cell Row (1 based).
 | col | Int32 | Cell Column (1 based)
ref | XF | Int32 | The resulting XF for the cell.
ref | aColor | TUIColor | Resulting color of the string. If for example you define red for negative numbers, and the result is red, this will be returned on aColor. If there is not color info on the format, it will remain unchanged.
 | ignorePrintErrors | Boolean | If true, the string for an error like #DIV/0 will always by #DIV/0 instead of using the value of ExcelFile.PrintErrors. Set it to true when the value is not for printing it.

Returns

A rich string with the cell value.

See also

  • XlsFile


XlsFile.SetCellFromHtml Method | FlexCel Studio for the .NET Framework documentation

XlsFile.SetCellFromHtml Method

Enters an HTML formatted string into a cell, and tries to match the Excel formats with the HTML formatting tags. Note that the rich text inside Excel is more limited than xls (you are limited to only changing font attributes), so many tags from the HTML tags might be ignored. Whenever a tag is not understood or cannot be mapped into Excel, it will just be omitted. For a list of supported tags, see the Remarks section.

Remarks

Any tag (between brackets) will be stripped from the entered text. If you want to enter a < sign, you need to enter "&lt;". For a list of all "&" possible symbols consult any HTML reference. &[HexadecimalUnicodeCharacer] are supported too.

All tags are case insensitive.

Spaces will be eliminated from the string as in normal HTML. To enter a "hard" space you can enter "&nbsp;" (non breaking space). Also, if text is inside "pre" tags, spaces will be preserved.

The supported tags are:

  • b or strong - Bold.
  • i or em- Italics.
  • u - Underline.
  • s or strike- Strikeout.
  • sub - Subscript.
  • sup - Superscript.
  • tt - Use monospace font.
  • pre - Preserve spaces and returns. On normal mode, if you have 2 spaces on a string, only one will be kept.
  • font - Change the used font. This tag behaves as normal HTML, and you can specify color, face, point-size or size as attributes. Size might be between 1 and 7, and the size in points are 8, 9, 12, 14, 18, 24, 34 for each size. You can also specify relative sizes (for example -1)
  • h1..h6 - Header fonts.
  • small - Use a smaller font. This is equivalent to <font size = '-1'>
  • big - Use a bigger font. This is equivalent to <font size = '+1'>
  • ul - Unordered list.
  • ol - Ordered list.
  • li - List item.

Syntax

Namespace: FlexCel.XlsAdapter

public override void SetCellFromHtml(Int32 row, Int32 col, String htmlText, Int32 XF)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Cell Row (1 based)
 | col | Int32 | Cell Column (1 based)
 | htmlText | String | Text with an HTML formatted string.
 | XF | Int32 | Format for the cell. It can be -1 to keep the existing format.

See also

  • XlsFile


XlsFile.GetHtmlFromCell Method | FlexCel Studio for the .NET Framework documentation

XlsFile.GetHtmlFromCell Method

Returns the contents of formatted cell as HTML. Conditional formats are not applied (unless includeCellFormatting is true): you need to call ExcelFile.ConditionallyModifyFormat(TFlxFormat, Int32, Int32, Boolean, TDrawingConditionalFormat) to the cell style to get the cell with cf applied. If ExcelFile.ShowFormulaText is true, it will return the formula text instead of the value. For a list of HTML tags that might be returned, see the Remarks section.

Remarks

Text will be returned as standard HTML, on the version specified. This means that for example a < sign will be returned as "&lt;". For a list of all "&" possible symbols consult any HTML reference. &[HexadecimalUnicodeCharacer] might be returned too.

Multiple spaces will be returned as "&nbsp;" (non breaking space) and line breaks will be returned as <br> tags.

The tags that might be returned by this method are: If htmlStyle is Simple:

  • b - Bold.
  • i - Italics.
  • u - Underline.
  • s - Strikeout.
  • sub - Subscript.
  • sup - Superscript.
  • font - Change the used font. This tag behaves as normal HTML, and you can specify color, face, point-size or size as attributes. Size might be between 1 and 7, and the size in points are 8, 9, 12, 14, 18, 24, 34 for each size. You can also specify relative sizes (for example -1)

If htmlStyle is CSS: The equivalent CSS style commands to the ones listed under htmlStyle = Simple.

Syntax

Namespace: FlexCel.XlsAdapter

public override String GetHtmlFromCell(Int32 row, Int32 col, THtmlVersion htmlVersion, THtmlStyle htmlStyle, Encoding encoding, Boolean includeCellFormatting)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Cell Row (1 based)
 | col | Int32 | Cell Column (1 based)
 | htmlVersion | THtmlVersion | Version of the HTML returned. In XHTML, single tags have a "/" at the end, while in 4.0 they don't.
 | htmlStyle | THtmlStyle | Specifies if to use simple tags or CSS for the returned HTML.
 | encoding | Encoding | Encoding for the returned string. Use UTF-8 if in doubt.
 | includeCellFormatting | Boolean | If true, the result will include the cell formatting in the formatting. So if for example a cell is formatted as bold, and the string inside doesn't have formatting, this method will return "<b>Text</b>" when includeCellFormatting is true, and just "Text" when it is false. If this parameter is true, it will also consider the conditional formatting of the cell.

Returns

An HTML formatted string with the cell contents.

See also

  • XlsFile


XlsFile.CopyCell Method | FlexCel Studio for the .NET Framework documentation

XlsFile.CopyCell Method

Copies one cell from one workbook to another. If the cell has a formula, it will be offset so it matches the new destination. Note: You will normally not need this method. To copy a range of cells from a workbook to another use ExcelFile.InsertAndCopyRange(TXlsCellRange, Int32, Int32, Int32, TFlxInsertMode, TRangeCopyMode, ExcelFile, Int32) instead. To copy a full sheet from one file to another, use ExcelFile.InsertAndCopySheets(Int32, Int32, Int32, ExcelFile).

Syntax

Namespace: FlexCel.XlsAdapter

public override void CopyCell(ExcelFile sourceWorkbook, Int32 sourceSheet, Int32 destSheet, Int32 sourceRow, Int32 sourceCol, Int32 destRow, Int32 destCol, TRangeCopyMode copyMode)

Parameters

<-> | Parameter | Type | Description
 | sourceWorkbook | ExcelFile | File from where we want to copy the cell.
 | sourceSheet | Int32 | Sheet in sourceWorkbook where the data is.
 | destSheet | Int32 | Sheet in this file where we want to copy the data.
 | sourceRow | Int32 | Row on the source file of the cell (1 based)
 | sourceCol | Int32 | Column on the source file of the cell (1 based)
 | destRow | Int32 | Row on the destination file of the cell (1 based)
 | destCol | Int32 | Column on the destination file of the cell (1 based)
 | copyMode | TRangeCopyMode | How the cell will be copied.

See also

  • XlsFile


XlsFile.GetFormat Method | FlexCel Studio for the .NET Framework documentation

XlsFile.GetFormat Method

Returns the format definition for a given format index. Note that this method will only return Cell formats. If you want to read a Style format, use ExcelFile.GetStyle(Int32)

Syntax

Namespace: FlexCel.XlsAdapter

public override TFlxFormat GetFormat(Int32 XF)

Parameters

<-> | Parameter | Type | Description
 | XF | Int32 | Format index 0-Based

Returns

Format definition

See also

  • XlsFile


XlsFile.AddFormat Method | FlexCel Studio for the .NET Framework documentation

XlsFile.AddFormat Method

Adds a new format to the Excel format list. If it already exists, it doesn't add a new one, so you can use this method for searching too.

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 AddFormat(TFlxFormat format)

Parameters

<-> | Parameter | Type | Description
 | format | TFlxFormat | Format to add to the list.

Returns

Position on the list for the format.

See also

  • XlsFile


XlsFile.SetFormat Method | FlexCel Studio for the .NET Framework documentation

XlsFile.SetFormat Method

Sets the font definition for a given format index. Normally it is of not use, (you should use AddFont or AddFormat instead) but could be used to change the default format. (using SetFormat(0, fmt); ). This method will change style XFs and CellXfs, depending if aFormat is a StyleXF or a CellXF.

Syntax

Namespace: FlexCel.XlsAdapter

public override void SetFormat(Int32 formatIndex, TFlxFormat aFormat)

Parameters

<-> | Parameter | Type | Description
 | formatIndex | Int32 | Format index. 0-based
 | aFormat | TFlxFormat | Format definition

See also

  • XlsFile


XlsFile.GetFont Method | FlexCel Studio for the .NET Framework documentation

XlsFile.GetFont Method

Returns the font definition for a given font index.

Syntax

Namespace: FlexCel.XlsAdapter

public override TFlxFont GetFont(Int32 fontIndex)

Parameters

<-> | Parameter | Type | Description
 | fontIndex | Int32 | Font index. 0-based

Returns

Font definition

See also

  • XlsFile


XlsFile.SetFont Method | FlexCel Studio for the .NET Framework documentation

XlsFile.SetFont Method

Sets the font definition for a given font index. Normally it is of not use, (you should use AddFont or AddFormat instead) but could be used to change the default font format. (using SetFont(0, font); )

Syntax

Namespace: FlexCel.XlsAdapter

public override void SetFont(Int32 fontIndex, TFlxFont aFont)

Parameters

<-> | Parameter | Type | Description
 | fontIndex | Int32 | Font index. 0-based
 | aFont | TFlxFont | Font definition

See also

  • XlsFile


XlsFile.AddFont Method | FlexCel Studio for the .NET Framework documentation

XlsFile.AddFont Method

Adds a new font to the excel font list. If it already exists, it doesn't add a new one, so you can use this method for searching too.

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 AddFont(TFlxFont font)

Parameters

<-> | Parameter | Type | Description
 | font | TFlxFont | Font to add to the list.

Returns

The position on the list for the added font.

See also

  • XlsFile


XlsFile.SetCellFormat Method | FlexCel Studio for the .NET Framework documentation

XlsFile.SetCellFormat Method

Overloads

  • XlsFile.SetCellFormat(Int32, Int32, Int32)
  • XlsFile.SetCellFormat(Int32, Int32, Int32, Int32, Int32)
  • XlsFile.SetCellFormat(Int32, Int32, Int32, Int32, TFlxFormat, TFlxApplyFormat, Boolean)

XlsFile.SetCellFormat(Int32, Int32, Int32)

Sets the Cell format (XF) on a given cell. You can create new formats using the ExcelFile.AddFormat function.

Syntax

Namespace: FlexCel.XlsAdapter

public override void SetCellFormat(Int32 row, Int32 col, Int32 XF)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row index of the cell (1 based)
 | col | Int32 | Column index of the cell (1 based)
 | XF | Int32 | XF Format index. See 'Cell formats' in the Api Developer Guide.

See also

  • XlsFile
  • ExcelFile.GetCellFormat(Int32, Int32)
  • ExcelFile.AddFormat

XlsFile.SetCellFormat(Int32, Int32, Int32, Int32, Int32)

Sets the Cell format (XF) on a range of cells. You can create new formats using the ExcelFile.AddFormat function.

Syntax

Namespace: FlexCel.XlsAdapter

public override void SetCellFormat(Int32 row1, Int32 col1, Int32 row2, Int32 col2, Int32 XF)

Parameters

<-> | Parameter | Type | Description
 | row1 | Int32 | Row index of the top cell on the range (1 based)
 | col1 | Int32 | Column index of the left cell on the range (1 based)
 | row2 | Int32 | Row index of the bottom cell on the range (1 based)
 | col2 | Int32 | Column index of the right cell on the range (1 based)
 | XF | Int32 | XF Format index. See 'Cell formats' in the Api Developer Guide.

See also

  • XlsFile
  • ExcelFile.GetCellFormat(Int32, Int32)
  • ExcelFile.AddFormat

XlsFile.SetCellFormat(Int32, Int32, Int32, Int32, TFlxFormat, TFlxApplyFormat, Boolean)

Changes part of the Cell format on a range of cells. WARNING! This method is slower than the other SetCellFormat versions, use it only if you do not care about maximum performance or if you just can't use the other SetCellFormat versions. This particular version of SetCellFormat has to read the format on each cell, modify it and write it back. While still very fast, it is not as fast as just setting the format on a cell.

Remarks

You can use this method for example to add a border on the top of a row of cells, keeping the existing font and pattern styles on the range.

Syntax

Namespace: FlexCel.XlsAdapter

public override void SetCellFormat(Int32 row1, Int32 col1, Int32 row2, Int32 col2, TFlxFormat newFormat, TFlxApplyFormat applyNewFormat, Boolean exteriorBorders)

Parameters

<-> | Parameter | Type | Description
 | row1 | Int32 | Row index of the top cell on the range (1 based)
 | col1 | Int32 | Column index of the left cell on the range (1 based)
 | row2 | Int32 | Row index of the bottom cell on the range (1 based)
 | col2 | Int32 | Column index of the right cell on the range (1 based)
 | newFormat | TFlxFormat | Format to apply to the cells.
 | applyNewFormat | TFlxApplyFormat | Indicates which properties of newFormat will be applied to the cells.
 | exteriorBorders | Boolean | When true, the format for the border will be applied only to the outer cells in the range. This can be useful for example to draw a box around a range of cells, but not drawing borders inside the range. Other parameters, like the cell background, will still be applied to the full range.

See also

  • XlsFile


XlsFile.GetCellFormat Method | FlexCel Studio for the .NET Framework documentation

XlsFile.GetCellFormat Method

Overloads

  • XlsFile.GetCellFormat(Int32, Int32)
  • XlsFile.GetCellFormat(Int32, Int32, Int32)

XlsFile.GetCellFormat(Int32, Int32)

Cell Format for a given cell This method gets the Format number (XF) of a cell. You can create new formats using the ExcelFile.AddFormat function.

Remarks

This method DOES NOT return the format for an empty cell, even if it has a column or a row format. For the visible format of the cell, see ExcelFile.GetCellVisibleFormat(Int32, Int32)

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 GetCellFormat(Int32 row, Int32 col)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row Index (1 based)
 | col | Int32 | Column Index (1 based)

Returns

XF for the cell.

Examples

To copy the format on cell A1 to B2 you should write:

    xls.SetCellFormat(2, 2, xls.GetCellFormat(1, 1));

See also

  • XlsFile
  • ExcelFile.AddFormat
  • ExcelFile.SetCellFormat(Int32, Int32, Int32)
  • ExcelFile.GetFormat
  • ExcelFile.GetCellVisibleFormat(Int32, Int32)

XlsFile.GetCellFormat(Int32, Int32, Int32)

Cell Format for a given cell This method gets the Format number (XF) of a cell. You can create new formats using the ExcelFile.AddFormat function.

Remarks

This method DOES NOT return the format for an empty cell, even if it has a column or a row format. For the visible format of the cell, see ExcelFile.GetCellVisibleFormat(Int32, Int32)

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 GetCellFormat(Int32 sheet, Int32 row, Int32 col)

Parameters

<-> | Parameter | Type | Description
 | sheet | Int32 | Sheet index (1 based).
 | row | Int32 | Row Index (1 based)
 | col | Int32 | Column Index (1 based)

Returns

XF for the cell.

Examples

To copy the format on cell A1 to B2 you should write:

    xls.SetCellFormat(2, 2, xls.GetCellFormat(1, 1));

See also

  • XlsFile
  • ExcelFile.AddFormat
  • ExcelFile.SetCellFormat(Int32, Int32, Int32)
  • ExcelFile.GetFormat
  • ExcelFile.GetCellVisibleFormat(Int32, Int32)


XlsFile.ConditionallyModifyFormat Method | FlexCel Studio for the .NET Framework documentation

XlsFile.ConditionallyModifyFormat Method

Modifies the format of the specified cell if it has a conditional format active. Returns a modified format with the applied conditional format if there was any change, null otherwise.

Syntax

Namespace: FlexCel.XlsAdapter

public override TFlxFormat ConditionallyModifyFormat(TFlxFormat format, Int32 row, Int32 col, Boolean includeTables, out TDrawingConditionalFormat ExtraInfo)

Parameters

<-> | Parameter | Type | Description
 | format | TFlxFormat | Original format of the cell.
 | row | Int32 | Row of the cell (1 based)
 | col | Int32 | Column of the cell (1 based)
 | includeTables | Boolean | If true and the cell is inside a table, the format for the table will be also taken in account.
out | ExtraInfo | TDrawingConditional​Format |

Returns

If the format is modified by a conditional format, it returns the new format. If there are no changes returns null, to avoid creating new instances of TFlxFormat.

See also

  • XlsFile


XlsFile.GetConditionalFormat Method | FlexCel Studio for the .NET Framework documentation

XlsFile.GetConditionalFormat Method

One of the entries on the conditional format list of this file.

Syntax

Namespace: FlexCel.XlsAdapter

public override TConditionalFormat GetConditionalFormat(Int32 index)

Parameters

<-> | Parameter | Type | Description
 | index | Int32 | Index to the conditional format list. (1 based)

Returns

The list of conditional format definitions for the index.

See also

  • XlsFile


XlsFile.SetConditionalFormat Method | FlexCel Studio for the .NET Framework documentation

XlsFile.SetConditionalFormat Method

Modifies one of the conditional format rules in the sheet.

Syntax

Namespace: FlexCel.XlsAdapter

public override void SetConditionalFormat(Int32 index, TConditionalFormat formatCondition)

Parameters

<-> | Parameter | Type | Description
 | index | Int32 | Index of the conditional format to modify. 1-based.
 | formatCondition | TConditionalFormat | The conditional format rules to apply to a set of ranges in the active sheet.

See also

  • XlsFile


XlsFile.AddConditionalFormat Method | FlexCel Studio for the .NET Framework documentation

XlsFile.AddConditionalFormat Method

Adds a conditional format for a range of cells.

Syntax

Namespace: FlexCel.XlsAdapter

public override void AddConditionalFormat(TConditionalFormat formatCondition)

Parameters

<-> | Parameter | Type | Description
 | formatCondition | TConditionalFormat | The conditional format rules to apply to a set of ranges in the active sheet.

See also

  • XlsFile


XlsFile.ClearConditionalFormatsInSheet Method | FlexCel Studio for the .NET Framework documentation

XlsFile.ClearConditionalFormatsInSheet Method

Removes all conditional formats in the active sheet.

Syntax

Namespace: FlexCel.XlsAdapter

public override void ClearConditionalFormatsInSheet()

See also

  • XlsFile


XlsFile.RemoveConditionalFormat Method | FlexCel Studio for the .NET Framework documentation

XlsFile.RemoveConditionalFormat Method

Removes the conditional format at position index.

Syntax

Namespace: FlexCel.XlsAdapter

public override void RemoveConditionalFormat(Int32 index)

Parameters

<-> | Parameter | Type | Description
 | index | Int32 | Index to the conditional format list. (1 based)

See also

  • XlsFile


XlsFile.GetStyleName Method | FlexCel Studio for the .NET Framework documentation

XlsFile.GetStyleName Method

Gets the name of the style at position index. (1 based).

Syntax

Namespace: FlexCel.XlsAdapter

public override String GetStyleName(Int32 index)

Parameters

<-> | Parameter | Type | Description
 | index | Int32 | Position in the list of styles (1 based).

Returns

The name of the style.

See also

  • XlsFile


XlsFile.GetStyle Method | FlexCel Studio for the .NET Framework documentation

XlsFile.GetStyle Method

Overloads

  • XlsFile.GetStyle(Int32)
  • XlsFile.GetStyle(String, Boolean)

XlsFile.GetStyle(Int32)

Returns the named style at position index for the workbook

Syntax

Namespace: FlexCel.XlsAdapter

public override TFlxFormat GetStyle(Int32 index)

Parameters

<-> | Parameter | Type | Description
 | index | Int32 | Position in the list of styles (1 based).

Returns

The named style definition.

See also

  • XlsFile

XlsFile.GetStyle(String, Boolean)

Returns a named style for the workbook. You can also use this method to check if a style exists or not.

Syntax

Namespace: FlexCel.XlsAdapter

public override TFlxFormat GetStyle(String name, Boolean convertToCellStyle)

Parameters

<-> | Parameter | Type | Description
 | name | String | Name for the style. It might be a user defined name, or a built-in name. You can get a list of builtin names with ExcelFile.GetBuiltInStyleName
 | convertToCellStyle | Boolean | If true, the returned style will have the "IsStyle" property set to false, so you can apply this TFlxFormat to a cell. If false IsStyle will be true and you can use the format definition in style definitions. Setting this parameter to true is exactly the same as setting it to false and setting "IsStyle" property in the result to false, and also setting the parent of the resulting cell format to the cell style.

Returns

The style definition, or null if the style doesn't exists.

See also

  • XlsFile


XlsFile.RenameStyle Method | FlexCel Studio for the .NET Framework documentation

XlsFile.RenameStyle Method

Renames an existing style. Note that this might be a user-defined style, you can't rename built-in styles.

Syntax

Namespace: FlexCel.XlsAdapter

public override void RenameStyle(String oldName, String newName)

Parameters

<-> | Parameter | Type | Description
 | oldName | String | Name of the existing style in the workbook.
 | newName | String | New name for the style. It must not exist.

See also

  • XlsFile


XlsFile.SetStyle Method | FlexCel Studio for the .NET Framework documentation

XlsFile.SetStyle Method

Modifies an existing style if name already exists, or creates a new style if it doesn't.

Syntax

Namespace: FlexCel.XlsAdapter

public override void SetStyle(String name, TFlxFormat fmt)

Parameters

<-> | Parameter | Type | Description
 | name | String | Name for the style. It might be a user defined name, or a built-in name. You can get a list of built-in names with ExcelFile.GetBuiltInStyleName
 | fmt | TFlxFormat | The new style definition.

See also

  • XlsFile


XlsFile.DeleteStyle Method | FlexCel Studio for the .NET Framework documentation

XlsFile.DeleteStyle Method

Returns a named style for the workbook.

Syntax

Namespace: FlexCel.XlsAdapter

public override void DeleteStyle(String name)

Parameters

<-> | Parameter | Type | Description
 | name | String | Name for the style. It must be a user defined name.

See also

  • XlsFile


XlsFile.GetBuiltInStyleName Method | FlexCel Studio for the .NET Framework documentation

XlsFile.GetBuiltInStyleName Method

Returns the name for a built-in style.

Syntax

Namespace: FlexCel.XlsAdapter

public override String GetBuiltInStyleName(TBuiltInStyle style, Int32 level)

Parameters

<-> | Parameter | Type | Description
 | style | TBuiltInStyle | Style you want find out the name.
 | level | Int32 | Used only if style is TBuiltInStyle.RowLevel or TBuiltInStyle.ColLevel. It specifies the level of the outline, and must be a number between 1 and 7. Keep it 0 for all other styles.

Returns

The name for the Built in style.

See also

  • XlsFile


XlsFile.TryGetBuiltInStyleType Method | FlexCel Studio for the .NET Framework documentation

XlsFile.TryGetBuiltInStyleType Method

Tries to convert a string into an built-in style identifier. Will return true if styleName can be converted, false otherwise.

Syntax

Namespace: FlexCel.XlsAdapter

public override Boolean TryGetBuiltInStyleType(String styleName, out TBuiltInStyle style, out Int32 level)

Parameters

<-> | Parameter | Type | Description
 | styleName | String | Style that we want to convert to built-in style.
out | style | TBuiltInStyle | Returns the built-in style. This value is only valid if this method returns true.
out | level | Int32 | Returns the level built-in style (1 based). This value is only valid if this method returns true, and only applies to outline styles. It will be 0 for non outline styles.

Returns

True is styleNameis a built-in style (and thus style and level are valid), false otherwise.

See also

  • XlsFile


XlsFile.CellMergedBounds Method | FlexCel Studio for the .NET Framework documentation

XlsFile.CellMergedBounds Method

Merged Range where the cell is.

Syntax

Namespace: FlexCel.XlsAdapter

public override TXlsCellRange CellMergedBounds(Int32 row, Int32 col)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row Index (1 based)
 | col | Int32 | Column Index (1 based)

Returns

The range where the cell is

Examples

If you have a merged cell in range A1: B2, calling CellMergedBounds on any of the cells: A1, B1, A2, B2 will return A1:B2.

See also

  • XlsFile
  • ExcelFile.MergeCells
  • ExcelFile.UnMergeCells
  • ExcelFile.CellMergedListCount
  • ExcelFile.CellMergedList


XlsFile.MergeCells Method | FlexCel Studio for the .NET Framework documentation

XlsFile.MergeCells Method

Merges a number of cells into one.

Remarks

This method might return a bigger range than the one you specify. For example, if you have a merged cell (A1:C1), calling MergeCells(1,2,2,2) will merge the cell with the existing one, returning ONE merged cell (A1:C2), and not (B1:B2)

Other thing to consider, is that Excel honors individual linestyles inside a merged cell. That is, you can have only the first 2 columns of the merged cell with a line and the others without. Normally, after merging the cells, you will want to call ExcelFile.SetCellFormat(Int32, Int32, Int32) on the range to make them all similar. FlexCel does not do it by default, to give the choice to you.

Syntax

Namespace: FlexCel.XlsAdapter

public override void MergeCells(Int32 firstRow, Int32 firstCol, Int32 lastRow, Int32 lastCol)

Parameters

<-> | Parameter | Type | Description
 | firstRow | Int32 | First row of the merged cell.
 | firstCol | Int32 | First column of the merged cell.
 | lastRow | Int32 | Last row of the merged cell.
 | lastCol | Int32 | Last column of the merged cell.

See also

  • XlsFile
  • ExcelFile.CellMergedBounds
  • ExcelFile.UnMergeCells
  • ExcelFile.CellMergedListCount
  • ExcelFile.CellMergedList


XlsFile.UnMergeCells Method | FlexCel Studio for the .NET Framework documentation

XlsFile.UnMergeCells Method

Unmerges the range of cells. The coordinates have to be exact, if there is no merged cell with the exact coordinates, nothing will be done. If you want to unmerge all cells inside a range, use ExcelFile.UnMergeAllCellsInRange instead.

Syntax

Namespace: FlexCel.XlsAdapter

public override void UnMergeCells(Int32 firstRow, Int32 firstCol, Int32 lastRow, Int32 lastCol)

Parameters

<-> | Parameter | Type | Description
 | firstRow | Int32 | First row of the merged cell.
 | firstCol | Int32 | First column of the merged cell.
 | lastRow | Int32 | Last row of the merged cell.
 | lastCol | Int32 | Last column of the merged cell.

See also

  • XlsFile
  • ExcelFile.CellMergedBounds
  • ExcelFile.MergeCells
  • ExcelFile.CellMergedListCount
  • ExcelFile.CellMergedList


XlsFile.UnMergeAllCellsInRange Method | FlexCel Studio for the .NET Framework documentation

XlsFile.UnMergeAllCellsInRange Method

This method will unmerge all the cells that are inside a range of cells.

Syntax

Namespace: FlexCel.XlsAdapter

public override void UnMergeAllCellsInRange(Int32 firstRow, Int32 firstCol, Int32 lastRow, Int32 lastCol, Boolean fullyInside)

Parameters

<-> | Parameter | Type | Description
 | firstRow | Int32 | First row of the range.
 | firstCol | Int32 | First column of the range.
 | lastRow | Int32 | Last row of the range.
 | lastCol | Int32 | Last column of the range.
 | fullyInside | Boolean | If true, the merged cells have to be completely inside the range to be deleted. For example, if the file has a merged cell A1:A5, and you call UnMergeAllCellsInRange(1, 1, 1, 1, true) A1:A5 won't be unmerged because it isn't completely inside the range. If false, all merged cells that have at least one cell inside the range will be deleted. In the example with the merged cell A1:A5, UnMergeAllCellsInRange(1, 1, 1, 1, false) would remove the merged cell, because it has the cell A1 inside the range.

See also

  • XlsFile


XlsFile.CellMergedList Method | FlexCel Studio for the .NET Framework documentation

XlsFile.CellMergedList Method

The Merged cell at position index on the mergedcell list.

Syntax

Namespace: FlexCel.XlsAdapter

public override TXlsCellRange CellMergedList(Int32 index)

Parameters

<-> | Parameter | Type | Description
 | index | Int32 | index on the list (1 based)

Returns

The merged cell at position index.

See also

  • XlsFile
  • ExcelFile.CellMergedListCount


XlsFile.CellMergedNext Method | FlexCel Studio for the .NET Framework documentation

XlsFile.CellMergedNext Method

Use this method to enumerate all merged cells in a sheet.

Syntax

Namespace: FlexCel.XlsAdapter

public override TXlsCellRange CellMergedNext(ref TCellMergedState state)

Parameters

<-> | Parameter | Type | Description
ref | state | TCellMergedState | This struct holds the current merged cell being enumerated and is used by the method to return the next cell in the enumeration. To get the first value, create it with TCellMergedState.Init()

Returns

The next merged cell in the sheet.

See also

  • XlsFile


XlsFile.GetRowCount Method | FlexCel Studio for the .NET Framework documentation

XlsFile.GetRowCount Method

Number of rows actually used on a given sheet.

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 GetRowCount(Int32 sheet)

Parameters

<-> | Parameter | Type | Description
 | sheet | Int32 |

See also

  • XlsFile


XlsFile.GetColCount Method | FlexCel Studio for the .NET Framework documentation

XlsFile.GetColCount Method

Number of columns actually used on a given sheet.

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 GetColCount(Int32 sheet, Boolean includeFormattedColumns)

Parameters

<-> | Parameter | Type | Description
 | sheet | Int32 | Sheet index where you want to find the columns (1 based)
 | includeFormattedColumns | Boolean | If true (the default) formatted columns (for example a column you selected and painted yellow) will be included in the count, even if it doesn't have data.

See also

  • XlsFile


XlsFile.IsEmptyRow Method | FlexCel Studio for the .NET Framework documentation

XlsFile.IsEmptyRow Method

True if the specified row does not have any cells, nor any format on it. In short, this row has never been used.

Syntax

Namespace: FlexCel.XlsAdapter

public override Boolean IsEmptyRow(Int32 row)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row to test (1-based)

See also

  • XlsFile


XlsFile.IsNotFormattedCol Method | FlexCel Studio for the .NET Framework documentation

XlsFile.IsNotFormattedCol Method

True if the specified column does not have any format applied on it.

Syntax

Namespace: FlexCel.XlsAdapter

public override Boolean IsNotFormattedCol(Int32 col)

Parameters

<-> | Parameter | Type | Description
 | col | Int32 | Column to test (1-based)

See also

  • XlsFile


XlsFile.GetRowFormat Method | FlexCel Studio for the .NET Framework documentation

XlsFile.GetRowFormat Method

Overloads

  • XlsFile.GetRowFormat(Int32)
  • XlsFile.GetRowFormat(Int32, Int32)

XlsFile.GetRowFormat(Int32)

Gets the XF format for the specified row, -1 if the row doesn't have format.

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 GetRowFormat(Int32 row)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row index (1-based)

Returns

XF format.

See also

  • XlsFile

XlsFile.GetRowFormat(Int32, Int32)

Gets the XF format for the specified row, -1 if the row doesn't have format.

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 GetRowFormat(Int32 sheet, Int32 row)

Parameters

<-> | Parameter | Type | Description
 | sheet | Int32 | Sheet index (1 based).
 | row | Int32 | Row index (1-based)

Returns

XF format.

See also

  • XlsFile


XlsFile.SetRowFormat Method | FlexCel Studio for the .NET Framework documentation

XlsFile.SetRowFormat Method

Overloads

  • XlsFile.SetRowFormat(Int32, Int32, Boolean)
  • XlsFile.SetRowFormat(Int32, TFlxFormat, TFlxApplyFormat, Boolean)

XlsFile.SetRowFormat(Int32, Int32, Boolean)

Sets the XF format for the entire row.

Syntax

Namespace: FlexCel.XlsAdapter

public override void SetRowFormat(Int32 row, Int32 XF, Boolean resetRow)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row index (1-based)
 | XF | Int32 | XF format.
 | resetRow | Boolean | When true, all existing cells on the row will be reset to this format. This is the standard Excel behavior and the recommended option. If you don't care about existing cells, you can speed up this method by setting it to false.

See also

  • XlsFile

XlsFile.SetRowFormat(Int32, TFlxFormat, TFlxApplyFormat, Boolean)

Sets the format characteristics specified in ApplyFormat for the entire row.

Syntax

Namespace: FlexCel.XlsAdapter

public override void SetRowFormat(Int32 row, TFlxFormat newFormat, TFlxApplyFormat applyNewFormat, Boolean resetRow)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row index (1-based)
 | newFormat | TFlxFormat | Format to apply.
 | applyNewFormat | TFlxApplyFormat | Indicates which properties of newFormat will be applied to the cells.
 | resetRow | Boolean | When true, all existing cells on the row will be reset to this format. This is the standard Excel behavior and the recommended option. If you don't care about existing cells, you can speed up this method by setting it to false.

See also

  • XlsFile


XlsFile.GetColFormat Method | FlexCel Studio for the .NET Framework documentation

XlsFile.GetColFormat Method

Overloads

  • XlsFile.GetColFormat(Int32)
  • XlsFile.GetColFormat(Int32, Int32)

XlsFile.GetColFormat(Int32)

Gets the XF format for the specified column, -1 if the column doesn't have format.

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 GetColFormat(Int32 col)

Parameters

<-> | Parameter | Type | Description
 | col | Int32 | Column index (1-based)

Returns

XF format.

See also

  • XlsFile

XlsFile.GetColFormat(Int32, Int32)

Gets the XF format for the specified column, -1 if the column doesn't have format.

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 GetColFormat(Int32 sheet, Int32 col)

Parameters

<-> | Parameter | Type | Description
 | sheet | Int32 | Sheet index (1 based).
 | col | Int32 | Column index (1-based)

Returns

XF format.

See also

  • XlsFile


XlsFile.SetColFormat Method | FlexCel Studio for the .NET Framework documentation

XlsFile.SetColFormat Method

Overloads

  • XlsFile.SetColFormat(Int32, Int32, Boolean)
  • XlsFile.SetColFormat(Int32, Int32, Int32, Boolean)
  • XlsFile.SetColFormat(Int32, TFlxFormat, TFlxApplyFormat, Boolean)

XlsFile.SetColFormat(Int32, Int32, Boolean)

Sets the format for an entire column. If you want to set the format for more than one column, use ExcelFile.SetColFormat(Int32, Int32, Int32, Boolean) instead.

Syntax

Namespace: FlexCel.XlsAdapter

public override void SetColFormat(Int32 col, Int32 XF, Boolean resetColumn)

Parameters

<-> | Parameter | Type | Description
 | col | Int32 | Column to set.
 | XF | Int32 | XF Format index.
 | resetColumn | Boolean | When true, all existing cells on the column will be reset to this format. This is the standard Excel behavior and the recommended option. If you don't care about existing cells, you can speed up this method by setting it to false.

See also

  • XlsFile

XlsFile.SetColFormat(Int32, Int32, Int32, Boolean)

Sets the format for a range of columns.

Syntax

Namespace: FlexCel.XlsAdapter

public override void SetColFormat(Int32 col1, Int32 col2, Int32 XF, Boolean resetColumn)

Parameters

<-> | Parameter | Type | Description
 | col1 | Int32 | First column in the range to set.
 | col2 | Int32 | Last column in the range to set.
 | XF | Int32 | XF Format index.
 | resetColumn | Boolean | When true, all existing cells on the column will be reset to this format. This is the standard Excel behavior and the recommended option. If you don't care about existing cells, you can speed up this method by setting it to false.

See also

  • XlsFile

XlsFile.SetColFormat(Int32, TFlxFormat, TFlxApplyFormat, Boolean)

Sets the format characteristics specified in ApplyFormat for the entire column.

Syntax

Namespace: FlexCel.XlsAdapter

public override void SetColFormat(Int32 col, TFlxFormat newFormat, TFlxApplyFormat applyNewFormat, Boolean resetColumn)

Parameters

<-> | Parameter | Type | Description
 | col | Int32 | Column to set.
 | newFormat | TFlxFormat | Format to apply.
 | applyNewFormat | TFlxApplyFormat | Indicates which properties of newFormat will be applied to the cells.
 | resetColumn | Boolean | When true, all existing cells on the column will be reset to this format. This is the standard Excel behavior and the recommended option. If you don't care about existing cells, you can speed up this method by setting it to false.

See also

  • XlsFile


XlsFile.GetRowOptions Method | FlexCel Studio for the .NET Framework documentation

XlsFile.GetRowOptions Method

Returns all Row options at once (if the row is autosize, if it is hidden, etc).

Remarks

To get individual values, use the corresponding methods (i.e. ExcelFile.GetAutoRowHeight) Use this method only to copy the options from one row to another.

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 GetRowOptions(Int32 row)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row Index (1 based)

Returns

Row options

Examples

To copy all the row options from row 1 to 2, use

    xls.SetRowOptions(2, xls.GetRowOptions(1));

This is faster and simpler than assigning each option alone.

See also

  • XlsFile


XlsFile.SetRowOptions Method | FlexCel Studio for the .NET Framework documentation

XlsFile.SetRowOptions Method

Sets all Row options at once (if the row is autosize, if it is hidden, etc).

Remarks

To set individual values, use the corresponding methods (i.e. ExcelFile.SetAutoRowHeight) Use this method only to copy the options from one row to another.

Syntax

Namespace: FlexCel.XlsAdapter

public override void SetRowOptions(Int32 row, Int32 options)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row Index (1 based)
 | options | Int32 | A flag with all row options

Examples

To copy all the row options from row 1 to 2, use

    xls.SetRowOptions(2, xls.GetRowOptions(1));

This is faster and simpler than assigning each option one by one.

See also

  • XlsFile


XlsFile.GetColOptions Method | FlexCel Studio for the .NET Framework documentation

XlsFile.GetColOptions Method

Returns all Column options at once (if the column is hidden, etc).

Remarks

To get individual values, use the corresponding methods (i.e. ExcelFile.GetColHidden) Use this method only to copy the options from one column to another.

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 GetColOptions(Int32 col)

Parameters

<-> | Parameter | Type | Description
 | col | Int32 | Column Index (1 based)

Examples

To copy all the column options from column 1 to 2, use

    xls.SetColOptions(2, xls.GetColOptions(1));

This is faster and simpler than assigning each option alone.

See also

  • XlsFile


XlsFile.SetColOptions Method | FlexCel Studio for the .NET Framework documentation

XlsFile.SetColOptions Method

Sets all Column options at once (if the column is hidden, etc).

Remarks

To set individual values, use the corresponding methods (i.e. ExcelFile.SetColHidden(Int32, Int32, Boolean)) Use this method only to copy the options from one column to another.

Syntax

Namespace: FlexCel.XlsAdapter

public override void SetColOptions(Int32 col, Int32 options)

Parameters

<-> | Parameter | Type | Description
 | col | Int32 | Column Index (1 based)
 | options | Int32 | A flag with all column options.

Examples

To copy all the column options from column 1 to 2, use

    xls.SetColOptions(2, xls.GetColOptions(1));

This is faster and simpler than assigning each option alone.

See also

  • XlsFile


XlsFile.GetRowHeight Method | FlexCel Studio for the .NET Framework documentation

XlsFile.GetRowHeight Method

Overloads

  • XlsFile.GetRowHeight(Int32)
  • XlsFile.GetRowHeight(Int32, Int32, Boolean)

XlsFile.GetRowHeight(Int32)

Returns the current Row height, in Excel internal units. (1/20th of a point) See Excel Internal Units for more information in Excel internal units.

Remarks

Use FlxConsts.RowMult to convert the internal units to pixels.

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 GetRowHeight(Int32 row)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row Index (1 based)

Returns

Row height in internal excel units.

Examples

    double RowHeightInPixels = xls.GetRowHeight(Row) / FlxConsts.RowMult;

See also

  • XlsFile

XlsFile.GetRowHeight(Int32, Int32, Boolean)

Returns the current Row height for a given sheet, in Excel internal units. (1/20th of a point) See Excel Internal Units for more information in Excel internal units.

Remarks

Use FlxConsts.RowMult to convert the internal units to pixels.

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 GetRowHeight(Int32 sheet, Int32 row, Boolean HiddenIsZero)

Parameters

<-> | Parameter | Type | Description
 | sheet | Int32 | Sheet where to look for the height.
 | row | Int32 | Row Index (1 based)
 | HiddenIsZero | Boolean | If true, the height returned for a hidden row will be 0 and not its real height.

Returns

Row height in internal Excel units.(1/20th of a point)

Examples

    double RowHeightInPixels = xls.GetRowHeight(Row) / FlxConsts.RowMult;

See also

  • XlsFile


XlsFile.SetRowHeight Method | FlexCel Studio for the .NET Framework documentation

XlsFile.SetRowHeight Method

Sets the current Row height, in Excel internal units. (1/20th of a point) See Excel Internal Units for more information in Excel internal units.

Remarks

Use FlxConsts.RowMult to convert the internal units to pixels.

Syntax

Namespace: FlexCel.XlsAdapter

public override void SetRowHeight(Int32 row, Int32 height)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row Index (1 based)
 | height | Int32 | Row height, in Excel internal units. (1/20th of a point). See FlxConsts.RowMult

Examples

    double RowHeightInPixels = xls.GetRowHeight(Row) / FlxConsts.RowMult;

See also

  • XlsFile


XlsFile.GetColWidth Method | FlexCel Studio for the .NET Framework documentation

XlsFile.GetColWidth Method

Overloads

  • XlsFile.GetColWidth(Int32)
  • XlsFile.GetColWidth(Int32, Boolean)
  • XlsFile.GetColWidth(Int32, Int32, Boolean)

XlsFile.GetColWidth(Int32)

Returns the current Column width, in Excel internal units. (Character width of "font 0" / 256) See Excel Internal Units for more information in Excel internal units.

Remarks

Use ExcelMetrics.ColMult to convert the internal units to pixels.

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 GetColWidth(Int32 col)

Parameters

<-> | Parameter | Type | Description
 | col | Int32 | Column Index (1 based)

Returns

Column width in internal excel units.(Character width of "font 0" / 256)

Examples

    double ColWidthInPixels = xls.GetColWidth(Col) / ExcelMetrics.ColMult(xls);

See also

  • XlsFile

XlsFile.GetColWidth(Int32, Boolean)

Returns the current Column width, in Excel internal units. (Character width of font 0 / 256) See Excel Internal Units for more information in Excel internal units.

Remarks

Use ExcelMetrics.ColMult to convert the internal units to pixels.

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 GetColWidth(Int32 col, Boolean HiddenIsZero)

Parameters

<-> | Parameter | Type | Description
 | col | Int32 | Column Index (1 based)
 | HiddenIsZero | Boolean | If true, the width returned for a hidden column will be 0 and not its real width.

Returns

Column width in internal excel units.(Character width of font 0 / 256)

Examples

    double ColWidthInPixels = xls.GetColWidth(Col) / ExcelMetrics.ColMult(xls);

See also

  • XlsFile

XlsFile.GetColWidth(Int32, Int32, Boolean)

Returns the current Column width for a given sheet, in Excel internal units. (Character width of font 0 / 256) See Excel Internal Units for more information in Excel internal units.

Remarks

Use ExcelMetrics.ColMult to convert the internal units to pixels.

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 GetColWidth(Int32 sheet, Int32 col, Boolean HiddenIsZero)

Parameters

<-> | Parameter | Type | Description
 | sheet | Int32 | Sheet where to look for the width.
 | col | Int32 | Column Index (1 based)
 | HiddenIsZero | Boolean | If true, the width returned for a hidden column will be 0 and not its real width.

Returns

Column width in internal excel units.(Character width of font 0 / 256)

Examples

    double ColWidthInPixels = xls.GetColWidth(Col) / ExcelMetrics.ColMult(xls);

See also

  • XlsFile


XlsFile.SetColWidth Method | FlexCel Studio for the .NET Framework documentation

XlsFile.SetColWidth Method

Overloads

  • XlsFile.SetColWidth(Int32, Int32)
  • XlsFile.SetColWidth(Int32, Int32, Int32)

XlsFile.SetColWidth(Int32, Int32)

Sets the current Column width, in Excel internal units. (Character width of font 0 / 256) Note: if possible, set many column widths at once by calling ExcelFile.SetColWidth(Int32, Int32, Int32). It is faster. See Excel Internal Units for more information in Excel internal units.

Remarks

Use ExcelMetrics.ColMult to convert the internal units to pixels.

Syntax

Namespace: FlexCel.XlsAdapter

public override void SetColWidth(Int32 col, Int32 width)

Parameters

<-> | Parameter | Type | Description
 | col | Int32 | Column index (1 based)
 | width | Int32 | Column width, in Excel internal units. (Character width of font 0 / 256). See ExcelMetrics.ColMult

Examples

    double ColWidthInPixels = xls.GetColWidth(Col) / ExcelMetrics.ColMult(xls);

See also

  • XlsFile

XlsFile.SetColWidth(Int32, Int32, Int32)

Sets the width of a range of columns, in Excel internal units. (Character width of font 0 / 256) See Excel Internal Units for more information in Excel internal units.

Remarks

Use ExcelMetrics.ColMult to convert the internal units to pixels.

Syntax

Namespace: FlexCel.XlsAdapter

public override void SetColWidth(Int32 col1, Int32 col2, Int32 width)

Parameters

<-> | Parameter | Type | Description
 | col1 | Int32 | Column index of the first column in the range. (1 based)
 | col2 | Int32 | Column index of the last column in the range. (1 based)
 | width | Int32 | Column width, in Excel internal units. (Character width of font 0 / 256). See ExcelMetrics.ColMult

Examples

    double ColWidthInPixels = xls.GetColWidth(Col) / ExcelMetrics.ColMult(xls);

See also

  • XlsFile


XlsFile.DefaultRowHeightVisual Method | FlexCel Studio for the .NET Framework documentation

XlsFile.DefaultRowHeightVisual Method

The default height for empty rows, in Excel internal units. (1/20th of a point). Different from ExcelFile.DefaultRowHeight this property returns the actual row height as Excel will show it, considering ExcelFile.DefaultRowHidden and ExcelFile.DefaultRowHeightAutomatic. See Excel Internal Units for more information in Excel internal units.

Remarks

Use FlxConsts.RowMult to convert the internal units to pixels.

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 DefaultRowHeightVisual(Boolean useDefaultRowHeightAutomatic)

Parameters

<-> | Parameter | Type | Description
 | useDefaultRowHeightAutomatic | Boolean | If false, the property ExcelFile.DefaultRowHeightAutomatic will be ignored and considered false. In many cases you will prefer to use the default row height stored in the file, even if DefaultRowHeightAutomatic is true.

Examples

    double RowHeightInPixels = xls.GetRowHeight(Row) / FlxConsts.RowMult;

See also

  • XlsFile


XlsFile.GetRowHidden Method | FlexCel Studio for the .NET Framework documentation

XlsFile.GetRowHidden Method

Overloads

  • XlsFile.GetRowHidden(Int32)
  • XlsFile.GetRowHidden(Int32, Int32)

XlsFile.GetRowHidden(Int32)

Returns true if the row is hidden.

Syntax

Namespace: FlexCel.XlsAdapter

public override Boolean GetRowHidden(Int32 row)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row index (1 based).

Returns

True if the row is hidden.

See also

  • XlsFile

XlsFile.GetRowHidden(Int32, Int32)

Returns true if the row is hidden. This method does not care about ActiveSheet.

Syntax

Namespace: FlexCel.XlsAdapter

public override Boolean GetRowHidden(Int32 sheet, Int32 row)

Parameters

<-> | Parameter | Type | Description
 | sheet | Int32 | Sheet index (1 based) for the row.
 | row | Int32 | Row index (1 based).

Returns

True if the row is hidden.

See also

  • XlsFile


XlsFile.SetRowHidden Method | FlexCel Studio for the .NET Framework documentation

XlsFile.SetRowHidden Method

Hides or shows a specific row.

Syntax

Namespace: FlexCel.XlsAdapter

public override void SetRowHidden(Int32 row, Boolean hide)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row index (1 based)
 | hide | Boolean | If true, row will be hidden, if false it will be visible.

See also

  • XlsFile


XlsFile.GetColHidden Method | FlexCel Studio for the .NET Framework documentation

XlsFile.GetColHidden Method

Returns true if the column is hidden.

Syntax

Namespace: FlexCel.XlsAdapter

public override Boolean GetColHidden(Int32 col)

Parameters

<-> | Parameter | Type | Description
 | col | Int32 | Column index (1 based)

Returns

True if the column is hidden.

See also

  • XlsFile


XlsFile.SetColHidden Method | FlexCel Studio for the .NET Framework documentation

XlsFile.SetColHidden Method

Overloads

  • XlsFile.SetColHidden(Int32, Boolean)
  • XlsFile.SetColHidden(Int32, Int32, Boolean)

XlsFile.SetColHidden(Int32, Boolean)

Hides or shows a specific column. Note: If you are hiding many columns at the same time, you can call ExcelFile.SetColHidden(Int32, Int32, Boolean) as it is faster.

Syntax

Namespace: FlexCel.XlsAdapter

public override void SetColHidden(Int32 col, Boolean hide)

Parameters

<-> | Parameter | Type | Description
 | col | Int32 | Column index (1 based).
 | hide | Boolean | If true, column will be hidden, if false it will be visible.

See also

  • XlsFile

XlsFile.SetColHidden(Int32, Int32, Boolean)

Hides or shows a range of columns.

Syntax

Namespace: FlexCel.XlsAdapter

public override void SetColHidden(Int32 col1, Int32 col2, Boolean hide)

Parameters

<-> | Parameter | Type | Description
 | col1 | Int32 | Column index of the first column in the range. (1 based)
 | col2 | Int32 | Column index of the last column in the range. (1 based)
 | hide | Boolean | If true, column will be hidden, if false it will be visible.

See also

  • XlsFile


XlsFile.GetAutoRowHeight Method | FlexCel Studio for the .NET Framework documentation

XlsFile.GetAutoRowHeight Method

Returns if the row is adjusting its size to the cell (the default) or if it has a fixed height.

Remarks

By default, Excel rows auto adapt their size to the font size. If you set the row height manually, it will remain fixed to this size until you set AutoFit (Menu->Format->Row->AutoFit) back.

Syntax

Namespace: FlexCel.XlsAdapter

public override Boolean GetAutoRowHeight(Int32 row)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row index (1-based)

Returns

True if AutoFit is on for the row, False if it has a fixed size

See also

  • XlsFile


XlsFile.SetAutoRowHeight Method | FlexCel Studio for the .NET Framework documentation

XlsFile.SetAutoRowHeight Method

Sets the current row to automatically autosize to the biggest cell or not.

Remarks

By default, Excel rows auto adapt their size to the font size. If you set the row height manually, it will remain fixed to this size until you set AutoFit (Menu->Format->Row->AutoFit) back.

Syntax

Namespace: FlexCel.XlsAdapter

public override void SetAutoRowHeight(Int32 row, Boolean autoRowHeight)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row index (1-based)
 | autoRowHeight | Boolean | If true, row will have autofit.

See also

  • XlsFile


XlsFile.AutofitRow Method | FlexCel Studio for the .NET Framework documentation

XlsFile.AutofitRow Method

Autofits a range of rows so they adapt their height to show all the text inside. Note that due to GDI+ / GDI incompatibilities, the height calculated by FlexCel will not be exactly the same than the one calculated by Excel. So when you open this workbook in Excel, Excel will re calculate the row heights to what it believes is best. You can change this behavior specifying keepHeightAutomatic = false. See also Fine Tuning Row Autofitting

Syntax

Namespace: FlexCel.XlsAdapter

public override void AutofitRow(Int32 row1, Int32 row2, Int32 minCol, Int32 maxCol, Boolean autofitNotAutofittingRows, Boolean keepHeightAutomatic, Double adjustment, Int32 adjustmentFixed, Int32 minHeight, Int32 maxHeight, TAutofitMerged autofitMerged)

Parameters

<-> | Parameter | Type | Description
 | row1 | Int32 | First row to autofit.
 | row2 | Int32 | Last row to autofit.
 | minCol | Int32 | First column that will be used to calculate the height of the row. If for example you wanted to calculate the row height based in the contents of the columns 3 to 9, you would specify 3 here.
 | maxCol | Int32 | Last column that will be used to calculate the height of the row. If for example you wanted to calculate the row height based in the contents of the columns 3 to 9, you would specify 9 here. Specify any value <=0 here to use all columns for the autofit.
 | autofitNotAutofittingRows | Boolean | When you are autofitting a range of rows, some rows might not be set to Autofit in Excel. When this parameter is true, those rows will be autofitted anyway.
 | keepHeightAutomatic | Boolean | If true, rows will be still autoheight when you open the file in Excel, so Excel will recalculate the values, probably changing the page breaks. If you set it to false, rows will be fixed in size, and when you open it on Excel they will remain so.
 | adjustment | Double | You will normally want to set this parameter to 1, which means that autofit will be made with standard measurements. If you set it to for example 1.1, then rows will be adjusted to 110% percent of what their calculated height was. Use this parameter to fine-tune autofiting, if for example rows are too small when opening the file in Excel.
 | adjustmentFixed | Int32 | You will normally set this parameter to 0, which means standard autofit. If you set it to a value, the row will be made larger by that amount from the calculated autofit. Different from the "adjustment" parameter, this parameter adds a fixed size to the row and not a percentage. The final size of the row will be: FinalSize = CalulatedAutoFit * adjustment + adjusmentFixed
 | minHeight | Int32 | Minimum final height for the row to autofit. If the calculated value is less than minHeight, row size will be set to minHeight. A negative value on minHeight means the row size will be no smaller than the original height.
 | maxHeight | Int32 | Maximum final height for the row to autofit. If the calculated value is more than maxHeight, row size will be set to maxHeight. maxHeight = 0 means no maxHeight. A negative value on maxHeight means the row size will be no bigger than the original height.
 | autofitMerged | TAutofitMerged | Specifies which row in a merged cell using more than one row will be used to autofit the merged cell. If you don't specify this parameter, it will be the last row.

See also

  • XlsFile


XlsFile.AutofitCol Method | FlexCel Studio for the .NET Framework documentation

XlsFile.AutofitCol Method

Autofits a range of columns so they adapt their width to show all the text inside.

Syntax

Namespace: FlexCel.XlsAdapter

public override void AutofitCol(Int32 col1, Int32 col2, Int32 minRow, Int32 maxRow, Boolean ignoreStrings, Double adjustment, Int32 adjustmentFixed, Int32 minWidth, Int32 maxWidth, TAutofitMerged autofitMerged)

Parameters

<-> | Parameter | Type | Description
 | col1 | Int32 | First column to Autofit.
 | col2 | Int32 | Last column to Autofit.
 | minRow | Int32 | First row that will be used to autofit the column. If you want for example to autofit a column based only in the cells from row 3 to 10, you would use 3 as minRow.
 | maxRow | Int32 | Last row that will be used to autofit the column. If you want for example to autofit a column based only in the cells from row 3 to 10, you would use 10 as maxRow. Specify any value <=0 here to use all rows for the autofit.
 | ignoreStrings | Boolean | When true, strings will not be considered for the autofit. Only numbers will.
 | adjustment | Double | You will normally want to set this parameter to 1, which means that autofit will be made with standard measurements. If you set it to for example 1.1, then columns will be adjusted to 110% percent of what their calculated width was. Use this parameter to fine-tune autofiting, if for example columns are too small when opening the file in Excel.
 | adjustmentFixed | Int32 | You will normally set this parameter to 0, which means standard autofit. If you set it to a value, the column will be made larger by that amount from the calculated autofit. Different from the "adjustment" parameter, this parameter adds a fixed size to the column and not a percentage. The final size of the column will be: FinalSize = CalulatedAutoFit * adjustment + adjusmentFixed
 | minWidth | Int32 | Minimum final width for the column to autofit. If the calculated value is less than minWidth, column size will be set to minWidth. A negative value on minWidth means the column size will be no smaller than the original width.
 | maxWidth | Int32 | Maximum final width for the column to autofit. If the calculated value is more than maxWidth, column size will be set to maxWidth. maxWidth = 0 means no maxWidth. A negative value on maxWidth means the column size will be no bigger than the original width.
 | autofitMerged | TAutofitMerged | Specifies which column in a merged cell using more than one column will be used to autofit the merged cell. If you don't specify this parameter, it will be the last column.

See also

  • XlsFile


XlsFile.AutofitRowsOnWorkbook Method | FlexCel Studio for the .NET Framework documentation

XlsFile.AutofitRowsOnWorkbook Method

Autofits all the rows on all sheets on a workbook that are set to autofit so they adapt their height to show all the text inside. Note that due to GDI+ / GDI incompatibilities, the heights calculated by FlexCel will not be exactly the same than the ones calculated by Excel. So when you open this workbook in Excel, Excel might re calculate the row heights to what it believes is best. You can change this behavior specifying keepSizesAutomatic = false. See also Fine Tuning Row Autofitting

Syntax

Namespace: FlexCel.XlsAdapter

public override void AutofitRowsOnWorkbook(Boolean autofitNotAutofittingRows, Boolean keepSizesAutomatic, Double adjustment, Int32 adjustmentFixed, Int32 minHeight, Int32 maxHeight, TAutofitMerged autofitMerged)

Parameters

<-> | Parameter | Type | Description
 | autofitNotAutofittingRows | Boolean | When you are autofitting a range of rows, some rows might not be set to Autofit in Excel. When this parameter is true, those rows will be autofitted anyway.
 | keepSizesAutomatic | Boolean | When true, no modifications will be done to the "autofit" status of the rows. When false, all rows will be marked as "no autofit", so when you open this file in Excel it will not be resized by Excel, and the printing/export to PDF from Excel will be the same as FlexCel.
 | adjustment | Double | You will normally want to set this parameter to 1, which means that autofit will be made with standard measurements. If you set it to for example 1.1, then rows will be adjusted to 110% percent of what their calculated height was. Use this parameter to fine-tune autofiting, if for example rows are too small when opening the file in Excel.
 | adjustmentFixed | Int32 | You will normally set this parameter to 0, which means standard autofit. If you set it to a value, the row will be made larger by that amount from the calculated autofit. Different from the "adjustment" parameter, this parameter adds a fixed size to the row and not a percentage. The final size of the row will be: FinalSize = CalulatedAutoFit * adjustment + adjusmentFixed
 | minHeight | Int32 | Minimum final height for the row to autofit. If the calculated value is less than minHeight, row size will be set to minHeight. A negative value on minHeight means the row size will be no smaller than the original height.
 | maxHeight | Int32 | Maximum final height for the row to autofit. If the calculated value is more than maxHeight, row size will be set to maxHeight. maxHeight = 0 means no maxHeight. A negative value on maxHeight means the row size will be no bigger than the original height.
 | autofitMerged | TAutofitMerged | Specifies which row in a merged cell using more than one row will be used to autofit the merged cell. If you don't specify this parameter, it will be the last row.

See also

  • XlsFile


XlsFile.MarkRowForAutofit Method | FlexCel Studio for the .NET Framework documentation

XlsFile.MarkRowForAutofit Method

Marks a row as candidate for future autofit. Note that this method will NOT change anything on the file. It just "marks" the row so you can use it later with ExcelFile.AutofitMarkedRowsAndCols(Boolean, Boolean, Double). To change the actual autofit status on the xls file, use ExcelFile.SetAutoRowHeight NOTE: This method will not mark empty rows.

Remarks

You can use this method for "delay-marking" rows that you will want to autofit later, but that you cannot autofit yet since they are not filled with data. There is normally no need to use this method, but it is used on report generation to "mark" <#row height(autofit)> tags so those rows and columns can be autofitted once the data on the sheet has been filled.

Syntax

Namespace: FlexCel.XlsAdapter

public override void MarkRowForAutofit(Int32 row, Boolean autofit, Double adjustment, Int32 adjustmentFixed, Int32 minHeight, Int32 maxHeight, Boolean isMerged)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row index (1 based)
 | autofit | Boolean | Set this to true to mark the row for autofitting, false for removing the row from autofitting list.
 | adjustment | Double | You will normally want to set this parameter to 1, which means that autofit will be made with standard measurements. If you set it to for example 1.1, then rows will be adjusted to 110% percent of what their calculated height was. Use this parameter to fine-tune autofiting, if for example rows are too small when opening the file in Excel.
 | adjustmentFixed | Int32 | You will normally set this parameter to 0, which means standard autofit. If you set it to a value, the row will be made larger by that amount from the calculated autofit. Different from the "adjustment" parameter, this parameter adds a fixed size to the row and not a percentage. The final size of the row will be: FinalSize = CalulatedAutoFit * adjustment + adjusmentFixed
 | minHeight | Int32 | Minimum final height for the row to autofit. If the calculated value is less than minHeight, row size will be set to minHeight. A negative value on minHeight means the row size will be no smaller than the original height.
 | maxHeight | Int32 | Maximum final height for the row to autofit. If the calculated value is more than maxHeight, row size will be set to maxHeight. maxHeight = 0 means no maxHeight. A negative value on maxHeight means the row size will be no bigger than the original height.
 | isMerged | Boolean | If true, only the cell will be autofitted, not the whole row.

See also

  • XlsFile


XlsFile.MarkColForAutofit Method | FlexCel Studio for the .NET Framework documentation

XlsFile.MarkColForAutofit Method

Marks a column as candidate for future autofit. Note that this method will NOT change anything on the file. It just "marks" the column so you can use it later with ExcelFile.AutofitMarkedRowsAndCols(Boolean, Boolean, Double).

Remarks

You can use this method for "delay-marking" columns that you will want to autofit later, but that you cannot autofit yet since they are not filled with data.There is normally no need to use this method, but it is used on report generation to "mark" <#col width(autofit)> tags so those rows and columns can be autofitted once the data on the sheet has been filled.

Syntax

Namespace: FlexCel.XlsAdapter

public override void MarkColForAutofit(Int32 col, Boolean autofit, Double adjustment, Int32 adjustmentFixed, Int32 minWidth, Int32 maxWidth, Boolean isMerged)

Parameters

<-> | Parameter | Type | Description
 | col | Int32 | Column index (1 based)
 | autofit | Boolean | Set this to true to mark the column for autofitting, false for removing the column from autofitting list.
 | adjustment | Double | You will normally want to set this parameter to 1, which means that autofit will be made with standard measurements. If you set it to for example 1.1, then columns will be adjusted to 110% percent of what their calculated width was. Use this parameter to fine-tune autofiting, if for example columns are too small when opening the file in Excel.
 | adjustmentFixed | Int32 | You will normally set this parameter to 0, which means standard autofit. If you set it to a value, the row will be made larger by that amount from the calculated autofit. Different from the "adjustment" parameter, this parameter adds a fixed size to the column and not a percentage. The final size of the column will be: FinalSize = CalulatedAutoFit * adjustment + adjusmentFixed
 | minWidth | Int32 | Minimum final width for the column to autofit. If the calculated value is less than minWidth, column size will be set to minWidth. A negative value on minWidth means the column size will be no smaller than the original width.
 | maxWidth | Int32 | Maximum final width for the column to autofit. If the calculated value is more than maxWidth, column size will be set to maxWidth. maxWidth = 0 means no maxWidth. A negative value on maxWidth means the column size will be no bigger than the original width.
 | isMerged | Boolean | If true, only the cell will be autofitted, not the whole column.

See also

  • XlsFile


XlsFile.IsRowMarkedForAutofit Method | FlexCel Studio for the .NET Framework documentation

XlsFile.IsRowMarkedForAutofit Method

Returns true is a row is marked for autofit.

Syntax

Namespace: FlexCel.XlsAdapter

public override Boolean IsRowMarkedForAutofit(Int32 row)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row number(1 based)

See also

  • XlsFile


XlsFile.IsColMarkedForAutofit Method | FlexCel Studio for the .NET Framework documentation

XlsFile.IsColMarkedForAutofit Method

Returns true is a column is marked for autofit.

Syntax

Namespace: FlexCel.XlsAdapter

public override Boolean IsColMarkedForAutofit(Int32 col)

Parameters

<-> | Parameter | Type | Description
 | col | Int32 | Column number(1 based)

See also

  • XlsFile


XlsFile.AutofitMarkedRowsAndCols Method | FlexCel Studio for the .NET Framework documentation

XlsFile.AutofitMarkedRowsAndCols Method

Autofits all the rows and columns on a sheet that have been previously marked with the ExcelFile.MarkRowForAutofit(Int32, Boolean, Double) and ExcelFile.MarkColForAutofit(Int32, Boolean, Double) methods.

Syntax

Namespace: FlexCel.XlsAdapter

public override void AutofitMarkedRowsAndCols(Boolean keepSizesAutomatic, Boolean ignoreStringsOnColumnFit, Double adjustment, Int32 adjustmentFixed, Int32 minHeight, Int32 maxHeight, Int32 minWidth, Int32 maxWidth, TAutofitMerged autofitMerged)

Parameters

<-> | Parameter | Type | Description
 | keepSizesAutomatic | Boolean | When true, no modifications will be done to the "autofit" status of the rows. When false, all rows will be marked as "no autofit", so when you open this file in Excel it will not be resized by Excel, and the sizes when printing/export to PDF from Excel will be the same as FlexCel, even when some cells might appear "cut" when printing on Excel.
 | ignoreStringsOnColumnFit | Boolean | When true, cells containing strings will not be autofitted.
 | adjustment | Double | You will normally want to set this parameter to 1, which means that autofit will be made with standard measurements. If you set it to for example 1.1, then columns and rows will be adjusted to 110% percent of what their calculated width and height was. Use this parameter to fine-tune autofiting, if for example columns are too small when opening the file in Excel.
 | adjustmentFixed | Int32 | You will normally set this parameter to 0, which means standard autofit. If you set it to a value, the row will be made larger by that amount from the calculated autofit. Different from the "adjustment" parameter, this parameter adds a fixed size to the row and not a percentage. The final size of the row will be: FinalSize = CalulatedAutoFit * adjustment + adjusmentFixed
 | minHeight | Int32 | Minimum final height for the row to autofit. If the calculated value is less than minHeight, row size will be set to minHeight. A negative value on minHeight means the row size will be no smaller than the original height.
 | maxHeight | Int32 | Maximum final height for the row to autofit. If the calculated value is more than maxHeight, row size will be set to maxHeight. maxHeight = 0 means no maxHeight. A negative value on maxHeight means the row size will be no bigger than the original height.
 | minWidth | Int32 | Minimum final width for the column to autofit. If the calculated value is less than minWidth, column size will be set to minWidth. A negative value on minWidth means the column size will be no smaller than the original width.
 | maxWidth | Int32 | Maximum final width for the column to autofit. If the calculated value is more than maxWidth, column size will be set to maxWidth. maxWidth = 0 means no maxWidth. A negative value on maxWidth means the column size will be no bigger than the original width.
 | autofitMerged | TAutofitMerged | Specifies which row in a merged cell using more than one row, or which column in a merged cell with more than one column will be used to autofit the merged cell. If you don't specify this parameter, it will be the last row or column in the merged range.

See also

  • XlsFile


XlsFile.AutofitComment Method | FlexCel Studio for the .NET Framework documentation

XlsFile.AutofitComment Method

Will return the resized anchor so the size of the comment is enough to fit all the text inside.

Syntax

Namespace: FlexCel.XlsAdapter

public override TClientAnchor AutofitComment(TRichString text, Double aspectRatio, Boolean dontShrink, Double adjustment, Double adjustmentFixed, TClientAnchor anchor)

Parameters

<-> | Parameter | Type | Description
 | text | TRichString | Text for the comment.
 | aspectRatio | Double | If you pass 0 as aspect ratio, FlexCel will only resize the height of the comment, keeping the same width as it already had. If you pass another number like 4.0/3.0 or 16.0/10.0, FlexCel will try to create a comment box with that approximate aspect ratio. Note that the ratio won't be the exact aspect ratio, just approximate.
 | dontShrink | Boolean | If true, the box will grow if the text needs more space, but it won't be made smaller if the text fits in a smaller height than the existing anchor.
 | adjustment | Double | The final height will be multiplied by this number. Because of small differences between how FlexCel and Excel render the text, it might happen that the size calculated by FlexCel is smaller than what it needs to be to display correctly in Excel. By setting this number bigger than 1, you can add a margin for those errors.
 | adjustmentFixed | Double | This number will be added to the final calculated height. Use it to add some margin around the comment box.
 | anchor | TClientAnchor |

Returns

The new anchor so the size of the box fits the text.

Examples

This code will add a comment and resize the box so it fits:

    static void AddCommentAndResize(XlsFile xls, double aspectRatio, int row, int col, TRichString text)
    {
        TCommentProperties comProps = TCommentProperties.CreateStandard(row, col, xls); //Create a standard comment box.
        comProps.Anchor = xls.AutofitComment(text, aspectRatio, true, 1.1, 10, comProps.Anchor); //Resize it so it fits the text.
        xls.SetComment(row, col, text, "", comProps); //Add the comment.
    }

    public static void CreateFileWithComment()
    {
        XlsFile xls = new XlsFile(1, TExcelFileFormat.v2021, true);
        AddCommentAndResize(xls, 1.6, 3, 1, "This is a long comment so it won't fit in a standard comment box. " +
          " But by using AutoFitComment, we will resize the box to hold all the text, and have an 1.6 aspect ratio between width and height");
        xls.Save("test.xlsx");
    }

See also

  • XlsFile


XlsFile.ColCountInRow Method | FlexCel Studio for the .NET Framework documentation

XlsFile.ColCountInRow Method

Overloads

  • XlsFile.ColCountInRow(Int32)
  • XlsFile.ColCountInRow(Int32, Int32)

XlsFile.ColCountInRow(Int32)

This method returns the NOT EMPTY cells on ONE ROW.

Note that this is not the full column count, but only the count of those columns that have any data on them for the given row. So for example if in row 2 you have a value in A2 and another in E2, ColCountInRow(2) will return 2 (cells A2 and E2), not 5 (columns from A to E).

You can use this together with ExcelFile.ColFromIndex(Int32, Int32) and ExcelFile.ColToIndex(Int32, Int32) to iterate faster on a block, skipping all empty cells.

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 ColCountInRow(Int32 row)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row index. (1-based)

Returns

The number of existing columns on one row.

Examples

Instead of writing:

    int RowCount = xls.RowCount;
    int ColCount = xls.ColCount;
    for (int row = 1; row <= RowCount; row++)
    {
        for (int col = 1; col <= ColCount; col++) //It would be faster to use ColCountInRow. See https://doc.tmssoftware.com/flexcel/net/guides/performance-guide.html#avoid-calling-colcount
        {
            DoSomething(row, col);
        }
    }

You can use:

    int RowCount = xls.RowCount;
    for (int row = 1; row <= RowCount; row++)
    {
        int ColCountInRow = xls.ColCountInRow(row);
        for (int colIndex = 1; colIndex <= ColCountInRow; colIndex++)
        {
            DoSomething(row, xls.ColFromIndex(row, colIndex));
        }
    }

See also

  • XlsFile
  • ExcelFile.ColFromIndex(Int32, Int32)
  • ExcelFile.ColToIndex(Int32, Int32)
  • ExcelFile.LoopOverUsedRange

XlsFile.ColCountInRow(Int32, Int32)

This method returns the NOT EMPTY cells on ONE ROW, for a given sheet.

Note that this is not the full column count, but only the count of those columns that have any data on them for the given row. So for example if in row 2 you have a value in A2 and another in E2, ColCountInRow(2) will return 2 (cells A2 and E2), not 5 (columns from A to E).

You can use this together with ExcelFile.ColFromIndex(Int32, Int32) and ExcelFile.ColToIndex(Int32, Int32) to iterate faster on a block, skipping all empty cells. Or you can call ExcelFile.LoopOverUsedRange for a method that does the looping for you using those methods.

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 ColCountInRow(Int32 sheet, Int32 row)

Parameters

<-> | Parameter | Type | Description
 | sheet | Int32 | Sheet where we are working. It might be different from ActiveSheet.
 | row | Int32 | Row index. (1-based)

Returns

The number of existing columns on one row.

Examples

Instead of writing:

    int RowCount = xls.RowCount;
    int ColCount = xls.ColCount;
    for (int row = 1; row <= RowCount; row++)
    {
        for (int col = 1; col <= ColCount; col++) //It would be faster to use ColCountInRow. See https://doc.tmssoftware.com/flexcel/net/guides/performance-guide.html#avoid-calling-colcount
        {
            DoSomething(row, col);
        }
    }

You can use:

    int RowCount = xls.RowCount;
    for (int row = 1; row <= RowCount; row++)
    {
        int ColCountInRow = xls.ColCountInRow(row);
        for (int colIndex = 1; colIndex <= ColCountInRow; colIndex++)
        {
            DoSomething(row, xls.ColFromIndex(row, colIndex));
        }
    }

See also

  • XlsFile
  • ExcelFile.ColFromIndex(Int32, Int32)
  • ExcelFile.ColToIndex(Int32, Int32)
  • ExcelFile.LoopOverUsedRange


XlsFile.ColFromIndex Method | FlexCel Studio for the .NET Framework documentation

XlsFile.ColFromIndex Method

Overloads

  • XlsFile.ColFromIndex(Int32, Int32)
  • XlsFile.ColFromIndex(Int32, Int32, Int32)

XlsFile.ColFromIndex(Int32, Int32)

This is the column (1 based) for a given ColIndex. You can use this together with ExcelFile.ColCountInRow(Int32) and ExcelFile.ColToIndex(Int32, Int32) to iterate faster on a block. Or you can call ExcelFile.LoopOverUsedRange for a method that does the looping for you using those methods.

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 ColFromIndex(Int32 row, Int32 colIndex)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row (1 based)
 | colIndex | Int32 | The index on the column list for the row. (1 based)

Returns

The column (1 based) corresponding to the index when the index is inside the bounds. If the index is <= 0 or the index is > ExcelFile.ColCountInRow(Int32), it will return 0.

Examples

Instead of writing:

    int RowCount = xls.RowCount;
    int ColCount = xls.ColCount;
    for (int row = 1; row <= RowCount; row++)
    {
        for (int col = 1; col <= ColCount; col++) //It would be faster to use ColCountInRow. See https://doc.tmssoftware.com/flexcel/net/guides/performance-guide.html#avoid-calling-colcount
        {
            DoSomething(row, col);
        }
    }

You can use:

    int RowCount = xls.RowCount;
    for (int row = 1; row <= RowCount; row++)
    {
        int ColCountInRow = xls.ColCountInRow(row);
        for (int colIndex = 1; colIndex <= ColCountInRow; colIndex++)
        {
            DoSomething(row, xls.ColFromIndex(row, colIndex));
        }
    }

To loop on all the existing cells on a range you can use:

    // Loop at most until the last used row in the sheet.
    // If LastRow is for example 1.000.000, but there are only
    // 3 used rows, it makes no sense to loop over all the empty rows after row 3.
    int LastUsedRow = Math.Min(LastRow, xls.RowCount);

    for (int row = FirstRow; row <= LastUsedRow; row++)
    {
        int LastCIndex = xls.ColToIndex(row, LastColumn);
        int LastColFromIndex = xls.ColFromIndex(row, LastCIndex);
        if (LastColFromIndex > LastColumn || LastColFromIndex == 0) // LastColumn does not exist.
        {
            LastCIndex--;
        }
        if (LastCIndex == 0) continue; // This row is empty. Move to the next row.

        int XF = -1;
        for (int cIndex = xls.ColToIndex(row, FirstColumn); cIndex <= LastCIndex; cIndex++)
        {
            DoSomething(row, xls.ColFromIndex(row, cIndex), xls.GetCellValueIndexed(row, cIndex, ref XF));
        }
    }

Note that this example is the implementation of ExcelFile.LoopOverUsedRange, so you might want to directly call ExcelFile.LoopOverUsedRange instead of pasting this example in your code.

See also

  • XlsFile
  • ExcelFile.ColCountInRow(Int32)
  • ExcelFile.ColToIndex(Int32, Int32)
  • ExcelFile.LoopOverUsedRange

XlsFile.ColFromIndex(Int32, Int32, Int32)

This is the column (1 based) for a given ColIndex and sheet. You can use this together with ExcelFile.ColCountInRow(Int32) and ExcelFile.ColToIndex(Int32, Int32) to iterate faster on a block. Or you can call ExcelFile.LoopOverUsedRange for a method that does the looping for you using those methods.

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 ColFromIndex(Int32 sheet, Int32 row, Int32 colIndex)

Parameters

<-> | Parameter | Type | Description
 | sheet | Int32 | Sheet where we are working. It might be different from ActiveSheet.
 | row | Int32 | Row (1 based)
 | colIndex | Int32 | The index on the column list for the row. (1 based)

Returns

The column (1 based) corresponding to the index when the index is inside the bounds. If the index is <= 0 or the index is > ExcelFile.ColCountInRow(Int32), it will return 0.

Examples

Instead of writing:

    int RowCount = xls.RowCount;
    int ColCount = xls.ColCount;
    for (int row = 1; row <= RowCount; row++)
    {
        for (int col = 1; col <= ColCount; col++) //It would be faster to use ColCountInRow. See https://doc.tmssoftware.com/flexcel/net/guides/performance-guide.html#avoid-calling-colcount
        {
            DoSomething(row, col);
        }
    }

You can use:

    int RowCount = xls.RowCount;
    for (int row = 1; row <= RowCount; row++)
    {
        int ColCountInRow = xls.ColCountInRow(row);
        for (int colIndex = 1; colIndex <= ColCountInRow; colIndex++)
        {
            DoSomething(row, xls.ColFromIndex(row, colIndex));
        }
    }

To loop on all the existing cells on a range you can use:

    // Loop at most until the last used row in the sheet.
    // If LastRow is for example 1.000.000, but there are only
    // 3 used rows, it makes no sense to loop over all the empty rows after row 3.
    int LastUsedRow = Math.Min(LastRow, xls.RowCount);

    for (int row = FirstRow; row <= LastUsedRow; row++)
    {
        int LastCIndex = xls.ColToIndex(row, LastColumn);
        int LastColFromIndex = xls.ColFromIndex(row, LastCIndex);
        if (LastColFromIndex > LastColumn || LastColFromIndex == 0) // LastColumn does not exist.
        {
            LastCIndex--;
        }
        if (LastCIndex == 0) continue; // This row is empty. Move to the next row.

        int XF = -1;
        for (int cIndex = xls.ColToIndex(row, FirstColumn); cIndex <= LastCIndex; cIndex++)
        {
            DoSomething(row, xls.ColFromIndex(row, cIndex), xls.GetCellValueIndexed(row, cIndex, ref XF));
        }
    }

Note that this example is the implementation of ExcelFile.LoopOverUsedRange, so you might want to directly call ExcelFile.LoopOverUsedRange instead of pasting this example in your code.

See also

  • XlsFile
  • ExcelFile.ColCountInRow(Int32)
  • ExcelFile.ColToIndex(Int32, Int32)
  • ExcelFile.LoopOverUsedRange


XlsFile.ColToIndex Method | FlexCel Studio for the .NET Framework documentation

XlsFile.ColToIndex Method

Overloads

  • XlsFile.ColToIndex(Int32, Int32)
  • XlsFile.ColToIndex(Int32, Int32, Int32)

XlsFile.ColToIndex(Int32, Int32)

This is the inverse of ExcelFile.ColFromIndex(Int32, Int32). It will return the index on the internal column array from the row for an existing column. If the column doesn't exist, it will return the index of the "LAST existing column less than col", plus 1. You can use this together with ExcelFile.ColCountInRow(Int32) and ExcelFile.ColFromIndex(Int32, Int32) to iterate faster on a block. Or you can call ExcelFile.LoopOverUsedRange for a method that does the looping for you using those methods.

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 ColToIndex(Int32 row, Int32 col)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row (1 based)
 | col | Int32 | Column (1 based)

Returns

The index on the column list for the row. (1 based)

Examples

To loop on all the existing cells range you can use:

    // Loop at most until the last used row in the sheet.
    // If LastRow is for example 1.000.000, but there are only
    // 3 used rows, it makes no sense to loop over all the empty rows after row 3.
    int LastUsedRow = Math.Min(LastRow, xls.RowCount);

    for (int row = FirstRow; row <= LastUsedRow; row++)
    {
        int LastCIndex = xls.ColToIndex(row, LastColumn);
        int LastColFromIndex = xls.ColFromIndex(row, LastCIndex);
        if (LastColFromIndex > LastColumn || LastColFromIndex == 0) // LastColumn does not exist.
        {
            LastCIndex--;
        }
        if (LastCIndex == 0) continue; // This row is empty. Move to the next row.

        int XF = -1;
        for (int cIndex = xls.ColToIndex(row, FirstColumn); cIndex <= LastCIndex; cIndex++)
        {
            DoSomething(row, xls.ColFromIndex(row, cIndex), xls.GetCellValueIndexed(row, cIndex, ref XF));
        }
    }

Note that this example is the implementation of ExcelFile.LoopOverUsedRange, so you might want to directly call ExcelFile.LoopOverUsedRange instead of pasting this example in your code.

See also

  • XlsFile
  • ExcelFile.ColCountInRow(Int32)
  • ExcelFile.ColFromIndex(Int32, Int32)
  • ExcelFile.LoopOverUsedRange

XlsFile.ColToIndex(Int32, Int32, Int32)

This is the inverse of ExcelFile.ColFromIndex(Int32, Int32). It will return the index on the internal column array from the row for an existing column. If the column doesn't exist, it will return the index of the "LAST existing column less than col", plus 1. You can use this together with ExcelFile.ColCountInRow(Int32) and ExcelFile.ColFromIndex(Int32, Int32) to iterate faster on a block. Or you can call ExcelFile.LoopOverUsedRange for a method that does the looping for you using those methods.

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 ColToIndex(Int32 sheet, Int32 row, Int32 col)

Parameters

<-> | Parameter | Type | Description
 | sheet | Int32 | Sheet where we are working. It might be different from ActiveSheet.
 | row | Int32 | Row (1 based)
 | col | Int32 | Column (1 based)

Returns

The index on the column list for the row. (1 based)

Examples

To loop on all the existing cells on a range you can use:

    // Loop at most until the last used row in the sheet.
    // If LastRow is for example 1.000.000, but there are only
    // 3 used rows, it makes no sense to loop over all the empty rows after row 3.
    int LastUsedRow = Math.Min(LastRow, xls.RowCount);

    for (int row = FirstRow; row <= LastUsedRow; row++)
    {
        int LastCIndex = xls.ColToIndex(row, LastColumn);
        int LastColFromIndex = xls.ColFromIndex(row, LastCIndex);
        if (LastColFromIndex > LastColumn || LastColFromIndex == 0) // LastColumn does not exist.
        {
            LastCIndex--;
        }
        if (LastCIndex == 0) continue; // This row is empty. Move to the next row.

        int XF = -1;
        for (int cIndex = xls.ColToIndex(row, FirstColumn); cIndex <= LastCIndex; cIndex++)
        {
            DoSomething(row, xls.ColFromIndex(row, cIndex), xls.GetCellValueIndexed(row, cIndex, ref XF));
        }
    }

Note that this example is the implementation of ExcelFile.LoopOverUsedRange, so you might want to directly call ExcelFile.LoopOverUsedRange instead of pasting this example in your code.

See also

  • XlsFile
  • ExcelFile.ColCountInRow(Int32)
  • ExcelFile.ColFromIndex(Int32, Int32)
  • ExcelFile.LoopOverUsedRange


XlsFile.CopyColFormats Method | FlexCel Studio for the .NET Framework documentation

XlsFile.CopyColFormats Method

Copies the column definitions, that is formats, widths, hidden/visible, etc from one workbook or sheet to another.

Syntax

Namespace: FlexCel.XlsAdapter

public override void CopyColFormats(ExcelFile sourceWorkbook, Int32 sourceSheet, Int32 sourceCol, Int32 destCol, Int32 colCount)

Parameters

<-> | Parameter | Type | Description
 | sourceWorkbook | ExcelFile | The workbook from where the column formats will be copied. If you set this to null, the column formats will be copied from the same file.
 | sourceSheet | Int32 | Sheet in the source workbook from where we will copy the column formats.
 | sourceCol | Int32 | First column format to copy
 | destCol | Int32 | First column where the format will be copied.
 | colCount | Int32 | Number of columns to copy.

See also

  • XlsFile


XlsFile.GetColumnBlocks Method | FlexCel Studio for the .NET Framework documentation

XlsFile.GetColumnBlocks Method

This method returns a list of blocks of column information, grouped by columns that have the same properties. Since an xlsx file can have 16384 columns, querying every one of them might be slow. With this method, if columns from 5 to 16384 are hidden, you will get a single block with firstCol = 5 and lastCol = 16384 that is hidden. If you used ExcelFile.GetColHidden instead you would have to call it 16384 times to get the same information.

Syntax

Namespace: FlexCel.XlsAdapter

public override TColumnBlock[] GetColumnBlocks(Int32 sourceSheet, Int32 firstCol, Int32 lastCol)

Parameters

<-> | Parameter | Type | Description
 | sourceSheet | Int32 | Sheet where we want to read the columns. Pass ActiveSheet if you want to read the current sheet.
 | firstCol | Int32 | First column of the range where we want to get information. The first block returned might have a firstCol smaller than this value, if the block actually starts before in the file.
 | lastCol | Int32 | Last column of the range where we want to get information. The last block returned might have a lastCol bigger than this value, if the block in the file continues after this column.

Returns

A list of blocks of columns that include all the columns between firstCol and lastCol. The blocks might include more columns outside the range too, and null columns inside the range will not be returned. All blocks are sorted in ascending order.

See also

  • XlsFile


XlsFile.GetColorPalette Method | FlexCel Studio for the .NET Framework documentation

XlsFile.GetColorPalette Method

Returns a color from the color palette. This method will throw an exception if its "index" parameter is bigger than ExcelFile.ColorPaletteCount, (for example, for an automatic color). To get the real color, use ExcelFile.GetColorPalette(Int32, TUIColor)

Syntax

Namespace: FlexCel.XlsAdapter

public override TUIColor GetColorPalette(Int32 index)

Parameters

<-> | Parameter | Type | Description
 | index | Int32 | Index of the entry to return. Must be 1<=index<=ExcelFile.ColorPaletteCount

Returns

Color at position index.

See also

  • XlsFile


XlsFile.SetColorPalette Method | FlexCel Studio for the .NET Framework documentation

XlsFile.SetColorPalette Method

Changes a color on the Excel color palette.

Syntax

Namespace: FlexCel.XlsAdapter

public override void SetColorPalette(Int32 index, TUIColor value)

Parameters

<-> | Parameter | Type | Description
 | index | Int32 | Index of the entry to change. Must be 1<=indexlt;=ExcelFile.ColorPaletteCount
 | value | TUIColor | Color to set.

See also

  • XlsFile


XlsFile.NearestColorIndex Method | FlexCel Studio for the .NET Framework documentation

XlsFile.NearestColorIndex Method

Overloads

  • XlsFile.NearestColorIndex(TUIColor)
  • XlsFile.NearestColorIndex(TUIColor, Boolean[])

XlsFile.NearestColorIndex(TUIColor)

Returns the most similar entry on the excel palette for a given color.

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 NearestColorIndex(TUIColor value)

Parameters

<-> | Parameter | Type | Description
 | value | TUIColor | Color we want to use.

Returns

Most similar color on the Excel palette.

See also

  • XlsFile

XlsFile.NearestColorIndex(TUIColor, Boolean[])

IMPORTANT: Since FlexCel 5.1, using ExcelFile.OptimizeColorPalette before saving should normally be used instead of this method to get an optimized palette. Just enter the true colors in FlexCel, and call ExcelFile.OptimizeColorPalette before saving.

Returns the most similar entry on the excel palette for a given color. If UsedColors is not null, it will try to modify the Excel color palette to get a better match on the color, modifying among the not used colors. Note that modifying the standard palette might result on a file that is not easy to edit on Excel later, since it does not have the standard Excel colors.

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 NearestColorIndex(TUIColor value, Boolean[] UsedColors)

Parameters

<-> | Parameter | Type | Description
 | value | TUIColor | Color we want to use.
 | UsedColors | Boolean[] | If null, this behaves like the standard NearestColorIndex. To get a list of used colors for the first call, use ExcelFile.GetUsedPaletteColors. After the first call, keep using the same UsedColors structure and do not call GetUsedPaletteColors again, to avoid overwriting colors that are not yet inserted into the xls file with new ones. You can call GetUsedPaletteColors only after you added the format with ExcelFile.AddFormat

Returns

Most similar color on the Excel palette.

See also

  • XlsFile


XlsFile.PaletteContainsColor Method | FlexCel Studio for the .NET Framework documentation

XlsFile.PaletteContainsColor Method

Returns true if the internal color palette contains the exact specified color. Note that Excel 2007 doesn't use the color palette, so this method is not needed there.

Syntax

Namespace: FlexCel.XlsAdapter

public override Boolean PaletteContainsColor(TExcelColor value)

Parameters

<-> | Parameter | Type | Description
 | value | TExcelColor | Color to check.

Returns

True if color is defined.

See also

  • XlsFile


XlsFile.OptimizeColorPalette Method | FlexCel Studio for the .NET Framework documentation

XlsFile.OptimizeColorPalette Method

Changes the colors in the color palette so they can represent better the colors in use. This method will change the colors not used in the palette by colors used in the sheet. If there are more unique colors in the sheet than the 56 available in the palette, only the first colors will be changed.

When FlexCel saves an xls file, it saves the color information twice: The real color for Excel 2007 and newer, and the indexed color for older Excel versions. This method optimizes the palette of indexed colors so they look better in Excel 2003 or older. It doesn't effect Excel 2007 or newer at all.

Syntax

Namespace: FlexCel.XlsAdapter

public override void OptimizeColorPalette()

See also

  • XlsFile


XlsFile.GetColorPaletteVersion Method | FlexCel Studio for the .NET Framework documentation

XlsFile.GetColorPaletteVersion Method

Internal use. Every time the palette changes, the number returned is incremented.

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 GetColorPaletteVersion()

See also

  • XlsFile


XlsFile.GetColorTheme Method | FlexCel Studio for the .NET Framework documentation

XlsFile.GetColorTheme Method

Overloads

  • XlsFile.GetColorTheme(TThemeColor)
  • XlsFile.GetColorTheme(TPrimaryThemeColor)

XlsFile.GetColorTheme(TThemeColor)

Returns a color from the active theme palette, including semantic colors. Only has effect in Excel 2007.

To get the full theme, look at ExcelFile.GetTheme

Syntax

Namespace: FlexCel.XlsAdapter

public override TDrawingColor GetColorTheme(TThemeColor themeColor)

Parameters

<-> | Parameter | Type | Description
 | themeColor | TThemeColor | Color of the theme to get.

Returns

Color for the given theme.

See also

  • XlsFile

XlsFile.GetColorTheme(TPrimaryThemeColor)

Returns a color from the active theme palette, without including semantic colors. Only has effect in Excel 2007.

To get the full theme, look at ExcelFile.GetTheme

Syntax

Namespace: FlexCel.XlsAdapter

public override TDrawingColor GetColorTheme(TPrimaryThemeColor themeColor)

Parameters

<-> | Parameter | Type | Description
 | themeColor | TPrimaryThemeColor | Color of the theme to get.

Returns

Color for the given theme.

See also

  • XlsFile


XlsFile.SetColorTheme Method | FlexCel Studio for the .NET Framework documentation

XlsFile.SetColorTheme Method

Overloads

  • XlsFile.SetColorTheme(TThemeColor, TDrawingColor)
  • XlsFile.SetColorTheme(TPrimaryThemeColor, TDrawingColor)

XlsFile.SetColorTheme(TThemeColor, TDrawingColor)

Changes a color on the Excel theme. Only has effect in Excel 2007.

This method is provided to not break compatibility with older FlexCel versions. In newer code, you should use ExcelFile.SetColorTheme(TPrimaryThemeColor, TDrawingColor) instead. If you want to change the full theme, use ExcelFile.GetTheme and ExcelFile.SetTheme

Syntax

Namespace: FlexCel.XlsAdapter

public override void SetColorTheme(TThemeColor themeColor, TDrawingColor value)

Parameters

<-> | Parameter | Type | Description
 | themeColor | TThemeColor | Color of the theme to change. The only values that make sense are those included in TPrimaryThemeColor. Colors outside that range will be mapped to the nearest color: For example Background1 will be mapped to Light1 and ForeGround1 will be mapped to Dark1.
 | value | TDrawingColor | Color to set.

See also

  • XlsFile

XlsFile.SetColorTheme(TPrimaryThemeColor, TDrawingColor)

Changes a color on the Excel theme. Only has effect in Excel 2007.

If you want to change the full theme, use ExcelFile.GetTheme and ExcelFile.SetTheme

Syntax

Namespace: FlexCel.XlsAdapter

public override void SetColorTheme(TPrimaryThemeColor themeColor, TDrawingColor value)

Parameters

<-> | Parameter | Type | Description
 | themeColor | TPrimaryThemeColor | Color of the theme to change.
 | value | TDrawingColor | Color to set.

See also

  • XlsFile


XlsFile.NearestColorTheme Method | FlexCel Studio for the .NET Framework documentation

XlsFile.NearestColorTheme Method

Returns the most similar entry on the theme palette for a given color.

Syntax

Namespace: FlexCel.XlsAdapter

public override TThemeColor NearestColorTheme(TUIColor value, out Double tint)

Parameters

<-> | Parameter | Type | Description
 | value | TUIColor | Color we want to use.
out | tint | Double | Returns the tint to apply to the theme color.

Returns

Most similar color on the theme palette.

See also

  • XlsFile


XlsFile.GetThemeFont Method | FlexCel Studio for the .NET Framework documentation

XlsFile.GetThemeFont Method

Gets the major of minor font scheme in the theme.

Syntax

Namespace: FlexCel.XlsAdapter

public override TThemeFont GetThemeFont(TFontScheme fontScheme)

Parameters

<-> | Parameter | Type | Description
 | fontScheme | TFontScheme | Font Scheme we want to get (either minor or major). Using "none" here will return null.

Returns

Font definition.

See also

  • XlsFile


XlsFile.SetThemeFont Method | FlexCel Studio for the .NET Framework documentation

XlsFile.SetThemeFont Method

Sets either the minor or the major font for the theme.

Syntax

Namespace: FlexCel.XlsAdapter

public override void SetThemeFont(TFontScheme fontScheme, TThemeFont font)

Parameters

<-> | Parameter | Type | Description
 | fontScheme | TFontScheme | Font Scheme we want to set (either minor or major). Using "none" here will do nothing.
 | font | TThemeFont | Font definition.

See also

  • XlsFile


XlsFile.GetTheme Method | FlexCel Studio for the .NET Framework documentation

XlsFile.GetTheme Method

This is an advanced method, that allows you to get the full theme in use. Normally you will just want to replace colors, and you can do this with ExcelFile.SetColorTheme(TPrimaryThemeColor, TDrawingColor) and ExcelFile.GetColorTheme(TPrimaryThemeColor) methods. Much of the functionality in a theme applies to PowerPoint, not Excel.

Syntax

Namespace: FlexCel.XlsAdapter

public override TTheme GetTheme()

See also

  • XlsFile


XlsFile.GetThemeNoClone Method | FlexCel Studio for the .NET Framework documentation

XlsFile.GetThemeNoClone Method

Internal use. This won't clone the internal structure for more performance.

Syntax

Namespace: FlexCel.XlsAdapter

public override TTheme GetThemeNoClone()

See also

  • XlsFile


XlsFile.SetTheme Method | FlexCel Studio for the .NET Framework documentation

XlsFile.SetTheme Method

This is an advanced method, that allows you to set the full theme in use. Normally you will just want to replace colors, and you can do this with ExcelFile.SetColorTheme(TPrimaryThemeColor, TDrawingColor) and ExcelFile.GetColorTheme(TPrimaryThemeColor) methods.

Syntax

Namespace: FlexCel.XlsAdapter

public override void SetTheme(TTheme aTheme)

Parameters

<-> | Parameter | Type | Description
 | aTheme | TTheme | Theme to set. You would normally use the result from ExcelFile.GetTheme here, or you might load a method from a ".tmx" file. There are many standard tmx files available in an Office installation under the "Document Themes Version" folder

See also

  • XlsFile


XlsFile.GetNamedRange Method | FlexCel Studio for the .NET Framework documentation

XlsFile.GetNamedRange Method

Overloads

  • XlsFile.GetNamedRange(Int32)
  • XlsFile.GetNamedRange(String, Int32)
  • XlsFile.GetNamedRange(String, Int32, Int32)

XlsFile.GetNamedRange(Int32)

Returns the Named Range Definition. If the range is not user defined (like "Print_Area") it will have a one-char name, and the value is on the enum InternalNameRange

Syntax

Namespace: FlexCel.XlsAdapter

public override TXlsNamedRange GetNamedRange(Int32 index)

Parameters

<-> | Parameter | Type | Description
 | index | Int32 | Index of the named range.

Returns

Named Range

See also

  • XlsFile
  • InternalNameRange

XlsFile.GetNamedRange(String, Int32)

Returns the Named Range Definition. If the range is not user defined (like "Print_Area") it will have a one-char name, and the value is on the enum InternalNameRange

Syntax

Namespace: FlexCel.XlsAdapter

public override TXlsNamedRange GetNamedRange(String Name, Int32 refersToSheetIndex)

Parameters

<-> | Parameter | Type | Description
 | Name | String | Name of the range we are looking for. Case insensitive.
 | refersToSheetIndex | Int32 | Sheet where the range refers to. A range with the same name might be defined on more than one sheet. To get the first range with the name, make refersToSheetIndex<=0 Note that a name can be stored in one sheet and refer to a different sheet. Or it might not refer to any sheet at all. (for example, the name "=name1+1" doesn't refer to any sheet.) And you could have a name "=Sheet1!a1" defined in sheet2. This name will "refer to" sheet1, but be defined in sheet2. While names are normally all defined globally (sheet 0), if you need to get the names that are stored in a specific sheet, use ExcelFile.GetNamedRange(String, Int32, Int32) instead.

Returns

Named Range or null if the range does not exist.

See also

  • XlsFile
  • InternalNameRange

XlsFile.GetNamedRange(String, Int32, Int32)

Returns the Named Range Definition. If the range is not user defined (like "Print_Area") it will have a one-char name, and the value is on the enum InternalNameRange

Syntax

Namespace: FlexCel.XlsAdapter

public override TXlsNamedRange GetNamedRange(String Name, Int32 refersToSheetIndex, Int32 localSheetIndex)

Parameters

<-> | Parameter | Type | Description
 | Name | String | Name of the range we are looking for. Case insensitive.
 | refersToSheetIndex | Int32 | Sheet where the range refers to. Note that this is not where the name is stored. Normally names are all stored globally (in sheet 0), but they refer to a specific sheet. For example, if you define the name "=Sheet2!a1" globally, it will be stored in sheet 0, but will refer to sheet2. A name like "=Sheet1:Sheet2!A1 doesn't refer to any sheet.
 | localSheetIndex | Int32 | Sheet where the range is stored. A range might be stored local to a sheet, or global (Excel default). To get a global range, make localSheetIndex = 0

Returns

Named Range or null if the range does not exist.

See also

  • XlsFile
  • InternalNameRange


XlsFile.FindNamedRange Method | FlexCel Studio for the .NET Framework documentation

XlsFile.FindNamedRange Method

Returns the index (1 based) on the list of named ranges for a given name and local sheet. If the range is not found, this method will return -1 You could use ExcelFile.GetNamedRange(Int32) to get the name definition, or directly call ExcelFile.GetNamedRange(String, Int32, Int32) to get a named range knowing its name and sheet position.

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 FindNamedRange(String Name, Int32 localSheetIndex)

Parameters

<-> | Parameter | Type | Description
 | Name | String | Name of the range we are looking for. Case insensitive.
 | localSheetIndex | Int32 | Sheet where the range is stored. A range might be stored local to a sheet, or global (Excel default). To get a global range, make localSheetIndex=0

Returns

The index (1 based) in the list of named ranges, or -1 if the range is not found.

See also

  • XlsFile


XlsFile.SetNamedRange Method | FlexCel Studio for the .NET Framework documentation

XlsFile.SetNamedRange Method

Overloads

  • XlsFile.SetNamedRange(TXlsNamedRange)
  • XlsFile.SetNamedRange(Int32, TXlsNamedRange)

XlsFile.SetNamedRange(TXlsNamedRange)

Modifies or adds a Named Range. If the named range exists, it will be modified, else it will be added. If the range is not user defined (like "Print_Area") it will have a one-char name, and the value is on the enum InternalNameRange Look at the example for more information.

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 SetNamedRange(TXlsNamedRange rangeData)

Parameters

<-> | Parameter | Type | Description
 | rangeData | TXlsNamedRange | Data of the named range. You don't need to specify the RPN Array.

Returns

The name index of the inserted or modified range (1 based).

Examples

This will create a range for repeating the first 2 columns and rows on each printed page (on sheet 1):

    xls.SetNamedRange(new TXlsNamedRange(TXlsNamedRange.GetInternalName(InternalNameRange.Print_Titles), SheetIndex, 0, "=1:2,A:B"));

Note that in this example in particular (Print_Titles), the range has to have full rows/columns, as this is what Excel expects. You should also use "A:B" notation instead of the full "A1:B65536" name, so it will work in Excel 2007 too.

See also

  • XlsFile

XlsFile.SetNamedRange(Int32, TXlsNamedRange)

Modifies a Named Range in the specified position. You could normally use ExcelFile.SetNamedRange(TXlsNamedRange) to do this, but if you want to modify the name of the named range, then you need to use this overloaded version. ExcelFile.SetNamedRange(TXlsNamedRange) would add a new range instead of modifying the existing one if you change the name. Look at the example for more information on how to use it.

Syntax

Namespace: FlexCel.XlsAdapter

public override void SetNamedRange(Int32 index, TXlsNamedRange rangeData)

Parameters

<-> | Parameter | Type | Description
 | index | Int32 | Index of the named range we are trying to modify.
 | rangeData | TXlsNamedRange | Data of the named range. You don't need to specify the RPN Array.

Examples

This will modify the name of the named range "MyName":

    int nameIndex = xls.FindNamedRange("MyName", -1);  //Find the name index from the name.
    TXlsNamedRange range = xls.GetNamedRange(nameIndex); //Load the name definition for the name index.
    range.Name = "MyNewName";  //Modify the name definition.
    xls.SetNamedRange(nameIndex, range);  //Set the new name definition into the file.

See also

  • XlsFile


XlsFile.DeleteNamedRange Method | FlexCel Studio for the .NET Framework documentation

XlsFile.DeleteNamedRange Method

Deletes the name at the specified position. Important: If the name you are trying to delete is referenced by any formula/chart/whatever in your file, the name will not actually be deleted but hidden.

You won't see the name in Excel or in the formula, but it will be there and you can see it from FlexCel. You can use ExcelFile.GetUsedNamedRanges to learn if a range might be deleted.

Also, note that if you later delete the formulas that reference those ranges FlexCel will remove those hanging ranges when saving. The only hidden ranges that will be present in the final file will be those that have active formulas referencing them.

Important:If the name wasn't deleted, ExcelFile.NamedRangeCount will not change. This means that you can't have code like this:

    while (xls.NamedRangeCount > 0) //WRONG! This loop might never end.
    {
        xls.DeleteNamedRange(1);  //Might not be deleted, and NamedRangeCount will never be 0.
    }

The correct code in this case would be:

    for (int i = xls.NamedRangeCount; i > 0; i--) xls.DeleteNamedRange(i);

Syntax

Namespace: FlexCel.XlsAdapter

public override void DeleteNamedRange(Int32 index)

Parameters

<-> | Parameter | Type | Description
 | index | Int32 | Index of the name to delete (1 based).

See also

  • XlsFile


XlsFile.GetUsedNamedRanges Method | FlexCel Studio for the .NET Framework documentation

XlsFile.GetUsedNamedRanges Method

Returns an array of booleans where each value indicates if the name at position "i-1" is used by any formula, chart, or object in the file. If the name is in use, it can't be deleted. Note that the index here is Zero-based, different from all other Name indexes in FlexCel, because arrays in C# are always 0-based. So UsedRange[0] corresponds to GetNamedRange(1) and so on.

Syntax

Namespace: FlexCel.XlsAdapter

public override Boolean[] GetUsedNamedRanges()

See also

  • XlsFile


XlsFile.CopyToClipboardFormat Method | FlexCel Studio for the .NET Framework documentation

XlsFile.CopyToClipboardFormat Method

Copies a range on the active sheet to a clipboard stream, on the specified format.

Remarks

See the copy and paste demo.

Syntax

Namespace: FlexCel.XlsAdapter

public override void CopyToClipboardFormat(FlexCelClipboardFormat clipboardFormat, TXlsCellRange range, Stream outStream)

Parameters

<-> | Parameter | Type | Description
 | clipboardFormat | FlexCelClipboard​Format | Format you want to copy into outStream.
 | range | TXlsCellRange | Range with the cells to copy.
 | outStream | Stream | Stream where the clipboard info will be copied. If null, nothing will be copied.

See also

  • XlsFile


XlsFile.PasteFromTextClipboardFormat Method | FlexCel Studio for the .NET Framework documentation

XlsFile.PasteFromTextClipboardFormat Method

Pastes the clipboard contents beginning on cells row, col.

Remarks

See the copy and paste demo.

Syntax

Namespace: FlexCel.XlsAdapter

public override void PasteFromTextClipboardFormat(Int32 row, Int32 col, TFlxInsertMode insertMode, String data)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | First row where to paste.
 | col | Int32 | First column where to paste.
 | insertMode | TFlxInsertMode | How the pasted cells will be inserted on the file.
 | data | String | A string containing a tab separated text format.

See also

  • XlsFile


XlsFile.PasteFromXlsClipboardFormat Method | FlexCel Studio for the .NET Framework documentation

XlsFile.PasteFromXlsClipboardFormat Method

Pastes the clipboard contents beginning on cells row, col, with the option to convert formulas to their values.

Remarks

See the copy and paste demo.

Syntax

Namespace: FlexCel.XlsAdapter

public override void PasteFromXlsClipboardFormat(Int32 row, Int32 col, TFlxInsertMode insertMode, Stream data, Boolean convertFormulasToValues)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | First row where to paste.
 | col | Int32 | First column where to paste.
 | insertMode | TFlxInsertMode | How the pasted cells will be inserted on the file.
 | data | Stream | A stream containing a Native xls format.
 | convertFormulasToValues | Boolean | If true, the formulas will be converted to values.

See also

  • XlsFile


XlsFile.GetPageHeaderAndFooter Method | FlexCel Studio for the .NET Framework documentation

XlsFile.GetPageHeaderAndFooter Method

This method will return all the headers and footers in a sheet.

Syntax

Namespace: FlexCel.XlsAdapter

public override THeaderAndFooter GetPageHeaderAndFooter()

See also

  • XlsFile


XlsFile.SetPageHeaderAndFooter Method | FlexCel Studio for the .NET Framework documentation

XlsFile.SetPageHeaderAndFooter Method

This method will set all the headers and footers in a sheet. If you want a simple header or footer for all the pages, you might want to use ExcelFile.PageHeader and ExcelFile.PageFooter

Syntax

Namespace: FlexCel.XlsAdapter

public override void SetPageHeaderAndFooter(THeaderAndFooter headerAndFooter)

Parameters

<-> | Parameter | Type | Description
 | headerAndFooter | THeaderAndFooter | Structure with the headers and footers definition.

See also

  • XlsFile


XlsFile.FillPageHeaderOrFooter Method | FlexCel Studio for the .NET Framework documentation

XlsFile.FillPageHeaderOrFooter Method

Given a Page Header or footer string including macros (like [FileName] or [PageNo]), this method will return the strings that go into the left, right and middle sections.

Syntax

Namespace: FlexCel.XlsAdapter

public override void FillPageHeaderOrFooter(String fullText, ref String leftText, ref String centerText, ref String rightText)

Parameters

<-> | Parameter | Type | Description
 | fullText | String | Header or footer text.
ref | leftText | String | Text that should be left justified.
ref | centerText | String | Text that should be centered.
ref | rightText | String | Text that should be right justified.

See also

  • XlsFile


XlsFile.GetPageHeaderOrFooterAsHtml Method | FlexCel Studio for the .NET Framework documentation

XlsFile.GetPageHeaderOrFooterAsHtml Method

Converts a section of a page header or footer into an HTML string.

Syntax

Namespace: FlexCel.XlsAdapter

public override String GetPageHeaderOrFooterAsHtml(String section, String imageTag, Int32 pageNumber, Int32 pageCount, THtmlVersion htmlVersion, Encoding encoding, IHtmlFontEvent onFont)

Parameters

<-> | Parameter | Type | Description
 | section | String | Text to convert. You will normally get this parameter calling ExcelFile.FillPageHeaderOrFooter
 | imageTag | String | Tag to call an image for the section. It must be in the form: "<img src=...>" and you can get the image with ExcelFile.GetHeaderOrFooterImage(THeaderAndFooterKind, THeaderAndFooterPos, TXlsImgType) . If null or empty, no img tag will be present in the resulting HTML, even if the section includes an image.
 | pageNumber | Int32 | Page we are printing. This parameter will be used if you have text like "Page 1 of 3" in the header. If you are exporting to HTML, this value should be 1, since there are no page breaks in an HTML doc.
 | pageCount | Int32 | Number of pages in the document. This parameter will be used if you have text like "Page 1 of 3" in the header. If you are exporting to HTML, this value should be 1, since there are no page breaks in an HTML doc
 | htmlVersion | THtmlVersion | Version of HTML we are targeting. In HTML 4 <br> is valid and <br/> is not. In XHtml the inverse is true.
 | encoding | Encoding | Code page used to encode the string. Normally this is UTF-8
 | onFont | IHtmlFontEvent | Method that can customize the fonts used in the resulting string. It can be null if you don't want to do any modification to the fonts.

Returns

An HTML string with the section.

See also

  • XlsFile


XlsFile.GetHeaderOrFooterImage Method | FlexCel Studio for the .NET Framework documentation

XlsFile.GetHeaderOrFooterImage Method

This method returns the images associated to a given section of the header or footer. There can be only one image per section, and you refer it from the header string (see ExcelFile.PageHeader and ExcelFile.PageFooter) by writing &G. NOTE THAT YOU CAN ONLY USE HEADER AND FOOTER GRAPHICS ON EXCEL XP AND NEWER. Excel 2000 and 97 will still open the file, but they will show no graphics.

Syntax

Namespace: FlexCel.XlsAdapter

public override void GetHeaderOrFooterImage(THeaderAndFooterKind headerAndFooterKind, THeaderAndFooterPos section, ref TXlsImgType imageType, Stream outStream)

Parameters

<-> | Parameter | Type | Description
 | headerAndFooterKind | THeaderAndFooterKind | Type of page for which we want to retrieve the image. You will normally get this value from THeaderAndFooter.GetHeaderAndFooterKind.
 | section | THeaderAndFooterPos | Section of the header or footer for which we want to retrieve the image.
ref | imageType | TXlsImgType | Returns the image type for the data returned. (If it is a bmp, jpg or other)
 | outStream | Stream | Stream where the image data will be copied.

See also

  • XlsFile


XlsFile.GetHeaderOrFooterImageProperties Method | FlexCel Studio for the .NET Framework documentation

XlsFile.GetHeaderOrFooterImageProperties Method

Returns the image position and size.

Syntax

Namespace: FlexCel.XlsAdapter

public override THeaderOrFooterImageProperties GetHeaderOrFooterImageProperties(THeaderAndFooterKind headerAndFooterKind, THeaderAndFooterPos section)

Parameters

<-> | Parameter | Type | Description
 | headerAndFooterKind | THeaderAndFooterKind | Type of page for which we want to retrieve the image. You will normally get this value from THeaderAndFooter.GetHeaderAndFooterKind.
 | section | THeaderAndFooterPos | Section of the header or footer for which we want to retrieve the image properties.

Returns

Image properties. Null if there is no image on this section.

See also

  • XlsFile


XlsFile.SetHeaderOrFooterImage Method | FlexCel Studio for the .NET Framework documentation

XlsFile.SetHeaderOrFooterImage Method

This method sets the image associated to a given section of the header or footer. There can be only one image per section, and you refer it from the header string (see ExcelFile.PageHeader and ExcelFile.PageFooter) by writing &G. NOTE THAT YOU CAN ONLY USE HEADER AND FOOTER GRAPHICS ON EXCEL XP AND NEWER. Excel 2000 and 97 will still open the file, but they will show no graphics. ALSO, NOTE that only setting the image will not display it. You need to write &G in the corresponding ExcelFile.PageHeader or ExcelFile.PageFooter

Syntax

Namespace: FlexCel.XlsAdapter

public override void SetHeaderOrFooterImage(THeaderAndFooterKind headerAndFooterKind, THeaderAndFooterPos section, Byte[] data, TXlsImgType imageType, THeaderOrFooterImageProperties properties)

Parameters

<-> | Parameter | Type | Description
 | headerAndFooterKind | THeaderAndFooterKind | Type of page for which we want to set the image. You will normally get this value from THeaderAndFooter.GetHeaderAndFooterKind.
 | section | THeaderAndFooterPos | Section of the header or footer for which we want to set the image.
 | data | Byte[] | Image data.
 | imageType | TXlsImgType | The image type for the data sent. (If it is a bmp, jpg or other)
 | properties | THeaderOrFooter​Image​Properties | Image size.

See also

  • XlsFile


XlsFile.GetPrintMargins Method | FlexCel Studio for the .NET Framework documentation

XlsFile.GetPrintMargins Method

Gets the Margins on the active sheet.

Syntax

Namespace: FlexCel.XlsAdapter

public override TXlsMargins GetPrintMargins()

See also

  • XlsFile


XlsFile.SetPrintMargins Method | FlexCel Studio for the .NET Framework documentation

XlsFile.SetPrintMargins Method

Sets the Margins on the active sheet.

Syntax

Namespace: FlexCel.XlsAdapter

public override void SetPrintMargins(TXlsMargins value)

Parameters

<-> | Parameter | Type | Description
 | value | TXlsMargins |

See also

  • XlsFile


XlsFile.GetPrinterDriverSettings Method | FlexCel Studio for the .NET Framework documentation

XlsFile.GetPrinterDriverSettings Method

Returns printer driver settings. This method is not intended to be used alone, but together with ExcelFile.SetPrinterDriverSettings to copy printer driver information from a file to another.

Remarks

Excel stores printer settings in two places

  1. Standard printer settings: You can set/read this with ExcelFile.PrintPaperSize, ExcelFile.PrintScale, ExcelFile.PrintLandscape, ExcelFile.PrintXResolution, ExcelFile.PrintYResolution and ExcelFile.PrintCopies
  2. Printer driver settings: You can access this with GetPrinterDriverSettings and SetPrinterDriverSettings.

NOTE THAT THOSE PLACES STORE DUPLICATED INFORMATION. For example, Excel stores the PageSize on both Standard printer settings and Printer driver settings.

Always that a value is stored on both places, (1) Standard printer settings takes preference.

If you set PaperSize = A4 on standard settings and PaperSize = A5 on driver settings, A4 will be used.

Syntax

Namespace: FlexCel.XlsAdapter

public override TPrinterDriverSettings GetPrinterDriverSettings()

Examples

To copy the printer driver information from an empty template to the working file, use:

    xlsWorkingCopy.SetPrinterDriverSettings(xlsTemplate.GetPrinterDriverSettings());

If you have defined a printer specific paper size, and you want to use it, you should call

    xlsWorkingCopy.PrintPaperSize = xlsTemplate.PrintPaperSize;

after copying the driver settings.

See also

  • XlsFile


XlsFile.SetPrinterDriverSettings Method | FlexCel Studio for the .NET Framework documentation

XlsFile.SetPrinterDriverSettings Method

Sets printer driver information. This method is not intended to be used alone, but together with ExcelFile.GetPrinterDriverSettings to copy printer driver information from a file to another.

Remarks

Excel stores printer settings in two places

  1. Standard printer settings: You can set/read this with ExcelFile.PrintPaperSize, ExcelFile.PrintScale, ExcelFile.PrintLandscape, ExcelFile.PrintXResolution, ExcelFile.PrintYResolution and ExcelFile.PrintCopies
  2. Printer driver settings: You can access this with GetPrinterDriverSettings and SetPrinterDriverSettings.

NOTE THAT THOSE PLACES STORE DUPLICATED INFORMATION. For example, Excel stores the PageSize on both Standard printer settings and Printer driver settings.

Always that a value is stored on both places, (1) Standard printer settings takes preference.

If you set PaperSize=A4 on standard settings and PaperSize=A5 on driver settings, A4 will be used.

Syntax

Namespace: FlexCel.XlsAdapter

public override void SetPrinterDriverSettings(TPrinterDriverSettings settings)

Parameters

<-> | Parameter | Type | Description
 | settings | TPrinterDriver​Settings | Printer driver information obtained with ExcelFile.GetPrinterDriverSettings. Use null to remove the printer settings.

Examples

To copy the printer driver information from an empty template to the working file, use:

    xlsWorkingCopy.SetPrinterDriverSettings(xlsTemplate.GetPrinterDriverSettings());

If you have defined a printer specific paper size, and you want to use it, you should call

    xlsWorkingCopy.PrintPaperSize = xlsTemplate.PrintPaperSize;

after copying the driver settings.

See also

  • XlsFile


XlsFile.SetImage Method | FlexCel Studio for the .NET Framework documentation

XlsFile.SetImage Method

Sets the image data and / or image properties of an existing image. Note that for SVG images, xlsx files store both a PNG and SVG image. To enter an SVG image, use ExcelFile.SetImageAlternate

Syntax

Namespace: FlexCel.XlsAdapter

public override void SetImage(Int32 imageIndex, Byte[] data, TXlsImgType imageType, Boolean usesObjectIndex, String objectPath)

Parameters

<-> | Parameter | Type | Description
 | imageIndex | Int32 | Index of the image on the sheet array (1-based)
 | data | Byte[] | Image data.
 | imageType | TXlsImgType | Image type of the new data.
 | usesObjectIndex | Boolean | If false (the default) then imageIndex is an index to the list of images. When true imageIndex is an index to the list of all objects in the sheet. When you have the object id, you can avoid calling ExcelFile.ObjectIndexToImageIndex which is a slow method, by setting this parameter to true.
 | objectPath | String | Path to the object, when the object is grouped with others. This parameter only has meaning if usesObjectIndex is true. If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"

See also

  • XlsFile


XlsFile.SetImageAlternate Method | FlexCel Studio for the .NET Framework documentation

XlsFile.SetImageAlternate Method

Sets the image data and / or image properties of an existing image. Currently this method is only needed for SVG images, since SVG images are stored as both PNG and SVG inside the xlsx file. This method allows you to supply both images.

Syntax

Namespace: FlexCel.XlsAdapter

public override void SetImageAlternate(Int32 imageIndex, Byte[] PNGData, Boolean usesObjectIndex, String objectPath, TSVGBlip aSVGBlip)

Parameters

<-> | Parameter | Type | Description
 | imageIndex | Int32 | Index of the image on the sheet array (1-based)
 | PNGData | Byte[] | Image data for the PNG image that is used as a backup for the SVG image. This data must be in PNG file format.
 | usesObjectIndex | Boolean | If false (the default) then imageIndex is an index to the list of images. When true imageIndex is an index to the list of all objects in the sheet. When you have the object id, you can avoid calling ExcelFile.ObjectIndexToImageIndex which is a slow method, by setting this parameter to true.
 | objectPath | String | Path to the object, when the object is grouped with others. This parameter only has meaning if usesObjectIndex is true. If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"
 | aSVGBlip | TSVGBlip | Image data for the SVG image

See also

  • XlsFile


XlsFile.SetImageProperties Method | FlexCel Studio for the .NET Framework documentation

XlsFile.SetImageProperties Method

Sets the image properties of an existing image.

Syntax

Namespace: FlexCel.XlsAdapter

public override void SetImageProperties(Int32 imageIndex, TImageProperties imageProperties, Boolean usesObjectIndex, String objectPath)

Parameters

<-> | Parameter | Type | Description
 | imageIndex | Int32 | Index of the image on the sheet array (1-based)
 | imageProperties | TImageProperties | Image size, placement, etc.
 | usesObjectIndex | Boolean | If false (the default) then imageIndex is an index to the list of images. When true imageIndex is an index to the list of all objects in the sheet. When you have the object id, you can avoid calling ExcelFile.ObjectIndexToImageIndex which is a slow method, by setting this parameter to true.
 | objectPath | String | Path to the object, when the object is grouped with others. This parameter only has meaning if usesObjectIndex is true. If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"

See also

  • XlsFile


XlsFile.GetImageName Method | FlexCel Studio for the .NET Framework documentation

XlsFile.GetImageName Method

Returns the image name at position imageIndex.

Remarks

Normally image names are automatically assigned by Excel, and are on the form "picture1", "picture2", etc. But you can name an image on Excel by selecting and then typing its name on the name combo box. (the combobox at the upper left corner on Excel). After that, you can use its name to identify it here.

Syntax

Namespace: FlexCel.XlsAdapter

public override String GetImageName(Int32 imageIndex, Boolean usesObjectIndex, String objectPath)

Parameters

<-> | Parameter | Type | Description
 | imageIndex | Int32 | Index of the image (1 based)
 | usesObjectIndex | Boolean | If false (the default) then imageIndex is an index to the list of images. When true imageIndex is an index to the list of all objects in the sheet. When you have the object id, you can avoid calling ExcelFile.ObjectIndexToImageIndex which is a slow method, by setting this parameter to true.
 | objectPath | String | Path to the object, when the object is grouped with others. This parameter only has meaning if usesObjectIndex is true. If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"

Returns

Image name.

See also

  • XlsFile


XlsFile.HasImageAlternate Method | FlexCel Studio for the .NET Framework documentation

XlsFile.HasImageAlternate Method

Returns true if the image has an alternate representation. This currently happens only with SVG images, which have a PNG base and an SVG alternate. If the image has an alternate, you can get the data with ExcelFile.GetImageAlternate

Syntax

Namespace: FlexCel.XlsAdapter

public override Boolean HasImageAlternate(Int32 imageIndex, String objectPath, Boolean usesObjectIndex)

Parameters

<-> Parameter Type Description
imageIndex Int32 Index of the image. (1 based)
objectPath String Object path to the image when it is a grouped image. For toplevel images you can use String.Empty.
In other case, you need to use the value returned by ExcelFile.GetObjectProperties(Int32, Boolean)
Important: ObjectPath is ignored if usesObjectIndex is false.

If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"
You might also use the name of the image as object path, like in xls.GetImage(-1, "@myimage", ref imageType, ImageStream, true)
usesObjectIndex Boolean If false then imageIndex is an index to the list of images.
When true imageIndex is an index to the list of all objects in the sheet. When you have the object id, you can avoid calling ExcelFile.ObjectIndexToImageIndex which is a slow method, by setting this parameter to true.

See also

  • XlsFile


XlsFile.GetImageProperties Method | FlexCel Studio for the .NET Framework documentation

XlsFile.GetImageProperties Method

Returns image position and size.

Syntax

Namespace: FlexCel.XlsAdapter

public override TImageProperties GetImageProperties(Int32 imageIndex, Boolean usesObjectIndex, String objectPath)

Parameters

<-> | Parameter | Type | Description
 | imageIndex | Int32 | Index of the image (1 based)
 | usesObjectIndex | Boolean | If false (the default) then imageIndex is an index to the list of images. When true imageIndex is an index to the list of all objects in the sheet. When you have the object id, you can avoid calling ExcelFile.ObjectIndexToImageIndex which is a slow method, by setting this parameter to true.
 | objectPath | String | Path to the object, when the object is grouped with others. This parameter only has meaning if usesObjectIndex is true. If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"

Returns

Image position and size.

See also

  • XlsFile


XlsFile.AddImage Method | FlexCel Studio for the .NET Framework documentation

XlsFile.AddImage Method

Adds an image to the active sheet. Note that for SVG images, xlsx files store both a PNG and SVG image. To enter an SVG image, use ExcelFile.AddImageAlternate

Syntax

Namespace: FlexCel.XlsAdapter

public override void AddImage(Byte[] data, TXlsImgType imageType, TImageProperties imageProperties)

Parameters

<-> | Parameter | Type | Description
 | data | Byte[] | byte array with the image data.
 | imageType | TXlsImgType | Type of image you are inserting (bmp, jpg, etc).
 | imageProperties | TImageProperties | Placement and other properties of the image.

See also

  • XlsFile


XlsFile.AddImageAlternate Method | FlexCel Studio for the .NET Framework documentation

XlsFile.AddImageAlternate Method

Adds an image to the active sheet. Currently this method is only needed for SVG images, since SVG images are stored as both PNG and SVG inside the xlsx file. This method allows you to supply both images.

Syntax

Namespace: FlexCel.XlsAdapter

public override void AddImageAlternate(Byte[] PNGData, TImageProperties imageProperties, TSVGBlip aSVGBlip)

Parameters

<-> | Parameter | Type | Description
 | PNGData | Byte[] | Image data for the PNG file that will be used as a backup for the SVG. This data must be in PNG file format.
 | imageProperties | TImageProperties | Image Properties.
 | aSVGBlip | TSVGBlip | Data for the SVG image to be added.

See also

  • XlsFile


XlsFile.DeleteImage Method | FlexCel Studio for the .NET Framework documentation

XlsFile.DeleteImage Method

Deletes the image at position imageIndex. Note that if the image is grouped, this will remove the full group. To remove a particular image inside a group, use ExcelFile.DeleteObject(Int32, String).

Syntax

Namespace: FlexCel.XlsAdapter

public override void DeleteImage(Int32 imageIndex, Boolean usesObjectIndex, String objectPath)

Parameters

<-> | Parameter | Type | Description
 | imageIndex | Int32 | Index of the image to delete. (1 based)
 | usesObjectIndex | Boolean | If false (the default) then imageIndex is an index to the list of images. When true imageIndex is an index to the list of all objects in the sheet. When you have the object id, you can avoid calling ExcelFile.ObjectIndexToImageIndex which is a slow method, by setting this parameter to true.
 | objectPath | String | Path to the object, when the object is grouped with others. This parameter only has meaning if usesObjectIndex is true. If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"

See also

  • XlsFile


XlsFile.ClearImage Method | FlexCel Studio for the .NET Framework documentation

XlsFile.ClearImage Method

Clears the image at position imageIndex, leaving an empty white box.

Syntax

Namespace: FlexCel.XlsAdapter

public override void ClearImage(Int32 imageIndex, Boolean usesObjectIndex, String objectPath)

Parameters

<-> | Parameter | Type | Description
 | imageIndex | Int32 | Index of the image to clear. (1 based)
 | usesObjectIndex | Boolean | If false (the default) then imageIndex is an index to the list of images. When true imageIndex is an index to the list of all objects in the sheet. When you have the object id, you can avoid calling ExcelFile.ObjectIndexToImageIndex which is a slow method, by setting this parameter to true.
 | objectPath | String | Path to the object, when the object is grouped with others. This parameter only has meaning if usesObjectIndex is true. If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"

See also

  • XlsFile


XlsFile.SetSheetBackground Method | FlexCel Studio for the .NET Framework documentation

XlsFile.SetSheetBackground Method

Sets the sheet background for the active sheet. Set it to null to remove the background.

Syntax

Namespace: FlexCel.XlsAdapter

public override void SetSheetBackground(Byte[] imgData)

Parameters

<-> | Parameter | Type | Description
 | imgData | Byte[] | Bytes with the image data.

See also

  • XlsFile


XlsFile.GetSheetBackground Method | FlexCel Studio for the .NET Framework documentation

XlsFile.GetSheetBackground Method

Gets the sheet background for the active sheet. It will return null if there isn't any background in the sheet.

Syntax

Namespace: FlexCel.XlsAdapter

public override Byte[] GetSheetBackground(out TXlsImgType imageType)

Parameters

<-> | Parameter | Type | Description
out | imageType | TXlsImgType | Returns the image type of the bytes returned.

Returns

The image data as a byte array.

See also

  • XlsFile


XlsFile.ImageIndexToObjectIndex Method | FlexCel Studio for the .NET Framework documentation

XlsFile.ImageIndexToObjectIndex Method

Returns the general index on the object list for an image. You can use then this index on SendToBack, for example. Note that if the image is in a group, this method will return the first object index for the group that contains the image. If you want to get the object path to the image instead, look at ExcelFile.ImageIndexToObjectPath

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 ImageIndexToObjectIndex(Int32 imageIndex)

Parameters

<-> | Parameter | Type | Description
 | imageIndex | Int32 | Image index on the image array.

Returns

Image index on the total objects array.

See also

  • XlsFile


XlsFile.ObjectIndexToImageIndex Method | FlexCel Studio for the .NET Framework documentation

XlsFile.ObjectIndexToImageIndex Method

Returns the index on the image collection of an object. Note that this method is slow when there are many images, so use it sparingly.

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 ObjectIndexToImageIndex(Int32 objectIndex)

Parameters

<-> | Parameter | Type | Description
 | objectIndex | Int32 | General index of the image on the Object collection.

Returns

-1 if the object is not an image, else the index on the image collection.

See also

  • XlsFile


XlsFile.ImageIndexToObjectPath Method | FlexCel Studio for the .NET Framework documentation

XlsFile.ImageIndexToObjectPath Method

Returns the absolute object path for an image, given an image index. Note that this method can be slow if there are many objects in the file. Whenever possible, prefer the methods that take directly an imageIndex instead of converting the imageIndex to an objectPath.

Syntax

Namespace: FlexCel.XlsAdapter

public override String ImageIndexToObjectPath(Int32 imageIndex)

Parameters

<-> | Parameter | Type | Description
 | imageIndex | Int32 | Image index on the image array.

Returns

Image index on the total objects array.

See also

  • XlsFile


XlsFile.ObjectPathToImageIndex Method | FlexCel Studio for the .NET Framework documentation

XlsFile.ObjectPathToImageIndex Method

Returns the index on the image collection of an object. Note that this method is slow when there are many images, so use it sparingly. Whenever possible, prefer the methods that take directly an objectPath instead of converting the objectPath to an imageIndex.

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 ObjectPathToImageIndex(Int32 objectIndex, String objectPath)

Parameters

<-> Parameter Type Description
objectIndex Int32 Index of the object.
objectPath String Index to the child object you want find.
If it is a simple object, you can use String.Empty here, if not you need to get the ObjectPath from ExcelFile.GetObjectProperties(Int32, Boolean)
If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3".
You might also use the name of the object as objectpath, like ObjectPathToImageIndex(-1, "@myobjectname");

Returns

-1 if the object is not an image, else the index on the image collection.

See also

  • XlsFile


XlsFile.GetObjectName Method | FlexCel Studio for the .NET Framework documentation

XlsFile.GetObjectName Method

Returns the name of the object at objectIndex position.

Syntax

Namespace: FlexCel.XlsAdapter

public override String GetObjectName(Int32 objectIndex)

Parameters

<-> | Parameter | Type | Description
 | objectIndex | Int32 | Object index. (1-based)

See also

  • XlsFile


XlsFile.GetObjectShapeId Method | FlexCel Studio for the .NET Framework documentation

XlsFile.GetObjectShapeId Method

Returns the shape id of the object at objectIndex position. Shape Ids are internal identifiers for the shape, that you can use to uniquely identify a shape. Note that the shape id can change when you load the file, once it is loaded, it will remain the same for the shape lifetime.

Syntax

Namespace: FlexCel.XlsAdapter

public override Int64 GetObjectShapeId(Int32 objectIndex)

Parameters

<-> | Parameter | Type | Description
 | objectIndex | Int32 | Object index. (1-based)

See also

  • XlsFile


XlsFile.FindObjectPath Method | FlexCel Studio for the .NET Framework documentation

XlsFile.FindObjectPath Method

Finds an object by its name, and returns the ObjectPath you need to use this object. Note that if there is more than an object with the same name in the sheet, this method will return null.

Syntax

Namespace: FlexCel.XlsAdapter

public override String FindObjectPath(String objectName)

Parameters

<-> | Parameter | Type | Description
 | objectName | String | Name of the object we are looking for.

See also

  • XlsFile


XlsFile.FindObjectByShapeId Method | FlexCel Studio for the .NET Framework documentation

XlsFile.FindObjectByShapeId Method

Finds an object given its internal shape id, and returns the object index you need to access the same object in FlexCel.

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 FindObjectByShapeId(Int64 ShapeId)

Parameters

<-> | Parameter | Type | Description
 | ShapeId | Int64 | Shape id of the object.

See also

  • XlsFile


XlsFile.GetObjectAnchor Method | FlexCel Studio for the .NET Framework documentation

XlsFile.GetObjectAnchor Method

Returns the placement of the object.

Syntax

Namespace: FlexCel.XlsAdapter

public override TClientAnchor GetObjectAnchor(Int32 objectIndex, String objectPath)

Parameters

<-> Parameter Type Description
objectIndex Int32 Index of the object (1-based)
objectPath String Index to the child object you want to change the text.
If it is a simple object, you can use String.Empty here, if not you need to get the ObjectPath from ExcelFile.GetObjectProperties(Int32, Boolean)
If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3".
You might also use the name of the object as objectpath, like GetObjectAnchor(-1, "@myobjectname");

Returns

Coordinates of the object.

See also

  • XlsFile


XlsFile.SetObjectAnchor Method | FlexCel Studio for the .NET Framework documentation

XlsFile.SetObjectAnchor Method

Sets the object placement.

Syntax

Namespace: FlexCel.XlsAdapter

public override void SetObjectAnchor(Int32 objectIndex, String objectPath, TClientAnchor objectAnchor)

Parameters

<-> | Parameter | Type | Description
 | objectIndex | Int32 | Index of the object (1-based)
 | objectPath | String | Object path for the shape if this is a grouped shape.
 | objectAnchor | TClientAnchor | Coordinates of the object.

See also

  • XlsFile


XlsFile.GetObjectProperties Method | FlexCel Studio for the .NET Framework documentation

XlsFile.GetObjectProperties Method

Returns information on an object and all of its children. If the shape doesn't exist, this method returns null.

Syntax

Namespace: FlexCel.XlsAdapter

public override TShapeProperties GetObjectProperties(Int32 objectIndex, String objectPath, Boolean getShapeOptions)

Parameters

<-> Parameter Type Description
objectIndex | Int32 | Index of the object (1-based)
objectPath String Index to the child object you want to change the text.
If it is a simple object, you can use String.Empty here, if not you need to get the ObjectPath from ExcelFile.GetObjectProperties(Int32, Boolean)
If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3".
You might also use the name of the object as objectpath by writing "@" at the start of the name, like in GetObjectProperties\(\-1, "@myobjectname", true);
getShapeOptions | Boolean | When true, shape options will be retrieved. As this can be a slow operation, only specify true when you really need those options.

See also

  • XlsFile


XlsFile.GetObjectPropertiesByShapeId Method | FlexCel Studio for the .NET Framework documentation

XlsFile.GetObjectPropertiesByShapeId Method

Returns information on an object and all of its children and parents.

Note: This method always returns a top level object. If you ask for a shape id of a shape that is contained inside other group, this method will return the first level group containing other groups that contain the shape.

Note 2:This method is mostly for internal use. Shape ids are not guaranteed to be preserved when saving and reloading a file, so this method should only be used while editing the file with shape ids retrieved from the XlsFile object, not hardcoded shape ids. To get the object properties for a known shape in a file, give it a name and call ExcelFile.GetObjectProperties(Int32, String, Boolean) with an objectPath of "@name\-of\-the\-shape".

Syntax

Namespace: FlexCel.XlsAdapter

public override TShapeProperties GetObjectPropertiesByShapeId(Int64 shapeId, Boolean getShapeOptions)

Parameters

<-> | Parameter | Type | Description
 | shapeId | Int64 | Identifier of the shape.
 | getShapeOptions | Boolean | When true, shape options will be retrieved. As this can be a slow operation, only specify true when you really need those options.

See also

  • XlsFile


XlsFile.SetObjectText Method | FlexCel Studio for the .NET Framework documentation

XlsFile.SetObjectText Method

Overloads

  • XlsFile.SetObjectText(Int32, String, String)
  • XlsFile.SetObjectText(Int32, String, TRichString)
  • XlsFile.SetObjectText(Int32, String, TDrawingRichString)

XlsFile.SetObjectText(Int32, String, String)

Sets the text for an autoshape. If the object does not accept text, this method will do nothing. This version of the method will only modify the text of the object, and preserve the existing formatting in the object if there was one.

Syntax

Namespace: FlexCel.XlsAdapter

public override void SetObjectText(Int32 objectIndex, String objectPath, String text)

Parameters

<-> Parameter Type Description
objectIndex | Int32 | Index of the object (1-based)
objectPath String Index to the child object you want to change the text.
If it is a simple object, you can use String.Empty here, if not you need to get the ObjectPath from ExcelFile.GetObjectProperties(Int32, Boolean)
If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"
text | String | Text you want to use. Use null to delete text from an AutoShape.

See also

  • XlsFile

XlsFile.SetObjectText(Int32, String, TRichString)

Sets the text for an autoshape. If the object does not accept text, this method will do nothing. This version of the method will only modify the rich string properties of the object text, and preserve those things not available in a TRichString like wordArt effects.

Syntax

Namespace: FlexCel.XlsAdapter

public override void SetObjectText(Int32 objectIndex, String objectPath, TRichString text)

Parameters

<-> Parameter Type Description
objectIndex | Int32 | Index of the object (1-based)
objectPath String Index to the child object you want to change the text.
If it is a simple object, you can use String.Empty here, if not you need to get the ObjectPath from ExcelFile.GetObjectProperties(Int32, Boolean)
If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"
text | TRichString | Text you want to use. Use null to delete text from an AutoShape.

See also

  • XlsFile

XlsFile.SetObjectText(Int32, String, TDrawingRichString)

Sets the text for an autoshape. If the object does not accept text, this method will do nothing.

Syntax

Namespace: FlexCel.XlsAdapter

public override void SetObjectText(Int32 objectIndex, String objectPath, TDrawingRichString text)

Parameters

<-> Parameter Type Description
objectIndex | Int32 | Index of the object (1-based)
objectPath String Index to the child object you want to change the text.
If it is a simple object, you can use String.Empty here, if not you need to get the ObjectPath from ExcelFile.GetObjectProperties(Int32, Boolean)
If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"
text | TDrawingRichString | Text you want to use. Use null to delete text from an AutoShape.

See also

  • XlsFile


XlsFile.SetObjectName Method | FlexCel Studio for the .NET Framework documentation

XlsFile.SetObjectName Method

Sets the name for an autoshape.

Syntax

Namespace: FlexCel.XlsAdapter

public override void SetObjectName(Int32 objectIndex, String objectPath, String name)

Parameters

<-> Parameter Type Description
objectIndex | Int32 | Index of the object (1-based)
objectPath String Index to the child object you want to change the text.
If it is a simple object, you can use String.Empty here, if not you need to get the ObjectPath from ExcelFile.GetObjectProperties(Int32, Boolean)
If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"
name | String | Name for the autoshape. Use null to remove the name from an AutoShape.

See also

  • XlsFile


XlsFile.SetObjectProperty Method | FlexCel Studio for the .NET Framework documentation

XlsFile.SetObjectProperty Method

Overloads

  • XlsFile.SetObjectProperty(Int32, String, TShapeOption, Int64)
  • XlsFile.SetObjectProperty(Int32, String, TShapeOption, Double)
  • XlsFile.SetObjectProperty(Int32, String, TShapeOption, Boolean)
  • XlsFile.SetObjectProperty(Int32, String, TShapeOption, String)
  • XlsFile.SetObjectProperty(Int32, String, TShapeOption, TDrawingHyperlink)
  • XlsFile.SetObjectProperty(Int32, String, TShapeOption, Int32, Boolean)

XlsFile.SetObjectProperty(Int32, String, TShapeOption, Int64)

Sets a LONG property for an autoshape. Verify the property expects a LONG. This is an advanced method and should be used with care. For normal use, you should use one of the standard methods.

Syntax

Namespace: FlexCel.XlsAdapter

public override void SetObjectProperty(Int32 objectIndex, String objectPath, TShapeOption shapeProperty, Int64 value)

Parameters

<-> Parameter Type Description
objectIndex | Int32 | Index of the object (1-based)
objectPath String Index to the child object you want to change the property.
If it is a simple object, you can use String.Empty here, if not you need to get the ObjectPath from ExcelFile.GetObjectProperties(Int32, Boolean)
If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"
shapeProperty | TShapeOption | Property you want to change.
value | Int64 | Value you want to use.

See also

  • XlsFile

XlsFile.SetObjectProperty(Int32, String, TShapeOption, Double)

Sets a DOUBLE (Encoded as 16.16) property for an autoshape. Verify the property expects a DOUBLE. This is an advanced method and should be used with care. For normal use, you should use one of the standard methods.

Syntax

Namespace: FlexCel.XlsAdapter

public override void SetObjectProperty(Int32 objectIndex, String objectPath, TShapeOption shapeProperty, Double value)

Parameters

<-> Parameter Type Description
objectIndex | Int32 | Index of the object (1-based)
objectPath String Index to the child object you want to change the property.
If it is a simple object, you can use String.Empty here, if not you need to get the ObjectPath from ExcelFile.GetObjectProperties(Int32, Boolean)
If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"
shapeProperty | TShapeOption | Property you want to change.
value | Double | Value you want to use.

See also

  • XlsFile

XlsFile.SetObjectProperty(Int32, String, TShapeOption, Boolean)

Sets a BOOLEAN property for an autoshape. Verify the property expects a BOOLEAN. This is an advanced method and should be used with care. For normal use, you should use one of the standard methods.

Syntax

Namespace: FlexCel.XlsAdapter

public override void SetObjectProperty(Int32 objectIndex, String objectPath, TShapeOption shapeProperty, Boolean value)

Parameters

<-> Parameter Type Description
objectIndex | Int32 | Index of the object (1-based)
objectPath String Index to the child object you want to change the property.
If it is a simple object, you can use String.Empty here, if not you need to get the ObjectPath from ExcelFile.GetObjectProperties(Int32, Boolean)
If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"
shapeProperty | TShapeOption | Property you want to change.
value | Boolean | Value you want to use.

See also

  • XlsFile

XlsFile.SetObjectProperty(Int32, String, TShapeOption, String)

Sets a STRING property for an autoshape. Verify the property expects a STRING. This is an advanced method and should be used with care. For normal use, you should use one of the standard methods. (like SetObjectText)

Syntax

Namespace: FlexCel.XlsAdapter

public override void SetObjectProperty(Int32 objectIndex, String objectPath, TShapeOption shapeProperty, String text)

Parameters

<-> Parameter Type Description
objectIndex | Int32 | Index of the object (1-based)
objectPath String Index to the child object you want to change the property.
If it is a simple object, you can use String.Empty here, if not you need to get the ObjectPath from ExcelFile.GetObjectProperties(Int32, Boolean)
If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"
shapeProperty | TShapeOption | Property you want to change.
text | String | Text you want to use.

See also

  • XlsFile

XlsFile.SetObjectProperty(Int32, String, TShapeOption, TDrawingHyperlink)

Sets an Hyperlink property for an autoshape. Verify the property expects a Hyperlink, currently only TShapeOption.pihlShape expects hyperlinks. This is an advanced method and should be used with care. For normal use, you should use one of the standard methods.

Syntax

Namespace: FlexCel.XlsAdapter

public override void SetObjectProperty(Int32 objectIndex, String objectPath, TShapeOption shapeProperty, TDrawingHyperlink value)

Parameters

<-> Parameter Type Description
objectIndex | Int32 | Index of the object (1-based)
objectPath String Index to the child object you want to change the property.
If it is a simple object, you can use String.Empty here, if not you need to get the ObjectPath from ExcelFile.GetObjectProperties(Int32, Boolean)
If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"
shapeProperty | TShapeOption | Property you want to change. For hyperlinks it should be TShapeOption.pihlShape
value | TDrawingHyperlink | Value you want to use.

See also

  • XlsFile

XlsFile.SetObjectProperty(Int32, String, TShapeOption, Int32, Boolean)

Sets a BOOLEAN property for an autoshape. Verify the property expects a BOOLEAN.

This is an advanced method, you probably want to use ExcelFile.SetObjectProperty(Int32, String, TShapeOption, Boolean) instead. This is an advanced method and should be used with care. For normal use, you should use one of the standard methods. Note that boolean properties are all stored in the same byte of the last property in the set.

Syntax

Namespace: FlexCel.XlsAdapter

public override void SetObjectProperty(Int32 objectIndex, String objectPath, TShapeOption shapeProperty, Int32 positionInSet, Boolean value)

Parameters

<-> Parameter Type Description
objectIndex | Int32 | Index of the object (1-based)
objectPath String Index to the child object you want to change the property.
If it is a simple object, you can use String.Empty here, if not you need to get the ObjectPath from ExcelFile.GetObjectProperties(Int32, Boolean)
If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"
shapeProperty | TShapeOption | Property you want to change. MAKE SURE it is the LAST property in the set.
positionInSet | Int32 | Boolean properties are grouped so all properties on one set are in only one value. So, the last bool property on the set is the first bit, and so on. ONLY THE LAST PROPERTY ON THE SET IS PRESENT.
value | Boolean | Value you want to use.

See also

  • XlsFile


XlsFile.SetObjectProperties Method | FlexCel Studio for the .NET Framework documentation

XlsFile.SetObjectProperties Method

Sets all the properties of the shape. This allows for more complete control than ExcelFile.SetObjectProperty(Int32, String, TShapeOption, String) beause it can specify for example a xlsx fill using a theme color, instead of simple RGB fills.

Syntax

Namespace: FlexCel.XlsAdapter

public override void SetObjectProperties(Int32 objectIndex, String objectPath, TShapeProperties shapeProperties, Boolean applyAnchor)

Parameters

<-> Parameter Type Description
objectIndex | Int32 | Index of the object (1-based)
objectPath String Index to the child object you want to change the property.
If it is a simple object, you can use String.Empty here, if not you need to get the ObjectPath from ExcelFile.GetObjectProperties(Int32, Boolean)
If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"
shapeProperties | TShapeProperties | All the properties of the object. You will normally get this value from ExcelFile.GetObjectProperties(Int32, Boolean) and then replace the values you want.
applyAnchor Boolean If true, the anchor of the shape properties will be copied too. If false, the anchor won't change.
False can be used when you want to copy the properties from one object to another, but keep the positions.

See also

  • XlsFile


XlsFile.AddAutoShape Method | FlexCel Studio for the .NET Framework documentation

XlsFile.AddAutoShape Method

Adds an autoshape to the sheet. You can add shapes to a worksheet, or to a chart sheet. For an example on how to add a shape, please create a shape in Excel, then open the file with APIMate and look at the generated code.

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 AddAutoShape(TShapeProperties shapeProperties)

Parameters

<-> | Parameter | Type | Description
 | shapeProperties | TShapeProperties | Properties of the shape we want to add.

Returns

The object index of the new shape.

See also

  • XlsFile


XlsFile.DeleteObject Method | FlexCel Studio for the .NET Framework documentation

XlsFile.DeleteObject Method

Deletes the graphic object at objectIndex. Use it with care, there are some graphics objects you don't want to remove (like comment boxes when you don't delete the associated comment.)

Syntax

Namespace: FlexCel.XlsAdapter

public override void DeleteObject(Int32 objectIndex, String objectPath)

Parameters

<-> Parameter Type Description
objectIndex Int32 Index of the object (1 based).
objectPath String Index to the child object you want to change the property.
If it is a simple object, you can use String.Empty here, if not you need to get the ObjectPath from ExcelFile.GetObjectProperties(Int32, Boolean)
If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"

See also

  • XlsFile


XlsFile.GetObjectsInRange Method | FlexCel Studio for the .NET Framework documentation

XlsFile.GetObjectsInRange Method

Returns a list with all the objects that are completely inside a range of cells.

Syntax

Namespace: FlexCel.XlsAdapter

public override void GetObjectsInRange(TXlsCellRange range, TExcelObjectList objectsInRange)

Parameters

<-> | Parameter | Type | Description
 | range | TXlsCellRange | Range of cells where we want to find the objects.
 | objectsInRange | TExcelObjectList | In this list we will add all the objects found. Note that the objects will be added to the list, so if you want just the objects in this range, make sure you clear the list before calling this method.

See also

  • XlsFile


XlsFile.GetObjectLinkedCell Method | FlexCel Studio for the .NET Framework documentation

XlsFile.GetObjectLinkedCell Method

Returns the cell that is linked to the object. If the object isn't an object that can be linked or it isn't linked, this method will return null. Note that when you change the value in the cell linked to this object, the value of the object will change.

The sheet returned in the TCellAddress might be null, in which case the reference is to a cell in the same sheet, or it might contain another sheet name.

Also note that this applies to form objects. To get the link of a shape like a circle or rectangle, use ExcelFile.GetShapeLinkedCell instead.

Syntax

Namespace: FlexCel.XlsAdapter

public override TCellAddress GetObjectLinkedCell(Int32 objectIndex, String objectPath)

Parameters

<-> Parameter Type Description
objectIndex Int32 Index of the object (1 based)
objectPath String Index to the child object you want to change the property.
If it is a simple object, you can use String.Empty here, if not you need to get the ObjectPath from ExcelFile.GetObjectProperties(Int32, Boolean)
If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"

Returns

The cell address this object is linked to, or null if it isn't linked.

See also

  • XlsFile


XlsFile.GetShapeLinkedCell Method | FlexCel Studio for the .NET Framework documentation

XlsFile.GetShapeLinkedCell Method

Returns the cell that is linked to the shape or image. If the object isn't linked, this method will return null. Note that when you change the value in the cell linked to this object, the value of the object will change. Also note that this method applies to shapes like a rectangle or circle, or an image. To get the link of a forms object like a combobox or a radiobutton use ExcelFile.GetObjectLinkedCell instead.

Remarks

Images behave differently from shapes: A linked shape will change its text with the value of the cells. A linked image will change its image, to be an screenshot of the selected range. Finally, a linked object like a combobox you can get with ExcelFile.GetObjectLinkedCell will modify the selected item depending on the linked cell.

Syntax

Namespace: FlexCel.XlsAdapter

public override String GetShapeLinkedCell(Int32 objectIndex, String objectPath)

Parameters

<-> Parameter Type Description
objectIndex Int32 Index of the object (1 based)
objectPath String Index to the child object you want to change the property.
If it is a simple object, you can use String.Empty here, if not you need to get the ObjectPath from ExcelFile.GetObjectProperties(Int32, Boolean)
If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"

Returns

The cell address or name which this shape is linked to, or null if it isn't linked.

See also

  • XlsFile


XlsFile.SetObjectLinkedCell Method | FlexCel Studio for the .NET Framework documentation

XlsFile.SetObjectLinkedCell Method

Links the object to a cell, if the object can be linked. If the object is a radio button then all the other radio buttons in the group will be linked to the same cell, so when the cell changes the radio buttons too, and vice-versa. To unlink the cell, make linkedCell null.

Remarks

Note that when the object is a radio button, this affects all radio buttons in the same group, not just the first. Also this method applies only to "objects" from the "Developer" tab like a button or a radio button. For shapes, see ExcelFile.SetShapeLinkedCell

Syntax

Namespace: FlexCel.XlsAdapter

public override void SetObjectLinkedCell(Int32 objectIndex, String objectPath, TCellAddress linkedCell)

Parameters

<-> Parameter Type Description
objectIndex | Int32 | Index of the object (1 based)
objectPath String Index to the child object you want to change the property.
If it is a simple object, you can use String.Empty here, if not you need to get the ObjectPath from ExcelFile.GetObjectProperties(Int32, Boolean)
If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"
linkedCell | TCellAddress | Cell that will be linked to the object. To unlink the object, make this parameter null.

See also

  • XlsFile


XlsFile.SetShapeLinkedCell Method | FlexCel Studio for the .NET Framework documentation

XlsFile.SetShapeLinkedCell Method

Links the shape or image to a cell, if the shape can be linked. To unlink the cell, make linkedCell null. Note that this method applies to shapes like a rectangle or circle, or images. To change the link of a forms object like a combobox or a radiobutton use ExcelFile.SetObjectLinkedCell instead.

Remarks

Images behave differently from shapes: A linked shape will change its text with the value of the cells. A linked image will change its image, to be an screenshot of the selected range. Finally, a linked object like a combobox you can get with ExcelFile.GetObjectLinkedCell will modify the selected item depending on the linked cell.

Syntax

Namespace: FlexCel.XlsAdapter

public override void SetShapeLinkedCell(Int32 objectIndex, String objectPath, String linkedCell)

Parameters

<-> Parameter Type Description
objectIndex | Int32 | Index of the object (1 based)
objectPath String Index to the child object you want to change the property.
If it is a simple object, you can use String.Empty here, if not you need to get the ObjectPath from ExcelFile.GetObjectProperties(Int32, Boolean)
If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"
linkedCell | String | Cell that will be linked to the shape. To unlink the shape, make this parameter null. Note that this can be a single cell like "A3", a simple rectangular range like A1:B4, or a name like "myName". You can't use a complex formula here like "A1&A2"

See also

  • XlsFile


XlsFile.GetObjectInputRange Method | FlexCel Studio for the .NET Framework documentation

XlsFile.GetObjectInputRange Method

Returns the input range for the object. If the object isn't a combobox or listbox, or it doesn't have an input range, this method will return null. Note that when you change the value in the cell linked to this object, the value of the object will change.

The sheet in the TCellAddresses returned might be null, in which case the reference is to a cell in the same sheet, or it might contain another sheet name.

Syntax

Namespace: FlexCel.XlsAdapter

public override TCellAddressRange GetObjectInputRange(Int32 objectIndex, String objectPath)

Parameters

<-> Parameter Type Description
objectIndex Int32 Index of the object (1 based)
objectPath String Index to the child object you want to change the property.
If it is a simple object, you can use String.Empty here, if not you need to get the ObjectPath from ExcelFile.GetObjectProperties(Int32, Boolean)
If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"

Returns

The input range, or null if the object doesn't have an input range.

See also

  • XlsFile


XlsFile.SetObjectInputRange Method | FlexCel Studio for the .NET Framework documentation

XlsFile.SetObjectInputRange Method

Sets the input range for a ListBox or a ComboBox. When applied to other objects, this method does nothing.

Syntax

Namespace: FlexCel.XlsAdapter

public override void SetObjectInputRange(Int32 objectIndex, String objectPath, TCellAddressRange inputRange)

Parameters

<-> Parameter Type Description
objectIndex | Int32 | Index of the object (1 based)
objectPath String Index to the child object you want to change the property.
If it is a simple object, you can use String.Empty here, if not you need to get the ObjectPath from ExcelFile.GetObjectProperties(Int32, Boolean)
If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"
inputRange | TCellAddressRange | Input range for the object.

See also

  • XlsFile


XlsFile.GetObjectMacro Method | FlexCel Studio for the .NET Framework documentation

XlsFile.GetObjectMacro Method

Returns the macro associated with an object, or null if there is no macro associated.

Syntax

Namespace: FlexCel.XlsAdapter

public override String GetObjectMacro(Int32 objectIndex, String objectPath)

Parameters

<-> Parameter Type Description
objectIndex Int32 Index of the object (1 based)
objectPath String Index to the child object you want to change the property.
If it is a simple object, you can use String.Empty here, if not you need to get the ObjectPath from ExcelFile.GetObjectProperties(Int32, Boolean)
If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"

Returns

The macro associated with the object, or null if there isn't any macro associated.

See also

  • XlsFile


XlsFile.SetObjectMacro Method | FlexCel Studio for the .NET Framework documentation

XlsFile.SetObjectMacro Method

Associates an object with a macro. While this will normally be used in buttons, you can associate macros to almost any object.

Syntax

Namespace: FlexCel.XlsAdapter

public override void SetObjectMacro(Int32 objectIndex, String objectPath, String macro)

Parameters

<-> Parameter Type Description
objectIndex | Int32 | Index of the object (1 based)
objectPath String Index to the child object you want to change the property.
If it is a simple object, you can use String.Empty here, if not you need to get the ObjectPath from ExcelFile.GetObjectProperties(Int32, Boolean)
If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"
macro | String | Macro that will be associated with the object. Look at ApiMate to know the exact name you have to enter here.

See also

  • XlsFile


XlsFile.GetCheckboxState Method | FlexCel Studio for the .NET Framework documentation

XlsFile.GetCheckboxState Method

Gets the value of a checkbox in the active sheet. Note that this only works for checkboxes added through the Forms toolbar. It won't return the values of ActiveX checkboxes.

Remarks

Note that if the checkbox is linked to a cell and you changed the cell value, this method will return the cell value.

Syntax

Namespace: FlexCel.XlsAdapter

public override TCheckboxState GetCheckboxState(Int32 objectIndex, String objectPath)

Parameters

<-> Parameter Type Description
objectIndex Int32 Index of the object (1 based)
objectPath String Index to the child object you want to change the property.
If it is a simple object, you can use String.Empty here, if not you need to get the ObjectPath from ExcelFile.GetObjectProperties(Int32, Boolean)
If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"

Returns

If the checkbox is checked or not.

Examples

To get all the checkboxes in the active sheet, you can use this code:

    XlsFile xls = new XlsFile("checkboxes.xls"); //Open the file we want to read.
    for (int i = 1; i <= xls.ObjectCount; i++) //Loop over all objects.
    {
        TShapeProperties shp = xls.GetObjectProperties(i, false);
        if (shp.ObjectType == TObjectType.CheckBox) //Is it a checkbox?
        {
            LogMessage(shp.Text + " :" + xls.GetCheckboxState(i, null).ToString()); //Log the state of the checkbox
        }
    }

See also

  • XlsFile


XlsFile.SetCheckboxState Method | FlexCel Studio for the .NET Framework documentation

XlsFile.SetCheckboxState Method

Sets the value of a checkbox in the active sheet. Note that this only works for checkboxes added through the Forms toolbar. It won't return the values of ActiveX checkboxes.

Remarks

If the checkbox is linked to a cell, this method will change both the checkbox and the cell.

Syntax

Namespace: FlexCel.XlsAdapter

public override void SetCheckboxState(Int32 objectIndex, String objectPath, TCheckboxState value)

Parameters

<-> Parameter Type Description
objectIndex | Int32 | Index of the object (1 based)
objectPath String Index to the child object you want to change the property.
If it is a simple object, you can use String.Empty here, if not you need to get the ObjectPath from ExcelFile.GetObjectProperties(Int32, Boolean)
If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"
value | TCheckboxState | Value to set.

Examples

To set a checkbox given its text, use the code:

    XlsFile xls = new XlsFile("checkboxes.xls");
    for (int i = 1; i <= xls.ObjectCount; i++)
    {
        TShapeProperties shp = xls.GetObjectProperties(i, false);
        if (shp.ObjectType == TObjectType.CheckBox && shp.Text == "MyText")
        {
            xls.SetCheckboxState(i, null, TCheckboxState.Checked);
        }
    }

To change a checkbox given its name instead of its text, replace shp.Text == "MyText" by shp.Name == "MyName" in the code above.

See also

  • XlsFile


XlsFile.GetCheckboxLinkedCell Method | FlexCel Studio for the .NET Framework documentation

XlsFile.GetCheckboxLinkedCell Method

Important

This Method is obsolete.

Use GetObjectLinkedCell instead.

OBSOLETE: Use ExcelFile.GetObjectLinkedCell instead.

Returns the cell that is linked to the checkbox. If the object isn't a checkbox or it isn't linked, this method will return null. Note that when you change the value in the cell linked to this checkbox, the value of the checkbox will change.

The sheet returned in the TCellAddress might be null, in which case the reference is to a cell in the same sheet, or it might contain another sheet name.

Syntax

Namespace: FlexCel.XlsAdapter

public override TCellAddress GetCheckboxLinkedCell(Int32 objectIndex, String objectPath)

Parameters

<-> Parameter Type Description
objectIndex Int32 Index of the object (1 based)
objectPath String Index to the child object you want to change the property.
If it is a simple object, you can use String.Empty here, if not you need to get the ObjectPath from ExcelFile.GetObjectProperties(Int32, Boolean)
If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"

Returns

The cell address this checkbox is linked to, or null if it isn't linked.

See also

  • XlsFile


XlsFile.SetCheckboxLinkedCell Method | FlexCel Studio for the .NET Framework documentation

XlsFile.SetCheckboxLinkedCell Method

Important

This Method is obsolete.

Use SetObjectLinkedCell instead.

OBSOLETE: Use ExcelFile.SetObjectLinkedCell instead.

Links the checkbox to a cell, so when the cell changes the checkbox changes too, and vice-versa. To unlink the cell, make linkedCell null.

Syntax

Namespace: FlexCel.XlsAdapter

public override void SetCheckboxLinkedCell(Int32 objectIndex, String objectPath, TCellAddress linkedCell)

Parameters

<-> Parameter Type Description
objectIndex | Int32 | Index of the object (1 based)
objectPath String Index to the child object you want to change the property.
If it is a simple object, you can use String.Empty here, if not you need to get the ObjectPath from ExcelFile.GetObjectProperties(Int32, Boolean)
If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"
linkedCell | TCellAddress | Cell that will be linked to the checkbox. To unlink the checkbox, make this parameter null.

See also

  • XlsFile


XlsFile.AddCheckbox Method | FlexCel Studio for the .NET Framework documentation

XlsFile.AddCheckbox Method

Adds a checkbox to the active sheet.

Remarks

Excel supports 2 types of checkboxes: ActiveX and internal (In Excel you would add them from the "ActiveX" and "Forms" toolbars respectively) The checkboxes added by this method are of type internal. ActiveX checkboxes are not supported.

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 AddCheckbox(TClientAnchor anchor, TRichString text, TCheckboxState value, TCellAddress linkedCell, String name)

Parameters

<-> | Parameter | Type | Description
 | anchor | TClientAnchor | Position for the checkbox.
 | text | TRichString | Text for the checkbox.
 | value | TCheckboxState | Value of the checkbox.
 | linkedCell | TCellAddress | Cell that will be linked to the checkbox. If you don't want to link the checkbox to a cell, make this parameter null.
 | name | String | Name that will be given to the checkbox.

Returns

Object Index of the inserted checkbox (1 based).

See also

  • XlsFile


XlsFile.GetRadioButtonState Method | FlexCel Studio for the .NET Framework documentation

XlsFile.GetRadioButtonState Method

Gets if a radio button in the active sheet is selected or not. Note that this only works for radio buttons added through the Forms toolbar. It won't return the values of ActiveX radio buttons.

Remarks

Note that if the radio button is linked to a cell and you changed the cell value, this method will return the cell value.

Syntax

Namespace: FlexCel.XlsAdapter

public override Boolean GetRadioButtonState(Int32 objectIndex, String objectPath)

Parameters

<-> Parameter Type Description
objectIndex Int32 Index of the object (1 based)
objectPath String Index to the child object you want to change the property.
If it is a simple object, you can use String.Empty here, if not you need to get the ObjectPath from ExcelFile.GetObjectProperties(Int32, Boolean)
If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"

Returns

If the radio button is selected or not.

Examples

To get all the radio buttons in the active sheet, you can use this code:

    XlsFile xls = new XlsFile("radiobuttons.xls"); //Open the file we want to read.
    for (int i = 1; i <= xls.ObjectCount; i++) //Loop over all objects.
    {
        TShapeProperties shp = xls.GetObjectProperties(i, false);
        if (shp.ObjectType == TObjectType.OptionButton) //Is it a radio button?
        {
            LogMessage(shp.Text + " :" + xls.GetRadioButtonState(i, null).ToString()); //Log the state of the radio button.
        }
    }

See also

  • XlsFile


XlsFile.SetRadioButtonState Method | FlexCel Studio for the .NET Framework documentation

XlsFile.SetRadioButtonState Method

Sets the value of a radio button in the active sheet. Note that this only works for radio buttons added through the Forms toolbar. It won't return the values of ActiveX radio buttons

Remarks

If the radio button is linked to a cell, this method will change both the radio button and the cell.

Syntax

Namespace: FlexCel.XlsAdapter

public override void SetRadioButtonState(Int32 objectIndex, String objectPath, Boolean selected)

Parameters

<-> Parameter Type Description
objectIndex Int32 Index of the object (1 based)
objectPath String Index to the child object you want to change the property.
If it is a simple object, you can use String.Empty here, if not you need to get the ObjectPath from ExcelFile.GetObjectProperties(Int32, Boolean)
If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"
selected Boolean If true, the option button will be set, and all other buttons in the range will be deselected.
When false the radio button will be deselected.

Examples

To set a radio button given its text, use the code:

    XlsFile xls = new XlsFile("radiobuttons.xls");
    for (int i = 1; i <= xls.ObjectCount; i++)
    {
        TShapeProperties shp = xls.GetObjectProperties(i, false);
        if (shp.ObjectType == TObjectType.OptionButton && shp.Text == "MyText")
        {
            xls.SetRadioButtonState(i, null, true);
        }
    }

To change a radio button given its name instead of its text, replace shp.Text == "MyText" by shp.Name == "MyName" in the code above.

See also

  • XlsFile


XlsFile.AddRadioButton Method | FlexCel Studio for the .NET Framework documentation

XlsFile.AddRadioButton Method

Adds a radio button to the active sheet. Call ExcelFile.AddGroupBox(TClientAnchor, TRichString) to insert a group box for grouping the radio buttons.

Remarks

Excel supports 2 types of radio buttons: ActiveX and internal (In Excel you would add them from the "ActiveX" and "Forms" toolbars respectively) The radio buttons added by this method are of type internal. ActiveX radio buttons are not supported.

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 AddRadioButton(TClientAnchor anchor, TRichString text, String name)

Parameters

<-> | Parameter | Type | Description
 | anchor | TClientAnchor | Position for the radio button.
 | text | TRichString | Text for the radio button.
 | name | String | Name of the inserted radio button.

Returns

Object Index of the inserted radio button (1 based).

See also

  • XlsFile


XlsFile.AddGroupBox Method | FlexCel Studio for the .NET Framework documentation

XlsFile.AddGroupBox Method

Adds a Group box to the active sheet. Call ExcelFile.AddRadioButton(TClientAnchor, TRichString) to insert radio buttons inside the group box.

Remarks

Excel determines if a radio button is inside a group box by looking at the coordinates of both objects. To include a radio button inside the group box, just make sure it is entirely inside the group box. Object hierarchy doesn't matter here, only the positions of the group box and the radio button.

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 AddGroupBox(TClientAnchor anchor, TRichString text, String name)

Parameters

<-> | Parameter | Type | Description
 | anchor | TClientAnchor | Position for the group box.
 | text | TRichString | Text for the group box.
 | name | String | Name for the inserted Group box

Returns

Object Index of the inserted group box (1 based).

See also

  • XlsFile


XlsFile.GetObjectSelection Method | FlexCel Studio for the .NET Framework documentation

XlsFile.GetObjectSelection Method

Gets the selected item in an object from the "Forms" palette. It can be a combobox or a listbox. 0 means no selection, 1 the first item in the list. Note that this only works for objects added through the Forms toolbar. It won't return the values of ActiveX objects.

Remarks

Note that if the object is linked to a cell and you changed the cell value, this method will return the cell value.

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 GetObjectSelection(Int32 objectIndex, String objectPath)

Parameters

<-> Parameter Type Description
objectIndex Int32 Index of the object (1 based)
objectPath String Index to the child object you want to change the property.
If it is a simple object, you can use String.Empty here, if not you need to get the ObjectPath from ExcelFile.GetObjectProperties(Int32, Boolean)
If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"

Returns

The position of the selected item in the object. 0 means no selection, 1 the first item is selected.

Examples

To get all the comboboxes in the active sheet, you can use this code:

    XlsFile xls = new XlsFile("comboboxes.xls"); //Open the file we want to read.
    for (int i = 1; i <= xls.ObjectCount; i++) //Loop over all objects.
    {
        TShapeProperties shp = xls.GetObjectProperties(i, false);
        if (shp.ObjectType == TObjectType.ComboBox) //Is it a combobox?
        {
            LogMessage(shp.Text + " :" + xls.GetObjectSelection(i, null).ToString()); //Log the state of the combobox
        }
    }

See also

  • XlsFile


XlsFile.SetObjectSelection Method | FlexCel Studio for the .NET Framework documentation

XlsFile.SetObjectSelection Method

Sets the selected item of an object from the "Forms" palette. It can be a combobox, a listbox, a spinbox or a scrollbar. Note that this only works for objects added through the Forms toolbar. It won't return the values of ActiveX objects.

Remarks

If the object is linked to a cell, this method will change both the object and the cell.

Syntax

Namespace: FlexCel.XlsAdapter

public override void SetObjectSelection(Int32 objectIndex, String objectPath, Int32 selectedItem)

Parameters

<-> Parameter Type Description
objectIndex | Int32 | Index of the object (1 based)
objectPath String Index to the child object you want to change the property.
If it is a simple object, you can use String.Empty here, if not you need to get the ObjectPath from ExcelFile.GetObjectProperties(Int32, Boolean)
If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"
selectedItem | Int32 | Position of the selected item in the object. 0 means no selection, 1 means that the first item is selected.

Examples

To set a combobox selection to be the 5th item, use the code:

    XlsFile xls = new XlsFile("comboboxes.xls");
    for (int i = 1; i <= xls.ObjectCount; i++)
    {
        TShapeProperties shp = xls.GetObjectProperties(i, false);
        if (shp.ObjectType == TObjectType.ComboBox && shp.Text == "MyText")
        {
            xls.SetObjectSelection(i, null, 5);
        }
    }

To change a combo given its name instead of its text, replace shp.Text == "MyText" by shp.Name == "MyName" in the code above.

See also

  • XlsFile


XlsFile.GetObjectSpinProperties Method | FlexCel Studio for the .NET Framework documentation

XlsFile.GetObjectSpinProperties Method

Returns maximum, minimum and increment in any control that has a spin or dropdown, like a listbox, combobox, spinner or scrollbar.

Syntax

Namespace: FlexCel.XlsAdapter

public override TSpinProperties GetObjectSpinProperties(Int32 objectIndex, String objectPath)

Parameters

<-> Parameter Type Description
objectIndex Int32 Index of the object (1 based)
objectPath String Index to the child object you want to change the property.
If it is a simple object, you can use String.Empty here, if not you need to get the ObjectPath from ExcelFile.GetObjectProperties(Int32, Boolean)
If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"

Returns

The spin properties.

See also

  • XlsFile


XlsFile.SetObjectSpinProperties Method | FlexCel Studio for the .NET Framework documentation

XlsFile.SetObjectSpinProperties Method

Sets the spin properties of an object. You should apply this only to scrollbars and spinners.

Syntax

Namespace: FlexCel.XlsAdapter

public override void SetObjectSpinProperties(Int32 objectIndex, String objectPath, TSpinProperties spinProps)

Parameters

<-> Parameter Type Description
objectIndex | Int32 | Index of the object (1 based)
objectPath String Index to the child object you want to change the property.
If it is a simple object, you can use String.Empty here, if not you need to get the ObjectPath from ExcelFile.GetObjectProperties(Int32, Boolean)
If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"
spinProps | TSpinProperties | Properties of the spinner.

See also

  • XlsFile


XlsFile.GetObjectSpinValue Method | FlexCel Studio for the .NET Framework documentation

XlsFile.GetObjectSpinValue Method

Returns the current selected value of a scrollbar.

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 GetObjectSpinValue(Int32 objectIndex, String objectPath)

Parameters

<-> Parameter Type Description
objectIndex Int32 Index of the object (1 based)
objectPath String Index to the child object you want to change the property.
If it is a simple object, you can use String.Empty here, if not you need to get the ObjectPath from ExcelFile.GetObjectProperties(Int32, Boolean)
If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"

Returns

The spin position.

See also

  • XlsFile


XlsFile.SetObjectSpinValue Method | FlexCel Studio for the .NET Framework documentation

XlsFile.SetObjectSpinValue Method

Sets the position in a scrollbar object. If the object is linked to a cell, the cell will be updated.

Syntax

Namespace: FlexCel.XlsAdapter

public override void SetObjectSpinValue(Int32 objectIndex, String objectPath, Int32 value)

Parameters

<-> Parameter Type Description
objectIndex | Int32 | Index of the object (1 based)
objectPath String Index to the child object you want to change the property.
If it is a simple object, you can use String.Empty here, if not you need to get the ObjectPath from ExcelFile.GetObjectProperties(Int32, Boolean)
If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"
value | Int32 | Position for the scrollbar.

See also

  • XlsFile


XlsFile.AddComboBox Method | FlexCel Studio for the .NET Framework documentation

XlsFile.AddComboBox Method

Adds a ComboBox to the active sheet.

Remarks

Excel supports 2 types of comboboxes: ActiveX and internal (In Excel you would add them from the "ActiveX" and "Forms" toolbars respectively) The comboboxes added by this method are of type internal. ActiveX comboboxes are not supported.

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 AddComboBox(TClientAnchor anchor, String name, TCellAddress linkedCell, TCellAddressRange inputRange, Int32 selectedItem)

Parameters

<-> | Parameter | Type | Description
 | anchor | TClientAnchor | Position for the combobox.
 | name | String | Name of the inserted combobox.
 | linkedCell | TCellAddress | Cell that will be linked to the combobox. Set this to null to not link any cell.
 | inputRange | TCellAddressRange | Range of cells with the values that the combobox will display.
 | selectedItem | Int32 | Item that will be selected, starting at 1. 0 means no selected item.

Returns

Object Index of the inserted combobox (1 based).

See also

  • XlsFile


XlsFile.AddListBox Method | FlexCel Studio for the .NET Framework documentation

XlsFile.AddListBox Method

Adds a ListBox to the active sheet.

Remarks

Excel supports 2 types of listboxes: ActiveX and internal (In Excel you would add them from the "ActiveX" and "Forms" toolbars respectively) The listboxes added by this method are of type internal. ActiveX listboxes are not supported.

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 AddListBox(TClientAnchor anchor, String name, TCellAddress linkedCell, TCellAddressRange inputRange, TListBoxSelectionType selectionType, Int32 selectedItem)

Parameters

<-> | Parameter | Type | Description
 | anchor | TClientAnchor | Position for the listbox.
 | name | String | Name of the inserted listbox.
 | linkedCell | TCellAddress | Cell that will be linked to the listbox. Set this to null to not link any cell.
 | inputRange | TCellAddressRange | Range of cells with the values that the listbox will display.
 | selectionType | TListBoxSelection​Type | How items are selected in the listbox.
 | selectedItem | Int32 | Item that will be selected, starting at 1. 0 means no selected item.

Returns

Object Index of the inserted listbox (1 based).

See also

  • XlsFile


XlsFile.AddButton Method | FlexCel Studio for the .NET Framework documentation

XlsFile.AddButton Method

Adds a button to the sheet, with the associated macro.

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 AddButton(TClientAnchor anchor, TRichString text, String name, String macro)

Parameters

<-> | Parameter | Type | Description
 | anchor | TClientAnchor | Position for the button.
 | text | TRichString | Text that will be shown in the button.
 | name | String | Name for the inserted button.
 | macro | String | Macro associated with the button.

See also

  • XlsFile


XlsFile.AddLabel Method | FlexCel Studio for the .NET Framework documentation

XlsFile.AddLabel Method

Adds a Label to the active sheet.

Remarks

Excel supports 2 types of labels: ActiveX and internal (In Excel you would add them from the "ActiveX" and "Forms" toolbars respectively) The labels added by this method are of type internal. ActiveX labels are not supported.

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 AddLabel(TClientAnchor anchor, TRichString text, String name)

Parameters

<-> | Parameter | Type | Description
 | anchor | TClientAnchor | Position for the label.
 | text | TRichString | Text for the label.
 | name | String | Name of the inserted label.

Returns

Object Index of the inserted listbox (1 based).

See also

  • XlsFile


XlsFile.AddSpinner Method | FlexCel Studio for the .NET Framework documentation

XlsFile.AddSpinner Method

Adds a Spinner to the active sheet.

Remarks

Excel supports 2 types of spinners: ActiveX and internal (In Excel you would add them from the "ActiveX" and "Forms" toolbars respectively) The spinners added by this method are of type internal. ActiveX spinners are not supported.

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 AddSpinner(TClientAnchor anchor, String name, TCellAddress linkedCell, TSpinProperties spinProps)

Parameters

<-> | Parameter | Type | Description
 | anchor | TClientAnchor | Position for the spinner.
 | name | String | Name of the inserted spinner.
 | linkedCell | TCellAddress | Cell that will be linked to the spinner. Set this to null to not link any cell.
 | spinProps | TSpinProperties | Properties for the spinner.

Returns

Object Index of the inserted spinner (1 based).

See also

  • XlsFile


XlsFile.AddScrollBar Method | FlexCel Studio for the .NET Framework documentation

XlsFile.AddScrollBar Method

Adds a ScrollBar to the active sheet.

Remarks

Excel supports 2 types of ScrollBars: ActiveX and internal (In Excel you would add them from the "ActiveX" and "Forms" toolbars respectively) The ScrollBars added by this method are of type internal. ActiveX ScrollBars are not supported.

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 AddScrollBar(TClientAnchor anchor, String name, TCellAddress linkedCell, TSpinProperties spinProps)

Parameters

<-> | Parameter | Type | Description
 | anchor | TClientAnchor | Position for the ScrollBar.
 | name | String | Name of the inserted ScrollBar.
 | linkedCell | TCellAddress | Cell that will be linked to the ScrollBar. Set this to null to not link any cell.
 | spinProps | TSpinProperties | Properties for the ScrollBar.

Returns

Object Index of the inserted ScrollBar (1 based).

See also

  • XlsFile


XlsFile.RenderObject Method | FlexCel Studio for the .NET Framework documentation

XlsFile.RenderObject Method

This method renders any object (chart, image, autoshape, etc) into an image, and returns it.

Syntax

Namespace: FlexCel.XlsAdapter

public override TUIImage RenderObject(Int32 objectIndex, Double dpi, TShapeProperties shapeProperties, TUISmoothingMode aSmoothingMode, TUIInterpolationMode aInterpolationMode, Boolean antiAliased, Boolean returnImage, TUIColor BackgroundColor, Double aPrintScale, out TPointF origin, out TUIRectangle imageDimensions, out TUISize imageSizePixels)

Parameters

<-> | Parameter | Type | Description
 | objectIndex | Int32 | Index of the object (1 based). Note: This object index is not used to get the object to render, which is given by the shapeProperties parameter. The object index is only used to determine the z-order of the object. If shapeProperties refers to a grouped object, pass the object index of the main group here.
 | dpi | Double | Resolution of the image to create in dots per inch. If creating the image for the screen, use 96 dpi.
 | shapeProperties | TShapeProperties | Properties of the shape you are about to render. You can get them by calling ExcelFile.GetObjectProperties(Int32, Boolean).
 | aSmoothingMode | TUISmoothingMode | Smoothing mode used to render the object. For more information, see "System.Drawing.Drawing2D.SmoothingMode"
 | aInterpolationMode | TUIInterpolationMode | Interpolation mode used to render the object. For more information, see "System.Drawing.Drawing2D.InterpolationMode"
 | antiAliased | Boolean | If true text will be antialiased when rendering for example a chart.
 | returnImage | Boolean | If false, this method will return null. Use it if you need to know the image dimensions, but do not care about the real image since it is faster and uses less resources.
 | BackgroundColor | TUIColor | Color for the background of the image. For a transparent background, use TUIColor.Empty.
 | aPrintScale | Double |
out | origin | TPointF | Top-left coordinates of the image in points. While this is normally the same as the image coordinates you get in the properties, if there is a shadow to the right or to the top it might change. Use it to properly position the image where you want it.
out | imageDimensions | TUIRectangle | Returns the image dimension of the rendered object in points. Note that this can be different from the image size reported by ExcelFile.GetImageProperties(Int32) because shadows or rotation of the image. You can get the image size in pixels just by looking at the image returned.
out | imageSizePixels | TUISize | Size of the returned image in pixels. You only need to use this if returnImage is false, since the returned bitmap will be null. Otherwise, you can just read the bitmap size.

Returns

Might return null if the image is not visible.

See also

  • XlsFile


XlsFile.RenderCells Method | FlexCel Studio for the .NET Framework documentation

XlsFile.RenderCells Method

This method renders a range of cells into an image, and returns it.

No objects will be drawn on the cells, you can use ExcelFile.RenderObject(Int32) to draw those.

Important note: By default this method will only render the text inside the cell, not the borders or cell fills or anything else. If you want to export an xls file to images, you need to set the parameter "exportObjects" to true, or use FlexCelImgExport

Syntax

Namespace: FlexCel.XlsAdapter

public override TUIImage RenderCells(Int32 row1, Int32 col1, Int32 row2, Int32 col2, Boolean drawBackground, Double dpi, TUISmoothingMode aSmoothingMode, TUIInterpolationMode aInterpolationMode, Boolean antiAliased, Double aPrintScale, Boolean forceBackgroundTransparent, Boolean exportObjects)

Parameters

<-> | Parameter | Type | Description
 | row1 | Int32 | Index of the first row to render. (1 based).
 | col1 | Int32 | Index of the first column to render (1 based).
 | row2 | Int32 | Index of the last row to render. (1 based).
 | col2 | Int32 | Index of the last column to render (1 based).
 | drawBackground | Boolean | If true, the image will have a solid background with the color of the cells. If false, the image will have a transparent background.
 | dpi | Double | Resolution of the image to create in dots per inch. If creating the image for the screen, use 96 dpi.
 | aSmoothingMode | TUISmoothingMode | Smoothing mode used to render the object. For more information, see "System.Drawing.Drawing2D.SmoothingMode"
 | aInterpolationMode | TUIInterpolationMode | Interpolation mode used to render the object. For more information, see "System.Drawing.Drawing2D.InterpolationMode"
 | antiAliased | Boolean | If true text will be antialiased when rendering.
 | aPrintScale | Double |
 | forceBackgroundTransparent | Boolean | If true the background of the image will be transparent for the cells that don't have fill, even if drawBackground is true.
 | exportObjects | Boolean | If false, only the cells themselves will be rendered, with no borders, images, etc. If true, objects will be rendered too.

Returns

An image with the rendered cells.

See also

  • XlsFile


XlsFile.CellRangeDimensions Method | FlexCel Studio for the .NET Framework documentation

XlsFile.CellRangeDimensions Method

Returns the height and width that would be used by a range of cells (in Points, or 1/72 inches).

Syntax

Namespace: FlexCel.XlsAdapter

public override TUIRectangle CellRangeDimensions(Int32 row1, Int32 col1, Int32 row2, Int32 col2, Boolean includeMargins)

Parameters

<-> | Parameter | Type | Description
 | row1 | Int32 | First row (1 based). If you use a value less or equal than 0 here, this method will return the full sheet dimensions.
 | col1 | Int32 | First column (1 based). If you use a value less or equal than 0 here, this method will return the full sheet dimensions.
 | row2 | Int32 | Last row (1 based). If you use a value less or equal than 0 here, this method will return the full sheet dimensions.
 | col2 | Int32 | Last column (1 based). If you use a value less or equal than 0 here, this method will return the full sheet dimensions.
 | includeMargins | Boolean | If true, the dimensions reported will include all margins in the sheet.

See also

  • XlsFile


XlsFile.RenderObjectAsSVG Method | FlexCel Studio for the .NET Framework documentation

XlsFile.RenderObjectAsSVG Method

Overloads

  • XlsFile.RenderObjectAsSVG(Int32, Double, TShapeProperties, TUIColor, TSVGExportType, String, String, String, IEnumerable<TSVGAttribute>, Encoding, Boolean, TPointF, TUIRectangle)
  • XlsFile.RenderObjectAsSVG(Stream, Int32, Double, TShapeProperties, TUIColor, TSVGExportType, String, String, String, IEnumerable<TSVGAttribute>, Encoding, Boolean, TPointF, TUIRectangle)

XlsFile.RenderObjectAsSVG(Int32, Double, TShapeProperties, TUIColor, TSVGExportType, String, String, String, IEnumerable<TSVGAttribute>, Encoding, Boolean, TPointF, TUIRectangle)

This method renders any object (chart, image, autoshape, etc) into an SVG image, and returns the XML for the image.

Syntax

Namespace: FlexCel.XlsAdapter

public override String RenderObjectAsSVG(Int32 objectIndex, Double aPageScale, TShapeProperties shapeProperties, TUIColor BackgroundColor, TSVGExportType exportType, String idPrefix, String title, String description, IEnumerable<TSVGAttribute> extraSVGAttributes, Encoding encoding, Boolean rasterizeSVGImages, out TPointF origin, out TUIRectangle imageDimensions)

Parameters

<-> | Parameter | Type | Description
 | objectIndex | Int32 | Index of the object (1 based). Note: This object index is not used to get the object to render, which is given by the shapeProperties parameter. The object index is only used to determine the z-order of the object. If shapeProperties refers to a grouped object, pass the object index of the main group here.
 | aPageScale | Double | Page scale. Use 1 for 100%
 | shapeProperties | TShapeProperties | Properties of the shape you are about to render. You can get them by calling ExcelFile.GetObjectProperties(Int32, Boolean).
 | BackgroundColor | TUIColor | Color for the background of the image. For a transparent background, use TUIColor.Empty.
 | exportType | TSVGExportType | How much of the SVG will be exported.
 | idPrefix | String | Prefix to be used in all definitions inside the svg file. For normal SVG files you can leave this null, but if you are embedding the files inside an html file, you need to ensure every image has unique identifiers. All SVG identifiers from different images inside an html file must be unique.
 | title | String | Title for the image. It will be saved inside the SVG file.
 | description | String | Description for the image. It will be saved inside the SVG file.
 | extraSVGAttributes | IEnumerable<TSVGAttribute> | Extra attributes to be added to the svg tag.
 | encoding | Encoding | Encoding that will be declared for the xml file if exportType is All. Note that the result string will always be UTF16 encoded, but if you want to save it to an UTF8 file, you will have to set encoding = utf8. Also note that this parameter is only used if the exportType parameter is All. It only affects the xml declaration. If null, utf-8 will be used.
 | rasterizeSVGImages | Boolean | If true, FlexCel will rasterize all SVG images in the Excel file to png before exporting them. See S V G Files Inside Xlsx Files for more information.
out | origin | TPointF | Top-left coordinates of the image in points. While this is normally the same as the image coordinates you get in the properties, if there is a shadow to the right or to the top it might change. Use it to properly position the image where you want it.
out | imageDimensions | TUIRectangle | Returns the image dimension of the rendered object in points. Note that this can be different from the image size reported by ExcelFile.GetImageProperties(Int32) because shadows or rotation of the image.

Returns

Might return null if the image is not visible.

See also

  • XlsFile

XlsFile.RenderObjectAsSVG(Stream, Int32, Double, TShapeProperties, TUIColor, TSVGExportType, String, String, String, IEnumerable<TSVGAttribute>, Encoding, Boolean, TPointF, TUIRectangle)

This method saves any object (chart, image, autoshape, etc) into an SVG image inside a stream.

Syntax

Namespace: FlexCel.XlsAdapter

public override void RenderObjectAsSVG(Stream resultStream, Int32 objectIndex, Double aPageScale, TShapeProperties shapeProperties, TUIColor BackgroundColor, TSVGExportType exportType, String idPrefix, String title, String description, IEnumerable<TSVGAttribute> extraSVGAttributes, Encoding encoding, Boolean rasterizeSVGImages, out TPointF origin, out TUIRectangle imageDimensions)

Parameters

<-> | Parameter | Type | Description
 | resultStream | Stream | Stream where the data will be saved.
 | objectIndex | Int32 | Index of the object (1 based). Note: This object index is not used to get the object to render, which is given by the shapeProperties parameter. The object index is only used to determine the z-order of the object. If shapeProperties refers to a grouped object, pass the object index of the main group here.
 | aPageScale | Double | Page scale. Use 1 for 100%
 | shapeProperties | TShapeProperties | Properties of the shape you are about to render. You can get them by calling ExcelFile.GetObjectProperties(Int32, Boolean).
 | BackgroundColor | TUIColor | Color for the background of the image. For a transparent background, use TUIColor.Empty.
 | exportType | TSVGExportType | How much of the SVG will be exported.
 | idPrefix | String | Prefix to be used in all definitions inside the svg file. For normal SVG files you can leave this null, but if you are embedding the files inside an html file, you need to ensure every image has unique identifiers. All SVG identifiers from different images inside an html file must be unique.
 | title | String | Title for the image. It will be saved inside the SVG file.
 | description | String | Description for the image. It will be saved inside the SVG file.
 | extraSVGAttributes | IEnumerable<TSVGAttribute> | Extra attributes to be added to the svg tag.
 | encoding | Encoding | Encoding that will be used for the xml. If null, utf-8 will be used.
 | rasterizeSVGImages | Boolean | If true, FlexCel will rasterize all SVG images in the Excel file to png before exporting them. See S V G Files Inside Xlsx Files for more information.
out | origin | TPointF | Top-left coordinates of the image in points. While this is normally the same as the image coordinates you get in the properties, if there is a shadow to the right or to the top it might change. Use it to properly position the image where you want it.
out | imageDimensions | TUIRectangle | Returns the image dimension of the rendered object in points. Note that this can be different from the image size reported by ExcelFile.GetImageProperties(Int32) because shadows or rotation of the image.

See also

  • XlsFile


XlsFile.SendToBack Method | FlexCel Studio for the .NET Framework documentation

XlsFile.SendToBack Method

Sends the graphical object to the bottom layer on the display (z-order) position. It will show below and will be covered by all other objects on the sheet.

Remarks

This will change the order of the array, so after calling SendToBack(i), position i will have a new object.

Syntax

Namespace: FlexCel.XlsAdapter

public override void SendToBack(Int32 objectIndex)

Parameters

<-> | Parameter | Type | Description
 | objectIndex | Int32 | Index of the object to move. (1 based)

See also

  • XlsFile
  • ExcelFile.SendBack
  • ExcelFile.SendForward
  • ExcelFile.BringToFront


XlsFile.BringToFront Method | FlexCel Studio for the .NET Framework documentation

XlsFile.BringToFront Method

Sends the graphical object to the top layer on the display (z-order) position. It will show above and will cover all other objects on the sheet.

Remarks

This will change the order of the array, so after calling BringToFront(i), position i will have a new object.

Syntax

Namespace: FlexCel.XlsAdapter

public override void BringToFront(Int32 objectIndex)

Parameters

<-> | Parameter | Type | Description
 | objectIndex | Int32 | Index of the object to move. (1 based)

See also

  • XlsFile
  • ExcelFile.SendToBack
  • ExcelFile.SendForward
  • ExcelFile.SendBack


XlsFile.SendForward Method | FlexCel Studio for the .NET Framework documentation

XlsFile.SendForward Method

Sends the graphical object one layer up on the display (z-order) position. It will show above and will cover the image at objectIndex+1.

Remarks

This will change the order of the array, so after calling SendForward(i), position i will have a new object. To move an object 2 steps down the correct code is:

    xls.SendForward(i);
    xls.SendForward(i + 1);

and not

    xls.SendForward(i);
    xls.SendForward(i);

The second code would actually leave the array unmodified.

Syntax

Namespace: FlexCel.XlsAdapter

public override void SendForward(Int32 objectIndex)

Parameters

<-> | Parameter | Type | Description
 | objectIndex | Int32 | Index of the object to move. (1 based)

See also

  • XlsFile
  • ExcelFile.SendToBack
  • ExcelFile.SendBack
  • ExcelFile.BringToFront


XlsFile.SendBack Method | FlexCel Studio for the .NET Framework documentation

XlsFile.SendBack Method

Sends the graphical object one layer down. It will show below and will be covered by image at objectIndex-1.

Remarks

This will change the order of the array, so after calling SendToBack(i), position i will have a new object. To move an object 2 steps down the correct code is:

    xls.SendBack(i);
    xls.SendBack(i - 1);

and not

    xls.SendBack(i);
    xls.SendBack(i);

The second code would actually leave the array unmodified.

Syntax

Namespace: FlexCel.XlsAdapter

public override void SendBack(Int32 objectIndex)

Parameters

<-> | Parameter | Type | Description
 | objectIndex | Int32 | Index of the object to move. (1 based)

See also

  • XlsFile
  • ExcelFile.SendToBack
  • ExcelFile.SendForward
  • ExcelFile.BringToFront


XlsFile.CommentRowCount Method | FlexCel Studio for the .NET Framework documentation

XlsFile.CommentRowCount Method

Maximum row index including comments.

Remarks

There are 2 groups of Comment related methods. One is used when you want to find out on a loop all existing comments on a range, and the other is used to get/set comments at a specified position (row and col). To loop among all existing comments, you can use CommentRowCount together with ExcelFile.CommentCountRow. Do not confuse them, even when they have similar names. CommentRowCount returns the maximum row with a comment, and ExcelFile.CommentCountRow returns the number of comments in a given row.

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 CommentRowCount()

Examples

You can loop on all the comments on a sheet with the following code:

    for (int row = 1; row <= xls.CommentRowCount(); row++)
    {
        for (int commentIndex = 1; commentIndex <= xls.CommentCountRow(row); commentIndex++)
        {
            DoSomething(xls.GetCommentRow(row, commentIndex));
        }
    }

See also

  • XlsFile
  • ExcelFile.CommentCountRow
  • ExcelFile.GetCommentRow
  • ExcelFile.GetCommentRowCol
  • ExcelFile.GetComment
  • ExcelFile.SetCommentRow(Int32, Int32, String, TImageProperties)
  • ExcelFile.SetComment(Int32, Int32, TRichString)
  • ExcelFile.GetCommentPropertiesRow
  • ExcelFile.SetCommentPropertiesRow
  • ExcelFile.SetCommentProperties


XlsFile.CommentCountRow Method | FlexCel Studio for the .NET Framework documentation

XlsFile.CommentCountRow Method

Number of comments on a given row.

Remarks

There are 2 groups of Comment related methods. One is used when you want to find out on a loop all existing comments on a range, and the other is used to get/set comments at a specified position (row and col). To loop among all existing comments, you can use ExcelFile.CommentRowCount together with CommentCountRow. Do not confuse them, even when they have similar names. ExcelFile.CommentRowCount returns the maximum row with a comment, and CommentCountRow returns the number of comments in a given row.

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 CommentCountRow(Int32 row)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row index (1 based)

Returns

The number of comments on a given row.

Examples

You can loop on all the comments on a sheet with the following code:

    for (int row = 1; row <= xls.CommentRowCount(); row++)
    {
        for (int commentIndex = 1; commentIndex <= xls.CommentCountRow(row); commentIndex++)
        {
            DoSomething(xls.GetCommentRow(row, commentIndex));
        }
    }

See also

  • XlsFile
  • ExcelFile.CommentRowCount
  • ExcelFile.GetCommentRow
  • ExcelFile.GetCommentRowCol
  • ExcelFile.GetComment
  • ExcelFile.SetCommentRow(Int32, Int32, String, TImageProperties)
  • ExcelFile.SetComment(Int32, Int32, TRichString)
  • ExcelFile.GetCommentPropertiesRow
  • ExcelFile.SetCommentPropertiesRow
  • ExcelFile.SetCommentProperties


XlsFile.GetCommentRow Method | FlexCel Studio for the .NET Framework documentation

XlsFile.GetCommentRow Method

Returns the comment at position commentIndex on the specified row.

Remarks

This method is used together with ExcelFile.CommentCountRow. See the reference on it for an example.

Syntax

Namespace: FlexCel.XlsAdapter

public override TRichString GetCommentRow(Int32 row, Int32 commentIndex)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row index (1 based)
 | commentIndex | Int32 | Comment index (1 based). See ExcelFile.CommentCountRow

Returns

Comment at the specified position.

See also

  • XlsFile
  • ExcelFile.CommentRowCount
  • ExcelFile.CommentCountRow
  • ExcelFile.GetCommentRowCol
  • ExcelFile.GetComment
  • ExcelFile.SetCommentRow(Int32, Int32, String, TImageProperties)
  • ExcelFile.SetComment(Int32, Int32, TRichString)
  • ExcelFile.GetCommentPropertiesRow
  • ExcelFile.SetCommentPropertiesRow
  • ExcelFile.SetCommentProperties


XlsFile.GetCommentRowCol Method | FlexCel Studio for the .NET Framework documentation

XlsFile.GetCommentRowCol Method

Returns the column for comment at position commentIndex

Remarks

This method is used together with ExcelFile.CommentCountRow. See the reference on it for an example.

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 GetCommentRowCol(Int32 row, Int32 commentIndex)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row with the comment. (1 based)
 | commentIndex | Int32 | Index of the comment (1 based)

Returns

The column index corresponding to the comment.

See also

  • XlsFile
  • ExcelFile.CommentRowCount
  • ExcelFile.CommentCountRow
  • ExcelFile.GetCommentRow
  • ExcelFile.GetComment
  • ExcelFile.SetCommentRow(Int32, Int32, String, TImageProperties)
  • ExcelFile.SetComment(Int32, Int32, TRichString)
  • ExcelFile.GetCommentPropertiesRow
  • ExcelFile.SetCommentPropertiesRow
  • ExcelFile.SetCommentProperties


XlsFile.GetComment Method | FlexCel Studio for the .NET Framework documentation

XlsFile.GetComment Method

Returns the comment at the specified row and column, or an empty string if there is no comment on that cell.

Remarks

Use this method when you are searching for a comment on a fixed position. To loop along all comments on a sheet, see ExcelFile.CommentRowCount

Syntax

Namespace: FlexCel.XlsAdapter

public override TRichString GetComment(Int32 row, Int32 col)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row index (1 based)
 | col | Int32 | Column index (1 based)

Returns

The comment on the specified cell, String.Empty if there is no comment on it.

See also

  • XlsFile
  • ExcelFile.CommentRowCount
  • ExcelFile.CommentCountRow
  • ExcelFile.GetCommentRow
  • ExcelFile.GetCommentRowCol
  • ExcelFile.SetCommentRow(Int32, Int32, String, TImageProperties)
  • ExcelFile.SetComment(Int32, Int32, TRichString)
  • ExcelFile.GetCommentPropertiesRow
  • ExcelFile.SetCommentPropertiesRow
  • ExcelFile.SetCommentProperties


XlsFile.SetCommentRow Method | FlexCel Studio for the .NET Framework documentation

XlsFile.SetCommentRow Method

Changes the properties (text and position of the popup) for an existing comment at commentIndex. To delete a comment, set a "new TRichString()" as the "value" param. To add a new comment, use ExcelFile.SetComment(Int32, Int32, TRichString).

Remarks

This method is used together with ExcelFile.CommentCountRow. See the reference on it for an example.

Syntax

Namespace: FlexCel.XlsAdapter

public override void SetCommentRow(Int32 row, Int32 commentIndex, TRichString value, TImageProperties commentProperties)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row Index (1 based)
 | commentIndex | Int32 | Comment index (1 based)
 | value | TRichString | Text of the comment. Set it to "new TRichString()" to remove the comment.
 | commentProperties | TImageProperties | Properties of the popup.

See also

  • XlsFile
  • ExcelFile.CommentRowCount
  • ExcelFile.CommentCountRow
  • ExcelFile.GetCommentRow
  • ExcelFile.GetCommentRowCol
  • ExcelFile.GetComment
  • ExcelFile.SetComment(Int32, Int32, TRichString)
  • ExcelFile.GetCommentPropertiesRow
  • ExcelFile.SetCommentPropertiesRow
  • ExcelFile.SetCommentProperties


XlsFile.SetComment Method | FlexCel Studio for the .NET Framework documentation

XlsFile.SetComment Method

Sets or deletes a comment at the specified cell.

Remarks

To delete a comment, set its value to String.Empty.

Syntax

Namespace: FlexCel.XlsAdapter

public override void SetComment(Int32 row, Int32 col, TRichString value, String author, TImageProperties commentProperties)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row index (1 based)
 | col | Int32 | Column index (1 based)
 | value | TRichString | Text of the comment. Set it to String.Empty to delete the comment.
 | author | String | Author of the comment.
 | commentProperties | TImageProperties | Properties of the popup.

See also

  • XlsFile
  • ExcelFile.CommentRowCount
  • ExcelFile.CommentCountRow
  • ExcelFile.GetCommentRow
  • ExcelFile.GetCommentRowCol
  • ExcelFile.GetComment
  • ExcelFile.SetCommentRow(Int32, Int32, String, TImageProperties)
  • ExcelFile.GetCommentPropertiesRow
  • ExcelFile.SetCommentPropertiesRow
  • ExcelFile.SetCommentProperties


XlsFile.GetCommentPropertiesRow Method | FlexCel Studio for the .NET Framework documentation

XlsFile.GetCommentPropertiesRow Method

Returns the comment properties for the popup at position commentIndex

Remarks

This method is used together with ExcelFile.CommentCountRow. See the reference on it for an example.

Syntax

Namespace: FlexCel.XlsAdapter

public override TCommentProperties GetCommentPropertiesRow(Int32 row, Int32 commentIndex)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row index (1 based)
 | commentIndex | Int32 | Comment index (1 based)

Returns

The comment properties.

See also

  • XlsFile
  • ExcelFile.CommentRowCount
  • ExcelFile.CommentCountRow
  • ExcelFile.GetCommentRow
  • ExcelFile.GetCommentRowCol
  • ExcelFile.GetComment
  • ExcelFile.SetCommentRow(Int32, Int32, String, TImageProperties)
  • ExcelFile.SetComment(Int32, Int32, TRichString)
  • ExcelFile.GetCommentPropertiesRow
  • ExcelFile.SetCommentPropertiesRow
  • ExcelFile.SetCommentProperties


XlsFile.GetCommentProperties Method | FlexCel Studio for the .NET Framework documentation

XlsFile.GetCommentProperties Method

Gets the popup placement for an existing comment. If there is not a comment on cell (row,col), this will return null.

Remarks

Note that you can change the size but not the placement of the popup. This placement you set here is the one you see when you right click the cell and choose "Show comment". The yellow popup box is placed automatically by excel.

Syntax

Namespace: FlexCel.XlsAdapter

public override TCommentProperties GetCommentProperties(Int32 row, Int32 col)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row index (1 based).
 | col | Int32 | Column index (1 based)

Returns

Placement of the comment popup.

See also

  • XlsFile
  • ExcelFile.CommentRowCount
  • ExcelFile.CommentCountRow
  • ExcelFile.GetCommentRow
  • ExcelFile.GetCommentRowCol
  • ExcelFile.GetComment
  • ExcelFile.SetCommentRow(Int32, Int32, String, TImageProperties)
  • ExcelFile.SetComment(Int32, Int32, TRichString)
  • ExcelFile.GetCommentPropertiesRow
  • ExcelFile.SetCommentPropertiesRow
  • ExcelFile.SetCommentProperties


XlsFile.SetCommentPropertiesRow Method | FlexCel Studio for the .NET Framework documentation

XlsFile.SetCommentPropertiesRow Method

Sets the comment properties at the specified index.

Remarks

This method is used together with ExcelFile.CommentCountRow. See the reference on it for an example.

Syntax

Namespace: FlexCel.XlsAdapter

public override void SetCommentPropertiesRow(Int32 row, Int32 commentIndex, TImageProperties commentProperties)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row index (1 based)
 | commentIndex | Int32 | Comment index (1 based)
 | commentProperties | TImageProperties | Comment properties. This parameter can be a TImageProperties, or the more complete derived class TCommentProperties, if you need to set extra information like the text alignment.

See also

  • XlsFile
  • ExcelFile.CommentRowCount
  • ExcelFile.CommentCountRow
  • ExcelFile.GetCommentRow
  • ExcelFile.GetCommentRowCol
  • ExcelFile.GetComment
  • ExcelFile.SetCommentRow(Int32, Int32, String, TImageProperties)
  • ExcelFile.SetComment(Int32, Int32, TRichString)
  • ExcelFile.GetCommentPropertiesRow
  • ExcelFile.GetCommentProperties
  • ExcelFile.SetCommentProperties


XlsFile.SetCommentProperties Method | FlexCel Studio for the .NET Framework documentation

XlsFile.SetCommentProperties Method

Sets the popup placement for an existing comment. If there is not a comment on cell (row,col), this will create an empty one.

Remarks

Note that you can change the size but not the placement of the popup. This placement you set here is the one you see when you right click the cell and choose "Show comment". The yellow popup box is placed automatically by excel.

Syntax

Namespace: FlexCel.XlsAdapter

public override void SetCommentProperties(Int32 row, Int32 col, TImageProperties commentProperties)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row index (1 based)
 | col | Int32 | Column index (1 based)
 | commentProperties | TImageProperties | Placement and properties of the comment popup. Null if there is no comment on the cell. This parameter can be a TImageProperties, or the more complete derived class TCommentProperties, if you need to set extra information like the text alignment.

See also

  • XlsFile
  • ExcelFile.CommentRowCount
  • ExcelFile.CommentCountRow
  • ExcelFile.GetCommentRow
  • ExcelFile.GetCommentRowCol
  • ExcelFile.GetComment
  • ExcelFile.SetCommentRow(Int32, Int32, String, TImageProperties)
  • ExcelFile.SetComment(Int32, Int32, TRichString)
  • ExcelFile.GetCommentPropertiesRow
  • ExcelFile.GetCommentProperties
  • ExcelFile.SetCommentPropertiesRow


XlsFile.LightClone Method | FlexCel Studio for the .NET Framework documentation

XlsFile.LightClone Method

Returns a copy of this ExcelFile object with the same backing data, so the cells in both objects are the same. Using a light clone allows you to read from a single ExcelFile in two different threads, since while the data is the same (so you don't use twice the memory as a real clone would), you can have separate activesheets in both. So one thread can be reading from the "original" file with ActiveSheet = 1, and the other thread could be reading from the light clone with activeSheet = 3.

Remarks

There is a difference between a light clone and the original object. When you set the ExcelFile.ActiveSheet in the clone, it won't actually set the selected sheet in the physical file as setting it in the original will do. This is because the light clone is targeted at reading, and you don't want to change the actual file you are reading. While FlexCel is safe for more than one thread reading from the same object, it isn't for more than one thread writing to the same object. When modifying an XlsFile, you shouldn't use light clones, use them only for reading.

You can see if an object is a light clone or not by looking at the ExcelFile.IsLightClone property.

Syntax

Namespace: FlexCel.XlsAdapter

public override ExcelFile LightClone()

See also

  • XlsFile


XlsFile.InsertAndCopyRange Method | FlexCel Studio for the .NET Framework documentation

XlsFile.InsertAndCopyRange Method

Inserts and/or copies a range of cells from one place to another.

This method is one of the most important on FlexCel API, and it allows you to copy ranges of cells from one place to another, adapting the formulas, images and everything as Excel would do it.

Remarks

This overload is useful for copying from another file. It is not as fast or complete as the other overloaded versions because it has to do a lot of transforms on the data. But it is very useful anyway.

Syntax

Namespace: FlexCel.XlsAdapter

public override void InsertAndCopyRange(TXlsCellRange sourceRange, Int32 destRow, Int32 destCol, Int32 destCount, TFlxInsertMode insertMode, TRangeCopyMode copyMode, ExcelFile sourceWorkbook, Int32 sourceSheet, TExcelObjectList ObjectsInRange)

Parameters

<-> | Parameter | Type | Description
 | sourceRange | TXlsCellRange | The range of cells you want to copy. If you specify full rows, they will be copied with Row format information and size. If you copy just a part of a row, Row format will not be copied. The same applies to columns. The only way to copy all row and columns, is to specify the full (A:IV) range.
 | destRow | Int32 | Destination row where the cells will be copied.
 | destCol | Int32 | Destination column where the cells will be copied.
 | destCount | Int32 | Number of times the sourceRange will be copied at (desRow, destCol). If you make for example destCount=2, sourceRange will be copied 2 times at (destRow, destCol)
 | insertMode | TFlxInsertMode | How the cells on destination will be inserted. They can shift down or left. Specifying Row or Col as mode is equivalent to specify a sourceRange including full rows or columns respectively.
 | copyMode | TRangeCopyMode | Which cells on sourceRange will be copied. If you intend to replace values on the copied cells, you might specify OnlyFormulas. If you just want to insert cells and not copy, specify None.
 | sourceWorkbook | ExcelFile | Workbook from where we are copying the cells. This might be the same workbook, and you would by copying from another sheet.
 | sourceSheet | Int32 | Sheet index on the source workbook. If sourceWorkbook is the same instance as this, and sourceSheet is the active sheet on the instance, this method is equivalent to the simpler overloaded version.
 | ObjectsInRange | TExcelObjectList | Returns the objects that are in the range to be copied. This is an optimization so you don't have to find those objects again. Set it to null to not return any objects

See also

  • XlsFile


XlsFile.DeleteRange Method | FlexCel Studio for the .NET Framework documentation

XlsFile.DeleteRange Method

Overloads

  • XlsFile.DeleteRange(TXlsCellRange, TFlxInsertMode)
  • XlsFile.DeleteRange(Int32, Int32, TXlsCellRange, TFlxInsertMode, Boolean)

XlsFile.DeleteRange(TXlsCellRange, TFlxInsertMode)

Deletes a range of cells, and moves all cells below up or all cells to the right left, depending on the insert mode.

Syntax

Namespace: FlexCel.XlsAdapter

public override void DeleteRange(TXlsCellRange cellRange, TFlxInsertMode insertMode)

Parameters

<-> | Parameter | Type | Description
 | cellRange | TXlsCellRange | Range of cells to delete.
 | insertMode | TFlxInsertMode | Mode of deletion. Note that Row and Col are equivalent to ShiftRight and ShiftDown with a cell range of full rows or cols respectively.

See also

  • XlsFile

XlsFile.DeleteRange(Int32, Int32, TXlsCellRange, TFlxInsertMode, Boolean)

Deletes a range of cells, and moves all cells below up or all cells to the right left, depending on the insert mode.

Syntax

Namespace: FlexCel.XlsAdapter

public override void DeleteRange(Int32 sheet1, Int32 sheet2, TXlsCellRange cellRange, TFlxInsertMode insertMode, Boolean removeFormats)

Parameters

<-> | Parameter | Type | Description
 | sheet1 | Int32 | First sheet where to delete cells.
 | sheet2 | Int32 | Last sheet where to delete cells.
 | cellRange | TXlsCellRange | Range of cells to delete.
 | insertMode | TFlxInsertMode | Mode of deletion. Note that Row and Col are equivalent to ShiftRight and ShiftDown with a cell range of full rows or cols respectively.
 | removeFormats | Boolean | If true, both formatting and data will be removed from the range, when clearing a range. This parameter has no effect if insertmode isn't one of the "none" options, because if it isn't the full range will move up or left.

See also

  • XlsFile


XlsFile.MoveRange Method | FlexCel Studio for the .NET Framework documentation

XlsFile.MoveRange Method

Moves a range of cells, the same way Excel does it. All references pointing to the old range will be relocated to the new, and all existing references to the new range will be relocated to #ref.

Syntax

Namespace: FlexCel.XlsAdapter

public override void MoveRange(TXlsCellRange cellRange, Int32 newRow, Int32 newCol, TFlxInsertMode insertMode, Boolean fixAllFormulas)

Parameters

<-> | Parameter | Type | Description
 | cellRange | TXlsCellRange | Range you want to move.
 | newRow | Int32 | Row where the range will be relocated.
 | newCol | Int32 | Column where the range will be relocated.
 | insertMode | TFlxInsertMode | This parameter switches between 2 different working modes: * Modes NoneDown and NoneRight are the same, and work the same way as when you drag a range of cells in Excel to a new location. Cells on the new range will be replaced by the old, and cells where the old range was located will be cleared(not deleted). No cells are inserted or deleted. * The other modes behave like when you select a range in Excel, cut it, and then right click and select "Insert Cut Cells...". The old range will be inserted where the new range goes, cells where the old range was will be deleted(not cleared). Using for example MoveRange(CellRange, newRow, newCol, TFlxInsertMode.ShiftRight) is equivalent to: 1) InsertAndCopyRange(CellRange, newRow, newCol, 1, TFlxInsertMode.ShiftRight, TRangeCopyMode.None); 2) MoveRange(CellRange, newRow, newCol, TFlxInsertMode.NoneRight); 3) DeleteRange(CellRange, TFlxInsertMode.ShiftRight);
 | fixAllFormulas | Boolean | If true (the default) FlexCel will correctly adapt all the references in all formulas everywhere. If false only the formulas being moved will be changed. The results with this parameter = false are incorrect if you have formulas pointing to the range moved, but is faster if you know no formulas point to cells inside the range moved. You should normally keep this parameter = true. FlexCel uses it false to emulate the way Excel sorts (which is wrong).

See also

  • XlsFile


XlsFile.ClearDataValidation Method | FlexCel Studio for the .NET Framework documentation

XlsFile.ClearDataValidation Method

Overloads

  • XlsFile.ClearDataValidation
  • XlsFile.ClearDataValidation(TXlsCellRange)

XlsFile.ClearDataValidation

Clears all data validation entries in the active sheet.

Syntax

Namespace: FlexCel.XlsAdapter

public override void ClearDataValidation()

See also

  • XlsFile

XlsFile.ClearDataValidation(TXlsCellRange)

Clears all data validation entries inside the specified range.

Syntax

Namespace: FlexCel.XlsAdapter

public override void ClearDataValidation(TXlsCellRange range)

Parameters

<-> | Parameter | Type | Description
 | range | TXlsCellRange | Range of cells where data validation will be cleared.

See also

  • XlsFile


XlsFile.AddDataValidation Method | FlexCel Studio for the .NET Framework documentation

XlsFile.AddDataValidation Method

Adds a new Data Validation to a specified range.

Syntax

Namespace: FlexCel.XlsAdapter

public override void AddDataValidation(TXlsCellRange range, TDataValidationInfo validationInfo)

Parameters

<-> | Parameter | Type | Description
 | range | TXlsCellRange | Range of cells where we will apply the Data Validation.
 | validationInfo | TDataValidationInfo | Validation information.

See also

  • XlsFile


XlsFile.GetDataValidation Method | FlexCel Studio for the .NET Framework documentation

XlsFile.GetDataValidation Method

Returns the validation information for a specific cell. If the cell has no Data Validation associated, this method returns null.

Syntax

Namespace: FlexCel.XlsAdapter

public override TDataValidationInfo GetDataValidation(Int32 row, Int32 col, out TXlsCellRange dvRange)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row of the cell (1 based)
 | col | Int32 | Column of the cell (1 based)
out | dvRange | TXlsCellRange | Range of cells where the data validation is applied.

Returns

The data validation for a cell, or null if the cell has no Data Validation associated.

See also

  • XlsFile


XlsFile.GetDataValidationInfo Method | FlexCel Studio for the .NET Framework documentation

XlsFile.GetDataValidationInfo Method

Returns the data validation information for an entry of the index. There are 2 ways you can access the data validation information on a sheet:

  1. If you know the row and column where you want to look, you can use ExcelFile.GetDataValidation(Int32, Int32) to return the data validation in the cell.
  2. If you want to find out all data validation structures in the sheet, you can use ExcelFile.DataValidationCount, ExcelFile.GetDataValidationInfo and ExcelFile.GetDataValidationRanges to loop over all existing data validations.

Syntax

Namespace: FlexCel.XlsAdapter

public override TDataValidationInfo GetDataValidationInfo(Int32 index)

Parameters

<-> | Parameter | Type | Description
 | index | Int32 | Position in the list of data validations. (1 based)

Returns

Data validation information.

See also

  • XlsFile


XlsFile.GetDataValidationRanges Method | FlexCel Studio for the .NET Framework documentation

XlsFile.GetDataValidationRanges Method

Returns a list of ranges for which a data validation definition applies. There are 2 ways you can access the data validation information on a sheet:

  1. If you know the row and column where you want to look, you can use ExcelFile.GetDataValidation(Int32, Int32) to return the data validation in the cell.
  2. If you want to find out all data validation structures in the sheet, you can use ExcelFile.DataValidationCount, ExcelFile.GetDataValidationInfo and ExcelFile.GetDataValidationRanges to loop over all existing data validations.

Syntax

Namespace: FlexCel.XlsAdapter

public override TXlsCellRange[] GetDataValidationRanges(Int32 index)

Parameters

<-> | Parameter | Type | Description
 | index | Int32 | Position in the list of data validations. (1 based)

Returns

A list of cell ranges.

See also

  • XlsFile


XlsFile.CheckDataValidation Method | FlexCel Studio for the .NET Framework documentation

XlsFile.CheckDataValidation Method

Overloads

  • XlsFile.CheckDataValidation(Int32, Int32)
  • XlsFile.CheckDataValidation(Int32, Int32, Object, Boolean)

XlsFile.CheckDataValidation(Int32, Int32)

Checks if the data in the cells where the data validation applies conforms to the data validation specifications.

Syntax

Namespace: FlexCel.XlsAdapter

public override TCellAddress[] CheckDataValidation(Int32 index, Int32 maxErrors)

Parameters

<-> | Parameter | Type | Description
 | index | Int32 | Position in the list of data validations. (1 based)
 | maxErrors | Int32 | The maximum number of errors reported by this method. To avoid getting a too big list, set it to a number like 100. If set to 0 or a negative number, the full list of errors will be returned, which can be very big.

Returns

An array with the first maxErrors cells that do not conform to the data validation. And empty array if all the cells conform.

See also

  • XlsFile

XlsFile.CheckDataValidation(Int32, Int32, Object, Boolean)

Returns -1 if the value complies with all the data validations at the cell in row, col, or the position of the data validation that causes the error if the value is not valid. The position returned is 1 based, and you can use ExcelFile.GetDataValidationInfo to get all information of the data validation.

When the parameter setIsValid is true and the data is valid, then this will also set the cell to value.

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 CheckDataValidation(Int32 row, Int32 col, Object value, Boolean setIfValid)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row for the cell where we would like to enter the value. (1 based)
 | col | Int32 | Column for the cell where we would like to enter the value. (1 based)
 | value | Object | Value that we want to check if valid.
 | setIfValid | Boolean | When true, the we will also set the cell value if the condition is valid. When false, we will only check if the value is valid, but keep the old value on the cell.

Returns

-1 if the value is valid for the cell according with the data validations on it, the position of the data validation causing the error otherwise. The position returned is 1 based, and you can use ExcelFile.GetDataValidationInfo to get all information of the data validation.

Examples

To set a value in a cell if valid, and if not show the error associated to this data validation, you could use code like:

    var xls = new XlsFile(sourceFileName, true);
    xls.ActiveSheetByName = "Sheet With Data";

    //We will try to enter the number 11 at cell (row, col).
    int dv = xls.CheckDataValidation(row, col, 11, true);

    if (dv > 0) //There was an error. The cell value is not modified
    {
        TDataValidationInfo dvInfo = xls.GetDataValidationInfo(dv);
        LogMessage(dvInfo.ErrorBoxText);
    }

See also

  • XlsFile


XlsFile.CheckDataValidationsInSheet Method | FlexCel Studio for the .NET Framework documentation

XlsFile.CheckDataValidationsInSheet Method

Checks if all the cells in the active sheet inside data validations have values that are valid according to the data validation specifications.

Syntax

Namespace: FlexCel.XlsAdapter

public override TCellAddress[] CheckDataValidationsInSheet(Int32 sheet, Int32 maxErrors)

Parameters

<-> | Parameter | Type | Description
 | sheet | Int32 | Sheet to check (1 based)
 | maxErrors | Int32 | The maximum number of errors reported by this method. To avoid getting a too big list, set it to a number like 100. If set to 0 or a negative number, the full list of errors will be returned, which can be very big.

Returns

An array with the first maxErrors cells that do not conform to the data validation. And empty array if all the cells conform.

See also

  • XlsFile


XlsFile.CheckDataValidationsInWorkbook Method | FlexCel Studio for the .NET Framework documentation

XlsFile.CheckDataValidationsInWorkbook Method

Checks if all the cells in the file inside data validations have values that are valid according to the data validation specifications.

Syntax

Namespace: FlexCel.XlsAdapter

public override TCellAddress[] CheckDataValidationsInWorkbook(Int32 maxErrors)

Parameters

<-> | Parameter | Type | Description
 | maxErrors | Int32 | The maximum number of errors reported by this method. To avoid getting a too big list, set it to a number like 100. If set to 0 or a negative number, the full list of errors will be returned, which can be very big.

Returns

An array with the first maxErrors cells that do not conform to the data validation. And empty array if all the cells conform.

Examples

The following code will mark in red all the cells in a file which don't comply with the data validations and save the file with a different name:

    static void CheckDataValidationsInWorkbook(string sourceFileName, string targetFileName)
    {
        var xls = new XlsFile(sourceFileName, true);
        var cellsWithErrors = xls.CheckDataValidationsInWorkbook(0);

        var fmt = xls.GetStyle(xls.GetBuiltInStyleName(TBuiltInStyle.Bad, 0), true);
        int xf = xls.AddFormat(fmt);

        for (int i = 0; i < cellsWithErrors.Length; i++)
        {
            xls.ActiveSheetByName = cellsWithErrors[i].Sheet;
            xls.SetCellFormat(cellsWithErrors[i].Row, cellsWithErrors[i].Col, xf);
        }
        xls.Save(targetFileName);

    }

See also

  • XlsFile


XlsFile.GetHyperLink Method | FlexCel Studio for the .NET Framework documentation

XlsFile.GetHyperLink Method

Returns the hyperlink at position index on the list.

Syntax

Namespace: FlexCel.XlsAdapter

public override THyperLink GetHyperLink(Int32 hyperLinkIndex)

Parameters

<-> | Parameter | Type | Description
 | hyperLinkIndex | Int32 | Index of the hyperlink (1 based).

Returns

Hyperlink description.

See also

  • XlsFile


XlsFile.SetHyperLink Method | FlexCel Studio for the .NET Framework documentation

XlsFile.SetHyperLink Method

Modifies an existing Hyperlink. Use ExcelFile.AddHyperLink to add a new one.

Syntax

Namespace: FlexCel.XlsAdapter

public override void SetHyperLink(Int32 hyperLinkIndex, THyperLink value)

Parameters

<-> | Parameter | Type | Description
 | hyperLinkIndex | Int32 | Index of the hyperlink (1 based).
 | value | THyperLink | Hyperlink description.

See also

  • XlsFile


XlsFile.GetHyperLinkCellRange Method | FlexCel Studio for the .NET Framework documentation

XlsFile.GetHyperLinkCellRange Method

Returns the cell range a hyperlink refers to.

Remarks

While normally hyperlinks refer to a single cell, you can make them point to a range. This method will return the first and last cell of the range that the hyperlink applies to.

Syntax

Namespace: FlexCel.XlsAdapter

public override TXlsCellRange GetHyperLinkCellRange(Int32 hyperLinkIndex)

Parameters

<-> | Parameter | Type | Description
 | hyperLinkIndex | Int32 | Index of the hyperlink (1 based).

Returns

Range the hyperlink applies to.

See also

  • XlsFile


XlsFile.SetHyperLinkCellRange Method | FlexCel Studio for the .NET Framework documentation

XlsFile.SetHyperLinkCellRange Method

Changes the cells an hyperlink is linked to.

Syntax

Namespace: FlexCel.XlsAdapter

public override void SetHyperLinkCellRange(Int32 hyperLinkIndex, TXlsCellRange cellRange)

Parameters

<-> | Parameter | Type | Description
 | hyperLinkIndex | Int32 | Index of the hyperlink (1 based).
 | cellRange | TXlsCellRange | Range of cells the hyperlink will refer to.

See also

  • XlsFile


XlsFile.AddHyperLink Method | FlexCel Studio for the .NET Framework documentation

XlsFile.AddHyperLink Method

Adds a new hyperlink to the Active sheet. Use ExcelFile.SetHyperLink to modify an existing one.

Syntax

Namespace: FlexCel.XlsAdapter

public override void AddHyperLink(TXlsCellRange cellRange, THyperLink value)

Parameters

<-> | Parameter | Type | Description
 | cellRange | TXlsCellRange | Range of cells the hyperlink will refer to.
 | value | THyperLink | Description of the hyperlink.

See also

  • XlsFile


XlsFile.DeleteHyperLink Method | FlexCel Studio for the .NET Framework documentation

XlsFile.DeleteHyperLink Method

Deletes an existing hyperlink.

Syntax

Namespace: FlexCel.XlsAdapter

public override void DeleteHyperLink(Int32 hyperLinkIndex)

Parameters

<-> | Parameter | Type | Description
 | hyperLinkIndex | Int32 | Index of the hyperlink (1 based).

See also

  • XlsFile


XlsFile.LoopHyperLinks Method | FlexCel Studio for the .NET Framework documentation

XlsFile.LoopHyperLinks Method

Loops over the list of existing hyperlinks in the active sheet which are at least partially contained in range, and executes action for each one of those links. This can be faster than looping over all hyperlinks in a page if you have thousands, since this method uses spatial indexing.

Remarks

The list of links that will be returned is frozen at the start of the method. If you add new links in the anonymous method "action", this method won't loop over those new links.

Syntax

Namespace: FlexCel.XlsAdapter

public override void LoopHyperLinks(TXlsCellRange range, Boolean fullyInside, Action<THyperLink, TXlsCellRange> action)

Parameters

<-> | Parameter | Type | Description
 | range | TXlsCellRange | Range of cells for which you want to retrieve the links.
 | fullyInside | Boolean | If true, only those links that are fully inside the range will be returned. If false, links which have only a part inside but also a part outside will be returned too.
 | action | Action<THyperLink, TXlsCellRange> | Actions to be applied to every link at least partially included in range.

Examples

The following example will find if there is an hyperlink at cell B3, and if there is some, call DoSomething with the link text.

    xls.LoopHyperLinks(new TXlsCellRange("B3"), false,
        (hyperlink, range) =>
        {
            if (hyperlink != null) DoSomething(hyperlink.Text);
        }
    );

Remember that while this method is efficient because the search is indexed, if you want to find for example all links in a column, it is faster to do a single call to LoopHyperLinks(B1:B10) than to call LoopHyperLinks(B1) to get the link at B1, then LoopHyperLinks(B2) for B2 and so on.

See also

  • XlsFile


XlsFile.GetRowOutlineLevel Method | FlexCel Studio for the .NET Framework documentation

XlsFile.GetRowOutlineLevel Method

Returns the Outline level for a row.

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 GetRowOutlineLevel(Int32 row)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row index (1 based)

Returns

Outline level for a row. It is a number between 0 and 7.

See also

  • XlsFile


XlsFile.SetRowOutlineLevel Method | FlexCel Studio for the .NET Framework documentation

XlsFile.SetRowOutlineLevel Method

Sets the Outline level for a row range.

Syntax

Namespace: FlexCel.XlsAdapter

public override void SetRowOutlineLevel(Int32 firstRow, Int32 lastRow, Int32 level)

Parameters

<-> | Parameter | Type | Description
 | firstRow | Int32 | Row index of the first row on the range. (1 based)
 | lastRow | Int32 | Row index of the last row on the range. (1 based)
 | level | Int32 | Outline level. must be between 0 and 7.

See also

  • XlsFile


XlsFile.GetColOutlineLevel Method | FlexCel Studio for the .NET Framework documentation

XlsFile.GetColOutlineLevel Method

Returns the Outline level for a column.

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 GetColOutlineLevel(Int32 col)

Parameters

<-> | Parameter | Type | Description
 | col | Int32 | Column index (1 based)

Returns

Outline level for a column. It is a number between 0 and 7.

See also

  • XlsFile


XlsFile.SetColOutlineLevel Method | FlexCel Studio for the .NET Framework documentation

XlsFile.SetColOutlineLevel Method

Sets the Outline level for a column range.

Syntax

Namespace: FlexCel.XlsAdapter

public override void SetColOutlineLevel(Int32 firstCol, Int32 lastCol, Int32 level)

Parameters

<-> | Parameter | Type | Description
 | firstCol | Int32 | Column index of the first column on the range. (1 based)
 | lastCol | Int32 | Column index of the last column on the range. (1 based)
 | level | Int32 | Outline level. must be between 0 and 7.

See also

  • XlsFile


XlsFile.CollapseOutlineRows Method | FlexCel Studio for the .NET Framework documentation

XlsFile.CollapseOutlineRows Method

Collapses or expands the row outlines in a sheet to the specified level. It is equivalent to pressing the numbers at the top of the outline gutter in Excel.

Syntax

Namespace: FlexCel.XlsAdapter

public override void CollapseOutlineRows(Int32 level, TCollapseChildrenMode collapseChildren, Int32 firstRow, Int32 lastRow)

Parameters

<-> | Parameter | Type | Description
 | level | Int32 | Level that we want to show of the outline. (1 based). For example, setting Level = 3 is the same as pressing the "3" number at the top of the outline gutter in Excel. Setting Level = 1 will collapse all groups, Level = 8 will expand all groups.
 | collapseChildren | TCollapseChildren​Mode | Determines if the children of the collapsed nodes will be collapsed too.
 | firstRow | Int32 | This defines the first row of the range to collapse/expand. Only rows inside that range will be modified.
 | lastRow | Int32 | This defines the last row of the range to collapse/expand. Only rows inside that range will be modified.

See also

  • XlsFile


XlsFile.CollapseOutlineCols Method | FlexCel Studio for the .NET Framework documentation

XlsFile.CollapseOutlineCols Method

Collapses or expands the column outlines in a sheet to the specified level. It is equivalent to pressing the numbers at the top of the outline gutter in Excel.

Syntax

Namespace: FlexCel.XlsAdapter

public override void CollapseOutlineCols(Int32 level, TCollapseChildrenMode collapseChildren, Int32 firstCol, Int32 lastCol)

Parameters

<-> | Parameter | Type | Description
 | level | Int32 | Level that we want to display from the outline. (1 based). For example, setting Level = 3 is the same as pressing the "3" number at the left of the outline gutter in Excel. Setting Level = 1 will collapse all groups, Level = 8 will expand all groups.
 | collapseChildren | TCollapseChildren​Mode | Determines if the children of the collapsed nodes will be collapsed too.
 | firstCol | Int32 | This defines the first column of the range to collapse/expand. Only columns inside that range will be modified.
 | lastCol | Int32 | This defines the last column of the range to collapse/expand. Only columns inside that range will be modified.

See also

  • XlsFile


XlsFile.IsOutlineNodeRow Method | FlexCel Studio for the .NET Framework documentation

XlsFile.IsOutlineNodeRow Method

Returns true when the row is the one that is used for collapsing an outline. (it has a "+" at the left).

Syntax

Namespace: FlexCel.XlsAdapter

public override Boolean IsOutlineNodeRow(Int32 row)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row to test (1 based)

Returns

True if the node has a "+" mark.

See also

  • XlsFile


XlsFile.IsOutlineNodeCol Method | FlexCel Studio for the .NET Framework documentation

XlsFile.IsOutlineNodeCol Method

Returns true when the column is the one that is used for collapsing an outline. (it has a "+" at the top).

Syntax

Namespace: FlexCel.XlsAdapter

public override Boolean IsOutlineNodeCol(Int32 col)

Parameters

<-> | Parameter | Type | Description
 | col | Int32 | Column to test (1 based)

Returns

True if the node has a "+" mark.

See also

  • XlsFile


XlsFile.IsOutlineNodeCollapsedRow Method | FlexCel Studio for the .NET Framework documentation

XlsFile.IsOutlineNodeCollapsedRow Method

Returns true when the row is an outline node (it has a "+" at the left) and it is closed (all children are hidden).

Syntax

Namespace: FlexCel.XlsAdapter

public override Boolean IsOutlineNodeCollapsedRow(Int32 row)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row to test (1 based)

Returns

True if the row contains a node and it is collapsed, false otherwise.

See also

  • XlsFile


XlsFile.IsOutlineNodeCollapsedCol Method | FlexCel Studio for the .NET Framework documentation

XlsFile.IsOutlineNodeCollapsedCol Method

Returns true when the column is an outline node (it has a "+" at the top) and it is closed (all children are hidden).

Syntax

Namespace: FlexCel.XlsAdapter

public override Boolean IsOutlineNodeCollapsedCol(Int32 col)

Parameters

<-> | Parameter | Type | Description
 | col | Int32 | Column to test (1 based)

Returns

True if the column contains a node and it is collapsed, false otherwise.

See also

  • XlsFile


XlsFile.CollapseOutlineNodeRow Method | FlexCel Studio for the .NET Framework documentation

XlsFile.CollapseOutlineNodeRow Method

Use this method to collapse a node of the outline. If the row is not a node (ExcelFile.IsOutlineNodeRow is false) this method does nothing. While this method allows a better control of the rows expanded and collapsed, you will normally use ExcelFile.CollapseOutlineRows(Int32, TCollapseChildrenMode) to collapse or expand all rows in a sheet.

Syntax

Namespace: FlexCel.XlsAdapter

public override void CollapseOutlineNodeRow(Int32 row, Boolean collapse)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row to expand or collapse (1 based)
 | collapse | Boolean | If true, the node will be collapsed, else it will be expanded.

See also

  • XlsFile


XlsFile.CollapseOutlineNodeCol Method | FlexCel Studio for the .NET Framework documentation

XlsFile.CollapseOutlineNodeCol Method

Use this method to collapse a node of the outline. If the column is not a node (ExcelFile.IsOutlineNodeCol is false) this method does nothing. While this method allows a better control of the columns expanded and collapsed, you will normally use ExcelFile.CollapseOutlineCols(Int32, TCollapseChildrenMode) to collapse or expand all columns in a sheet.

Syntax

Namespace: FlexCel.XlsAdapter

public override void CollapseOutlineNodeCol(Int32 col, Boolean collapse)

Parameters

<-> | Parameter | Type | Description
 | col | Int32 | Column to expand or collapse. (1 based)
 | collapse | Boolean | If true, the node will be collapsed, else it will be expanded.

See also

  • XlsFile


XlsFile.SubtotalDefaultEnglishString Method | FlexCel Studio for the .NET Framework documentation

XlsFile.SubtotalDefaultEnglishString Method

Returns the english string that Excel uses to refer to Sums, averages, et. when you use the Subtotal command. You can use the result of this method together with ExcelFile.Subtotal to specify the text for totals.

Syntax

Namespace: FlexCel.XlsAdapter

public override String SubtotalDefaultEnglishString(Int32 aggFunction)

Parameters

<-> | Parameter | Type | Description
 | aggFunction | Int32 | Number of function used for aggregating. If the number is unknown then this function will return "Total". For known numbers this function will return what Excel writes on the cells for that function.

See also

  • XlsFile


XlsFile.Subtotal Method | FlexCel Studio for the .NET Framework documentation

XlsFile.Subtotal Method

This method works like the "Subtotal" command in Excel in the "Data" tab of the ribbon. It will take a number of cells and group them by similar values, adding a subtotal formula every new different value and a grand total at the end. It will also add outlines at the right.

Syntax

Namespace: FlexCel.XlsAdapter

public override void Subtotal(TXlsCellRange range, Int32 atChangeInColumn, Int32 aggFunction, Int32[] subtotalColumns, Func<Int32, Int32, Object, String, String> SubtotalText, String grandtotalText, Func<TFlxFormat, Object, TFlxFormat> SubTotalRowFormat, Func<TFlxFormat, Object, TFlxFormat> SubTotalCellTextFormat, Func<TFlxFormat, Object, TFlxFormat> SubTotalCellFormulaFormat, Func<TFlxFormat, TFlxFormat> GrandTotalRowFormat, Func<TFlxFormat, TFlxFormat> GrandTotalCellTextFormat, Func<TFlxFormat, TFlxFormat> GrandTotalCellFormulaFormat)

Parameters

<-> | Parameter | Type | Description
 | range | TXlsCellRange | Range where to apply the subtotals. If null, the whole sheet will be used.
 | atChangeInColumn | Int32 | Index of the column where we want to group in. Every time a value in this column changes from the previous row, a new subtotal will be added.
 | aggFunction | Int32 | Function that will be used in the =Subtotal(...) formula added. To do a sum, set this value to 9. For other values, see the Excel reference in the =Subtotal function.
 | subtotalColumns | Int32[] | We will add a subtotal formula in each one of the columns in this array.
 | SubtotalText | Func<Int32, Int32, Object, String, String> | In this function you need to return the text that will be written in every "Subtotal" line. The parameters to this function are the row, column, and value of the cell we are aggregating, as an object and as a string. If this function is null, "aggregatedcolumn Total" will be written.
 | grandtotalText | String | Text for the grand total line. If null or empty, no grand total line will be added. Note: You can pass "Grand " + the result of ExcelFile.SubtotalDefaultEnglishString here to get the standard English labels for the function ("Total", "Average", etc).
 | SubTotalRowFormat | Func<TFlxFormat, Object, TFlxFormat> | Row format for the subtotal rows added. You get a TFlxFormat and the cell value for the column you are aggregating, and you must return a changed one with the format you want. You might leave this function null, and no special format will be applied to the rows.
 | SubTotalCellTextFormat | Func<TFlxFormat, Object, TFlxFormat> | Cell format for the subtotal cells which contain text like "Food Subtotal". You get a TFlxFormat and the cell value for the column you are aggregating, and you must return a changed one with the format you want. You might leave this function null, and bold will be applied to all subtotal texts.
 | SubTotalCellFormulaFormat | Func<TFlxFormat, Object, TFlxFormat> | Cell format for the subtotal cells which contain formulas like =Subtotal(...). You get a TFlxFormat and the cell value for the column you are aggregating, and you must return a changed one with the format you want. You might leave this function null, and no special format will be applied to subtotal formulas.
 | GrandTotalRowFormat | Func<TFlxFormat, TFlxFormat> | Row format for the grand total row added. You get a TFlxFormat, and you must return a changed one with the format you want. You might leave this function null, and no special format will be applied to the grand total row.
 | GrandTotalCellTextFormat | Func<TFlxFormat, TFlxFormat> | Cell format for the grand total cells which contain text like "Food Total". You get a TFlxFormat, and you must return a changed one with the format you want. You might leave this function null, and bold will be applied to all grand total texts.
 | GrandTotalCellFormulaFormat | Func<TFlxFormat, TFlxFormat> | Cell format for the grand total cells which contain formulas like =Subtotal(...). You get a TFlxFormat, and you must return a changed one with the format you want. You might leave this function null, and no special format will be applied to grand total formulas.

Examples

The following example will calculate the Count (function 3) of column 2 at every change of column 1. It will write "Grand Count" in the big total, and the rest of parameters will be the default.

    xls.Subtotal(null, 1, 3, new int[] { 2 }, null, "Grand " + xls.SubtotalDefaultEnglishString(3), null, null, null, null, null, null);

Below is a more complex example, which will calculate the Average (function 1) of columns 4 and 5 at every change of column 3. This method uses the callbacks to provide custom text for the subtotal lines and custom formats for all possible cases. This can be useful if default texts aren't enough or you want to use other language than English, but normally most callbacks will be null as the defaults should work in most cases. This example is just to show all the functionality in a single call.

     xls.Subtotal(new TXlsCellRange(2, 1, xls.RowCount - 1, 2), 3, 1, new int[] { 4, 5 },
         (row, col, cellVal, cellValAsString) => { return "This is the average of " + cellValAsString; }
         , "Super Average",
         (fmt, cellval) =>
         {
             fmt.Font.Name = "Courier new";
             fmt.Font.Scheme = TFontScheme.None;
             fmt.FillPattern.Pattern = TFlxPatternStyle.Solid;
             fmt.FillPattern.FgColor = Colors.MediumAquamarine;
             return fmt;
         },
         (fmt, cellval) =>
         {
             fmt.Font.Style = TFlxFontStyles.Bold;
             fmt.FillPattern.Pattern = TFlxPatternStyle.Solid;
             fmt.FillPattern.FgColor = Colors.MediumBlue;
             return fmt;
         },
         (fmt, cellval) =>
         {
             fmt.Font.Style = TFlxFontStyles.Italic;
             fmt.FillPattern.Pattern = TFlxPatternStyle.Solid;
             fmt.FillPattern.FgColor = Colors.MediumOrchid;
             return fmt;
         },
         (fmt) =>
         {
             fmt.Font.Style = TFlxFontStyles.StrikeOut;
             fmt.FillPattern.Pattern = TFlxPatternStyle.Solid;
             fmt.FillPattern.FgColor = Colors.MediumSeaGreen;
             return fmt;
         },
         (fmt) =>
         {
             fmt.Font.Style = TFlxFontStyles.StrikeOut;
             fmt.FillPattern.Pattern = TFlxPatternStyle.Solid;
             fmt.FillPattern.FgColor = Colors.MediumSpringGreen;
             return fmt;
         },
         (fmt) =>
         {
             fmt.Font.Style = TFlxFontStyles.StrikeOut;
             fmt.FillPattern.Pattern = TFlxPatternStyle.Solid;
             fmt.FillPattern.FgColor = Colors.MediumTurquoise;
             return fmt;
         }
    );

See also

  • XlsFile


XlsFile.SelectCells Method | FlexCel Studio for the .NET Framework documentation

XlsFile.SelectCells Method

Selects a group of cells on a given pane. If you just want to select just one cell, you can use the simpler method ExcelFile.SelectCell This property can work in different windows depending on the value of ExcelFile.ActiveWindow

Syntax

Namespace: FlexCel.XlsAdapter

public override void SelectCells(TXlsCellRange[] cellRange)

Parameters

<-> | Parameter | Type | Description
 | cellRange | TXlsCellRange[] | Cells to select.

See also

  • XlsFile


XlsFile.GetSelectedCells Method | FlexCel Studio for the .NET Framework documentation

XlsFile.GetSelectedCells Method

Returns the selected ranges on a sheet. This property can work in different windows depending on the value of ExcelFile.ActiveWindow

Syntax

Namespace: FlexCel.XlsAdapter

public override TXlsCellRange[] GetSelectedCells()

See also

  • XlsFile


XlsFile.ScrollWindow Method | FlexCel Studio for the .NET Framework documentation

XlsFile.ScrollWindow Method

Scrolls the window to a specified place. This property can work in different windows depending on the value of ExcelFile.ActiveWindow

Syntax

Namespace: FlexCel.XlsAdapter

public override void ScrollWindow(TPanePosition panePosition, Int32 row, Int32 col)

Parameters

<-> | Parameter | Type | Description
 | panePosition | TPanePosition | Pane to move. Note that if you move for example the left column of the upper left pane, you will also move the left column of the lower left pane.
 | row | Int32 | First visible row.
 | col | Int32 | First visible column.

See also

  • XlsFile


XlsFile.GetWindowScroll Method | FlexCel Studio for the .NET Framework documentation

XlsFile.GetWindowScroll Method

Returns the window scroll for a specified pane. This property can work in different windows depending on the value of ExcelFile.ActiveWindow

Syntax

Namespace: FlexCel.XlsAdapter

public override TCellAddress GetWindowScroll(TPanePosition panePosition)

Parameters

<-> | Parameter | Type | Description
 | panePosition | TPanePosition | Pane to return.

See also

  • XlsFile


XlsFile.FreezePanes Method | FlexCel Studio for the .NET Framework documentation

XlsFile.FreezePanes Method

This command is equivalent to Menu->Window->Freeze Panes. It will freeze the rows and columns above and to the left from cell. Note that because Excel works this way, when you ExcelFile.SplitWindow the panes are suppressed and vice-versa See also ExcelFile.GetFrozenPanes This property can work in different windows depending on the value of ExcelFile.ActiveWindow

Syntax

Namespace: FlexCel.XlsAdapter

public override void FreezePanes(TCellAddress cell)

Parameters

<-> | Parameter | Type | Description
 | cell | TCellAddress | All rows and columns above and to the left of this cell will be frozen. Set it to null or "A1" to unfreeze the panes.

See also

  • XlsFile


XlsFile.GetFrozenPanes Method | FlexCel Studio for the .NET Framework documentation

XlsFile.GetFrozenPanes Method

Returns the cell that is freezing the window, "A1" if no panes are frozen. See also ExcelFile.FreezePanes This property can work in different windows depending on the value of ExcelFile.ActiveWindow

Syntax

Namespace: FlexCel.XlsAdapter

public override TCellAddress GetFrozenPanes()

See also

  • XlsFile


XlsFile.SplitWindow Method | FlexCel Studio for the .NET Framework documentation

XlsFile.SplitWindow Method

This command is equivalent to Menu->Window->Split. It will split the window in 4 regions. Note that because Excel works this way, when you ExcelFile.FreezePanes the windows are unsplitted and vice-versa See also ExcelFile.GetSplitWindow This property can work in different windows depending on the value of ExcelFile.ActiveWindow

Syntax

Namespace: FlexCel.XlsAdapter

public override void SplitWindow(Int32 xOffset, Int32 yOffset)

Parameters

<-> | Parameter | Type | Description
 | xOffset | Int32 | Offset from the left on 1/20 of a point. Zero for no vertical split.
 | yOffset | Int32 | Offset from the top on 1/20 of a point. Zero for no horizontal split.

See also

  • XlsFile


XlsFile.GetSplitWindow Method | FlexCel Studio for the .NET Framework documentation

XlsFile.GetSplitWindow Method

Returns the horizontal and vertical offsets for the split windows. Zero means no split. See also ExcelFile.SplitWindow This property can work in different windows depending on the value of ExcelFile.ActiveWindow

Syntax

Namespace: FlexCel.XlsAdapter

public override TPoint GetSplitWindow()

See also

  • XlsFile


XlsFile.GetDataConnections Method | FlexCel Studio for the .NET Framework documentation

XlsFile.GetDataConnections Method

Returns the data connections in the file. Use ExcelFile.SetDataConnections to change the connections in the file.

Syntax

Namespace: FlexCel.XlsAdapter

public override TDataConnections GetDataConnections()

See also

  • XlsFile


XlsFile.SetDataConnections Method | FlexCel Studio for the .NET Framework documentation

XlsFile.SetDataConnections Method

Sets the data connections in the file.

Syntax

Namespace: FlexCel.XlsAdapter

public override void SetDataConnections(TDataConnections connections)

Parameters

<-> | Parameter | Type | Description
 | connections | TDataConnections | Object with all connections in the file. Set it to null if you want to remove all connections.

See also

  • XlsFile


XlsFile.GetChart Method | FlexCel Studio for the .NET Framework documentation

XlsFile.GetChart Method

Returns a chart from an object position and path. If the object does not contain a chart, it returns null. Note that charts can be first-level objects (in chart sheets), or they can be embedded inside other objects, that can be themselves embedded inside other objects. So you need to recursively look inside all objects to see if there are charts anywhere.

Look at the example in this topic to see how to get all charts in a sheet.

Syntax

Namespace: FlexCel.XlsAdapter

public override ExcelChart GetChart(Int32 objectIndex, String objectPath)

Parameters

<-> Parameter Type Description
objectIndex Int32 Index of the object (1-based)
objectPath String Index to the child object where the chart is.
If it is a simple object, you can use String.Empty here, if not you need to get the ObjectPath from ExcelFile.GetObjectProperties(Int32, Boolean)
If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"

Examples

The following example will retrieve all charts that are inserted as objects in a sheet, along with the chart sheets.

    public void ProcessAllCharts()
    {
        XlsFile xls = new XlsFile(true);
        xls.Open("filewithcharts.xls");
        for (int iSheet = 1; iSheet <= xls.SheetCount; iSheet++)
        {
            xls.ActiveSheet = iSheet;

            //Process charts embedded as objects in worksheets.
            for (int iChart = 1; iChart <= xls.ObjectCount; iChart++)
            {
                TShapeProperties props = xls.GetObjectProperties(iChart, true);
                ProcessChart(xls, iChart, props); //We need to process it even if it is not a chart, since it might be a group with a chart inside.
            }

            //Process chart sheets.
            if (xls.SheetType == TSheetType.Chart)
            {
                ExcelChart chart = xls.GetChart(1, null);
                DoSomething(xls, chart);
            }

        }

        xls.Save("changedfilewithcharts.xls");
    }

    private void ProcessChart(ExcelFile xls, int iChart, TShapeProperties props)
    {
        if (props.ObjectType == TObjectType.Chart)
        {
            ExcelChart chart = xls.GetChart(iChart, props.ObjectPath);
            DoSomething(xls, chart);
        }

        for (int i = 1; i <= props.ChildrenCount; i++)
        {
            TShapeProperties childProp = props.Children(i);
            ProcessChart(xls, i, childProp);
        }
    }

See also

  • XlsFile


XlsFile.AddChart Method | FlexCel Studio for the .NET Framework documentation

XlsFile.AddChart Method

This method will add a chart to the active sheet. You can then add series and customize the returned ExcelChart object.

Important: This method only works in xlsx files.

Syntax

Namespace: FlexCel.XlsAdapter

public override ExcelChart AddChart(TShapeProperties objProps, TChartType chartType, ChartStyle aChartStyle, Boolean roundedCorners)

Parameters

<-> | Parameter | Type | Description
 | objProps | TShapeProperties | Place where the chart will be placed and characteristics like if it is printable or not.
 | chartType | TChartType | Kind of chart created. Note that you can have more than one type of chart in the same chart, so this just sets the base chart type. You can add other chart types over it.
 | aChartStyle | ChartStyle | Theme of the chart. This is a number between 1 and 48 which defines many standard properties for the chart, like the default line width for the series or the legend. The default style is 2.
 | roundedCorners | Boolean | If true, the chart will have rounded corners.

See also

  • XlsFile


XlsFile.Find Method | FlexCel Studio for the .NET Framework documentation

XlsFile.Find Method

Finds a value inside a cell and returns the position for the cell, or null if nothing was found.

Syntax

Namespace: FlexCel.XlsAdapter

public override TCellAddress Find(Object value, TXlsCellRange Range, TCellAddress Start, Boolean ByRows, Boolean CaseInsensitive, Boolean SearchInFormulas, Boolean WholeCellContents)

Parameters

<-> | Parameter | Type | Description
 | value | Object | Value we are searching.
 | Range | TXlsCellRange | Range to Search. Null means the whole worksheet.
 | Start | TCellAddress | Cell where to start searching. For the first time, use null. After this, you can use the result of this method to get the next cell.
 | ByRows | Boolean | If true, the value will be searched down then left. If false, the search will go left then down. SEARCH IS FASTER WHEN BYROWS = FALSE
 | CaseInsensitive | Boolean | If true, string searches will not be case sensitive, "a" = "A"
 | SearchInFormulas | Boolean | If true, the search will cover formulas too.
 | WholeCellContents | Boolean | If true, the string must match the whole cell, not a part of it.

Returns

Cell where the string is found, or null if it is not found.

Examples

To find all cells on a sheet that contain the string "bolts":

    TCellAddress Cell = null; //initialize the value to null to start searching.
    do
    {
        Cell = xls.Find("bolts", null, Cell, false, true, true, false); //find the next value.
        if (Cell != null) LogMessage(Cell.CellRef);
    }
    while (Cell != null); //until it doesn't find any more matches.

See also

  • XlsFile


XlsFile.Replace Method | FlexCel Studio for the .NET Framework documentation

XlsFile.Replace Method

Replaces the instances of oldValue by newValue in the active sheet, and allows to specify the cell format and value for every replaced cell.

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 Replace(Object oldValue, Object newValue, TXlsCellRange Range, Boolean CaseInsensitive, Boolean SearchInFormulas, Boolean WholeCellContents, Action<TReplaceAction> ReplaceAction)

Parameters

<-> | Parameter | Type | Description
 | oldValue | Object | Value we want to replace.
 | newValue | Object | Value we want to use to replace oldValue.
 | Range | TXlsCellRange | Range to Search. Null means the whole worksheet.
 | CaseInsensitive | Boolean | If true, string searches will not be case sensitive, "a" = "A"
 | SearchInFormulas | Boolean | If true, the search will cover formulas too.
 | WholeCellContents | Boolean | If true, only whole cells will be replaced.
 | ReplaceAction | Action<TReplaceAction> | Action to be performed in every replacement.

Returns

The number of replacements done.

Examples

To replace all cells on a sheet that contain 1999-01-01 with 2003-01-01, formatting the cells in column 3 as blue:

    xls.Replace(new DateTime(1999, 01, 01), new DateTime(2003, 01, 01), null, true, true, true,
                (x) =>
                  {
                      if (x.Col == 3)
                      {
                          TFlxFormat fm = x.Workbook.GetFormat(x.XF);
                          fm.FillPattern.FgColor = Colors.Red;
                          fm.FillPattern.Pattern = TFlxPatternStyle.Solid;
                          x.XF = x.Workbook.AddFormat(fm);
                      }
                  }
    );

See also

  • XlsFile


XlsFile.Sort Method | FlexCel Studio for the .NET Framework documentation

XlsFile.Sort Method

Sorts a range on the current sheet.

Syntax

Namespace: FlexCel.XlsAdapter

public override void Sort(TXlsCellRange Range, Boolean ByRows, Int32[] Keys, TSortOrder[] SortOrder, IComparer Comparer, TSortFormulaMode SortFormulaMode)

Parameters

<-> | Parameter | Type | Description
 | Range | TXlsCellRange | Range to sort. It must not include headers.
 | ByRows | Boolean | If true, rows will be sorted. If false, columns will.
 | Keys | Int32[] | An array of integers indicating the columns or rows you want to use for sorting. Note that this number is absolute, for example column 1 always means column "A" no matter if the range we are sorting begins at column "B". A null array means sort by the first column or row, then by the second, etc. up to 8 entries.
 | SortOrder | TSortOrder[] | An array of flags indicating whether to sort ascending or descending for each Key. If null, all sorts will be ascending. If not null and the array size is less than the size of the "Keys" parameter, all missing entries are assumed to be Ascending.
 | Comparer | IComparer | Comparer to create a custom way to compare the different items. Set it to null to use default ordering.
 | SortFormulaMode | TSortFormulaMode | Defines how formulas in the file will be changed when sorting.

Examples

To sort the range of cells from B7 to D100, on columns B Ascending and C Descending using TSortFormulaMode.ExcelLike:

    xls.Sort(new TXlsCellRange("B7:D100"), //To sort the full sheet, you can pass null here.
        true, //Normally we want to sort the rows in the range. But we might want to sort columns and we can do it by setting this to false.
        new int[] { 2, 3 },// Sort by columns B and C (2 and 3)
        new TSortOrder[] { TSortOrder.Ascending, TSortOrder.Descending }, //Sort column B ascending, column C descending. If you want to sort everything in ascending order, just set this to null.
        null, // Use the standard comparer.
        TSortFormulaMode.ExcelLike //Excel-like is faster, but won't change formulas outside the range being sorted.
        );

See also

  • XlsFile


XlsFile.SetAutoFilter Method | FlexCel Studio for the .NET Framework documentation

XlsFile.SetAutoFilter Method

Sets the AutoFilter in the Active sheet to point to the range specified. Note: You will normally want to use ExcelFile.SetAutoFilter(Int32, Int32, Int32), since that is the common way to set autofilters. The last row shouldn't matter, so it will addapt automatically when you add rows. If you specify the last row, then the range will still grow to include all data, but it will include at least the last row you specify, even if it is blank."/>

Syntax

Namespace: FlexCel.XlsAdapter

public override void SetAutoFilter(Int32 row1, Int32 col1, Int32 row2, Int32 col2)

Parameters

<-> | Parameter | Type | Description
 | row1 | Int32 | Row where the AutoFilter will be placed (1 based).
 | col1 | Int32 | First column for the AutoFilter range (1 based).
 | row2 | Int32 | Last row for the autofilter (1 based).
 | col2 | Int32 | Last column for the AutoFilter range (1 based). Note that the autofilter will automatically expand over this row if you have more non-empty rows below this row.

See also

  • XlsFile


XlsFile.RemoveAutoFilter Method | FlexCel Studio for the .NET Framework documentation

XlsFile.RemoveAutoFilter Method

Removes the AutoFilter from the active sheet. If there is no AutoFilter in the sheet, this method does nothing.

Syntax

Namespace: FlexCel.XlsAdapter

public override void RemoveAutoFilter()

See also

  • XlsFile


XlsFile.HasAutoFilter Method | FlexCel Studio for the .NET Framework documentation

XlsFile.HasAutoFilter Method

Overloads

  • XlsFile.HasAutoFilter
  • XlsFile.HasAutoFilter(Int32, Int32)

XlsFile.HasAutoFilter

Returns true if the active sheet has any AutoFilter defined.

Syntax

Namespace: FlexCel.XlsAdapter

public override Boolean HasAutoFilter()

See also

  • XlsFile

XlsFile.HasAutoFilter(Int32, Int32)

Returns true if a cell has an AutoFilter.

Syntax

Namespace: FlexCel.XlsAdapter

public override Boolean HasAutoFilter(Int32 row, Int32 col)

Parameters

<-> | Parameter | Type | Description
 | row | Int32 | Row of the cell we want to find out. (1 based)
 | col | Int32 | Column of the cell we want to find out. (1 based)

Returns

True if the cell has an AutoFilter, false otherwise.

See also

  • XlsFile


XlsFile.GetAutoFilterRange Method | FlexCel Studio for the .NET Framework documentation

XlsFile.GetAutoFilterRange Method

Returns the range of cells with AutoFilter in the Active sheet, or null if there is not AutoFilter.

Syntax

Namespace: FlexCel.XlsAdapter

public override TXlsCellRange GetAutoFilterRange()

See also

  • XlsFile


XlsFile.Recalc Method | FlexCel Studio for the .NET Framework documentation

XlsFile.Recalc Method

When ExcelFile.RecalcMode is manual, use this method to force a recalculation of the spreadsheet.

Syntax

Namespace: FlexCel.XlsAdapter

public override void Recalc(Boolean forced)

Parameters

<-> | Parameter | Type | Description
 | forced | Boolean | When true this method will always perform a recalc. When false, only if there has been a change on the spreadsheet. While for performance reasons you will normally want to keep this false, you might need to set it to true if the formulas refer to functions like "=NOW()" or "=RANDOM()" that change every time you recalculate.

See also

  • XlsFile


XlsFile.RecalcAndVerify Method | FlexCel Studio for the .NET Framework documentation

XlsFile.RecalcAndVerify Method

Use this method to validate a file. FlexCel does not support all the range of functions from Excel when recalculating, so unknown functions will return "#NAME?" errors. Using this function you can validate your user worksheets and see if all the formulas they use are supported.

Remarks

Note that you *can* use unsupported functions on FlexCel. When you open the generated file on Excel it will show ok. The only problem is if you need to natively print or export to PDF the file.

Also, take in account that RecalcAndVerify is slower than recalc, as it has to do more work to locate the errors. Do not use it as a replace for ExcelFile.Recalc

Syntax

Namespace: FlexCel.XlsAdapter

public override TUnsupportedFormulaList RecalcAndVerify()

See also

  • XlsFile


XlsFile.RecalcCell Method | FlexCel Studio for the .NET Framework documentation

XlsFile.RecalcCell Method

This method will recalculate a single cell and all of it's dependencies, but not the whole workbook.

USE THIS METHOD WITH CARE! You will normally want to simply call ExcelFile.Recalc or just save the file and let FlexCel calculate the workbook for you. This method is for rare situations where you are making thousands of recalculations and the speed of Recalc is not enough, and you have a big part of the spreadsheet that you know that didn't change.

Note: If you are recalculating many cells without changing data, you can speed up calculations by calling ExcelFile.StartBatchRecalcCells and ExcelFile.EndBatchRecalcCells

Syntax

Namespace: FlexCel.XlsAdapter

public override Object RecalcCell(Int32 sheet, Int32 row, Int32 col, Boolean forced)

Parameters

<-> | Parameter | Type | Description
 | sheet | Int32 | Sheet for the cell we want to recalculate. Use ExcelFile.ActiveSheet here to refer to the active sheet.
 | row | Int32 | Row for the cell we want to recalculate. (1 based)
 | col | Int32 | Column for the cell we want to recalculate. (1 based)
 | forced | Boolean | When true this method will always perform a recalc. When false, only if there has been a change on the spreadsheet. While for performance reasons you will normally want to keep this false, you might need to set it to true if the formulas refer to functions like "=NOW()" or "=RANDOM()" that change every time you recalculate.

Returns

The result of the formula at the cell, or null if there is no formula.

Examples

The following code will recalculate the value of cells A1 and A2, but not C7:

    XlsFile xls = new XlsFile(1, TExcelFileFormat.v2021, true);

    xls.SetCellValue(1, 1, new TFormula("=A2 + 5"));
    xls.SetCellValue(2, 1, new TFormula("=A3 * 2"));
    xls.SetCellValue(3, 1, 7);

    xls.SetCellValue(7, 3, new TFormula("=A3 * 2"));

    object ResultValue = xls.RecalcCell(1, 1, 1, true);

    Debug.Assert((double)ResultValue == 19, "RecalcCell returns the value at the cell.");
    Debug.Assert((double)(xls.GetCellValue(1, 1) as TFormula).Result == 19, "Cell A1 was recalculated because we called RecalcCell on it.");
    Debug.Assert((double)(xls.GetCellValue(2, 1) as TFormula).Result == 14, "Cell A2 was recalculated because A1 depends on A2.");
    Debug.Assert((double)(xls.GetCellValue(7, 3) as TFormula).Result == 0, "Cell C7 was NOT recalculated because A1 doesn't have a dependency with it. Call xlsFile.Recalc() to recalc all cells.");

See also

  • XlsFile


XlsFile.StartBatchRecalcCells Method | FlexCel Studio for the .NET Framework documentation

XlsFile.StartBatchRecalcCells Method

This method tells FlexCel that you are going to call multiple times ExcelFile.RecalcCell without changing any data in the spreadsheet. This way, FlexCel won't keep recalculating the same supporting cells each time you call RecalcCells.

Always match this call with a call to ExcelFile.EndBatchRecalcCells.

Syntax

Namespace: FlexCel.XlsAdapter

public override void StartBatchRecalcCells()

Examples

Let's imagine that you want to read the values of cell A1 and cell A2 in a spreadsheet. Let's also imagine that both A1 and A2 depend on cell B1 and B1 depends in a lot of other cells. If you call ExcelFile.RecalcCell first in A1 and then in A2, FlexCel will recalculate B1 and all the cells B1 depends on twice. But if you wrap both calls in Start/EndBatchRecalcCells:

    //Tell FlexCel that from here, all calls to RecalcCell can use the values calculated by previous calls
    //to RecalcCells.
    xls.StartBatchRecalcCells();

    object A1Value = xls.RecalcCell(1, 1, 1, true);

    //This will not recalculate again anything the previous call calculated.
    object A2Value = xls.RecalcCell(2, 1, 1, true);

    //Go back to normal mode.
    xls.EndBatchRecalcCells();

Then FlexCel will calculate B1 only when calculating A1, and will not calculate it again when calculating A2.

See also

  • XlsFile


XlsFile.EndBatchRecalcCells Method | FlexCel Studio for the .NET Framework documentation

XlsFile.EndBatchRecalcCells Method

This method ends the batch started by ExcelFile.StartBatchRecalcCells and goes back to normal mode.

Syntax

Namespace: FlexCel.XlsAdapter

public override void EndBatchRecalcCells()

See also

  • XlsFile


XlsFile.RecalcExpression Method | FlexCel Studio for the .NET Framework documentation

XlsFile.RecalcExpression Method

Calculates the value of any formula and returns the result. The expression must be a valid Excel formula, it must start with "=", and cell references that don't specify a sheet (like for example "=A2") will refer to the active sheet. Cells used by the formula will be recalculated as needed too.

You can use this method as a simple calculator, or to calculate things like the sum of a range of cells in the spreadsheet. Look at the example for more information on how to use it.

Note that we will consider the expression to be located in the cell A1 of the Active sheet. So for example "=ROW()" will return 1, and "=A2" will return the value of A2 in the active sheet.

Syntax

Namespace: FlexCel.XlsAdapter

public override Object RecalcExpression(String expression, Boolean forced)

Parameters

<-> | Parameter | Type | Description
 | expression | String | Formula to evaluate. It must start with "=" and be a valid Excel formula.
 | forced | Boolean | When true this method will always perform a recalc. When false, only if there has been a change on the spreadsheet. While for performance reasons you will normally want to keep this false, you might need to set it to true if the formulas refer to functions like "=NOW()" or "=RANDOM()" that change every time you recalculate.

Returns

The value of the calculated formula.

Examples

To calculate the sum of all the cells in column A of the sheet "Data", you can use the following code:

    ExcelFile xls = new XlsFile("myfile.xls", true);
    xls.ActiveSheetByName = "Data";
    Double Result = Convert.ToDouble(xls.RecalcExpression("=Sum(A:A)"));

To calculate a simple expression, you can use:

    return (double)xls.RecalcExpression("=1 + 2 * 3");

See also

  • XlsFile


XlsFile.RecalcRange Method | FlexCel Studio for the .NET Framework documentation

XlsFile.RecalcRange Method

This method recalculates a formula that returns a range, and returns the cells that compose it. Note that normally ranges are a single rectangle (like in "=A1:B2"), and in this case this method will return a single element in the array. But you might have a formula like "=A1:A10, C6:C7" which will return two different ranges. In this case, the returned array will have more than one TCellAddressRange. If the formula doesn't resolve to a range or group of ranges, this method will return null.

Syntax

Namespace: FlexCel.XlsAdapter

public override TCellAddressRange[] RecalcRange(Int32 activeSheet, Int32 activeRow, Int32 activeCol, Int32 rowOffset, Int32 colOffset, String expression, Boolean forced, Boolean relativeReferences)

Parameters

<-> | Parameter | Type | Description
 | activeSheet | Int32 | Sheet where you are positioned when doing the calculation. You might pass xls.ActiveSheet here.
 | activeRow | Int32 | Row where you are positioned when doing the calculation. This only matters if you have functions that change depending on the cell you are in. (Mainly =Row() and =Column() functions). If you are not sure, specify 1 here.
 | activeCol | Int32 | Column where you are positioned when doing the calculation. This only matters if you have functions that change depending on the cell you are in. (Mainly =Row() and =Column() functions). If you are not sure, specify 1 here.
 | rowOffset | Int32 | Offset from the first cell of a range. This only matters if you have relative references that change depending on the cell you are in. (This is the case with named ranges or data validations and relative references like A1 instead of $A$1). If you are not sure, specify 0 here.
 | colOffset | Int32 | Offset from the first cell of a range. This only matters if you have relative references that change depending on the cell you are in. (This is the case with named ranges or data validations and relative references like A1 instead of $A$1). If you are not sure, specify 0 here.
 | expression | String | Formula to evaluate. It must start with "=", be a valid Excel formula and resolve to a range of cells.
 | forced | Boolean | When true this method will always perform a recalc. When false, only if there has been a change on the spreadsheet. While for performance reasons you will normally want to keep this false, you might need to set it to true if the formulas refer to functions like "=NOW()" or "=RANDOM()" that change every time you recalculate.
 | relativeReferences | Boolean | Specifies if the references in the formula are relative to the cell where the cursor is positioned or not. Formulas in data validations, name definitions and conditional formats are relative and should have this parameter set to true. Formulas in cell are not relative, and should have this parameter set to false.

Returns

The array of ranges that the formula refers to.

See also

  • XlsFile


XlsFile.OffsetRelativeFormula Method | FlexCel Studio for the .NET Framework documentation

XlsFile.OffsetRelativeFormula Method

Use this method to know the actual formula that applies to a cell when the formula is relative. In some places, mostly data validations and names, Excel returns relative formulas.

So for example you might have a name with a definition of "=Sheet1!A2" when you are positioned at cell A1. If you now move the cursor to cell A2 in Excel, the name definition will be "=Sheet1!A3" since the reference is relative to the cell where the cursor is. If you retrieve the name formula with FlexCel, as FlexCel doesn't have a cursor, it will always return the canonical formula as if you were positioned at A1. If you want to know the real formula when you are positioned at A2, you need to call this method with cellRow =3, cellCol = 1 and expression = "=Sheet1!A2". It will return "=Sheet1!A3".

Remarks

Remember that you can use ExcelFile.FormulaReferenceStyle to change the formulas to R1C1 style. R1C1 formulas are nicer for relative formulas, since they don't change when you change the cursor. (R1C1 references are already relative to the cell where the cursor is).

Syntax

Namespace: FlexCel.XlsAdapter

public override String OffsetRelativeFormula(Int32 activeSheet, Int32 cellRow, Int32 cellCol, String expression)

Parameters

<-> | Parameter | Type | Description
 | activeSheet | Int32 | Sheet where you are positioned when doing the calculation. You might pass xls.ActiveSheet here.
 | cellRow | Int32 | Row of the cell where the relative formula is.
 | cellCol | Int32 | Column of the cell where the relative formula is.
 | expression | String | Formula to offset. It must start with "=", and be a valid Excel formula.

Returns

The formula with relative references changed to match the cell at cellRow, cellCol

See also

  • XlsFile


XlsFile.RecalcRelativeFormula Method | FlexCel Studio for the .NET Framework documentation

XlsFile.RecalcRelativeFormula Method

Use this method to know the value of a formula that applies to a cell when the formula is relative. In some places, mostly data validations and names, Excel returns relative formulas.

So for example you might have a name with a definition of "=Sheet1!A2" when you are positioned at cell A1. If you now move the cursor to cell A2 in Excel, the name definition will be "=Sheet1!A3" since the reference is relative to the cell where the cursor is. If you use ExcelFile.RecalcExpression(String) to know the result of the formula, as FlexCel doesn't have a cursor, it will always return the canonical formula as if you were positioned at A1. If you want to know the real formula when you are positioned at A2, you need to call this method with cellRow =3, cellCol = 1 and expression = "=Sheet1!A2". It will return the result of the formula "=Sheet1!A3".

Syntax

Namespace: FlexCel.XlsAdapter

public override Object RecalcRelativeFormula(Int32 activeSheet, Int32 cellRow, Int32 cellCol, String expression)

Parameters

<-> | Parameter | Type | Description
 | activeSheet | Int32 | Sheet where you are positioned when doing the calculation. You might pass xls.ActiveSheet here.
 | cellRow | Int32 | Row of the cell where the relative formula is.
 | cellCol | Int32 | Column of the cell where the relative formula is.
 | expression | String | Formula to offset. It must start with "=", and be a valid Excel formula.

Returns

The value of the calculated formula

See also

  • XlsFile


XlsFile.GetWhatIfTableList Method | FlexCel Studio for the .NET Framework documentation

XlsFile.GetWhatIfTableList Method

Returns a list of the upper cells of the What-if tables in the page. You can then use ExcelFile.GetWhatIfTable to get the definition of each one.

Syntax

Namespace: FlexCel.XlsAdapter

public override TCellAddress[] GetWhatIfTableList()

See also

  • XlsFile


XlsFile.GetWhatIfTable Method | FlexCel Studio for the .NET Framework documentation

XlsFile.GetWhatIfTable Method

Returns the range of cells that make the what-if table that starts at aRow and aCol. If there is no What-if table at aRow, aCol, this method returns null.

If both the returned rowInputCell and colInputCell are null, this means this table points to deleted references.

Syntax

Namespace: FlexCel.XlsAdapter

public override TXlsCellRange GetWhatIfTable(Int32 sheet, Int32 row, Int32 col, out TCellAddress rowInputCell, out TCellAddress colInputCell)

Parameters

<-> | Parameter | Type | Description
 | sheet | Int32 | Sheet where the table is.
 | row | Int32 | First cell from where we want to get a what-if table.
 | col | Int32 | First cell from where we want to get a what-if table.
out | rowInputCell | TCellAddress | Returns the row input cell for this table. If the table doesn't have a row input cell, this value is null.
out | colInputCell | TCellAddress | Returns the column input cell for this table. If the table doesn't have a column input cell, this value is null.

Returns

The full range of the table, not including the formula headers. Only the cells where {=Table()} formulas are..

See also

  • XlsFile


XlsFile.SetWhatIfTable Method | FlexCel Studio for the .NET Framework documentation

XlsFile.SetWhatIfTable Method

Creates an Excel What-if table in the range of cells specified by Range. Calling this method is the same as setting a cell value with a TFormula where TFormula.Span has more than one cell, and TFormula.Text is something like "{=TABLE(,A4)}". The parameters for the =TABLE function are rowInputCell and colInputCell, and they look the same a Excel will show them.

Syntax

Namespace: FlexCel.XlsAdapter

public override void SetWhatIfTable(TXlsCellRange range, TCellAddress rowInputCell, TCellAddress colInputCell)

Parameters

<-> | Parameter | Type | Description
 | range | TXlsCellRange | Range for the table. This is the range of cells that will have "={TABLE()}" formulas.
 | rowInputCell | TCellAddress | Row input cell for the table. Make it null if you don't want a row input cell. If both rowInputCell and colInputCell are null, a table with deleted references will be added. Note that the sheet here is ignored, What-if tables need the input cells to be in the same sheet as the table.
 | colInputCell | TCellAddress | Column input cell for the table. Make it null if you don't want a column input cell. If both rowInputCell and colInputCell are null, a table with deleted references will be added. Note that the sheet here is ignored, What-if tables need the input cells to be in the same sheet as the table.

See also

  • XlsFile


XlsFile.GetLink Method | FlexCel Studio for the .NET Framework documentation

XlsFile.GetLink Method

Gets the external link at position i.

Syntax

Namespace: FlexCel.XlsAdapter

public override String GetLink(Int32 index)

Parameters

<-> | Parameter | Type | Description
 | index | Int32 | Index of the link (1 based). i goes between 1 and ExcelFile.LinkCount

See also

  • XlsFile


XlsFile.SetLink Method | FlexCel Studio for the .NET Framework documentation

XlsFile.SetLink Method

Changes the external link at position i for a new value. Note that you can't add new links with this method, external links are added automatically when you add formulas that reference other worksheets. This method is only to change existing links to point to other place. All formulas pointing to the old link will point to the new.

Note that the replacing filename should have the same sheets as the original, or the formulas might break.

Syntax

Namespace: FlexCel.XlsAdapter

public override void SetLink(Int32 index, String value)

Parameters

<-> | Parameter | Type | Description
 | index | Int32 | Index of the link (1 based). i goes between 1 and ExcelFile.LinkCount
 | value | String | Please make sure this is a VALID filename, or you are likely to crash Excel. Also, xls file format doesn't like paths starting with "..", so you might need to enter the full path here.

See also

  • XlsFile


XlsFile.ConvertFormulasToValues Method | FlexCel Studio for the .NET Framework documentation

XlsFile.ConvertFormulasToValues Method

Use it to convert formulas to their values. It can be useful if for example you are copying the sheet to another workbook, and you don't want any references to it. NOTE: You will probably want to use ExcelFile.ConvertExternalNamesToRefErrors(Boolean) too, to convert named ranges besides the formulas.

Also note that if you want to convert a whole file, you need to call ConvertFormulasToValues in every sheet.

Syntax

Namespace: FlexCel.XlsAdapter

public override void ConvertFormulasToValues(Boolean onlyExternal, Boolean recalcBeforeConverting)

Parameters

<-> | Parameter | Type | Description
 | onlyExternal | Boolean | When true, it will only convert the formulas that do not refer to the same sheet. For example "=A1+Sheet2!A1" will be converted, but "=A2+A3" will not.
 | recalcBeforeConverting | Boolean | If true (the default), FlexCel will try to recalculate the file before converting the formulas. Use false when for any reason FlexCel can't recalculate the values (for example if you have links to other files that don't exist anymore)

See also

  • XlsFile


XlsFile.ConvertExternalNamesToRefErrors Method | FlexCel Studio for the .NET Framework documentation

XlsFile.ConvertExternalNamesToRefErrors Method

Use it to convert the external names in a sheet to #REF! . It can be useful when you need to remove all external links in a file. NOTE: You will probably want to use ExcelFile.ConvertFormulasToValues(Boolean) too.

Syntax

Namespace: FlexCel.XlsAdapter

public override void ConvertExternalNamesToRefErrors(Boolean recalcBeforeConverting)

Parameters

<-> | Parameter | Type | Description
 | recalcBeforeConverting | Boolean | If true (the default), FlexCel will try to recalculate the file before converting the formulas. Use false when for any reason FlexCel can't recalculate the values (for example if you have links to other files that don't exist anymore)

See also

  • XlsFile


XlsFile.GetCachedFont0 Method | FlexCel Studio for the .NET Framework documentation

XlsFile.GetCachedFont0 Method

This method is used by FlexCel itself, you shouldn't call it directly.

Syntax

Namespace: FlexCel.XlsAdapter

public override TCachedFontWidth GetCachedFont0()

See also

  • XlsFile


XlsFile.SetCachedFont0 Method | FlexCel Studio for the .NET Framework documentation

XlsFile.SetCachedFont0 Method

This method is used by FlexCel itself, you shouldn't call it directly.

Syntax

Namespace: FlexCel.XlsAdapter

public override void SetCachedFont0(TCachedFontWidth cachedFont)

Parameters

<-> | Parameter | Type | Description
 | cachedFont | TCachedFontWidth |

See also

  • XlsFile


XlsFile.AddUserDefinedFunction Method | FlexCel Studio for the .NET Framework documentation

XlsFile.AddUserDefinedFunction Method

Adds a custom formula function to the FlexCel recalculation engine. Note that this formulas are only valid for Excel custom formulas, not for internal ones. For example, you could define "EDATE" since it is a custom formula defined in the Analysis Addin, but you cannot redefine "SUM". Note that if a custom formula with the name already exists, it will be replaced. Names are Case insensitive ("Date" is the same as "DATE").

Also note that some user defined functions come already built in FlexCel, so you might not need to define them. For more information on adding Custom Formulas make sure you read 'Using Excel's user defined functions (UDF)' in the Api Developer Guide and take a look at the at the Excel User Defined Functions C Sharp / netframework example.

Syntax

Namespace: FlexCel.XlsAdapter

public override void AddUserDefinedFunction(TUserDefinedFunctionScope scope, TUserDefinedFunctionLocation location, TUserDefinedFunction userFunction)

Parameters

<-> | Parameter | Type | Description
 | scope | TUserDefined​Function​Scope | Defines if the custom function will be available globally to all ExcelFile instances or only to the ExcelFile instance where it was added. It is recommended to add functions globally, unless you have different xls files with functions that might have the same name but could be implemented different.
 | location | TUserDefined​Function​Location | Defines if the function will be inserted as a reference to a macro in the local sheet or in an external book or addin. This parameter is used only when adding formulas with user defined functions to a sheet. It is not needed or used when recalculating those functions or when reading the text of a formula.
 | userFunction | TUserDefinedFunction | Formula function we want to add.

See also

  • XlsFile


XlsFile.ClearUserDefinedFunctions Method | FlexCel Studio for the .NET Framework documentation

XlsFile.ClearUserDefinedFunctions Method

Removes all the custom formula functions from the FlexCel recalculation engine.

Syntax

Namespace: FlexCel.XlsAdapter

public override void ClearUserDefinedFunctions(TUserDefinedFunctionScope scope)

Parameters

<-> | Parameter | Type | Description
 | scope | TUserDefined​Function​Scope |

See also

  • XlsFile


XlsFile.RemoveUserDefinedFunction Method | FlexCel Studio for the .NET Framework documentation

XlsFile.RemoveUserDefinedFunction Method

Removes a single function from the FlexCel recalculation engine. If the function doesn't exist, this method will return false.

Syntax

Namespace: FlexCel.XlsAdapter

public override Boolean RemoveUserDefinedFunction(TUserDefinedFunctionScope scope, String functionName)

Parameters

<-> | Parameter | Type | Description
 | scope | TUserDefined​Function​Scope |
 | functionName | String | Name of the function. Case insensitive.

Returns

True if the function existed and was removed, false if it didn't exist.

See also

  • XlsFile


XlsFile.EvaluateUserDefinedFunction Method | FlexCel Studio for the .NET Framework documentation

XlsFile.EvaluateUserDefinedFunction Method

Evaluates a custom function you have added earlier with ExcelFile.AddUserDefinedFunction. You will not normally need to call this method, but it could be used for testing. If the function has not been added with ExcelFile.AddUserDefinedFunction, this method will return TFlxFormulaErrorValue.ErrName.

Syntax

Namespace: FlexCel.XlsAdapter

public override Object EvaluateUserDefinedFunction(String functionName, TUdfEventArgs arguments, Object[] parameters)

Parameters

<-> | Parameter | Type | Description
 | functionName | String | Function you want to evaluate.
 | arguments | TUdfEventArgs | Extra arguments you can use to evaluate the formula.
 | parameters | Object[] | Parameters for the formula.

Returns

The result of evaluating the formula. It might be a string, a double, a boolean, a TFlxFormulaError or an Array.

See also

  • XlsFile


XlsFile.IsDefinedFunction Method | FlexCel Studio for the .NET Framework documentation

XlsFile.IsDefinedFunction Method

Returns true if the Custom formula function has been added to the FlexCel recalculating engine. Note that internal functions are not returned by this method, but user defined functions pre-defined in FlexCel will be.

Syntax

Namespace: FlexCel.XlsAdapter

public override Boolean IsDefinedFunction(String functionName, out TUserDefinedFunctionLocation location)

Parameters

<-> | Parameter | Type | Description
 | functionName | String | Name of the function. Case insensitive.
out | location | TUserDefined​Function​Location | Returns if the function is defined as an internal or external function.

Returns

True if the name has been added, false if not.

See also

  • XlsFile


XlsFile.RemoveMacros Method | FlexCel Studio for the .NET Framework documentation

XlsFile.RemoveMacros Method

If the file has macros, this method will remove them.

Syntax

Namespace: FlexCel.XlsAdapter

public override void RemoveMacros()

See also

  • XlsFile


XlsFile.HasMacros Method | FlexCel Studio for the .NET Framework documentation

XlsFile.HasMacros Method

Returns true if the file has any macros.

Syntax

Namespace: FlexCel.XlsAdapter

public override Boolean HasMacros()

See also

  • XlsFile


XlsFile.IsSharedWorkbook Method | FlexCel Studio for the .NET Framework documentation

XlsFile.IsSharedWorkbook Method

Returns true is this is a shared workbook. This method only will return true for xls files, since FlexCel doesn't load tracking changes in xlsx files.

Syntax

Namespace: FlexCel.XlsAdapter

public override Boolean IsSharedWorkbook()

See also

  • XlsFile


XlsFile.UnshareWorkbook Method | FlexCel Studio for the .NET Framework documentation

XlsFile.UnshareWorkbook Method

Removes the "track changes" information of the workbook and unshares the workbook. This is only needed for xls files, as FlexCel doesn't save tracking changes in xlsx files, and the feature is deprecated in Excel.

Syntax

Namespace: FlexCel.XlsAdapter

public override void UnshareWorkbook()

See also

  • XlsFile


XlsFile.HasWebAddinTaskPanes Method | FlexCel Studio for the .NET Framework documentation

XlsFile.HasWebAddinTaskPanes Method

Returns true if the file has any task pane web add-in. Note that this only applies to task pane addins. The content addins are just objects in the sheet.

Syntax

Namespace: FlexCel.XlsAdapter

public override Boolean HasWebAddinTaskPanes()

See also

  • XlsFile


XlsFile.RemoveWebAddinTaskPanes Method | FlexCel Studio for the .NET Framework documentation

XlsFile.RemoveWebAddinTaskPanes Method

Removes all task pane web add-ins from the file. Note that this will only remove the task pane addins. You can remove the content addins by removing the corresponding objects in the sheet with ExcelFile.DeleteObject(Int32)

Syntax

Namespace: FlexCel.XlsAdapter

public override void RemoveWebAddinTaskPanes()

See also

  • XlsFile


XlsFile.GetCustomTableStyle Method | FlexCel Studio for the .NET Framework documentation

XlsFile.GetCustomTableStyle Method

Overloads

  • XlsFile.GetCustomTableStyle(String)
  • XlsFile.GetCustomTableStyle(Int32)

XlsFile.GetCustomTableStyle(String)

Gets the custom table style with a given name. If the name doesn't exist, this method returns null.

Syntax

Namespace: FlexCel.XlsAdapter

public override TCustomTableStyle GetCustomTableStyle(String name)

Parameters

<-> | Parameter | Type | Description
 | name | String | Name of the table style we want to retrieve. Case insensitive: "NAME" is the same as "name".

See also

  • XlsFile

XlsFile.GetCustomTableStyle(Int32)

Gets the custom table style at position index (1 based).

Syntax

Namespace: FlexCel.XlsAdapter

public override TCustomTableStyle GetCustomTableStyle(Int32 index)

Parameters

<-> | Parameter | Type | Description
 | index | Int32 | Position for the custom style in the style table. (1 based). If index is less than 0 or equal or bigger than ExcelFile.CustomTableStyleCount then this method will throw an exception.

See also

  • XlsFile


XlsFile.HasCustomTableStyle Method | FlexCel Studio for the .NET Framework documentation

XlsFile.HasCustomTableStyle Method

Returns true if the workbook has a custom table style with name "name".

Syntax

Namespace: FlexCel.XlsAdapter

public override Boolean HasCustomTableStyle(String name)

Parameters

<-> | Parameter | Type | Description
 | name | String | Name of the custom table style to check. Case insensitive: "NAME" is the same as "name".

See also

  • XlsFile


XlsFile.SetCustomTableStyle Method | FlexCel Studio for the .NET Framework documentation

XlsFile.SetCustomTableStyle Method

Adds a new or replaces an existing table style.

Syntax

Namespace: FlexCel.XlsAdapter

public override void SetCustomTableStyle(TCustomTableStyle aTableStyle)

Parameters

<-> | Parameter | Type | Description
 | aTableStyle | TCustomTableStyle | Custom table style definition.

See also

  • XlsFile


XlsFile.RenameCustomTableStyle Method | FlexCel Studio for the .NET Framework documentation

XlsFile.RenameCustomTableStyle Method

Renames an existing custom table style. Note that this method won't change the table styles from existing tables from oldName to newName. So after renaming a table style, you should loop in all the tables in the workbook which use that table style, and manually rename their custom table styles too.

Syntax

Namespace: FlexCel.XlsAdapter

public override void RenameCustomTableStyle(String oldName, String newName)

Parameters

<-> | Parameter | Type | Description
 | oldName | String | Existing table style. If the old table style name doesn't exist, this method will raise an exception.
 | newName | String | New name for the table style. If the new table style already exists, this method will raise an exception.

See also

  • XlsFile


XlsFile.DeleteCustomTableStyle Method | FlexCel Studio for the .NET Framework documentation

XlsFile.DeleteCustomTableStyle Method

Overloads

  • XlsFile.DeleteCustomTableStyle(Int32)
  • XlsFile.DeleteCustomTableStyle(String)

XlsFile.DeleteCustomTableStyle(Int32)

Deletes an existing table style.

Syntax

Namespace: FlexCel.XlsAdapter

public override void DeleteCustomTableStyle(Int32 index)

Parameters

<-> | Parameter | Type | Description
 | index | Int32 | Position of the table style to delete (1 based).

See also

  • XlsFile

XlsFile.DeleteCustomTableStyle(String)

Deletes an existing table style given its name.

Syntax

Namespace: FlexCel.XlsAdapter

public override void DeleteCustomTableStyle(String name)

Parameters

<-> | Parameter | Type | Description
 | name | String | Name of the table style to delete. If the name doesn't exist, this method will throw an exception. Case insensitive: "NAME" is the same as "name". You can use ExcelFile.HasCustomTableStyle to check if a table style exists before deleting it.

See also

  • XlsFile


XlsFile.DeleteAllCustomTableStylesInWorkbook Method | FlexCel Studio for the .NET Framework documentation

XlsFile.DeleteAllCustomTableStylesInWorkbook Method

Deletes all custom table styles in the workbook.

Syntax

Namespace: FlexCel.XlsAdapter

public override void DeleteAllCustomTableStylesInWorkbook()

See also

  • XlsFile


XlsFile.GetTable Method | FlexCel Studio for the .NET Framework documentation

XlsFile.GetTable Method

Overloads

  • XlsFile.GetTable(Int32)
  • XlsFile.GetTable(String, Boolean)

XlsFile.GetTable(Int32)

Returns the table definition for the table at position tableIndex, for the active sheet. (1 based)

Syntax

Namespace: FlexCel.XlsAdapter

public override TTableDefinition GetTable(Int32 tableIndex)

Parameters

<-> | Parameter | Type | Description
 | tableIndex | Int32 | Position of the table in the active sheet. (1-based)

Returns

The table definition. If tableIndex is out of range, then it will throw an Exception.

See also

  • XlsFile

XlsFile.GetTable(String, Boolean)

Returns the definition for a table in the file. Note that this method will return any table in the file, not only in the active sheet, as table names are unique in the whole workbook. You can find which sheet the table is in with ExcelFile.GetTableSheet

Syntax

Namespace: FlexCel.XlsAdapter

public override TTableDefinition GetTable(String tableName, Boolean ignoreFormulas)

Parameters

<-> | Parameter | Type | Description
 | tableName | String | Name of the table.
 | ignoreFormulas | Boolean | If true, this method won't return the formulas for the totals and the column. This parameter allows to get the table a little faster, when you are not interested in the formulas.

Returns

Null if the table doesn't exist, or the table definition otherwise.

See also

  • XlsFile


XlsFile.GetTableSheet Method | FlexCel Studio for the .NET Framework documentation

XlsFile.GetTableSheet Method

Returns the sheet number of the table, or raises an exception if the table doesn't exist.

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 GetTableSheet(String tableName)

Parameters

<-> | Parameter | Type | Description
 | tableName | String |

See also

  • XlsFile


XlsFile.HasTable Method | FlexCel Studio for the .NET Framework documentation

XlsFile.HasTable Method

Returns true if the table exists in the file.

Syntax

Namespace: FlexCel.XlsAdapter

public override Boolean HasTable(String tableName)

Parameters

<-> | Parameter | Type | Description
 | tableName | String | Name of the table (case insensitive).

See also

  • XlsFile


XlsFile.GetTableName Method | FlexCel Studio for the .NET Framework documentation

XlsFile.GetTableName Method

If there is a table in the cell at (row, col) then this method will return the name of the table. If not it will return an empty string.

Syntax

Namespace: FlexCel.XlsAdapter

public override String GetTableName(Int32 sheet, Int32 row, Int32 col)

Parameters

<-> | Parameter | Type | Description
 | sheet | Int32 | Sheet where to find the table (1 based)
 | row | Int32 | Row, 1 based.
 | col | Int32 | Column, 1 based.

See also

  • XlsFile


XlsFile.GetTableAtCell Method | FlexCel Studio for the .NET Framework documentation

XlsFile.GetTableAtCell Method

If there is a table in the cell at (row, col) then this method will return the table definition. If not it will return null.

Syntax

Namespace: FlexCel.XlsAdapter

public override TTableDefinition GetTableAtCell(Int32 sheet, Int32 row, Int32 col)

Parameters

<-> | Parameter | Type | Description
 | sheet | Int32 | Sheet where to find the table (1 based)
 | row | Int32 | Row, 1 based.
 | col | Int32 | Column, 1 based.

See also

  • XlsFile


XlsFile.AddTable Method | FlexCel Studio for the .NET Framework documentation

XlsFile.AddTable Method

Adds a table to the active sheet.

Syntax

Namespace: FlexCel.XlsAdapter

public override void AddTable(TTableDefinition aTable)

Parameters

<-> | Parameter | Type | Description
 | aTable | TTableDefinition | Table to add.

See also

  • XlsFile


XlsFile.SetTable Method | FlexCel Studio for the .NET Framework documentation

XlsFile.SetTable Method

Changes an existing table. The table to change is given by the table name in aTable. Note that this method won't change the name of the table. To do so, you need to call ExcelFile.RenameTable

Syntax

Namespace: FlexCel.XlsAdapter

public override void SetTable(TTableDefinition aTable)

Parameters

<-> | Parameter | Type | Description
 | aTable | TTableDefinition | Table to modify.

See also

  • XlsFile


XlsFile.RenameTable Method | FlexCel Studio for the .NET Framework documentation

XlsFile.RenameTable Method

Renames an existing table to a new name, renaming also all references to that table. Note that the final name of the table might not be the name you specified in newName, if newName already existed. You need to check the result of this method to know the actual name which the table was renamed to.

Syntax

Namespace: FlexCel.XlsAdapter

public override String RenameTable(String existingName, String newName)

Parameters

<-> | Parameter | Type | Description
 | existingName | String | Existing name of the table.
 | newName | String | New name of the table.

Returns

The actual new name of the table. It might be different from newName if newName already existed in the file.

See also

  • XlsFile


XlsFile.DeleteTable Method | FlexCel Studio for the .NET Framework documentation

XlsFile.DeleteTable Method

Deletes a table from the workbook, based on its name. Note that the table might not be in the active sheet. Note also that this will only delete the table itself, but not the data inside.

Syntax

Namespace: FlexCel.XlsAdapter

public override void DeleteTable(String aName)

Parameters

<-> | Parameter | Type | Description
 | aName | String | Name of the table to delete.

See also

  • XlsFile


XlsFile.DeleteAllTablesInSheet Method | FlexCel Studio for the .NET Framework documentation

XlsFile.DeleteAllTablesInSheet Method

Removes all the tables in the active sheet. The contents are not removed, only the table itself.

Syntax

Namespace: FlexCel.XlsAdapter

public override void DeleteAllTablesInSheet()

See also

  • XlsFile


XlsFile.PivotTableCountInSheet Method | FlexCel Studio for the .NET Framework documentation

XlsFile.PivotTableCountInSheet Method

Returns the number of pivot tables in the active sheet.

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 PivotTableCountInSheet()

See also

  • XlsFile


XlsFile.AddCustomXmlPart Method | FlexCel Studio for the .NET Framework documentation

XlsFile.AddCustomXmlPart Method

Adds a custom XML part to the file, as described in https://msdn.microsoft.com/en-us/library/bb608618.aspx

Remarks

Excel saves the file in the encoding specified by the xml declaration. But this goes against the spec.

From Open Packaging specification:

XML content shall be encoded using either UTF-8 or UTF-16. If any part includes an encoding declaration, as defined in $4.3.3 of the XML 1.0 specification, that declaration shall not name any encoding other than UTF-8 or UTF-16. Package implementers shall enforce this requirement upon creation and retrieval of the XML content. [M1.17]

FlexCel will behave like Excel and use the encoding in the xml declaration if one is present, but you should make that encoding UTF8 or UTF16.

Syntax

Namespace: FlexCel.XlsAdapter

public override void AddCustomXmlPart(TCustomXmlPart part)

Parameters

<-> | Parameter | Type | Description
 | part | TCustomXmlPart | Part to add.

See also

  • XlsFile


XlsFile.GetCustomXmlPart Method | FlexCel Studio for the .NET Framework documentation

XlsFile.GetCustomXmlPart Method

Returns the part at the given position. (1 based)

Syntax

Namespace: FlexCel.XlsAdapter

public override TCustomXmlPart GetCustomXmlPart(Int32 position)

Parameters

<-> | Parameter | Type | Description
 | position | Int32 | 1-based index in the collection of custom parts.

See also

  • XlsFile


XlsFile.RemoveCustomXmlPart Method | FlexCel Studio for the .NET Framework documentation

XlsFile.RemoveCustomXmlPart Method

Deletes the part at the given position. ( 1 based)

Syntax

Namespace: FlexCel.XlsAdapter

public override void RemoveCustomXmlPart(Int32 position)

Parameters

<-> | Parameter | Type | Description
 | position | Int32 | 1-based index in the collection of custom parts.

See also

  • XlsFile


XlsFile.SetXmlMap Method | FlexCel Studio for the .NET Framework documentation

XlsFile.SetXmlMap Method

Sets the XML Maps in the file. This is equivalent to going to the "Developer" tab in Excel and then clicking in Source in the XML section.

Set it to null to remove the XML Maps in the file.

Remarks

This method only works for xlsx/m files, not for xls.

Syntax

Namespace: FlexCel.XlsAdapter

public override void SetXmlMap(TXmlMap map)

Parameters

<-> | Parameter | Type | Description
 | map | TXmlMap | Map that we wish to set. Make it null to remove the maps in the file.

See also

  • XlsFile


XlsFile.GetXmlMap Method | FlexCel Studio for the .NET Framework documentation

XlsFile.GetXmlMap Method

Returns the XML Maps in the file if it has any, or null if there are no XML Maps. Note that the map returned is a copy, so modifying it won't modify the map in the file. To modify the map in the file you need to get it with ExcelFile.GetXmlMap, modify it, then set it with ExcelFile.SetXmlMap

Remarks

This method only works for xlsx/m files, not for xls.

Syntax

Namespace: FlexCel.XlsAdapter

public override TXmlMap GetXmlMap()

See also

  • XlsFile


XlsFile.GetFormulaTokens Method | FlexCel Studio for the .NET Framework documentation

XlsFile.GetFormulaTokens Method

Returns the formula of a cell as an RPN list of tokens that you can use to analyze it. If the cell doesn't have a formula, then this method will return null.

Note that the result is an RPN expression, so for example the formula "= 1 * 2 + 3" would be returned as "1, 2, *, 3, +". While the formula "= 1 * (2 + 3)" would be returned as "1, 2, 3, +, *"

See Using Tokens for more information.

Syntax

Namespace: FlexCel.XlsAdapter

public override TTokenList GetFormulaTokens(Int32 sheet, Int32 row, Int32 col)

Parameters

<-> | Parameter | Type | Description
 | sheet | Int32 | Sheet where the formula is.
 | row | Int32 | Row of the cell with the formula. (1 based)
 | col | Int32 | Column of the cell with the formula. (1 based)

See also

  • XlsFile


XlsFile.GetTokens Method | FlexCel Studio for the .NET Framework documentation

XlsFile.GetTokens Method

Returns the tokens for a formula in text form. See ExcelFile.GetFormulaTokens(Int32, Int32) for more information.

Syntax

Namespace: FlexCel.XlsAdapter

public override TTokenList GetTokens(Int32 sheet, String formula)

Parameters

<-> | Parameter | Type | Description
 | sheet | Int32 | Sheet where the formula is. This is used to know if the A1 in the formula "=A1" refers to Sheet1!A1 or Sheet2!A1. This value is 1 based, and you can pass ExcelFile.ActiveSheet if the formula is in the active sheet.
 | formula | String | Formula we want to convert into tokens. Must start with an "=" sign.

See also

  • XlsFile


XlsFile.SetFormulaTokens Method | FlexCel Studio for the .NET Framework documentation

XlsFile.SetFormulaTokens Method

Sets a cell with the formula specified by its tokens. Normally you will get the tokens by modifying the result of ExcelFile.GetFormulaTokens(Int32, Int32)

Syntax

Namespace: FlexCel.XlsAdapter

public override void SetFormulaTokens(Int32 sheet, Int32 row, Int32 col, TTokenList tokens)

Parameters

<-> | Parameter | Type | Description
 | sheet | Int32 | Sheet of the cell with the formula. (1 based)
 | row | Int32 | Row of the cell with the formula. (1 based)
 | col | Int32 | Column of the cell with the formula. (1 based)
 | tokens | TTokenList | A collection of tokens which define the formula.

See also

  • XlsFile


XlsFile.SetTokens Method | FlexCel Studio for the .NET Framework documentation

XlsFile.SetTokens Method

This method converts a list of tokens in the corresponding string. Normally you get the tokens from ExcelFile.GetTokens or ExcelFile.GetFormulaTokens(Int32, Int32)

Syntax

Namespace: FlexCel.XlsAdapter

public override String SetTokens(Int32 sheet, Int32 row, Int32 col, TTokenList tokens)

Parameters

<-> | Parameter | Type | Description
 | sheet | Int32 | Sheet where the formula is. This is used to know if the A1 in the formula "=A1" refers to Sheet1!A1 or Sheet2!A1. This value is 1 based, and you can pass ExcelFile.ActiveSheet if the formula is in the active sheet.
 | row | Int32 | Row where the formula is going to be. (1 based)
 | col | Int32 | Column where the formula is going to be. (1 based)
 | tokens | TTokenList | A collection of tokens which define the formula.

Returns

A string representing the formula. Includes the "=" sign at the start.

See also

  • XlsFile


XlsFile.IsXltTemplate Property | FlexCel Studio for the .NET Framework documentation

XlsFile.IsXltTemplate Property

Determines if the file is a template (xlt format instead of xls, xltx instead of xlsx, or xltm instead of xlsm). Both file formats are nearly identical, but there is an extra record needed so the file is a proper xlt template. Note that when saving to a file, FlexCel can detect if this is a template from the extension, and so if you save to *.xlt, *.xltx or *.xltm the file will be saved as template, even if this property is false. When saving to a stream, you need to set this property correctly because FlexCel can't guess it from the filename.

Syntax

Namespace: FlexCel.XlsAdapter

public override Boolean IsXltTemplate { get; set; }

See also

  • XlsFile


XlsFile.ActiveWindow Property | FlexCel Studio for the .NET Framework documentation

XlsFile.ActiveWindow Property

Gets or sets the active windows to which some sheet and workbook options like zoom will apply. (1 based) Note that spreadsheets normally have a single Window, so this value will most likely be 1 and should stay that way. If you are working with multiple spreadsheet windows, you can change this property to change the sheet options of a particular window. The properties that apply to a specific window and are affected by this property mention it on their docs.

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 ActiveWindow { get; set; }

See also

  • XlsFile


XlsFile.WindowCount Property | FlexCel Studio for the .NET Framework documentation

XlsFile.WindowCount Property

Returns the number of windows in the file. Note that this isn't the sheet count, but the number of views of the workbook. Most Excel documents have only one window.

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 WindowCount { get; }

See also

  • XlsFile


XlsFile.ActiveSheetForActiveWindow Property | FlexCel Studio for the .NET Framework documentation

XlsFile.ActiveSheetForActiveWindow Property

Gets or sets the active sheet for the ExcelFile.ActiveWindow. Note that this won't change the active sheet for FlexCel when you enter a value, you still need to call ExcelFile.ActiveSheet for that. This property will only change the sheet that is active in that window when you open the file in Excel. Setting this property will also unselect the other sheets. If you want to select multiple sheets, make sure to select them *after* setting the ActiveSheetForActiveWindow.

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 ActiveSheetForActiveWindow { get; set; }

See also

  • XlsFile


XlsFile.ExcelFileFormat Property | FlexCel Studio for the .NET Framework documentation

XlsFile.ExcelFileFormat Property

Empty files created by different versions of Excel can have different characteristics. For example, the default font in an Excel 2003 file is Arial, while the default in 2007 is Calibri, and in 2023 it is Aptos. This property returns the version of file that is loaded into FlexCel. When calling ExcelFile.NewFile(Int32, TExcelFileFormat) or when opening a new file, FlexCel will update the value of this property.

Syntax

Namespace: FlexCel.XlsAdapter

public override TExcelFileFormat ExcelFileFormat { get; }

See also

  • XlsFile


XlsFile.XlsxExtraCompatibility Property | FlexCel Studio for the .NET Framework documentation

XlsFile.XlsxExtraCompatibility Property

By default, FlexCel creates xlsx files that conform to the published xlsx spec, but are not necessarily the same as a file Excel would create. FlexCel might use different prefixes, etc, as the ones Excel choose to use. While this is ok, some third party tools might have problems opening the xlsx files if they are not exactly as Excel would create them. If you are having issues with third party tools and the xlsx files created by FlexCel, you can try setting this property to true. Note: setting this property to true might result in files that contain invalid Ids, because the Ids are used by FlexCel and Excel. This is a very unlikely possibility, but the risk is there. If possible, it is best to keep this property false.

Syntax

Namespace: FlexCel.XlsAdapter

public override Boolean XlsxExtraCompatibility { get; set; }

See also

  • XlsFile


XlsFile.XlsxCompatibilityConvertIndexedColorsToRGB Property | FlexCel Studio for the .NET Framework documentation

XlsFile.XlsxCompatibilityConvertIndexedColorsToRGB Property

By default, if an xls or xlsx file has indexed colors or if you set an indexed color with the FlexCelAPI, FlexCel will save those colors as indexed in the final file. This is correct and the default, but LibreOffice/OpenOffice at the time of this writing (version 6.2) won't understand indexed colors in xlsx files. So if you have xlsx files with indexed colors that you want to display correctly in Libre/OpenOffice, you must turn this property on.

Syntax

Namespace: FlexCel.XlsAdapter

public override Boolean XlsxCompatibilityConvertIndexedColorsToRGB { get; set; }

See also

  • XlsFile


XlsFile.StrictOpenXml Property | FlexCel Studio for the .NET Framework documentation

XlsFile.StrictOpenXml Property

Read this file to know if the xlsx file loaded by FlexCel is a normal xlsx file or a "Strict Open XML file". Set this property to make FlexCel save as strict or normal open xlsx file.

This property has no effect in xls files, only in xlsx. If you are not sure about what a strict open xml file is, just keep this property false and FlexCel will output normal xlsx files.

IMPORTANT:FlexCel works by preserving a lot of stuff it doesn't know about, and that stuff might be valid in normal files and invalid in strict files or vice-versa. So if you open an strict file and save it as normal, or open a normal file and save it as strict, it might happen that FlexCel preserves some records or namespaces that are not allowed in the new format. Given this, you shouldn't use this property to change the type of existing files, except for simple files or files that you created yourself with ExcelFile.NewFile. You should normally read strict files and save them as strict, or read normal files and save them as normal.

Syntax

Namespace: FlexCel.XlsAdapter

public override Boolean StrictOpenXml { get; set; }

See also

  • XlsFile


XlsFile.ActiveFileName Property | FlexCel Studio for the .NET Framework documentation

XlsFile.ActiveFileName Property

The file we are working on. When we save the file with another name, it changes. When we open a stream, it is set to "". This value is also used to get the text of Headers and Footers (when using the filename macro). When using the filename macro on headers/footers, make sure you set this value to what you want.

Syntax

Namespace: FlexCel.XlsAdapter

public override String ActiveFileName { get; set; }

See also

  • XlsFile


XlsFile.ActiveSheet Property | FlexCel Studio for the .NET Framework documentation

XlsFile.ActiveSheet Property

The Sheet where we are working on, 1-based(First sheet is 1, not 0). Always set this property before working on a file. You can read or write this value.

Remarks

Setting the active sheet will also set the selected sheet in the file, except when the object is a light clone (ExcelFile.LightClone) For lightcloned object, the selected file won't change. Also if the file has multiple windows, this property will only change the selected sheet for the first window. Use ExcelFile.ActiveSheetForActiveWindow if you want to change the active sheet for a different window.

Finally, remember that a file can have more than one sheet selected, even if only one can be active. To Select mutiple sheets, call ExcelFile.SetSheetSelected.

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 ActiveSheet { get; set; }

See also

  • XlsFile


XlsFile.ActiveSheetByName Property | FlexCel Studio for the .NET Framework documentation

XlsFile.ActiveSheetByName Property

The sheet where we are working on, referred by name instead of by index. To change the active sheet name, use ExcelFile.SheetName

Remarks

Setting the active sheet will also set the selected sheet in the file, except when the object is a light clone (ExcelFile.LightClone) For lightcloned object, the selected file won't change.

Syntax

Namespace: FlexCel.XlsAdapter

public override String ActiveSheetByName { get; set; }

See also

  • XlsFile


XlsFile.SheetCount Property | FlexCel Studio for the .NET Framework documentation

XlsFile.SheetCount Property

The number of sheets on the file.

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 SheetCount { get; }

See also

  • XlsFile


XlsFile.SheetCountVisible Property | FlexCel Studio for the .NET Framework documentation

XlsFile.SheetCountVisible Property

Number of visible sheets in the file.

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 SheetCountVisible { get; }

See also

  • XlsFile


XlsFile.SheetName Property | FlexCel Studio for the .NET Framework documentation

XlsFile.SheetName Property

Reads and changes the name of the active sheet. To switch to another sheet by its name, use ExcelFile.ActiveSheetByName

Remarks

This name must be unique in the file. It can be up to 31 characters long, and it can't contain the characters "/", "\", "?", "[", "]", "*" or ":"

Syntax

Namespace: FlexCel.XlsAdapter

public override String SheetName { get; set; }

See also

  • XlsFile


XlsFile.SheetCodeName Property | FlexCel Studio for the .NET Framework documentation

XlsFile.SheetCodeName Property

Returns or sets the codename of a sheet, that is an unique identifier assigned to the sheet when it is created. Codenames are useful because they never change once the file is created, and they are what macros reference. Very important! We don't support changing codenames if the file has macros, because we can't modify the required macros to use the modified codename. Also, Excel 2003 or older will ignore the codename if the file doesn't have macros. Excel 2007 or newer will preserve the codenames even if the file doesn't have macros.

Syntax

Namespace: FlexCel.XlsAdapter

public override String SheetCodeName { get; set; }

See also

  • XlsFile


XlsFile.SheetID Property | FlexCel Studio for the .NET Framework documentation

XlsFile.SheetID Property

Returns an unique identifier for the active sheet. This is a value that is only used by FlexCel, and you can use it together with ExcelFile.GetSheetIndexFromID to retrieve a sheet after deleting or adding sheets. While normally you can use ExcelFile.ActiveSheet to store and retrieve a sheet, if you plan to delete or add sheets before restoring the active sheet, the stored ActiveSheet could become invalid. Note that this is a value internal for FlexCel, and not stored in the xls/x file. SheetIDs will change every time you open the file.

Syntax

Namespace: FlexCel.XlsAdapter

public override Guid SheetID { get; }

See also

  • XlsFile


XlsFile.SheetVisible Property | FlexCel Studio for the .NET Framework documentation

XlsFile.SheetVisible Property

Sets the visibility of the active sheet.

Syntax

Namespace: FlexCel.XlsAdapter

public override TXlsSheetVisible SheetVisible { get; set; }

See also

  • XlsFile


XlsFile.SheetZoom Property | FlexCel Studio for the .NET Framework documentation

XlsFile.SheetZoom Property

Reads/Writes the zoom of the current sheet. Note that this property refers to the zoom in the current page view mode. If you are for example in Page Break Preview mode, this would be the zoom for Page Break Preview. You can change of page view mode and the zoom for all of the modes with ExcelFile.SheetView This property can work in different windows depending on the value of ExcelFile.ActiveWindow

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 SheetZoom { get; set; }

See also

  • XlsFile


XlsFile.FirstSheetVisible Property | FlexCel Studio for the .NET Framework documentation

XlsFile.FirstSheetVisible Property

This is the first sheet that will be visible in the bar of sheet tabs at the bottom. Normally you will want this to be 1. Note that every time you change ExcelFile.ActiveSheet this value gets reset, because it makes no sense to preserve it.

If you want to change it, change it before saving. The same way, to read it, read it just after opening the file.

Please also note that if the first sheet you select is hidden, FlexCel will ignore this value and select a visible sheet. (otherwise Excel would crash) This property can work in different windows depending on the value of ExcelFile.ActiveWindow

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 FirstSheetVisible { get; set; }

See also

  • XlsFile


XlsFile.SheetTabColor Property | FlexCel Studio for the .NET Framework documentation

XlsFile.SheetTabColor Property

Reads/Writes the color of the current sheet tab. TExcelColor.Automatic to specify no color.

Syntax

Namespace: FlexCel.XlsAdapter

public override TExcelColor SheetTabColor { get; set; }

See also

  • XlsFile


XlsFile.SheetView Property | FlexCel Studio for the .NET Framework documentation

XlsFile.SheetView Property

Returns and sets the page view mode with their corresponding zooms. Note that changing the zoom here changes ExcelFile.SheetZoom This property can work in different windows depending on the value of ExcelFile.ActiveWindow

Syntax

Namespace: FlexCel.XlsAdapter

public override TSheetView SheetView { get; set; }

See also

  • XlsFile


XlsFile.SheetIsRightToLeft Property | FlexCel Studio for the .NET Framework documentation

XlsFile.SheetIsRightToLeft Property

If true then the sheet goes from right to left, with A1 starting at the top right of the page. You can also set this option with ExcelFile.SheetOptions

Syntax

Namespace: FlexCel.XlsAdapter

public override Boolean SheetIsRightToLeft { get; set; }

See also

  • XlsFile


XlsFile.ShowGridLines Property | FlexCel Studio for the .NET Framework documentation

XlsFile.ShowGridLines Property

True if the gray grid lines are shown on the Active sheet. You can also set this option with ExcelFile.SheetOptions This property can work in different windows depending on the value of ExcelFile.ActiveWindow

Syntax

Namespace: FlexCel.XlsAdapter

public override Boolean ShowGridLines { get; set; }

See also

  • XlsFile


XlsFile.ShowGridHeadings Property | FlexCel Studio for the .NET Framework documentation

XlsFile.ShowGridHeadings Property

True is the column headings ("A", "B", etc) and row headings ("1", "2", etc) are shown. You can also set this option with ExcelFile.SheetOptions by changing TSheetOptions.ShowRowAndColumnHeaders This property can work in different windows depending on the value of ExcelFile.ActiveWindow

Syntax

Namespace: FlexCel.XlsAdapter

public override Boolean ShowGridHeadings { get; set; }

See also

  • XlsFile


XlsFile.ShowFormulaText Property | FlexCel Studio for the .NET Framework documentation

XlsFile.ShowFormulaText Property

When true, the formula text will be displayed instead of the formula value. You can also set this option with ExcelFile.SheetOptions This property can work in different windows depending on the value of ExcelFile.ActiveWindow

Syntax

Namespace: FlexCel.XlsAdapter

public override Boolean ShowFormulaText { get; set; }

See also

  • XlsFile


XlsFile.GridLinesColor Property | FlexCel Studio for the .NET Framework documentation

XlsFile.GridLinesColor Property

Color of the grid separator lines. This property can work in different windows depending on the value of ExcelFile.ActiveWindow

Syntax

Namespace: FlexCel.XlsAdapter

public override TExcelColor GridLinesColor { get; set; }

See also

  • XlsFile


XlsFile.HideZeroValues Property | FlexCel Studio for the .NET Framework documentation

XlsFile.HideZeroValues Property

When true number 0 will be shown as empty. You can also set this option with ExcelFile.SheetOptions This property can work in different windows depending on the value of ExcelFile.ActiveWindow

Syntax

Namespace: FlexCel.XlsAdapter

public override Boolean HideZeroValues { get; set; }

See also

  • XlsFile


XlsFile.SheetType Property | FlexCel Studio for the .NET Framework documentation

XlsFile.SheetType Property

Use this property to know it the ExcelFile.ActiveSheet is a worksheet, a chart sheet or other.

Syntax

Namespace: FlexCel.XlsAdapter

public override TSheetType SheetType { get; }

See also

  • XlsFile


XlsFile.SheetOptions Property | FlexCel Studio for the .NET Framework documentation

XlsFile.SheetOptions Property

This property groups a lot of properties of the sheet, like for example if it is showing formula texts or the results. Most of this properties can be changed directly from XlsFile, but this method allows you to change them all together, or to easily copy the options from one file to another. Look also at ExcelFile.SheetWindowOptions for options that affect all sheets. This property can work in different windows depending on the value of ExcelFile.ActiveWindow

Syntax

Namespace: FlexCel.XlsAdapter

public override TSheetOptions SheetOptions { get; set; }

See also

  • XlsFile


XlsFile.SheetWindowOptions Property | FlexCel Studio for the .NET Framework documentation

XlsFile.SheetWindowOptions Property

This property groups a lot of properties of all the sheets in the workbook, like for example if the sheet tab bar at the bottom is visible. Look also at ExcelFile.SheetOptions for options that affect only the active sheet. This property can work in different windows depending on the value of ExcelFile.ActiveWindow

Syntax

Namespace: FlexCel.XlsAdapter

public override TSheetWindowOptions SheetWindowOptions { get; set; }

See also

  • XlsFile


XlsFile.HPageBreakCount Property | FlexCel Studio for the .NET Framework documentation

XlsFile.HPageBreakCount Property

The number of horizontal page breaks in the active sheet.

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 HPageBreakCount { get; }

See also

  • XlsFile


XlsFile.VPageBreakCount Property | FlexCel Studio for the .NET Framework documentation

XlsFile.VPageBreakCount Property

The number of vertical page breaks in the active sheet.

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 VPageBreakCount { get; }

See also

  • XlsFile


XlsFile.AllowEnteringEmptyStrings Property | FlexCel Studio for the .NET Framework documentation

XlsFile.AllowEnteringEmptyStrings Property

By default, FlexCel won't allow you to enter empty or null strings into a cell; it will create a blank record instead. If for any reason you need to enter actual empty strings (which might be confusing to the Excel user) set this property to true.

Syntax

Namespace: FlexCel.XlsAdapter

public override Boolean AllowEnteringEmptyStrings { get; set; }

See also

  • XlsFile


XlsFile.AllowEnteringUnknownFunctionsAndNames Property | FlexCel Studio for the .NET Framework documentation

XlsFile.AllowEnteringUnknownFunctionsAndNames Property

Whenever you try to use an unknown function in a formula, like "=MYFUNCTION()", FlexCel will raise an Exception. Same happens with unknown names. This is normally the expected behavior, so you don't enter a misspelled name by mistake, and you can add used defined function to FlexCel so it understands it.

But in some cases, you might want to allow any function to be entered, no matter if is known or not: Excel behaves this way. For those cases, set this property to true. The unknown functions will return #NAME? as formula result.

Syntax

Namespace: FlexCel.XlsAdapter

public override Boolean AllowEnteringUnknownFunctionsAndNames { get; set; }

See also

  • XlsFile


XlsFile.FormatCount Property | FlexCel Studio for the .NET Framework documentation

XlsFile.FormatCount Property

Number of custom formats defined in all the file. When calling GetFormat(XF), 0<=XF<FormatCount.

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 FormatCount { get; }

See also

  • XlsFile


XlsFile.GetDefaultFont Property | FlexCel Studio for the .NET Framework documentation

XlsFile.GetDefaultFont Property

Returns Excel standard font for an empty cell.

Syntax

Namespace: FlexCel.XlsAdapter

public override TFlxFont GetDefaultFont { get; }

See also

  • XlsFile


XlsFile.GetDefaultFontNormalStyle Property | FlexCel Studio for the .NET Framework documentation

XlsFile.GetDefaultFontNormalStyle Property

Returns Excel font for the "normal" style. This style is used to draw the row and column headings.

Syntax

Namespace: FlexCel.XlsAdapter

public override TFlxFont GetDefaultFontNormalStyle { get; }

See also

  • XlsFile


XlsFile.FontCount Property | FlexCel Studio for the .NET Framework documentation

XlsFile.FontCount Property

Number of fonts defined in all the sheet. When calling GetFont(fontIndex), 0<=fontIndex<FormatCount.

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 FontCount { get; }

See also

  • XlsFile


XlsFile.ConditionalFormatCount Property | FlexCel Studio for the .NET Framework documentation

XlsFile.ConditionalFormatCount Property

Returns the number of conditional format blocks on the list. You can use this value to loop on them and retrieve the individual ones with ExcelFile.GetConditionalFormat

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 ConditionalFormatCount { get; }

See also

  • XlsFile


XlsFile.StyleCount Property | FlexCel Studio for the .NET Framework documentation

XlsFile.StyleCount Property

Returns the number of named styles in the file.

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 StyleCount { get; }

See also

  • XlsFile


XlsFile.CellMergedListCount Property | FlexCel Studio for the .NET Framework documentation

XlsFile.CellMergedListCount Property

For using with ExcelFile.CellMergedList on a loop: for (int i=1;i <= CellMergedListCount;i++) DoSomething(CellMergedList(i))...

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 CellMergedListCount { get; }

See also

  • XlsFile


XlsFile.RowCount Property | FlexCel Studio for the .NET Framework documentation

XlsFile.RowCount Property

Number of rows actually used on the sheet.

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 RowCount { get; }

See also

  • XlsFile


XlsFile.ColCount Property | FlexCel Studio for the .NET Framework documentation

XlsFile.ColCount Property

Number of columns actually used on the active sheet, including formatted columns. You will normally want to use ExcelFile.ColCountOnlyData instead.

Note that this method is slow as it needs to loop over all the rows to find out the biggest used column. Never use it in a loop like "for (int col = 1; col <= xls.ColCount; col++)". Instead try to use ExcelFile.ColCountInRow(Int32). If you *need* to use ColCount, cache its value first:

    int RowCount = xls.RowCount;
    int ColCount = xls.ColCount;
    for (int row = 1; row <= RowCount; row++)
    {
        for (int col = 1; col <= ColCount; col++) //It would be faster to use ColCountInRow. See https://doc.tmssoftware.com/flexcel/net/guides/performance-guide.html#avoid-calling-colcount
        {
            DoSomething(row, col);
        }
    }

Remember that loops in C# will evaluate the second parameter every time the loop is executed.

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 ColCount { get; }

See also

  • XlsFile


XlsFile.ColFormatCount Property | FlexCel Studio for the .NET Framework documentation

XlsFile.ColFormatCount Property

Returns the number of formatted columns in the file. Note that in xlsx files this number can be very big.

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 ColFormatCount { get; }

See also

  • XlsFile


XlsFile.ColCountOnlyData Property | FlexCel Studio for the .NET Framework documentation

XlsFile.ColCountOnlyData Property

While ExcelFile.ColCount will return the maximum column including both data and formatted columns, this method doesn't include formatted columns, only cells with data, and it is normally what you need to use.

Important: This method includes blank formatted cells. See The Maximum Used Column On A Sheet

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 ColCountOnlyData { get; }

See also

  • XlsFile


XlsFile.DefaultRowHeight Property | FlexCel Studio for the .NET Framework documentation

XlsFile.DefaultRowHeight Property

The default height for empty rows, in Excel internal units. (1/20th of a point). IMPORTANT: For this property to have any effect, you also need to set ExcelFile.DefaultRowHeightAutomatic = false. To get the real default row height Excel will use when ExcelFile.DefaultRowHeightAutomatic = true or ExcelFile.DefaultRowHidden = true use ExcelFile.DefaultRowHeightVisual See Excel Internal Units for more information in Excel internal units.

Remarks

Use FlxConsts.RowMult to convert the internal units to pixels.

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 DefaultRowHeight { get; set; }

Examples

    double RowHeightInPixels = xls.GetRowHeight(Row) / FlxConsts.RowMult;

See also

  • XlsFile


XlsFile.DefaultRowHeightAutomatic Property | FlexCel Studio for the .NET Framework documentation

XlsFile.DefaultRowHeightAutomatic Property

When this property is true, the row height for empty rows is calculated with the height of the "Normal" font and will change if you change the Normal style. When false, the value in ExcelFile.DefaultRowHeight will be used.

Syntax

Namespace: FlexCel.XlsAdapter

public override Boolean DefaultRowHeightAutomatic { get; set; }

See also

  • XlsFile


XlsFile.DefaultRowHidden Property | FlexCel Studio for the .NET Framework documentation

XlsFile.DefaultRowHidden Property

When this property is true, rows with no data are hidden by default. Note that this property only affects the visibility of empty rows. If for example row 6 is empty and you have this property true, then row 6 will be hidden. But if you write any value in a cell in row 6, then the row won't be empty anymore, and it won't be hidden anymore either.

Syntax

Namespace: FlexCel.XlsAdapter

public override Boolean DefaultRowHidden { get; set; }

See also

  • XlsFile


XlsFile.DefaultColWidth Property | FlexCel Studio for the .NET Framework documentation

XlsFile.DefaultColWidth Property

The default width for empty columns, in Excel internal units. (Character width of font 0 / 256) See Excel Internal Units for more information in Excel internal units.

Remarks

Use ExcelMetrics.ColMult to convert the internal units to pixels.

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 DefaultColWidth { get; set; }

Examples

    double ColWidthInPixels = xls.GetColWidth(Col) / ExcelMetrics.ColMult(xls);

See also

  • XlsFile


XlsFile.GetUsedPaletteColors Property | FlexCel Studio for the .NET Framework documentation

XlsFile.GetUsedPaletteColors Property

Returns a list of the used colors on the palette. You can use it as an entry to ExcelFile.NearestColorIndex(TUIColor) to modify the palette.

Syntax

Namespace: FlexCel.XlsAdapter

public override Boolean[] GetUsedPaletteColors { get; }

See also

  • XlsFile


XlsFile.NamedRangeCount Property | FlexCel Studio for the .NET Framework documentation

XlsFile.NamedRangeCount Property

The count of all named ranges on the file.

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 NamedRangeCount { get; }

See also

  • XlsFile


XlsFile.PageHeader Property | FlexCel Studio for the .NET Framework documentation

XlsFile.PageHeader Property

Page header on the active sheet. Note that this property sets the same header for the all the pages. In Excel 2007 or newer you can set a different header for the first page, or odd/even pages. If you want to control these options, see ExcelFile.GetPageHeaderAndFooter and ExcelFile.SetPageHeaderAndFooter.

A page header is a string that contains the text for the 3 parts of the header.

The Left section begins with &L, the Center section with &C and the Right with &R

For example, the text"&LThis goes at the left!&CThis is centered!&RThis is right aligned" will write text to all the sections.

This is the full list of macros you can include:

  • && The "&" character itself
  • &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 (XP or Newer)
  • &G Picture (XP or Newer)
  • &U Underlining on/off
  • &E Double underlining on/off
  • &S Strikeout on/off
  • &X Superscript on/off
  • &Y Subscript on/off
  • &"<fontname>" Set new font <fontname>
  • &"<fontname>,<fontstyle>" Set new font with specified style <fontstyle>. The style <fontstyle> is in most cases one of "Regular", "Bold", "Italic", or "Bold Italic". But this setting is dependent on the used font, it may differ (localized style names, or "Standard", "Oblique", ...).
  • &<fontheight> Set font height in points (<fontheight> is a decimal value). If this command is followed by a plain number to be printed in the header, it will be separated from the font height with a space character.
  • &K<fontcolor> Set the font color. Font color can be either specified as a RRGGBB hexadecimal number, like &KFF0000 for red, or as a theme color with "TH-TINT" like &K08-024. For a theme, the first 2 digits before the "-" sign are the number that corresponds with the TPrimaryThemeColor, and the other numbers are the tint of the theme.

Normally, the easiest way to find out which header string you need is to create an xls file on Excel, add a header, open the file with FlexCel and take a look at the generated header (You can use the ApiMate tool for that).

Syntax

Namespace: FlexCel.XlsAdapter

public override String PageHeader { get; set; }

See also

  • XlsFile


XlsFile.PageFooter Property | FlexCel Studio for the .NET Framework documentation

XlsFile.PageFooter Property

Page footer on the active sheet. For a description on the format of the string, see ExcelFile.PageHeader

Syntax

Namespace: FlexCel.XlsAdapter

public override String PageFooter { get; set; }

See also

  • XlsFile


XlsFile.PrintGridLines Property | FlexCel Studio for the .NET Framework documentation

XlsFile.PrintGridLines Property

True if the gray grid lines are printed when printing the spreadsheet.

Syntax

Namespace: FlexCel.XlsAdapter

public override Boolean PrintGridLines { get; set; }

See also

  • XlsFile


XlsFile.PrintHeadings Property | FlexCel Studio for the .NET Framework documentation

XlsFile.PrintHeadings Property

When true the row and column labels (A,B...etc for columns, 1,2... for rows) will be printed.

Syntax

Namespace: FlexCel.XlsAdapter

public override Boolean PrintHeadings { get; set; }

See also

  • XlsFile


XlsFile.PrintHCentered Property | FlexCel Studio for the .NET Framework documentation

XlsFile.PrintHCentered Property

When true the sheet will print horizontally centered on the page.

Syntax

Namespace: FlexCel.XlsAdapter

public override Boolean PrintHCentered { get; set; }

See also

  • XlsFile


XlsFile.PrintVCentered Property | FlexCel Studio for the .NET Framework documentation

XlsFile.PrintVCentered Property

When true the sheet will print vertically centered on the page.

Syntax

Namespace: FlexCel.XlsAdapter

public override Boolean PrintVCentered { get; set; }

See also

  • XlsFile


XlsFile.PrintToFit Property | FlexCel Studio for the .NET Framework documentation

XlsFile.PrintToFit Property

If true, sheet will be configured to fit on ExcelFile.PrintNumberOfHorizontalPages x ExcelFile.PrintNumberOfVerticalPages.

Syntax

Namespace: FlexCel.XlsAdapter

public override Boolean PrintToFit { get; set; }

See also

  • XlsFile


XlsFile.PrintCopies Property | FlexCel Studio for the .NET Framework documentation

XlsFile.PrintCopies Property

Number of copies to print.

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 PrintCopies { get; set; }

See also

  • XlsFile


XlsFile.PrintXResolution Property | FlexCel Studio for the .NET Framework documentation

XlsFile.PrintXResolution Property

Horizontal printer resolution on DPI.

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 PrintXResolution { get; set; }

See also

  • XlsFile


XlsFile.PrintYResolution Property | FlexCel Studio for the .NET Framework documentation

XlsFile.PrintYResolution Property

Vertical printer resolution on DPI.

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 PrintYResolution { get; set; }

See also

  • XlsFile


XlsFile.PrintOptions Property | FlexCel Studio for the .NET Framework documentation

XlsFile.PrintOptions Property

All print options in a single place. You will normally want to set individual properties like ExcelFile.PrintLandscape

Syntax

Namespace: FlexCel.XlsAdapter

public override TPrintOptions PrintOptions { get; set; }

See also

  • XlsFile


XlsFile.PrintOptionsInitializedFromPrinter Property | FlexCel Studio for the .NET Framework documentation

XlsFile.PrintOptionsInitializedFromPrinter Property

If this property is false, then Excel has not read the printer options from the printer, and ExcelFile.PrintLandscape, ExcelFile.PrintPaperSize, ExcelFile.PrintScale, ExcelFile.PrintXResolution, ExcelFile.PrintYResolution and ExcelFile.PrintCopies will be ignored. This property will change automatically to true if you manually change any of the above properties.

Remarks

You shouldn't have to set this property, as it is set automatically to true when you set the others like ExcelFile.PrintLandscape. But if you set it to true, it will not only set the print options to initialized, but also initialize all uninitialized properties like ExcelFile.PrintLandscape to default values.

Syntax

Namespace: FlexCel.XlsAdapter

public override Boolean PrintOptionsInitializedFromPrinter { get; set; }

See also

  • XlsFile


XlsFile.PrintLandscape Property | FlexCel Studio for the .NET Framework documentation

XlsFile.PrintLandscape Property

If true, page will be printed landscape, else portrait.

This property modifies ExcelFile.PrintOptions

Syntax

Namespace: FlexCel.XlsAdapter

public override Boolean PrintLandscape { get; set; }

See also

  • XlsFile


XlsFile.PrintBlackAndWhite Property | FlexCel Studio for the .NET Framework documentation

XlsFile.PrintBlackAndWhite Property

If true, page will be printed in "Excel Black and White". Important: This property doesn't mean that the file will be printed in black and white. Instead it means the option in the Page Setup dialog: https://support.microsoft.com/en-us/office/page-setup-71c20d94-b13e-48fd-9800-cedd1fec6da3 Basically, when you select this option no background will be printed, and all foreground colors will be black. So if you have a cell with a black background and a white font, it will print as white background with a black font.

This property modifies ExcelFile.PrintOptions

Syntax

Namespace: FlexCel.XlsAdapter

public override Boolean PrintBlackAndWhite { get; set; }

See also

  • XlsFile


XlsFile.PrintOverThenDown Property | FlexCel Studio for the .NET Framework documentation

XlsFile.PrintOverThenDown Property

If true, the pages will be printed to the right, then down. Otherwise pages will be printed down, then to the right.

This property modifies ExcelFile.PrintOptions

Syntax

Namespace: FlexCel.XlsAdapter

public override Boolean PrintOverThenDown { get; set; }

See also

  • XlsFile


XlsFile.PrintDraftQuality Property | FlexCel Studio for the .NET Framework documentation

XlsFile.PrintDraftQuality Property

If true, the pages will be printed in draft quality.

This property modifies ExcelFile.PrintOptions

Syntax

Namespace: FlexCel.XlsAdapter

public override Boolean PrintDraftQuality { get; set; }

See also

  • XlsFile


XlsFile.PrintScale Property | FlexCel Studio for the .NET Framework documentation

XlsFile.PrintScale Property

Percent to grow/shrink the sheet when printing. 100 means a page scale of 100%.

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 PrintScale { get; set; }

See also

  • XlsFile


XlsFile.PrintFirstPageNumber Property | FlexCel Studio for the .NET Framework documentation

XlsFile.PrintFirstPageNumber Property

Page number that will be assigned to the first sheet when printing. (So it will show in page headers/footers). You might set this value to null to keep the page automatic. Also, the value returned here will be null it this value is not set (Set to Automatic)

Syntax

Namespace: FlexCel.XlsAdapter

public override Nullable<Int32> PrintFirstPageNumber { get; set; }

See also

  • XlsFile


XlsFile.PrintNumberOfHorizontalPages Property | FlexCel Studio for the .NET Framework documentation

XlsFile.PrintNumberOfHorizontalPages Property

If set, the sheet will be printed on at most this number of horizontal pages. Use 0 to have unlimited horizontal pages while still limiting the vertical pages with ExcelFile.PrintNumberOfVerticalPages. (see 'Preparing for printing' in the Api Developer Guide)

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 PrintNumberOfHorizontalPages { get; set; }

See also

  • XlsFile
  • ExcelFile.PrintNumberOfVerticalPages


XlsFile.PrintNumberOfVerticalPages Property | FlexCel Studio for the .NET Framework documentation

XlsFile.PrintNumberOfVerticalPages Property

If set, the sheet will be printed on at most this number of vertical pages. Use 0 to have unlimited vertical pages while still limiting the horizontal pages with ExcelFile.PrintNumberOfHorizontalPages. (see 'Preparing for printing' in the Api Developer Guide)

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 PrintNumberOfVerticalPages { get; set; }

See also

  • XlsFile
  • ExcelFile.PrintNumberOfHorizontalPages


XlsFile.PrintPaperSize Property | FlexCel Studio for the .NET Framework documentation

XlsFile.PrintPaperSize Property

Pre-defined standard paper size. If you want to set up a printer specific paper size, see ExcelFile.SetPrinterDriverSettings

Syntax

Namespace: FlexCel.XlsAdapter

public override TPaperSize PrintPaperSize { get; set; }

See also

  • XlsFile


XlsFile.PrintPaperDimensions Property | FlexCel Studio for the .NET Framework documentation

XlsFile.PrintPaperDimensions Property

Returns the dimensions for the selected paper. See also ExcelFile.PrintPaperSize.

Syntax

Namespace: FlexCel.XlsAdapter

public override TPaperDimensions PrintPaperDimensions { get; }

See also

  • XlsFile


XlsFile.PrintErrors Property | FlexCel Studio for the .NET Framework documentation

XlsFile.PrintErrors Property

Determines how the errors will be printed.

Syntax

Namespace: FlexCel.XlsAdapter

public override TPrintErrors PrintErrors { get; set; }

See also

  • XlsFile


XlsFile.PrintComments Property | FlexCel Studio for the .NET Framework documentation

XlsFile.PrintComments Property

Determines how the comments will be printed.

Syntax

Namespace: FlexCel.XlsAdapter

public override TPrintComments PrintComments { get; set; }

See also

  • XlsFile


XlsFile.ImageCount Property | FlexCel Studio for the .NET Framework documentation

XlsFile.ImageCount Property

The number of images in the active sheet.

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 ImageCount { get; }

See also

  • XlsFile


XlsFile.ObjectCount Property | FlexCel Studio for the .NET Framework documentation

XlsFile.ObjectCount Property

Count of all graphical objects on the sheet. They can be charts, images, shapes, etc.

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 ObjectCount { get; }

See also

  • XlsFile


XlsFile.DataValidationCount Property | FlexCel Studio for the .NET Framework documentation

XlsFile.DataValidationCount Property

Returns the number of DataValidation structures in the active sheet. There are 2 ways you can access the data validation information on a sheet:

  1. If you know the row and column where you want to look, you can use ExcelFile.GetDataValidation(Int32, Int32) to return the data validation in the cell.
  2. If you want to find out all data validation structures in the sheet, you can use ExcelFile.DataValidationCount, ExcelFile.GetDataValidationInfo and ExcelFile.GetDataValidationRanges to loop over all existing data validations.

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 DataValidationCount { get; }

See also

  • XlsFile


XlsFile.HyperLinkCount Property | FlexCel Studio for the .NET Framework documentation

XlsFile.HyperLinkCount Property

The count of hyperlinks on the active sheet

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 HyperLinkCount { get; }

See also

  • XlsFile


XlsFile.OutlineSummaryRowsBelowDetail Property | FlexCel Studio for the .NET Framework documentation

XlsFile.OutlineSummaryRowsBelowDetail Property

Determines whether the summary rows should be below or above details on outline.

Syntax

Namespace: FlexCel.XlsAdapter

public override Boolean OutlineSummaryRowsBelowDetail { get; set; }

See also

  • XlsFile


XlsFile.OutlineSummaryColsRightToDetail Property | FlexCel Studio for the .NET Framework documentation

XlsFile.OutlineSummaryColsRightToDetail Property

Determines whether the summary columns should be right to or left to the details on outline.

Syntax

Namespace: FlexCel.XlsAdapter

public override Boolean OutlineSummaryColsRightToDetail { get; set; }

See also

  • XlsFile


XlsFile.OutlineAutomaticStyles Property | FlexCel Studio for the .NET Framework documentation

XlsFile.OutlineAutomaticStyles Property

This handles the setting of Automatic Styles inside the outline options.

Syntax

Namespace: FlexCel.XlsAdapter

public override Boolean OutlineAutomaticStyles { get; set; }

See also

  • XlsFile


XlsFile.ChartCount Property | FlexCel Studio for the .NET Framework documentation

XlsFile.ChartCount Property

Returns the count of charts on this sheet. Please take note that this method will not return the number of embedded objects with charts inside in a sheet, but just the number of charts in the sheet. In simpler terms, this method will return 0 for all worksheets, and 1 for all chart sheets. This is not a very useful method, but it needs to be this way to be consistent with ExcelFile.GetChart. So, looping like this:

    for (int i = 1; i <= xls.ChartCount; i++)
    {
        xls.GetChart(i, null);
    }

will loop 0 times for worksheets and 1 time for workbooks.

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 ChartCount { get; }

Examples

The following example will retrieve all charts that are inserted as objects in a sheet, along with the chart sheets.

    public void ProcessAllCharts()
    {
        XlsFile xls = new XlsFile(true);
        xls.Open("filewithcharts.xls");
        for (int iSheet = 1; iSheet <= xls.SheetCount; iSheet++)
        {
            xls.ActiveSheet = iSheet;

            //Process charts embedded as objects in worksheets.
            for (int iChart = 1; iChart <= xls.ObjectCount; iChart++)
            {
                TShapeProperties props = xls.GetObjectProperties(iChart, true);
                ProcessChart(xls, iChart, props); //We need to process it even if it is not a chart, since it might be a group with a chart inside.
            }

            //Process chart sheets.
            if (xls.SheetType == TSheetType.Chart)
            {
                ExcelChart chart = xls.GetChart(1, null);
                DoSomething(xls, chart);
            }

        }

        xls.Save("changedfilewithcharts.xls");
    }

    private void ProcessChart(ExcelFile xls, int iChart, TShapeProperties props)
    {
        if (props.ObjectType == TObjectType.Chart)
        {
            ExcelChart chart = xls.GetChart(iChart, props.ObjectPath);
            DoSomething(xls, chart);
        }

        for (int i = 1; i <= props.ChildrenCount; i++)
        {
            TShapeProperties childProp = props.Children(i);
            ProcessChart(xls, i, childProp);
        }
    }

See also

  • XlsFile


XlsFile.OptionsDates1904 Property | FlexCel Studio for the .NET Framework documentation

XlsFile.OptionsDates1904 Property

Excel has 2 different date systems. On windows systems it uses 1900 based dates, and on old Macintosh systems it uses 1904 dates. You can change this on Excel under Options, and this property allows you to know and change which format is being used. See https://support.microsoft.com/en-us/help/214330/differences-between-the-1900-and-the-1904-date-system-in-excel

Syntax

Namespace: FlexCel.XlsAdapter

public override Boolean OptionsDates1904 { get; set; }

See also

  • XlsFile


XlsFile.OptionsR1C1 Property | FlexCel Studio for the .NET Framework documentation

XlsFile.OptionsR1C1 Property

Use this property to change the reference system used in the file. Note that this option only changes how Excel and FlexCel will display the file. Internally, the formulas will always be stored in A1 format, and converted by Excel to and from R1C1 if this property is true. FlexCel will also use this property to render the file when it is set to print formulas.

Also, this property doesn't change how FlexCel will parse or return the formula text in the cells or names. By default, even if this property is true, you will need to enter the formulas in FlexCel in A1 mode. To change the entry mode in FlexCel, please use ExcelFile.FormulaReferenceStyle

Syntax

Namespace: FlexCel.XlsAdapter

public override Boolean OptionsR1C1 { get; set; }

See also

  • XlsFile


XlsFile.OptionsSaveExternalLinkValues Property | FlexCel Studio for the .NET Framework documentation

XlsFile.OptionsSaveExternalLinkValues Property

This property has the value of the corresponding option on Excel options.

Syntax

Namespace: FlexCel.XlsAdapter

public override Boolean OptionsSaveExternalLinkValues { get; set; }

See also

  • XlsFile


XlsFile.OptionsPrecisionAsDisplayed Property | FlexCel Studio for the .NET Framework documentation

XlsFile.OptionsPrecisionAsDisplayed Property

This property has the value of the corresponding option on Excel options.

Syntax

Namespace: FlexCel.XlsAdapter

public override Boolean OptionsPrecisionAsDisplayed { get; set; }

See also

  • XlsFile


XlsFile.OptionsMultithreadRecalc Property | FlexCel Studio for the .NET Framework documentation

XlsFile.OptionsMultithreadRecalc Property

Number of threads that can be used at the same time by Excel when recalculating. Set it to 0 to disable multithread recalculation, and to -1 to let Excel decide the best number of threads to use. The maximum value for this property is 1024.

This option only applies to Excel 2007 or newer.

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 OptionsMultithreadRecalc { get; set; }

See also

  • XlsFile


XlsFile.OptionsForceFullRecalc Property | FlexCel Studio for the .NET Framework documentation

XlsFile.OptionsForceFullRecalc Property

If true, Excel will do full recalculations of the spreadsheet when you change a cell. If false, only the cells that depend on the cell being changed will be recalculated. This option only applies to Excel 2007 or newer.

Syntax

Namespace: FlexCel.XlsAdapter

public override Boolean OptionsForceFullRecalc { get; set; }

See also

  • XlsFile


XlsFile.OptionsFullRecalcOnLoad Property | FlexCel Studio for the .NET Framework documentation

XlsFile.OptionsFullRecalcOnLoad Property

This property tells you if the open file wasn't recalculated when saved. If true, the workbook doesn't have recalculated values and will be recalculated when open in Excel. This option only applies to xlsx files. Note that if you open a file which has FullRecalcOnLoad = true in FlexCel, recalculate it and save it, FlexCel will save the file with FullRecalcOnLoad = false. To change what FlexCel writes in FullRecalcOnLoad when saving, change ExcelFile.OptionsFullRecalcOnLoadMode

Syntax

Namespace: FlexCel.XlsAdapter

public override Boolean OptionsFullRecalcOnLoad { get; }

See also

  • XlsFile


XlsFile.OptionsFullRecalcOnLoadMode Property | FlexCel Studio for the .NET Framework documentation

XlsFile.OptionsFullRecalcOnLoadMode Property

Defines how FlexCel will identify the files it creates to be calculated by Excel when it opens them.

Syntax

Namespace: FlexCel.XlsAdapter

public override TFullRecalcOnLoadMode OptionsFullRecalcOnLoadMode { get; set; }

See also

  • XlsFile


XlsFile.OptionsRecalcCircularReferences Property | FlexCel Studio for the .NET Framework documentation

XlsFile.OptionsRecalcCircularReferences Property

If true, Excel and FlexCel will do iterative calculating over cells with circular references, until ExcelFile.OptionsRecalcMaxIterations is reached or the difference is less than ExcelFile.OptionsRecalcMaxChange

Syntax

Namespace: FlexCel.XlsAdapter

public override Boolean OptionsRecalcCircularReferences { get; set; }

See also

  • XlsFile


XlsFile.OptionsRecalcMaxIterations Property | FlexCel Studio for the .NET Framework documentation

XlsFile.OptionsRecalcMaxIterations Property

Maximum number of iterations when calculating circular references (ExcelFile.OptionsRecalcCircularReferences is true),

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 OptionsRecalcMaxIterations { get; set; }

See also

  • XlsFile


XlsFile.OptionsRecalcMaxChange Property | FlexCel Studio for the .NET Framework documentation

XlsFile.OptionsRecalcMaxChange Property

Maximum difference between 2 iterations when calculating circular references (ExcelFile.OptionsRecalcCircularReferences is true),

Syntax

Namespace: FlexCel.XlsAdapter

public override Double OptionsRecalcMaxChange { get; set; }

See also

  • XlsFile


XlsFile.OptionsAutoCompressPictures Property | FlexCel Studio for the .NET Framework documentation

XlsFile.OptionsAutoCompressPictures Property

If true, Excel will try to compress the pictures to keep sizes down. This option only applies to Excel 2007 or newer.

Syntax

Namespace: FlexCel.XlsAdapter

public override Boolean OptionsAutoCompressPictures { get; set; }

See also

  • XlsFile


XlsFile.OptionsForceUseCheckCompatibility Property | FlexCel Studio for the .NET Framework documentation

XlsFile.OptionsForceUseCheckCompatibility Property

When the option ExcelFile.OptionsCheckCompatibility is true, Excel will refuse to austosave the file. To avoid a confusing situation where Excel refuses to autosave the file and shows a vague warning about an "older file format", ExcelFile.OptionsCheckCompatibility is ignored by FlexCel.

In order to force FlexCel to save ExcelFile.OptionsCheckCompatibility to the file (thus disabling the "Autosave" function) you need to set this property to true besides ExcelFile.OptionsCheckCompatibility.

Syntax

Namespace: FlexCel.XlsAdapter

public override Boolean OptionsForceUseCheckCompatibility { get; set; }

See also

  • XlsFile


XlsFile.OptionsCheckCompatibility Property | FlexCel Studio for the .NET Framework documentation

XlsFile.OptionsCheckCompatibility Property

Whether the "Check for compatibility" dialog will pop up when saving as xls in Excel 2007 or newer. This option only applies to Excel 2007 or newer.

Important: When this option is true, Excel will refuse to enable "Autosave" and upload the files to OneDrive (Autosave is the first option in the title bar in Excel 2019). If true, you will get a message:

"How do I turn on Autosave? Before Autosave can save your file, you need to fix the following: This file was created in an older file format. Please select File > Save As to update the file format."

So in order to avoid accidentally setting this option true and preventing the Autosave function, FlexCel will ignore this setting in xlsx files unless you also set ExcelFile.OptionsForceUseCheckCompatibility to true

Syntax

Namespace: FlexCel.XlsAdapter

public override Boolean OptionsCheckCompatibility { get; set; }

See also

  • XlsFile


XlsFile.OptionsBackup Property | FlexCel Studio for the .NET Framework documentation

XlsFile.OptionsBackup Property

Defines whether to save a backup copy of the workbook or not.

Syntax

Namespace: FlexCel.XlsAdapter

public override Boolean OptionsBackup { get; set; }

See also

  • XlsFile


XlsFile.OptionsRecalcMode Property | FlexCel Studio for the .NET Framework documentation

XlsFile.OptionsRecalcMode Property

Reads and writes the recalculating options in the file. Note that this only affects the file and how Excel will recalculate, not how FlexCel does its recalculation. FlexCel ignores this setting and uses ExcelFile.RecalcMode instead.

Syntax

Namespace: FlexCel.XlsAdapter

public override TSheetCalcMode OptionsRecalcMode { get; set; }

See also

  • XlsFile


XlsFile.RecalcMode Property | FlexCel Studio for the .NET Framework documentation

XlsFile.RecalcMode Property

Set this property to change how the file will be recalculated. Note that this affects only how FlexCel recalculates the file, but not how Excel will recalculate it. It doesn't change anything in the generated file. To change the options for the file, use ExcelFile.OptionsRecalcMode instead.

Remarks

Setting RecalcMode = Manual might be a little faster for big spreadsheets with *lots* of formulas, but they won't preview ok on Excel viewers as FlexCelPrintDocument. See also ExcelFile.RecalcVersion When Manual, you can still call ExcelFile.Recalc(Boolean) with "forced" = true to recalculate the sheet.

Not all functions are supported, those that are not will return a #NAME? error on a viewer, and will be recalculated by Excel when you open the file. See Supported Excel Functions for a list of supported functions.

Syntax

Namespace: FlexCel.XlsAdapter

public override TRecalcMode RecalcMode { get; set; }

See also

  • XlsFile


XlsFile.RecalcVersion Property | FlexCel Studio for the .NET Framework documentation

XlsFile.RecalcVersion Property

Defines which version of Excel recalculation engine will be saved in the file. This affects how Excel will recalculate the file on open.

If you set this property for example to Excel2007, then any Excel version newer than Excel 2007 will recalculate all formulas when you load the file, so it will modify the workbook and will ask for saving changes when closing. Even if you just open and close the file. Note that this will only happen if there are formulas on the sheet.

If there are any formulas that FlexCel can't recalculate, you should set this property to AlwaysRecalc. For example, if you have the formula:

"=GETPIVOTDATA("a";"b")"

FlexCel will return #NAME?, as it doesn't implement this function. If you open this file on Excel and RecalcVersion was not AlwaysRecalc when saving, Excel will not calculate it and will show also #NAME?. If RecalcVersion was AlwaysRecalc, Excel will show the right answer, but will ask for saving the file when closing.

Syntax

Namespace: FlexCel.XlsAdapter

public override TRecalcVersion RecalcVersion { get; set; }

Examples

The following code:

    XlsFile xls = new XlsFile(true); //We can't change the recalcmode once we have opened or created the file.
    xls.RecalcMode = TRecalcMode.Manual; //So the sheet is not recalculated before saving.
    xls.NewFile(1, TExcelFileFormat.v2021); //Create the file *after* recalcmode was changed.
    xls.RecalcVersion = TRecalcVersion.Excel2021; //So Excel equal or older than 2021 won't recalculate either.
    xls.SetCellValue(1, 1, new TFormula("= 1 + 1", 3));  //Basic math...
    xls.Save(OutFileName);

will create a file with a formula "1 + 1" and result = 3 on cell A1. If RecalcVersion was TRecalcVersion.AlwaysRecalc, Excel would show the correct value when opening.

See also

  • XlsFile


XlsFile.NeedsRecalc Property | FlexCel Studio for the .NET Framework documentation

XlsFile.NeedsRecalc Property

Internal use.

Syntax

Namespace: FlexCel.XlsAdapter

protected override Boolean NeedsRecalc { get; set; }

See also

  • XlsFile


XlsFile.Recalculating Property | FlexCel Studio for the .NET Framework documentation

XlsFile.Recalculating Property

Internal use.

Syntax

Namespace: FlexCel.XlsAdapter

protected override Boolean Recalculating { get; }

See also

  • XlsFile


XlsFile.LinkCount Property | FlexCel Studio for the .NET Framework documentation

XlsFile.LinkCount Property

Returns the number of external links for the file. You can access those links with ExcelFile.GetLink and ExcelFile.SetLink

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 LinkCount { get; }

See also

  • XlsFile


XlsFile.HeightCorrection Property | FlexCel Studio for the .NET Framework documentation

XlsFile.HeightCorrection Property

Factor to multiply default row heights. See remarks for a detailed explanation.

Remarks

Excel does not print the same things to all printers (or even the same printer with another resolution). Depending on the driver and resolution, printed columns and rows will be a little smaller or bigger.

FlexCel uses .NET framework to print, and so it is resolution independent, it will always print the same no matter where. So FlexCel is tuned to print like Excel on a 600 dpi generic printer. This will probably be ok for most uses, but in some cases might cause FlexCel to print an Extra page with only one column or row.

You can use this property and ExcelFile.WidthCorrection to manually fine tune FlexCel printing, previewing and exporting to PDF to make it smaller or larger. A normal value for this property might be 1.05 or 0.99, but don't use it unless you really need to.

Syntax

Namespace: FlexCel.XlsAdapter

public override Double HeightCorrection { get; set; }

Examples

To calculate the exact HeightCorrection and WidthCorrection for your printer create a new Excel sheet, make column A wide (almost a sheet wide) and row 1 larger (almost a sheet tall). Set the borders around cell A1 to a solid line. Now, print this file from Excel and from FlexCel (you can use the PrintPreview demo for this) and compare the 2 resulting boxes. If for example the Excel printed box is 1.2 cm wide and FlexCel is 1.4, WidthCorrection should be 1.4/1.2. (A larger WidthCorrection means a smaller box)

See also

  • XlsFile


XlsFile.FileFormatWhenOpened Property | FlexCel Studio for the .NET Framework documentation

XlsFile.FileFormatWhenOpened Property

Returns the file format that the file had when it was opened. If the file was created with ExcelFile.NewFile, the file format when opened is xls.

Syntax

Namespace: FlexCel.XlsAdapter

public override TFileFormats FileFormatWhenOpened { get; }

See also

  • XlsFile


XlsFile.Linespacing Property | FlexCel Studio for the .NET Framework documentation

XlsFile.Linespacing Property

A Linespacing of 1 means use the standard GDI+ linespace when a cell has more than one line. A linespace of 2 would mean double linespacing, and 0.5 would mean half linespacing. Normally linespacing in Excel is a little bigger than linespacing in GDI+, so you can use this property to fine tune what you need.

This property doesn't alter the Excel file in any way. It is only used when rendering.

Syntax

Namespace: FlexCel.XlsAdapter

public override Double Linespacing { get; set; }

See also

  • XlsFile


XlsFile.WidthCorrection Property | FlexCel Studio for the .NET Framework documentation

XlsFile.WidthCorrection Property

Factor to multiply default column widths. See remarks for a detailed explanation.

Remarks

Excel does not print the same things to all printers (or even the same printer with another resolution). Depending on the driver and resolution, printed columns and rows will be a little smaller or bigger.

FlexCel uses .NET framework to print, and so it is resolution independent, it will always print the same no matter where. So FlexCel is tuned to print like Excel on a 600 dpi generic printer. This will probably be ok for most uses, but in some cases might cause FlexCel to print an Extra page with only one column or row.

You can use this property and ExcelFile.HeightCorrection to manually fine tune FlexCel printing, previewing and exporting to PDF to make it smaller or larger. A normal value for this property might be 1.05 or 0.99, but don't use it unless you really need to.

Syntax

Namespace: FlexCel.XlsAdapter

public override Double WidthCorrection { get; set; }

Examples

To calculate the exact HeightCorrection and WidthCorrection for your printer create a new Excel sheet, make column A wide (almost a sheet wide) and row 1 larger (almost a sheet tall). Set the borders around cell A1 to a solid line. Now, print this file from Excel and from FlexCel (you can use the PrintPreview demo for this) and compare the 2 resulting boxes. If for example the Excel printed box is 1.2 cm wide and FlexCel is 1.4, WidthCorrection should be 1.4/1.2. (A larger WidthCorrection means a smaller box).

See also

  • XlsFile


XlsFile.CellMarginFactor Property | FlexCel Studio for the .NET Framework documentation

XlsFile.CellMarginFactor Property

This property can be used to add a margin to the cells when rendering, so text is rendered smaller and can have more line breaks. The default value of 1.0 means normal cells. The bigger this value, the bigger the margins and the smaller the real cell width for rendering the text. You might want to make this value a little larger than 1 if autofitting and Excel is wrapping text that FlexCel fits into one line.

Syntax

Namespace: FlexCel.XlsAdapter

public override Double CellMarginFactor { get; set; }

See also

  • XlsFile


XlsFile.CellIndentationRendering Property | FlexCel Studio for the .NET Framework documentation

XlsFile.CellIndentationRendering Property

Excel doesn't adapt the cell indentation when changing the print scale. This means that if a cell indentation is 0.1 inches at 100% print scale, it will also be 0.1 inches at 50% print scale. This will break the layout of your files when changing the print scaling, and so by default FlexCel won't behave like Excel here and make the indentation half the size if printing at half the scale. If you want to mimic the exact Excel behavior, set this property to true. See 'Cell indentation' in the Api Developer Guide

Syntax

Namespace: FlexCel.XlsAdapter

public override TCellIndentationRendering CellIndentationRendering { get; set; }

See also

  • XlsFile


XlsFile.HeadingColWidth Property | FlexCel Studio for the .NET Framework documentation

XlsFile.HeadingColWidth Property

Width that will be used by the added column with row numbers when ExcelFile.PrintHeadings is true. The default value (0) means to use an automatic value which is fine if you don't have too many rows to print. A positive value will make the column wider or narrower. A negative value will auto-calculate the width depending in the number of rows and normal font of the spreadsheet.

Syntax

Namespace: FlexCel.XlsAdapter

public override Double HeadingColWidth { get; set; }

See also

  • XlsFile


XlsFile.HeadingRowHeight Property | FlexCel Studio for the .NET Framework documentation

XlsFile.HeadingRowHeight Property

Height that will be used by the added row with column headers when ExcelFile.PrintHeadings is true. The default value (0) means to use an automatic value which is fine with normal fonts. A positive value will make the column wider or narrower.A negative value will auto-calculate the height depending in the normal font of the spreadsheet.

Syntax

Namespace: FlexCel.XlsAdapter

public override Double HeadingRowHeight { get; set; }

See also

  • XlsFile


XlsFile.ScreenScaling Property | FlexCel Studio for the .NET Framework documentation

XlsFile.ScreenScaling Property

This property lets you specify the screen scaling that FlexCel will assume for reading xlsx files in percent. (default is 100 which means 100%). The values can be between 100 and 500.

Column widths in xlsx files which don't have a fixed column width set will be different in different screen resolutions. So we need to know which resolution to emulate in order to read those files correctly. You will probably want to leave this property to the default value of 100, but you can change it if needed.

For more information, please read https://www.tmssoftware.com/site/blog.asp?post=311

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 ScreenScaling { get; set; }

See also

  • XlsFile


XlsFile.CustomTableStyleCount Property | FlexCel Studio for the .NET Framework documentation

XlsFile.CustomTableStyleCount Property

Returns the number of custom tables styles defined in the workbook.

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 CustomTableStyleCount { get; }

See also

  • XlsFile


XlsFile.TableCountInWorkbook Property | FlexCel Studio for the .NET Framework documentation

XlsFile.TableCountInWorkbook Property

Returns the number of tables in the whole workbook. (Not just the active sheet)

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 TableCountInWorkbook { get; }

See also

  • XlsFile


XlsFile.TableCountInSheet Property | FlexCel Studio for the .NET Framework documentation

XlsFile.TableCountInSheet Property

Returns the number of tables in the active sheet. Use ExcelFile.GetTable(Int32) to retrieve the tables in the sheet.

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 TableCountInSheet { get; }

See also

  • XlsFile


XlsFile.CustomXmlPartCount Property | FlexCel Studio for the .NET Framework documentation

XlsFile.CustomXmlPartCount Property

Returns the number of custom xml parts in the active document.

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 CustomXmlPartCount { get; }

See also

  • XlsFile


XlsxChart Class | FlexCel Studio for the .NET Framework documentation

XlsxChart Class

Implements an ExcelChart interface for charts in xlsx files.

Syntax

Namespace: FlexCel.XlsAdapter

public class XlsxChart: XlsBaseChart

Methods

Name Description
SeriesInSubchart Returns the number of series on each subchart. Note that this property only works in xlsx files: In xls files it will always return 0.
AddSubchart Adds a new subchart to the existing chart. Note that if the current active subchart is empty, this method will not add a new subchart, but replace the empty one. In that case, ExcelChart.​Subchart​Count won't change.

This method only works in xlsx files, not xls.
SetChartOptions Sets the chart options of a specific subchart inside the chart. Note that while a chart can have multiple subcharts inside (for example one pie subchart and one line subchart), normally there is only one subchart and so the SubchartPos parameter is normally 1.
AddSeries Adds a series to the chart.
DeleteSeries Deletes the series at position index.
GetSeries Returns a series definition.
GetSeriesInSubchart Returns a series definition for a given subchart. Note: This method only works in xlsx files.
SetSeries Sets a Series value. Note that for xlsx charts, this will change the **data range** and the **options** of the series. If you only want to change the data range, pass null options to the method.
SetSeriesInSubchart Sets a Series value. Note that for xlsx charts, this will change the **data range** and the **options** of the series. If you only want to change the data range, pass null options to the method.
GetBubbleSeries Returns the bubble definition for a series when in a bubble chart.
SetBubbleSeries Sets a Series value. Note that for xlsx charts, this will change the **data range** and the **options** of the series. If you only want to change the data range, pass null options to the method.
GetChartAxis Returns the axis information for this chart. Note that this might be more than one, if the chart has a secondary axis.
SetChartAxis Sets the options for either the primary or secondary pair of axis.
GetDataLabels Returns all the labels for the chart. Note that Axis have their labels defined inside their own definition.
SetDataLabels Changes the labels for the chart. You should always get the values with ExcelChart.​Get​Data​Labels, modify them, and change them back with this method.
GetDataLabelsRange Returns the range of cells for a "Label Contains: " "Value from Cells" option in the labels.
Note that for this to work, you also need to use the string [CELLRANGE] in the label definition.
SetDataLabelsRange Sets the range of cells for a "Label Contains: " "Value from Cells" option in the labels.
Note that for this to work, you also need to use the string [CELLRANGE] in the label definition.
GetTitle Returns the title of the chart.
SetTitle Sets the title of the chart. This method is only implemented for xlsx charts.
GetChartLegend Information about the Legend of the chart.
SetChartLegend Sets the legend properties.
RemoveChartLegend Removes the Legend from the chart.
GetTrendline Gets a trendline for a chart. This method is only implemented for xlsx charts.
SetTrendline Gets a trendline for a chart. This method is only implemented for xlsx charts.
GetObjectProperties An object embedded inside a chart.
SetObjectText Overloaded
 SetObjectText(Int32, String, String)
SetObjectText(Int32, String, TRichString)
SetObjectText(Int32, String, TDrawingRichString)
DeleteObject Overloaded
 DeleteObject(Int32)
DeleteObject(Int32, String)
GetImage Returns an image and its type.
Note that for SVG images, xlsx files store both a PNG and SVG image. In those cases, for backward compatibility reasons, this method will return the PNG image. To get the SVG, call ExcelChart.​Get​Image​Alternate
GetImageAlternate Returns an image and its type. Currently this method is the same as ExcelChart.GetImage for all images except SVG.
For SVG images, xlsx files store both a PNG and SVG image. In those cases, this method will return the SVG image. To get the PNG, call ExcelChart.GetImage

Properties

Name | Description
IsXlsxChart | Returns true if the chart is defined inside an xlsx file instead of xls. While both charts in xls and xlsx files are mostly compatible, some behaviors can change depending on what type of chart this is. For example, if the first series in an xls chart is pie, it won't draw gridlines even if the second isn't. In xlsx charts, if another series is not pie, Excel will draw the gridlines.
Style | This is a number between 1 and 48 which defines many standard properties for the chart, like the default line width for the series or the legend. The default style is 2.
SubchartCount | A chart can have multiple subcharts inside: For example one bar chart and one pie chart. This method returns how many subcharts you have inside the main chart. Note that this property only works in xlsx files: In xls files it will always return 1.
Background | Options for the background of the full chart. If this member is null, the options for the Autoshape will be used.
DefaultFont | Returns the default font for all text in the chart that does not have a font defined.
DefaultLabelFont | Returns the default font for all labels in the chart that do not have a font defined.
DefaultAxisFont | Returns the default font for the Axis in the chart that do not have a font defined.
DefaultAxisTitleFont | Returns the default font for the Axis title in the chart that do not have a font defined.
DefaultTitleFont | Returns the default font for the Title in the chart that do not have a font defined.
PlotEmptyCells | Defines how null cells will be plotted on the chart.
ShowDataInHidden​Rows​AndCols | Defines if hidden rows and columns will be used when plotting values.
ChartOptions | Returns the type of chart and the options specific for that kind of chart. There might be more than one ChartOptions returned, since you can mix more than one type of chart on a simple chart. (One for each series). You need to look at the series ChartOptionsIndex to know to which one it refers.
PlotArea | Returns or sets the plot area definition for the chart. Note: Setting the plot area only works in xlsx files.
Chart3DOptions | Returns the 3D options for the chart, or null if the chart isn't 3D.
Floor | The floor in a 3D-chart.
SideWall | The wall next to the y-axis in a 3D-chart.
BackWall | The wall at the back of a 3D-chart
SeriesCount | Returns the count of series on this chart.
ObjectCount | The number of objects that are embedded inside this chart.


XlsxChart.SeriesInSubchart Method | FlexCel Studio for the .NET Framework documentation

XlsxChart.SeriesInSubchart Method

Returns the number of series on each subchart. Note that this property only works in xlsx files: In xls files it will always return 0.

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 SeriesInSubchart(Int32 subchartPos)

Parameters

<-> | Parameter | Type | Description
 | subchartPos | Int32 | Number of the subchart. (1 based)

See also

  • XlsxChart


XlsxChart.AddSubchart Method | FlexCel Studio for the .NET Framework documentation

XlsxChart.AddSubchart Method

Adds a new subchart to the existing chart. Note that if the current active subchart is empty, this method will not add a new subchart, but replace the empty one. In that case, ExcelChart.SubchartCount won't change.

This method only works in xlsx files, not xls.

Syntax

Namespace: FlexCel.XlsAdapter

public override void AddSubchart(TChartType chartType, Int32 axisIndex)

Parameters

<-> | Parameter | Type | Description
 | chartType | TChartType | Type of subchart added. If it is the same as the current chart type, it won't be added.
 | axisIndex | Int32 | It can be 0 if the axis of this subchart will be the primary pair of axis, or 1 if they are the secondary pair.

See also

  • XlsxChart


XlsxChart.SetChartOptions Method | FlexCel Studio for the .NET Framework documentation

XlsxChart.SetChartOptions Method

Sets the chart options of a specific subchart inside the chart. Note that while a chart can have multiple subcharts inside (for example one pie subchart and one line subchart), normally there is only one subchart and so the SubchartPos parameter is normally 1.

Syntax

Namespace: FlexCel.XlsAdapter

public override void SetChartOptions(Int32 subchartPos, TChartOptions options)

Parameters

<-> | Parameter | Type | Description
 | subchartPos | Int32 | Position of the subchart (1 based)
 | options | TChartOptions | Options to set in the subchart.

See also

  • XlsxChart


XlsxChart.AddSeries Method | FlexCel Studio for the .NET Framework documentation

XlsxChart.AddSeries Method

Adds a series to the chart.

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 AddSeries(ChartSeries value)

Parameters

<-> | Parameter | Type | Description
 | value | ChartSeries | Definition of the new series

Returns

Index of the newly added series.

See also

  • XlsxChart


XlsxChart.DeleteSeries Method | FlexCel Studio for the .NET Framework documentation

XlsxChart.DeleteSeries Method

Deletes the series at position index.

Syntax

Namespace: FlexCel.XlsAdapter

public override void DeleteSeries(Int32 index)

Parameters

<-> | Parameter | Type | Description
 | index | Int32 |

See also

  • XlsxChart


XlsxChart.GetSeries Method | FlexCel Studio for the .NET Framework documentation

XlsxChart.GetSeries Method

Returns a series definition.

Syntax

Namespace: FlexCel.XlsAdapter

public override ChartSeries GetSeries(Int32 index, Boolean getDefinitions, Boolean getValues, Boolean getOptions)

Parameters

<-> | Parameter | Type | Description
 | index | Int32 | Index of the series you want to return. (1 based)
 | getDefinitions | Boolean | If false, this method will not return the series formulas, so it will be a little faster.
 | getValues | Boolean | If false, this method will not return the series values, so it will be a little faster and use less memory.
 | getOptions | Boolean | If false, this method will not return the series options.

Returns

series description.

See also

  • XlsxChart


XlsxChart.GetSeriesInSubchart Method | FlexCel Studio for the .NET Framework documentation

XlsxChart.GetSeriesInSubchart Method

Returns a series definition for a given subchart. Note: This method only works in xlsx files.

Syntax

Namespace: FlexCel.XlsAdapter

public override ChartSeries GetSeriesInSubchart(Int32 subchart, Int32 indexInSubchart, Boolean getDefinitions, Boolean getValues, Boolean getOptions)

Parameters

<-> | Parameter | Type | Description
 | subchart | Int32 | Subchart where we want to get the series from. (1 based)
 | indexInSubchart | Int32 | Index of the series you want to return in the given subchart. (1 based)
 | getDefinitions | Boolean | If false, this method will not return the series formulas, so it will be a little faster.
 | getValues | Boolean | If false, this method will not return the series values, so it will be a little faster and use less memory.
 | getOptions | Boolean | If false, this method will not return the series options.

Returns

series description.

See also

  • XlsxChart


XlsxChart.SetSeries Method | FlexCel Studio for the .NET Framework documentation

XlsxChart.SetSeries Method

Sets a Series value. Note that for xlsx charts, this will change the **data range** and the **options** of the series. If you only want to change the data range, pass null options to the method.

Syntax

Namespace: FlexCel.XlsAdapter

public override void SetSeries(Int32 index, ChartSeries value)

Parameters

<-> | Parameter | Type | Description
 | index | Int32 | Index of the series to set.(1 based)
 | value | ChartSeries | Series definition.

See also

  • XlsxChart


XlsxChart.SetSeriesInSubchart Method | FlexCel Studio for the .NET Framework documentation

XlsxChart.SetSeriesInSubchart Method

Sets a Series value. Note that for xlsx charts, this will change the **data range** and the **options** of the series. If you only want to change the data range, pass null options to the method.

Syntax

Namespace: FlexCel.XlsAdapter

public override void SetSeriesInSubchart(Int32 subchart, Int32 indexInSubchart, ChartSeries value)

Parameters

<-> | Parameter | Type | Description
 | subchart | Int32 | Subchart where we want to set the series. (1 based)
 | indexInSubchart | Int32 | Index of the series to set inside the subchart.(1 based)
 | value | ChartSeries | Series definition.

See also

  • XlsxChart


XlsxChart.GetBubbleSeries Method | FlexCel Studio for the .NET Framework documentation

XlsxChart.GetBubbleSeries Method

Returns the bubble definition for a series when in a bubble chart.

Syntax

Namespace: FlexCel.XlsAdapter

public override ChartBubbleSeries GetBubbleSeries(Int32 index, Boolean getDefinitions, Boolean getValues)

Parameters

<-> | Parameter | Type | Description
 | index | Int32 | Index of the series with the bubbles you want to return. (1 based)
 | getDefinitions | Boolean | If false, this method will not return the bubble formulas, so it will be a little faster.
 | getValues | Boolean | If false, this method will not return the bubble values, so it will be a little faster and use less memory.

Returns

Bubble descriptions.

See also

  • XlsxChart


XlsxChart.SetBubbleSeries Method | FlexCel Studio for the .NET Framework documentation

XlsxChart.SetBubbleSeries Method

Sets a Series value. Note that for xlsx charts, this will change the **data range** and the **options** of the series. If you only want to change the data range, pass null options to the method.

Syntax

Namespace: FlexCel.XlsAdapter

public override void SetBubbleSeries(Int32 index, ChartBubbleSeries bubbleSeries)

Parameters

<-> | Parameter | Type | Description
 | index | Int32 | Index of the series with the bubbles you want to set. (1 based)
 | bubbleSeries | ChartBubbleSeries | The bubble series definition.

See also

  • XlsxChart


XlsxChart.GetChartAxis Method | FlexCel Studio for the .NET Framework documentation

XlsxChart.GetChartAxis Method

Returns the axis information for this chart. Note that this might be more than one, if the chart has a secondary axis.

Syntax

Namespace: FlexCel.XlsAdapter

public override TChartAxis[] GetChartAxis()

See also

  • XlsxChart


XlsxChart.SetChartAxis Method | FlexCel Studio for the .NET Framework documentation

XlsxChart.SetChartAxis Method

Sets the options for either the primary or secondary pair of axis.

Syntax

Namespace: FlexCel.XlsAdapter

public override void SetChartAxis(TChartAxis axis)

Parameters

<-> | Parameter | Type | Description
 | axis | TChartAxis | Pair of axis we want to set the options.

See also

  • XlsxChart


XlsxChart.GetDataLabels Method | FlexCel Studio for the .NET Framework documentation

XlsxChart.GetDataLabels Method

Returns all the labels for the chart. Note that Axis have their labels defined inside their own definition.

Syntax

Namespace: FlexCel.XlsAdapter

public override TDataLabel[] GetDataLabels()

See also

  • XlsxChart


XlsxChart.SetDataLabels Method | FlexCel Studio for the .NET Framework documentation

XlsxChart.SetDataLabels Method

Changes the labels for the chart. You should always get the values with ExcelChart.GetDataLabels, modify them, and change them back with this method.

Syntax

Namespace: FlexCel.XlsAdapter

public override void SetDataLabels(TDataLabel[] labels)

Parameters

<-> | Parameter | Type | Description
 | labels | TDataLabel[] | New labels for the chart.

See also

  • XlsxChart


XlsxChart.GetDataLabelsRange Method | FlexCel Studio for the .NET Framework documentation

XlsxChart.GetDataLabelsRange Method

Returns the range of cells for a "Label Contains: " "Value from Cells" option in the labels. Note that for this to work, you also need to use the string [CELLRANGE] in the label definition.

Syntax

Namespace: FlexCel.XlsAdapter

public override TDataLabelsRange GetDataLabelsRange(Int32 chartIndex, Int32 seriesIndex)

Parameters

<-> | Parameter | Type | Description
 | chartIndex | Int32 | Index of the chart (1 based). Must be bigger than 0 and less-or-equal than ExcelChart.SubchartCount
 | seriesIndex | Int32 | Index of the series in the chart (1 based). Must be bigger than 0 and less-or-equal than ExcelChart.SeriesInSubchart

See also

  • XlsxChart


XlsxChart.SetDataLabelsRange Method | FlexCel Studio for the .NET Framework documentation

XlsxChart.SetDataLabelsRange Method

Sets the range of cells for a "Label Contains: " "Value from Cells" option in the labels. Note that for this to work, you also need to use the string [CELLRANGE] in the label definition.

Syntax

Namespace: FlexCel.XlsAdapter

public override void SetDataLabelsRange(Int32 chartIndex, Int32 seriesIndex, TDataLabelsRange value)

Parameters

<-> | Parameter | Type | Description
 | chartIndex | Int32 | Index of the chart (1 based). Must be bigger than 0 and less-or-equal than ExcelChart.SubchartCount
 | seriesIndex | Int32 | Index of the series in the chart (1 based). Must be bigger than 0 and less-or-equal than ExcelChart.SeriesInSubchart
 | value | TDataLabelsRange | Value of the range for the series.

See also

  • XlsxChart


XlsxChart.GetTitle Method | FlexCel Studio for the .NET Framework documentation

XlsxChart.GetTitle Method

Returns the title of the chart.

Syntax

Namespace: FlexCel.XlsAdapter

public override TDataLabel GetTitle()

See also

  • XlsxChart


XlsxChart.SetTitle Method | FlexCel Studio for the .NET Framework documentation

XlsxChart.SetTitle Method

Sets the title of the chart. This method is only implemented for xlsx charts.

Syntax

Namespace: FlexCel.XlsAdapter

public override void SetTitle(TDataLabel value)

Parameters

<-> | Parameter | Type | Description
 | value | TDataLabel |

See also

  • XlsxChart


XlsxChart.GetChartLegend Method | FlexCel Studio for the .NET Framework documentation

XlsxChart.GetChartLegend Method

Information about the Legend of the chart.

Syntax

Namespace: FlexCel.XlsAdapter

public override TChartLegend GetChartLegend()

See also

  • XlsxChart


XlsxChart.SetChartLegend Method | FlexCel Studio for the .NET Framework documentation

XlsxChart.SetChartLegend Method

Sets the legend properties.

Syntax

Namespace: FlexCel.XlsAdapter

public override void SetChartLegend(TChartLegend value)

Parameters

<-> | Parameter | Type | Description
 | value | TChartLegend |

See also

  • XlsxChart


XlsxChart.RemoveChartLegend Method | FlexCel Studio for the .NET Framework documentation

XlsxChart.RemoveChartLegend Method

Removes the Legend from the chart.

Syntax

Namespace: FlexCel.XlsAdapter

public override void RemoveChartLegend()

See also

  • XlsxChart


XlsxChart.GetTrendline Method | FlexCel Studio for the .NET Framework documentation

XlsxChart.GetTrendline Method

Gets a trendline for a chart. This method is only implemented for xlsx charts.

Syntax

Namespace: FlexCel.XlsAdapter

public override TChartTrendline GetTrendline(Int32 chartIndex, Int32 seriesIndex)

Parameters

<-> | Parameter | Type | Description
 | chartIndex | Int32 | Index of the chart (1 based). Must be bigger than 0 and less-or-equal than ExcelChart.SubchartCount
 | seriesIndex | Int32 | Index of the series in the chart (1 based). Must be bigger than 0 and less-or-equal than ExcelChart.SeriesInSubchart

Returns

The trendline definition if there is one, null otherwise. For xls charts this method will always return null.

See also

  • XlsxChart


XlsxChart.SetTrendline Method | FlexCel Studio for the .NET Framework documentation

XlsxChart.SetTrendline Method

Gets a trendline for a chart. This method is only implemented for xlsx charts.

Syntax

Namespace: FlexCel.XlsAdapter

public override void SetTrendline(Int32 chartIndex, Int32 seriesIndex, TChartTrendline trendline)

Parameters

<-> | Parameter | Type | Description
 | chartIndex | Int32 | Index of the chart (1 based). Must be bigger than 0 and less-or-equal than ExcelChart.SubchartCount
 | seriesIndex | Int32 | Index of the series in the chart (1 based). Must be bigger than 0 and less-or-equal than ExcelChart.SeriesInSubchart
 | trendline | TChartTrendline | Trendline definition.

See also

  • XlsxChart


XlsxChart.GetObjectProperties Method | FlexCel Studio for the .NET Framework documentation

XlsxChart.GetObjectProperties Method

An object embedded inside a chart.

Syntax

Namespace: FlexCel.XlsAdapter

public override TShapeProperties GetObjectProperties(Int32 objectIndex, Boolean GetShapeOptions)

Parameters

<-> | Parameter | Type | Description
 | objectIndex | Int32 | Index of the object, between 1 and ExcelChart.ObjectCount
 | GetShapeOptions | Boolean | When true, shape options will be retrieved. As this can be a slow operation, only specify true when you really need those options.

Returns

The properties for the embedded object.

See also

  • XlsxChart


XlsxChart.SetObjectText Method | FlexCel Studio for the .NET Framework documentation

XlsxChart.SetObjectText Method

Overloads

  • XlsxChart.SetObjectText(Int32, String, String)
  • XlsxChart.SetObjectText(Int32, String, TRichString)
  • XlsxChart.SetObjectText(Int32, String, TDrawingRichString)

XlsxChart.SetObjectText(Int32, String, String)

Sets the text for an autoshape. If the object does not accept text, this method will do nothing. This version of the method will only modify the text of the object, and preserve the existing formatting in the object if there was one.

Syntax

Namespace: FlexCel.XlsAdapter

public override void SetObjectText(Int32 objectIndex, String objectPath, String text)

Parameters

<-> | Parameter | Type | Description
 | objectIndex | Int32 | Index of the object (1-based)
 | objectPath | String | Index to the child object you want to change the text. If it is a simple object, you can use String.Empty here, if not you need to get the ObjectPath from ExcelChart.GetObjectProperties If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"
 | text | String | Text you want to use. Use null to delete text from an AutoShape.

See also

  • XlsxChart

XlsxChart.SetObjectText(Int32, String, TRichString)

Sets the text for an autoshape. If the object does not accept text, this method will do nothing. This version of the method will only modify the rich string properties of the object text, and preserve those things not available in a TRichString like wordArt effects.

Syntax

Namespace: FlexCel.XlsAdapter

public override void SetObjectText(Int32 objectIndex, String objectPath, TRichString text)

Parameters

<-> | Parameter | Type | Description
 | objectIndex | Int32 | Index of the object (1-based)
 | objectPath | String | Index to the child object you want to change the text. If it is a simple object, you can use String.Empty here, if not you need to get the ObjectPath from ExcelChart.GetObjectProperties If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"
 | text | TRichString | Text you want to use. Use null to delete text from an AutoShape.

See also

  • XlsxChart

XlsxChart.SetObjectText(Int32, String, TDrawingRichString)

Changes the text inside an object of the chart.

Syntax

Namespace: FlexCel.XlsAdapter

public override void SetObjectText(Int32 objectIndex, String objectPath, TDrawingRichString text)

Parameters

<-> | Parameter | Type | Description
 | objectIndex | Int32 | Index of the object, between 1 and ExcelChart.ObjectCount
 | objectPath | String | Index to the child object you want to change the text. If it is a simple object, you can use String.Empty here, if not you need to get the ObjectPath from ExcelChart.GetObjectProperties If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"
 | text | TDrawingRichString | Text you want to use. Use null to delete text from an AutoShape.

See also

  • XlsxChart


XlsxChart.DeleteObject Method | FlexCel Studio for the .NET Framework documentation

XlsxChart.DeleteObject Method

Overloads

  • XlsxChart.DeleteObject(Int32)
  • XlsxChart.DeleteObject(Int32, String)

XlsxChart.DeleteObject(Int32)

Deletes the graphic object at objectIndex. Use it with care, there are some graphics objects you don't want to remove (like comment boxes when you don't delete the associated comment.)

Syntax

Namespace: FlexCel.XlsAdapter

public override void DeleteObject(Int32 objectIndex)

Parameters

<-> | Parameter | Type | Description
 | objectIndex | Int32 | Index of the object (1 based).

See also

  • XlsxChart

XlsxChart.DeleteObject(Int32, String)

Deletes the graphic object at objectIndex. Use it with care, there are some graphics objects you don't want to remove (like comment boxes when you don't delete the associated comment.)

Syntax

Namespace: FlexCel.XlsAdapter

public override void DeleteObject(Int32 objectIndex, String objectPath)

Parameters

<-> | Parameter | Type | Description
 | objectIndex | Int32 | Index of the object (1 based).
 | objectPath | String | Index to the child object you want to change the property. If it is a simple object, you can use String.Empty here, if not you need to get the ObjectPath from ExcelChart.GetObjectProperties If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"

See also

  • XlsxChart


XlsxChart.GetImage Method | FlexCel Studio for the .NET Framework documentation

XlsxChart.GetImage Method

Returns an image and its type. Note that for SVG images, xlsx files store both a PNG and SVG image. In those cases, for backward compatibility reasons, this method will return the PNG image. To get the SVG, call ExcelChart.GetImageAlternate

Syntax

Namespace: FlexCel.XlsAdapter

public override void GetImage(Int32 imageIndex, String objectPath, ref TXlsImgType imageType, Stream outStream, Boolean usesObjectIndex)

Parameters

<-> | Parameter | Type | Description
 | imageIndex | Int32 | Index of the image. (1 based)
 | objectPath | String | Object path to the image when it is a grouped image. For toplevel images you can use String.Empty. In other case, you need to use the value returned by ExcelChart.GetObjectProperties If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"
ref | imageType | TXlsImgType | Returns the image type for the data returned. (If it is a bmp, jpg or other)
 | outStream | Stream | Stream where the image data will be copied.
 | usesObjectIndex | Boolean | If false (the default) then imageIndex is an index to the list of images. When true imageIndex is an index to the list of all objects in the sheet. When you have the object id, you can avoid calling ObjectIndexToImageIndex which is a slow method, by setting this parameter to true.

See also

  • XlsxChart


XlsxChart.GetImageAlternate Method | FlexCel Studio for the .NET Framework documentation

XlsxChart.GetImageAlternate Method

Returns an image and its type. Currently this method is the same as ExcelChart.GetImage for all images except SVG. For SVG images, xlsx files store both a PNG and SVG image. In those cases, this method will return the SVG image. To get the PNG, call ExcelChart.GetImage

Syntax

Namespace: FlexCel.XlsAdapter

public override void GetImageAlternate(Int32 imageIndex, String objectPath, out TXlsImgType imageType, Stream outStream, Boolean usesObjectIndex)

Parameters

<-> | Parameter | Type | Description
 | imageIndex | Int32 | Index of the image. (1 based)
 | objectPath | String | Object path to the image when it is a grouped image. For toplevel images you can use String.Empty. In other case, you need to use the value returned by ExcelChart.GetObjectProperties If it is "absolute"(it starts with "\\"), then the path includes the objectIndex, and the objectIndex is not used. An object path of "\\1\\2\\3" is exactly the same as using objectIndex = 1 and objectPath = "2\\3"
out | imageType | TXlsImgType | Returns the image type for the data returned. (If it is a bmp, jpg or other)
 | outStream | Stream | Stream where the image data will be copied.
 | usesObjectIndex | Boolean | If false (the default) then imageIndex is an index to the list of images. When true imageIndex is an index to the list of all objects in the sheet. When you have the object id, you can avoid calling ObjectIndexToImageIndex which is a slow method, by setting this parameter to true.

See also

  • XlsxChart


XlsxChart.IsXlsxChart Property | FlexCel Studio for the .NET Framework documentation

XlsxChart.IsXlsxChart Property

Returns true if the chart is defined inside an xlsx file instead of xls. While both charts in xls and xlsx files are mostly compatible, some behaviors can change depending on what type of chart this is. For example, if the first series in an xls chart is pie, it won't draw gridlines even if the second isn't. In xlsx charts, if another series is not pie, Excel will draw the gridlines.

Syntax

Namespace: FlexCel.XlsAdapter

public override Boolean IsXlsxChart { get; }

See also

  • XlsxChart


XlsxChart.Style Property | FlexCel Studio for the .NET Framework documentation

XlsxChart.Style Property

This is a number between 1 and 48 which defines many standard properties for the chart, like the default line width for the series or the legend. The default style is 2.

Syntax

Namespace: FlexCel.XlsAdapter

public override ChartStyle Style { get; set; }

See also

  • XlsxChart


XlsxChart.SubchartCount Property | FlexCel Studio for the .NET Framework documentation

XlsxChart.SubchartCount Property

A chart can have multiple subcharts inside: For example one bar chart and one pie chart. This method returns how many subcharts you have inside the main chart. Note that this property only works in xlsx files: In xls files it will always return 1.

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 SubchartCount { get; }

See also

  • XlsxChart


XlsxChart.Background Property | FlexCel Studio for the .NET Framework documentation

XlsxChart.Background Property

Options for the background of the full chart. If this member is null, the options for the Autoshape will be used.

Syntax

Namespace: FlexCel.XlsAdapter

public override TChartFrameOptions Background { get; set; }

See also

  • XlsxChart


XlsxChart.DefaultFont Property | FlexCel Studio for the .NET Framework documentation

XlsxChart.DefaultFont Property

Returns the default font for all text in the chart that does not have a font defined.

Syntax

Namespace: FlexCel.XlsAdapter

public override TFlxChartFont DefaultFont { get; set; }

See also

  • XlsxChart


XlsxChart.DefaultLabelFont Property | FlexCel Studio for the .NET Framework documentation

XlsxChart.DefaultLabelFont Property

Returns the default font for all labels in the chart that do not have a font defined.

Syntax

Namespace: FlexCel.XlsAdapter

public override TFlxChartFont DefaultLabelFont { get; }

See also

  • XlsxChart


XlsxChart.DefaultAxisFont Property | FlexCel Studio for the .NET Framework documentation

XlsxChart.DefaultAxisFont Property

Returns the default font for the Axis in the chart that do not have a font defined.

Syntax

Namespace: FlexCel.XlsAdapter

public override TFlxChartFont DefaultAxisFont { get; }

See also

  • XlsxChart


XlsxChart.DefaultAxisTitleFont Property | FlexCel Studio for the .NET Framework documentation

XlsxChart.DefaultAxisTitleFont Property

Returns the default font for the Axis title in the chart that do not have a font defined.

Syntax

Namespace: FlexCel.XlsAdapter

public override TFlxChartFont DefaultAxisTitleFont { get; }

See also

  • XlsxChart


XlsxChart.DefaultTitleFont Property | FlexCel Studio for the .NET Framework documentation

XlsxChart.DefaultTitleFont Property

Returns the default font for the Title in the chart that do not have a font defined.

Syntax

Namespace: FlexCel.XlsAdapter

public override TFlxChartFont DefaultTitleFont { get; }

See also

  • XlsxChart


XlsxChart.PlotEmptyCells Property | FlexCel Studio for the .NET Framework documentation

XlsxChart.PlotEmptyCells Property

Defines how null cells will be plotted on the chart.

Syntax

Namespace: FlexCel.XlsAdapter

public override TPlotEmptyCells PlotEmptyCells { get; set; }

See also

  • XlsxChart


XlsxChart.ShowDataInHiddenRowsAndCols Property | FlexCel Studio for the .NET Framework documentation

XlsxChart.ShowDataInHiddenRowsAndCols Property

Defines if hidden rows and columns will be used when plotting values.

Syntax

Namespace: FlexCel.XlsAdapter

public override Boolean ShowDataInHiddenRowsAndCols { get; set; }

See also

  • XlsxChart


XlsxChart.ChartOptions Property | FlexCel Studio for the .NET Framework documentation

XlsxChart.ChartOptions Property

Returns the type of chart and the options specific for that kind of chart. There might be more than one ChartOptions returned, since you can mix more than one type of chart on a simple chart. (One for each series). You need to look at the series ChartOptionsIndex to know to which one it refers.

Syntax

Namespace: FlexCel.XlsAdapter

public override TChartOptions[] ChartOptions { get; }

See also

  • XlsxChart


XlsxChart.PlotArea Property | FlexCel Studio for the .NET Framework documentation

XlsxChart.PlotArea Property

Returns or sets the plot area definition for the chart. Note: Setting the plot area only works in xlsx files.

Syntax

Namespace: FlexCel.XlsAdapter

public override TChartPlotArea PlotArea { get; set; }

See also

  • XlsxChart


XlsxChart.Chart3DOptions Property | FlexCel Studio for the .NET Framework documentation

XlsxChart.Chart3DOptions Property

Returns the 3D options for the chart, or null if the chart isn't 3D.

Syntax

Namespace: FlexCel.XlsAdapter

public override TChart3DOptions Chart3DOptions { get; }

See also

  • XlsxChart


XlsxChart.Floor Property | FlexCel Studio for the .NET Framework documentation

XlsxChart.Floor Property

The floor in a 3D-chart.

Syntax

Namespace: FlexCel.XlsAdapter

public override ChartWallOptions Floor { get; }

See also

  • XlsxChart


XlsxChart.SideWall Property | FlexCel Studio for the .NET Framework documentation

XlsxChart.SideWall Property

The wall next to the y-axis in a 3D-chart.

Syntax

Namespace: FlexCel.XlsAdapter

public override ChartWallOptions SideWall { get; }

See also

  • XlsxChart


XlsxChart.BackWall Property | FlexCel Studio for the .NET Framework documentation

XlsxChart.BackWall Property

The wall at the back of a 3D-chart

Syntax

Namespace: FlexCel.XlsAdapter

public override ChartWallOptions BackWall { get; }

See also

  • XlsxChart


XlsxChart.SeriesCount Property | FlexCel Studio for the .NET Framework documentation

XlsxChart.SeriesCount Property

Returns the count of series on this chart.

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 SeriesCount { get; }

See also

  • XlsxChart


XlsxChart.ObjectCount Property | FlexCel Studio for the .NET Framework documentation

XlsxChart.ObjectCount Property

The number of objects that are embedded inside this chart.

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 ObjectCount { get; }

See also

  • XlsxChart


XlsErr Enumeration | FlexCel Studio for the .NET Framework documentation

XlsErr Enumeration

Error Codes. We use this and not actual strings to make sure all are correctly spelled.

Syntax

Namespace: FlexCel.XlsAdapter

Members

Name | Value | Description
ErrInternal | 0 | Internal
ErrTooManyEntries | 1 | TooManyEntries
ErrInvalidContinue | 2 | InvalidContinue
ErrWrongExcelRecord | 3 | WrongExcelRecord
ErrExcelInvalid | 4 | ExcelInvalid
ErrFileIsPasswordProtected | 5 | FileIsPasswordProtected
ErrNotSupportedOnCE | 6 | NotSupportedOnCE
ErrFileIsNotXLS | 7 | FileIsNotXLS
ErrBadFormula | 8 | BadFormula
ErrBadName | 9 | BadName
ErrBadToken | 10 | BadToken
ErrWrongType | 11 | WrongType
ErrInvalidStream | 12 | InvalidStream
ErrEofReached | 13 | EofReached
ErrReadingRecord | 14 | ReadingRecord
ErrInvalidStringRecord | 15 | InvalidStringRecord
ErrInvalidVersion | 16 | InvalidVersion
ErrDupRow | 17 | DupRow
ErrRowMissing | 18 | RowMissing
ErrEscherNotLoaded | 19 | EscherNotLoaded
ErrLoadingEscher | 20 | LoadingEscher
ErrBStoreDuplicated | 21 | BStoreDuplicated
ErrDgDuplicated | 22 | DgDuplicated
ErrDggDuplicated | 23 | DggDuplicated
ErrSolverDuplicated | 24 | SolverDuplicated
ErrChangingEscher | 25 | ChangingEscher
ErrNotImplemented | 26 | NotImplemented
ErrCantCopyPictFmla | 27 | CantCopyPictFmla
ErrBadChartFormula | 28 | BadChartFormula
ErrSectionNotLoaded | 29 | SectionNotLoaded
ErrInvalidDrawing | 30 | InvalidDrawing
ErrXlsIndexOutBounds | 31 | XlsIndexOutBounds
ErrBadCF | 32 | BadCF
ErrInvalidCF | 33 | InvalidCF
ErrInvalidSheetNo | 34 | InvalidSheetNo
ErrDuplicatedSheetName | 35 | DuplicatedSheetName
ErrTooManyPageBreaks | 36 | TooManyPageBreaks
ErrInvalidRow | 37 | InvalidRow
ErrInvalidCol | 38 | InvalidCol
ErrBadRowCount | 39 | BadRowCount
ErrShrFmlaNotFound | 40 | ShrFmlaNotFound
ErrHiddenSheetSelected | 41 | HiddenSheetSelected
ErrNoSheetVisible | 42 | NoSheetVisible
ErrBadCopyRows | 43 | BadCopyRows
ErrBadCopyCols | 44 | BadCopyCols
ErrBadMoveCall | 45 | BadMoveCall
BaseSheetName | 46 | eSheetName
ErrCantDeleteSheetWithMacros | 47 | CantDeleteSheetWithMacros
ErrCantRenameSheetCodenameWithMacros | 48 | ErrCantRenameSheetCodenameWithMacros
ErrTooManyRows | 49 | TooManyRows
ErrTooManyColumns | 50 | TooManyColumns
ErrTooManySheets | 51 | Trying to insert more than 65536 sheets.
ErrInvalidPassword | 52 | Invalid password.
ErrPasswordTooLong | 53 | Password too long.
ErrNotSupportedEncryption | 54 | Encryption method is not supported.
ErrInvalidNameForARange | 55 | The name for a named range is invalid. It should have no more than 255 characters, must no start with a number, and must not contain some special characters.
ErrNameAlreadyExistsAtDifferentIndex | 56 | The name already exists at a different position in the file.
ErrNameCantBeNamedSameAsATable | 57 | The name can't be the same of one existing Excel-Table.
ErrObjectNotFound | 58 | Could not find the object path inside the shape.
ErrInvalidArrayElement | 59 | The array element is not any of the supported types.
ErrPxlIsInvalid | 60 | The Pocket Excel file (Pxl) is not on a format FlexCel can understand.
ErrPxlIsInvalidToken | 61 | The Pocket Excel file (Pxl) is not on a format FlexCel can understand. Token invalid.
ErrStringTooLong | 62 | The string is longer than the maximum allowed by Excel.
ErrStringEmpty | 63 | The string can't be empty.
ErrHeaderFooterStringTooLong | 64 | The string for a header or footer is longer than the maximum allowed by Excel.
ErrFileIsNotSupported | 65 | The file is not on any on the formats supported by FlexCel (Excel 2 or newer, Pxl).
ErrPxlDoesNotHaveExternalFormulas | 66 | Pocket Excel does not have support for formulas that reference external files.
ErrInvalidPropertySector | 67 | Cannot read the properties of this file.
ErrInvalidChart | 68 | Chart is invalid.
ErrMoveRangesCanNotIntersect | 69 | Ranges in move calls cannot intersect.
ErrCantMovePartOfTable | 70 | Can't move a part of a table.
ErrCantMovePartOfArrayFormula | 71 | Can't move a part of an Array formula.
ErrMoveRangeOutsideBounds | 72 | Trying to move a range outside bounds.
ErrTooManyCFRules | 73 | Too many Conditional format rules.
ErrTooManyXFDefs | 74 | Too many format definitions.
ErrDataValidationFmla1TooLong | 75 | First formula of Data validation has more than 255 characters.
ErrDataValidationFmla2TooLong | 76 | Second Formula of Data validation has more than 255 characters.
ErrDataValidationFmla1Null | 77 | First formula of Data validation is null.
ErrDataValidationFmla2Null | 78 | Second formula of Data validation is null.
ErrInvalidHyperLink | 79 | Invalid Hyperlink.
ErrInvalidHyperLinkType | 80 | Invalid type of Hyperlink.
ErrInvalidFormatStringLength | 81 | Maximum length for a format string is 255 characters.
ErrInvalidFormatId | 82 | Too many custom numeric formats.
ErrStreamNeedsReadAccess | 83 | In order to save as xlsx, the stream needs to have read access besides write.
ErrFileSize0 | 84 | The file we are trying to open has zero size.
ErrStreamAtEnd | 85 | Stream is at the end.
ErrNullGradient | 86 | If you specify a gradient pattern, then gradient definition can't be null
ErrRangeMustHaveSameSheet | 87 | Both sheets in the range must be the same
ErrMissingPart | 88 | There is a part missing from the xlsx file.
ErrMalformedXml | 89 | File has malformed xml, and .net 3.5 can't read it.
SheetAlreadyProcessed | 90 | Sheet has already been processed.
RecoveryInvalidName | 91 | A corrupt file has an invalid name.
RecoveryInvalidFmla | 92 | A corrupt file has an invalid formula.
RecoveryInvalidFormat | 93 | A corrupt file has an invalid format.
ErrCustomPropIdRepeated | 94 | The id is repeated.
ErrCustomPropIdInvalid | 95 | The id is invalid.
TableHeadersMustBeStrings | 96 | The headers in a table must be strings.
TableHeadersMustBeUnique | 97 | Table headers must be unique.
TableNameInvalid | 98 | The name of the table is not valid.
TableColumnsDontMatchRange | 99 | The number of columns in the column definitions is different from the number of columns in the table range.
TablesMustHaveAtLeastOneRow | 100 | A table must have at least one row.
DeletingTooManySheets | 101 | Deleting more sheets than the sheets in the file.
ErrInvalidChartOptions | 102 | The chart options are of the wrong type.
ErrCantChangeAPieToDoughnut | 103 | Can't change a pie chart into a doughnut chart.
ErrCantChangeADoughnutToPie | 104 | Can't change a doughnut chart into a pie chart.
ErrInvalidNegativeAxisId | 105 | Axis id must be positive.
ErrInvalidAxisId | 106 | The axis id is too big.
ErrInvalidCodeNameStart | 107 | Codenames should start with a letter.
ErrInvalidCodeNameChar | 108 | Codenames should be ASCII.
ErrInvalidCodeNameLen | 109 | CodeNames must be less than 32 characters.
SeriesIsntBubble | 110 | Series must be a bubble series.
ErrTooManySeries | 111 | Trying to insert more than 255 series in a chart.
ErrCantAddTrendLineToChart | 112 | The type of chart doesn't allow a trendline.
ErrThisOverloadDoesntSupportArrays | 113 | This version of the method doesn't support array formulas.


FlexCel.Winforms Namespace | FlexCel Studio for the .NET Framework documentation

FlexCel.Winforms Namespace

This namespace is composed by bonus components not included on the main FlexCel assembly. FlexCel.dll is by nature not dependent on Winforms or ASP.NET, so it has no references to them. Classes on this assembly are specific to Winforms.

Classes

Name | Description
FlexCelPreview | A Simple replacement for PrintPreviewControl that allows you to preview even if the user has no printers installed. View the demo on Custom Preview to see how it is used.

Enumerations

Name | Description
TAutofitPreview | How the preview will be zoomed.


FlexCelPreview Class | FlexCel Studio for the .NET Framework documentation

FlexCelPreview Class

A Simple replacement for PrintPreviewControl that allows you to preview even if the user has no printers installed. View the demo on Custom Preview to see how it is used.

Syntax

Namespace: FlexCel.Winforms

public class FlexCelPreview: UserControl

Constructors

Name | Description
FlexCelPreview | Creates a new instance of FlexCelPreview.

Methods

Name | Description
Dispose | Clean up any resources being used.
OnStartPageChanged | Replace this event when creating a custom descendant of FlexCelPreview.
OnZoomChanged | Replace this event when creating a custom descendant of FlexCelPreview.
InvalidatePreview | Invalidates the preview and forces the control to reload from the document. When the control is a Thumbnail you cannot Invalidate it, this will be done automatically when you invalidate the main view.
AutofitPreviewOnce | Use this method to do a single autofit. If you want the preview to be in "autofit mode" so it keeps autofitting even if you resize the window, set AutofitPreview instead.
OnMouseDown | Overrides the standard mousedown event to handle it.
ProcessCmdKey | Overrides the ProcessCmdKey event.
OnFontChanged | Overrides the OnfontChanged event.
OnResize | Overrides de OnResize method.
OnPaint | Overrides the OnPaint event.

Properties

Name | Description
ScreenResolution | Returns the screen resolution being used.
ScreenScale | This is the ScreenResoulution divided by 96. So an screen with 100% magnification (96 dpi) will have a ScreenScale of 1, while a screen with 200% magnification will have a ScreenScale of 2.
Document | Document to be Previewed.
PageXSeparation | Separation (in display units) between a page an the next. Note that if CenteredPreview is true and the preview window is bigger than the page being displayed, this value has no effect.
CenteredPreview | When true, the preview will be drawn at the middle of the window, instead of at the left. If true, then PageXSeparation is the minimum margin that the preview will have.
PageYSeparation | Separation (in display units) between a page an the next.
EndPreviewAtLastPage | When true, the preview will stop at the last page, and if you are showing more than one page at the same time you won't be able to select the last page. When false, FlexCelPreview will add enough space after the last page so all pages are selectable. Note that in normal cases this won't make a difference, this property only applies if zoom is so small that you can see more than one page in the preview.
AutofitPreview | Defines if the page will be automatically zoomed to fit in the preview. Note that zoom will never be less than 10% or 400%. If you want to autofit just once, call AutofitPreviewOnce instead.
StartPage | Page the preview is showing.
TotalPages | Number of pages displaying.
Zoom | Zoom preview.
CacheSize | The cache size in number of pages stored at 100% zoom. For larger zoom actual number of pages is decreased by (Zoom*Zoom)
ShowThumbsPageNumber | If true, the thumbnails will display the page number. Note that this property only affects the thumbnails, not the main preview.
ThumbnailSmall | When using this component on Thumbnail mode, set this property to another FlexCelPreview component that will hold the small Thumbnail images.
ThumbnailLarge | When using this component on Thumbnail mode, set this property to another FlexCelPreview component that will hold the large Thumbnail images.
SmoothingMode | This affects how the images are rendered on the screen. Some modes will look a little blurred but with better quality. Consult the .NET framework documentation on SmoothingMode for more information
InterpolationMode | This affects how the images are rendered on the screen. Some modes will look a little blurred but with better quality. Consult the .NET framework documentation on SmoothingMode for more information
AutoScroll | Indicates whether scrollbars appear automatically when needed.
BackColor | Background color for the preview.
PageShadowSize | Shadow size for the pages in the preview. Set it to 0 to disable shadows.
PageShadowColor | Shadow color for the pages in the preview.
PageBorderColor | Border color for the pages in the preview.
PageBorderWidth | Border width for the pages in the preview.
PageBorderStyle | Border style for the pages in the preview.
PageNumberBgColor | Background color for the page numbers in the thumbnail view.
PageNumberSelected​BgColor | Background color for the selected page number in the thumbnail view.
PageNumberTextColor | Text color for the page number in the thumbnail view.
PageNumberSelected​Text​Color | Text color for the selected page number in the thumbnail view.
MaxPageSize | Returns the maximum height and width of a page. Note that width and height might not be from the same page, this is the width of the widest page and the height of the tallest page.

Events

Name | Description
StartPageChanged | Fires when the starting page changes.
ZoomChanged | Fires when the Zoom changes. (for example, the user uses ctrl+MouseWeel).


FlexCelPreview.FlexCelPreview Constructor | FlexCel Studio for the .NET Framework documentation

FlexCelPreview.FlexCelPreview Constructor

Creates a new instance of FlexCelPreview.

Syntax

Namespace: FlexCel.Winforms

public FlexCelPreview()

See also

  • FlexCelPreview


FlexCelPreview.Dispose Method | FlexCel Studio for the .NET Framework documentation

FlexCelPreview.Dispose Method

Clean up any resources being used.

Syntax

Namespace: FlexCel.Winforms

protected override void Dispose(Boolean disposing)

Parameters

<-> | Parameter | Type | Description
 | disposing | Boolean |

See also

  • FlexCelPreview


FlexCelPreview.OnStartPageChanged Method | FlexCel Studio for the .NET Framework documentation

FlexCelPreview.OnStartPageChanged Method

Replace this event when creating a custom descendant of FlexCelPreview.

Syntax

Namespace: FlexCel.Winforms

protected virtual void OnStartPageChanged(EventArgs e)

Parameters

<-> | Parameter | Type | Description
 | e | EventArgs |

See also

  • FlexCelPreview


FlexCelPreview.OnZoomChanged Method | FlexCel Studio for the .NET Framework documentation

FlexCelPreview.OnZoomChanged Method

Replace this event when creating a custom descendant of FlexCelPreview.

Syntax

Namespace: FlexCel.Winforms

protected virtual void OnZoomChanged(EventArgs e)

Parameters

<-> | Parameter | Type | Description
 | e | EventArgs |

See also

  • FlexCelPreview


FlexCelPreview.InvalidatePreview Method | FlexCel Studio for the .NET Framework documentation

FlexCelPreview.InvalidatePreview Method

Invalidates the preview and forces the control to reload from the document. When the control is a Thumbnail you cannot Invalidate it, this will be done automatically when you invalidate the main view.

Syntax

Namespace: FlexCel.Winforms

public void InvalidatePreview()

See also

  • FlexCelPreview


FlexCelPreview.AutofitPreviewOnce Method | FlexCel Studio for the .NET Framework documentation

FlexCelPreview.AutofitPreviewOnce Method

Use this method to do a single autofit. If you want the preview to be in "autofit mode" so it keeps autofitting even if you resize the window, set AutofitPreview instead.

Syntax

Namespace: FlexCel.Winforms

public void AutofitPreviewOnce(TAutofitPreview value)

Parameters

<-> | Parameter | Type | Description
 | value | TAutofitPreview |

See also

  • FlexCelPreview


FlexCelPreview.OnMouseDown Method | FlexCel Studio for the .NET Framework documentation

FlexCelPreview.OnMouseDown Method

Overrides the standard mousedown event to handle it.

Syntax

Namespace: FlexCel.Winforms

protected override void OnMouseDown(MouseEventArgs e)

Parameters

<-> | Parameter | Type | Description
 | e | MouseEventArgs |

See also

  • FlexCelPreview


FlexCelPreview.ProcessCmdKey Method | FlexCel Studio for the .NET Framework documentation

FlexCelPreview.ProcessCmdKey Method

Overrides the ProcessCmdKey event.

Syntax

Namespace: FlexCel.Winforms

protected override Boolean ProcessCmdKey(ref Message msg, Keys keyData)

Parameters

<-> | Parameter | Type | Description
ref | msg | Message |
 | keyData | Keys |

See also

  • FlexCelPreview


FlexCelPreview.OnFontChanged Method | FlexCel Studio for the .NET Framework documentation

FlexCelPreview.OnFontChanged Method

Overrides the OnfontChanged event.

Syntax

Namespace: FlexCel.Winforms

protected override void OnFontChanged(EventArgs e)

Parameters

<-> | Parameter | Type | Description
 | e | EventArgs |

See also

  • FlexCelPreview


FlexCelPreview.OnResize Method | FlexCel Studio for the .NET Framework documentation

FlexCelPreview.OnResize Method

Overrides de OnResize method.

Syntax

Namespace: FlexCel.Winforms

protected override void OnResize(EventArgs e)

Parameters

<-> | Parameter | Type | Description
 | e | EventArgs |

See also

  • FlexCelPreview


FlexCelPreview.OnPaint Method | FlexCel Studio for the .NET Framework documentation

FlexCelPreview.OnPaint Method

Overrides the OnPaint event.

Syntax

Namespace: FlexCel.Winforms

protected override void OnPaint(PaintEventArgs pe)

Parameters

<-> | Parameter | Type | Description
 | pe | PaintEventArgs |

See also

  • FlexCelPreview


FlexCelPreview.ScreenResolution Property | FlexCel Studio for the .NET Framework documentation

FlexCelPreview.ScreenResolution Property

Returns the screen resolution being used.

Syntax

Namespace: FlexCel.Winforms

public Double ScreenResolution { get; }

See also

  • FlexCelPreview


FlexCelPreview.ScreenScale Property | FlexCel Studio for the .NET Framework documentation

FlexCelPreview.ScreenScale Property

This is the ScreenResoulution divided by 96. So an screen with 100% magnification (96 dpi) will have a ScreenScale of 1, while a screen with 200% magnification will have a ScreenScale of 2.

Syntax

Namespace: FlexCel.Winforms

public Double ScreenScale { get; }

See also

  • FlexCelPreview


FlexCelPreview.Document Property | FlexCel Studio for the .NET Framework documentation

FlexCelPreview.Document Property

Document to be Previewed.

Syntax

Namespace: FlexCel.Winforms

public FlexCelImgExport Document { get; set; }

See also

  • FlexCelPreview


FlexCelPreview.PageXSeparation Property | FlexCel Studio for the .NET Framework documentation

FlexCelPreview.PageXSeparation Property

Separation (in display units) between a page an the next. Note that if CenteredPreview is true and the preview window is bigger than the page being displayed, this value has no effect.

Syntax

Namespace: FlexCel.Winforms

public Int32 PageXSeparation { get; set; }

See also

  • FlexCelPreview


FlexCelPreview.CenteredPreview Property | FlexCel Studio for the .NET Framework documentation

FlexCelPreview.CenteredPreview Property

When true, the preview will be drawn at the middle of the window, instead of at the left. If true, then PageXSeparation is the minimum margin that the preview will have.

Syntax

Namespace: FlexCel.Winforms

public Boolean CenteredPreview { get; set; }

See also

  • FlexCelPreview


FlexCelPreview.PageYSeparation Property | FlexCel Studio for the .NET Framework documentation

FlexCelPreview.PageYSeparation Property

Separation (in display units) between a page an the next.

Syntax

Namespace: FlexCel.Winforms

public Int32 PageYSeparation { get; set; }

See also

  • FlexCelPreview


FlexCelPreview.EndPreviewAtLastPage Property | FlexCel Studio for the .NET Framework documentation

FlexCelPreview.EndPreviewAtLastPage Property

When true, the preview will stop at the last page, and if you are showing more than one page at the same time you won't be able to select the last page. When false, FlexCelPreview will add enough space after the last page so all pages are selectable. Note that in normal cases this won't make a difference, this property only applies if zoom is so small that you can see more than one page in the preview.

Syntax

Namespace: FlexCel.Winforms

public Boolean EndPreviewAtLastPage { get; set; }

See also

  • FlexCelPreview


FlexCelPreview.AutofitPreview Property | FlexCel Studio for the .NET Framework documentation

FlexCelPreview.AutofitPreview Property

Defines if the page will be automatically zoomed to fit in the preview. Note that zoom will never be less than 10% or 400%. If you want to autofit just once, call AutofitPreviewOnce instead.

Syntax

Namespace: FlexCel.Winforms

public TAutofitPreview AutofitPreview { get; set; }

See also

  • FlexCelPreview


FlexCelPreview.StartPage Property | FlexCel Studio for the .NET Framework documentation

FlexCelPreview.StartPage Property

Page the preview is showing.

Syntax

Namespace: FlexCel.Winforms

public Int32 StartPage { get; set; }

See also

  • FlexCelPreview


FlexCelPreview.TotalPages Property | FlexCel Studio for the .NET Framework documentation

FlexCelPreview.TotalPages Property

Number of pages displaying.

Syntax

Namespace: FlexCel.Winforms

public Int32 TotalPages { get; }

See also

  • FlexCelPreview


FlexCelPreview.Zoom Property | FlexCel Studio for the .NET Framework documentation

FlexCelPreview.Zoom Property

Zoom preview.

Syntax

Namespace: FlexCel.Winforms

public Double Zoom { get; set; }

See also

  • FlexCelPreview


FlexCelPreview.CacheSize Property | FlexCel Studio for the .NET Framework documentation

FlexCelPreview.CacheSize Property

The cache size in number of pages stored at 100% zoom. For larger zoom actual number of pages is decreased by (Zoom*Zoom)

Syntax

Namespace: FlexCel.Winforms

public Int32 CacheSize { get; set; }

See also

  • FlexCelPreview


FlexCelPreview.ShowThumbsPageNumber Property | FlexCel Studio for the .NET Framework documentation

FlexCelPreview.ShowThumbsPageNumber Property

If true, the thumbnails will display the page number. Note that this property only affects the thumbnails, not the main preview.

Syntax

Namespace: FlexCel.Winforms

public Boolean ShowThumbsPageNumber { get; set; }

See also

  • FlexCelPreview


FlexCelPreview.ThumbnailSmall Property | FlexCel Studio for the .NET Framework documentation

FlexCelPreview.ThumbnailSmall Property

When using this component on Thumbnail mode, set this property to another FlexCelPreview component that will hold the small Thumbnail images.

Syntax

Namespace: FlexCel.Winforms

public FlexCelPreview ThumbnailSmall { get; set; }

See also

  • FlexCelPreview


FlexCelPreview.ThumbnailLarge Property | FlexCel Studio for the .NET Framework documentation

FlexCelPreview.ThumbnailLarge Property

When using this component on Thumbnail mode, set this property to another FlexCelPreview component that will hold the large Thumbnail images.

Syntax

Namespace: FlexCel.Winforms

public FlexCelPreview ThumbnailLarge { get; set; }

See also

  • FlexCelPreview


FlexCelPreview.SmoothingMode Property | FlexCel Studio for the .NET Framework documentation

FlexCelPreview.SmoothingMode Property

This affects how the images are rendered on the screen. Some modes will look a little blurred but with better quality. Consult the .NET framework documentation on SmoothingMode for more information

Syntax

Namespace: FlexCel.Winforms

public SmoothingMode SmoothingMode { get; set; }

See also

  • FlexCelPreview


FlexCelPreview.InterpolationMode Property | FlexCel Studio for the .NET Framework documentation

FlexCelPreview.InterpolationMode Property

This affects how the images are rendered on the screen. Some modes will look a little blurred but with better quality. Consult the .NET framework documentation on SmoothingMode for more information

Syntax

Namespace: FlexCel.Winforms

public InterpolationMode InterpolationMode { get; set; }

See also

  • FlexCelPreview


FlexCelPreview.AutoScroll Property | FlexCel Studio for the .NET Framework documentation

FlexCelPreview.AutoScroll Property

Indicates whether scrollbars appear automatically when needed.

Syntax

Namespace: FlexCel.Winforms

public override Boolean AutoScroll { get; set; }

See also

  • FlexCelPreview


FlexCelPreview.BackColor Property | FlexCel Studio for the .NET Framework documentation

FlexCelPreview.BackColor Property

Background color for the preview.

Syntax

Namespace: FlexCel.Winforms

public override Color BackColor { get; set; }

See also

  • FlexCelPreview


FlexCelPreview.PageShadowSize Property | FlexCel Studio for the .NET Framework documentation

FlexCelPreview.PageShadowSize Property

Shadow size for the pages in the preview. Set it to 0 to disable shadows.

Syntax

Namespace: FlexCel.Winforms

public Double PageShadowSize { get; set; }

See also

  • FlexCelPreview


FlexCelPreview.PageShadowColor Property | FlexCel Studio for the .NET Framework documentation

FlexCelPreview.PageShadowColor Property

Shadow color for the pages in the preview.

Syntax

Namespace: FlexCel.Winforms

public Color PageShadowColor { get; set; }

See also

  • FlexCelPreview


FlexCelPreview.PageBorderColor Property | FlexCel Studio for the .NET Framework documentation

FlexCelPreview.PageBorderColor Property

Border color for the pages in the preview.

Syntax

Namespace: FlexCel.Winforms

public Color PageBorderColor { get; set; }

See also

  • FlexCelPreview


FlexCelPreview.PageBorderWidth Property | FlexCel Studio for the .NET Framework documentation

FlexCelPreview.PageBorderWidth Property

Border width for the pages in the preview.

Syntax

Namespace: FlexCel.Winforms

public Double PageBorderWidth { get; set; }

See also

  • FlexCelPreview


FlexCelPreview.PageBorderStyle Property | FlexCel Studio for the .NET Framework documentation

FlexCelPreview.PageBorderStyle Property

Border style for the pages in the preview.

Syntax

Namespace: FlexCel.Winforms

public DashStyle PageBorderStyle { get; set; }

See also

  • FlexCelPreview


FlexCelPreview.PageNumberBgColor Property | FlexCel Studio for the .NET Framework documentation

FlexCelPreview.PageNumberBgColor Property

Background color for the page numbers in the thumbnail view.

Syntax

Namespace: FlexCel.Winforms

public Color PageNumberBgColor { get; set; }

See also

  • FlexCelPreview


FlexCelPreview.PageNumberSelectedBgColor Property | FlexCel Studio for the .NET Framework documentation

FlexCelPreview.PageNumberSelectedBgColor Property

Background color for the selected page number in the thumbnail view.

Syntax

Namespace: FlexCel.Winforms

public Color PageNumberSelectedBgColor { get; set; }

See also

  • FlexCelPreview


FlexCelPreview.PageNumberTextColor Property | FlexCel Studio for the .NET Framework documentation

FlexCelPreview.PageNumberTextColor Property

Text color for the page number in the thumbnail view.

Syntax

Namespace: FlexCel.Winforms

public Color PageNumberTextColor { get; set; }

See also

  • FlexCelPreview


FlexCelPreview.PageNumberSelectedTextColor Property | FlexCel Studio for the .NET Framework documentation

FlexCelPreview.PageNumberSelectedTextColor Property

Text color for the selected page number in the thumbnail view.

Syntax

Namespace: FlexCel.Winforms

public Color PageNumberSelectedTextColor { get; set; }

See also

  • FlexCelPreview


FlexCelPreview.MaxPageSize Property | FlexCel Studio for the .NET Framework documentation

FlexCelPreview.MaxPageSize Property

Returns the maximum height and width of a page. Note that width and height might not be from the same page, this is the width of the widest page and the height of the tallest page.

Syntax

Namespace: FlexCel.Winforms

public TUISize MaxPageSize { get; }

See also

  • FlexCelPreview


FlexCelPreview.StartPageChanged Event | FlexCel Studio for the .NET Framework documentation

FlexCelPreview.StartPageChanged Event

Fires when the starting page changes.

Syntax

Namespace: FlexCel.Winforms

public EventHandler StartPageChanged

See also

  • FlexCelPreview


FlexCelPreview.ZoomChanged Event | FlexCel Studio for the .NET Framework documentation

FlexCelPreview.ZoomChanged Event

Fires when the Zoom changes. (for example, the user uses ctrl+MouseWeel).

Syntax

Namespace: FlexCel.Winforms

public EventHandler ZoomChanged

See also

  • FlexCelPreview


TAutofitPreview Enumeration | FlexCel Studio for the .NET Framework documentation

TAutofitPreview Enumeration

How the preview will be zoomed.

Syntax

Namespace: FlexCel.Winforms

Members

Name | Value | Description
None | 0 | No autofit. The value in Zoom is used.
Width | 1 | Fit to the width of the biggest page in the preview, so it displays without horizontal scroll bars.
Height | 2 | Fit to the height of the biggest page in the preview.
Full | 3 | Fit so the biggest page in the preview can be seen at full without scrolling.


FlexCel.AspNet Namespace | FlexCel Studio for the .NET Framework documentation

FlexCel.AspNet Namespace

Classes for using FlexCel directly in ASP.NET as WebForms components.

Classes

Name | Description
FlexCelAspExport | A FlexCelHtmlExport specialized to export pages with FlexCelAspViewer. This class is mainly for internal use, there is no need to use it directly.
FlexCelAspViewer | An ASP.NET component that can be used to embed an Excel file as HTML in a WebForm.
FlexCelHtmlImage​Handler | This is a base image handler you can use to create your own. This code is adapted from here: http:​//​www.​hanselman.​com/​blog/​Perma​Link,​guid,​5c59d662-​b250-​4eb2-​96e4-​f274295bd52e.​aspx We would like to thank Scott Hanselman for the insightful article.
ImageLinkEventArgs | Arguments passed on FlexCelAspViewer.​Image​Link,
UniqueTemporary​Files​Image​Handler | The image handler used when you select TImageExport​Mode.​Unique​Temporary​Files

Enumerations

Name | Description
THtmlSheetExport | Defines how many sheets will be exported.
TImageExportMode | How images on the Excel file will be stored in order to be served to the browser.

Delegates

Name | Description
ImageLinkEvent​Handler | Delegate used to specify where to store the images on a page.


FlexCelAspExport Class | FlexCel Studio for the .NET Framework documentation

FlexCelAspExport Class

A FlexCelHtmlExport specialized to export pages with FlexCelAspViewer. This class is mainly for internal use, there is no need to use it directly.

Syntax

Namespace: FlexCel.AspNet

public class FlexCelAspExport: FlexCelHtmlExport

Constructors

Name | Description
FlexCelAspExport | Constructs a new instance of FlexCelHtmlExport.

Methods

Name | Description
OnGetImageInformation | Intercepts the original OnGetImageInformation event to provide the parameters for FlexCelAspExport.
OnSaveImage | Intercepts the original OnGetSaveImage event to provide the parameters for FlexCelAspExport.
OnNamedRangeExport | Intercepts the original OnNamedRangeExport event to provide the parameters for FlexCelAspExport.

Properties

Name | Description
HasSaveImageEvent | Returns true if the viewer has a SaveImage event assigned.


FlexCelAspExport.FlexCelAspExport Constructor | FlexCel Studio for the .NET Framework documentation

FlexCelAspExport.FlexCelAspExport Constructor

Constructs a new instance of FlexCelHtmlExport.

Syntax

Namespace: FlexCel.AspNet

public FlexCelAspExport(FlexCelAspViewer aViewer)

Parameters

<-> | Parameter | Type | Description
 | aViewer | FlexCelAspViewer | Viewer that this exporter will be serving.

See also

  • FlexCelAspExport


FlexCelAspExport.OnGetImageInformation Method | FlexCel Studio for the .NET Framework documentation

FlexCelAspExport.OnGetImageInformation Method

Intercepts the original OnGetImageInformation event to provide the parameters for FlexCelAspExport.

Syntax

Namespace: FlexCel.AspNet

protected override void OnGetImageInformation(ImageInformationEventArgs e)

Parameters

<-> | Parameter | Type | Description
 | e | ImageInformation​Event​Args |

See also

  • FlexCelAspExport


FlexCelAspExport.OnSaveImage Method | FlexCel Studio for the .NET Framework documentation

FlexCelAspExport.OnSaveImage Method

Intercepts the original OnGetSaveImage event to provide the parameters for FlexCelAspExport.

Syntax

Namespace: FlexCel.AspNet

protected override void OnSaveImage(SaveImageEventArgs e)

Parameters

<-> | Parameter | Type | Description
 | e | SaveImageEventArgs |

See also

  • FlexCelAspExport


FlexCelAspExport.OnNamedRangeExport Method | FlexCel Studio for the .NET Framework documentation

FlexCelAspExport.OnNamedRangeExport Method

Intercepts the original OnNamedRangeExport event to provide the parameters for FlexCelAspExport.

Syntax

Namespace: FlexCel.AspNet

protected override void OnNamedRangeExport(NamedRangeExportEventArgs e)

Parameters

<-> | Parameter | Type | Description
 | e | NamedRangeExport​Event​Args |

See also

  • FlexCelAspExport


FlexCelAspExport.HasSaveImageEvent Property | FlexCel Studio for the .NET Framework documentation

FlexCelAspExport.HasSaveImageEvent Property

Returns true if the viewer has a SaveImage event assigned.

Syntax

Namespace: FlexCel.AspNet

public override Boolean HasSaveImageEvent { get; }

See also

  • FlexCelAspExport


FlexCelAspViewer Class | FlexCel Studio for the .NET Framework documentation

FlexCelAspViewer Class

An ASP.NET component that can be used to embed an Excel file as HTML in a WebForm.

Syntax

Namespace: FlexCel.AspNet

public class FlexCelAspViewer: WebControl

Constructors

Name | Description
FlexCelAspViewer | Creates a new instance of FlexCelAspViewer.

Methods

Name | Description
OnImageLink | Replace this event when creating a custom descendant of FlexCelAspViewer.
OnSaveImage | Replace this event when creating a custom descendant of FlexCelAspViewer.
OnNamedRangeExport | Replace this event when creating a custom descendant of FlexCelAspViewer.
OnPreRender | This prerender method is overriden so it saves the CSS rules to the head part of the html file.
RenderContents | Method overriden to return the exported xls file as HTML.

Properties

Name | Description
HtmlExport | Component that will do the actual conversion from an Excel file to HTML. Most of the export settings should be changed in this component.
SheetExport | Defines how many sheets will be exported.
SheetSeparator | Defines a separator between multiple sheets when exporting all visible sheets. You can use for example <hr> here to write an horizontal ruler between sheets.
RelativeImagePath | Path where the images will be stored, relative to the path where the page is in. Try to use a different folder for the images, so it is easier to delete them later.
ImageExportMode | How the images will be served to the browser. See t'Creating a file using flexcelaspviewer component' in the Html Exporting Guide for more information.
ImageTimeout | Time in minutes that temporary images will live in the server before being deleted. Temporary images older than "current date - imageTimeOut" will be removed each time a new call to this component is made. Set this property to 0 or a negative value to not delete any image, if you wish to do the cleanup yourself using a server script. See also MaxTemporaryImages
MaxTemporaryImages | Maximum number of temporary images in the images folder. Set it to 0 or a negative value if you want unlimited images. Use this variable to avoid Denial of Service conditions. For example, a malicious user could keep continuously refreshing the webpage, without waiting for the page to load. As all images are created each time he refreshes, but they are never deleted (because they are never requested back) the disk could fill very fast, not giving time to the ImageTimeout ...[more]
ImageHandlerName | Name for the ImageHandler used to return images when ImageExportMode is not TImageExport​Mode.​Temporary​Files. You need to add this name in web.config in your app.
ImageParameterName | Name for the parameter used to return the image in the URL. name when ImageExportMode is TImageExport​Mode.​Unique​Temporary​Files. This parameter will appear in the url as: http:​//​server/​.​.​.​/flexcelviewer.​ashx?​IMAGEPARAMETERNAME=​Imagename

Events

Name | Description
ImageLink | Use this event to customize the links in the HTML file when using TImageExport​Mode.​Custom​Storage.
SaveImage | Use this event to save the images into other place. You will normally need to use this event when implementing your own Http Handler to return the images.
NamedRangeExport | Use this event to customize how a named range if exported to the HTML file. Note that for this event to be called, you first need to set HtmlExport.ExportNamedRanges = true. If you want to change the id that will be exported or exclude certain named from being exported, you can do so here.


FlexCelAspViewer.FlexCelAspViewer Constructor | FlexCel Studio for the .NET Framework documentation

FlexCelAspViewer.FlexCelAspViewer Constructor

Creates a new instance of FlexCelAspViewer.

Syntax

Namespace: FlexCel.AspNet

public FlexCelAspViewer()

See also

  • FlexCelAspViewer


FlexCelAspViewer.OnImageLink Method | FlexCel Studio for the .NET Framework documentation

FlexCelAspViewer.OnImageLink Method

Replace this event when creating a custom descendant of FlexCelAspViewer.

Syntax

Namespace: FlexCel.AspNet

protected internal virtual void OnImageLink(ImageLinkEventArgs e)

Parameters

<-> | Parameter | Type | Description
 | e | ImageLinkEventArgs |

See also

  • FlexCelAspViewer


FlexCelAspViewer.OnSaveImage Method | FlexCel Studio for the .NET Framework documentation

FlexCelAspViewer.OnSaveImage Method

Replace this event when creating a custom descendant of FlexCelAspViewer.

Syntax

Namespace: FlexCel.AspNet

protected internal virtual void OnSaveImage(SaveImageEventArgs e)

Parameters

<-> | Parameter | Type | Description
 | e | SaveImageEventArgs |

See also

  • FlexCelAspViewer


FlexCelAspViewer.OnNamedRangeExport Method | FlexCel Studio for the .NET Framework documentation

FlexCelAspViewer.OnNamedRangeExport Method

Replace this event when creating a custom descendant of FlexCelAspViewer.

Syntax

Namespace: FlexCel.AspNet

protected internal virtual void OnNamedRangeExport(NamedRangeExportEventArgs e)

Parameters

<-> | Parameter | Type | Description
 | e | NamedRangeExport​Event​Args |

See also

  • FlexCelAspViewer


FlexCelAspViewer.OnPreRender Method | FlexCel Studio for the .NET Framework documentation

FlexCelAspViewer.OnPreRender Method

This prerender method is overriden so it saves the CSS rules to the head part of the html file.

Syntax

Namespace: FlexCel.AspNet

protected override void OnPreRender(EventArgs e)

Parameters

<-> | Parameter | Type | Description
 | e | EventArgs |

See also

  • FlexCelAspViewer


FlexCelAspViewer.RenderContents Method | FlexCel Studio for the .NET Framework documentation

FlexCelAspViewer.RenderContents Method

Method overriden to return the exported xls file as HTML.

Syntax

Namespace: FlexCel.AspNet

protected override void RenderContents(HtmlTextWriter writer)

Parameters

<-> | Parameter | Type | Description
 | writer | HtmlTextWriter |

See also

  • FlexCelAspViewer


FlexCelAspViewer.HtmlExport Property | FlexCel Studio for the .NET Framework documentation

FlexCelAspViewer.HtmlExport Property

Component that will do the actual conversion from an Excel file to HTML. Most of the export settings should be changed in this component.

Syntax

Namespace: FlexCel.AspNet

public FlexCelAspExport HtmlExport { get; }

See also

  • FlexCelAspViewer


FlexCelAspViewer.SheetExport Property | FlexCel Studio for the .NET Framework documentation

FlexCelAspViewer.SheetExport Property

Defines how many sheets will be exported.

Syntax

Namespace: FlexCel.AspNet

public THtmlSheetExport SheetExport { get; set; }

See also

  • FlexCelAspViewer


FlexCelAspViewer.SheetSeparator Property | FlexCel Studio for the .NET Framework documentation

FlexCelAspViewer.SheetSeparator Property

Defines a separator between multiple sheets when exporting all visible sheets. You can use for example <hr> here to write an horizontal ruler between sheets.

Syntax

Namespace: FlexCel.AspNet

public String SheetSeparator { get; set; }

See also

  • FlexCelAspViewer


FlexCelAspViewer.RelativeImagePath Property | FlexCel Studio for the .NET Framework documentation

FlexCelAspViewer.RelativeImagePath Property

Path where the images will be stored, relative to the path where the page is in. Try to use a different folder for the images, so it is easier to delete them later.

Syntax

Namespace: FlexCel.AspNet

public String RelativeImagePath { get; set; }

See also

  • FlexCelAspViewer


FlexCelAspViewer.ImageExportMode Property | FlexCel Studio for the .NET Framework documentation

FlexCelAspViewer.ImageExportMode Property

How the images will be served to the browser. See t'Creating a file using flexcelaspviewer component' in the Html Exporting Guide for more information.

Syntax

Namespace: FlexCel.AspNet

public TImageExportMode ImageExportMode { get; set; }

See also

  • FlexCelAspViewer


FlexCelAspViewer.ImageTimeout Property | FlexCel Studio for the .NET Framework documentation

FlexCelAspViewer.ImageTimeout Property

Time in minutes that temporary images will live in the server before being deleted. Temporary images older than "current date - imageTimeOut" will be removed each time a new call to this component is made. Set this property to 0 or a negative value to not delete any image, if you wish to do the cleanup yourself using a server script. See also MaxTemporaryImages

Syntax

Namespace: FlexCel.AspNet

public Int32 ImageTimeout { get; set; }

See also

  • FlexCelAspViewer


FlexCelAspViewer.MaxTemporaryImages Property | FlexCel Studio for the .NET Framework documentation

FlexCelAspViewer.MaxTemporaryImages Property

Maximum number of temporary images in the images folder. Set it to 0 or a negative value if you want unlimited images. Use this variable to avoid Denial of Service conditions. For example, a malicious user could keep continuously refreshing the webpage, without waiting for the page to load. As all images are created each time he refreshes, but they are never deleted (because they are never requested back) the disk could fill very fast, not giving time to the ImageTimeout timespan to happen, and crashing the server.

Note that this number is approximate, if for example the maximum is 5000, you could get 5200 images in a peak time. It is not guaranteed that the maximum images will be 5000, just that it will not grow much more than that.

Syntax

Namespace: FlexCel.AspNet

public Int32 MaxTemporaryImages { get; set; }

See also

  • FlexCelAspViewer


FlexCelAspViewer.ImageHandlerName Property | FlexCel Studio for the .NET Framework documentation

FlexCelAspViewer.ImageHandlerName Property

Name for the ImageHandler used to return images when ImageExportMode is not TImageExportMode.TemporaryFiles. You need to add this name in web.config in your app.

Syntax

Namespace: FlexCel.AspNet

public String ImageHandlerName { get; set; }

See also

  • FlexCelAspViewer


FlexCelAspViewer.ImageParameterName Property | FlexCel Studio for the .NET Framework documentation

FlexCelAspViewer.ImageParameterName Property

Name for the parameter used to return the image in the URL. name when ImageExportMode is TImageExportMode.UniqueTemporaryFiles. This parameter will appear in the url as: http://server/.../flexcelviewer.ashx?IMAGEPARAMETERNAME=Imagename

Syntax

Namespace: FlexCel.AspNet

public String ImageParameterName { get; set; }

See also

  • FlexCelAspViewer


FlexCelAspViewer.ImageLink Event | FlexCel Studio for the .NET Framework documentation

FlexCelAspViewer.ImageLink Event

Use this event to customize the links in the HTML file when using TImageExportMode.CustomStorage.

Syntax

Namespace: FlexCel.AspNet

public ImageLinkEventHandler ImageLink

See also

  • FlexCelAspViewer


FlexCelAspViewer.SaveImage Event | FlexCel Studio for the .NET Framework documentation

FlexCelAspViewer.SaveImage Event

Use this event to save the images into other place. You will normally need to use this event when implementing your own Http Handler to return the images.

Syntax

Namespace: FlexCel.AspNet

public SaveImageEventHandler SaveImage

See also

  • FlexCelAspViewer


FlexCelAspViewer.NamedRangeExport Event | FlexCel Studio for the .NET Framework documentation

FlexCelAspViewer.NamedRangeExport Event

Use this event to customize how a named range if exported to the HTML file. Note that for this event to be called, you first need to set HtmlExport.ExportNamedRanges = true. If you want to change the id that will be exported or exclude certain named from being exported, you can do so here.

Syntax

Namespace: FlexCel.AspNet

public NamedRangeExportEventHandler NamedRangeExport

See also

  • FlexCelAspViewer


FlexCelHtmlImageHandler Class | FlexCel Studio for the .NET Framework documentation

FlexCelHtmlImageHandler Class

This is a base image handler you can use to create your own. This code is adapted from here: http://www.hanselman.com/blog/PermaLink,guid,5c59d662-b250-4eb2-96e4-f274295bd52e.aspx We would like to thank Scott Hanselman for the insightful article.

Remarks

To use this handler, include the following lines in a Web.config file. <configuration> <system.web> <httpHandlers> <add verb="*" path="flexcelviewer.ashx" type="FlexCel.AspNet.FlexCelHtmlImageHandler,FlexCel.AspNet"/> </httpHandlers> </system.web> </configuration> You might need to change the name "flexcelviewer.ashx" if you change FlexCelAspViewer.ImageHandlerName. Both names need to be the same.

Syntax

Namespace: FlexCel.AspNet

public class FlexCelHtmlImageHandler: IHttpHandler

Methods

Name | Description
ProcessRequest | This method will validate the parameters, and then call GetImage to get the real data. When inheriting from this class, you normally only have to override ValidateParameters GetImage
ValidateParameters | Override this method to check the parameters are valid.
ImageExists | Override this method to provide a 404 error if the image has been deleted or doesn't exists.
GetImage | Override this method to return the image. WARNING: Whatever you do here, make really sure you return only the indented image. A NAIVE IMPLEMENTATION OF THIS METHOD MIGHT RESULT IN A HUGE SECURITY HOLE. An attacker could use an implementation that just returns a file to retrieve any file in the server.

Properties

Name | Description
IsReusable | This instance can be reused.
RequiresAuthentication | Override this property in a descendant class if you do not want to ask for authentication for this image handler.


FlexCelHtmlImageHandler.ProcessRequest Method | FlexCel Studio for the .NET Framework documentation

FlexCelHtmlImageHandler.ProcessRequest Method

This method will validate the parameters, and then call GetImage to get the real data. When inheriting from this class, you normally only have to override ValidateParameters GetImage

Syntax

Namespace: FlexCel.AspNet

public virtual void ProcessRequest(HttpContext context)

Parameters

<-> | Parameter | Type | Description
 | context | HttpContext |

See also

  • FlexCelHtmlImageHandler


FlexCelHtmlImageHandler.ValidateParameters Method | FlexCel Studio for the .NET Framework documentation

FlexCelHtmlImageHandler.ValidateParameters Method

Override this method to check the parameters are valid.

Syntax

Namespace: FlexCel.AspNet

public virtual Boolean ValidateParameters(HttpContext context)

Parameters

<-> | Parameter | Type | Description
 | context | HttpContext |

See also

  • FlexCelHtmlImageHandler


FlexCelHtmlImageHandler.ImageExists Method | FlexCel Studio for the .NET Framework documentation

FlexCelHtmlImageHandler.ImageExists Method

Override this method to provide a 404 error if the image has been deleted or doesn't exists.

Syntax

Namespace: FlexCel.AspNet

public virtual Boolean ImageExists(HttpContext context)

Parameters

<-> | Parameter | Type | Description
 | context | HttpContext |

See also

  • FlexCelHtmlImageHandler


FlexCelHtmlImageHandler.GetImage Method | FlexCel Studio for the .NET Framework documentation

FlexCelHtmlImageHandler.GetImage Method

Override this method to return the image.

WARNING: Whatever you do here, make really sure you return only the indented image. A NAIVE IMPLEMENTATION OF THIS METHOD MIGHT RESULT IN A HUGE SECURITY HOLE. An attacker could use an implementation that just returns a file to retrieve any file in the server.

Syntax

Namespace: FlexCel.AspNet

public virtual Boolean GetImage(HttpContext context)

Parameters

<-> | Parameter | Type | Description
 | context | HttpContext |

Returns

True if the image was correctly served.

See also

  • FlexCelHtmlImageHandler


FlexCelHtmlImageHandler.IsReusable Property | FlexCel Studio for the .NET Framework documentation

FlexCelHtmlImageHandler.IsReusable Property

This instance can be reused.

Syntax

Namespace: FlexCel.AspNet

public Boolean IsReusable { get; }

See also

  • FlexCelHtmlImageHandler


FlexCelHtmlImageHandler.RequiresAuthentication Property | FlexCel Studio for the .NET Framework documentation

FlexCelHtmlImageHandler.RequiresAuthentication Property

Override this property in a descendant class if you do not want to ask for authentication for this image handler.

Syntax

Namespace: FlexCel.AspNet

public virtual Boolean RequiresAuthentication { get; }

See also

  • FlexCelHtmlImageHandler


ImageLinkEventArgs Class | FlexCel Studio for the .NET Framework documentation

ImageLinkEventArgs Class

Arguments passed on FlexCelAspViewer.ImageLink,

Syntax

Namespace: FlexCel.AspNet

public class ImageLinkEventArgs: EventArgs

Constructors

Name | Description
ImageLinkEventArgs | Creates a new Argument.

Properties

Name | Description
Workbook | ExcelFile with the image, positioned in the sheet that we are rendering. Make sure if you modify ActiveSheet of this instance to restore it back to the original value before exiting the event.
ObjectIndex | Object index of the object being rendered. You can use xls.​Get​Object(​object​Index) to get the object properties. If the image is not an object (for example it is a rotated text) this property will be -1.
ShapeProps | Shape properties of the object being rendered. You can use them to get the name of the object, its size, etc. If the image is not an object (for example it is a rotated text) this property will be null.
AlternateText | Alternate text for the image, to show in the "ALT" tag when a browser can not display images. By default this is set to the text in the box "Alternative Text" in the web tab on the image properties. If no Alternative text is supplied in the file, the image name will be used here.
SavedImageFormat | File format in which the image is.
ImageLink | The link that will be inserted in the html file. Modify it to create your won link to the HttpHandler.


ImageLinkEventArgs.ImageLinkEventArgs Constructor | FlexCel Studio for the .NET Framework documentation

ImageLinkEventArgs.ImageLinkEventArgs Constructor

Creates a new Argument.

Syntax

Namespace: FlexCel.AspNet

public ImageLinkEventArgs(ExcelFile aWorkbook, Int32 aObjectIndex, TShapeProperties aShapeProps, String aImageLink, String aAlternateText, THtmlImageFormat aSavedImageFormat)

Parameters

<-> | Parameter | Type | Description
 | aWorkbook | ExcelFile | See Workbook
 | aObjectIndex | Int32 | See ObjectIndex
 | aShapeProps | TShapeProperties | See ShapeProps
 | aImageLink | String | See ImageLink
 | aAlternateText | String | See AlternateText
 | aSavedImageFormat | THtmlImageFormat | See SavedImageFormat

See also

  • ImageLinkEventArgs


ImageLinkEventArgs.Workbook Property | FlexCel Studio for the .NET Framework documentation

ImageLinkEventArgs.Workbook Property

ExcelFile with the image, positioned in the sheet that we are rendering. Make sure if you modify ActiveSheet of this instance to restore it back to the original value before exiting the event.

Syntax

Namespace: FlexCel.AspNet

public ExcelFile Workbook { get; }

See also

  • ImageLinkEventArgs


ImageLinkEventArgs.ObjectIndex Property | FlexCel Studio for the .NET Framework documentation

ImageLinkEventArgs.ObjectIndex Property

Object index of the object being rendered. You can use xls.GetObject(objectIndex) to get the object properties. If the image is not an object (for example it is a rotated text) this property will be -1.

Syntax

Namespace: FlexCel.AspNet

public Int32 ObjectIndex { get; }

See also

  • ImageLinkEventArgs


ImageLinkEventArgs.ShapeProps Property | FlexCel Studio for the .NET Framework documentation

ImageLinkEventArgs.ShapeProps Property

Shape properties of the object being rendered. You can use them to get the name of the object, its size, etc. If the image is not an object (for example it is a rotated text) this property will be null.

Syntax

Namespace: FlexCel.AspNet

public TShapeProperties ShapeProps { get; }

See also

  • ImageLinkEventArgs


ImageLinkEventArgs.AlternateText Property | FlexCel Studio for the .NET Framework documentation

ImageLinkEventArgs.AlternateText Property

Alternate text for the image, to show in the "ALT" tag when a browser can not display images. By default this is set to the text in the box "Alternative Text" in the web tab on the image properties. If no Alternative text is supplied in the file, the image name will be used here.

Syntax

Namespace: FlexCel.AspNet

public String AlternateText { get; }

See also

  • ImageLinkEventArgs


ImageLinkEventArgs.SavedImageFormat Property | FlexCel Studio for the .NET Framework documentation

ImageLinkEventArgs.SavedImageFormat Property

File format in which the image is.

Syntax

Namespace: FlexCel.AspNet

public THtmlImageFormat SavedImageFormat { get; }

See also

  • ImageLinkEventArgs


ImageLinkEventArgs.ImageLink Property | FlexCel Studio for the .NET Framework documentation

ImageLinkEventArgs.ImageLink Property

The link that will be inserted in the html file. Modify it to create your won link to the HttpHandler.

Syntax

Namespace: FlexCel.AspNet

public String ImageLink { get; set; }

See also

  • ImageLinkEventArgs


UniqueTemporaryFilesImageHandler Class | FlexCel Studio for the .NET Framework documentation

UniqueTemporaryFilesImageHandler Class

The image handler used when you select TImageExportMode.UniqueTemporaryFiles

Remarks

To use this handler, include the following lines in a Web.config file. <configuration> <system.web> <httpHandlers> <add verb="*" path="flexcelviewer.ashx" type="FlexCel.AspNet.UniqueTemporaryFilesImageHandler,FlexCel.AspNet"/> </httpHandlers> </system.web> </configuration> You might need to change the name "flexcelviewer.ashx" if you change FlexCelAspViewer.ImageHandlerName. Both names need to be the same.

Note that this handler requires authentication in order to display the images. If you want to have a handler that does not require authentication, you can derive a class from this one, and override the FlexCelHtmlImageHandler.RequiresAuthentication property to return false. After that, register this new class in web.config instead of this one.

Syntax

Namespace: FlexCel.AspNet

public class UniqueTemporaryFilesImageHandler: FlexCelHtmlImageHandler

Methods

Name | Description
ValidateParameters | This method will validate the image passed is a valid GUID.
ImageExists | This method checks if the image still exists, and return false if it doesn't.
GetImage | This method returns the image from the file.


UniqueTemporaryFilesImageHandler.ValidateParameters Method | FlexCel Studio for the .NET Framework documentation

UniqueTemporaryFilesImageHandler.ValidateParameters Method

This method will validate the image passed is a valid GUID.

Syntax

Namespace: FlexCel.AspNet

public override Boolean ValidateParameters(HttpContext context)

Parameters

<-> | Parameter | Type | Description
 | context | HttpContext |

See also

  • UniqueTemporaryFilesImageHandler


UniqueTemporaryFilesImageHandler.ImageExists Method | FlexCel Studio for the .NET Framework documentation

UniqueTemporaryFilesImageHandler.ImageExists Method

This method checks if the image still exists, and return false if it doesn't.

Syntax

Namespace: FlexCel.AspNet

public override Boolean ImageExists(HttpContext context)

Parameters

<-> | Parameter | Type | Description
 | context | HttpContext |

See also

  • UniqueTemporaryFilesImageHandler


UniqueTemporaryFilesImageHandler.GetImage Method | FlexCel Studio for the .NET Framework documentation

UniqueTemporaryFilesImageHandler.GetImage Method

This method returns the image from the file.

Syntax

Namespace: FlexCel.AspNet

public override Boolean GetImage(HttpContext context)

Parameters

<-> | Parameter | Type | Description
 | context | HttpContext |

See also

  • UniqueTemporaryFilesImageHandler


THtmlSheetExport Enumeration | FlexCel Studio for the .NET Framework documentation

THtmlSheetExport Enumeration

Defines how many sheets will be exported.

Syntax

Namespace: FlexCel.AspNet

Members

Name | Value | Description
ActiveSheet | 0 | Only ActiveSheet on the workbook will be exported.
AllVisibleSheets | 1 | All visible sheets in the workbook will be exported, one after the other.


TImageExportMode Enumeration | FlexCel Studio for the .NET Framework documentation

TImageExportMode Enumeration

How images on the Excel file will be stored in order to be served to the browser.

Syntax

Namespace: FlexCel.AspNet

Members

Name | Value | Description
TemporaryFiles | 0 | When this option is selected, images will be saved in a temporary directory (defined in FlexCelAspViewer.RelativeImagePath ) You can configure a timeout period with FlexCelAspViewer.ImageTimeout after which the images will be deleted.
UniqueTemporaryFiles | 1 | When this option is selected, images will be saved in a temporary directory (defined in FlexCelAspViewer.RelativeImagePath ) You can configure a timeout period with FlexCelAspViewer.ImageTimeout after which the images will be deleted. Different from TemporaryFiles, this mode will delete the image once it is served. This is an advantage from the point of view that images are cleaned faster (without waiting for the timeout), but might be a disadvantage if the user for example right clicks the image and selects "view image". As the image is deleted the first time it is served, the second time (when the user does "view image") it will return image not found. Also some browsers might ask for the image more than once. Use this mode only in controlled environments, when you know the browsers being used and you can test them. If you use this mode as for a public web server, some users might not see the images.
CustomStorage | 2 | This is an advanced option that allows you to store the images somewhere else, for example a database. Links on the image will point to an HttpHandler that you need to implement. See 'Timageexportmodecustomstorage' in the Html Exporting Guide for more information.


ImageLinkEventHandler Delegate | FlexCel Studio for the .NET Framework documentation

ImageLinkEventHandler Delegate

Delegate used to specify where to store the images on a page.

Syntax

Namespace: FlexCel.AspNet

public delegate void ImageLinkEventHandler(Object sender, ImageLinkEventArgs e)

Parameters

<-> | Parameter | Type | Description
 | sender | Object |
 | e | ImageLinkEventArgs |


Tips and Tricks | FlexCel Studio for the .NET Framework documentation

Tips and Tricks

An assorted list of small and interesting stuff to help you get the most out of FlexCel.

We will be adding new tips regularly here, so make sure to check this page from time to time.

In this section:

Localized month names

Why you are not getting the same date strings as Excel. And while we are at it, we tell you what's a "genitive month name"

Cloud fonts

Excel is moving more and more to cloud fonts, and why that is bad news for the rest of us.

Painting a full sheet black

Paint the columns, not the cells.

Running FlexCel inside Docker containers

A Docker container needs fonts!

Text rotation in shapes inside xls and xlsx files

Do we rotate the text first and then align it, or do we align it first?

SVG files inside xlsx files

Modern Excel versions allow SVG as a file format for images inside. In this tip we explore the FlexCel support for the feature.

The maximum used column on a sheet

It all depends on what we define by "used column"

Finding the actual fonts used when exporting to PDF

When exporting to PDF, you need to find out which fonts are actually used.

Scalable images in your documentation

Did you know that you can use FlexCel's "Export as SVG" feature to get scalable images of your spreadsheets?

Using Tokens to get information from formulas

Let's imagine that you want to manually modify all formulas that refer to A1 to refer to A2. You could try some manual regex to search and replace all occurrences of "A1" by "A2" into the formula string. But of course this would replace also A11 by A21 and also do replacements in things that aren't references. Luckily FlexCel's Tokens provide a much more elegant and reliable solution to do it.

Semi-absolute references

You know that a cell reference like "A4" is relative, while "$A$4" is absolute. But is there a way to have a reference be absolute when it is outside the range copied, and relative if it is inside?

References in conditional formats and data validations

Formulas inside conditional formats or data validations apply to a range of cells instead of a single cell. This makes them behave differently from regular cell formulas in ways that might not be obvious.

Replacing a font by another in an Excel file

If you want to replace for example all Calibri fonts with a different font in a file, you can use the code in this tip.

Finding out how many pages will be exported

Sometimes you want to know the number of pages needed for a report, before actually exporting or printing it.

Fine-tuning row autofitting

When autofitting rows, you might want to use ExcelFile.CellMarginFactor besides adjustment.

Understanding CSV files

There is no such thing as a "Universal CSV" which everyone can understand. To create a CSV file, you need to know who will be reading it.

Embedding Excel files in your application

Don't use APIMate for this.

Internal numeric formats

Excel has some numeric formats that vary from locale to locale. Let's get a more in depth look under the covers.

How to change the FlexCel locale

Some numeric formats in Excel change depending on your machine locale. FlexCel will by default pick your locale from the machine configuration too, but you can change those without modifying the machine settings.

Using barcodes

Here we discuss the different ways to embed a barcode in your file using FlexCel.

How to get the hyperlink in a given cell?

Hyperlinks in a cell aren't as straightforward as other cell properties. Here we discuss how they work and how to get the link in some specific cell.

Why are xlsx files generated by FlexCel smaller than the same files generated by Excel?

You open an existing file with FlexCel and save it. Now the file is some kilobytes smaller. What is happening?

Automatically opening generated Excel files

Sometimes you might want to open the generated files directly in Excel without asking the user where to save them first. While this is not technically possible, in this tip we show a way to simulate it.

Using strict xlsx files

FlexCel supports both normal and strict xlsx files. Which one should you use?

Finding out which FlexCel version you are using

A simple code snippet to find out the version of FlexCel that you are using from inside your application.

Sign your PDF files

You are creating documents. How do you ensure that nobody alters the data on them?

Conditionally format all things!

Whenever you need change the format of a cell depending on its value, conditional format is here to help.

Expanding formulas in consecutive cells

If there only was a simple way to enter "=B1" in A1 and "=B2" in A2...

We also tell you about a simple way to check if all the formulas in a range have consistent values (so the formula in A1 refers to B1, and the formula in A2 refers to B2 and so on)

Changing the font name

Excel 2007 made changing the font name in a cell a little more complex than what it should be.

Entering multiple lines of text inside a cell

You can enter multiple lines of text inside a single cell, but there are a couple of things to be aware of.

Understanding Excel measurement units

What does a column width of 8.44 actually mean?

Dumping a Dataset into Excel

I have my data in this dataset. How do I export it to Excel?

Reading only the first row of a file

If you have lots of big files to analyze, you might not want to load the full files into memory just to check if you need to process them.


Localized Month Names | FlexCel Studio for the .NET Framework documentation

Localized Month Names

Month names can be more complex than what they look like.

A simple example: In Excel, let's write the date "1930-07-18" and let's format it in a Spanish "dd-MMM-yyyy" format:

spanish date with dot

As you can see, it uses a dot after the month abbreviation ("jul." instead of "jul"). This is because Abbreviations must always be followed by a full stop

It makes sense. We native Spanish speakers have always known that abbreviations end in dots.

But just for fun, let's open this same file we just created in Excel 2007, Windows 7:

spanish date without dot

It makes sense, too. While we write dots after abbreviations, it is not common to write dots after abbreviated month names. Maybe because we usually write the Código trilítero, not the abbreviation. So, we can conclude that, initially, the people coding Excel used the "Código trilítero," but then they realized it was wrong and switched to the abbreviation.

But now, let's look at the .NET world. Let's try this program:

using System;
using System.Globalization;

public class Program
{
    public static void Main()
    {
        var Culture = CultureInfo.CreateSpecificCulture("es-ES");
        Console.WriteLine(new DateTime(1930, 7, 18).ToString("dd/MMM/yy"));
    }
}

If we compile it with .NET 4.8, we will get 18/Jul/30. No dot, and the "J" in "Julio" is uppercase. What can I say? The whole thing is starting to look crazy. But we shouldn't surrender so soon. Let's change our framework to .NET 8 on the same machine and try again. And now we get "18/jul./30". So they went the reverse route as Excel/Windows, they started with the Código trilítero and then switched to abbreviations.

And Delphi has its own set of cases where it doesn't show the same as Excel (or .NET). Everyone does as they please here.

I could keep writing for hours: we've just made an example with the fourth most spoken language in the world and a language with a Royal Academy that ensures it has clear rules. If we use languages with no-so-clear rules, differences start to grow bigger. And we only tried Microsoft Windows here; if we add other OSs, it gets even worse.

There are combinations where it uses "July" instead of "Jul" as the "July abbreviation," but only for "en-AU," not "en-EN." Don't Australians abbreviate July? I don't know, and it looks like nobody does.

There are also Genitive Month Names and even Abbreviated Genitive Month Names. .NET 4 will never use Genitive Month Names, .NET 8 will use them if you have a format string like "dd/MMM/yyyy", but not if you have "MMM" alone. Excel has its own rules (that also changed over the years) on whether to use Genitive month or standard month names. In .NET Core 5, Microsoft switched from using the built-in Windows functions to ICU even in Windows.

This is all to say that it is possible that you won't get the same abbreviated month names that you see in your Excel when you export from FlexCel. And if you see them the same, those might change when you update Windows, .NET, Delphi, or Excel.

It usually won't matter, but in some cases it might. For example, you might see "Jul" in Excel but "July" in FlexCel, and the text won't fit in the cell anymore. I advise not to use abbreviated month names and always leave some extra space in the cell so longer text can fit.

But if you need to get the same results as Excel with FlexCel, you can.

The first thing is to set the month names (and genitive month names) in the CultureInfo of your app, so they look as you want them to:

    CultureInfo Culture = CultureInfo.CreateSpecificCulture("es-ES");
    //In this case RemoveDots() just removes the dots from the abbreviated names. You might just specify the array manually.
    Culture.DateTimeFormat.AbbreviatedMonthNames = RemoveDots(Culture.DateTimeFormat.AbbreviatedMonthNames);
    Culture.DateTimeFormat.AbbreviatedMonthGenitiveNames = RemoveDots(Culture.DateTimeFormat.AbbreviatedMonthGenitiveNames);

But this won't cover all cases. As we saw in the first screenshot, you can specify a different language for the format of a cell, even if Excel itself is using a different locale. In this case FlexCel will create that locale based in the locale code, and you need to override that too. You can use the code below to override the locale creation:

    TFlxNumberFormat.CultureCreating += args =>
    {
        switch (args.LanguageCode)
        {
            // see https://learn.microsoft.com/en-us/openspecs/office_standards/ms-oe376/6c085406-a698-4e12-9d4d-c3b0ee3dbc4a
            //for the language code
            case 1034: //Spanish - Spain (Traditional Sort)
                args.Culture = CultureInfo.CreateSpecificCulture("es-ES");
                args.Culture.DateTimeFormat.AbbreviatedMonthNames = RemoveDots(args.Culture.DateTimeFormat.AbbreviatedMonthNames);
                args.Culture.DateTimeFormat.AbbreviatedMonthGenitiveNames = RemoveDots(args.Culture.DateTimeFormat.AbbreviatedMonthGenitiveNames);
                break;
        }
    };


Cloud fonts | FlexCel Studio for the .NET Framework documentation

Cloud fonts

As we write this tip, Microsoft has just released a new default font for all the Office applications, including Excel. And we've just released support for it, but there are some issues that we just can't fix.

A new default font is usually a headache, as the font is not likely to be available on platforms other than Windows. For that reason alone, we suggest using Calibri until the new Aptos font becomes as ubiquitous. But this time, we have another reason to recommend not switching just yet:

Unlike Calibri, Arial, or all the "classic" fonts, Aptos was delivered as a Cloud font. As explained in the link above, cloud fonts are available only to the Office apps, and not to Windows itself. This means that your application (and any other application in your machine) can't see them, even if you can see them in Office.

If you are creating a PDF, a workaround for FlexCel in Windows would be to add the folder "%LocalAppData%\Microsoft\FontCache\4\CloudFonts" in the FlexCelPdfExport.GetFontFolder event.

But this isn't a great workaround because:

  1. It will only work for PDF files. When printing, or previewing, FlexCel won't find the fonts, and they will be poorly substituted by another, probably breaking the layout of the page.
  2. Even when exporting to PDF, FlexCel might sometimes ask the operating system for some font data, and the operating system will provide the wrong font. See also the FlexCel PDF Exporting Guide
  3. The place of local fonts is not documented and might change: Today, it is "FontCache\4\CloudFonts," but tomorrow, it might change to "FontCache\5\CloudFonts," and your app will break.

Given all the issues, if you really want to use Aptos (or any other cloud font) in your files, we recommend installing them locally so that all Windows apps can see them. You can find a nice step-by-step guide in how to do so at https://office-watch.com/2023/cloud-fonts-available-all-programs/

Important

At the time of this writing, the Aptos font is only available as a Cloud font, and it is not installed in Windows. It might happen that some Windows update in the future installs the font also in Windows, which would fix most of the issues of this tip. So we recommend you to open the Font Viewer in Windows, and see if the Aptos font isn't available.


Painting a full sheet black. | FlexCel Studio for the .NET Framework documentation

Painting a full sheet black.

Let's imagine we want to paint all cells on a sheet with a black background and a white font. Unfortunately, Excel doesn't have a way to set the format for a full sheet, so that's not an option.

The first idea is that we could loop over each of the 17 billion cells in the spreadsheet and paint each cell in black. And that would work, but it would not only be very slow (even computers take their time to count to 17 billion), but it would also use a lot of memory. Because we need to create 17 billion empty cells to format them in black. Even when xlsx files are compressed, the file size would be huge, too, as it would be the time it takes for Excel to open the file.

So, no way to set the entire sheet to black, and if we try to format every cell, it won't work either. But there surely is a way, isn't it? If you create a file in Excel, select all cells, and paint them black, the file will not be much bigger than an empty file and will not take vast amounts of memory. Excel somehow manages to do it, and we know it is not setting the format for the entire sheet or for every cell.

Then, how is Excel doing it? As usual, the simplest way to find out is with APIMate. So, let's create an empty file in Excel, paint all the cells black, then save the file and open it with APIMate. And this is the code we get:

    TFlxFormat ColFmt;
    ColFmt = xls.GetFormat(xls.GetColFormat(1));
    ColFmt.Font.Color = TExcelColor.FromTheme(TThemeColor.Light1);
    ColFmt.FillPattern.Pattern = TFlxPatternStyle.Solid;
    ColFmt.FillPattern.FgColor = TExcelColor.FromTheme(TThemeColor.Dark1);
    ColFmt.FillPattern.BgColor = TExcelColor.Automatic;
    xls.SetColFormat(1, 16384, xls.AddFormat(ColFmt));

While Excel doesn't have a way to format the whole sheet, it has Cell, Row, and Column formats. A sheet has about 17 billion cells, nearly 1 million rows, and around 16 thousand columns. To format every cell, we would need to set the format in 17 billion cells. To format every row, we would need to set the format in 1 million rows. To format every column, we need to set the format in 16 thousand columns.

The option requiring fewer formats is formatting every column, which is what Excel does, and what you should do, too, if you want to change the format for a whole sheet.


Running FlexCel inside Docker containers | FlexCel Studio for the .NET Framework documentation

Running FlexCel inside Docker containers

Docker containers are an excellent alternative for distributing applications that work the same anywhere. Conceptually they are similar to deploying to a Linux machine (and they share the same issues), but there is an extra problem.

Fonts strike once again

When running FlexCel in a different Operating System, the first thing to check is that the fonts FlexCel needs to work on are available. Specifically, when inside a docker container, it might be the case that no fonts are available at all, causing SKIA to return an invalid font with no name, zero width, and zero height. FlexCel will, in most cases, catch those errors and tell you to install the fonts. But in other cases, it might not. So be aware to always check for fonts.

There are two issues with fonts:

The "No font available at all" problem

It happens when there are zero fonts available in the OS, and the problem is common in containers. This is where SKIA returns a font with no name, and you will be informed of the issue. The problem goes away simply by having a single font installed. But having a single font installed will lead us to the next point:

The "Some fonts aren't available" problem

FlexCel uses the font files to calculate cell widths and heights during exporting and in other operations like autofitting. If you have a single font available to the OS, that font will be used as a substitute for any "real" font used in the Excel file. So metrics will likely be wrong.

To fix this, ** you need to have not just one generic font installed but all the required fonts instead. **

Installing fonts in a Docker container

To install some fonts into a docker container, you must first copy them to the folder where "Dockerfile" is. Once you have them there, you can zip them and install them with the commands:

Ubuntu or Debian Container:

WORKDIR /app
RUN apt-get update
RUN apt-get -y install fontconfig
RUN mkdir -p /usr/share/fonts/truetype/
COPY ./fonts/* /usr/share/fonts/truetype/
RUN fc-cache -f

Alpine-Linux Container:

WORKDIR /app
RUN apk add --no-cache fontconfig
RUN mkdir -p /usr/share/fonts/truetype/
COPY ./fonts/* /usr/share/fonts/truetype/
RUN fc-cache -f

Others Linux distributions will likely be similar, but might vary in the package manager they use (apk, apt-get, pacman, etc)

Note

Remember that you might need to copy multiple font files to install a single font. For example to install Arial you need to install:

  • arial.ttf // Normal font
  • arialbd.ttf // Bold variant
  • arialbi.ttf // Bold-Italic variant
  • ariali.ttf // Italic variant.


Text rotation in shapes inside xls and xlsx files | FlexCel Studio for the .NET Framework documentation

Text rotation in shapes inside xls and xlsx files

The problem with shape rotation

When Excel changed the file format from xls to xlsx back in 2007, they rewrote the entire graphics engine. And while the functionality was more or less the same, the base was completely different, and this created subtle differences. We usually keep those differences abstracted from you, but in this tip, we wanted to review a small thing that can be confusing.

Back in Excel 2003 times (xls), you could change the rotation of the text inside an autoshape to be rotated 90 degrees, -90 degrees, vertical or horizontal. Besides that, you could align the text to the right, left, top, or bottom.

So let's imagine we have some text aligned to the right:

shape text rotation excel2003

And then we rotate it 90 degrees counter-clockwise:

shape text rotation excel2003 90

As you can see, Excel first applies the rotation, then the alignment. That means the text is still aligned to the right after rotating it. On the other hand, if you have a similar file in a newer Excel:

shape text rotation excel2021

And rotate it the same:

shape text rotation excel2021 90

The text will now be aligned to the left, not to the right. This happens because, in newer Excels, the text is first aligned to the right, then rotated. The alignment is part of the text, not of the shape. It might be easier to see with an image:

shape text rotation process2021

In older Excels, the shape would be rotated first, and the text aligned to the right no matter the rotation.

So, we've seen the process is different under the hood. However, Excel tries to keep the illusion that nothing changed, and so it displays the text as "Top-Left aligned" in this screenshot:

shape text rotation excel2021 90

But internally, in the xlsx file, the text will be saved as "Top-Bottom" aligned, with a rotation of -90 degrees clockwise.

The problem with comments and controls rotation

Probably because of how huge the task was, comments and controls weren't really migrated to xlsx in the big Excel 2007 rewrite. Xlsx files used an older, Excel-2003 xml to store those. And that means that comments and controls kept working as in Excel 2003. They rotate first, then align.

Newer revisions of xlsx introduced newer ways to write comments and controls inside the xlsx file, and that made everything worse. Now you have a control saved twice in the file, and one part has xls behavior while the other has xlsx.

How it affects FlexCel

When writing code, you need to know the order in which operations are applied. Let's imagine we are trying to get the text rotated 90 degrees and aligned to the top-right as in the second screenshot.

Inside an xls file, we need to write:

    Shape.VerticalJustification = Top
    Shape.HorizontalJustification = Right
    Shape.Rotation = Rotation90DegressCounterClockwise.

But for xlsx, we need:

    Shape.VerticalJustification = Bottom
    Shape.HorizontalJustification = Right
    Shape.Rotation = Rotation90DegressCounterClockwise.

We have a single API for both xls and xlsx files, so properties have to have some defined behavior. It can't be that you set the text to be top-right, then rotate the text, and when you save as xls or as xlsx you get different results.

So we've decided to have all properties to behave like xls. To get the text top right, you need to set the justification to Top-Right. Then FlexCel will save in the xlsx file the alignment as Bottom-Right. Same when you read the file: If an xlsx file says "Bottom-Right" in its alignment and it is rotated 90 degrees, FlexCel will report Top-Right. If you are manually reviewing the xml inside an xlsx file, the values will differ from what FlexCel reports.

The reasons we settled for the xls approach, even when xlsx is much newer and would normally be preferred are:

  1. Our code predates xlsx, so we already had properties like TShapeProperties.TextFlags or TShapeProperties.TextRotation that used the xls approach. When we introduced simpler properties like TShapeProperties.TextVerticalAlignment it made sense to keep a consistent approach, instead of having some properties behave in one way and some in another.

  2. The xlsx way applies only to Autoshapes, but not to comments or the text in controls. So if we took the xlsx approach, we would also have to convert the comments and controls even in xlsx files.

  3. It is the way Excel displays it. Even when internally the file will say "Bottom-Right", in the Excel UI you will see the text aligned as "Top-right".


SVG files inside xlsx files. | FlexCel Studio for the .NET Framework documentation

SVG files inside xlsx files.

A little bit of history

Back in the old times of 1997, Excel would store the images inside an xls file in a handful of (at the time) standard formats:

  • PNG: Best for images with text or that required high fidelity. They use lossless compression, which meant images are preserved without modifications, but the files are also larger.

  • JPEG: Best for photos or images where you want to compress a lot. They use lossy compression, which means files are smaller but modified slightly from the original.

  • BMP: Those were similar to PNGs, but with a big difference: they weren't compressed at all. Being uncompressed made them useless except for tiny bitmaps, but if you had small images, they could be rendered faster in a time where computers were much slower than today.

  • WMF/EMF: Windows Metafiles. Those are vectorial formats, which means they scale better than bitmaps and are usually smaller. They also require you to draw them with a vector-image application, and they wouldn't work well for a photo.

  • PICT: This was the WMF equivalent for macs before OSX. They were also used to store vector images, but they were used when working in a mac instead of Windows.

Those formats provided a good set for 1997. They allowed vector and bitmap images, and the bitmaps could have lossy or lossless compression.

Let's now advance some years and go to 2007, when Excel introduced the xlsx file format. They used the opportunity to add some additional file formats to the xlsx files:

  • GIF: This file format is equivalent to PNG but has worse compression. On the upside, they allow animated images. If you've never tried it, you can add animated gifs to Excel, and they will show with a "Play" button that you can press to start the animation.

  • TIFF. Yet another bitmap format, used as the standard for FAX machines. The one thing they add to already supported bitmap formats is the ability to have "multi-page" images. But as far as we know, Excel doesn't support multi-page tiffs and will only show the first page.

Again, a good set for the time. But if you look closely, you will find that we have five bitmap formats against only three vector formats. And one of the vector formats (PICT) has been dead for years. The other two (WMF and EMF) are essentially the same; both are Windows-only and not really good. So it became clear that Excel needed to support a more modern, cross-platform vector-image format.

Enter SVG

Let's advance ten years more to somewhere in 2017 when Excel added SVG support to xlsx files in an Office-365 rolling update.

This time the situation was different. In 2007, along with the support for tiff and gif, Excel introduced a new file format (xlsx). So it was simple to add new image formats: Old xls files would still support the old set of image formats (images would be converted to the supported formats when saving as xls), and new xlsx files would support the new set.

But SVG was introduced without a file format change. So if they just added SVG images to xlsx, this would break any existing xlsx processing tool, including any old Excel versions. The pictures would look great in the latest Excel, but if you shared the xlsx file with someone using Excel 2013, he wouldn't be able to see any.

To avoid this problem, Excel saves SVG images as both SVG and PNG inside the xlsx file. Old Excel versions will ignore the SVG and display the PNG, while SVG-Enabled Excels will show the SVG. Everyone is happy, and this is why old FlexCel versions will still display SVG images even when FlexCel wasn't SVG enabled.

How FlexCel deals with SVG images

Since version 7.10, FlexCel can handle SVG images. But we had a problem: Neither of the graphic engines we use for image processing (GDI+, SKIA, etc.) can render SVG images. So if we simply added support for reading the new SVG section and ignored the PNG inside the xlsx file, we would be in a strange situation: Old, not-SVG-enabled FlexCels would be able to render xlsx files with SVG correctly (because they would display the alternate PNG), and new, SVG-enabled FlexCels would not (because they would try to render the SVG, which our graphic engines don't support).

And even if you are not using the FlexCel rendering engine, you might be reading those images and doing something with them. If that is the case, upgrading from FlexCel 7.9 to 7.10 might break your app. Because now we start returning SVGs to it when SVG wasn't a file format that we could return and your app didn't have to support it. Even worse, SVG images can be tricky because they might use fonts not available on your machine. So again, this might mean that a file converted to PDF completely fine in 7.9 would start rendering wrong in 7.10 because you don't have the fonts needed to display the SVG correctly.

That would be a disaster. Backward compatibility is something we care a lot about, and our idea is that upgrading to newer FlexCel versions should not break anything. You install a new FlexCel version, and that's it. Nothing that was previously working should break. Of course, we can never guarantee 100% that there will be no breaking changes, but we make our best effort to ensure you never have to worry about breaking anything when updating.

So how did 7.10 added SVG support? We made the following changes:

  1. We will now read (and write back) both PNGs and SVGs when opening and saving an xlsx file. So if you open a file, modify some cells, and save it back, the file will keep the SVG image as before. FlexCel 7.9 would ignore the SVG image and only write back the PNG. Note that this applies only to xlsx files. As xls doesn't support SVG, only the PNG will be saved to xls files.

  2. When you call ExcelFile.GetImage, we will still return the PNG for SVG images, ensuring that your existing code won't break. There is a new method ExcelFile.GetImageAlternate that will work the same as GetImage for most images but will return the SVG for SVG images. It is now your choice to modify your app to call GetImageAlternate instead of GetImage if you want to handle SVG images. If you don't change anything in your code, 7.10 will keep working as 7.9 did.

  3. There are new methods ExcelFile.SetImageAlternate and ExcelFile.AddImageAlternate which will allow you to enter SVG images via the API. Those methods require both the SVG and the backup PNG because FlexCel doesn't have an SVG renderer that could automatically convert the SVG to PNG. As usual, APIMate will show you how to enter an SVG image from a file that has it.

  4. When rendering a file to PDF or images, FlexCel will continue to use the backing PNG image. This makes it possible to display those images even if our graphics backend doesn't support SVG and also guarantees that there won't be rendering problems due to missing fonts. For SVG and HTML export, there are new properties FlexCelHtmlExport.RasterizeSVGImages and FlexCelSvgExport.RasterizeSVGImages which let you decide if you want to use the png or the SVG image for the rendered file. Those properties are false by default, which means that FlexCel will try to use the SVG images for HTML and SVG unless you change the properties.

Warning

While not breaking backwards compatibility is one of the highest things on our list, there is a potential little thing that could break here. As mentioned in point 4, when rendering to HTML or SVG, FlexCel 7.10 will now by default use the SVG, not the PNG to do the rendering. This makes sense, because if your file contains a SVG file you will likely want the SVG image to be exported to HTML or SVG. But also as mentioned, if the SVG contains fonts that are not available in every machine, this could break the new files. If you want to be 100% sure that those files will render exactly as intended even if there are missing fonts, you should set RasterizeSVGImages to true.

Note

If adding an SVG file via the API with ExcelFile.AddImageAlternate, make sure to provide a reasonably high-resolution PNG alternate image. Very low-resolution PNGs will display ok in a modern Excel (because it will ignore it and render from the SVG), but it will display wrong anywhere else.

Note

The property RasterizeSVGImages mentioned in this tip applies only to images stored inside the xlsx file as SVG. When exporting to HTML, FlexCel also has the ability to render the charts to fully-scalable SVG images instead of PNGs. For that, make sure to set the property FlexCelHtmlExport.SavedImagesFormat to SVG.


The maximum used column on a sheet. | FlexCel Studio for the .NET Framework documentation

The maximum used column on a sheet.

This one looks simple enough. What is the maximum used column on a sheet? In Excel, you can find out with this macro:

Sub Macro1()
      Range("a1").FormulaR1C1 = ActiveSheet.UsedRange.Address
End Sub

In FlexCel, we have not one, but two methods to get this information:

  • ExcelFile.ColCount
  • ExcelFile.ColCountOnlyData And yet, how to get the column count is a common question in our inbox. The main problem being, everyone has a different definition in mind of what "ColCount" should return.

The first question that comes to mind is: Should we include formatted columns in the result? For example, in the image below, should ColCount return 2 or 5?

colcount with formatted columns

That's why we have two different methods to measure the column count. ExcelFile.ColCount will include formatted columns (column E in the example above), and ExcelFile.ColCountOnlyData won't.

But this is just the entrance to the rabbit hole. The next question to answer is, "Should we include blank formatted cells in the count?" And there is no simple answer, as it depends on why you want the column count for.

Let's say we want to calculate the range of visible cells that we want to print and let's imagine we have the following spreadsheet:

colcount with visible formatted cells

It seems evident that if you want to print that sheet, you should include cell E5. And both ColCount and ColCountOnlyData in FlexCel will include cell E5 because both count blank formatted cells. But let's imagine now that cell E5 was bold, with a white background. It now makes no sense to include E5, since it won't be visible when you print it. So for printing, neither ColCountOnlyData nor ColCount will work. We would need a "MaxPrintableColumn" method, including an empty cell with a yellow background, but not including an empty cell with bold formatting.

Now let's consider a case like the following:

colcount with span

Again, depending on what your need is for the column count, the result changes. If you need to process the cells with data, then the last column with Data is A. But if you need to print the sheet, you should print it up to column D.

And we can keep going for a while. What happens if the last column with data is hidden? It shouldn't count for printing, but it should count for processing data. And what if the cell has a formula, and the formula has an empty result? Should the cell be considered empty? Should we consider empty a cell that only has whitespace? Or a cell with a formula that returns 0, if the "display zeros" option in the workbook is off? When we start combining all the options, it turns out that we would need a lot of methods or parameters to accommodate them all, and we might still miss the particular combination that looks like the "logical" ColCount output given your situation.

The final issue with all ColCount variants is that no variant would be efficient. Given that FlexCel stores the cells grouped by rows, finding the maximum column means looping over all rows to find the maximum. It is not something that we can do more efficiently than you could. So to sum it up:

  1. For most cases, you shouldn't use ColCount or ColCountOnlyData at all. Use ExcelFile.ColCountInRow instead. It is not just that ColCount is slow to compute, it is also that it calculates the maximum enclosing rectangle, and that can include lots of empty cells. See the Performance Guide for more information.

  2. For the cases where you really need a column count, decide which is the exact column count that you want. Do you need to include empty formatted cells, formatted columns, etc? Then you can use the following code to calculate it:

    static int CalcMaxColumn(ExcelFile xls)
    {
        int RowCount = xls.RowCount;
        int MaxCol = 0;
        for (int row = 1; row <= RowCount; row++)
        {
            int ColCountInRow = xls.ColCountInRow(row);
            for (int colIndex = ColCountInRow; colIndex >= 1; colIndex--)
            {
                int XF = -1;
                object cellValue = xls.GetCellValueIndexed(row, colIndex, ref XF);
                if (cellValue == null) continue; // you can add some other condition here like if it is a RichString and the richstring is NullOrWhiteSpace()

                int c = xls.ColFromIndex(row, colIndex);
                if (c > MaxCol) MaxCol = c;
                break;
            }
        }
        return MaxCol;
    }


Finding the actual fonts used when exporting to PDF | FlexCel Studio for the .NET Framework documentation

Finding the actual fonts used when exporting to PDF

As explained in the PDF exporting guide, when you export a file to PDF, you might end up with white rectangles instead of the actual text.

The cause of those problems is font substitution: If you create a new file in Excel and write おはようございます！in cell A1, the text will display correctly, even if you don't change the default Calibri font: unicode in calibri

If you open this file in the FlexCel previewer it will also look fine: unicode in calibri previewer

If you print, export to HTML, images or SVG, from Excel or FlexCel, the file will look fine. But what happens if you export to PDF? Given the fact that I just gave you a link about font problems in PDF, and that this tip is about fonts on PDF, you might expect the export to PDF to be wrong. But no, if you export to PDF, with Excel or FlexCel, you will see then same nice Japanese text.

And yet, everybody is lying here. Calibri doesn't contain definitions for Japanese characters, and so it is impossible to draw a お using Calibri. The image isn't there. So why do you see お instead of a blank square when you look at the text in Excel? Because under the hood, Windows is replacing Calibri by a different font that has a definition for お, and using that font to draw お instead. Same when you look at the FlexCel previewer, or when you export to PDF. Whoever is rendering the font realizes that they can't do it with Calibri, and they use a different font instead.

However, now we come to the part where PDF is different. In all the other cases, when printing, exporting to HTML or whatever, it is the Operating System or the Browser who does the font substitution. You just tell the OS to draw a お in Calibri, and it takes care of finding the best font.

PDF is different. If a PDF file tells a PDF reader to draw a お in Calibri, it will not do font replacement, and print a square. So we need to do the font replacement ourselves before writing the PDF file. The PDF file we generate must have the correct font to draw the characters we want.

But now you might be wondering: Why, when we exported to PDF with FlexCel, we didn't get blank squares? We can get a hint of what is happening if we look at the generated file in Acrobat and press "Ctrl-D" to see the fonts used in the document:

extra fonts in pdf

A-ha! There is an extra "Arial Unicode MS" font, and that is what Acrobat must be using to render the text. And so, where does "Arial Unicode MS" comes from? As mentioned in the PDF exporting guide, FlexCel is using the FlexCelPdfExport.FallbackFonts property to figure out which font to use. It tries the fonts one by one until it finds one that supports the character, and then uses that instead when exporting to PDF.

And the problem is that this is all transparent to you until it isn't. Because while we have a good set of default fallback fonts, we don't and can't cover every language. Some languages will still get a blank square (if the character is not in any of the fallback fonts), and some might get uglier fonts (because the replacement font with nicer glyphs is not in the FallbackFonts list). Also, there used to be a font with most glyphs out there (Arial Unicode) installed by default in Windows, but that font doesn't ship with Windows 10 anymore (probably because it was too big).

So let's go back to our Japanese. Let's imagine that we are in a computer without Arial Unicode or any other fallback font supporting Japanese, and we want to modify our FalbackFonts list to support it. Which font should we use?

Excel won't show you what font it is using to display the text on the screen. It will happily tell you it is "Calibri" even when we know it isn't. If you export the file to HTML, it will be exported as "Calibri" too, and the browser will perform the font substitution, but the browser won't tell you either. The process is so transparent; that nobody will tell you the real font they are using. They will just pretend it is Calibri.

Until we remember that PDF is different. And now, after so many words, this leads us to today's tip: To find out the fallback fonts you need for exporting to PDF in FlexCel, export the file to PDF with Excel, and then press Ctrl-D in Acrobat to look at the fonts Excel used.

In our example, if we exported the original file to PDF with Excel, not FlexCel, and pressed Ctrl-D, we would see: extra fonts in pdf excel

And this solves the case. Excel used MS-Gothic, not Calibri, to draw the Japanese text. If you are getting white squares when exporting from FlexCel, consider exporting the file to PDF from Excel, and look at the fonts it used.


Using scalable images in your documentation | FlexCel Studio for the .NET Framework documentation

Using scalable images in your documentation

When writing FlexCel documentation at tms, we often need to include document screenshots.

In many cases, a simple screen capture will do. But in others, we'd like something that can scale with the monitor resolution, and a bitmap is not enough. In those cases, we use FlexCel to export the images as SVG (scalar vector graphics).

We will discuss two different cases here:

  1. Sometimes you want to render a simple object. Like for example the chart at the top of this blog post We created that image from the file in the Chart API example, using the following code:

           var svg = xls.RenderObjectAsSVG(-1, "@lines of code", "Lines of code over time", "This chart was rendered with RenderObjectAsSVG", Encoding.UTF8);
          {
              File.WriteAllText("flexcel-lines-of-code.svg", svg);
          }

  2. Other times, you might want to render a part of a sheet, as we did in the diagram at the end of this article. On those cases, we use code similar to the following:

           using (var svg = new FlexCelSVGExport(xls, true))
          {
              // Set a page size that has the size of the image you want.
              // You will need to experiment a little to get the correct size.
              svg.PageSize = new TPaperDimensions("custom", 780, 300);

              svg.SaveAsImage((x) => { x.FileName = "result" + x.PageNumber.ToString(CultureInfo.InvariantCulture) + ".svg"; });
          }

You might change the print scaling of the xlsx file to get a smaller or bigger image.


Using Tokens to get information from formulas | FlexCel Studio for the .NET Framework documentation

Using Tokens to get information from formulas

Introduction

When reading formulas with FlexCel, you get a string with the formula definition, like for example:

=SQRT(A1^2 + A2^2)

And while this is enough in many cases, sometimes you need a little more information. For example, which are the cells used in the formula above? It is challenging to know that the cells used are A1 and A2 just by looking at the string. You could try to use some kind of regex to get the information, but you will hit limits soon. Formula syntax depends on the context, and depending on its surroundings, the string "A1" might be present in the formula and not mean a cell.

To solve this problem correctly, we need to parse the string. And guess what? FlexCel already has one parser which you can use. To print out the cells used in the formula above, you can use the following code:

    //Set up a file to analyze.
    XlsFile xls = new XlsFile(1, TExcelFileFormat.v2021, false);
    xls.SetCellValue("A2", new TFormula("=SQRT(A1^2 + A2^2)"));

    //Print the cell addresses in the formula.
    var tokens = xls.GetFormulaTokens(2, 1);
    var cellrefs = from x in tokens where x is TTokenCellAddress select x;

    foreach (TTokenCellAddress cellref in cellrefs)
    {
        Console.WriteLine(cellref.Address.CellRef);
    }
Note

In the example above, we set cell A2 to the formula and then use ExcelFile.GetFormulaTokens to read the tokens. This was done to simulate a real-world situation where we already have the formulas in an existing file, and we want to parse them. But for this particular example, instead of setting the value of a cell and then reading the tokens from the cell, we could have used ExcelFile.GetTokens to get the tokens directly from the string.

Analyzing formulas in a file

ExcelFile.GetFormulaTokens returns an array with the tokens that make up the formula, using RPN Notation

RPN is straightforward to evaluate mechanically. When you have a data token, you push it into the stack. When the token is an operator or function taking n parameters, you combine the n last members of the stack and replace them by the result. So let's see in more detail the tokens in the formula above. This is the full list of tokens returned by GetFormulaTokens:

  • TTokenCellAddress - A1
  • TTokenData - 2
  • TTokenOperator - Power
  • TTokenWhitespace - the is the space before the "+". We will ignore whitespace
  • TTokenCellAddress - A2
  • TTokenData - 2
  • TTokenOperator - Power
  • TTokenWhitespace
  • TTokenOperator - Add
  • TTokenFunction - SQRT

Using RPN, this is evaluated as follows:

  1. Push A1 into the stack
  2. Push 2 into the stack
  3. Calculate A1^2 - Now the stack contains only A1^2
  4. Push A2 into the stack
  5. Push 2 into the stack
  6. Calculate A2^2 - Now the stack contains A1^2 and A2^2
  7. Add both entries in the stack. Now the stack contains A1^2 + A2^2
  8. Calculate SQRT of the entries in the stack. The result is SQRT(A1^2 + A2^2)

You can visualize the stack after each step above in the following diagram:

Manipulating formulas in a file

Up to now, we've seen how to analyze existing formulas. This enough can be very powerful, and allows you to create custom static analyzers that can detect unwanted constructs in spreadsheets. But do you know a nice feature that most good static analyzers have? They allow you to apply fixes to your code automatically.

So let's imagine we have a file with thousands of formulas, and in cell B1 we have a constant which contains the tax to apply. We want to check all the formulas for references to B1, and make sure they reference a name "Tax" instead. We have half of the solution already: ExcelFile.GetFormulaTokens. This method will allow us to detect all references to B1 in the formulas. But now, to actually modify the code, we need the other half: ExcelFile.SetFormulaTokens

We can now read the tokens of a formula, modify them, and write them back. The following code will replace all occurrences of B1 by the name "Tax":

    //Set up a file to analyze.
    XlsFile xls = new XlsFile(1, TExcelFileFormat.v2021, true);
    xls.SetCellValue("A2", new TFormula("=B1 * C2"));
    xls.SetNamedRange(new TXlsNamedRange("Tax", 0, 1, 1, 2, 1, 2, 0));

    //Modify all references to B1 to be references to the name "Tax"
    var tokens = xls.GetFormulaTokens(2, 1);

    var modified = false;
    for (int i = 0; i < tokens.Count; i++)
    {
        if (tokens[i] is TTokenCellAddress address
            && address.Address.Row == 1
            && address.Address.Col == 2)
        {
            tokens[i] = new TTokenName("Tax", null, null);
            modified = true;
        }
    }

    if (modified)
    {
        xls.SetFormulaTokens(2, 1, tokens);
    }


Semi-absolute references | FlexCel Studio for the .NET Framework documentation

Semi-absolute references

As you probably already know, in Excel, you have absolute and relative references. An absolute reference has a $ before either the column or the row. So, for example, $B4 has an absolute column and a relative row, while $B$4 has both absolute column and row.

Absolute references don't change when you copy the formula, while relative references adapt. If you have the following formula in cell A1:

=B1+$B$1

And you copy cell A1 into A2, you will get

=B2+$B$1

The row in the relative reference changed, while the absolute reference didn't. This is all simple and makes sense: You use relative references for variables that change when you change the row or column, and absolute references for constants. It seems like this should cover all cases, and yet, you might find that sometimes none of them works in the way you want them.

When a reference needs to be relative sometimes, and absolute others

Let's imagine this simple case:

semi absolute refs

Here cell B1 is a clear case of an absolute reference. It contains the VAT, and the VAT is a constant for all cells in the sheet. On the other hand, column "Price without Tax" is a clear case of a relative reference: You want "Price with Tax" to be =B6 * $B$1 for row 6, and =B7 * $B$1 for row 7.

But take a look at the formula in column "Final price". For the first block (clothing), you want an absolute reference to the clothing discount (cell B4). But for the second block (toys) you want a different reference to the toys discount (cell B11)

If we made the formula in "Final price" column to be =C6 * $B$4, it will work fine for the first block, but cell D13 would have the formula =C13 * $B$4 instead of =C11 * B11.

But if we made the formula relative: =C6 * B4, then the formula in D7 would be =C7 * B5

This is a case where neither relative or absolute references would work. And so FlexCel introduces a new mode, which we've called "semi-absolute references".

What is a semi-absolute reference

We define a semi-absolute reference as a reference which behaves as relative when inside the block being copied, and as absolute when outside. In the example above, when we copy the rows from 3 to 9 to row 10:

  • Cell B1 is outside the block being copied (outside rows 3 to 9). So references to $B$1 will be absolute.
  • Cell B4 is inside the block being copied. So even when we write $B$4, this reference will be relative, and point to row 11 for the copied block (rows 10 to 15)

How to use FlexCel's semi-absolute references

Since we can't change Excel formula syntax, semi-absolute references don't introduce a new notation. That is, we can't add a new syntax like =A1 + €A€1 for semi-absolute references, because Excel wouldn't understand them. So semi-absolute references are a mode instead, which applies to all absolute references.

When in semi-absolute mode, all absolute references will behave as semi-absolute.

You can enter semi-absolute reference mode by either:

  • When using the API, setting ExcelFile.SemiAbsoluteReferences = true.

  • When using Reports, setting FlexCelReport.SemiAbsoluteReferences = true

  • When using Reports, you can also write <#Semi Absolute References> or <#Absolute References> in the expressions column in the <#config> sheet. This allows you to decide if to use semi-absolute references on a report-by-report basis.

Note

You will find that semi-absolute references make more sense than absolute-absolute references in most cases. They simply behave more intuitively. So typically, there is no problem in setting SemiAbsoluteReferences = true by default in your reports. When an absolute reference is inside the block being copied, you usually want the new cells to refer to the copied absolute reference, not to the old reference.

The only reason we don't set semi-absolute references on by default is because this is not the way Excel behaves, and we try to be the as much compatible as possible with Excel.


References in conditional formats and data validations | FlexCel Studio for the .NET Framework documentation

References in conditional formats and data validations

In theory, formulas in conditional formats should behave similarly to formulas in cells. But the thing is: A conditional format applies not to a cell (like cell formulas) but to a range of cells. As we will see below, this causes differences that are important to know.

Note

In this tip, we will focus on Conditional formats. But what we say here applies whenever a formula covers a range of cells, as it is the case with, for example, data validations too.

Say, you might apply a conditional format to cells A3:A5 where if the number is > 5 it will show red:

conditional formats range

As you can see in the image, we apply the format if A3 is bigger than 5. But what does "A3" mean here? If you press enter, you will see that A4 becomes red, even when the formula we wrote said "a3>5" (and A3 is not bigger than 5):

conditional formats range values

And if you think about it, you can't write a "normal" cell formula here, because the same formula applies to a range of cells, and you want the formula to apply to A3 when it is in A3, to A4 when it is in A4, and so on. So A3 in the formula above means "the cell where we are evaluating the format". If the cell is A3, it means A3; if the cell is A5, it means A5.

Here Excel and FlexCel behave a little different. Excel uses the top left corner cell of the range (in this case, A3) to mean "cell with 0-offset". So here, A3 means "current cell" and in this formula A4 would mean "cell which is 1 row below". This is because the range where the conditional format applies starts at A3. In FlexCel the "0 offset cell" is always A1.

So if you look at the formula in FlexCel, it will say "=A1>5" instead of "=A3>5". This is a cosmetic difference, as Excel internally uses(and stores in the file) the formula "=A1>5", and using A1 always as the 0-offset cell makes more sense. But it is a difference you should be aware of.

Note

The fact that references in conditional format's formulas are relative can also have some interesting consequences when the offset is negative. What happens if we want to refer to "the cell that is 4 rows above us"? In the example we used, A3 meant "the cell that is in the current row". So the cell 4 rows above should be A(-1)?

No, we can't have negative rows. We need to wrap up the formula and start counting from the bottom of the spreadsheet (row 1068576). So the cell that is 4 rows above is A1068575 for Excel, and A1068572 when in FlexCel.

And this creates yet another problem: What is the last row of the spreadsheet? Currently, for an xlsx file it is indeed 1068576, but for xls files is 65536. And it used to be less than that, and in the future it could be bigger than that. Every time Excel changes the grid size, references in conditional formats can break. (see "Conditional Formats might become invalid" in the API Guide.

While we wouldn't expect Excel to change the grid size again soon (because this and other problems it can cause), if possible, it is a good idea to not use negative offsets inside formulas that apply to ranges of cells.


Replacing a font by another in an Excel file. | FlexCel Studio for the .NET Framework documentation

Replacing a font by another in an Excel file.

Sometimes you might want to replace all occurrences of a font by another inside an Excel file. Maybe the old font isn't widely available in some new platforms that you want to support, maybe there are licensing issues with the font, or maybe your company changed their corporate font and you need to change it in all existing reports. The reason doesn't really matter. So, how do we do it?

Note

Sometimes you might want to only change the font in the resulting PDF file, not in the xls/x files. If you only care about PDF outputs, make sure also to read the PDF exporting guide

Step 1: Manually inspect the old and the new font.

Before even starting, let's make this clear: Fonts can have different metrics. Some fonts are very similar, like Arial and Helvetica, but some other fonts can be completely different.

If the fonts you are replacing have similar metrics, you can skip to the next step. But if they don't, the first thing to do is to analyze how different they are.

In this example we are going to replace Calibri by Verdana, so let's write a sentence in Calibri 11pt and Verdana 11pt to see how different they are:

calibri11 vs verdana11

Oops... they are quite different. So we can't just do a "search and replace" from Calibri to Arial, without breaking the report layout. For this particular phrase, Calibri 11pt should be replaced by something like Verdana 8.5 pt: calibri11 vs verdana85

And this means that the existing Calibri text must be reduced in size by about 0.8 to get a similar text in Verdana.

Note

0.8 is the factor for the phrase that we tested: "The secret of getting ahead is getting started." While it shouldn't vary too much, some phrases will be shorter or longer, depending on the metrics of every character in both fonts. We are doing no exact science here, and unless you are replacing very similar fonts like Arial by Helvetica, you must expect some layouts to break.

Step 2: Replace the fonts.

Ok, so we now know we have to replace Calibri 11pt by Verdana 8.5pt, or more in general Calibri Npt by Verdana N*0.8pt.

In Excel, we would have to change the fonts in every cell, and the styles, and the themes, and text inside autoshapes, and text inside charts, and so on. But luckily for us, in FlexCel it is more straightforward. There are two places we have to change: The font list and the themes. And you can do so with the code below:

    const string FontToReplace = "Calibri";
    const string ReplaceWith = "Verdana";
    const double FontFactor = 0.8;

    XlsFile xls = new XlsFile("original_file.xlsx", true);

    //Change the fonts
    for (int i = 0; i <= xls.FontCount; i++)
    {
        TFlxFont fnt = xls.GetFont(i);
        if (String.Equals(fnt.Name, FontToReplace, StringComparison.OrdinalIgnoreCase))
        {
            fnt.Name = ReplaceWith;
            fnt.Size20 = (int)(fnt.Size20 * FontFactor);
        }
        xls.SetFont(i, fnt);
    }

    //Change the theme font
    var Theme = xls.GetTheme();
    Theme.Name = "My theme";
    Theme.Elements.FontScheme.Name = "My font scheme";
    var textFont = new TThemeTextFont(ReplaceWith, "", TPitchFamily.FIXED_PITCH__SWISS_FONT_FAMILY, TFontCharSet.Ansi);

    if (String.Equals(Theme.Elements.FontScheme.MajorFont.Latin.Typeface, FontToReplace,
        StringComparison.OrdinalIgnoreCase))
    {
        Theme.Elements.FontScheme.MajorFont.Latin = textFont;
    }

    if (String.Equals(Theme.Elements.FontScheme.MajorFont.ComplexScript.Typeface, FontToReplace,
        StringComparison.OrdinalIgnoreCase))
    {
        Theme.Elements.FontScheme.MajorFont.ComplexScript = textFont;
    }

    if (String.Equals(Theme.Elements.FontScheme.MajorFont.EastAsian.Typeface, FontToReplace,
        StringComparison.OrdinalIgnoreCase))
    {
        Theme.Elements.FontScheme.MajorFont.EastAsian = textFont;
    }

    if (String.Equals(Theme.Elements.FontScheme.MinorFont.Latin.Typeface, FontToReplace,
        StringComparison.OrdinalIgnoreCase))
    {
        Theme.Elements.FontScheme.MinorFont.Latin = textFont;
    }

    if (String.Equals(Theme.Elements.FontScheme.MinorFont.ComplexScript.Typeface, FontToReplace,
        StringComparison.OrdinalIgnoreCase))
    {
        Theme.Elements.FontScheme.MinorFont.ComplexScript = textFont;
    }

    if (String.Equals(Theme.Elements.FontScheme.MinorFont.EastAsian.Typeface, FontToReplace,
        StringComparison.OrdinalIgnoreCase))
    {
        Theme.Elements.FontScheme.MinorFont.EastAsian = textFont;
    }

    xls.SetTheme(Theme);

    xls.Save("result_file.xlsx");


Finding out how many pages will be exported | FlexCel Studio for the .NET Framework documentation

Finding out how many pages will be exported

If you need to calculate the number of pages a report will take without actually exporting it or printing it, you can use the code below.

    public int NumberOfPagesToExport(ExcelFile xls)
    {
        using (FlexCelImgExport img = new FlexCelImgExport(xls))
        {
            var ExportInfo = img.GetFirstPageExportInfo();
            return ExportInfo.TotalPages;
        }
    }

You can use the FlexCelImgExport.GetFirstPageExportInfo method to find out a lot of information about how the pages will be exported. For example, you might have set a "Print to fit" in one page wide, and wonder which zoom FlexCel will use to fit the page. If the zoom is too small, you might want to change it to fit in two pages wide. To get the zoom used in the page, you can use:

    public double FinalZoom(ExcelFile xls, int sheet)
    {
        using (FlexCelImgExport img = new FlexCelImgExport(xls))
        {
            var ExportInfo = img.GetFirstPageExportInfo();
            return ExportInfo.Sheet(sheet).ZoomUsed;
        }
    }


Fine-tuning row autofitting. | FlexCel Studio for the .NET Framework documentation

Fine-tuning row autofitting.

As discussed in the Api guide the text in Excel can change with the resolution or zoom of the printed page, and what fits at one resolution might not fit at another.

The solution for that problem is to make the column or row big enough that it will fit at any resolution, and to do so, ExcelFile.AutofitRow and ExcelFile.AutofitCol have two parameters: "adjustment" and "adjustmentFixed"

Basically, if for example AutofitCol calculates that the needed column width is 9, then it will set the actual column width to 9 * adjustment + adjustment fixed.

If adjustment is 1.1 and adjutmentFixed is 0.2, then the column width will be set not to the 9 calculated, but to 9 * 1.1 + 0.2 = 10.1

Similarly, if the autofit engine calculates that the exact row height to fit some lines of text is 100, it will set the row height to 100 * adjustment + adjustmentFixed.

But rows and columns are not the same, and autofitting rows is different from autofitting columns. This is because we write horizontally from left to right (or right to left) and not from top to bottom. And adjustment and adjustmentFixed are not great for providing that extra margin when autofitting rows.

Let's imagine we are trying to fit the text "Hello World" into a column. As said, if we calculate that the width necessary to fit the text is 9, we will make the column 10.1 and so the text will fit anyway even if the resolution is different.

But now, let's imagine that we want to autofit the row containing "Hello World". Same as with the column, we provide an adjustment, so the row will be a little larger than what it needs to be. But, at some resolutions "Hello World" might fit in one line inside the column:

hello world in one line

and at other resolutions it might break into "Hello" in the first line and "World" into the second line:

hello world in two lines

It is a very small difference in the width of the text, but it causes the row height to double. We would need to have an adjustment of 2.0 to correctly display the text at any resolution. But an adjustment of 2.0 will make all other lines twice as big as needed. Adjustment alone is not a solution when fitting rows (as it is for fitting columns).

To ensure the row with "Hello World" is always set to 2-line height, we need to reduce a little the effective width of the cell.

Imagine for example that at resolution A "Hello World" is 9.9 inches long, but at resolution B it is 1.1 inches long. If the cell width is 10 inches, then at resolution A it will fit in one line, but at resolution B it will take 2 lines. But if we reduce the effective width of the cell from 10 inches to 9.8 inches, now no matter which resolution we use, it will always take 2 lines.

On the other hand, the text "Hello" is 0.5 inches long, so it fits always in one line at resolution A or B. We got what we wanted: "Hello" always fits in one line, "Hello World" always fits in 2 lines.

In FlexCel, the way to reduce the effective width of the cell is using the property ExcelFile.CellMarginFactor

So if you are having issues with autofitting rows at different resolutions, you might want to set ExcelFile.CellMarginFactor to a value like 1.1 before autofitting the rows.


Understanding CSV files. | FlexCel Studio for the .NET Framework documentation

Understanding CSV files.

The problem with CSV

In theory, CSV files should be simple. They might not have the rich formatting abilities of an xls/xlsx file, but they are just text, and text is simple. They should be much better for interoperability between apps, because every app should be able to understand text, so they should be able to parse CSV files without much effort.

But in practice CSV is a poor format to share data to unknown apps, and the reason is the lack of a standards-defined CSV file format. Or actually the problem is not that there is not a standard, because there is one: https://tools.ietf.org/html/rfc4180

The problem is that nobody implements the standard. If you create CSV files which conform to the standard, most apps that can load CSV files (including Excel, Open Office and Google docs) will fail to open the files.

CSV files are what is known as a "de-facto" standard, and by de-facto we mean "Valid CSV files are the files that Excel generates". Other apps or tools will try to open and save "Excel-CSV" files, not "Standard-CSV" files, and those tools include FlexCel. FlexCel will generate Excel-compatible-CSV, so your users can open those CSV files with Excel or other tools that understand "Excel-compatible-CSV". In the same way, when reading FlexCel will assume the file is also Excel-compatible-CSV, because most CSV files out there are.

Ok, so going back to the title, what is the problem with CSV? The problem is that "Excel-compatible-CSV" is not a single standard: Different Excel versions and languages will generate different files. There are multiple CSV standards, and when you open a file you have to know which standard was used to generate it. When you create a CSV file, you must know which application will read the CSV file, and save the file in a format the target application will understand.

In the rest of this document we will discuss the differences.

The locale

Different languages use different decimal and thousands separators. In English, the decimal separator is the dot, and the thousands separator is the comma. So we would write the number "one thousand, ninety-nine point twenty-five" as "1,099.25". But in most other languages, the comma and the dot are reversed, and for example in Spanish, the same number would be written as "1.099,25".

Different languages also have different date ordering. In English, 2/1/1998 means "February 1, 1998". In many other languages it means "January 2, 1998"

Now imagine that you are reading a CSV file generated by an unknown application, and you find the number "1.234" in the file. Does this number mean "1 dot 234" or "1 thousand, 2 hundred and thirty-four"? You can't really know. If the file was created by some user with Excel in a Spanish machine, then it is 1234. If the user was in an English machine, then it is 1.234.

The same problem happens when you want to create a CSV file that other application(s) will read. Do you save "February 2, 1998" as "2/1/1998" or "1/2/1998"? You need to know who is going to read the file, and save a file they will understand.

The separator

It is there in the name: "C S V" stands for "Comma-Separated Values" So you would expect the different columns in a CSV to be separated by commas. But probably because in non-English locales the comma is used as the decimal separator, in non-English locales Excel uses the semi-colon (;) as the field separator. To avoid the confusion between "," and ";", some other applications use a tab (character 9) to separate between fields (this is also known as "TSV" or tab-separated values).

Once again, when you read a CSV file you need to know which separator was used in the file. When creating the file, you need to know which separator the application reading the CSV file will expect.

The encoding

Finally, you need to know the encoding to save the file. Excel by default uses the Windows' encoding when saving to CSV, and this means the meaning of the bytes in the CSV file vary depending on the machine reading them.

If for example a user saves a CSV in a Russian-locale machine, the file will be saved with a Windows-1251 Encoding This means that if he writes the character "Д" in the file, it will be saved as the character 196. When a user with an English locale (Windows-1252)opens the file, he will see an "Ä" instead since that is what the number 196 represents in Windows-1252.

In an ideal world, we would be using UTF-8 as the universal encoding, but we are far from living in an ideal world. In this real world, once again, you need to know who is going to read the file and save the file in the encoding they expect. When reading files, you need to know what encoding was used to create them.

Important

In Windows encodings like 1252 every byte is a valid character, so there is no way to know if the encoding is incorrect. The text you are reading might make no sense, but any combination of bytes is valid. But in UTF8 many combinations of characters are invalid, so when loading an UTF8 document, the UTF8 decoder can normally detect invalid documents.

What the decoder does when detecting invalid UTF-8 sequences depends in the OS and platform you are using: Sometimes it will change the invalid character by a "?" or a white square, but on others it might refuse to decode the full text.

If you are getting 0 rows when importing a CSV file in FlexCel, you most likely are using UTF-8 and the file is not in UTF-8. The UTF-8 decoder is detecting invalid characters and passing an empty string to FlexCel. When FlexCel loads the empty string, it will produce an empty document.

Dealing with CSV files in FlexCel

As discussed in the previous section, there are 3 things you need to know when reading and writing CSV files: The locale, the separator and the encoding.

To specify the locale of the files you are reading or writing, you need to change the FlexCel locale.

You specify the separator and the encoding when you call ExcelFile.Export or ExcelFile.Save to save the file, or when you call ExcelFile.Open or ExcelFile.Import to open the file.

Below is an example about how to open a file saved in a Spanish locale, using ";" as field separator and Win1232 as Encoding, and save the file using "," as field separator, with a USA locale, and UTF-8 encoding:

    CultureInfo SaveLocale = System.Threading.Thread.CurrentThread.CurrentCulture;
    CultureInfo SaveUILocale = System.Threading.Thread.CurrentThread.CurrentUICulture;
    System.Threading.Thread.CurrentThread.CurrentCulture = new CultureInfo("es-ES");
    try
    {
        System.Threading.Thread.CurrentThread.CurrentUICulture = System.Threading.Thread.CurrentThread.CurrentCulture;
        try
        {
            XlsFile xls = new XlsFile(true);
            xls.Open("test.csv", TFileFormats.Text, ';', 1, 1, null, Encoding.GetEncoding(1252), true);
            System.Threading.Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");
            System.Threading.Thread.CurrentThread.CurrentUICulture = System.Threading.Thread.CurrentThread.CurrentCulture;
            xls.Save("result.csv", TFileFormats.Text, ',', Encoding.UTF8);
        }
        finally
        {
            System.Threading.Thread.CurrentThread.CurrentUICulture = SaveUILocale;
        }
    }
    finally
    {
        System.Threading.Thread.CurrentThread.CurrentCulture = SaveLocale;
    }
Important

As if it wasn't enough with all the issues discussed in this documents, CSV files can also be slow to read. This is because for every cell we read, we have to figure out the cell type. Please read the CSV section in the Performance Guide for more information.

Conclusion

It would make (a lot of) sense if we all agreed in a single standard so we would be able to generate "universal CSV files" which everyone could read or write, but that is just not the way it is.

You can use CSV files to interchange data with known applications, but using CSV as a "general" interchange format for unknown users is not a great idea. For example, don't provide a link to download a CSV file in a website unless you know all your users will use the same settings when opening that file. Providing an xlsx file instead is a much safer way to ensure everyone can read it.


Embedding Excel files in your application | FlexCel Studio for the .NET Framework documentation

Embedding Excel files in your application

Sometimes, you need to include either templates for reports or pre-made Excel files inside your application. The simplest option is just to deploy your xls/x files together with your application, but you might want to embed them in your executable instead.

One way you might think of to include the xls file is using APIMate to "convert" the file into code, then paste that code inside your application. But while that would work, it isn't really a nice solution:

  • The code generated by APIMate is very repetitive. So for example if you have the cells from A1 to A100 with the numbers 1 to 100, APIMate will write 100 calls to ExcelFile.SetCellValue(1, 1, 1), ExcelFile.SetCellValue(2, 1, 2), and so on, instead of calling ExcelFile.SetCellValue(row, 1, row) in a loop with row from 1 to 100. The idea of APIMate is to show you how to do stuff, so for example you want to know how to format a cell conditionally, you conditionally format it in Excel, then open the file in APIMate and look at the code APIMate generates. But it is not great to actually convert files to code.

  • For the reason above, the code will be big, resulting in a bigger executable than if you embedded the file directly, and it will be slower to compile too.

  • Embedded files as resources will normally open faster than the code that APIMate generates uses to create the file. Again, the code generated by APIMate is not designed for this, and it can be inefficient as it sets every cell with a different call.

  • Resources are simpler to update. Just edit the file in Excel, save it and rebuild your app. While if you used APIMate, you would have to relaunch APIMate and recopy-paste the code every time.

So how do you embed a file as a resource?

  1. In Visual Studio, go to Menu->Project->Add Existing Item... (or press Shift+Alt+A)

  2. In the dialog to select the file set the filter to All Files (*.*) and select the xls/x files you want to embed.

  3. In the solution explorer, right click in the file(s) you added and select "Properties":

add resources visual studio

  1. Set the Build Action of the files to Embedded Resource:

visual studio build action

  1. Now, to open the file, use the following code:
    Assembly asm = Assembly.GetExecutingAssembly();
    using (Stream InStream = asm.GetManifestResourceStream("Resources.test.xlsx"))
    {
        var xls = new XlsFile(InStream, true);
    }

Where the name of the resource is "Namespace.NameOfTheFile" (In this case the namespace is "Resources" so the name of the resource is Resources.test.xlsx)

If you can't figure out the name of the embedded resources, you can use the following method:

    static string[] GetEmbeddedFiles()
    {
        Assembly asm = Assembly.GetExecutingAssembly();
        return asm.GetManifestResourceNames();
    }

This code will return the names of all embedded files in your executable.


Internal numeric formats. | FlexCel Studio for the .NET Framework documentation

Internal numeric formats.

Excel numeric formats should in theory be simple. For example you set a cell format to be "00.00", then the number 1 is formatted as 01.00. But it gets more complex than that, and in this tip we are going to dig deeper into format strings. Most of the information here is Excel -not FlexCel- specific, but it helps to know about how format strings work in detail.

Localized format strings

The first thing you need to be aware of is that Excel uses different format strings depending on the language of the Excel version that you have installed. For example, in English Excel you could use "yyyy-mm-dd" (year-month-day) to print a date like "2000-01-01". But if your Excel is in Spanish, you would have to write "aaaa-mm-dd" (año-mes-día)

This sounds like a nightmare for sharing files: I write a file with my English Excel, using a format like "yyyy-mm-dd" so the cell looks to me like "2000-01-01", but when I share it with you and you open it in your Spanish Excel, you will see "yyyy-01-01" in the cells instead of "2000-01-01" since the file is using "y" for year and it should be using "a" for año.

But luckily it is not that bad. Internally, in the file all formats are stored in English and converted on the fly by Excel when showing them to you. This means that inside the xls or xlsx file the format will always be stored as "yyyy-mm-dd". When you open it in a Spanish Excel, Excel will display it as "aaaa-mm-dd". When you enter "aaaa-mm-dd" as a format in a cell in a Spanish Excel, it will be saved as "yyyy-mm-dd" inside the file. So the file can actually be shared between different languages, without issues. Some users will see "yyyy-mm-dd" when they open it and others will see "aaaa-mm-dd", but the file is the same internally.

This is the reason you always have to enter format strings in English when using FlexCel. It doesn't matter if you have a Spanish Excel installed and you see the format strings using Spanish names, what goes on the file is always English format strings. You can use APIMate to get the English format strings that you need to use in FlexCel even if you have a Spanish or another language Excel. Just enter the format string in your language in Excel, save the file, and open it with APIMate. It will show you the English format string that you need to use.

Warning

While numeric formats in cells will be automatically converted as mentioned above, you have to be extra careful when using functions like Text

In those cases the format will not be automatically translated. The formula =Text(A1,"yyyy-mm-dd") will not work correctly when opened in a non-English Excel. Similarly, the formula =Text(A1,"aaaa-mm-dd") will work in your Spanish Excel, but users with other languages will see it wrong.

Internal format strings

Ok, now we know that the format strings are stored always as English strings, except when inside formula functions. This means that a format like "dd/mm/yyyy" should look the same everywhere, shouldn't it?

Sadly not always. The most commonly used format strings are not stored as strings inside a file, but as format ids. This is probably a file size optimization for times where floppy disks had 1.44 mb, but it still is like this today. And as you might guess, those internal formats are also a problem, because they change with the language of Excel.

So for example, format number 20 is "h:mm" in an Excel from the USA, but "hh:mm" in an Excel from England. If you set the cell format in the USA to be "h:mm" and then send the file to a customer in England, he will likely see "hh:mm" when he opens your file.

Note

The internal formats, except for formats number 14 and 22, are hardcoded into Excel itself, they don't change with the machine locale. This means that if you buy a USA version of Excel, it will always read format 20 as "h:mm" even if you are in a machine with a British locale and your Windows settings are "hh:mm".

Formats 14 and 22 are different, and we cover them in the next section.

This creates a problem for FlexCel. What should we display when we find a format 20 in a file? There are no "American" and "British" versions of FlexCel, there is a single flexcel.dll file that is the same for all users over the world. So we can't hardcode "h:mm" for American versions of flexcel.dll and "hh:mm" for British versions.

What FlexCel does instead is to behave as an American Excel by default, but letting you customize the built-in format to whatever you want. The method you use for that is XlsFile.SetBuiltInFormat

Please read the link above to see a list with every internal format and how it is interpreted by FlexCel.

Format strings that actually change with the locale

As it was mentioned above, all internal formats except 14 and 22 are hardcoded. But formats 14 and 22 behave differently: they change depending on your locale.

So if you save a file with the format "mm/dd/yyy" in an American locale, this format will be saved as format 14. If you now change the Windows locale so dates are "dd/mm/yyyy", the same Excel will show the file differently.

Those two internal formats are shown by Excel starting with an "*", and it is explained in the format dialog that those formats change with the locale.

There are actually four formats that change with the locale. Two of them are for dates (long and short form) one is for date and time, and the last one is for time. Two of them use an internal format (14 and 22), the others use a [$-F0000] syntax.

They are as follows:

  1. Short Date: This is the internal format number 14. To set a cell to this format, set the format string to be RegionalDateString. RegionalDateString is a FlexCel variable which will change depending on your ShortDatePattern in your locale settings.

    Note

    This format is not directly the format string in your Windows settings converted to an Excel formatted string. While it will read the format string from the Windows settings, only some formats are allowed and extra stuff might be ignored. For example, if the Windows format string is "mm/dd/yyyy dd/mm" the Excel string will be "mm/dd/yyyy".

  2. Long Date: This is not stored as an internal format, but as a format starting with the string "[$-F800]". What goes after [$-F800] doesn't really matter, but normally it is the format string for a long date in the language Excel was when creating the file. This allows third-party Excel readers which don't understand the [$-F800] string to still display something.

    So for example you could have the format string: "[$-F800]dddd,\ mmmm\ dd,\ yyyy". As it starts with [$-F800], it will be converted to a regional date by Excel (or FlexCel), and what is after the [$-F800] will be ignored. But some other third-party Excel viewer which doesn't know about this will ignore the [$-F800] and still display a long date, just not correctly localized.

  3. Date and Time: This is the internal format number 22. To set a cell to this format, set the format string to be RegionalDateTimeString. RegionalDateTimeString is a FlexCel variable which will change depending on your locale settings.

  4. Time This is not stored as an internal format, but as a format starting with the string "[$-F400]". What goes after [$-F400] doesn't really matter, but normally it is the format string for a time in the language Excel was when creating the file. This allows third-party Excel readers which don't understand the [$-F400] string to still display something.

    So for example you could have the format string: "[$-F400]h:mm:ss\ AM/PM". As it starts with [$-F400], it will be converted to a regional time by Excel (or FlexCel), and what is after the [$-F400] will be ignored. But some other third-party Excel viewer which doesn't know about this will ignore the [$-F800] and still display a time, just not correctly localized.

Note

Those formats will change in FlexCel depending in your machine locale, just as they would in Excel. But you can change what FlexCel uses without needing to change the Windows locale. See the link about how to change the FlexCel locale

Tip

Besides the formats [$-F800] and [$-F400] you can actually use any locale with the same syntax. For example, the string: [$-409]m/d/yy h:mm AM/PM;@ is formatted with English locale. Those formats are what is shown at the bottom of the "Format cell" dialog, and FlexCel also fully supports them.

But those formats don't change with your machine locale: They show the same everywhere so they aren't really a problem and this is why we don't discuss them in this tip.

How to avoid internal format strings

As we have seen before, if you have an Excel from the USA and set the cell format to be "h:mm", this will be saved as format 20, not "h:mm" in the file. This format 20 then can be displayed differently to different customers with different localized versions of Excel.

FlexCel behaves the same: If you set the format to be "h:mm", it will realize that it matches internal format 20, and save the internal format 20 into the file.

So how do you set the format to be "h:mm" for everybody, and not the Excel-Locale-Dependent format 20?

The bad news is that there is no easy way to do exactly that. Whenever Excel sees "h:mm" it will be converted to format 20. But the good news is that it is very simple to do something that has the same effect: **You can set the format to be "h:mm;@" **

As you can see here this is a format string with two parts: "h:mm" for positive numbers and zeros, and "@" for negative values (Excel doesn't support negative dates, so the value here doesn't really matter). "h:mm;@" works exactly the same as "h:mm", but due to the extra @ it won't match the internal format and won't be converted. To match the internal format the string must be exactly "h:mm".

This is the trick Excel uses when you select a "locale" in the format dialog. Let's for example select a "Jamaica" locale:

localized formats 2

If you then go to "Custom" without closing the dialog, you will see that the format added was yyyy-mm-dd;@:

localized formats 3

The @ at the end makes sure this won't be replaced by an internal format.

How to find out the internal formats in your Excel version

As discussed, every localized Excel version has its own version of the internal formats. Also as discussed, we can't ship a different flexcel.dll for every locale, so our flexcel.dll comes localized by default as a USA Excel. And finally as also mentioned, you should try not to use localized formats if you care about the differences, by adding a ";@" at the end.

But what do you do if you are not creating the files, and your users are sending you files with internal formats created with their localized Excel versions?

Let's say you live in Spain, and your users are creating files with Spanish Excel with a format "dd/mm/yyyy". You are opening those files with FlexCel and exporting them to pdf, but in the export the dates appear as "mm/dd/yyyy" since FlexCel by default is localized as USA, and is behaving the same as if you had a USA Excel.

You can try to explain all of this to your users, but it is likely that they won't understand: They saved the files as "dd/mm/yyyy" and they expect the pdf to be "dd/mm/yyyy".

As we have learned in this article, the solution is to use XlsFile.SetBuiltInFormat to make FlexCel behave as a Spanish Excel. But how do you know which string to use in every one of the internal formats?

We can't sadly provide every translation from every locale Excel is translated too. And notice that even US locale is different from UK locale, so it is not just about different languages.

But what we can do is to give you a spreadsheet, which has all the relevant built-in formats in column B. This file has a user-defined function which will calculate the localized format on column B using the NumberFormatLocal VBA property. Then it shows you the code you need to write on columns F and G, in C# or Delphi respectively. If you are using a different programming language, it should be simple to change the formulas in either column F or G to return the calls in your language.

You can get the spreadsheet from here:

all-builtin-formats.xlsm

Tip

Remember to enable macros in this spreadsheet so the user-defined function will work.


How to change the FlexCel locale. | FlexCel Studio for the .NET Framework documentation

How to change the FlexCel locale.

Some formats in Excel change depending on the locale of your machine. We have discussed those formats more in depth in the tip about internal numeric formats.

When FlexCel renders a file to pdf or other format, it needs to know how you want those locales printed. Is it dd/mm/yyyy or mm/dd/yyyy? As you would expect, if you don't do anything, FlexCel picks the locale from your machine settings. If you want to change how FlexCel renders those locale-dependent formats, the simplest way is to just change the machine settings. But sometimes you can't or don't want to change the machine locale, but still want FlexCel to render those formats as if the machine had some specific locale.

In .NET it is simple to change the locale, you can just change the thread locale by changing CurrentCulture and CurrentUICulture

You might change them at the start of your application (or when creating new threads), or you might change it before working with FlexCel and set them back after the FlexCel work is done, as in the example below. You might even have different threads working in different locales.

Example:

    CultureInfo SaveLocale = System.Threading.Thread.CurrentThread.CurrentCulture;
    CultureInfo SaveUILocale = System.Threading.Thread.CurrentThread.CurrentUICulture;
    System.Threading.Thread.CurrentThread.CurrentCulture = new CultureInfo("zh-CN");
    try
    {
        System.Threading.Thread.CurrentThread.CurrentUICulture = System.Threading.Thread.CurrentThread.CurrentCulture;
        try
        {
            XlsFile xls = new XlsFile("chinese.xlsx", true);
            using (FlexCelPdfExport pdf = new FlexCelPdfExport(xls, true))
            {
                pdf.Export("chinese.pdf");
            }
        }
        finally
        {
            System.Threading.Thread.CurrentThread.CurrentUICulture = SaveUILocale;
        }
    }
    finally
    {
        System.Threading.Thread.CurrentThread.CurrentCulture = SaveLocale;
    }


Using barcodes. | FlexCel Studio for the .NET Framework documentation

Using barcodes.

One question we get regularly is how to embed barcodes using FlexCel. Excel doesn't have any barcode-specific functionality, so the ways to do that are to either insert an image with a barcode, or write text with a special font which will render the text as the barcode representation.

Using a barcode font

This is the simplest, and in my opinion best method to get barcodes into Excel. Just install a barcode font, then write the barcode in text, and it will be rendered as expected.

Advantages:

  1. The font is vectorial, not a bitmap, and fonts are great for scaling. That means that if you zoom in the page or print with a high-resolution printer, you won't see a pixelated image. It will always be crisp just like any other text in the document, because it is text, just rendered with a special font.

  2. The generated file will probably be smaller. If you have thousands of barcodes, each barcode will be stored as an ASCII text instead of as an image. It can make a big difference.

  3. The file can be easily edited by another user once you created it. They only need to change the text and the barcode will update.

  4. It is just simpler to write the text in FlexCel to a cell than to generate an image and insert the image.

Disadvantages:

  1. You need to find the special font that renders the barcode and you need and make sure you are legally allowed to redistribute the font. There are lots of free fonts on the internet, such as https://www.barcodesinc.com/free-barcode-font/ but you will have to find one that suits your needs.

  2. With images you might get more complex barcodes than with a font. Say for example a barcode with the shape of your logo, or with annotated text.

  3. In Excel you can't embed fonts, so to redistribute an xls or xlsx file using a barcode font, you need to make sure your users also have the font installed in their machines. If they don't have the font installed, they will see the text but not the barcodes.

Note

When exporting to PDF, not only you can embed the fonts, but also this is what FlexCel does by default when exporting. So a PDF generated with a barcode font will look great anywhere, no matter if the user seeing the pdf actually has the font installed on his machine or not.

Using an image

If a barcode font won't work for you, then the other option is to insert an image with the barcode where you need it. You will still need a separate component for creating the barcode image, and it is best if you can export it to wmf or emf since those are vectorial formats which will look better at higher resolutions. If you can only get pngs, make sure they are of a resolution that is good enough for printing. Try not to use jpegs as they are bad for this kind of images and can have a lot of artifacts.

Using images is more complex than using a font, files will be bigger, and basically all "Advantages" in the previous section become the "Disadvantages" of using images. But on the nice side, the users won't need to have any font installed to see the barcodes. So if you need to send the xls/x files to random users, an image might be the only sane choice. Once again, remember that pdf files don't have this problem, so you might want to still use a barcode font, but redistribute the pdfs instead of the xls/x files.


How to get the hyperlink in a given cell? | FlexCel Studio for the .NET Framework documentation

How to get the hyperlink in a given cell?

Different from other cell properties like the background color, Excel hyperlinks are not stored tied to any cell. In fact, hyperlinks can cover more than one cell: you might have a hyperlink covering a range from A1 to C2 and the link will trigger if any of those cells is clicked.

So hyperlinks are stored in a list, and in FlexCel you have methods to know the number of hyperlinks (ExcelFile.HyperLinkCount), to retrieve the range of cells one hyperlink in the list applies to (ExcelFile.GetHyperLinkCellRange) and of course to get the information on the link like the url where it goes (ExcelFile.GetHyperLink)

If you wanted to know if say cell A3 has a hyperlink, a way to find out would be to loop from 1 to HyperLinkCount and call GetHyperLinkCellRange in each entry of the list. If the range contains A3, you have found the hyperlink, and you can now call GetHyperLink to get the url of it.

But of course, this can be very slow, if you have thousands of links and you want to get the links in cell A2, A3, A4... For each one of the cells, you would be looping over all the list to find the correct links.

What we need here is an indexed search, so you spend O(Ln) instead of O(n) in each search. But as the search is in 2 dimensions (rows and columns) we need spatial indexing. Luckily, FlexCel offers a method ExcelFile.LoopHyperLinks that will do just that.

LoopHyperLinks will search for the links that apply to a range of cells, then call an anonymous method for every one of the links that apply. This will be much more efficient than a dumb loop over all links, since LoopHyperLinks internally holds a spatial index to locate the links efficiently.

Take a look at ExcelFile.LoopHyperLinks for a code example on how to get the links to a cell.


Why are xlsx files generated by FlexCel smaller than the same files generated by Excel? | FlexCel Studio for the .NET Framework documentation

Why are xlsx files generated by FlexCel smaller than the same files generated by Excel?

This is a question we get from time to time: You take an existing xlsx file, open it with FlexCel and save it, without doing anything else. You will notice that the new file is several kilobytes smaller than the original, and yet, nothing changed. What is going on?

There can be actually many causes for this, but the main reason is simple: Xlsx files are zip files with a different extension. In a zip file, you can specify the compression level ranging from "fastest" (less compression) to "best" (slowest).

Excel is an interactive tool, and it is really important that when a user presses enter the file is saved as fast as possible and control returned to the user. So Excel uses the "fastest" compression setting. On the other hand, FlexCel is optimized for server use, and in this case, smaller sizes win over some milliseconds less to generate the file. So we use the "default" compression setting which is normally the best compromise between speed and compression. And this is why the files generated by FlexCel are normally smaller than the same files as generated by Excel.

Note

Comparing file sizes of zip files is not really indicative of anything, but if you want to verify this, you can easily do the test:

  1. Create a file in Excel
  2. Open and save it with FlexCel
  3. Open the file generated in 2. with Excel again and save it. The file size for this file should be similar to the file in 1., and bigger than the file in 2.

Finally, note that while "default" compression is normally the best compromise, you can change the compression of the files generated by FlexCel changing the ExcelFile.XlsxCompressionLevel property.

Tip

You might also see the opposite case: You generate a file in FlexCel and when you open it and save it with Excel, the size is smaller.

This is normally because a setting in Excel. If you go to the Ribbon -> File -> Options -> Advanced, you will see the following options:

excel options compress images

If the checkbox isn't checked (the default) Excel will reduce the resolution of the images in the file to match the given resolution. This will result in a smaller file with lower-resolution images.

On the other side, FlexCel will never try to automatically reduce the image quality. If you enter an image with AddImage, it will enter it "as-is" and assume you wanted that resolution. To get smaller images with FlexCel, reduce the image quality before entering the image into the file.


Automatically open generated Excel files. | FlexCel Studio for the .NET Framework documentation

Automatically open generated Excel files.

In the FlexCel demos we follow a common pattern: When we generate a file we ask the user where he wants to save it, and then, we offer to open the generated file in Excel.

The code is something similar to this:

    if (saveFileDialog1.ShowDialog() == DialogResult.OK)
    {
        xls.Save(saveFileDialog1.FileName);
        if (MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) == DialogResult.Yes)
        {
            using (Process p = new Process())
            {
                p.StartInfo.FileName = saveFileDialog1.FileName;
                p.StartInfo.UseShellExecute = true;
                p.Start();
            }
        }
    }

Now, if you have used OLE Automation before FlexCel, you are probably used to a different pattern: In OLE you can launch Excel, fill it with data using Automation, and then leave the file open without saving it. And while I personally think saving the file first is nicer, there might be cases where you want to emulate this behavior of just opening the file without asking the user to save it first.

The bad news is that it is not technically possible to create a file in FlexCel and have it open in Excel without saving it somewhere first. On the other side, the good news is that you can reasonably emulate the behavior and make it look to the user as if the file wasn't saved on disk first.

This trick uses Excel templates, which have an extension xlt in Excel 2003 or older (equivalent to xls) and xltx in Excel 2007 or newer. An Excel template is similar to an xls/xlsx file, but it has two different characteristics:

  1. When you open an xltx file in Excel, Excel makes a copy in memory of it, and doesn't lock the original file. This means that you can remove the template once Excel has opened it without worrying that Excel will be using it.

  2. When a user presses "Save" in Excel, Excel won't save the template but show the "Save As..." dialog and let the user choose a filename for saving.

So what we are going to do is to create a temporary xltx file instead of a regular xlsx file, open it in Excel, then wait a little to make sure Excel finished loading it, and then remove the temporary file. To do so, we can use code like this:

    string tmpFileName = Path.GetTempPath() + Guid.NewGuid().ToString("D") + ".xltx";
    xls.Save(tmpFileName);

    //The verb to open a Xltx template is "New", not "Open".
    //Process.Start will use the default verb, which is also "New",
    //So there is no need to specify it.
    //Note also that latest .NET versions won't start a file without shellexecute.
    using (Process p = new Process())
    {
        p.StartInfo.FileName = tmpFileName;
        p.StartInfo.UseShellExecute = true;
        p.Start();
    }

    Task.Run(() =>
    {
        //Wait 30 seconds to delete the file, so Excel has time to open it.
        Thread.Sleep(30000);
        File.Delete(tmpFileName);
    });
Note

Once you use Process.Start to open the file, you have to wait until Excel finished loading it. In the code above we wait for 30 seconds before deleting the file, but if your files are huge or the machines where Excel is installed are too slow, you might want to increase the time before you try to delete the file.

Note

When saving a file to disk, FlexCel automatically detects from the extension that it should be saved as a template, so you don't need to do any extra work. Just save the file with an xlt/x extension and it will be saved as a template. But in other cases like when saving to a stream, FlexCel can't figure out that you want to save as a template, and you will have to explicitly say so. You can tell FlexCel that the file is a template by setting the property ExcelFile.IsXltTemplate to true.

Note

When starting the process to open the file, remember that the action needed to open the template in "template mode" is New, not Open as it is the default in most cases. For example, when you right-click in an xlsx file, "Open" is the default action:

open xlsx file

But when you right click in an xltx file, "New" is the default action:

open xltx file

If you opened a template with "Open" instead of "New", it would behave like a normal xlsx file, being locked by Excel while in use. So in the code above, we used the default action instead of the default "Open" action. Had we called:

    var startInfo = new ProcessStartInfo(tmpFileName);
    startInfo.Verb = "Open";
    startInfo.UseShellExecute = true;
    Process.Start(startInfo);

Then the trick wouldn't work.


Deciding between standard xlsx files and strict xlsx files. | FlexCel Studio for the .NET Framework documentation

Deciding between standard xlsx files and strict xlsx files.

FlexCel 6.17 introduced full support for reading and saving strict xlsx files. Strict xlsx files are a different file format from normal xlsx files, and you can select them when doing a "File Save As..." in Excel:

save as strict xlsx

Now the question is: Should I use normal or strict xlsx files? And the short answer is: Use normal xlsx files unless you have a non-negotiable requirement from your customers to use strict xlsx.

The long answer: When Microsoft introduced xlsx back in Excel 2007 they didn't have the time to define all the parts of the new file format, and so for some parts (mostly drawings) they just reused an older xml file format: Office XML Formats.

Using the existing file formats for the parts that weren't ready gave them a head start and allowed them to ship xlsx earlier, but it introduced at least two problems:

  1. The style and namespaces for the xml are different. This is mostly a cosmetic issue, but for example the old xml format uses pascal case for the identifiers (for example "LegacyDrawing") while the new system uses lower camel case (legacyDrawing). The old xml also relies more on attributes while the new one relies more on xml children, store booleans differently and a long list of etc. In general the xml in those legacy parts is very different from the rest of the newer parts. To read or write to them, they require a lot of specific code which is different from the code to read or write similar non-legacy parts.

  2. More importantly the old format wasn't always valid xml. So for example the text of a button with an enter in the text would be stored as "Some text<br>Second line." This will crash any compliant xml readers, because xml readers are required to fail when they find invalid xml and <br> is not valid xml as there is no ending tag.

So in order to fix this and other issues, Microsoft has been developing a parallel "Strict xml" standard which uses different xml namespaces and has no legacy parts. They renamed the "normal xlsx" to "transitional xlsx" and added the "strict xlsx" variant.

But the support for strict xlsx in Excel came late, with Excel 2010 being first able to read it, and Excel 2013 first able to write them. By that time, transitional xlsx was already the standard, and that hasn't changed up to the day I am writing this hint. And if strict xlsx hasn't gained traction yet, it is unlikely that it ever will. (even when I would like to be proven wrong as the strict xlsx format is simpler and free of legacy baggage)

So coming back to the answer: Normal xlsx is the standard, and the format that everyone else will understand (including old FlexCel versions). So if you have no specific need for the strict xml parts, just keep using the standard.

The strict xlsx format on the other side should be cleaner, but being "cleaner" is not a property of a file format that should concern you much. The fact that everyone can read the files you create should be a bigger concern. And actually, strict xlsx files as saved by Excel aren't cleaner because they still include the legacy parts inside conditionals so older Excels as Excel 2007 can still read them. And on the other side, "normal" xlsx files still include the new, non-legacy parts too for tools that can't understand the legacy parts, so both file formats are basically the same, except for the different xml namespaces and some syntax differences.

Note

As mentioned above, when saving a strict xlsx file with Excel it will still include all the legacy and potentially invalid xml parts. We believe this defeats the purpose of having a cleaner format, so when you save with FlexCel, we will only write the non-legacy parts. You will need to have Excel 2010 so it understands the new non-legacy parts, but you also need Excel 2010 for strict files saved with Excel, since the xml namespaces are different so older tools won't understand the files. If an xlsx reader knows about strict xml and the strict xml namespaces, it should be able to handle the non-legacy parts too.


Finding out which FlexCel version you are using | FlexCel Studio for the .NET Framework documentation

Finding out which FlexCel version you are using

Sometimes you want to know the exact FlexCel version you are using from inside your app, and you might also want to make sure you aren't using a trial. You can use the following code to find out:

    System.Reflection.Assembly assembly = System.Reflection.Assembly.GetAssembly(typeof(ExcelFile));

    //Find out the version.
    var version = assembly.GetName().Version;
    Console.Write(version.ToString());

    //Find out if it is a trial or a registered assembly. Trial has the word "TRIAL" in the title.
    var title = assembly.GetCustomAttributes(typeof(System.Reflection.AssemblyTitleAttribute), false)
         .OfType<System.Reflection.AssemblyTitleAttribute>()
         .FirstOrDefault().Title;
    Console.WriteLine(title);


Sign your PDF files | FlexCel Studio for the .NET Framework documentation

Sign your PDF files

A little story

Some time ago I requested some official documents from my government, and they provided them to me in PDF format. This is all as expected: PDF is the de-facto standard for digital documents.

But what I didn't expect was that those documents weren't digitally signed. This doesn't make them completely useless, but the fact that they are not digitally signed diminishes a lot their value for me. If in the future I need to use those documents myself to prove anything, I can't really prove that I didn't create those documents myself, or that I modified the data on them. Can you imagine them giving you any old-fashioned paper document that is not signed and/or rubberstamped?

The government should digitally sign all the digital documents they give us, in the same way they physically sign their paper documents. And if you are creating documents that can be used as proof of anything, so should you.

What is a digital sign

Digitally signing a PDF document is a way to prove that the document is the same as the one you produced, and it wasn't altered by anyone else. Someone might change the document, but the signature will become invalid. They might re-sign the document, but they would have to sign it with their signature, not with yours. The only way they can have a PDF signed by you is if you gave that exact PDF to them.

PDF signing is also a proven technology based on solid asymmetric encryption. It is not something that you (or anyone else) can fake with a 5-minute google search, and neither with months of hard work. A digital sign is actually much more secure than a physical sign, as long as you use a secure encryption algorithm.

Warning

When working in FlexCel .NET, the examples used the default algorithm in a CMSSigner, which happens to be SHA1. SHA1 is not considered secure anymore, so we have updated the examples to use SHA512. If you have old code, you might want to update it to use SHA512 too. In Delphi, we already use SHA512 by default.

How to keep your signing secure.

As mentioned in the previous section, signing is a safe way to ensure your documents are not altered. But you need to do it right, and in this section we will discuss some of the stuff that you need to care about.

Keep your key secure

The most important thing you need to ensure is that nobody can get your certificate with your private key. No matter how good the lock on your door, if the attacker gets the key, he will be able to enter. Or in this case, if he gets your signing key, he will be able to sign as if he was you.

In practice this means that you can't bundle the certificate with your app, even if you encrypt the certificate. If your application can read the certificate, a hacker can too. The only secure way to keep the certificate safe is to sign the PDFs in a server that your users don't have access to.

Keep up to date with the signing algorithms

As we advance in our technology, vulnerabilities can be found in the algorithms used to sign, and you need to make sure you aren't using an algorithm that is considered vulnerable. At the time of this writing, this means to use SHA256 or SHA512 and not SHA1 as SHA1 is known to be non-secure

Should SHA2 or SHA3 become vulnerable in the future, you will need to update the signing algorithm again.

Get a real certificate from a trusted CA

You can sign your PDFs with self-signed certificates and it will work, but then, nothing is preventing an attacker from creating his own self-signed certificates too, where he claims to be you.

If you teach your users to trust your self-signed certificates, they might trust other self-signed certificates too.

Getting more information

You can read more about how to sign PDF files with FlexCel at the PDF guide

Appendix: Also use PDF/A

As we are discussing how to best ship PDF files, I would also like to mention that it is a great idea to ship your documents as PDF/A. Basically, a PDF/A file is a file designed so "it can be still be read 100 years from now". And why wouldn't you want your documents to be still readable 100 years from now? Documents created 20 years ago (like a wks lotus 123 file) might be already difficult to open today. Will it still be possible to open them 100 years from now?

Of course nobody can guarantee that any file (not PDF, nor PDF/A) will still be readable in the future. But PDF/A does have some characteristics that make it likely. For example:

  • It is "frozen in time". Different from normal pdf which is constantly evolving, the PDF/A file format is done. It will never change, and it will be the same 100 years from now. Nobody knows how the PDF file format might have evolved by then.
  • It removes complex and unnecessary stuff which is present in normal PDFs like JavaScript, Audio and Video.
  • It requires that everything is self-contained in the document. So for example the fonts that you use (which might not be available in the future) must be embedded.

  • There are multiple independent validators to check if a PDF/A file honors all the requisites. FlexCel currently uses 3 different validators to ensure that the documents it generates are valid.

    It doesn't mean that there are not drawbacks too: By making your files self-contained they will be larger, and some PDF features you might want to use might not be available. But in most cases, if your documents are meant to last, you should consider PDF/A.

    There are many varieties of PDF/A and all of them are supported by FlexCel. If you are not sure on what flavor to use, I would recommend PDF/A2, as PDF/A1 is a little too restrictive, especially because it doesn't support the modern signing algorithms we use in FlexCel. So if you want to sign and PDF/A your files, you can't use PDFA/1. PDF/A3 is similar to A2, but it allows attachments. Use A3 only if you want to attach files to your pdf documents.

    You can read more on how to create PDF/A files in the PDF guide


Conditionally format all things! | FlexCel Studio for the .NET Framework documentation

Conditionally format all things!

In Excel 2007, Excel completely changed conditional formatting, turning it from a very useful tool to something that you just need to know about.

Note

FlexCel has supported the old conditional formats basically since forever, but it also added complete support for the new Excel 2007 conditional formats in version 6.9.

This means that in the current FlexCel version you can add, remove and modify any existing conditional formatting in any file. Every little thing is supported up to the features introduced in Excel 2016 (the latest version at the time of writing this tip). And FlexCel will also calculate all of them and export them to PDF, HTML, SVG, etc.

If you weren't using them before because FlexCel didn't support them, make sure to give them a second look now.

As usual ApiMate will tell you everything about how to enter a conditional format with code, but conditional formats are especially useful when doing reports.

Let's imagine you want to paint a cell in red if it is bigger than 10. You could do this with tags like <#Format cell>, but that can get tiring soon and it won't be so simple to maintain. It is much simpler to just press the "Conditional Formatting" button in the home tab of the ribbon:

Then go to "Highlight cell rules" and select "Greater than" in the cell that you want to format. Then save the template, and when you run the report, if the value is bigger than 10 it will be red. No tags or code required!

But this is just scratching the surface. Conditional formats will not only allow you to do stuff that is possible with normal formatting (with more work), they will also allow you to do stuff that is just not possible at all without them. Like for example:

Data bars

Color scales

Icon sets

Conditional formats allow a full new world of possibilities to the formatting of your documents, and better of all, they are fun to use. FlexCel currently supports everything you can throw at it, up to the latest features in Excel 2016.

Note

Not only FlexCel supports all the features in conditional formatting, it sometimes supports them better than Excel itself!

For example, iconsets in Excel (up to the latest Excel 2021) are bitmaps, which means that they won't look so good when zoomed in or printed.

This is a screenshot of one of the icons above with Excel at 350% zoom:

iconsets zoomed in excel

To be fair to Excel, they did increase the resolution of those bitmaps in newer versions, they used to look much more jagged. You might also need a high-dpi monitor to see the differences better.

On the other hand, FlexCel will draw those icons as vectors and export them as vectors to pdf, which means that they will look great no matter the resolution or size of the final result.

This is a screenshot of the same icons as exported to pdf by FlexCel, at 400% zoom:

iconsets zoomed in flexcel

As we value conditional formats so much, we put a lot of effort and months of work to make sure every little detail is right: From the rendering of icons and databars to the performance and memory usage with huge files. Take advantage of them.


Expanding formulas in consecutive cells | FlexCel Studio for the .NET Framework documentation

Expanding formulas in consecutive cells

One common thing you might want to do when entering formulas in FlexCel is to change the column or rows where they appear. So for example, let's imagine you have this formula in A1:

= A2 * 2

And you want to expand the formula to Columns B to Z. In B1, you will want the formula =B2 * 2, in C1 you will want =C2 * 2 and so on.

There are multiple ways to achieve this:

1) You can enter the formula in A1:

    xls.SetCellValue(1, 1, new TFormula("= A2 * 2"));

And then copy the cell to the range B:X:

    xls.InsertAndCopyRange(new TXlsCellRange(1, 1, 1, 1), 1, 2, 25, TFlxInsertMode.NoneRight, TRangeCopyMode.All);

This will work the same as in Excel, and the formulas will be adapted when copied. Same as in Excel absolute references (like for example $B$1) won't be changed, but relative references will change when copied.

2) You can manually create the formulas by using TCellAddress

TCellAddress is the record you use in FlexCel to convert cell references from/to numbers to letters. Here is a little example on how you can get the row and column from the string "B5" and also how to get the string "B5" from the row and column:

    // From string to number
       // We will extract the row (5)
       // and the column (2) from the reference "B5"
       var a = new TCellAddress("B5");
       xls.GetCellValue(a.Row, a.Col);

       // From numbers to string
       // We will get the string "B5" from the row (5)
       // and the column(2)
       a = new TCellAddress(5, 2);
       DoSomething(a.CellRef);

So, for our original example, we could use some code like this:

    for (int col = 1; col <= 26; col++)
       {
           xls.SetCellValue(1, col, new TFormula("= " + new TCellAddress(2, col).CellRef + " * 2"));
       }

3) Using R1C1 notation. R1C1 is an alternative notation to the classical A1 notation, to describe formulas based in their rows and columns, instead of in a letter and a number.

R1C1 is completely equivalent to A1, but has the advantage of always using column numbers, and that the cells are relative to their position, which is what you usually want.

Note

You can find a lot of information in R1C1 cell references internet just by a web search, and I recommend you to search for R1C1 if you weren't aware that this mode existed. As it makes no sense to repeat all the information in this doc, here we will focus on how to use R1C1 from FlexCel.

There are a couple of properties that govern R1C1 in FlexCel:

  • ExcelFile.FormulaReferenceStyle = TReferenceStyle.R1C1;

    This will affect how you can insert the formulas in FlexCel, but it is independent of how Excel will show them. To change how Excel displays R1C1 formulas, you need:

  • ExcelFile.OptionsR1C1 = true

    OptionsR1C1 only affects how Excel shows the formulas, but not how you enter them in FlexCel, or how FlexCel will return the text of the formulas to you. That is the job of ExcelFile.FormulaReferenceStyle.

    So for our original example, here is the code to do it with R1C1 notation. Note that due to the fact that R1C1 is relative, the formula is always exactly the same. There is no need to calculate a formula for each cell as we did in Solution 2; in fact we can move the creation of the formula outside of the loop to avoid creating temporary objects:

    xls.FormulaReferenceStyle = TReferenceStyle.R1C1;
    var Formula = new TFormula("= R[1]C * 2");
    for (int col = 1; col <= 26; col++)
    {
        xls.SetCellValue(1, col, Formula);
    }
Important

While we used R1C1 internally to enter the formulas, in Excel they will show in A1 notation exactly the same as they do with the other 2 solutions. That is because as explained above R1C1 support is divided in a property that only affects FlexCel: ExcelFile.FormulaReferenceStyle and a property that only affects Excel: ExcelFile.OptionsR1C1

So you can work in R1C1 mode in FlexCel while keeping A1 mode in Excel, or vice-versa.

FlexCel comes with full R1C1 support built-in.

Bonus track - Checking the formulas in a spreadsheet

R1C1 references are not only nice to enter formulas, but also to check for consistency in existing files.

Imagine you have a file with formulas like in our example above, and you want to check that they are all as they are supposed to be. So for example in Column J, you have =J2 * 2 and not =A2 * 2. Checking this in A1 notation can be very complex, especially if the formulas are not simple.

But retrieve the formulas in R1C1 instead, and all you need to do to check for consistency is to check that all formulas in A1:Z1 are the same!.

That is, retrieve the formula in A1 (in this case "=R[1]C * 2") and then check that all other formulas in the range have the same as the text in A1. If a formula is different, then it is not consistent.


Changing the font name | FlexCel Studio for the .NET Framework documentation

Changing the font name

Before Excel 2007, changing the font name in a cell was a matter of well... just changing the font name. To use for example noto, you would write:

    var fmt = xls.GetFormat(xls.GetCellFormat(row, col));
    fmt.Font.Name = "noto";

    xls.SetCellFormat(row, col, xls.AddFormat(fmt));

and that would be it. But if you try this code and open the generated file in a modern Excel, you will see that the font didn't actually change. What is going on?

Excel 2007 introduced themes, which are a collection of settings like fonts or colors which you can change to alter the look of the document all at once.

Themes mostly affect colors, and you can find a more in-depth explanation of them at the Api Developer Guide

But themes also affect font names. The theme defines 2 fonts: Major (used in the headings) and Minor (used in the normal cells)

When you select a font in the font combo-box in Excel, you might have noticed that the first 2 entries are under the category "Theme fonts" and that they have (Headings) and (Body) written at the right:

The "(Headings)" font corresponds to TFontScheme.Major and the "(Body)" font corresponds to TFontScheme.Minor.

Note

Those 2 fonts in Excel are different from the same fonts without the (Headings) and (Body) labels at the right.

Imagine that you set cell A1 to Calibri (Body) and cell A2 to just Calibri. And now you change the spreadsheet theme to a theme where the Body (or minor) font is Arial. When you change the theme, A1 will change to Arial, but A2 will continue to be Calibri.

So how does this affect FlexCel? Notice that in the code above, we didn't change the font scheme; only the font name. As the theme takes priority over the font name, a font linked to the Minor scheme will continue to be whatever font the theme defines for minor, and not what you specify in the font name.

To make that code work you need to also change the TFlxFont.Scheme to none.

This is the correct way to change the font name:

    var fmt = xls.GetFormat(xls.GetCellFormat(row, col));
    fmt.Font.Name = "noto";
    // For the font name to change, we need to
    // detach the font from the theme!
    fmt.Font.Scheme = TFontScheme.None;

    xls.SetCellFormat(row, col, xls.AddFormat(fmt));
Note

To change all fonts of a given type to a different type in a file, take a look at Replacing a font by another in an Excel file.


Entering multiple lines of text inside a cell | FlexCel Studio for the .NET Framework documentation

Entering multiple lines of text inside a cell

In Excel, you can enter multiple lines of text by pressing Alt-Enter between words.

You start with this:

Then type Hello, press Alt-Enter, then type World, and you end up with this:

In the surface, you have just entered text into the cell. But digging a little below the surface, you have not only entered data, but also changed the format of the cell!

When you entered the text, Excel noticed that it had multiple lines, so it helpfully decided to change the format of the cell to Wrap text. If you look at the cell format now, you will see that it has wrap text enabled:

And it wasn't enabled before. If you manually disable it, you will end up with this:

multiline no wrap

Because the format changed without anybody telling you when you pressed Alt-Enter, you might not be aware of the fact that in order to display multiline cells you need to set TFlxFormat.WrapText = true.

So in order to enter a multiline text with FlexCel you need to:

  1. Set TFlxFormat.WrapText = true.
  2. Make sure you use a character 10 (\n) to separate the lines.
Warning

It doesn't matter if your OS uses \r\n or any other character to separate lines: Excel always uses the character 10 as line separator.

So don't use Environment.NewLine to separate lines.

Note

You might wonder why FlexCel isn't as "smart" as Excel, and when it detects that you have carriage returns in your text, automatically change the format to wrap text.

The reason is simple: Excel and FlexCel have different target users. Excel is an interactive application, and in those cases every help the application can give you by guessing what you want to do is welcome. (well not every one, but most. Some guessings can be infuriating even in interactive mode.)

If Excel guesses wrong, you can see it immediately and just press ctrl-z to undo.

In FlexCel case, you are writing a program to create files, and every "smart" guess just makes the outcome more unpredictable. You tell FlexCel to do A, but it will end up doing B because it guessed B is what you really wanted to do.

So FlexCel is dumb on purpose. If you tell it to do A, it will do A and nothing else. If you set a cell value, it won't also change the cell format because it thinks you might want to do that too.

Note

Still here? Ok, what we told you in the last note was only partially true.

There is this method ExcelFile.SetCellFromString in FlexCel that is designed to work as Excel, and will change the format to wrap text if it detects carriage returns inside the string. But this is so because SetCellFromString is specifically designed to replicate the Excel behavior in case you need it. SetCellFromString is not the preferred way to enter text with FlexCel.

For most cases what was said in the last note stands: FlexCel won't do B when you tell it to do A. That is the only sane way to write a reliable program.


Understanding Excel measurement units | FlexCel Studio for the .NET Framework documentation

Understanding Excel measurement units

Excel uses many different units for measuring different things, and FlexCel uses the same.

For most rendering stuff, including the PDF API, FlexCel uses points, and those are simple: A point is 1/72 of an inch. As you can see in the Google calculator here.

A point is also normally used to specify font sizes: For example a font with 11 points has a bounding box of 11/72 inches.

Sometimes we use pixels, where a pixel is not defined as a physical point on the screen, but just as 1/96 of an inch, no matter the actual resolution of the screen. Excel and FlexCel are resolution-independent, so physical pixels are never used. When we mention "pixels", we always refer to resolution-independent pixels.

Now, the Excel units are a little more complex. The simplest ones are the y coordinates (rows): A row is measured in twips, or 1/20 of an point. ExcelFile.GetRowHeight returns the current row height in twips.

But the x coordinates (columns) are more complex. They measure how many “0”s you can put in a cell in the font used in the “Normal” style, plus some margins.

For example, the normal style for an Excel 2007 or newer file is “Calibri 11”, so if you can fit 5 “0”s in a column with that font, (“00000”) then the column width is 5. But not exactly, there are some margins too, which aren’t correctly documented in Excel docs, and which actually change depending on the screen resolution. So the width is not going to be 5, but 5.something.

Here you can see how a column autofitted to "00000" looks like:

column width 5

It is interesting to see what happens when we change the "normal" font of the spreadsheet to some bigger font. The column width in pixels will get bigger, but the internal units will still be around 5, because you can still fit 5 "0"s in that column. In fact, even when physically much bigger, the "size" got a little smaller when selecting a bigger font: from 5.13 to 5.08.

column width 5 big font

You can convert between columns and rows and pixels using ExcelMetrics.ColMult and FlxConsts.RowMult. For example:

    double RowHeightInPixels = xls.GetRowHeight(Row) / FlxConsts.RowMult;

    double ColWidthInPixels = xls.GetColWidth(Col) / ExcelMetrics.ColMult(xls);
Note

The "pixels" in those examples are the "resolution-independent-pixels" we mentioned at the start. That is, 1/96 of an inch.

Now, sadly Excel isn’t very exact about the units, so this isn't an exact conversion. You can see it simply by pressing a screen preview and measuring the real width of a cell, and compare it with what you see on the screen: you’ll see it is not exactly the same.

The actual box width for a cell can also change if you use a different screen scaling: They will look different if you use say 100% or 175% screen scaling. FlexCel can offset this with the property ExcelFile.ScreenScaling. While by default the screen scaling is 100 (which corresponds to 100% scaling or 96 dpi), if you are always working in a different setting, changing this property will make FlexCel work as if it was Excel showing the file at that particular screen scaling.

Changes between resolutions are not much, but they exist so in general it is a bad idea to try to do “pixel perfect” designs in Excel. You always need to leave some extra room because in different resolutions the cells might be slightly smaller or bigger.

For more info about how Excel units can change with the resolution, you can also read Autofitting Rows and Columns in the API Developer Guide

Note

As you can see in the images above, Excel will also show you the column size in "Pixels" besides the internal units.

But sadly those "pixels" aren't actual pixels either, or "resolution-independent-pixels" which we mentioned at the start which are 1/96 of an inch. If you took the effort to count them, you would realize that the pixels in that column are not what Excel says they are. Also, if you double the resolution of the screen those "pixels" will remain the same, even if the actual count of pixels doubled with the double resolution.

But the main issue is that those "pixels" are as unreliable as the other units Excel uses. They share the same resolution problems as the internal Excel units, so they don't really solve any problem.


Dumping a Dataset into Excel | FlexCel Studio for the .NET Framework documentation

Dumping a Dataset into Excel

One question we get asked from time to time is if FlexCel has a method like “DumpDataset” or “CopyFromRecordset” (which is the actual name in OLE Automation). This method should take a dataset and dump it into a sheet.

And the answer is no, we don’t include such a method because it would be too limiting: Normally you will have to customize how the cells are written, and you can’t do that with a single method that does the full export in one piece. So instead, we provide 2 other different solutions to the problem.

  1. FlexCel has reports, which you can use to dump a dataset “as is”, mostly as a DumpDataSet method would, but it also lets you do the formatting.

    As an added advantage reports allow you to easily modify the resulting sheets without modifying the code at all, so even the final user can do it.

    From reports, the most similar thing to "DumpDataset" is to create an empty spreadsheet, write "<#mydataset.*>" on it, save it, and then run the report against your dataset. You can find an example of this in the demos Generic Reports and Generic Reports 2

    Of course those 2 demos focus in “generic” datasets which you don’t know beforehand. If you know what data you are outputting, then you can just write <#dataset.field> in the cells where you want that field written, and format each field as you want.

    Reports are explicitly designed to deal with the problem of exporting datasets into Excel, but allowing formatting.

  2. The reports in FlexCel work exclusively by calling the FlexCel API, so anything you can do in a report, you can do it directly with the API. So if for any reason you can’t or don’t want to use reports, you can use a method like this:

    static void DumpDataSet(DataTable ds)
    {
        var xls = new XlsFile(1, TExcelFileFormat.v2019, true);
        //Generate the formats we will be using to format dates and times.
        var Fmt = xls.GetDefaultFormat;
        Fmt.Format = "dd/mm/yyyy hh:mm";
        var DateTimeXF = xls.AddFormat(Fmt);

        //Now loop over all records and send them to the file.
        for (int row = 0; row < ds.Rows.Count; row++)
        {
            for (int col = 0; col < ds.Columns.Count; col++)
            {
                object value = ds.Rows[row][col];
                if (value is DateTime)
                {
                    xls.SetCellValue(row + 1, col + 1, value, DateTimeXF);
                }
                else
                {
                    xls.SetCellValue(row + 1, col + 1, value);
                }

            }
            xls.Save("test.xlsx");

        }
    }


Reading only the first row of a file | FlexCel Studio for the .NET Framework documentation

Reading only the first row of a file

Sometimes you need to process a big number of files depending on their data in the first rows. If the data isn't what you want, you skip the file.

For those cases, it might make sense not to load the full file in memory, just to read the cell A1 and then close it. And FlexCel has the right tool for the job: Virtual Mode

Virtual mode is described in more detail in the Performance Guide, but in this tip we will just give you the code to read a file and stop reading after the first cell.

You can also find this example in the ExcelFile.VirtualMode documentation.

    static void ReadFirstRowOfAllSheets(string fileName)
    {
        XlsFile xls = new XlsFile(); //Create the object but don't open the file yet.
        xls.VirtualMode = true;  //Set the mode to Virtual.
        xls.VirtualCellRead += (sender, e) =>
        {
            if (e.Cell.Row > 1)
            {
                if (e.Cell.Sheet < e.SheetNames.Length) e.NextSheet = e.SheetNames[e.Cell.Sheet]; //Stop reading this sheet, move to the next.
                else e.NextSheet = null; //Stop reading the file.
            }
            else
            {
                Console.WriteLine("Cell: " + new TCellAddress(e.SheetNames[e.Cell.Sheet - 1], e.Cell.Row, e.Cell.Col, false, false).CellRef);
                Console.Write("Value: ");
                Console.WriteLine(e.Cell.Value);
            }
        };
        xls.Open(fileName);
    }


Examples | FlexCel Studio for the .NET Framework documentation

Examples

This section contains the code listing for all the examples available in the FlexCel distribution.

You can open the actual examples at the locations shown in each one of the code listings.

Remember that you can also browse through all the examples by opening the Demo Browser (MainDemo.csproj) included in FlexCel:

In this section:

  • Examples for C#
  • Examples for Visual Basic .NET


Examples for C# | FlexCel Studio for the .NET Framework documentation

Examples for C#

In this section

  • .NET Framework Examples

  • Android Examples

  • iOS Examples

  • macOS Examples

  • .NET Core Examples

  • Universal Windows Platform (UWP) Examples


.NET Framework Examples (C#) | FlexCel Studio for the .NET Framework documentation

.NET Framework Examples (C#)

Overview

The main demos for FlexCel Studio. The demos here are in Winforms, but they apply to most of the .NET framework variations.

In this section

  • API Demos

  • Report demos

  • Printing, previewing and exporting files

  • Thanks


API Demos (C# / netframework) | FlexCel Studio for the .NET Framework documentation

API Demos (C# / netframework)

Overview

This section contains demos for reading and writing Excel files using the native FlexCel engine.

In this section

  • Getting started

  • Advanced API

  • Chart API

  • Reading Excel files

  • Working in virtual mode

  • Reading and writing encrypted files

  • FlexCel image explorer

  • Flexcel object explorer

  • Copy and paste

  • Using hyperlinks

  • Intelligent page breaks

  • Validating FlexCel recalculation

  • Recalculation of linked files

  • Excel user defined functions (UDF)

  • Consolidating files

  • Creating pdf files with the PDF API

  • Handling non-fatal errors


Getting started (C# / netframework) | FlexCel Studio for the .NET Framework documentation

Getting started (C# / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\csharp\VS2022\netframework\10.API\10.GettingStarted and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​csharp/​VS2022/​netframework/​Modules/​10.​API/​10.​Getting​Started

Overview

A simple demo showing how to create an Excel file with the API from scratch.

Concepts

  • Before using FlexCel, you have to add it to the references, and add "using FlexCel.Core" and "using FlexCel.XlsAdapter" to your using statements.

  • The most important class here is the XlsFile class, from where you can read and write to any Excel 2 or newer file.

  • To set the value for a cell, use XlsFile.SetCellValue. You can set any kind of object here, not just text. If you set it to a TFormula object, you will enter a formula.

  • As explained in the FlexCel API Developer Guide, formats in Excel are indexes to an XF (eXtended Format list) To modify the format on a cell, you have to assign an XF index to that cell. To create new XF formats, use XlsFile.AddFormat

Files

AssemblyInfo.cs

using System.Reflection;
using System.Runtime.CompilerServices;

//
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
//
[assembly: AssemblyTitle("")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("(c) 2002 - 2024 TMS Software")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

//
// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version
//      Build Number
//      Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:

[assembly: AssemblyVersion("7.21.0.0")]

//
// In order to sign your assembly you must specify a key to use. Refer to the
// Microsoft .NET Framework documentation for more information on assembly signing.
//
// Use the attributes below to control which key is used for signing.
//
// Notes:
//   (*) If no key is specified, the assembly is not signed.
//   (*) KeyName refers to a key that has been installed in the Crypto Service
//       Provider (CSP) on your machine. KeyFile refers to a file which contains
//       a key.
//   (*) If the KeyFile and the KeyName values are both specified, the
//       following processing occurs:
//       (1) If the KeyName can be found in the CSP, that key is used.
//       (2) If the KeyName does not exist and the KeyFile does exist, the key
//           in the KeyFile is installed into the CSP and used.
//   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
//       When specifying the KeyFile, the location of the KeyFile should be
//       relative to the project output directory which is
//       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
//       located in the project directory, you would specify the AssemblyKeyFile
//       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
//   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
//       documentation for more information on this.
//
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]
[assembly: AssemblyKeyName("")]

Form1.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using System.IO;
using System.Diagnostics;
using System.Reflection;
using System.Threading;

namespace GettingStarted
{
    /// <summary>
    /// A small example on how to create a simple file with the API.
    /// Note that you can use the APIMate tool (in Start Menu->TMS FlexCel Studio->Tools) to find out the
    /// methods you need to call.
    /// </summary>
    public partial class mainForm: System.Windows.Forms.Form
    {

        public mainForm()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, System.EventArgs e)
        {
            ExcelFile Xls = new XlsFile(true);
            AddData(Xls);

            if (cbAutoOpen.Checked)
                AutoOpen(Xls);
            else
                NormalOpen(Xls);
        }

        private void AddData(ExcelFile Xls)
        {
            //Create a new file. We could also open an existing file with Xls.Open
            Xls.NewFile(1, TExcelFileFormat.v2019);
            //Set some cell values.
            Xls.SetCellValue(1, 1, "Hello to the world");
            Xls.SetCellValue(2, 1, 3);
            Xls.SetCellValue(3, 1, 2.1);
            Xls.SetCellValue(4, 1, new TFormula("=Sum(A2,A3)"));

            //Load an image from disk.
            string AssemblyPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
            using (Image Img = Image.FromFile(AssemblyPath + Path.DirectorySeparatorChar + ".." + Path.DirectorySeparatorChar + ".." + Path.DirectorySeparatorChar + "Test.bmp"))
            {

                //Add a new image on cell E2
                Xls.AddImage(2, 6, Img);
                //Add a new image with custom properties at cell F6
                Xls.AddImage(Img, new TImageProperties(new TClientAnchor(TFlxAnchorType.DontMoveAndDontResize, 2, 10, 6, 10, 100, 100, Xls), ""));
                //Swap the order of the images. it is not really necessary here, we could have loaded them on the inverse order.
                Xls.BringToFront(1);
            }

            //Add a comment on cell a2
            Xls.SetComment(2, 1, "This is 3");

            //Custom Format cells a2 and a3
            TFlxFormat f = Xls.GetDefaultFormat;
            f.Font.Name = "Times New Roman";
            f.Font.Color = Color.Red;
            f.FillPattern.Pattern = TFlxPatternStyle.LightDown;
            f.FillPattern.FgColor = Color.Blue;
            f.FillPattern.BgColor = Color.White;

            //You can call AddFormat as many times as you want, it will never add a format twice.
            //But if you know the format you are going to use, you can get some extra CPU cycles by
            //calling addformat once and saving the result into a variable.
            int XF = Xls.AddFormat(f);

            Xls.SetCellFormat(2, 1, XF);
            Xls.SetCellFormat(3, 1, XF);

            f.Rotation = 45;
            f.FillPattern.Pattern = TFlxPatternStyle.Solid;
            int XF2 = Xls.AddFormat(f);
            //Apply a custom format to all the row.
            Xls.SetRowFormat(1, XF2);

            //Merge cells
            Xls.MergeCells(5, 1, 10, 6);
            //Note how this one merges with the previous range, creating a final range (5,1,15,6)
            Xls.MergeCells(10, 6, 15, 6);

            //Make the page print in landscape or portrait mode
            Xls.PrintLandscape = false;

        }

        //This is part of an advanced feature (showing the user using a file) , you do not need to use
        //this method on normal places.
        private string GetLockingUser(string FileName)
        {
            try
            {
                XlsFile xerr = new XlsFile();
                xerr.Open(FileName);
                return " - File might be in use by: " + xerr.Protection.WriteAccess;
            }
            catch
            {
                return String.Empty;
            }
        }

        private static void LaunchFile(string f)
        {
            if (f != null)
            {
                using (Process p = new Process())
                {
                    p.StartInfo.FileName = f;
                    p.StartInfo.UseShellExecute = true;
                    p.Start();
                }
            }
        }

        private void NormalOpen(ExcelFile Xls)
        {
            if (saveFileDialog1.ShowDialog() == DialogResult.OK)
            {
                try
                {
                    Xls.Save(saveFileDialog1.FileName);
                }
                catch (IOException ex) //This is not really needed, just to show the username of the user locking the file.
                {
                    throw new IOException(ex.Message + GetLockingUser(saveFileDialog1.FileName), ex);
                }

                if (MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    LaunchFile(saveFileDialog1.FileName);
                }
            }
        }

        //This method will use a "trick" to create a temporary file and delete it even when it is open on Excel.
        //We will create a "template" (xlt/x file), and tell Excel to create a new file based on this template.
        //Then we can safely delete the xlt/x file, since Excel opened a copy.
        private void AutoOpen(ExcelFile Xls)
        {
            string FilePath = Path.GetTempPath();  //GetTempFileName does not allow us to specify the "xltx" extension.
            string FileName = Path.Combine(FilePath, Guid.NewGuid().ToString() + ".xltx");  //xltx is the extension for excel templates.
            try
            {
                using (FileStream OutStream = new FileStream(FileName, FileMode.Create, FileAccess.ReadWrite))
                {
                    Xls.IsXltTemplate = true; //Make it an xltx template.
                    Xls.Save(OutStream);
                }
                LaunchFile(FileName);
            }
            finally
            {
                //For .Net 4 and newer you can use Task.Run here. See https://doc.tmssoftware.com/flexcel/net/tips/automatically-open-generated-excel-files.html
                new Thread(delegate()
                {
                    Thread.Sleep(30000); //wait for 30 secs to give Excel time to start.
                    File.Delete(FileName);  //As it is an xltx file, we can delete it even when it is open on Excel.
                });
            }
        }

        /// <summary>
        /// This is the method that will be called by the ASP.NET front end. It returns an array of bytes
        /// with the report data, so the ASP.NET application can stream it to the client.
        /// </summary>
        /// <returns>The generated file as a byte array.</returns>
        public byte[] WebRun()
        {
            ExcelFile Xls = new XlsFile(true);
            AddData(Xls);

            using (MemoryStream OutStream = new MemoryStream())
            {
                Xls.Save(OutStream);
                return OutStream.ToArray();
            }
        }

    }
}

Form1.Designer.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using System.IO;
using System.Diagnostics;
using System.Reflection;
namespace GettingStarted
{
    public partial class mainForm: System.Windows.Forms.Form
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.Container components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.button1 = new System.Windows.Forms.Button();
            this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog();
            this.label1 = new System.Windows.Forms.Label();
            this.cbAutoOpen = new System.Windows.Forms.CheckBox();
            this.SuspendLayout();
            //
            // button1
            //
            this.button1.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
            this.button1.Location = new System.Drawing.Point(78, 160);
            this.button1.Name = "button1";
            this.button1.Size = new System.Drawing.Size(75, 23);
            this.button1.TabIndex = 0;
            this.button1.Text = "GO!";
            this.button1.Click += new System.EventHandler(this.button1_Click);
            //
            // saveFileDialog1
            //
            this.saveFileDialog1.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm|Excel 97/2003|*.xls|Excel 2007|*.xlsx;*.xlsm|All " +
    "files|*.*";
            this.saveFileDialog1.RestoreDirectory = true;
            //
            // label1
            //
            this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
            | System.Windows.Forms.AnchorStyles.Left)
            | System.Windows.Forms.AnchorStyles.Right)));
            this.label1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
            this.label1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.label1.Location = new System.Drawing.Point(16, 16);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(205, 80);
            this.label1.TabIndex = 1;
            this.label1.Text = "A first demo on how to create basic things with FlexCel API.";
            //
            // cbAutoOpen
            //
            this.cbAutoOpen.Location = new System.Drawing.Point(16, 104);
            this.cbAutoOpen.Name = "cbAutoOpen";
            this.cbAutoOpen.Size = new System.Drawing.Size(144, 48);
            this.cbAutoOpen.TabIndex = 2;
            this.cbAutoOpen.Text = "Auto open the generated file without saving it";
            //
            // mainForm
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(229, 197);
            this.Controls.Add(this.cbAutoOpen);
            this.Controls.Add(this.label1);
            this.Controls.Add(this.button1);
            this.Name = "mainForm";
            this.Text = "Getting Started";
            this.ResumeLayout(false);

        }
        #endregion

        private System.Windows.Forms.Button button1;
        private System.Windows.Forms.SaveFileDialog saveFileDialog1;
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.CheckBox cbAutoOpen;

    }
}

Program.cs

using System;
using System.Windows.Forms;

namespace GettingStarted
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new mainForm());
        }
    }
}


Advanced API (C# / netframework) | FlexCel Studio for the .NET Framework documentation

Advanced API (C# / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\csharp\VS2022\netframework\10.API\12.Advanced API and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​csharp/​VS2022/​netframework/​Modules/​10.​API/​12.​Advanced API

Overview

This demo shows a lot of unrelated things you can do with the FlexCel API.

It is a complement of what was shown in GettingStarted: this means things that were shown there (like how to insert an image) will not be repeated here. You should look at both demos when studying the API.

The things shown here do not make much sense in the real world; they are explicitly designed to show what can be done.

Also remember that most of this stuff can be found easier with APIMate

The created file will be password protected, and all the passwords are "flexcel" (without quotes)

Concepts

  • FlexCel shines at modifying existing Excel files. It has been designed from the start with that in mind, and to not losing anything in the original file. So we will start from an existing file with the skeleton of what we want to do, and modify it with code. This starting file (template.xls/x) could be embedded in the exe file, but this is not shown here. To see an example on how to embed the template inside the exe, look at Templates On The Exe

  • The starting template has a macro. At this time we can not create macros with FlexCel, but we can modify a file with existing macros and those macros will be in the final file.

  • How to copy a chart from other template and fill the values.

  • How to add Outlines.

  • How to freeze panes.

  • How to add data validation.

  • How to search and replace in a range of cells.

  • How to sort a range of cells.

  • How to Autofit the rows in a sheet.

  • How to protect the file and cells with a password.

  • As FlexCel doesn't convert charts between xlsx and xls, if you want to create an xls file you need to start with an xls template, and the same goes for xlsx. So we need two templates.

Files

AssemblyInfo.cs

using System.Reflection;
using System.Runtime.CompilerServices;

//
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
//
[assembly: AssemblyTitle("")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("(c) 2002 - 2024 TMS Software")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

//
// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version
//      Build Number
//      Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:

[assembly: AssemblyVersion("7.21.0.0")]

//
// In order to sign your assembly you must specify a key to use. Refer to the
// Microsoft .NET Framework documentation for more information on assembly signing.
//
// Use the attributes below to control which key is used for signing.
//
// Notes:
//   (*) If no key is specified, the assembly is not signed.
//   (*) KeyName refers to a key that has been installed in the Crypto Service
//       Provider (CSP) on your machine. KeyFile refers to a file which contains
//       a key.
//   (*) If the KeyFile and the KeyName values are both specified, the
//       following processing occurs:
//       (1) If the KeyName can be found in the CSP, that key is used.
//       (2) If the KeyName does not exist and the KeyFile does exist, the key
//           in the KeyFile is installed into the CSP and used.
//   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
//       When specifying the KeyFile, the location of the KeyFile should be
//       relative to the project output directory which is
//       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
//       located in the project directory, you would specify the AssemblyKeyFile
//       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
//   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
//       documentation for more information on this.
//
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]
[assembly: AssemblyKeyName("")]

Form1.cs

using System;
using System.Drawing;
using System.Collections;
using System.Windows.Forms;
using System.Data;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using System.IO;
using System.Diagnostics;
using System.Reflection;
using System.Text;

namespace AdvancedAPI
{
    /// <summary>
    /// A demo on creating a file using more advanced features.
    /// </summary>
    public partial class mainForm: System.Windows.Forms.Form
    {

        public mainForm()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, System.EventArgs e)
        {
            ExcelFile Xls = new XlsFile(true);
            AddData(Xls);

            NormalOpen(Xls);
        }

        /// <summary>
        /// We will use this path to find the template.xls. Code is a little complex because it has to run in mono.
        /// </summary>
        private string PathToExe
        {
            get
            {
                return Path.Combine(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), ".."), "..") + Path.DirectorySeparatorChar;
            }
        }

        //some silly data to fill in the cells. A real app would read this from somewhere else.
        readonly string[] Country = { "USA", "Canada", "Spain", "France", "United Kingdom", "Australia", "Brazil", "Unknown" };

        readonly int DataRows = 100;

        /// <summary>
        /// Will return a list of countries separated by Character(0) so it can be used as input for a built in list.
        /// </summary>
        /// <returns></returns>
        private string GetCountryList()
        {
            StringBuilder sb = new StringBuilder();
            string sep = "";
            foreach (string c in Country)
            {
                sb.Append(sep);
                sb.Append(c);
                sep = "\0";  //not very efficient method to concat, but good enough for this demo.
            }

            return sb.ToString();
        }

        private void AddChart(TXlsNamedRange DataCell, ExcelFile Xls)
        {
            //Find the cell where the cart will go.
            TXlsNamedRange ChartRange = Xls.GetNamedRange("ChartData", -1);

            //Insert cells to expand the range for the chart. It already has 2 rows, so we need to insert Country.Length - 2
            //Note also that we insert after ChartRange.Top, so the chart is updates with the new range.
            Xls.InsertAndCopyRange(new TXlsCellRange(ChartRange.Top, ChartRange.Left, ChartRange.Top, ChartRange.Left + 1),
                ChartRange.Top + 1, ChartRange.Left, Country.Length - 2, TFlxInsertMode.ShiftRangeDown);  //we use shiftrangedown so not all the row goes down and the chart stays in place.

            //Get the cell addresses of the data range.
            TCellAddress FirstCell = new TCellAddress(DataCell.Top, DataCell.Left);
            TCellAddress SecondCell = new TCellAddress(DataCell.Top + DataRows, DataCell.Left + 1);
            TCellAddress FirstSumCell = new TCellAddress(DataCell.Top, DataCell.Left + 1);

            //Fill a table with the data to be used in the chart.
            for (int r = ChartRange.Top; r < ChartRange.Top + Country.Length; r++)
            {
                Xls.SetCellValue(r, ChartRange.Left, Country[r - ChartRange.Top]);
                Xls.SetCellValue(r, ChartRange.Left + 1, new TFormula("=SUMIF(" + FirstCell.CellRef + ":" + SecondCell.CellRef +
                    ",\"" + Country[r - ChartRange.Top] + "\", " + FirstSumCell.CellRef + ":" + SecondCell.CellRef + ")"));
            }

        }

        private void AddData(ExcelFile Xls)
        {
            string TemplateFile = "template.xls";
            if (cbXlsxTemplate.Checked)
            {
                if (!XlsFile.SupportsXlsx)
                {
                    throw new Exception("Xlsx files are not supported in this version of the .NET framework");
                }
                TemplateFile = "template.xlsm";
            }

            // Open an existing file to be used as template. In this example this file has
            // little data, in a real situation it should have as much as possible. (Or even better, be a report)
            Xls.Open(Path.Combine(PathToExe, TemplateFile));

            //Find the cell where we want to fill the data. In this case, we have created a named range "data" so the address
            //is not hardcoded here.
            TXlsNamedRange DataCell = Xls.GetNamedRange("Data", -1);

            //Add a chart with totals
            AddChart(DataCell, Xls);
            //Note that "DataCell" will change because we inserted rows above it when creating the chart. But we will keep using the old one.

            //Add the captions. This should probably go into the template, but in a dynamic environment it might go here.
            Xls.SetCellValue(DataCell.Top - 1, DataCell.Left, "Country");
            Xls.SetCellValue(DataCell.Top - 1, DataCell.Left + 1, "Quantity");

            //Add a rectangle around the cells
            TFlxApplyFormat ApplyFormat = new TFlxApplyFormat();
            ApplyFormat.SetAllMembers(false);
            ApplyFormat.Borders.SetAllMembers(true);  //We will only apply the borders to the existing cell formats
            TFlxFormat fmt = Xls.GetDefaultFormat;
            fmt.Borders.Left.Style = TFlxBorderStyle.Double;
            fmt.Borders.Left.Color = Colors.Black;
            fmt.Borders.Right.Style = TFlxBorderStyle.Double;
            fmt.Borders.Right.Color = Colors.Black;
            fmt.Borders.Top.Style = TFlxBorderStyle.Double;
            fmt.Borders.Top.Color = Colors.Black;
            fmt.Borders.Bottom.Style = TFlxBorderStyle.Double;
            fmt.Borders.Bottom.Color = Colors.Black;
            Xls.SetCellFormat(DataCell.Top - 1, DataCell.Left, DataCell.Top, DataCell.Left + 1, fmt, ApplyFormat, true);  //Set last parameter to true so it draws a box.

            //Freeze panes
            Xls.FreezePanes(new TCellAddress(DataCell.Top, 1));

            Random Rnd = new Random();

            //Fill the data
            int z = 0;
            int OutlineLevel = 0;
            for (int r = 0; r <= DataRows; r++)
            {

                //Fill the values.
                Xls.SetCellValue(DataCell.Top + r, DataCell.Left, Country[z % Country.Length]);  //For non C# users, "%" means "mod" or modulus in other languages. It is the rest of the integer division.
                Xls.SetCellValue(DataCell.Top + r, DataCell.Left + 1, Rnd.Next(1000));

                //Add the country to the outline
                Xls.SetRowOutlineLevel(DataCell.Top + r, OutlineLevel);
                //increment the country randomly
                if (Rnd.Next(3) == 0)
                {
                    z++;
                    OutlineLevel = 0;  //Break the group and create a new one.
                }
                else
                {
                    OutlineLevel = 1;
                }
            }

            //Make the "+" signs of the outline appear at the top.
            Xls.OutlineSummaryRowsBelowDetail = false;

            //Collapse the outline to the first level.
            Xls.CollapseOutlineRows(1, TCollapseChildrenMode.Collapsed);

            //Add Data Validation for the first column, it must be a country.
            TDataValidationInfo dv = new TDataValidationInfo(
                TDataValidationDataType.List, //We will use a built in list.
                TDataValidationConditionType.Between,  //This parameter does not matter since it is a list. It will not be used.
                "=\"" + GetCountryList() + "\"",   //We could have used a range of cells here with the values (like "=C1..C4") Instead, we directly entered the list in the formula.
                null,  //no need for a second formula, not used in List
                false,
                true,
                true,  //Note that as we entered the data directly in FirstFormula, we need to set this to true
                true,
                "Unknown country",
                "Please make sure that the country is in the list",
                false, //We will not use an input box, so this is false and the 2 next entries are null
                null,
                null,
                TDataValidationIcon.Stop);  //We will use the stop icon so no invalid input is permitted.
            Xls.AddDataValidation(new TXlsCellRange(DataCell.Top, DataCell.Left, DataCell.Top + DataRows, DataCell.Left), dv);

            //Add Data Validation for the second column, it must be an integer between 0 and 1000.
            dv = new TDataValidationInfo(
                TDataValidationDataType.WholeNumber, //We will request a number.
                TDataValidationConditionType.Between,
                "=0",  //First formula marks the first part of the "between" condition.
                "=1000",  //Second formula is the second part.
                false,
                false,
                false,
                true,
                "Invalid Quantity",
                null, //We will leave the default error message.
                true,
                "Quantity:",
                "Please enter a quantity between 0 and 1000",
                TDataValidationIcon.Stop);  //We will use the stop icon so no invalid input is permitted.
            Xls.AddDataValidation(new TXlsCellRange(DataCell.Top, DataCell.Left + 1, DataCell.Top + DataRows, DataCell.Left + 1), dv);

            //Search country "Unknown" and replace it by "no".
            //This does not make any sense here (we could just have entered "no" to begin)
            //but it shows how to do it when modifying an existing file
            Xls.Replace("Unknown", "no", TXlsCellRange.FullRange(), true, false, true);

            //Autofit the rows. As we keep the row height automatic this will not show when opening in Excel, but will work when directly printing from FlexCel.
            Xls.AutofitRowsOnWorkbook(false, true, 1);

            Xls.Recalc(); //Calculate the SUMIF formulas so we can sort by them. Note that FlexCel automatically recalculates before saving,
                          //but in this case we haven't saved yet, so the sheet is not recalculated. You do not normally need to call Recalc directly.

            //Sort the data. As in the case with replace, this does not make much sense. We could have entered the data sorted to begin
            //But it shows how you can use the feature.

            //Find the cell where the chart goes.
            TXlsNamedRange ChartRange = Xls.GetNamedRange("ChartData", -1);
            Xls.Sort(new TXlsCellRange(ChartRange.Top, ChartRange.Left, ChartRange.Top + Country.Length, ChartRange.Left + 1),
                true, new int[] { 2 }, new TSortOrder[] { TSortOrder.Descending }, null);

            //Protect the Sheet
            TSheetProtectionOptions Sp = new TSheetProtectionOptions(false); //Create default protection options that allows everything.
            Sp.InsertColumns = false; //Restrict inserting columns.
            Xls.Protection.SetSheetProtection("flexcel", Sp);
            //Set a modify password. Note that this does *not* encrypt the file.
            Xls.Protection.SetModifyPassword("flexcel", true, "flexcel");

            Xls.Protection.OpenPassword = "flexcel";  //OpenPasword is the only password that will actually encrypt the file, so you will not be able to open it with flexcel if you do not know the password.

            //Select cell A1
            Xls.SelectCell(1, 1, true);
        }

        //This is part of an advanced feature (showing the user using a file) , you do not need to use
        //this method on normal places.
        private string GetLockingUser(string FileName)
        {
            try
            {
                XlsFile xerr = new XlsFile();
                xerr.Open(FileName);
                return " - File might be in use by: " + xerr.Protection.WriteAccess;
            }
            catch
            {
                return String.Empty;
            }
        }

        private void NormalOpen(ExcelFile Xls)
        {
            if (cbXlsxTemplate.Checked) saveFileDialog1.FilterIndex = 1; else saveFileDialog1.FilterIndex = 0;
            if (saveFileDialog1.ShowDialog() == DialogResult.OK)
            {
                if (!XlsFile.SupportsXlsx && Path.GetExtension(saveFileDialog1.FileName) == ".xlsm")
                {
                    throw new Exception("Xlsx files are not supported in this version of the .NET framework");
                }

                try
                {
                    Xls.Save(saveFileDialog1.FileName);
                }
                catch (IOException ex) //This is not really needed, just to show the username of the user locking the file.
                {
                    throw new IOException(ex.Message + GetLockingUser(saveFileDialog1.FileName), ex);
                }

                if (MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    using (Process p = new Process())
                    {
                        p.StartInfo.FileName = saveFileDialog1.FileName;
                        p.StartInfo.UseShellExecute = true;
                        p.Start();
                    }
                }
            }
        }
    }
}

Form1.Designer.cs

using System;
using System.Drawing;
using System.Collections;
using System.Windows.Forms;
using System.Data;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using System.IO;
using System.Diagnostics;
using System.Reflection;
using System.Text;
namespace AdvancedAPI
{
    public partial class mainForm : System.Windows.Forms.Form
    {
        private System.Windows.Forms.Button button1;
        private System.Windows.Forms.SaveFileDialog saveFileDialog1;
        private System.Windows.Forms.Label label1;
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.Container components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose( bool disposing )
        {
            if( disposing )
            {
                if (components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose( disposing );
        }

        #region Windows Form Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(mainForm));
            this.button1 = new System.Windows.Forms.Button();
            this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog();
            this.label1 = new System.Windows.Forms.Label();
            this.cbXlsxTemplate = new System.Windows.Forms.CheckBox();
            this.SuspendLayout();
            //
            // button1
            //
            this.button1.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
            this.button1.Location = new System.Drawing.Point(136, 160);
            this.button1.Name = "button1";
            this.button1.Size = new System.Drawing.Size(75, 23);
            this.button1.TabIndex = 0;
            this.button1.Text = "GO!";
            this.button1.Click += new System.EventHandler(this.button1_Click);
            //
            // saveFileDialog1
            //
            this.saveFileDialog1.Filter = "Excel Files (97-2003)|*.xls|Excel Files (2007 or newer)|*.xlsm";
            this.saveFileDialog1.RestoreDirectory = true;
            //
            // label1
            //
            this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
                        | System.Windows.Forms.AnchorStyles.Left)
                        | System.Windows.Forms.AnchorStyles.Right)));
            this.label1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
            this.label1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.label1.Location = new System.Drawing.Point(16, 16);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(320, 90);
            this.label1.TabIndex = 1;
            this.label1.Text = resources.GetString("label1.Text");
            //
            // cbXlsxTemplate
            //
            this.cbXlsxTemplate.AutoSize = true;
            this.cbXlsxTemplate.Location = new System.Drawing.Point(16, 120);
            this.cbXlsxTemplate.Name = "cbXlsxTemplate";
            this.cbXlsxTemplate.Size = new System.Drawing.Size(108, 17);
            this.cbXlsxTemplate.TabIndex = 2;
            this.cbXlsxTemplate.Text = "Use xlsx template";
            this.cbXlsxTemplate.UseVisualStyleBackColor = true;
            //
            // mainForm
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(344, 197);
            this.Controls.Add(this.cbXlsxTemplate);
            this.Controls.Add(this.label1);
            this.Controls.Add(this.button1);
            this.Name = "mainForm";
            this.Text = "Advanced API";
            this.ResumeLayout(false);
            this.PerformLayout();

        }
        #endregion

        private CheckBox cbXlsxTemplate;
    }
}

Program.cs

using System;
using System.Windows.Forms;

namespace AdvancedAPI
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new mainForm());
        }
    }
}


Chart API (C# / netframework) | FlexCel Studio for the .NET Framework documentation

Chart API (C# / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\csharp\VS2022\netframework\10.API\16.Chart API and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​csharp/​VS2022/​netframework/​Modules/​10.​API/​16.​Chart API

Overview

Here we will show how to create a simple chart only with code. Note that as charts are complex and have many configuration options, the best way to find out how to create a particular chart is to create it in Excel, and then open it with APIMate. APIMate has full support for showing the chart API.

Concepts

  • How you can use ExcelFile.AddChart, ExcelChart.AddSeries and other commands to create a simple chart.

  • The chart API works only in xlsx files, so this demo wouldn't work with xls files.

Files

AssemblyInfo.cs

using System.Reflection;
using System.Runtime.CompilerServices;

//
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
//
[assembly: AssemblyTitle("")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("(c) 2002 - 2024 TMS Software")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

//
// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version
//      Build Number
//      Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:

[assembly: AssemblyVersion("7.21.0.0")]

//
// In order to sign your assembly you must specify a key to use. Refer to the
// Microsoft .NET Framework documentation for more information on assembly signing.
//
// Use the attributes below to control which key is used for signing.
//
// Notes:
//   (*) If no key is specified, the assembly is not signed.
//   (*) KeyName refers to a key that has been installed in the Crypto Service
//       Provider (CSP) on your machine. KeyFile refers to a file which contains
//       a key.
//   (*) If the KeyFile and the KeyName values are both specified, the
//       following processing occurs:
//       (1) If the KeyName can be found in the CSP, that key is used.
//       (2) If the KeyName does not exist and the KeyFile does exist, the key
//           in the KeyFile is installed into the CSP and used.
//   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
//       When specifying the KeyFile, the location of the KeyFile should be
//       relative to the project output directory which is
//       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
//       located in the project directory, you would specify the AssemblyKeyFile
//       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
//   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
//       documentation for more information on this.
//
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]
[assembly: AssemblyKeyName("")]

Form1.cs

using System;
using System.Drawing;
using System.Collections;
using System.Windows.Forms;
using System.Data;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using System.IO;
using System.Diagnostics;
using System.Reflection;
using System.Text;

namespace ChartAPI
{
    /// <summary>
    /// A demo on creating a chart with code.
    /// </summary>
    public partial class mainForm: System.Windows.Forms.Form
    {

        public mainForm()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, System.EventArgs e)
        {
            AutoRun();
        }

        private string PathToExe
        {
            get
            {
                return Path.Combine(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), ".."), "..") + Path.DirectorySeparatorChar;
            }
        }

        private void AutoRun()
        {
            //We will use data already stored in a file. For a real case, you would
            //probably fill this data from some database.
            string fileName = Path.Combine(PathToExe, "git-stats.xlsx");
            ExcelFile Xls = new XlsFile(fileName, true);

            //Add a new empty sheet for adding the chart.
            Xls.InsertAndCopySheets(0, 1, 1);
            Xls.ActiveSheet = 1;
            Xls.SheetName = "Chart";
            Xls.PrintToFit = true;
            Xls.PrintScale = 70;
            Xls.PrintXResolution = 600;
            Xls.PrintYResolution = 600;
            Xls.PrintOptions = TPrintOptions.None;
            Xls.PrintPaperSize = TPaperSize.Letter;
            Xls.PrintLandscape = true;

            AddChart(Xls);
            NormalOpen(Xls);
        }

        private void AddChart(ExcelFile xls)
        {
            //This code is adapted from APIMate.
            //Objects
            TShapeProperties ChartOptions1 = new TShapeProperties();
            ChartOptions1.Anchor = new TClientAnchor(TFlxAnchorType.MoveAndResize, 1, 215, 1, 608, 30, 228, 17, 736);
            ChartOptions1.ShapeName = "Lines of code";
            ChartOptions1.Print = true;
            ChartOptions1.Visible = true;
            ChartOptions1.ShapeOptions.SetValue(TShapeOption.fLockText, true);
            ChartOptions1.ShapeOptions.SetValue(TShapeOption.LockRotation, true);
            ChartOptions1.ShapeOptions.SetValue(TShapeOption.fAutoTextMargin, true);
            ChartOptions1.ShapeOptions.SetValue(TShapeOption.fillColor, 134217806);
            ChartOptions1.ShapeOptions.SetValue(TShapeOption.wzName, "Lines of code");
            ExcelChart Chart1 = xls.AddChart(ChartOptions1, TChartType.Area, new ChartStyle(102), false);

            TDataLabel Title = new TDataLabel();
            Title.PositionZeroBased = null;
            ChartFillOptions TextFillOptions = new ChartFillOptions(new TShapeFill(new TSolidFill(TDrawingColor.FromRgb(0x80, 0x80, 0x80)), true, TFormattingType.Subtle, TDrawingColor.FromRgb(0x00, 0x00, 0x00, new TColorTransform(TColorTransformType.Alpha, 0)), false));
            TChartTextOptions LabelTextOptions = new TChartTextOptions(new TFlxChartFont("Calibri Light", 320, TExcelColor.FromArgb(0x80, 0x80, 0x80), TFlxFontStyles.Bold, TFlxUnderline.None, TFontScheme.Major), THFlxAlignment.center, TVFlxAlignment.center, TBackgroundMode.Transparent, TextFillOptions);
            Title.TextOptions = LabelTextOptions;
            TDataLabelOptions LabelOptions = new TDataLabelOptions();
            Title.LabelOptions = LabelOptions;
            ChartLineOptions ChartLineOptions = new ChartLineOptions(new TShapeLine(true, new TLineStyle(new TNoFill(), null), null, TFormattingType.Subtle));
            ChartFillOptions ChartFillOptions = new ChartFillOptions(new TShapeFill(new TNoFill(), false, TFormattingType.Subtle, null, false));
            Title.Frame = new TChartFrameOptions(ChartLineOptions, ChartFillOptions, false);

            TRTFRun[] Runs;
            Runs = new TRTFRun[1];
            Runs[0].FirstChar = 0;
            TFlxFont fnt;
            fnt = xls.GetDefaultFont;
            fnt.Name = "Calibri Light";
            fnt.Size20 = 320;
            fnt.Color = TExcelColor.FromArgb(0x80, 0x80, 0x80);
            fnt.Style = TFlxFontStyles.Bold;
            fnt.Family = 0;
            fnt.CharSet = 1;
            fnt.Scheme = TFontScheme.Major;
            Runs[0].FontIndex = xls.AddFont(fnt);
            TRichString LabelValue1 = new TRichString("FlexCel: Lines of code over time", Runs, xls);

            Title.LabelValues = new Object[] { LabelValue1 };

            Chart1.SetTitle(Title);

            Chart1.Background = new TChartFrameOptions(TDrawingColor.FromTheme(TThemeColor.Dark1, new TColorTransform(TColorTransformType.LumMod, 0.15), new TColorTransform(TColorTransformType.LumOff, 0.85)), 9525, TDrawingColor.FromTheme(TThemeColor.Light1), false);

            TChartFrameOptions PlotAreaFrame;
            ChartLineOptions = new ChartLineOptions(new TShapeLine(true, new TLineStyle(new TNoFill(), null), null, TFormattingType.Subtle));
            ChartFillOptions = new ChartFillOptions(new TShapeFill(new TPatternFill(TDrawingColor.FromTheme(TThemeColor.Dark1, new TColorTransform(TColorTransformType.LumMod, 0.15), new TColorTransform(TColorTransformType.LumOff, 0.85)), TDrawingColor.FromTheme(TThemeColor.Light1), TDrawingPattern.ltDnDiag), true, TFormattingType.Subtle, null, false));
            PlotAreaFrame = new TChartFrameOptions(ChartLineOptions, ChartFillOptions, false);
            TChartPlotAreaPosition PlotAreaPos = new TChartPlotAreaPosition(true, TChartRelativeRectangle.Automatic, TChartLayoutTarget.Inner, true);
            Chart1.PlotArea = new TChartPlotArea(PlotAreaFrame, PlotAreaPos, false);

            Chart1.SetChartOptions(1, new TAreaChartOptions(false, TStackedMode.Stacked, null));

            int LastYear = 0;
            double shade = 1;
            for (int i = 2; i < 190; i++)
            {
                ChartSeries Series = new ChartSeries(
                    "=" + new TCellAddress("Data", 1, i, true, true).CellRef,
                    "=" + new TCellAddress("Data", 2, i, true, true).CellRef + ":" + new TCellAddress("Data", 189, i, true, true).CellRef,
                    "=Data!$A$2:$A$189");

                //We will display every year in a single color. Each month gets its own shade.
                int xf = -1;
                int Year = FlxDateTime.FromOADate(((double)xls.GetCellValue(2, 1, i, ref xf)), false).Year;
                if (LastYear != Year) shade = 1; else if (shade > 0.3) shade -= 0.05;
                    LastYear = Year;
                TDrawingColor SeriesColor = TDrawingColor.FromTheme(TThemeColor.Accent1 + Year % 6,
                    new TColorTransform(TColorTransformType.Shade, shade));

                ChartSeriesFillOptions SeriesFill = new ChartSeriesFillOptions(new TShapeFill(new TSolidFill(SeriesColor), true, TFormattingType.Subtle, null, false), null, false, false);
                ChartSeriesLineOptions SeriesLine = new ChartSeriesLineOptions(new TShapeLine(true, new TLineStyle(new TNoFill(), null), null, TFormattingType.Subtle), false);
                Series.Options.Add(new ChartSeriesOptions(-1, SeriesFill, SeriesLine, null, null, null, true));

                Chart1.AddSeries(Series);
            }

            Chart1.PlotEmptyCells = TPlotEmptyCells.Zero;
            Chart1.ShowDataInHiddenRowsAndCols = false;

            TFlxChartFont AxisFont = new TFlxChartFont("Calibri", 180, TExcelColor.FromArgb(0x59, 0x59, 0x59), TFlxFontStyles.None, TFlxUnderline.None, TFontScheme.Minor);
            TAxisLineOptions AxisLine = new TAxisLineOptions();
            AxisLine.MainAxis = new ChartLineOptions(new TShapeLine(true, new TLineStyle(new TSolidFill(TDrawingColor.FromTheme(TThemeColor.Dark1, new TColorTransform(TColorTransformType.LumMod, 0.15), new TColorTransform(TColorTransformType.LumOff, 0.85))), 9525, TPenAlignment.Center, TLineCap.Flat, TCompoundLineType.Single, null, TLineJoin.Round, null, null, null), null, TFormattingType.Subtle));
            AxisLine.DoNotDrawLabelsIfNotDrawingAxis = false;
            TAxisTickOptions AxisTicks = new TAxisTickOptions(TTickType.Outside, TTickType.None, TAxisLabelPosition.NextToAxis, TBackgroundMode.Transparent, TDrawingColor.FromRgb(0x59, 0x59, 0x59), 0);
            TAxisRangeOptions AxisRangeOptions = new TAxisRangeOptions(12, 1, false, false, false);
            TBaseAxis CatAxis = new TCategoryAxis(0, 0, 12, TDateUnits.Days, 12, TDateUnits.Days, TDateUnits.Months, 0, TCategoryAxisOptions.AutoMin | TCategoryAxisOptions.AutoMax | TCategoryAxisOptions.DateAxis | TCategoryAxisOptions.AutoCrossDate | TCategoryAxisOptions.AutoDate, AxisFont, "yyyy\\-mm\\-dd;@", true, AxisLine, AxisTicks, AxisRangeOptions, null, TChartAxisPos.Bottom, 1);
            AxisFont = new TFlxChartFont("Calibri", 180, TExcelColor.FromArgb(0x59, 0x59, 0x59), TFlxFontStyles.None, TFlxUnderline.None, TFontScheme.Minor);
            AxisLine = new TAxisLineOptions();
            AxisLine.MainAxis = new ChartLineOptions(new TShapeLine(true, new TLineStyle(new TSolidFill(TDrawingColor.FromTheme(TThemeColor.Dark1, new TColorTransform(TColorTransformType.LumMod, 0.15), new TColorTransform(TColorTransformType.LumOff, 0.85))), 9525, TPenAlignment.Center, TLineCap.Flat, TCompoundLineType.Single, null, TLineJoin.Round, null, null, null), null, TFormattingType.Subtle));
            AxisLine.MajorGridLines = new ChartLineOptions(new TShapeLine(true, new TLineStyle(new TSolidFill(TDrawingColor.FromTheme(TThemeColor.Dark1, new TColorTransform(TColorTransformType.LumMod, 0.15), new TColorTransform(TColorTransformType.LumOff, 0.85))), 9525, TPenAlignment.Center, TLineCap.Flat, TCompoundLineType.Single, null, TLineJoin.Round, null, null, null), null, TFormattingType.Subtle));
            AxisLine.DoNotDrawLabelsIfNotDrawingAxis = false;
            AxisTicks = new TAxisTickOptions(TTickType.None, TTickType.None, TAxisLabelPosition.NextToAxis, TBackgroundMode.Transparent, TDrawingColor.FromRgb(0x59, 0x59, 0x59), 0);
            CatAxis.NumberFormat = "yyyy-mm";
            CatAxis.NumberFormatLinkedToSource = false;

            TBaseAxis ValAxis = new TValueAxis(0, 0, 0, 0, 0, TValueAxisOptions.AutoMin | TValueAxisOptions.AutoMax | TValueAxisOptions.AutoMajor | TValueAxisOptions.AutoMinor | TValueAxisOptions.AutoCross, AxisFont, "General", true, AxisLine, AxisTicks, null, TChartAxisPos.Left);
            Chart1.SetChartAxis(new TChartAxis(0, CatAxis, ValAxis));

        }

        private void NormalOpen(ExcelFile Xls)
        {
            if (saveFileDialog1.ShowDialog() == DialogResult.OK)
            {
                Xls.Save(saveFileDialog1.FileName);

                if (MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    using (Process p = new Process())
                    {
                        p.StartInfo.FileName = saveFileDialog1.FileName;
                        p.StartInfo.UseShellExecute = true;
                        p.Start();
                    }
                }
            }
        }
    }
}

Form1.Designer.cs

using System;
using System.Drawing;
using System.Collections;
using System.Windows.Forms;
using System.Data;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using System.IO;
using System.Diagnostics;
using System.Reflection;
using System.Text;
namespace ChartAPI
{
    public partial class mainForm : System.Windows.Forms.Form
    {
        private System.Windows.Forms.Button button1;
        private System.Windows.Forms.SaveFileDialog saveFileDialog1;
        private System.Windows.Forms.Label label1;
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.Container components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose( bool disposing )
        {
            if( disposing )
            {
                if (components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose( disposing );
        }

        #region Windows Form Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.button1 = new System.Windows.Forms.Button();
            this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog();
            this.label1 = new System.Windows.Forms.Label();
            this.SuspendLayout();
            //
            // button1
            //
            this.button1.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
            this.button1.Location = new System.Drawing.Point(136, 160);
            this.button1.Name = "button1";
            this.button1.Size = new System.Drawing.Size(75, 23);
            this.button1.TabIndex = 0;
            this.button1.Text = "GO!";
            this.button1.Click += new System.EventHandler(this.button1_Click);
            //
            // saveFileDialog1
            //
            this.saveFileDialog1.DefaultExt = "xlsx";
            this.saveFileDialog1.Filter = "Excel Files (2007 or newer)|*.xlsx";
            this.saveFileDialog1.RestoreDirectory = true;
            //
            // label1
            //
            this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
            | System.Windows.Forms.AnchorStyles.Left)
            | System.Windows.Forms.AnchorStyles.Right)));
            this.label1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
            this.label1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.label1.Location = new System.Drawing.Point(16, 16);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(320, 90);
            this.label1.TabIndex = 1;
            this.label1.Text = "A demo showing how to create a simple chart with code. Use APIMate for more compl" +
    "ex charts";
            //
            // mainForm
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(344, 197);
            this.Controls.Add(this.label1);
            this.Controls.Add(this.button1);
            this.Name = "mainForm";
            this.Text = "Chart API";
            this.ResumeLayout(false);

        }
        #endregion
    }
}

Program.cs

using System;
using System.Windows.Forms;

namespace ChartAPI
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new mainForm());
        }
    }
}


Reading Excel files (C# / netframework) | FlexCel Studio for the .NET Framework documentation

Reading Excel files (C# / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\csharp\VS2022\netframework\10.API\20.Reading Files and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​csharp/​VS2022/​netframework/​Modules/​10.​API/​20.​Reading Files

Overview

A demo showing how to read the contents of an Excel file using FlexCel.

Concepts

  • To read an Excel file you use the XlsFile class, from where you can read and write to any Excel 2.0 or newer file.

  • To get the value for a single cell, use XlsFile.GetCellValue.

  • To get the value for a cell when looping a full sheet, use XlsFile.GetCellValueIndexed. It is faster than using GetCellValue since you will only read the used cells.

  • XlsFile.GetCellValue and XlsFile.GetCellValueIndexed can return one of the following objects:

    • null

    • Double

    • Boolean

    • String

    • TRichString

    • TFormula

  • With GetCellValue and GetCellValueIndexed you will get the actual values. But if you want to actually display formatted data (for example if you have the number 2 with 2 decimals, and you want to display 2.00 instead of 2), you need to use other methods. There are 2 ways to do it:

    1. XlsFile.GetStringFromCell will return a rich string with the cell formatted.

    2. FormatValue will format an object with a specified format and then return the corresponding rich string. TFlxNumberFormat.FormatValue is used internally by GetStringFromCell.

  • In Excel, Dates are doubles. The only difference between a date and a double is on the format on the cell. With FormatValue you can get the actual string that is displayed on Excel. Also, to convert this double to a DateTime, you can use FlxDateTime.FromOADate.

Files

AssemblyInfo.cs

using System.Reflection;
using System.Runtime.CompilerServices;

//
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
//
[assembly: AssemblyTitle("")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("(c) 2002 - 2024 TMS Software")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

//
// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version
//      Build Number
//      Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:

[assembly: AssemblyVersion("7.21.0.0")]

//
// In order to sign your assembly you must specify a key to use. Refer to the
// Microsoft .NET Framework documentation for more information on assembly signing.
//
// Use the attributes below to control which key is used for signing.
//
// Notes:
//   (*) If no key is specified, the assembly is not signed.
//   (*) KeyName refers to a key that has been installed in the Crypto Service
//       Provider (CSP) on your machine. KeyFile refers to a file which contains
//       a key.
//   (*) If the KeyFile and the KeyName values are both specified, the
//       following processing occurs:
//       (1) If the KeyName can be found in the CSP, that key is used.
//       (2) If the KeyName does not exist and the KeyFile does exist, the key
//           in the KeyFile is installed into the CSP and used.
//   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
//       When specifying the KeyFile, the location of the KeyFile should be
//       relative to the project output directory which is
//       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
//       located in the project directory, you would specify the AssemblyKeyFile
//       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
//   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
//       documentation for more information on this.
//
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]
[assembly: AssemblyKeyName("")]

Form1.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;

using FlexCel.Core;
using FlexCel.XlsAdapter;

namespace ReadingFiles
{
    /// <summary>
    /// A demo on how to read a file from FlexCel and display the results.
    /// </summary>
    public partial class mainForm: System.Windows.Forms.Form
    {
        public mainForm()
        {
            InitializeComponent();
            ResizeToolbar(mainToolbar);
        }

        private void ResizeToolbar(ToolStrip toolbar)
        {

            using (Graphics gr = CreateGraphics())
            {
                double xFactor = gr.DpiX / 96.0;
                double yFactor = gr.DpiY / 96.0;
                toolbar.ImageScalingSize = new Size((int)(24 * xFactor), (int)(24 * yFactor));
                toolbar.Width = 0; //force a recalc of the buttons.
            }
        }

        private void btnExit_Click(object sender, System.EventArgs e)
        {
            Close();
        }

        private void btnOpenFile_Click(object sender, System.EventArgs e)
        {
            if (openFileDialog1.ShowDialog() != DialogResult.OK) return;
            ImportFile(openFileDialog1.FileName, btnFormatValues.Checked);
        }

        private void ImportFile(string FileName, bool Formatted)
        {
            try
            {
                //Open the Excel file.
                XlsFile xls = new XlsFile(false);
                DateTime StartOpen = DateTime.Now;
                xls.Open(FileName);
                DateTime EndOpen = DateTime.Now;

                //Set up the Grid
                DisplayGrid.DataBindings.Clear();
                DisplayGrid.DataSource = null;
                DisplayGrid.DataMember = null;
                DataSet dataSet1 = new DataSet();
                sheetCombo.Items.Clear();

                //We will create a DataTable "SheetN" for each sheet on the Excel sheet.
                for (int sheet = 1; sheet <= xls.SheetCount; sheet++)
                {
                    xls.ActiveSheet = sheet;

                    sheetCombo.Items.Add(xls.SheetName);

                    DataTable Data = dataSet1.Tables.Add("Sheet" + sheet.ToString());
                    Data.BeginLoadData();
                    try
                    {
                        int ColCount = xls.ColCount;
                        //Add one column on the dataset for each used column on Excel.
                        for (int c = 1; c <= ColCount; c++)
                        {
                            Data.Columns.Add(TCellAddress.EncodeColumn(c), typeof(String));  //Here we will add all strings, since we do not know what we are waiting for.
                        }

                        string[] dr = new string[ColCount];

                        int RowCount = xls.RowCount;
                        for (int r = 1; r <= RowCount; r++)
                        {
                            Array.Clear(dr, 0, dr.Length);
                            //This loop will only loop on used cells. It is more efficient than looping on all the columns.
                            for (int cIndex = xls.ColCountInRow(r); cIndex > 0; cIndex--)  //reverse the loop to avoid calling ColCountInRow more than once.
                            {
                                int Col = xls.ColFromIndex(r, cIndex);

                                if (Formatted)
                                {
                                    TRichString rs = xls.GetStringFromCell(r, Col);
                                    dr[Col - 1] = rs.Value;
                                }
                                else
                                {
                                    int XF = 0; //This is the cell format, we will not use it here.
                                    object val = xls.GetCellValueIndexed(r, cIndex, ref XF);

                                    TFormula Fmla = val as TFormula;
                                    if (Fmla != null)
                                    {
                                        //When we have formulas, we want to write the formula result.
                                        //If we wanted the formula text, we would not need this part.
                                        dr[Col - 1] = Convert.ToString(Fmla.Result);
                                    }
                                    else
                                    {
                                        dr[Col - 1] = Convert.ToString(val);
                                    }
                                }
                            }
                            Data.Rows.Add(dr);
                        }
                    }
                    finally
                    {
                        Data.EndLoadData();
                    }

                    DateTime EndFill = DateTime.Now;
                    statusBar.Text = String.Format("Time to load file: {0}    Time to fill dataset: {1}     Total time: {2}", (EndOpen - StartOpen).ToString(), (EndFill - EndOpen).ToString(), (EndFill - StartOpen).ToString());

                }

                //Set up grid.
                DisplayGrid.DataSource = dataSet1;
                DisplayGrid.DataMember = "Sheet1";
                sheetCombo.SelectedIndex = 0;
                DisplayGrid.CaptionText = FileName;

            }
            catch
            {
                DisplayGrid.CaptionText = "Error Loading File";
                DisplayGrid.DataSource = null;
                DisplayGrid.DataMember = "";
                sheetCombo.Items.Clear();
                throw;
            }
        }

        private void sheetCombo_SelectedIndexChanged(object sender, System.EventArgs e)
        {
            if ((sender as ComboBox).SelectedIndex < 0) return;
            DisplayGrid.DataMember = "Sheet" + ((sender as ComboBox).SelectedIndex + 1).ToString();
        }

        private void AnalizeFile(string FileName, int Row, int Col)
        {
            XlsFile xls = new XlsFile();
            xls.Open(FileName);

            int XF = 0;
            MessageBox.Show("Active sheet is \"" + xls.ActiveSheetByName + "\"");
            object v = xls.GetCellValue(Row, Col, ref XF);

            if (v == null)
            {
                MessageBox.Show("Cell A1 is empty");
                return;
            }

            //Here we have all the kind of objects FlexCel can return.
            switch (Type.GetTypeCode(v.GetType()))
            {
                case TypeCode.Boolean:
                    MessageBox.Show("Cell A1 is a boolean: " + (bool)v);
                    return;
                case TypeCode.Double:  //Remember, dates are doubles with date format.
                    TUIColor CellColor = Color.Empty;
                    bool HasDate, HasTime;
                    String CellValue = TFlxNumberFormat.FormatValue(v, xls.GetFormat(XF).Format, ref CellColor, xls, out HasDate, out HasTime).ToString();

                    if (HasDate || HasTime)
                    {
                        MessageBox.Show("Cell A1 is a DateTime value: " + FlxDateTime.FromOADate((double)v, xls.OptionsDates1904).ToString() + "\n" +
                            "The value is displayed as: " + CellValue);
                    }
                    else
                    {
                        MessageBox.Show("Cell A1 is a double: " + (double)v + "\n" +
                            "The value is displayed as: " + CellValue + "\n");
                    }
                    return;
                case TypeCode.String:
                    MessageBox.Show("Cell A1 is a string: " + v.ToString());
                    return;
            }

            TFormula Fmla = v as TFormula;
            if (Fmla != null)
            {
                MessageBox.Show("Cell A1 is a formula: " + Fmla.Text + "   Value: " + Convert.ToString(Fmla.Result));
                return;
            }

            TRichString RSt = v as TRichString;
            if (RSt != null)
            {
                MessageBox.Show("Cell A1 is a formatted string: " + RSt.Value);
                return;
            }

            if (v is TFlxFormulaErrorValue)
            {
                MessageBox.Show("Cell A1 is an error: " + TFormulaMessages.ErrString((TFlxFormulaErrorValue)v));
                return;
            }

            throw new Exception("Unexpected value on cell");

        }

        private void btnInfo_Click(object sender, System.EventArgs e)
        {
            MessageBox.Show("This demo shows how to read the contents of an xls file\n" +
                "The 'Open File' button will load an Excel file into a dataset. Depending on the button 'Format Values' it will load the actual values (this is the fastest) or the formatted values.\n" +
                "The 'Format Values' button will modify how the files are read when you press 'Open File'. Formated values are slower, but they will look just how Excel shows them.\n" +
                "The 'Value in Cell A1' button will load an Excel file and show the contents of cell a1 on the active sheet.");
        }

        /// <summary>
        /// This method will not do anything truly useful, but it alows you to see how to
        /// process the different types of objects that GetCellValue can return
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnValueInCurrentCell_Click(object sender, EventArgs e)
        {
            if (openFileDialog1.ShowDialog() != DialogResult.OK) return;
            AnalizeFile(openFileDialog1.FileName, 1, 1);
        }
    }
}

Form1.Designer.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using FlexCel.Core;
using FlexCel.XlsAdapter;
namespace ReadingFiles
{
    public partial class mainForm: System.Windows.Forms.Form
    {
        private System.Windows.Forms.OpenFileDialog openFileDialog1;
        private System.Windows.Forms.DataGrid DisplayGrid;
        private System.Windows.Forms.Panel panel1;
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.ComboBox sheetCombo;
        private System.Windows.Forms.StatusBar statusBar;
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(mainForm));
            this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
            this.DisplayGrid = new System.Windows.Forms.DataGrid();
            this.panel1 = new System.Windows.Forms.Panel();
            this.sheetCombo = new System.Windows.Forms.ComboBox();
            this.label1 = new System.Windows.Forms.Label();
            this.statusBar = new System.Windows.Forms.StatusBar();
            this.mainToolbar = new System.Windows.Forms.ToolStrip();
            this.btnOpenFile = new System.Windows.Forms.ToolStripButton();
            this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
            this.btnFormatValues = new System.Windows.Forms.ToolStripButton();
            this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
            this.btnValueInCellA1 = new System.Windows.Forms.ToolStripButton();
            this.btnExit = new System.Windows.Forms.ToolStripButton();
            this.btnInfo = new System.Windows.Forms.ToolStripButton();
            ((System.ComponentModel.ISupportInitialize)(this.DisplayGrid)).BeginInit();
            this.panel1.SuspendLayout();
            this.mainToolbar.SuspendLayout();
            this.SuspendLayout();
            //
            // openFileDialog1
            //
            this.openFileDialog1.DefaultExt = "xls";
            this.openFileDialog1.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm|Excel 97/2003|*.xls|Excel 2007|*.xlsx;*.xlsm|All " +
    "files|*.*";
            this.openFileDialog1.Title = "Open an Excel File";
            //
            // DisplayGrid
            //
            this.DisplayGrid.DataMember = "";
            this.DisplayGrid.Dock = System.Windows.Forms.DockStyle.Fill;
            this.DisplayGrid.HeaderForeColor = System.Drawing.SystemColors.ControlText;
            this.DisplayGrid.Location = new System.Drawing.Point(0, 67);
            this.DisplayGrid.Name = "DisplayGrid";
            this.DisplayGrid.Size = new System.Drawing.Size(880, 372);
            this.DisplayGrid.TabIndex = 5;
            //
            // panel1
            //
            this.panel1.BackColor = System.Drawing.SystemColors.ControlDark;
            this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.panel1.Controls.Add(this.sheetCombo);
            this.panel1.Controls.Add(this.label1);
            this.panel1.Dock = System.Windows.Forms.DockStyle.Top;
            this.panel1.Location = new System.Drawing.Point(0, 38);
            this.panel1.Name = "panel1";
            this.panel1.Size = new System.Drawing.Size(880, 29);
            this.panel1.TabIndex = 6;
            //
            // sheetCombo
            //
            this.sheetCombo.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.sheetCombo.Location = new System.Drawing.Point(65, 3);
            this.sheetCombo.Name = "sheetCombo";
            this.sheetCombo.Size = new System.Drawing.Size(391, 21);
            this.sheetCombo.TabIndex = 1;
            this.sheetCombo.SelectedIndexChanged += new System.EventHandler(this.sheetCombo_SelectedIndexChanged);
            //
            // label1
            //
            this.label1.ForeColor = System.Drawing.SystemColors.HighlightText;
            this.label1.Location = new System.Drawing.Point(8, 8);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(40, 23);
            this.label1.TabIndex = 0;
            this.label1.Text = "Sheet:";
            //
            // statusBar
            //
            this.statusBar.Location = new System.Drawing.Point(0, 439);
            this.statusBar.Name = "statusBar";
            this.statusBar.Size = new System.Drawing.Size(880, 22);
            this.statusBar.TabIndex = 7;
            //
            // mainToolbar
            //
            this.mainToolbar.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.btnOpenFile,
            this.toolStripSeparator1,
            this.btnFormatValues,
            this.toolStripSeparator2,
            this.btnValueInCellA1,
            this.btnExit,
            this.btnInfo});
            this.mainToolbar.Location = new System.Drawing.Point(0, 0);
            this.mainToolbar.Name = "mainToolbar";
            this.mainToolbar.Size = new System.Drawing.Size(880, 38);
            this.mainToolbar.TabIndex = 11;
            this.mainToolbar.Text = "mainToolbar";
            //
            // btnOpenFile
            //
            this.btnOpenFile.Image = ((System.Drawing.Image)(resources.GetObject("btnOpenFile.Image")));
            this.btnOpenFile.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.btnOpenFile.Name = "btnOpenFile";
            this.btnOpenFile.Size = new System.Drawing.Size(59, 35);
            this.btnOpenFile.Text = "Open file";
            this.btnOpenFile.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
            this.btnOpenFile.Click += new System.EventHandler(this.btnOpenFile_Click);
            //
            // toolStripSeparator1
            //
            this.toolStripSeparator1.Name = "toolStripSeparator1";
            this.toolStripSeparator1.Size = new System.Drawing.Size(6, 38);
            //
            // btnFormatValues
            //
            this.btnFormatValues.CheckOnClick = true;
            this.btnFormatValues.Image = ((System.Drawing.Image)(resources.GetObject("btnFormatValues.Image")));
            this.btnFormatValues.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.btnFormatValues.Name = "btnFormatValues";
            this.btnFormatValues.Size = new System.Drawing.Size(85, 35);
            this.btnFormatValues.Text = "&Format values";
            this.btnFormatValues.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
            //
            // toolStripSeparator2
            //
            this.toolStripSeparator2.Name = "toolStripSeparator2";
            this.toolStripSeparator2.Size = new System.Drawing.Size(6, 38);
            //
            // btnValueInCellA1
            //
            this.btnValueInCellA1.Image = ((System.Drawing.Image)(resources.GetObject("btnValueInCellA1.Image")));
            this.btnValueInCellA1.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.btnValueInCellA1.Name = "btnValueInCellA1";
            this.btnValueInCellA1.Size = new System.Drawing.Size(91, 35);
            this.btnValueInCellA1.Text = "&Value in cell A1";
            this.btnValueInCellA1.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
            this.btnValueInCellA1.Click += new System.EventHandler(this.btnValueInCurrentCell_Click);
            //
            // btnExit
            //
            this.btnExit.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right;
            this.btnExit.Image = ((System.Drawing.Image)(resources.GetObject("btnExit.Image")));
            this.btnExit.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.btnExit.Name = "btnExit";
            this.btnExit.Size = new System.Drawing.Size(59, 35);
            this.btnExit.Text = "     E&xit     ";
            this.btnExit.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
            this.btnExit.Click += new System.EventHandler(this.btnExit_Click);
            //
            // btnInfo
            //
            this.btnInfo.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right;
            this.btnInfo.Image = ((System.Drawing.Image)(resources.GetObject("btnInfo.Image")));
            this.btnInfo.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.btnInfo.Name = "btnInfo";
            this.btnInfo.Size = new System.Drawing.Size(74, 35);
            this.btnInfo.Text = "Information";
            this.btnInfo.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
            this.btnInfo.Click += new System.EventHandler(this.btnInfo_Click);
            //
            // mainForm
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(880, 461);
            this.Controls.Add(this.DisplayGrid);
            this.Controls.Add(this.panel1);
            this.Controls.Add(this.statusBar);
            this.Controls.Add(this.mainToolbar);
            this.Name = "mainForm";
            this.Text = "Reading Excel Files";
            ((System.ComponentModel.ISupportInitialize)(this.DisplayGrid)).EndInit();
            this.panel1.ResumeLayout(false);
            this.mainToolbar.ResumeLayout(false);
            this.mainToolbar.PerformLayout();
            this.ResumeLayout(false);
            this.PerformLayout();

        }
        #endregion

        private ToolStrip mainToolbar;
        private ToolStripButton btnOpenFile;
        private ToolStripSeparator toolStripSeparator1;
        private ToolStripButton btnInfo;
        private ToolStripButton btnExit;
        private ToolStripButton btnValueInCellA1;
        private ToolStripSeparator toolStripSeparator2;
        private ToolStripButton btnFormatValues;
    }
}

Program.cs

using System;
using System.Windows.Forms;

namespace ReadingFiles
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new mainForm());
        }
    }
}


Working in virtual mode (C# / netframework) | FlexCel Studio for the .NET Framework documentation

Working in virtual mode (C# / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\csharp\VS2022\netframework\10.API\22.Virtual Mode and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​csharp/​VS2022/​netframework/​Modules/​10.​API/​22.​Virtual Mode

Overview

This example shows how to read or write Excel files without fully loading them in memory. See the FlexCel Performance Guide for more information in how Virtual Mode works.

Concepts

  • How to read xls, xlsx or txt files without loading them into memory.

Files

AssemblyInfo.cs

using System.Reflection;
using System.Runtime.CompilerServices;

//
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
//
[assembly: AssemblyTitle("")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("(c) 2002 - 2024 TMS Software")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

//
// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version
//      Build Number
//      Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:

[assembly: AssemblyVersion("7.21.0.0")]

//
// In order to sign your assembly you must specify a key to use. Refer to the
// Microsoft .NET Framework documentation for more information on assembly signing.
//
// Use the attributes below to control which key is used for signing.
//
// Notes:
//   (*) If no key is specified, the assembly is not signed.
//   (*) KeyName refers to a key that has been installed in the Crypto Service
//       Provider (CSP) on your machine. KeyFile refers to a file which contains
//       a key.
//   (*) If the KeyFile and the KeyName values are both specified, the
//       following processing occurs:
//       (1) If the KeyName can be found in the CSP, that key is used.
//       (2) If the KeyName does not exist and the KeyFile does exist, the key
//           in the KeyFile is installed into the CSP and used.
//   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
//       When specifying the KeyFile, the location of the KeyFile should be
//       relative to the project output directory which is
//       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
//       located in the project directory, you would specify the AssemblyKeyFile
//       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
//   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
//       documentation for more information on this.
//
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]
[assembly: AssemblyKeyName("")]

CellReader.cs

using System;
using System.Collections.Generic;
using System.Text;
using FlexCel.Core;
using System.Drawing;

namespace VirtualMode
{
    //A simple cell reader that will get the values from FlexCel and put them into a grid.
    class CellReader
    {
        private bool Only50Rows;
        private SparseCellArray CellData;
        private bool FormatValues;
        private int SheetToRead;
        public DateTime StartSheetSelect;
        public DateTime EndSheetSelect;

        public CellReader(bool aOnly50Rows, SparseCellArray aCellData, bool aFormatValues)
        {
            Only50Rows = aOnly50Rows;
            CellData = aCellData;
            FormatValues = aFormatValues;
        }

        public void OnStartReading(object sender, VirtualCellStartReadingEventArgs e)
        {
            StartSheetSelect = DateTime.Now;
            using (SheetSelectorForm SheetSelector = new SheetSelectorForm(e.SheetNames))
            {

                if (!SheetSelector.Execute())
                {
                    EndSheetSelect = DateTime.Now;
                    e.NextSheet = null; //stop reading
                    return;
                }

                EndSheetSelect = DateTime.Now;
                e.NextSheet = SheetSelector.SelectedSheet;
                SheetToRead = SheetSelector.SelectedSheetIndex + 1;
            }
        }

        public void OnCellRead(object sender, VirtualCellReadEventArgs e)
        {
            if (Only50Rows && e.Cell.Row > 50)
            {
                e.NextSheet = null; //Stop reading all sheets.
                return;
            }

            if (e.Cell.Sheet != SheetToRead)
            {
                e.NextSheet = null; //Stop reading all sheets.
                return;
            }

            if (FormatValues)
            {
                TUIColor Clr = Color.Empty;
                CellData.AddValue(e.Cell.Row, e.Cell.Col,
                   TFlxNumberFormat.FormatValue(e.Cell.Value,
                   ((ExcelFile)sender).GetFormat(e.Cell.XF).Format, ref Clr, ((ExcelFile)sender)));
            }
            else
            {
                CellData.AddValue(e.Cell.Row, e.Cell.Col, Convert.ToString(e.Cell.Value));
            }
        }
    }
}

Form1.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;

using FlexCel.Core;
using FlexCel.XlsAdapter;
using System.Collections.Generic;

namespace VirtualMode
{
    /// <summary>
    /// A demo on how to read a file from FlexCel and display the results.
    /// </summary>
    public partial class mainForm: System.Windows.Forms.Form
    {
        SparseCellArray CellData; //we will store the data here. This is an example, in real world you would use "Virtual mode" to load the cells into your own structures.

        public mainForm()
        {
            InitializeComponent();
            ResizeToolbar(mainToolbar);
        }

        private void ResizeToolbar(ToolStrip toolbar)
        {

            using (Graphics gr = CreateGraphics())
            {
                double xFactor = gr.DpiX / 96.0;
                double yFactor = gr.DpiY / 96.0;
                toolbar.ImageScalingSize = new Size((int)(24 * xFactor), (int)(24 * yFactor));
                toolbar.Width = 0; //force a recalc of the buttons.
            }
        }

        private void btnExit_Click(object sender, System.EventArgs e)
        {
            Close();
        }

        private void btnInfo_Click(object sender, System.EventArgs e)
        {
            MessageBox.Show("This demo shows how to read the contents of an xls file without loading the file in memory.\n" +
                "We will first load the sheet names in the file, then open just a single sheet, and read all or just the 50 first rows of it."
                );
        }

        private void btnOpenFile_Click(object sender, System.EventArgs e)
        {
            if (openFileDialog1.ShowDialog() != DialogResult.OK) return;
            ImportFile(openFileDialog1.FileName);
        }

        private void ImportFile(string FileName)
        {
            try
            {
                XlsFile xls = new XlsFile();
                xls.VirtualMode = true; //Remember to turn virtual mode on, or the event won't be called.

                //By default, FlexCel returns the formula text for the formulas, besides its calculated value.
                //If you are not interested in formula texts, you can gain a little performance by ignoring it.
                //This also works in non virtual mode.
                xls.IgnoreFormulaText = cbIgnoreFormulaText.Checked;

                CellData = new SparseCellArray();

                //Attach the CellReader handler.
                CellReader cr = new CellReader(cbFirst50Rows.Checked, CellData, cbFormatValues.Checked);
                xls.VirtualCellStartReading += new VirtualCellStartReadingEventHandler(cr.OnStartReading);
                xls.VirtualCellRead += new VirtualCellReadEventHandler(cr.OnCellRead);

                DateTime StartOpen = DateTime.Now;

                //Open the file. As we have a CellReader attached, the cells won't be loaded into memory, they will be passed to the CellReader
                xls.Open(FileName);
                DateTime StartSheetSelect = cr.StartSheetSelect;
                DateTime EndSheetSelect = cr.EndSheetSelect;

                DateTime EndOpen = DateTime.Now;
                statusBar.Text = "Time to open file: " + (StartSheetSelect - StartOpen).ToString() + "     Time to load file and fill grid: " + (EndOpen - EndSheetSelect).ToString();

                //Set up grid.
                GridCaption.Text = FileName;
                if (CellData != null)
                {
                    DisplayGrid.ColumnCount = CellData.ColCount;
                    DisplayGrid.RowCount = CellData.RowCount;
                }
                else
                {
                    DisplayGrid.ColumnCount = 0;
                    DisplayGrid.RowCount = 0;
                }

                for (int i = 0; i < DisplayGrid.ColumnCount; i++)
                {
                    DisplayGrid.Columns[i].Name = TCellAddress.EncodeColumn(i + 1);
                }
            }
            catch
            {
                GridCaption.Text = "Error Loading File";
                CellData = null;
                throw;
            }
        }

        private void DisplayGrid_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e)
        {
            //Show the row number in the grid at the left
            string r = (e.RowIndex + 1).ToString();
            SizeF textSize = e.Graphics.MeasureString(r, DisplayGrid.Font);
            if (DisplayGrid.RowHeadersWidth < (int)(textSize.Width + 20)) DisplayGrid.RowHeadersWidth = (int)(textSize.Width + 20);
            e.Graphics.DrawString(r, DisplayGrid.Font, SystemBrushes.ControlText, e.RowBounds.Left + DisplayGrid.RowHeadersWidth - textSize.Width - 5, e.RowBounds.Location.Y + ((e.RowBounds.Height - textSize.Height) / 2f));
        }

        private void DisplayGrid_CellValueNeeded(object sender, DataGridViewCellValueEventArgs e)
        {
            if (CellData == null)
            {
                e.Value = null;
                return;
            }

            if (e.RowIndex >= CellData.RowCount)
            {
                e.Value = null;
                return;
            }

            e.Value = CellData.GetValue(e.RowIndex + 1, e.ColumnIndex + 1);
        }
    }
}

Form1.Designer.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using FlexCel.Core;
using FlexCel.XlsAdapter;
namespace VirtualMode
{
    public partial class mainForm: System.Windows.Forms.Form
    {
        private System.Windows.Forms.OpenFileDialog openFileDialog1;
        private System.Windows.Forms.Panel panel2;
        private System.Windows.Forms.StatusBar statusBar;
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(mainForm));
            this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
            this.panel2 = new System.Windows.Forms.Panel();
            this.cbFormatValues = new System.Windows.Forms.CheckBox();
            this.cbIgnoreFormulaText = new System.Windows.Forms.CheckBox();
            this.cbFirst50Rows = new System.Windows.Forms.CheckBox();
            this.statusBar = new System.Windows.Forms.StatusBar();
            this.DisplayGrid = new System.Windows.Forms.DataGridView();
            this.GridCaptionPanel = new System.Windows.Forms.Panel();
            this.GridCaption = new System.Windows.Forms.Label();
            this.mainToolbar = new System.Windows.Forms.ToolStrip();
            this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
            this.btnOpenFile = new System.Windows.Forms.ToolStripButton();
            this.btnExit = new System.Windows.Forms.ToolStripButton();
            this.btnInfo = new System.Windows.Forms.ToolStripButton();
            this.panel2.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.DisplayGrid)).BeginInit();
            this.GridCaptionPanel.SuspendLayout();
            this.mainToolbar.SuspendLayout();
            this.SuspendLayout();
            //
            // openFileDialog1
            //
            this.openFileDialog1.DefaultExt = "xls";
            this.openFileDialog1.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm|Excel 97/2003|*.xls|Excel 2007|*.xlsx;*.xlsm|All " +
    "files|*.*";
            this.openFileDialog1.Title = "Open an Excel File";
            //
            // panel2
            //
            this.panel2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.panel2.Controls.Add(this.cbFormatValues);
            this.panel2.Controls.Add(this.cbIgnoreFormulaText);
            this.panel2.Controls.Add(this.cbFirst50Rows);
            this.panel2.Dock = System.Windows.Forms.DockStyle.Top;
            this.panel2.Location = new System.Drawing.Point(0, 38);
            this.panel2.Name = "panel2";
            this.panel2.Size = new System.Drawing.Size(880, 25);
            this.panel2.TabIndex = 4;
            //
            // cbFormatValues
            //
            this.cbFormatValues.AutoSize = true;
            this.cbFormatValues.Location = new System.Drawing.Point(269, 5);
            this.cbFormatValues.Name = "cbFormatValues";
            this.cbFormatValues.Size = new System.Drawing.Size(131, 17);
            this.cbFormatValues.TabIndex = 2;
            this.cbFormatValues.Text = "Format values (slower)";
            this.cbFormatValues.UseVisualStyleBackColor = true;
            //
            // cbIgnoreFormulaText
            //
            this.cbIgnoreFormulaText.AutoSize = true;
            this.cbIgnoreFormulaText.Checked = true;
            this.cbIgnoreFormulaText.CheckState = System.Windows.Forms.CheckState.Checked;
            this.cbIgnoreFormulaText.Location = new System.Drawing.Point(150, 5);
            this.cbIgnoreFormulaText.Name = "cbIgnoreFormulaText";
            this.cbIgnoreFormulaText.Size = new System.Drawing.Size(113, 17);
            this.cbIgnoreFormulaText.TabIndex = 1;
            this.cbIgnoreFormulaText.Text = "Ignore formula text";
            this.cbIgnoreFormulaText.UseVisualStyleBackColor = true;
            //
            // cbFirst50Rows
            //
            this.cbFirst50Rows.AutoSize = true;
            this.cbFirst50Rows.Checked = true;
            this.cbFirst50Rows.CheckState = System.Windows.Forms.CheckState.Checked;
            this.cbFirst50Rows.Location = new System.Drawing.Point(11, 5);
            this.cbFirst50Rows.Name = "cbFirst50Rows";
            this.cbFirst50Rows.Size = new System.Drawing.Size(133, 17);
            this.cbFirst50Rows.TabIndex = 0;
            this.cbFirst50Rows.Text = "Read only first 50 rows";
            this.cbFirst50Rows.UseVisualStyleBackColor = true;
            //
            // statusBar
            //
            this.statusBar.Location = new System.Drawing.Point(0, 439);
            this.statusBar.Name = "statusBar";
            this.statusBar.Size = new System.Drawing.Size(880, 22);
            this.statusBar.TabIndex = 7;
            //
            // DisplayGrid
            //
            this.DisplayGrid.AllowUserToAddRows = false;
            this.DisplayGrid.AllowUserToDeleteRows = false;
            dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
            dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Control;
            dataGridViewCellStyle1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.WindowText;
            dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight;
            dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
            dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
            this.DisplayGrid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1;
            this.DisplayGrid.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
            this.DisplayGrid.Dock = System.Windows.Forms.DockStyle.Fill;
            this.DisplayGrid.Location = new System.Drawing.Point(0, 86);
            this.DisplayGrid.Name = "DisplayGrid";
            this.DisplayGrid.ReadOnly = true;
            this.DisplayGrid.Size = new System.Drawing.Size(880, 353);
            this.DisplayGrid.TabIndex = 8;
            this.DisplayGrid.VirtualMode = true;
            this.DisplayGrid.CellValueNeeded += new System.Windows.Forms.DataGridViewCellValueEventHandler(this.DisplayGrid_CellValueNeeded);
            this.DisplayGrid.RowPostPaint += new System.Windows.Forms.DataGridViewRowPostPaintEventHandler(this.DisplayGrid_RowPostPaint);
            //
            // GridCaptionPanel
            //
            this.GridCaptionPanel.BackColor = System.Drawing.SystemColors.ActiveCaption;
            this.GridCaptionPanel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.GridCaptionPanel.Controls.Add(this.GridCaption);
            this.GridCaptionPanel.Dock = System.Windows.Forms.DockStyle.Top;
            this.GridCaptionPanel.ForeColor = System.Drawing.SystemColors.ActiveCaptionText;
            this.GridCaptionPanel.Location = new System.Drawing.Point(0, 63);
            this.GridCaptionPanel.Name = "GridCaptionPanel";
            this.GridCaptionPanel.Size = new System.Drawing.Size(880, 23);
            this.GridCaptionPanel.TabIndex = 9;
            //
            // GridCaption
            //
            this.GridCaption.AutoSize = true;
            this.GridCaption.Location = new System.Drawing.Point(13, 6);
            this.GridCaption.Name = "GridCaption";
            this.GridCaption.Size = new System.Drawing.Size(0, 13);
            this.GridCaption.TabIndex = 0;
            //
            // mainToolbar
            //
            this.mainToolbar.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.btnOpenFile,
            this.toolStripSeparator1,
            this.btnExit,
            this.btnInfo});
            this.mainToolbar.Location = new System.Drawing.Point(0, 0);
            this.mainToolbar.Name = "mainToolbar";
            this.mainToolbar.Size = new System.Drawing.Size(880, 38);
            this.mainToolbar.TabIndex = 10;
            this.mainToolbar.Text = "toolStrip1";
            //
            // toolStripSeparator1
            //
            this.toolStripSeparator1.Name = "toolStripSeparator1";
            this.toolStripSeparator1.Size = new System.Drawing.Size(6, 38);
            //
            // btnOpenFile
            //
            this.btnOpenFile.Image = ((System.Drawing.Image)(resources.GetObject("btnOpenFile.Image")));
            this.btnOpenFile.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.btnOpenFile.Name = "btnOpenFile";
            this.btnOpenFile.Size = new System.Drawing.Size(59, 35);
            this.btnOpenFile.Text = "Open file";
            this.btnOpenFile.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
            this.btnOpenFile.Click += new System.EventHandler(this.btnOpenFile_Click);
            //
            // btnExit
            //
            this.btnExit.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right;
            this.btnExit.Image = ((System.Drawing.Image)(resources.GetObject("btnExit.Image")));
            this.btnExit.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.btnExit.Name = "btnExit";
            this.btnExit.Size = new System.Drawing.Size(59, 35);
            this.btnExit.Text = "     E&xit     ";
            this.btnExit.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
            this.btnExit.Click += new System.EventHandler(this.btnExit_Click);
            //
            // btnInfo
            //
            this.btnInfo.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right;
            this.btnInfo.Image = ((System.Drawing.Image)(resources.GetObject("btnInfo.Image")));
            this.btnInfo.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.btnInfo.Name = "btnInfo";
            this.btnInfo.Size = new System.Drawing.Size(74, 35);
            this.btnInfo.Text = "Information";
            this.btnInfo.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
            this.btnInfo.Click += new System.EventHandler(this.btnInfo_Click);
            //
            // mainForm
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(880, 461);
            this.Controls.Add(this.DisplayGrid);
            this.Controls.Add(this.GridCaptionPanel);
            this.Controls.Add(this.panel2);
            this.Controls.Add(this.statusBar);
            this.Controls.Add(this.mainToolbar);
            this.Name = "mainForm";
            this.Text = "Virtual Mode Example - Cells are not stored in memory";
            this.panel2.ResumeLayout(false);
            this.panel2.PerformLayout();
            ((System.ComponentModel.ISupportInitialize)(this.DisplayGrid)).EndInit();
            this.GridCaptionPanel.ResumeLayout(false);
            this.GridCaptionPanel.PerformLayout();
            this.mainToolbar.ResumeLayout(false);
            this.mainToolbar.PerformLayout();
            this.ResumeLayout(false);
            this.PerformLayout();

        }
        #endregion

        private DataGridView DisplayGrid;
        private Panel GridCaptionPanel;
        private Label GridCaption;
        private ToolStrip mainToolbar;
        private ToolStripButton btnOpenFile;
        private ToolStripSeparator toolStripSeparator1;
        private ToolStripButton btnInfo;
        private ToolStripButton btnExit;
        private CheckBox cbFirst50Rows;
        private CheckBox cbIgnoreFormulaText;
        private CheckBox cbFormatValues;
    }
}

Program.cs

using System;
using System.Windows.Forms;

namespace VirtualMode
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new mainForm());
        }
    }
}

SheetSelectorForm.cs

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace VirtualMode
{
    public partial class SheetSelectorForm: Form
    {
        public SheetSelectorForm()
        {
            InitializeComponent();
        }

        public SheetSelectorForm(string[] SheetNames)
            : this()
        {
            foreach (string s in SheetNames)
            {
                SheetList.Items.Add(s);
            }

            SheetList.SelectedIndex = 0;
        }

        internal bool Execute()
        {
            return ShowDialog() == DialogResult.OK;
        }

        public string SelectedSheet
        {
            get
            {
                return Convert.ToString(SheetList.SelectedItem);
            }
        }

        public int SelectedSheetIndex
        {
            get
            {
                return SheetList.SelectedIndex;
            }
        }

        private void SheetList_DoubleClick(object sender, EventArgs e)
        {
            DialogResult = DialogResult.OK;
        }
    }
}

SheetSelectorForm.Designer.cs

namespace VirtualMode
{
    partial class SheetSelectorForm
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.panel1 = new System.Windows.Forms.Panel();
            this.btnOk = new System.Windows.Forms.Button();
            this.btnCancel = new System.Windows.Forms.Button();
            this.SheetList = new System.Windows.Forms.ListBox();
            this.panel1.SuspendLayout();
            this.SuspendLayout();
            //
            // panel1
            //
            this.panel1.Controls.Add(this.btnCancel);
            this.panel1.Controls.Add(this.btnOk);
            this.panel1.Dock = System.Windows.Forms.DockStyle.Bottom;
            this.panel1.Location = new System.Drawing.Point(0, 217);
            this.panel1.Name = "panel1";
            this.panel1.Size = new System.Drawing.Size(284, 45);
            this.panel1.TabIndex = 0;
            //
            // btnOk
            //
            this.btnOk.DialogResult = System.Windows.Forms.DialogResult.OK;
            this.btnOk.Location = new System.Drawing.Point(116, 10);
            this.btnOk.Name = "btnOk";
            this.btnOk.Size = new System.Drawing.Size(75, 23);
            this.btnOk.TabIndex = 0;
            this.btnOk.Text = "Ok";
            this.btnOk.UseVisualStyleBackColor = true;
            //
            // btnCancel
            //
            this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            this.btnCancel.Location = new System.Drawing.Point(197, 10);
            this.btnCancel.Name = "btnCancel";
            this.btnCancel.Size = new System.Drawing.Size(75, 23);
            this.btnCancel.TabIndex = 1;
            this.btnCancel.Text = "Cancel";
            this.btnCancel.UseVisualStyleBackColor = true;
            //
            // SheetList
            //
            this.SheetList.Dock = System.Windows.Forms.DockStyle.Fill;
            this.SheetList.FormattingEnabled = true;
            this.SheetList.Location = new System.Drawing.Point(0, 0);
            this.SheetList.Name = "SheetList";
            this.SheetList.Size = new System.Drawing.Size(284, 217);
            this.SheetList.TabIndex = 1;
            this.SheetList.DoubleClick += new System.EventHandler(this.SheetList_DoubleClick);
            //
            // SheetSelectorForm
            //
            this.AcceptButton = this.btnOk;
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.CancelButton = this.btnCancel;
            this.ClientSize = new System.Drawing.Size(284, 262);
            this.Controls.Add(this.SheetList);
            this.Controls.Add(this.panel1);
            this.Name = "SheetSelectorForm";
            this.Text = "Select sheet to load...";
            this.panel1.ResumeLayout(false);
            this.ResumeLayout(false);

        }

        #endregion

        private System.Windows.Forms.Panel panel1;
        private System.Windows.Forms.Button btnCancel;
        private System.Windows.Forms.Button btnOk;
        private System.Windows.Forms.ListBox SheetList;
    }
}

SparseCellArray.cs

using System;
using System.Collections.Generic;
using System.Text;

namespace VirtualMode
{
    ///    <summary>
    ///      This is a simple class that holds cell values. Items are supposed to
    ///      be entered in sorted order, and it isn't really production-ready, just
    ///      to be used in a demo.
    ///    </summary>
    class SparseCellArray
    {
        List<SparseRow> Data;
        int FColCount;

        public SparseCellArray()
        {
            FColCount = 0;
        }
        public void AddValue(int Row, int Col, string Value)
        {
            if (Col > FColCount) FColCount = Col;
            if (Data == null) Data = new List<SparseRow>();
            SparseRow SpRow = new SparseRow(Row);
            int Idx = Data.BinarySearch(SpRow);
            if (Idx < 0)
            {
                SpRow.CreateData();
                Data.Insert(~Idx, SpRow);
            }
            else SpRow = Data[Idx];

            SparseCell SpCell = new SparseCell(Col, Value);
            Idx = SpRow.Data.BinarySearch(SpCell);
            if (Idx < 0)
            {
                SpRow.Data.Insert(~Idx, SpCell);
            }
            else
            {
                SpRow.Data[Idx] = SpCell;
            }

        }

        public string GetValue(int Row, int Col)
        {
            if (Data == null) return null;

            SparseRow SpRow = new SparseRow(Row);
            int Idx = Data.BinarySearch(SpRow);
            if (Idx < 0) return null;
            SpRow = Data[Idx];
            SparseCell SpCell = new SparseCell(Col, null);
            Idx = SpRow.Data.BinarySearch(SpCell);
            if (Idx < 0) return null;
            return SpRow.Data[Idx].Value;
        }

        public int ColCount { get { return FColCount; } }
        public int RowCount
        {
            get
            {
                if (Data == null || Data.Count == 0) return 0;
                return Data[Data.Count - 1].Row;
            }
        }
    }

    struct SparseRow: IComparable<SparseRow>
    {
        public int Row;
        public List<SparseCell> Data;

        public SparseRow(int aRow)
        {
            Row = aRow;
            Data = null;
        }

        public void CreateData()
        {
            Data = new List<SparseCell>();
        }

        #region IComparable<SparseRow> Members

        public int CompareTo(SparseRow other)
        {
            return Row.CompareTo(other.Row);
        }

        #endregion
    }

    class SparseCell: IComparable<SparseCell>

    {
        public int Col;
        public string Value;

        public SparseCell(int aCol, string aValue)
        {
            Col = aCol;
            Value = aValue;
        }

        #region IComparable<SparseCell> Members

        public int CompareTo(SparseCell other)
        {
            return Col.CompareTo(other.Col);
        }

        #endregion
    }
}


Reading and writing encrypted files (C# / netframework) | FlexCel Studio for the .NET Framework documentation

Reading and writing encrypted files (C# / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\csharp\VS2022\netframework\10.API\25.Encrypted Files and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​csharp/​VS2022/​netframework/​Modules/​10.​API/​25.​Encrypted Files

Overview

How to read and write Encrypted Excel files using FlexCel.

Concepts

  • Concepts on this demo are similar to the ones shown in Encryption And Subtotals example, but are repeated here so you can see them even if you are not using reports.

  • There are 4 ways to protect data in Excel:

    1. A password to open. This is the only way that will actually encrypt the file. All other methods just will add a record telling Excel not to modify the file. On Excel, this option is on ->Tools->Options... Security tab.

    2. A password to modify. Also on ->Tools->Options->Security tab, this password will allow you to open the file, but not to save it. The file will not be encrypted, and you can always use Save As to save the file.

    3. Protecting the workbook. This will cause a pseudo-encryption of the file, but the password used to encrypt will be always the same, no matter what password you enter. On Excel, this option is at ->Tools->Protection->Protect Workbook.

    4. Protecting the sheet. This option will protect the cells, objects, etc on a particular sheet. ->Tools->Protection->Protect Sheet.

  • When the file is encrypted (using a password to open) FlexCel supports four different encryption modes: Excel 95, Standard Excel97/2000 encryption, Excel 2007 xlsx encryption and Excel 2010 "agile" xlsx encryption.

  • To open an encrypted file, you can set the OpenPassword property or the OnPassword event. Use the OnPassword event when you want to interactively ask for a password if the file is encrypted.

Files

AssemblyInfo.cs

using System.Reflection;
using System.Runtime.CompilerServices;

//
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
//
[assembly: AssemblyTitle("")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("(c) 2002 - 2024 TMS Software")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

//
// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version
//      Build Number
//      Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:

[assembly: AssemblyVersion("7.21.0.0")]

//
// In order to sign your assembly you must specify a key to use. Refer to the
// Microsoft .NET Framework documentation for more information on assembly signing.
//
// Use the attributes below to control which key is used for signing.
//
// Notes:
//   (*) If no key is specified, the assembly is not signed.
//   (*) KeyName refers to a key that has been installed in the Crypto Service
//       Provider (CSP) on your machine. KeyFile refers to a file which contains
//       a key.
//   (*) If the KeyFile and the KeyName values are both specified, the
//       following processing occurs:
//       (1) If the KeyName can be found in the CSP, that key is used.
//       (2) If the KeyName does not exist and the KeyFile does exist, the key
//           in the KeyFile is installed into the CSP and used.
//   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
//       When specifying the KeyFile, the location of the KeyFile should be
//       relative to the project output directory which is
//       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
//       located in the project directory, you would specify the AssemblyKeyFile
//       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
//   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
//       documentation for more information on this.
//
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]
[assembly: AssemblyKeyName("")]

Form1.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using System.Diagnostics;
using System.Reflection;

using FlexCel.Core;
using FlexCel.XlsAdapter;

namespace EncryptedFiles
{
    /// <summary>
    /// Shows how to deal with Encrypted files.
    /// </summary>
    public partial class mainForm: System.Windows.Forms.Form
    {

        public mainForm()
        {
            InitializeComponent();
        }

        private void btnExit_Click(object sender, System.EventArgs e)
        {
            Close();
        }

        //The event that will actually provide the password to open the empty form.
        private void GetPassword(OnPasswordEventArgs e)
        {
            PasswordDialog Pwd = new PasswordDialog();
            e.Password = string.Empty;
            if (Pwd.ShowDialog() != DialogResult.OK) return;
            e.Password = Pwd.Password;
        }

        private void btnGo_Click(object sender, System.EventArgs e)
        {
            // On this demo we will fill data on an existing file with the api, starting with an encrypted file holding the starting formats.

            // Declare some data for the chart.
            string[] Names = { "Dog", "Cat", "Cow", "Horse", "Fish" };
            int[] Quantities = { 123, 200, 150, 0, 180 };

            // Use two folders up to where the exe is to store the data. (Exe is stored at bin\debug)
            string DataPath = Path.Combine(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), ".."), "..") + Path.DirectorySeparatorChar;

            XlsFile xls = new XlsFile(true);

            // We will use the OnPassword event here to show how to
            // open a file if you don't know a priory if it is encrypted or not.
            // If you already knew the file was encrypted, (as in this case)you could use:
            // xls.Protection.OpenPassword = "42";

            xls.Protection.OnPassword += new OnPasswordEventHandler(GetPassword);
            xls.Open(Path.Combine(DataPath, "EmptyForm.xls"));

            // Insert rows so the chart range grows. On this case we assume the data is at least 2 rows long. If not, we should handle
            // the case and do a xls.DeleteRange.
            xls.InsertAndCopyRange(new TXlsCellRange(1, 1, 1, 2), 5, 1, Names.Length - 2, TFlxInsertMode.ShiftRangeDown, TRangeCopyMode.None);

            // Fill the data.
            for (int i = 0; i < Names.Length; i++)
            {
                xls.SetCellValue(4 + i, 1, Names[i]);
                xls.SetCellValue(4 + i, 2, Quantities[i]);
            }

            // Set a new password for opening.
            xls.Protection.OpenPassword = "43";
            xls.Protection.SetModifyPassword("43", false, "Ford Prefect");

            if (saveFileDialog1.ShowDialog() == DialogResult.OK)
            {
                xls.Save(saveFileDialog1.FileName);

                if (MessageBox.Show("Do you want to open the generated file? (Remember password is 43)", "Confirm", MessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    using (Process p = new Process())
                    {
                        p.StartInfo.FileName = saveFileDialog1.FileName;
                        p.StartInfo.UseShellExecute = true;
                        p.Start();
                    }
                }
            }
        }

    }
}

Form1.Designer.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using System.Diagnostics;
using System.Reflection;
using FlexCel.Core;
using FlexCel.XlsAdapter;
namespace EncryptedFiles
{
    public partial class mainForm: System.Windows.Forms.Form
    {
        private System.Windows.Forms.Panel panel2;
        private System.Windows.Forms.Button btnExit;
        private System.Windows.Forms.Button btnGo;
        private System.Windows.Forms.SaveFileDialog saveFileDialog1;
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.panel2 = new System.Windows.Forms.Panel();
            this.btnExit = new System.Windows.Forms.Button();
            this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog();
            this.btnGo = new System.Windows.Forms.Button();
            this.panel2.SuspendLayout();
            this.SuspendLayout();
            //
            // panel2
            //
            this.panel2.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
            this.panel2.Controls.Add(this.btnExit);
            this.panel2.Dock = System.Windows.Forms.DockStyle.Top;
            this.panel2.Location = new System.Drawing.Point(0, 0);
            this.panel2.Name = "panel2";
            this.panel2.Size = new System.Drawing.Size(336, 35);
            this.panel2.TabIndex = 4;
            //
            // btnExit
            //
            this.btnExit.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.btnExit.BackColor = System.Drawing.SystemColors.Control;
            this.btnExit.Image = global::EncryptedFiles.Properties.Resources._4close;
            this.btnExit.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
            this.btnExit.Location = new System.Drawing.Point(272, 2);
            this.btnExit.Name = "btnExit";
            this.btnExit.Size = new System.Drawing.Size(56, 26);
            this.btnExit.TabIndex = 2;
            this.btnExit.Text = "Exit";
            this.btnExit.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            this.btnExit.UseVisualStyleBackColor = false;
            this.btnExit.Click += new System.EventHandler(this.btnExit_Click);
            //
            // saveFileDialog1
            //
            this.saveFileDialog1.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm|Excel 97/2003|*.xls|Excel 2007|*.xlsx;*.xlsm|All " +
    "files|*.*";
            this.saveFileDialog1.RestoreDirectory = true;
            //
            // btnGo
            //
            this.btnGo.BackColor = System.Drawing.SystemColors.Control;
            this.btnGo.Image = global::EncryptedFiles.Properties.Resources._4gears;
            this.btnGo.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
            this.btnGo.Location = new System.Drawing.Point(96, 72);
            this.btnGo.Name = "btnGo";
            this.btnGo.Size = new System.Drawing.Size(152, 30);
            this.btnGo.TabIndex = 5;
            this.btnGo.Text = "Create Encrypted File";
            this.btnGo.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            this.btnGo.UseVisualStyleBackColor = false;
            this.btnGo.Click += new System.EventHandler(this.btnGo_Click);
            //
            // mainForm
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(336, 122);
            this.Controls.Add(this.btnGo);
            this.Controls.Add(this.panel2);
            this.Name = "mainForm";
            this.Text = "Encrypted Excel Files";
            this.panel2.ResumeLayout(false);
            this.ResumeLayout(false);

        }
        #endregion
    }
}

PasswordDialog.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;

namespace EncryptedFiles
{
    /// <summary>
    /// Summary description for PasswordDialog.
    /// </summary>
    public partial class PasswordDialog: System.Windows.Forms.Form
    {

        public PasswordDialog()
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            //
            // TODO: Add any constructor code after InitializeComponent call
            //
        }

        public string Password
        {
            get
            {
                return PasswordEdit.Text;
            }
        }
    }
}

PasswordDialog.Designer.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
namespace EncryptedFiles
{
    public partial class PasswordDialog: System.Windows.Forms.Form
    {
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.Label label2;
        private System.Windows.Forms.TextBox PasswordEdit;
        private System.Windows.Forms.Label label3;
        private System.Windows.Forms.Button btnOk;
        public System.Windows.Forms.Button btnCancel;
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.Container components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.label1 = new System.Windows.Forms.Label();
            this.label2 = new System.Windows.Forms.Label();
            this.PasswordEdit = new System.Windows.Forms.TextBox();
            this.label3 = new System.Windows.Forms.Label();
            this.btnOk = new System.Windows.Forms.Button();
            this.btnCancel = new System.Windows.Forms.Button();
            this.SuspendLayout();
            //
            // label1
            //
            this.label1.Location = new System.Drawing.Point(16, 8);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(280, 23);
            this.label1.TabIndex = 0;
            this.label1.Text = "Please enter the password to open the template.";
            //
            // label2
            //
            this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
            this.label2.Location = new System.Drawing.Point(16, 32);
            this.label2.Name = "label2";
            this.label2.Size = new System.Drawing.Size(176, 23);
            this.label2.TabIndex = 1;
            this.label2.Text = "HINT: The password is 42";
            //
            // PasswordEdit
            //
            this.PasswordEdit.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
                | System.Windows.Forms.AnchorStyles.Right)));
            this.PasswordEdit.Location = new System.Drawing.Point(128, 64);
            this.PasswordEdit.Name = "PasswordEdit";
            this.PasswordEdit.PasswordChar = '*';
            this.PasswordEdit.Size = new System.Drawing.Size(360, 20);
            this.PasswordEdit.TabIndex = 0;
            this.PasswordEdit.Text = "";
            //
            // label3
            //
            this.label3.Location = new System.Drawing.Point(56, 64);
            this.label3.Name = "label3";
            this.label3.Size = new System.Drawing.Size(64, 23);
            this.label3.TabIndex = 3;
            this.label3.Text = "Password:";
            //
            // btnOk
            //
            this.btnOk.DialogResult = System.Windows.Forms.DialogResult.OK;
            this.btnOk.Location = new System.Drawing.Point(128, 112);
            this.btnOk.Name = "btnOk";
            this.btnOk.TabIndex = 1;
            this.btnOk.Text = "Ok";
            //
            // btnCancel
            //
            this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            this.btnCancel.Location = new System.Drawing.Point(216, 112);
            this.btnCancel.Name = "btnCancel";
            this.btnCancel.TabIndex = 2;
            this.btnCancel.Text = "Cancel";
            //
            // PasswordDialog
            //
            this.AcceptButton = this.btnOk;
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(520, 154);
            this.Controls.Add(this.btnCancel);
            this.Controls.Add(this.btnOk);
            this.Controls.Add(this.label3);
            this.Controls.Add(this.PasswordEdit);
            this.Controls.Add(this.label2);
            this.Controls.Add(this.label1);
            this.Name = "PasswordDialog";
            this.ShowInTaskbar = false;
            this.Text = "Information";
            this.ResumeLayout(false);

        }
        #endregion
    }
}

Program.cs

using System;
using System.Windows.Forms;

namespace EncryptedFiles
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new mainForm());
        }
    }
}


FlexCel image explorer (C# / netframework) | FlexCel Studio for the .NET Framework documentation

FlexCel image explorer (C# / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\csharp\VS2022\netframework\10.API\30.FlexCelImageExplorer and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​csharp/​VS2022/​netframework/​Modules/​10.​API/​30.​FlexCel​Image​Explorer

Overview

This is an application that will show all the images in an Excel file, to show their real size and bit depth. It will also allow you to extract those images to files. Note that the first time you open a file it can take some time, as it opens ALL the xls files on the folder and extracts all the image information so it can highlight files with problems.

Concepts

  • How to use the API to read the images on a file.

  • How to convert the images to 256 colors or black and white using GDI+

  • On the left pane, files in red are files that have a cropped image. (that is, the image stored is larger than the image shown on Excel). Having this cropped image only consumes disk space, and makes rendering to pdf slower, as the image has to be decoded, cropped to the real size and encoded again.

  • Bold entries on the left pane are images with true color and transparency. Those images can get very big quite fast, so it is better if you can convert them to indexed color. Also, file with true color and transparency have to be re-encoded when exporting to pdf, making the process slower.

Files

AssemblyInfo.cs

using System.Reflection;
using System.Runtime.CompilerServices;

//
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
//
[assembly: AssemblyTitle("")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("(c) 2002 - 2024 TMS Software")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

//
// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version
//      Build Number
//      Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:

[assembly: AssemblyVersion("7.21.0.0")]

//
// In order to sign your assembly you must specify a key to use. Refer to the
// Microsoft .NET Framework documentation for more information on assembly signing.
//
// Use the attributes below to control which key is used for signing.
//
// Notes:
//   (*) If no key is specified, the assembly is not signed.
//   (*) KeyName refers to a key that has been installed in the Crypto Service
//       Provider (CSP) on your machine. KeyFile refers to a file which contains
//       a key.
//   (*) If the KeyFile and the KeyName values are both specified, the
//       following processing occurs:
//       (1) If the KeyName can be found in the CSP, that key is used.
//       (2) If the KeyName does not exist and the KeyFile does exist, the key
//           in the KeyFile is installed into the CSP and used.
//   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
//       When specifying the KeyFile, the location of the KeyFile should be
//       relative to the project output directory which is
//       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
//       located in the project directory, you would specify the AssemblyKeyFile
//       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
//   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
//       documentation for more information on this.
//
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]
[assembly: AssemblyKeyName("")]

MainForm.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;

using FlexCel.Core;
using FlexCel.XlsAdapter;
using System.Diagnostics;

namespace FlexCelImageExplorer
{
    /// <summary>
    /// Image Explorer.
    /// </summary>
    public partial class mainForm: System.Windows.Forms.Form
    {

        public mainForm()
        {
            InitializeComponent();
            GetCurrencyManager.CurrentChanged += new EventHandler(CurrentRowChanged);
            ResizeToolbar(mainToolbar);
        }

        private void ResizeToolbar(ToolStrip toolbar)
        {

            using (Graphics gr = CreateGraphics())
            {
                double xFactor = gr.DpiX / 96.0;
                double yFactor = gr.DpiY / 96.0;
                toolbar.ImageScalingSize = new Size((int)(24 * xFactor), (int)(24 * yFactor));
                toolbar.Width = 0; //force a recalc of the buttons.
            }
        }

        private string CurrentFilename = null;
        private TCompressForm CompressForm;

        private CurrencyManager GetCurrencyManager
        {
            get
            {
                return (CurrencyManager)this.BindingContext[dataGrid.DataSource, dataGrid.DataMember];
            }
        }

        private int GetImagePos
        {
            get
            {
                return GetCurrencyManager.Position;
            }
        }

        private void btnExit_Click(object sender, System.EventArgs e)
        {
            Close();
        }

        private void btnOpenFile_Click(object sender, System.EventArgs e)
        {
            if (openFileDialog1.ShowDialog() != DialogResult.OK) return;
            OpenFile(openFileDialog1.FileName);
            if (cbScanFolder.Checked) FillListBox();
        }

        private bool GetHasCrop(TImageProperties ImgProps)
        {
            return ImgProps.CropArea.CropFromLeft != 0 ||
                ImgProps.CropArea.CropFromRight != 0 ||
                ImgProps.CropArea.CropFromTop != 0 ||
                ImgProps.CropArea.CropFromBottom != 0;
        }

        private void FillListBox()
        {
            lblFolder.Text = "Files on folder: " + Path.GetDirectoryName(openFileDialog1.FileName);
            DirectoryInfo di = new DirectoryInfo(Path.GetDirectoryName(openFileDialog1.FileName));
            FileInfo[] Fi = di.GetFiles("*.xls");
            FilesListBox.Items.Clear();

            TImageInfo[] Files = new TImageInfo[Fi.Length];

            for (int k = 0; k < Fi.Length; k++)
            {
                FileInfo f = Fi[k];
                bool HasCrop = false;
                bool HasARGB = false;
                XlsFile x1 = new XlsFile();

                bool HasImages = false;

                try
                {
                    x1.Open(f.FullName);
                    for (int sheet = 1; sheet <= x1.SheetCount; sheet++)
                    {
                        x1.ActiveSheet = sheet;
                        for (int i = x1.ImageCount; i > 0; i--)
                        {
                            HasImages = true;
                            TImageProperties ip = x1.GetImageProperties(i);
                            if (!HasCrop) HasCrop = GetHasCrop(ip);

                            TXlsImgType imgType = TXlsImgType.Unknown;
                            using (MemoryStream ms = new MemoryStream())
                            {
                                x1.GetImage(i, ref imgType, ms);
                                FlexCel.Pdf.TPngInformation PngInfo = FlexCel.Pdf.TPdfPng.GetPngInfo(ms);
                                if (PngInfo != null)
                                {
                                    HasARGB = PngInfo.ColorType == 6;
                                }
                            }

                        }
                    }
                }
                catch (Exception)
                {
                    Files[k] = new TImageInfo(f, false, false, false, false);
                    continue;
                }

                Files[k] = new TImageInfo(f, true, HasCrop, HasImages, HasARGB);
            }

            FilesListBox.Items.AddRange(Files);
        }

        private void OpenFile(string FileName)
        {
            ImageDataTable.Rows.Clear();

            try
            {
                XlsFile Xls = new XlsFile(true);
                CurrentFilename = FileName;
                Xls.Open(FileName);

                for (int sheet = 1; sheet <= Xls.SheetCount; sheet++)
                {
                    Xls.ActiveSheet = sheet;
                    for (int i = Xls.ImageCount; i > 0; i--)
                    {
                        TXlsImgType ImageType = TXlsImgType.Unknown;
                        byte[] ImgBytes = Xls.GetImage(i, ref ImageType);
                        TImageProperties ImgProps = Xls.GetImageProperties(i);
                        object[] ImgData = new object[ImageDataTable.Columns.Count];
                        ImgData[0] = Xls.SheetName;
                        ImgData[1] = i;
                        ImgData[4] = ImageType.ToString();
                        ImgData[7] = Xls.GetImageName(i);
                        ImgData[8] = ImgBytes;
                        ImgData[9] = GetHasCrop(ImgProps);

                        using (MemoryStream ms = new MemoryStream(ImgBytes))
                        {
                            FlexCel.Pdf.TPngInformation PngInfo = FlexCel.Pdf.TPdfPng.GetPngInfo(ms);
                            if (PngInfo != null)
                            {
                                ImgData[2] = PngInfo.Width;
                                ImgData[3] = PngInfo.Height;
                                string s = String.Empty;
                                int bpp = 0;

                                if ((PngInfo.ColorType & 4) != 0)
                                {
                                    s += "ALPHA-";
                                    bpp = 1;
                                }
                                if ((PngInfo.ColorType & 2) == 0)
                                {
                                    s += "Grayscale -" + (1 << PngInfo.BitDepth).ToString() + " shades. ";
                                    bpp = 1;
                                }
                                else
                                {
                                    if ((PngInfo.ColorType & 1) == 0)
                                    {
                                        bpp += 3;
                                        s += "RGB - " + (PngInfo.BitDepth * (bpp)).ToString() + "bpp.  ";
                                    }
                                    else
                                    {
                                        s += "Indexed - " + (1 << PngInfo.BitDepth).ToString() + " colors. ";
                                        bpp = 1;
                                    }
                                }

                                ImgData[5] = s;

                                ImgData[6] = (Math.Round(PngInfo.Width * PngInfo.Height * PngInfo.BitDepth * bpp / 8f / 1024f)).ToString() + " kb.";
                            }
                            else
                            {
                                ms.Position = 0;
                                try
                                {
                                    using (Image Img = Image.FromStream(ms))
                                    {
                                        Bitmap Bmp = Img as Bitmap;
                                        if (Bmp != null)
                                        {
                                            ImgData[5] = Bmp.PixelFormat.ToString() + "bpp";
                                        }
                                        ImgData[2] = Img.Width;
                                        ImgData[3] = Img.Height;
                                    }
                                }
                                catch (Exception)
                                {
                                    ImgData[2] = -1;
                                    ImgData[3] = -1;
                                    ImgData[5] = null;
                                    ImgData[8] = null;

                                }
                            }
                        }

                        ImageDataTable.Rows.Add(ImgData);
                    }
                }

            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error");
                dataGrid.CaptionText = "No file selected";
                CurrentFilename = null;
                return;
            }
            dataGrid.CaptionText = "Selected file: " + FileName;
            CurrentRowChanged(GetCurrencyManager, null);
        }

        private void FilesListBox_SelectedIndexChanged(object sender, System.EventArgs e)
        {
            TImageInfo ImageInfo = (TImageInfo)FilesListBox.SelectedItem;
            if (ImageInfo == null) return;
            OpenFile(ImageInfo.File.FullName);
        }

        public void CurrentRowChanged(object sender, System.EventArgs e)
        {
            int Pos = ((BindingManagerBase)sender).Position;
            if (Pos < 0)
            {
                PreviewBox.Image = null;
                return;
            }

            DataRowCollection r = dataSet1.Tables["ImageDataTable"].Rows;
            if (Pos < 0 || Pos >= r.Count)
            {
                PreviewBox.Image = null;
            }
            else
            {
                byte[] ImgData = r[Pos].ItemArray[8] as byte[];
                if (ImgData == null)
                {
                    PreviewBox.Image = null;
                }
                else
                {
                    using (MemoryStream ms = new MemoryStream(ImgData))
                    {
                        PreviewBox.Image = Image.FromStream(ms);
                    }
                }
            }
        }

        private void btnOpen_Click(object sender, System.EventArgs e)
        {
            if (CurrentFilename == null)
            {
                MessageBox.Show("There is no open file");
                return;
            }
            using (Process p = new Process())
            {
                p.StartInfo.FileName = CurrentFilename;
                p.StartInfo.UseShellExecute = true;
                p.Start();
            }
        }

        private void btnConvert_Click(object sender, System.EventArgs e)
        {
            //This is not yet implemented...
            int Pos = GetImagePos;
            if (Pos < 0)
            {
                MessageBox.Show("There is no selected image", "Error");
                return;
            }
            if (CompressForm == null) CompressForm = new TCompressForm();
            CompressForm.ImageToUse = (byte[])dataSet1.Tables["ImageDataTable"].Rows[Pos].ItemArray[8];
            CompressForm.XlsFilename = CurrentFilename;
            CompressForm.ShowDialog();
        }

        private void FilesListBox_DrawItem(object sender, System.Windows.Forms.DrawItemEventArgs e)
        {
            if (e.Index < 0) return;
            e.DrawBackground();
            Brush myBrush = Brushes.Black;

            TImageInfo ImageInfo = (TImageInfo)((ListBox)sender).Items[e.Index];
            if (!ImageInfo.HasImages)
            {
                myBrush = Brushes.Silver;
            }
            if (ImageInfo.HasCrop)
            {
                myBrush = Brushes.Red;
            }

            FontStyle NewStyle;
            if (ImageInfo.HasARGB) NewStyle = FontStyle.Bold; else NewStyle = FontStyle.Regular;
            using (Font MyFont = new Font(e.Font, NewStyle))
            {
                e.Graphics.DrawString(ImageInfo.ToString(),
                    MyFont, myBrush, e.Bounds, StringFormat.GenericDefault);
            }
            e.DrawFocusRectangle();
        }

        private void btnSaveImage_Click(object sender, System.EventArgs e)
        {
            int Pos = GetImagePos;
            if (Pos < 0)
            {
                MessageBox.Show("There is no selected image to save", "Error");
                return;
            }

            string ext = dataSet1.Tables["ImageDataTable"].Rows[Pos].ItemArray[4].ToString().ToLower();
            saveImageDialog.DefaultExt = ext;
            saveImageDialog.Filter = ext + " Images|*." + ext;
            if (saveImageDialog.ShowDialog() != DialogResult.OK) return;
            byte[] ImgData = (byte[])dataSet1.Tables["ImageDataTable"].Rows[Pos].ItemArray[8];
            using (FileStream fs = new FileStream(saveImageDialog.FileName, FileMode.Create))
            {
                fs.Write(ImgData, 0, ImgData.Length);
            }

        }

        private void btnInfo_Click(object sender, System.EventArgs e)
        {
            MessageBox.Show("FlexCelImageExplorer is a small application targeted to reduce the size on images inside Excel files.\n" +
                "On the current version you can see the image properties and extract the images to disk.");

        }

        private void btnStretchPreview_Click(object sender, EventArgs e)
        {
            if (btnStretchPreview.Checked)
                PreviewBox.SizeMode = PictureBoxSizeMode.StretchImage;
            else
                PreviewBox.SizeMode = PictureBoxSizeMode.Normal;
        }

    }

    class TImageInfo
    {
        internal FileInfo File;
        internal bool IsValidFile;
        internal bool HasCrop;
        internal bool HasImages;
        internal bool HasARGB;

        public TImageInfo(FileInfo aFile, bool aIsValidFile, bool aHasCrop, bool aHasImages, bool aHasARGB)
        {
            File = aFile;
            HasCrop = aHasCrop;
            HasImages = aHasImages;
            IsValidFile = aIsValidFile;
            HasARGB = aHasARGB;
        }

        public override string ToString()
        {
            if (!IsValidFile)
                return " (*)" + File.ToString();
            return File.ToString();
        }

    }
}

MainForm.Designer.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using FlexCel.Core;
using FlexCel.XlsAdapter;
namespace FlexCelImageExplorer
{
    public partial class mainForm: System.Windows.Forms.Form
    {
        private System.Windows.Forms.OpenFileDialog openFileDialog1;
        private System.Windows.Forms.Panel panel1;
        private System.Windows.Forms.Splitter splitter1;
        private System.Windows.Forms.Panel panel3;
        private System.Windows.Forms.ListBox FilesListBox;
        private System.Windows.Forms.Label lblFolder;
        private System.Windows.Forms.DataGrid dataGrid;
        private System.Data.DataSet dataSet1;
        private System.Data.DataTable ImageDataTable;
        private System.Data.DataColumn Index;
        private System.Data.DataColumn Cell1;
        private System.Data.DataColumn Cell2;
        private System.Data.DataColumn cType;
        private System.Data.DataColumn cText;
        private System.Data.DataColumn Description;
        private System.Data.DataColumn dataColumn1;
        private System.Windows.Forms.Panel panel4;
        private System.Windows.Forms.Splitter splitter2;
        private System.Data.DataColumn dataColumn2;
        private System.Windows.Forms.PictureBox PreviewBox;
        private System.Data.DataColumn dataColumn3;
        private System.Windows.Forms.SaveFileDialog saveImageDialog;
        private System.Data.DataColumn dataColumn4;
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(mainForm));
            this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
            this.panel1 = new System.Windows.Forms.Panel();
            this.FilesListBox = new System.Windows.Forms.ListBox();
            this.panel3 = new System.Windows.Forms.Panel();
            this.lblFolder = new System.Windows.Forms.Label();
            this.splitter1 = new System.Windows.Forms.Splitter();
            this.dataGrid = new System.Windows.Forms.DataGrid();
            this.ImageDataTable = new System.Data.DataTable();
            this.dataColumn4 = new System.Data.DataColumn();
            this.Index = new System.Data.DataColumn();
            this.Cell1 = new System.Data.DataColumn();
            this.Cell2 = new System.Data.DataColumn();
            this.cType = new System.Data.DataColumn();
            this.cText = new System.Data.DataColumn();
            this.Description = new System.Data.DataColumn();
            this.dataColumn1 = new System.Data.DataColumn();
            this.dataColumn2 = new System.Data.DataColumn();
            this.dataColumn3 = new System.Data.DataColumn();
            this.dataSet1 = new System.Data.DataSet();
            this.panel4 = new System.Windows.Forms.Panel();
            this.PreviewBox = new System.Windows.Forms.PictureBox();
            this.splitter2 = new System.Windows.Forms.Splitter();
            this.saveImageDialog = new System.Windows.Forms.SaveFileDialog();
            this.mainToolbar = new System.Windows.Forms.ToolStrip();
            this.cbScanFolder = new System.Windows.Forms.ToolStripButton();
            this.btnOpenFile = new System.Windows.Forms.ToolStripButton();
            this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
            this.btnShowInExcel = new System.Windows.Forms.ToolStripButton();
            this.btnSaveAsImage = new System.Windows.Forms.ToolStripButton();
            this.btnExit = new System.Windows.Forms.ToolStripButton();
            this.btnInfo = new System.Windows.Forms.ToolStripButton();
            this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
            this.btnStretchPreview = new System.Windows.Forms.ToolStripButton();
            this.panel1.SuspendLayout();
            this.panel3.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.dataGrid)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.ImageDataTable)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.dataSet1)).BeginInit();
            this.panel4.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.PreviewBox)).BeginInit();
            this.mainToolbar.SuspendLayout();
            this.SuspendLayout();
            //
            // openFileDialog1
            //
            this.openFileDialog1.DefaultExt = "xls";
            this.openFileDialog1.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm|Excel 97/2003|*.xls|Excel 2007|*.xlsx;*.xlsm|All " +
    "files|*.*";
            this.openFileDialog1.Title = "Open an Excel File";
            //
            // panel1
            //
            this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
            this.panel1.Controls.Add(this.FilesListBox);
            this.panel1.Controls.Add(this.panel3);
            this.panel1.Dock = System.Windows.Forms.DockStyle.Left;
            this.panel1.Location = new System.Drawing.Point(0, 38);
            this.panel1.Name = "panel1";
            this.panel1.Size = new System.Drawing.Size(176, 400);
            this.panel1.TabIndex = 4;
            //
            // FilesListBox
            //
            this.FilesListBox.Dock = System.Windows.Forms.DockStyle.Fill;
            this.FilesListBox.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed;
            this.FilesListBox.Location = new System.Drawing.Point(0, 40);
            this.FilesListBox.Name = "FilesListBox";
            this.FilesListBox.Size = new System.Drawing.Size(172, 356);
            this.FilesListBox.TabIndex = 1;
            this.FilesListBox.DrawItem += new System.Windows.Forms.DrawItemEventHandler(this.FilesListBox_DrawItem);
            this.FilesListBox.SelectedIndexChanged += new System.EventHandler(this.FilesListBox_SelectedIndexChanged);
            //
            // panel3
            //
            this.panel3.BackColor = System.Drawing.Color.DarkSeaGreen;
            this.panel3.Controls.Add(this.lblFolder);
            this.panel3.Dock = System.Windows.Forms.DockStyle.Top;
            this.panel3.Location = new System.Drawing.Point(0, 0);
            this.panel3.Name = "panel3";
            this.panel3.Size = new System.Drawing.Size(172, 40);
            this.panel3.TabIndex = 0;
            //
            // lblFolder
            //
            this.lblFolder.Dock = System.Windows.Forms.DockStyle.Fill;
            this.lblFolder.ForeColor = System.Drawing.Color.Black;
            this.lblFolder.Location = new System.Drawing.Point(0, 0);
            this.lblFolder.Name = "lblFolder";
            this.lblFolder.Size = new System.Drawing.Size(172, 40);
            this.lblFolder.TabIndex = 0;
            this.lblFolder.Text = "No Selected Folder.";
            //
            // splitter1
            //
            this.splitter1.Location = new System.Drawing.Point(176, 38);
            this.splitter1.Name = "splitter1";
            this.splitter1.Size = new System.Drawing.Size(3, 400);
            this.splitter1.TabIndex = 5;
            this.splitter1.TabStop = false;
            //
            // dataGrid
            //
            this.dataGrid.CaptionText = "No file selected";
            this.dataGrid.DataMember = "";
            this.dataGrid.DataSource = this.ImageDataTable;
            this.dataGrid.Dock = System.Windows.Forms.DockStyle.Top;
            this.dataGrid.HeaderForeColor = System.Drawing.SystemColors.ControlText;
            this.dataGrid.Location = new System.Drawing.Point(179, 38);
            this.dataGrid.Name = "dataGrid";
            this.dataGrid.PreferredColumnWidth = 120;
            this.dataGrid.ReadOnly = true;
            this.dataGrid.Size = new System.Drawing.Size(709, 128);
            this.dataGrid.TabIndex = 7;
            //
            // ImageDataTable
            //
            this.ImageDataTable.Columns.AddRange(new System.Data.DataColumn[] {
            this.dataColumn4,
            this.Index,
            this.Cell1,
            this.Cell2,
            this.cType,
            this.cText,
            this.Description,
            this.dataColumn1,
            this.dataColumn2,
            this.dataColumn3});
            this.ImageDataTable.TableName = "ImageDataTable";
            //
            // dataColumn4
            //
            this.dataColumn4.ColumnName = "Sheet";
            //
            // Index
            //
            this.Index.ColumnName = "Index";
            //
            // Cell1
            //
            this.Cell1.Caption = "Width (Pixels)";
            this.Cell1.ColumnName = "Width (Pixels)";
            //
            // Cell2
            //
            this.Cell2.Caption = "Height (Pixels)";
            this.Cell2.ColumnName = "Height (Pixels)";
            //
            // cType
            //
            this.cType.ColumnName = "Type";
            //
            // cText
            //
            this.cText.Caption = "Image Format";
            this.cText.ColumnName = "Image Format";
            //
            // Description
            //
            this.Description.Caption = "Uncompressed size";
            this.Description.ColumnName = "Uncompressed size";
            //
            // dataColumn1
            //
            this.dataColumn1.Caption = "Name";
            this.dataColumn1.ColumnName = "Name";
            //
            // dataColumn2
            //
            this.dataColumn2.ColumnMapping = System.Data.MappingType.Hidden;
            this.dataColumn2.ColumnName = "Image";
            this.dataColumn2.DataType = typeof(byte[]);
            //
            // dataColumn3
            //
            this.dataColumn3.ColumnName = "Cropped";
            this.dataColumn3.DataType = typeof(bool);
            //
            // dataSet1
            //
            this.dataSet1.DataSetName = "ImageDataSet";
            this.dataSet1.Locale = new System.Globalization.CultureInfo("");
            this.dataSet1.Tables.AddRange(new System.Data.DataTable[] {
            this.ImageDataTable});
            //
            // panel4
            //
            this.panel4.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
            this.panel4.Controls.Add(this.PreviewBox);
            this.panel4.Dock = System.Windows.Forms.DockStyle.Fill;
            this.panel4.Location = new System.Drawing.Point(179, 169);
            this.panel4.Name = "panel4";
            this.panel4.Size = new System.Drawing.Size(709, 269);
            this.panel4.TabIndex = 8;
            //
            // PreviewBox
            //
            this.PreviewBox.Dock = System.Windows.Forms.DockStyle.Fill;
            this.PreviewBox.Location = new System.Drawing.Point(0, 0);
            this.PreviewBox.Name = "PreviewBox";
            this.PreviewBox.Size = new System.Drawing.Size(705, 265);
            this.PreviewBox.TabIndex = 0;
            this.PreviewBox.TabStop = false;
            //
            // splitter2
            //
            this.splitter2.Dock = System.Windows.Forms.DockStyle.Top;
            this.splitter2.Location = new System.Drawing.Point(179, 166);
            this.splitter2.Name = "splitter2";
            this.splitter2.Size = new System.Drawing.Size(709, 3);
            this.splitter2.TabIndex = 9;
            this.splitter2.TabStop = false;
            //
            // mainToolbar
            //
            this.mainToolbar.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.cbScanFolder,
            this.btnOpenFile,
            this.toolStripSeparator1,
            this.btnShowInExcel,
            this.btnSaveAsImage,
            this.btnExit,
            this.btnInfo,
            this.toolStripSeparator2,
            this.btnStretchPreview});
            this.mainToolbar.Location = new System.Drawing.Point(0, 0);
            this.mainToolbar.Name = "mainToolbar";
            this.mainToolbar.Size = new System.Drawing.Size(888, 38);
            this.mainToolbar.TabIndex = 12;
            this.mainToolbar.Text = "toolStrip1";
            //
            // cbScanFolder
            //
            this.cbScanFolder.CheckOnClick = true;
            this.cbScanFolder.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
            this.cbScanFolder.Image = ((System.Drawing.Image)(resources.GetObject("cbScanFolder.Image")));
            this.cbScanFolder.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.cbScanFolder.Name = "cbScanFolder";
            this.cbScanFolder.Size = new System.Drawing.Size(122, 35);
            this.cbScanFolder.Text = "Scan all files in folder";
            this.cbScanFolder.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
            //
            // btnOpenFile
            //
            this.btnOpenFile.Image = ((System.Drawing.Image)(resources.GetObject("btnOpenFile.Image")));
            this.btnOpenFile.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.btnOpenFile.Name = "btnOpenFile";
            this.btnOpenFile.Size = new System.Drawing.Size(59, 35);
            this.btnOpenFile.Text = "Open file";
            this.btnOpenFile.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
            this.btnOpenFile.Click += new System.EventHandler(this.btnOpenFile_Click);
            //
            // toolStripSeparator1
            //
            this.toolStripSeparator1.Name = "toolStripSeparator1";
            this.toolStripSeparator1.Size = new System.Drawing.Size(6, 38);
            //
            // btnShowInExcel
            //
            this.btnShowInExcel.Image = ((System.Drawing.Image)(resources.GetObject("btnShowInExcel.Image")));
            this.btnShowInExcel.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.btnShowInExcel.Name = "btnShowInExcel";
            this.btnShowInExcel.Size = new System.Drawing.Size(82, 35);
            this.btnShowInExcel.Text = "Show in Excel";
            this.btnShowInExcel.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
            this.btnShowInExcel.Click += new System.EventHandler(this.btnOpen_Click);
            //
            // btnSaveAsImage
            //
            this.btnSaveAsImage.Image = ((System.Drawing.Image)(resources.GetObject("btnSaveAsImage.Image")));
            this.btnSaveAsImage.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.btnSaveAsImage.Name = "btnSaveAsImage";
            this.btnSaveAsImage.Size = new System.Drawing.Size(85, 35);
            this.btnSaveAsImage.Text = "Save as image";
            this.btnSaveAsImage.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
            this.btnSaveAsImage.Click += new System.EventHandler(this.btnSaveImage_Click);
            //
            // btnExit
            //
            this.btnExit.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right;
            this.btnExit.Image = ((System.Drawing.Image)(resources.GetObject("btnExit.Image")));
            this.btnExit.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.btnExit.Name = "btnExit";
            this.btnExit.Size = new System.Drawing.Size(59, 35);
            this.btnExit.Text = "     E&xit     ";
            this.btnExit.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
            this.btnExit.Click += new System.EventHandler(this.btnExit_Click);
            //
            // btnInfo
            //
            this.btnInfo.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right;
            this.btnInfo.Image = ((System.Drawing.Image)(resources.GetObject("btnInfo.Image")));
            this.btnInfo.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.btnInfo.Name = "btnInfo";
            this.btnInfo.Size = new System.Drawing.Size(74, 35);
            this.btnInfo.Text = "Information";
            this.btnInfo.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
            this.btnInfo.Click += new System.EventHandler(this.btnInfo_Click);
            //
            // toolStripSeparator2
            //
            this.toolStripSeparator2.Name = "toolStripSeparator2";
            this.toolStripSeparator2.Size = new System.Drawing.Size(6, 38);
            //
            // btnStretchPreview
            //
            this.btnStretchPreview.CheckOnClick = true;
            this.btnStretchPreview.Image = ((System.Drawing.Image)(resources.GetObject("btnStretchPreview.Image")));
            this.btnStretchPreview.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.btnStretchPreview.Name = "btnStretchPreview";
            this.btnStretchPreview.Size = new System.Drawing.Size(92, 35);
            this.btnStretchPreview.Text = "Stretch preview";
            this.btnStretchPreview.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
            this.btnStretchPreview.Click += new System.EventHandler(this.btnStretchPreview_Click);
            //
            // mainForm
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(888, 438);
            this.Controls.Add(this.panel4);
            this.Controls.Add(this.splitter2);
            this.Controls.Add(this.dataGrid);
            this.Controls.Add(this.splitter1);
            this.Controls.Add(this.panel1);
            this.Controls.Add(this.mainToolbar);
            this.Name = "mainForm";
            this.Text = "FlexCel Image Explorer";
            this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
            this.panel1.ResumeLayout(false);
            this.panel3.ResumeLayout(false);
            ((System.ComponentModel.ISupportInitialize)(this.dataGrid)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.ImageDataTable)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.dataSet1)).EndInit();
            this.panel4.ResumeLayout(false);
            ((System.ComponentModel.ISupportInitialize)(this.PreviewBox)).EndInit();
            this.mainToolbar.ResumeLayout(false);
            this.mainToolbar.PerformLayout();
            this.ResumeLayout(false);
            this.PerformLayout();

        }
        #endregion

        private ToolStrip mainToolbar;
        private ToolStripButton btnOpenFile;
        private ToolStripSeparator toolStripSeparator1;
        private ToolStripButton btnShowInExcel;
        private ToolStripButton btnSaveAsImage;
        private ToolStripButton btnExit;
        private ToolStripButton btnInfo;
        private ToolStripSeparator toolStripSeparator2;
        private ToolStripButton btnStretchPreview;
        private ToolStripButton cbScanFolder;
    }
}

Program.cs

using System;
using System.Windows.Forms;

namespace FlexCelImageExplorer
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new mainForm());
        }
    }
}

TCompressForm.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.IO;

namespace FlexCelImageExplorer
{
    /// <summary>
    /// Summary description for TCompressForm.
    /// </summary>
    public partial class TCompressForm: System.Windows.Forms.Form
    {

        public TCompressForm()
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();
            cbPixelFormat.SelectedIndex = 2;

            //
            // TODO: Add any constructor code after InitializeComponent call
            //
        }

        private byte[] FImageToUse;
        private string FXlsFilename;

        internal byte[] ImageToUse
        {
            get
            {
                return FImageToUse;
            }
            set
            {
                FImageToUse = value;
                using (MemoryStream ms = new MemoryStream(value))
                {
                    pictureBox1.Image = Image.FromStream(ms);
                }
            }
        }

        internal string XlsFilename
        {
            get
            {
                return FXlsFilename;
            }
            set
            {
                FXlsFilename = value;
            }
        }

        private void btnCancel_Click(object sender, System.EventArgs e)
        {
            Close();
        }

        private void TCompressForm_Load(object sender, System.EventArgs e)
        {
        }

        private void btnOk_Click(object sender, System.EventArgs e)
        {
            Close();
        }
    }
}

TCompressForm.Designer.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.IO;
namespace FlexCelImageExplorer
{
    public partial class TCompressForm: System.Windows.Forms.Form
    {
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.NumericUpDown edPercent;
        private System.Windows.Forms.ComboBox cbPixelFormat;
        private System.Windows.Forms.Button btnOk;
        private System.Windows.Forms.Button btnCancel;
        private System.Windows.Forms.Panel panel1;
        private System.Windows.Forms.Panel panel2;
        private System.Windows.Forms.PictureBox pictureBox1;
        private System.Windows.Forms.CheckBox cbTransparent;
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.Container components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.label1 = new System.Windows.Forms.Label();
            this.edPercent = new System.Windows.Forms.NumericUpDown();
            this.cbPixelFormat = new System.Windows.Forms.ComboBox();
            this.btnOk = new System.Windows.Forms.Button();
            this.btnCancel = new System.Windows.Forms.Button();
            this.panel1 = new System.Windows.Forms.Panel();
            this.panel2 = new System.Windows.Forms.Panel();
            this.pictureBox1 = new System.Windows.Forms.PictureBox();
            this.cbTransparent = new System.Windows.Forms.CheckBox();
            ((System.ComponentModel.ISupportInitialize)(this.edPercent)).BeginInit();
            this.panel1.SuspendLayout();
            this.panel2.SuspendLayout();
            this.SuspendLayout();
            //
            // label1
            //
            this.label1.Location = new System.Drawing.Point(16, 8);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(144, 16);
            this.label1.TabIndex = 0;
            this.label1.Text = "Change Resolution (%):";
            //
            // edPercent
            //
            this.edPercent.Increment = new System.Decimal(new int[] {
                                                                        5,
                                                                        0,
                                                                        0,
                                                                        0});
            this.edPercent.Location = new System.Drawing.Point(176, 8);
            this.edPercent.Minimum = new System.Decimal(new int[] {
                                                                      10,
                                                                      0,
                                                                      0,
                                                                      0});
            this.edPercent.Name = "edPercent";
            this.edPercent.Size = new System.Drawing.Size(48, 20);
            this.edPercent.TabIndex = 2;
            this.edPercent.Value = new System.Decimal(new int[] {
                                                                    60,
                                                                    0,
                                                                    0,
                                                                    0});
            //
            // cbPixelFormat
            //
            this.cbPixelFormat.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.cbPixelFormat.Items.AddRange(new object[] {
                                                               "1bpp (Black and White)",
                                                               "8bpp (256 colors optimized palette)",
                                                               "24bpp (true color)"});
            this.cbPixelFormat.Location = new System.Drawing.Point(16, 40);
            this.cbPixelFormat.Name = "cbPixelFormat";
            this.cbPixelFormat.Size = new System.Drawing.Size(208, 21);
            this.cbPixelFormat.TabIndex = 3;
            //
            // btnOk
            //
            this.btnOk.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
            this.btnOk.FlatStyle = System.Windows.Forms.FlatStyle.System;
            this.btnOk.Location = new System.Drawing.Point(148, 168);
            this.btnOk.Name = "btnOk";
            this.btnOk.TabIndex = 4;
            this.btnOk.Text = "Ok";
            this.btnOk.Click += new System.EventHandler(this.btnOk_Click);
            //
            // btnCancel
            //
            this.btnCancel.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
            this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            this.btnCancel.FlatStyle = System.Windows.Forms.FlatStyle.System;
            this.btnCancel.Location = new System.Drawing.Point(244, 168);
            this.btnCancel.Name = "btnCancel";
            this.btnCancel.TabIndex = 5;
            this.btnCancel.Text = "Cancel";
            this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
            //
            // panel1
            //
            this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
            this.panel1.Controls.Add(this.cbTransparent);
            this.panel1.Controls.Add(this.edPercent);
            this.panel1.Controls.Add(this.cbPixelFormat);
            this.panel1.Controls.Add(this.label1);
            this.panel1.Location = new System.Drawing.Point(16, 16);
            this.panel1.Name = "panel1";
            this.panel1.Size = new System.Drawing.Size(240, 136);
            this.panel1.TabIndex = 6;
            //
            // panel2
            //
            this.panel2.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
                | System.Windows.Forms.AnchorStyles.Left)
                | System.Windows.Forms.AnchorStyles.Right)));
            this.panel2.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
            this.panel2.Controls.Add(this.pictureBox1);
            this.panel2.Location = new System.Drawing.Point(280, 16);
            this.panel2.Name = "panel2";
            this.panel2.Size = new System.Drawing.Size(168, 136);
            this.panel2.TabIndex = 7;
            //
            // pictureBox1
            //
            this.pictureBox1.Dock = System.Windows.Forms.DockStyle.Fill;
            this.pictureBox1.Location = new System.Drawing.Point(0, 0);
            this.pictureBox1.Name = "pictureBox1";
            this.pictureBox1.Size = new System.Drawing.Size(164, 132);
            this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
            this.pictureBox1.TabIndex = 0;
            this.pictureBox1.TabStop = false;
            //
            // cbTransparent
            //
            this.cbTransparent.Location = new System.Drawing.Point(16, 88);
            this.cbTransparent.Name = "cbTransparent";
            this.cbTransparent.TabIndex = 4;
            this.cbTransparent.Text = "Transparent";
            //
            // TCompressForm
            //
            this.AcceptButton = this.btnOk;
            this.CancelButton = this.btnCancel;
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(472, 214);
            this.Controls.Add(this.panel2);
            this.Controls.Add(this.panel1);
            this.Controls.Add(this.btnCancel);
            this.Controls.Add(this.btnOk);
            this.Name = "TCompressForm";
            this.Text = "Compression Options...";
            this.Load += new System.EventHandler(this.TCompressForm_Load);
            ((System.ComponentModel.ISupportInitialize)(this.edPercent)).EndInit();
            this.panel1.ResumeLayout(false);
            this.panel2.ResumeLayout(false);
            this.ResumeLayout(false);

        }
        #endregion
    }
}


Flexcel object explorer (C# / netframework) | FlexCel Studio for the .NET Framework documentation

Flexcel object explorer (C# / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\csharp\VS2022\netframework\10.API\35.Object Explorer and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​csharp/​VS2022/​netframework/​Modules/​10.​API/​35.​Object Explorer

Overview

Shapes in an Excel file can be nested in complex ways. For example, you might have a "Group" shape that inside has a "Picture" shape and other "Group" shape with other pictures inside. You can access the whole hierarchy of objects with ExcelFile.GetObjectProperties but it can be hard to visualize. This application shows a tree view of all the objects in a sheet, and can be useful when trying to understand the structure of the objects in an xls file.

Concepts

  • How to use the API to read the objects and properties in a file.

  • How to use ExcelFile.RenderObject to visually render the object (as shown in the preview pane). Internally, RenderObject uses ExcelFile.GetObjectProperties in the same way as this application, and draws the properties into a .NET image.

  • Custom properties (The ones shown in the grid at the top) can hold integers, booleans, strings or other datatypes. You need to know of which type is the property you are trying to read. Since FlexCel does not know it, it will try to show it as a string or as an integer.

Files

AssemblyInfo.cs

using System.Reflection;
using System.Runtime.CompilerServices;

//
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
//
[assembly: AssemblyTitle("")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("(c) 2002 - 2024 TMS Software")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

//
// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version
//      Build Number
//      Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:

[assembly: AssemblyVersion("7.21.0.0")]

//
// In order to sign your assembly you must specify a key to use. Refer to the
// Microsoft .NET Framework documentation for more information on assembly signing.
//
// Use the attributes below to control which key is used for signing.
//
// Notes:
//   (*) If no key is specified, the assembly is not signed.
//   (*) KeyName refers to a key that has been installed in the Crypto Service
//       Provider (CSP) on your machine. KeyFile refers to a file which contains
//       a key.
//   (*) If the KeyFile and the KeyName values are both specified, the
//       following processing occurs:
//       (1) If the KeyName can be found in the CSP, that key is used.
//       (2) If the KeyName does not exist and the KeyFile does exist, the key
//           in the KeyFile is installed into the CSP and used.
//   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
//       When specifying the KeyFile, the location of the KeyFile should be
//       relative to the project output directory which is
//       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
//       located in the project directory, you would specify the AssemblyKeyFile
//       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
//   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
//       documentation for more information on this.
//
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]
[assembly: AssemblyKeyName("")]

MainForm.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;

using FlexCel.Core;
using FlexCel.XlsAdapter;
using System.Collections.Generic;
using System.Diagnostics;

namespace ObjectExplorer
{
    /// <summary>
    /// Object explorer.
    /// </summary>
    public partial class mainForm: System.Windows.Forms.Form
    {

        public mainForm()
        {
            InitializeComponent();
            ResizeToolbar(mainToolbar);
        }

        private void ResizeToolbar(ToolStrip toolbar)
        {

            using (Graphics gr = CreateGraphics())
            {
                double xFactor = gr.DpiX / 96.0;
                double yFactor = gr.DpiY / 96.0;
                toolbar.ImageScalingSize = new Size((int)(24 * xFactor), (int)(24 * yFactor));
                toolbar.Width = 0; //force a recalc of the buttons.
            }
        }

        #region Global variables
        XlsFile Xls;
        #endregion

        private void btnExit_Click(object sender, System.EventArgs e)
        {
            Close();
        }

        private void btnOpenFile_Click(object sender, System.EventArgs e)
        {
            if (openFileDialog1.ShowDialog() != DialogResult.OK) return;

            Xls = new XlsFile();
            Xls.Open(openFileDialog1.FileName);

            cbSheet.Items.Clear();
            int ActSheet = Xls.ActiveSheet;
            for (int i = 1; i <= Xls.SheetCount; i++)
            {
                Xls.ActiveSheet = i;
                cbSheet.Items.Add(Xls.SheetName);
            }
            Xls.ActiveSheet = ActSheet;
            cbSheet.SelectedIndex = ActSheet - 1;

            FillListBox();
        }

        private void FillListBox()
        {
            lblObjects.Text = openFileDialog1.FileName;
            dataGrid.DataSource = null;

            ObjTree.BeginUpdate();
            try
            {
                ObjTree.Nodes.Clear();

                for (int i = 1; i <= Xls.ObjectCount; i++)
                {
                    TShapeProperties ShapeProps = Xls.GetObjectProperties(i, true);
                    string s = "Object " + i.ToString();
                    if (ShapeProps.ShapeName != null) s = ShapeProps.ShapeName;

                    TreeNode RootNode = new TreeNode(s);
                    FillNodes(ShapeProps, RootNode);

                    ObjTree.Nodes.Add(RootNode);
                }
            }
            finally
            {
                ObjTree.EndUpdate();
            }
        }

        private void FillNodes(TShapeProperties ShapeProps, TreeNode Node)
        {
            Node.Tag = ShapeProps; //In this simple demo we will use the tag property to store the Shape properties. This is not indented for 'real' use.

            for (int i = 1; i <= ShapeProps.ChildrenCount; i++)
            {
                TShapeProperties ChildProps = ShapeProps.Children(i);
                string ShapeName = ChildProps.ShapeName;
                if (ShapeName == null) ShapeName = "Object " + i.ToString();
                TreeNode Child = new TreeNode(ShapeName);
                FillNodes(ChildProps, Child);
                Node.Nodes.Add(Child);
            }
        }

        private void btnOpen_Click(object sender, System.EventArgs e)
        {
            if (Xls == null)
            {
                MessageBox.Show("There is no open file");
                return;
            }
            using (Process p = new Process())
            {
                p.StartInfo.FileName = Xls.ActiveFileName;
                p.StartInfo.UseShellExecute = true;
                p.Start();
            }
        }

        private void btnSaveImage_Click(object sender, System.EventArgs e)
        {
            if (PreviewBox.Image == null)
            {
                MessageBox.Show("There is no selected image to save", "Error");
                return;
            }
            if (saveImageDialog.ShowDialog() != DialogResult.OK) return;

            PreviewBox.Image.Save(saveImageDialog.FileName);
        }

        private void btnInfo_Click(object sender, System.EventArgs e)
        {
            MessageBox.Show("Object Explorer allows to explore inside the objects in an Excel file.\n" +
                "Objects in xls files are hierachily distributed, you can have two objects grouped as a third object, " +
                "and this hierarchy is shown in the 'Objects' pane at the left. The properties for the selected object are displayed at the 'Object properties' pane.");
        }

        private void ObjTree_AfterSelect(object sender, System.Windows.Forms.TreeViewEventArgs e)
        {
            RenderNode(e.Node);
            FillProperties(e.Node);
        }

        private void RenderNode(TreeNode Node)
        {
            if (Xls == null)
            {
                PreviewBox.Image = null;
                return;
            }

            TreeNode t = Node;
            if (t == null)
            {
                PreviewBox.Image = null;
                return;
            }

            while (t.Parent != null) t = t.Parent;  //Only root level objects will be rendered.

            if (t.Index + 1 > Xls.ObjectCount)
            {
                PreviewBox.Image = null;
                return;
            }

            PreviewBox.Image = Xls.RenderObject(t.Index + 1);

        }

        private void FillProperties(TreeNode Node)
        {
            lblObjName.Text = "Name:";
            lblObjText.Text = "Text:";
            TShapeProperties Props = (TShapeProperties)Node.Tag;
            if (Props == null)
            {
                dataGrid.DataSource = null;
                return;
            }

            TShapeOptionList ShapeOptions = (Node.Tag as TShapeProperties).ShapeOptions;
            if (ShapeOptions == null)
            {
                dataGrid.DataSource = null;
                return;
            }

            lblObjName.Text = "Name: " + Props.ShapeName;
            lblObjText.Text = "Text: " + Props.Text;

            ArrayList ShapeOpts = new ArrayList();
            foreach (KeyValuePair<TShapeOption, object> opt in ShapeOptions)
            {
                ShapeOpts.Add(new KeyValue(opt.Key, ShapeOptions));
            }
            dataGrid.DataSource = ShapeOpts;
        }

        private void cbSheet_SelectedIndexChanged(object sender, System.EventArgs e)
        {
            Xls.ActiveSheet = cbSheet.SelectedIndex + 1;
            FillListBox();
        }

        private void btnStretchPreview_Click(object sender, EventArgs e)
        {
            if (btnStretchPreview.Checked)
                PreviewBox.SizeMode = PictureBoxSizeMode.StretchImage;
            else
                PreviewBox.SizeMode = PictureBoxSizeMode.Normal;

        }

    }

    class KeyValue
    {
        private string FKey;
        private string FAs1616;
        private string FAsLong;
        private string FAsString;

        public KeyValue(TShapeOption aKey, TShapeOptionList List)
        {
            FKey = Convert.ToString(aKey);
            FAs1616 = Convert.ToString(List.As1616(aKey, 0));
            FAsLong = Convert.ToString(List.AsLong(aKey, 0));
            FAsString = List.AsUnicodeString(aKey, "");
        }

        public string Key { get { return FKey; } set { FKey = value; } }
        public string As1616 { get { return FAs1616; } set { FAs1616 = value; } }
        public string AsLong { get { return FAsLong; } set { FAsLong = value; } }
        public string AsString { get { return FAsString; } set { FAsString = value; } }

        public override string ToString()
        {
            return Key;
        }

    }
}

MainForm.Designer.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using FlexCel.Core;
using FlexCel.XlsAdapter;
namespace ObjectExplorer
{
    public partial class mainForm: System.Windows.Forms.Form
    {
        private System.Windows.Forms.OpenFileDialog openFileDialog1;
        private System.Windows.Forms.Panel panel1;
        private System.Windows.Forms.Splitter splitter1;
        private System.Windows.Forms.Panel panel3;
        private System.Windows.Forms.DataGrid dataGrid;
        private System.Windows.Forms.Panel panel4;
        private System.Windows.Forms.Splitter splitter2;
        private System.Windows.Forms.PictureBox PreviewBox;
        private System.Windows.Forms.SaveFileDialog saveImageDialog;
        private System.Windows.Forms.Label lblObjects;
        private System.Windows.Forms.TreeView ObjTree;
        private System.Windows.Forms.Panel panel5;
        private System.Windows.Forms.Label lblObjName;
        private System.Windows.Forms.Label lblObjText;
        private System.Windows.Forms.Panel panel6;
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.ComboBox cbSheet;
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(mainForm));
            this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
            this.panel1 = new System.Windows.Forms.Panel();
            this.ObjTree = new System.Windows.Forms.TreeView();
            this.panel6 = new System.Windows.Forms.Panel();
            this.cbSheet = new System.Windows.Forms.ComboBox();
            this.label1 = new System.Windows.Forms.Label();
            this.panel3 = new System.Windows.Forms.Panel();
            this.lblObjects = new System.Windows.Forms.Label();
            this.splitter1 = new System.Windows.Forms.Splitter();
            this.dataGrid = new System.Windows.Forms.DataGrid();
            this.panel4 = new System.Windows.Forms.Panel();
            this.PreviewBox = new System.Windows.Forms.PictureBox();
            this.splitter2 = new System.Windows.Forms.Splitter();
            this.saveImageDialog = new System.Windows.Forms.SaveFileDialog();
            this.panel5 = new System.Windows.Forms.Panel();
            this.lblObjText = new System.Windows.Forms.Label();
            this.lblObjName = new System.Windows.Forms.Label();
            this.mainToolbar = new System.Windows.Forms.ToolStrip();
            this.btnOpenFile = new System.Windows.Forms.ToolStripButton();
            this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
            this.btnShowInExcel = new System.Windows.Forms.ToolStripButton();
            this.btnSaveAsImage = new System.Windows.Forms.ToolStripButton();
            this.btnExit = new System.Windows.Forms.ToolStripButton();
            this.btnInfo = new System.Windows.Forms.ToolStripButton();
            this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
            this.btnStretchPreview = new System.Windows.Forms.ToolStripButton();
            this.panel1.SuspendLayout();
            this.panel6.SuspendLayout();
            this.panel3.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.dataGrid)).BeginInit();
            this.panel4.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.PreviewBox)).BeginInit();
            this.panel5.SuspendLayout();
            this.mainToolbar.SuspendLayout();
            this.SuspendLayout();
            //
            // openFileDialog1
            //
            this.openFileDialog1.DefaultExt = "xls";
            this.openFileDialog1.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm|Excel 97/2003|*.xls|Excel 2007|*.xlsx;*.xlsm|All " +
    "files|*.*";
            this.openFileDialog1.Title = "Open an Excel File";
            //
            // panel1
            //
            this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
            this.panel1.Controls.Add(this.ObjTree);
            this.panel1.Controls.Add(this.panel6);
            this.panel1.Controls.Add(this.panel3);
            this.panel1.Dock = System.Windows.Forms.DockStyle.Left;
            this.panel1.Location = new System.Drawing.Point(0, 38);
            this.panel1.Name = "panel1";
            this.panel1.Size = new System.Drawing.Size(176, 472);
            this.panel1.TabIndex = 4;
            //
            // ObjTree
            //
            this.ObjTree.Dock = System.Windows.Forms.DockStyle.Fill;
            this.ObjTree.HideSelection = false;
            this.ObjTree.Location = new System.Drawing.Point(0, 112);
            this.ObjTree.Name = "ObjTree";
            this.ObjTree.Size = new System.Drawing.Size(172, 356);
            this.ObjTree.TabIndex = 1;
            this.ObjTree.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.ObjTree_AfterSelect);
            //
            // panel6
            //
            this.panel6.BackColor = System.Drawing.Color.DarkSeaGreen;
            this.panel6.Controls.Add(this.cbSheet);
            this.panel6.Controls.Add(this.label1);
            this.panel6.Dock = System.Windows.Forms.DockStyle.Top;
            this.panel6.Location = new System.Drawing.Point(0, 64);
            this.panel6.Name = "panel6";
            this.panel6.Size = new System.Drawing.Size(172, 48);
            this.panel6.TabIndex = 2;
            //
            // cbSheet
            //
            this.cbSheet.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.cbSheet.Location = new System.Drawing.Point(6, 16);
            this.cbSheet.Name = "cbSheet";
            this.cbSheet.Size = new System.Drawing.Size(160, 21);
            this.cbSheet.TabIndex = 33;
            this.cbSheet.SelectedIndexChanged += new System.EventHandler(this.cbSheet_SelectedIndexChanged);
            //
            // label1
            //
            this.label1.BackColor = System.Drawing.Color.LightGoldenrodYellow;
            this.label1.Dock = System.Windows.Forms.DockStyle.Fill;
            this.label1.ForeColor = System.Drawing.Color.Black;
            this.label1.Location = new System.Drawing.Point(0, 0);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(172, 48);
            this.label1.TabIndex = 1;
            this.label1.Text = "Sheet:";
            //
            // panel3
            //
            this.panel3.BackColor = System.Drawing.Color.DarkSeaGreen;
            this.panel3.Controls.Add(this.lblObjects);
            this.panel3.Dock = System.Windows.Forms.DockStyle.Top;
            this.panel3.Location = new System.Drawing.Point(0, 0);
            this.panel3.Name = "panel3";
            this.panel3.Size = new System.Drawing.Size(172, 64);
            this.panel3.TabIndex = 0;
            //
            // lblObjects
            //
            this.lblObjects.BackColor = System.Drawing.Color.LightGoldenrodYellow;
            this.lblObjects.Dock = System.Windows.Forms.DockStyle.Fill;
            this.lblObjects.ForeColor = System.Drawing.Color.Black;
            this.lblObjects.Location = new System.Drawing.Point(0, 0);
            this.lblObjects.Name = "lblObjects";
            this.lblObjects.Size = new System.Drawing.Size(172, 64);
            this.lblObjects.TabIndex = 1;
            this.lblObjects.Text = "File:";
            //
            // splitter1
            //
            this.splitter1.Location = new System.Drawing.Point(176, 91);
            this.splitter1.Name = "splitter1";
            this.splitter1.Size = new System.Drawing.Size(3, 419);
            this.splitter1.TabIndex = 5;
            this.splitter1.TabStop = false;
            //
            // dataGrid
            //
            this.dataGrid.CaptionText = "Object Properties";
            this.dataGrid.DataMember = "";
            this.dataGrid.Dock = System.Windows.Forms.DockStyle.Top;
            this.dataGrid.HeaderForeColor = System.Drawing.SystemColors.ControlText;
            this.dataGrid.Location = new System.Drawing.Point(179, 91);
            this.dataGrid.Name = "dataGrid";
            this.dataGrid.PreferredColumnWidth = 120;
            this.dataGrid.ReadOnly = true;
            this.dataGrid.Size = new System.Drawing.Size(557, 213);
            this.dataGrid.TabIndex = 7;
            //
            // panel4
            //
            this.panel4.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
            this.panel4.Controls.Add(this.PreviewBox);
            this.panel4.Dock = System.Windows.Forms.DockStyle.Fill;
            this.panel4.Location = new System.Drawing.Point(179, 307);
            this.panel4.Name = "panel4";
            this.panel4.Size = new System.Drawing.Size(557, 203);
            this.panel4.TabIndex = 8;
            //
            // PreviewBox
            //
            this.PreviewBox.Dock = System.Windows.Forms.DockStyle.Fill;
            this.PreviewBox.Location = new System.Drawing.Point(0, 0);
            this.PreviewBox.Name = "PreviewBox";
            this.PreviewBox.Size = new System.Drawing.Size(553, 199);
            this.PreviewBox.TabIndex = 0;
            this.PreviewBox.TabStop = false;
            //
            // splitter2
            //
            this.splitter2.Dock = System.Windows.Forms.DockStyle.Top;
            this.splitter2.Location = new System.Drawing.Point(179, 304);
            this.splitter2.Name = "splitter2";
            this.splitter2.Size = new System.Drawing.Size(557, 3);
            this.splitter2.TabIndex = 9;
            this.splitter2.TabStop = false;
            //
            // saveImageDialog
            //
            this.saveImageDialog.DefaultExt = "png";
            this.saveImageDialog.Filter = "PNG Files|*.png";
            //
            // panel5
            //
            this.panel5.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.panel5.Controls.Add(this.lblObjText);
            this.panel5.Controls.Add(this.lblObjName);
            this.panel5.Dock = System.Windows.Forms.DockStyle.Top;
            this.panel5.Location = new System.Drawing.Point(176, 38);
            this.panel5.Name = "panel5";
            this.panel5.Size = new System.Drawing.Size(560, 53);
            this.panel5.TabIndex = 10;
            //
            // lblObjText
            //
            this.lblObjText.AutoSize = true;
            this.lblObjText.Location = new System.Drawing.Point(16, 32);
            this.lblObjText.Name = "lblObjText";
            this.lblObjText.Size = new System.Drawing.Size(31, 13);
            this.lblObjText.TabIndex = 1;
            this.lblObjText.Text = "Text:";
            //
            // lblObjName
            //
            this.lblObjName.AutoSize = true;
            this.lblObjName.Location = new System.Drawing.Point(16, 8);
            this.lblObjName.Name = "lblObjName";
            this.lblObjName.Size = new System.Drawing.Size(38, 13);
            this.lblObjName.TabIndex = 0;
            this.lblObjName.Text = "Name:";
            //
            // mainToolbar
            //
            this.mainToolbar.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.btnOpenFile,
            this.toolStripSeparator1,
            this.btnShowInExcel,
            this.btnSaveAsImage,
            this.btnExit,
            this.btnInfo,
            this.toolStripSeparator2,
            this.btnStretchPreview});
            this.mainToolbar.Location = new System.Drawing.Point(0, 0);
            this.mainToolbar.Name = "mainToolbar";
            this.mainToolbar.Size = new System.Drawing.Size(736, 38);
            this.mainToolbar.TabIndex = 11;
            this.mainToolbar.Text = "toolStrip1";
            //
            // btnOpenFile
            //
            this.btnOpenFile.Image = ((System.Drawing.Image)(resources.GetObject("btnOpenFile.Image")));
            this.btnOpenFile.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.btnOpenFile.Name = "btnOpenFile";
            this.btnOpenFile.Size = new System.Drawing.Size(59, 35);
            this.btnOpenFile.Text = "Open file";
            this.btnOpenFile.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
            this.btnOpenFile.Click += new System.EventHandler(this.btnOpenFile_Click);
            //
            // toolStripSeparator1
            //
            this.toolStripSeparator1.Name = "toolStripSeparator1";
            this.toolStripSeparator1.Size = new System.Drawing.Size(6, 38);
            //
            // btnShowInExcel
            //
            this.btnShowInExcel.Image = ((System.Drawing.Image)(resources.GetObject("btnShowInExcel.Image")));
            this.btnShowInExcel.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.btnShowInExcel.Name = "btnShowInExcel";
            this.btnShowInExcel.Size = new System.Drawing.Size(82, 35);
            this.btnShowInExcel.Text = "Show in Excel";
            this.btnShowInExcel.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
            this.btnShowInExcel.Click += new System.EventHandler(this.btnOpen_Click);
            //
            // btnSaveAsImage
            //
            this.btnSaveAsImage.Image = ((System.Drawing.Image)(resources.GetObject("btnSaveAsImage.Image")));
            this.btnSaveAsImage.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.btnSaveAsImage.Name = "btnSaveAsImage";
            this.btnSaveAsImage.Size = new System.Drawing.Size(85, 35);
            this.btnSaveAsImage.Text = "Save as image";
            this.btnSaveAsImage.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
            this.btnSaveAsImage.Click += new System.EventHandler(this.btnSaveImage_Click);
            //
            // btnExit
            //
            this.btnExit.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right;
            this.btnExit.Image = ((System.Drawing.Image)(resources.GetObject("btnExit.Image")));
            this.btnExit.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.btnExit.Name = "btnExit";
            this.btnExit.Size = new System.Drawing.Size(59, 35);
            this.btnExit.Text = "     E&xit     ";
            this.btnExit.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
            this.btnExit.Click += new System.EventHandler(this.btnExit_Click);
            //
            // btnInfo
            //
            this.btnInfo.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right;
            this.btnInfo.Image = ((System.Drawing.Image)(resources.GetObject("btnInfo.Image")));
            this.btnInfo.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.btnInfo.Name = "btnInfo";
            this.btnInfo.Size = new System.Drawing.Size(74, 35);
            this.btnInfo.Text = "Information";
            this.btnInfo.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
            this.btnInfo.Click += new System.EventHandler(this.btnInfo_Click);
            //
            // toolStripSeparator2
            //
            this.toolStripSeparator2.Name = "toolStripSeparator2";
            this.toolStripSeparator2.Size = new System.Drawing.Size(6, 38);
            //
            // btnStretchPreview
            //
            this.btnStretchPreview.CheckOnClick = true;
            this.btnStretchPreview.Image = ((System.Drawing.Image)(resources.GetObject("btnStretchPreview.Image")));
            this.btnStretchPreview.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.btnStretchPreview.Name = "btnStretchPreview";
            this.btnStretchPreview.Size = new System.Drawing.Size(92, 35);
            this.btnStretchPreview.Text = "Stretch preview";
            this.btnStretchPreview.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
            this.btnStretchPreview.Click += new System.EventHandler(this.btnStretchPreview_Click);
            //
            // mainForm
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(736, 510);
            this.Controls.Add(this.panel4);
            this.Controls.Add(this.splitter2);
            this.Controls.Add(this.dataGrid);
            this.Controls.Add(this.splitter1);
            this.Controls.Add(this.panel5);
            this.Controls.Add(this.panel1);
            this.Controls.Add(this.mainToolbar);
            this.Name = "mainForm";
            this.Text = "FlexCel Object Explorer";
            this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
            this.panel1.ResumeLayout(false);
            this.panel6.ResumeLayout(false);
            this.panel3.ResumeLayout(false);
            ((System.ComponentModel.ISupportInitialize)(this.dataGrid)).EndInit();
            this.panel4.ResumeLayout(false);
            ((System.ComponentModel.ISupportInitialize)(this.PreviewBox)).EndInit();
            this.panel5.ResumeLayout(false);
            this.panel5.PerformLayout();
            this.mainToolbar.ResumeLayout(false);
            this.mainToolbar.PerformLayout();
            this.ResumeLayout(false);
            this.PerformLayout();

        }
        #endregion

        private ToolStrip mainToolbar;
        private ToolStripButton btnOpenFile;
        private ToolStripSeparator toolStripSeparator1;
        private ToolStripButton btnShowInExcel;
        private ToolStripButton btnExit;
        private ToolStripButton btnSaveAsImage;
        private ToolStripButton btnInfo;
        private ToolStripSeparator toolStripSeparator2;
        private ToolStripButton btnStretchPreview;

    }
}

Program.cs

using System;
using System.Windows.Forms;

namespace ObjectExplorer
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new mainForm());
        }
    }
}


Copy and paste (C# / netframework) | FlexCel Studio for the .NET Framework documentation

Copy and paste (C# / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\csharp\VS2022\netframework\10.API\40.Copy And Paste and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​csharp/​VS2022/​netframework/​Modules/​10.​API/​40.​Copy And Paste

Overview

ExcelFile has a group of methods allowing you to copy/paste from/to FlexCel to/from Excel in native Excel format. All methods copy and paste the data on BIFF8 and Tabbed-Text format, to allow for copying/pasting from other sources besides Excel.

Copying and pasting in native BIFF8 format is a great advance over copying/pasting on plain text only. It allows you to keep cell formats/colors/rounding decimals/merged cells/etc. It allows a new world of interoperation between your applications and Excel. Your users will be able to interchange data back and forward between your application and Excel just by copying and pasting. But keep in mind that it has its limitations too:

  • It can't copy/paste images

  • It can't copy/paste strings longer than 255 characters

  • It can't copy the data on multiple sheets.

I would like to say that these limitations are not FlexCel's fault. The BIFF8 specification is correctly implemented, those are limitations on Excel's part.

Of course, Excel can copy and paste everything without problems, but this is so because Excel doesn't use the clipboard to do the operation. If you close all instances of Excel, open a Worksheet, copy some cells to the clipboard, close Excel and open it again you will run into the same limitations. Copy/paste limitations on Excel don't show when it is kept in memory.

Concepts

  • FlexCel methods return datastreams for maximum flexibility. No data will be actually copied/pasted from/to the clipboard by FlexCel, this is your task. Here you can see how it is done.

Files

AssemblyInfo.cs

using System.Reflection;
using System.Runtime.CompilerServices;

//
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
//
[assembly: AssemblyTitle("")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("(c) 2002 - 2024 TMS Software")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

//
// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version
//      Build Number
//      Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:

[assembly: AssemblyVersion("7.21.0.0")]

//
// In order to sign your assembly you must specify a key to use. Refer to the
// Microsoft .NET Framework documentation for more information on assembly signing.
//
// Use the attributes below to control which key is used for signing.
//
// Notes:
//   (*) If no key is specified, the assembly is not signed.
//   (*) KeyName refers to a key that has been installed in the Crypto Service
//       Provider (CSP) on your machine. KeyFile refers to a file which contains
//       a key.
//   (*) If the KeyFile and the KeyName values are both specified, the
//       following processing occurs:
//       (1) If the KeyName can be found in the CSP, that key is used.
//       (2) If the KeyName does not exist and the KeyFile does exist, the key
//           in the KeyFile is installed into the CSP and used.
//   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
//       When specifying the KeyFile, the location of the KeyFile should be
//       relative to the project output directory which is
//       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
//       located in the project directory, you would specify the AssemblyKeyFile
//       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
//   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
//       documentation for more information on this.
//
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]
[assembly: AssemblyKeyName("")]

Form1.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using System.Text;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using System.Collections.Generic;

namespace CopyAndPaste
{
    /// <summary>
    /// Copy and Paste Example.
    /// </summary>
    public partial class mainForm: System.Windows.Forms.Form
    {

        public mainForm()
        {
            InitializeComponent();
        }

        private XlsFile Xls;

        private void btnNewFile_Click(object sender, System.EventArgs e)
        {
            try
            {
                Xls = new XlsFile();
                Xls.NewFile(1, TExcelFileFormat.v2019);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }

        private void btnOpenFile_Click(object sender, EventArgs e)
        {
            try
            {
                if (openFileDialog.ShowDialog() != System.Windows.Forms.DialogResult.OK) return;
                Xls = new XlsFile(openFileDialog.FileName);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }

        }

        private void DoPaste(IDataObject iData)
        {
            if (Xls == null)
            {
                MessageBox.Show("Please push the New File button before pasting");
                return;
            }

            try
            {
                if (iData.GetDataPresent(FlexCelDataFormats.Excel97))
                {
                    //DO NOT CALL -> using (MemoryStream ms = (MemoryStream)iData.GetData(FlexCelDataFormats.Excel97))
                    //You shouldn't dispose the stream, as it belongs to the Clipboard.
                    object o = iData.GetData(FlexCelDataFormats.Excel97);
                    MemoryStream ms = (MemoryStream)o;
                    {
                        Xls.PasteFromXlsClipboardFormat(1, 1, TFlxInsertMode.NoneDown, ms);
                        MessageBox.Show("NATIVE Data has been pasted at cell A1");
                    }
                }
                else
                    if (iData.GetDataPresent(DataFormats.UnicodeText))
                {
                    Xls.PasteFromTextClipboardFormat(1, 1, TFlxInsertMode.NoneDown, (string)iData.GetData(DataFormats.UnicodeText));
                    MessageBox.Show("UNICODE TEXT Data has been pasted at cell A1");
                }
                else
                        if (iData.GetDataPresent(DataFormats.Text))
                {
                    Xls.PasteFromTextClipboardFormat(1, 1, TFlxInsertMode.NoneDown, (string)iData.GetData(DataFormats.Text));
                    MessageBox.Show("TEXT Data has been pasted at cell A1");

                }
                else
                {
                    MessageBox.Show("There is no Excel or Text data on the clipboard");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                Xls = new XlsFile();
                Xls.NewFile(1, TExcelFileFormat.v2019);
            }
        }

        private void btnPaste_Click(object sender, System.EventArgs e)
        {
            DoPaste(Clipboard.GetDataObject());
        }

        private void DropHere_DragOver(object sender, System.Windows.Forms.DragEventArgs e)
        {
            if (e.Data.GetDataPresent(FlexCelDataFormats.Excel97) ||
                e.Data.GetDataPresent(DataFormats.UnicodeText) ||
                e.Data.GetDataPresent(DataFormats.Text)
                )
                e.Effect = DragDropEffects.Copy;
        }

        private void DropHere_DragDrop(object sender, System.Windows.Forms.DragEventArgs e)
        {
            DoPaste(e.Data);
        }

        private void DoCopy(bool ToClipboard)
        {
            if (Xls == null)
            {
                MessageBox.Show("Please push the New File button before copying");
                return;
            }

            //VERY IMPORTANT!!!!!
            //****************************************************************************
            //The MemoryStreams CAN NOT BE DISPOSED UNTIL WE CALL Clipboard.SetObjectData.
            //Even when we assigned the Stream with the DataObject Data, it is still in use and can't be freed.
            //****************************************************************************

            try
            {
                DataObject data = new DataObject();
                List<MemoryStream> dataStreams = new List<MemoryStream>(); //we will use this list to dispose the memorystreams after they have been used.
                try
                {
                    foreach (FlexCelClipboardFormat cf in Enum.GetValues(typeof(FlexCelClipboardFormat)))
                    {
                        MemoryStream dataStream = new MemoryStream();
                        dataStreams.Add(dataStream);
                        Xls.CopyToClipboard(cf, dataStream);
                        dataStream.Position = 0;
                        data.SetData(FlexCelDataFormats.GetString(cf), dataStream);

                    }
                    if (ToClipboard)
                        Clipboard.SetDataObject(data, true);
                    else
                        DoDragDrop(data, DragDropEffects.Copy);
                }
                finally
                {
                    foreach (MemoryStream ms in dataStreams)
                    {
                        ms.Dispose();
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }

        private void btnCopy_Click(object sender, System.EventArgs e)
        {
            DoCopy(true);
        }

        private void btnDragMe_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
        {
            DoCopy(false);
        }

    }
}

Form1.Designer.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using System.Text;
using FlexCel.Core;
using FlexCel.XlsAdapter;
namespace CopyAndPaste
{
    public partial class mainForm: System.Windows.Forms.Form
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.Container components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.btnPaste = new System.Windows.Forms.Button();
            this.btnNewFile = new System.Windows.Forms.Button();
            this.btnCopy = new System.Windows.Forms.Button();
            this.label1 = new System.Windows.Forms.Label();
            this.label2 = new System.Windows.Forms.Label();
            this.label3 = new System.Windows.Forms.Label();
            this.label4 = new System.Windows.Forms.Label();
            this.btnDragMe = new System.Windows.Forms.Button();
            this.label5 = new System.Windows.Forms.Label();
            this.DropHere = new System.Windows.Forms.Label();
            this.btnOpenFile = new System.Windows.Forms.Button();
            this.openFileDialog = new System.Windows.Forms.OpenFileDialog();
            this.SuspendLayout();
            //
            // btnPaste
            //
            this.btnPaste.Location = new System.Drawing.Point(44, 251);
            this.btnPaste.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
            this.btnPaste.Name = "btnPaste";
            this.btnPaste.Size = new System.Drawing.Size(138, 42);
            this.btnPaste.TabIndex = 0;
            this.btnPaste.Text = "Paste";
            this.btnPaste.Click += new System.EventHandler(this.btnPaste_Click);
            //
            // btnNewFile
            //
            this.btnNewFile.Location = new System.Drawing.Point(44, 74);
            this.btnNewFile.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
            this.btnNewFile.Name = "btnNewFile";
            this.btnNewFile.Size = new System.Drawing.Size(138, 42);
            this.btnNewFile.TabIndex = 1;
            this.btnNewFile.Text = "New File";
            this.btnNewFile.Click += new System.EventHandler(this.btnNewFile_Click);
            //
            // btnCopy
            //
            this.btnCopy.Location = new System.Drawing.Point(44, 428);
            this.btnCopy.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
            this.btnCopy.Name = "btnCopy";
            this.btnCopy.Size = new System.Drawing.Size(138, 42);
            this.btnCopy.TabIndex = 2;
            this.btnCopy.Text = "Copy";
            this.btnCopy.Click += new System.EventHandler(this.btnCopy_Click);
            //
            // label1
            //
            this.label1.BackColor = System.Drawing.Color.LightSkyBlue;
            this.label1.Location = new System.Drawing.Point(44, 15);
            this.label1.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(719, 44);
            this.label1.TabIndex = 4;
            this.label1.Text = "1) Begin by creating a new file or opening an existing file...";
            this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
            //
            // label2
            //
            this.label2.BackColor = System.Drawing.Color.LightSkyBlue;
            this.label2.Location = new System.Drawing.Point(44, 148);
            this.label2.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
            this.label2.Name = "label2";
            this.label2.Size = new System.Drawing.Size(719, 44);
            this.label2.TabIndex = 5;
            this.label2.Text = "2) Now go to Excel, copy some cells and paste them here...";
            this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
            //
            // label3
            //
            this.label3.BackColor = System.Drawing.Color.LightSkyBlue;
            this.label3.Location = new System.Drawing.Point(44, 325);
            this.label3.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
            this.label3.Name = "label3";
            this.label3.Size = new System.Drawing.Size(719, 44);
            this.label3.TabIndex = 6;
            this.label3.Text = "3) After pasting, you can copy back the results to the clipboard";
            this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
            //
            // label4
            //
            this.label4.BackColor = System.Drawing.Color.SteelBlue;
            this.label4.ForeColor = System.Drawing.Color.White;
            this.label4.Location = new System.Drawing.Point(44, 369);
            this.label4.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
            this.label4.Name = "label4";
            this.label4.Size = new System.Drawing.Size(719, 44);
            this.label4.TabIndex = 7;
            this.label4.Text = "Press the \"Copy\" button or drag the \"Drag Me!\" into Excel.";
            this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
            //
            // btnDragMe
            //
            this.btnDragMe.AllowDrop = true;
            this.btnDragMe.Location = new System.Drawing.Point(205, 428);
            this.btnDragMe.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
            this.btnDragMe.Name = "btnDragMe";
            this.btnDragMe.Size = new System.Drawing.Size(138, 42);
            this.btnDragMe.TabIndex = 8;
            this.btnDragMe.Text = "Drag Me!";
            this.btnDragMe.MouseDown += new System.Windows.Forms.MouseEventHandler(this.btnDragMe_MouseDown);
            //
            // label5
            //
            this.label5.BackColor = System.Drawing.Color.SteelBlue;
            this.label5.ForeColor = System.Drawing.Color.White;
            this.label5.Location = new System.Drawing.Point(44, 192);
            this.label5.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
            this.label5.Name = "label5";
            this.label5.Size = new System.Drawing.Size(719, 44);
            this.label5.TabIndex = 10;
            this.label5.Text = "Press the \"Paste\" button or drag some cells from Excel into \"Drop Here!\".";
            this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
            //
            // DropHere
            //
            this.DropHere.AllowDrop = true;
            this.DropHere.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
            this.DropHere.Location = new System.Drawing.Point(200, 251);
            this.DropHere.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
            this.DropHere.Name = "DropHere";
            this.DropHere.Size = new System.Drawing.Size(183, 42);
            this.DropHere.TabIndex = 11;
            this.DropHere.Text = "Drop Here!";
            this.DropHere.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
            this.DropHere.DragDrop += new System.Windows.Forms.DragEventHandler(this.DropHere_DragDrop);
            this.DropHere.DragOver += new System.Windows.Forms.DragEventHandler(this.DropHere_DragOver);
            //
            // btnOpenFile
            //
            this.btnOpenFile.Location = new System.Drawing.Point(205, 74);
            this.btnOpenFile.Margin = new System.Windows.Forms.Padding(6);
            this.btnOpenFile.Name = "btnOpenFile";
            this.btnOpenFile.Size = new System.Drawing.Size(138, 42);
            this.btnOpenFile.TabIndex = 12;
            this.btnOpenFile.Text = "Open File";
            this.btnOpenFile.Click += new System.EventHandler(this.btnOpenFile_Click);
            //
            // openFileDialog
            //
            this.openFileDialog.DefaultExt = "xls";
            this.openFileDialog.Filter = "Excel Files|*.xls|All files|*.*";
            this.openFileDialog.Title = "Select a file to preview";
            //
            // mainForm
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(11F, 24F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(836, 615);
            this.Controls.Add(this.btnOpenFile);
            this.Controls.Add(this.DropHere);
            this.Controls.Add(this.label5);
            this.Controls.Add(this.btnDragMe);
            this.Controls.Add(this.label4);
            this.Controls.Add(this.label3);
            this.Controls.Add(this.label2);
            this.Controls.Add(this.label1);
            this.Controls.Add(this.btnCopy);
            this.Controls.Add(this.btnNewFile);
            this.Controls.Add(this.btnPaste);
            this.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
            this.Name = "mainForm";
            this.Text = "Copy and Paste Demo";
            this.ResumeLayout(false);

        }
        #endregion

        private Button btnPaste;
        private Button btnNewFile;
        private Button btnCopy;
        private Label label1;
        private Label label2;
        private Label label3;
        private Label label4;
        private Label label5;
        private Button btnDragMe;
        private Label DropHere;
        private Button btnOpenFile;
        private OpenFileDialog openFileDialog;

    }
}

Program.cs

using System;
using System.Windows.Forms;

namespace CopyAndPaste
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new mainForm());
        }
    }
}


Using hyperlinks (C# / netframework) | FlexCel Studio for the .NET Framework documentation

Using hyperlinks (C# / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\csharp\VS2022\netframework\10.API\70.HyperLinks and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​csharp/​VS2022/​netframework/​Modules/​10.​API/​70.​Hyper​Links

Overview

This is a small application to show how to use hyperlinks. Parameters in a hyperlink are not straightforward, so the idea is that you can go to Excel, create a Worksheet with your desired hyperlinks, and use this app to see what parameters they have.

Columns in the Grid

  • Cell1, Cell2:

    These are the first and last cell on the range of the hyperlink. Normally they will be the same cell

  • Type: There are 4 types of Hyperlinks:

    1. URL: This can be http, https, ftp, or mailto://

    2. UNC: This is a path to a network site on universal naming convention, like \\server\folder\your_file.xls.

    3. Local File: This is a file stored relative to the path of the sheet. (for example, on the upper folder)

    4. Current Workbook: this is a link to a cell on the file. Note that this option always has Text=''

  • Text:

    Text of the HyperLink. This is empty when linking to a cell.

  • Description:

    Description of the HyperLink.

  • Target Frame:

    This parameter is not documented. You can leave it empty.

  • Text Mark:

    When entering an URL on Excel, you can enter additional text following the url with a "#" character (for example www.your_url.com#myurl") The text Mark is the text after the "#" char. When entering an address to a cell, the address goes here too.

  • Hint:

    This is the hint Excel will show when hovering the mouse over the hyperlink.

Files

AssemblyInfo.cs

using System.Reflection;
using System.Runtime.CompilerServices;

//
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
//
[assembly: AssemblyTitle("")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("(c) 2002 - 2024 TMS Software")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

//
// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version
//      Build Number
//      Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:

[assembly: AssemblyVersion("7.21.0.0")]

//
// In order to sign your assembly you must specify a key to use. Refer to the
// Microsoft .NET Framework documentation for more information on assembly signing.
//
// Use the attributes below to control which key is used for signing.
//
// Notes:
//   (*) If no key is specified, the assembly is not signed.
//   (*) KeyName refers to a key that has been installed in the Crypto Service
//       Provider (CSP) on your machine. KeyFile refers to a file which contains
//       a key.
//   (*) If the KeyFile and the KeyName values are both specified, the
//       following processing occurs:
//       (1) If the KeyName can be found in the CSP, that key is used.
//       (2) If the KeyName does not exist and the KeyFile does exist, the key
//           in the KeyFile is installed into the CSP and used.
//   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
//       When specifying the KeyFile, the location of the KeyFile should be
//       relative to the project output directory which is
//       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
//       located in the project directory, you would specify the AssemblyKeyFile
//       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
//   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
//       documentation for more information on this.
//
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]
[assembly: AssemblyKeyName("")]

Form1.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using System.IO;
using System.Diagnostics;
using System.Reflection;

namespace HyperLinks
{
    /// <summary>
    /// How to deal with Hyperlinks in FlexCel.
    /// </summary>
    public partial class mainForm: System.Windows.Forms.Form
    {

        public mainForm()
        {
            InitializeComponent();
            ResizeToolbar(mainToolbar);
        }

        private void ResizeToolbar(ToolStrip toolbar)
        {

            using (Graphics gr = CreateGraphics())
            {
                double xFactor = gr.DpiX / 96.0;
                double yFactor = gr.DpiY / 96.0;
                toolbar.ImageScalingSize = new Size((int)(24 * xFactor), (int)(24 * yFactor));
                toolbar.Width = 0; //force a recalc of the buttons.
            }

        }

        private void button2_Click(object sender, System.EventArgs e)
        {
            Close();
        }

        private ExcelFile Xls = null;

        private void ReadHyperLinks_Click(object sender, System.EventArgs e)
        {
            if (openFileDialog1.ShowDialog() != DialogResult.OK) return;
            Xls = new XlsFile();

            Xls.Open(openFileDialog1.FileName);

            dataGrid.CaptionText = "Hyperlinks on file: " + openFileDialog1.FileName;
            HlDataTable.Rows.Clear();

            for (int i = 1; i <= Xls.HyperLinkCount; i++)
            {
                TXlsCellRange Range = Xls.GetHyperLinkCellRange(i);
                THyperLink HLink = Xls.GetHyperLink(i);

                string HLinkType = Enum.GetName(typeof(THyperLinkType), HLink.LinkType);

                object[] values ={i, TCellAddress.EncodeColumn(Range.Left)+Range.Top.ToString(),
                                     TCellAddress.EncodeColumn(Range.Right)+Range.Bottom.ToString(),
                                     HLinkType,
                                     HLink.Text,
                                     HLink.Description,
                                     HLink.TextMark,
                                     HLink.TargetFrame,
                                     HLink.Hint
                                };
                HlDataTable.Rows.Add(values);

            }

        }

        private void writeHyperLinks_Click(object sender, System.EventArgs e)
        {
            if (Xls == null)
            {
                MessageBox.Show("You need to open a file first.");
                return;
            }

            ExcelFile XlsOut = new XlsFile(true);
            XlsOut.NewFile(1, TExcelFileFormat.v2019);

            for (int i = 1; i <= Xls.HyperLinkCount; i++)
            {
                TXlsCellRange Range = Xls.GetHyperLinkCellRange(i);
                THyperLink HLink = Xls.GetHyperLink(i);

                int XF = -1;
                object Value = Xls.GetCellValue(Range.Top, Range.Left, ref XF);
                XlsOut.SetCellValue(i, 1, Value, XlsOut.AddFormat(Xls.GetFormat(XF)));
                XlsOut.AddHyperLink(new TXlsCellRange(i, 1, i, 1), HLink);
            }

            if (saveFileDialog1.ShowDialog() != DialogResult.OK) return;
            XlsOut.Save(saveFileDialog1.FileName);
            if (MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) == DialogResult.Yes)
            {
                    using (Process p = new Process())
                    {
                        p.StartInfo.FileName = saveFileDialog1.FileName;
                        p.StartInfo.UseShellExecute = true;
                        p.Start();
                    }
            }
        }

    }
}

Form1.Designer.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using System.IO;
using System.Diagnostics;
using System.Reflection;
namespace HyperLinks
{
    public partial class mainForm: System.Windows.Forms.Form
    {
        private System.Windows.Forms.SaveFileDialog saveFileDialog1;
        private System.Windows.Forms.OpenFileDialog openFileDialog1;
        private System.Windows.Forms.DataGrid dataGrid;
        private System.Data.DataSet dataSet1;
        private System.Data.DataTable HlDataTable;
        private System.Data.DataColumn Index;
        private System.Data.DataColumn Cell1;
        private System.Data.DataColumn Cell2;
        private System.Data.DataColumn cType;
        private System.Data.DataColumn Description;
        private System.Data.DataColumn TextMark;
        private System.Data.DataColumn TargetFrame;
        private System.Data.DataColumn cText;
        private System.Data.DataColumn cHint;
        private System.Windows.Forms.DataGridTableStyle dataGridTableStyle1;
        private System.Windows.Forms.DataGridTextBoxColumn dataGridTextBoxColumn1;
        private System.Windows.Forms.DataGridTextBoxColumn dataGridTextBoxColumn2;
        private System.Windows.Forms.DataGridTextBoxColumn dataGridTextBoxColumn3;
        private System.Windows.Forms.DataGridTextBoxColumn dataGridTextBoxColumn4;
        private System.Windows.Forms.DataGridTextBoxColumn dataGridTextBoxColumn5;
        private System.Windows.Forms.DataGridTextBoxColumn dataGridTextBoxColumn6;
        private System.Windows.Forms.DataGridTextBoxColumn dataGridTextBoxColumn7;
        private System.Windows.Forms.DataGridTextBoxColumn dataGridTextBoxColumn8;
        private System.Windows.Forms.DataGridTextBoxColumn dataGridTextBoxColumn9;
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(mainForm));
            this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog();
            this.dataGrid = new System.Windows.Forms.DataGrid();
            this.HlDataTable = new System.Data.DataTable();
            this.Index = new System.Data.DataColumn();
            this.Cell1 = new System.Data.DataColumn();
            this.Cell2 = new System.Data.DataColumn();
            this.cType = new System.Data.DataColumn();
            this.cText = new System.Data.DataColumn();
            this.Description = new System.Data.DataColumn();
            this.TextMark = new System.Data.DataColumn();
            this.TargetFrame = new System.Data.DataColumn();
            this.cHint = new System.Data.DataColumn();
            this.dataGridTableStyle1 = new System.Windows.Forms.DataGridTableStyle();
            this.dataGridTextBoxColumn1 = new System.Windows.Forms.DataGridTextBoxColumn();
            this.dataGridTextBoxColumn2 = new System.Windows.Forms.DataGridTextBoxColumn();
            this.dataGridTextBoxColumn3 = new System.Windows.Forms.DataGridTextBoxColumn();
            this.dataGridTextBoxColumn4 = new System.Windows.Forms.DataGridTextBoxColumn();
            this.dataGridTextBoxColumn5 = new System.Windows.Forms.DataGridTextBoxColumn();
            this.dataGridTextBoxColumn6 = new System.Windows.Forms.DataGridTextBoxColumn();
            this.dataGridTextBoxColumn7 = new System.Windows.Forms.DataGridTextBoxColumn();
            this.dataGridTextBoxColumn8 = new System.Windows.Forms.DataGridTextBoxColumn();
            this.dataGridTextBoxColumn9 = new System.Windows.Forms.DataGridTextBoxColumn();
            this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
            this.dataSet1 = new System.Data.DataSet();
            this.mainToolbar = new System.Windows.Forms.ToolStrip();
            this.btnReadHyperlinks = new System.Windows.Forms.ToolStripButton();
            this.btnWriteHyperlinks = new System.Windows.Forms.ToolStripButton();
            this.btnExit = new System.Windows.Forms.ToolStripButton();
            ((System.ComponentModel.ISupportInitialize)(this.dataGrid)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.HlDataTable)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.dataSet1)).BeginInit();
            this.mainToolbar.SuspendLayout();
            this.SuspendLayout();
            //
            // saveFileDialog1
            //
            this.saveFileDialog1.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm|Excel 97/2003|*.xls|Excel 2007|*.xlsx;*.xlsm|All " +
    "files|*.*";
            this.saveFileDialog1.RestoreDirectory = true;
            this.saveFileDialog1.Title = "Save the file as...";
            //
            // dataGrid
            //
            this.dataGrid.CaptionText = "No file selected";
            this.dataGrid.DataMember = "";
            this.dataGrid.DataSource = this.HlDataTable;
            this.dataGrid.Dock = System.Windows.Forms.DockStyle.Fill;
            this.dataGrid.HeaderForeColor = System.Drawing.SystemColors.ControlText;
            this.dataGrid.Location = new System.Drawing.Point(0, 38);
            this.dataGrid.Name = "dataGrid";
            this.dataGrid.ReadOnly = true;
            this.dataGrid.Size = new System.Drawing.Size(768, 327);
            this.dataGrid.TabIndex = 3;
            this.dataGrid.TableStyles.AddRange(new System.Windows.Forms.DataGridTableStyle[] {
            this.dataGridTableStyle1});
            //
            // HlDataTable
            //
            this.HlDataTable.Columns.AddRange(new System.Data.DataColumn[] {
            this.Index,
            this.Cell1,
            this.Cell2,
            this.cType,
            this.cText,
            this.Description,
            this.TextMark,
            this.TargetFrame,
            this.cHint});
            this.HlDataTable.TableName = "HlDataTable";
            //
            // Index
            //
            this.Index.ColumnName = "Index";
            //
            // Cell1
            //
            this.Cell1.ColumnName = "Cell1";
            //
            // Cell2
            //
            this.Cell2.ColumnName = "Cell2";
            //
            // cType
            //
            this.cType.ColumnName = "Type";
            //
            // cText
            //
            this.cText.ColumnName = "Text";
            //
            // Description
            //
            this.Description.ColumnName = "Description";
            //
            // TextMark
            //
            this.TextMark.ColumnName = "TextMark";
            //
            // TargetFrame
            //
            this.TargetFrame.ColumnName = "TargetFrame";
            //
            // cHint
            //
            this.cHint.ColumnName = "Hint";
            //
            // dataGridTableStyle1
            //
            this.dataGridTableStyle1.DataGrid = this.dataGrid;
            this.dataGridTableStyle1.GridColumnStyles.AddRange(new System.Windows.Forms.DataGridColumnStyle[] {
            this.dataGridTextBoxColumn1,
            this.dataGridTextBoxColumn2,
            this.dataGridTextBoxColumn3,
            this.dataGridTextBoxColumn4,
            this.dataGridTextBoxColumn5,
            this.dataGridTextBoxColumn6,
            this.dataGridTextBoxColumn7,
            this.dataGridTextBoxColumn8,
            this.dataGridTextBoxColumn9});
            this.dataGridTableStyle1.HeaderForeColor = System.Drawing.SystemColors.ControlText;
            this.dataGridTableStyle1.MappingName = "HlDataTable";
            this.dataGridTableStyle1.PreferredColumnWidth = 15;
            //
            // dataGridTextBoxColumn1
            //
            this.dataGridTextBoxColumn1.Format = "";
            this.dataGridTextBoxColumn1.FormatInfo = null;
            this.dataGridTextBoxColumn1.HeaderText = "Index";
            this.dataGridTextBoxColumn1.MappingName = "Index";
            this.dataGridTextBoxColumn1.Width = 35;
            //
            // dataGridTextBoxColumn2
            //
            this.dataGridTextBoxColumn2.Format = "";
            this.dataGridTextBoxColumn2.FormatInfo = null;
            this.dataGridTextBoxColumn2.HeaderText = "Cell1";
            this.dataGridTextBoxColumn2.MappingName = "Cell1";
            this.dataGridTextBoxColumn2.Width = 40;
            //
            // dataGridTextBoxColumn3
            //
            this.dataGridTextBoxColumn3.Format = "";
            this.dataGridTextBoxColumn3.FormatInfo = null;
            this.dataGridTextBoxColumn3.HeaderText = "Cell2";
            this.dataGridTextBoxColumn3.MappingName = "Cell2";
            this.dataGridTextBoxColumn3.Width = 40;
            //
            // dataGridTextBoxColumn4
            //
            this.dataGridTextBoxColumn4.Format = "";
            this.dataGridTextBoxColumn4.FormatInfo = null;
            this.dataGridTextBoxColumn4.HeaderText = "Type";
            this.dataGridTextBoxColumn4.MappingName = "Type";
            this.dataGridTextBoxColumn4.Width = 75;
            //
            // dataGridTextBoxColumn5
            //
            this.dataGridTextBoxColumn5.Format = "";
            this.dataGridTextBoxColumn5.FormatInfo = null;
            this.dataGridTextBoxColumn5.HeaderText = "Text";
            this.dataGridTextBoxColumn5.MappingName = "Text";
            this.dataGridTextBoxColumn5.Width = 150;
            //
            // dataGridTextBoxColumn6
            //
            this.dataGridTextBoxColumn6.Format = "";
            this.dataGridTextBoxColumn6.FormatInfo = null;
            this.dataGridTextBoxColumn6.HeaderText = "Description";
            this.dataGridTextBoxColumn6.MappingName = "Description";
            this.dataGridTextBoxColumn6.Width = 150;
            //
            // dataGridTextBoxColumn7
            //
            this.dataGridTextBoxColumn7.Format = "";
            this.dataGridTextBoxColumn7.FormatInfo = null;
            this.dataGridTextBoxColumn7.HeaderText = "TextMark";
            this.dataGridTextBoxColumn7.MappingName = "TextMark";
            this.dataGridTextBoxColumn7.Width = 75;
            //
            // dataGridTextBoxColumn8
            //
            this.dataGridTextBoxColumn8.Format = "";
            this.dataGridTextBoxColumn8.FormatInfo = null;
            this.dataGridTextBoxColumn8.HeaderText = "TargetFrame";
            this.dataGridTextBoxColumn8.MappingName = "TargetFrame";
            this.dataGridTextBoxColumn8.Width = 75;
            //
            // dataGridTextBoxColumn9
            //
            this.dataGridTextBoxColumn9.Format = "";
            this.dataGridTextBoxColumn9.FormatInfo = null;
            this.dataGridTextBoxColumn9.HeaderText = "Hint";
            this.dataGridTextBoxColumn9.MappingName = "Hint";
            this.dataGridTextBoxColumn9.Width = 75;
            //
            // openFileDialog1
            //
            this.openFileDialog1.DefaultExt = "xls";
            this.openFileDialog1.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm|Excel 97/2003|*.xls|Excel 2007|*.xlsx;*.xlsm|All " +
    "files|*.*";
            this.openFileDialog1.Title = "Open an Excel File";
            //
            // dataSet1
            //
            this.dataSet1.DataSetName = "HlDataSet";
            this.dataSet1.Locale = new System.Globalization.CultureInfo("");
            this.dataSet1.Tables.AddRange(new System.Data.DataTable[] {
            this.HlDataTable});
            //
            // mainToolbar
            //
            this.mainToolbar.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.btnReadHyperlinks,
            this.btnWriteHyperlinks,
            this.btnExit});
            this.mainToolbar.Location = new System.Drawing.Point(0, 0);
            this.mainToolbar.Name = "mainToolbar";
            this.mainToolbar.Size = new System.Drawing.Size(768, 38);
            this.mainToolbar.TabIndex = 11;
            this.mainToolbar.Text = "toolStrip1";
            //
            // btnReadHyperlinks
            //
            this.btnReadHyperlinks.Image = ((System.Drawing.Image)(resources.GetObject("btnReadHyperlinks.Image")));
            this.btnReadHyperlinks.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.btnReadHyperlinks.Name = "btnReadHyperlinks";
            this.btnReadHyperlinks.Size = new System.Drawing.Size(96, 35);
            this.btnReadHyperlinks.Text = "Read Hyperlinks";
            this.btnReadHyperlinks.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
            this.btnReadHyperlinks.Click += new System.EventHandler(this.ReadHyperLinks_Click);
            //
            // btnWriteHyperlinks
            //
            this.btnWriteHyperlinks.Image = ((System.Drawing.Image)(resources.GetObject("btnWriteHyperlinks.Image")));
            this.btnWriteHyperlinks.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.btnWriteHyperlinks.Name = "btnWriteHyperlinks";
            this.btnWriteHyperlinks.Size = new System.Drawing.Size(98, 43);
            this.btnWriteHyperlinks.Text = "Write Hyperlinks";
            this.btnWriteHyperlinks.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
            this.btnWriteHyperlinks.Click += new System.EventHandler(this.writeHyperLinks_Click);
            //
            // btnExit
            //
            this.btnExit.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right;
            this.btnExit.Image = ((System.Drawing.Image)(resources.GetObject("btnExit.Image")));
            this.btnExit.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.btnExit.Name = "btnExit";
            this.btnExit.Size = new System.Drawing.Size(59, 35);
            this.btnExit.Text = "     E&xit     ";
            this.btnExit.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
            this.btnExit.Click += new System.EventHandler(this.button2_Click);
            //
            // mainForm
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(768, 365);
            this.Controls.Add(this.dataGrid);
            this.Controls.Add(this.mainToolbar);
            this.Name = "mainForm";
            this.Text = "Form1";
            ((System.ComponentModel.ISupportInitialize)(this.dataGrid)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.HlDataTable)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.dataSet1)).EndInit();
            this.mainToolbar.ResumeLayout(false);
            this.mainToolbar.PerformLayout();
            this.ResumeLayout(false);
            this.PerformLayout();

        }
        #endregion

        private ToolStrip mainToolbar;
        private ToolStripButton btnReadHyperlinks;
        private ToolStripButton btnWriteHyperlinks;
        private ToolStripButton btnExit;
    }
}

Program.cs

using System;
using System.Windows.Forms;

namespace HyperLinks
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new mainForm());
        }
    }
}


Intelligent page breaks (C# / netframework) | FlexCel Studio for the .NET Framework documentation

Intelligent page breaks (C# / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\csharp\VS2022\netframework\10.API\72.Intelligent Page Breaks and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​csharp/​VS2022/​netframework/​Modules/​10.​API/​72.​Intelligent Page Breaks

Overview

While there is no direct support in Excel for Widow/Orphan control, FlexCel has the capacity to add page breaks to your file, so you can keep interesting sections together.

Make sure to read the conceptual documentation about Intelligent Page Breaks to better understand what we are doing here.

Concepts

  • How to add automatic page breaks to a sheet. In this case, we are dumping a C# file to PDF, and we want to keep procedures in the same page is possible.

  • How to deal with different levels of "keep together". FlexCel allows you to make some rows more "keep together" than others, if it can't fit everything in the same page, it will try to keep the rows of higher "keep together". We use this here to try to keep full classes first, if it is not possible full procedures, if not full for/while loops, etc.\ Each "{" sign in the source file means higher level of "keep together", and each "}" decreases the level.

  • The method ExcelFile.AutoPageBreaks must be called after everything is done, so the sheet is in a final state when applying the page breaks.

Files

AssemblyInfo.cs

using System.Reflection;
using System.Runtime.CompilerServices;

//
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
//
[assembly: AssemblyTitle("")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("(c) 2002 - 2024 TMS Software")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

//
// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version
//      Build Number
//      Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:

[assembly: AssemblyVersion("7.21.0.0")]

//
// In order to sign your assembly you must specify a key to use. Refer to the
// Microsoft .NET Framework documentation for more information on assembly signing.
//
// Use the attributes below to control which key is used for signing.
//
// Notes:
//   (*) If no key is specified, the assembly is not signed.
//   (*) KeyName refers to a key that has been installed in the Crypto Service
//       Provider (CSP) on your machine. KeyFile refers to a file which contains
//       a key.
//   (*) If the KeyFile and the KeyName values are both specified, the
//       following processing occurs:
//       (1) If the KeyName can be found in the CSP, that key is used.
//       (2) If the KeyName does not exist and the KeyFile does exist, the key
//           in the KeyFile is installed into the CSP and used.
//   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
//       When specifying the KeyFile, the location of the KeyFile should be
//       relative to the project output directory which is
//       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
//       located in the project directory, you would specify the AssemblyKeyFile
//       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
//   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
//       documentation for more information on this.
//
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]
[assembly: AssemblyKeyName("")]

Form1.cs

using System;
using System.Drawing;
using System.Collections.Generic;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using System.IO;
using System.Diagnostics;
using System.Reflection;
using System.Text;

using FlexCel.Render;

namespace IntelligentPageBreaks
{
    /// <summary>
    /// Demo showing how to create intelligent page breaks with the API.
    /// </summary>
    public partial class mainForm: System.Windows.Forms.Form
    {
        public mainForm()
        {
            InitializeComponent();
        }

        private Dictionary<string, string> Keywords = CreateKeywords();

        private static Dictionary<string, string> CreateKeywords()
        {
            // A very silly syntax highlighter. We don't have any context here, so for example "get" will be highlighted when it is a property or when it is not, but it is ok for this demo.
            Dictionary<string, string> Result = new Dictionary<string, string>();

            Result.Add("private", null);
            Result.Add("public", null);
            Result.Add("protected", null);
            Result.Add("internal", null);
            Result.Add("static", null);
            Result.Add("void", null);
            Result.Add("get", null);
            Result.Add("set", null);
            Result.Add("return", null);
            Result.Add("while", null);
            Result.Add("for", null);
            Result.Add("foreach", null);
            Result.Add("using", null);
            Result.Add("true", null);
            Result.Add("false", null);

            return Result;
        }

        private string PathToExe
        {
            get
            {
                return Path.Combine(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), ".."), "..") + Path.DirectorySeparatorChar;
            }
        }

        private TRichString SyntaxColor(ExcelFile Xls, int NormalFont, int CommentFont, int HighlightFont, string line)
        {
            List<TRTFRun> RTFRunList = new List<TRTFRun>();

            int i = 0;
            while (i < line.Length)
            {
                if (i > 0 && line[i - 1] == '/' && line[i] == '/')
                {
                    TRTFRun rtf;
                    rtf.FirstChar = i - 1;
                    rtf.FontIndex = CommentFont;
                    RTFRunList.Add(rtf);
                    return new TRichString(line, RTFRunList.ToArray(), Xls);

                }

                int start = i;
                while (i < line.Length && char.IsLetterOrDigit(line[i]))
                {
                    i++;
                }

                if (i > start && Keywords.ContainsKey(line.Substring(start, i - start)))
                {
                    TRTFRun rtf;
                    rtf.FirstChar = start;
                    rtf.FontIndex = HighlightFont;
                    RTFRunList.Add(rtf);
                    rtf.FirstChar = i;
                    rtf.FontIndex = NormalFont;
                    RTFRunList.Add(rtf);
                }

                i++;
            }

            return new TRichString(line, RTFRunList.ToArray(), Xls);
        }

        private void DumpFile(ExcelFile Xls, ref int Row)
        {
            TFlxFont fnt = Xls.GetDefaultFont;
            fnt.Color = Color.Blue;
            int HighlightFont = Xls.AddFont(fnt);
            fnt.Color = Color.Green;
            int CommentFont = Xls.AddFont(fnt);

            int Level = 0;
            Stack<int> LevelStart = new Stack<int>();
            LevelStart.Push(Row);

            using (StreamReader sr = new StreamReader(Path.Combine(PathToExe, "Form1.cs")))
            {
                string line;
                while ((line = sr.ReadLine()) != null)
                {
                    //Find the level of "keep together" for the row. We will use #region and "{" delimiters
                    //to increase the level. If possible, we would want those blocks together in one page.
                    string s = line.Trim();
                    if (s.StartsWith("#region")) { Level++; LevelStart.Push(Row); }
                    if (s == "{")
                    {
                        Level++;
                        LevelStart.Push(Row - 1);//On {} blocks, we want to keep lines together starting with the previous statement.
                    }

                    if (s == "#endregion" || s == "}")
                    {
                        Level--;
                        Xls.KeepRowsTogether(LevelStart.Pop(), Row, Level + 1, false);
                    }

                    Xls.KeepRowsTogether(Row, Row, Level, true);

                    Xls.SetCellValue(Row, 1, SyntaxColor(Xls, 0, CommentFont, HighlightFont, line.Replace("\t", "    ")));
                    Row++;
                }
            }
        }

        private void AddData(ExcelFile Xls)
        {

            //Fill the file with the contents of this c# file, many times so we can see many page breaks.
            int Row = 3;
            DumpFile(Xls, ref Row);

            Xls.AutofitRowsOnWorkbook(false, true, 1);
            Xls.AutoPageBreaks(50, 100); // we will use a 100% of page scale since we are printing to pdf.
                                         //If this was to create an Excel file, pagescale should be lower to
                                         //compensate the differences between page sizes in diiferent printers in Excel

            //Export the file to PDF so we can see the page breaks.
            using (FlexCelPdfExport pdf = new FlexCelPdfExport(Xls, true))
            {
                pdf.Export(saveFileDialog1.FileName);
            }

        }

        private void button1_Click(object sender, System.EventArgs e)
        {
            AutoRun();
        }

        public void AutoRun()
        {
            if (saveFileDialog1.ShowDialog() != DialogResult.OK) return;
            ExcelFile Xls = new XlsFile(true);
            Xls.NewFile(1, TExcelFileFormat.v2019);
            Xls.SetColWidth(1, 78 * 256); //;make longer lines wrap in the cell.
            TFlxFormat fmt = Xls.GetFormat(Xls.GetColFormat(1));
            fmt.WrapText = true;

            Xls.SetColFormat(1, Xls.AddFormat(fmt));
            AddData(Xls);
            if (MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) == DialogResult.Yes)
            {
                using (Process p = new Process())
                {
                    p.StartInfo.FileName = saveFileDialog1.FileName;
                    p.StartInfo.UseShellExecute = true;
                    p.Start();
                }
            }

        }
    }
}

Form1.Designer.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using System.IO;
using System.Diagnostics;
using System.Reflection;
using System.Text;
using FlexCel.Render;
namespace IntelligentPageBreaks
{
    public partial class mainForm: System.Windows.Forms.Form
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.Container components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.button1 = new System.Windows.Forms.Button();
            this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog();
            this.label1 = new System.Windows.Forms.Label();
            this.SuspendLayout();
            //
            // button1
            //
            this.button1.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
            this.button1.Location = new System.Drawing.Point(132, 73);
            this.button1.Name = "button1";
            this.button1.TabIndex = 0;
            this.button1.Text = "GO!";
            this.button1.Click += new System.EventHandler(this.button1_Click);
            //
            // saveFileDialog1
            //
            this.saveFileDialog1.Filter = "Pdf Files|*.pdf";
            this.saveFileDialog1.RestoreDirectory = true;
            this.saveFileDialog1.Title = "Select PDF file to save";
            //
            // label1
            //
            this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
                | System.Windows.Forms.AnchorStyles.Left)
                | System.Windows.Forms.AnchorStyles.Right)));
            this.label1.BackColor = System.Drawing.Color.FromArgb(((System.Byte)(255)), ((System.Byte)(255)), ((System.Byte)(192)));
            this.label1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.label1.Location = new System.Drawing.Point(16, 16);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(312, 32);
            this.label1.TabIndex = 1;
            this.label1.Text = "A  demo on how to have FlexCel paginate your documents so they keep their section" +
                "s together.";
            //
            // mainForm
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(336, 110);
            this.Controls.Add(this.label1);
            this.Controls.Add(this.button1);
            this.Name = "mainForm";
            this.Text = "Intelligent Page Breaks";
            this.ResumeLayout(false);

        }
        #endregion

        private System.Windows.Forms.Button button1;
        private System.Windows.Forms.SaveFileDialog saveFileDialog1;
        private System.Windows.Forms.Label label1;

    }
}

Program.cs

using System;
using System.Windows.Forms;

namespace IntelligentPageBreaks
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new mainForm());
        }
    }
}


Validating FlexCel recalculation (C# / netframework) | FlexCel Studio for the .NET Framework documentation

Validating FlexCel recalculation (C# / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\csharp\VS2022\netframework\10.API\75.Validate Recalc and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​csharp/​VS2022/​netframework/​Modules/​10.​API/​75.​Validate Recalc

Overview

By default, FlexCel recalculates the files it generates before saving. This is not completely necessary for normal xls/x files, because Excel will recalculate the file again when opening. But when natively printing or exporting to PDF, you need the values from the recalculation, because no Excel is involved in the process.

While most files will recalculate fine, if you have complex formulas and need to verify they will recalculate ok, this is the application to use.

Concepts

  • Button "Validate Recalc": This will verify that flexcel can understand all the formulas on your sheet.

  • Button "Compare with Excel": This will open a file you saved with Excel, force a recalculation in FlexCel and then compare all formula results with the original ones. You can use this to verify the results are actually what you expect them to be.

Files

AssemblyInfo.cs

using System.Reflection;
using System.Runtime.CompilerServices;

//
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
//
[assembly: AssemblyTitle("")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("(c) 2002 - 2024 TMS Software")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

//
// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version
//      Build Number
//      Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:

[assembly: AssemblyVersion("7.21.0.0")]

//
// In order to sign your assembly you must specify a key to use. Refer to the
// Microsoft .NET Framework documentation for more information on assembly signing.
//
// Use the attributes below to control which key is used for signing.
//
// Notes:
//   (*) If no key is specified, the assembly is not signed.
//   (*) KeyName refers to a key that has been installed in the Crypto Service
//       Provider (CSP) on your machine. KeyFile refers to a file which contains
//       a key.
//   (*) If the KeyFile and the KeyName values are both specified, the
//       following processing occurs:
//       (1) If the KeyName can be found in the CSP, that key is used.
//       (2) If the KeyName does not exist and the KeyFile does exist, the key
//           in the KeyFile is installed into the CSP and used.
//   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
//       When specifying the KeyFile, the location of the KeyFile should be
//       relative to the project output directory which is
//       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
//       located in the project directory, you would specify the AssemblyKeyFile
//       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
//   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
//       documentation for more information on this.
//
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]
[assembly: AssemblyKeyName("")]

Form1.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using System.IO;
using System.Diagnostics;
using System.Reflection;

namespace ValidateRecalc
{
    /// <summary>
    /// Use this demo to validate the recalculation made by FlexCel.
    /// </summary>
    public partial class mainForm: System.Windows.Forms.Form
    {
        private FlexCel.Report.FlexCelReport XlsReport;

        public mainForm()
        {
            InitializeComponent();
            ResizeToolbar(mainToolbar);
        }

        private void ResizeToolbar(ToolStrip toolbar)
        {

            using (Graphics gr = CreateGraphics())
            {
                double xFactor = gr.DpiX / 96.0;
                double yFactor = gr.DpiY / 96.0;
                toolbar.ImageScalingSize = new Size((int)(24 * xFactor), (int)(24 * yFactor));
                toolbar.Width = 0; //force a recalc of the buttons.
            }
        }

        private void button2_Click(object sender, System.EventArgs e)
        {
            Close();
        }

        private void btnInfo_Click(object sender, EventArgs e)
        {
            MessageBox.Show("This example will validate the calculations performed by the FlexCel engine.\n" +
            "It can do it in 2 different ways:\n" +
            "  1) The button 'Validate Recalc' will analyze a file, and report if there is anything that FlexCel doesn't support on it.\n" +
            "  2) The button 'Compare with Excel' will open a file saved by Excel, recalculate it with FlexCel, compare the values reported by both FlexCel and Excel and report if there are any differences.");
        }

        private void validateRecalc_Click(object sender, System.EventArgs e)
        {
            if (openFileDialog1.ShowDialog() != DialogResult.OK) return;
            XlsFile Xls = new XlsFile();

            Xls.Open(openFileDialog1.FileName);

            // /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
            // ////////Code here is only needed if you have linked files. In this example we don't know, so we will use it /////////
            TWorkspace Work = new TWorkspace(); //Create a workspace
            Work.Add(Path.GetFileName(openFileDialog1.FileName), Xls);  //Add the original file to it
            Work.LoadLinkedFile += new LoadLinkedFileEventHandler(Work_LoadLinkedFile);  //Set up an event to load the linked files.
                                                                                // /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

            report.Text = "Results on file: " + openFileDialog1.FileName;
            TUnsupportedFormulaList Usl = Xls.RecalcAndVerify();
            if (Usl.Count == 0)
            {
                report.Text += "\n**********All formulas supported!**********";
                return;
            }

            report.Text += "\nIssues Found:";
            for (int i = 0; i < Usl.Count; i++)
            {
                string FileName = String.Empty;
                if (Usl[i].FileName != null) FileName = "File: " + Usl[i].FileName + "  => ";
                report.Text += "\n     " + FileName + Usl[i].Cell.CellRef + ": " + Usl[i].ErrorType.ToString();
                if (Usl[i].StackTrace != null)
                {
                    for (int k = 0; k < Usl[i].StackTrace.Length; k++)
                    {
                        if (Usl[i].StackTrace[k].Address != null)
                        {
                            String TraceFileName = Usl[i].StackTrace[k].FileName == null ? "" : "[" + Usl[i].StackTrace[k].FileName + "]";
                            report.Text += "\n         -> References cell: " + TraceFileName + Usl[i].StackTrace[k].Address.CellRef;
                        }
                    }
                }
                if (Usl[i].FunctionName != null)
                {
                    string FunctionStr = "Function";
                    if (Usl[i].ErrorType == TUnsupportedFormulaErrorType.ExternalReference) FunctionStr = "Linked file not found";
                    report.Text += " ->" + FunctionStr + ": " + Usl[i].FunctionName;
                }
            }
        }

        private void compareWithExcel_Click(object sender, System.EventArgs e)
        {
            if (openFileDialog1.ShowDialog() != DialogResult.OK) return;
            compareWithExcel.Enabled = false;
            validateRecalc.Enabled = false;
            try
            {
                XlsFile xls1 = new XlsFile();
                XlsFile xls2 = new XlsFile();

                xls1.Open(openFileDialog1.FileName);
                xls2.Open(openFileDialog1.FileName);
                report.Text = "Compare with Excel: " + openFileDialog1.FileName;

                // /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
                // ////////Code here is only needed if you have linked files. In this example we don't know, so we will use it /////////
                TWorkspace Work = new TWorkspace(); //Create a workspace
                Work.Add(Path.GetFileName(openFileDialog1.FileName), xls1);  //Add the original file to it
                Work.LoadLinkedFile += new LoadLinkedFileEventHandler(Work_LoadLinkedFile);  //Set up an event to load the linked files.
                                                                                // /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

                CompareXls(xls1, xls2, null);
            }
            finally
            {
                compareWithExcel.Enabled = true;
                validateRecalc.Enabled = true;
            }
        }

        private void CompareXls(XlsFile xls1, XlsFile xls2, DataTable table)
        {
            int DiffCount = 0;
            xls1.Recalc();

            for (int sheet = 1; sheet <= xls1.SheetCount; sheet++)
            {
                xls1.ActiveSheet = sheet;
                xls2.ActiveSheet = sheet;
                int aColCount = xls1.ColCount;
                for (int r = 1; r <= xls1.RowCount; r++)
                    for (int c = 1; c <= aColCount; c++)
                    {
                        TFormula f = xls1.GetCellValue(r, c) as TFormula;
                        if (f != null)
                        {
                            TCellAddress ad = new TCellAddress(r, c);
                            TFormula f2 = (TFormula)xls2.GetCellValue(r, c);
                            if (f.Result == null) f.Result = "";
                            if (f2.Result == null) f2.Result = "";
                            double eps = 0;
                            if (f.Result is Double && f2.Result is Double)
                            {
                                if ((Double)f2.Result == 0)
                                {
                                    if (Math.Abs((double)f.Result) < Double.Epsilon)
                                        eps = 0;
                                    else
                                        eps = Double.NaN;
                                }
                                else
                                    eps = (double)f.Result / (Double)f2.Result;
                                if (Math.Abs(eps - 1) < 0.001)
                                    f.Result = f2.Result;
                            }
                            if (!f.Result.Equals(f2.Result))
                            {
                                if (table == null)
                                {
                                    report.Text += "\nSheet:" + xls1.SheetName + " --- Cell:" + ad.CellRef + " --- Calculated: " + f.Result.ToString() + "    Excel: " + f2.Result.ToString() + "  dif: " + eps.ToString() + "   formula: " + f.Text;
                                    Application.DoEvents();
                                }
                                else
                                {
                                    table.Rows.Add(new object[] { xls1.SheetName, ad.CellRef, f.Result.ToString(), f2.Result.ToString(), eps.ToString(), f.Text });
                                }
                                DiffCount++;

                            }
                        }
                    }
            }

            if (table == null)
            {
                report.Text += "\nFinished Comparing.";
                if (DiffCount == 0) report.Text += "\n**********No differences found!**********";
                else
                    report.Text += String.Format("\n  --->Found {0} differences", DiffCount);
            }
        }

        private void ValidateXls(XlsFile xls, DataTable table)
        {
            TUnsupportedFormulaList Usl = xls.RecalcAndVerify();
            for (int i = 0; i < Usl.Count; i++)
            {
                table.Rows.Add(new object[]
                    {
                        Usl[i].FileName,
                        Usl[i].Cell.CellRef,
                        Usl[i].ErrorType.ToString(),
                        Usl[i].FunctionName
                    });
            }
        }

        /// <summary>
        /// This is the method that will be called by the ASP.NET front end. It returns an array of bytes
        /// with the report data, so the ASP.NET application can stream it to the client.
        /// </summary>
        /// <returns>The generated file as a byte array.</returns>
        public byte[] WebRun(Stream DataStream, string FileName)
        {
            XlsReport.SetValue("Date", DateTime.Now);
            XlsReport.SetValue("FileName", FileName);
            DataSet Data = new DataSet();
            DataTable ValidateResult = Data.Tables.Add("ValidateResult");
            ValidateResult.Columns.Add("FileName", typeof(string));
            ValidateResult.Columns.Add("CellRef", typeof(string));
            ValidateResult.Columns.Add("ErrorType", typeof(string));
            ValidateResult.Columns.Add("FunctionName", typeof(string));

            DataTable CompareResult = Data.Tables.Add("CompareResult");
            CompareResult.Columns.Add("SheetName", typeof(string));
            CompareResult.Columns.Add("CellRef", typeof(string));
            CompareResult.Columns.Add("CalcResult", typeof(string));
            CompareResult.Columns.Add("XlsResult", typeof(string));
            CompareResult.Columns.Add("Diff", typeof(string));
            CompareResult.Columns.Add("FormulaText", typeof(string));

            XlsReport.AddTable(Data);

            XlsFile xls1 = new XlsFile();
            XlsFile xls2 = new XlsFile();

            xls1.Open(DataStream);
            DataStream.Position = 0;
            xls2.Open(DataStream);

            CompareXls(xls1, xls2, CompareResult);
            ValidateXls(xls1, ValidateResult);

            string DataPath = Path.Combine(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), ".."), "..") + Path.DirectorySeparatorChar;

            using (MemoryStream OutStream = new MemoryStream())
            {
                using (FileStream InStream = new FileStream(DataPath + "ValidateReport.xls", FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
                {
                    XlsReport.Run(InStream, OutStream);
                    return OutStream.ToArray();
                }
            }
        }

        /// <summary>
        /// This event is used when there are linked files, to load them on demand.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Work_LoadLinkedFile(object sender, LoadLinkedFileEventArgs e)
        {
            //IMPORTANT: DO NOT USE THIS METHOD IN PRODUCTION IF SECURITY IS IMPORTANT.
            //This method will access any file in your harddisk, as long as it is linked in the spreaadhseet, and
            //that could mean an IMPORTANT SECURITY RISK. You should limit the places where the app can search for
            //linked files. Look at the "Recalculating Linked Files" in the PDF API Guide for more information.

            string FilePath = Path.Combine(Path.GetDirectoryName(openFileDialog1.FileName), e.FileName);

            if (File.Exists(FilePath)) //If we find the path, just load the file.
            {
                e.Xls = new XlsFile();
                e.Xls.Open(FilePath);
                return;
            }

            //If we couldn't find the file, ask the user for its location.
            linkedFileDialog.FileName = FilePath;
            if (linkedFileDialog.ShowDialog() != DialogResult.OK) return;  //if user cancels, e.Xls will be null, so no file will be used and an #errna error will show in the formulas.

            e.Xls = new XlsFile();
            e.Xls.Open(linkedFileDialog.FileName);

        }

    }

}

Form1.Designer.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using System.IO;
using System.Diagnostics;
using System.Reflection;
namespace ValidateRecalc
{
    public partial class mainForm: System.Windows.Forms.Form
    {
        private System.Windows.Forms.OpenFileDialog openFileDialog1;
        private System.Windows.Forms.RichTextBox report;
        private System.Windows.Forms.OpenFileDialog linkedFileDialog;
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(mainForm));
            this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
            this.report = new System.Windows.Forms.RichTextBox();
            this.XlsReport = new FlexCel.Report.FlexCelReport();
            this.linkedFileDialog = new System.Windows.Forms.OpenFileDialog();
            this.mainToolbar = new System.Windows.Forms.ToolStrip();
            this.validateRecalc = new System.Windows.Forms.ToolStripButton();
            this.compareWithExcel = new System.Windows.Forms.ToolStripButton();
            this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
            this.btnInfo = new System.Windows.Forms.ToolStripButton();
            this.btnExit = new System.Windows.Forms.ToolStripButton();
            this.mainToolbar.SuspendLayout();
            this.SuspendLayout();
            //
            // openFileDialog1
            //
            this.openFileDialog1.DefaultExt = "xls";
            this.openFileDialog1.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm|Excel 97/2003|*.xls|Excel 2007|*.xlsx;*.xlsm|All " +
    "files|*.*";
            this.openFileDialog1.Title = "Open an Excel File";
            //
            // report
            //
            this.report.Dock = System.Windows.Forms.DockStyle.Fill;
            this.report.Font = new System.Drawing.Font("Courier New", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.report.Location = new System.Drawing.Point(0, 38);
            this.report.Name = "report";
            this.report.ReadOnly = true;
            this.report.Size = new System.Drawing.Size(768, 327);
            this.report.TabIndex = 3;
            this.report.Text = "";
            //
            // linkedFileDialog
            //
            this.linkedFileDialog.DefaultExt = "xls";
            this.linkedFileDialog.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm|Excel 97/2003|*.xls|Excel 2007|*.xlsx;*.xlsm|All " +
    "files|*.*";
            this.linkedFileDialog.Title = "Please supply the location for the following linked file.";
            //
            // mainToolbar
            //
            this.mainToolbar.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.validateRecalc,
            this.compareWithExcel,
            this.toolStripSeparator1,
            this.btnInfo,
            this.btnExit});
            this.mainToolbar.Location = new System.Drawing.Point(0, 0);
            this.mainToolbar.Name = "mainToolbar";
            this.mainToolbar.Size = new System.Drawing.Size(768, 38);
            this.mainToolbar.TabIndex = 11;
            this.mainToolbar.Text = "toolStrip1";
            //
            // validateRecalc
            //
            this.validateRecalc.Image = ((System.Drawing.Image)(resources.GetObject("validateRecalc.Image")));
            this.validateRecalc.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.validateRecalc.Name = "validateRecalc";
            this.validateRecalc.Size = new System.Drawing.Size(90, 35);
            this.validateRecalc.Text = "&Validate Recalc";
            this.validateRecalc.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
            this.validateRecalc.Click += new System.EventHandler(this.validateRecalc_Click);
            //
            // compareWithExcel
            //
            this.compareWithExcel.Image = ((System.Drawing.Image)(resources.GetObject("compareWithExcel.Image")));
            this.compareWithExcel.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.compareWithExcel.Name = "compareWithExcel";
            this.compareWithExcel.Size = new System.Drawing.Size(115, 43);
            this.compareWithExcel.Text = "Compare with Excel";
            this.compareWithExcel.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
            this.compareWithExcel.Click += new System.EventHandler(this.compareWithExcel_Click);
            //
            // toolStripSeparator1
            //
            this.toolStripSeparator1.Name = "toolStripSeparator1";
            this.toolStripSeparator1.Size = new System.Drawing.Size(6, 46);
            //
            // btnInfo
            //
            this.btnInfo.Image = ((System.Drawing.Image)(resources.GetObject("btnInfo.Image")));
            this.btnInfo.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.btnInfo.Name = "btnInfo";
            this.btnInfo.Size = new System.Drawing.Size(74, 43);
            this.btnInfo.Text = "Information";
            this.btnInfo.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
            this.btnInfo.Click += new System.EventHandler(this.btnInfo_Click);
            //
            // btnExit
            //
            this.btnExit.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right;
            this.btnExit.Image = ((System.Drawing.Image)(resources.GetObject("btnExit.Image")));
            this.btnExit.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.btnExit.Name = "btnExit";
            this.btnExit.Size = new System.Drawing.Size(59, 35);
            this.btnExit.Text = "     E&xit     ";
            this.btnExit.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
            this.btnExit.Click += new System.EventHandler(this.button2_Click);
            //
            // mainForm
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(768, 365);
            this.Controls.Add(this.report);
            this.Controls.Add(this.mainToolbar);
            this.Name = "mainForm";
            this.Text = "Validate FlexCel recalculation";
            this.mainToolbar.ResumeLayout(false);
            this.mainToolbar.PerformLayout();
            this.ResumeLayout(false);
            this.PerformLayout();

        }
        #endregion

        private ToolStrip mainToolbar;
        private ToolStripButton validateRecalc;
        private ToolStripButton compareWithExcel;
        private ToolStripSeparator toolStripSeparator1;
        private ToolStripButton btnInfo;
        private ToolStripButton btnExit;
    }
}

Program.cs

using System;
using System.Windows.Forms;

namespace ValidateRecalc
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new mainForm());
        }
    }
}


Recalculation of linked files (C# / netframework) | FlexCel Studio for the .NET Framework documentation

Recalculation of linked files (C# / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\csharp\VS2022\netframework\10.API\77.Recalculation Of Linked Files and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​csharp/​VS2022/​netframework/​Modules/​10.​API/​77.​Recalculation Of Linked Files

Overview

FlexCel allows complete control over recalculation of linked files. In this demo, we will show how to create 3 linked files and how to recalculate them.

Concepts

  • How to create files with formulas that link to other files.

  • There are two ways to create a workspace to calculate linked files:

    1. When you know all the files needed in advance, you just add them to the workspace before recalculating.

    2. If you don't know which files (if any) you are going to need, you can use an event to load them on demand. This is the approach we use in the Validate Recalc example, since it deals with arbitrary files. Whenever you know which files are needed, it is better to use the first method.

  • Workspaces can take a lot of memory. Make sure you make them null after recalculating, and also the XlsFiles used in it. If you keep the files, those files will point to the workspace even if you make it null, and it will not be released. You can also Clear() the workspace before making it null to make sure you leave no references to it.

Files

AssemblyInfo.cs

using System.Reflection;
using System.Runtime.CompilerServices;

//
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
//
[assembly: AssemblyTitle("")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("(c) 2002 - 2024 TMS Software")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

//
// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version
//      Build Number
//      Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:

[assembly: AssemblyVersion("7.21.0.0")]

//
// In order to sign your assembly you must specify a key to use. Refer to the
// Microsoft .NET Framework documentation for more information on assembly signing.
//
// Use the attributes below to control which key is used for signing.
//
// Notes:
//   (*) If no key is specified, the assembly is not signed.
//   (*) KeyName refers to a key that has been installed in the Crypto Service
//       Provider (CSP) on your machine. KeyFile refers to a file which contains
//       a key.
//   (*) If the KeyFile and the KeyName values are both specified, the
//       following processing occurs:
//       (1) If the KeyName can be found in the CSP, that key is used.
//       (2) If the KeyName does not exist and the KeyFile does exist, the key
//           in the KeyFile is installed into the CSP and used.
//   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
//       When specifying the KeyFile, the location of the KeyFile should be
//       relative to the project output directory which is
//       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
//       located in the project directory, you would specify the AssemblyKeyFile
//       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
//   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
//       documentation for more information on this.
//
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]
[assembly: AssemblyKeyName("")]

Form1.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using System.IO;
using System.Diagnostics;
using System.Reflection;
using System.Globalization;
using System.Drawing.Imaging;
using System.Drawing.Drawing2D;

namespace RecalculationOfLinkedFiles
{
    /// <summary>
    /// Shows how to recalculate linked files.
    /// </summary>
    public partial class mainForm: System.Windows.Forms.Form
    {

        public mainForm()
        {
            InitializeComponent();
        }

        private void button2_Click(object sender, System.EventArgs e)
        {
            Close();
        }

        private void CellA1_TextChanged(object sender, System.EventArgs e)
        {
            //This is a very slow way to do this (recreating the full 3 files each time you type a character)
            //but it is the best for what we want to show. (how to create and recalculate spreadsheets)
            //In a real world example you would keep the created files in memory and just recalculate them
            //when there is a change.
            CreateFilesAndRecalculate();
        }

        /// <summary>
        /// This method will try to convert a text to a string, and if not possible, return the text.
        /// </summary>
        /// <param name="s"></param>
        /// <returns></returns>
        private object GetValue(string s)
        {
            double d;
            if (Double.TryParse(s, NumberStyles.Any, CultureInfo.CurrentCulture, out d)) return d;
            return s;
        }

        private void CreateFilesAndRecalculate()
        {
            //Set up the files.
            XlsFile xls1 = new XlsFile();
            xls1.NewFile(1, TExcelFileFormat.v2019);

            xls1.SetCellValue(1, 1, GetValue(CellA1.Text));
            xls1.SetCellValue(2, 1, new TFormula("=[Third File.xls]Sheet1!A1 + 7"));

            XlsFile xls2 = new XlsFile();
            xls2.NewFile(1, TExcelFileFormat.v2019);
            xls2.SetCellValue(1, 1, new TFormula("=[First File.xls]Sheet1!A1 * 2"));

            XlsFile xls3 = new XlsFile();
            xls3.NewFile(1, TExcelFileFormat.v2019);
            xls3.SetCellValue(1, 1, new TFormula("=[Second File.xls]Sheet1!A1 * 5"));

            //Create a workspace to recalculate them.
            //In this case, as we know what files we need in advance, we will just add them to the workspace
            //For an example on how to load files on demand, take a look at the chart example in this demo.
            TWorkspace Workspace = new TWorkspace();
            Workspace.Add("First File.xls", xls1);
            Workspace.Add("Second File.xls", xls2);
            Workspace.Add("Third File.xls", xls3);

            //Now that the workspace is set, we can recalculate. We could recalc() in the Workspace object or in any of the files in it.
            //The effect is the same, all files will be recalculated.
            //DO NOT RECALCULATE EVERY FILE. EACH TIME YOU CALCULATE ONE, YOU ARE CALCULATING THEM ALL.
            xls1.Recalc();

            //Ok, now it is time to show the results.
            Cell2.Text = Convert.ToString(((TFormula)xls2.GetCellValue(1, 1)).Result);
            Cell3.Text = Convert.ToString(((TFormula)xls3.GetCellValue(1, 1)).Result);
            Cell4.Text = Convert.ToString(((TFormula)xls1.GetCellValue(2, 1)).Result);

            //In this example both the workspace and the xls files are local objects, so we don't need to worry about memory
            //If any of them is a global object, remember that keeping a reference to it will keep a reference to *ALL* the
            //files in the workspace (even if you make Workspace = null). You might want to call Workspace.Clear() in that case before setting it to null.
        }

        private void Chart_TextChanged(object sender, System.EventArgs e)
        {
            //Again, loading the file each time we press a key is incredibly silly. But for this example is ok,
            //since loading the files is what we actually want to show.

            string TemplatePath = Path.Combine(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), ".."), "..");
            XlsFile xlsChart = new XlsFile();
            xlsChart.Open(Path.Combine(TemplatePath, "Chart.xls"));

            //Create a Workspace.
            //Note that if we didn't create this workspace, the chart would not show, since it wouldn't be able to
            //find the linked file. You can verify it by commenting the following lines
            TWorkspace Workspace = new TWorkspace();
            Workspace.Add("Chart.xls", xlsChart); //We always need to have the main file in the workspace.

            //The best thing here would be to also add "ChartData.xls" to the workspace, since we already know which file we need.
            //But since we already saw how to do that in the other example in this demo, we are going to pretend we don't know which files
            //we need, and load them on demand.
            //NOTE: DON'T LOAD FILES ON DEMAND UNLESS YOU REALLY NEED TO, SINCE YOU MIGHT BE CREATING A SECURITY RISK. Read the API GUIDE PDF for more information.
            Workspace.LoadLinkedFile += new LoadLinkedFileEventHandler(Workspace_LoadLinkedFile);

            //Now that the Workspace is created, we can render the chart. We will use the code from "Render Objects" demo.
            if (chartBox.Image != null) chartBox.Image.Dispose();
            chartBox.Image = GetChart(xlsChart, 1);  //To do this well, we should name the chart, retrieve the object index and use it here.
                                                     //To see how this should be done, look at the Render Objects demo. Here we won't care about that, and just use "1" since we know the chart is the only object in the file.

        }

        /// <summary>
        /// This event is used when there are linked files, to load them on demand.
        /// </summary>
        private void Workspace_LoadLinkedFile(object sender, LoadLinkedFileEventArgs e)
        {
            //In order to reduce the risk of opening any file, in this demo we are going to only open files in the same folder we are working on.
            XlsFile xls = new XlsFile();
            string TemplatePath = Path.Combine(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), ".."), "..");
            xls.Open(Path.Combine(TemplatePath, Path.GetFileName(e.FileName)));

            e.Xls = xls;

            //A normal event should end here. Since we need to change the values of the file we loaded in demand, we will do that here.
            xls.SetCellValue(4, 2, GetValue(ChartA1.Text));
            xls.SetCellValue(5, 2, GetValue(ChartA2.Text));
            xls.SetCellValue(6, 2, GetValue(ChartA3.Text));
            xls.SetCellValue(4, 3, GetValue(ChartB1.Text));
            xls.SetCellValue(5, 3, GetValue(ChartB2.Text));
            xls.SetCellValue(6, 3, GetValue(ChartB3.Text));
        }

        //This code is from the "Render objects" demo, and returns the image of a chart.
        private Image GetChart(ExcelFile Xls, int ChartIndex)
        {
            TShapeProperties ChartProps = Xls.GetObjectProperties(ChartIndex, true);

            //We could get the chart with the following command,
            //but it would be fixed size. In this example we are going to be a little more complex.

            //Xls.RenderObject(ChartIndex);

            //A more complex way to retrieve the chart, to show how to use
            //all parameters in renderobject.

            TUIRectangle ImageDimensions;
            TPointF Origin;
            TUISize SizePixels;

            //First calculate the chart dimensions without actually rendering it. This is fast.
            Xls.RenderObject(ChartIndex, 96, ChartProps,
                SmoothingMode.AntiAlias, InterpolationMode.HighQualityBicubic, true, false,
                out Origin, out ImageDimensions, out SizePixels);

            float dpi = 96;  //default screen resolution
            if (SizePixels.Height > 0 && SizePixels.Width > 0)
            {
                double AspectX = (double)chartBox.Width / SizePixels.Width;
                double AspectY = (double)chartBox.Height / SizePixels.Height;

                double Aspect = Math.Max(AspectX, AspectY);
                //Make the dpi adjust the screen resolution and the size of the form.
                dpi = (float)(96 * Aspect);
                if (dpi < 20) dpi = 20;
                if (dpi > 500) dpi = 500;
            }

            return Xls.RenderObject(ChartIndex, dpi, ChartProps,
                SmoothingMode.AntiAlias, InterpolationMode.HighQualityBicubic, true, true,
                out Origin, out ImageDimensions, out SizePixels);

        }

    }

}

Form1.Designer.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using System.IO;
using System.Diagnostics;
using System.Reflection;
using System.Globalization;
using System.Drawing.Imaging;
using System.Drawing.Drawing2D;
namespace RecalculationOfLinkedFiles
{
    public partial class mainForm: System.Windows.Forms.Form
    {
        private System.Windows.Forms.Panel panel2;
        private System.Windows.Forms.Button button2;
        private System.Windows.Forms.TextBox CellA1;
        private System.Windows.Forms.Panel panel1;
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.Label label2;
        private System.Windows.Forms.Label label3;
        private System.Windows.Forms.TextBox Cell2;
        private System.Windows.Forms.Label label4;
        private System.Windows.Forms.Label label5;
        private System.Windows.Forms.Label label6;
        private System.Windows.Forms.Label label7;
        private System.Windows.Forms.TextBox Cell3;
        private System.Windows.Forms.Label label8;
        private System.Windows.Forms.Label label9;
        private System.Windows.Forms.TextBox Cell4;
        private System.Windows.Forms.Label label18;
        private System.Windows.Forms.Panel panel3;
        private System.Windows.Forms.TextBox ChartA1;
        private System.Windows.Forms.TextBox ChartB1;
        private System.Windows.Forms.TextBox ChartB2;
        private System.Windows.Forms.TextBox ChartA2;
        private System.Windows.Forms.TextBox ChartB3;
        private System.Windows.Forms.TextBox ChartA3;
        private System.Windows.Forms.PictureBox chartBox;
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(mainForm));
            this.panel2 = new System.Windows.Forms.Panel();
            this.button2 = new System.Windows.Forms.Button();
            this.CellA1 = new System.Windows.Forms.TextBox();
            this.panel1 = new System.Windows.Forms.Panel();
            this.label8 = new System.Windows.Forms.Label();
            this.label9 = new System.Windows.Forms.Label();
            this.Cell4 = new System.Windows.Forms.TextBox();
            this.label6 = new System.Windows.Forms.Label();
            this.label7 = new System.Windows.Forms.Label();
            this.Cell3 = new System.Windows.Forms.TextBox();
            this.label5 = new System.Windows.Forms.Label();
            this.label4 = new System.Windows.Forms.Label();
            this.label3 = new System.Windows.Forms.Label();
            this.Cell2 = new System.Windows.Forms.TextBox();
            this.label2 = new System.Windows.Forms.Label();
            this.label1 = new System.Windows.Forms.Label();
            this.label18 = new System.Windows.Forms.Label();
            this.ChartA1 = new System.Windows.Forms.TextBox();
            this.panel3 = new System.Windows.Forms.Panel();
            this.chartBox = new System.Windows.Forms.PictureBox();
            this.ChartB3 = new System.Windows.Forms.TextBox();
            this.ChartA3 = new System.Windows.Forms.TextBox();
            this.ChartB2 = new System.Windows.Forms.TextBox();
            this.ChartA2 = new System.Windows.Forms.TextBox();
            this.ChartB1 = new System.Windows.Forms.TextBox();
            this.panel2.SuspendLayout();
            this.panel1.SuspendLayout();
            this.panel3.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.chartBox)).BeginInit();
            this.SuspendLayout();
            //
            // panel2
            //
            this.panel2.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
            this.panel2.Controls.Add(this.button2);
            this.panel2.Dock = System.Windows.Forms.DockStyle.Bottom;
            this.panel2.Location = new System.Drawing.Point(0, 422);
            this.panel2.Name = "panel2";
            this.panel2.Size = new System.Drawing.Size(760, 32);
            this.panel2.TabIndex = 2;
            //
            // button2
            //
            this.button2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.button2.BackColor = System.Drawing.SystemColors.Control;
            this.button2.Image = ((System.Drawing.Image)(resources.GetObject("button2.Image")));
            this.button2.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
            this.button2.Location = new System.Drawing.Point(697, 2);
            this.button2.Name = "button2";
            this.button2.Size = new System.Drawing.Size(56, 26);
            this.button2.TabIndex = 2;
            this.button2.Text = "Exit";
            this.button2.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            this.button2.UseVisualStyleBackColor = false;
            this.button2.Click += new System.EventHandler(this.button2_Click);
            //
            // CellA1
            //
            this.CellA1.Location = new System.Drawing.Point(24, 88);
            this.CellA1.Name = "CellA1";
            this.CellA1.Size = new System.Drawing.Size(100, 20);
            this.CellA1.TabIndex = 3;
            this.CellA1.TextChanged += new System.EventHandler(this.CellA1_TextChanged);
            //
            // panel1
            //
            this.panel1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
            | System.Windows.Forms.AnchorStyles.Right)));
            this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
            this.panel1.Controls.Add(this.label8);
            this.panel1.Controls.Add(this.label9);
            this.panel1.Controls.Add(this.Cell4);
            this.panel1.Controls.Add(this.label6);
            this.panel1.Controls.Add(this.label7);
            this.panel1.Controls.Add(this.Cell3);
            this.panel1.Controls.Add(this.label5);
            this.panel1.Controls.Add(this.label4);
            this.panel1.Controls.Add(this.label3);
            this.panel1.Controls.Add(this.Cell2);
            this.panel1.Controls.Add(this.label2);
            this.panel1.Controls.Add(this.label1);
            this.panel1.Controls.Add(this.CellA1);
            this.panel1.Location = new System.Drawing.Point(8, 8);
            this.panel1.Name = "panel1";
            this.panel1.Size = new System.Drawing.Size(736, 136);
            this.panel1.TabIndex = 4;
            //
            // label8
            //
            this.label8.Location = new System.Drawing.Point(520, 72);
            this.label8.Name = "label8";
            this.label8.Size = new System.Drawing.Size(160, 16);
            this.label8.TabIndex = 15;
            this.label8.Text = "=[Third File.xls]Sheet1!A1 + 7";
            //
            // label9
            //
            this.label9.Location = new System.Drawing.Point(520, 56);
            this.label9.Name = "label9";
            this.label9.Size = new System.Drawing.Size(100, 16);
            this.label9.TabIndex = 14;
            this.label9.Text = "First File: A2";
            //
            // Cell4
            //
            this.Cell4.Enabled = false;
            this.Cell4.Location = new System.Drawing.Point(520, 88);
            this.Cell4.Name = "Cell4";
            this.Cell4.Size = new System.Drawing.Size(152, 20);
            this.Cell4.TabIndex = 13;
            //
            // label6
            //
            this.label6.Location = new System.Drawing.Point(328, 72);
            this.label6.Name = "label6";
            this.label6.Size = new System.Drawing.Size(184, 16);
            this.label6.TabIndex = 12;
            this.label6.Text = "=[Second File.xls]Sheet1!A1 * 5";
            //
            // label7
            //
            this.label7.Location = new System.Drawing.Point(328, 56);
            this.label7.Name = "label7";
            this.label7.Size = new System.Drawing.Size(100, 16);
            this.label7.TabIndex = 11;
            this.label7.Text = "Third File: A1";
            //
            // Cell3
            //
            this.Cell3.Enabled = false;
            this.Cell3.Location = new System.Drawing.Point(328, 88);
            this.Cell3.Name = "Cell3";
            this.Cell3.Size = new System.Drawing.Size(152, 20);
            this.Cell3.TabIndex = 10;
            //
            // label5
            //
            this.label5.Location = new System.Drawing.Point(152, 72);
            this.label5.Name = "label5";
            this.label5.Size = new System.Drawing.Size(152, 16);
            this.label5.TabIndex = 9;
            this.label5.Text = "=[First File.xls]Sheet1!A1 * 2";
            //
            // label4
            //
            this.label4.Location = new System.Drawing.Point(24, 72);
            this.label4.Name = "label4";
            this.label4.Size = new System.Drawing.Size(100, 16);
            this.label4.TabIndex = 8;
            this.label4.Text = "Constant";
            //
            // label3
            //
            this.label3.Location = new System.Drawing.Point(152, 56);
            this.label3.Name = "label3";
            this.label3.Size = new System.Drawing.Size(100, 16);
            this.label3.TabIndex = 7;
            this.label3.Text = "Second File: A1";
            //
            // Cell2
            //
            this.Cell2.Enabled = false;
            this.Cell2.Location = new System.Drawing.Point(152, 88);
            this.Cell2.Name = "Cell2";
            this.Cell2.Size = new System.Drawing.Size(144, 20);
            this.Cell2.TabIndex = 6;
            //
            // label2
            //
            this.label2.Location = new System.Drawing.Point(24, 56);
            this.label2.Name = "label2";
            this.label2.Size = new System.Drawing.Size(100, 16);
            this.label2.TabIndex = 5;
            this.label2.Text = "First File: A1";
            //
            // label1
            //
            this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
            | System.Windows.Forms.AnchorStyles.Right)));
            this.label1.Location = new System.Drawing.Point(16, 16);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(704, 32);
            this.label1.TabIndex = 4;
            this.label1.Text = "In this first example we will dynamically create 3 linked files. We will create a" +
    " workspace to link the files, and see how recalculation works.";
            //
            // label18
            //
            this.label18.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
            | System.Windows.Forms.AnchorStyles.Right)));
            this.label18.Location = new System.Drawing.Point(16, 16);
            this.label18.Name = "label18";
            this.label18.Size = new System.Drawing.Size(704, 32);
            this.label18.TabIndex = 4;
            this.label18.Text = "This second example shows how to load files when we don\'t know a priori which fil" +
    "es we need to recalculate a file. To make it more interesting, we will use a cha" +
    "rt linked to other file.";
            //
            // ChartA1
            //
            this.ChartA1.Location = new System.Drawing.Point(16, 56);
            this.ChartA1.Name = "ChartA1";
            this.ChartA1.Size = new System.Drawing.Size(64, 20);
            this.ChartA1.TabIndex = 3;
            this.ChartA1.Text = "1";
            this.ChartA1.TextChanged += new System.EventHandler(this.Chart_TextChanged);
            //
            // panel3
            //
            this.panel3.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
            | System.Windows.Forms.AnchorStyles.Left)
            | System.Windows.Forms.AnchorStyles.Right)));
            this.panel3.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
            this.panel3.Controls.Add(this.chartBox);
            this.panel3.Controls.Add(this.ChartB3);
            this.panel3.Controls.Add(this.ChartA3);
            this.panel3.Controls.Add(this.ChartB2);
            this.panel3.Controls.Add(this.ChartA2);
            this.panel3.Controls.Add(this.ChartB1);
            this.panel3.Controls.Add(this.label18);
            this.panel3.Controls.Add(this.ChartA1);
            this.panel3.Location = new System.Drawing.Point(8, 176);
            this.panel3.Name = "panel3";
            this.panel3.Size = new System.Drawing.Size(736, 225);
            this.panel3.TabIndex = 5;
            //
            // chartBox
            //
            this.chartBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
            | System.Windows.Forms.AnchorStyles.Left)
            | System.Windows.Forms.AnchorStyles.Right)));
            this.chartBox.Location = new System.Drawing.Point(176, 56);
            this.chartBox.Name = "chartBox";
            this.chartBox.Size = new System.Drawing.Size(544, 152);
            this.chartBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
            this.chartBox.TabIndex = 52;
            this.chartBox.TabStop = false;
            //
            // ChartB3
            //
            this.ChartB3.Location = new System.Drawing.Point(88, 104);
            this.ChartB3.Name = "ChartB3";
            this.ChartB3.Size = new System.Drawing.Size(64, 20);
            this.ChartB3.TabIndex = 9;
            this.ChartB3.Text = "5";
            this.ChartB3.TextChanged += new System.EventHandler(this.Chart_TextChanged);
            //
            // ChartA3
            //
            this.ChartA3.Location = new System.Drawing.Point(16, 104);
            this.ChartA3.Name = "ChartA3";
            this.ChartA3.Size = new System.Drawing.Size(64, 20);
            this.ChartA3.TabIndex = 8;
            this.ChartA3.Text = "3";
            this.ChartA3.TextChanged += new System.EventHandler(this.Chart_TextChanged);
            //
            // ChartB2
            //
            this.ChartB2.Location = new System.Drawing.Point(88, 80);
            this.ChartB2.Name = "ChartB2";
            this.ChartB2.Size = new System.Drawing.Size(64, 20);
            this.ChartB2.TabIndex = 7;
            this.ChartB2.Text = "4";
            this.ChartB2.TextChanged += new System.EventHandler(this.Chart_TextChanged);
            //
            // ChartA2
            //
            this.ChartA2.Location = new System.Drawing.Point(16, 80);
            this.ChartA2.Name = "ChartA2";
            this.ChartA2.Size = new System.Drawing.Size(64, 20);
            this.ChartA2.TabIndex = 6;
            this.ChartA2.Text = "2";
            this.ChartA2.TextChanged += new System.EventHandler(this.Chart_TextChanged);
            //
            // ChartB1
            //
            this.ChartB1.Location = new System.Drawing.Point(88, 56);
            this.ChartB1.Name = "ChartB1";
            this.ChartB1.Size = new System.Drawing.Size(64, 20);
            this.ChartB1.TabIndex = 5;
            this.ChartB1.Text = "3";
            this.ChartB1.TextChanged += new System.EventHandler(this.Chart_TextChanged);
            //
            // mainForm
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(760, 454);
            this.Controls.Add(this.panel3);
            this.Controls.Add(this.panel1);
            this.Controls.Add(this.panel2);
            this.Name = "mainForm";
            this.Text = "Calculation of linked files";
            this.panel2.ResumeLayout(false);
            this.panel1.ResumeLayout(false);
            this.panel1.PerformLayout();
            this.panel3.ResumeLayout(false);
            this.panel3.PerformLayout();
            ((System.ComponentModel.ISupportInitialize)(this.chartBox)).EndInit();
            this.ResumeLayout(false);

        }
        #endregion
    }
}

Program.cs

using System;
using System.Windows.Forms;

namespace RecalculationOfLinkedFiles
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new mainForm());
        }
    }
}


Excel user defined functions (UDF) (C# / netframework) | FlexCel Studio for the .NET Framework documentation

Excel user defined functions (UDF) (C# / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\csharp\VS2022\netframework\10.API\78.Excel User Defined Functions and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​csharp/​VS2022/​netframework/​Modules/​10.​API/​78.​Excel User Defined Functions

Overview

Here we will explore how to handle Excel files with UDFs. FlexCel has full support for adding Excel UDFs to cells, retrieving UDFs from cells or recalculating files containing UDFs. But you need to create .NET functions that will mimic the UDF behavior, and add them to the FlexCel recalculation engine.

Make sure you read Using Excel's User-defined Functions (UDF) in the API developers guide for a conceptual explanation of what we are doing here.

Concepts

  • How to recalculate a sheet containing User Defined Functions (UDfs).

  • How to read and write UDFs from and to an Excel file.

  • In order to compare the results calculated by Excel and By FlexCel, this demo will save two files: one pdf (that will not use Excel recalculation) and one xls (that will be recalculated by Excel when opened).

Files

AssemblyInfo.cs

using System.Reflection;
using System.Runtime.CompilerServices;

//
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
//
[assembly: AssemblyTitle("")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("(c) 2002 - 2024 TMS Software")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

//
// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version
//      Build Number
//      Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:

[assembly: AssemblyVersion("7.21.0.0")]

//
// In order to sign your assembly you must specify a key to use. Refer to the
// Microsoft .NET Framework documentation for more information on assembly signing.
//
// Use the attributes below to control which key is used for signing.
//
// Notes:
//   (*) If no key is specified, the assembly is not signed.
//   (*) KeyName refers to a key that has been installed in the Crypto Service
//       Provider (CSP) on your machine. KeyFile refers to a file which contains
//       a key.
//   (*) If the KeyFile and the KeyName values are both specified, the
//       following processing occurs:
//       (1) If the KeyName can be found in the CSP, that key is used.
//       (2) If the KeyName does not exist and the KeyFile does exist, the key
//           in the KeyFile is installed into the CSP and used.
//   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
//       When specifying the KeyFile, the location of the KeyFile should be
//       relative to the project output directory which is
//       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
//       located in the project directory, you would specify the AssemblyKeyFile
//       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
//   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
//       documentation for more information on this.
//
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]
[assembly: AssemblyKeyName("")]

Form1.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using System.IO;
using System.Diagnostics;
using System.Reflection;
using System.Text;

using FlexCel.Render;

namespace ExcelUserDefinedFunctions
{
    /// <summary>
    /// An example on how to recalculate user defined functions.
    /// </summary>
    public partial class mainForm: System.Windows.Forms.Form
    {

        public mainForm()
        {
            InitializeComponent();
        }

        private string PathToExe
        {
            get
            {
                return Path.Combine(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), ".."), "..") + Path.DirectorySeparatorChar;
            }
        }

        /// <summary>
        /// Loads the user defined functions into the Excel recalculating engine.
        /// </summary>
        /// <param name="Xls"></param>
        private void LoadUdfs(ExcelFile Xls)
        {
            Xls.AddUserDefinedFunction(TUserDefinedFunctionScope.Local, TUserDefinedFunctionLocation.Internal, new SumCellsWithSameColor());
            Xls.AddUserDefinedFunction(TUserDefinedFunctionScope.Local, TUserDefinedFunctionLocation.Internal, new IsPrime());
            Xls.AddUserDefinedFunction(TUserDefinedFunctionScope.Local, TUserDefinedFunctionLocation.Internal, new BoolChoose());
            Xls.AddUserDefinedFunction(TUserDefinedFunctionScope.Local, TUserDefinedFunctionLocation.Internal, new Lowest());
        }

        private void AddData(ExcelFile Xls)
        {
            LoadUdfs(Xls); //Register our custom functions. As we are using a local scope, we need to register them each time.

            Xls.Open(Path.Combine(PathToExe, "udfs.xls"));  //Open the file we want to manipulate.

            //Fill the cell range with other values so we can see how the sheet is recalculated by FlexCel.
            TXlsCellRange Data = Xls.GetNamedRange("Data", -1);
            for (int r = Data.Top; r < Data.Bottom; r++)
            {
                Xls.SetCellValue(r, Data.Left, r - Data.Top);
            }

            //Add an UDF to the sheet. We can enter the fucntion "BoolChoose" here because it was registered into FlexCel in LoadUDF()
            //If it hadn't been registered, this line would raise an Exception of an unknown function.
            string FmlaText = "=BoolChoose(TRUE,\"This formula was entered with FlexCel!\",\"It shouldn't display this\")";
            Xls.SetCellValue(11, 1, new TFormula(FmlaText));

            //Verify the UDF entered is correct. We can read any udf from Excel, even if it is not registered with AddUserDefinedFunction.
            object o = Xls.GetCellValue(11, 1);
            TFormula fm = o as TFormula;
            Debug.Assert(fm != null, "The cell must contain a formula");
            if (fm != null) Debug.Assert(fm.Text == FmlaText, "Error in Formula: It should be \"" + FmlaText + "\" and it is \"" + fm.Text + "\"");

            //Recalc the sheet. As we are not saving it yet, we ned to make a manual recalc.
            Xls.Recalc();

            //Export the file to PDF so we can see the values calculated by FlexCel without Excel recalculating them.
            using (FlexCelPdfExport pdf = new FlexCelPdfExport(Xls, true))
            {
                pdf.Export(saveFileDialog1.FileName);
            }

            //Save the file as xls too so we can compare.
            Xls.Save(Path.ChangeExtension(saveFileDialog1.FileName, "xls"));
        }

        private void button1_Click(object sender, System.EventArgs e)
        {
            AutoRun();
        }

        public void AutoRun()
        {
            if (saveFileDialog1.ShowDialog() != DialogResult.OK) return;
            ExcelFile Xls = new XlsFile(true);
            AddData(Xls);
            if (MessageBox.Show("Do you want to open the generated files (PDF and XLS)?", "Confirm", MessageBoxButtons.YesNo) == DialogResult.Yes)
            {
                using (Process p = new Process())
                {
                    p.StartInfo.FileName = saveFileDialog1.FileName;
                    p.StartInfo.UseShellExecute = true;
                    p.Start();
                }
                using (Process p = new Process())
                {
                    p.StartInfo.FileName = Path.ChangeExtension(saveFileDialog1.FileName, "xls");
                    p.StartInfo.UseShellExecute = true;
                    p.Start();
                }
            }

        }

        /// <summary>
        /// This is the method that will be called by the ASP.NET front end. It returns an array of bytes
        /// with the report data, so the ASP.NET application can stream it to the client.
        /// </summary>
        /// <returns>The generated file as a byte array.</returns>
        public byte[] WebRun()
        {
            ExcelFile Xls = new XlsFile(true);
            AddData(Xls);

            using (MemoryStream OutStream = new MemoryStream())
            {
                Xls.Save(OutStream);
                return OutStream.ToArray();
            }
        }
    }

    #region UDF definitions
    /// <summary>
    /// Implements a custom function that will sum the cells in a range that have the same
    /// color of the source cell. This function mimics the VBA macro in the example, so when
    /// recalculating the sheet with FlexCel you will get the same results as with Excel.
    /// </summary>
    public class SumCellsWithSameColor: TUserDefinedFunction
    {
        /// <summary>
        /// Creates a new instance and registers the class in the FlexCel recalculating engine as "SumCellsWithSameColor".
        /// </summary>
        public SumCellsWithSameColor() : base("SumCellsWithSameColor")
        {
        }

        /// <summary>
        /// Returns the sum of cells in a range that have the same color as a reference cell.
        /// </summary>
        /// <param name="arguments"></param>
        /// <param name="parameters">In this case we expect 2 parameters, first the reference cell and then
        /// the range in which to sum. We will return an error otherwise.</param>
        /// <returns></returns>
        public override object Evaluate(TUdfEventArgs arguments, object[] parameters)
        {
            #region Get Parameters
            TFlxFormulaErrorValue Err;
            if (!CheckParameters(parameters, 2, out Err)) return Err;

            //The first parameter should be a range
            TXls3DRange SourceCell;
            if (!TryGetCellRange(parameters[0], out SourceCell, out Err)) return Err;

            //The second parameter should be a range too.
            TXls3DRange SumRange;
            if (!TryGetCellRange(parameters[1], out SumRange, out Err)) return Err;
            #endregion

            //Get the color in SourceCell. Note that if Source cell is a range with more than one cell,
            //we will use the first cell in the range. Also, as different colors can have the same rgb value, we will compare the actual RGB values, not the ExcelColors
            TFlxFormat fmt = arguments.Xls.GetCellVisibleFormatDef(SourceCell.Sheet1, SourceCell.Top, SourceCell.Left);
            int SourceColor = fmt.FillPattern.FgColor.ToColor(arguments.Xls).ToArgb();

            double Result = 0;
            //Loop in the sum range and sum the corresponding values.
            for (int s = SumRange.Sheet1; s <= SumRange.Sheet2; s++)
            {
                for (int r = SumRange.Top; r <= SumRange.Bottom; r++)
                {
                    for (int c = SumRange.Left; c <= SumRange.Right; c++)
                    {
                        int XF = -1;
                        object val = arguments.Xls.GetCellValue(s, r, c, ref XF);
                        if (val is double) //we will only sum numeric values.
                        {
                            TFlxFormat sumfmt = arguments.Xls.GetCellVisibleFormatDef(s, r, c);
                            if (sumfmt.FillPattern.FgColor.ToColor(arguments.Xls).ToArgb() == SourceColor)
                            {
                                Result += (double)val;
                            }
                        }
                    }
                }
            }
            return Result;
        }
    }

    /// <summary>
    /// Implements a custom function that will return true if a number is prime.
    /// This function mimics the VBA macro in the example, so when
    /// recalculating the sheet with FlexCel you will get the same results as with Excel.
    /// </summary>
    public class IsPrime: TUserDefinedFunction
    {
        /// <summary>
        /// Creates a new instance and registers the class in the FlexCel recalculating engine as "IsPrime".
        /// </summary>
        public IsPrime() : base("IsPrime")
        {
        }

        /// <summary>
        /// Returns true if a number is prime.
        /// </summary>
        /// <param name="arguments"></param>
        /// <param name="parameters">In this case we expect 1 parameter with the number. We will return an error otherwise.</param>
        /// <returns></returns>
        public override object Evaluate(TUdfEventArgs arguments, object[] parameters)
        {
            #region Get Parameters
            TFlxFormulaErrorValue Err;
            if (!CheckParameters(parameters, 1, out Err)) return Err;

            //The parameter should be a double or a range.
            double Number;
            if (!TryGetDouble(arguments.Xls, parameters[0], out Number, out Err)) return Err;
            #endregion

            //Return true if the number is prime.
            int n = Convert.ToInt32(Number);
            if (n == 2) return true;
            if (n < 2 || n % 2 == 0) return false;
            for (int i = 3; i <= Math.Sqrt(n); i += 2)
            {
                if (n % i == 0) return false;
            }
            return true;
        }
    }

    /// <summary>
    /// Implements a custom function that will choose between two different strings.
    /// This function mimics the VBA macro in the example, so when
    /// recalculating the sheet with FlexCel you will get the same results as with Excel.
    /// </summary>
    public class BoolChoose: TUserDefinedFunction
    {
        /// <summary>
        /// Creates a new instance and registers the class in the FlexCel recalculating engine as "BoolChoose".
        /// </summary>
        public BoolChoose() : base("BoolChoose")
        {
        }

        /// <summary>
        /// Chooses between 2 different strings.
        /// </summary>
        /// <param name="arguments"></param>
        /// <param name="parameters">In this case we expect 3 parameters: The first is a boolean, and the other 2 strings. We will return an error otherwise.</param>
        /// <returns></returns>
        public override object Evaluate(TUdfEventArgs arguments, object[] parameters)
        {
            #region Get Parameters
            TFlxFormulaErrorValue Err;
            if (!CheckParameters(parameters, 3, out Err)) return Err;

            //The first parameter should be a boolean.
            bool ChooseFirst;
            if (!TryGetBoolean(arguments.Xls, parameters[0], out ChooseFirst, out Err)) return Err;

            //The second parameter should be a string.
            string s1;
            if (!TryGetString(arguments.Xls, parameters[1], out s1, out Err)) return Err;

            //The third parameter should be a string.
            string s2;
            if (!TryGetString(arguments.Xls, parameters[2], out s2, out Err)) return Err;
            #endregion

            //Return s1 or s2 depending on ChooseFirst
            if (ChooseFirst) return s1; else return s2;
        }
    }

    /// <summary>
    /// Implements a custom function that will choose the lowest member in an array.
    /// This function mimics the VBA macro in the example, so when
    /// recalculating the sheet with FlexCel you will get the same results as with Excel.
    /// </summary>
    public class Lowest: TUserDefinedFunction
    {
        /// <summary>
        /// Creates a new instance and registers the class in the FlexCel recalculating engine as "Lowest".
        /// </summary>
        public Lowest() : base("Lowest")
        {
        }

        /// <summary>
        /// Chooses the lowest element in an array.
        /// </summary>
        /// <param name="arguments"></param>
        /// <param name="parameters">In this case we expect 1 parameter that should be an array. We will return an error otherwise.</param>
        /// <returns></returns>
        public override object Evaluate(TUdfEventArgs arguments, object[] parameters)
        {
            #region Get Parameters
            TFlxFormulaErrorValue Err;
            if (!CheckParameters(parameters, 1, out Err)) return Err;

            //The first parameter should be an array.
            object[,] SourceArray;
            if (!TryGetArray(arguments.Xls, parameters[0], out SourceArray, out Err)) return Err;
            #endregion

            double Result = 0;
            bool First = true;
            foreach (object o in SourceArray)
            {
                if (o is double)
                {
                    if (First)
                    {
                        First = false;
                        Result = (double)o;
                    }
                    else
                    {
                        if ((double)o < Result) Result = (double)o;
                    }
                }
                else return TFlxFormulaErrorValue.ErrValue;
            }

            return Result;
        }

    }
    #endregion

}

Form1.Designer.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using System.IO;
using System.Diagnostics;
using System.Reflection;
using System.Text;
using FlexCel.Render;
namespace ExcelUserDefinedFunctions
{
    public partial class mainForm: System.Windows.Forms.Form
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.Container components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.button1 = new System.Windows.Forms.Button();
            this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog();
            this.label1 = new System.Windows.Forms.Label();
            this.SuspendLayout();
            //
            // button1
            //
            this.button1.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
            this.button1.Location = new System.Drawing.Point(132, 73);
            this.button1.Name = "button1";
            this.button1.TabIndex = 0;
            this.button1.Text = "GO!";
            this.button1.Click += new System.EventHandler(this.button1_Click);
            //
            // saveFileDialog1
            //
            this.saveFileDialog1.Filter = "Pdf Files|*.pdf";
            this.saveFileDialog1.RestoreDirectory = true;
            this.saveFileDialog1.Title = "The Application will save BOTH AN XLS AND A PDF file in this folder";
            //
            // label1
            //
            this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
                | System.Windows.Forms.AnchorStyles.Left)
                | System.Windows.Forms.AnchorStyles.Right)));
            this.label1.BackColor = System.Drawing.Color.FromArgb(((System.Byte)(255)), ((System.Byte)(255)), ((System.Byte)(192)));
            this.label1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.label1.Location = new System.Drawing.Point(16, 16);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(312, 32);
            this.label1.TabIndex = 1;
            this.label1.Text = "A  demo on how to handle Excel UDFs with the API.";
            //
            // mainForm
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(336, 110);
            this.Controls.Add(this.label1);
            this.Controls.Add(this.button1);
            this.Name = "mainForm";
            this.Text = "Excel User Defined Functions";
            this.ResumeLayout(false);

        }
        #endregion

        private System.Windows.Forms.Button button1;
        private System.Windows.Forms.SaveFileDialog saveFileDialog1;
        private System.Windows.Forms.Label label1;
    }
}

Program.cs

using System;
using System.Windows.Forms;

namespace ExcelUserDefinedFunctions
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new mainForm());
        }
    }
}


Consolidating files (C# / netframework) | FlexCel Studio for the .NET Framework documentation

Consolidating files (C# / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\csharp\VS2022\netframework\10.API\80.Consolidating Files and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​csharp/​VS2022/​netframework/​Modules/​10.​API/​80.​Consolidating Files

Overview

The FlexCel API is oriented to modifying files, instead of reading and creating files as different things. So, some most important commands on it are ExcelFile.InsertAndCopyRange and ExcelFile.DeleteRange, that copy and delete ranges on existing sheets.

This is a real-world example on how you can use ExcelFile.InsertAndCopyRange to copy the first sheet of many different Excel files into one big file.

Concepts

  • You can use ExcelFile.InsertAndCopyRange and/or ExcelFile.InsertAndCopySheets to copy ranges across different files. Even when it is not as complete as copying from the same file, it does copy most of the things.

  • ExcelFile.InsertAndCopyRange behaves the same way as Excel. That is, if you copy whole rows, the row height and format will be copied, not only the values. The same happens with columns, only when copying full columns the format and width will be copied to the destination. On this demo, we want to copy all Column and Row format, so we have to select the whole sheet. If we selected a smaller range, say (1,1,65535,255) instead of (1,1,65536,256) no full column or full row would be selected and not column or row format would be copied.

  • If the sheets you are copying have formulas or names with references to other files or sheets, you might not get the expected results. You could use ExcelFile.ConvertFormulasToValues and ExcelFile.ConvertFormulasToValues

Files

AssemblyInfo.cs

using System.Reflection;
using System.Runtime.CompilerServices;

//
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
//
[assembly: AssemblyTitle("")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("(c) 2002 - 2024 TMS Software")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

//
// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version
//      Build Number
//      Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:

[assembly: AssemblyVersion("7.21.0.0")]

//
// In order to sign your assembly you must specify a key to use. Refer to the
// Microsoft .NET Framework documentation for more information on assembly signing.
//
// Use the attributes below to control which key is used for signing.
//
// Notes:
//   (*) If no key is specified, the assembly is not signed.
//   (*) KeyName refers to a key that has been installed in the Crypto Service
//       Provider (CSP) on your machine. KeyFile refers to a file which contains
//       a key.
//   (*) If the KeyFile and the KeyName values are both specified, the
//       following processing occurs:
//       (1) If the KeyName can be found in the CSP, that key is used.
//       (2) If the KeyName does not exist and the KeyFile does exist, the key
//           in the KeyFile is installed into the CSP and used.
//   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
//       When specifying the KeyFile, the location of the KeyFile should be
//       relative to the project output directory which is
//       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
//       located in the project directory, you would specify the AssemblyKeyFile
//       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
//   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
//       documentation for more information on this.
//
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]
[assembly: AssemblyKeyName("")]

Form1.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using System.IO;
using System.Diagnostics;
using System.Reflection;

namespace ConsolidatingFiles
{
    /// <summary>
    /// A demo on how to copy many sheets from different files into one file.
    /// </summary>
    public partial class mainForm: System.Windows.Forms.Form
    {

        public mainForm()
        {
            InitializeComponent();
        }

        /// <summary>
        /// This is the method that will be called by the ASP.NET front end. It returns an array of bytes
        /// with the report data, so the ASP.NET application can stream it to the client.
        /// </summary>
        /// <param name="fileDatas"></param>
        /// <param name="fileNames"></param>
        /// <param name="OnlyData"></param>
        /// <returns>The generated file as a byte array.</returns>
        public byte[] WebRun(Stream[] fileDatas, string[] fileNames, bool OnlyData)
        {
            if (fileNames.Length <= 0)
            {
                throw new ApplicationException("You must select at least one file");
            }

            ExcelFile XlsOut = Consolidate(fileDatas, fileNames, OnlyData);

            using (MemoryStream OutStream = new MemoryStream())
            {
                XlsOut.Save(OutStream);
                return OutStream.ToArray();
            }

        }

        private ExcelFile Consolidate(Stream[] fileDatas, string[] fileNames, bool OnlyData)
        {
            ExcelFile XlsIn = new XlsFile();
            ExcelFile XlsOut = new XlsFile(true);
            XlsOut.NewFile(1, TExcelFileFormat.v2019);

            if (fileNames.Length > 1 && cbOnlyData.Checked) XlsOut.InsertAndCopySheets(1, 2, fileNames.Length - 1);

            for (int i = 0; i < fileNames.Length; i++)
            {
                if (fileDatas != null) XlsIn.Open(fileDatas[i]);
                else XlsIn.Open(fileNames[i]);
                XlsIn.ConvertFormulasToValues(true); //If there is any formula referring to other sheet, convert it to value.
                                                     //We could also call an overloaded version of InsertAndCopySheets() that
                                                     //copies many sheets at the same time, so references are kept.
                XlsOut.ActiveSheet = i + 1;

                if (OnlyData)
                    XlsOut.InsertAndCopyRange(TXlsCellRange.FullRange(), 1, 1, 1, TFlxInsertMode.ShiftRangeDown, TRangeCopyMode.All, XlsIn, 1);
                else
                {
                    XlsOut.InsertAndCopySheets(1, XlsOut.ActiveSheet, 1, XlsIn);
                }

                //Change sheet name.
                string s = Path.GetFileName(fileNames[i]);
                if (s.Length > 32) XlsOut.SheetName = s.Substring(0, 29) + "...";
                else XlsOut.SheetName = s;

            }

            if (!cbOnlyData.Checked)
            {
                XlsOut.ActiveSheet = XlsOut.SheetCount;
                XlsOut.DeleteSheet(1);  //Remove the empty sheet that came with the workbook.
            }

            XlsOut.ActiveSheet = 1;
            return XlsOut;
        }

        private void button1_Click(object sender, System.EventArgs e)
        {
            if (openFileDialog1.ShowDialog() != DialogResult.OK) return;
            string[] fileNames = openFileDialog1.FileNames;
            if (fileNames.Length <= 0)
            {
                MessageBox.Show("You must select at least one file");
                return;
            }

            ExcelFile XlsOut = Consolidate(null, fileNames, cbOnlyData.Checked);

            if (saveFileDialog1.ShowDialog() == DialogResult.OK)
            {
                XlsOut.Save(saveFileDialog1.FileName);

                if (MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    using (Process p = new Process())
                    {
                        p.StartInfo.FileName = saveFileDialog1.FileName;
                        p.StartInfo.UseShellExecute = true;
                        p.Start();
                    }
                }
            }

        }
    }
}

Form1.Designer.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using System.IO;
using System.Diagnostics;
using System.Reflection;
namespace ConsolidatingFiles
{
    public partial class mainForm: System.Windows.Forms.Form
    {
        private System.Windows.Forms.Button button1;
        private System.Windows.Forms.SaveFileDialog saveFileDialog1;
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.OpenFileDialog openFileDialog1;
        private System.Windows.Forms.Label label2;
        private System.Windows.Forms.CheckBox cbOnlyData;
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.Container components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.button1 = new System.Windows.Forms.Button();
            this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog();
            this.label1 = new System.Windows.Forms.Label();
            this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
            this.label2 = new System.Windows.Forms.Label();
            this.cbOnlyData = new System.Windows.Forms.CheckBox();
            this.SuspendLayout();
            //
            // button1
            //
            this.button1.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
            this.button1.Location = new System.Drawing.Point(180, 152);
            this.button1.Name = "button1";
            this.button1.TabIndex = 0;
            this.button1.Text = "GO!";
            this.button1.Click += new System.EventHandler(this.button1_Click);
            //
            // saveFileDialog1
            //
            this.saveFileDialog1.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm|Excel 97/2003|*.xls|Excel 2007|*.xlsx;*.xlsm|All files|*.*";
            this.saveFileDialog1.RestoreDirectory = true;
            //
            // label1
            //
            this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
                | System.Windows.Forms.AnchorStyles.Left)
                | System.Windows.Forms.AnchorStyles.Right)));
            this.label1.BackColor = System.Drawing.Color.FromArgb(((System.Byte)(255)), ((System.Byte)(255)), ((System.Byte)(192)));
            this.label1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.label1.Location = new System.Drawing.Point(16, 16);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(408, 32);
            this.label1.TabIndex = 1;
            this.label1.Text = "A demo on how to consolidate several files into one.";
            //
            // openFileDialog1
            //
            this.openFileDialog1.DefaultExt = "xls";
            this.openFileDialog1.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm|Excel 97/2003|*.xls|Excel 2007|*.xlsx;*.xlsm|All files|*.*";
            this.openFileDialog1.Multiselect = true;
            this.openFileDialog1.Title = "Select ALL the files you want to consolidate.";
            //
            // label2
            //
            this.label2.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
                | System.Windows.Forms.AnchorStyles.Left)
                | System.Windows.Forms.AnchorStyles.Right)));
            this.label2.BackColor = System.Drawing.Color.White;
            this.label2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.label2.Location = new System.Drawing.Point(16, 64);
            this.label2.Name = "label2";
            this.label2.Size = new System.Drawing.Size(408, 32);
            this.label2.TabIndex = 2;
            this.label2.Text = "After pressing the button, multi-select all the files you want with ctrl and shif" +
                "t.";
            //
            // cbOnlyData
            //
            this.cbOnlyData.Location = new System.Drawing.Point(24, 112);
            this.cbOnlyData.Name = "cbOnlyData";
            this.cbOnlyData.Size = new System.Drawing.Size(344, 24);
            this.cbOnlyData.TabIndex = 3;
            this.cbOnlyData.Text = "Copy only data. (dont copy margins zoom, etc)";
            //
            // mainForm
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(432, 197);
            this.Controls.Add(this.cbOnlyData);
            this.Controls.Add(this.label2);
            this.Controls.Add(this.label1);
            this.Controls.Add(this.button1);
            this.Name = "mainForm";
            this.Text = "Form1";
            this.ResumeLayout(false);

        }
        #endregion
    }
}

Program.cs

using System;
using System.Windows.Forms;

namespace ConsolidatingFiles
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new mainForm());
        }
    }
}


Creating pdf files with the PDF API (C# / netframework) | FlexCel Studio for the .NET Framework documentation

Creating pdf files with the PDF API (C# / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\csharp\VS2022\netframework\10.API\A0.Creating Pdf Files With PDF API and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​csharp/​VS2022/​netframework/​Modules/​10.​API/​A0.​Creating Pdf Files With PDF API

Overview

Even when FlexCel is not a full featured PDF package, it does have a basic PDF API that you can use to create PDF files from scratch.

Concepts

  • How to create a PDF file using FlexCel's internal PDF API. The API is very similar to GDI+, and allows you to use a PDF "Canvas" where you can draw things in. To use the API, you need to use the class PdfWriter

  • The PDF API on FlexCel is designed to support exporting Excel documents to PDF using FlexCelPdfExport. But you can use the same API FlexCelPdfExport uses to create your own PDF files with code.

Files

AssemblyInfo.cs

using System.Reflection;
using System.Runtime.CompilerServices;

//
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
//
[assembly: AssemblyTitle("")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("(c) 2002 - 2024 TMS Software")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

//
// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version
//      Build Number
//      Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:

[assembly: AssemblyVersion("7.21.0.0")]

//
// In order to sign your assembly you must specify a key to use. Refer to the
// Microsoft .NET Framework documentation for more information on assembly signing.
//
// Use the attributes below to control which key is used for signing.
//
// Notes:
//   (*) If no key is specified, the assembly is not signed.
//   (*) KeyName refers to a key that has been installed in the Crypto Service
//       Provider (CSP) on your machine. KeyFile refers to a file which contains
//       a key.
//   (*) If the KeyFile and the KeyName values are both specified, the
//       following processing occurs:
//       (1) If the KeyName can be found in the CSP, that key is used.
//       (2) If the KeyName does not exist and the KeyFile does exist, the key
//           in the KeyFile is installed into the CSP and used.
//   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
//       When specifying the KeyFile, the location of the KeyFile should be
//       relative to the project output directory which is
//       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
//       located in the project directory, you would specify the AssemblyKeyFile
//       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
//   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
//       documentation for more information on this.
//
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]
[assembly: AssemblyKeyName("")]

Form1.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using FlexCel.Core;
using FlexCel.Pdf;
using System.IO;
using System.Diagnostics;
using System.Reflection;
using System.Drawing.Drawing2D;

namespace CreatingPdfFilesWithPDFAPI
{
    /// <summary>
    /// Jow to create PDF files directly with FlexCel.
    /// </summary>
    public partial class mainForm: System.Windows.Forms.Form
    {
        public mainForm()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, System.EventArgs e)
        {
            if (saveFileDialog1.ShowDialog() != DialogResult.OK) return;

            TUITextDecoration Underline = new TUITextDecoration(TUIUnderline.Single);
            PdfWriter pdf = new PdfWriter();

            using (FileStream file = new FileStream(saveFileDialog1.FileName, FileMode.Create))
            {
                pdf.Compress = true;
                pdf.BeginDoc(file);
                pdf.YAxisGrowsDown = true; //To keep it compatible with GDI+
                using (TUIFont f = TUIFont.Create("times new roman", (float)22.5, TUIFontStyle.Italic))
                {
                    using (TUIFont f2 = TUIFont.Create("Arial", (float)12, TUIFontStyle.Italic))
                    {
                        pdf.DrawString("This is the first line on a test of many lines.", f, Underline, Brushes.Navy, 100, 100);
                        pdf.DrawString("Some unicode: \u0e2a\u0e27\u0e31\u0e2a\u0e14\u0e35", f, Underline, Brushes.ForestGreen, 100, 200);
                        pdf.DrawString("More lines here!", f, Underline, Brushes.ForestGreen, 200, 300);
                        pdf.DrawString("And this is the last line.", f, Underline, Brushes.Black, 200, 400);
                        pdf.Properties.Author = "Adrian";
                        pdf.Properties.Title = "This is a test of FlexCel Api";
                        pdf.Properties.Keywords = "test\nflexcel\napi";
                        pdf.NewPage();
                        pdf.SaveState();
                        pdf.Rotate(200, 100, 45);
                        pdf.DrawString("Some rotated test", f, Underline, Brushes.Black, 200, 200);
                        pdf.RestoreState();
                        pdf.DrawString("Some NOT rotated text", f, Underline, Brushes.Black, 200, 200);
                        pdf.DrawString("Hello from FlexCel!", f2, Brushes.Black, 200, 50);

                        TPointF[] points = { new TPointF(200, 100), new TPointF(200, 50), new TPointF(500, 50), new TPointF(700, 100) };
                        pdf.DrawLines(Pens.DarkOrchid, points);

                        RectangleF Coords = new RectangleF(100, 300, 100, 100);
                        using (Brush Gradient = new LinearGradientBrush(Coords, Color.Red, Color.Blue, 0f))
                        {
                            pdf.DrawAndFillRectangle(Pens.Red, Gradient, 100, 300, 100, 100);
                        }
                        pdf.DrawRectangle(Pens.DarkSlateBlue, 100, 300, 50, 50);
                        pdf.DrawLine(Pens.Black, 100, 300, 200, 400);

                        string AssemblyPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
                        using (Image Img = Image.FromFile(AssemblyPath + Path.DirectorySeparatorChar + ".." + Path.DirectorySeparatorChar + ".." + Path.DirectorySeparatorChar + "test.jpg"))
                        {
                            pdf.DrawImage(Img, new RectangleF(200, 300, 200, 150), null);
                        }
                        pdf.IntersectClipRegion(new RectangleF(100, 100, 50, 50));
                        pdf.FillRectangle(Brushes.DarkTurquoise, 100, 100, 100, 100);

                        pdf.EndDoc();
                    }
                }
            }
            if (MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) == DialogResult.Yes)
            {
                using (Process p = new Process())
                {
                    p.StartInfo.FileName = saveFileDialog1.FileName;
                    p.StartInfo.UseShellExecute = true;
                    p.Start();
                }
            }

        }
    }
}

Form1.Designer.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using FlexCel.Core;
using FlexCel.Pdf;
using System.IO;
using System.Diagnostics;
using System.Reflection;
using System.Drawing.Drawing2D;
namespace CreatingPdfFilesWithPDFAPI
{
    public partial class mainForm: System.Windows.Forms.Form
    {
        private System.Windows.Forms.Button button1;
        private System.Windows.Forms.SaveFileDialog saveFileDialog1;
        private System.Windows.Forms.Label label1;
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.Container components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.button1 = new System.Windows.Forms.Button();
            this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog();
            this.label1 = new System.Windows.Forms.Label();
            this.SuspendLayout();
            //
            // button1
            //
            this.button1.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
            this.button1.Location = new System.Drawing.Point(48, 160);
            this.button1.Name = "button1";
            this.button1.TabIndex = 0;
            this.button1.Text = "GO!";
            this.button1.Click += new System.EventHandler(this.button1_Click);
            //
            // saveFileDialog1
            //
            this.saveFileDialog1.Filter = "Pdf Files|*.pdf";
            this.saveFileDialog1.RestoreDirectory = true;
            //
            // label1
            //
            this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
                | System.Windows.Forms.AnchorStyles.Left)
                | System.Windows.Forms.AnchorStyles.Right)));
            this.label1.BackColor = System.Drawing.Color.FromArgb(((System.Byte)(255)), ((System.Byte)(255)), ((System.Byte)(192)));
            this.label1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.label1.Location = new System.Drawing.Point(16, 16);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(144, 80);
            this.label1.TabIndex = 1;
            this.label1.Text = "A demo on how to create a PDF file with the PDF API.";
            //
            // mainForm
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(168, 197);
            this.Controls.Add(this.label1);
            this.Controls.Add(this.button1);
            this.Name = "mainForm";
            this.Text = "Form1";
            this.ResumeLayout(false);

        }
        #endregion
    }
}

Program.cs

using System;
using System.Windows.Forms;

namespace CreatingPdfFilesWithPDFAPI
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new mainForm());
        }
    }
}


Handling non-fatal errors (C# / netframework) | FlexCel Studio for the .NET Framework documentation

Handling non-fatal errors (C# / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\csharp\VS2022\netframework\10.API\X0.Handling Errors and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​csharp/​VS2022/​netframework/​Modules/​10.​API/​X0.​Handling Errors

Overview

On this demo we are going to see how to deal with errors that are not fatal and will normally be ignored, but that can degrade the generated files.

You can hook your own listener to the FlexCelTrace static class to gain control on what should be done when a non-fatal error happens.

Concepts

  • How to hook a listener to the static FlexCelTrace class. In a normal application you would just hook the listener at the beginning of the application. On this case, since our demo can be used standalone or from the MainDemo browser, we need to make sure we unhook the event when the form is disposed.

  • How to stop the file generation when a non-fatal error happens.

  • How we should take care of threading issues, since FlexCelTrace is a static class that could be called from more than one place.

  • How to ignore different types of errors.

Files

AssemblyInfo.cs

using System.Reflection;
using System.Runtime.CompilerServices;

//
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
//
[assembly: AssemblyTitle("")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("(c) 2002 - 2024 TMS Software")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

//
// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version
//      Build Number
//      Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:

[assembly: AssemblyVersion("7.21.0.0")]

//
// In order to sign your assembly you must specify a key to use. Refer to the
// Microsoft .NET Framework documentation for more information on assembly signing.
//
// Use the attributes below to control which key is used for signing.
//
// Notes:
//   (*) If no key is specified, the assembly is not signed.
//   (*) KeyName refers to a key that has been installed in the Crypto Service
//       Provider (CSP) on your machine. KeyFile refers to a file which contains
//       a key.
//   (*) If the KeyFile and the KeyName values are both specified, the
//       following processing occurs:
//       (1) If the KeyName can be found in the CSP, that key is used.
//       (2) If the KeyName does not exist and the KeyFile does exist, the key
//           in the KeyFile is installed into the CSP and used.
//   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
//       When specifying the KeyFile, the location of the KeyFile should be
//       relative to the project output directory which is
//       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
//       located in the project directory, you would specify the AssemblyKeyFile
//       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
//   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
//       documentation for more information on this.
//
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]
[assembly: AssemblyKeyName("")]

Form1.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using System.IO;
using System.Diagnostics;
using System.Reflection;
using System.Text;

using FlexCel.Render;

namespace HandlingErrors
{
    /// <summary>
    /// How to handle non fatal errors with FlexCel.
    /// </summary>
    public partial class mainForm: System.Windows.Forms.Form
    {

        private FlexCelErrorEventHandler FlexCelTrace_OnErrorHandler;
        public mainForm()
        {
            InitializeComponent();

            //Create a list to hold error messages. Keeping all error messages in memory is normally not a good thing to do,
            //but for this demo it is ok.
            ErrorList = new ArrayList();

            //Hook our error handler to FlexCel error handler.
            FlexCelTrace_OnErrorHandler = new FlexCelErrorEventHandler(FlexCelTrace_OnError); //We will save the value of the delegate here so we can unhook the event on dispose.
            FlexCelTrace.OnError += FlexCelTrace_OnErrorHandler;
        }

        private ArrayList ErrorList;
        private static object ErrorListLock = new object(); //Used to lock ErrorList and ensure no more than one thread writes to it.

        private string PathToExe
        {
            get
            {
                return Path.Combine(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), ".."), "..") + Path.DirectorySeparatorChar;
            }
        }

        private void button1_Click(object sender, System.EventArgs e)
        {
            ErrorList.Clear();
            errorBox.Text = "";

            try
            {
                DoThings();
            }
            catch (MyAbortException ex)
            {
                MessageBox.Show(ex.Message);
            }

            if (ErrorList.Count == 0) errorBox.Text = "No errors!";
            else
            {
                errorBox.Text = String.Format("There were {0} error messages" + Environment.NewLine, ErrorList.Count);
                foreach (string s in ErrorList)
                {
                    errorBox.AppendText(s + Environment.NewLine);
                }
            }
        }

        private void DoThings()
        {
            ExcelFile xls = new XlsFile(true);
            xls.NewFile(1, TExcelFileFormat.v2019);

            for (int r = 1; r < 2000; r++)
            {
                xls.InsertHPageBreak(r); //This won't throw an exception here, since FlexCel allows to have more than 1025 page breaks, but at the moment of saving. (since an xls file can't have more than that)
            }

            xls.SetCellValue(1, 1, "We have a page break on each row, so this will print/export as one row per page");
            xls.SetCellValue(2, 1, "??? ? ? ? ???? ????"); //Since we leave the font at arial, this won't show when exporting to pdf.

            TFlxFormat fmt = xls.GetDefaultFormat;
            fmt.Font.Name = "Arial Unicode MS";
            xls.SetCellValue(3, 1, "??? ? ? ? ???? ????", xls.AddFormat(fmt)); //this will display fine in the pdf.

            fmt.Font.Name = "ThisFontDoesntExists";
            xls.SetCellValue(4, 1, "This font doesn't exists", xls.AddFormat(fmt));

            //Tahoma doesn't have italic variant. See http://help.lockergnome.com/office/Tahoma-italic-ftopict705661.html
            //You shouldn't normally use Tahoma italics in a document. If we embedded the fonts in this pdf, the fake italics wouldn't work.
            fmt.Font.Name = "Tahoma";
            fmt.Font.Style = TFlxFontStyles.Italic;
            xls.SetCellValue(5, 1, "This is fake italics", xls.AddFormat(fmt));

            if (saveFileDialog1.ShowDialog() != DialogResult.OK) return;

            using (FlexCelPdfExport pdf = new FlexCelPdfExport(xls, true))
            {
                pdf.Export(Path.ChangeExtension(saveFileDialog1.FileName, ".pdf"));
            }

            xls.Save(saveFileDialog1.FileName + ".xls");
        }

        /// <summary>
        /// This is the generic event handler for non fatal errors. We hooked it in the mainForm constructor.
        /// </summary>
        /// <param name="e"></param>
        private void FlexCelTrace_OnError(TFlexCelErrorInfo e)
        {

            if (cbIgnoreFontErrors.Checked)
            {
                switch (e.Error)
                {
                    //Ignore this errors:
                    case FlexCelError.PdfFontNotFound:
                    case FlexCelError.PdfGlyphNotInFont:
                    case FlexCelError.PdfFauxBoldOrItalics:
                        return;
                }
            }

            //Normally tracing non fatal errors is a good idea.
            //Depending on the listener of your trace object, you can redirect this to a log, the event viewer or wherever else.
            Trace.WriteLine(e.Message);

            //If we selected "Stop On Errors" we will abort file generation by throwing an exception that will be
            //catched in the main block.
            if (cbStopOnErrors.Checked)
            {
                throw new MyAbortException(e.Message);
            }

            //In this case this is a single thread app so locking is not really necessary,
            //but it is a good practice to always lock access to global objects in this error handler.
            //This event handler might me called from more than one thread, and you don't want to mess
            //the object collecting the messages (in this case ErrorList).
            lock (ErrorListLock)
            {
                ErrorList.Add(System.Threading.Thread.CurrentThread.Name + ": - " + e.Message);
            }
        }
    }

    /// <summary>
    /// A custom exception designed to notify us when a non fatal error must be aborted.
    /// </summary>
    public class MyAbortException: Exception
    {
        public MyAbortException(string aMessage) : base(aMessage) { }
    }
}

Form1.Designer.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using System.IO;
using System.Diagnostics;
using System.Reflection;
using System.Text;
using FlexCel.Render;
namespace HandlingErrors
{
    public partial class mainForm: System.Windows.Forms.Form
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.Container components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (components != null)
                {
                    components.Dispose();
                }
            }

            //Onhook the event handler. Since this is a form, we need to onhook the event when it is disposed or it would live forever.
            FlexCelTrace.OnError -= FlexCelTrace_OnErrorHandler;

            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.button1 = new System.Windows.Forms.Button();
            this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog();
            this.label1 = new System.Windows.Forms.Label();
            this.cbStopOnErrors = new System.Windows.Forms.CheckBox();
            this.errorBox = new System.Windows.Forms.TextBox();
            this.cbIgnoreFontErrors = new System.Windows.Forms.CheckBox();
            this.SuspendLayout();
            //
            // button1
            //
            this.button1.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
            this.button1.Location = new System.Drawing.Point(244, 313);
            this.button1.Name = "button1";
            this.button1.TabIndex = 0;
            this.button1.Text = "GO!";
            this.button1.Click += new System.EventHandler(this.button1_Click);
            //
            // saveFileDialog1
            //
            this.saveFileDialog1.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm|Excel 97/2003|*.xls|Excel 2007|*.xlsx;*.xlsm|All files|*.*";
            this.saveFileDialog1.RestoreDirectory = true;
            this.saveFileDialog1.Title = "Save file as: (FILE WILL BE SAVED AS PDF TOO)";
            //
            // label1
            //
            this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
                | System.Windows.Forms.AnchorStyles.Right)));
            this.label1.BackColor = System.Drawing.Color.FromArgb(((System.Byte)(255)), ((System.Byte)(255)), ((System.Byte)(192)));
            this.label1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.label1.Location = new System.Drawing.Point(16, 16);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(536, 32);
            this.label1.TabIndex = 1;
            this.label1.Text = "This demo shows how to handle non fatal errors in FlexCel by using the FlexCelTra" +
                "ce static class.";
            //
            // cbStopOnErrors
            //
            this.cbStopOnErrors.Location = new System.Drawing.Point(16, 64);
            this.cbStopOnErrors.Name = "cbStopOnErrors";
            this.cbStopOnErrors.Size = new System.Drawing.Size(400, 24);
            this.cbStopOnErrors.TabIndex = 2;
            this.cbStopOnErrors.Text = "Stop on non fatal errors";
            //
            // errorBox
            //
            this.errorBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
                | System.Windows.Forms.AnchorStyles.Left)
                | System.Windows.Forms.AnchorStyles.Right)));
            this.errorBox.Font = new System.Drawing.Font("Arial Unicode MS", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
            this.errorBox.Location = new System.Drawing.Point(16, 128);
            this.errorBox.Multiline = true;
            this.errorBox.Name = "errorBox";
            this.errorBox.ReadOnly = true;
            this.errorBox.ScrollBars = System.Windows.Forms.ScrollBars.Both;
            this.errorBox.Size = new System.Drawing.Size(536, 160);
            this.errorBox.TabIndex = 3;
            this.errorBox.Text = "";
            this.errorBox.WordWrap = false;
            //
            // cbIgnoreFontErrors
            //
            this.cbIgnoreFontErrors.Location = new System.Drawing.Point(16, 88);
            this.cbIgnoreFontErrors.Name = "cbIgnoreFontErrors";
            this.cbIgnoreFontErrors.Size = new System.Drawing.Size(208, 24);
            this.cbIgnoreFontErrors.TabIndex = 4;
            this.cbIgnoreFontErrors.Text = "Ignore font errors";
            //
            // mainForm
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(560, 350);
            this.Controls.Add(this.cbIgnoreFontErrors);
            this.Controls.Add(this.errorBox);
            this.Controls.Add(this.cbStopOnErrors);
            this.Controls.Add(this.label1);
            this.Controls.Add(this.button1);
            this.Name = "mainForm";
            this.Text = "Handling non fatal errors.";
            this.ResumeLayout(false);

        }
        #endregion

        private System.Windows.Forms.Button button1;
        private System.Windows.Forms.SaveFileDialog saveFileDialog1;
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.TextBox errorBox;
        private System.Windows.Forms.CheckBox cbStopOnErrors;
        private System.Windows.Forms.CheckBox cbIgnoreFontErrors;

    }
}

Program.cs

using System;
using System.Windows.Forms;

namespace HandlingErrors
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new mainForm());
        }
    }
}


Report demos (C# / netframework) | FlexCel Studio for the .NET Framework documentation

Report demos (C# / netframework)

Overview

Here you can find how to make templates and code to create full featured Excel reports.

In this section

  • Getting started with Reports

  • Range reports

  • Using Linq as datasource

  • Advanced Linq

  • Tables as datasources

  • Using Entity Framework datasources

  • Multiple sheet report

  • Exporting Web Services

  • Includes

  • Bidirectional reports

  • Lookups

  • Aggregates

  • Regular expressions

  • Manual formulas

  • Parameters inside expressions

  • Intelligent page breaks in reports

  • Debugging reports

  • Fixed forms with datasets

  • Balanced columns

  • Join and Union

  • Templates in the executable

  • Images

  • Charts

  • Charts With Dynamic Series

  • Pivot tables

  • HTML

  • Autofiting rows and columns

  • Generic reports

  • Generic reports Part 2

  • Meta templates

  • User defined tables

  • Direct SQL

  • Master detail report on one table

  • Merging similar cells

  • Splitting datasets

  • Fixed footer

  • Overflowing data in different sheets

  • User defined functions

  • User defined formats

  • Virtual datasets

  • Encryption and subtotals

  • Step by step tutorial on FlexCel reports

  • Features


Getting started with Reports (C# / netframework) | FlexCel Studio for the .NET Framework documentation

Getting started with Reports (C# / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\csharp\VS2022\netframework\20.Reports\10.Getting Started Reports and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​csharp/​VS2022/​netframework/​Modules/​20.​Reports/​10.​Getting Started Reports

Overview

A really simple demo on how to create an Excel report. No database is used, only report variables.

Concepts

  • A template is an Excel file with tags that will be replaced by report variables or fields from a dataset. Tags are always on the form <#tag> If a tag has parameters, it always has the form <#tag(param1; param2...)>. You can read the FlexCel Reports Tag Reference. for more information.

  • To set the value for report variable, use FlexCelReport.SetValue. You can set any kind of object from here, not just text. If you set it to a TFormula object, you will enter a formula.

  • <#Tags> will be replaced inside Cells, Comments, Sheet names, Images, Hyperlinks, AutoShapes, Headers and Footers. All of this is shown here. To see the headers and footers, you must do a print preview.

  • There are 2 special datatypes you must be aware:

    1. Dates: Dates in Excel are just numbers, with a special cell format. To enter a date in Excel, make sure the cell has a date format.

    2. Multiline Text:To be able to show carriage return on a cell, it must have "Wrap text" enabled on its cell format.

  • Hyperlinks are a special case for 2 reasons:

    1. You can't enter <# into an hyperlink, as # is a reserved keyword. So, tags in hyperlinks are on the form "*.TAG.*" (On older FlexCelVersions we would use "<.tag>". This will still work, but you can't enter this text into Excel 2003 or newer)

    2. If you do not begin the hyperlink text with "http://" or "https://" while creating the link in Excel, it will be created as local file. As this is not what you would normally want, all "local file" hyperlinks will be changed to URL hyperlinks if the replaced text starts with "http:" or "https:". So do not create links like "www.tmssoftware.com", make your hyperlinks "https://www.tmssoftware.com"

  • To create an hyperlink to a cell in the same file using tags, start the definition of the hyperlink with a "#", like "*.sheetvar.*!*.#cellvar.*"

  • There are special tags, like the <#If( condition, iftrue, iffalse)> that might contain other tags inside. You can use any composition of tags on any of the places where they will be replaced.

  • Empty comments will be removed. This is a feature so you can selectively comment cells based on the comment text. If comment text is blank, no comment will be made.

  • To replace images, name them as <#tag>. To see or change the name of an image, use the combo box at the upper left corner on Excel.

  • You can use tags as usual on sheet names. But, as the maximum sheet name length is 32, it is kind of limited. You can use Equal tag (<#=(cell)>) to solve this limitation.

  • You can define reusable variables on the config sheet. For example, here we define an expression containing the name and "anonymous" if the name is null, and we use it on the sheet name and the print header. Then we can use this expression on many places. <#=(cell)> is conceptually the same as report expressions, but report expressions are normally cleaner on what they mean.

  • Rich text will be preserved on cells. If for example you write "<#name> and <#date>", the result will be "your name and thedate"

Files

AssemblyInfo.cs

using System.Reflection;
using System.Runtime.CompilerServices;

//
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
//
[assembly: AssemblyTitle("")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("(c) 2002 - 2024 TMS Software")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

//
// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version
//      Build Number
//      Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:

[assembly: AssemblyVersion("7.21.0.0")]

//
// In order to sign your assembly you must specify a key to use. Refer to the
// Microsoft .NET Framework documentation for more information on assembly signing.
//
// Use the attributes below to control which key is used for signing.
//
// Notes:
//   (*) If no key is specified, the assembly is not signed.
//   (*) KeyName refers to a key that has been installed in the Crypto Service
//       Provider (CSP) on your machine. KeyFile refers to a file which contains
//       a key.
//   (*) If the KeyFile and the KeyName values are both specified, the
//       following processing occurs:
//       (1) If the KeyName can be found in the CSP, that key is used.
//       (2) If the KeyName does not exist and the KeyFile does exist, the key
//           in the KeyFile is installed into the CSP and used.
//   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
//       When specifying the KeyFile, the location of the KeyFile should be
//       relative to the project output directory which is
//       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
//       located in the project directory, you would specify the AssemblyKeyFile
//       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
//   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
//       documentation for more information on this.
//
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]
[assembly: AssemblyKeyName("")]

Form1.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using System.Diagnostics;
using System.Reflection;
using System.Threading;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using FlexCel.Report;

namespace GettingStartedReports
{
    /// <summary>
    /// Simple report
    /// </summary>
    public partial class mainForm: System.Windows.Forms.Form
    {
        public mainForm()
        {
            InitializeComponent();
        }

        private void btnGo_Click(object sender, System.EventArgs e)
        {
            //Note that we are using a FlexCelReport component in a form here. We could also create the FlexCelReport component dynamically.

            if (cbAutoOpen.Checked)
                AutoOpenRun();
            else
                NormalRun();
        }

        private void Setup(string UserName, string UserUrl, string DataPath)
        {
            //Set report variables, including an image.

            reportStart.SetValue("Date", DateTime.Now);
            reportStart.SetValue("Name", UserName);
            reportStart.SetValue("TwoLines", "First line" + Environment.NewLine + "Second Line");
            reportStart.SetValue("Empty", null);
            reportStart.SetValue("LinkPage", UserUrl);
            reportStart.SetValue("Img", File.ReadAllBytes(Path.Combine(DataPath, "img.png")));
        }

        private void NormalRun()
        {
            string DataPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
            DataPath = Path.Combine(DataPath, "..");
            DataPath = Path.Combine(DataPath, "..");
            Setup(edName.Text, edUrl.Text, DataPath);

            if (saveFileDialog1.ShowDialog() == DialogResult.OK)
            {
                //FlexCel isn't a conversion tool. While it does a good job converting a lot of stuff
                //between xls and xlsx, for best results we will use an xlsx template if the user choose xlsx and xls if the user choose xls.
                reportStart.Run(Path.Combine(DataPath, "Getting Started Reports.template" + Path.GetExtension(saveFileDialog1.FileName)), saveFileDialog1.FileName);

                if (MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    using (Process p = new Process())
                    {
                        p.StartInfo.FileName = saveFileDialog1.FileName;
                        p.StartInfo.UseShellExecute = true;
                        p.Start();
                    }
                }
            }
        }

        private void AutoOpenRun()
        {
            string DataPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
            DataPath = Path.Combine(DataPath, "..");
            DataPath = Path.Combine(DataPath, "..");
            Setup(edName.Text, edUrl.Text, DataPath);

            XlsFile Xls = new XlsFile();
            Xls.Open(Path.Combine(DataPath, "Getting Started Reports.template.xlsx"));
            reportStart.Run(Xls);

            string FilePath = Path.GetTempPath();  //GetTempFileName does not allow us to specify the "xltx" extension.
            string FileName = Path.Combine(FilePath, Guid.NewGuid().ToString() + ".xltx");  //xltx is the extension for excel templates.
            try
            {
                using (FileStream OutStream = new FileStream(FileName, FileMode.Create, FileAccess.ReadWrite))
                {
                    Xls.IsXltTemplate = true; //Make it an xltx template.
                    Xls.Save(OutStream);
                }
                using (Process p = new Process())
                {
                    p.StartInfo.FileName = FileName;
                    p.StartInfo.UseShellExecute = true;
                    p.Start();
                }
            }
            finally
            {
                //For .Net 4 and newer you can use Task.Run here. See https://doc.tmssoftware.com/flexcel/net/tips/automatically-open-generated-excel-files.html
                new Thread(delegate()
                {
                    Thread.Sleep(30000); //wait for 30 secs to give Excel time to start.
                    File.Delete(FileName);  //As it is an xltx file, we can delete it even when it is open on Excel.
                });
            }
        }

        /// <summary>
        /// This is the method that will be called by the ASP.NET front end. It returns an array of bytes
        /// with the report data, so the ASP.NET application can stream it to the client.
        /// </summary>
        /// <param name="UserName"></param>
        /// <param name="UserUrl"></param>
        /// <returns>The generated file as a byte array.</returns>
        public byte[] WebRun(string UserName, string UserUrl)
        {
            string DataPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
            DataPath = Path.Combine(DataPath, "..");
            DataPath = Path.Combine(DataPath, "..");
            Setup(UserName, UserUrl, DataPath);

            using (MemoryStream OutStream = new MemoryStream())
            {
                using (FileStream InStream = new FileStream(Path.Combine(DataPath, "Getting Started Reports.template.xls"), FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
                {
                    reportStart.Run(InStream, OutStream);
                    return OutStream.ToArray();
                }
            }
        }

        private void btnCancel_Click(object sender, System.EventArgs e)
        {
            Close();
        }

    }

}

Form1.Designer.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using System.Diagnostics;
using System.Reflection;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using FlexCel.Report;
namespace GettingStartedReports
{
    public partial class mainForm: System.Windows.Forms.Form
    {
        private System.Windows.Forms.Button btnGo;
        private System.Windows.Forms.SaveFileDialog saveFileDialog1;

        private System.Windows.Forms.TextBox edName;
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.Button btnCancel;
        private System.Windows.Forms.Label label2;
        private System.Windows.Forms.TextBox edUrl;
        private System.Windows.Forms.CheckBox cbAutoOpen;
        private FlexCel.Report.FlexCelReport reportStart;

        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.Container components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.btnGo = new System.Windows.Forms.Button();
            this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog();
            this.reportStart = new FlexCel.Report.FlexCelReport();
            this.edName = new System.Windows.Forms.TextBox();
            this.label1 = new System.Windows.Forms.Label();
            this.btnCancel = new System.Windows.Forms.Button();
            this.label2 = new System.Windows.Forms.Label();
            this.edUrl = new System.Windows.Forms.TextBox();
            this.cbAutoOpen = new System.Windows.Forms.CheckBox();
            this.SuspendLayout();
            //
            // btnGo
            //
            this.btnGo.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
            this.btnGo.BackColor = System.Drawing.Color.Green;
            this.btnGo.ForeColor = System.Drawing.Color.White;
            this.btnGo.Location = new System.Drawing.Point(152, 152);
            this.btnGo.Name = "btnGo";
            this.btnGo.Size = new System.Drawing.Size(112, 24);
            this.btnGo.TabIndex = 0;
            this.btnGo.Text = "GO!";
            this.btnGo.UseVisualStyleBackColor = false;
            this.btnGo.Click += new System.EventHandler(this.btnGo_Click);
            //
            // saveFileDialog1
            //
            this.saveFileDialog1.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm|Excel 97/2003|*.xls|Excel 2007|*.xlsx;*.xlsm|All " +
    "files|*.*";
            this.saveFileDialog1.RestoreDirectory = true;
            //
            // reportStart
            //
            this.reportStart.AllowOverwritingFiles = true;
            this.reportStart.DeleteEmptyRanges = false;
            //
            // edName
            //
            this.edName.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
            | System.Windows.Forms.AnchorStyles.Right)));
            this.edName.Location = new System.Drawing.Point(24, 40);
            this.edName.Name = "edName";
            this.edName.Size = new System.Drawing.Size(360, 20);
            this.edName.TabIndex = 1;
            //
            // label1
            //
            this.label1.Location = new System.Drawing.Point(24, 24);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(160, 16);
            this.label1.TabIndex = 2;
            this.label1.Text = "Tell me your name:";
            //
            // btnCancel
            //
            this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
            this.btnCancel.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
            this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            this.btnCancel.ForeColor = System.Drawing.Color.White;
            this.btnCancel.Location = new System.Drawing.Point(272, 152);
            this.btnCancel.Name = "btnCancel";
            this.btnCancel.Size = new System.Drawing.Size(112, 23);
            this.btnCancel.TabIndex = 3;
            this.btnCancel.Text = "Cancel";
            this.btnCancel.UseVisualStyleBackColor = false;
            this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
            //
            // label2
            //
            this.label2.Location = new System.Drawing.Point(28, 60);
            this.label2.Name = "label2";
            this.label2.Size = new System.Drawing.Size(228, 16);
            this.label2.TabIndex = 5;
            this.label2.Text = "Your Home page (without http://)";
            //
            // edUrl
            //
            this.edUrl.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
            | System.Windows.Forms.AnchorStyles.Right)));
            this.edUrl.Location = new System.Drawing.Point(28, 76);
            this.edUrl.Name = "edUrl";
            this.edUrl.Size = new System.Drawing.Size(360, 20);
            this.edUrl.TabIndex = 4;
            this.edUrl.Text = "www.tmssoftware.com";
            //
            // cbAutoOpen
            //
            this.cbAutoOpen.Location = new System.Drawing.Point(24, 104);
            this.cbAutoOpen.Name = "cbAutoOpen";
            this.cbAutoOpen.Size = new System.Drawing.Size(264, 24);
            this.cbAutoOpen.TabIndex = 6;
            this.cbAutoOpen.Text = "Auto open the generated file without saving it";
            //
            // mainForm
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(416, 190);
            this.Controls.Add(this.cbAutoOpen);
            this.Controls.Add(this.label2);
            this.Controls.Add(this.edUrl);
            this.Controls.Add(this.btnCancel);
            this.Controls.Add(this.label1);
            this.Controls.Add(this.edName);
            this.Controls.Add(this.btnGo);
            this.Name = "mainForm";
            this.Text = "Getting Started";
            this.ResumeLayout(false);
            this.PerformLayout();

        }
        #endregion
    }
}

Program.cs

using System;
using System.Windows.Forms;

namespace GettingStartedReports
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new mainForm());
        }
    }
}


Range reports (C# / netframework) | FlexCel Studio for the .NET Framework documentation

Range reports (C# / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\csharp\VS2022\netframework\20.Reports\20.Range Reports and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​csharp/​VS2022/​netframework/​Modules/​20.​Reports/​20.​Range Reports

Overview

On the GettingStarted demo we saw how to write tags on a template, and have FlexCel replace them. Now we are going to replace whole ranges with values from a database.

Concepts

  • To be able to use a database, you have to define a named range on the template, to tell FlexCel which rows or columns to use. Also, you need to add the table on the code.

  • You can arrange the ranges in many different ways. Take a look at all the sheets, they have different reports from the Northwind demo recreated with FlexCel.

  • There are four kinds of named ranges:

    • "__" Ranges: They are the most common, and the ones you should probably use. The table will be inserted horizontally, and the full rows will be moved down.

    • "_" Ranges: They work as the "__" ranges, but only the range and not the full row is moved down. Row properties (like row height) are not copied because not the full row is copied.

    • "II_" Ranges: Use them to insert the table by columns, not by rows. Full columns will be inserted.

    • "I_" Ranges: Tables will be inserted by columns, but only the selected range will move. Column properties (like column width) are not copied.

  • Ranges can be defined inside ranges, to create Master-Detail reports. On the dataset schema on your application, you have to define the corresponding relations for this to work.

  • It might happen that you need to use the same datatable, lets say __Categories__ on more than one sheet. You can't define more than one __Categories__ named range, but you can define an alias on the Config sheet, (for example Categories2=Categories) and then use __Categories2__ on the second sheet. Another alternative not shown in this example would be to use Alias Bands.

  • We used Intelligent Page Breaks in the first sheet so categories are kept in their own pages when printing.

Files

AssemblyInfo.cs

using System.Reflection;
using System.Runtime.CompilerServices;

//
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
//
[assembly: AssemblyTitle("")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("(c) 2002 - 2024 TMS Software")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

//
// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version
//      Build Number
//      Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:

[assembly: AssemblyVersion("7.21.0.0")]

//
// In order to sign your assembly you must specify a key to use. Refer to the
// Microsoft .NET Framework documentation for more information on assembly signing.
//
// Use the attributes below to control which key is used for signing.
//
// Notes:
//   (*) If no key is specified, the assembly is not signed.
//   (*) KeyName refers to a key that has been installed in the Crypto Service
//       Provider (CSP) on your machine. KeyFile refers to a file which contains
//       a key.
//   (*) If the KeyFile and the KeyName values are both specified, the
//       following processing occurs:
//       (1) If the KeyName can be found in the CSP, that key is used.
//       (2) If the KeyName does not exist and the KeyFile does exist, the key
//           in the KeyFile is installed into the CSP and used.
//   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
//       When specifying the KeyFile, the location of the KeyFile should be
//       relative to the project output directory which is
//       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
//       located in the project directory, you would specify the AssemblyKeyFile
//       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
//   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
//       documentation for more information on this.
//
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]
[assembly: AssemblyKeyName("")]

Form1.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using System.Diagnostics;
using System.Reflection;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using FlexCel.Report;
using FlexCel.Demo.SharedData;

namespace RangeReports
{
    /// <summary>
    /// Summary description for Form1.
    /// </summary>
    public partial class mainForm: System.Windows.Forms.Form
    {

        public mainForm()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, System.EventArgs e)
        {
            AutoRun();
        }

        public void AutoRun()
        {
            using (FlexCelReport ordersReport = SharedData.CreateReport())
            {
                ordersReport.SetValue("Date", DateTime.Now);

                string DataPath = Path.Combine(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), ".."), "..") + Path.DirectorySeparatorChar;

                if (saveFileDialog1.ShowDialog() == DialogResult.OK)
                {
                    ordersReport.Run(DataPath + "Range Reports.template.xls", saveFileDialog1.FileName);

                    if (MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) == DialogResult.Yes)
                    {
                        using (Process p = new Process())
                        {
                            p.StartInfo.FileName = saveFileDialog1.FileName;
                            p.StartInfo.UseShellExecute = true;
                            p.Start();
                        }
                    }
                }
            }
        }

        private void btnCancel_Click(object sender, System.EventArgs e)
        {
            Close();
        }
    }

}

Form1.Designer.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using System.Diagnostics;
using System.Reflection;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using FlexCel.Report;
using FlexCel.Demo.SharedData;
namespace RangeReports
{
    public partial class mainForm: System.Windows.Forms.Form
    {
        private System.Windows.Forms.Button button1;
        private System.Windows.Forms.SaveFileDialog saveFileDialog1;
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.Button btnCancel;
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.Container components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.button1 = new System.Windows.Forms.Button();
            this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog();
            this.label1 = new System.Windows.Forms.Label();
            this.btnCancel = new System.Windows.Forms.Button();
            this.SuspendLayout();
            //
            // button1
            //
            this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.button1.BackColor = System.Drawing.Color.Green;
            this.button1.ForeColor = System.Drawing.Color.White;
            this.button1.Location = new System.Drawing.Point(152, 88);
            this.button1.Name = "button1";
            this.button1.Size = new System.Drawing.Size(112, 23);
            this.button1.TabIndex = 0;
            this.button1.Text = "GO!";
            this.button1.UseVisualStyleBackColor = false;
            this.button1.Click += new System.EventHandler(this.button1_Click);
            //
            // saveFileDialog1
            //
            this.saveFileDialog1.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm|Excel 97/2003|*.xls|Excel 2007|*.xlsx;*.xlsm|All files|*.*";
            this.saveFileDialog1.RestoreDirectory = true;
            //
            // label1
            //
            this.label1.Location = new System.Drawing.Point(24, 24);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(272, 24);
            this.label1.TabIndex = 2;
            this.label1.Text = "Press \"GO\" to create a database Report.";
            //
            // btnCancel
            //
            this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.btnCancel.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
            this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            this.btnCancel.ForeColor = System.Drawing.Color.White;
            this.btnCancel.Location = new System.Drawing.Point(272, 88);
            this.btnCancel.Name = "btnCancel";
            this.btnCancel.Size = new System.Drawing.Size(112, 23);
            this.btnCancel.TabIndex = 3;
            this.btnCancel.Text = "Cancel";
            this.btnCancel.UseVisualStyleBackColor = false;
            this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
            //
            // mainForm
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(416, 133);
            this.Controls.Add(this.btnCancel);
            this.Controls.Add(this.label1);
            this.Controls.Add(this.button1);
            this.Name = "mainForm";
            this.Text = "Range Reports";
            this.ResumeLayout(false);

        }
        #endregion
    }
}

Program.cs

using System;
using System.Windows.Forms;

namespace RangeReports
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new mainForm());
        }
    }
}


Using Linq as datasource (C# / netframework) | FlexCel Studio for the .NET Framework documentation

Using Linq as datasource (C# / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\csharp\VS2022\netframework\20.Reports\22.Linq and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​csharp/​VS2022/​netframework/​Modules/​20.​Reports/​22.​Linq

Overview

THIS DEMO NEEDS .NET 3.5 OR NEWER.

Most of the demos here use datasets as datasources. This is just for convenience, because Linq is not supported in .NET 2.0 and so if we used Linq those demos wouldn't work for everybody, and also because the focus is in the Excel templates, not so much in the data layer. But you can use any IQueryable<T> collection as a datasource in a FlexCel report, and this is what we will show here.

Concepts

  • How to run a report from a List<> of objects.

  • When using IQueryable<T> as datasource, you can use any public property of T in the report. So if type T has a public property "LastName", you can access it with <#dt.LastName>.

  • Master detail with implicit relationships. When a public property of a collection of objects is other collection of objects, the property is considered as a detail of the main collection. In this example "Elements" is a property of "Categories", and so there is an implicit relationship between them.

  • Master detail with explicit relationships. While when using LINQ you will normally use implicit relationships, you can also relate any two collections of objects with a relationship, as you could with datasets. In this example, "ElementName" is explicitly related to "Elements" with a call to FlexCelReport.AddRelationship.

Files

AssemblyInfo.cs

using System.Reflection;
using System.Runtime.CompilerServices;

//
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
//
[assembly: AssemblyTitle("")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("(c) 2002 - 2024 TMS Software")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

//
// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version
//      Build Number
//      Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:

[assembly: AssemblyVersion("7.21.0.0")]

//
// In order to sign your assembly you must specify a key to use. Refer to the
// Microsoft .NET Framework documentation for more information on assembly signing.
//
// Use the attributes below to control which key is used for signing.
//
// Notes:
//   (*) If no key is specified, the assembly is not signed.
//   (*) KeyName refers to a key that has been installed in the Crypto Service
//       Provider (CSP) on your machine. KeyFile refers to a file which contains
//       a key.
//   (*) If the KeyFile and the KeyName values are both specified, the
//       following processing occurs:
//       (1) If the KeyName can be found in the CSP, that key is used.
//       (2) If the KeyName does not exist and the KeyFile does exist, the key
//           in the KeyFile is installed into the CSP and used.
//   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
//       When specifying the KeyFile, the location of the KeyFile should be
//       relative to the project output directory which is
//       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
//       located in the project directory, you would specify the AssemblyKeyFile
//       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
//   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
//       documentation for more information on this.
//
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]
[assembly: AssemblyKeyName("")]

Form1.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using System.Diagnostics;
using System.Reflection;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using FlexCel.Report;
using System.Collections.Generic;
using System.Linq;

namespace Linq
{
    /// <summary>
    /// Summary description for Form1.
    /// </summary>
    public partial class mainForm : System.Windows.Forms.Form
    {

        public mainForm()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, System.EventArgs e)
        {
            AutoRun();
        }

        public void AutoRun()
        {
            using (FlexCelReport report = new FlexCelReport(true))
            {
                LoadTables(report);

                string DataPath = Path.Combine(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), ".."), "..") + Path.DirectorySeparatorChar;

                if (saveFileDialog1.ShowDialog() == DialogResult.OK)
                {
                    report.Run(DataPath + "Linq.template.xls", saveFileDialog1.FileName);

                    if (MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) == DialogResult.Yes)
                    {
                        using (Process p = new Process())
                        {
                            p.StartInfo.FileName = saveFileDialog1.FileName;
                            p.StartInfo.UseShellExecute = true;
                            p.Start();
                        }
                    }
                }
            }
        }

        private void LoadTables(FlexCelReport report)
        {
            List<Categories> Categories = new List<Categories>();
            Categories Animals = new Categories("Animals");
            Animals.Elements.Add(new Elements(1, "Penguin"));
            Animals.Elements.Add(new Elements(2, "Cat"));
            Animals.Elements.Add(new Elements(3, "Unicorn"));
            Categories.Add(Animals);

            Categories Flowers = new Categories("Flowers");
            Flowers.Elements.Add(new Elements(4, "Daisy"));
            Flowers.Elements.Add(new Elements(5, "Rose"));
            Flowers.Elements.Add(new Elements(6, "Orchid"));
            Categories.Add(Flowers);

            report.AddTable("Categories", Categories );
            //We don't need to call AddTable for elements since it is already added when we add Categories.

            List<ElementName> ElementNames = new List<ElementName>();
            ElementNames.Add(new ElementName(1, "Linus"));
            ElementNames.Add(new ElementName(1, "Gerard"));
            ElementNames.Add(new ElementName(2, "Rover"));
            ElementNames.Add(new ElementName(3, "Mike"));
            ElementNames.Add(new ElementName(5, "Rosalyn"));
            ElementNames.Add(new ElementName(5, "Monica"));
            ElementNames.Add(new ElementName(6, "Lisa"));

            report.AddTable("ElementName", ElementNames);
            //ElementName doesn't have an intrinsic relationship with categories, so we will have to manually add a relationship.
            //Non intrinsic relationships should be rare, but we do it here to show how it can be done.
            report.AddRelationship("Elements", "ElementName", "ElementID", "ElementID");
        }

        private void btnCancel_Click(object sender, System.EventArgs e)
        {
            Close();
        }
    }

    public class Categories
    {
        //Public properties can be used in reports.
        public string Name { get; private set; }

        //Elements is in master-detail relationship with this element, even when we don't explicitly add a relationship.
        //Relationship is inferred because Elements is a property of this object
        public List<Elements> Elements { get; private set; }

        public Categories(string name)
        {
            this.Name = name;
            Elements = new List<Elements>();
        }

    }

    public class Elements
    {
        //We will relate this property with the table of colors by adding a relationship.
        public int ElementID { get; private set; }

        public string Name { get; private set; }

        public Elements(int elementID, string name)
        {
            this.Name = name;
            this.ElementID = elementID;
        }

    }

    public class ElementName
    {
        public int ElementID { get; private set; }
        public string Name { get; private set; }

        public ElementName(int elementID, string name)
        {
            this.ElementID = elementID;
            this.Name = name;
        }
    }

}

Form1.Designer.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using System.Diagnostics;
using System.Reflection;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using FlexCel.Report;
namespace Linq
{
    public partial class mainForm : System.Windows.Forms.Form
    {
        private System.Windows.Forms.Button button1;
        private System.Windows.Forms.SaveFileDialog saveFileDialog1;
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.Button btnCancel;
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.Container components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose( bool disposing )
        {
            if( disposing )
            {
                if (components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose( disposing );
        }

        #region Windows Form Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.button1 = new System.Windows.Forms.Button();
            this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog();
            this.label1 = new System.Windows.Forms.Label();
            this.btnCancel = new System.Windows.Forms.Button();
            this.SuspendLayout();
            //
            // button1
            //
            this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.button1.BackColor = System.Drawing.Color.Green;
            this.button1.ForeColor = System.Drawing.Color.White;
            this.button1.Location = new System.Drawing.Point(152, 88);
            this.button1.Name = "button1";
            this.button1.Size = new System.Drawing.Size(112, 23);
            this.button1.TabIndex = 0;
            this.button1.Text = "GO!";
            this.button1.UseVisualStyleBackColor = false;
            this.button1.Click += new System.EventHandler(this.button1_Click);
            //
            // saveFileDialog1
            //
            this.saveFileDialog1.Filter = "Excel Files|*.xls";
            this.saveFileDialog1.RestoreDirectory = true;
            //
            // label1
            //
            this.label1.Location = new System.Drawing.Point(24, 24);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(272, 24);
            this.label1.TabIndex = 2;
            this.label1.Text = "Press \"GO\" to create a report from a List<> of objects.";
            //
            // btnCancel
            //
            this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.btnCancel.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
            this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            this.btnCancel.ForeColor = System.Drawing.Color.White;
            this.btnCancel.Location = new System.Drawing.Point(272, 88);
            this.btnCancel.Name = "btnCancel";
            this.btnCancel.Size = new System.Drawing.Size(112, 23);
            this.btnCancel.TabIndex = 3;
            this.btnCancel.Text = "Cancel";
            this.btnCancel.UseVisualStyleBackColor = false;
            this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
            //
            // mainForm
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(416, 133);
            this.Controls.Add(this.btnCancel);
            this.Controls.Add(this.label1);
            this.Controls.Add(this.button1);
            this.Name = "mainForm";
            this.Text = "Linq Reports";
            this.ResumeLayout(false);

        }
        #endregion
    }
}

Program.cs

using System;
using System.Windows.Forms;

namespace Linq
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new mainForm());
        }
    }
}


Advanced Linq (C# / netframework) | FlexCel Studio for the .NET Framework documentation

Advanced Linq (C# / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\csharp\VS2022\netframework\20.Reports\22b.Advanced Linq and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​csharp/​VS2022/​netframework/​Modules/​20.​Reports/​22b.​Advanced Linq

Overview

THIS DEMO REQUIRES .NET 3.5 OR NEWER.

Most of the demos here use datasets as datasources. This is just for convenience, because Linq is not supported in .NET 2.0 and so if we used Linq those demos wouldn't work for everybody, and also because the focus is in the Excel templates, not so much in the data layer. But you can use any IQueryable<T> collection as a datasource in a FlexCel report, and this is what we will show here.

This demo shows some features not shown in the Linq example.

Concepts

  • How to do a master-detail report when the details are nested many levels inside the master. In this case, the class Country has a People class, and the People class has a list of Language objects. If People was a List<> inside Country and you wanted to use that list, you would just define a __People__ band (this is shown in the Linq example). But as the List<> is inside People which in turn is inside Country, you need to define a __People.Language__ band.

  • How to reference a table with dots using [square brackets]. If you write in a cell <#tablename.section.field> FlexCel will interpret this as table "tablename", field "section.field". The text up to the first dot is always the table, and the rest is the field. But sometimes you might want this to being interpreted as table "tablename.section", field "field". To do so, you need to write <#[tablename.section].field>. In this particular case, we have a table "People.Language" which we defined in the previous point. If we wrote in cell B1: "<#people.language.speakers.percent> FlexCel would interpret this is the table "people", not "people.language" which is what we need. To make FlexCel understand that we want a table "people.language" we use <#[people.language].speakers.percent>

Files

AssemblyInfo.cs

using System.Reflection;
using System.Runtime.CompilerServices;

//
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
//
[assembly: AssemblyTitle("")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("(c) 2002 - 2024 TMS Software")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

//
// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version
//      Build Number
//      Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:

[assembly: AssemblyVersion("7.21.0.0")]

//
// In order to sign your assembly you must specify a key to use. Refer to the
// Microsoft .NET Framework documentation for more information on assembly signing.
//
// Use the attributes below to control which key is used for signing.
//
// Notes:
//   (*) If no key is specified, the assembly is not signed.
//   (*) KeyName refers to a key that has been installed in the Crypto Service
//       Provider (CSP) on your machine. KeyFile refers to a file which contains
//       a key.
//   (*) If the KeyFile and the KeyName values are both specified, the
//       following processing occurs:
//       (1) If the KeyName can be found in the CSP, that key is used.
//       (2) If the KeyName does not exist and the KeyFile does exist, the key
//           in the KeyFile is installed into the CSP and used.
//   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
//       When specifying the KeyFile, the location of the KeyFile should be
//       relative to the project output directory which is
//       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
//       located in the project directory, you would specify the AssemblyKeyFile
//       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
//   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
//       documentation for more information on this.
//
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]
[assembly: AssemblyKeyName("")]

Form1.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using System.Diagnostics;
using System.Reflection;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using FlexCel.Report;
using System.Collections.Generic;
using System.Linq;

namespace AdvancedLinq
{
    /// <summary>
    /// Summary description for Form1.
    /// </summary>
    public partial class mainForm : System.Windows.Forms.Form
    {

        public mainForm()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, System.EventArgs e)
        {
            AutoRun();
        }

        public void AutoRun()
        {
            using (FlexCelReport report = new FlexCelReport(true))
            {
                LoadTables(report);

                string DataPath = Path.Combine(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), ".."), "..") + Path.DirectorySeparatorChar;

                if (saveFileDialog1.ShowDialog() == DialogResult.OK)
                {
                    report.Run(DataPath + "Advanced Linq.template.xlsx", saveFileDialog1.FileName);

                    if (MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) == DialogResult.Yes)
                    {
                        using (Process p = new Process())
                        {
                            p.StartInfo.FileName = saveFileDialog1.FileName;
                            p.StartInfo.UseShellExecute = true;
                            p.Start();
                        }
                    }
                }
            }
        }

        private void LoadTables(FlexCelReport report)
        {
            var Countries = new List<Country>();
            Countries.Add(new Country("China",
                          new People(1384688986),
                          new Geography(
                              new Area(270550, 9326410))));

            var country = Countries[Countries.Count - 1];
            country.People.Language.Add(new Language(
                new LanguageName("Md", "Mandarin"),
                new LanguageSpeakers(0, 66.2)));

            country.People.Language.Add(new Language(
                new LanguageName("Yue", "Yue"),
                new LanguageSpeakers(0, 4.9)));

            country.People.Language.Add(new Language(
                new LanguageName("Wu", "Wu"),
                new LanguageSpeakers(0, 6.1)));

            country.People.Language.Add(new Language(
                new LanguageName("Mb", "Minbei"),
                new LanguageSpeakers(0, 6.2)));

            country.People.Language.Add(new Language(
                new LanguageName("Mn", "Minnan"),
                new LanguageSpeakers(0, 5.2)));

            country.People.Language.Add(new Language(
                new LanguageName("Xi", "Xiang"),
                new LanguageSpeakers(0, 3.0)));

            country.People.Language.Add(new Language(
                new LanguageName("Gan", "Gan"),
                new LanguageSpeakers(0, 4.0)));

            Countries.Add(new Country("India",
                          new People(1296834042),
                          new Geography(
                              new Area(314070, 2973193))));

            country = Countries[Countries.Count - 1];
            country.People.Language.Add(new Language(
                new LanguageName("Hi", "Hindi"),
                new LanguageSpeakers(0, 43.6)));

            country.People.Language.Add(new Language(
                new LanguageName("Bg", "Bengali"),
                new LanguageSpeakers(0, 8)));

            country.People.Language.Add(new Language(
                new LanguageName("Ma", "Marath"),
                new LanguageSpeakers(0, 6.9)));

            country.People.Language.Add(new Language(
                new LanguageName("Te", "Telugu"),
                new LanguageSpeakers(0, 6.7)));

            country.People.Language.Add(new Language(
                new LanguageName("Ta", "Tamil"),
                new LanguageSpeakers(0, 5.7)));

            country.People.Language.Add(new Language(
                new LanguageName("Gu", "Gujarati"),
                new LanguageSpeakers(0, 4.6)));

            country.People.Language.Add(new Language(
                new LanguageName("Ur", "Urdu"),
                new LanguageSpeakers(0, 4.2)));

            country.People.Language.Add(new Language(
                new LanguageName("Ka", "Kannada"),
                new LanguageSpeakers(0, 3.6)));

            country.People.Language.Add(new Language(
                new LanguageName("Od", "Odia"),
                new LanguageSpeakers(0, 3.1)));

            country.People.Language.Add(new Language(
                new LanguageName("Ma", "Malayalam"),
                new LanguageSpeakers(0, 2.9)));

            country.People.Language.Add(new Language(
                new LanguageName("Pu", "Punjabi"),
                new LanguageSpeakers(0, 2.7)));

            country.People.Language.Add(new Language(
                new LanguageName("As", "Assamese"),
                new LanguageSpeakers(0, 1.3)));

            country.People.Language.Add(new Language(
                new LanguageName("Mi", "Maithili"),
                new LanguageSpeakers(0, 1.1)));

            country.People.Language.Add(new Language(
                new LanguageName("O", "Other"),
                new LanguageSpeakers(0, 5.6)));

            Countries.Add(new Country("United States",
                          new People(329256465),
                          new Geography(
                              new Area(685924, 9147593))));

            country = Countries[Countries.Count - 1];
            country.People.Language.Add(new Language(
                new LanguageName("En", "English"),
                new LanguageSpeakers(0, 78.2)));

            country.People.Language.Add(new Language(
                new LanguageName("Sp", "Spanish"),
                new LanguageSpeakers(0, 13.4)));

            country.People.Language.Add(new Language(
                new LanguageName("Ch", "Chinese"),
                new LanguageSpeakers(0, 1.1)));

            country.People.Language.Add(new Language(
                new LanguageName("O", "Other"),
                new LanguageSpeakers(0, 7.3)));

            report.AddTable("country", Countries );
        }

        private void btnCancel_Click(object sender, System.EventArgs e)
        {
            Close();
        }
    }

    public class Country
    {
        public string Name { get; private set; }

        public People People { get; set; }
        public Geography Geography { get; set; }

        public Country(string name, People people, Geography geography)
        {
            this.Name = name;
            this.People = people;
            this.Geography = geography;
        }

    }

    public class Geography
    {
        public Area Area { get; private set; }

        public Geography(Area area)
        {
            this.Area = area;
        }
    }

    public class Area
    {
        public int Total { get { return Water + Land; } }
        public int Water { get; private set; }
        public int Land { get; private set; }

        public Area(int water, int land)
        {
            this.Water = water;
            this.Land = land;
        }
    }

    public class People
    {
        public int Population { get; private set; }
        public List<Language> Language { get; private set; }

        public People(int population)
        {
            this.Population = population;
            this.Language = new List<Language>();
        }
    }

    public class Language
    {
        public LanguageName Name { get; private set; }
        public LanguageSpeakers Speakers { get; private set; }

        public Language(LanguageName name, LanguageSpeakers speakers)
        {
            this.Name = name;
            this.Speakers = speakers;
        }

    }

    public class LanguageName
    {
        public string ShortName { get; private set; }
        public string LongName { get; private set; }

        public LanguageName(string shortName, string longName)
        {
            this.ShortName = shortName;
            this.LongName = longName;
        }
    }

    public class LanguageSpeakers
    {
        public int AbsoluteNumber { get; private set; }
        public double Percent { get; private set; }

        public LanguageSpeakers(int absoluteNumber, double percent)
        {
            this.AbsoluteNumber = absoluteNumber;
            this.Percent = percent / 100.0;
        }
    }
}

Form1.Designer.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using System.Diagnostics;
using System.Reflection;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using FlexCel.Report;
namespace AdvancedLinq
{
    public partial class mainForm : System.Windows.Forms.Form
    {
        private System.Windows.Forms.Button button1;
        private System.Windows.Forms.SaveFileDialog saveFileDialog1;
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.Button btnCancel;
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.Container components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose( bool disposing )
        {
            if( disposing )
            {
                if (components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose( disposing );
        }

        #region Windows Form Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.button1 = new System.Windows.Forms.Button();
            this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog();
            this.label1 = new System.Windows.Forms.Label();
            this.btnCancel = new System.Windows.Forms.Button();
            this.SuspendLayout();
            //
            // button1
            //
            this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.button1.BackColor = System.Drawing.Color.Green;
            this.button1.ForeColor = System.Drawing.Color.White;
            this.button1.Location = new System.Drawing.Point(152, 88);
            this.button1.Name = "button1";
            this.button1.Size = new System.Drawing.Size(112, 23);
            this.button1.TabIndex = 0;
            this.button1.Text = "GO!";
            this.button1.UseVisualStyleBackColor = false;
            this.button1.Click += new System.EventHandler(this.button1_Click);
            //
            // saveFileDialog1
            //
            this.saveFileDialog1.Filter = "Excel Files|*.xlsx";
            this.saveFileDialog1.RestoreDirectory = true;
            //
            // label1
            //
            this.label1.Location = new System.Drawing.Point(24, 24);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(272, 24);
            this.label1.TabIndex = 2;
            this.label1.Text = "Press \"GO\" to create a report from a List<> of objects.";
            //
            // btnCancel
            //
            this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.btnCancel.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
            this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            this.btnCancel.ForeColor = System.Drawing.Color.White;
            this.btnCancel.Location = new System.Drawing.Point(272, 88);
            this.btnCancel.Name = "btnCancel";
            this.btnCancel.Size = new System.Drawing.Size(112, 23);
            this.btnCancel.TabIndex = 3;
            this.btnCancel.Text = "Cancel";
            this.btnCancel.UseVisualStyleBackColor = false;
            this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
            //
            // mainForm
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(416, 133);
            this.Controls.Add(this.btnCancel);
            this.Controls.Add(this.label1);
            this.Controls.Add(this.button1);
            this.Name = "mainForm";
            this.Text = "Advanced Linq Reports";
            this.ResumeLayout(false);

        }
        #endregion
    }
}

Program.cs

using System;
using System.Windows.Forms;

namespace AdvancedLinq
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new mainForm());
        }
    }
}


Tables as datasources (C# / netframework) | FlexCel Studio for the .NET Framework documentation

Tables as datasources (C# / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\csharp\VS2022\netframework\20.Reports\23.Tables As Datasources and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​csharp/​VS2022/​netframework/​Modules/​20.​Reports/​23.​Tables As Datasources

Overview

On the other examples here, we use __NAMES__ to define where the data has to go in the template. Here, we use tables instead.

Concepts

  • Tables can work like names to define data bands, if they are named starting with "__", "_" and ending with the same, just as named ranges.

  • To have the table expand when data is inserted, the table must have an empty row after the data.

  • Tables behave like "X" ranges, even if you don't name them as "__Table__X". You can name them with an X at the end or not, but no matter what you do, they will behave as if the "X" was in the name, and remove the empty row that you need to have for the tables to expand.

  • Tables will be renamed after the report runs, by removing the "_" or "__" from the start and the end. If you don't want them to be renamed, you can change the property FlexCelReport.RenameExcelTablesUsedAsBands.

  • A __Table__ is just a shortcut for defining a __Table__X named range. In this example you could have got the same results by having the table named "Products" instead of "__Products__" and defining a name "__Products__X" from A38 to D38.

  • __Tables__ can be embedded in a master detail relationship with other __Names__. It is impossible to have a table inside a table (this is an Excel limitation), but you can have a __Table__ inside a __Name__ as in this example and the table will be copied for every record of __Name__

Files

AssemblyInfo.cs

using System.Reflection;
using System.Runtime.CompilerServices;

//
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
//
[assembly: AssemblyTitle("")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("(c) 2002 - 2024 TMS Software")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

//
// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version
//      Build Number
//      Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:

[assembly: AssemblyVersion("7.21.0.0")]

//
// In order to sign your assembly you must specify a key to use. Refer to the
// Microsoft .NET Framework documentation for more information on assembly signing.
//
// Use the attributes below to control which key is used for signing.
//
// Notes:
//   (*) If no key is specified, the assembly is not signed.
//   (*) KeyName refers to a key that has been installed in the Crypto Service
//       Provider (CSP) on your machine. KeyFile refers to a file which contains
//       a key.
//   (*) If the KeyFile and the KeyName values are both specified, the
//       following processing occurs:
//       (1) If the KeyName can be found in the CSP, that key is used.
//       (2) If the KeyName does not exist and the KeyFile does exist, the key
//           in the KeyFile is installed into the CSP and used.
//   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
//       When specifying the KeyFile, the location of the KeyFile should be
//       relative to the project output directory which is
//       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
//       located in the project directory, you would specify the AssemblyKeyFile
//       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
//   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
//       documentation for more information on this.
//
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]
[assembly: AssemblyKeyName("")]

Form1.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using System.Diagnostics;
using System.Reflection;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using FlexCel.Report;
using FlexCel.Demo.SharedData;

namespace TablesAsDatasources
{
    /// <summary>
    /// Summary description for Form1.
    /// </summary>
    public partial class mainForm: System.Windows.Forms.Form
    {

        public mainForm()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, System.EventArgs e)
        {
            AutoRun();
        }

        public void AutoRun()
        {
            using (FlexCelReport ordersReport = SharedData.CreateReport())
            {
                ordersReport.SetValue("Date", DateTime.Now);

                string DataPath = Path.Combine(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), ".."), "..") + Path.DirectorySeparatorChar;

                if (saveFileDialog1.ShowDialog() == DialogResult.OK)
                {
                    ordersReport.Run(DataPath + "Tables As Datasources.template.xlsx", saveFileDialog1.FileName);

                    if (MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) == DialogResult.Yes)
                    {
                        using (Process p = new Process())
                        {
                            p.StartInfo.FileName = saveFileDialog1.FileName;
                            p.StartInfo.UseShellExecute = true;
                            p.Start();
                        }
                    }
                }
            }
        }

        private void btnCancel_Click(object sender, System.EventArgs e)
        {
            Close();
        }
    }

}

Form1.Designer.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using System.Diagnostics;
using System.Reflection;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using FlexCel.Report;
using FlexCel.Demo.SharedData;
namespace TablesAsDatasources
{
    public partial class mainForm: System.Windows.Forms.Form
    {
        private System.Windows.Forms.Button button1;
        private System.Windows.Forms.SaveFileDialog saveFileDialog1;
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.Button btnCancel;
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.Container components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.button1 = new System.Windows.Forms.Button();
            this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog();
            this.label1 = new System.Windows.Forms.Label();
            this.btnCancel = new System.Windows.Forms.Button();
            this.SuspendLayout();
            //
            // button1
            //
            this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.button1.BackColor = System.Drawing.Color.Green;
            this.button1.ForeColor = System.Drawing.Color.White;
            this.button1.Location = new System.Drawing.Point(152, 88);
            this.button1.Name = "button1";
            this.button1.Size = new System.Drawing.Size(112, 23);
            this.button1.TabIndex = 0;
            this.button1.Text = "GO!";
            this.button1.UseVisualStyleBackColor = false;
            this.button1.Click += new System.EventHandler(this.button1_Click);
            //
            // saveFileDialog1
            //
            this.saveFileDialog1.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm|Excel 97/2003|*.xls|Excel 2007|*.xlsx;*.xlsm|All files|*.*";
            this.saveFileDialog1.RestoreDirectory = true;
            //
            // label1
            //
            this.label1.Location = new System.Drawing.Point(24, 24);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(272, 24);
            this.label1.TabIndex = 2;
            this.label1.Text = "Press \"GO\" to create a database Report with a table.";
            //
            // btnCancel
            //
            this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.btnCancel.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
            this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            this.btnCancel.ForeColor = System.Drawing.Color.White;
            this.btnCancel.Location = new System.Drawing.Point(272, 88);
            this.btnCancel.Name = "btnCancel";
            this.btnCancel.Size = new System.Drawing.Size(112, 23);
            this.btnCancel.TabIndex = 3;
            this.btnCancel.Text = "Cancel";
            this.btnCancel.UseVisualStyleBackColor = false;
            this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
            //
            // mainForm
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(416, 133);
            this.Controls.Add(this.btnCancel);
            this.Controls.Add(this.label1);
            this.Controls.Add(this.button1);
            this.Name = "mainForm";
            this.Text = "Tables as datasources";
            this.ResumeLayout(false);

        }
        #endregion
    }
}

Program.cs

using System;
using System.Windows.Forms;

namespace TablesAsDatasources
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new mainForm());
        }
    }
}


Using Entity Framework datasources (C# / netframework) | FlexCel Studio for the .NET Framework documentation

Using Entity Framework datasources (C# / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\csharp\VS2022\netframework\20.Reports\24.Entity Framework Reports and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​csharp/​VS2022/​netframework/​Modules/​20.​Reports/​24.​Entity Framework Reports

Overview

Note

To run this example, you need to have SQL Server (LocalDB) installed. For this reason, and because it uses NuGet, this demo doesn't run from MainDemo. You need to open this solution and run it alone.

While you can use any generic IQueryable<T> object as a source of reports, here we provide a concrete example of redoing the "range reports" demo using Entity Framework.

Concepts

  • Entity Framework reports should be run inside a serializable or snapshot transaction. While snapshot transactions are preferred as they won't block other users from changing the data while the report is running, in this example we use serializable (Because LocalDB doesn't support snapshot)

  • Here we have an implicit relationship between categories and products, so we don't need to add an explicit one. The report will just work.

Files

Category.cs

//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated from a template.
//
//     Manual changes to this file may cause unexpected behavior in your application.
//     Manual changes to this file will be overwritten if the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

namespace EntityFrameworkReports
{
    using System;
    using System.Collections.Generic;

    public partial class Category
    {
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
        public Category()
        {
            this.Products = new HashSet<Product>();
        }

        public int CategoryID { get; set; }
        public string CategoryName { get; set; }
        public string Description { get; set; }
        public byte[] Picture { get; set; }

        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
        public virtual ICollection<Product> Products { get; set; }
    }
}

Customer.cs

//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated from a template.
//
//     Manual changes to this file may cause unexpected behavior in your application.
//     Manual changes to this file will be overwritten if the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

namespace EntityFrameworkReports
{
    using System;
    using System.Collections.Generic;

    public partial class Customer
    {
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
        public Customer()
        {
            this.Orders = new HashSet<Order>();
            this.CustomerDemographics = new HashSet<CustomerDemographic>();
        }

        public string CustomerID { get; set; }
        public string CompanyName { get; set; }
        public string ContactName { get; set; }
        public string ContactTitle { get; set; }
        public string Address { get; set; }
        public string City { get; set; }
        public string Region { get; set; }
        public string PostalCode { get; set; }
        public string Country { get; set; }
        public string Phone { get; set; }
        public string Fax { get; set; }

        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
        public virtual ICollection<Order> Orders { get; set; }
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
        public virtual ICollection<CustomerDemographic> CustomerDemographics { get; set; }
    }
}

CustomerDemographic.cs

//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated from a template.
//
//     Manual changes to this file may cause unexpected behavior in your application.
//     Manual changes to this file will be overwritten if the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

namespace EntityFrameworkReports
{
    using System;
    using System.Collections.Generic;

    public partial class CustomerDemographic
    {
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
        public CustomerDemographic()
        {
            this.Customers = new HashSet<Customer>();
        }

        public string CustomerTypeID { get; set; }
        public string CustomerDesc { get; set; }

        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
        public virtual ICollection<Customer> Customers { get; set; }
    }
}

Employee.cs

//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated from a template.
//
//     Manual changes to this file may cause unexpected behavior in your application.
//     Manual changes to this file will be overwritten if the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

namespace EntityFrameworkReports
{
    using System;
    using System.Collections.Generic;

    public partial class Employee
    {
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
        public Employee()
        {
            this.Employees1 = new HashSet<Employee>();
            this.Orders = new HashSet<Order>();
            this.Territories = new HashSet<Territory>();
        }

        public int EmployeeID { get; set; }
        public string LastName { get; set; }
        public string FirstName { get; set; }
        public string Title { get; set; }
        public string TitleOfCourtesy { get; set; }
        public Nullable<System.DateTime> BirthDate { get; set; }
        public Nullable<System.DateTime> HireDate { get; set; }
        public string Address { get; set; }
        public string City { get; set; }
        public string Region { get; set; }
        public string PostalCode { get; set; }
        public string Country { get; set; }
        public string HomePhone { get; set; }
        public string Extension { get; set; }
        public byte[] Photo { get; set; }
        public string Notes { get; set; }
        public Nullable<int> ReportsTo { get; set; }
        public string PhotoPath { get; set; }

        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
        public virtual ICollection<Employee> Employees1 { get; set; }
        public virtual Employee Employee1 { get; set; }
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
        public virtual ICollection<Order> Orders { get; set; }
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
        public virtual ICollection<Territory> Territories { get; set; }
    }
}

Form1.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using System.Diagnostics;
using System.Reflection;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using FlexCel.Report;
using System.Transactions;
using System.Configuration;

namespace EntityFrameworkReports
{
    /// <summary>
    /// Summary description for Form1.
    /// </summary>
    public partial class mainForm : System.Windows.Forms.Form
    {

        public mainForm()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, System.EventArgs e)
        {
            AutoRun();
        }

        public void AutoRun()
        {
            using (FlexCelReport ordersReport = new FlexCelReport(true))
            {
                string DataPath = Path.Combine(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), ".."), "..") + Path.DirectorySeparatorChar;
                ordersReport.SetValue("Date", DateTime.Now);

                using (northwndEntities Northwind = new northwndEntities())
                {
                    ordersReport.AddTable("Categories", Northwind.Categories);
                    ordersReport.AddTable("Products", Northwind.Products);

                    if (saveFileDialog1.ShowDialog() == DialogResult.OK)
                    {
                        TransactionOptions transactionOptions = new TransactionOptions();
                        transactionOptions.IsolationLevel = System.Transactions.IsolationLevel.Serializable; //it would be better to sue Snapshot here, but it isn't supported by SQL Sever CE
                        using (TransactionScope transactionScope = new TransactionScope(TransactionScopeOption.Required, transactionOptions))
                        {
                            ordersReport.Run(DataPath + "Entity Framework Reports.template.xls", saveFileDialog1.FileName);
                            transactionScope.Complete();
                        }

                        if (MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) == DialogResult.Yes)
                        {
                            using (Process p = new Process())
                            {
                                p.StartInfo.FileName = saveFileDialog1.FileName;
                                p.StartInfo.UseShellExecute = true;
                                p.Start();
                            }
                        }
                    }
                }
            }
        }

        private void btnCancel_Click(object sender, System.EventArgs e)
        {
            Close();
        }
    }

}

Form1.Designer.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using System.Diagnostics;
using System.Reflection;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using FlexCel.Report;

namespace EntityFrameworkReports
{
    public partial class mainForm : System.Windows.Forms.Form
    {
        private System.Windows.Forms.Button button1;
        private System.Windows.Forms.SaveFileDialog saveFileDialog1;
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.Button btnCancel;
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.Container components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose( bool disposing )
        {
            if( disposing )
            {
                if (components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose( disposing );
        }

        #region Windows Form Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.button1 = new System.Windows.Forms.Button();
            this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog();
            this.label1 = new System.Windows.Forms.Label();
            this.btnCancel = new System.Windows.Forms.Button();
            this.SuspendLayout();
            //
            // button1
            //
            this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.button1.BackColor = System.Drawing.Color.Green;
            this.button1.ForeColor = System.Drawing.Color.White;
            this.button1.Location = new System.Drawing.Point(152, 88);
            this.button1.Name = "button1";
            this.button1.Size = new System.Drawing.Size(112, 23);
            this.button1.TabIndex = 0;
            this.button1.Text = "GO!";
            this.button1.UseVisualStyleBackColor = false;
            this.button1.Click += new System.EventHandler(this.button1_Click);
            //
            // saveFileDialog1
            //
            this.saveFileDialog1.Filter = "Excel Files|*.xls";
            this.saveFileDialog1.RestoreDirectory = true;
            //
            // label1
            //
            this.label1.Location = new System.Drawing.Point(24, 24);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(272, 24);
            this.label1.TabIndex = 2;
            this.label1.Text = "Press \"GO\" to create a database Report.";
            //
            // btnCancel
            //
            this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.btnCancel.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
            this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            this.btnCancel.ForeColor = System.Drawing.Color.White;
            this.btnCancel.Location = new System.Drawing.Point(272, 88);
            this.btnCancel.Name = "btnCancel";
            this.btnCancel.Size = new System.Drawing.Size(112, 23);
            this.btnCancel.TabIndex = 3;
            this.btnCancel.Text = "Cancel";
            this.btnCancel.UseVisualStyleBackColor = false;
            this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
            //
            // mainForm
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(416, 133);
            this.Controls.Add(this.btnCancel);
            this.Controls.Add(this.label1);
            this.Controls.Add(this.button1);
            this.Name = "mainForm";
            this.Text = "Entity Framework Report";
            this.ResumeLayout(false);

        }
        #endregion
    }
}

ModelNorthwind.Context.cs

//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated from a template.
//
//     Manual changes to this file may cause unexpected behavior in your application.
//     Manual changes to this file will be overwritten if the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

namespace EntityFrameworkReports
{
    using System;
    using System.Data.Entity;
    using System.Data.Entity.Infrastructure;

    public partial class northwndEntities : DbContext
    {
        public northwndEntities()
            : base("name=northwndEntities")
        {
        }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            throw new UnintentionalCodeFirstException();
        }

        public virtual DbSet<Category> Categories { get; set; }
        public virtual DbSet<CustomerDemographic> CustomerDemographics { get; set; }
        public virtual DbSet<Customer> Customers { get; set; }
        public virtual DbSet<Employee> Employees { get; set; }
        public virtual DbSet<Order_Detail> Order_Details { get; set; }
        public virtual DbSet<Order> Orders { get; set; }
        public virtual DbSet<Product> Products { get; set; }
        public virtual DbSet<Region> Regions { get; set; }
        public virtual DbSet<Shipper> Shippers { get; set; }
        public virtual DbSet<Supplier> Suppliers { get; set; }
        public virtual DbSet<Territory> Territories { get; set; }
    }
}

ModelNorthwind.cs

//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated from a template.
//
//     Manual changes to this file may cause unexpected behavior in your application.
//     Manual changes to this file will be overwritten if the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

ModelNorthwind.Designer.cs

// T4 code generation is enabled for model ''.
// To enable legacy code generation, change the value of the 'Code Generation Strategy' designer
// property to 'Legacy ObjectContext'. This property is available in the Properties Window when the model
// is open in the designer.

// If no context and entity classes have been generated, it may be because you created an empty model but
// have not yet chosen which version of Entity Framework to use. To generate a context class and entity
// classes for your model, open the model in the designer, right-click on the designer surface, and
// select 'Update Model from Database...', 'Generate Database from Model...', or 'Add Code Generation
// Item...'.

Order.cs

//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated from a template.
//
//     Manual changes to this file may cause unexpected behavior in your application.
//     Manual changes to this file will be overwritten if the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

namespace EntityFrameworkReports
{
    using System;
    using System.Collections.Generic;

    public partial class Order
    {
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
        public Order()
        {
            this.Order_Details = new HashSet<Order_Detail>();
        }

        public int OrderID { get; set; }
        public string CustomerID { get; set; }
        public Nullable<int> EmployeeID { get; set; }
        public Nullable<System.DateTime> OrderDate { get; set; }
        public Nullable<System.DateTime> RequiredDate { get; set; }
        public Nullable<System.DateTime> ShippedDate { get; set; }
        public Nullable<int> ShipVia { get; set; }
        public Nullable<decimal> Freight { get; set; }
        public string ShipName { get; set; }
        public string ShipAddress { get; set; }
        public string ShipCity { get; set; }
        public string ShipRegion { get; set; }
        public string ShipPostalCode { get; set; }
        public string ShipCountry { get; set; }

        public virtual Customer Customer { get; set; }
        public virtual Employee Employee { get; set; }
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
        public virtual ICollection<Order_Detail> Order_Details { get; set; }
        public virtual Shipper Shipper { get; set; }
    }
}

Order_Detail.cs

//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated from a template.
//
//     Manual changes to this file may cause unexpected behavior in your application.
//     Manual changes to this file will be overwritten if the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

namespace EntityFrameworkReports
{
    using System;
    using System.Collections.Generic;

    public partial class Order_Detail
    {
        public int OrderID { get; set; }
        public int ProductID { get; set; }
        public decimal UnitPrice { get; set; }
        public short Quantity { get; set; }
        public float Discount { get; set; }

        public virtual Order Order { get; set; }
        public virtual Product Product { get; set; }
    }
}

Product.cs

//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated from a template.
//
//     Manual changes to this file may cause unexpected behavior in your application.
//     Manual changes to this file will be overwritten if the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

namespace EntityFrameworkReports
{
    using System;
    using System.Collections.Generic;

    public partial class Product
    {
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
        public Product()
        {
            this.Order_Details = new HashSet<Order_Detail>();
        }

        public int ProductID { get; set; }
        public string ProductName { get; set; }
        public Nullable<int> SupplierID { get; set; }
        public Nullable<int> CategoryID { get; set; }
        public string QuantityPerUnit { get; set; }
        public Nullable<decimal> UnitPrice { get; set; }
        public Nullable<short> UnitsInStock { get; set; }
        public Nullable<short> UnitsOnOrder { get; set; }
        public Nullable<short> ReorderLevel { get; set; }
        public bool Discontinued { get; set; }

        public virtual Category Category { get; set; }
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
        public virtual ICollection<Order_Detail> Order_Details { get; set; }
        public virtual Supplier Supplier { get; set; }
    }
}

Program.cs

using System;
using System.Windows.Forms;

namespace EntityFrameworkReports
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new mainForm());
        }
    }
}

Region.cs

//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated from a template.
//
//     Manual changes to this file may cause unexpected behavior in your application.
//     Manual changes to this file will be overwritten if the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

namespace EntityFrameworkReports
{
    using System;
    using System.Collections.Generic;

    public partial class Region
    {
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
        public Region()
        {
            this.Territories = new HashSet<Territory>();
        }

        public int RegionID { get; set; }
        public string RegionDescription { get; set; }

        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
        public virtual ICollection<Territory> Territories { get; set; }
    }
}

Shipper.cs

//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated from a template.
//
//     Manual changes to this file may cause unexpected behavior in your application.
//     Manual changes to this file will be overwritten if the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

namespace EntityFrameworkReports
{
    using System;
    using System.Collections.Generic;

    public partial class Shipper
    {
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
        public Shipper()
        {
            this.Orders = new HashSet<Order>();
        }

        public int ShipperID { get; set; }
        public string CompanyName { get; set; }
        public string Phone { get; set; }

        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
        public virtual ICollection<Order> Orders { get; set; }
    }
}

Supplier.cs

//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated from a template.
//
//     Manual changes to this file may cause unexpected behavior in your application.
//     Manual changes to this file will be overwritten if the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

namespace EntityFrameworkReports
{
    using System;
    using System.Collections.Generic;

    public partial class Supplier
    {
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
        public Supplier()
        {
            this.Products = new HashSet<Product>();
        }

        public int SupplierID { get; set; }
        public string CompanyName { get; set; }
        public string ContactName { get; set; }
        public string ContactTitle { get; set; }
        public string Address { get; set; }
        public string City { get; set; }
        public string Region { get; set; }
        public string PostalCode { get; set; }
        public string Country { get; set; }
        public string Phone { get; set; }
        public string Fax { get; set; }
        public string HomePage { get; set; }

        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
        public virtual ICollection<Product> Products { get; set; }
    }
}

Territory.cs

//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated from a template.
//
//     Manual changes to this file may cause unexpected behavior in your application.
//     Manual changes to this file will be overwritten if the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

namespace EntityFrameworkReports
{
    using System;
    using System.Collections.Generic;

    public partial class Territory
    {
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
        public Territory()
        {
            this.Employees = new HashSet<Employee>();
        }

        public string TerritoryID { get; set; }
        public string TerritoryDescription { get; set; }
        public int RegionID { get; set; }

        public virtual Region Region { get; set; }
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
        public virtual ICollection<Employee> Employees { get; set; }
    }
}


Multiple sheet report (C# / netframework) | FlexCel Studio for the .NET Framework documentation

Multiple sheet report (C# / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\csharp\VS2022\netframework\20.Reports\25.Multiple sheet report and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​csharp/​VS2022/​netframework/​Modules/​20.​Reports/​25.​Multiple sheet report

Overview

Here we are going to create a report using each entry on the table Categories to create a new sheet. For each category, we will list the products and the order details of each product.

Concepts

  • How to use a table to create a report on multiple sheets.

  • Defining Custom Formats to have alternating color rows

  • This is a three level master detail report: Category -> Products -> Order Details. The first level is on the sheet, and this is handled automatically. Any datatable with a relation defined with "category" datatable will be filtered accordingly on each sheet.

  • Grouping and Outlining. To create a report using outlining, just define the outline on the template and it will expand as needed.

Files

AssemblyInfo.cs

using System.Reflection;
using System.Runtime.CompilerServices;

//
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
//
[assembly: AssemblyTitle("")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("(c) 2002 - 2024 TMS Software")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

//
// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version
//      Build Number
//      Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:

[assembly: AssemblyVersion("7.21.0.0")]

//
// In order to sign your assembly you must specify a key to use. Refer to the
// Microsoft .NET Framework documentation for more information on assembly signing.
//
// Use the attributes below to control which key is used for signing.
//
// Notes:
//   (*) If no key is specified, the assembly is not signed.
//   (*) KeyName refers to a key that has been installed in the Crypto Service
//       Provider (CSP) on your machine. KeyFile refers to a file which contains
//       a key.
//   (*) If the KeyFile and the KeyName values are both specified, the
//       following processing occurs:
//       (1) If the KeyName can be found in the CSP, that key is used.
//       (2) If the KeyName does not exist and the KeyFile does exist, the key
//           in the KeyFile is installed into the CSP and used.
//   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
//       When specifying the KeyFile, the location of the KeyFile should be
//       relative to the project output directory which is
//       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
//       located in the project directory, you would specify the AssemblyKeyFile
//       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
//   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
//       documentation for more information on this.
//
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]
[assembly: AssemblyKeyName("")]

Form1.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using System.Diagnostics;
using System.Reflection;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using FlexCel.Report;
using FlexCel.Demo.SharedData;

namespace Multiplesheetreport
{
    /// <summary>
    /// Multiple range reports
    /// </summary>
    public partial class mainForm: System.Windows.Forms.Form
    {
        public mainForm()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, System.EventArgs e)
        {
            AutoRun();
        }

        public void AutoRun()
        {
            using (FlexCelReport ordersReport = SharedData.CreateReport())
            {
                ordersReport.SetValue("Date", DateTime.Now);

                string DataPath = Path.Combine(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), ".."), "..") + Path.DirectorySeparatorChar;

                if (saveFileDialog1.ShowDialog() == DialogResult.OK)
                {
                    ordersReport.Run(DataPath + "Multiple sheet report.template.xls", saveFileDialog1.FileName);

                    if (MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) == DialogResult.Yes)
                    {
                        using (Process p = new Process())
                        {
                            p.StartInfo.FileName = saveFileDialog1.FileName;
                            p.StartInfo.UseShellExecute = true;
                            p.Start();
                        }
                    }
                }
            }
        }

        private void btnCancel_Click(object sender, System.EventArgs e)
        {
            Close();
        }
    }

}

Form1.Designer.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using System.Diagnostics;
using System.Reflection;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using FlexCel.Report;
using FlexCel.Demo.SharedData;
namespace Multiplesheetreport
{
    public partial class mainForm: System.Windows.Forms.Form
    {
        private System.Windows.Forms.Button button1;
        private System.Windows.Forms.SaveFileDialog saveFileDialog1;
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.Button btnCancel;
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.Container components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.button1 = new System.Windows.Forms.Button();
            this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog();
            this.label1 = new System.Windows.Forms.Label();
            this.btnCancel = new System.Windows.Forms.Button();
            this.SuspendLayout();
            //
            // button1
            //
            this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.button1.BackColor = System.Drawing.Color.Green;
            this.button1.ForeColor = System.Drawing.Color.White;
            this.button1.Location = new System.Drawing.Point(152, 88);
            this.button1.Name = "button1";
            this.button1.Size = new System.Drawing.Size(112, 23);
            this.button1.TabIndex = 0;
            this.button1.Text = "GO!";
            this.button1.UseVisualStyleBackColor = false;
            this.button1.Click += new System.EventHandler(this.button1_Click);
            //
            // saveFileDialog1
            //
            this.saveFileDialog1.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm|Excel 97/2003|*.xls|Excel 2007|*.xlsx;*.xlsm|All files|*.*";
            this.saveFileDialog1.RestoreDirectory = true;
            //
            // label1
            //
            this.label1.Location = new System.Drawing.Point(24, 24);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(288, 24);
            this.label1.TabIndex = 2;
            this.label1.Text = "A report with a sheet per category.";
            //
            // btnCancel
            //
            this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.btnCancel.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
            this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            this.btnCancel.ForeColor = System.Drawing.Color.White;
            this.btnCancel.Location = new System.Drawing.Point(272, 88);
            this.btnCancel.Name = "btnCancel";
            this.btnCancel.Size = new System.Drawing.Size(112, 23);
            this.btnCancel.TabIndex = 3;
            this.btnCancel.Text = "Cancel";
            this.btnCancel.UseVisualStyleBackColor = false;
            this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
            //
            // mainForm
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(416, 133);
            this.Controls.Add(this.btnCancel);
            this.Controls.Add(this.label1);
            this.Controls.Add(this.button1);
            this.Name = "mainForm";
            this.Text = "Multiple Sheet Report";
            this.ResumeLayout(false);

        }
        #endregion
    }
}

Program.cs

using System;
using System.Windows.Forms;

namespace Multiplesheetreport
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new mainForm());
        }
    }
}


Exporting Web Services (C# / netframework) | FlexCel Studio for the .NET Framework documentation

Exporting Web Services (C# / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\csharp\VS2022\netframework\20.Reports\27.Exporting Web Services and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​csharp/​VS2022/​netframework/​Modules/​20.​Reports/​27.​Exporting Web Services

Overview

A demo that accesses the NOAA Meteorological web service and returns an Excel file with the forecast. Just in case you do not have an Internet connection available, some sample data is included to work offline too.

Concepts

How to export the data on a Web Service to Excel or PDF.

Files

AssemblyInfo.cs

using System.Reflection;
using System.Runtime.CompilerServices;

//
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
//
[assembly: AssemblyTitle("")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("(c) 2002 - 2024 TMS Software")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

//
// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version
//      Build Number
//      Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:

[assembly: AssemblyVersion("7.21.0.0")]

//
// In order to sign your assembly you must specify a key to use. Refer to the
// Microsoft .NET Framework documentation for more information on assembly signing.
//
// Use the attributes below to control which key is used for signing.
//
// Notes:
//   (*) If no key is specified, the assembly is not signed.
//   (*) KeyName refers to a key that has been installed in the Crypto Service
//       Provider (CSP) on your machine. KeyFile refers to a file which contains
//       a key.
//   (*) If the KeyFile and the KeyName values are both specified, the
//       following processing occurs:
//       (1) If the KeyName can be found in the CSP, that key is used.
//       (2) If the KeyName does not exist and the KeyFile does exist, the key
//           in the KeyFile is installed into the CSP and used.
//   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
//       When specifying the KeyFile, the location of the KeyFile should be
//       relative to the project output directory which is
//       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
//       located in the project directory, you would specify the AssemblyKeyFile
//       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
//   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
//       documentation for more information on this.
//
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]
[assembly: AssemblyKeyName("")]

Form1.cs

/*This program is inspired on the progam by Mikhail Arkhipov
 * at http://blogs.msdn.com/mikhailarkhipov/archive/2004/08/12/213963.aspx
 * Thanks!
 */

/* UPDATE: This was patched with the info on
 * http://weblogs.asp.net/jan/archive/2004/01/28/63771.aspx
 * to make it work.
 *
 * Thanks again...
 *
 * UPDATE 2!
 * The NOAA broke the service again, and it has not fixed it for more than a year.
 * I give up. We will use http://www.webservicex.net/WeatherForecast.asmx instead.
 * The code for NOAA is still there on the SetupNOAA method, just not used so you can see it (and try it if it ever starts working again)
 *
 * UPDATE 3!
 * Now WebserviceX is not working, going back to NOAA. As you can see, it isn't very trustable that a webservice will be there in the
 * future, so this demo might not work in online mode when you try it. But you can always look at in in offline mode.
 * */

using System;
using System.Drawing;
using System.Collections.Generic;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using System.Diagnostics;
using System.Reflection;
using System.Xml;
using System.Net;
using System.Threading;

using FlexCel.Core;
using FlexCel.XlsAdapter;
using FlexCel.Report;
using FlexCel.Render;

using ExportingWebServices.gov.weather.www;
using System.Globalization;

namespace ExportingWebServices
{
    /// <summary>
    /// An example that will read data from a webservice.
    /// </summary>
    public partial class mainForm: System.Windows.Forms.Form
    {
        Dictionary<string, LatLong> Cities = new Dictionary<string, LatLong>(StringComparer.CurrentCultureIgnoreCase);
        public mainForm()
        {
            InitializeComponent();
            LoadCities();
        }

        private void LoadCities()
        {
            XmlDocument xml = new XmlDocument();
            {
                string DataPath = Path.Combine(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), ".."), "..") + Path.DirectorySeparatorChar;
                xml.Load(Path.Combine(DataPath, "cities.xml"));
                XmlNodeList latLonList = xml.GetElementsByTagName("latLonList");
                XmlNodeList cityNameList = xml.GetElementsByTagName("cityNameList");

                if (latLonList.Count != 1) throw new Exception("Invalid city list");
                if (cityNameList.Count != 1) throw new Exception("Invalid city list");

                string lats = latLonList.Item(0).InnerText;
                string cits = cityNameList.Item(0).InnerText;

                string[] latsParsed = lats.Split(' ');
                string[] citsParsed = cits.Split('|');

                if (citsParsed.Length != latsParsed.Length) throw new Exception("Invalid city list");

                edcity.BeginUpdate();
                try
                {
                    for (int i = 0; i < citsParsed.Length; i++)
                    {
                        string[] ll = latsParsed[i].Split(',');
                        if (ll.Length != 2) throw new Exception("Invalid city list");
                        Cities.Add(citsParsed[i], new LatLong(Convert.ToDecimal(ll[0], CultureInfo.InvariantCulture), Convert.ToDecimal(ll[1], CultureInfo.InvariantCulture)));
                        edcity.Items.Add(citsParsed[i]);
                    }

                    edcity.Text = "New York,NY";
                }
                finally
                {
                    edcity.EndUpdate();
                }

            }
        }

        private void Export(SaveFileDialog SaveDialog, bool ToPdf)
        {
            try
            {
                string DataPath = Path.Combine(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), ".."), "..") + Path.DirectorySeparatorChar;

                //We will use a thread to connect, to avoid "freezing" the GUI
                WebConnectThread MyWebConnect = new WebConnectThread(reportStart, edcity.Text, DataPath, cbOffline.Checked, Cities);
                Thread WebConnect = new Thread(new ThreadStart(MyWebConnect.SetupNOAA));
                WebConnect.Start();
                using (ProgressDialog Pg = new ProgressDialog())
                {
                    Pg.ShowProgress(WebConnect);
                    if (MyWebConnect != null && MyWebConnect.MainException != null)
                    {
                        throw MyWebConnect.MainException;
                    }
                }

                if (SaveDialog.ShowDialog() == DialogResult.OK)
                {
                    if (ToPdf)
                    {
                        XlsFile xls = new XlsFile();
                        xls.Open(DataPath + "Exporting Web Services.template.xls");
                        reportStart.Run(xls);
                        using (FlexCelPdfExport PdfExport = new FlexCelPdfExport(xls, true))
                        {
                            PdfExport.Export(SaveDialog.FileName);
                        }
                    }
                    else
                    {
                        reportStart.Run(DataPath + "Exporting Web Services.template.xls", SaveDialog.FileName);
                    }

                    if (MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) == DialogResult.Yes)
                    {
                        using (Process p = new Process())
                        {
                            p.StartInfo.FileName = SaveDialog.FileName;
                            p.StartInfo.UseShellExecute = true;
                            p.Start();
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }

        }

        private void btnCancel_Click(object sender, System.EventArgs e)
        {
            Close();
        }

        private void btnExportPdf_Click(object sender, System.EventArgs e)
        {
            Export(saveFileDialogPdf, true);
        }

        private void btnExportXls_Click(object sender, System.EventArgs e)
        {
            Export(saveFileDialogXls, false);
        }

        private void edcity_KeyDown(object sender, KeyEventArgs e)
        {
            edcity.DroppedDown = false;
        }

    }

    struct LatLong
    {
        public decimal Latitude;
        public decimal Longitude;

        public LatLong(decimal aLatitude, decimal aLongitude)
        {
            Latitude = aLatitude;
            Longitude = aLongitude;
        }
    }

    class WebConnectThread
    {
        string CityName;
        string DataPath;
        bool UseOfflineData;
        Dictionary<string, LatLong> Cities;
        FlexCelReport ReportStart;
        private Exception FMainException;

        public WebConnectThread(FlexCelReport aReportStart, string aCityName, string aDataPath, bool aUseOfflineData, Dictionary<string, LatLong> aCities)
        {
            CityName = aCityName;
            DataPath = aDataPath;
            UseOfflineData = aUseOfflineData;
            ReportStart = aReportStart;
            Cities = aCities;
        }

        public void SetupNOAA()
        {
            try
            {
                SetupNOAA(ReportStart, CityName, DataPath, UseOfflineData, Cities);
            }
            catch (Exception ex)
            {
                FMainException = ex;
            }

        }

        public static void SetupNOAA(FlexCelReport reportStart, string CityName, string DataPath, bool UseOfflineData, Dictionary<string, LatLong> Cities)
        {
            LatLong CityCoords;
            GetCity(Cities, CityName, out CityCoords);
            reportStart.SetValue("Date", DateTime.Now);
            string forecasts;
            DateTime dtStart = DateTime.Now;

            if (UseOfflineData)
            {
                using (StreamReader fs = new StreamReader(Path.Combine(DataPath, "OfflineData.xml")))
                {
                    forecasts = fs.ReadToEnd();
                }
            }
            else
            {
                ndfdXML nd = new ndfdXML();
                forecasts = nd.NDFDgen(CityCoords.Latitude, CityCoords.Longitude, productType.glance, dtStart, dtStart.AddDays(7), unitType.m, new weatherParametersType());

#if(SAVEOFFLINEDATA)
                using (StreamWriter sw = new StreamWriter(Path.Combine(DataPath, "OfflineData.xml")))
                {
                    sw.Write(forecasts);
                }
#endif
            }

            if (String.IsNullOrEmpty(forecasts)) throw new Exception("Can't find the place " + CityName);

            DataSet ds = new DataSet();
            //Load the data into a dataset. On this web service, we cannot just call DataSet.ReadXml as the data is not on the correct format.
            XmlDocument xmlDoc = new XmlDocument();
            {
                xmlDoc.LoadXml(forecasts);
                XmlNodeList HighList = xmlDoc.SelectNodes("/dwml/data/parameters/temperature[@type='maximum']/value/text()");
                XmlNodeList LowList = xmlDoc.SelectNodes("/dwml/data/parameters/temperature[@type='minimum']/value/text()");
                XmlNodeList IconList = xmlDoc.SelectNodes("/dwml/data/parameters/conditions-icon/icon-link/text()");

                DataTable WeatherTable = ds.Tables.Add("Weather");

                WeatherTable.Columns.Add("Day", typeof(DateTime));
                WeatherTable.Columns.Add("Low", typeof(double));
                WeatherTable.Columns.Add("High", typeof(double));
                WeatherTable.Columns.Add("Icon", typeof(byte[]));

                for (int i = 0; i < Math.Min(Math.Min(HighList.Count, LowList.Count), IconList.Count); i++)
                {
                    WeatherTable.Rows.Add(new object[]{
                                                          dtStart.AddDays(i),
                                                          Convert.ToDouble(LowList[i].Value),
                                                          Convert.ToDouble(HighList[i].Value),
                                                          LoadIcon(IconList[i].Value, UseOfflineData, DataPath)});
                }
            }

            reportStart.AddTable(ds, TDisposeMode.DisposeAfterRun);
            reportStart.SetValue("Latitude", CityCoords.Latitude);
            reportStart.SetValue("Longitude", CityCoords.Longitude);
            reportStart.SetValue("Place", CityName);

        }

        private static void GetCity(Dictionary<string, LatLong> Cities, string CityName, out LatLong CityCoords)
        {
            if (!Cities.TryGetValue(CityName, out CityCoords)) throw new Exception("Can't find the city " + CityName);
        }

        internal Exception MainException
        {
            get
            {
                return FMainException;
            }
        }

        internal static byte[] LoadIcon(string url, bool useOfflineData, string dataPath)
        {
            if (url == null || url.Length == 0)
            {
                return null; //no icon for this image.
            }

            if (useOfflineData)
            {
                Uri u = new Uri(url);
                return LoadFileIcon(Path.Combine(dataPath, u.Segments[u.Segments.Length - 1]));
            }
            else
            {
#if (SAVEOFFLINEDATA)
                Uri u = new Uri(url);
                byte[] IconData = LoadWebIcon(url);
                using (FileStream fs = new FileStream(Path.Combine(dataPath, u.Segments[u.Segments.Length - 1]), FileMode.Create))
                {
                    fs.Write(IconData, 0, IconData.Length);
                }
#endif

                return LoadWebIcon(url);

            }
        }

        /// <summary>
        /// On a real implementation this should be cached.
        /// </summary>
        /// <param name="url"></param>
        /// <returns></returns>
        internal static byte[] LoadWebIcon(string url)
        {
            using (WebClient wc = new WebClient())
            {
                wc.Headers.Add("user-agent", "FlexCel Webservice Example");
                return wc.DownloadData(url);
            }
        }

        private static byte[] LoadFileIcon(string filename)
        {
            using (FileStream fs = new FileStream(filename, FileMode.Open))
            {
                byte[] Result = new byte[fs.Length];
                fs.Read(Result, 0, Result.Length);
                return Result;
            }
        }

    }

}

Form1.Designer.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using System.Diagnostics;
using System.Reflection;
using System.Xml;
using System.Net;
using System.Threading;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using FlexCel.Report;
using FlexCel.Render;
using ExportingWebServices.gov.weather.www;
namespace ExportingWebServices
{
    public partial class mainForm: System.Windows.Forms.Form
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.Container components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.btnExportXls = new System.Windows.Forms.Button();
            this.saveFileDialogXls = new System.Windows.Forms.SaveFileDialog();
            this.reportStart = new FlexCel.Report.FlexCelReport();
            this.btnCancel = new System.Windows.Forms.Button();
            this.label3 = new System.Windows.Forms.Label();
            this.cbOffline = new System.Windows.Forms.CheckBox();
            this.btnExportPdf = new System.Windows.Forms.Button();
            this.saveFileDialogPdf = new System.Windows.Forms.SaveFileDialog();
            this.edcity = new System.Windows.Forms.ComboBox();
            this.SuspendLayout();
            //
            // btnExportXls
            //
            this.btnExportXls.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.btnExportXls.BackColor = System.Drawing.Color.Green;
            this.btnExportXls.ForeColor = System.Drawing.Color.White;
            this.btnExportXls.Location = new System.Drawing.Point(16, 120);
            this.btnExportXls.Name = "btnExportXls";
            this.btnExportXls.Size = new System.Drawing.Size(112, 23);
            this.btnExportXls.TabIndex = 0;
            this.btnExportXls.Text = "Export to Excel";
            this.btnExportXls.UseVisualStyleBackColor = false;
            this.btnExportXls.Click += new System.EventHandler(this.btnExportXls_Click);
            //
            // saveFileDialogXls
            //
            this.saveFileDialogXls.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm|Excel 97/2003|*.xls|Excel 2007|*.xlsx;*.xlsm|All " +
    "files|*.*";
            this.saveFileDialogXls.RestoreDirectory = true;
            //
            // reportStart
            //
            this.reportStart.AllowOverwritingFiles = true;
            this.reportStart.DeleteEmptyRanges = false;
            //
            // btnCancel
            //
            this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.btnCancel.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
            this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            this.btnCancel.ForeColor = System.Drawing.Color.White;
            this.btnCancel.Location = new System.Drawing.Point(272, 120);
            this.btnCancel.Name = "btnCancel";
            this.btnCancel.Size = new System.Drawing.Size(112, 23);
            this.btnCancel.TabIndex = 3;
            this.btnCancel.Text = "Cancel";
            this.btnCancel.UseVisualStyleBackColor = false;
            this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
            //
            // label3
            //
            this.label3.Location = new System.Drawing.Point(32, 19);
            this.label3.Name = "label3";
            this.label3.Size = new System.Drawing.Size(40, 85);
            this.label3.TabIndex = 8;
            this.label3.Text = "City:";
            //
            // cbOffline
            //
            this.cbOffline.Checked = true;
            this.cbOffline.CheckState = System.Windows.Forms.CheckState.Checked;
            this.cbOffline.Location = new System.Drawing.Point(32, 80);
            this.cbOffline.Name = "cbOffline";
            this.cbOffline.Size = new System.Drawing.Size(352, 24);
            this.cbOffline.TabIndex = 10;
            this.cbOffline.Text = "Use offline data. (do not actually connect to the web service)";
            //
            // btnExportPdf
            //
            this.btnExportPdf.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.btnExportPdf.BackColor = System.Drawing.Color.SteelBlue;
            this.btnExportPdf.ForeColor = System.Drawing.Color.White;
            this.btnExportPdf.Location = new System.Drawing.Point(144, 120);
            this.btnExportPdf.Name = "btnExportPdf";
            this.btnExportPdf.Size = new System.Drawing.Size(112, 23);
            this.btnExportPdf.TabIndex = 11;
            this.btnExportPdf.Text = "Export to Pdf";
            this.btnExportPdf.UseVisualStyleBackColor = false;
            this.btnExportPdf.Click += new System.EventHandler(this.btnExportPdf_Click);
            //
            // saveFileDialogPdf
            //
            this.saveFileDialogPdf.Filter = "Pdf Files|*.pdf";
            this.saveFileDialogPdf.RestoreDirectory = true;
            //
            // edcity
            //
            this.edcity.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend;
            this.edcity.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems;
            this.edcity.FormattingEnabled = true;
            this.edcity.Location = new System.Drawing.Point(78, 12);
            this.edcity.MaxDropDownItems = 32;
            this.edcity.Name = "edcity";
            this.edcity.Size = new System.Drawing.Size(306, 21);
            this.edcity.TabIndex = 12;
            this.edcity.KeyDown += new System.Windows.Forms.KeyEventHandler(this.edcity_KeyDown);
            //
            // mainForm
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(416, 157);
            this.Controls.Add(this.edcity);
            this.Controls.Add(this.btnExportPdf);
            this.Controls.Add(this.cbOffline);
            this.Controls.Add(this.label3);
            this.Controls.Add(this.btnCancel);
            this.Controls.Add(this.btnExportXls);
            this.Name = "mainForm";
            this.Text = "Exporting Web Services";
            this.ResumeLayout(false);

        }
        #endregion

        private System.Windows.Forms.Button btnCancel;
        private System.Windows.Forms.Label label3;
        private System.Windows.Forms.CheckBox cbOffline;
        private System.Windows.Forms.Button btnExportXls;
        private System.Windows.Forms.Button btnExportPdf;
        private System.Windows.Forms.SaveFileDialog saveFileDialogXls;
        private System.Windows.Forms.SaveFileDialog saveFileDialogPdf;
        private FlexCel.Report.FlexCelReport reportStart;
        private ComboBox edcity;

    }
}

Program.cs

using System;
using System.Windows.Forms;

namespace ExportingWebServices
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new mainForm());
        }
    }
}

ProgressDialog.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;

using System.Threading;

using FlexCel.Render;

namespace ExportingWebServices
{
    /// <summary>
    /// A dialog box to show progress. This could be done with a BackgroundWorker, it was done this way for .NET 1.1 compatibility.
    /// </summary>
    public partial class ProgressDialog: System.Windows.Forms.Form
    {
        private System.Timers.Timer timer1;

        public ProgressDialog()
        {
            InitializeComponent();
        }

        private DateTime StartTime;
        private Thread RunningThread;

        private void timer1_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
        {
            UpdateStatus();
        }

        public void ShowProgress(Thread aRunningThread)
        {
            RunningThread = aRunningThread;

            if (!RunningThread.IsAlive) { DialogResult = DialogResult.OK; return; }
            timer1.Enabled = true;
            StartTime = DateTime.Now;
            ShowDialog();
        }

        private void UpdateStatus()
        {
            TimeSpan ts = DateTime.Now - StartTime;
            string hours;
            if (ts.Hours == 0) hours = ""; else hours = ts.Hours.ToString("00") + ":";
            statusBarPanelTime.Text = hours + ts.Minutes.ToString("00") + ":" + ts.Seconds.ToString("00");

            if (!RunningThread.IsAlive) DialogResult = DialogResult.OK;
        }

        private void ProgressDialog_Closed(object sender, System.EventArgs e)
        {
            timer1.Enabled = false;
        }

    }
}

ProgressDialog.Designer.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Threading;
using FlexCel.Render;
namespace ExportingWebServices
{
    public partial class ProgressDialog: System.Windows.Forms.Form
    {
        private System.Windows.Forms.StatusBar statusBar1;
        private System.Windows.Forms.StatusBarPanel statusBarPanel1;
        private System.Windows.Forms.StatusBarPanel statusBarPanelTime;
        private System.Windows.Forms.Label labelCaption;
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.Container components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.statusBar1 = new System.Windows.Forms.StatusBar();
            this.statusBarPanel1 = new System.Windows.Forms.StatusBarPanel();
            this.statusBarPanelTime = new System.Windows.Forms.StatusBarPanel();
            this.labelCaption = new System.Windows.Forms.Label();
            this.timer1 = new System.Timers.Timer();
            ((System.ComponentModel.ISupportInitialize)(this.statusBarPanel1)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.statusBarPanelTime)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.timer1)).BeginInit();
            this.SuspendLayout();
            //
            // statusBar1
            //
            this.statusBar1.Location = new System.Drawing.Point(0, 100);
            this.statusBar1.Name = "statusBar1";
            this.statusBar1.Panels.AddRange(new System.Windows.Forms.StatusBarPanel[] {
                                                                                this.statusBarPanel1,
                                                                                this.statusBarPanelTime});
            this.statusBar1.ShowPanels = true;
            this.statusBar1.Size = new System.Drawing.Size(448, 22);
            this.statusBar1.TabIndex = 1;
            //
            // statusBarPanel1
            //
            this.statusBarPanel1.BorderStyle = System.Windows.Forms.StatusBarPanelBorderStyle.None;
            this.statusBarPanel1.Text = "Elapsed Time:";
            this.statusBarPanel1.Width = 80;
            //
            // statusBarPanelTime
            //
            this.statusBarPanelTime.BorderStyle = System.Windows.Forms.StatusBarPanelBorderStyle.None;
            this.statusBarPanelTime.Text = "0:00";
            //
            // labelCaption
            //
            this.labelCaption.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
                | System.Windows.Forms.AnchorStyles.Right)));
            this.labelCaption.Location = new System.Drawing.Point(16, 16);
            this.labelCaption.Name = "labelCaption";
            this.labelCaption.Size = new System.Drawing.Size(408, 16);
            this.labelCaption.TabIndex = 2;
            this.labelCaption.Text = "Connecting to Webservice...";
            //
            // timer1
            //
            this.timer1.Enabled = true;
            this.timer1.SynchronizingObject = this;
            this.timer1.Elapsed += new System.Timers.ElapsedEventHandler(this.timer1_Elapsed);
            //
            // ProgressDialog
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(448, 122);
            this.Controls.Add(this.labelCaption);
            this.Controls.Add(this.statusBar1);
            this.Name = "ProgressDialog";
            this.ShowInTaskbar = false;
            this.Text = "Please wait...";
            this.Closed += new System.EventHandler(this.ProgressDialog_Closed);
            ((System.ComponentModel.ISupportInitialize)(this.statusBarPanel1)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.statusBarPanelTime)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.timer1)).EndInit();
            this.ResumeLayout(false);

        }
        #endregion
    }
}


Includes (C# / netframework) | FlexCel Studio for the .NET Framework documentation

Includes (C# / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\csharp\VS2022\netframework\20.Reports\40.Includes and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​csharp/​VS2022/​netframework/​Modules/​20.​Reports/​40.​Includes

Overview

The <#Include> tag is very useful to keep your reports modular.

Concepts

  • Included files can contain nested included files inside.

  • There are two main ways to use the includes: As a common reusable part of your reports (like a header), or together with <#if> tag to create different layouts of subreports depending on the data. Use the "different layouts" only if data on the detail changes in fact very much depending on the data on the parent. If not, using <#If> and <#format cell> will probably be better.

  • An included report "inherits" all the variables and datasets of the parent. The included report is a subreport that is precompiled separated from the parent and run on its own sandbox. It is *not* pasted on the main report until it is run, and it can't modify things on the parent.

  • When creating an included report it can happen that column widths are different on the including and the included report. You might have a template header.xls that you include on every report, but the including reports can have different column widths, changing the header. One solution to this is to use only textboxes and images on header.xls, group them all together, and finally right click on the group and select "Move but not size with cells". This way, the included header will look the same everywhere.

Files

AssemblyInfo.cs

using System.Reflection;
using System.Runtime.CompilerServices;

//
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
//
[assembly: AssemblyTitle("")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("(c) 2002 - 2024 TMS Software")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

//
// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version
//      Build Number
//      Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:

[assembly: AssemblyVersion("7.21.0.0")]

//
// In order to sign your assembly you must specify a key to use. Refer to the
// Microsoft .NET Framework documentation for more information on assembly signing.
//
// Use the attributes below to control which key is used for signing.
//
// Notes:
//   (*) If no key is specified, the assembly is not signed.
//   (*) KeyName refers to a key that has been installed in the Crypto Service
//       Provider (CSP) on your machine. KeyFile refers to a file which contains
//       a key.
//   (*) If the KeyFile and the KeyName values are both specified, the
//       following processing occurs:
//       (1) If the KeyName can be found in the CSP, that key is used.
//       (2) If the KeyName does not exist and the KeyFile does exist, the key
//           in the KeyFile is installed into the CSP and used.
//   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
//       When specifying the KeyFile, the location of the KeyFile should be
//       relative to the project output directory which is
//       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
//       located in the project directory, you would specify the AssemblyKeyFile
//       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
//   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
//       documentation for more information on this.
//
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]
[assembly: AssemblyKeyName("")]

Form1.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using System.Diagnostics;
using System.Reflection;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using FlexCel.Report;
using FlexCel.Demo.SharedData;

namespace Includes
{
    /// <summary>
    /// Including reports
    /// </summary>
    public partial class mainForm: System.Windows.Forms.Form
    {

        public mainForm()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, System.EventArgs e)
        {
            AutoRun();
        }

        public void AutoRun()
        {
            using (FlexCelReport ordersReport = SharedData.CreateReport())
            {
                ordersReport.SetValue("Date", DateTime.Now);
                ordersReport.SetValue("ReportCaption", "ORDERS");

                string DataPath = Path.Combine(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), ".."), "..") + Path.DirectorySeparatorChar;

                if (saveFileDialog1.ShowDialog() == DialogResult.OK)
                {
                    ordersReport.Run(DataPath + "Includes.template.xls", saveFileDialog1.FileName);

                    if (MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) == DialogResult.Yes)
                    {
                        using (Process p = new Process())
                        {
                            p.StartInfo.FileName = saveFileDialog1.FileName;
                            p.StartInfo.UseShellExecute = true;
                            p.Start();
                        }
                    }
                }
            }
        }

        private void btnCancel_Click(object sender, System.EventArgs e)
        {
            Close();
        }
    }

}

Form1.Designer.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using System.Diagnostics;
using System.Reflection;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using FlexCel.Report;
using FlexCel.Demo.SharedData;
namespace Includes
{
    public partial class mainForm: System.Windows.Forms.Form
    {
        private System.Windows.Forms.Button button1;
        private System.Windows.Forms.SaveFileDialog saveFileDialog1;
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.Button btnCancel;
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.Container components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.button1 = new System.Windows.Forms.Button();
            this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog();
            this.label1 = new System.Windows.Forms.Label();
            this.btnCancel = new System.Windows.Forms.Button();
            this.SuspendLayout();
            //
            // button1
            //
            this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.button1.BackColor = System.Drawing.Color.Green;
            this.button1.ForeColor = System.Drawing.Color.White;
            this.button1.Location = new System.Drawing.Point(152, 88);
            this.button1.Name = "button1";
            this.button1.Size = new System.Drawing.Size(112, 23);
            this.button1.TabIndex = 0;
            this.button1.Text = "GO!";
            this.button1.UseVisualStyleBackColor = false;
            this.button1.Click += new System.EventHandler(this.button1_Click);
            //
            // saveFileDialog1
            //
            this.saveFileDialog1.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm|Excel 97/2003|*.xls|Excel 2007|*.xlsx;*.xlsm|All files|*.*";
            this.saveFileDialog1.RestoreDirectory = true;
            //
            // label1
            //
            this.label1.Location = new System.Drawing.Point(24, 24);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(272, 24);
            this.label1.TabIndex = 2;
            this.label1.Text = "Including subreports demo.";
            //
            // btnCancel
            //
            this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.btnCancel.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
            this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            this.btnCancel.ForeColor = System.Drawing.Color.White;
            this.btnCancel.Location = new System.Drawing.Point(272, 88);
            this.btnCancel.Name = "btnCancel";
            this.btnCancel.Size = new System.Drawing.Size(112, 23);
            this.btnCancel.TabIndex = 3;
            this.btnCancel.Text = "Cancel";
            this.btnCancel.UseVisualStyleBackColor = false;
            this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
            //
            // mainForm
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(416, 133);
            this.Controls.Add(this.btnCancel);
            this.Controls.Add(this.label1);
            this.Controls.Add(this.button1);
            this.Name = "mainForm";
            this.Text = "Including Reports";
            this.ResumeLayout(false);

        }
        #endregion
    }
}

Program.cs

using System;
using System.Windows.Forms;

namespace Includes
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new mainForm());
        }
    }
}


Bidirectional reports (C# / netframework) | FlexCel Studio for the .NET Framework documentation

Bidirectional reports (C# / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\csharp\VS2022\netframework\20.Reports\42.Bidirectional Reports and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​csharp/​VS2022/​netframework/​Modules/​20.​Reports/​42.​Bidirectional Reports

Overview

In this example we will create a report that grows both horizontally and vertically.

Concepts

  • Normally ranges in FlexCel reports can't intercept. But there is an exception: If you define a range in the shape of a cross, FlexCel will do a bidirectional report.

  • In Bidirectional reports the row range acts as the master, and the column range as the detail. You can have more than one column range for the same row, but not more than one row range for the same column.

  • In this example we have two different column reports using the same row report. In the first column we show which employees have orders for a given customer, and in the second we show the orders for that customer.

  • Those two columns are conceptually different: In the first we use a column and row dataset which are not related. This will create a square with all the records of the column dataset for the column, and all the records of the row dataset for the rows. In the second column, the column dataset (orders) is related to the row dataset (customers). So the number of columns will be different for each row, depending in how many orders that customer has. FlexCel will insert as many columns as the maximum numbers of orders for any customer.

  • You can look at the User Defined Functions example for another demo on how bidirectional reports work.

Files

AssemblyInfo.cs

using System.Reflection;
using System.Runtime.CompilerServices;

//
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
//
[assembly: AssemblyTitle("")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("(c) 2002 - 2024 TMS Software")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

//
// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version
//      Build Number
//      Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:

[assembly: AssemblyVersion("7.21.0.0")]

//
// In order to sign your assembly you must specify a key to use. Refer to the
// Microsoft .NET Framework documentation for more information on assembly signing.
//
// Use the attributes below to control which key is used for signing.
//
// Notes:
//   (*) If no key is specified, the assembly is not signed.
//   (*) KeyName refers to a key that has been installed in the Crypto Service
//       Provider (CSP) on your machine. KeyFile refers to a file which contains
//       a key.
//   (*) If the KeyFile and the KeyName values are both specified, the
//       following processing occurs:
//       (1) If the KeyName can be found in the CSP, that key is used.
//       (2) If the KeyName does not exist and the KeyFile does exist, the key
//           in the KeyFile is installed into the CSP and used.
//   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
//       When specifying the KeyFile, the location of the KeyFile should be
//       relative to the project output directory which is
//       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
//       located in the project directory, you would specify the AssemblyKeyFile
//       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
//   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
//       documentation for more information on this.
//
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]
[assembly: AssemblyKeyName("")]

Form1.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using System.Diagnostics;
using System.Reflection;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using FlexCel.Report;
using FlexCel.Demo.SharedData;

namespace BidirectionalReports
{
    public partial class mainForm: System.Windows.Forms.Form
    {

        public mainForm()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, System.EventArgs e)
        {
            AutoRun();
        }

        public void AutoRun()
        {
            using (FlexCelReport ordersReport = SharedData.CreateReport())
            {
                ordersReport.SetValue("Date", DateTime.Now);
                string DataPath = Path.Combine(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), ".."), "..") + Path.DirectorySeparatorChar;

                if (saveFileDialog1.ShowDialog() == DialogResult.OK)
                {
                    ordersReport.Run(DataPath + "Bidirectional Reports.template.xlsx", saveFileDialog1.FileName);

                    if (MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) == DialogResult.Yes)
                    {
                        using (Process p = new Process())
                        {
                            p.StartInfo.FileName = saveFileDialog1.FileName;
                            p.StartInfo.UseShellExecute = true;
                            p.Start();
                        }
                    }
                }
            }
        }

        private void btnCancel_Click(object sender, System.EventArgs e)
        {
            Close();
        }

    }
}

Form1.Designer.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using System.Diagnostics;
using System.Reflection;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using FlexCel.Report;
using FlexCel.Demo.SharedData;
namespace BidirectionalReports
{
    public partial class mainForm: System.Windows.Forms.Form
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.Container components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.button1 = new System.Windows.Forms.Button();
            this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog();
            this.label1 = new System.Windows.Forms.Label();
            this.btnCancel = new System.Windows.Forms.Button();
            this.SuspendLayout();
            //
            // button1
            //
            this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.button1.BackColor = System.Drawing.Color.Green;
            this.button1.ForeColor = System.Drawing.Color.White;
            this.button1.Location = new System.Drawing.Point(279, 162);
            this.button1.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
            this.button1.Name = "button1";
            this.button1.Size = new System.Drawing.Size(205, 42);
            this.button1.TabIndex = 0;
            this.button1.Text = "GO!";
            this.button1.UseVisualStyleBackColor = false;
            this.button1.Click += new System.EventHandler(this.button1_Click);
            //
            // saveFileDialog1
            //
            this.saveFileDialog1.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm|Excel 97/2003|*.xls|Excel 2007|*.xlsx;*.xlsm|All " +
                "files|*.*";
            this.saveFileDialog1.RestoreDirectory = true;
            //
            // label1
            //
            this.label1.Location = new System.Drawing.Point(44, 44);
            this.label1.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(528, 44);
            this.label1.TabIndex = 2;
            this.label1.Text = "A report that grows both horizontally and vertically.";
            //
            // btnCancel
            //
            this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.btnCancel.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
            this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            this.btnCancel.ForeColor = System.Drawing.Color.White;
            this.btnCancel.Location = new System.Drawing.Point(499, 162);
            this.btnCancel.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
            this.btnCancel.Name = "btnCancel";
            this.btnCancel.Size = new System.Drawing.Size(205, 42);
            this.btnCancel.TabIndex = 3;
            this.btnCancel.Text = "Cancel";
            this.btnCancel.UseVisualStyleBackColor = false;
            this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
            //
            // mainForm
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(11F, 24F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(763, 246);
            this.Controls.Add(this.btnCancel);
            this.Controls.Add(this.label1);
            this.Controls.Add(this.button1);
            this.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
            this.Name = "mainForm";
            this.Text = "Bidirectional Reports";
            this.ResumeLayout(false);

        }
        #endregion

        private System.Windows.Forms.Button button1;
        private System.Windows.Forms.SaveFileDialog saveFileDialog1;
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.Button btnCancel;
    }
}

Program.cs

using System;
using System.Windows.Forms;

namespace BidirectionalReports
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new mainForm());
        }
    }
}


Lookups (C# / netframework) | FlexCel Studio for the .NET Framework documentation

Lookups (C# / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\csharp\VS2022\netframework\20.Reports\45.Lookups and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​csharp/​VS2022/​netframework/​Modules/​20.​Reports/​45.​Lookups

Overview

Sometimes you have a field with a value that is read from another table. On this example, the field Employees.ReportsTo is a number, which points to the EmployeeID of the supervisor. Using the <#lookup()> tag, you can write the name of the supervisor, not only his EmployeeID.

Concepts

  • How to use the <#Lookup> tag to search for a field in another table.

  • Normally you will make lookup on one field, as in the example: <#lookup(Employees;EmployeeID;<#Employees.ReportsTo>;LastName)>. (This code lookups the value of ReportsTo, on the table Employees, searches for the field EmployeeId and returns LastName. Now, sometimes you might want to lookup on more than on field. Imagine that you wanted to search on the table Employee, but the record that not only has EmployeeID = ReportsTo, but Country="Spain". You can use the Array> tag to search here: <#lookup(Employees;EmployeeID,Country;<#array(<#Employees.ReportsTo>;Spain)>;FirstName)>

  • Unrelated to Lookups, we show two other Excel features you can use: We froze the top panel so when you scroll down, the header is always visible, and we added an AutoFilter to find Employees. We just added them on the template, and they continue to exist on the generated report. Note that you can't define them in an include.

Files

AssemblyInfo.cs

using System.Reflection;
using System.Runtime.CompilerServices;

//
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
//
[assembly: AssemblyTitle("")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("(c) 2002 - 2024 TMS Software")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

//
// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version
//      Build Number
//      Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:

[assembly: AssemblyVersion("7.21.0.0")]

//
// In order to sign your assembly you must specify a key to use. Refer to the
// Microsoft .NET Framework documentation for more information on assembly signing.
//
// Use the attributes below to control which key is used for signing.
//
// Notes:
//   (*) If no key is specified, the assembly is not signed.
//   (*) KeyName refers to a key that has been installed in the Crypto Service
//       Provider (CSP) on your machine. KeyFile refers to a file which contains
//       a key.
//   (*) If the KeyFile and the KeyName values are both specified, the
//       following processing occurs:
//       (1) If the KeyName can be found in the CSP, that key is used.
//       (2) If the KeyName does not exist and the KeyFile does exist, the key
//           in the KeyFile is installed into the CSP and used.
//   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
//       When specifying the KeyFile, the location of the KeyFile should be
//       relative to the project output directory which is
//       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
//       located in the project directory, you would specify the AssemblyKeyFile
//       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
//   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
//       documentation for more information on this.
//
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]
[assembly: AssemblyKeyName("")]

Form1.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using System.Diagnostics;
using System.Reflection;
using System.Resources;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using FlexCel.Report;
using FlexCel.Demo.SharedData;

namespace Lookups
{
    /// <summary>
    /// Lookups
    /// </summary>
    public partial class mainForm: System.Windows.Forms.Form
    {
        public mainForm()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, System.EventArgs e)
        {
            AutoRun();
        }

        public void AutoRun()
        {
            using (FlexCelReport ordersReport = SharedData.CreateReport())
            {
                ordersReport.SetValue("Date", DateTime.Now);
                string DataPath = Path.Combine(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), ".."), "..") + Path.DirectorySeparatorChar;

                if (saveFileDialog1.ShowDialog() == DialogResult.OK)
                {
                    ordersReport.Run(DataPath + "Lookups.template.xls", saveFileDialog1.FileName);

                    if (MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) == DialogResult.Yes)
                    {
                        using (Process p = new Process())
                        {
                            p.StartInfo.FileName = saveFileDialog1.FileName;
                            p.StartInfo.UseShellExecute = true;
                            p.Start();
                        }
                    }
                }
            }
        }

        private void btnCancel_Click(object sender, System.EventArgs e)
        {
            Close();
        }

    }

}

Form1.Designer.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using System.Diagnostics;
using System.Reflection;
using System.Resources;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using FlexCel.Report;
using FlexCel.Demo.SharedData;
namespace Lookups
{
    public partial class mainForm: System.Windows.Forms.Form
    {
        private System.Windows.Forms.Button button1;
        private System.Windows.Forms.SaveFileDialog saveFileDialog1;
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.Button btnCancel;
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.Container components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.button1 = new System.Windows.Forms.Button();
            this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog();
            this.label1 = new System.Windows.Forms.Label();
            this.btnCancel = new System.Windows.Forms.Button();
            this.SuspendLayout();
            //
            // button1
            //
            this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.button1.BackColor = System.Drawing.Color.Green;
            this.button1.ForeColor = System.Drawing.Color.White;
            this.button1.Location = new System.Drawing.Point(152, 88);
            this.button1.Name = "button1";
            this.button1.Size = new System.Drawing.Size(112, 23);
            this.button1.TabIndex = 0;
            this.button1.Text = "GO!";
            this.button1.UseVisualStyleBackColor = false;
            this.button1.Click += new System.EventHandler(this.button1_Click);
            //
            // saveFileDialog1
            //
            this.saveFileDialog1.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm|Excel 97/2003|*.xls|Excel 2007|*.xlsx;*.xlsm|All files|*.*";
            this.saveFileDialog1.RestoreDirectory = true;
            //
            // label1
            //
            this.label1.Location = new System.Drawing.Point(24, 24);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(288, 24);
            this.label1.TabIndex = 2;
            this.label1.Text = "A demo on how to use lookup fields. ";
            //
            // btnCancel
            //
            this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.btnCancel.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
            this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            this.btnCancel.ForeColor = System.Drawing.Color.White;
            this.btnCancel.Location = new System.Drawing.Point(272, 88);
            this.btnCancel.Name = "btnCancel";
            this.btnCancel.Size = new System.Drawing.Size(112, 23);
            this.btnCancel.TabIndex = 3;
            this.btnCancel.Text = "Cancel";
            this.btnCancel.UseVisualStyleBackColor = false;
            this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
            //
            // mainForm
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(416, 133);
            this.Controls.Add(this.btnCancel);
            this.Controls.Add(this.label1);
            this.Controls.Add(this.button1);
            this.Name = "mainForm";
            this.Text = "Lookups";
            this.ResumeLayout(false);

        }
        #endregion
    }
}

Program.cs

using System;
using System.Windows.Forms;

namespace Lookups
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new mainForm());
        }
    }
}


Aggregates (C# / netframework) | FlexCel Studio for the .NET Framework documentation

Aggregates (C# / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\csharp\VS2022\netframework\20.Reports\46.Aggregates and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​csharp/​VS2022/​netframework/​Modules/​20.​Reports/​46.​Aggregates

Overview

FlexCel allows you to aggregate tables on the fly, providing you with the sum, average, maximum or minimum of the records in a table.

Note

You will normally not want to use in-memory aggregates, since they are slower and consume more memory than aggregates made directly in the database. (using an expression like "select sum(field1) from table group by field2")

Concepts

  • Different ways to use the <#aggregate> tag to aggregate the values in a table.

Files

AssemblyInfo.cs

using System.Reflection;
using System.Runtime.CompilerServices;

//
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
//
[assembly: AssemblyTitle("")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("(c) 2002 - 2024 TMS Software")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

//
// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version
//      Build Number
//      Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:

[assembly: AssemblyVersion("7.21.0.0")]

//
// In order to sign your assembly you must specify a key to use. Refer to the
// Microsoft .NET Framework documentation for more information on assembly signing.
//
// Use the attributes below to control which key is used for signing.
//
// Notes:
//   (*) If no key is specified, the assembly is not signed.
//   (*) KeyName refers to a key that has been installed in the Crypto Service
//       Provider (CSP) on your machine. KeyFile refers to a file which contains
//       a key.
//   (*) If the KeyFile and the KeyName values are both specified, the
//       following processing occurs:
//       (1) If the KeyName can be found in the CSP, that key is used.
//       (2) If the KeyName does not exist and the KeyFile does exist, the key
//           in the KeyFile is installed into the CSP and used.
//   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
//       When specifying the KeyFile, the location of the KeyFile should be
//       relative to the project output directory which is
//       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
//       located in the project directory, you would specify the AssemblyKeyFile
//       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
//   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
//       documentation for more information on this.
//
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]
[assembly: AssemblyKeyName("")]

Form1.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using System.Diagnostics;
using System.Reflection;
using System.Resources;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using FlexCel.Report;
using FlexCel.Demo.SharedData;

namespace Aggregates
{
    /// <summary>
    /// How to sumarize many records into one.
    /// </summary>
    public partial class mainForm: System.Windows.Forms.Form
    {
        public mainForm()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, System.EventArgs e)
        {
            AutoRun();
        }

        public void AutoRun()
        {
            using (FlexCelReport ordersReport = SharedData.CreateReport())
            {
                ordersReport.SetValue("Date", DateTime.Now);
                string DataPath = Path.Combine(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), ".."), "..") + Path.DirectorySeparatorChar;

                if (saveFileDialog1.ShowDialog() == DialogResult.OK)
                {
                    ordersReport.Run(DataPath + "Aggregates.template.xls", saveFileDialog1.FileName);

                    if (MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) == DialogResult.Yes)
                    {
                        using (Process p = new Process())
                        {
                            p.StartInfo.FileName = saveFileDialog1.FileName;
                            p.StartInfo.UseShellExecute = true;
                            p.Start();
                        }
                    }
                }
            }
        }

        private void btnCancel_Click(object sender, System.EventArgs e)
        {
            Close();
        }

    }

}

Form1.Designer.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using System.Diagnostics;
using System.Reflection;
using System.Resources;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using FlexCel.Report;
using FlexCel.Demo.SharedData;
namespace Aggregates
{
    public partial class mainForm: System.Windows.Forms.Form
    {
        private System.Windows.Forms.Button button1;
        private System.Windows.Forms.SaveFileDialog saveFileDialog1;
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.Button btnCancel;
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.Container components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.button1 = new System.Windows.Forms.Button();
            this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog();
            this.label1 = new System.Windows.Forms.Label();
            this.btnCancel = new System.Windows.Forms.Button();
            this.SuspendLayout();
            //
            // button1
            //
            this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.button1.BackColor = System.Drawing.Color.Green;
            this.button1.ForeColor = System.Drawing.Color.White;
            this.button1.Location = new System.Drawing.Point(152, 88);
            this.button1.Name = "button1";
            this.button1.Size = new System.Drawing.Size(112, 23);
            this.button1.TabIndex = 0;
            this.button1.Text = "GO!";
            this.button1.UseVisualStyleBackColor = false;
            this.button1.Click += new System.EventHandler(this.button1_Click);
            //
            // saveFileDialog1
            //
            this.saveFileDialog1.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm|Excel 97/2003|*.xls|Excel 2007|*.xlsx;*.xlsm|All files|*.*";
            this.saveFileDialog1.RestoreDirectory = true;
            //
            // label1
            //
            this.label1.Location = new System.Drawing.Point(24, 24);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(288, 24);
            this.label1.TabIndex = 2;
            this.label1.Text = "A demo on how to use the Aggregate tag. ";
            //
            // btnCancel
            //
            this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.btnCancel.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
            this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            this.btnCancel.ForeColor = System.Drawing.Color.White;
            this.btnCancel.Location = new System.Drawing.Point(272, 88);
            this.btnCancel.Name = "btnCancel";
            this.btnCancel.Size = new System.Drawing.Size(112, 23);
            this.btnCancel.TabIndex = 3;
            this.btnCancel.Text = "Cancel";
            this.btnCancel.UseVisualStyleBackColor = false;
            this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
            //
            // mainForm
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(416, 133);
            this.Controls.Add(this.btnCancel);
            this.Controls.Add(this.label1);
            this.Controls.Add(this.button1);
            this.Name = "mainForm";
            this.Text = "Aggregates";
            this.ResumeLayout(false);

        }
        #endregion
    }
}

Program.cs

using System;
using System.Windows.Forms;

namespace Aggregates
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new mainForm());
        }
    }
}


Regular expressions (C# / netframework) | FlexCel Studio for the .NET Framework documentation

Regular expressions (C# / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\csharp\VS2022\netframework\20.Reports\47.Regular Expressions and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​csharp/​VS2022/​netframework/​Modules/​20.​Reports/​47.​Regular Expressions

Overview

Regular expressions give you both the power to transform the text in your reports in any way you like, and also to obfuscate and make unmaintainable your templates if you abuse them. The <#regex()> tag lets you write your own Regular Expressions in a FlexCel report.

Concepts

  • There are 2 versions of the <#regex> tag:

  • RegEx(IgnoreCase, Expression, Search): This will search for the expression inside "Search" string, and return the part of "Search" that matches the expression.

  • RegEx(IgnoreCase, Expression, Search, Replace): This will Replace the matching string inside "Search" by the "Replace" string.

  • Both "Search" and "Replace" parameters are evaluated at runtime, so they will evaluate to different strings as the row changes. The "Expression" parameter is evaluated only once before starting the report, so it will not change.

  • As formerly said, use regular expressions with care. Sometimes they are just invaluable to get your desired output, but on other times they can make maintaining the templates a lot of work. Depending on the case, you might find better to define your own user function to do a complex transformation. (See the User Defined Functions example)

  • Regular Expressions are a complex subject, and we will not explain how to use them here. There is a lot of information out there available on them.

Files

AssemblyInfo.cs

using System.Reflection;
using System.Runtime.CompilerServices;

//
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
//
[assembly: AssemblyTitle("")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("(c) 2002 - 2024 TMS Software")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

//
// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version
//      Build Number
//      Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:

[assembly: AssemblyVersion("7.21.0.0")]

//
// In order to sign your assembly you must specify a key to use. Refer to the
// Microsoft .NET Framework documentation for more information on assembly signing.
//
// Use the attributes below to control which key is used for signing.
//
// Notes:
//   (*) If no key is specified, the assembly is not signed.
//   (*) KeyName refers to a key that has been installed in the Crypto Service
//       Provider (CSP) on your machine. KeyFile refers to a file which contains
//       a key.
//   (*) If the KeyFile and the KeyName values are both specified, the
//       following processing occurs:
//       (1) If the KeyName can be found in the CSP, that key is used.
//       (2) If the KeyName does not exist and the KeyFile does exist, the key
//           in the KeyFile is installed into the CSP and used.
//   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
//       When specifying the KeyFile, the location of the KeyFile should be
//       relative to the project output directory which is
//       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
//       located in the project directory, you would specify the AssemblyKeyFile
//       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
//   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
//       documentation for more information on this.
//
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]
[assembly: AssemblyKeyName("")]

Form1.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using System.Diagnostics;
using System.Reflection;
using System.Resources;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using FlexCel.Report;
using FlexCel.Demo.SharedData;

namespace RegularExpressions
{
    /// <summary>
    /// How to make your reports criptic using regexps...
    /// </summary>
    public partial class mainForm: System.Windows.Forms.Form
    {

        public mainForm()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, System.EventArgs e)
        {
            AutoRun();
        }

        public void AutoRun()
        {
            using (FlexCelReport ordersReport = SharedData.CreateReport())
            {
                ordersReport.SetValue("Date", DateTime.Now);
                ordersReport.SetValue("ReportCaption", "Suppliers");
                string DataPath = Path.Combine(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), ".."), "..") + Path.DirectorySeparatorChar;

                if (saveFileDialog1.ShowDialog() == DialogResult.OK)
                {
                    ordersReport.Run(DataPath + "Regular Expressions.template.xls", saveFileDialog1.FileName);

                    if (MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) == DialogResult.Yes)
                    {
                        using (Process p = new Process())
                        {
                            p.StartInfo.FileName = saveFileDialog1.FileName;
                            p.StartInfo.UseShellExecute = true;
                            p.Start();
                        }
                    }
                }
            }
        }

        private void btnCancel_Click(object sender, System.EventArgs e)
        {
            Close();
        }

    }

}

Form1.Designer.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using System.Diagnostics;
using System.Reflection;
using System.Resources;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using FlexCel.Report;
using FlexCel.Demo.SharedData;
namespace RegularExpressions
{
    public partial class mainForm: System.Windows.Forms.Form
    {
        private System.Windows.Forms.Button button1;
        private System.Windows.Forms.SaveFileDialog saveFileDialog1;
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.Button btnCancel;
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.Container components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.button1 = new System.Windows.Forms.Button();
            this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog();
            this.label1 = new System.Windows.Forms.Label();
            this.btnCancel = new System.Windows.Forms.Button();
            this.SuspendLayout();
            //
            // button1
            //
            this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.button1.BackColor = System.Drawing.Color.Green;
            this.button1.ForeColor = System.Drawing.Color.White;
            this.button1.Location = new System.Drawing.Point(152, 88);
            this.button1.Name = "button1";
            this.button1.Size = new System.Drawing.Size(112, 23);
            this.button1.TabIndex = 0;
            this.button1.Text = "GO!";
            this.button1.UseVisualStyleBackColor = false;
            this.button1.Click += new System.EventHandler(this.button1_Click);
            //
            // saveFileDialog1
            //
            this.saveFileDialog1.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm|Excel 97/2003|*.xls|Excel 2007|*.xlsx;*.xlsm|All files|*.*";
            this.saveFileDialog1.RestoreDirectory = true;
            //
            // label1
            //
            this.label1.Location = new System.Drawing.Point(24, 24);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(288, 24);
            this.label1.TabIndex = 2;
            this.label1.Text = "A demo on how to use Regular Expressions in fields. ";
            //
            // btnCancel
            //
            this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.btnCancel.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
            this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            this.btnCancel.ForeColor = System.Drawing.Color.White;
            this.btnCancel.Location = new System.Drawing.Point(272, 88);
            this.btnCancel.Name = "btnCancel";
            this.btnCancel.Size = new System.Drawing.Size(112, 23);
            this.btnCancel.TabIndex = 3;
            this.btnCancel.Text = "Cancel";
            this.btnCancel.UseVisualStyleBackColor = false;
            this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
            //
            // mainForm
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(416, 133);
            this.Controls.Add(this.btnCancel);
            this.Controls.Add(this.label1);
            this.Controls.Add(this.button1);
            this.Name = "mainForm";
            this.Text = "Regular Expressions";
            this.ResumeLayout(false);

        }
        #endregion
    }
}

Program.cs

using System;
using System.Windows.Forms;

namespace RegularExpressions
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new mainForm());
        }
    }
}


Manual formulas (C# / netframework) | FlexCel Studio for the .NET Framework documentation

Manual formulas (C# / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\csharp\VS2022\netframework\20.Reports\48.Manual Formulas and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​csharp/​VS2022/​netframework/​Modules/​20.​Reports/​48.​Manual Formulas

Overview

Here we will create a small fully functional Minesweeper in Excel, and without any macros.

Most of the time, you will just want to write the formulas directly on the report, and let FlexCel change them when inserting rows. But sometimes, you might want to create a formula using flexcel tags. You can do it by using <#formula> and <#ref> tags, but don't do it unless you really need to.

Concepts

  • How to replace <#tags> inside a formula.

  • When you use the <#Formula> tag, formulas are just strings on the template. So we could define inside a cell: "<#formula>=b3", but then if we want to change the template, and insert a row below row 1, the string will still be "<#formula>=b3". That is why we need to use a <#Ref> tag. For example <#formula>=<#ref(0;-1)> on cell c3 will point to b3, but if you insert a row below row 1, it will point to b4 as it should be.

  • There is never a real need to use the <#formula> tag, you can always workaround it. On this particular case we used it so we could change the font, (since it is not possible to change the font on a conditional format), but we could have also used the approach we used on the Expression Parameters demo. In fact, it might have been better that way (by adding the <#format range> tag in the data). But this demo is to show how to use this feature, it is up to you to decide if it is worth or not.

  • How to use conditional formatting, locked cells and data validation to make a nice application.

Files

AssemblyInfo.cs

using System.Reflection;
using System.Runtime.CompilerServices;

//
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
//
[assembly: AssemblyTitle("")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("(c) 2002 - 2024 TMS Software")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

//
// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version
//      Build Number
//      Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:

[assembly: AssemblyVersion("7.21.0.0")]

//
// In order to sign your assembly you must specify a key to use. Refer to the
// Microsoft .NET Framework documentation for more information on assembly signing.
//
// Use the attributes below to control which key is used for signing.
//
// Notes:
//   (*) If no key is specified, the assembly is not signed.
//   (*) KeyName refers to a key that has been installed in the Crypto Service
//       Provider (CSP) on your machine. KeyFile refers to a file which contains
//       a key.
//   (*) If the KeyFile and the KeyName values are both specified, the
//       following processing occurs:
//       (1) If the KeyName can be found in the CSP, that key is used.
//       (2) If the KeyName does not exist and the KeyFile does exist, the key
//           in the KeyFile is installed into the CSP and used.
//   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
//       When specifying the KeyFile, the location of the KeyFile should be
//       relative to the project output directory which is
//       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
//       located in the project directory, you would specify the AssemblyKeyFile
//       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
//   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
//       documentation for more information on this.
//
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]
[assembly: AssemblyKeyName("")]

Form1.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using System.Diagnostics;
using System.Reflection;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using FlexCel.Report;

namespace ManualFormulas
{
    /// <summary>
    /// Shows the formula tag.
    /// </summary>
    public partial class mainForm: System.Windows.Forms.Form
    {
        public mainForm()
        {
            InitializeComponent();
        }

        private void SetupMines(FlexCelReport MinesReport)
        {
            DataSet ds = new DataSet();
            DataTable dtrows = ds.Tables.Add("datarow");
            dtrows.Columns.Add("position", typeof(int));

            DataTable dtcols = ds.Tables.Add("datacol");
            dtcols.Columns.Add("position", typeof(int));
            dtcols.Columns.Add("value", typeof(int));

            ds.Relations.Add(dtrows.Columns["position"], dtcols.Columns["position"]);

            //let's create 10 mines.
            ArrayList mines = new ArrayList();
            Random rnd = new Random();
            while (mines.Count < 10)
            {
                int nextMine = rnd.Next(9 * 9 - 1);
                int minepos = mines.BinarySearch(nextMine);
                if (minepos >= 0) continue; //the value already exists
                mines.Insert(~minepos, nextMine);
            }

            //Fill the tables on master detail
            for (int r = 0; r < 9; r++)
            {
                dtrows.Rows.Add(new object[] { r });
                for (int c = 0; c < 9; c++)
                {
                    object[] values = new object[2];
                    values[0] = r;
                    if (mines.BinarySearch(r * 9 + c) >= 0) values[1] = 1; else values[1] = DBNull.Value;
                    dtcols.Rows.Add(values);
                }
            }

            //finally, add the tables to the report.
            MinesReport.ClearTables();
            MinesReport.AddTable(ds, TDisposeMode.DisposeAfterRun); //leave to Flexcel to delete the dataset.
        }

        private void button1_Click(object sender, System.EventArgs e)
        {
            AutoRun();
        }

        public void AutoRun()
        {
            using (FlexCelReport MinesReport = new FlexCelReport(true))
            {
                MinesReport.AfterGenerateWorkbook += new GenerateEventHandler(MinesReport_AfterGenerateWorkbook);
                SetupMines(MinesReport);
                string DataPath = Path.Combine(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), ".."), "..") + Path.DirectorySeparatorChar;

                if (saveFileDialog1.ShowDialog() == DialogResult.OK)
                {
                    MinesReport.Run(DataPath + "Manual Formulas.template.xls", saveFileDialog1.FileName);

                    if (MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) == DialogResult.Yes)
                    {
                        using (Process p = new Process())
                        {
                            p.StartInfo.FileName = saveFileDialog1.FileName;
                            p.StartInfo.UseShellExecute = true;
                            p.Start();
                        }
                    }
                }
            }
        }

        private void btnCancel_Click(object sender, System.EventArgs e)
        {
            Close();
        }

        private void MinesReport_AfterGenerateWorkbook(object sender, FlexCel.Report.GenerateEventArgs e)
        {
            //do some "pretty" up for the final user.
            //we could do this directly on the template, but doing it here allows us to keep the template unprotected and easier to modify.

            e.File.ActiveSheet = 2;
            e.File.SheetVisible = TXlsSheetVisible.Hidden;
            e.File.ActiveSheet = 1;
            e.File.Protection.SetSheetProtection(null, new TSheetProtectionOptions(true));
            for (int r = 20; r <= FlxConsts.Max_Rows97_2003 + 1; r++) e.File.SetRowHidden(r, true);
            for (int c = 12; c <= FlxConsts.Max_Columns97_2003 + 1; c++) e.File.SetColHidden(c, true);
        }
    }

}

Form1.Designer.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using System.Diagnostics;
using System.Reflection;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using FlexCel.Report;
namespace ManualFormulas
{
    public partial class mainForm: System.Windows.Forms.Form
    {
        private System.Windows.Forms.Button button1;
        private System.Windows.Forms.SaveFileDialog saveFileDialog1;
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.Button btnCancel;
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.Container components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.button1 = new System.Windows.Forms.Button();
            this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog();
            this.label1 = new System.Windows.Forms.Label();
            this.btnCancel = new System.Windows.Forms.Button();
            this.SuspendLayout();
            //
            // button1
            //
            this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.button1.BackColor = System.Drawing.Color.Green;
            this.button1.ForeColor = System.Drawing.Color.White;
            this.button1.Location = new System.Drawing.Point(152, 88);
            this.button1.Name = "button1";
            this.button1.Size = new System.Drawing.Size(112, 23);
            this.button1.TabIndex = 0;
            this.button1.Text = "GO!";
            this.button1.UseVisualStyleBackColor = false;
            this.button1.Click += new System.EventHandler(this.button1_Click);
            //
            // saveFileDialog1
            //
            this.saveFileDialog1.Filter = "Excel Files|*.xls";
            this.saveFileDialog1.RestoreDirectory = true;
            //
            // label1
            //
            this.label1.Location = new System.Drawing.Point(24, 24);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(288, 24);
            this.label1.TabIndex = 2;
            this.label1.Text = "A report with formulas created with tags.";
            //
            // btnCancel
            //
            this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.btnCancel.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
            this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            this.btnCancel.ForeColor = System.Drawing.Color.White;
            this.btnCancel.Location = new System.Drawing.Point(272, 88);
            this.btnCancel.Name = "btnCancel";
            this.btnCancel.Size = new System.Drawing.Size(112, 23);
            this.btnCancel.TabIndex = 3;
            this.btnCancel.Text = "Cancel";
            this.btnCancel.UseVisualStyleBackColor = false;
            this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
            //
            // mainForm
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(416, 133);
            this.Controls.Add(this.btnCancel);
            this.Controls.Add(this.label1);
            this.Controls.Add(this.button1);
            this.Name = "mainForm";
            this.Text = "Manual Formulas Report";
            this.ResumeLayout(false);

        }
        #endregion
    }
}

Program.cs

using System;
using System.Windows.Forms;

namespace ManualFormulas
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new mainForm());
        }
    }
}


Parameters inside expressions (C# / netframework) | FlexCel Studio for the .NET Framework documentation

Parameters inside expressions (C# / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\csharp\VS2022\netframework\20.Reports\50.Expression Parameters and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​csharp/​VS2022/​netframework/​Modules/​20.​Reports/​50.​Expression Parameters

Overview

In FlexCel it is possible to create Expressions that include parameters.

Concepts

  • How to create report Expressions using parameters.

  • How to apply an Expression Format to a formula. You can't directly write a formula like: =a1+1<#format cell(blue)> because of course Excel will not recognize it as a valid formula. > But you can use the <#format range> tag to format the formula. On this example, formula is on column "D" and the formatting tag for the formula is on column "E"

Files

AssemblyInfo.cs

using System.Reflection;
using System.Runtime.CompilerServices;

//
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
//
[assembly: AssemblyTitle("")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("(c) 2002 - 2024 TMS Software")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

//
// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version
//      Build Number
//      Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:

[assembly: AssemblyVersion("7.21.0.0")]

//
// In order to sign your assembly you must specify a key to use. Refer to the
// Microsoft .NET Framework documentation for more information on assembly signing.
//
// Use the attributes below to control which key is used for signing.
//
// Notes:
//   (*) If no key is specified, the assembly is not signed.
//   (*) KeyName refers to a key that has been installed in the Crypto Service
//       Provider (CSP) on your machine. KeyFile refers to a file which contains
//       a key.
//   (*) If the KeyFile and the KeyName values are both specified, the
//       following processing occurs:
//       (1) If the KeyName can be found in the CSP, that key is used.
//       (2) If the KeyName does not exist and the KeyFile does exist, the key
//           in the KeyFile is installed into the CSP and used.
//   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
//       When specifying the KeyFile, the location of the KeyFile should be
//       relative to the project output directory which is
//       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
//       located in the project directory, you would specify the AssemblyKeyFile
//       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
//   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
//       documentation for more information on this.
//
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]
[assembly: AssemblyKeyName("")]

Form1.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using System.Diagnostics;
using System.Reflection;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using FlexCel.Report;
using FlexCel.Demo.SharedData;

namespace ExpressionParameters
{
    public partial class mainForm: System.Windows.Forms.Form
    {
        private FlexCel.Report.FlexCelReport ordersReport;

        public mainForm()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, System.EventArgs e)
        {
            AutoRun();
        }

        public void AutoRun()
        {
            using (FlexCelReport ordersReport = SharedData.CreateReport())
            {
                ordersReport.SetValue("Date", DateTime.Now);

                string DataPath = Path.Combine(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), ".."), "..") + Path.DirectorySeparatorChar;

                if (saveFileDialog1.ShowDialog() == DialogResult.OK)
                {
                    ordersReport.Run(DataPath + "Expression Parameters.template.xls", saveFileDialog1.FileName);

                    if (MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) == DialogResult.Yes)
                    {
                        using (Process p = new Process())
                        {
                            p.StartInfo.FileName = saveFileDialog1.FileName;
                            p.StartInfo.UseShellExecute = true;
                            p.Start();
                        }
                    }
                }
            }
        }

        private void btnCancel_Click(object sender, System.EventArgs e)
        {
            Close();
        }
    }

}

Form1.Designer.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using System.Diagnostics;
using System.Reflection;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using FlexCel.Report;
using FlexCel.Demo.SharedData;
namespace ExpressionParameters
{
    public partial class mainForm: System.Windows.Forms.Form
    {
        private System.Windows.Forms.Button button1;
        private System.Windows.Forms.SaveFileDialog saveFileDialog1;
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.Button btnCancel;
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.Container components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.button1 = new System.Windows.Forms.Button();
            this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog();
            this.ordersReport = new FlexCel.Report.FlexCelReport();
            this.label1 = new System.Windows.Forms.Label();
            this.btnCancel = new System.Windows.Forms.Button();
            this.SuspendLayout();
            //
            // button1
            //
            this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.button1.BackColor = System.Drawing.Color.Green;
            this.button1.ForeColor = System.Drawing.Color.White;
            this.button1.Location = new System.Drawing.Point(152, 88);
            this.button1.Name = "button1";
            this.button1.Size = new System.Drawing.Size(112, 23);
            this.button1.TabIndex = 0;
            this.button1.Text = "GO!";
            this.button1.Click += new System.EventHandler(this.button1_Click);
            //
            // saveFileDialog1
            //
            this.saveFileDialog1.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm|Excel 97/2003|*.xls|Excel 2007|*.xlsx;*.xlsm|All files|*.*";
            this.saveFileDialog1.RestoreDirectory = true;
            //
            // ordersReport
            //
            this.ordersReport.DeleteEmptyRanges = false;
            this.ordersReport.ErrorActions = FlexCel.Report.TErrorActions.None;
            //
            // label1
            //
            this.label1.Location = new System.Drawing.Point(24, 24);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(288, 24);
            this.label1.TabIndex = 2;
            this.label1.Text = "A report with parameters in Expressions";
            //
            // btnCancel
            //
            this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.btnCancel.BackColor = System.Drawing.Color.FromArgb(((System.Byte)(192)), ((System.Byte)(0)), ((System.Byte)(0)));
            this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            this.btnCancel.ForeColor = System.Drawing.Color.White;
            this.btnCancel.Location = new System.Drawing.Point(272, 88);
            this.btnCancel.Name = "btnCancel";
            this.btnCancel.Size = new System.Drawing.Size(112, 23);
            this.btnCancel.TabIndex = 3;
            this.btnCancel.Text = "Cancel";
            this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
            //
            // mainForm
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(416, 133);
            this.Controls.Add(this.btnCancel);
            this.Controls.Add(this.label1);
            this.Controls.Add(this.button1);
            this.Name = "mainForm";
            this.Text = "Expression Parameters  Report";
            this.ResumeLayout(false);

        }
        #endregion
    }
}

Program.cs

using System;
using System.Windows.Forms;

namespace ExpressionParameters
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new mainForm());
        }
    }
}


Intelligent page breaks in reports (C# / netframework) | FlexCel Studio for the .NET Framework documentation

Intelligent page breaks in reports (C# / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\csharp\VS2022\netframework\20.Reports\51.Intelligent Page Breaks In Reports and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​csharp/​VS2022/​netframework/​Modules/​20.​Reports/​51.​Intelligent Page Breaks In Reports

Overview

Intelligent page breaks are a FlexCel feature that lets you keep together selected rows when printing.

In this demo we will see how to use them on a report.

Make sure to read the conceptual documentation about Intelligent Page Breaks to better understand what we are doing here.

Concepts

  • How to create Multi-level "keep together" ranges. In most reports one level is normally enough, but in master detail cases or situations like this one, you might need more than one.

  • Take a look at the "keeprows_x_" named ranges in the template. Those are the ranges you use to tell FlexCel which rows to keep together. To have an interesting data sample for our demo, we will write a chart of the customers only if they are from Germany or USA.

  • In this example, we want to keep full customers in the same page. But if that isn't possible, we would like the chart not to split in the middle of a page break. That is why we defined a "keeprows_2_" inside "keeprows_1_" protecting the chart. You can see an example of how this works at pages 43-44 when doing a print preview. The chart is completely in a page 44, instead of half in 43 and half in the 44. If you remove the "keeprows_2_" range from the template you will see how that would be otherwise.

Files

AssemblyInfo.cs

using System.Reflection;
using System.Runtime.CompilerServices;

//
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
//
[assembly: AssemblyTitle("")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("(c) 2002 - 2024 TMS Software")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

//
// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version
//      Build Number
//      Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:

[assembly: AssemblyVersion("7.21.0.0")]

//
// In order to sign your assembly you must specify a key to use. Refer to the
// Microsoft .NET Framework documentation for more information on assembly signing.
//
// Use the attributes below to control which key is used for signing.
//
// Notes:
//   (*) If no key is specified, the assembly is not signed.
//   (*) KeyName refers to a key that has been installed in the Crypto Service
//       Provider (CSP) on your machine. KeyFile refers to a file which contains
//       a key.
//   (*) If the KeyFile and the KeyName values are both specified, the
//       following processing occurs:
//       (1) If the KeyName can be found in the CSP, that key is used.
//       (2) If the KeyName does not exist and the KeyFile does exist, the key
//           in the KeyFile is installed into the CSP and used.
//   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
//       When specifying the KeyFile, the location of the KeyFile should be
//       relative to the project output directory which is
//       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
//       located in the project directory, you would specify the AssemblyKeyFile
//       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
//   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
//       documentation for more information on this.
//
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]
[assembly: AssemblyKeyName("")]

Form1.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using System.Diagnostics;
using System.Reflection;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using FlexCel.Report;
using FlexCel.Demo.SharedData;

namespace IntelligentPageBreaksInReports
{
    /// <summary>
    /// How to keep things together when doing reports.
    /// </summary>
    public partial class mainForm: System.Windows.Forms.Form
    {
        public mainForm()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, System.EventArgs e)
        {
            AutoRun();
        }

        public void AutoRun()
        {
            using (FlexCelReport ordersReport = SharedData.CreateReport())
            {
                ordersReport.SetValue("Date", DateTime.Now);

                string DataPath = Path.Combine(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), ".."), "..") + Path.DirectorySeparatorChar;

                if (saveFileDialog1.ShowDialog() == DialogResult.OK)
                {
                    ordersReport.Run(DataPath + "Intelligent Page Breaks In Reports.template" + Path.GetExtension(saveFileDialog1.FileName), saveFileDialog1.FileName);

                    if (MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) == DialogResult.Yes)
                    {
                        using (Process p = new Process())
                        {
                            p.StartInfo.FileName = saveFileDialog1.FileName;
                            p.StartInfo.UseShellExecute = true;
                            p.Start();
                        }
                    }
                }
            }
        }

        private void btnCancel_Click(object sender, System.EventArgs e)
        {
            Close();
        }
    }

}

Form1.Designer.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using System.Diagnostics;
using System.Reflection;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using FlexCel.Report;
using FlexCel.Demo.SharedData;
namespace IntelligentPageBreaksInReports
{
    public partial class mainForm: System.Windows.Forms.Form
    {
        private System.Windows.Forms.Button button1;
        private System.Windows.Forms.SaveFileDialog saveFileDialog1;
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.Button btnCancel;
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.Container components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.button1 = new System.Windows.Forms.Button();
            this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog();
            this.label1 = new System.Windows.Forms.Label();
            this.btnCancel = new System.Windows.Forms.Button();
            this.SuspendLayout();
            //
            // button1
            //
            this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.button1.BackColor = System.Drawing.Color.Green;
            this.button1.ForeColor = System.Drawing.Color.White;
            this.button1.Location = new System.Drawing.Point(152, 88);
            this.button1.Name = "button1";
            this.button1.Size = new System.Drawing.Size(112, 23);
            this.button1.TabIndex = 0;
            this.button1.Text = "GO!";
            this.button1.Click += new System.EventHandler(this.button1_Click);
            //
            // saveFileDialog1
            //
            this.saveFileDialog1.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm|Excel 97/2003|*.xls|Excel 2007|*.xlsx;*.xlsm|All files|*.*";
            this.saveFileDialog1.RestoreDirectory = true;
            //
            // label1
            //
            this.label1.Location = new System.Drawing.Point(24, 24);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(288, 24);
            this.label1.TabIndex = 2;
            this.label1.Text = "A small example on a multilevel \"keep together\" report";
            //
            // btnCancel
            //
            this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.btnCancel.BackColor = System.Drawing.Color.FromArgb(((System.Byte)(192)), ((System.Byte)(0)), ((System.Byte)(0)));
            this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            this.btnCancel.ForeColor = System.Drawing.Color.White;
            this.btnCancel.Location = new System.Drawing.Point(272, 88);
            this.btnCancel.Name = "btnCancel";
            this.btnCancel.Size = new System.Drawing.Size(112, 23);
            this.btnCancel.TabIndex = 3;
            this.btnCancel.Text = "Cancel";
            this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
            //
            // mainForm
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(416, 133);
            this.Controls.Add(this.btnCancel);
            this.Controls.Add(this.label1);
            this.Controls.Add(this.button1);
            this.Name = "mainForm";
            this.Text = "Intelligent Page Breaks In  Reports";
            this.ResumeLayout(false);

        }
        #endregion
    }
}

Program.cs

using System;
using System.Windows.Forms;

namespace IntelligentPageBreaksInReports
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new mainForm());
        }
    }
}


Debugging reports (C# / netframework) | FlexCel Studio for the .NET Framework documentation

Debugging reports (C# / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\csharp\VS2022\netframework\20.Reports\52.Debugging Reports and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​csharp/​VS2022/​netframework/​Modules/​20.​Reports/​52.​Debugging Reports

Overview

As you have seen in the previous demos, tags can get complex once you start nesting them one inside the other to get a result. This demo shows how to investigate expressions on your report, and deal with bugs in your expressions by looking at what is going on inside the hood. Make sure you read Debugging Reports in the Report designer's guide for more in depth information.

Concepts

  • How to use the <#debug> tag in the config sheet to activate debug mode. Note that we could get the same effect by setting FlexCelReport.DebugExpressions and FlexCelReport.ErrorsInResultFile.

Files

AssemblyInfo.cs

using System.Reflection;
using System.Runtime.CompilerServices;

//
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
//
[assembly: AssemblyTitle("")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("(c) 2002 - 2024 TMS Software")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

//
// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version
//      Build Number
//      Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:

[assembly: AssemblyVersion("7.21.0.0")]

//
// In order to sign your assembly you must specify a key to use. Refer to the
// Microsoft .NET Framework documentation for more information on assembly signing.
//
// Use the attributes below to control which key is used for signing.
//
// Notes:
//   (*) If no key is specified, the assembly is not signed.
//   (*) KeyName refers to a key that has been installed in the Crypto Service
//       Provider (CSP) on your machine. KeyFile refers to a file which contains
//       a key.
//   (*) If the KeyFile and the KeyName values are both specified, the
//       following processing occurs:
//       (1) If the KeyName can be found in the CSP, that key is used.
//       (2) If the KeyName does not exist and the KeyFile does exist, the key
//           in the KeyFile is installed into the CSP and used.
//   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
//       When specifying the KeyFile, the location of the KeyFile should be
//       relative to the project output directory which is
//       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
//       located in the project directory, you would specify the AssemblyKeyFile
//       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
//   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
//       documentation for more information on this.
//
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]
[assembly: AssemblyKeyName("")]

Form1.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using System.Diagnostics;
using System.Reflection;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using FlexCel.Report;

namespace DebuggingReports
{
    /// <summary>
    /// How to debug a report.
    /// </summary>
    public partial class mainForm: System.Windows.Forms.Form
    {
        public mainForm()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, System.EventArgs e)
        {
            AutoRun();
        }

        private FlexCelReport CreateReport()
        {
            FlexCelReport Result = new FlexCelReport(true);

            Result.SetValue("test", 3);
            Result.SetValue("tagval", 1);
            Result.SetValue("refval", "l");

            //Here we will add a dummy table with some fantasy values
            DataTable dt = new DataTable("testdb");
            dt.Columns.Add("key", typeof(int));
            dt.Columns.Add("data", typeof(string));
            dt.Rows.Add(new object[] { 5, "cat" });
            dt.Rows.Add(new object[] { 6, "dog" });
            Result.AddTable("testdb", dt, TDisposeMode.DisposeAfterRun);

            return Result;
        }

        public void AutoRun()
        {
            using (FlexCelReport Report = CreateReport())
            {
                string DataPath = Path.Combine(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), ".."), "..") + Path.DirectorySeparatorChar;

                if (saveFileDialog1.ShowDialog() == DialogResult.OK)
                {
                    Report.Run(DataPath + "Debugging Reports.template.xls", saveFileDialog1.FileName);

                    if (MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) == DialogResult.Yes)
                    {
                        using (Process p = new Process())
                        {
                            p.StartInfo.FileName = saveFileDialog1.FileName;
                            p.StartInfo.UseShellExecute = true;
                            p.Start();
                        }
                    }
                }
            }
        }

        private void btnCancel_Click(object sender, System.EventArgs e)
        {
            Close();
        }
    }

}

Form1.Designer.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using System.Diagnostics;
using System.Reflection;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using FlexCel.Report;
namespace DebuggingReports
{
    public partial class mainForm: System.Windows.Forms.Form
    {
        private System.Windows.Forms.Button button1;
        private System.Windows.Forms.SaveFileDialog saveFileDialog1;
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.Button btnCancel;
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.Container components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.button1 = new System.Windows.Forms.Button();
            this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog();
            this.label1 = new System.Windows.Forms.Label();
            this.btnCancel = new System.Windows.Forms.Button();
            this.SuspendLayout();
            //
            // button1
            //
            this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.button1.BackColor = System.Drawing.Color.Green;
            this.button1.ForeColor = System.Drawing.Color.White;
            this.button1.Location = new System.Drawing.Point(152, 88);
            this.button1.Name = "button1";
            this.button1.Size = new System.Drawing.Size(112, 23);
            this.button1.TabIndex = 0;
            this.button1.Text = "GO!";
            this.button1.Click += new System.EventHandler(this.button1_Click);
            //
            // saveFileDialog1
            //
            this.saveFileDialog1.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm|Excel 97/2003|*.xls|Excel 2007|*.xlsx;*.xlsm|All files|*.*";
            this.saveFileDialog1.RestoreDirectory = true;
            //
            // label1
            //
            this.label1.Location = new System.Drawing.Point(24, 24);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(288, 24);
            this.label1.TabIndex = 2;
            this.label1.Text = "A demo showing how to debug reports";
            //
            // btnCancel
            //
            this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.btnCancel.BackColor = System.Drawing.Color.FromArgb(((System.Byte)(192)), ((System.Byte)(0)), ((System.Byte)(0)));
            this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            this.btnCancel.ForeColor = System.Drawing.Color.White;
            this.btnCancel.Location = new System.Drawing.Point(272, 88);
            this.btnCancel.Name = "btnCancel";
            this.btnCancel.Size = new System.Drawing.Size(112, 23);
            this.btnCancel.TabIndex = 3;
            this.btnCancel.Text = "Cancel";
            this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
            //
            // mainForm
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(416, 133);
            this.Controls.Add(this.btnCancel);
            this.Controls.Add(this.label1);
            this.Controls.Add(this.button1);
            this.Name = "mainForm";
            this.Text = "Debugging  Reports";
            this.ResumeLayout(false);

        }
        #endregion
    }
}

Program.cs

using System;
using System.Windows.Forms;

namespace DebuggingReports
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new mainForm());
        }
    }
}


Fixed forms with datasets (C# / netframework) | FlexCel Studio for the .NET Framework documentation

Fixed forms with datasets (C# / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\csharp\VS2022\netframework\20.Reports\55.Fixed Forms With Datasets and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​csharp/​VS2022/​netframework/​Modules/​20.​Reports/​55.​Fixed Forms With Datasets

Overview

Sometimes you need to have a normal entry form, but a part of that form is a table from a dataset. Under normal FlexCel mode, the rows will be inserted, and the bottom of the form moved down, and this is what you normally would like. But using __dataset__FIXED ranges, you can create a band that will not insert any row, keeping the format of the form unchanged. Look at Fixed Bands in the Reports designer guide for more information.

Concepts

  • How to create bands that do not insert rows.

  • How to use the "TOP" tag to filter the top 10 items in the list. (look at Retrieving TOP N Records from a table in the Reports designer guide) Note: The top tag is not recommended as a general way to filter datasets. If for example you need 10 records from a dataset, with this tag you will still retrieve the full table from the database. Whenever possible, you must filter at the data layer level, avoiding retrieving those records at all.

Files

AssemblyInfo.cs

using System.Reflection;
using System.Runtime.CompilerServices;

//
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
//
[assembly: AssemblyTitle("")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("(c) 2002 - 2024 TMS Software")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

//
// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version
//      Build Number
//      Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:

[assembly: AssemblyVersion("7.21.0.0")]

//
// In order to sign your assembly you must specify a key to use. Refer to the
// Microsoft .NET Framework documentation for more information on assembly signing.
//
// Use the attributes below to control which key is used for signing.
//
// Notes:
//   (*) If no key is specified, the assembly is not signed.
//   (*) KeyName refers to a key that has been installed in the Crypto Service
//       Provider (CSP) on your machine. KeyFile refers to a file which contains
//       a key.
//   (*) If the KeyFile and the KeyName values are both specified, the
//       following processing occurs:
//       (1) If the KeyName can be found in the CSP, that key is used.
//       (2) If the KeyName does not exist and the KeyFile does exist, the key
//           in the KeyFile is installed into the CSP and used.
//   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
//       When specifying the KeyFile, the location of the KeyFile should be
//       relative to the project output directory which is
//       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
//       located in the project directory, you would specify the AssemblyKeyFile
//       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
//   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
//       documentation for more information on this.
//
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]
[assembly: AssemblyKeyName("")]

Form1.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using System.Diagnostics;
using System.Reflection;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using FlexCel.Report;
using FlexCel.Demo.SharedData;

namespace FixedFormsWithDatasets
{
    /// <summary>
    /// Form-Like reports
    /// </summary>
    public partial class mainForm: System.Windows.Forms.Form
    {

        public mainForm()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, System.EventArgs e)
        {
            AutoRun();
        }

        public void AutoRun()
        {
            using (FlexCelReport ordersReport = SharedData.CreateReport())
            {
                ordersReport.SetValue("Date", DateTime.Now);

                string DataPath = Path.Combine(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), ".."), "..") + Path.DirectorySeparatorChar;

                if (saveFileDialog1.ShowDialog() == DialogResult.OK)
                {
                    ordersReport.Run(DataPath + "Fixed Forms With Datasets.template.xls", saveFileDialog1.FileName);

                    if (MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) == DialogResult.Yes)
                    {
                        using (Process p = new Process())
                        {
                            p.StartInfo.FileName = saveFileDialog1.FileName;
                            p.StartInfo.UseShellExecute = true;
                            p.Start();
                        }
                    }
                }
            }
        }

        private void btnCancel_Click(object sender, System.EventArgs e)
        {
            Close();
        }
    }

}

Form1.Designer.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using System.Diagnostics;
using System.Reflection;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using FlexCel.Report;
using FlexCel.Demo.SharedData;
namespace FixedFormsWithDatasets
{
    public partial class mainForm: System.Windows.Forms.Form
    {
        private System.Windows.Forms.Button button1;
        private System.Windows.Forms.SaveFileDialog saveFileDialog1;
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.Button btnCancel;
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.Container components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.button1 = new System.Windows.Forms.Button();
            this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog();
            this.label1 = new System.Windows.Forms.Label();
            this.btnCancel = new System.Windows.Forms.Button();
            this.SuspendLayout();
            //
            // button1
            //
            this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.button1.BackColor = System.Drawing.Color.Green;
            this.button1.ForeColor = System.Drawing.Color.White;
            this.button1.Location = new System.Drawing.Point(152, 88);
            this.button1.Name = "button1";
            this.button1.Size = new System.Drawing.Size(112, 23);
            this.button1.TabIndex = 0;
            this.button1.Text = "GO!";
            this.button1.UseVisualStyleBackColor = false;
            this.button1.Click += new System.EventHandler(this.button1_Click);
            //
            // saveFileDialog1
            //
            this.saveFileDialog1.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm|Excel 97/2003|*.xls|Excel 2007|*.xlsx;*.xlsm|All files|*.*";
            this.saveFileDialog1.RestoreDirectory = true;
            //
            // label1
            //
            this.label1.Location = new System.Drawing.Point(24, 24);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(288, 24);
            this.label1.TabIndex = 2;
            this.label1.Text = "A form with a table inside";
            //
            // btnCancel
            //
            this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.btnCancel.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
            this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            this.btnCancel.ForeColor = System.Drawing.Color.White;
            this.btnCancel.Location = new System.Drawing.Point(272, 88);
            this.btnCancel.Name = "btnCancel";
            this.btnCancel.Size = new System.Drawing.Size(112, 23);
            this.btnCancel.TabIndex = 3;
            this.btnCancel.Text = "Cancel";
            this.btnCancel.UseVisualStyleBackColor = false;
            this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
            //
            // mainForm
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(416, 133);
            this.Controls.Add(this.btnCancel);
            this.Controls.Add(this.label1);
            this.Controls.Add(this.button1);
            this.Name = "mainForm";
            this.Text = "Fixed Form  Report";
            this.ResumeLayout(false);

        }
        #endregion
    }
}

Program.cs

using System;
using System.Windows.Forms;

namespace FixedFormsWithDatasets
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new mainForm());
        }
    }
}


Balanced columns (C# / netframework) | FlexCel Studio for the .NET Framework documentation

Balanced columns (C# / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\csharp\VS2022\netframework\20.Reports\57.Balanced Columns and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​csharp/​VS2022/​netframework/​Modules/​20.​Reports/​57.​Balanced Columns

Overview

The FlexCel reporting engine will automatically balance the ranges that are inside a master range so the master range will stay in place. You can use this feature for creating master detail reports with balanced columns inside (where the master will grow to cover the longest column), or use a fake "master" report to ensure the columns inside the report have the same number of rows.

Concepts

  • How to create a master detail report with detail columns, and where the master grows with the biggest of the columns. In columns where the number is less, the last cell of the column will be copied to fill the missing rows, so all columns have the same height.

  • How to use Fixed N Bands to avoid having empty rows at the end of each master record.

  • How to use the "ROWS" function in the config sheet (see Creating empty datasets with N rows) to create a database with a single row, that you can use as a master from the main report, and so ensure balanced columns.

For more information in balanced columns please take a look at the section Fixed N Bands in the Reports designer's guide.

Files

AssemblyInfo.cs

using System.Reflection;
using System.Runtime.CompilerServices;

//
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
//
[assembly: AssemblyTitle("")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("(c) 2002 - 2024 TMS Software")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

//
// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version
//      Build Number
//      Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:

[assembly: AssemblyVersion("7.21.0.0")]

//
// In order to sign your assembly you must specify a key to use. Refer to the
// Microsoft .NET Framework documentation for more information on assembly signing.
//
// Use the attributes below to control which key is used for signing.
//
// Notes:
//   (*) If no key is specified, the assembly is not signed.
//   (*) KeyName refers to a key that has been installed in the Crypto Service
//       Provider (CSP) on your machine. KeyFile refers to a file which contains
//       a key.
//   (*) If the KeyFile and the KeyName values are both specified, the
//       following processing occurs:
//       (1) If the KeyName can be found in the CSP, that key is used.
//       (2) If the KeyName does not exist and the KeyFile does exist, the key
//           in the KeyFile is installed into the CSP and used.
//   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
//       When specifying the KeyFile, the location of the KeyFile should be
//       relative to the project output directory which is
//       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
//       located in the project directory, you would specify the AssemblyKeyFile
//       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
//   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
//       documentation for more information on this.
//
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]
[assembly: AssemblyKeyName("")]

Form1.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using System.Diagnostics;
using System.Reflection;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using FlexCel.Report;
using FlexCel.Demo.SharedData;

namespace BalancedColumns
{
    /// <summary>
    /// Form-Like reports
    /// </summary>
    public partial class mainForm: System.Windows.Forms.Form
    {

        public mainForm()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, System.EventArgs e)
        {
            AutoRun();
        }

        public void AutoRun()
        {
            using (FlexCelReport report = SharedData.CreateReport())
            {
                string DataPath = Path.Combine(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), ".."), "..") + Path.DirectorySeparatorChar;

                if (saveFileDialog1.ShowDialog() == DialogResult.OK)
                {
                    report.Run(DataPath + "Balanced Columns.template.xls", saveFileDialog1.FileName);

                    if (MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) == DialogResult.Yes)
                    {
                        using (Process p = new Process())
                        {
                            p.StartInfo.FileName = saveFileDialog1.FileName;
                            p.StartInfo.UseShellExecute = true;
                            p.Start();
                        }
                    }
                }
            }
        }

        private void btnCancel_Click(object sender, System.EventArgs e)
        {
            Close();
        }
    }

}

Form1.Designer.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using System.Diagnostics;
using System.Reflection;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using FlexCel.Report;
using FlexCel.Demo.SharedData;
namespace BalancedColumns
{
    public partial class mainForm: System.Windows.Forms.Form
    {
        private System.Windows.Forms.Button button1;
        private System.Windows.Forms.SaveFileDialog saveFileDialog1;
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.Button btnCancel;
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.Container components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.button1 = new System.Windows.Forms.Button();
            this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog();
            this.label1 = new System.Windows.Forms.Label();
            this.btnCancel = new System.Windows.Forms.Button();
            this.SuspendLayout();
            //
            // button1
            //
            this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.button1.BackColor = System.Drawing.Color.Green;
            this.button1.ForeColor = System.Drawing.Color.White;
            this.button1.Location = new System.Drawing.Point(152, 88);
            this.button1.Name = "button1";
            this.button1.Size = new System.Drawing.Size(112, 23);
            this.button1.TabIndex = 0;
            this.button1.Text = "GO!";
            this.button1.UseVisualStyleBackColor = false;
            this.button1.Click += new System.EventHandler(this.button1_Click);
            //
            // saveFileDialog1
            //
            this.saveFileDialog1.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm|Excel 97/2003|*.xls|Excel 2007|*.xlsx;*.xlsm|All files|*.*";
            this.saveFileDialog1.RestoreDirectory = true;
            //
            // label1
            //
            this.label1.Location = new System.Drawing.Point(24, 24);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(288, 24);
            this.label1.TabIndex = 2;
            this.label1.Text = "A report with side-by-side columns with different lenghts.";
            //
            // btnCancel
            //
            this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.btnCancel.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
            this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            this.btnCancel.ForeColor = System.Drawing.Color.White;
            this.btnCancel.Location = new System.Drawing.Point(272, 88);
            this.btnCancel.Name = "btnCancel";
            this.btnCancel.Size = new System.Drawing.Size(112, 23);
            this.btnCancel.TabIndex = 3;
            this.btnCancel.Text = "Cancel";
            this.btnCancel.UseVisualStyleBackColor = false;
            this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
            //
            // mainForm
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(416, 133);
            this.Controls.Add(this.btnCancel);
            this.Controls.Add(this.label1);
            this.Controls.Add(this.button1);
            this.Name = "mainForm";
            this.Text = "Balanced Columns";
            this.ResumeLayout(false);

        }
        #endregion
    }
}

Program.cs

using System;
using System.Windows.Forms;

namespace BalancedColumns
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new mainForm());
        }
    }
}


Join and Union (C# / netframework) | FlexCel Studio for the .NET Framework documentation

Join and Union (C# / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\csharp\VS2022\netframework\20.Reports\58.Join and Union and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​csharp/​VS2022/​netframework/​Modules/​20.​Reports/​58.​Join and Union

Overview

Sometimes you want to run unrelated reports in columns. One option is to run them as "_" ranges instead of "__" (see the Balanced Columns example). But this will break merged cells and ranges might not expand (see Joining Tables in the Report Designers guide). So other option is to "join" those unrelated tables into a single table, and run a single "__" range.

Also shown in this example is how to do a Union of Tables.

Concepts

  • How to join unrelated tables into a bigger table. In this example we join Categories, Products and Shippers into a single table (CSP) which we use to run the report.

  • How to access the fields of the joined table. If the joined tables have different column names, you can access those fields directly. For example, we write "<#CSP.CategoryName>" and this will access the column CategoryName of the Categories table in the CSP table, as none of the other joined tables has a similar column. But when we want to access CategoryId, that column is present in both Categories and Products. So we need to explicitly write the table name after CSP and before CategoryID. In this example, <#CSP.Products.CategoryId> references the column CategoryId of the table Prodcuts, and not Categories.

  • It might be a good idea to always prefix the table being accessed when using a joined table. In this example we write <#CSP.Shippers.CompanyName> even when CompanyName is not in the other tables and we could just write <#CSP.CompanyName>. But somehow writing the full name will make it more future proof, not breaking if we later add another table. As in this example we wanted to show both variants, we used both forms (the short one: <#CSP.CategoryName> and the long one: <#CSP.Shippers.CompanyName>) But depending on your case and if there are chances of column names being the same, you might want to just use only the long form.

  • How to use the "UNION" function to append the records of one table after another. In this example we do a union of Suppliers, Shippers and Customers and write the phone numbers of all of them into a single table.

For more information in balanced columns please take a look at the sections Joining Tables and Union of Tables in the Report Designers guide.

Files

AssemblyInfo.cs

using System.Reflection;
using System.Runtime.CompilerServices;

//
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
//
[assembly: AssemblyTitle("")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("(c) 2002 - 2024 TMS Software")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

//
// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version
//      Build Number
//      Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:

[assembly: AssemblyVersion("7.21.0.0")]

//
// In order to sign your assembly you must specify a key to use. Refer to the
// Microsoft .NET Framework documentation for more information on assembly signing.
//
// Use the attributes below to control which key is used for signing.
//
// Notes:
//   (*) If no key is specified, the assembly is not signed.
//   (*) KeyName refers to a key that has been installed in the Crypto Service
//       Provider (CSP) on your machine. KeyFile refers to a file which contains
//       a key.
//   (*) If the KeyFile and the KeyName values are both specified, the
//       following processing occurs:
//       (1) If the KeyName can be found in the CSP, that key is used.
//       (2) If the KeyName does not exist and the KeyFile does exist, the key
//           in the KeyFile is installed into the CSP and used.
//   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
//       When specifying the KeyFile, the location of the KeyFile should be
//       relative to the project output directory which is
//       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
//       located in the project directory, you would specify the AssemblyKeyFile
//       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
//   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
//       documentation for more information on this.
//
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]
[assembly: AssemblyKeyName("")]

Form1.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using System.Diagnostics;
using System.Reflection;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using FlexCel.Report;
using FlexCel.Demo.SharedData;

namespace JoinandUnion
{
    /// <summary>
    /// Form-Like reports
    /// </summary>
    public partial class mainForm: System.Windows.Forms.Form
    {

        public mainForm()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, System.EventArgs e)
        {
            AutoRun();
        }

        public void AutoRun()
        {
            using (FlexCelReport report = SharedData.CreateReport())
            {
                string DataPath = Path.Combine(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), ".."), "..") + Path.DirectorySeparatorChar;

                if (saveFileDialog1.ShowDialog() == DialogResult.OK)
                {
                    report.Run(DataPath + "Join and Union.template.xls", saveFileDialog1.FileName);

                    if (MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) == DialogResult.Yes)
                    {
                        using (Process p = new Process())
                        {
                            p.StartInfo.FileName = saveFileDialog1.FileName;
                            p.StartInfo.UseShellExecute = true;
                            p.Start();
                        }
                    }
                }
            }
        }

        private void btnCancel_Click(object sender, System.EventArgs e)
        {
            Close();
        }
    }

}

Form1.Designer.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using System.Diagnostics;
using System.Reflection;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using FlexCel.Report;
using FlexCel.Demo.SharedData;
namespace JoinandUnion
{
    public partial class mainForm: System.Windows.Forms.Form
    {
        private System.Windows.Forms.Button button1;
        private System.Windows.Forms.SaveFileDialog saveFileDialog1;
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.Button btnCancel;
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.Container components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.button1 = new System.Windows.Forms.Button();
            this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog();
            this.label1 = new System.Windows.Forms.Label();
            this.btnCancel = new System.Windows.Forms.Button();
            this.SuspendLayout();
            //
            // button1
            //
            this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.button1.BackColor = System.Drawing.Color.Green;
            this.button1.ForeColor = System.Drawing.Color.White;
            this.button1.Location = new System.Drawing.Point(279, 162);
            this.button1.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
            this.button1.Name = "button1";
            this.button1.Size = new System.Drawing.Size(205, 42);
            this.button1.TabIndex = 0;
            this.button1.Text = "GO!";
            this.button1.UseVisualStyleBackColor = false;
            this.button1.Click += new System.EventHandler(this.button1_Click);
            //
            // saveFileDialog1
            //
            this.saveFileDialog1.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm|Excel 97/2003|*.xls|Excel 2007|*.xlsx;*.xlsm|All " +
    "files|*.*";
            this.saveFileDialog1.RestoreDirectory = true;
            //
            // label1
            //
            this.label1.Location = new System.Drawing.Point(44, 44);
            this.label1.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(528, 44);
            this.label1.TabIndex = 2;
            this.label1.Text = "A reportshowing JOIN and UNION tags.";
            //
            // btnCancel
            //
            this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.btnCancel.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
            this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            this.btnCancel.ForeColor = System.Drawing.Color.White;
            this.btnCancel.Location = new System.Drawing.Point(499, 162);
            this.btnCancel.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
            this.btnCancel.Name = "btnCancel";
            this.btnCancel.Size = new System.Drawing.Size(205, 42);
            this.btnCancel.TabIndex = 3;
            this.btnCancel.Text = "Cancel";
            this.btnCancel.UseVisualStyleBackColor = false;
            this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
            //
            // mainForm
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(11F, 24F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(763, 246);
            this.Controls.Add(this.btnCancel);
            this.Controls.Add(this.label1);
            this.Controls.Add(this.button1);
            this.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
            this.Name = "mainForm";
            this.Text = "Join and Union";
            this.ResumeLayout(false);

        }
        #endregion
    }
}

Program.cs

using System;
using System.Windows.Forms;

namespace JoinandUnion
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new mainForm());
        }
    }
}


Templates in the executable (C# / netframework) | FlexCel Studio for the .NET Framework documentation

Templates in the executable (C# / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\csharp\VS2022\netframework\20.Reports\60.Templates On The Exe and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​csharp/​VS2022/​netframework/​Modules/​20.​Reports/​60.​Templates On The Exe

Overview

Sometimes you might want to distribute your templates embedded in your application, instead of shipping the separately.

Concepts

  • How to embed a template directly in the exe file. For step-by-step instructions please read Embedding Excel files in your application

  • Dealing with includes. Included files are normally searched on the same path as the original file, but here, as we are reading from a stream, we must tell FlexCel where to find the embedded template. This is done with the FlexCelReport.GetInclude event.

  • While here we show how to use a stream to read a template from the executable, you can use a very similar approach to store your templates on a database, or on any place you like. Just call the FlexCelReport.Run with a stream with your data, and assign the FlexCelReport.GetInclude event to assign the data for the included files.

Files

AssemblyInfo.cs

using System.Reflection;
using System.Runtime.CompilerServices;

//
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
//
[assembly: AssemblyTitle("")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("(c) 2002 - 2024 TMS Software")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

//
// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version
//      Build Number
//      Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:

[assembly: AssemblyVersion("7.21.0.0")]

//
// In order to sign your assembly you must specify a key to use. Refer to the
// Microsoft .NET Framework documentation for more information on assembly signing.
//
// Use the attributes below to control which key is used for signing.
//
// Notes:
//   (*) If no key is specified, the assembly is not signed.
//   (*) KeyName refers to a key that has been installed in the Crypto Service
//       Provider (CSP) on your machine. KeyFile refers to a file which contains
//       a key.
//   (*) If the KeyFile and the KeyName values are both specified, the
//       following processing occurs:
//       (1) If the KeyName can be found in the CSP, that key is used.
//       (2) If the KeyName does not exist and the KeyFile does exist, the key
//           in the KeyFile is installed into the CSP and used.
//   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
//       When specifying the KeyFile, the location of the KeyFile should be
//       relative to the project output directory which is
//       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
//       located in the project directory, you would specify the AssemblyKeyFile
//       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
//   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
//       documentation for more information on this.
//
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]
[assembly: AssemblyKeyName("")]

Form1.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using System.Diagnostics;
using System.Reflection;
using System.Resources;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using FlexCel.Report;
using FlexCel.Demo.SharedData;

namespace TemplatesOnTheExe
{
    /// <summary>
    /// How to embed the reports in the executable, including "included" reports.
    /// </summary>
    public partial class mainForm: System.Windows.Forms.Form
    {

        public mainForm()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, System.EventArgs e)
        {
            AutoRun();
        }

        public void AutoRun()
        {
            using (FlexCelReport ordersReport = SharedData.CreateReport())
            {
                ordersReport.GetInclude += new GetIncludeEventHandler(ordersReport_GetInclude);
                ordersReport.SetValue("Date", DateTime.Now);

                if (saveFileDialog1.ShowDialog() == DialogResult.OK)
                {
                    Assembly a = Assembly.GetExecutingAssembly();
                    using (Stream InStream = a.GetManifestResourceStream("TemplatesOnTheExe.Templates.Templates On The Exe.template.xls"))
                    {
                        using (FileStream OutStream = new FileStream(saveFileDialog1.FileName, FileMode.Create))
                        {
                            ordersReport.Run(InStream, OutStream);
                        }
                    }

                    if (MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) == DialogResult.Yes)
                    {
                        using (Process p = new Process())
                        {
                            p.StartInfo.FileName = saveFileDialog1.FileName;
                            p.StartInfo.UseShellExecute = true;
                            p.Start();
                        }
                    }
                }
            }

        }

        private void btnCancel_Click(object sender, System.EventArgs e)
        {
            Close();
        }

        private void ordersReport_GetInclude(object sender, FlexCel.Report.GetIncludeEventArgs e)
        {
            Assembly a = Assembly.GetExecutingAssembly();
            using (Stream InStream = a.GetManifestResourceStream("TemplatesOnTheExe.Templates." + e.FileName))
            {
                byte[] data = new byte[InStream.Length];
                InStream.Position = 0;
                InStream.Read(data, 0, data.Length);
                e.IncludeData = data;
            }
        }
    }

}

Form1.Designer.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using System.Diagnostics;
using System.Reflection;
using System.Resources;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using FlexCel.Report;
using FlexCel.Demo.SharedData;
namespace TemplatesOnTheExe
{
    public partial class mainForm: System.Windows.Forms.Form
    {
        private System.Windows.Forms.Button button1;
        private System.Windows.Forms.SaveFileDialog saveFileDialog1;
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.Button btnCancel;
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.Container components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.button1 = new System.Windows.Forms.Button();
            this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog();
            this.label1 = new System.Windows.Forms.Label();
            this.btnCancel = new System.Windows.Forms.Button();
            this.SuspendLayout();
            //
            // button1
            //
            this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.button1.BackColor = System.Drawing.Color.Green;
            this.button1.ForeColor = System.Drawing.Color.White;
            this.button1.Location = new System.Drawing.Point(152, 88);
            this.button1.Name = "button1";
            this.button1.Size = new System.Drawing.Size(112, 23);
            this.button1.TabIndex = 0;
            this.button1.Text = "GO!";
            this.button1.UseVisualStyleBackColor = false;
            this.button1.Click += new System.EventHandler(this.button1_Click);
            //
            // saveFileDialog1
            //
            this.saveFileDialog1.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm|Excel 97/2003|*.xls|Excel 2007|*.xlsx;*.xlsm|All files|*.*";
            this.saveFileDialog1.RestoreDirectory = true;
            //
            // label1
            //
            this.label1.Location = new System.Drawing.Point(24, 24);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(360, 24);
            this.label1.TabIndex = 2;
            this.label1.Text = "How to read a template from the executable instead of an external file.";
            //
            // btnCancel
            //
            this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.btnCancel.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
            this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            this.btnCancel.ForeColor = System.Drawing.Color.White;
            this.btnCancel.Location = new System.Drawing.Point(272, 88);
            this.btnCancel.Name = "btnCancel";
            this.btnCancel.Size = new System.Drawing.Size(112, 23);
            this.btnCancel.TabIndex = 3;
            this.btnCancel.Text = "Cancel";
            this.btnCancel.UseVisualStyleBackColor = false;
            this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
            //
            // mainForm
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(416, 133);
            this.Controls.Add(this.btnCancel);
            this.Controls.Add(this.label1);
            this.Controls.Add(this.button1);
            this.Name = "mainForm";
            this.Text = "Templates on the exe";
            this.ResumeLayout(false);

        }
        #endregion
    }
}

Program.cs

using System;
using System.Windows.Forms;

namespace TemplatesOnTheExe
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new mainForm());
        }
    }
}


Images (C# / netframework) | FlexCel Studio for the .NET Framework documentation

Images (C# / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\csharp\VS2022\netframework\20.Reports\65.Images and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​csharp/​VS2022/​netframework/​Modules/​20.​Reports/​65.​Images

Overview

Inserting images from a database on a FlexCel report is simple, just insert a blank image and name it as <#table.field>. All the complexity is handled by FlexCel. But when you need more options, there are always things you can do.

Concepts

  • Using the Image Size (<#IMGSIZE(Zoom, AspectRatio)>) tag. This tag only works when written on an image name, and allows you to define which size the inserted image will have. Use this tag only if the image dimension changes on the database. If all images are the same size (most common scenario) just set the size of the image at design time, as it is faster.

  • Using an Alias on the config sheet. As the image name has a small length, we defined the report variables <#Photo>, <Photo100>, etc. on the config sheet.

  • Using the ImgPos, ImgFit and ImgDelete tags. On the second sheet of this report you can see those tags in action.

  • Using the FlexCelReport.GetImageData event. This is a last resort option. If you need to do some further processing on the image, you can do it on this event. The preferred order of option then is:

    1. If all images are the same size and on a standard format, just name the image as <#table.field> and do nothing more.

    2. If you need to adjust dynamically the image dimensions, use Image Size tag. It can be a little slower than 1, as the image has to be processed to calculate its dimensions.

    3. If you need to define a custom image size, or the image is on a proprietary format you need to convert, use FlexCelReport.GetImageData event.

Files

AssemblyInfo.cs

using System.Reflection;
using System.Runtime.CompilerServices;

//
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
//
[assembly: AssemblyTitle("")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("(c) 2002 - 2024 TMS Software")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

//
// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version
//      Build Number
//      Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:

[assembly: AssemblyVersion("7.21.0.0")]

//
// In order to sign your assembly you must specify a key to use. Refer to the
// Microsoft .NET Framework documentation for more information on assembly signing.
//
// Use the attributes below to control which key is used for signing.
//
// Notes:
//   (*) If no key is specified, the assembly is not signed.
//   (*) KeyName refers to a key that has been installed in the Crypto Service
//       Provider (CSP) on your machine. KeyFile refers to a file which contains
//       a key.
//   (*) If the KeyFile and the KeyName values are both specified, the
//       following processing occurs:
//       (1) If the KeyName can be found in the CSP, that key is used.
//       (2) If the KeyName does not exist and the KeyFile does exist, the key
//           in the KeyFile is installed into the CSP and used.
//   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
//       When specifying the KeyFile, the location of the KeyFile should be
//       relative to the project output directory which is
//       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
//       located in the project directory, you would specify the AssemblyKeyFile
//       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
//   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
//       documentation for more information on this.
//
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]
[assembly: AssemblyKeyName("")]

Form1.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using System.Diagnostics;
using System.Reflection;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using FlexCel.Report;
using FlexCel.Demo.SharedData;

namespace Images
{
    /// <summary>
    /// A report with lots of images.
    /// </summary>
    public partial class mainForm: System.Windows.Forms.Form
    {

        public mainForm()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, System.EventArgs e)
        {
            AutoRun();
        }

        public void AutoRun()
        {
            using (FlexCelReport ordersReport = SharedData.CreateReport())
            {
                ordersReport.GetImageData += new GetImageDataEventHandler(ordersReport_GetImageData);
                ordersReport.SetValue("Date", DateTime.Now);

                string DataPath = Path.Combine(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), ".."), "..") + Path.DirectorySeparatorChar;

                if (saveFileDialog1.ShowDialog() == DialogResult.OK)
                {
                    ordersReport.Run(DataPath + "Images.template.xls", saveFileDialog1.FileName);

                    if (MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) == DialogResult.Yes)
                    {
                        using (Process p = new Process())
                        {
                            p.StartInfo.FileName = saveFileDialog1.FileName;
                            p.StartInfo.UseShellExecute = true;
                            p.Start();
                        }
                    }
                }
            }
        }

        private void btnCancel_Click(object sender, System.EventArgs e)
        {
            Close();
        }

        private void ordersReport_GetImageData(object sender, FlexCel.Report.GetImageDataEventArgs e)
        {
            if (String.Compare(e.ImageName, "<#PhotoCode>", true) == 0)
            {
                byte[] RealImageData = ImageUtils.StripOLEHeader(e.ImageData); //On access databases, images are stored with an OLE
                //header that we have to strip to get the real image.
                //This is done automatically by flexcel in most cases,
                //but here we have the original image format.
                using (MemoryStream MemStream = new MemoryStream(RealImageData)) //Keep stream open until bitmap has been used
                {
                    using (Bitmap bmp = new Bitmap(MemStream))
                    {
                        bmp.RotateFlip(RotateFlipType.Rotate90FlipNone);
                        using (MemoryStream OutStream = new MemoryStream())
                        {
                            bmp.Save(OutStream, System.Drawing.Imaging.ImageFormat.Png);
                            e.Width = bmp.Width;
                            e.Height = bmp.Height;
                            e.ImageData = OutStream.ToArray();
                        }
                    }
                }
            }

        }
    }

}

Form1.Designer.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using System.Diagnostics;
using System.Reflection;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using FlexCel.Report;
using FlexCel.Demo.SharedData;
namespace Images
{
    public partial class mainForm: System.Windows.Forms.Form
    {
        private System.Windows.Forms.Button button1;
        private System.Windows.Forms.SaveFileDialog saveFileDialog1;
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.Button btnCancel;
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.Container components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.button1 = new System.Windows.Forms.Button();
            this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog();
            this.label1 = new System.Windows.Forms.Label();
            this.btnCancel = new System.Windows.Forms.Button();
            this.SuspendLayout();
            //
            // button1
            //
            this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.button1.BackColor = System.Drawing.Color.Green;
            this.button1.ForeColor = System.Drawing.Color.White;
            this.button1.Location = new System.Drawing.Point(152, 88);
            this.button1.Name = "button1";
            this.button1.Size = new System.Drawing.Size(112, 23);
            this.button1.TabIndex = 0;
            this.button1.Text = "GO!";
            this.button1.UseVisualStyleBackColor = false;
            this.button1.Click += new System.EventHandler(this.button1_Click);
            //
            // saveFileDialog1
            //
            this.saveFileDialog1.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm|Excel 97/2003|*.xls|Excel 2007|*.xlsx;*.xlsm|All files|*.*";
            this.saveFileDialog1.RestoreDirectory = true;
            //
            // label1
            //
            this.label1.Location = new System.Drawing.Point(24, 24);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(288, 24);
            this.label1.TabIndex = 2;
            this.label1.Text = "Different ways to include images on a report.";
            //
            // btnCancel
            //
            this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.btnCancel.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
            this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            this.btnCancel.ForeColor = System.Drawing.Color.White;
            this.btnCancel.Location = new System.Drawing.Point(272, 88);
            this.btnCancel.Name = "btnCancel";
            this.btnCancel.Size = new System.Drawing.Size(112, 23);
            this.btnCancel.TabIndex = 3;
            this.btnCancel.Text = "Cancel";
            this.btnCancel.UseVisualStyleBackColor = false;
            this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
            //
            // mainForm
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(416, 133);
            this.Controls.Add(this.btnCancel);
            this.Controls.Add(this.label1);
            this.Controls.Add(this.button1);
            this.Name = "mainForm";
            this.Text = "Images";
            this.ResumeLayout(false);

        }
        #endregion
    }
}

Program.cs

using System;
using System.Windows.Forms;

namespace Images
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new mainForm());
        }
    }
}


Charts (C# / netframework) | FlexCel Studio for the .NET Framework documentation

Charts (C# / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\csharp\VS2022\netframework\20.Reports\70.Charts and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​csharp/​VS2022/​netframework/​Modules/​20.​Reports/​70.​Charts

Overview

Some examples of how to create Charts with FlexCel.

Concepts

  • Charts might be difficult: Sometimes Excel goes out of its way guessing what you want to do and what are the cells you want to use. While this is very good in normal situations (Excel almost always gets it right), it gets difficult when you are trying to define a chart out of <#xx.yy> fields. So a nice trick is to write two rows of real data first, define the chart, and after that substitute the first row of real data with <#...> fields. You can leave the second with the test data, because as long as you use x-ranges, it will be deleted.

  • You can't use a <#delete row> tag to remove the extra row. <#delete row> tags are executed from bottom to top, at the same time that the insertions are made. So, the row will be deleted before the actual data is inserted and the range will not expand. To solve this, we now have x-ranges. If you put "X" as the last char on a named range (as in "_Products_X" on this demo), the range will work as a normal one, but after being inserted it will delete the next empty row. (or column if it is a column range)

  • Usually when you create a chart, series remain fixed and the data range expands. But some special charts might need that the data range is fixed and new series are created. For those cases, you can use swap series> tags. Look at the example Charts With Dynamic Series

  • FlexCelReport will not replace <#tags> inside the main title or the x/y axis titles. But you can drop a textbox inside the chart, and this text will be replaced.

  • Try and open the generated xls file with Custom Preview demo. You will see it looks very similar to the the way Excel displays it.

Files

AssemblyInfo.cs

using System.Reflection;
using System.Runtime.CompilerServices;

//
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
//
[assembly: AssemblyTitle("")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("(c) 2002 - 2024 TMS Software")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

//
// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version
//      Build Number
//      Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:

[assembly: AssemblyVersion("7.21.0.0")]

//
// In order to sign your assembly you must specify a key to use. Refer to the
// Microsoft .NET Framework documentation for more information on assembly signing.
//
// Use the attributes below to control which key is used for signing.
//
// Notes:
//   (*) If no key is specified, the assembly is not signed.
//   (*) KeyName refers to a key that has been installed in the Crypto Service
//       Provider (CSP) on your machine. KeyFile refers to a file which contains
//       a key.
//   (*) If the KeyFile and the KeyName values are both specified, the
//       following processing occurs:
//       (1) If the KeyName can be found in the CSP, that key is used.
//       (2) If the KeyName does not exist and the KeyFile does exist, the key
//           in the KeyFile is installed into the CSP and used.
//   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
//       When specifying the KeyFile, the location of the KeyFile should be
//       relative to the project output directory which is
//       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
//       located in the project directory, you would specify the AssemblyKeyFile
//       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
//   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
//       documentation for more information on this.
//
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]
[assembly: AssemblyKeyName("")]

Form1.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using System.Diagnostics;
using System.Reflection;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using FlexCel.Report;
using FlexCel.Demo.SharedData;

namespace Charts
{
    /// <summary>
    /// A report including charts.
    /// </summary>
    public partial class mainForm: System.Windows.Forms.Form
    {

        public mainForm()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, System.EventArgs e)
        {
            AutoRun();
        }

        public void AutoRun()
        {
            using (FlexCelReport ordersReport = SharedData.CreateReport())
            {
                ordersReport.SetValue("Date", DateTime.Now);

                string DataPath = Path.Combine(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), ".."), "..") + Path.DirectorySeparatorChar;

                if (saveFileDialog1.ShowDialog() == DialogResult.OK)
                {
                    ordersReport.Run(DataPath + "Charts.template.xls", saveFileDialog1.FileName);

                    if (MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) == DialogResult.Yes)
                    {
                        using (Process p = new Process())
                        {
                            p.StartInfo.FileName = saveFileDialog1.FileName;
                            p.StartInfo.UseShellExecute = true;
                            p.Start();
                        }
                    }
                }
            }
        }

        private void btnCancel_Click(object sender, System.EventArgs e)
        {
            Close();
        }
    }

}

Form1.Designer.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using System.Diagnostics;
using System.Reflection;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using FlexCel.Report;
using FlexCel.Demo.SharedData;
namespace Charts
{
    public partial class mainForm: System.Windows.Forms.Form
    {
        private System.Windows.Forms.Button button1;
        private System.Windows.Forms.SaveFileDialog saveFileDialog1;
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.Button btnCancel;
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.Container components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.button1 = new System.Windows.Forms.Button();
            this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog();
            this.label1 = new System.Windows.Forms.Label();
            this.btnCancel = new System.Windows.Forms.Button();
            this.SuspendLayout();
            //
            // button1
            //
            this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.button1.BackColor = System.Drawing.Color.Green;
            this.button1.ForeColor = System.Drawing.Color.White;
            this.button1.Location = new System.Drawing.Point(152, 88);
            this.button1.Name = "button1";
            this.button1.Size = new System.Drawing.Size(112, 23);
            this.button1.TabIndex = 0;
            this.button1.Text = "GO!";
            this.button1.UseVisualStyleBackColor = false;
            this.button1.Click += new System.EventHandler(this.button1_Click);
            //
            // saveFileDialog1
            //
            this.saveFileDialog1.Filter = "Excel Files|*.xls";
            this.saveFileDialog1.RestoreDirectory = true;
            //
            // label1
            //
            this.label1.Location = new System.Drawing.Point(24, 24);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(288, 24);
            this.label1.TabIndex = 2;
            this.label1.Text = "A report including some charts.";
            //
            // btnCancel
            //
            this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.btnCancel.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
            this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            this.btnCancel.ForeColor = System.Drawing.Color.White;
            this.btnCancel.Location = new System.Drawing.Point(272, 88);
            this.btnCancel.Name = "btnCancel";
            this.btnCancel.Size = new System.Drawing.Size(112, 23);
            this.btnCancel.TabIndex = 3;
            this.btnCancel.Text = "Cancel";
            this.btnCancel.UseVisualStyleBackColor = false;
            this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
            //
            // mainForm
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(416, 133);
            this.Controls.Add(this.btnCancel);
            this.Controls.Add(this.label1);
            this.Controls.Add(this.button1);
            this.Name = "mainForm";
            this.Text = "Charts";
            this.ResumeLayout(false);

        }
        #endregion
    }
}

Program.cs

using System;
using System.Windows.Forms;

namespace Charts
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new mainForm());
        }
    }
}


Charts With Dynamic Series (C# / netframework) | FlexCel Studio for the .NET Framework documentation

Charts With Dynamic Series (C# / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\csharp\VS2022\netframework\20.Reports\75.Charts With Dynamic Series and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​csharp/​VS2022/​netframework/​Modules/​20.​Reports/​75.​Charts With Dynamic Series

Overview

Examples of how to create a chart with one series per row. Charts with one series per row are not a common thing to do. You will normally want your series in columns, as shown in the example Charts. Even for this demo, the charts would probably look better if we had them with one series per column. But if you need to do it, you can use this example as a base.

Concepts

  • How to use swap series to create a chart with a series per row, as explained in Creating charts with dynamic series.

  • To use <#swap series> in an embedded chart, you name the chart with a name containing <#swap series>.The tag will be removed from the final chart name. To use <#swap series> in a chart sheet, you write it on the sheet name. And again, the tag will be removed from the final sheet name.

  • How to use the FlexCelReport.CustomizeChart event to further customize the chart.

Files

AssemblyInfo.cs

using System.Reflection;
using System.Runtime.CompilerServices;

//
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
//
[assembly: AssemblyTitle("")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("(c) 2002 - 2024 TMS Software")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

//
// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version
//      Build Number
//      Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:

[assembly: AssemblyVersion("7.21.0.0")]

//
// In order to sign your assembly you must specify a key to use. Refer to the
// Microsoft .NET Framework documentation for more information on assembly signing.
//
// Use the attributes below to control which key is used for signing.
//
// Notes:
//   (*) If no key is specified, the assembly is not signed.
//   (*) KeyName refers to a key that has been installed in the Crypto Service
//       Provider (CSP) on your machine. KeyFile refers to a file which contains
//       a key.
//   (*) If the KeyFile and the KeyName values are both specified, the
//       following processing occurs:
//       (1) If the KeyName can be found in the CSP, that key is used.
//       (2) If the KeyName does not exist and the KeyFile does exist, the key
//           in the KeyFile is installed into the CSP and used.
//   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
//       When specifying the KeyFile, the location of the KeyFile should be
//       relative to the project output directory which is
//       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
//       located in the project directory, you would specify the AssemblyKeyFile
//       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
//   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
//       documentation for more information on this.
//
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]
[assembly: AssemblyKeyName("")]

Form1.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using System.Diagnostics;
using System.Reflection;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using FlexCel.Report;
using FlexCel.Demo.SharedData;

namespace ChartsWithDynamicSeries
{
    /// <summary>
    /// A report including charts which have a series per row.
    /// </summary>
    public partial class mainForm: System.Windows.Forms.Form
    {

        public mainForm()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, System.EventArgs e)
        {
            AutoRun();
        }

        public void AutoRun()
        {
            using (FlexCelReport ordersReport = SharedData.CreateReport())
            {
                ordersReport.CustomizeChart += OrdersReport_CustomizeChart;
                string DataPath = Path.Combine(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), ".."), "..") + Path.DirectorySeparatorChar;

                if (saveFileDialog1.ShowDialog() == DialogResult.OK)
                {
                    ordersReport.Run(DataPath + "Charts With Dynamic Series.template.xlsx", saveFileDialog1.FileName);

                    if (MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) == DialogResult.Yes)
                    {
                        using (Process p = new Process())
                        {
                            p.StartInfo.FileName = saveFileDialog1.FileName;
                            p.StartInfo.UseShellExecute = true;
                            p.Start();
                        }
                    }
                }
            }
        }

        private void OrdersReport_CustomizeChart(object sender, CustomizeChartEventArgs e)
        {
            if (e.ChartName == "Stock<#swap series>")
            {
                //In this event we will set the colors of the series depending on the product.
                //Let's image each product has an associated color that we want to use for its series.
                for (int subChart = 1; subChart <= e.Chart.SubchartCount; subChart++)
                {
                    for (int series = 1; series <= e.Chart.SeriesInSubchart(subChart); series++)
                    {
                        var seriesDef = e.Chart.GetSeriesInSubchart(subChart, series, true, true, true);
                        var seriesOptions = seriesDef.Options[-1];
                        seriesOptions.FillOptions = new ChartSeriesFillOptions(
                            new TShapeFill(true, new TSolidFill(ColorForProduct(series))), null, false, false);
                        e.Chart.SetSeriesInSubchart(subChart, series, seriesDef);
                    }
                }
            }
        }

        private static TDrawingColor ColorForProduct(int series)
        {
            return TDrawingColor.FromRgb((byte)((series * 24) % 255), (byte)((series * 32) % 255), (byte)((series * 16) % 255));
        }

        private void btnCancel_Click(object sender, System.EventArgs e)
        {
            Close();
        }
    }

}

Form1.Designer.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using System.Diagnostics;
using System.Reflection;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using FlexCel.Report;
using FlexCel.Demo.SharedData;
namespace ChartsWithDynamicSeries
{
    public partial class mainForm: System.Windows.Forms.Form
    {
        private System.Windows.Forms.Button button1;
        private System.Windows.Forms.SaveFileDialog saveFileDialog1;
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.Button btnCancel;
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.Container components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.button1 = new System.Windows.Forms.Button();
            this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog();
            this.label1 = new System.Windows.Forms.Label();
            this.btnCancel = new System.Windows.Forms.Button();
            this.SuspendLayout();
            //
            // button1
            //
            this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.button1.BackColor = System.Drawing.Color.Green;
            this.button1.ForeColor = System.Drawing.Color.White;
            this.button1.Location = new System.Drawing.Point(152, 88);
            this.button1.Name = "button1";
            this.button1.Size = new System.Drawing.Size(112, 23);
            this.button1.TabIndex = 0;
            this.button1.Text = "GO!";
            this.button1.UseVisualStyleBackColor = false;
            this.button1.Click += new System.EventHandler(this.button1_Click);
            //
            // saveFileDialog1
            //
            this.saveFileDialog1.Filter = "Excel Files|*.xlsx";
            this.saveFileDialog1.RestoreDirectory = true;
            //
            // label1
            //
            this.label1.Location = new System.Drawing.Point(24, 24);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(288, 24);
            this.label1.TabIndex = 2;
            this.label1.Text = "A report including charts which have a series per row.";
            //
            // btnCancel
            //
            this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.btnCancel.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
            this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            this.btnCancel.ForeColor = System.Drawing.Color.White;
            this.btnCancel.Location = new System.Drawing.Point(272, 88);
            this.btnCancel.Name = "btnCancel";
            this.btnCancel.Size = new System.Drawing.Size(112, 23);
            this.btnCancel.TabIndex = 3;
            this.btnCancel.Text = "Cancel";
            this.btnCancel.UseVisualStyleBackColor = false;
            this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
            //
            // mainForm
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(416, 133);
            this.Controls.Add(this.btnCancel);
            this.Controls.Add(this.label1);
            this.Controls.Add(this.button1);
            this.Name = "mainForm";
            this.Text = "Charts With Dynamic Series";
            this.ResumeLayout(false);

        }
        #endregion
    }
}

Program.cs

using System;
using System.Windows.Forms;

namespace ChartsWithDynamicSeries
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new mainForm());
        }
    }
}


Pivot tables (C# / netframework) | FlexCel Studio for the .NET Framework documentation

Pivot tables (C# / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\csharp\VS2022\netframework\20.Reports\80.Pivot Tables and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​csharp/​VS2022/​netframework/​Modules/​20.​Reports/​80.​Pivot Tables

Overview

Pivot Tables are a very useful (and complex) Excel feature that allows you to summarize data and see it from different points of view just by clicking on fields.

FlexCel doesn't have support on the API for Pivot tables, but as usual, you can define one on the template, fill in the data as you would in a normal report, and the Pivot Table will be refreshed with it. There are some issues and things you have to take in account to make it work, but it is usually worth it.

Pivot tables work in both xls and xlsx, but FlexCel won't convert between them. A report made from an xls template must be saved as xls, and a report made from an xlsx template must be saved as xlsx for pivot tables to be preserved.

Concepts

  • Xls Templates: Excel saves a cache data for opening the pivot faster next time, and you can't use this on FlexCel because it is not implemented (FlexCel does not calculate the data in the pivot table). So, in the template, right-click the table, select "Don't save on open", and deselect "Update on open". Note: FlexCel will make this automatically in xlsx templates, so you don't need to do it.

  • Xls Templates: Defining a Named Range for the table data: The only way to get the Pivot Table range updated as you insert rows, is to define a named range ("TableData" in this example). When asked for the range to the Pivot table, refer to it. Do not select the range directly, or it won't be expanded. Note: This doesn't apply to xlsx templates, in those cases FlexCel will also expand direct ranges and you don't need to use a name, even when it isn't a bad idea anyway.

  • X ranges again! We need the pivot table range to be 2 rows at least, but we don't want the second row to be on the generated report. Same as in Charts, we use an "X" range that will erase the last row once it is done.

  • "." Sheets and "_." ranges . As FlexCel by default processes all sheets on the file, we would have a problem because it doesn't find the datasets on the Pivot Table sheet. One way to exclude FlexCel from reading a sheet, prefix its name with a dot "." The dot will be erased from the final sheet name. Here it doesn't work because the name of the sheet changes, and then the pivot chart loses its reference. So, we use a "." range. Ranges starting with a dot ("_.", "__.", "I_." and "II_.") are ignored by FlexCel.

  • When you insert cells the pivot table won't move. On this example, we included a file on cell A1, but we left the rows empty before inserting the pivot table. In general, the best you can do is to leave the pivot table alone on a sheet, without any <#tags>, and inside a "_." range.

  • There is a know issue with Excel and Internet explorer if you are doing a web application and trying to open the file directly from ie. When opening the file, ie will save it in a temporary folder with a name like "filename[1].xls" and then open it with Excel. The problem is that Excel does not allow [] characters in a filename, because it uses them in formulas to specify external files. In this case you will get an error and Excel won't update the pivot chart. Note that this is not related in any way to FlexCel, nor we can do anything to solve it. The problem happens with any Excel file with pivot tables that you open directly from ie, and the only solution is to save the file to disk before opening it, or use other browser. You can find more information at: http://www.microsoft.com/office/community/en-us/default.mspx?mid=146e209c-7f5d-4c5c-865c-42cfdb09d79b&dg=microsoft.public.excel.crashesgpfs and http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1398316&SiteID=1

  • Excel by default does not delete old entries in the comboboxes inside the pivot table, no matter how much you refresh the pivot table. This means that you will see "...delete row..." inside those comboboxes, since those entries were there when you created the template and they won't be deleted. You could get rid of them with a macro, but adding a macro to a sheet will add a security warning, so probably it is not worth it. But there is other undocumented way: If you can get a copy of Excel 2007 or newer to edit the template, you can set the "Pivot Table options", "Data" tab, "Number of items to retain per field" and set it to "none". The good thing about it is that once you change it, it will work also in Excel 2003, even when there is no way to change that option from Excel 2003 user interface.

Files

AssemblyInfo.cs

using System.Reflection;
using System.Runtime.CompilerServices;

//
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
//
[assembly: AssemblyTitle("")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("(c) 2002 - 2024 TMS Software")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

//
// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version
//      Build Number
//      Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:

[assembly: AssemblyVersion("7.21.0.0")]

//
// In order to sign your assembly you must specify a key to use. Refer to the
// Microsoft .NET Framework documentation for more information on assembly signing.
//
// Use the attributes below to control which key is used for signing.
//
// Notes:
//   (*) If no key is specified, the assembly is not signed.
//   (*) KeyName refers to a key that has been installed in the Crypto Service
//       Provider (CSP) on your machine. KeyFile refers to a file which contains
//       a key.
//   (*) If the KeyFile and the KeyName values are both specified, the
//       following processing occurs:
//       (1) If the KeyName can be found in the CSP, that key is used.
//       (2) If the KeyName does not exist and the KeyFile does exist, the key
//           in the KeyFile is installed into the CSP and used.
//   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
//       When specifying the KeyFile, the location of the KeyFile should be
//       relative to the project output directory which is
//       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
//       located in the project directory, you would specify the AssemblyKeyFile
//       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
//   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
//       documentation for more information on this.
//
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]
[assembly: AssemblyKeyName("")]

Form1.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using System.Diagnostics;
using System.Reflection;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using FlexCel.Report;
using FlexCel.Demo.SharedData;

namespace PivotTables
{
    /// <summary>
    /// How to keep pivot tabels in reports.
    /// </summary>
    public partial class mainForm: System.Windows.Forms.Form
    {
        public mainForm()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, System.EventArgs e)
        {
            AutoRun();
        }

        public void AutoRun()
        {
            using (FlexCelReport ordersReport = SharedData.CreateReport())
            {
                ordersReport.SetValue("Date", DateTime.Now);

                string DataPath = Path.Combine(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), ".."), "..") + Path.DirectorySeparatorChar;

                if (saveFileDialog1.ShowDialog() == DialogResult.OK)
                {
                    string Template = Path.GetExtension(saveFileDialog1.FileName) == ".xlsx" ? "Pivot Tables.template.xlsx" : "Pivot Tables.template.xls";
                    ordersReport.Run(DataPath + Template, saveFileDialog1.FileName);

                    if (MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) == DialogResult.Yes)
                    {
                        using (Process p = new Process())
                        {
                            p.StartInfo.FileName = saveFileDialog1.FileName;
                            p.StartInfo.UseShellExecute = true;
                            p.Start();
                        }
                    }
                }
            }

        }

        private void btnCancel_Click(object sender, System.EventArgs e)
        {
            Close();
        }
    }

}

Form1.Designer.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using System.Diagnostics;
using System.Reflection;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using FlexCel.Report;
using FlexCel.Demo.SharedData;
namespace PivotTables
{
    public partial class mainForm: System.Windows.Forms.Form
    {
        private System.Windows.Forms.Button button1;
        private System.Windows.Forms.SaveFileDialog saveFileDialog1;
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.Button btnCancel;
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.Container components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.button1 = new System.Windows.Forms.Button();
            this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog();
            this.label1 = new System.Windows.Forms.Label();
            this.btnCancel = new System.Windows.Forms.Button();
            this.SuspendLayout();
            //
            // button1
            //
            this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.button1.BackColor = System.Drawing.Color.Green;
            this.button1.ForeColor = System.Drawing.Color.White;
            this.button1.Location = new System.Drawing.Point(152, 88);
            this.button1.Name = "button1";
            this.button1.Size = new System.Drawing.Size(112, 23);
            this.button1.TabIndex = 0;
            this.button1.Text = "GO!";
            this.button1.UseVisualStyleBackColor = false;
            this.button1.Click += new System.EventHandler(this.button1_Click);
            //
            // saveFileDialog1
            //
            this.saveFileDialog1.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm|Excel 97/2003|*.xls|Excel 2007|*.xlsx;*.xlsm|All files|*.*";
            this.saveFileDialog1.RestoreDirectory = true;
            //
            // label1
            //
            this.label1.Location = new System.Drawing.Point(24, 24);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(288, 24);
            this.label1.TabIndex = 2;
            this.label1.Text = "A pivot table with data refreshed from FlexCel.";
            //
            // btnCancel
            //
            this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.btnCancel.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
            this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            this.btnCancel.ForeColor = System.Drawing.Color.White;
            this.btnCancel.Location = new System.Drawing.Point(272, 88);
            this.btnCancel.Name = "btnCancel";
            this.btnCancel.Size = new System.Drawing.Size(112, 23);
            this.btnCancel.TabIndex = 3;
            this.btnCancel.Text = "Cancel";
            this.btnCancel.UseVisualStyleBackColor = false;
            this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
            //
            // mainForm
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(416, 133);
            this.Controls.Add(this.btnCancel);
            this.Controls.Add(this.label1);
            this.Controls.Add(this.button1);
            this.Name = "mainForm";
            this.Text = "Pivot Tables";
            this.ResumeLayout(false);

        }
        #endregion
    }
}

Program.cs

using System;
using System.Windows.Forms;

namespace PivotTables
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new mainForm());
        }
    }
}


HTML (C# / netframework) | FlexCel Studio for the .NET Framework documentation

HTML (C# / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\csharp\VS2022\netframework\20.Reports\83.HTML and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​csharp/​VS2022/​netframework/​Modules/​20.​Reports/​83.​HTML

Overview

A demo that shows how to use HTML formatted strings directly on FlexCel. On this example we used to connect to Yahoo Travel web service, and format the results into an Excel or pdf sheet. As Yahoo Travel doesn't exist anymore, some sample data is included to work offline without connecting.

Concepts

  • FlexCel supports a light subset of HTML commands, like <b>, <br>, and the escaped characters like &. But this should be enough to for having rich format inside cells.

  • Any HTML tag that FlexCel cannot parse will be ignored.

  • Note how the word "London" is in bold in titles like "London and Paris". This is because the HTML returned contained those tags.

  • You can allow HTML in a FlexCelReport in two ways:

    1. You can enable it globally by setting FlexCelReport.HTMLMode = true, and disable it where not needed with the <#HTML(false)> tag. This is not normally recommended, since when in HTML mode all strings have to be html strings, where for example two spaces mean only one, and carriage returns are created with <br> tags.

    2. You can enable it on a cell by cell basis, by using the <#HTML(true)> tag. This is the approach we use here.

  • How to set Intelligent Page Breaks. FlexCel will add page breaks so all entries are kept together when printing or exporting to pdf.

  • You can also set an hyperlink in an image. In this case, we wrote an hyperlink in the image pointing to the URL in the database. This link is also exported to pdf.

Files

AssemblyInfo.cs

using System.Reflection;
using System.Runtime.CompilerServices;

//
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
//
[assembly: AssemblyTitle("")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("(c) 2002 - 2024 TMS Software")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

//
// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version
//      Build Number
//      Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:

[assembly: AssemblyVersion("7.21.0.0")]

//
// In order to sign your assembly you must specify a key to use. Refer to the
// Microsoft .NET Framework documentation for more information on assembly signing.
//
// Use the attributes below to control which key is used for signing.
//
// Notes:
//   (*) If no key is specified, the assembly is not signed.
//   (*) KeyName refers to a key that has been installed in the Crypto Service
//       Provider (CSP) on your machine. KeyFile refers to a file which contains
//       a key.
//   (*) If the KeyFile and the KeyName values are both specified, the
//       following processing occurs:
//       (1) If the KeyName can be found in the CSP, that key is used.
//       (2) If the KeyName does not exist and the KeyFile does exist, the key
//           in the KeyFile is installed into the CSP and used.
//   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
//       When specifying the KeyFile, the location of the KeyFile should be
//       relative to the project output directory which is
//       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
//       located in the project directory, you would specify the AssemblyKeyFile
//       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
//   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
//       documentation for more information on this.
//
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]
[assembly: AssemblyKeyName("")]

Form1.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using System.Diagnostics;
using System.Reflection;
using System.Xml;
using System.Net;
using System.Threading;
using System.Globalization;

using FlexCel.Core;
using FlexCel.XlsAdapter;
using FlexCel.Report;
using FlexCel.Render;

namespace HTML
{
    /// <summary>
    /// Shows the limited HTML support.
    /// </summary>
    public partial class mainForm: System.Windows.Forms.Form
    {

        public mainForm()
        {
            InitializeComponent();
        }

        private void Export(SaveFileDialog SaveDialog, bool ToPdf)
        {
            using (FlexCelReport reportStart = new FlexCelReport(true))
            {

                if (cbOffline.Checked && edCity.Text != "london") MessageBox.Show("Offline mode is selected, so we will show the data of london. The actual city you wrote will not be used unless you select online mode.", "Warning");
                try
                {
                    string DataPath = Path.Combine(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), ".."), "..") + Path.DirectorySeparatorChar;
                    string OfflineDataPath = Path.Combine(DataPath, "OfflineData") + Path.DirectorySeparatorChar;

                    //We will use a thread to connect, to avoid "freezing" the GUI
                    WebConnectThread MyWebConnect = new WebConnectThread(reportStart, edCity.Text, OfflineDataPath, cbOffline.Checked);
                    Thread WebConnect = new Thread(new ThreadStart(MyWebConnect.LoadData));
                    WebConnect.Start();
                    using (ProgressDialog Pg = new ProgressDialog())
                    {
                        Pg.ShowProgress(WebConnect);
                        if (MyWebConnect != null && MyWebConnect.MainException != null)
                        {
                            throw MyWebConnect.MainException;
                        }
                    }

                    if (SaveDialog.ShowDialog() == DialogResult.OK)
                    {
                        if (ToPdf)
                        {
                            XlsFile xls = new XlsFile();
                            xls.Open(DataPath + "HTML.template.xls");
                            reportStart.Run(xls);
                            using (FlexCelPdfExport PdfExport = new FlexCelPdfExport(xls, true))
                            {
                                PdfExport.Export(SaveDialog.FileName);
                            }
                        }
                        else
                        {
                            reportStart.Run(DataPath + "HTML.template.xls", SaveDialog.FileName);
                        }

                        if (MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) == DialogResult.Yes)
                        {
                            using (Process p = new Process())
                            {
                                p.StartInfo.FileName = SaveDialog.FileName;
                                p.StartInfo.UseShellExecute = true;
                                p.Start();
                            }
                        }
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }
        }

        private void btnCancel_Click(object sender, System.EventArgs e)
        {
            Close();
        }

        private void btnExportPdf_Click(object sender, System.EventArgs e)
        {
            Export(saveFileDialogPdf, true);
        }

        private void btnExportXls_Click(object sender, System.EventArgs e)
        {
            Export(saveFileDialogXls, false);
        }

        private void linkLabel1_LinkClicked(object sender, System.Windows.Forms.LinkLabelLinkClickedEventArgs e)
        {
            using (Process p = new Process())
            {
                p.StartInfo.FileName = (sender as LinkLabel).Text;
                p.StartInfo.UseShellExecute = true;
                p.Start();
            }
        }
    }

    class WebConnectThread
    {
        string CityName;
        string DataPath;
        bool UseOfflineData;
        FlexCelReport ReportStart;
        private Exception FMainException;

        public WebConnectThread(FlexCelReport aReportStart, string aCityName, string aDataPath, bool aUseOfflineData)
        {
            CityName = aCityName;
            DataPath = aDataPath;
            UseOfflineData = aUseOfflineData;
            ReportStart = aReportStart;
        }

        /// <summary>
        /// This is the method we will call form a thread. It catches any internal exception.
        /// </summary>
        public void LoadData()
        {
            try
            {
                LoadData(ReportStart, CityName, DataPath, UseOfflineData);
            }
            catch (Exception ex)
            {
                FMainException = ex;
            }

        }

        public static void LoadData(FlexCelReport reportStart, string CityName, string DataPath, bool UseOfflineData)
        {
            reportStart.SetValue("Date", DateTime.Now);
            DataSet ds = new DataSet();
            ds.Locale = CultureInfo.InvariantCulture;
            ds.EnforceConstraints = false;
            ds.ReadXmlSchema(Path.Combine(DataPath, "TripSearchResponse.xsd"));
            ds.Tables["Result"].Columns.Add("ImageData", typeof(byte[])); //Add a column for the actual images.
            if (UseOfflineData)
            {
                ds.ReadXml(Path.Combine(DataPath, "OfflineData.xml"));
            }
            else
            {
                // Create the web request
                string url = String.Format("http://travel.yahooapis.com/TripService/V1.1/tripSearch?appid=YahooDemo&query={0}&results=20", CityName);
                UriBuilder uri = new UriBuilder(url);
                HttpWebRequest request = WebRequest.Create(uri.Uri.AbsoluteUri) as HttpWebRequest;

                // Get response
                using (HttpWebResponse response = request.GetResponse() as HttpWebResponse)
                {
                    // Load data into a dataset
                    ds.ReadXml(response.GetResponseStream());
                }
            }

            if (ds.Tables["ResultSet"].Rows.Count <= 0) throw new Exception("Error loading the data.");
            if (Convert.ToInt32(ds.Tables["ResultSet"].Rows[0]["totalResultsReturned"]) <= 0) throw new Exception("There are no travel plans for this location");

            LoadImageData(ds, UseOfflineData, DataPath);

            /* Uncomment this code to create an offline image of the data.*/
#if (CreateOffline)
            ds.WriteXml(Path.Combine(DataPath, "OfflineData.xml"));
#endif

            reportStart.AddTable(ds);
        }

        internal Exception MainException
        {
            get
            {
                return FMainException;
            }
        }

        private static void LoadImageData(DataSet ds, bool UseOfflineData, string DataPath)
        {
            DataTable Images = ds.Tables["Image"];
            Images.PrimaryKey = new DataColumn[] { Images.Columns["Result_Id"] };
            foreach (DataRow dr in ds.Tables["Result"].Rows)
            {
                DataRow ImageRow = Images.Rows.Find(dr["Result_Id"]);

                if (ImageRow == null) continue;
                string url = Convert.ToString(ImageRow["Url"]);
                if (url != null && url.Length > 0)
                {
                    dr["ImageData"] = LoadIcon(url, UseOfflineData, DataPath);
                }
            }

        }

        internal static byte[] LoadIcon(string url, bool useOfflineData, string dataPath)
        {
            if (useOfflineData)
            {
                Uri u = new Uri(url);
                return LoadFileIcon(Path.Combine(dataPath, u.Segments[u.Segments.Length - 1]));
            }
            else
            {
                /* Uncomment this code to create an offline image of the data. */
#if (CreateOffline)
                Uri u = new Uri(url);
                byte[] IconData = LoadWebIcon(url);
                using (FileStream fs = new FileStream(Path.Combine(dataPath, u.Segments[u.Segments.Length - 1]), FileMode.Create))
                {
                    fs.Write(IconData, 0, IconData.Length);
                }
#endif

                return LoadWebIcon(url);

            }
        }

        /// <summary>
        /// On a real implementation this should be cached.
        /// </summary>
        /// <param name="url"></param>
        /// <returns></returns>
        internal static byte[] LoadWebIcon(string url)
        {
            using (WebClient wc = new WebClient())
            {
                return wc.DownloadData(url);
            }
        }

        private static byte[] LoadFileIcon(string filename)
        {
            using (FileStream fs = new FileStream(filename, FileMode.Open))
            {
                byte[] Result = new byte[fs.Length];
                fs.Read(Result, 0, Result.Length);
                return Result;
            }
        }

    }

}

Form1.Designer.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using System.Diagnostics;
using System.Reflection;
using System.Xml;
using System.Net;
using System.Threading;
using System.Globalization;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using FlexCel.Report;
using FlexCel.Render;
namespace HTML
{
    public partial class mainForm: System.Windows.Forms.Form
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.Container components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.btnExportXls = new System.Windows.Forms.Button();
            this.saveFileDialogXls = new System.Windows.Forms.SaveFileDialog();
            this.btnCancel = new System.Windows.Forms.Button();
            this.cbOffline = new System.Windows.Forms.CheckBox();
            this.btnExportPdf = new System.Windows.Forms.Button();
            this.saveFileDialogPdf = new System.Windows.Forms.SaveFileDialog();
            this.edCity = new System.Windows.Forms.TextBox();
            this.labelCity = new System.Windows.Forms.Label();
            this.label1 = new System.Windows.Forms.Label();
            this.linkLabel1 = new System.Windows.Forms.LinkLabel();
            this.panel1 = new System.Windows.Forms.Panel();
            this.label2 = new System.Windows.Forms.Label();
            this.panel1.SuspendLayout();
            this.SuspendLayout();
            //
            // btnExportXls
            //
            this.btnExportXls.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
            this.btnExportXls.BackColor = System.Drawing.Color.Green;
            this.btnExportXls.ForeColor = System.Drawing.Color.White;
            this.btnExportXls.Location = new System.Drawing.Point(16, 258);
            this.btnExportXls.Name = "btnExportXls";
            this.btnExportXls.Size = new System.Drawing.Size(112, 24);
            this.btnExportXls.TabIndex = 0;
            this.btnExportXls.Text = "Export to Excel";
            this.btnExportXls.UseVisualStyleBackColor = false;
            this.btnExportXls.Click += new System.EventHandler(this.btnExportXls_Click);
            //
            // saveFileDialogXls
            //
            this.saveFileDialogXls.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm|Excel 97/2003|*.xls|Excel 2007|*.xlsx;*.xlsm|All " +
    "files|*.*";
            this.saveFileDialogXls.RestoreDirectory = true;
            //
            // btnCancel
            //
            this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
            this.btnCancel.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
            this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            this.btnCancel.ForeColor = System.Drawing.Color.White;
            this.btnCancel.Location = new System.Drawing.Point(272, 258);
            this.btnCancel.Name = "btnCancel";
            this.btnCancel.Size = new System.Drawing.Size(112, 24);
            this.btnCancel.TabIndex = 3;
            this.btnCancel.Text = "Cancel";
            this.btnCancel.UseVisualStyleBackColor = false;
            this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
            //
            // cbOffline
            //
            this.cbOffline.Checked = true;
            this.cbOffline.CheckState = System.Windows.Forms.CheckState.Checked;
            this.cbOffline.Location = new System.Drawing.Point(13, 200);
            this.cbOffline.Name = "cbOffline";
            this.cbOffline.Size = new System.Drawing.Size(352, 24);
            this.cbOffline.TabIndex = 10;
            this.cbOffline.Text = "Use offline data. (do not actually connect to the web service)";
            //
            // btnExportPdf
            //
            this.btnExportPdf.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
            this.btnExportPdf.BackColor = System.Drawing.Color.SteelBlue;
            this.btnExportPdf.ForeColor = System.Drawing.Color.White;
            this.btnExportPdf.Location = new System.Drawing.Point(144, 258);
            this.btnExportPdf.Name = "btnExportPdf";
            this.btnExportPdf.Size = new System.Drawing.Size(112, 24);
            this.btnExportPdf.TabIndex = 11;
            this.btnExportPdf.Text = "Export to Pdf";
            this.btnExportPdf.UseVisualStyleBackColor = false;
            this.btnExportPdf.Click += new System.EventHandler(this.btnExportPdf_Click);
            //
            // saveFileDialogPdf
            //
            this.saveFileDialogPdf.Filter = "Pdf Files|*.pdf";
            this.saveFileDialogPdf.RestoreDirectory = true;
            //
            // edCity
            //
            this.edCity.Location = new System.Drawing.Point(157, 160);
            this.edCity.Name = "edCity";
            this.edCity.Size = new System.Drawing.Size(208, 20);
            this.edCity.TabIndex = 12;
            this.edCity.Text = "london";
            //
            // labelCity
            //
            this.labelCity.Location = new System.Drawing.Point(5, 152);
            this.labelCity.Name = "labelCity";
            this.labelCity.Size = new System.Drawing.Size(144, 40);
            this.labelCity.TabIndex = 13;
            this.labelCity.Text = "City Name: (try things like tokio, sydney, new york, madrid, rio de janeiro)";
            //
            // label1
            //
            this.label1.Font = new System.Drawing.Font("Times New Roman", 10.25F, System.Drawing.FontStyle.Italic);
            this.label1.Location = new System.Drawing.Point(13, 88);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(352, 32);
            this.label1.TabIndex = 14;
            this.label1.Text = "This application uses Yahoo Travel APIs to load demo trips and export them to Exc" +
    "el. For more information, visit:";
            //
            // linkLabel1
            //
            this.linkLabel1.Location = new System.Drawing.Point(13, 128);
            this.linkLabel1.Name = "linkLabel1";
            this.linkLabel1.Size = new System.Drawing.Size(320, 16);
            this.linkLabel1.TabIndex = 15;
            this.linkLabel1.TabStop = true;
            this.linkLabel1.Text = "http://developer.yahoo.com/travel/";
            this.linkLabel1.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel1_LinkClicked);
            //
            // panel1
            //
            this.panel1.BackColor = System.Drawing.Color.LightGoldenrodYellow;
            this.panel1.Controls.Add(this.label2);
            this.panel1.Dock = System.Windows.Forms.DockStyle.Top;
            this.panel1.Location = new System.Drawing.Point(0, 0);
            this.panel1.Name = "panel1";
            this.panel1.Size = new System.Drawing.Size(416, 69);
            this.panel1.TabIndex = 16;
            //
            // label2
            //
            this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label2.Location = new System.Drawing.Point(12, 9);
            this.label2.Name = "label2";
            this.label2.Size = new System.Drawing.Size(392, 49);
            this.label2.TabIndex = 0;
            this.label2.Text = "IMPORTANT: Yahoo has discontinued this service, so this demo will only work with " +
    "offline data. As the online functionality isn\'t essential to this demo, we have " +
    "decided to keep it.";
            //
            // mainForm
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(416, 292);
            this.Controls.Add(this.panel1);
            this.Controls.Add(this.linkLabel1);
            this.Controls.Add(this.label1);
            this.Controls.Add(this.labelCity);
            this.Controls.Add(this.edCity);
            this.Controls.Add(this.btnExportPdf);
            this.Controls.Add(this.cbOffline);
            this.Controls.Add(this.btnCancel);
            this.Controls.Add(this.btnExportXls);
            this.Name = "mainForm";
            this.Text = "Using HTML formatted text with FlexCel";
            this.panel1.ResumeLayout(false);
            this.ResumeLayout(false);
            this.PerformLayout();

        }
        #endregion
        private System.Windows.Forms.Button btnCancel;
        private System.Windows.Forms.CheckBox cbOffline;
        private System.Windows.Forms.Button btnExportXls;
        private System.Windows.Forms.Button btnExportPdf;
        private System.Windows.Forms.SaveFileDialog saveFileDialogXls;
        private System.Windows.Forms.SaveFileDialog saveFileDialogPdf;
        private System.Windows.Forms.TextBox edCity;
        private System.Windows.Forms.Label labelCity;
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.LinkLabel linkLabel1;
        private Panel panel1;
        private Label label2;
    }
}

Program.cs

using System;
using System.Windows.Forms;

namespace HTML
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new mainForm());
        }
    }
}

ProgressDialog.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;

using System.Threading;

using FlexCel.Render;

namespace HTML
{
    /// <summary>
    /// A dialog box to show progress.
    /// </summary>
    public partial class ProgressDialog: System.Windows.Forms.Form
    {
        private System.Timers.Timer timer1;

        public ProgressDialog()
        {
            InitializeComponent();
        }

        private DateTime StartTime;
        private Thread RunningThread;

        private void timer1_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
        {
            UpdateStatus();
        }

        public void ShowProgress(Thread aRunningThread)
        {
            RunningThread = aRunningThread;

            if (!RunningThread.IsAlive) { DialogResult = DialogResult.OK; return; }
            timer1.Enabled = true;
            StartTime = DateTime.Now;
            ShowDialog();
        }

        private void UpdateStatus()
        {
            TimeSpan ts = DateTime.Now - StartTime;
            string hours;
            if (ts.Hours == 0) hours = ""; else hours = ts.Hours.ToString("00") + ":";
            statusBarPanelTime.Text = hours + ts.Minutes.ToString("00") + ":" + ts.Seconds.ToString("00");

            if (!RunningThread.IsAlive) DialogResult = DialogResult.OK;
        }

        private void ProgressDialog_Closed(object sender, System.EventArgs e)
        {
            timer1.Enabled = false;
        }
    }
}

ProgressDialog.Designer.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Threading;
using FlexCel.Render;
namespace HTML
{
    public partial class ProgressDialog: System.Windows.Forms.Form
    {
        private System.Windows.Forms.StatusBar statusBar1;
        private System.Windows.Forms.StatusBarPanel statusBarPanel1;
        private System.Windows.Forms.StatusBarPanel statusBarPanelTime;
        private System.Windows.Forms.Label labelCaption;
        private System.Windows.Forms.PictureBox pictureBox1;
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.Container components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(ProgressDialog));
            this.statusBar1 = new System.Windows.Forms.StatusBar();
            this.statusBarPanel1 = new System.Windows.Forms.StatusBarPanel();
            this.statusBarPanelTime = new System.Windows.Forms.StatusBarPanel();
            this.labelCaption = new System.Windows.Forms.Label();
            this.timer1 = new System.Timers.Timer();
            this.pictureBox1 = new System.Windows.Forms.PictureBox();
            ((System.ComponentModel.ISupportInitialize)(this.statusBarPanel1)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.statusBarPanelTime)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.timer1)).BeginInit();
            this.SuspendLayout();
            //
            // statusBar1
            //
            this.statusBar1.Location = new System.Drawing.Point(0, 128);
            this.statusBar1.Name = "statusBar1";
            this.statusBar1.Panels.AddRange(new System.Windows.Forms.StatusBarPanel[] {
                                                                                this.statusBarPanel1,
                                                                                this.statusBarPanelTime});
            this.statusBar1.ShowPanels = true;
            this.statusBar1.Size = new System.Drawing.Size(448, 22);
            this.statusBar1.TabIndex = 1;
            //
            // statusBarPanel1
            //
            this.statusBarPanel1.BorderStyle = System.Windows.Forms.StatusBarPanelBorderStyle.None;
            this.statusBarPanel1.Text = "Elapsed Time:";
            this.statusBarPanel1.Width = 80;
            //
            // statusBarPanelTime
            //
            this.statusBarPanelTime.BorderStyle = System.Windows.Forms.StatusBarPanelBorderStyle.None;
            this.statusBarPanelTime.Text = "0:00";
            //
            // labelCaption
            //
            this.labelCaption.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
                | System.Windows.Forms.AnchorStyles.Right)));
            this.labelCaption.Location = new System.Drawing.Point(16, 16);
            this.labelCaption.Name = "labelCaption";
            this.labelCaption.Size = new System.Drawing.Size(408, 16);
            this.labelCaption.TabIndex = 2;
            this.labelCaption.Text = "Retrieving data from Webservice...";
            //
            // timer1
            //
            this.timer1.Enabled = true;
            this.timer1.SynchronizingObject = this;
            this.timer1.Elapsed += new System.Timers.ElapsedEventHandler(this.timer1_Elapsed);
            //
            // pictureBox1
            //
            this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image")));
            this.pictureBox1.Location = new System.Drawing.Point(64, 40);
            this.pictureBox1.Name = "pictureBox1";
            this.pictureBox1.Size = new System.Drawing.Size(296, 64);
            this.pictureBox1.TabIndex = 3;
            this.pictureBox1.TabStop = false;
            //
            // ProgressDialog
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(448, 150);
            this.ControlBox = false;
            this.Controls.Add(this.pictureBox1);
            this.Controls.Add(this.labelCaption);
            this.Controls.Add(this.statusBar1);
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
            this.MaximizeBox = false;
            this.MinimizeBox = false;
            this.Name = "ProgressDialog";
            this.ShowInTaskbar = false;
            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
            this.Text = "Please wait...";
            this.Closed += new System.EventHandler(this.ProgressDialog_Closed);
            ((System.ComponentModel.ISupportInitialize)(this.statusBarPanel1)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.statusBarPanelTime)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.timer1)).EndInit();
            this.ResumeLayout(false);

        }
        #endregion
    }
}


Autofiting rows and columns (C# / netframework) | FlexCel Studio for the .NET Framework documentation

Autofiting rows and columns (C# / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\csharp\VS2022\netframework\20.Reports\85.Autofit and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​csharp/​VS2022/​netframework/​Modules/​20.​Reports/​85.​Autofit

Overview

When using FlexCel, you can opt for autofit certain rows so they adjust to their content. By default, this is not done automatically for all rows since most rows do not need autofit, and so you need to use a special <#Row Height(autofit)> tag. Make sure you read Autofitting Rows and Columns in the API developer's guide for more information on autofitting.

Concepts

  • With default settings, autofitting rows in FlexCel will not change the autofitting status of the row. So, when you open this file in Excel, all row heights will be recalculated again, changing page breaks, but guaranteeing that all text is visible. If you prefer to keep autofitted row fixed when you open them on Excel, make the row fixed on the template or use the <#Autofit Settings> tag.

  • You can use an "Adjustment" parameter on the <#Row Height> and <#Autofit Settings> tags, to leave a margin for text. Remember that normally Excel text is a little wider than FlexCel's, so it might need more room. "AdjustmentFixed" is other parameter that can be used for the same thing.

  • You can use different types of autofit depending on your needs, and they are shown on different sheets on this demo. There are normally 2 "modes" of autofit:

    1. The default. FlexCel autofits the rows so it can print/export fine, but leaves the rows to autofit so Excel will autofit them again when you open the file. This mode ensures text will not be "cropped" in Excel or FlexCel, but the row heights will be different in both.

    2. "Fixed" mode. Here, FlexCel calculates the Autofit and fixes the row to that size. When you open the file in Excel rows will not change, so the page will print the same. But, as Excel normally uses more space to print the words, some words might be cropped when opening on Excel. To avoid cropping, it is recommended that you use a large Adjustment, of about 150.

Files

AssemblyInfo.cs

using System.Reflection;
using System.Runtime.CompilerServices;

//
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
//
[assembly: AssemblyTitle("")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("(c) 2002 - 2024 TMS Software")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

//
// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version
//      Build Number
//      Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:

[assembly: AssemblyVersion("7.21.0.0")]

//
// In order to sign your assembly you must specify a key to use. Refer to the
// Microsoft .NET Framework documentation for more information on assembly signing.
//
// Use the attributes below to control which key is used for signing.
//
// Notes:
//   (*) If no key is specified, the assembly is not signed.
//   (*) KeyName refers to a key that has been installed in the Crypto Service
//       Provider (CSP) on your machine. KeyFile refers to a file which contains
//       a key.
//   (*) If the KeyFile and the KeyName values are both specified, the
//       following processing occurs:
//       (1) If the KeyName can be found in the CSP, that key is used.
//       (2) If the KeyName does not exist and the KeyFile does exist, the key
//           in the KeyFile is installed into the CSP and used.
//   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
//       When specifying the KeyFile, the location of the KeyFile should be
//       relative to the project output directory which is
//       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
//       located in the project directory, you would specify the AssemblyKeyFile
//       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
//   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
//       documentation for more information on this.
//
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]
[assembly: AssemblyKeyName("")]

Form1.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using System.Diagnostics;
using System.Reflection;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using FlexCel.Report;
using FlexCel.Demo.SharedData;

namespace Autofit
{
    /// <summary>
    /// How to autofit rows and columns.
    /// </summary>
    public partial class mainForm: System.Windows.Forms.Form
    {

        public mainForm()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, System.EventArgs e)
        {
            AutoRun();
        }

        public void AutoRun()
        {
            using (FlexCelReport ordersReport = SharedData.CreateReport())
            {
                string DataPath = Path.Combine(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), ".."), "..") + Path.DirectorySeparatorChar;

                if (saveFileDialog1.ShowDialog() == DialogResult.OK)
                {
                    ordersReport.Run(DataPath + "Autofit.template.xls", saveFileDialog1.FileName);

                    if (MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) == DialogResult.Yes)
                    {
                        using (Process p = new Process())
                        {
                            p.StartInfo.FileName = saveFileDialog1.FileName;
                            p.StartInfo.UseShellExecute = true;
                            p.Start();
                        }
                    }
                }
            }
        }

        private void btnCancel_Click(object sender, System.EventArgs e)
        {
            Close();
        }
    }

}

Form1.Designer.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using System.Diagnostics;
using System.Reflection;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using FlexCel.Report;
using FlexCel.Demo.SharedData;
namespace Autofit
{
    public partial class mainForm: System.Windows.Forms.Form
    {
        private System.Windows.Forms.Button button1;
        private System.Windows.Forms.SaveFileDialog saveFileDialog1;
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.Button btnCancel;
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.Container components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.button1 = new System.Windows.Forms.Button();
            this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog();
            this.label1 = new System.Windows.Forms.Label();
            this.btnCancel = new System.Windows.Forms.Button();
            this.SuspendLayout();
            //
            // button1
            //
            this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.button1.BackColor = System.Drawing.Color.Green;
            this.button1.ForeColor = System.Drawing.Color.White;
            this.button1.Location = new System.Drawing.Point(152, 88);
            this.button1.Name = "button1";
            this.button1.Size = new System.Drawing.Size(112, 23);
            this.button1.TabIndex = 0;
            this.button1.Text = "GO!";
            this.button1.UseVisualStyleBackColor = false;
            this.button1.Click += new System.EventHandler(this.button1_Click);
            //
            // saveFileDialog1
            //
            this.saveFileDialog1.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm|Excel 97/2003|*.xls|Excel 2007|*.xlsx;*.xlsm|All files|*.*";
            this.saveFileDialog1.RestoreDirectory = true;
            //
            // label1
            //
            this.label1.Location = new System.Drawing.Point(24, 24);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(272, 24);
            this.label1.TabIndex = 2;
            this.label1.Text = "Shows how to autofit some rows or columns.";
            //
            // btnCancel
            //
            this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.btnCancel.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
            this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            this.btnCancel.ForeColor = System.Drawing.Color.White;
            this.btnCancel.Location = new System.Drawing.Point(272, 88);
            this.btnCancel.Name = "btnCancel";
            this.btnCancel.Size = new System.Drawing.Size(112, 23);
            this.btnCancel.TabIndex = 3;
            this.btnCancel.Text = "Cancel";
            this.btnCancel.UseVisualStyleBackColor = false;
            this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
            //
            // mainForm
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(416, 133);
            this.Controls.Add(this.btnCancel);
            this.Controls.Add(this.label1);
            this.Controls.Add(this.button1);
            this.Name = "mainForm";
            this.Text = "Autofit";
            this.ResumeLayout(false);

        }
        #endregion
    }
}

Program.cs

using System;
using System.Windows.Forms;

namespace Autofit
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new mainForm());
        }
    }
}


Generic reports (C# / netframework) | FlexCel Studio for the .NET Framework documentation

Generic reports (C# / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\csharp\VS2022\netframework\20.Reports\88.Generic Reports and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​csharp/​VS2022/​netframework/​Modules/​20.​Reports/​88.​Generic Reports

Overview

When you are reporting from an unknown database (for example if you are writing a DbExport app) you can't use a fixed template, because you don't know what the columns will be. While FlexCelReport is designed to handle fixed-form templates, there is some support also for generic reports. This example together with the Meta Templates and Generic Reports 2 examples show what can be done. For more advanced generic reports, you should probably use the API directly.

Concepts

  • You can use <#DataTable.*> to write a full row of data from a datatable. Cells at the right of the cell containing the <#DataTable.*> tag will be overwritten.

  • You can use <#DataTable.**> to write a full row with the column captions on a datatable. Cells at the right of the cell containing the <#DataTable.**> tag will be overwritten.

  • <DataTable.**> can be placed anywhere, it doesn't need to be inside a named range. <DataTable.*> should be inside a named range populating DataTable.

  • Dates: As dates on Excel are just numbers formatted as date, <#DataTable.*> will format the cell when the column has a DateTime value. If the time part of the datetime is 0, time will not be entered.

  • You can use expressions in cells with <#DataTable.*> and <#DataTable.**> tags. You can also get the current value of the tag in the cell by writing <#DataTable.*> or <#DataTable.**> again in the same cell. For example, the tags:

      <#Table.**><#Column Width(autofit;110)>

    Will autofit all the columns in the range expanded by the <#Table.**> tag. While the tags:

      <#Table.*><#if(<#evaluate(mod(column(),2)=0)>;<#format cell(light)>;)>
  <#if(<#table.*>="BONAP";<#format cell(blue)>;)>
  <#if(<#table.**>="OrderDate";<#format cell(longdate)>;)>

    will perform 3 things: On the first, it will paint alternating columns with the "light" format. On the second, it will it will highlight cells that contain the string "BONAP" in blue. On the third, it will format the cells in the "OrderDate" column to have a longer date format.

  • Autofilters will be automatically expanded with the <#DataTable.**> tag. You only need to set them in the cell with the tag.

Files

AssemblyInfo.cs

using System.Reflection;
using System.Runtime.CompilerServices;

//
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
//
[assembly: AssemblyTitle("")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("(c) 2002 - 2024 TMS Software")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

//
// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version
//      Build Number
//      Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:

[assembly: AssemblyVersion("7.21.0.0")]

//
// In order to sign your assembly you must specify a key to use. Refer to the
// Microsoft .NET Framework documentation for more information on assembly signing.
//
// Use the attributes below to control which key is used for signing.
//
// Notes:
//   (*) If no key is specified, the assembly is not signed.
//   (*) KeyName refers to a key that has been installed in the Crypto Service
//       Provider (CSP) on your machine. KeyFile refers to a file which contains
//       a key.
//   (*) If the KeyFile and the KeyName values are both specified, the
//       following processing occurs:
//       (1) If the KeyName can be found in the CSP, that key is used.
//       (2) If the KeyName does not exist and the KeyFile does exist, the key
//           in the KeyFile is installed into the CSP and used.
//   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
//       When specifying the KeyFile, the location of the KeyFile should be
//       relative to the project output directory which is
//       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
//       located in the project directory, you would specify the AssemblyKeyFile
//       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
//   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
//       documentation for more information on this.
//
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]
[assembly: AssemblyKeyName("")]

EnterSQLDialog.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;

namespace GenericReports
{
    /// <summary>
    /// A dialog where you can enter any SQL.
    /// </summary>
    public partial class EnterSQLDialog: System.Windows.Forms.Form
    {

        public EnterSQLDialog()
        {
            InitializeComponent();
        }

        public string SQL
        {
            get
            {
                return edSQL.Text;
            }
        }
    }
}

EnterSQLDialog.Designer.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
namespace GenericReports
{
    public partial class EnterSQLDialog: System.Windows.Forms.Form
    {
        private System.Windows.Forms.TextBox edSQL;
        private System.Windows.Forms.Panel panel1;
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.Panel panel2;
        private System.Windows.Forms.Button btnCancel;
        private System.Windows.Forms.Button button1;
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.Container components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.edSQL = new System.Windows.Forms.TextBox();
            this.panel1 = new System.Windows.Forms.Panel();
            this.label1 = new System.Windows.Forms.Label();
            this.panel2 = new System.Windows.Forms.Panel();
            this.btnCancel = new System.Windows.Forms.Button();
            this.button1 = new System.Windows.Forms.Button();
            this.panel1.SuspendLayout();
            this.panel2.SuspendLayout();
            this.SuspendLayout();
            //
            // edSQL
            //
            this.edSQL.Dock = System.Windows.Forms.DockStyle.Fill;
            this.edSQL.Location = new System.Drawing.Point(0, 24);
            this.edSQL.Multiline = true;
            this.edSQL.Name = "edSQL";
            this.edSQL.Size = new System.Drawing.Size(520, 125);
            this.edSQL.TabIndex = 0;
            this.edSQL.Text = "Select * from orders";
            //
            // panel1
            //
            this.panel1.BackColor = System.Drawing.Color.Gray;
            this.panel1.Controls.Add(this.label1);
            this.panel1.Dock = System.Windows.Forms.DockStyle.Top;
            this.panel1.ForeColor = System.Drawing.Color.White;
            this.panel1.Location = new System.Drawing.Point(0, 0);
            this.panel1.Name = "panel1";
            this.panel1.Size = new System.Drawing.Size(520, 24);
            this.panel1.TabIndex = 1;
            //
            // label1
            //
            this.label1.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
            this.label1.Location = new System.Drawing.Point(17, 6);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(296, 23);
            this.label1.TabIndex = 0;
            this.label1.Text = "Enter SQL to execute";
            //
            // panel2
            //
            this.panel2.BackColor = System.Drawing.Color.Gray;
            this.panel2.Controls.Add(this.btnCancel);
            this.panel2.Controls.Add(this.button1);
            this.panel2.Dock = System.Windows.Forms.DockStyle.Bottom;
            this.panel2.ForeColor = System.Drawing.Color.White;
            this.panel2.Location = new System.Drawing.Point(0, 149);
            this.panel2.Name = "panel2";
            this.panel2.Size = new System.Drawing.Size(520, 40);
            this.panel2.TabIndex = 2;
            //
            // btnCancel
            //
            this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.btnCancel.BackColor = System.Drawing.Color.FromArgb(((System.Byte)(192)), ((System.Byte)(0)), ((System.Byte)(0)));
            this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            this.btnCancel.ForeColor = System.Drawing.Color.White;
            this.btnCancel.Location = new System.Drawing.Point(400, 9);
            this.btnCancel.Name = "btnCancel";
            this.btnCancel.Size = new System.Drawing.Size(112, 23);
            this.btnCancel.TabIndex = 5;
            this.btnCancel.Text = "Cancel";
            //
            // button1
            //
            this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.button1.BackColor = System.Drawing.Color.Green;
            this.button1.DialogResult = System.Windows.Forms.DialogResult.OK;
            this.button1.ForeColor = System.Drawing.Color.White;
            this.button1.Location = new System.Drawing.Point(280, 9);
            this.button1.Name = "button1";
            this.button1.Size = new System.Drawing.Size(112, 23);
            this.button1.TabIndex = 4;
            this.button1.Text = "Ok";
            //
            // EnterSQLDialog
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(520, 189);
            this.Controls.Add(this.edSQL);
            this.Controls.Add(this.panel2);
            this.Controls.Add(this.panel1);
            this.Name = "EnterSQLDialog";
            this.Text = "Information";
            this.panel1.ResumeLayout(false);
            this.panel2.ResumeLayout(false);
            this.ResumeLayout(false);

        }
        #endregion
    }
}

Form1.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using System.Diagnostics;
using System.Reflection;
using System.Data.OleDb;
using System.Threading;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using FlexCel.Report;

namespace GenericReports
{
    /// <summary>
    /// A generic report.
    /// </summary>
    public partial class mainForm: System.Windows.Forms.Form
    {
        private EnterSQLDialog SqlDialog;

        public mainForm()
        {
            InitializeComponent();
            ResizeToolbar(mainToolbar);
        }

        private void ResizeToolbar(ToolStrip toolbar)
        {

            using (Graphics gr = CreateGraphics())
            {
                double xFactor = gr.DpiX / 96.0;
                double yFactor = gr.DpiY / 96.0;
                toolbar.ImageScalingSize = new Size((int)(24 * xFactor), (int)(24 * yFactor));
                toolbar.Width = 0; //force a recalc of the buttons.
            }
        }

        private void button2_Click(object sender, System.EventArgs e)
        {
            Close();
        }

        private void btnOpenconnection_Click(object sender, System.EventArgs e)
        {
            string DataPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + Path.DirectorySeparatorChar;
            string ConfigFile = DataPath + "GenericReports.udl";
            if (!File.Exists(ConfigFile))
                using (FileStream f = File.Create(ConfigFile))
                {
                    //Nothing, create an empty udl.
                }

            using (Process p = new Process())
            {
                p.StartInfo.FileName = ConfigFile;
                p.StartInfo.UseShellExecute = true;
                p.Start();
            }
        }

        private void btnQuery_Click(object sender, System.EventArgs e)
        {
            string DataPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + Path.DirectorySeparatorChar;
            string ConfigFile = DataPath + "GenericReports.udl";
            Connection.Close();
            dataSet = new DataSet();

            Connection.ConnectionString = "File Name = " + ConfigFile;

            Connection.Open();

            if (SqlDialog == null) SqlDialog = new EnterSQLDialog();

            if (SqlDialog.ShowDialog() != DialogResult.OK)
                return;

            dbDataAdapter.SelectCommand = new OleDbCommand(SqlDialog.SQL, Connection);
            dbDataAdapter.Fill(dataSet, "Table");
            dataGrid.CaptionText = dbDataAdapter.SelectCommand.CommandText;
            dataGrid.SetDataBinding(dataSet, "Table");
        }

        private void Export(string SQL, out string DataPath)
        {
            Report.ClearTables();
            Report.AddTable(dataSet);
            Report.SetValue("Date", DateTime.Now);
            Report.SetValue("ReportCaption", SQL);

            DataPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + Path.DirectorySeparatorChar; //First try to find the template on exe folder.

            if (!File.Exists(DataPath + "Generic Reports.template.xls")) //When on design mode, search for the template 2 folders up.
                DataPath = Path.Combine(DataPath, Path.Combine("..", "..")) + Path.DirectorySeparatorChar;
        }

        private void btnExportExcel_Click(object sender, System.EventArgs e)
        {
            string DataPath = null;
            if (dbDataAdapter == null || dbDataAdapter.SelectCommand == null || dbDataAdapter.SelectCommand.CommandText == null)
            {
                MessageBox.Show("You need to select a query first");
                return;
            }
            Export(dbDataAdapter.SelectCommand.CommandText, out DataPath);

            if (saveFileDialog1.ShowDialog() == DialogResult.OK)
            {
                Report.Run(DataPath + "Generic Reports.template.xls", saveFileDialog1.FileName);

                if (MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    using (Process p = new Process())
                    {
                        p.StartInfo.FileName = saveFileDialog1.FileName;
                        p.StartInfo.UseShellExecute = true;
                        p.Start();
                    }
                }
            }
        }
    }
}

Form1.Designer.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using System.Diagnostics;
using System.Reflection;
using System.Data.OleDb;
using System.Threading;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using FlexCel.Report;
namespace GenericReports
{
    public partial class mainForm: System.Windows.Forms.Form
    {
        private System.Windows.Forms.SaveFileDialog saveFileDialog1;
        private System.Data.DataSet dataSet;
        private System.Windows.Forms.DataGrid dataGrid;
        private System.Data.OleDb.OleDbConnection Connection;
        private System.Data.OleDb.OleDbDataAdapter dbDataAdapter;
        private FlexCel.Report.FlexCelReport Report;
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(mainForm));
            this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog();
            this.Report = new FlexCel.Report.FlexCelReport();
            this.Connection = new System.Data.OleDb.OleDbConnection();
            this.dataSet = new System.Data.DataSet();
            this.dataGrid = new System.Windows.Forms.DataGrid();
            this.dbDataAdapter = new System.Data.OleDb.OleDbDataAdapter();
            this.mainToolbar = new System.Windows.Forms.ToolStrip();
            this.btnOpenConnection = new System.Windows.Forms.ToolStripButton();
            this.btnQuery = new System.Windows.Forms.ToolStripButton();
            this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
            this.btnExportExcel = new System.Windows.Forms.ToolStripButton();
            this.btnExit = new System.Windows.Forms.ToolStripButton();
            ((System.ComponentModel.ISupportInitialize)(this.dataSet)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.dataGrid)).BeginInit();
            this.mainToolbar.SuspendLayout();
            this.SuspendLayout();
            //
            // saveFileDialog1
            //
            this.saveFileDialog1.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm|Excel 97/2003|*.xls|Excel 2007|*.xlsx;*.xlsm|All " +
    "files|*.*";
            this.saveFileDialog1.RestoreDirectory = true;
            //
            // Report
            //
            this.Report.AllowOverwritingFiles = true;
            this.Report.DeleteEmptyBands = FlexCel.Report.TDeleteEmptyBands.ClearDataAndFormats;
            this.Report.DeleteEmptyRanges = false;
            //
            // dataSet
            //
            this.dataSet.DataSetName = "NewDataSet";
            this.dataSet.Locale = new System.Globalization.CultureInfo("es-ES");
            //
            // dataGrid
            //
            this.dataGrid.DataMember = "";
            this.dataGrid.Dock = System.Windows.Forms.DockStyle.Fill;
            this.dataGrid.HeaderForeColor = System.Drawing.SystemColors.ControlText;
            this.dataGrid.Location = new System.Drawing.Point(0, 38);
            this.dataGrid.Name = "dataGrid";
            this.dataGrid.Size = new System.Drawing.Size(528, 239);
            this.dataGrid.TabIndex = 4;
            //
            // mainToolbar
            //
            this.mainToolbar.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.btnOpenConnection,
            this.btnQuery,
            this.toolStripSeparator1,
            this.btnExportExcel,
            this.btnExit});
            this.mainToolbar.Location = new System.Drawing.Point(0, 0);
            this.mainToolbar.Name = "mainToolbar";
            this.mainToolbar.Size = new System.Drawing.Size(528, 38);
            this.mainToolbar.TabIndex = 12;
            this.mainToolbar.Text = "mainToolbar";
            //
            // btnOpenConnection
            //
            this.btnOpenConnection.Image = ((System.Drawing.Image)(resources.GetObject("btnOpenConnection.Image")));
            this.btnOpenConnection.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.btnOpenConnection.Name = "btnOpenConnection";
            this.btnOpenConnection.Size = new System.Drawing.Size(103, 35);
            this.btnOpenConnection.Text = "Open connection";
            this.btnOpenConnection.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
            this.btnOpenConnection.Click += new System.EventHandler(this.btnOpenconnection_Click);
            //
            // btnQuery
            //
            this.btnQuery.Image = ((System.Drawing.Image)(resources.GetObject("btnQuery.Image")));
            this.btnQuery.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.btnQuery.Name = "btnQuery";
            this.btnQuery.Size = new System.Drawing.Size(70, 35);
            this.btnQuery.Text = "Query Data";
            this.btnQuery.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
            this.btnQuery.Click += new System.EventHandler(this.btnQuery_Click);
            //
            // toolStripSeparator1
            //
            this.toolStripSeparator1.Name = "toolStripSeparator1";
            this.toolStripSeparator1.Size = new System.Drawing.Size(6, 38);
            //
            // btnExportExcel
            //
            this.btnExportExcel.Image = ((System.Drawing.Image)(resources.GetObject("btnExportExcel.Image")));
            this.btnExportExcel.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.btnExportExcel.Name = "btnExportExcel";
            this.btnExportExcel.Size = new System.Drawing.Size(87, 35);
            this.btnExportExcel.Text = "Export to Excel";
            this.btnExportExcel.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
            this.btnExportExcel.Click += new System.EventHandler(this.btnExportExcel_Click);
            //
            // btnExit
            //
            this.btnExit.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right;
            this.btnExit.Image = ((System.Drawing.Image)(resources.GetObject("btnExit.Image")));
            this.btnExit.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.btnExit.Name = "btnExit";
            this.btnExit.Size = new System.Drawing.Size(59, 35);
            this.btnExit.Text = "     E&xit     ";
            this.btnExit.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
            this.btnExit.Click += new System.EventHandler(this.button2_Click);
            //
            // mainForm
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(528, 277);
            this.Controls.Add(this.dataGrid);
            this.Controls.Add(this.mainToolbar);
            this.Name = "mainForm";
            this.Text = "Generic Reports";
            ((System.ComponentModel.ISupportInitialize)(this.dataSet)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.dataGrid)).EndInit();
            this.mainToolbar.ResumeLayout(false);
            this.mainToolbar.PerformLayout();
            this.ResumeLayout(false);
            this.PerformLayout();

        }
        #endregion

        private ToolStrip mainToolbar;
        private ToolStripButton btnOpenConnection;
        private ToolStripButton btnQuery;
        private ToolStripSeparator toolStripSeparator1;
        private ToolStripButton btnExportExcel;
        private ToolStripButton btnExit;
    }
}

Program.cs

using System;
using System.Windows.Forms;
using System.Threading;

namespace GenericReports
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            ThreadExceptionHandler handler = new ThreadExceptionHandler();

            Application.ThreadException += new ThreadExceptionEventHandler(handler.Application_ThreadException);

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new mainForm());
        }
    }

    internal class ThreadExceptionHandler
    {
        public void Application_ThreadException(object sender, ThreadExceptionEventArgs e)
        {
            try
            {
                DialogResult result = ShowThreadExceptionDialog(
                    e.Exception);

                if (result == DialogResult.Abort)
                    Application.Exit();
            }
            catch
            {
                // Fatal error, terminate program
                try
                {
                    MessageBox.Show("Fatal Error",
                        "Fatal Error",
                        MessageBoxButtons.OK,
                        MessageBoxIcon.Stop);
                }
                finally
                {
                    Application.Exit();
                }
            }
        }

        ///
        /// Creates and displays the error message.
        ///
        private DialogResult ShowThreadExceptionDialog(Exception ex)
        {
            string errorMessage =
                "Unhandled Exception:\n\n" +
                ex.Message + "\n\n" +
                ex.GetType() +
                "\n\nStack Trace:\n" +
                ex.StackTrace;

            return MessageBox.Show(errorMessage,
                "Application Error",
                MessageBoxButtons.AbortRetryIgnore,
                MessageBoxIcon.Stop);
        }
    }

}


Generic reports Part 2 (C# / netframework) | FlexCel Studio for the .NET Framework documentation

Generic reports Part 2 (C# / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\csharp\VS2022\netframework\20.Reports\89.Generic Reports 2 and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​csharp/​VS2022/​netframework/​Modules/​20.​Reports/​89.​Generic Reports 2

Overview

In the previous example we saw how to use <#DataTable.*> and <#DataTable.**> to create generic reports. While this works in most common cases, there are times when you might need a more complex but also more powerful approach.

Concepts

  • You can create a generic report by doing a report that grows both in columns and in rows.

  • You can use Columns(Dataset) table definition in the config sheet to have a datasource that contains the columns of the dataset. You can then use this new datasource as a source for the horizontal report (with an I_range_I), so every column in the Excel file will have one entry in the datasource.

  • Different from "*" reports, here you can filter this column datasource and only show some columns, or order them.

  • You can use <#dbvalue> tag to get the value for a column or a row. Here we use it inside a report expression in the config sheet so we don't need to write the full dbvalue tag every time.

  • Different from "*" reports, columns here are not overwritten, they are inserted.

  • A problem with this type of reports is formatting. You will want to format all dates as dates, not numbers, and you might want to format numbers as currency and so on. Here we will use a simple user-defined function to return the datatype of the value, and if it is a date then format it as date.

Files

AssemblyInfo.cs

using System.Reflection;
using System.Runtime.CompilerServices;

//
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
//
[assembly: AssemblyTitle("")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("(c) 2002 - 2024 TMS Software")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

//
// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version
//      Build Number
//      Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:

[assembly: AssemblyVersion("7.21.0.0")]

//
// In order to sign your assembly you must specify a key to use. Refer to the
// Microsoft .NET Framework documentation for more information on assembly signing.
//
// Use the attributes below to control which key is used for signing.
//
// Notes:
//   (*) If no key is specified, the assembly is not signed.
//   (*) KeyName refers to a key that has been installed in the Crypto Service
//       Provider (CSP) on your machine. KeyFile refers to a file which contains
//       a key.
//   (*) If the KeyFile and the KeyName values are both specified, the
//       following processing occurs:
//       (1) If the KeyName can be found in the CSP, that key is used.
//       (2) If the KeyName does not exist and the KeyFile does exist, the key
//           in the KeyFile is installed into the CSP and used.
//   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
//       When specifying the KeyFile, the location of the KeyFile should be
//       relative to the project output directory which is
//       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
//       located in the project directory, you would specify the AssemblyKeyFile
//       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
//   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
//       documentation for more information on this.
//
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]
[assembly: AssemblyKeyName("")]

EnterSQLDialog.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;

namespace GenericReports2
{
    /// <summary>
    /// A dialog where you can enter any SQL.
    /// </summary>
    public partial class EnterSQLDialog: System.Windows.Forms.Form
    {

        public EnterSQLDialog()
        {
            InitializeComponent();
        }

        public string SQL
        {
            get
            {
                return edSQL.Text;
            }
        }
    }
}

EnterSQLDialog.Designer.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
namespace GenericReports2
{
    public partial class EnterSQLDialog: System.Windows.Forms.Form
    {
        private System.Windows.Forms.TextBox edSQL;
        private System.Windows.Forms.Panel panel1;
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.Panel panel2;
        private System.Windows.Forms.Button btnCancel;
        private System.Windows.Forms.Button button1;
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.Container components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.edSQL = new System.Windows.Forms.TextBox();
            this.panel1 = new System.Windows.Forms.Panel();
            this.label1 = new System.Windows.Forms.Label();
            this.panel2 = new System.Windows.Forms.Panel();
            this.btnCancel = new System.Windows.Forms.Button();
            this.button1 = new System.Windows.Forms.Button();
            this.panel1.SuspendLayout();
            this.panel2.SuspendLayout();
            this.SuspendLayout();
            //
            // edSQL
            //
            this.edSQL.Dock = System.Windows.Forms.DockStyle.Fill;
            this.edSQL.Location = new System.Drawing.Point(0, 24);
            this.edSQL.Multiline = true;
            this.edSQL.Name = "edSQL";
            this.edSQL.Size = new System.Drawing.Size(520, 125);
            this.edSQL.TabIndex = 0;
            this.edSQL.Text = "Select * from orders";
            //
            // panel1
            //
            this.panel1.BackColor = System.Drawing.Color.Gray;
            this.panel1.Controls.Add(this.label1);
            this.panel1.Dock = System.Windows.Forms.DockStyle.Top;
            this.panel1.ForeColor = System.Drawing.Color.White;
            this.panel1.Location = new System.Drawing.Point(0, 0);
            this.panel1.Name = "panel1";
            this.panel1.Size = new System.Drawing.Size(520, 24);
            this.panel1.TabIndex = 1;
            //
            // label1
            //
            this.label1.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
            this.label1.Location = new System.Drawing.Point(17, 6);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(296, 23);
            this.label1.TabIndex = 0;
            this.label1.Text = "Enter SQL to execute";
            //
            // panel2
            //
            this.panel2.BackColor = System.Drawing.Color.Gray;
            this.panel2.Controls.Add(this.btnCancel);
            this.panel2.Controls.Add(this.button1);
            this.panel2.Dock = System.Windows.Forms.DockStyle.Bottom;
            this.panel2.ForeColor = System.Drawing.Color.White;
            this.panel2.Location = new System.Drawing.Point(0, 149);
            this.panel2.Name = "panel2";
            this.panel2.Size = new System.Drawing.Size(520, 40);
            this.panel2.TabIndex = 2;
            //
            // btnCancel
            //
            this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.btnCancel.BackColor = System.Drawing.Color.FromArgb(((System.Byte)(192)), ((System.Byte)(0)), ((System.Byte)(0)));
            this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            this.btnCancel.ForeColor = System.Drawing.Color.White;
            this.btnCancel.Location = new System.Drawing.Point(400, 9);
            this.btnCancel.Name = "btnCancel";
            this.btnCancel.Size = new System.Drawing.Size(112, 23);
            this.btnCancel.TabIndex = 5;
            this.btnCancel.Text = "Cancel";
            //
            // button1
            //
            this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.button1.BackColor = System.Drawing.Color.Green;
            this.button1.DialogResult = System.Windows.Forms.DialogResult.OK;
            this.button1.ForeColor = System.Drawing.Color.White;
            this.button1.Location = new System.Drawing.Point(280, 9);
            this.button1.Name = "button1";
            this.button1.Size = new System.Drawing.Size(112, 23);
            this.button1.TabIndex = 4;
            this.button1.Text = "Ok";
            //
            // EnterSQLDialog
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(520, 189);
            this.Controls.Add(this.edSQL);
            this.Controls.Add(this.panel2);
            this.Controls.Add(this.panel1);
            this.Name = "EnterSQLDialog";
            this.Text = "Information";
            this.panel1.ResumeLayout(false);
            this.panel2.ResumeLayout(false);
            this.ResumeLayout(false);

        }
        #endregion
    }
}

Form1.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using System.Diagnostics;
using System.Reflection;
using System.Data.OleDb;
using System.Threading;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using FlexCel.Report;

namespace GenericReports2
{
    /// <summary>
    /// A generic report.
    /// </summary>
    public partial class mainForm: System.Windows.Forms.Form
    {
        private EnterSQLDialog SqlDialog;

        public mainForm()
        {
            InitializeComponent();
            ResizeToolbar(mainToolbar);
        }

        private void ResizeToolbar(ToolStrip toolbar)
        {

            using (Graphics gr = CreateGraphics())
            {
                double xFactor = gr.DpiX / 96.0;
                double yFactor = gr.DpiY / 96.0;
                toolbar.ImageScalingSize = new Size((int)(24 * xFactor), (int)(24 * yFactor));
                toolbar.Width = 0; //force a recalc of the buttons.
            }
        }

        private void button2_Click(object sender, System.EventArgs e)
        {
            Close();
        }

        private void btnOpenconnection_Click(object sender, System.EventArgs e)
        {
            string DataPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + Path.DirectorySeparatorChar;
            string ConfigFile = DataPath + "GenericReports2.udl";
            if (!File.Exists(ConfigFile))
                using (FileStream f = File.Create(ConfigFile))
                {
                    //Nothing, create an empty udl.
                }

            using (Process p = new Process())
            {
                p.StartInfo.FileName = ConfigFile;
                p.StartInfo.UseShellExecute = true;
                p.Start();
            }
        }

        private void btnQuery_Click(object sender, System.EventArgs e)
        {
            string DataPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + Path.DirectorySeparatorChar;
            string ConfigFile = DataPath + "GenericReports2.udl";
            Connection.Close();
            dataSet = new DataSet();

            Connection.ConnectionString = "File Name = " + ConfigFile;

            Connection.Open();

            if (SqlDialog == null) SqlDialog = new EnterSQLDialog();

            if (SqlDialog.ShowDialog() != DialogResult.OK)
                return;

            dbDataAdapter.SelectCommand = new OleDbCommand(SqlDialog.SQL, Connection);
            dbDataAdapter.Fill(dataSet, "Table");
            dataGrid.CaptionText = dbDataAdapter.SelectCommand.CommandText;
            dataGrid.SetDataBinding(dataSet, "Table");
        }

        private void Export(string SQL, out string DataPath)
        {
            Report.ClearTables();
            Report.AddTable(dataSet);
            Report.SetValue("Date", DateTime.Now);
            Report.SetValue("ReportCaption", SQL);
            Report.SetUserFunction("datatype", new DataTypeImp());

            DataPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + Path.DirectorySeparatorChar; //First try to find the template on exe folder.

            if (!File.Exists(DataPath + "Generic Reports 2.template.xls")) //When on design mode, search for the template 2 folders up.
                DataPath = Path.Combine(DataPath, Path.Combine("..", "..")) + Path.DirectorySeparatorChar;
        }

        private void btnExportExcel_Click(object sender, System.EventArgs e)
        {
            string DataPath = null;
            if (dbDataAdapter == null || dbDataAdapter.SelectCommand == null || dbDataAdapter.SelectCommand.CommandText == null)
            {
                MessageBox.Show("You need to select a query first");
                return;
            }
            Export(dbDataAdapter.SelectCommand.CommandText, out DataPath);

            if (saveFileDialog1.ShowDialog() == DialogResult.OK)
            {
                Report.Run(DataPath + "Generic Reports 2.template.xls", saveFileDialog1.FileName);

                if (MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    using (Process p = new Process())
                    {
                        p.StartInfo.FileName = saveFileDialog1.FileName;
                        p.StartInfo.UseShellExecute = true;
                        p.Start();
                    }
                }
            }
        }
    }

    /// <summary>
    /// A small used-defined function to know the type of the value inserted.
    /// </summary>
    public class DataTypeImp: TFlexCelUserFunction
    {
        public override object Evaluate(object[] parameters)
        {
            if (parameters == null || parameters.Length != 1)
            {
                throw new Exception("DataType must be called with 1 parameter.");
            }

            if (parameters[0] is double) return "double";
            if (parameters[0] is DateTime) return "datetime";
            return "";
        }
    }
}

Form1.Designer.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using System.Diagnostics;
using System.Reflection;
using System.Data.OleDb;
using System.Threading;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using FlexCel.Report;

namespace GenericReports2
{
    public partial class mainForm: System.Windows.Forms.Form
    {
        private System.Windows.Forms.SaveFileDialog saveFileDialog1;
        private System.Data.DataSet dataSet;
        private System.Windows.Forms.DataGrid dataGrid;
        private System.Data.OleDb.OleDbConnection Connection;
        private System.Data.OleDb.OleDbDataAdapter dbDataAdapter;
        private FlexCel.Report.FlexCelReport Report;
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(mainForm));
            this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog();
            this.Report = new FlexCel.Report.FlexCelReport();
            this.Connection = new System.Data.OleDb.OleDbConnection();
            this.dataSet = new System.Data.DataSet();
            this.dataGrid = new System.Windows.Forms.DataGrid();
            this.dbDataAdapter = new System.Data.OleDb.OleDbDataAdapter();
            this.mainToolbar = new System.Windows.Forms.ToolStrip();
            this.btnOpenConnection = new System.Windows.Forms.ToolStripButton();
            this.btnQuery = new System.Windows.Forms.ToolStripButton();
            this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
            this.btnExportExcel = new System.Windows.Forms.ToolStripButton();
            this.btnExit = new System.Windows.Forms.ToolStripButton();
            ((System.ComponentModel.ISupportInitialize)(this.dataSet)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.dataGrid)).BeginInit();
            this.mainToolbar.SuspendLayout();
            this.SuspendLayout();
            //
            // saveFileDialog1
            //
            this.saveFileDialog1.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm|Excel 97/2003|*.xls|Excel 2007|*.xlsx;*.xlsm|All " +
    "files|*.*";
            this.saveFileDialog1.RestoreDirectory = true;
            //
            // Report
            //
            this.Report.AllowOverwritingFiles = true;
            this.Report.DeleteEmptyBands = FlexCel.Report.TDeleteEmptyBands.ClearDataAndFormats;
            this.Report.DeleteEmptyRanges = false;
            //
            // dataSet
            //
            this.dataSet.DataSetName = "NewDataSet";
            this.dataSet.Locale = new System.Globalization.CultureInfo("es-ES");
            //
            // dataGrid
            //
            this.dataGrid.DataMember = "";
            this.dataGrid.Dock = System.Windows.Forms.DockStyle.Fill;
            this.dataGrid.HeaderForeColor = System.Drawing.SystemColors.ControlText;
            this.dataGrid.Location = new System.Drawing.Point(0, 38);
            this.dataGrid.Name = "dataGrid";
            this.dataGrid.Size = new System.Drawing.Size(528, 239);
            this.dataGrid.TabIndex = 4;
            //
            // mainToolbar
            //
            this.mainToolbar.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.btnOpenConnection,
            this.btnQuery,
            this.toolStripSeparator1,
            this.btnExportExcel,
            this.btnExit});
            this.mainToolbar.Location = new System.Drawing.Point(0, 0);
            this.mainToolbar.Name = "mainToolbar";
            this.mainToolbar.Size = new System.Drawing.Size(528, 38);
            this.mainToolbar.TabIndex = 11;
            this.mainToolbar.Text = "mainToolbar";
            //
            // btnOpenConnection
            //
            this.btnOpenConnection.Image = ((System.Drawing.Image)(resources.GetObject("btnOpenConnection.Image")));
            this.btnOpenConnection.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.btnOpenConnection.Name = "btnOpenConnection";
            this.btnOpenConnection.Size = new System.Drawing.Size(103, 35);
            this.btnOpenConnection.Text = "Open connection";
            this.btnOpenConnection.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
            this.btnOpenConnection.Click += new System.EventHandler(this.btnOpenconnection_Click);
            //
            // btnQuery
            //
            this.btnQuery.Image = ((System.Drawing.Image)(resources.GetObject("btnQuery.Image")));
            this.btnQuery.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.btnQuery.Name = "btnQuery";
            this.btnQuery.Size = new System.Drawing.Size(70, 35);
            this.btnQuery.Text = "Query Data";
            this.btnQuery.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
            this.btnQuery.Click += new System.EventHandler(this.btnQuery_Click);
            //
            // toolStripSeparator1
            //
            this.toolStripSeparator1.Name = "toolStripSeparator1";
            this.toolStripSeparator1.Size = new System.Drawing.Size(6, 38);
            //
            // btnExportExcel
            //
            this.btnExportExcel.Image = ((System.Drawing.Image)(resources.GetObject("btnExportExcel.Image")));
            this.btnExportExcel.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.btnExportExcel.Name = "btnExportExcel";
            this.btnExportExcel.Size = new System.Drawing.Size(87, 35);
            this.btnExportExcel.Text = "Export to Excel";
            this.btnExportExcel.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
            this.btnExportExcel.Click += new System.EventHandler(this.btnExportExcel_Click);
            //
            // btnExit
            //
            this.btnExit.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right;
            this.btnExit.Image = ((System.Drawing.Image)(resources.GetObject("btnExit.Image")));
            this.btnExit.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.btnExit.Name = "btnExit";
            this.btnExit.Size = new System.Drawing.Size(59, 35);
            this.btnExit.Text = "     E&xit     ";
            this.btnExit.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
            this.btnExit.Click += new System.EventHandler(this.button2_Click);
            //
            // mainForm
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(528, 277);
            this.Controls.Add(this.dataGrid);
            this.Controls.Add(this.mainToolbar);
            this.Name = "mainForm";
            this.Text = "Generic Reports 2";
            ((System.ComponentModel.ISupportInitialize)(this.dataSet)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.dataGrid)).EndInit();
            this.mainToolbar.ResumeLayout(false);
            this.mainToolbar.PerformLayout();
            this.ResumeLayout(false);
            this.PerformLayout();

        }
        #endregion

        private ToolStrip mainToolbar;
        private ToolStripButton btnOpenConnection;
        private ToolStripButton btnQuery;
        private ToolStripSeparator toolStripSeparator1;
        private ToolStripButton btnExportExcel;
        private ToolStripButton btnExit;
    }
}

Program.cs

using System;
using System.Windows.Forms;
using System.Threading;

namespace GenericReports2
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            ThreadExceptionHandler handler = new ThreadExceptionHandler();

            Application.ThreadException += new ThreadExceptionEventHandler(handler.Application_ThreadException);

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new mainForm());
        }
    }

    internal class ThreadExceptionHandler
    {
        public void Application_ThreadException(object sender, ThreadExceptionEventArgs e)
        {
            try
            {
                DialogResult result = ShowThreadExceptionDialog(
                    e.Exception);

                if (result == DialogResult.Abort)
                    Application.Exit();
            }
            catch
            {
                // Fatal error, terminate program
                try
                {
                    MessageBox.Show("Fatal Error",
                        "Fatal Error",
                        MessageBoxButtons.OK,
                        MessageBoxIcon.Stop);
                }
                finally
                {
                    Application.Exit();
                }
            }
        }

        ///
        /// Creates and displays the error message.
        ///
        private DialogResult ShowThreadExceptionDialog(Exception ex)
        {
            string errorMessage =
                "Unhandled Exception:\n\n" +
                ex.Message + "\n\n" +
                ex.GetType() +
                "\n\nStack Trace:\n" +
                ex.StackTrace;

            return MessageBox.Show(errorMessage,
                "Application Error",
                MessageBoxButtons.AbortRetryIgnore,
                MessageBoxIcon.Stop);
        }
    }

}


Meta templates (C# / netframework) | FlexCel Studio for the .NET Framework documentation

Meta templates (C# / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\csharp\VS2022\netframework\20.Reports\90.Meta Templates and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​csharp/​VS2022/​netframework/​Modules/​20.​Reports/​90.​Meta Templates

Overview

FlexCel allows self-modifying templates, that can adapt themselves to the data that is going to be reported. This provides other way to create generic reports, besides what is shown in the Generic Reports example. But the utility of meta templates can go much further.

In this example, we have a template that will show rss feeds. If the feed contains a pubDate field, it will be added. If it doesn't, the row will be deleted from the template before running the report.

Concepts

  • You can use the <#Preprocess> tag to evaluate expressions when the template is being read. You can delete columns and rows, clear fields, etc. Once the preprocessing is over, the report will be run on the modified template.

  • Database fields and expressions can have default values, that will be applied when the field or expression does not exist. For example: <#DataTable.field;20> will evaluate to the value in DataTable.Field if Field exists, or 20 otherwise.

  • The <#Defined> tag can be used to know wheter a field or table is defined or not, and to for example delete the column if the field does not exist.

Files

AssemblyInfo.cs

using System.Reflection;
using System.Runtime.CompilerServices;

//
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
//
[assembly: AssemblyTitle("")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("(c) 2002 - 2024 TMS Software")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

//
// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version
//      Build Number
//      Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:

[assembly: AssemblyVersion("7.21.0.0")]

//
// In order to sign your assembly you must specify a key to use. Refer to the
// Microsoft .NET Framework documentation for more information on assembly signing.
//
// Use the attributes below to control which key is used for signing.
//
// Notes:
//   (*) If no key is specified, the assembly is not signed.
//   (*) KeyName refers to a key that has been installed in the Crypto Service
//       Provider (CSP) on your machine. KeyFile refers to a file which contains
//       a key.
//   (*) If the KeyFile and the KeyName values are both specified, the
//       following processing occurs:
//       (1) If the KeyName can be found in the CSP, that key is used.
//       (2) If the KeyName does not exist and the KeyFile does exist, the key
//           in the KeyFile is installed into the CSP and used.
//   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
//       When specifying the KeyFile, the location of the KeyFile should be
//       relative to the project output directory which is
//       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
//       located in the project directory, you would specify the AssemblyKeyFile
//       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
//   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
//       documentation for more information on this.
//
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]
[assembly: AssemblyKeyName("")]

Form1.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using System.Diagnostics;
using System.Reflection;
using System.Data.OleDb;
using System.Threading;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using FlexCel.Report;

using System.Xml;

namespace MetaTemplates
{
    /// <summary>
    /// Templates that self-modify themselves before running.
    /// </summary>
    public partial class mainForm: System.Windows.Forms.Form
    {

        public mainForm()
        {
            InitializeComponent();
        }

        public struct FeedData
        {
            public string Name;
            public string Url;
            public string Logo;

            public FeedData(string aName, string aUrl, string aLogo)
            {
                Name = aName;
                Url = aUrl;
                Logo = aLogo;
            }

            public override string ToString()
            {
                return Name;
            }
        }

        private FeedData[] Feeds =
                {
                new FeedData("TMS", "https://www.tmssoftware.com/rss/tms.xml", "tms.gif"),
                new FeedData("MSDN","https://sxpdata.microsoft.com/feeds/3.0/msdntn/MSDNMagazine_enus", "msdn.jpg"),
                new FeedData("SLASHDOT" , "http://rss.slashdot.org/Slashdot/slashdot", "slashdot.gif")
                };

        private void button2_Click(object sender, System.EventArgs e)
        {
            Close();
        }

        private string DataPath
        {
            get
            {
                return Path.Combine(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), ".."), "..") + Path.DirectorySeparatorChar;
            }
        }

        private void Export(DataSet data)
        {
            using (FlexCelReport Report = new FlexCelReport(true))
            {
                Report.AddTable(data);
                Report.SetValue("FeedName", ((FeedData)cbFeeds.SelectedValue).Name);
                Report.SetValue("FeedUrl", ((FeedData)cbFeeds.SelectedValue).Url);
                Report.SetValue("ShowCount", cbShowFeedCount.Checked);

                using (FileStream fs = new FileStream(Path.Combine(Path.Combine(DataPath, "logos"), ((FeedData)cbFeeds.SelectedValue).Logo), FileMode.Open))
                {
                    byte[] b = new byte[fs.Length];
                    fs.Read(b, 0, b.Length);
                    Report.SetValue("Logo", b);
                }
                Report.Run(DataPath + "Meta Templates.template.xls", saveFileDialog1.FileName);
            }

        }

        private void btnExportExcel_Click(object sender, System.EventArgs e)
        {

            using (DataSet data = new DataSet())
            {
                string LocalData = Path.Combine(Path.Combine(DataPath, "data"), ((FeedData)cbFeeds.SelectedValue).Name + ".xml");

                if (cbOffline.Checked)
                {
                    data.ReadXml(LocalData);
                }
                else
                {
                    //In a real world example, this should be done on a thread, as it is done in the HTML example.
                    //To keep things simple here ,we will just "freeze" the gui while downloading the data, without
                    //providing feedback to the user.
                    XmlTextReader FeedReader = new XmlTextReader(((FeedData)cbFeeds.SelectedValue).Url);
                    data.ReadXml(FeedReader);
                }

#if (SaveForOffline)
                data.WriteXml(LocalData);
#endif

                if (saveFileDialog1.ShowDialog() == DialogResult.OK)
                {
                    Export(data);

                    if (MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) == DialogResult.Yes)
                    {
                        using (Process p = new Process())
                        {
                            p.StartInfo.FileName = saveFileDialog1.FileName;
                            p.StartInfo.UseShellExecute = true;
                            p.Start();
                        }
                    }
                }
            }
        }

        private void mainForm_Load(object sender, System.EventArgs e)
        {
            cbFeeds.DataSource = Feeds;
            cbFeeds.SelectedIndex = 0;
        }

    }
}

Form1.Designer.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using System.Diagnostics;
using System.Reflection;
using System.Data.OleDb;
using System.Threading;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using FlexCel.Report;
using System.Xml;
namespace MetaTemplates
{
    public partial class mainForm: System.Windows.Forms.Form
    {
        private System.Windows.Forms.SaveFileDialog saveFileDialog1;
        private System.Windows.Forms.Panel panel2;
        private System.Windows.Forms.Button button2;
        private System.Windows.Forms.Button btnExportExcel;
        private System.Windows.Forms.ComboBox cbFeeds;
        private System.Windows.Forms.CheckBox cbOffline;
        private System.Windows.Forms.CheckBox cbShowFeedCount;
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(mainForm));
            this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog();
            this.panel2 = new System.Windows.Forms.Panel();
            this.button2 = new System.Windows.Forms.Button();
            this.btnExportExcel = new System.Windows.Forms.Button();
            this.cbFeeds = new System.Windows.Forms.ComboBox();
            this.cbOffline = new System.Windows.Forms.CheckBox();
            this.cbShowFeedCount = new System.Windows.Forms.CheckBox();
            this.panel2.SuspendLayout();
            this.SuspendLayout();
            //
            // saveFileDialog1
            //
            this.saveFileDialog1.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm|Excel 97/2003|*.xls|Excel 2007|*.xlsx;*.xlsm|All " +
    "files|*.*";
            this.saveFileDialog1.RestoreDirectory = true;
            //
            // panel2
            //
            this.panel2.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
            this.panel2.Controls.Add(this.button2);
            this.panel2.Controls.Add(this.btnExportExcel);
            this.panel2.Controls.Add(this.cbFeeds);
            this.panel2.Dock = System.Windows.Forms.DockStyle.Top;
            this.panel2.Location = new System.Drawing.Point(0, 0);
            this.panel2.Name = "panel2";
            this.panel2.Size = new System.Drawing.Size(528, 40);
            this.panel2.TabIndex = 3;
            //
            // button2
            //
            this.button2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.button2.BackColor = System.Drawing.SystemColors.Control;
            this.button2.Image = ((System.Drawing.Image)(resources.GetObject("button2.Image")));
            this.button2.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
            this.button2.Location = new System.Drawing.Point(464, 2);
            this.button2.Name = "button2";
            this.button2.Size = new System.Drawing.Size(56, 26);
            this.button2.TabIndex = 2;
            this.button2.Text = "Exit";
            this.button2.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            this.button2.UseVisualStyleBackColor = false;
            this.button2.Click += new System.EventHandler(this.button2_Click);
            //
            // btnExportExcel
            //
            this.btnExportExcel.BackColor = System.Drawing.SystemColors.Control;
            this.btnExportExcel.Image = ((System.Drawing.Image)(resources.GetObject("btnExportExcel.Image")));
            this.btnExportExcel.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
            this.btnExportExcel.Location = new System.Drawing.Point(16, 2);
            this.btnExportExcel.Name = "btnExportExcel";
            this.btnExportExcel.Size = new System.Drawing.Size(120, 30);
            this.btnExportExcel.TabIndex = 1;
            this.btnExportExcel.Text = "Export to Excel";
            this.btnExportExcel.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            this.btnExportExcel.UseVisualStyleBackColor = false;
            this.btnExportExcel.Click += new System.EventHandler(this.btnExportExcel_Click);
            //
            // cbFeeds
            //
            this.cbFeeds.DisplayMember = "1";
            this.cbFeeds.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.cbFeeds.Location = new System.Drawing.Point(200, 8);
            this.cbFeeds.Name = "cbFeeds";
            this.cbFeeds.Size = new System.Drawing.Size(216, 21);
            this.cbFeeds.TabIndex = 4;
            this.cbFeeds.ValueMember = "1";
            //
            // cbOffline
            //
            this.cbOffline.Checked = true;
            this.cbOffline.CheckState = System.Windows.Forms.CheckState.Checked;
            this.cbOffline.Location = new System.Drawing.Point(40, 56);
            this.cbOffline.Name = "cbOffline";
            this.cbOffline.Size = new System.Drawing.Size(368, 24);
            this.cbOffline.TabIndex = 5;
            this.cbOffline.Text = "Use offline data (do not connect to internet)";
            //
            // cbShowFeedCount
            //
            this.cbShowFeedCount.Location = new System.Drawing.Point(40, 80);
            this.cbShowFeedCount.Name = "cbShowFeedCount";
            this.cbShowFeedCount.Size = new System.Drawing.Size(360, 24);
            this.cbShowFeedCount.TabIndex = 6;
            this.cbShowFeedCount.Text = "Show feed number column in the generated report.";
            //
            // mainForm
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(528, 126);
            this.Controls.Add(this.cbShowFeedCount);
            this.Controls.Add(this.cbOffline);
            this.Controls.Add(this.panel2);
            this.Name = "mainForm";
            this.Text = "Meta Templates";
            this.Load += new System.EventHandler(this.mainForm_Load);
            this.panel2.ResumeLayout(false);
            this.ResumeLayout(false);

        }
        #endregion
    }
}

Program.cs

using System;
using System.Windows.Forms;

namespace MetaTemplates
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new mainForm());
        }
    }
}


User defined tables (C# / netframework) | FlexCel Studio for the .NET Framework documentation

User defined tables (C# / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\csharp\VS2022\netframework\20.Reports\91.User Tables and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​csharp/​VS2022/​netframework/​Modules/​20.​Reports/​91.​User Tables

Overview

User defined tables allow you to specify the datasets in the report part of the data layer. Different from Direct SQL, user tables work in a more controlled environment, where you can specifically deny or grant access to the data. User Tables also allow access not SQL databases.

Concepts

  • To use User Tables you need the following things:

    1. On the config sheet, write "User Table(parameters)" on the "Source Name" column, and something else on the "Table Name" column. What you write on the "Table Name" column is really not important, but you need to write something so FlexCel knows that the row has information. Normally you would use this column to tell FlexCel what is the name of the datatable you want to add, but this is not a requirement.

    2. On the code, you need to define a UserTable event that will actually add the tables to the report base on what you write on the "parameters" and "table name" columns.

  • On this example, we just use the parameter as the name of the table we want to load, and use the "table name" column as the name of the table we will insert on the report. We could also use the parameter string as parameter to an SQL, but when doing this, please make sure you validate the parameter string against a hashtable of possible values, to avoid SQL injections attacks.

  • Even when we do not show it here, you could pass many parameters on the "Parameters" string, using your own defined parameter separator, and process this string on the event.

  • Unrelated to user tables, on this demo we also show how you can delete the categories that have no products, using a <#delete range> tag inside a <#if(<#products.#Rowcount>0 ) = 0> tag. Important note:* As FlexCel already deletes products that have no records, this will interfere with the <#Delete range> tag that will delete whole categories, and it would in fact delete one more row that what we need. So it is important that you make* **genericReport.DeleteEmptyRanges = false on the code before running the report.

Files

AssemblyInfo.cs

using System.Reflection;
using System.Runtime.CompilerServices;

//
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
//
[assembly: AssemblyTitle("")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("(c) 2002 - 2024 TMS Software")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

//
// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version
//      Build Number
//      Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:

[assembly: AssemblyVersion("7.21.0.0")]

//
// In order to sign your assembly you must specify a key to use. Refer to the
// Microsoft .NET Framework documentation for more information on assembly signing.
//
// Use the attributes below to control which key is used for signing.
//
// Notes:
//   (*) If no key is specified, the assembly is not signed.
//   (*) KeyName refers to a key that has been installed in the Crypto Service
//       Provider (CSP) on your machine. KeyFile refers to a file which contains
//       a key.
//   (*) If the KeyFile and the KeyName values are both specified, the
//       following processing occurs:
//       (1) If the KeyName can be found in the CSP, that key is used.
//       (2) If the KeyName does not exist and the KeyFile does exist, the key
//           in the KeyFile is installed into the CSP and used.
//   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
//       When specifying the KeyFile, the location of the KeyFile should be
//       relative to the project output directory which is
//       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
//       located in the project directory, you would specify the AssemblyKeyFile
//       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
//   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
//       documentation for more information on this.
//
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]
[assembly: AssemblyKeyName("")]

Form1.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using System.Diagnostics;
using System.Reflection;
using System.Resources;
using System.Globalization;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using FlexCel.Report;
using FlexCel.Demo.SharedData;

namespace UserTables
{
    /// <summary>
    /// Using tables that are defined in the template.
    /// </summary>
    public partial class mainForm: System.Windows.Forms.Form
    {

        public mainForm()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, System.EventArgs e)
        {
            AutoRun();
        }

        public void AutoRun()
        {
            using (FlexCelReport genericReport = new FlexCelReport(true))
            {
                genericReport.UserTable += new UserTableEventHandler(genericReport_UserTable);
                genericReport.DeleteEmptyRanges = false;

                string DataPath = Path.Combine(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), ".."), "..") + Path.DirectorySeparatorChar;

                if (saveFileDialog1.ShowDialog() == DialogResult.OK)
                {
                    genericReport.Run(DataPath + "User Tables.template" + Path.GetExtension(saveFileDialog1.FileName), saveFileDialog1.FileName);

                    if (MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) == DialogResult.Yes)
                    {
                        using (Process p = new Process())
                        {
                            p.StartInfo.FileName = saveFileDialog1.FileName;
                            p.StartInfo.UseShellExecute = true;
                            p.Start();
                        }
                    }
                }
            }
        }

        private void genericReport_UserTable(object sender, UserTableEventArgs e)
        {
            DataSet ds = new DataSet();

            //On this example we will just return the table with the name specified on parameters
            //but you could return whatever you wanted here.
            //As always, remember to *validate* what the user can enter on the parameters string.

            switch (e.Parameters.ToUpper(CultureInfo.InvariantCulture))
            {
                case "SUPPLIERS":
                    SharedData.Fill(ds, "select * from suppliers", e.TableName);
                    break;
                case "CATEGORIES":
                    SharedData.Fill(ds, "select * from categories", e.TableName);
                    break;
                case "PRODUCTS":
                    SharedData.Fill(ds, "select * from products", e.TableName);
                    break;

                default: throw new Exception("Invalid parameter to user table: " + e.Parameters);
            }

            ((FlexCelReport)sender).AddTable(ds, TDisposeMode.DisposeAfterRun);
        }

        private void btnCancel_Click(object sender, System.EventArgs e)
        {
            Close();
        }
    }

}

Form1.Designer.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using System.Diagnostics;
using System.Reflection;
using System.Resources;
using System.Globalization;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using FlexCel.Report;
namespace UserTables
{
    public partial class mainForm: System.Windows.Forms.Form
    {
        private System.Windows.Forms.Button button1;
        private System.Windows.Forms.SaveFileDialog saveFileDialog1;
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.Button btnCancel;
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.Container components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.button1 = new System.Windows.Forms.Button();
            this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog();
            this.label1 = new System.Windows.Forms.Label();
            this.btnCancel = new System.Windows.Forms.Button();
            this.SuspendLayout();
            //
            // button1
            //
            this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.button1.BackColor = System.Drawing.Color.Green;
            this.button1.ForeColor = System.Drawing.Color.White;
            this.button1.Location = new System.Drawing.Point(112, 136);
            this.button1.Name = "button1";
            this.button1.Size = new System.Drawing.Size(112, 23);
            this.button1.TabIndex = 0;
            this.button1.Text = "GO!";
            this.button1.UseVisualStyleBackColor = false;
            this.button1.Click += new System.EventHandler(this.button1_Click);
            //
            // saveFileDialog1
            //
            this.saveFileDialog1.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm|Excel 97/2003|*.xls|Excel 2007|*.xlsx;*.xlsm|All files|*.*";
            this.saveFileDialog1.RestoreDirectory = true;
            //
            // label1
            //
            this.label1.Location = new System.Drawing.Point(24, 24);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(288, 24);
            this.label1.TabIndex = 2;
            this.label1.Text = "A demo on how to use user tables on a report. ";
            //
            // btnCancel
            //
            this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.btnCancel.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
            this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            this.btnCancel.ForeColor = System.Drawing.Color.White;
            this.btnCancel.Location = new System.Drawing.Point(232, 136);
            this.btnCancel.Name = "btnCancel";
            this.btnCancel.Size = new System.Drawing.Size(112, 23);
            this.btnCancel.TabIndex = 3;
            this.btnCancel.Text = "Cancel";
            this.btnCancel.UseVisualStyleBackColor = false;
            this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
            //
            // mainForm
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(376, 166);
            this.Controls.Add(this.btnCancel);
            this.Controls.Add(this.label1);
            this.Controls.Add(this.button1);
            this.Name = "mainForm";
            this.Text = "User Tables";
            this.ResumeLayout(false);

        }
        #endregion
    }
}

Program.cs

using System;
using System.Windows.Forms;

namespace UserTables
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new mainForm());
        }
    }
}


Direct SQL (C# / netframework) | FlexCel Studio for the .NET Framework documentation

Direct SQL (C# / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\csharp\VS2022\netframework\20.Reports\92.Direct SQL and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​csharp/​VS2022/​netframework/​Modules/​20.​Reports/​92.​Direct SQL

Overview

In normal FlexCel reports, you create the data layer in code and the template in Excel. This allows your user to easily modify the presentation layer with Excel and without needing to modify the code.

While this is a very good choice for most reports (as the data layer does not change much, and the presentation does), sometimes you might want to allow your users to directly modify the data layer from Excel. This is when you can use Direct SQL in templates.

Concepts

  • By default, you can't use Direct SQL on reports. To be able to use it, you need to add a connection to the report with FlexCelReport.AddConnection in the code.

  • Allowing the final user to specify the SQL directly on the report might carry big security risks.

    1. A user might use the SQL to modify the data. For example, instead of a normal SQL like "select * from customer" he might write "delete from customers" and erase all information. While FlexCel does a little validation on the SQL string, (for example it will not allow SQLs not starting with "SELECT") there are always ways to modify the data.

    2. A user might get access to data you don't intend him to. For example, he might know the user passwords are on the table "Users" and use an existing unrelated report to get the data from this table.

  • To keep your application secure, it is recommended that:

  • You give Read Only access rights to the connection you add to the report, and only give access to the tables the report needs to use

  • You enable Direct SQL on cases where you can control the templates. For example on a web application (where the templates are always on the server) or a GUI App where templates are kept on a server. Or, of course, if you don't care about the data because it is not important, or the customer has administrator access to all the database anyway.

  • Do not use Encrypted templates to give security to the system. While this can give some extra security, encrypted xls files can be cracked with tools available in Internet.

  • To use Direct SQL on the templates, you write SQL(connection, sqlstring) on the "Source name" column in the config sheet.

  • You can't use expressions inside an SQL statement. The "sqlstring" you pass as parameter to the SQL() command will not allow any expression replacement. Again, this is a security decision to avoid SQL Injection attacks. (If you don't know what this is, you can search for "SQL injection" in Internet to get a more in-depth description of the problem)

  • As you can't use expressions inside the SQL, you need to be able to pass parameters to it. To pass a parameter to the SQL:

  • In SQL databases you can normally use two types of parameters: positional ("?") and named ("@param" or ":param"). On order to keep your templates database-independent, FlexCel Templates will always use named parameters starting with "@". Even if you are accessing ODBC, you should write "SELECT * from table where field = @field" and never "SELECT * from table where field = ?" in the template. The only supported syntax in templates is "@" parameters; FlexCel will convert the parameters to what's needed when calling the actual SQL.

  • You then can set the parameters in the code, by using FlexCelReport.AddSqlParameter This is not database independent, and you need to add the correct type of parameter for the actual database here.

Files

AssemblyInfo.cs

using System.Reflection;
using System.Runtime.CompilerServices;

//
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
//
[assembly: AssemblyTitle("")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("(c) 2002 - 2024 TMS Software")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

//
// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version
//      Build Number
//      Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:

[assembly: AssemblyVersion("7.21.0.0")]

//
// In order to sign your assembly you must specify a key to use. Refer to the
// Microsoft .NET Framework documentation for more information on assembly signing.
//
// Use the attributes below to control which key is used for signing.
//
// Notes:
//   (*) If no key is specified, the assembly is not signed.
//   (*) KeyName refers to a key that has been installed in the Crypto Service
//       Provider (CSP) on your machine. KeyFile refers to a file which contains
//       a key.
//   (*) If the KeyFile and the KeyName values are both specified, the
//       following processing occurs:
//       (1) If the KeyName can be found in the CSP, that key is used.
//       (2) If the KeyName does not exist and the KeyFile does exist, the key
//           in the KeyFile is installed into the CSP and used.
//   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
//       When specifying the KeyFile, the location of the KeyFile should be
//       relative to the project output directory which is
//       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
//       located in the project directory, you would specify the AssemblyKeyFile
//       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
//   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
//       documentation for more information on this.
//
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]
[assembly: AssemblyKeyName("")]

Form1.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using System.Diagnostics;
using System.Reflection;
using System.Resources;
using System.Globalization;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using FlexCel.Report;
using FlexCel.Demo.SharedData;

namespace DirectSQL
{
    /// <summary>
    /// Summary description for Form1.
    /// </summary>
    public partial class mainForm: System.Windows.Forms.Form
    {

        public mainForm()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, System.EventArgs e)
        {
            using (FlexCelReport genericReport = new FlexCelReport(true))
            {
                IDbDataAdapter genericAdapter = SharedData.GetDataAdapter();
                try
                {
                    genericReport.SetValue("ReportCaption", "Sales by Country and Employee");
                    genericReport.AddConnection("Northwind", genericAdapter, CultureInfo.CurrentCulture);

                    //In OleDb the parameters are positional, you don't really need to name them when creating them.
                    //But when you are using an SQL Server connection, you *need*
                    //to specify the parameter name ("@StartDate") and make it equal to "@" + the name
                    //of the parameter. It is recommended that you always specify the name, even in OleDb connections.

                    //Also, we are not going to create the parameters directly here (using new SqlCeParameter(...).
                    //We are going to centralize all data access for the demos in SharedData, so we can change it and change all demos.
                    genericReport.AddSqlParameter("StartDate", SharedData.CreateParameter("@StartDate", startDate.Value.Date));
                    genericReport.AddSqlParameter("EndDate", SharedData.CreateParameter("@EndDate", endDate.Value.Date));
                    string DataPath = Path.Combine(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), ".."), "..") + Path.DirectorySeparatorChar;

                    if (saveFileDialog1.ShowDialog() == DialogResult.OK)
                    {
                        genericReport.Run(DataPath + "Direct SQL.template.xls", saveFileDialog1.FileName);

                        if (MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) == DialogResult.Yes)
                        {
                            using (Process p = new Process())
                            {
                                p.StartInfo.FileName = saveFileDialog1.FileName;
                                p.StartInfo.UseShellExecute = true;
                                p.Start();
                            }
                        }
                    }
                }
                finally
                {
                    ((IDisposable)genericAdapter).Dispose();
                }
            }
        }

        private void btnCancel_Click(object sender, System.EventArgs e)
        {
            Close();
        }
    }

}

Form1.Designer.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using System.Diagnostics;
using System.Reflection;
using System.Resources;
using System.Globalization;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using FlexCel.Report;
namespace DirectSQL
{
    public partial class mainForm: System.Windows.Forms.Form
    {
        private System.Windows.Forms.Button button1;
        private System.Windows.Forms.SaveFileDialog saveFileDialog1;
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.Button btnCancel;
        private System.Windows.Forms.DateTimePicker startDate;
        private System.Windows.Forms.Label label2;
        private System.Windows.Forms.DateTimePicker endDate;
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.Container components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.button1 = new System.Windows.Forms.Button();
            this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog();
            this.label1 = new System.Windows.Forms.Label();
            this.btnCancel = new System.Windows.Forms.Button();
            this.startDate = new System.Windows.Forms.DateTimePicker();
            this.label2 = new System.Windows.Forms.Label();
            this.endDate = new System.Windows.Forms.DateTimePicker();
            this.SuspendLayout();
            //
            // button1
            //
            this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.button1.BackColor = System.Drawing.Color.Green;
            this.button1.ForeColor = System.Drawing.Color.White;
            this.button1.Location = new System.Drawing.Point(104, 136);
            this.button1.Name = "button1";
            this.button1.Size = new System.Drawing.Size(112, 23);
            this.button1.TabIndex = 0;
            this.button1.Text = "GO!";
            this.button1.UseVisualStyleBackColor = false;
            this.button1.Click += new System.EventHandler(this.button1_Click);
            //
            // saveFileDialog1
            //
            this.saveFileDialog1.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm|Excel 97/2003|*.xls|Excel 2007|*.xlsx;*.xlsm|All files|*.*";
            this.saveFileDialog1.RestoreDirectory = true;
            //
            // label1
            //
            this.label1.Location = new System.Drawing.Point(24, 24);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(288, 24);
            this.label1.TabIndex = 2;
            this.label1.Text = "A demo on how to use direct SQL on a report. ";
            //
            // btnCancel
            //
            this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.btnCancel.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
            this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            this.btnCancel.ForeColor = System.Drawing.Color.White;
            this.btnCancel.Location = new System.Drawing.Point(224, 136);
            this.btnCancel.Name = "btnCancel";
            this.btnCancel.Size = new System.Drawing.Size(112, 23);
            this.btnCancel.TabIndex = 3;
            this.btnCancel.Text = "Cancel";
            this.btnCancel.UseVisualStyleBackColor = false;
            this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
            //
            // startDate
            //
            this.startDate.Format = System.Windows.Forms.DateTimePickerFormat.Short;
            this.startDate.Location = new System.Drawing.Point(24, 80);
            this.startDate.Name = "startDate";
            this.startDate.Size = new System.Drawing.Size(144, 20);
            this.startDate.TabIndex = 4;
            this.startDate.Value = new System.DateTime(1996, 1, 1, 15, 55, 0, 0);
            //
            // label2
            //
            this.label2.Location = new System.Drawing.Point(24, 56);
            this.label2.Name = "label2";
            this.label2.Size = new System.Drawing.Size(224, 16);
            this.label2.TabIndex = 5;
            this.label2.Text = "Get orders between:";
            //
            // endDate
            //
            this.endDate.Format = System.Windows.Forms.DateTimePickerFormat.Short;
            this.endDate.Location = new System.Drawing.Point(192, 80);
            this.endDate.Name = "endDate";
            this.endDate.Size = new System.Drawing.Size(144, 20);
            this.endDate.TabIndex = 6;
            this.endDate.Value = new System.DateTime(1997, 1, 1, 0, 0, 0, 0);
            //
            // mainForm
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(368, 182);
            this.Controls.Add(this.endDate);
            this.Controls.Add(this.label2);
            this.Controls.Add(this.startDate);
            this.Controls.Add(this.btnCancel);
            this.Controls.Add(this.label1);
            this.Controls.Add(this.button1);
            this.Name = "mainForm";
            this.Text = "Direct SQL";
            this.ResumeLayout(false);

        }
        #endregion
    }
}

Program.cs

using System;
using System.Windows.Forms;

namespace DirectSQL
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new mainForm());
        }
    }
}


Master detail report on one table (C# / netframework) | FlexCel Studio for the .NET Framework documentation

Master detail report on one table (C# / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\csharp\VS2022\netframework\20.Reports\93.Master Detail on one Table and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​csharp/​VS2022/​netframework/​Modules/​20.​Reports/​93.​Master Detail on one Table

Overview

On this demo we see how to "split" one table into a master and a detail table, in order to group the data. If you have the choice on how to supply the report data is better to read different tables for master-report (to avoid duplicate data). But if you already have the data joined into one table, the Distinct and Relationship tags can help you get it back into different tables.

Look at Grouping Tables in the Report designer's guide for more information.

Concepts

  • How to use the "DISTINCT" filter to create a new master dataset with the unique records on a table.

  • You can use the DISTINCT filter on more than one column, by separating them with ";". Only records that have any of the columns different will be included.

  • How to use the "RELATIONSHIP" tag on the configuration sheet to relate two tables in master-detail. Note that different from the relationships you can set on the Data Layer, the relationships on the config sheet can be between tables on different datasets.

  • The Relationship syntax is a little more complex than distinct. You need to write "RELATIONSHIP" on the table name, then "Master->Detail" on source name (where Master is the parent table and Detail the child). After that, you need to write the field names that relate both tables on the "Filter" column. You can relate more than one field, with the syntax: MasterTableField1->CDetailTableField1;MasterTableField2->CDetailTableField2...etc.

  • How to use the <#Merge Range> tag to merge all the cells in the country column.

Files

AssemblyInfo.cs

using System.Reflection;
using System.Runtime.CompilerServices;

//
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
//
[assembly: AssemblyTitle("")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("(c) 2002 - 2024 TMS Software")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

//
// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version
//      Build Number
//      Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:

[assembly: AssemblyVersion("7.21.0.0")]

//
// In order to sign your assembly you must specify a key to use. Refer to the
// Microsoft .NET Framework documentation for more information on assembly signing.
//
// Use the attributes below to control which key is used for signing.
//
// Notes:
//   (*) If no key is specified, the assembly is not signed.
//   (*) KeyName refers to a key that has been installed in the Crypto Service
//       Provider (CSP) on your machine. KeyFile refers to a file which contains
//       a key.
//   (*) If the KeyFile and the KeyName values are both specified, the
//       following processing occurs:
//       (1) If the KeyName can be found in the CSP, that key is used.
//       (2) If the KeyName does not exist and the KeyFile does exist, the key
//           in the KeyFile is installed into the CSP and used.
//   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
//       When specifying the KeyFile, the location of the KeyFile should be
//       relative to the project output directory which is
//       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
//       located in the project directory, you would specify the AssemblyKeyFile
//       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
//   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
//       documentation for more information on this.
//
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]
[assembly: AssemblyKeyName("")]

Form1.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using System.Diagnostics;
using System.Reflection;
using System.Resources;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using FlexCel.Report;
using FlexCel.Demo.SharedData;

namespace MasterDetailononeTable
{
    /// <summary>
    /// How to split a table into 2.
    /// </summary>
    public partial class mainForm: System.Windows.Forms.Form
    {

        public mainForm()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, System.EventArgs e)
        {
            AutoRun();
        }

        public void AutoRun()
        {
            using (FlexCelReport ordersReport = SharedData.CreateReport())
            {
                ordersReport.SetValue("Date", DateTime.Now);
                ordersReport.SetValue("ReportCaption", "Sales by year and country");

                using (DataSet ds = new DataSet())
                {
                    SharedData.Fill(ds, @"SELECT Employees.Country, SUM([Order Details].UnitPrice * [Order Details].Quantity) AS Sales, COUNT([Order Details].Quantity) AS OrderCount, DatePart(yyyy, Orders.OrderDate) AS SaleYear, DatePart(q, Orders.OrderDate) AS Quarter FROM ((Employees INNER JOIN Orders ON Employees.EmployeeID = Orders.EmployeeID) INNER JOIN [Order Details] ON Orders.OrderID = [Order Details].OrderID) GROUP BY Employees.Country, DatePart(yyyy, Orders.OrderDate), DatePart(q, Orders.OrderDate)", "Data");
                    ordersReport.AddTable(ds);
                    string DataPath = Path.Combine(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), ".."), "..") + Path.DirectorySeparatorChar;

                    if (saveFileDialog1.ShowDialog() == DialogResult.OK)
                    {
                        ordersReport.Run(DataPath + "Master Detail on one Table.template.xls", saveFileDialog1.FileName);

                        if (MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) == DialogResult.Yes)
                        {
                            using (Process p = new Process())
                            {
                                p.StartInfo.FileName = saveFileDialog1.FileName;
                                p.StartInfo.UseShellExecute = true;
                                p.Start();
                            }
                        }
                    }
                }
            }
        }

        private void btnCancel_Click(object sender, System.EventArgs e)
        {
            Close();
        }
    }

}

Form1.Designer.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using System.Diagnostics;
using System.Reflection;
using System.Resources;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using FlexCel.Report;
namespace MasterDetailononeTable
{
    public partial class mainForm: System.Windows.Forms.Form
    {
        private System.Windows.Forms.Button button1;
        private System.Windows.Forms.SaveFileDialog saveFileDialog1;
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.Button btnCancel;
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.Container components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.button1 = new System.Windows.Forms.Button();
            this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog();
            this.label1 = new System.Windows.Forms.Label();
            this.btnCancel = new System.Windows.Forms.Button();
            this.SuspendLayout();
            //
            // button1
            //
            this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.button1.BackColor = System.Drawing.Color.Green;
            this.button1.ForeColor = System.Drawing.Color.White;
            this.button1.Location = new System.Drawing.Point(152, 88);
            this.button1.Name = "button1";
            this.button1.Size = new System.Drawing.Size(112, 23);
            this.button1.TabIndex = 0;
            this.button1.Text = "GO!";
            this.button1.UseVisualStyleBackColor = false;
            this.button1.Click += new System.EventHandler(this.button1_Click);
            //
            // saveFileDialog1
            //
            this.saveFileDialog1.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm|Excel 97/2003|*.xls|Excel 2007|*.xlsx;*.xlsm|All files|*.*";
            this.saveFileDialog1.RestoreDirectory = true;
            //
            // label1
            //
            this.label1.Location = new System.Drawing.Point(24, 24);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(352, 24);
            this.label1.TabIndex = 2;
            this.label1.Text = "A demo on how to create a Master-Detail report with only one table";
            //
            // btnCancel
            //
            this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.btnCancel.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
            this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            this.btnCancel.ForeColor = System.Drawing.Color.White;
            this.btnCancel.Location = new System.Drawing.Point(272, 88);
            this.btnCancel.Name = "btnCancel";
            this.btnCancel.Size = new System.Drawing.Size(112, 23);
            this.btnCancel.TabIndex = 3;
            this.btnCancel.Text = "Cancel";
            this.btnCancel.UseVisualStyleBackColor = false;
            this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
            //
            // mainForm
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(416, 133);
            this.Controls.Add(this.btnCancel);
            this.Controls.Add(this.label1);
            this.Controls.Add(this.button1);
            this.Name = "mainForm";
            this.Text = "Master-Detail on one table";
            this.ResumeLayout(false);

        }
        #endregion
    }
}

Program.cs

using System;
using System.Windows.Forms;

namespace MasterDetailononeTable
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new mainForm());
        }
    }
}


Merging similar cells (C# / netframework) | FlexCel Studio for the .NET Framework documentation

Merging similar cells (C# / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\csharp\VS2022\netframework\20.Reports\935.Merging Similar Cells and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​csharp/​VS2022/​netframework/​Modules/​20.​Reports/​935.​Merging Similar Cells

Overview

This demo is about how to perform a common task: Merging similar cells into one.

Concepts

  • There are 2 ways to merge similar cells in a sheet:

    1. Use a master-detail relationship. This is normally the way to go, just merge the master cells and have the details not merged. You can use as many master-detail levels as you want, and you can see this in the technique used in the first column of this demo.

    2. Use <#Merge Range> tags together with <#DbValue> tags. This can be useful when you want to do the merging in every column and you don't want to define a master and a detail table for each one of them. You need to be careful when using this method to check all the columns at the left (as shown in the "Ship country" column comment), not just the value at the last record.

Files

AssemblyInfo.cs

using System.Reflection;
using System.Runtime.CompilerServices;

//
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
//
[assembly: AssemblyTitle("")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("(c) 2002 - 2024 TMS Software")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

//
// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version
//      Build Number
//      Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:

[assembly: AssemblyVersion("7.21.0.0")]

//
// In order to sign your assembly you must specify a key to use. Refer to the
// Microsoft .NET Framework documentation for more information on assembly signing.
//
// Use the attributes below to control which key is used for signing.
//
// Notes:
//   (*) If no key is specified, the assembly is not signed.
//   (*) KeyName refers to a key that has been installed in the Crypto Service
//       Provider (CSP) on your machine. KeyFile refers to a file which contains
//       a key.
//   (*) If the KeyFile and the KeyName values are both specified, the
//       following processing occurs:
//       (1) If the KeyName can be found in the CSP, that key is used.
//       (2) If the KeyName does not exist and the KeyFile does exist, the key
//           in the KeyFile is installed into the CSP and used.
//   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
//       When specifying the KeyFile, the location of the KeyFile should be
//       relative to the project output directory which is
//       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
//       located in the project directory, you would specify the AssemblyKeyFile
//       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
//   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
//       documentation for more information on this.
//
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]
[assembly: AssemblyKeyName("")]

Form1.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using System.Diagnostics;
using System.Reflection;
using System.Resources;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using FlexCel.Report;
using FlexCel.Demo.SharedData;

namespace MergingSimilarCells
{
    public partial class mainForm: System.Windows.Forms.Form
    {
        public mainForm()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, System.EventArgs e)
        {
            AutoRun();
        }

        public void AutoRun()
        {
            using (FlexCelReport ordersReport = SharedData.CreateReport())
            {

                string DataPath = Path.Combine(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), ".."), "..") + Path.DirectorySeparatorChar;

                if (saveFileDialog1.ShowDialog() == DialogResult.OK)
                {
                    ordersReport.Run(DataPath + "Merging Similar Cells.template.xls", saveFileDialog1.FileName);

                    if (MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) == DialogResult.Yes)
                    {
                        using (Process p = new Process())
                        {
                            p.StartInfo.FileName = saveFileDialog1.FileName;
                            p.StartInfo.UseShellExecute = true;
                            p.Start();
                        }
                    }
                }
            }
        }

        private void btnCancel_Click(object sender, System.EventArgs e)
        {
            Close();
        }
    }
}

Form1.Designer.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using System.Diagnostics;
using System.Reflection;
using System.Resources;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using FlexCel.Report;
using FlexCel.Demo.SharedData;
namespace MergingSimilarCells
{
    public partial class mainForm: System.Windows.Forms.Form
    {
        private System.Windows.Forms.Button button1;
        private System.Windows.Forms.SaveFileDialog saveFileDialog1;
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.Button btnCancel;
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.Container components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if ((components != null))
                {
                    components.Dispose();
                }
            }
            base.Dispose(disposing);
        }

        #region "Windows Form Designer generated code"
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.button1 = new System.Windows.Forms.Button();
            this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog();
            this.label1 = new System.Windows.Forms.Label();
            this.btnCancel = new System.Windows.Forms.Button();
            this.SuspendLayout();
            //
            // button1
            //
            this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.button1.BackColor = System.Drawing.Color.Green;
            this.button1.ForeColor = System.Drawing.Color.White;
            this.button1.Location = new System.Drawing.Point(152, 88);
            this.button1.Name = "button1";
            this.button1.Size = new System.Drawing.Size(112, 23);
            this.button1.TabIndex = 0;
            this.button1.Text = "GO!";
            this.button1.UseVisualStyleBackColor = false;
            this.button1.Click += new System.EventHandler(this.button1_Click);
            //
            // saveFileDialog1
            //
            this.saveFileDialog1.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm|Excel 97/2003|*.xls|Excel 2007|*.xlsx;*.xlsm|All files|*.*";
            this.saveFileDialog1.RestoreDirectory = true;
            //
            // label1
            //
            this.label1.Location = new System.Drawing.Point(24, 24);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(352, 24);
            this.label1.TabIndex = 2;
            this.label1.Text = "A demo on how to merge similar cells when creating a report";
            //
            // btnCancel
            //
            this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.btnCancel.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
            this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            this.btnCancel.ForeColor = System.Drawing.Color.White;
            this.btnCancel.Location = new System.Drawing.Point(272, 88);
            this.btnCancel.Name = "btnCancel";
            this.btnCancel.Size = new System.Drawing.Size(112, 23);
            this.btnCancel.TabIndex = 3;
            this.btnCancel.Text = "Cancel";
            this.btnCancel.UseVisualStyleBackColor = false;
            this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
            //
            // mainForm
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(416, 133);
            this.Controls.Add(this.btnCancel);
            this.Controls.Add(this.label1);
            this.Controls.Add(this.button1);
            this.Name = "mainForm";
            this.Text = "Merging similar cells";
            this.ResumeLayout(false);

        }
        #endregion

    }
}

Program.cs

using System;
using System.Windows.Forms;

namespace MergingSimilarCells
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new mainForm());
        }
    }
}


Splitting datasets (C# / netframework) | FlexCel Studio for the .NET Framework documentation

Splitting datasets (C# / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\csharp\VS2022\netframework\20.Reports\94.Split Datasets and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​csharp/​VS2022/​netframework/​Modules/​20.​Reports/​94.​Split Datasets

Overview

It is a normal request when doing a report for printing, to be able to manipulate the page breaks so there are no "hanging" lines at the end or beginning of a page. Since Excel does not provide this functionality, it is impossible for us to do it. But, you can use the <#SPLIT> tag on the config sheet to for example fit 40 records on each page.

Concepts

  • How to use the SPLIT tag to create a master-detail relationship of a dataset with itself, where each detail has a fixed number of records.

  • The SPLIT tag is a little special in that it does not create a real dataset, but it filters the data on the fly instead. This has some restrictions, the most important being that the master dataset and the clhild must be in direct relationship one with the other. If MasterOrders and Orders are both master and detail, you can not have MasterOrders/Other/Orders ranges each one inside the other. You must have Other/MasterOrders/Orders or Orders/MasterOrders/Other. This restriction normally is harmless.

  • It is not shown on this demo, but note that you could use a parameter on the "record count" parameter of the split tag. For example: <#Split(table;<#splitcount>)> and dinamically change the split range on the application before running the report.

Files

AssemblyInfo.cs

using System.Reflection;
using System.Runtime.CompilerServices;

//
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
//
[assembly: AssemblyTitle("")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("(c) 2002 - 2024 TMS Software")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

//
// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version
//      Build Number
//      Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:

[assembly: AssemblyVersion("7.21.0.0")]

//
// In order to sign your assembly you must specify a key to use. Refer to the
// Microsoft .NET Framework documentation for more information on assembly signing.
//
// Use the attributes below to control which key is used for signing.
//
// Notes:
//   (*) If no key is specified, the assembly is not signed.
//   (*) KeyName refers to a key that has been installed in the Crypto Service
//       Provider (CSP) on your machine. KeyFile refers to a file which contains
//       a key.
//   (*) If the KeyFile and the KeyName values are both specified, the
//       following processing occurs:
//       (1) If the KeyName can be found in the CSP, that key is used.
//       (2) If the KeyName does not exist and the KeyFile does exist, the key
//           in the KeyFile is installed into the CSP and used.
//   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
//       When specifying the KeyFile, the location of the KeyFile should be
//       relative to the project output directory which is
//       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
//       located in the project directory, you would specify the AssemblyKeyFile
//       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
//   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
//       documentation for more information on this.
//
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]
[assembly: AssemblyKeyName("")]

Form1.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using System.Diagnostics;
using System.Reflection;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using FlexCel.Report;
using FlexCel.Demo.SharedData;

namespace SplitDatasets
{
    public partial class mainForm: System.Windows.Forms.Form
    {

        public mainForm()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, System.EventArgs e)
        {
            AutoRun();
        }

        public void AutoRun()
        {
            using (FlexCelReport ordersReport = SharedData.CreateReport())
            {
                string DataPath = Path.Combine(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), ".."), "..") + Path.DirectorySeparatorChar;

                if (saveFileDialog1.ShowDialog() == DialogResult.OK)
                {
                    ordersReport.Run(DataPath + "Split Datasets.template.xls", saveFileDialog1.FileName);

                    if (MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) == DialogResult.Yes)
                    {
                        using (Process p = new Process())
                        {
                            p.StartInfo.FileName = saveFileDialog1.FileName;
                            p.StartInfo.UseShellExecute = true;
                            p.Start();
                        }
                    }
                }
            }
        }

        private void btnCancel_Click(object sender, System.EventArgs e)
        {
            Close();
        }
    }

}

Form1.Designer.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using System.Diagnostics;
using System.Reflection;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using FlexCel.Report;
using FlexCel.Demo.SharedData;
namespace SplitDatasets
{
    public partial class mainForm: System.Windows.Forms.Form
    {
        private System.Windows.Forms.Button button1;
        private System.Windows.Forms.SaveFileDialog saveFileDialog1;
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.Button btnCancel;
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.Container components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.button1 = new System.Windows.Forms.Button();
            this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog();
            this.label1 = new System.Windows.Forms.Label();
            this.btnCancel = new System.Windows.Forms.Button();
            this.SuspendLayout();
            //
            // button1
            //
            this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.button1.BackColor = System.Drawing.Color.Green;
            this.button1.ForeColor = System.Drawing.Color.White;
            this.button1.Location = new System.Drawing.Point(152, 88);
            this.button1.Name = "button1";
            this.button1.Size = new System.Drawing.Size(112, 23);
            this.button1.TabIndex = 0;
            this.button1.Text = "GO!";
            this.button1.UseVisualStyleBackColor = false;
            this.button1.Click += new System.EventHandler(this.button1_Click);
            //
            // saveFileDialog1
            //
            this.saveFileDialog1.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm|Excel 97/2003|*.xls|Excel 2007|*.xlsx;*.xlsm|All files|*.*";
            this.saveFileDialog1.RestoreDirectory = true;
            //
            // label1
            //
            this.label1.Location = new System.Drawing.Point(24, 24);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(328, 24);
            this.label1.TabIndex = 2;
            this.label1.Text = "Shows how to split a dataset into groups of n records.";
            //
            // btnCancel
            //
            this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.btnCancel.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
            this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            this.btnCancel.ForeColor = System.Drawing.Color.White;
            this.btnCancel.Location = new System.Drawing.Point(272, 88);
            this.btnCancel.Name = "btnCancel";
            this.btnCancel.Size = new System.Drawing.Size(112, 23);
            this.btnCancel.TabIndex = 3;
            this.btnCancel.Text = "Cancel";
            this.btnCancel.UseVisualStyleBackColor = false;
            this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
            //
            // mainForm
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(416, 133);
            this.Controls.Add(this.btnCancel);
            this.Controls.Add(this.label1);
            this.Controls.Add(this.button1);
            this.Name = "mainForm";
            this.Text = "Split Datasets";
            this.ResumeLayout(false);

        }
        #endregion
    }
}

Program.cs

using System;
using System.Windows.Forms;

namespace SplitDatasets
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new mainForm());
        }
    }
}


Fixed footer (C# / netframework) | FlexCel Studio for the .NET Framework documentation

Fixed footer (C# / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\csharp\VS2022\netframework\20.Reports\94a.Fixed Footer and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​csharp/​VS2022/​netframework/​Modules/​20.​Reports/​94a.​Fixed Footer

Overview

When doing simple headers and footers, like for example printing "Page n of m" in every page, then Excel's built-in headers and footers should be enough. But sometimes you need more complex headers or footers, and you need to define them in the cells.

For headers, Excel provides a "Rows to repeat at top" and "Columns to repeat at left" command that allow you to repeat a range of cells in every printed page. But to do footers, Excel doesn't provide a similar "Rows to repeat at bottom" or "Columns to repeat at right". If you need complex footers, then the only option is to manually split the dataset in groups of n rows, and manually copy the footer every time.

Concepts

  • How to use the SPLIT tag (look at Splitting Tables in the Reports designer's guide) to create a report with 40 records per page.

  • How to use the "multiple of" parameter in ATLEAST (look at Ensuring a table has at least N records in the Reports designer's guide) to ensure the dataset has a number of records multiple of 40. This makes sure that the footer will be at the bottom of the last page, not after the last record.

Files

AssemblyInfo.cs

using System.Reflection;
using System.Runtime.CompilerServices;

//
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
//
[assembly: AssemblyTitle("")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("(c) 2002 - 2024 TMS Software")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

//
// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version
//      Build Number
//      Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:

[assembly: AssemblyVersion("7.21.0.0")]

//
// In order to sign your assembly you must specify a key to use. Refer to the
// Microsoft .NET Framework documentation for more information on assembly signing.
//
// Use the attributes below to control which key is used for signing.
//
// Notes:
//   (*) If no key is specified, the assembly is not signed.
//   (*) KeyName refers to a key that has been installed in the Crypto Service
//       Provider (CSP) on your machine. KeyFile refers to a file which contains
//       a key.
//   (*) If the KeyFile and the KeyName values are both specified, the
//       following processing occurs:
//       (1) If the KeyName can be found in the CSP, that key is used.
//       (2) If the KeyName does not exist and the KeyFile does exist, the key
//           in the KeyFile is installed into the CSP and used.
//   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
//       When specifying the KeyFile, the location of the KeyFile should be
//       relative to the project output directory which is
//       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
//       located in the project directory, you would specify the AssemblyKeyFile
//       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
//   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
//       documentation for more information on this.
//
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]
[assembly: AssemblyKeyName("")]

Form1.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using System.Diagnostics;
using System.Reflection;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using FlexCel.Report;
using FlexCel.Demo.SharedData;

namespace FixedFooter
{
    /// <summary>
    /// Form-Like reports
    /// </summary>
    public partial class mainForm: System.Windows.Forms.Form
    {

        public mainForm()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, System.EventArgs e)
        {
            AutoRun();
        }

        public void AutoRun()
        {
            using (FlexCelReport ordersReport = SharedData.CreateReport())
            {
                ordersReport.SetValue("Date", DateTime.Now);

                string DataPath = Path.Combine(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), ".."), "..") + Path.DirectorySeparatorChar;

                if (saveFileDialog1.ShowDialog() == DialogResult.OK)
                {
                    ordersReport.Run(DataPath + "Fixed Footer.template" + Path.GetExtension(saveFileDialog1.FileName), saveFileDialog1.FileName);

                    if (MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) == DialogResult.Yes)
                    {
                        using (Process p = new Process())
                        {
                            p.StartInfo.FileName = saveFileDialog1.FileName;
                            p.StartInfo.UseShellExecute = true;
                            p.Start();
                        }
                    }
                }
            }
        }

        private void btnCancel_Click(object sender, System.EventArgs e)
        {
            Close();
        }
    }

}

Form1.Designer.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using System.Diagnostics;
using System.Reflection;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using FlexCel.Report;
using FlexCel.Demo.SharedData;
namespace FixedFooter
{
    public partial class mainForm: System.Windows.Forms.Form
    {
        private System.Windows.Forms.Button button1;
        private System.Windows.Forms.SaveFileDialog saveFileDialog1;
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.Button btnCancel;
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.Container components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.button1 = new System.Windows.Forms.Button();
            this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog();
            this.label1 = new System.Windows.Forms.Label();
            this.btnCancel = new System.Windows.Forms.Button();
            this.SuspendLayout();
            //
            // button1
            //
            this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.button1.BackColor = System.Drawing.Color.Green;
            this.button1.ForeColor = System.Drawing.Color.White;
            this.button1.Location = new System.Drawing.Point(152, 88);
            this.button1.Name = "button1";
            this.button1.Size = new System.Drawing.Size(112, 23);
            this.button1.TabIndex = 0;
            this.button1.Text = "GO!";
            this.button1.UseVisualStyleBackColor = false;
            this.button1.Click += new System.EventHandler(this.button1_Click);
            //
            // saveFileDialog1
            //
            this.saveFileDialog1.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm|Excel 97/2003|*.xls|Excel 2007|*.xlsx;*.xlsm|All files|*.*";
            this.saveFileDialog1.RestoreDirectory = true;
            //
            // label1
            //
            this.label1.Location = new System.Drawing.Point(24, 24);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(288, 24);
            this.label1.TabIndex = 2;
            this.label1.Text = "A report with a fixed footer";
            //
            // btnCancel
            //
            this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.btnCancel.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
            this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            this.btnCancel.ForeColor = System.Drawing.Color.White;
            this.btnCancel.Location = new System.Drawing.Point(272, 88);
            this.btnCancel.Name = "btnCancel";
            this.btnCancel.Size = new System.Drawing.Size(112, 23);
            this.btnCancel.TabIndex = 3;
            this.btnCancel.Text = "Cancel";
            this.btnCancel.UseVisualStyleBackColor = false;
            this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
            //
            // mainForm
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(416, 133);
            this.Controls.Add(this.btnCancel);
            this.Controls.Add(this.label1);
            this.Controls.Add(this.button1);
            this.Name = "mainForm";
            this.Text = "Fixed Footer Report";
            this.ResumeLayout(false);

        }
        #endregion
    }
}

Program.cs

using System;
using System.Windows.Forms;

namespace FixedFooter
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new mainForm());
        }
    }
}


Overflowing data in different sheets (C# / netframework) | FlexCel Studio for the .NET Framework documentation

Overflowing data in different sheets (C# / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\csharp\VS2022\netframework\20.Reports\94b.Overflow sheets and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​csharp/​VS2022/​netframework/​Modules/​20.​Reports/​94b.​Overflow sheets

Overview

THIS DEMO NEEDS .NET 3.5 OR NEWER. YOU COULD DO THE SAME IN .NET 2.0, BUT THIS PARTICULAR DEMO USES LINQ.

For very big datasets, it might happen that they don't fit in a single sheet. In xls files, you can have a maximum of 65536 rows, and in xlsx 1048576 rows. If you want to dump bigger datasets than the maximum available (or you just want to allow say a maximum of 100 records in a sheet and after it is reached move to the next), then you might use the SPLIT tag as a master in the sheet.

Take a look at Splitting Tables in the Report designer's guide for more information.

Concepts

  • How to use the SPLIT tag to create a master-detail relationship of a dataset with itself, where each detail has a fixed number of records. This way you can limit the number of records that you show in each sheet.

  • How to use the Evaluate tag to provide a meaningful sheet name.

Files

AssemblyInfo.cs

using System.Reflection;
using System.Runtime.CompilerServices;

//
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
//
[assembly: AssemblyTitle("")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("(c) 2002 - 2024 TMS Software")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

//
// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version
//      Build Number
//      Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:

[assembly: AssemblyVersion("7.21.0.0")]

//
// In order to sign your assembly you must specify a key to use. Refer to the
// Microsoft .NET Framework documentation for more information on assembly signing.
//
// Use the attributes below to control which key is used for signing.
//
// Notes:
//   (*) If no key is specified, the assembly is not signed.
//   (*) KeyName refers to a key that has been installed in the Crypto Service
//       Provider (CSP) on your machine. KeyFile refers to a file which contains
//       a key.
//   (*) If the KeyFile and the KeyName values are both specified, the
//       following processing occurs:
//       (1) If the KeyName can be found in the CSP, that key is used.
//       (2) If the KeyName does not exist and the KeyFile does exist, the key
//           in the KeyFile is installed into the CSP and used.
//   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
//       When specifying the KeyFile, the location of the KeyFile should be
//       relative to the project output directory which is
//       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
//       located in the project directory, you would specify the AssemblyKeyFile
//       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
//   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
//       documentation for more information on this.
//
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]
[assembly: AssemblyKeyName("")]

Form1.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using System.Diagnostics;
using System.Reflection;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using FlexCel.Report;

namespace Overflowsheets
{
    public partial class mainForm : System.Windows.Forms.Form
    {

        public mainForm()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, System.EventArgs e)
        {
            AutoRun();
        }

        public void AutoRun()
        {
            using (FlexCelReport Report = new FlexCelReport(true))
            {
                TMyData[] Data = new TMyData[1010];
                for (int i = 0; i < Data.Length; i++)
                {
                    Data[i] = new TMyData("Customer " + i.ToString());
                }
                Report.AddTable("data", Data);
                Report.SetValue("split", 40);

                string DataPath = Path.Combine(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), ".."), "..") + Path.DirectorySeparatorChar;

                if (saveFileDialog1.ShowDialog() == DialogResult.OK)
                {
                    Report.Run(DataPath + "Overflow Sheets.template.xlsx", saveFileDialog1.FileName);

                    if (MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) == DialogResult.Yes)
                    {
                        using (Process p = new Process())
                        {
                            p.StartInfo.FileName = saveFileDialog1.FileName;
                            p.StartInfo.UseShellExecute = true;
                            p.Start();
                        }
                    }
                }
            }
        }

        private void btnCancel_Click(object sender, System.EventArgs e)
        {
            Close();
        }
    }

    class TMyData
    {
        public string Name { get; set; }

        public TMyData(string name)
        {
            this.Name = name;
        }
    }

}

Form1.Designer.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using System.Diagnostics;
using System.Reflection;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using FlexCel.Report;
namespace Overflowsheets
{
    public partial class mainForm : System.Windows.Forms.Form
    {
        private System.Windows.Forms.Button button1;
        private System.Windows.Forms.SaveFileDialog saveFileDialog1;
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.Button btnCancel;
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.Container components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose( bool disposing )
        {
            if( disposing )
            {
                if (components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose( disposing );
        }

        #region Windows Form Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.button1 = new System.Windows.Forms.Button();
            this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog();
            this.label1 = new System.Windows.Forms.Label();
            this.btnCancel = new System.Windows.Forms.Button();
            this.SuspendLayout();
            //
            // button1
            //
            this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.button1.BackColor = System.Drawing.Color.Green;
            this.button1.ForeColor = System.Drawing.Color.White;
            this.button1.Location = new System.Drawing.Point(152, 88);
            this.button1.Name = "btnGo";
            this.button1.Size = new System.Drawing.Size(112, 23);
            this.button1.TabIndex = 0;
            this.button1.Text = "GO!";
            this.button1.UseVisualStyleBackColor = false;
            this.button1.Click += new System.EventHandler(this.button1_Click);
            //
            // saveFileDialog1
            //
            this.saveFileDialog1.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm|Excel 97/2003|*.xls|Excel 2007|*.xlsx;*.xlsm|All files|*.*";
            this.saveFileDialog1.RestoreDirectory = true;
            //
            // label1
            //
            this.label1.Location = new System.Drawing.Point(24, 24);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(428, 24);
            this.label1.TabIndex = 2;
            this.label1.Text = "Shows how to split a report in multiple sheets with n records per sheet.";
            //
            // btnCancel
            //
            this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.btnCancel.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
            this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            this.btnCancel.ForeColor = System.Drawing.Color.White;
            this.btnCancel.Location = new System.Drawing.Point(272, 88);
            this.btnCancel.Name = "btnCancel";
            this.btnCancel.Size = new System.Drawing.Size(112, 23);
            this.btnCancel.TabIndex = 3;
            this.btnCancel.Text = "Cancel";
            this.btnCancel.UseVisualStyleBackColor = false;
            this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
            //
            // mainForm
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(416, 133);
            this.Controls.Add(this.btnCancel);
            this.Controls.Add(this.label1);
            this.Controls.Add(this.button1);
            this.Name = "mainForm";
            this.Text = "Overflow Sheets";
            this.ResumeLayout(false);

        }
        #endregion
    }
}

Program.cs

using System;
using System.Windows.Forms;

namespace Overflowsheets
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new mainForm());
        }
    }
}


User defined functions (C# / netframework) | FlexCel Studio for the .NET Framework documentation

User defined functions (C# / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\csharp\VS2022\netframework\20.Reports\95.User Defined Functions and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​csharp/​VS2022/​netframework/​Modules/​20.​Reports/​95.​User Defined Functions

Overview

Here we will see how to define a user function to calculate the number of orders by employee and shipper. This example is similar to the Pivot Tables example, but using only static normal cells.

Concepts

  • How to define user functions for non-standard needs. By the way: Try to define only as little user functions as you really need. User functions are on code, and a change on them means that you have to recompile the code.

  • We defined two ranges here, one horizontal and one vertical. The user defined function here will return a value for a couple of those values, allowing us to create a "static" pivot table.

Files

AssemblyInfo.cs

using System.Reflection;
using System.Runtime.CompilerServices;

//
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
//
[assembly: AssemblyTitle("")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("(c) 2002 - 2024 TMS Software")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

//
// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version
//      Build Number
//      Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:

[assembly: AssemblyVersion("7.21.0.0")]

//
// In order to sign your assembly you must specify a key to use. Refer to the
// Microsoft .NET Framework documentation for more information on assembly signing.
//
// Use the attributes below to control which key is used for signing.
//
// Notes:
//   (*) If no key is specified, the assembly is not signed.
//   (*) KeyName refers to a key that has been installed in the Crypto Service
//       Provider (CSP) on your machine. KeyFile refers to a file which contains
//       a key.
//   (*) If the KeyFile and the KeyName values are both specified, the
//       following processing occurs:
//       (1) If the KeyName can be found in the CSP, that key is used.
//       (2) If the KeyName does not exist and the KeyFile does exist, the key
//           in the KeyFile is installed into the CSP and used.
//   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
//       When specifying the KeyFile, the location of the KeyFile should be
//       relative to the project output directory which is
//       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
//       located in the project directory, you would specify the AssemblyKeyFile
//       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
//   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
//       documentation for more information on this.
//
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]
[assembly: AssemblyKeyName("")]

Form1.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using System.Diagnostics;
using System.Reflection;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using FlexCel.Report;
using FlexCel.Demo.SharedData;

namespace UserDefinedFunctions
{
    public partial class mainForm: System.Windows.Forms.Form
    {

        public mainForm()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, System.EventArgs e)
        {
            AutoRun();
        }

        public void AutoRun()
        {
            using (FlexCelReport ordersReport = SharedData.CreateReport())
            {
                ordersReport.SetValue("Date", DateTime.Now);
                ordersReport.SetUserFunction("Orders", new OrdersImp(SharedData.GetOrders()));

                string DataPath = Path.Combine(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), ".."), "..") + Path.DirectorySeparatorChar;

                if (saveFileDialog1.ShowDialog() == DialogResult.OK)
                {
                    ordersReport.Run(DataPath + "User Defined Functions.template.xls", saveFileDialog1.FileName);

                    if (MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) == DialogResult.Yes)
                    {
                        using (Process p = new Process())
                        {
                            p.StartInfo.FileName = saveFileDialog1.FileName;
                            p.StartInfo.UseShellExecute = true;
                            p.Start();
                        }
                    }
                }
            }
        }

        private void btnCancel_Click(object sender, System.EventArgs e)
        {
            Close();
        }

    }

    #region Orders Implementation
    class OrdersImp: TFlexCelUserFunction
    {
        DataView OrdersDv;

        public OrdersImp(DataTable OrdersTable)
        {
            OrdersDv = new DataView(OrdersTable, String.Empty, "EmployeeID,ShipVia", DataViewRowState.CurrentRows);
        }
        public override object Evaluate(object[] parameters)
        {
            if (parameters == null || parameters.Length != 2)
                throw new ArgumentException("Bad parameter count in call to Orders() user-defined function");

            int Count = OrdersDv.FindRows(parameters).Length;
            if (Count > 0) return Count; else return null;
        }
    }
    #endregion

}

Form1.Designer.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using System.Diagnostics;
using System.Reflection;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using FlexCel.Report;
using FlexCel.Demo.SharedData;
namespace UserDefinedFunctions
{
    public partial class mainForm: System.Windows.Forms.Form
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.Container components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.button1 = new System.Windows.Forms.Button();
            this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog();
            this.label1 = new System.Windows.Forms.Label();
            this.btnCancel = new System.Windows.Forms.Button();
            this.SuspendLayout();
            //
            // button1
            //
            this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.button1.BackColor = System.Drawing.Color.Green;
            this.button1.ForeColor = System.Drawing.Color.White;
            this.button1.Location = new System.Drawing.Point(152, 88);
            this.button1.Name = "button1";
            this.button1.Size = new System.Drawing.Size(112, 23);
            this.button1.TabIndex = 0;
            this.button1.Text = "GO!";
            this.button1.UseVisualStyleBackColor = false;
            this.button1.Click += new System.EventHandler(this.button1_Click);
            //
            // saveFileDialog1
            //
            this.saveFileDialog1.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm|Excel 97/2003|*.xls|Excel 2007|*.xlsx;*.xlsm|All files|*.*";
            this.saveFileDialog1.RestoreDirectory = true;
            //
            // label1
            //
            this.label1.Location = new System.Drawing.Point(24, 24);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(288, 24);
            this.label1.TabIndex = 2;
            this.label1.Text = "A Crosstab report using an user defined function.";
            //
            // btnCancel
            //
            this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.btnCancel.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
            this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            this.btnCancel.ForeColor = System.Drawing.Color.White;
            this.btnCancel.Location = new System.Drawing.Point(272, 88);
            this.btnCancel.Name = "btnCancel";
            this.btnCancel.Size = new System.Drawing.Size(112, 23);
            this.btnCancel.TabIndex = 3;
            this.btnCancel.Text = "Cancel";
            this.btnCancel.UseVisualStyleBackColor = false;
            this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
            //
            // mainForm
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(416, 133);
            this.Controls.Add(this.btnCancel);
            this.Controls.Add(this.label1);
            this.Controls.Add(this.button1);
            this.Name = "mainForm";
            this.Text = "User defined functions";
            this.ResumeLayout(false);

        }
        #endregion

        private System.Windows.Forms.Button button1;
        private System.Windows.Forms.SaveFileDialog saveFileDialog1;
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.Button btnCancel;
    }
}

Program.cs

using System;
using System.Windows.Forms;

namespace UserDefinedFunctions
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new mainForm());
        }
    }
}


User defined formats (C# / netframework) | FlexCel Studio for the .NET Framework documentation

User defined formats (C# / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\csharp\VS2022\netframework\20.Reports\95b.User Defined Formats and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​csharp/​VS2022/​netframework/​Modules/​20.​Reports/​95b.​User Defined Formats

Overview

User defined formats are a way to format cells in a report with code. Normally you will want to use them if the data to format the cells is in the database and it is not known at compile time, so you can't use conditional formatting or formats defined in the config sheet.

Concepts

  • How to define and use a user defined format.

  • You can pass parameters to the user defined format by writing them after the format name. In this example we show passing one parameter (in user format "ZipCode") and two parameters (in user format "ShipFormat").

  • If you don't want to modify the format then return a null TFlxFormat and a null TFlxApplyFormat. We do this in the ZipCode user format, when the zip code is not numeric. If you wanted to return a format but not apply, you could set only the TFlxApplyFormat to null and the full TFlxFormat would be applied.

  • As you can see, the colors in this demo don't make much sense. There is a reason for that: trying to find an example of stuff that can only be made with user defined formats is not easy. If you wanted for example to mark red the cells where a value is > 100, then you would just use an Excel conditional format instead. The recommended order of preference would be:

    1. If you can do it with Excel conditional formats, then use that.

    2. If you can't use conditional formats then use formats defined in the config sheet

    3. For more complex formats where you can't use any of the above (like for example if the color of the cell is stored in the database, or the rules are too complex to code them in a conditional format or the config sheet), then use user defined formats.

  • You can use user defined formats to format rows, columns or cells. As format cell has more priority than format row, in this example there are cells which override the row format.

Files

AssemblyInfo.cs

using System.Reflection;
using System.Runtime.CompilerServices;

//
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
//
[assembly: AssemblyTitle("")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("(c) 2002 - 2024 TMS Software")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

//
// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version
//      Build Number
//      Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:

[assembly: AssemblyVersion("7.21.0.0")]

//
// In order to sign your assembly you must specify a key to use. Refer to the
// Microsoft .NET Framework documentation for more information on assembly signing.
//
// Use the attributes below to control which key is used for signing.
//
// Notes:
//   (*) If no key is specified, the assembly is not signed.
//   (*) KeyName refers to a key that has been installed in the Crypto Service
//       Provider (CSP) on your machine. KeyFile refers to a file which contains
//       a key.
//   (*) If the KeyFile and the KeyName values are both specified, the
//       following processing occurs:
//       (1) If the KeyName can be found in the CSP, that key is used.
//       (2) If the KeyName does not exist and the KeyFile does exist, the key
//           in the KeyFile is installed into the CSP and used.
//   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
//       When specifying the KeyFile, the location of the KeyFile should be
//       relative to the project output directory which is
//       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
//       located in the project directory, you would specify the AssemblyKeyFile
//       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
//   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
//       documentation for more information on this.
//
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]
[assembly: AssemblyKeyName("")]

Form1.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using System.Diagnostics;
using System.Reflection;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using FlexCel.Report;
using FlexCel.Demo.SharedData;

namespace UserDefinedFormats
{
    public partial class mainForm: System.Windows.Forms.Form
    {

        public mainForm()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, System.EventArgs e)
        {
            AutoRun();
        }

        public void AutoRun()
        {
            using (FlexCelReport ordersReport = SharedData.CreateReport())
            {
                ordersReport.SetValue("Date", DateTime.Now);
                ordersReport.SetUserFormat("ZipCode", new ZipCodeImp());
                ordersReport.SetUserFormat("ShipFormat", new ShipFormatImp());

                string DataPath = Path.Combine(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), ".."), "..") + Path.DirectorySeparatorChar;

                if (saveFileDialog1.ShowDialog() == DialogResult.OK)
                {
                    ordersReport.Run(DataPath + "User Defined Formats.template.xlsx", saveFileDialog1.FileName);

                    if (MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) == DialogResult.Yes)
                    {
                        using (Process p = new Process())
                        {
                            p.StartInfo.FileName = saveFileDialog1.FileName;
                            p.StartInfo.UseShellExecute = true;
                            p.Start();
                        }
                    }
                }
            }
        }

        private void btnCancel_Click(object sender, System.EventArgs e)
        {
            Close();
        }

    }

    #region ZipCode Implementation
    class ZipCodeImp: TFlexCelUserFormat
    {
        public ZipCodeImp()
        {
        }

        public override TFlxPartialFormat Evaluate(ExcelFile workbook, TXlsCellRange rangeToFormat, object[] parameters)
        {
            if (parameters == null || parameters.Length != 1)
                throw new ArgumentException("Bad parameter count in call to ZipCode() user-defined format");

            int color;
            //If the zip code is not valid, don't modify the format.
            if (parameters[0] == null || !int.TryParse(Convert.ToString(parameters[0]), out color)) return new TFlxPartialFormat(null, null, false);

            //This code is not supposed to make sense. We will convert the zip code to a color based in the numeric value.
            TFlxFormat fmt = workbook.GetDefaultFormat;
            fmt.FillPattern.Pattern = TFlxPatternStyle.Solid;
            fmt.FillPattern.FgColor = TExcelColor.FromArgb(color);
            fmt.FillPattern.BgColor = TExcelColor.Automatic;

            fmt.Font.Color = TExcelColor.FromArgb(~color);

            TFlxApplyFormat apply = new TFlxApplyFormat();
            apply.FillPattern.SetAllMembers(true);
            apply.Font.Color = true;
            return new TFlxPartialFormat(fmt, apply, false);
        }
    }
    #endregion

    #region ShipFormat Implementation
    class ShipFormatImp : TFlexCelUserFormat
    {
        public ShipFormatImp()
        {
        }

        public override TFlxPartialFormat Evaluate(ExcelFile workbook, TXlsCellRange rangeToFormat, object[] parameters)
        {
            //Again, this example is not supposed to make sense, only to show how you can code a complex rule.
            //This method will format the rows with a color that depends in the length of the first parameter,
            //and if the second parameter starts with "B" it will make the text red.

            if (parameters == null || parameters.Length != 2)
                throw new ArgumentException("Bad parameter count in call to ShipFormat() user-defined format");

            int len = Convert.ToString(parameters[0]).Length;
            string country = Convert.ToString(parameters[1]);

            Int32 color = 0xFFFFFF - len * 100;
            TFlxFormat fmt = workbook.GetDefaultFormat;
            fmt.FillPattern.Pattern = TFlxPatternStyle.Solid;
            fmt.FillPattern.FgColor = TExcelColor.FromArgb(color);
            fmt.FillPattern.BgColor = TExcelColor.Automatic;

            TFlxApplyFormat apply = new TFlxApplyFormat();
            apply.FillPattern.SetAllMembers(true);

            if (country.StartsWith("B"))
            {
                fmt.Font.Color = Colors.OrangeRed;
                apply.Font.Color = true;
            }

            return new TFlxPartialFormat(fmt, apply, false);
        }
    }
    #endregion

}

Form1.Designer.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using System.Diagnostics;
using System.Reflection;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using FlexCel.Report;
using FlexCel.Demo.SharedData;
namespace UserDefinedFormats
{
    public partial class mainForm: System.Windows.Forms.Form
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.Container components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.button1 = new System.Windows.Forms.Button();
            this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog();
            this.label1 = new System.Windows.Forms.Label();
            this.btnCancel = new System.Windows.Forms.Button();
            this.SuspendLayout();
            //
            // button1
            //
            this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.button1.BackColor = System.Drawing.Color.Green;
            this.button1.ForeColor = System.Drawing.Color.White;
            this.button1.Location = new System.Drawing.Point(152, 88);
            this.button1.Name = "button1";
            this.button1.Size = new System.Drawing.Size(112, 23);
            this.button1.TabIndex = 0;
            this.button1.Text = "GO!";
            this.button1.UseVisualStyleBackColor = false;
            this.button1.Click += new System.EventHandler(this.button1_Click);
            //
            // saveFileDialog1
            //
            this.saveFileDialog1.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm|Excel 97/2003|*.xls|Excel 2007|*.xlsx;*.xlsm|All files|*.*";
            this.saveFileDialog1.RestoreDirectory = true;
            //
            // label1
            //
            this.label1.Location = new System.Drawing.Point(24, 24);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(288, 24);
            this.label1.TabIndex = 2;
            this.label1.Text = "A report using an user defined format.";
            //
            // btnCancel
            //
            this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.btnCancel.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
            this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            this.btnCancel.ForeColor = System.Drawing.Color.White;
            this.btnCancel.Location = new System.Drawing.Point(272, 88);
            this.btnCancel.Name = "btnCancel";
            this.btnCancel.Size = new System.Drawing.Size(112, 23);
            this.btnCancel.TabIndex = 3;
            this.btnCancel.Text = "Cancel";
            this.btnCancel.UseVisualStyleBackColor = false;
            this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
            //
            // mainForm
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(416, 133);
            this.Controls.Add(this.btnCancel);
            this.Controls.Add(this.label1);
            this.Controls.Add(this.button1);
            this.Name = "mainForm";
            this.Text = "User defined formats";
            this.ResumeLayout(false);

        }
        #endregion

        private System.Windows.Forms.Button button1;
        private System.Windows.Forms.SaveFileDialog saveFileDialog1;
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.Button btnCancel;
    }
}

Program.cs

using System;
using System.Windows.Forms;

namespace UserDefinedFormats
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new mainForm());
        }
    }
}


Virtual datasets (C# / netframework) | FlexCel Studio for the .NET Framework documentation

Virtual datasets (C# / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\csharp\VS2022\netframework\20.Reports\96.Virtual Datasets and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​csharp/​VS2022/​netframework/​Modules/​20.​Reports/​96.​Virtual Datasets

Overview

Normally FlexCelReport uses DataTables for its data. On reporting we can see DataTables as "overcharged" arrays, with added functionality like filtering or sorting. They are also really powerful and fast, so using them is normally the best option. But in some cases you might have very large bussiness objects and would like to use them directly without copying them first into a DataTable. On those cases, you can create your own VirtualDataset and VirtualDatasetState descendants to do this task.

This is an advanced topic. Remember to read the [Appendix: Virtual DataSets on](~/guides/reports-developer-guide.md#appendix:-virtual-datasets -on) the Reports developer guide.

Concepts

  • How to create a VirtualDataset descendant to encapsulate an arbitrary object and make a report with it. Two descendants are shown, one very simple with the minimum functionality needed, and other that fully implements all the features.

  • As you can see on the ComplexVirtualArrayDataSource example, to provide all the functionality you do not need to override too many methods. But you should implement very efficient methods. If you do not, probably the performance dumping everything to a DataSet would be faster.

  • How to create "infographics". this is based on the article: http://www.juiceanalytics.com/weblog/?p=236

Files

AssemblyInfo.cs

using System.Reflection;
using System.Runtime.CompilerServices;

//
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
//
[assembly: AssemblyTitle("")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("(c) 2002 - 2024 TMS Software")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

//
// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version
//      Build Number
//      Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:

[assembly: AssemblyVersion("7.21.0.0")]

//
// In order to sign your assembly you must specify a key to use. Refer to the
// Microsoft .NET Framework documentation for more information on assembly signing.
//
// Use the attributes below to control which key is used for signing.
//
// Notes:
//   (*) If no key is specified, the assembly is not signed.
//   (*) KeyName refers to a key that has been installed in the Crypto Service
//       Provider (CSP) on your machine. KeyFile refers to a file which contains
//       a key.
//   (*) If the KeyFile and the KeyName values are both specified, the
//       following processing occurs:
//       (1) If the KeyName can be found in the CSP, that key is used.
//       (2) If the KeyName does not exist and the KeyFile does exist, the key
//           in the KeyFile is installed into the CSP and used.
//   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
//       When specifying the KeyFile, the location of the KeyFile should be
//       relative to the project output directory which is
//       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
//       located in the project directory, you would specify the AssemblyKeyFile
//       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
//   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
//       documentation for more information on this.
//
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]
[assembly: AssemblyKeyName("")]

ComplexVirtualArrayDataSource.cs

using System;
using System.Globalization;
using System.Collections.Generic;

using FlexCel.Report;
using System.Collections;

namespace VirtualDatasets
{
    /// <summary>
    /// This class implements the complete functionality needed to run a FlexCelReport from an array of objects.
    /// Sorting/Filtering on the config sheet is allowed for this datasource, but they are not implemented on an efficient way.
    /// If you do not have an efficient way to do those things (using indexes) and you plan to do them, you will probably get better performance
    /// using Datasets.
    /// </summary>
    public class ComplexVirtualArrayDataSource: VirtualDataTable
    {
        #region Private variables
        object[][] FData;
        string[] FColumnCaptions;
        #endregion

        #region Constructors
        public ComplexVirtualArrayDataSource(VirtualDataTable aCreatedBy, object[][] aData, string[] aColumnCaptions, string aTableName)
            : base(aTableName, aCreatedBy)
        {
            FData = aData;
            FColumnCaptions = aColumnCaptions;
        }
        #endregion

        #region Columns
        public override int ColumnCount
        {
            get
            {
                return FColumnCaptions.Length;
            }
        }

        public override int GetColumn(string columnName)
        {
            //not very optimized method, but this is just a demo.
            if (columnName == null) return -1;
            columnName = columnName.Trim();
            for (int i = 0; i < FColumnCaptions.Length; i++)
            {
                if (string.Compare(FColumnCaptions[i], columnName, true) == 0) return i;
            }
            return -1;
        }

        public override string GetColumnName(int columnIndex)
        {
            return FColumnCaptions[columnIndex];
        }

        public override string GetColumnCaption(int columnIndex)
        {
            return FColumnCaptions[columnIndex];
        }

        #endregion

        #region Settings
        public override System.Globalization.CultureInfo Locale
        {
            get
            {
                return CultureInfo.CurrentCulture;
            }
        }
        #endregion

        #region Create State
        public override VirtualDataTableState CreateState(string sort, TMasterDetailLink[] masterDetailLinks, TSplitLink splitLink)
        {
            return new ComplexVirtualArrayDataSourceState(this, sort, masterDetailLinks, splitLink);
        }

        #endregion

        #region Data
        public object[][] Data { get { return FData; } }

        public override VirtualDataTable FilterData(string newDataName, string rowFilter)
        {
            if (rowFilter == null || rowFilter.Length == 0)
            {
                return new ComplexVirtualArrayDataSource(this, FData, FColumnCaptions, newDataName);  //no need to copy the data since it is invariant.
            }

            RelationshipType Relationship = RelationshipType.Equals;
            //on this demo we will only support filters of the type: "field = value", "field > value" or "field < value"
            string[] filteredData = rowFilter.Split('=');
            if (filteredData == null || filteredData.Length != 2)
            {
                filteredData = rowFilter.Split('<');
                if (filteredData == null || filteredData.Length != 2)
                {
                    filteredData = rowFilter.Split('>');
                    if (filteredData == null || filteredData.Length != 2)
                    {
                        throw new Exception("Filter \"" + rowFilter + "\" is invalid. The dataset \"" + TableName + "\" only supports filters of the type \"field =/>/< value\".");
                    }
                    else
                    {
                        Relationship = RelationshipType.BiggerThan;
                    }
                }
                else
                {
                    Relationship = RelationshipType.LessThan;
                }

            }

            int ColIndex = GetColumn(filteredData[0].Trim());
            if (ColIndex < 0)
            {
                throw new Exception("Filter \"" + rowFilter + "\" is invalid. Can not find column \"" + filteredData[0].Trim() + "\"");
            }

            //Remember, this is only a demo to show what to do in this event. This code is not good code to use on
            //a real application!. You should use some index here to find the data or this would crawl on large objects.

            List<object[]> Result = new List<object[]>();
            string SearchValue = filteredData[1].Trim();
            double Searchfloat = 0;
            if (Relationship != RelationshipType.Equals) //when relationship is not equals, we will assume columns are numbers. This is because we do not have any type definition for our columns on this simple example.
            {
                Searchfloat = Convert.ToDouble(filteredData[1].Trim());
            }

            foreach (object[] Row in Data)
            {
                switch (Relationship)
                {
                    case RelationshipType.Equals:
                        if (Convert.ToString(Row[ColIndex]) == SearchValue)
                        {
                            Result.Add(Row);  //remember, data is invariant, so we do not need to clone Row.
                        }
                        break;
                    case RelationshipType.LessThan:
                        if (Convert.ToDouble(Row[ColIndex]) < Searchfloat)
                        {
                            Result.Add(Row);  //remember, data is invariant, so we do not need to clone Row.
                        }
                        break;
                    case RelationshipType.BiggerThan:
                        if (Convert.ToDouble(Row[ColIndex]) > Searchfloat)
                        {
                            Result.Add(Row);  //remember, data is invariant, so we do not need to clone Row.
                        }
                        break;
                }
            }

            return new ComplexVirtualArrayDataSource(this, Result.ToArray(), FColumnCaptions, newDataName);

        }

        public override VirtualDataTable GetDistinct(string newDataName, int[] filterFields)
        {
            if (filterFields == null || filterFields.Length == 0)
            {
                return new ComplexVirtualArrayDataSource(this, FData, FColumnCaptions, newDataName);  //no need to copy the data since it is invariant.
            }

            Dictionary<object[], object[]> Result = new Dictionary<object[], object[]>();
            object[] Keys = new object[filterFields.Length];
            foreach (object[] Row in FData)
            {
                for (int i = 0; i < filterFields.Length; i++)
                {
                    Keys[i] = Row[filterFields[i]];
                }
                Result[Keys] = Keys;
            }

            object[][] R = new object[Data.Length][];
            Result.Keys.CopyTo(R, 0);

            string[] NewColumnCaptions = new string[filterFields.Length];
            for (int i = 0; i < filterFields.Length; i++)
            {
                NewColumnCaptions[i] = FColumnCaptions[filterFields[i]];
            }
            return new ComplexVirtualArrayDataSource(this, R, NewColumnCaptions, newDataName);

        }

        #endregion

    }

    public class ComplexVirtualArrayDataSourceState: VirtualDataTableState
    {
        #region Privates
        private object[][] SortedData;
        private List<object[]> FilteredData;
        #endregion

        #region Constructors
        public ComplexVirtualArrayDataSourceState(ComplexVirtualArrayDataSource aTableData, string sort, TMasterDetailLink[] masterDetailLinks, TSplitLink splitLink)
            : base(aTableData)
        {
            if (sort == null || sort.Trim().Length == 0)
            {
                SortedData = aTableData.Data; //no need to clone, this is invariant.
            }
            else
            {
                SortedData = (object[][])aTableData.Data.Clone();
                int sortcolumn = aTableData.GetColumn(sort);
                if (sortcolumn < 0)
                {
                    throw new Exception("Can not find column \"" + sort + "\" in dataset \"" + TableName);
                }
                Array.Sort(SortedData, new ArrayComparer(sortcolumn));
            }

            //here we should use the data in masterdetaillinks and splitlink to create indexes to make the FilteredrowCount and MoveMasterRecord methods faster.
            //on this demo we are not going to do it.
            if ((masterDetailLinks != null && masterDetailLinks.Length > 0) || splitLink != null)
            {
                FilteredData = new List<object[]>();
            }
        }
        #endregion

        #region Data
        private object[][] Data { get { return ((SimpleVirtualArrayDataSource)TableData).Data; } }

        /// <summary>
        /// Remember that this method should be fast!
        /// </summary>
        public override int RowCount
        {
            get
            {
                if (FilteredData == null) return SortedData.Length;
                return FilteredData.Count;
            }
        }

        public override object GetValue(int column)
        {
            if (FilteredData == null) return SortedData[Position][column];
            return ((object[])FilteredData[Position])[column];
        }

        public override object GetValue(int row, int column)
        {
            if (FilteredData == null) return SortedData[row][column];
            return ((object[])FilteredData[row])[column];
        }
        #endregion

        #region Move
        public override void MoveFirst()
        {
            //No need to do anything in an array, since "Position" is moved for us.
            //If we had an IEnumerator for example as data backend, we would reset it here.
        }

        public override void MoveNext()
        {
            //No need to do anything in an array, since "Position" is moved for us.
            //If we had an IEnumerator for example as data backend, we would move it here.
        }

        #endregion

        #region Relationships
        public override void MoveMasterRecord(TMasterDetailLink[] masterDetailLinks, TSplitLink splitLink)
        {
            //Here we need to modify FilteredData to contain only those records on FilteredData that are visible on this state.
            //If we created indexes on this method constructor's, this can be done fast.

            //on this example, as always, we will use a very slow method. The idea of this demo is not to demostrate how to do efficient code
            // (you probably have efficient methods on the bussines objects you are wrapping), but how to override the methods.

            if (FilteredData == null) return;  //this dataset is not on master-detail relationship and does not have any split relationship either.

            FilteredData.Clear();
            int[] ChildColumn = new int[masterDetailLinks.Length];
            for (int i = 0; i < masterDetailLinks.Length; i++)
            {
                ChildColumn[i] = TableData.GetColumn(masterDetailLinks[i].ChildFieldName);
            }

            int SplitPos = 0;
            int StartRow = 0;
            if (splitLink != null)
            {
                StartRow = splitLink.SplitCount * splitLink.ParentDataSource.Position;
            }

            for (int r = 0; r < SortedData.Length; r++)
            {
                object[] Row = SortedData[r];
                bool RowApplies = true;
                for (int i = 0; i < masterDetailLinks.Length; i++)
                {
                    object key = masterDetailLinks[i].ParentDataSource.GetValue(masterDetailLinks[i].ParentField);
                    if (Convert.ToString(Row[ChildColumn[i]]) != Convert.ToString(key))
                    {
                        RowApplies = false;
                        break;
                    }
                }

                if (!RowApplies) continue; //the row does not fit this master detail relationship.

                SplitPos++;
                if (SplitPos <= StartRow) continue; //we are not filling the correct split slot.

                FilteredData.Add(Row);
                if (splitLink != null && FilteredData.Count >= splitLink.SplitCount) return;
            }

        }

        public override int FilteredRowCount(TMasterDetailLink[] masterDetailLinks)
        {
            int Result = 0;

            int[] ChildColumn = new int[masterDetailLinks.Length];
            for (int i = 0; i < masterDetailLinks.Length; i++)
            {
                ChildColumn[i] = TableData.GetColumn(masterDetailLinks[i].ChildFieldName);
            }

            for (int r = 0; r < SortedData.Length; r++)
            {
                object[] Row = SortedData[r];
                bool RowApplies = true;
                for (int i = 0; i < masterDetailLinks.Length; i++)
                {
                    object key = masterDetailLinks[i].ParentDataSource.GetValue(masterDetailLinks[i].ParentField);
                    if (Convert.ToString(Row[ChildColumn[i]]) != Convert.ToString(key))
                    {
                        RowApplies = false;
                        break;
                    }
                }

                if (!RowApplies) continue; //the row does not fit this master detail relationship.

                Result++;
            }

            return Result;

        }

        #endregion

    }

    internal enum RelationshipType
    {
        Equals,
        LessThan,
        BiggerThan
    }

    public class ArrayComparer: IComparer<object[]>
    {
        int Column;
        static CaseInsensitiveComparer Comparer = new CaseInsensitiveComparer();

        public ArrayComparer(int aColumn)
        {
            Column = aColumn;
        }

        int IComparer<object[]>.Compare(Object[] x, Object[] y)
        {
            return (Comparer.Compare(x[Column], y[Column]));
        }

    }

}

Form1.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using System.Diagnostics;
using System.Reflection;
using System.Resources;
using System.Globalization;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using FlexCel.Report;

namespace VirtualDatasets
{
    public partial class mainForm: System.Windows.Forms.Form
    {

        public mainForm()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, System.EventArgs e)
        {
            AutoRun();
        }

        public void AutoRun()
        {
            string DataPath = Path.Combine(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), ".."), "..") + Path.DirectorySeparatorChar;

            if (saveFileDialog1.ShowDialog() == DialogResult.OK)
            {
                object[][] SimpleData = LoadDataSet(Path.Combine(DataPath, "Countries.txt"));
                SimpleVirtualArrayDataSource SimpleTable = new SimpleVirtualArrayDataSource(null, SimpleData, new string[] { "Rank", "Country", "Area", "Date" }, "SimpleTable");

                using (FlexCelReport genericReport = new FlexCelReport(true))
                {
                    genericReport.AddTable("SimpleData", SimpleTable);

                    object[][] Complex1 = LoadDataSet(Path.Combine(DataPath, "Countries.txt"));
                    ComplexVirtualArrayDataSource ComplexAreas = new ComplexVirtualArrayDataSource(null, Complex1, new string[] { "Rank", "Country", "Area", "Date" }, "ComplexAreas");
                    object[][] Complex2 = LoadDataSet(Path.Combine(DataPath, "Populations.txt"));
                    ComplexVirtualArrayDataSource ComplexPopulations = new ComplexVirtualArrayDataSource(null, Complex2, new string[] { "Rank", "Country", "Population", "Date" }, "ComplexPopulations");

                    genericReport.AddTable("ComplexAreas", ComplexAreas, TDisposeMode.DisposeAfterRun);
                    genericReport.AddTable("ComplexPopulations", ComplexPopulations, TDisposeMode.DisposeAfterRun);

                    genericReport.Run(Path.Combine(DataPath, "Virtual Datasets.template.xls"), saveFileDialog1.FileName);
                }

                if (MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    using (Process p = new Process())
                    {
                        p.StartInfo.FileName = saveFileDialog1.FileName;
                        p.StartInfo.UseShellExecute = true;
                        p.Start();
                    }
                }
            }
        }

        private void btnCancel_Click(object sender, System.EventArgs e)
        {
            Close();
        }

        private object[][] LoadDataSet(string filename)
        {
            //Let's create some bussiness object with random data.

            ArrayList Result = new ArrayList();
            using (StreamReader sr = new StreamReader(Path.GetFullPath(filename)))
            {
                string line;
                while ((line = sr.ReadLine()) != null)
                {
                    string[] fields = line.Split('\t');
                    //Zero validation here since this is a demo and will use always the same data. On a real app you should not expect your data to play nice
                    object[] f = new object[fields.Length];
                    string s = fields[0] as String;
                    f[0] = Convert.ToInt64(s);
                    f[1] = fields[1];
                    s = fields[2] as String;
                    f[2] = (object)Convert.ToInt64(s.Replace(",", ""));
                    f[3] = fields[3];
                    Result.Add(f);
                }
            }

            return (object[][])Result.ToArray(typeof(object[]));
        }
    }

}

Form1.Designer.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using System.Diagnostics;
using System.Reflection;
using System.Resources;
using System.Globalization;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using FlexCel.Report;
namespace VirtualDatasets
{
    public partial class mainForm: System.Windows.Forms.Form
    {
        private System.Windows.Forms.Button button1;
        private System.Windows.Forms.SaveFileDialog saveFileDialog1;
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.Button btnCancel;
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.Container components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.button1 = new System.Windows.Forms.Button();
            this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog();
            this.label1 = new System.Windows.Forms.Label();
            this.btnCancel = new System.Windows.Forms.Button();
            this.SuspendLayout();
            //
            // button1
            //
            this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
            this.button1.BackColor = System.Drawing.Color.Green;
            this.button1.ForeColor = System.Drawing.Color.White;
            this.button1.Location = new System.Drawing.Point(96, 80);
            this.button1.Name = "button1";
            this.button1.Size = new System.Drawing.Size(112, 23);
            this.button1.TabIndex = 0;
            this.button1.Text = "GO!";
            this.button1.UseVisualStyleBackColor = false;
            this.button1.Click += new System.EventHandler(this.button1_Click);
            //
            // saveFileDialog1
            //
            this.saveFileDialog1.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm|Excel 97/2003|*.xls|Excel 2007|*.xlsx;*.xlsm|All files|*.*";
            this.saveFileDialog1.RestoreDirectory = true;
            //
            // label1
            //
            this.label1.Location = new System.Drawing.Point(24, 24);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(288, 24);
            this.label1.TabIndex = 2;
            this.label1.Text = "A demo on how to use arbitrary objects on a report. ";
            //
            // btnCancel
            //
            this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
            this.btnCancel.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
            this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            this.btnCancel.ForeColor = System.Drawing.Color.White;
            this.btnCancel.Location = new System.Drawing.Point(216, 80);
            this.btnCancel.Name = "btnCancel";
            this.btnCancel.Size = new System.Drawing.Size(112, 23);
            this.btnCancel.TabIndex = 3;
            this.btnCancel.Text = "Cancel";
            this.btnCancel.UseVisualStyleBackColor = false;
            this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
            //
            // mainForm
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(360, 130);
            this.Controls.Add(this.btnCancel);
            this.Controls.Add(this.label1);
            this.Controls.Add(this.button1);
            this.Name = "mainForm";
            this.Text = "Virtual Datasets";
            this.ResumeLayout(false);

        }
        #endregion
    }
}

Program.cs

using System;
using System.Windows.Forms;

namespace VirtualDatasets
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new mainForm());
        }
    }
}

SimpleVirtualArrayDataSource.cs

using System;
using System.Globalization;

using FlexCel.Report;

namespace VirtualDatasets
{
    /// <summary>
    /// This class implements the minimum functionality needed to run a FlexCelReport from an array of objects.
    /// No Sorting/Filtering on the config sheet is allowed for this datasource, and you can not use it on master detail relationships.
    /// </summary>
    public class SimpleVirtualArrayDataSource: VirtualDataTable
    {
        #region Private variables
        object[][] FData;
        string[] FColumnCaptions;
        #endregion

        #region Constructors
        public SimpleVirtualArrayDataSource(VirtualDataTable aCreatedBy, object[][] aData, string[] aColumnCaptions, string aTableName) : base(aTableName, aCreatedBy)
        {
            FData = aData;
            FColumnCaptions = aColumnCaptions;
        }
        #endregion

        #region Columns
        public override int ColumnCount
        {
            get
            {
                return FColumnCaptions.Length;
            }
        }

        public override int GetColumn(string columnName)
        {
            //not very optimized method, but this is just a demo.
            if (columnName == null) return -1;
            columnName = columnName.Trim();
            for (int i = 0; i < FColumnCaptions.Length; i++)
            {
                if (string.Compare(FColumnCaptions[i], columnName, true) == 0) return i;
            }
            return -1;
        }

        public override string GetColumnName(int columnIndex)
        {
            return FColumnCaptions[columnIndex];
        }

        public override string GetColumnCaption(int columnIndex)
        {
            return FColumnCaptions[columnIndex];
        }

        #endregion

        #region Settings
        public override System.Globalization.CultureInfo Locale
        {
            get
            {
                return CultureInfo.CurrentCulture;
            }
        }
        #endregion

        #region Create State
        public override VirtualDataTableState CreateState(string sort, TMasterDetailLink[] masterDetailLinks, TSplitLink splitLink)
        {
            return new SimpleVirtualArrayDataSourceState(this);
        }

        #endregion

        #region Data
        public object[][] Data { get { return FData; } }
        #endregion

        #region Filter
        /// <summary>
        /// Even when we don't implement filter, we need to return a new instance when rowFilter is null.
        /// </summary>
        /// <param name="newDataName"></param>
        /// <param name="rowFilter"></param>
        /// <returns></returns>
        public override VirtualDataTable FilterData(string newDataName, string rowFilter)
        {
            if (string.IsNullOrEmpty(rowFilter))
            {
                return new SimpleVirtualArrayDataSource(this, Data, FColumnCaptions, TableName);
            }
            return base.FilterData(newDataName, rowFilter);
        }
        #endregion

    }

    public class SimpleVirtualArrayDataSourceState: VirtualDataTableState
    {
        #region Constructors
        public SimpleVirtualArrayDataSourceState(SimpleVirtualArrayDataSource aTableData) : base(aTableData)
        {
        }
        #endregion

        #region Data
        private object[][] Data { get { return ((SimpleVirtualArrayDataSource)TableData).Data; } }

        /// <summary>
        /// Remember that this method should be fast!
        /// </summary>
        public override int RowCount
        {
            get
            {
                return Data.Length;
            }
        }

        public override object GetValue(int column)
        {
            return Data[Position][column];
        }

        public override object GetValue(int row, int column)
        {
            return Data[row][column];
        }

        public override void MoveFirst()
        {
            //No need to do anything in an array, since "Position" is moved for us.
            //If we had an IEnumerator for example as data backend, we would reset it here.
        }

        public override void MoveNext()
        {
            //No need to do anything in an array, since "Position" is moved for us.
            //If we had an IEnumerator for example as data backend, we would move it here.
        }

        #endregion

    }

}


Encryption and subtotals (C# / netframework) | FlexCel Studio for the .NET Framework documentation

Encryption and subtotals (C# / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\csharp\VS2022\netframework\20.Reports\98.Encryption And Subtotals and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​csharp/​VS2022/​netframework/​Modules/​20.​Reports/​98.​Encryption And Subtotals

Overview

Two unrelated concepts are shown here. First, how to protect and encrypt a report. Second a frequently asked question: how to make a grand total out of sub totals.

Concepts

  • There are 4 ways to protect data in Excel:

    1. A password to open. This is the only way that will actually encrypt the file. All other methods just will add a record telling Excel not to modify the file. In Excel, this option is on ->Tools->Options... Security tab.

    2. A password to modify. Also on ->Tools->Options->Security tab, this password will allow you to open the file, but not to save it. The file will not be encrypted, and you can always use Save As to save the file.

    3. Protecting the workbook. This will cause a pseudo-encryption of the file, but the password used to encrypt will be always the same, no matter what password you enter. On Excel, this option is at ->Tools->Protection->Protect Workbook.

    4. Protecting the sheet. This option will protect the cells, objects, etc on a particular sheet. ->Tools->Protection->Protect Sheet.

  • When the file is encrypted (using a password to open) FlexCel supports four different encryption modes: Excel 95, Standard Excel97/2000 encryption, Excel 2007 xlsx encryption and Excel 2010 "agile" xlsx encryption.

  • To open an encrypted file, you can set the OpenPassword property or the OnPassword event. Use the OnPassword event when you want to interactively ask for a password *if* the file is encrypted.

  • Calculating a grand total. This is not related with encryption, but we used this example to show how it can be done. It is not really 100% FlexCel related either, but it is a frequently asked question. Imagine you have a master-detail report, with subtotals, and you want to calculate the sum of subtotals. You could do this on three ways:

    1. You could manually add a formula like "=Sum(A50, A60, A63...)" after the report is generated to calculate the sum of sub totals. Even when this sound like the natural approach, it is highly not recommended. Besides the effort needed to dynamically calculate the formula, formulas on Excel have a maximum of characters and you could end up on a formula too long message. Also, the sheet will become slow to calculate, and the formulas too complicated to follow. And you would be adding a lot of code to the report, that will not let the final user change the cells on the template.

    2. You can do it all on the template. By using different columns to hold different values and then merging the cells and hiding a column, you can get it to look as if it were done with way 1. But the formulas are much simpler here, and you do not need code to adapt them. This way is what we show here.

    3. There is a third option using the SubTotal Excel function. The SubTotal Excel function is unique in that it does not take other SubTotal() functions in account when doing its job. So you can have multiple SubTotal() functions in the same column, and they will not interfere with each other.

Files

AssemblyInfo.cs

using System.Reflection;
using System.Runtime.CompilerServices;

//
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
//
[assembly: AssemblyTitle("")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("(c) 2002 - 2024 TMS Software")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

//
// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version
//      Build Number
//      Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:

[assembly: AssemblyVersion("7.21.0.0")]

//
// In order to sign your assembly you must specify a key to use. Refer to the
// Microsoft .NET Framework documentation for more information on assembly signing.
//
// Use the attributes below to control which key is used for signing.
//
// Notes:
//   (*) If no key is specified, the assembly is not signed.
//   (*) KeyName refers to a key that has been installed in the Crypto Service
//       Provider (CSP) on your machine. KeyFile refers to a file which contains
//       a key.
//   (*) If the KeyFile and the KeyName values are both specified, the
//       following processing occurs:
//       (1) If the KeyName can be found in the CSP, that key is used.
//       (2) If the KeyName does not exist and the KeyFile does exist, the key
//           in the KeyFile is installed into the CSP and used.
//   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
//       When specifying the KeyFile, the location of the KeyFile should be
//       relative to the project output directory which is
//       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
//       located in the project directory, you would specify the AssemblyKeyFile
//       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
//   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
//       documentation for more information on this.
//
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]
[assembly: AssemblyKeyName("")]

Form1.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using System.Diagnostics;
using System.Reflection;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using FlexCel.Report;
using FlexCel.Demo.SharedData;

namespace EncryptionAndSubtotals
{
    public partial class mainForm: System.Windows.Forms.Form
    {
        public mainForm()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, System.EventArgs e)
        {
            ManualRun();
        }

        public void ManualRun()
        {
            using (FlexCelReport ordersReport = SharedData.CreateReport())
            {
                ordersReport.BeforeReadTemplate += new GenerateEventHandler(ordersReport_BeforeReadTemplate);
                ordersReport.AfterGenerateSheet += new GenerateEventHandler(ordersReport_AfterGenerateSheet);
                ordersReport.AfterGenerateWorkbook += new GenerateEventHandler(ordersReport_AfterGenerateWorkbook);

                ordersReport.SetValue("Date", DateTime.Now);

                string DataPath = Path.Combine(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), ".."), "..") + Path.DirectorySeparatorChar;

                if (saveFileDialog1.ShowDialog() == DialogResult.OK)
                {
                    ordersReport.Run(DataPath + "Encryption And Subtotals.template.xls", saveFileDialog1.FileName);

                    if (MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) == DialogResult.Yes)
                    {
                        using (Process p = new Process())
                        {
                            p.StartInfo.FileName = saveFileDialog1.FileName;
                            p.StartInfo.UseShellExecute = true;
                            p.Start();
                        }
                    }
                }
            }
        }

        private void btnCancel_Click(object sender, System.EventArgs e)
        {
            Close();
        }

        private void mainForm_Load(object sender, System.EventArgs e)
        {
            encryptionType.SelectedItem = encryptionType.Items[0];
        }

        private void ordersReport_BeforeReadTemplate(object sender, FlexCel.Report.GenerateEventArgs e)
        {
            e.File.Protection.OpenPassword = OpenPassTemplate.Text;
        }

        private void ordersReport_AfterGenerateSheet(object sender, FlexCel.Report.GenerateEventArgs e)
        {
            e.File.Protection.SetSheetProtection(ProtectSheetPass.Text, new TSheetProtectionOptions(ProtectSheet.Checked));
        }

        private void ordersReport_AfterGenerateWorkbook(object sender, FlexCel.Report.GenerateEventArgs e)
        {
            if (encryptionType.SelectedItem == encryptionType.Items[1])
                e.File.Protection.EncryptionType = TEncryptionType.Xor;
            else e.File.Protection.EncryptionType = TEncryptionType.Standard;
            e.File.Protection.OpenPassword = OpenPassGenerated.Text;
            e.File.Protection.SetModifyPassword(ModifyPassGenerated.Text, RecommendReadOnly.Checked, ReservingUser.Text);
            e.File.Protection.SetWorkbookProtection(ProtectWorkbookPass.Text, new TWorkbookProtectionOptions(false, ProtectWorkbook.Checked));
        }
    }

}

Form1.Designer.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using System.Diagnostics;
using System.Reflection;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using FlexCel.Report;
using FlexCel.Demo.SharedData;
namespace EncryptionAndSubtotals
{
    public partial class mainForm: System.Windows.Forms.Form
    {
        private System.Windows.Forms.Button button1;
        private System.Windows.Forms.SaveFileDialog saveFileDialog1;
        private System.Windows.Forms.Button btnCancel;
        private System.Windows.Forms.Panel panel1;
        private System.Windows.Forms.Label label2;
        private System.Windows.Forms.TextBox OpenPassTemplate;
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.Panel panel2;
        private System.Windows.Forms.Label label3;
        private System.Windows.Forms.TextBox OpenPassGenerated;
        private System.Windows.Forms.Label label4;
        private System.Windows.Forms.Label label5;
        private System.Windows.Forms.TextBox ModifyPassGenerated;
        private System.Windows.Forms.Label label6;
        private System.Windows.Forms.TextBox ProtectWorkbookPass;
        private System.Windows.Forms.Label label7;
        private System.Windows.Forms.TextBox ProtectSheetPass;
        private System.Windows.Forms.Label label8;
        private System.Windows.Forms.ComboBox encryptionType;
        private System.Windows.Forms.Label label9;
        private System.Windows.Forms.TextBox ReservingUser;
        private System.Windows.Forms.CheckBox RecommendReadOnly;
        private System.Windows.Forms.CheckBox ProtectWorkbook;
        private System.Windows.Forms.CheckBox ProtectSheet;
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.Container components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.button1 = new System.Windows.Forms.Button();
            this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog();
            this.btnCancel = new System.Windows.Forms.Button();
            this.panel1 = new System.Windows.Forms.Panel();
            this.label2 = new System.Windows.Forms.Label();
            this.OpenPassTemplate = new System.Windows.Forms.TextBox();
            this.label1 = new System.Windows.Forms.Label();
            this.panel2 = new System.Windows.Forms.Panel();
            this.ProtectSheet = new System.Windows.Forms.CheckBox();
            this.ProtectWorkbook = new System.Windows.Forms.CheckBox();
            this.RecommendReadOnly = new System.Windows.Forms.CheckBox();
            this.label9 = new System.Windows.Forms.Label();
            this.ReservingUser = new System.Windows.Forms.TextBox();
            this.encryptionType = new System.Windows.Forms.ComboBox();
            this.label8 = new System.Windows.Forms.Label();
            this.ProtectSheetPass = new System.Windows.Forms.TextBox();
            this.label7 = new System.Windows.Forms.Label();
            this.label6 = new System.Windows.Forms.Label();
            this.ProtectWorkbookPass = new System.Windows.Forms.TextBox();
            this.label5 = new System.Windows.Forms.Label();
            this.ModifyPassGenerated = new System.Windows.Forms.TextBox();
            this.label3 = new System.Windows.Forms.Label();
            this.OpenPassGenerated = new System.Windows.Forms.TextBox();
            this.label4 = new System.Windows.Forms.Label();
            this.panel1.SuspendLayout();
            this.panel2.SuspendLayout();
            this.SuspendLayout();
            //
            // button1
            //
            this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
            this.button1.BackColor = System.Drawing.Color.Green;
            this.button1.ForeColor = System.Drawing.Color.White;
            this.button1.Location = new System.Drawing.Point(312, 414);
            this.button1.Name = "button1";
            this.button1.Size = new System.Drawing.Size(112, 23);
            this.button1.TabIndex = 0;
            this.button1.Text = "GO!";
            this.button1.UseVisualStyleBackColor = false;
            this.button1.Click += new System.EventHandler(this.button1_Click);
            //
            // saveFileDialog1
            //
            this.saveFileDialog1.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm|Excel 97/2003|*.xls|Excel 2007|*.xlsx;*.xlsm|All " +
    "files|*.*";
            this.saveFileDialog1.RestoreDirectory = true;
            //
            // btnCancel
            //
            this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
            this.btnCancel.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
            this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            this.btnCancel.ForeColor = System.Drawing.Color.White;
            this.btnCancel.Location = new System.Drawing.Point(432, 414);
            this.btnCancel.Name = "btnCancel";
            this.btnCancel.Size = new System.Drawing.Size(112, 23);
            this.btnCancel.TabIndex = 3;
            this.btnCancel.Text = "Cancel";
            this.btnCancel.UseVisualStyleBackColor = false;
            this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
            //
            // panel1
            //
            this.panel1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
            | System.Windows.Forms.AnchorStyles.Right)));
            this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.panel1.Controls.Add(this.label2);
            this.panel1.Controls.Add(this.OpenPassTemplate);
            this.panel1.Controls.Add(this.label1);
            this.panel1.Location = new System.Drawing.Point(24, 16);
            this.panel1.Name = "panel1";
            this.panel1.Size = new System.Drawing.Size(496, 80);
            this.panel1.TabIndex = 6;
            //
            // label2
            //
            this.label2.Location = new System.Drawing.Point(8, 32);
            this.label2.Name = "label2";
            this.label2.Size = new System.Drawing.Size(200, 16);
            this.label2.TabIndex = 8;
            this.label2.Text = "Password to open the template:";
            //
            // OpenPassTemplate
            //
            this.OpenPassTemplate.Location = new System.Drawing.Point(8, 48);
            this.OpenPassTemplate.Name = "OpenPassTemplate";
            this.OpenPassTemplate.Size = new System.Drawing.Size(200, 20);
            this.OpenPassTemplate.TabIndex = 7;
            this.OpenPassTemplate.Text = "flexcel";
            //
            // label1
            //
            this.label1.Location = new System.Drawing.Point(8, 8);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(416, 24);
            this.label1.TabIndex = 6;
            this.label1.Text = "The template is protected with a password to open. On this demo, it is \"flexcel\"";
            //
            // panel2
            //
            this.panel2.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
            | System.Windows.Forms.AnchorStyles.Left)
            | System.Windows.Forms.AnchorStyles.Right)));
            this.panel2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.panel2.Controls.Add(this.ProtectSheet);
            this.panel2.Controls.Add(this.ProtectWorkbook);
            this.panel2.Controls.Add(this.RecommendReadOnly);
            this.panel2.Controls.Add(this.label9);
            this.panel2.Controls.Add(this.ReservingUser);
            this.panel2.Controls.Add(this.encryptionType);
            this.panel2.Controls.Add(this.label8);
            this.panel2.Controls.Add(this.ProtectSheetPass);
            this.panel2.Controls.Add(this.label7);
            this.panel2.Controls.Add(this.label6);
            this.panel2.Controls.Add(this.ProtectWorkbookPass);
            this.panel2.Controls.Add(this.label5);
            this.panel2.Controls.Add(this.ModifyPassGenerated);
            this.panel2.Controls.Add(this.label3);
            this.panel2.Controls.Add(this.OpenPassGenerated);
            this.panel2.Controls.Add(this.label4);
            this.panel2.Location = new System.Drawing.Point(24, 112);
            this.panel2.Name = "panel2";
            this.panel2.Size = new System.Drawing.Size(496, 296);
            this.panel2.TabIndex = 7;
            //
            // ProtectSheet
            //
            this.ProtectSheet.Checked = true;
            this.ProtectSheet.CheckState = System.Windows.Forms.CheckState.Checked;
            this.ProtectSheet.Location = new System.Drawing.Point(368, 203);
            this.ProtectSheet.Name = "ProtectSheet";
            this.ProtectSheet.Size = new System.Drawing.Size(64, 16);
            this.ProtectSheet.TabIndex = 22;
            this.ProtectSheet.Text = "Protect";
            //
            // ProtectWorkbook
            //
            this.ProtectWorkbook.Checked = true;
            this.ProtectWorkbook.CheckState = System.Windows.Forms.CheckState.Checked;
            this.ProtectWorkbook.Location = new System.Drawing.Point(368, 147);
            this.ProtectWorkbook.Name = "ProtectWorkbook";
            this.ProtectWorkbook.Size = new System.Drawing.Size(64, 16);
            this.ProtectWorkbook.TabIndex = 21;
            this.ProtectWorkbook.Text = "Protect";
            //
            // RecommendReadOnly
            //
            this.RecommendReadOnly.Location = new System.Drawing.Point(240, 243);
            this.RecommendReadOnly.Name = "RecommendReadOnly";
            this.RecommendReadOnly.Size = new System.Drawing.Size(168, 24);
            this.RecommendReadOnly.TabIndex = 20;
            this.RecommendReadOnly.Text = "Recommend read only";
            //
            // label9
            //
            this.label9.Location = new System.Drawing.Point(8, 227);
            this.label9.Name = "label9";
            this.label9.Size = new System.Drawing.Size(200, 16);
            this.label9.TabIndex = 19;
            this.label9.Text = "Reserving user: (for modify password)";
            //
            // ReservingUser
            //
            this.ReservingUser.Location = new System.Drawing.Point(8, 243);
            this.ReservingUser.Name = "ReservingUser";
            this.ReservingUser.Size = new System.Drawing.Size(200, 20);
            this.ReservingUser.TabIndex = 18;
            this.ReservingUser.Text = "Flexcel User";
            //
            // encryptionType
            //
            this.encryptionType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.encryptionType.Items.AddRange(new object[] {
            "Default Excel 97/2000 Encryption",
            "Excel 95 XOR Encryption"});
            this.encryptionType.Location = new System.Drawing.Point(8, 84);
            this.encryptionType.Name = "encryptionType";
            this.encryptionType.Size = new System.Drawing.Size(424, 21);
            this.encryptionType.TabIndex = 17;
            //
            // label8
            //
            this.label8.Location = new System.Drawing.Point(8, 48);
            this.label8.Name = "label8";
            this.label8.Size = new System.Drawing.Size(488, 33);
            this.label8.TabIndex = 16;
            this.label8.Text = "Encryption type for xls files (xlsx uses Agile encryption). Note that this is onl" +
    "y needed when saving, as the encryption type is autodetected when opening:";
            //
            // ProtectSheetPass
            //
            this.ProtectSheetPass.Location = new System.Drawing.Point(232, 176);
            this.ProtectSheetPass.Name = "ProtectSheetPass";
            this.ProtectSheetPass.Size = new System.Drawing.Size(120, 20);
            this.ProtectSheetPass.TabIndex = 15;
            this.ProtectSheetPass.Text = "sheet";
            //
            // label7
            //
            this.label7.Location = new System.Drawing.Point(232, 179);
            this.label7.Name = "label7";
            this.label7.Size = new System.Drawing.Size(248, 16);
            this.label7.TabIndex = 14;
            this.label7.Text = "Password to protect the generated sheets:";
            //
            // label6
            //
            this.label6.Location = new System.Drawing.Point(232, 131);
            this.label6.Name = "label6";
            this.label6.Size = new System.Drawing.Size(248, 16);
            this.label6.TabIndex = 12;
            this.label6.Text = "Password to protect the generated workbook:";
            //
            // ProtectWorkbookPass
            //
            this.ProtectWorkbookPass.Location = new System.Drawing.Point(232, 147);
            this.ProtectWorkbookPass.Name = "ProtectWorkbookPass";
            this.ProtectWorkbookPass.Size = new System.Drawing.Size(120, 20);
            this.ProtectWorkbookPass.TabIndex = 11;
            this.ProtectWorkbookPass.Text = "workbook";
            //
            // label5
            //
            this.label5.Location = new System.Drawing.Point(8, 179);
            this.label5.Name = "label5";
            this.label5.Size = new System.Drawing.Size(200, 16);
            this.label5.TabIndex = 10;
            this.label5.Text = "Password to modify the generated file:";
            //
            // ModifyPassGenerated
            //
            this.ModifyPassGenerated.Location = new System.Drawing.Point(8, 195);
            this.ModifyPassGenerated.Name = "ModifyPassGenerated";
            this.ModifyPassGenerated.Size = new System.Drawing.Size(200, 20);
            this.ModifyPassGenerated.TabIndex = 9;
            this.ModifyPassGenerated.Text = "modify";
            //
            // label3
            //
            this.label3.Location = new System.Drawing.Point(8, 131);
            this.label3.Name = "label3";
            this.label3.Size = new System.Drawing.Size(200, 16);
            this.label3.TabIndex = 8;
            this.label3.Text = "Password to open the generated file:";
            //
            // OpenPassGenerated
            //
            this.OpenPassGenerated.Location = new System.Drawing.Point(8, 147);
            this.OpenPassGenerated.Name = "OpenPassGenerated";
            this.OpenPassGenerated.Size = new System.Drawing.Size(200, 20);
            this.OpenPassGenerated.TabIndex = 7;
            this.OpenPassGenerated.Text = "open";
            //
            // label4
            //
            this.label4.Location = new System.Drawing.Point(8, 8);
            this.label4.Name = "label4";
            this.label4.Size = new System.Drawing.Size(416, 40);
            this.label4.TabIndex = 6;
            this.label4.Text = "Here we enter the passwords we want to protect the generated sheets and workbook." +
    " Leave them blank to have no password.";
            //
            // mainForm
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(552, 443);
            this.Controls.Add(this.panel2);
            this.Controls.Add(this.panel1);
            this.Controls.Add(this.btnCancel);
            this.Controls.Add(this.button1);
            this.Name = "mainForm";
            this.Text = "Encryption And Subtotals";
            this.Load += new System.EventHandler(this.mainForm_Load);
            this.panel1.ResumeLayout(false);
            this.panel1.PerformLayout();
            this.panel2.ResumeLayout(false);
            this.panel2.PerformLayout();
            this.ResumeLayout(false);

        }
        #endregion
    }
}

Program.cs

using System;
using System.Windows.Forms;

namespace EncryptionAndSubtotals
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new mainForm());
        }
    }
}


Step by step tutorial on FlexCel reports (C# / netframework) | FlexCel Studio for the .NET Framework documentation

Step by step tutorial on FlexCel reports (C# / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\csharp\VS2022\netframework\20.Reports\A0.Reporting Tutorial and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​csharp/​VS2022/​netframework/​Modules/​20.​Reports/​A0.​Reporting Tutorial

Overview

This demo is the completed project from the FlexCel reporting tutorial video at

https://www.tmssoftware.com/flexcel/tutorial.htm

Note: This demo does not run from MainDemo and it needs .NET 2.0 or newer.

It also needs the Adventure Works demo database from

http://www.codeplex.com/MSFTDBProdSamples/Release/ProjectReleases.aspx?ReleaseId=4004 (SQLServer 2005)

or

http://www.codeplex.com/MSFTDBProdSamples/Release/ProjectReleases.aspx?ReleaseId=8392 (SQLServer 2008)

In order to run this demo, open the website from Visual Studio 2005 or newer, by doing: Menu->File->Open->Website

and pointing to the "Modules\20.Reports\A0.Reporting Tutorial" folder.

Concepts

  • Concepts are explained in the video. This is just the finished code and template so you can take a look at it.

  • In order to actually run this demo, you might need to edit web.config and change the connection settings for your SQL Server.

Files

Default.aspx.cs

using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using FlexCel.Render;
using FlexCel.Report;
using System.IO;

public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }

    private ExcelFile CreateReport()
    {
        XlsFile Result = new XlsFile(true);
        Result.Open(MapPath("~/App_Data/template.xls"));
        using (FlexCelReport fr = new FlexCelReport())
        {
            LoadData(fr);

            fr.SetValue("ReportCaption", "Hello from FlexCel!");
            fr.Run(Result);
            return Result;
        }
    }

    private void LoadData(FlexCelReport fr)
    {
        DataSet1 Data = new DataSet1();
        DataSet1TableAdapters.ProductTableAdapter ProductAdapter = new DataSet1TableAdapters.ProductTableAdapter();
        ProductAdapter.Fill(Data.Product);

        DataSet1TableAdapters.ProductPhotoTableAdapter ProductPhotoAdapter = new DataSet1TableAdapters.ProductPhotoTableAdapter();
        ProductPhotoAdapter.Fill(Data.ProductPhoto);

        DataSet1TableAdapters.ProductProductPhotoTableAdapter ProductProductPhotoAdapter = new DataSet1TableAdapters.ProductProductPhotoTableAdapter();
        ProductProductPhotoAdapter.Fill(Data.ProductProductPhoto);

        fr.AddTable(Data);
    }

    protected void Button1_Click(object sender, EventArgs e)
    {
        ExcelFile xls = CreateReport();
        FlexCelAspViewer1.HtmlExport.Workbook = xls;
    }
    protected void Button2_Click(object sender, EventArgs e)
    {
        ExcelFile xls = CreateReport();

        using (MemoryStream ms = new MemoryStream())
        {
            xls.Save(ms);
            ms.Position = 0;
            Response.Clear();
            Response.AddHeader("Content-Disposition", "attachment; filename=Test.xls");
            Response.AddHeader("Content-Length", ms.Length.ToString());
            Response.ContentType = "application/excel"; //octet-stream";
            Response.BinaryWrite(ms.ToArray());
            Response.End();
        }

    }
    protected void Button3_Click(object sender, EventArgs e)
    {
        ExcelFile xls = CreateReport();

        using (MemoryStream ms = new MemoryStream())
        {
            using (FlexCelPdfExport pdf = new FlexCelPdfExport())
            {
                pdf.Workbook = xls;
                pdf.BeginExport(ms);
                pdf.ExportAllVisibleSheets(false, "FlexCel");
                pdf.EndExport();
                ms.Position = 0;
                Response.Clear();
                Response.AddHeader("Content-Disposition", "attachment; filename=Test.pdf");
                Response.AddHeader("Content-Length", ms.Length.ToString());
                Response.ContentType = "application/pdf"; //octet-stream";
                Response.BinaryWrite(ms.ToArray());
                Response.End();
            }
        }

    }
}


Features (C# / netframework) | FlexCel Studio for the .NET Framework documentation

Features (C# / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\csharp\VS2022\netframework\20.Reports\B0.Features Page and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​csharp/​VS2022/​netframework/​Modules/​20.​Reports/​B0.​Features Page

Overview

This is a real world demo, showing how we create the "features" HTML sheet you can find at

https://www.tmssoftware.com/flexcel/featuresflexcel.htm

Concepts

  • Everything in this demo is shown in more detail somewhere else. This is just a showcase of a real application of a FlexCel report, but anyway there are some ideas worth noting.

  • We use the Image Fit tag in the image to autofit the containing cell to the height of the image. Bus as we also need to autofit the whole row, we need to do an autofit with a "Dont Shrink" option on the rows. If we didn't, when autofitting the rows the images would get outside their cells again.

  • We use Intelligent Page Breaks to have a nice PDF output.

  • As we wanted to use Access so we can distribute this demo easily to you, we did not store the images in the database. (Access is not good at storing images). So we saved the images in a folder, and used an user defined function to load them and feed the report.

Files

AssemblyInfo.cs

using System.Reflection;
using System.Runtime.CompilerServices;

//
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
//
[assembly: AssemblyTitle("")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("(c) 2002 - 2024 TMS Software")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

//
// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version
//      Build Number
//      Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:

[assembly: AssemblyVersion("7.21.0.0")]

//
// In order to sign your assembly you must specify a key to use. Refer to the
// Microsoft .NET Framework documentation for more information on assembly signing.
//
// Use the attributes below to control which key is used for signing.
//
// Notes:
//   (*) If no key is specified, the assembly is not signed.
//   (*) KeyName refers to a key that has been installed in the Crypto Service
//       Provider (CSP) on your machine. KeyFile refers to a file which contains
//       a key.
//   (*) If the KeyFile and the KeyName values are both specified, the
//       following processing occurs:
//       (1) If the KeyName can be found in the CSP, that key is used.
//       (2) If the KeyName does not exist and the KeyFile does exist, the key
//           in the KeyFile is installed into the CSP and used.
//   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
//       When specifying the KeyFile, the location of the KeyFile should be
//       relative to the project output directory which is
//       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
//       located in the project directory, you would specify the AssemblyKeyFile
//       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
//   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
//       documentation for more information on this.
//
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]
[assembly: AssemblyKeyName("")]

Form1.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using System.Diagnostics;
using System.Reflection;
using System.Data.OleDb;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using FlexCel.Report;
using FlexCel.Render;
using FlexCel.Pdf;
using System.Globalization;

using System.Xml;

namespace FeaturesPage
{
    public partial class mainForm: System.Windows.Forms.Form
    {
        public mainForm()
        {
            InitializeComponent();
            //initialize the db.
            dbconnection.ConnectionString = dbconnection.ConnectionString.Replace("Features.mdb", Path.Combine(DataPath, "features.mdb"));
            ResizeToolbar(mainToolbar);
            FlexCelConfig.DpiForImages = 192; //Make the exports in hidpi.
        }

        private static void LaunchFile(string f)
        {
            if (f != null)
            {
                using (Process p = new Process())
                {
                    p.StartInfo.FileName = f;
                    p.StartInfo.UseShellExecute = true;
                    p.Start();
                }
            }
        }

        private void ResizeToolbar(ToolStrip toolbar)
        {

            using (Graphics gr = CreateGraphics())
            {
                double xFactor = gr.DpiX / 96.0;
                double yFactor = gr.DpiY / 96.0;
                toolbar.ImageScalingSize = new Size((int)(24 * xFactor), (int)(24 * yFactor));
                toolbar.Width = 0; //force a recalc of the buttons.
            }
        }

        private void button2_Click(object sender, System.EventArgs e)
        {
            Close();
        }

        private static string DataPath
        {
            get
            {
                return Path.Combine(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), ".."), "..") + Path.DirectorySeparatorChar;
            }
        }

        private string ResultPath
        {
            get
            {
                string BasePath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
                return Path.Combine(BasePath, "Features");
            }
        }

        private XlsFile Export(DataSet data)
        {
            using (FlexCelReport Report = new FlexCelReport(true))
            {
                Report.AddTable(data);
                Report.SetUserFunction("Images", new ImagesImp());
                XlsFile Xls = new XlsFile(true);
                Xls.Open(Path.Combine(DataPath, "Features Page.template.xls"));

                Report.Run(Xls);
                return Xls;
            }

        }

        private DataSet LoadDataSet()
        {
            DataSet Result = new DataSet();
            featuresAdapter.Fill(Result, "Features");
            categoriesAdapter.Fill(Result, "Categories");
            hyperlinksAdapter.Fill(Result, "Hyperlinks");
            Result.Relations.Add(Result.Tables["Categories"].Columns["CategoryId"], Result.Tables["Features"].Columns["CategoryId"]);
            Result.Relations.Add(Result.Tables["Features"].Columns["FeaturesId"], Result.Tables["Hyperlinks"].Columns["FeaturesId"]);

            return Result;
        }

        private void btnExportExcel_Click(object sender, System.EventArgs e)
        {

            string XlsPath = Path.Combine(ResultPath, "FeaturesFlexCel.xls");
            using (DataSet data = LoadDataSet())
            {
                XlsFile Xls = Export(data);

                Directory.CreateDirectory(ResultPath);
                Xls.Save(XlsPath);
            }

            if (MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) == DialogResult.Yes)
            {
                LaunchFile(XlsPath);
            }

        }

        private void btnExportHtml_Click(object sender, System.EventArgs e)
        {
            string MainHtmlPath = Path.Combine(ResultPath, "featuresflexcel.htm");

            using (DataSet data = LoadDataSet())
            {
                XlsFile Xls = Export(data);

                Directory.CreateDirectory(ResultPath);
                using (FlexCelHtmlExport html = new FlexCelHtmlExport(Xls, true))
                {
                    html.ImageResolution = 192;
                    html.ImageBackground = Color.White; //Since we are not setting html.FixIE6TransparentPngSupport, we must ensure tehre are no transparent images.
                    TStandardSheetSelector SheetSelector = new TStandardSheetSelector(TSheetSelectorPosition.Top);
                    SheetSelector.SheetSelectorEntry += new SheetSelectorEntryEventHandler(SheetSelector_SheetSelectorEntry);
                    SheetSelector.CssGeneral.Main += "font-family:Verdana;font-size:10pt;";

                    html.ExportAllVisibleSheetsAsTabs(ResultPath, "Features", ".htm", null, null, SheetSelector);

                    //Rename the first tab so it is "featuresflexcel.htm";
                    string[] Sheets = html.GeneratedFiles.GetHtmlFiles();
                    File.Delete(MainHtmlPath);
                    File.Move(Sheets[0], MainHtmlPath);

                }
            }
            if (MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) == DialogResult.Yes)
            {
                LaunchFile(MainHtmlPath);
            }

        }

        static void SheetSelector_SheetSelectorEntry(object sender, SheetSelectorEntryEventArgs e)
        {
            //We will rename the first sheet, so we need to update the links here.
            if (e.ActiveSheet == 1) e.Link = "featuresflexcel.htm";
        }

        private void btnExportPDF_Click(object sender, System.EventArgs e)
        {
            string PdfPath = Path.Combine(ResultPath, "FeaturesFlexCel.pdf");

            using (DataSet data = LoadDataSet())
            {
                XlsFile Xls = Export(data);
                Directory.CreateDirectory(ResultPath);

                using (FlexCelPdfExport pdf = new FlexCelPdfExport(Xls, true))
                {
                    using (FileStream pdfStream = new FileStream(PdfPath, FileMode.Create))
                    {
                        pdf.BeginExport(pdfStream);
                        pdf.FontMapping = TFontMapping.ReplaceAllFonts;

                        pdf.Properties.Subject = "A list of FlexCel.NET features";
                        pdf.Properties.Author = "TMS Software";
                        pdf.Properties.Title = "List of FlexCel.NET features";
                        pdf.PageLayout = TPageLayout.Outlines;
                        pdf.ExportAllVisibleSheets(false, "Features");
                        pdf.EndExport();
                    }
                }
            }

            if (MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) == DialogResult.Yes)
            {
                LaunchFile(PdfPath);
            }

        }

        class ImagesImp: TFlexCelUserFunction
        {
            public ImagesImp()
            {
            }

            public override object Evaluate(object[] parameters)
            {
                if (parameters == null || parameters.Length != 1)
                    throw new ArgumentException("Bad parameter count in call to Images() user-defined function");

                string ImageFilename = Path.Combine(Path.Combine(DataPath, "images"), "Features" + Convert.ToString(parameters[0], CultureInfo.InvariantCulture) + ".png");
                if (File.Exists(ImageFilename))
                {
                    using (FileStream fs = new FileStream(ImageFilename, FileMode.Open))
                    {
                        byte[] Result = new byte[fs.Length];
                        fs.Read(Result, 0, Result.Length);
                        return Result;
                    }
                }

                return null;
            }
        }

    }

}

Form1.Designer.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using System.Diagnostics;
using System.Reflection;
using System.Data.OleDb;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using FlexCel.Report;
using FlexCel.Render;
using FlexCel.Pdf;
using System.Globalization;
using System.Xml;
namespace FeaturesPage
{
    public partial class mainForm: System.Windows.Forms.Form
    {
        private System.Windows.Forms.Label label1;
        private System.Data.OleDb.OleDbCommand oleDbSelectCommand1;
        private System.Data.OleDb.OleDbCommand oleDbInsertCommand1;
        private System.Data.OleDb.OleDbCommand oleDbUpdateCommand1;
        private System.Data.OleDb.OleDbCommand oleDbDeleteCommand1;
        private System.Data.OleDb.OleDbConnection dbconnection;
        private System.Data.OleDb.OleDbDataAdapter categoriesAdapter;
        private System.Data.OleDb.OleDbDataAdapter featuresAdapter;
        private System.Data.OleDb.OleDbCommand oleDbSelectCommand2;
        private System.Data.OleDb.OleDbCommand oleDbInsertCommand2;
        private System.Data.OleDb.OleDbCommand oleDbUpdateCommand2;
        private System.Data.OleDb.OleDbCommand oleDbDeleteCommand2;
        private System.Data.OleDb.OleDbCommand oleDbSelectCommand3;
        private System.Data.OleDb.OleDbDataAdapter hyperlinksAdapter;
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(mainForm));
            this.label1 = new System.Windows.Forms.Label();
            this.oleDbSelectCommand1 = new System.Data.OleDb.OleDbCommand();
            this.dbconnection = new System.Data.OleDb.OleDbConnection();
            this.oleDbInsertCommand1 = new System.Data.OleDb.OleDbCommand();
            this.oleDbUpdateCommand1 = new System.Data.OleDb.OleDbCommand();
            this.oleDbDeleteCommand1 = new System.Data.OleDb.OleDbCommand();
            this.categoriesAdapter = new System.Data.OleDb.OleDbDataAdapter();
            this.featuresAdapter = new System.Data.OleDb.OleDbDataAdapter();
            this.oleDbDeleteCommand2 = new System.Data.OleDb.OleDbCommand();
            this.oleDbInsertCommand2 = new System.Data.OleDb.OleDbCommand();
            this.oleDbSelectCommand2 = new System.Data.OleDb.OleDbCommand();
            this.oleDbUpdateCommand2 = new System.Data.OleDb.OleDbCommand();
            this.oleDbSelectCommand3 = new System.Data.OleDb.OleDbCommand();
            this.hyperlinksAdapter = new System.Data.OleDb.OleDbDataAdapter();
            this.mainToolbar = new System.Windows.Forms.ToolStrip();
            this.toolStripButton4 = new System.Windows.Forms.ToolStripButton();
            this.toolStripButton3 = new System.Windows.Forms.ToolStripButton();
            this.toolStripButton2 = new System.Windows.Forms.ToolStripButton();
            this.toolStripButton1 = new System.Windows.Forms.ToolStripButton();
            this.mainToolbar.SuspendLayout();
            this.SuspendLayout();
            //
            // label1
            //
            this.label1.Location = new System.Drawing.Point(179, 69);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(200, 48);
            this.label1.TabIndex = 4;
            this.label1.Text = "Files will be saved under a \"Features\" Folder in under where the application is r" +
    "unning.";
            //
            // oleDbSelectCommand1
            //
            this.oleDbSelectCommand1.CommandText = "SELECT Caption, CategoryId, CategoryName, Description FROM Categories";
            this.oleDbSelectCommand1.Connection = this.dbconnection;
            //
            // dbconnection
            //
            this.dbconnection.ConnectionString = resources.GetString("dbconnection.ConnectionString");
            //
            // oleDbInsertCommand1
            //
            this.oleDbInsertCommand1.CommandText = "INSERT INTO Categories(Caption, CategoryName, Description) VALUES (?, ?, ?)";
            this.oleDbInsertCommand1.Connection = this.dbconnection;
            this.oleDbInsertCommand1.Parameters.AddRange(new System.Data.OleDb.OleDbParameter[] {
            new System.Data.OleDb.OleDbParameter("Caption", System.Data.OleDb.OleDbType.VarWChar, 255, "Caption"),
            new System.Data.OleDb.OleDbParameter("CategoryName", System.Data.OleDb.OleDbType.VarWChar, 255, "CategoryName"),
            new System.Data.OleDb.OleDbParameter("Description", System.Data.OleDb.OleDbType.VarWChar, 0, "Description")});
            //
            // oleDbUpdateCommand1
            //
            this.oleDbUpdateCommand1.CommandText = resources.GetString("oleDbUpdateCommand1.CommandText");
            this.oleDbUpdateCommand1.Connection = this.dbconnection;
            this.oleDbUpdateCommand1.Parameters.AddRange(new System.Data.OleDb.OleDbParameter[] {
            new System.Data.OleDb.OleDbParameter("Caption", System.Data.OleDb.OleDbType.VarWChar, 255, "Caption"),
            new System.Data.OleDb.OleDbParameter("CategoryName", System.Data.OleDb.OleDbType.VarWChar, 255, "CategoryName"),
            new System.Data.OleDb.OleDbParameter("Description", System.Data.OleDb.OleDbType.VarWChar, 0, "Description"),
            new System.Data.OleDb.OleDbParameter("Original_CategoryId", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, false, ((byte)(0)), ((byte)(0)), "CategoryId", System.Data.DataRowVersion.Original, null),
            new System.Data.OleDb.OleDbParameter("Original_Caption", System.Data.OleDb.OleDbType.VarWChar, 255, System.Data.ParameterDirection.Input, false, ((byte)(0)), ((byte)(0)), "Caption", System.Data.DataRowVersion.Original, null),
            new System.Data.OleDb.OleDbParameter("Original_Caption1", System.Data.OleDb.OleDbType.VarWChar, 255, System.Data.ParameterDirection.Input, false, ((byte)(0)), ((byte)(0)), "Caption", System.Data.DataRowVersion.Original, null),
            new System.Data.OleDb.OleDbParameter("Original_CategoryName", System.Data.OleDb.OleDbType.VarWChar, 255, System.Data.ParameterDirection.Input, false, ((byte)(0)), ((byte)(0)), "CategoryName", System.Data.DataRowVersion.Original, null),
            new System.Data.OleDb.OleDbParameter("Original_CategoryName1", System.Data.OleDb.OleDbType.VarWChar, 255, System.Data.ParameterDirection.Input, false, ((byte)(0)), ((byte)(0)), "CategoryName", System.Data.DataRowVersion.Original, null)});
            //
            // oleDbDeleteCommand1
            //
            this.oleDbDeleteCommand1.CommandText = "DELETE FROM Categories WHERE (CategoryId = ?) AND (Caption = ? OR ? IS NULL AND C" +
    "aption IS NULL) AND (CategoryName = ? OR ? IS NULL AND CategoryName IS NULL)";
            this.oleDbDeleteCommand1.Connection = this.dbconnection;
            this.oleDbDeleteCommand1.Parameters.AddRange(new System.Data.OleDb.OleDbParameter[] {
            new System.Data.OleDb.OleDbParameter("Original_CategoryId", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, false, ((byte)(0)), ((byte)(0)), "CategoryId", System.Data.DataRowVersion.Original, null),
            new System.Data.OleDb.OleDbParameter("Original_Caption", System.Data.OleDb.OleDbType.VarWChar, 255, System.Data.ParameterDirection.Input, false, ((byte)(0)), ((byte)(0)), "Caption", System.Data.DataRowVersion.Original, null),
            new System.Data.OleDb.OleDbParameter("Original_Caption1", System.Data.OleDb.OleDbType.VarWChar, 255, System.Data.ParameterDirection.Input, false, ((byte)(0)), ((byte)(0)), "Caption", System.Data.DataRowVersion.Original, null),
            new System.Data.OleDb.OleDbParameter("Original_CategoryName", System.Data.OleDb.OleDbType.VarWChar, 255, System.Data.ParameterDirection.Input, false, ((byte)(0)), ((byte)(0)), "CategoryName", System.Data.DataRowVersion.Original, null),
            new System.Data.OleDb.OleDbParameter("Original_CategoryName1", System.Data.OleDb.OleDbType.VarWChar, 255, System.Data.ParameterDirection.Input, false, ((byte)(0)), ((byte)(0)), "CategoryName", System.Data.DataRowVersion.Original, null)});
            //
            // categoriesAdapter
            //
            this.categoriesAdapter.DeleteCommand = this.oleDbDeleteCommand1;
            this.categoriesAdapter.InsertCommand = this.oleDbInsertCommand1;
            this.categoriesAdapter.SelectCommand = this.oleDbSelectCommand1;
            this.categoriesAdapter.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] {
            new System.Data.Common.DataTableMapping("Table", "Categories", new System.Data.Common.DataColumnMapping[] {
                        new System.Data.Common.DataColumnMapping("Caption", "Caption"),
                        new System.Data.Common.DataColumnMapping("CategoryId", "CategoryId"),
                        new System.Data.Common.DataColumnMapping("CategoryName", "CategoryName"),
                        new System.Data.Common.DataColumnMapping("Description", "Description")})});
            this.categoriesAdapter.UpdateCommand = this.oleDbUpdateCommand1;
            //
            // featuresAdapter
            //
            this.featuresAdapter.DeleteCommand = this.oleDbDeleteCommand2;
            this.featuresAdapter.InsertCommand = this.oleDbInsertCommand2;
            this.featuresAdapter.SelectCommand = this.oleDbSelectCommand2;
            this.featuresAdapter.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] {
            new System.Data.Common.DataTableMapping("Table", "Features", new System.Data.Common.DataColumnMapping[] {
                        new System.Data.Common.DataColumnMapping("Caption", "Caption"),
                        new System.Data.Common.DataColumnMapping("CategoryId", "CategoryId"),
                        new System.Data.Common.DataColumnMapping("Description", "Description"),
                        new System.Data.Common.DataColumnMapping("FeaturesId", "FeaturesId")})});
            this.featuresAdapter.UpdateCommand = this.oleDbUpdateCommand2;
            //
            // oleDbDeleteCommand2
            //
            this.oleDbDeleteCommand2.CommandText = "DELETE FROM Features WHERE (FeaturesId = ?) AND (Caption = ?) AND (CategoryId = ?" +
    ")";
            this.oleDbDeleteCommand2.Parameters.AddRange(new System.Data.OleDb.OleDbParameter[] {
            new System.Data.OleDb.OleDbParameter("Original_FeaturesId", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, false, ((byte)(0)), ((byte)(0)), "FeaturesId", System.Data.DataRowVersion.Original, null),
            new System.Data.OleDb.OleDbParameter("Original_Caption", System.Data.OleDb.OleDbType.VarWChar, 255, System.Data.ParameterDirection.Input, false, ((byte)(0)), ((byte)(0)), "Caption", System.Data.DataRowVersion.Original, null),
            new System.Data.OleDb.OleDbParameter("Original_CategoryId", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, false, ((byte)(0)), ((byte)(0)), "CategoryId", System.Data.DataRowVersion.Original, null)});
            //
            // oleDbInsertCommand2
            //
            this.oleDbInsertCommand2.CommandText = "INSERT INTO Features(Caption, CategoryId, Description) VALUES (?, ?, ?)";
            this.oleDbInsertCommand2.Parameters.AddRange(new System.Data.OleDb.OleDbParameter[] {
            new System.Data.OleDb.OleDbParameter("Caption", System.Data.OleDb.OleDbType.VarWChar, 255, "Caption"),
            new System.Data.OleDb.OleDbParameter("CategoryId", System.Data.OleDb.OleDbType.Integer, 0, "CategoryId"),
            new System.Data.OleDb.OleDbParameter("Description", System.Data.OleDb.OleDbType.VarWChar, 0, "Description")});
            //
            // oleDbSelectCommand2
            //
            this.oleDbSelectCommand2.CommandText = "SELECT Caption, CategoryId, Description, FeaturesId FROM Features order by Positi" +
    "onInSheet";
            this.oleDbSelectCommand2.Connection = this.dbconnection;
            //
            // oleDbUpdateCommand2
            //
            this.oleDbUpdateCommand2.CommandText = "UPDATE Features SET Caption = ?, CategoryId = ?, Description = ? WHERE (FeaturesI" +
    "d = ?) AND (Caption = ?) AND (CategoryId = ?)";
            this.oleDbUpdateCommand2.Parameters.AddRange(new System.Data.OleDb.OleDbParameter[] {
            new System.Data.OleDb.OleDbParameter("Caption", System.Data.OleDb.OleDbType.VarWChar, 255, "Caption"),
            new System.Data.OleDb.OleDbParameter("CategoryId", System.Data.OleDb.OleDbType.Integer, 0, "CategoryId"),
            new System.Data.OleDb.OleDbParameter("Description", System.Data.OleDb.OleDbType.VarWChar, 0, "Description"),
            new System.Data.OleDb.OleDbParameter("Original_FeaturesId", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, false, ((byte)(0)), ((byte)(0)), "FeaturesId", System.Data.DataRowVersion.Original, null),
            new System.Data.OleDb.OleDbParameter("Original_Caption", System.Data.OleDb.OleDbType.VarWChar, 255, System.Data.ParameterDirection.Input, false, ((byte)(0)), ((byte)(0)), "Caption", System.Data.DataRowVersion.Original, null),
            new System.Data.OleDb.OleDbParameter("Original_CategoryId", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, false, ((byte)(0)), ((byte)(0)), "CategoryId", System.Data.DataRowVersion.Original, null)});
            //
            // oleDbSelectCommand3
            //
            this.oleDbSelectCommand3.CommandText = "SELECT FeaturesId, HiperlinksId, LinkName, Url FROM Hyperlinks";
            this.oleDbSelectCommand3.Connection = this.dbconnection;
            //
            // hyperlinksAdapter
            //
            this.hyperlinksAdapter.SelectCommand = this.oleDbSelectCommand3;
            this.hyperlinksAdapter.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] {
            new System.Data.Common.DataTableMapping("Table", "Hyperlinks", new System.Data.Common.DataColumnMapping[] {
                        new System.Data.Common.DataColumnMapping("FeaturesId", "FeaturesId"),
                        new System.Data.Common.DataColumnMapping("HiperlinksId", "HiperlinksId"),
                        new System.Data.Common.DataColumnMapping("LinkName", "LinkName"),
                        new System.Data.Common.DataColumnMapping("Url", "Url")})});
            //
            // mainToolbar
            //
            this.mainToolbar.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.toolStripButton4,
            this.toolStripButton3,
            this.toolStripButton2,
            this.toolStripButton1});
            this.mainToolbar.Location = new System.Drawing.Point(0, 0);
            this.mainToolbar.Name = "mainToolbar";
            this.mainToolbar.Size = new System.Drawing.Size(528, 38);
            this.mainToolbar.TabIndex = 5;
            this.mainToolbar.Text = "mainToolbar";
            //
            // toolStripButton4
            //
            this.toolStripButton4.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton4.Image")));
            this.toolStripButton4.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.toolStripButton4.Name = "toolStripButton4";
            this.toolStripButton4.Size = new System.Drawing.Size(78, 35);
            this.toolStripButton4.Text = "Save to Excel";
            this.toolStripButton4.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
            this.toolStripButton4.Click += new System.EventHandler(this.btnExportExcel_Click);
            //
            // toolStripButton3
            //
            this.toolStripButton3.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton3.Image")));
            this.toolStripButton3.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.toolStripButton3.Name = "toolStripButton3";
            this.toolStripButton3.Size = new System.Drawing.Size(94, 35);
            this.toolStripButton3.Text = "Export to HTML";
            this.toolStripButton3.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
            this.toolStripButton3.Click += new System.EventHandler(this.btnExportHtml_Click);
            //
            // toolStripButton2
            //
            this.toolStripButton2.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton2.Image")));
            this.toolStripButton2.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.toolStripButton2.Name = "toolStripButton2";
            this.toolStripButton2.Size = new System.Drawing.Size(82, 35);
            this.toolStripButton2.Text = "Export to PDF";
            this.toolStripButton2.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
            this.toolStripButton2.Click += new System.EventHandler(this.btnExportPDF_Click);
            //
            // toolStripButton1
            //
            this.toolStripButton1.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right;
            this.toolStripButton1.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton1.Image")));
            this.toolStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.toolStripButton1.Name = "toolStripButton1";
            this.toolStripButton1.Size = new System.Drawing.Size(59, 35);
            this.toolStripButton1.Text = "     E&xit     ";
            this.toolStripButton1.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
            this.toolStripButton1.Click += new System.EventHandler(this.button2_Click);
            //
            // mainForm
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(528, 126);
            this.Controls.Add(this.label1);
            this.Controls.Add(this.mainToolbar);
            this.Name = "mainForm";
            this.Text = "Features FlexCel";
            this.mainToolbar.ResumeLayout(false);
            this.mainToolbar.PerformLayout();
            this.ResumeLayout(false);
            this.PerformLayout();

        }
        #endregion

        private ToolStrip mainToolbar;
        private ToolStripButton toolStripButton4;
        private ToolStripButton toolStripButton3;
        private ToolStripButton toolStripButton2;
        private ToolStripButton toolStripButton1;
    }
}

Program.cs

using System;
using System.Windows.Forms;

namespace FeaturesPage
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new mainForm());
        }
    }
}


Printing, previewing and exporting files (C# / netframework) | FlexCel Studio for the .NET Framework documentation

Printing, previewing and exporting files (C# / netframework)

Overview

FlexCel reporting is oriented to creating files, not to print them. Once you have the files you can save them, email them or just print them if that's what you really need. But, sometimes you might want to directly print the report, and here is where FlexCelPrintDocument can be helpful. You might want also to export the report to PDF, and then you would use FlexCelPdfExport. Or you might want to export the Excel file as an image, or to fax it, using FlexCelImgExport.

All of those components share a common rendering engine, that "renders" the xls file to a canvas, so it can be printed or saved. Keep in mind that results are not 100% the same, and they cannot be, but they are very similar.

FlexCelPrintDocument is a Winforms PrintDocument descendant, and you can use it on the same way. This means you can use it with a standard PrintPreviewDialog or PrintPreviewControl as you would do with any PrintDocument.

In this section

  • Printing, previewing and exporting

  • Custom previewing

  • Exporting Excel files to PDF

  • Exporting to PDF/A

  • Signing PDFs

  • Exporting Excel files to HTML

  • Exporting Excel files to SVG

  • Rendering standalone objects

  • Using the FlexCel ASP viewer component


Printing, previewing and exporting (C# / netframework) | FlexCel Studio for the .NET Framework documentation

Printing, previewing and exporting (C# / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\csharp\VS2022\netframework\25.Printing and Exporting\10.Print Preview and Export and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​csharp/​VS2022/​netframework/​Modules/​25.​Printing and Exporting/10.Print Preview and Export

Overview

A small demo on how to use FlexCelPrintDocument to natively print and preview any existing Excel File, and on how to use FlexCelImgExport to convert any Excel file to images. Pdf export is not shown here, but it is on other examples.

Concepts

  • FlexCelPrintDocument output is not 100% identical to Excel output, and it can't be that way. But it is very similar, and this includes fonts, colors, margins, headers/footers/images, etc. It can print cells with multiple fonts, it can replace the macros on headers and footers (like "&CPage &P of &N"), it can show conditional formats, and the list goes on.

  • You can customize the final output by assigning a PagePrint event. On this demo, it is customized so it prints "Confidential" on each page. (if you select the checkbox)

  • How to export the generated output to images or a multipage tiff, which is the format used to send faxes. On this example, the tiff quality is hard-coded on the demo to 96 DPI, but you can increase to get better-looking pictures (and higher file sizes)

Files

AssemblyInfo.cs

using System.Reflection;
using System.Runtime.CompilerServices;

//
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
//
[assembly: AssemblyTitle("")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("(c) 2002 - 2024 TMS Software")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

//
// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version
//      Build Number
//      Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:

[assembly: AssemblyVersion("7.21.0.0")]

//
// In order to sign your assembly you must specify a key to use. Refer to the
// Microsoft .NET Framework documentation for more information on assembly signing.
//
// Use the attributes below to control which key is used for signing.
//
// Notes:
//   (*) If no key is specified, the assembly is not signed.
//   (*) KeyName refers to a key that has been installed in the Crypto Service
//       Provider (CSP) on your machine. KeyFile refers to a file which contains
//       a key.
//   (*) If the KeyFile and the KeyName values are both specified, the
//       following processing occurs:
//       (1) If the KeyName can be found in the CSP, that key is used.
//       (2) If the KeyName does not exist and the KeyFile does exist, the key
//           in the KeyFile is installed into the CSP and used.
//   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
//       When specifying the KeyFile, the location of the KeyFile should be
//       relative to the project output directory which is
//       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
//       located in the project directory, you would specify the AssemblyKeyFile
//       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
//   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
//       documentation for more information on this.
//
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]
[assembly: AssemblyKeyName("")]

Form1.cs

using System;
using System.Drawing;
using System.Drawing.Imaging;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;

using FlexCel.Core;
using FlexCel.XlsAdapter;
using FlexCel.Render;

using System.IO;
using System.Diagnostics;
using System.Reflection;
using System.Drawing.Drawing2D;
using System.Drawing.Printing;

using System.Runtime.InteropServices;
using FlexCel.Draw;

namespace PrintPreviewandExport
{
    /// <summary>
    /// Printing / Previewing and Exporting xls files.
    /// </summary>
    public partial class mainForm: System.Windows.Forms.Form
    {
        private FlexCel.Render.FlexCelPrintDocument flexCelPrintDocument1;

        public mainForm()
        {
            InitializeComponent();
            cbInterpolation.SelectedIndex = 1;
            ResizeToolbar(mainToolbar);
        }

        private void ResizeToolbar(ToolStrip toolbar)
        {

            using (Graphics gr = CreateGraphics())
            {
                double xFactor = gr.DpiX / 96.0;
                double yFactor = gr.DpiY / 96.0;
                toolbar.ImageScalingSize = new Size((int)(24 * xFactor), (int)(24 * yFactor));
                toolbar.Width = 0; //force a recalc of the buttons.
            }
        }

        private void button2_Click(object sender, System.EventArgs e)
        {
            Close();
        }

        private void LoadSheetConfig()
        {
            ExcelFile Xls = flexCelPrintDocument1.Workbook;

            chGridLines.Checked = Xls.PrintGridLines;
            chHeadings.Checked = Xls.PrintHeadings;
            chFormulaText.Checked = Xls.ShowFormulaText;

            chPrintLeft.Checked = (Xls.PrintOptions & TPrintOptions.LeftToRight) != 0;
            edHeader.Text = Xls.PageHeader;
            edFooter.Text = Xls.PageFooter;
            chFitIn.Checked = Xls.PrintToFit;
            edHPages.Text = Xls.PrintNumberOfHorizontalPages.ToString();
            edVPages.Text = Xls.PrintNumberOfVerticalPages.ToString();
            edVPages.ReadOnly = !chFitIn.Checked;
            edHPages.ReadOnly = !chFitIn.Checked;

            edZoom.ReadOnly = chFitIn.Checked;
            edZoom.Text = Xls.PrintScale.ToString();

            TXlsMargins m = Xls.GetPrintMargins();
            edl.Text = m.Left.ToString();
            edt.Text = m.Top.ToString();
            edr.Text = m.Right.ToString();
            edb.Text = m.Bottom.ToString();
            edf.Text = m.Footer.ToString();
            edh.Text = m.Header.ToString();

            Landscape.Checked = (Xls.PrintOptions & TPrintOptions.Orientation) == 0;

        }

        private void openFile_Click(object sender, System.EventArgs e)
        {
            if (openFileDialog1.ShowDialog() != DialogResult.OK) return;
            flexCelPrintDocument1.Workbook = new XlsFile();

            flexCelPrintDocument1.Workbook.Open(openFileDialog1.FileName);

            edFileName.Text = openFileDialog1.FileName;

            ExcelFile Xls = flexCelPrintDocument1.Workbook;

            cbSheet.Items.Clear();
            int ActSheet = Xls.ActiveSheet;
            for (int i = 1; i <= Xls.SheetCount; i++)
            {
                Xls.ActiveSheet = i;
                cbSheet.Items.Add(Xls.SheetName);
            }
            Xls.ActiveSheet = ActSheet;
            cbSheet.SelectedIndex = ActSheet - 1;

            LoadSheetConfig();
        }

        private bool HasFileOpen()
        {
            if (flexCelPrintDocument1.Workbook == null)
            {
                MessageBox.Show("You need to open a file first.");
                return false;
            }
            return true;
        }

        private bool LoadPreferences()
        {
            //NOTE: THERE SHOULD BE *A LOT* MORE VALIDATION OF VALUES ON THIS METHOD. (For example, validate that margins are between bounds)
            // As this is a simple demo, they are not included.
            try
            {
                flexCelPrintDocument1.AllVisibleSheets = cbAllSheets.Checked;
                flexCelPrintDocument1.ResetPageNumberOnEachSheet = cbResetPageNumber.Checked;
                flexCelPrintDocument1.AntiAliasedText = chAntiAlias.Checked;

                ExcelFile Xls = flexCelPrintDocument1.Workbook;
                Xls.PrintGridLines = chGridLines.Checked;
                Xls.PrintHeadings = chHeadings.Checked;
                Xls.PageHeader = edHeader.Text;
                Xls.PageFooter = edFooter.Text;
                Xls.ShowFormulaText = chFormulaText.Checked;

                if (chFitIn.Checked)
                {
                    Xls.PrintToFit = true;
                    Xls.PrintNumberOfHorizontalPages = Convert.ToInt32(edHPages.Text);
                    Xls.PrintNumberOfVerticalPages = Convert.ToInt32(edVPages.Text);
                }
                else
                    Xls.PrintToFit = false;

                if (chPrintLeft.Checked) Xls.PrintOptions |= TPrintOptions.LeftToRight;
                else Xls.PrintOptions &= ~TPrintOptions.LeftToRight;

                try
                {
                    Xls.PrintScale = Convert.ToInt32(edZoom.Text);
                }
                catch
                {
                    MessageBox.Show("Invalid Zoom");
                    return false;
                }

                TXlsMargins m = new TXlsMargins();
                m.Left = Convert.ToDouble(edl.Text);
                m.Top = Convert.ToDouble(edt.Text);
                m.Right = Convert.ToDouble(edr.Text);
                m.Bottom = Convert.ToDouble(edb.Text);
                m.Footer = Convert.ToDouble(edf.Text);
                m.Header = Convert.ToDouble(edh.Text);
                Xls.SetPrintMargins(m);

                flexCelPrintDocument1.PrintRangeLeft = Convert.ToInt32(edLeft.Text);
                flexCelPrintDocument1.PrintRangeTop = Convert.ToInt32(edTop.Text);
                flexCelPrintDocument1.PrintRangeRight = Convert.ToInt32(edRight.Text);
                flexCelPrintDocument1.PrintRangeBottom = Convert.ToInt32(edBottom.Text);

                flexCelPrintDocument1.DocumentName = flexCelPrintDocument1.Workbook.ActiveFileName + " - Sheet " + flexCelPrintDocument1.Workbook.ActiveSheetByName;

                flexCelPrintDocument1.DefaultPageSettings.Landscape = Landscape.Checked;
            }
            catch (Exception e)
            {
                MessageBox.Show("Error: " + e.Message);
                return false;
            }
            return true;
        }

        private void preview_Click(object sender, System.EventArgs e)
        {
            if (!HasFileOpen()) return;
            if (!LoadPreferences()) return;
            if (!DoSetup()) return;

            //If you want to bypass the paper size selected on the dialog and use the one on Excel, uncomment
            //the following lines:
            //TPaperDimensions t= flexCelPrintDocument1.Workbook.PrintPaperDimensions;
            //flexCelPrintDocument1.DefaultPageSettings.PaperSize = new PaperSize(t.PaperName, Convert.ToInt32(t.Width), Convert.ToInt32(t.Height));

            printPreviewDialog1.ShowDialog();

        }

        private bool DoSetup()
        {
            bool Result = printDialog1.ShowDialog() == DialogResult.OK;
            Landscape.Checked = flexCelPrintDocument1.DefaultPageSettings.Landscape;
            return Result;
        }

        private void setup_Click(object sender, System.EventArgs e)
        {
            DoSetup();
        }

        private void chFitIn_CheckedChanged(object sender, System.EventArgs e)
        {
            edVPages.ReadOnly = !chFitIn.Checked;
            edHPages.ReadOnly = !chFitIn.Checked;
            edZoom.ReadOnly = chFitIn.Checked;
        }

        private void print_Click(object sender, System.EventArgs e)
        {
            if (!HasFileOpen()) return;
            if (!LoadPreferences()) return;
            if (!DoSetup()) return;
            flexCelPrintDocument1.Print();
        }

        private void cbSheet_SelectedIndexChanged(object sender, System.EventArgs e)
        {
            flexCelPrintDocument1.Workbook.ActiveSheet = cbSheet.SelectedIndex + 1;
            LoadSheetConfig();

        }

        /// <summary>
        /// Add a "Confidential" watermark on each page.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void flexCelPrintDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
        {
            if (!cbConfidential.Checked) return;

            using (Matrix myMatrix = new Matrix())
            {
                myMatrix.RotateAt(45, new PointF(e.PageBounds.Left + e.MarginBounds.Width / 2F, e.PageBounds.Top + e.MarginBounds.Height / 2F), MatrixOrder.Append);
                e.Graphics.Transform = myMatrix;
            }

            using (Brush ABrush = new SolidBrush(Color.FromArgb(30, 25, 25, 25))) //Red=Green=Blue is a shade of gray. Alpha=30 means it is transparent (255 is pure opaque, 0 is pure transparent).
            {
                using (Font AFont = new Font("Arial", 72))
                {
                    using (StringFormat sf = new StringFormat())
                    {

                        sf.Alignment = StringAlignment.Center;
                        sf.LineAlignment = StringAlignment.Center;
                        e.Graphics.DrawString("Confidential", AFont, ABrush, e.PageBounds, sf);
                    }
                }
            }
        }

        #region Hard Margins
        //Shows how to read the hard margins from a printer if you really need to.

        private void flexCelPrintDocument1_BeforePrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
        {
            switch (cbInterpolation.SelectedIndex)
            {
                case 0: e.Graphics.InterpolationMode = InterpolationMode.Bicubic; break;
                case 1: e.Graphics.InterpolationMode = InterpolationMode.Bilinear; break;
                case 2: e.Graphics.InterpolationMode = InterpolationMode.Default; break;
                case 3: e.Graphics.InterpolationMode = InterpolationMode.High; break;
                case 4: e.Graphics.InterpolationMode = InterpolationMode.HighQualityBicubic; break;
                case 5: e.Graphics.InterpolationMode = InterpolationMode.HighQualityBilinear; break;
                case 6: e.Graphics.InterpolationMode = InterpolationMode.Low; break;
                case 7: e.Graphics.InterpolationMode = InterpolationMode.NearestNeighbor; break;
            }

        }

        [DllImport("gdi32.dll")]
        private static extern Int32 GetDeviceCaps(IntPtr hdc, Int32 capindex);

        /// <summary>
        /// This event will adjust for a better position on the page for some printers.
        /// It is not normally necessary, and it has to make an unmanaged call to GetDeviceCaps,
        /// but it is given here as an example of how it could be done.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void flexCelPrintDocument1_GetPrinterHardMargins(object sender, FlexCel.Render.PrintHardMarginsEventArgs e)
        {
            const int PHYSICALOFFSETX = 112;
            const int PHYSICALOFFSETY = 113;

            double DpiX = e.Graphics.DpiX;
            double DpiY = e.Graphics.DpiY;

            IntPtr Hdc = e.Graphics.GetHdc();
            try
            {
                e.XMargin = (float)(GetDeviceCaps(Hdc, PHYSICALOFFSETX) * 100.0 / DpiX);
                e.YMargin = (float)(GetDeviceCaps(Hdc, PHYSICALOFFSETY) * 100.0 / DpiY);
            }

            finally
            {
                e.Graphics.ReleaseHdc(Hdc);
            }

        }
        #endregion

        #region Export as image

        #region Common methods to Export with FlexCelImgExport
        private Bitmap CreateBitmap(double Resolution, TPaperDimensions pd, PixelFormat PxFormat)
        {
            Bitmap Result =
                new Bitmap((int)Math.Ceiling(pd.Width / 96F * Resolution),
                (int)Math.Ceiling(pd.Height / 96F * Resolution), PxFormat);
            Result.SetResolution((float)Resolution, (float)Resolution);
            return Result;

        }
        #endregion

        #region Export using FlexCelImgExport - simple images the hard way. DO NOT USE IF NOT DESPERATE!
        //The methods shows how to use FlexCelImgExport the "hard way", without using SaveAsImage.
        //For normal operation you should only need to call SaveAsImage, but you could use the code here
        //if you need to customize the ImgExport output, or if you need to get all the images as different files.
        private void CreateImg(Stream OutStream, FlexCelImgExport ImgExport, ImageFormat ImgFormat, ImageColorDepth Colors, ref TImgExportInfo ExportInfo)
        {
            TPaperDimensions pd = ImgExport.GetRealPageSize();

            PixelFormat RgbPixFormat;
            if (Colors != ImageColorDepth.TrueColor) RgbPixFormat = PixelFormat.Format32bppPArgb; else RgbPixFormat = PixelFormat.Format24bppRgb;
            PixelFormat PixFormat = PixelFormat.Format1bppIndexed;
            switch (Colors)
            {
                case ImageColorDepth.TrueColor: PixFormat = RgbPixFormat; break;
                case ImageColorDepth.Color256: PixFormat = PixelFormat.Format8bppIndexed; break;
            }

            using (Bitmap OutImg = CreateBitmap(ImgExport.Resolution, pd, PixFormat))
            {
                Bitmap ActualOutImg;
                if (Colors != ImageColorDepth.TrueColor) ActualOutImg = CreateBitmap(ImgExport.Resolution, pd, RgbPixFormat); else ActualOutImg = OutImg;
                try
                {
                    using (Graphics Gr = Graphics.FromImage(ActualOutImg))
                    {
                        Gr.FillRectangle(Brushes.White, 0, 0, ActualOutImg.Width, ActualOutImg.Height); //Clear the background
                        ImgExport.ExportNext(Gr, ref ExportInfo);
                    }

                    if (Colors == ImageColorDepth.BlackAndWhite) FloydSteinbergDither.ConvertToBlackAndWhite(ActualOutImg, OutImg);
                    else
                        if (Colors == ImageColorDepth.Color256)
                    {
                        OctreeQuantizer.ConvertTo256Colors(ActualOutImg, OutImg);
                    }
                }
                finally
                {
                    if (ActualOutImg != OutImg) ActualOutImg.Dispose();
                }

                OutImg.Save(OutStream, ImgFormat);
            }
        }

        private void ExportAllImages(FlexCelImgExport ImgExport, ImageFormat ImgFormat, ImageColorDepth ColorDepth)
        {
            TImgExportInfo ExportInfo = null; //For first page.
            int i = 0;
            do
            {
                string FileName = Path.GetDirectoryName(exportImageDialog.FileName)
                    + Path.DirectorySeparatorChar
                    + Path.GetFileNameWithoutExtension(exportImageDialog.FileName)
                    + "_" + ImgExport.Workbook.SheetName
                    + String.Format("_{0:0000}", i) +
                    Path.GetExtension(exportImageDialog.FileName);
                using (FileStream ImageStream = new FileStream(FileName, FileMode.Create))
                {
                    CreateImg(ImageStream, ImgExport, ImgFormat, ColorDepth, ref ExportInfo);
                }
                i++;
            } while (ExportInfo.CurrentPage < ExportInfo.TotalPages);
        }

        private void DoExportUsingFlexCelImgExportComplex(ImageColorDepth ColorDepth)
        {
            if (!HasFileOpen()) return;
            if (!LoadPreferences()) return;

            if (exportImageDialog.ShowDialog() != DialogResult.OK) return;

            System.Drawing.Imaging.ImageFormat ImgFormat = System.Drawing.Imaging.ImageFormat.Png;
            if (String.Compare(Path.GetExtension(exportImageDialog.FileName), ".jpg", true) == 0)
                ImgFormat = System.Drawing.Imaging.ImageFormat.Jpeg;

            using (FlexCelImgExport ImgExport = new FlexCelImgExport(flexCelPrintDocument1.Workbook))
            {
                ImgExport.Resolution = 96; //To get a better quality image but with larger file size too, increate this value. (for example to 300 or 600 dpi)

                if (cbAllSheets.Checked)
                {
                    int SaveActiveSheet = ImgExport.Workbook.ActiveSheet;
                    try
                    {
                        ImgExport.Workbook.ActiveSheet = 1;
                        bool Finished = false;
                        while (!Finished)
                        {
                            ExportAllImages(ImgExport, ImgFormat, ColorDepth);
                            if (ImgExport.Workbook.ActiveSheet < ImgExport.Workbook.SheetCount)
                            {
                                ImgExport.Workbook.ActiveSheet++;
                            }
                            else Finished = true;

                        }
                    }
                    finally
                    {
                        ImgExport.Workbook.ActiveSheet = SaveActiveSheet;
                    }
                }
                else
                {
                    ExportAllImages(ImgExport, ImgFormat, ColorDepth);
                }

            }

        }
        #endregion

        #region Export using FlexCelImgExport - simple images the simple way.

        private void DoExportUsingFlexCelImgExportSimple(ImageColorDepth ColorDepth)
        {
            if (!HasFileOpen()) return;
            if (!LoadPreferences()) return;

            if (exportImageDialog.ShowDialog() != DialogResult.OK) return;

            ImageExportType ImgFormat = ImageExportType.Png;
            if (String.Compare(Path.GetExtension(exportImageDialog.FileName), ".jpg", true) == 0)
                ImgFormat = ImageExportType.Jpeg;

            using (FlexCelImgExport ImgExport = new FlexCelImgExport(flexCelPrintDocument1.Workbook))
            {
                ImgExport.AllVisibleSheets = cbAllSheets.Checked;
                ImgExport.ResetPageNumberOnEachSheet = cbResetPageNumber.Checked;
                ImgExport.Resolution = 96; //To get a better quality image but with larger file size too, increate this value. (for example to 300 or 600 dpi)
                ImgExport.SaveAsImage(exportImageDialog.FileName, ImgFormat, ColorDepth);
            }
        }

        #endregion

        #region Export using FlexCelImageExport - MultiPageTiff
        //How to create a multipage tiff using FlexCelImgExport.
        //This will create a multipage tiff with the data.
        private void DoExportMultiPageTiff(ImageColorDepth ColorDepth, bool IsFax)
        {
            if (!HasFileOpen()) return;
            if (!LoadPreferences()) return;

            if (exportTiffDialog.ShowDialog() != DialogResult.OK) return;

            ImageExportType ExportType = ImageExportType.Tiff;
            if (IsFax) ExportType = ImageExportType.Fax;

            using (FlexCelImgExport ImgExport = new FlexCelImgExport(flexCelPrintDocument1.Workbook))
            {
                ImgExport.AllVisibleSheets = cbAllSheets.Checked;
                ImgExport.ResetPageNumberOnEachSheet = cbResetPageNumber.Checked;

                ImgExport.Resolution = 96; //To get a better quality image but with larger file size too, increate this value. (for example to 300 or 600 dpi)
                using (FileStream TiffStream = new FileStream(exportTiffDialog.FileName, FileMode.Create))
                {
                    ImgExport.SaveAsImage(TiffStream, ExportType, ColorDepth);
                }
            }
            if (MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) == DialogResult.Yes)
            {
                using (Process p = new Process())
                {
                    p.StartInfo.FileName = exportTiffDialog.FileName;
                    p.StartInfo.UseShellExecute = true;
                    p.Start();
                }
            }

        }
        #endregion

        #region Event handlers
        private void ImgBlackAndWhite_Click(object sender, System.EventArgs e)
        {
            DoExportUsingFlexCelImgExportComplex(ImageColorDepth.BlackAndWhite);
        }

        private void Img256Colors_Click(object sender, System.EventArgs e)
        {
            DoExportUsingFlexCelImgExportComplex(ImageColorDepth.Color256);
        }

        private void ImgTrueColor_Click(object sender, System.EventArgs e)
        {
            DoExportUsingFlexCelImgExportComplex(ImageColorDepth.TrueColor);
        }

        private void ImgBlackAndWhite2_Click(object sender, System.EventArgs e)
        {
            DoExportUsingFlexCelImgExportSimple(ImageColorDepth.BlackAndWhite);
        }

        private void Img256Colors2_Click(object sender, System.EventArgs e)
        {
            DoExportUsingFlexCelImgExportSimple(ImageColorDepth.Color256);
        }

        private void ImgTrueColor2_Click(object sender, System.EventArgs e)
        {
            DoExportUsingFlexCelImgExportSimple(ImageColorDepth.TrueColor);
        }

        private void TiffFax_Click(object sender, System.EventArgs e)
        {
            DoExportMultiPageTiff(ImageColorDepth.BlackAndWhite, true);
        }

        private void TiffBlackAndWhite_Click(object sender, System.EventArgs e)
        {
            DoExportMultiPageTiff(ImageColorDepth.BlackAndWhite, false);
        }

        private void Tiff256Colors_Click(object sender, System.EventArgs e)
        {
            DoExportMultiPageTiff(ImageColorDepth.Color256, false);
        }

        private void TiffTrueColor_Click(object sender, System.EventArgs e)
        {
            DoExportMultiPageTiff(ImageColorDepth.TrueColor, false);
        }

        #endregion

        private void cbAllSheets_CheckedChanged(object sender, System.EventArgs e)
        {
            cbSheet.Enabled = !cbAllSheets.Checked;
            cbResetPageNumber.Enabled = cbAllSheets.Checked;
            Landscape.Enabled = !cbAllSheets.Checked;  //When exporting many sheets, we will honor the landscape/portrait setting on each one.
        }

        #endregion

    }
}

Form1.Designer.cs

using System;
using System.Drawing;
using System.Drawing.Imaging;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using FlexCel.Render;
using System.IO;
using System.Diagnostics;
using System.Reflection;
using System.Drawing.Drawing2D;
using System.Drawing.Printing;
using System.Runtime.InteropServices;
namespace PrintPreviewandExport
{
    public partial class mainForm: System.Windows.Forms.Form
    {
        private System.Windows.Forms.OpenFileDialog openFileDialog1;
        private System.Windows.Forms.PrintDialog printDialog1;
        private System.Windows.Forms.PrintPreviewDialog printPreviewDialog1;
        private System.Windows.Forms.Panel panel1;
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.TextBox edFileName;
        private System.Windows.Forms.CheckBox chFormulaText;
        private System.Windows.Forms.CheckBox chAntiAlias;
        private System.Windows.Forms.CheckBox chGridLines;
        private System.Windows.Forms.TextBox edHeader;
        private System.Windows.Forms.Label label2;
        private System.Windows.Forms.TextBox edFooter;
        private System.Windows.Forms.Label label3;
        private System.Windows.Forms.TextBox edHPages;
        private System.Windows.Forms.TextBox edVPages;
        private System.Windows.Forms.Label label5;
        private System.Windows.Forms.Label label6;
        private System.Windows.Forms.CheckBox chPrintLeft;
        private System.Windows.Forms.CheckBox chFitIn;
        private System.Windows.Forms.Label label4;
        private System.Windows.Forms.TextBox edZoom;
        private System.Windows.Forms.Label label7;
        private System.Windows.Forms.TextBox edl;
        private System.Windows.Forms.Label label8;
        private System.Windows.Forms.TextBox edt;
        private System.Windows.Forms.Label label9;
        private System.Windows.Forms.TextBox edr;
        private System.Windows.Forms.Label labelb;
        private System.Windows.Forms.TextBox edb;
        private System.Windows.Forms.Label label10;
        private System.Windows.Forms.TextBox edh;
        private System.Windows.Forms.Label label11;
        private System.Windows.Forms.TextBox edf;
        private System.Windows.Forms.CheckBox Landscape;
        private System.Windows.Forms.Panel panel3;
        private System.Windows.Forms.Label label12;
        private System.Windows.Forms.Label label13;
        private System.Windows.Forms.Label label14;
        private System.Windows.Forms.TextBox edTop;
        private System.Windows.Forms.TextBox edLeft;
        private System.Windows.Forms.Label label15;
        private System.Windows.Forms.TextBox edRight;
        private System.Windows.Forms.Label label16;
        private System.Windows.Forms.TextBox edBottom;
        private System.Windows.Forms.Label label17;
        private System.Windows.Forms.ComboBox cbSheet;
        private System.Windows.Forms.Label label18;
        private System.Windows.Forms.CheckBox cbConfidential;
        private System.Windows.Forms.SaveFileDialog exportImageDialog;
        private System.Windows.Forms.CheckBox chHeadings;
        private System.Windows.Forms.Label label19;
        private System.Windows.Forms.ComboBox cbInterpolation;
        private System.Windows.Forms.SaveFileDialog exportTiffDialog;
        private System.Windows.Forms.CheckBox cbAllSheets;
        private System.Windows.Forms.Panel panel4;
        private System.Windows.Forms.CheckBox cbResetPageNumber;
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(mainForm));
            this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
            this.printDialog1 = new System.Windows.Forms.PrintDialog();
            this.flexCelPrintDocument1 = new FlexCel.Render.FlexCelPrintDocument();
            this.printPreviewDialog1 = new System.Windows.Forms.PrintPreviewDialog();
            this.panel1 = new System.Windows.Forms.Panel();
            this.cbResetPageNumber = new System.Windows.Forms.CheckBox();
            this.panel4 = new System.Windows.Forms.Panel();
            this.cbAllSheets = new System.Windows.Forms.CheckBox();
            this.label19 = new System.Windows.Forms.Label();
            this.cbInterpolation = new System.Windows.Forms.ComboBox();
            this.chHeadings = new System.Windows.Forms.CheckBox();
            this.cbConfidential = new System.Windows.Forms.CheckBox();
            this.label18 = new System.Windows.Forms.Label();
            this.cbSheet = new System.Windows.Forms.ComboBox();
            this.panel3 = new System.Windows.Forms.Panel();
            this.edBottom = new System.Windows.Forms.TextBox();
            this.label17 = new System.Windows.Forms.Label();
            this.edRight = new System.Windows.Forms.TextBox();
            this.label16 = new System.Windows.Forms.Label();
            this.edLeft = new System.Windows.Forms.TextBox();
            this.label15 = new System.Windows.Forms.Label();
            this.edTop = new System.Windows.Forms.TextBox();
            this.label14 = new System.Windows.Forms.Label();
            this.label13 = new System.Windows.Forms.Label();
            this.label12 = new System.Windows.Forms.Label();
            this.Landscape = new System.Windows.Forms.CheckBox();
            this.label11 = new System.Windows.Forms.Label();
            this.edf = new System.Windows.Forms.TextBox();
            this.labelb = new System.Windows.Forms.Label();
            this.edb = new System.Windows.Forms.TextBox();
            this.label9 = new System.Windows.Forms.Label();
            this.edr = new System.Windows.Forms.TextBox();
            this.label8 = new System.Windows.Forms.Label();
            this.edt = new System.Windows.Forms.TextBox();
            this.label7 = new System.Windows.Forms.Label();
            this.edl = new System.Windows.Forms.TextBox();
            this.label4 = new System.Windows.Forms.Label();
            this.edZoom = new System.Windows.Forms.TextBox();
            this.chFitIn = new System.Windows.Forms.CheckBox();
            this.chPrintLeft = new System.Windows.Forms.CheckBox();
            this.label6 = new System.Windows.Forms.Label();
            this.label5 = new System.Windows.Forms.Label();
            this.edVPages = new System.Windows.Forms.TextBox();
            this.edHPages = new System.Windows.Forms.TextBox();
            this.edFooter = new System.Windows.Forms.TextBox();
            this.label3 = new System.Windows.Forms.Label();
            this.edHeader = new System.Windows.Forms.TextBox();
            this.label2 = new System.Windows.Forms.Label();
            this.edFileName = new System.Windows.Forms.TextBox();
            this.chFormulaText = new System.Windows.Forms.CheckBox();
            this.chGridLines = new System.Windows.Forms.CheckBox();
            this.chAntiAlias = new System.Windows.Forms.CheckBox();
            this.label1 = new System.Windows.Forms.Label();
            this.label10 = new System.Windows.Forms.Label();
            this.edh = new System.Windows.Forms.TextBox();
            this.exportImageDialog = new System.Windows.Forms.SaveFileDialog();
            this.exportTiffDialog = new System.Windows.Forms.SaveFileDialog();
            this.mainToolbar = new System.Windows.Forms.ToolStrip();
            this.btnOpenFile = new System.Windows.Forms.ToolStripButton();
            this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
            this.btnSetup = new System.Windows.Forms.ToolStripButton();
            this.btnPreview = new System.Windows.Forms.ToolStripButton();
            this.btnPrint = new System.Windows.Forms.ToolStripButton();
            this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
            this.btnExportAsImages = new System.Windows.Forms.ToolStripDropDownButton();
            this.usingFlexCelImgExportAllPagesrecommendedWayToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
            this.blackAndWhiteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
            this.colorsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
            this.trueColorToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
            this.usingFlexCelImgExport1PagerecommendedWayToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
            this.blackAndWhiteToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
            this.colorsToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
            this.trueColorToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
            this.multiPageTIFFUsingFlexCelImgExportToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
            this.faxToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
            this.blackAndWhiteToolStripMenuItem2 = new System.Windows.Forms.ToolStripMenuItem();
            this.colorsToolStripMenuItem2 = new System.Windows.Forms.ToolStripMenuItem();
            this.trueColorToolStripMenuItem2 = new System.Windows.Forms.ToolStripMenuItem();
            this.btnExit = new System.Windows.Forms.ToolStripButton();
            this.panel1.SuspendLayout();
            this.panel3.SuspendLayout();
            this.mainToolbar.SuspendLayout();
            this.SuspendLayout();
            //
            // openFileDialog1
            //
            this.openFileDialog1.DefaultExt = "xls";
            this.openFileDialog1.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm|Excel 97/2003|*.xls|Excel 2007|*.xlsx;*.xlsm|All " +
    "files|*.*";
            this.openFileDialog1.Title = "Open an Excel File";
            //
            // printDialog1
            //
            this.printDialog1.AllowSomePages = true;
            this.printDialog1.Document = this.flexCelPrintDocument1;
            //
            // flexCelPrintDocument1
            //
            this.flexCelPrintDocument1.AllVisibleSheets = false;
            this.flexCelPrintDocument1.ResetPageNumberOnEachSheet = false;
            this.flexCelPrintDocument1.Workbook = null;
            this.flexCelPrintDocument1.GetPrinterHardMargins += new FlexCel.Render.PrintHardMarginsEventHandler(this.flexCelPrintDocument1_GetPrinterHardMargins);
            this.flexCelPrintDocument1.BeforePrintPage += new System.Drawing.Printing.PrintPageEventHandler(this.flexCelPrintDocument1_BeforePrintPage);
            this.flexCelPrintDocument1.PrintPage += new System.Drawing.Printing.PrintPageEventHandler(this.flexCelPrintDocument1_PrintPage);
            //
            // printPreviewDialog1
            //
            this.printPreviewDialog1.AutoScrollMargin = new System.Drawing.Size(0, 0);
            this.printPreviewDialog1.AutoScrollMinSize = new System.Drawing.Size(0, 0);
            this.printPreviewDialog1.ClientSize = new System.Drawing.Size(400, 300);
            this.printPreviewDialog1.Document = this.flexCelPrintDocument1;
            this.printPreviewDialog1.Enabled = true;
            this.printPreviewDialog1.Icon = ((System.Drawing.Icon)(resources.GetObject("printPreviewDialog1.Icon")));
            this.printPreviewDialog1.Name = "printPreviewDialog1";
            this.printPreviewDialog1.Visible = false;
            //
            // panel1
            //
            this.panel1.BackColor = System.Drawing.Color.White;
            this.panel1.Controls.Add(this.cbResetPageNumber);
            this.panel1.Controls.Add(this.panel4);
            this.panel1.Controls.Add(this.cbAllSheets);
            this.panel1.Controls.Add(this.label19);
            this.panel1.Controls.Add(this.cbInterpolation);
            this.panel1.Controls.Add(this.chHeadings);
            this.panel1.Controls.Add(this.cbConfidential);
            this.panel1.Controls.Add(this.label18);
            this.panel1.Controls.Add(this.cbSheet);
            this.panel1.Controls.Add(this.panel3);
            this.panel1.Controls.Add(this.Landscape);
            this.panel1.Controls.Add(this.label11);
            this.panel1.Controls.Add(this.edf);
            this.panel1.Controls.Add(this.labelb);
            this.panel1.Controls.Add(this.edb);
            this.panel1.Controls.Add(this.label9);
            this.panel1.Controls.Add(this.edr);
            this.panel1.Controls.Add(this.label8);
            this.panel1.Controls.Add(this.edt);
            this.panel1.Controls.Add(this.label7);
            this.panel1.Controls.Add(this.edl);
            this.panel1.Controls.Add(this.label4);
            this.panel1.Controls.Add(this.edZoom);
            this.panel1.Controls.Add(this.chFitIn);
            this.panel1.Controls.Add(this.chPrintLeft);
            this.panel1.Controls.Add(this.label6);
            this.panel1.Controls.Add(this.label5);
            this.panel1.Controls.Add(this.edVPages);
            this.panel1.Controls.Add(this.edHPages);
            this.panel1.Controls.Add(this.edFooter);
            this.panel1.Controls.Add(this.label3);
            this.panel1.Controls.Add(this.edHeader);
            this.panel1.Controls.Add(this.label2);
            this.panel1.Controls.Add(this.edFileName);
            this.panel1.Controls.Add(this.chFormulaText);
            this.panel1.Controls.Add(this.chGridLines);
            this.panel1.Controls.Add(this.chAntiAlias);
            this.panel1.Controls.Add(this.label1);
            this.panel1.Controls.Add(this.label10);
            this.panel1.Controls.Add(this.edh);
            this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
            this.panel1.Location = new System.Drawing.Point(0, 38);
            this.panel1.Name = "panel1";
            this.panel1.Size = new System.Drawing.Size(768, 479);
            this.panel1.TabIndex = 3;
            //
            // cbResetPageNumber
            //
            this.cbResetPageNumber.Enabled = false;
            this.cbResetPageNumber.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.cbResetPageNumber.Location = new System.Drawing.Point(528, 48);
            this.cbResetPageNumber.Name = "cbResetPageNumber";
            this.cbResetPageNumber.Size = new System.Drawing.Size(216, 16);
            this.cbResetPageNumber.TabIndex = 39;
            this.cbResetPageNumber.Text = "Reset Page number on each sheet.";
            //
            // panel4
            //
            this.panel4.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
            | System.Windows.Forms.AnchorStyles.Right)));
            this.panel4.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.panel4.Location = new System.Drawing.Point(16, 72);
            this.panel4.Name = "panel4";
            this.panel4.Size = new System.Drawing.Size(736, 3);
            this.panel4.TabIndex = 38;
            //
            // cbAllSheets
            //
            this.cbAllSheets.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.cbAllSheets.Location = new System.Drawing.Point(32, 48);
            this.cbAllSheets.Name = "cbAllSheets";
            this.cbAllSheets.Size = new System.Drawing.Size(104, 16);
            this.cbAllSheets.TabIndex = 37;
            this.cbAllSheets.Text = "All Sheets";
            this.cbAllSheets.CheckedChanged += new System.EventHandler(this.cbAllSheets_CheckedChanged);
            //
            // label19
            //
            this.label19.Location = new System.Drawing.Point(392, 80);
            this.label19.Name = "label19";
            this.label19.Size = new System.Drawing.Size(160, 40);
            this.label19.TabIndex = 36;
            this.label19.Text = "Interpolation mode for images: Sometimes a lower mode might give crisper results." +
    "";
            //
            // cbInterpolation
            //
            this.cbInterpolation.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.cbInterpolation.Items.AddRange(new object[] {
            "Bicubic",
            "Bilinear",
            "Default",
            "High",
            "HighQualityBicubic",
            "HighQualityBilinear ",
            "Low",
            "NearestNeighbor"});
            this.cbInterpolation.Location = new System.Drawing.Point(560, 88);
            this.cbInterpolation.Name = "cbInterpolation";
            this.cbInterpolation.Size = new System.Drawing.Size(152, 21);
            this.cbInterpolation.TabIndex = 35;
            //
            // chHeadings
            //
            this.chHeadings.Location = new System.Drawing.Point(176, 136);
            this.chHeadings.Name = "chHeadings";
            this.chHeadings.Size = new System.Drawing.Size(128, 24);
            this.chHeadings.TabIndex = 34;
            this.chHeadings.Text = "Print Headings";
            //
            // cbConfidential
            //
            this.cbConfidential.Location = new System.Drawing.Point(56, 112);
            this.cbConfidential.Name = "cbConfidential";
            this.cbConfidential.Size = new System.Drawing.Size(232, 16);
            this.cbConfidential.TabIndex = 33;
            this.cbConfidential.Text = "Print \"Confidential\" on each page";
            //
            // label18
            //
            this.label18.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label18.Location = new System.Drawing.Point(168, 48);
            this.label18.Name = "label18";
            this.label18.Size = new System.Drawing.Size(88, 16);
            this.label18.TabIndex = 32;
            this.label18.Text = "Sheet to print:";
            //
            // cbSheet
            //
            this.cbSheet.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.cbSheet.Location = new System.Drawing.Point(256, 43);
            this.cbSheet.Name = "cbSheet";
            this.cbSheet.Size = new System.Drawing.Size(160, 21);
            this.cbSheet.TabIndex = 31;
            this.cbSheet.SelectedIndexChanged += new System.EventHandler(this.cbSheet_SelectedIndexChanged);
            //
            // panel3
            //
            this.panel3.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
            | System.Windows.Forms.AnchorStyles.Right)));
            this.panel3.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
            this.panel3.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.panel3.Controls.Add(this.edBottom);
            this.panel3.Controls.Add(this.label17);
            this.panel3.Controls.Add(this.edRight);
            this.panel3.Controls.Add(this.label16);
            this.panel3.Controls.Add(this.edLeft);
            this.panel3.Controls.Add(this.label15);
            this.panel3.Controls.Add(this.edTop);
            this.panel3.Controls.Add(this.label14);
            this.panel3.Controls.Add(this.label13);
            this.panel3.Controls.Add(this.label12);
            this.panel3.Location = new System.Drawing.Point(504, 232);
            this.panel3.Name = "panel3";
            this.panel3.Size = new System.Drawing.Size(216, 224);
            this.panel3.TabIndex = 30;
            //
            // edBottom
            //
            this.edBottom.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.edBottom.Location = new System.Drawing.Point(80, 136);
            this.edBottom.Name = "edBottom";
            this.edBottom.Size = new System.Drawing.Size(48, 20);
            this.edBottom.TabIndex = 26;
            this.edBottom.Text = "0";
            //
            // label17
            //
            this.label17.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label17.Location = new System.Drawing.Point(16, 160);
            this.label17.Name = "label17";
            this.label17.Size = new System.Drawing.Size(56, 16);
            this.label17.TabIndex = 25;
            this.label17.Text = "Last Col:";
            //
            // edRight
            //
            this.edRight.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.edRight.Location = new System.Drawing.Point(80, 160);
            this.edRight.Name = "edRight";
            this.edRight.Size = new System.Drawing.Size(48, 20);
            this.edRight.TabIndex = 24;
            this.edRight.Text = "0";
            //
            // label16
            //
            this.label16.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label16.Location = new System.Drawing.Point(16, 136);
            this.label16.Name = "label16";
            this.label16.Size = new System.Drawing.Size(85, 16);
            this.label16.TabIndex = 23;
            this.label16.Text = "Last Row:";
            //
            // edLeft
            //
            this.edLeft.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.edLeft.Location = new System.Drawing.Point(80, 112);
            this.edLeft.Name = "edLeft";
            this.edLeft.Size = new System.Drawing.Size(48, 20);
            this.edLeft.TabIndex = 22;
            this.edLeft.Text = "0";
            //
            // label15
            //
            this.label15.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label15.Location = new System.Drawing.Point(16, 112);
            this.label15.Name = "label15";
            this.label15.Size = new System.Drawing.Size(85, 16);
            this.label15.TabIndex = 21;
            this.label15.Text = "First Col:";
            //
            // edTop
            //
            this.edTop.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.edTop.Location = new System.Drawing.Point(80, 88);
            this.edTop.Name = "edTop";
            this.edTop.Size = new System.Drawing.Size(48, 20);
            this.edTop.TabIndex = 20;
            this.edTop.Text = "0";
            //
            // label14
            //
            this.label14.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label14.Location = new System.Drawing.Point(8, 88);
            this.label14.Name = "label14";
            this.label14.Size = new System.Drawing.Size(85, 16);
            this.label14.TabIndex = 3;
            this.label14.Text = "First Row:";
            //
            // label13
            //
            this.label13.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
            | System.Windows.Forms.AnchorStyles.Right)));
            this.label13.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label13.Location = new System.Drawing.Point(8, 32);
            this.label13.Name = "label13";
            this.label13.Size = new System.Drawing.Size(192, 32);
            this.label13.TabIndex = 2;
            this.label13.Text = "If one of this values is <=0 all print_range will be printed";
            //
            // label12
            //
            this.label12.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label12.Location = new System.Drawing.Point(8, 16);
            this.label12.Name = "label12";
            this.label12.Size = new System.Drawing.Size(192, 16);
            this.label12.TabIndex = 1;
            this.label12.Text = "Range to Print:";
            //
            // Landscape
            //
            this.Landscape.Location = new System.Drawing.Point(456, 136);
            this.Landscape.Name = "Landscape";
            this.Landscape.Size = new System.Drawing.Size(96, 24);
            this.Landscape.TabIndex = 29;
            this.Landscape.Text = "Landscape";
            //
            // label11
            //
            this.label11.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label11.Location = new System.Drawing.Point(264, 416);
            this.label11.Name = "label11";
            this.label11.Size = new System.Drawing.Size(80, 16);
            this.label11.TabIndex = 28;
            this.label11.Text = "Footer Margin";
            //
            // edf
            //
            this.edf.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.edf.Location = new System.Drawing.Point(344, 416);
            this.edf.Name = "edf";
            this.edf.Size = new System.Drawing.Size(128, 20);
            this.edf.TabIndex = 27;
            //
            // labelb
            //
            this.labelb.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.labelb.Location = new System.Drawing.Point(256, 368);
            this.labelb.Name = "labelb";
            this.labelb.Size = new System.Drawing.Size(88, 16);
            this.labelb.TabIndex = 26;
            this.labelb.Text = "Bottom Margin";
            //
            // edb
            //
            this.edb.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.edb.Location = new System.Drawing.Point(344, 368);
            this.edb.Name = "edb";
            this.edb.Size = new System.Drawing.Size(128, 20);
            this.edb.TabIndex = 25;
            //
            // label9
            //
            this.label9.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label9.Location = new System.Drawing.Point(56, 368);
            this.label9.Name = "label9";
            this.label9.Size = new System.Drawing.Size(80, 16);
            this.label9.TabIndex = 24;
            this.label9.Text = "Right Margin";
            //
            // edr
            //
            this.edr.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.edr.Location = new System.Drawing.Point(136, 368);
            this.edr.Name = "edr";
            this.edr.Size = new System.Drawing.Size(112, 20);
            this.edr.TabIndex = 23;
            //
            // label8
            //
            this.label8.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label8.Location = new System.Drawing.Point(264, 328);
            this.label8.Name = "label8";
            this.label8.Size = new System.Drawing.Size(80, 16);
            this.label8.TabIndex = 22;
            this.label8.Text = "Top Margin";
            //
            // edt
            //
            this.edt.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.edt.Location = new System.Drawing.Point(344, 328);
            this.edt.Name = "edt";
            this.edt.Size = new System.Drawing.Size(128, 20);
            this.edt.TabIndex = 21;
            //
            // label7
            //
            this.label7.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label7.Location = new System.Drawing.Point(56, 328);
            this.label7.Name = "label7";
            this.label7.Size = new System.Drawing.Size(80, 16);
            this.label7.TabIndex = 20;
            this.label7.Text = "Left Margin";
            //
            // edl
            //
            this.edl.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.edl.Location = new System.Drawing.Point(136, 328);
            this.edl.Name = "edl";
            this.edl.Size = new System.Drawing.Size(112, 20);
            this.edl.TabIndex = 19;
            //
            // label4
            //
            this.label4.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label4.Location = new System.Drawing.Point(120, 280);
            this.label4.Name = "label4";
            this.label4.Size = new System.Drawing.Size(56, 16);
            this.label4.TabIndex = 18;
            this.label4.Text = "Zoom (%)";
            //
            // edZoom
            //
            this.edZoom.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.edZoom.Location = new System.Drawing.Point(184, 280);
            this.edZoom.Name = "edZoom";
            this.edZoom.Size = new System.Drawing.Size(24, 20);
            this.edZoom.TabIndex = 17;
            //
            // chFitIn
            //
            this.chFitIn.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.chFitIn.Location = new System.Drawing.Point(56, 248);
            this.chFitIn.Name = "chFitIn";
            this.chFitIn.Size = new System.Drawing.Size(56, 24);
            this.chFitIn.TabIndex = 16;
            this.chFitIn.Text = "Fit in";
            this.chFitIn.CheckedChanged += new System.EventHandler(this.chFitIn_CheckedChanged);
            //
            // chPrintLeft
            //
            this.chPrintLeft.Location = new System.Drawing.Point(312, 136);
            this.chPrintLeft.Name = "chPrintLeft";
            this.chPrintLeft.Size = new System.Drawing.Size(136, 24);
            this.chPrintLeft.TabIndex = 15;
            this.chPrintLeft.Text = "Print Left, then down.";
            //
            // label6
            //
            this.label6.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label6.Location = new System.Drawing.Point(256, 248);
            this.label6.Name = "label6";
            this.label6.Size = new System.Drawing.Size(80, 16);
            this.label6.TabIndex = 14;
            this.label6.Text = "pages tall.";
            //
            // label5
            //
            this.label5.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label5.Location = new System.Drawing.Point(144, 248);
            this.label5.Name = "label5";
            this.label5.Size = new System.Drawing.Size(80, 16);
            this.label5.TabIndex = 13;
            this.label5.Text = "pages wide x";
            //
            // edVPages
            //
            this.edVPages.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.edVPages.Location = new System.Drawing.Point(224, 248);
            this.edVPages.Name = "edVPages";
            this.edVPages.ReadOnly = true;
            this.edVPages.Size = new System.Drawing.Size(24, 20);
            this.edVPages.TabIndex = 12;
            //
            // edHPages
            //
            this.edHPages.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.edHPages.Location = new System.Drawing.Point(112, 248);
            this.edHPages.Name = "edHPages";
            this.edHPages.ReadOnly = true;
            this.edHPages.Size = new System.Drawing.Size(24, 20);
            this.edHPages.TabIndex = 10;
            //
            // edFooter
            //
            this.edFooter.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
            | System.Windows.Forms.AnchorStyles.Right)));
            this.edFooter.BackColor = System.Drawing.Color.White;
            this.edFooter.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.edFooter.Location = new System.Drawing.Point(112, 200);
            this.edFooter.Name = "edFooter";
            this.edFooter.Size = new System.Drawing.Size(608, 20);
            this.edFooter.TabIndex = 8;
            //
            // label3
            //
            this.label3.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label3.Location = new System.Drawing.Point(56, 200);
            this.label3.Name = "label3";
            this.label3.Size = new System.Drawing.Size(56, 16);
            this.label3.TabIndex = 7;
            this.label3.Text = "Footer:";
            //
            // edHeader
            //
            this.edHeader.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
            | System.Windows.Forms.AnchorStyles.Right)));
            this.edHeader.BackColor = System.Drawing.Color.White;
            this.edHeader.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.edHeader.Location = new System.Drawing.Point(112, 176);
            this.edHeader.Name = "edHeader";
            this.edHeader.Size = new System.Drawing.Size(608, 20);
            this.edHeader.TabIndex = 6;
            //
            // label2
            //
            this.label2.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label2.Location = new System.Drawing.Point(56, 176);
            this.label2.Name = "label2";
            this.label2.Size = new System.Drawing.Size(56, 16);
            this.label2.TabIndex = 5;
            this.label2.Text = "Header:";
            //
            // edFileName
            //
            this.edFileName.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
            | System.Windows.Forms.AnchorStyles.Right)));
            this.edFileName.BackColor = System.Drawing.Color.White;
            this.edFileName.BorderStyle = System.Windows.Forms.BorderStyle.None;
            this.edFileName.Location = new System.Drawing.Point(112, 16);
            this.edFileName.Name = "edFileName";
            this.edFileName.ReadOnly = true;
            this.edFileName.Size = new System.Drawing.Size(632, 13);
            this.edFileName.TabIndex = 4;
            this.edFileName.Text = "No file selected";
            //
            // chFormulaText
            //
            this.chFormulaText.Location = new System.Drawing.Point(576, 136);
            this.chFormulaText.Name = "chFormulaText";
            this.chFormulaText.Size = new System.Drawing.Size(136, 24);
            this.chFormulaText.TabIndex = 3;
            this.chFormulaText.Text = "Print Formula Text";
            //
            // chGridLines
            //
            this.chGridLines.Location = new System.Drawing.Point(56, 136);
            this.chGridLines.Name = "chGridLines";
            this.chGridLines.Size = new System.Drawing.Size(104, 24);
            this.chGridLines.TabIndex = 2;
            this.chGridLines.Text = "Print Grid Lines";
            //
            // chAntiAlias
            //
            this.chAntiAlias.Location = new System.Drawing.Point(56, 88);
            this.chAntiAlias.Name = "chAntiAlias";
            this.chAntiAlias.Size = new System.Drawing.Size(152, 16);
            this.chAntiAlias.TabIndex = 1;
            this.chAntiAlias.Text = "Antialias Text";
            //
            // label1
            //
            this.label1.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label1.Location = new System.Drawing.Point(24, 16);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(80, 16);
            this.label1.TabIndex = 0;
            this.label1.Text = "File to print:";
            //
            // label10
            //
            this.label10.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label10.Location = new System.Drawing.Point(48, 416);
            this.label10.Name = "label10";
            this.label10.Size = new System.Drawing.Size(88, 16);
            this.label10.TabIndex = 22;
            this.label10.Text = "Header Margin";
            //
            // edh
            //
            this.edh.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.edh.Location = new System.Drawing.Point(136, 416);
            this.edh.Name = "edh";
            this.edh.Size = new System.Drawing.Size(112, 20);
            this.edh.TabIndex = 21;
            //
            // exportImageDialog
            //
            this.exportImageDialog.DefaultExt = "png";
            this.exportImageDialog.Filter = "Png files|*.png|Jpg files|*.jpg";
            this.exportImageDialog.Title = "Save image as...";
            //
            // exportTiffDialog
            //
            this.exportTiffDialog.DefaultExt = "tif";
            this.exportTiffDialog.Filter = "TIFF Files|*.tif";
            this.exportTiffDialog.Title = "Save image as multi page tiff...";
            //
            // mainToolbar
            //
            this.mainToolbar.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.btnOpenFile,
            this.toolStripSeparator1,
            this.btnSetup,
            this.btnPreview,
            this.btnPrint,
            this.toolStripSeparator2,
            this.btnExportAsImages,
            this.btnExit});
            this.mainToolbar.Location = new System.Drawing.Point(0, 0);
            this.mainToolbar.Name = "mainToolbar";
            this.mainToolbar.Size = new System.Drawing.Size(768, 38);
            this.mainToolbar.TabIndex = 11;
            this.mainToolbar.Text = "toolStrip1";
            //
            // btnOpenFile
            //
            this.btnOpenFile.Image = ((System.Drawing.Image)(resources.GetObject("btnOpenFile.Image")));
            this.btnOpenFile.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.btnOpenFile.Name = "btnOpenFile";
            this.btnOpenFile.Size = new System.Drawing.Size(59, 35);
            this.btnOpenFile.Text = "Open file";
            this.btnOpenFile.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
            this.btnOpenFile.Click += new System.EventHandler(this.openFile_Click);
            //
            // toolStripSeparator1
            //
            this.toolStripSeparator1.Name = "toolStripSeparator1";
            this.toolStripSeparator1.Size = new System.Drawing.Size(6, 46);
            //
            // btnSetup
            //
            this.btnSetup.Image = ((System.Drawing.Image)(resources.GetObject("btnSetup.Image")));
            this.btnSetup.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.btnSetup.Name = "btnSetup";
            this.btnSetup.Size = new System.Drawing.Size(69, 35);
            this.btnSetup.Text = "Print &Setup";
            this.btnSetup.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
            this.btnSetup.Click += new System.EventHandler(this.setup_Click);
            //
            // btnPreview
            //
            this.btnPreview.Image = ((System.Drawing.Image)(resources.GetObject("btnPreview.Image")));
            this.btnPreview.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.btnPreview.Name = "btnPreview";
            this.btnPreview.Size = new System.Drawing.Size(80, 35);
            this.btnPreview.Text = "Print Pre&view";
            this.btnPreview.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
            this.btnPreview.Click += new System.EventHandler(this.preview_Click);
            //
            // btnPrint
            //
            this.btnPrint.Image = ((System.Drawing.Image)(resources.GetObject("btnPrint.Image")));
            this.btnPrint.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.btnPrint.Name = "btnPrint";
            this.btnPrint.Size = new System.Drawing.Size(36, 35);
            this.btnPrint.Text = "&Print";
            this.btnPrint.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
            this.btnPrint.Click += new System.EventHandler(this.print_Click);
            //
            // toolStripSeparator2
            //
            this.toolStripSeparator2.Name = "toolStripSeparator2";
            this.toolStripSeparator2.Size = new System.Drawing.Size(6, 46);
            //
            // btnExportAsImages
            //
            this.btnExportAsImages.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.usingFlexCelImgExportAllPagesrecommendedWayToolStripMenuItem,
            this.usingFlexCelImgExport1PagerecommendedWayToolStripMenuItem,
            this.multiPageTIFFUsingFlexCelImgExportToolStripMenuItem});
            this.btnExportAsImages.Image = ((System.Drawing.Image)(resources.GetObject("btnExportAsImages.Image")));
            this.btnExportAsImages.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.btnExportAsImages.Name = "btnExportAsImages";
            this.btnExportAsImages.Size = new System.Drawing.Size(108, 35);
            this.btnExportAsImages.Text = "Export as &Images";
            this.btnExportAsImages.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
            //
            // usingFlexCelImgExportAllPagesrecommendedWayToolStripMenuItem
            //
            this.usingFlexCelImgExportAllPagesrecommendedWayToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.blackAndWhiteToolStripMenuItem,
            this.colorsToolStripMenuItem,
            this.trueColorToolStripMenuItem});
            this.usingFlexCelImgExportAllPagesrecommendedWayToolStripMenuItem.Name = "usingFlexCelImgExportAllPagesrecommendedWayToolStripMenuItem";
            this.usingFlexCelImgExportAllPagesrecommendedWayToolStripMenuItem.Size = new System.Drawing.Size(153, 22);
            this.usingFlexCelImgExportAllPagesrecommendedWayToolStripMenuItem.Text = "All pages";
            //
            // blackAndWhiteToolStripMenuItem
            //
            this.blackAndWhiteToolStripMenuItem.Name = "blackAndWhiteToolStripMenuItem";
            this.blackAndWhiteToolStripMenuItem.Size = new System.Drawing.Size(161, 22);
            this.blackAndWhiteToolStripMenuItem.Text = "Black And White";
            this.blackAndWhiteToolStripMenuItem.Click += new System.EventHandler(this.ImgBlackAndWhite_Click);
            //
            // colorsToolStripMenuItem
            //
            this.colorsToolStripMenuItem.Name = "colorsToolStripMenuItem";
            this.colorsToolStripMenuItem.Size = new System.Drawing.Size(161, 22);
            this.colorsToolStripMenuItem.Text = "256 Colors";
            this.colorsToolStripMenuItem.Click += new System.EventHandler(this.Img256Colors_Click);
            //
            // trueColorToolStripMenuItem
            //
            this.trueColorToolStripMenuItem.Name = "trueColorToolStripMenuItem";
            this.trueColorToolStripMenuItem.Size = new System.Drawing.Size(161, 22);
            this.trueColorToolStripMenuItem.Text = "True Color";
            this.trueColorToolStripMenuItem.Click += new System.EventHandler(this.ImgTrueColor_Click);
            //
            // usingFlexCelImgExport1PagerecommendedWayToolStripMenuItem
            //
            this.usingFlexCelImgExport1PagerecommendedWayToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.blackAndWhiteToolStripMenuItem1,
            this.colorsToolStripMenuItem1,
            this.trueColorToolStripMenuItem1});
            this.usingFlexCelImgExport1PagerecommendedWayToolStripMenuItem.Name = "usingFlexCelImgExport1PagerecommendedWayToolStripMenuItem";
            this.usingFlexCelImgExport1PagerecommendedWayToolStripMenuItem.Size = new System.Drawing.Size(153, 22);
            this.usingFlexCelImgExport1PagerecommendedWayToolStripMenuItem.Text = "1 page";
            //
            // blackAndWhiteToolStripMenuItem1
            //
            this.blackAndWhiteToolStripMenuItem1.Name = "blackAndWhiteToolStripMenuItem1";
            this.blackAndWhiteToolStripMenuItem1.Size = new System.Drawing.Size(161, 22);
            this.blackAndWhiteToolStripMenuItem1.Text = "Black And White";
            this.blackAndWhiteToolStripMenuItem1.Click += new System.EventHandler(this.ImgBlackAndWhite2_Click);
            //
            // colorsToolStripMenuItem1
            //
            this.colorsToolStripMenuItem1.Name = "colorsToolStripMenuItem1";
            this.colorsToolStripMenuItem1.Size = new System.Drawing.Size(161, 22);
            this.colorsToolStripMenuItem1.Text = "256 Colors";
            this.colorsToolStripMenuItem1.Click += new System.EventHandler(this.Img256Colors2_Click);
            //
            // trueColorToolStripMenuItem1
            //
            this.trueColorToolStripMenuItem1.Name = "trueColorToolStripMenuItem1";
            this.trueColorToolStripMenuItem1.Size = new System.Drawing.Size(161, 22);
            this.trueColorToolStripMenuItem1.Text = "True Color";
            this.trueColorToolStripMenuItem1.Click += new System.EventHandler(this.ImgTrueColor2_Click);
            //
            // multiPageTIFFUsingFlexCelImgExportToolStripMenuItem
            //
            this.multiPageTIFFUsingFlexCelImgExportToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.faxToolStripMenuItem,
            this.blackAndWhiteToolStripMenuItem2,
            this.colorsToolStripMenuItem2,
            this.trueColorToolStripMenuItem2});
            this.multiPageTIFFUsingFlexCelImgExportToolStripMenuItem.Name = "multiPageTIFFUsingFlexCelImgExportToolStripMenuItem";
            this.multiPageTIFFUsingFlexCelImgExportToolStripMenuItem.Size = new System.Drawing.Size(153, 22);
            this.multiPageTIFFUsingFlexCelImgExportToolStripMenuItem.Text = "MultiPage TIFF";
            //
            // faxToolStripMenuItem
            //
            this.faxToolStripMenuItem.Name = "faxToolStripMenuItem";
            this.faxToolStripMenuItem.Size = new System.Drawing.Size(161, 22);
            this.faxToolStripMenuItem.Text = "Fax";
            this.faxToolStripMenuItem.Click += new System.EventHandler(this.TiffFax_Click);
            //
            // blackAndWhiteToolStripMenuItem2
            //
            this.blackAndWhiteToolStripMenuItem2.Name = "blackAndWhiteToolStripMenuItem2";
            this.blackAndWhiteToolStripMenuItem2.Size = new System.Drawing.Size(161, 22);
            this.blackAndWhiteToolStripMenuItem2.Text = "Black And White";
            this.blackAndWhiteToolStripMenuItem2.Click += new System.EventHandler(this.TiffBlackAndWhite_Click);
            //
            // colorsToolStripMenuItem2
            //
            this.colorsToolStripMenuItem2.Name = "colorsToolStripMenuItem2";
            this.colorsToolStripMenuItem2.Size = new System.Drawing.Size(161, 22);
            this.colorsToolStripMenuItem2.Text = "256 Colors";
            this.colorsToolStripMenuItem2.Click += new System.EventHandler(this.Tiff256Colors_Click);
            //
            // trueColorToolStripMenuItem2
            //
            this.trueColorToolStripMenuItem2.Name = "trueColorToolStripMenuItem2";
            this.trueColorToolStripMenuItem2.Size = new System.Drawing.Size(161, 22);
            this.trueColorToolStripMenuItem2.Text = "True Color";
            this.trueColorToolStripMenuItem2.Click += new System.EventHandler(this.TiffTrueColor_Click);
            //
            // btnExit
            //
            this.btnExit.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right;
            this.btnExit.Image = ((System.Drawing.Image)(resources.GetObject("btnExit.Image")));
            this.btnExit.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.btnExit.Name = "btnExit";
            this.btnExit.Size = new System.Drawing.Size(59, 35);
            this.btnExit.Text = "     E&xit     ";
            this.btnExit.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
            this.btnExit.Click += new System.EventHandler(this.button2_Click);
            //
            // mainForm
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(768, 517);
            this.Controls.Add(this.panel1);
            this.Controls.Add(this.mainToolbar);
            this.Name = "mainForm";
            this.Text = "Print and preview a file";
            this.panel1.ResumeLayout(false);
            this.panel1.PerformLayout();
            this.panel3.ResumeLayout(false);
            this.panel3.PerformLayout();
            this.mainToolbar.ResumeLayout(false);
            this.mainToolbar.PerformLayout();
            this.ResumeLayout(false);
            this.PerformLayout();

        }
        #endregion

        private ToolStrip mainToolbar;
        private ToolStripButton btnOpenFile;
        private ToolStripSeparator toolStripSeparator1;
        private ToolStripButton btnSetup;
        private ToolStripButton btnPreview;
        private ToolStripButton btnPrint;
        private ToolStripSeparator toolStripSeparator2;
        private ToolStripButton btnExit;
        private ToolStripDropDownButton btnExportAsImages;
        private ToolStripMenuItem usingFlexCelImgExportAllPagesrecommendedWayToolStripMenuItem;
        private ToolStripMenuItem blackAndWhiteToolStripMenuItem;
        private ToolStripMenuItem colorsToolStripMenuItem;
        private ToolStripMenuItem trueColorToolStripMenuItem;
        private ToolStripMenuItem usingFlexCelImgExport1PagerecommendedWayToolStripMenuItem;
        private ToolStripMenuItem blackAndWhiteToolStripMenuItem1;
        private ToolStripMenuItem colorsToolStripMenuItem1;
        private ToolStripMenuItem trueColorToolStripMenuItem1;
        private ToolStripMenuItem multiPageTIFFUsingFlexCelImgExportToolStripMenuItem;
        private ToolStripMenuItem faxToolStripMenuItem;
        private ToolStripMenuItem blackAndWhiteToolStripMenuItem2;
        private ToolStripMenuItem colorsToolStripMenuItem2;
        private ToolStripMenuItem trueColorToolStripMenuItem2;
    }
}

Program.cs

using System;
using System.Windows.Forms;

namespace PrintPreviewandExport
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new mainForm());
        }
    }
}


Custom previewing (C# / netframework) | FlexCel Studio for the .NET Framework documentation

Custom previewing (C# / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\csharp\VS2022\netframework\25.Printing and Exporting\20.CustomPreview and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​csharp/​VS2022/​netframework/​Modules/​25.​Printing and Exporting/​20.​Custom​Preview

Overview

FlexCel comes with a full featured viewer that you can use to display a preview of Excel files in your application, and without having any printer installed.

Concepts

  • How to create a preview form that you can embed inside your application, including thumbnails, navigation, etc.

  • How to Export to PDF from a thread, allowing the user to cancel it.

Files

AssemblyInfo.cs

using System.Reflection;
using System.Runtime.CompilerServices;

//
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
//
[assembly: AssemblyTitle("Custom Preview")]
[assembly: AssemblyDescription("A custom previewer of xls files using FlexCel engine.")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("TMS Software")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("(c) 2002 - 2024 TMS Software")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

//
// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version
//      Build Number
//      Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:

[assembly: AssemblyVersion("7.21.0.0")]

//
// In order to sign your assembly you must specify a key to use. Refer to the
// Microsoft .NET Framework documentation for more information on assembly signing.
//
// Use the attributes below to control which key is used for signing.
//
// Notes:
//   (*) If no key is specified, the assembly is not signed.
//   (*) KeyName refers to a key that has been installed in the Crypto Service
//       Provider (CSP) on your machine. KeyFile refers to a file which contains
//       a key.
//   (*) If the KeyFile and the KeyName values are both specified, the
//       following processing occurs:
//       (1) If the KeyName can be found in the CSP, that key is used.
//       (2) If the KeyName does not exist and the KeyFile does exist, the key
//           in the KeyFile is installed into the CSP and used.
//   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
//       When specifying the KeyFile, the location of the KeyFile should be
//       relative to the project output directory which is
//       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
//       located in the project directory, you would specify the AssemblyKeyFile
//       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
//   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
//       documentation for more information on this.
//
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]
[assembly: AssemblyKeyName("")]

Form1.cs

using System;
using System.Drawing;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using System.Drawing.Drawing2D;

using System.Diagnostics;
using System.Threading;

using FlexCel.Core;
using FlexCel.XlsAdapter;
using FlexCel.Winforms;
using FlexCel.Render;
using FlexCel.Pdf;

namespace CustomPreview
{
    /// <summary>
    /// Previewer of files.
    /// </summary>
    public partial class mainForm: System.Windows.Forms.Form
    {
        public mainForm() : this(new string[0])
        {
        }

        public mainForm(string[] Args)
        {
            InitializeComponent();
            ResizeToolbar(mainToolbar);
            if (Args.Length > 0)
            {
                LoadFile(Args[0]);
            }

            if (ExcelFile.SupportsXlsx)
            {
                this.openFileDialog.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm|Excel 97/2003|*.xls|Excel 2007|*.xlsx;*.xlsm|All files|*.*";
            }

            MainPreview.CenteredPreview = true;
            thumbs.CenteredPreview = true;
        }

        private void ResizeToolbar(ToolStrip toolbar)
        {

            using (Graphics gr = CreateGraphics())
            {
                double xFactor = gr.DpiX / 96.0;
                double yFactor = gr.DpiY / 96.0;
                toolbar.ImageScalingSize = new Size((int)(24 * xFactor), (int)(24 * yFactor));
                toolbar.Width = 0; //force a recalc of the buttons.
            }
        }

        private void UpdatePages()
        {
            edPage.Text = String.Format("{0} of {1}", MainPreview.StartPage, MainPreview.TotalPages);
        }

        private void flexCelPreview1_StartPageChanged(object sender, System.EventArgs e)
        {
            UpdatePages();
        }

        private void ChangePages()
        {
            string s = edPage.Text.Trim();
            int pos = 0;
            while (pos < s.Length && s[pos] >= '0' && s[pos] <= '9') pos++;
            if (pos > 0)
            {
                int page = MainPreview.StartPage;
                try
                {
                    page = Convert.ToInt32(s.Substring(0, pos));
                }
                catch (Exception)
                {
                }

                MainPreview.StartPage = page;
            }
            UpdatePages();
        }

        private void edPage_Leave(object sender, System.EventArgs e)
        {
            ChangePages();
        }

        private void edPage_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
        {
            if (e.KeyChar == (char)13)
                ChangePages();
            if (e.KeyChar == (char)27)
                UpdatePages();
        }

        private void flexCelPreview1_ZoomChanged(object sender, System.EventArgs e)
        {
            UpdateZoom();
        }

        private void UpdateZoom()
        {
            edZoom.Text = String.Format("{0}%", (int)Math.Round(MainPreview.Zoom * 100));
            if (MainPreview.AutofitPreview == TAutofitPreview.None) UpdateAutofitText();
        }

        private void ChangeZoom()
        {
            string s = edZoom.Text.Trim();
            int pos = 0;
            while (pos < s.Length && s[pos] >= '0' && s[pos] <= '9') pos++;
            if (pos > 0)
            {
                int zoom = (int)Math.Round(MainPreview.Zoom * 100);
                try
                {
                    zoom = Convert.ToInt32(s.Substring(0, pos));
                }
                catch (Exception)
                {
                }

                MainPreview.Zoom = zoom / 100.0;
            }
            UpdateZoom();
        }

        private void edZoom_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
        {
            if (e.KeyChar == (char)13)
                ChangeZoom();
            if (e.KeyChar == (char)27)
                UpdateZoom();
        }

        private void edZoom_Enter(object sender, System.EventArgs e)
        {
            ChangeZoom();
        }

        private void btnClose_Click(object sender, System.EventArgs e)
        {
            Close();
        }

        private void openFile_Click(object sender, System.EventArgs e)
        {
            if (openFileDialog.ShowDialog() != DialogResult.OK) return;
            LoadFile(openFileDialog.FileName);
        }

        //The event that will actually provide the password to open the empty form.
        private void GetPassword(OnPasswordEventArgs e)
        {
            PasswordForm Pwd = new PasswordForm();
            e.Password = string.Empty;
            if (Pwd.ShowDialog() != DialogResult.OK) return;
            e.Password = Pwd.Password;
        }

        internal void LoadFile(string FileName)
        {
            openFileDialog.FileName = FileName;
            lbSheets.Items.Clear();

            XlsFile xls = new XlsFile();
            xls.HeadingColWidth = -1;
            xls.HeadingRowHeight = -1;
            xls.Protection.OnPassword += new OnPasswordEventHandler(GetPassword);
            xls.Open(FileName);

            for (int i = 1; i <= xls.SheetCount; i++)
            {
                lbSheets.Items.Add(xls.GetSheetName(i));
            }

            lbSheets.SelectedIndex = xls.ActiveSheet - 1;

            flexCelImgExport1.Workbook = xls;
            MainPreview.InvalidatePreview();
            Text = "Custom Preview: " + openFileDialog.FileName;
            //btnHeadings.Checked = flexCelImgExport1.Workbook.PrintHeadings;
            //btnGridLines.Checked = flexCelImgExport1.Workbook.PrintGridLines;
            btnFirst.Enabled = true; btnPrev.Enabled = true; btnNext.Enabled = true; btnLast.Enabled = true; edPage.Enabled = true;
            btnZoomIn.Enabled = true; edZoom.Enabled = true; btnZoomOut.Enabled = true;
            btnGridLines.Enabled = true; btnHeadings.Enabled = true; btnRecalc.Enabled = true; btnPdf.Enabled = true;

        }

        private void btnFirst_Click(object sender, System.EventArgs e)
        {
            MainPreview.StartPage = 1;
        }

        private void btnPrev_Click(object sender, System.EventArgs e)
        {
            MainPreview.StartPage--;
        }

        private void btnNext_Click(object sender, System.EventArgs e)
        {
            MainPreview.StartPage++;
        }

        private void btnLast_Click(object sender, System.EventArgs e)
        {
            MainPreview.StartPage = MainPreview.TotalPages;
        }

        private void btnZoomOut_Click(object sender, System.EventArgs e)
        {
            MainPreview.Zoom -= 0.1;
        }

        private void btnZoomIn_Click(object sender, System.EventArgs e)
        {
            MainPreview.Zoom += 0.1;
        }

        private void lbSheets_SelectedIndexChanged(object sender, System.EventArgs e)
        {
            if (flexCelImgExport1.Workbook == null) return;
            if (lbSheets.Items.Count > flexCelImgExport1.Workbook.SheetCount) return;
            flexCelImgExport1.Workbook.ActiveSheet = lbSheets.SelectedIndex + 1;
            MainPreview.InvalidatePreview();
        }

        private void btnPdf_Click(object sender, System.EventArgs e)
        {
            if (flexCelImgExport1.Workbook == null)
            {
                MessageBox.Show("There is no open file");
                return;
            }
            if (PdfSaveFileDialog.ShowDialog() != DialogResult.OK) return;

            using (FlexCelPdfExport PdfExport = new FlexCelPdfExport(flexCelImgExport1.Workbook, true))
            {
                if (!DoExportToPdf(PdfExport)) return;
            }

            if (MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo, MessageBoxIcon.Question) != DialogResult.Yes) return;
            Process.Start(PdfSaveFileDialog.FileName);
        }

        private bool DoExportToPdf(FlexCelPdfExport PdfExport)
        {
            PdfThread MyPdfThread = new PdfThread(PdfExport, PdfSaveFileDialog.FileName, cbAllSheets.Checked);
            Thread PdfExportThread = new Thread(new ThreadStart(MyPdfThread.ExportToPdf));
            PdfExportThread.Start();
            using (PdfProgressDialog Pg = new PdfProgressDialog())
            {
                Pg.ShowProgress(PdfExportThread, PdfExport);
                if (Pg.DialogResult != DialogResult.OK)
                {
                    PdfExport.Cancel();
                    PdfExportThread.Join(); //We could just leave the thread running until it dies, but there are 2 reasons for waiting until it finishes:
                                            //1) We could dispose it before it ends. This is workaroundable.
                                            //2) We might change its workbook object before it ends (by loading other file). This will surely bring issues.
                    return false;
                }

                if (MyPdfThread != null && MyPdfThread.MainException != null)
                {
                    throw MyPdfThread.MainException;
                }
            }
            return true;
        }

        private void cbAllSheets_CheckedChanged(object sender, System.EventArgs e)
        {
            lbSheets.Visible = !cbAllSheets.Checked;
            sheetSplitter.Visible = lbSheets.Visible;
            flexCelImgExport1.AllVisibleSheets = cbAllSheets.Checked;
            if (flexCelImgExport1.Workbook == null) return;
            MainPreview.InvalidatePreview();

        }

        private void btnRecalc_Click(object sender, System.EventArgs e)
        {
            if (flexCelImgExport1.Workbook == null)
            {
                MessageBox.Show("Please open a file before recalculating.");
                return;
            }
            flexCelImgExport1.Workbook.Recalc(true);
            MainPreview.InvalidatePreview();

        }

        private void mainForm_Load(object sender, System.EventArgs e)
        {
        }

        private void btnHeadings_Click(object sender, EventArgs e)
        {
            ExcelFile xls = flexCelImgExport1.Workbook;
            if (xls == null)
            {
                return;
            }

            if (cbAllSheets.Checked)
            {
                int SaveActiveSheet = xls.ActiveSheet;
                for (int sheet = 1; sheet <= xls.SheetCount; sheet++)
                {
                    xls.ActiveSheet = sheet;
                    xls.PrintHeadings = btnHeadings.Checked;
                }
                xls.ActiveSheet = SaveActiveSheet;
            }
            else
            {
                xls.PrintHeadings = btnHeadings.Checked;
            }
            MainPreview.InvalidatePreview();

        }

        private void btnGridLines_Click(object sender, EventArgs e)
        {
            ExcelFile xls = flexCelImgExport1.Workbook;
            if (xls == null)
            {
                return;
            }

            if (cbAllSheets.Checked)
            {
                int SaveActiveSheet = xls.ActiveSheet;
                for (int sheet = 1; sheet <= xls.SheetCount; sheet++)
                {
                    xls.ActiveSheet = sheet;
                    xls.PrintGridLines = btnGridLines.Checked;
                }
                xls.ActiveSheet = SaveActiveSheet;
            }
            else
            {
                xls.PrintGridLines = btnGridLines.Checked;
            }
            MainPreview.InvalidatePreview();

        }

        private void noneToolStripMenuItem_Click(object sender, EventArgs e)
        {
            MainPreview.AutofitPreview = TAutofitPreview.None;
            UpdateAutofitText();
        }

        private void fitToWidthToolStripMenuItem_Click(object sender, EventArgs e)
        {
            MainPreview.AutofitPreview = TAutofitPreview.Width;
            UpdateAutofitText();
        }

        private void fitToHeightToolStripMenuItem_Click(object sender, EventArgs e)
        {
            MainPreview.AutofitPreview = TAutofitPreview.Height;
            UpdateAutofitText();
        }

        private void fitToPageToolStripMenuItem_Click(object sender, EventArgs e)
        {
            MainPreview.AutofitPreview = TAutofitPreview.Full;
            UpdateAutofitText();
        }

        private void UpdateAutofitText()
        {
            switch (MainPreview.AutofitPreview)
            {
                case TAutofitPreview.None:
                    btnAutofit.Text = "No Autofit";
                    break;
                case TAutofitPreview.Width:
                    btnAutofit.Text = "Fit to Width";
                    break;
                case TAutofitPreview.Height:
                    btnAutofit.Text = "Fit to Height";
                    break;
                case TAutofitPreview.Full:
                    btnAutofit.Text = "Fit to Page";
                    break;
                default:
                    break;
            }

        }

    }

    #region PdfThread
    class PdfThread
    {
        private FlexCelPdfExport PdfExport;
        private string FileName;
        private bool AllVisibleSheets;
        private Exception FMainException;

        internal PdfThread(FlexCelPdfExport aPdfExport, string aFileName, bool aAllVisibleSheets)
        {
            PdfExport = aPdfExport;
            FileName = aFileName;
            AllVisibleSheets = aAllVisibleSheets;
        }

        internal void ExportToPdf()
        {
            try
            {
                if (AllVisibleSheets)
                {
                    try
                    {
                        using (FileStream f = new FileStream(FileName, FileMode.Create, FileAccess.Write))
                        {
                            PdfExport.BeginExport(f);
                            PdfExport.PageLayout = TPageLayout.Outlines;
                            PdfExport.ExportAllVisibleSheets(false, System.IO.Path.GetFileNameWithoutExtension(FileName));
                            PdfExport.EndExport();
                        }
                    }
                    catch
                    {
                        try
                        {
                            File.Delete(FileName);
                        }
                        catch
                        {
                            //Not here.
                        }
                        throw;
                    }
                }
                else
                {
                    PdfExport.PageLayout = TPageLayout.None;
                    PdfExport.Export(FileName);
                }
            }
            catch (Exception ex)
            {
                FMainException = ex;
            }
        }

        internal Exception MainException
        {
            get
            {
                return FMainException;
            }
        }
    }
    #endregion

}

Form1.Designer.cs

using System;
using System.Drawing;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using System.Drawing.Drawing2D;
using System.Diagnostics;
using System.Threading;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using FlexCel.Winforms;
using FlexCel.Render;
using FlexCel.Pdf;
namespace CustomPreview
{
    public partial class mainForm: System.Windows.Forms.Form
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.components = new System.ComponentModel.Container();
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(mainForm));
            this.flexCelImgExport1 = new FlexCel.Render.FlexCelImgExport();
            this.openFileDialog = new System.Windows.Forms.OpenFileDialog();
            this.panel1 = new System.Windows.Forms.Panel();
            this.MainPreview = new FlexCel.Winforms.FlexCelPreview();
            this.thumbs = new FlexCel.Winforms.FlexCelPreview();
            this.splitter1 = new System.Windows.Forms.Splitter();
            this.panelLeft = new System.Windows.Forms.Panel();
            this.cbAllSheets = new System.Windows.Forms.CheckBox();
            this.label2 = new System.Windows.Forms.Label();
            this.sheetSplitter = new System.Windows.Forms.Splitter();
            this.lbSheets = new System.Windows.Forms.ListBox();
            this.label1 = new System.Windows.Forms.Label();
            this.PdfSaveFileDialog = new System.Windows.Forms.SaveFileDialog();
            this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
            this.mainToolbar = new System.Windows.Forms.ToolStrip();
            this.openFile = new System.Windows.Forms.ToolStripButton();
            this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
            this.btnFirst = new System.Windows.Forms.ToolStripButton();
            this.btnPrev = new System.Windows.Forms.ToolStripButton();
            this.edPage = new System.Windows.Forms.ToolStripTextBox();
            this.btnNext = new System.Windows.Forms.ToolStripButton();
            this.btnLast = new System.Windows.Forms.ToolStripButton();
            this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
            this.btnAutofit = new System.Windows.Forms.ToolStripDropDownButton();
            this.noneToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
            this.fitToWidthToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
            this.fitToHeightToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
            this.fitToPageToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
            this.btnZoomOut = new System.Windows.Forms.ToolStripButton();
            this.edZoom = new System.Windows.Forms.ToolStripTextBox();
            this.btnZoomIn = new System.Windows.Forms.ToolStripButton();
            this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator();
            this.btnGridLines = new System.Windows.Forms.ToolStripButton();
            this.btnHeadings = new System.Windows.Forms.ToolStripButton();
            this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator();
            this.btnRecalc = new System.Windows.Forms.ToolStripButton();
            this.btnPdf = new System.Windows.Forms.ToolStripButton();
            this.btnClose = new System.Windows.Forms.ToolStripButton();
            this.panel1.SuspendLayout();
            this.panelLeft.SuspendLayout();
            this.mainToolbar.SuspendLayout();
            this.SuspendLayout();
            //
            // flexCelImgExport1
            //
            this.flexCelImgExport1.AllVisibleSheets = false;
            this.flexCelImgExport1.PageSize = null;
            this.flexCelImgExport1.ResetPageNumberOnEachSheet = false;
            this.flexCelImgExport1.Resolution = 96D;
            this.flexCelImgExport1.Workbook = null;
            //
            // openFileDialog
            //
            this.openFileDialog.DefaultExt = "xls";
            this.openFileDialog.Filter = "Excel Files|*.xls|All files|*.*";
            this.openFileDialog.Title = "Select a file to preview";
            //
            // panel1
            //
            this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.panel1.Controls.Add(this.MainPreview);
            this.panel1.Controls.Add(this.splitter1);
            this.panel1.Controls.Add(this.panelLeft);
            this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
            this.panel1.Location = new System.Drawing.Point(0, 46);
            this.panel1.Name = "panel1";
            this.panel1.Size = new System.Drawing.Size(808, 375);
            this.panel1.TabIndex = 8;
            //
            // MainPreview
            //
            this.MainPreview.AutoScrollMinSize = new System.Drawing.Size(40, 383);
            this.MainPreview.Dock = System.Windows.Forms.DockStyle.Fill;
            this.MainPreview.Document = this.flexCelImgExport1;
            this.MainPreview.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;
            this.MainPreview.Location = new System.Drawing.Point(144, 0);
            this.MainPreview.Name = "MainPreview";
            this.MainPreview.PageXSeparation = 20;
            this.MainPreview.Size = new System.Drawing.Size(662, 373);
            this.MainPreview.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;
            this.MainPreview.StartPage = 1;
            this.MainPreview.TabIndex = 2;
            this.MainPreview.ThumbnailLarge = null;
            this.MainPreview.ThumbnailSmall = this.thumbs;
            this.MainPreview.StartPageChanged += new System.EventHandler(this.flexCelPreview1_StartPageChanged);
            this.MainPreview.ZoomChanged += new System.EventHandler(this.flexCelPreview1_ZoomChanged);
            //
            // thumbs
            //
            this.thumbs.AutoScrollMinSize = new System.Drawing.Size(20, 10);
            this.thumbs.Dock = System.Windows.Forms.DockStyle.Fill;
            this.thumbs.Document = this.flexCelImgExport1;
            this.thumbs.Location = new System.Drawing.Point(0, 115);
            this.thumbs.Name = "thumbs";
            this.thumbs.Size = new System.Drawing.Size(136, 258);
            this.thumbs.StartPage = 1;
            this.thumbs.TabIndex = 3;
            this.thumbs.ThumbnailLarge = this.MainPreview;
            this.thumbs.ThumbnailSmall = null;
            this.thumbs.Zoom = 0.1D;
            //
            // splitter1
            //
            this.splitter1.BackColor = System.Drawing.SystemColors.ControlLightLight;
            this.splitter1.Location = new System.Drawing.Point(136, 0);
            this.splitter1.MinSize = 0;
            this.splitter1.Name = "splitter1";
            this.splitter1.Size = new System.Drawing.Size(8, 373);
            this.splitter1.TabIndex = 11;
            this.splitter1.TabStop = false;
            //
            // panelLeft
            //
            this.panelLeft.Controls.Add(this.cbAllSheets);
            this.panelLeft.Controls.Add(this.thumbs);
            this.panelLeft.Controls.Add(this.label2);
            this.panelLeft.Controls.Add(this.sheetSplitter);
            this.panelLeft.Controls.Add(this.lbSheets);
            this.panelLeft.Controls.Add(this.label1);
            this.panelLeft.Dock = System.Windows.Forms.DockStyle.Left;
            this.panelLeft.Location = new System.Drawing.Point(0, 0);
            this.panelLeft.Name = "panelLeft";
            this.panelLeft.Size = new System.Drawing.Size(136, 373);
            this.panelLeft.TabIndex = 9;
            //
            // cbAllSheets
            //
            this.cbAllSheets.Location = new System.Drawing.Point(16, 16);
            this.cbAllSheets.Name = "cbAllSheets";
            this.cbAllSheets.Size = new System.Drawing.Size(104, 16);
            this.cbAllSheets.TabIndex = 14;
            this.cbAllSheets.Text = "All Sheets";
            this.cbAllSheets.CheckedChanged += new System.EventHandler(this.cbAllSheets_CheckedChanged);
            //
            // label2
            //
            this.label2.Dock = System.Windows.Forms.DockStyle.Top;
            this.label2.Location = new System.Drawing.Point(0, 99);
            this.label2.Name = "label2";
            this.label2.Size = new System.Drawing.Size(136, 16);
            this.label2.TabIndex = 13;
            this.label2.Text = "Thumbs";
            //
            // sheetSplitter
            //
            this.sheetSplitter.BackColor = System.Drawing.SystemColors.ControlLightLight;
            this.sheetSplitter.Dock = System.Windows.Forms.DockStyle.Top;
            this.sheetSplitter.Location = new System.Drawing.Point(0, 91);
            this.sheetSplitter.Name = "sheetSplitter";
            this.sheetSplitter.Size = new System.Drawing.Size(136, 8);
            this.sheetSplitter.TabIndex = 11;
            this.sheetSplitter.TabStop = false;
            //
            // lbSheets
            //
            this.lbSheets.Dock = System.Windows.Forms.DockStyle.Top;
            this.lbSheets.Items.AddRange(new object[] {
            "No open file"});
            this.lbSheets.Location = new System.Drawing.Point(0, 35);
            this.lbSheets.Name = "lbSheets";
            this.lbSheets.Size = new System.Drawing.Size(136, 56);
            this.lbSheets.TabIndex = 10;
            this.lbSheets.SelectedIndexChanged += new System.EventHandler(this.lbSheets_SelectedIndexChanged);
            //
            // label1
            //
            this.label1.Dock = System.Windows.Forms.DockStyle.Top;
            this.label1.Location = new System.Drawing.Point(0, 0);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(136, 35);
            this.label1.TabIndex = 12;
            this.label1.Text = "Sheets";
            //
            // PdfSaveFileDialog
            //
            this.PdfSaveFileDialog.DefaultExt = "pdf";
            this.PdfSaveFileDialog.Filter = "Pdf Files|*.pdf";
            this.PdfSaveFileDialog.Title = "Select the file to export to:";
            //
            // mainToolbar
            //
            this.mainToolbar.ImageScalingSize = new System.Drawing.Size(24, 24);
            this.mainToolbar.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.openFile,
            this.toolStripSeparator2,
            this.btnFirst,
            this.btnPrev,
            this.edPage,
            this.btnNext,
            this.btnLast,
            this.toolStripSeparator1,
            this.btnAutofit,
            this.btnZoomOut,
            this.edZoom,
            this.btnZoomIn,
            this.toolStripSeparator3,
            this.btnGridLines,
            this.btnHeadings,
            this.toolStripSeparator4,
            this.btnRecalc,
            this.btnPdf,
            this.btnClose});
            this.mainToolbar.LayoutStyle = System.Windows.Forms.ToolStripLayoutStyle.HorizontalStackWithOverflow;
            this.mainToolbar.Location = new System.Drawing.Point(0, 0);
            this.mainToolbar.Name = "mainToolbar";
            this.mainToolbar.Size = new System.Drawing.Size(808, 46);
            this.mainToolbar.TabIndex = 14;
            //
            // openFile
            //
            this.openFile.Image = global::CustomPreview.Properties.Resources.open;
            this.openFile.ImageAlign = System.Drawing.ContentAlignment.TopCenter;
            this.openFile.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.openFile.Name = "openFile";
            this.openFile.Size = new System.Drawing.Size(61, 43);
            this.openFile.Text = "&Open File";
            this.openFile.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
            this.openFile.ToolTipText = "Open an Excel file";
            this.openFile.Click += new System.EventHandler(this.openFile_Click);
            //
            // toolStripSeparator2
            //
            this.toolStripSeparator2.AutoSize = false;
            this.toolStripSeparator2.Name = "toolStripSeparator2";
            this.toolStripSeparator2.Size = new System.Drawing.Size(20, 46);
            //
            // btnFirst
            //
            this.btnFirst.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
            this.btnFirst.Enabled = false;
            this.btnFirst.Image = ((System.Drawing.Image)(resources.GetObject("btnFirst.Image")));
            this.btnFirst.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.btnFirst.Name = "btnFirst";
            this.btnFirst.Size = new System.Drawing.Size(27, 43);
            this.btnFirst.Text = "<<";
            this.btnFirst.ToolTipText = "First page";
            this.btnFirst.Click += new System.EventHandler(this.btnFirst_Click);
            //
            // btnPrev
            //
            this.btnPrev.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
            this.btnPrev.Enabled = false;
            this.btnPrev.Image = ((System.Drawing.Image)(resources.GetObject("btnPrev.Image")));
            this.btnPrev.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.btnPrev.Name = "btnPrev";
            this.btnPrev.Size = new System.Drawing.Size(23, 43);
            this.btnPrev.Text = "<";
            this.btnPrev.ToolTipText = "Previous page";
            this.btnPrev.Click += new System.EventHandler(this.btnPrev_Click);
            //
            // edPage
            //
            this.edPage.AutoSize = false;
            this.edPage.Enabled = false;
            this.edPage.Name = "edPage";
            this.edPage.Size = new System.Drawing.Size(100, 18);
            this.edPage.TextBoxTextAlign = System.Windows.Forms.HorizontalAlignment.Right;
            this.edPage.Leave += new System.EventHandler(this.edPage_Leave);
            this.edPage.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.edPage_KeyPress);
            //
            // btnNext
            //
            this.btnNext.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
            this.btnNext.Enabled = false;
            this.btnNext.Image = ((System.Drawing.Image)(resources.GetObject("btnNext.Image")));
            this.btnNext.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.btnNext.Name = "btnNext";
            this.btnNext.Size = new System.Drawing.Size(23, 43);
            this.btnNext.Text = ">";
            this.btnNext.ToolTipText = "Next page";
            this.btnNext.Click += new System.EventHandler(this.btnNext_Click);
            //
            // btnLast
            //
            this.btnLast.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
            this.btnLast.Enabled = false;
            this.btnLast.Image = ((System.Drawing.Image)(resources.GetObject("btnLast.Image")));
            this.btnLast.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.btnLast.Name = "btnLast";
            this.btnLast.Size = new System.Drawing.Size(27, 43);
            this.btnLast.Text = ">>";
            this.btnLast.ToolTipText = "Last page";
            this.btnLast.Click += new System.EventHandler(this.btnLast_Click);
            //
            // toolStripSeparator1
            //
            this.toolStripSeparator1.Name = "toolStripSeparator1";
            this.toolStripSeparator1.Size = new System.Drawing.Size(6, 46);
            //
            // btnAutofit
            //
            this.btnAutofit.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.noneToolStripMenuItem,
            this.fitToWidthToolStripMenuItem,
            this.fitToHeightToolStripMenuItem,
            this.fitToPageToolStripMenuItem});
            this.btnAutofit.Image = global::CustomPreview.Properties.Resources.autofit;
            this.btnAutofit.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.btnAutofit.Name = "btnAutofit";
            this.btnAutofit.Size = new System.Drawing.Size(76, 43);
            this.btnAutofit.Text = "No Autofit";
            this.btnAutofit.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
            //
            // noneToolStripMenuItem
            //
            this.noneToolStripMenuItem.Name = "noneToolStripMenuItem";
            this.noneToolStripMenuItem.Size = new System.Drawing.Size(140, 22);
            this.noneToolStripMenuItem.Text = "No Autofit";
            this.noneToolStripMenuItem.Click += new System.EventHandler(this.noneToolStripMenuItem_Click);
            //
            // fitToWidthToolStripMenuItem
            //
            this.fitToWidthToolStripMenuItem.Name = "fitToWidthToolStripMenuItem";
            this.fitToWidthToolStripMenuItem.Size = new System.Drawing.Size(140, 22);
            this.fitToWidthToolStripMenuItem.Text = "Fit to Width";
            this.fitToWidthToolStripMenuItem.Click += new System.EventHandler(this.fitToWidthToolStripMenuItem_Click);
            //
            // fitToHeightToolStripMenuItem
            //
            this.fitToHeightToolStripMenuItem.Name = "fitToHeightToolStripMenuItem";
            this.fitToHeightToolStripMenuItem.Size = new System.Drawing.Size(140, 22);
            this.fitToHeightToolStripMenuItem.Text = "Fit to Height";
            this.fitToHeightToolStripMenuItem.Click += new System.EventHandler(this.fitToHeightToolStripMenuItem_Click);
            //
            // fitToPageToolStripMenuItem
            //
            this.fitToPageToolStripMenuItem.Name = "fitToPageToolStripMenuItem";
            this.fitToPageToolStripMenuItem.Size = new System.Drawing.Size(140, 22);
            this.fitToPageToolStripMenuItem.Text = "Fit to Page";
            this.fitToPageToolStripMenuItem.Click += new System.EventHandler(this.fitToPageToolStripMenuItem_Click);
            //
            // btnZoomOut
            //
            this.btnZoomOut.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
            this.btnZoomOut.Enabled = false;
            this.btnZoomOut.Image = ((System.Drawing.Image)(resources.GetObject("btnZoomOut.Image")));
            this.btnZoomOut.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.btnZoomOut.Name = "btnZoomOut";
            this.btnZoomOut.Size = new System.Drawing.Size(23, 43);
            this.btnZoomOut.Text = "-";
            this.btnZoomOut.ToolTipText = "Zoom out";
            this.btnZoomOut.Click += new System.EventHandler(this.btnZoomOut_Click);
            //
            // edZoom
            //
            this.edZoom.AutoSize = false;
            this.edZoom.Enabled = false;
            this.edZoom.Name = "edZoom";
            this.edZoom.Size = new System.Drawing.Size(40, 18);
            this.edZoom.TextBoxTextAlign = System.Windows.Forms.HorizontalAlignment.Right;
            this.edZoom.Enter += new System.EventHandler(this.edZoom_Enter);
            this.edZoom.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.edZoom_KeyPress);
            //
            // btnZoomIn
            //
            this.btnZoomIn.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
            this.btnZoomIn.Enabled = false;
            this.btnZoomIn.Image = ((System.Drawing.Image)(resources.GetObject("btnZoomIn.Image")));
            this.btnZoomIn.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.btnZoomIn.Name = "btnZoomIn";
            this.btnZoomIn.Size = new System.Drawing.Size(23, 43);
            this.btnZoomIn.Text = "+";
            this.btnZoomIn.ToolTipText = "Zoom in";
            this.btnZoomIn.Click += new System.EventHandler(this.btnZoomIn_Click);
            //
            // toolStripSeparator3
            //
            this.toolStripSeparator3.AutoSize = false;
            this.toolStripSeparator3.Name = "toolStripSeparator3";
            this.toolStripSeparator3.Size = new System.Drawing.Size(20, 46);
            //
            // btnGridLines
            //
            this.btnGridLines.CheckOnClick = true;
            this.btnGridLines.Enabled = false;
            this.btnGridLines.Image = global::CustomPreview.Properties.Resources.grid;
            this.btnGridLines.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.btnGridLines.Name = "btnGridLines";
            this.btnGridLines.Size = new System.Drawing.Size(57, 43);
            this.btnGridLines.Text = "&Gridlines";
            this.btnGridLines.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
            this.btnGridLines.ToolTipText = "Show gridlines";
            this.btnGridLines.Click += new System.EventHandler(this.btnGridLines_Click);
            //
            // btnHeadings
            //
            this.btnHeadings.CheckOnClick = true;
            this.btnHeadings.Enabled = false;
            this.btnHeadings.Image = global::CustomPreview.Properties.Resources.Head;
            this.btnHeadings.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.btnHeadings.Name = "btnHeadings";
            this.btnHeadings.Size = new System.Drawing.Size(61, 43);
            this.btnHeadings.Text = "&Headings";
            this.btnHeadings.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
            this.btnHeadings.ToolTipText = "Show the headings";
            this.btnHeadings.Click += new System.EventHandler(this.btnHeadings_Click);
            //
            // toolStripSeparator4
            //
            this.toolStripSeparator4.Name = "toolStripSeparator4";
            this.toolStripSeparator4.Size = new System.Drawing.Size(6, 46);
            //
            // btnRecalc
            //
            this.btnRecalc.Enabled = false;
            this.btnRecalc.Image = global::CustomPreview.Properties.Resources.calc;
            this.btnRecalc.ImageAlign = System.Drawing.ContentAlignment.TopCenter;
            this.btnRecalc.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.btnRecalc.Name = "btnRecalc";
            this.btnRecalc.Size = new System.Drawing.Size(45, 43);
            this.btnRecalc.Text = "&Recalc";
            this.btnRecalc.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
            this.btnRecalc.ToolTipText = "Recalculate the file";
            this.btnRecalc.Click += new System.EventHandler(this.btnRecalc_Click);
            //
            // btnPdf
            //
            this.btnPdf.Enabled = false;
            this.btnPdf.Image = global::CustomPreview.Properties.Resources.pdf;
            this.btnPdf.ImageAlign = System.Drawing.ContentAlignment.TopCenter;
            this.btnPdf.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.btnPdf.Name = "btnPdf";
            this.btnPdf.Size = new System.Drawing.Size(79, 43);
            this.btnPdf.Text = "Export to &Pdf";
            this.btnPdf.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
            this.btnPdf.ToolTipText = "Export the file to Pdf";
            this.btnPdf.Click += new System.EventHandler(this.btnPdf_Click);
            //
            // btnClose
            //
            this.btnClose.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right;
            this.btnClose.Image = global::CustomPreview.Properties.Resources.close;
            this.btnClose.ImageAlign = System.Drawing.ContentAlignment.TopCenter;
            this.btnClose.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.btnClose.Name = "btnClose";
            this.btnClose.Size = new System.Drawing.Size(59, 43);
            this.btnClose.Text = "     E&xit     ";
            this.btnClose.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
            this.btnClose.ToolTipText = "Exit from the application";
            this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
            //
            // mainForm
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(808, 421);
            this.Controls.Add(this.panel1);
            this.Controls.Add(this.mainToolbar);
            this.Name = "mainForm";
            this.Text = "Custom Preview Demo";
            this.Load += new System.EventHandler(this.mainForm_Load);
            this.panel1.ResumeLayout(false);
            this.panelLeft.ResumeLayout(false);
            this.mainToolbar.ResumeLayout(false);
            this.mainToolbar.PerformLayout();
            this.ResumeLayout(false);
            this.PerformLayout();

        }
        #endregion

        private System.Windows.Forms.OpenFileDialog openFileDialog;
        private System.Windows.Forms.Panel panel1;
        private System.Windows.Forms.Panel panelLeft;
        private System.Windows.Forms.ListBox lbSheets;
        private System.Windows.Forms.Splitter splitter1;
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.Label label2;
        private System.Windows.Forms.SaveFileDialog PdfSaveFileDialog;
        private System.Windows.Forms.CheckBox cbAllSheets;
        private System.Windows.Forms.Splitter sheetSplitter;
        private System.Windows.Forms.ToolTip toolTip1;
        private FlexCel.Render.FlexCelImgExport flexCelImgExport1;
        private FlexCel.Winforms.FlexCelPreview MainPreview;
        private FlexCel.Winforms.FlexCelPreview thumbs;
        private ToolStrip mainToolbar;
        private ToolStripButton openFile;
        private ToolStripSeparator toolStripSeparator1;
        private ToolStripButton btnRecalc;
        private ToolStripButton btnPdf;
        private ToolStripButton btnClose;
        private ToolStripSeparator toolStripSeparator2;
        private ToolStripButton btnFirst;
        private ToolStripButton btnPrev;
        private ToolStripTextBox edPage;
        private ToolStripButton btnNext;
        private ToolStripButton btnLast;
        private ToolStripButton btnZoomOut;
        private ToolStripTextBox edZoom;
        private ToolStripButton btnZoomIn;
        private ToolStripSeparator toolStripSeparator3;
        private ToolStripButton btnHeadings;
        private ToolStripButton btnGridLines;
        private ToolStripSeparator toolStripSeparator4;
        private ToolStripDropDownButton btnAutofit;
        private ToolStripMenuItem noneToolStripMenuItem;
        private ToolStripMenuItem fitToWidthToolStripMenuItem;
        private ToolStripMenuItem fitToHeightToolStripMenuItem;
        private ToolStripMenuItem fitToPageToolStripMenuItem;
    }
}

PasswordForm.cs

using System;
using System.Drawing;
using System.ComponentModel;
using System.Windows.Forms;

namespace CustomPreview
{
    /// <summary>
    /// Form for asking for a password when the file is password protected.
    /// </summary>
    public partial class PasswordForm: System.Windows.Forms.Form
    {

        public PasswordForm()
        {
            InitializeComponent();
        }

        public string Password
        {
            get
            {
                return PasswordEdit.Text;
            }
        }
    }
}

PasswordForm.Designer.cs

using System;
using System.Drawing;
using System.ComponentModel;
using System.Windows.Forms;
namespace CustomPreview
{
    public partial class PasswordForm: System.Windows.Forms.Form
    {
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.Button btnOk;
        private System.Windows.Forms.Label label3;
        private System.Windows.Forms.TextBox PasswordEdit;
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.Container components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.label1 = new System.Windows.Forms.Label();
            this.btnOk = new System.Windows.Forms.Button();
            this.label3 = new System.Windows.Forms.Label();
            this.PasswordEdit = new System.Windows.Forms.TextBox();
            this.SuspendLayout();
            //
            // label1
            //
            this.label1.Location = new System.Drawing.Point(24, 16);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(240, 23);
            this.label1.TabIndex = 0;
            this.label1.Text = "Please enter the password to open this file:";
            //
            // btnOk
            //
            this.btnOk.DialogResult = System.Windows.Forms.DialogResult.OK;
            this.btnOk.Location = new System.Drawing.Point(152, 112);
            this.btnOk.Name = "btnOk";
            this.btnOk.TabIndex = 1;
            this.btnOk.Text = "Ok";
            //
            // label3
            //
            this.label3.Location = new System.Drawing.Point(40, 64);
            this.label3.Name = "label3";
            this.label3.Size = new System.Drawing.Size(64, 23);
            this.label3.TabIndex = 5;
            this.label3.Text = "Password:";
            //
            // PasswordEdit
            //
            this.PasswordEdit.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
                | System.Windows.Forms.AnchorStyles.Right)));
            this.PasswordEdit.Location = new System.Drawing.Point(112, 64);
            this.PasswordEdit.Name = "PasswordEdit";
            this.PasswordEdit.PasswordChar = '*';
            this.PasswordEdit.Size = new System.Drawing.Size(200, 20);
            this.PasswordEdit.TabIndex = 0;
            this.PasswordEdit.Text = "";
            //
            // PasswordForm
            //
            this.AcceptButton = this.btnOk;
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(408, 154);
            this.Controls.Add(this.label3);
            this.Controls.Add(this.PasswordEdit);
            this.Controls.Add(this.btnOk);
            this.Controls.Add(this.label1);
            this.Name = "PasswordForm";
            this.ShowInTaskbar = false;
            this.Text = "File is password protected.";
            this.ResumeLayout(false);

        }
        #endregion
    }
}

PdfProgressDialog.cs

using System;
using System.Drawing;
using System.ComponentModel;
using System.Windows.Forms;

using System.Threading;

using FlexCel.Render;

namespace CustomPreview
{
    /// <summary>
    /// Shows progress as we are exporting to pdf.
    /// </summary>
    public partial class PdfProgressDialog: System.Windows.Forms.Form
    {
        private System.Timers.Timer timer1;

        public PdfProgressDialog()
        {
            InitializeComponent();
        }

        private DateTime StartTime;
        private Thread RunningThread;
        private FlexCelPdfExport PdfExport;

        private void timer1_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
        {
            UpdateStatus();
        }

        public void ShowProgress(Thread aRunningThread, FlexCelPdfExport aPdfExport)
        {
            RunningThread = aRunningThread;

            if (!RunningThread.IsAlive) { DialogResult = DialogResult.OK; return; }
            timer1.Enabled = true;
            StartTime = DateTime.Now;
            PdfExport = aPdfExport;
            ShowDialog();
        }

        private void UpdateStatus()
        {
            TimeSpan ts = DateTime.Now - StartTime;
            string hours;
            if (ts.Hours == 0) hours = ""; else hours = ts.Hours.ToString("00") + ":";
            statusBarPanelTime.Text = hours + ts.Minutes.ToString("00") + ":" + ts.Seconds.ToString("00");

            if (!RunningThread.IsAlive) DialogResult = DialogResult.OK;

            if (PdfExport.Progress.TotalPage > 0) labelPages.Text = String.Format("Generating Page {0} of {1}", PdfExport.Progress.Page, PdfExport.Progress.TotalPage);
        }

        private void PdfProgressDialog_Closed(object sender, System.EventArgs e)
        {
            timer1.Enabled = false;
        }

    }
}

PdfProgressDialog.Designer.cs

using System;
using System.Drawing;
using System.ComponentModel;
using System.Windows.Forms;
using System.Threading;
using FlexCel.Render;
namespace CustomPreview
{
    public partial class PdfProgressDialog: System.Windows.Forms.Form
    {
        private System.Windows.Forms.Button btnCancel;
        private System.Windows.Forms.StatusBar statusBar1;
        private System.Windows.Forms.StatusBarPanel statusBarPanel1;
        private System.Windows.Forms.StatusBarPanel statusBarPanelTime;
        private System.Windows.Forms.Label labelPages;
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.Container components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.btnCancel = new System.Windows.Forms.Button();
            this.statusBar1 = new System.Windows.Forms.StatusBar();
            this.statusBarPanel1 = new System.Windows.Forms.StatusBarPanel();
            this.statusBarPanelTime = new System.Windows.Forms.StatusBarPanel();
            this.labelPages = new System.Windows.Forms.Label();
            this.timer1 = new System.Timers.Timer();
            ((System.ComponentModel.ISupportInitialize)(this.statusBarPanel1)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.statusBarPanelTime)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.timer1)).BeginInit();
            this.SuspendLayout();
            //
            // btnCancel
            //
            this.btnCancel.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
            this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            this.btnCancel.Location = new System.Drawing.Point(184, 64);
            this.btnCancel.Name = "btnCancel";
            this.btnCancel.TabIndex = 0;
            this.btnCancel.Text = "Cancel";
            //
            // statusBar1
            //
            this.statusBar1.Location = new System.Drawing.Point(0, 100);
            this.statusBar1.Name = "statusBar1";
            this.statusBar1.Panels.AddRange(new System.Windows.Forms.StatusBarPanel[] {
                                                                                this.statusBarPanel1,
                                                                                this.statusBarPanelTime});
            this.statusBar1.ShowPanels = true;
            this.statusBar1.Size = new System.Drawing.Size(448, 22);
            this.statusBar1.TabIndex = 1;
            //
            // statusBarPanel1
            //
            this.statusBarPanel1.BorderStyle = System.Windows.Forms.StatusBarPanelBorderStyle.None;
            this.statusBarPanel1.Text = "Elapsed Time:";
            this.statusBarPanel1.Width = 80;
            //
            // statusBarPanelTime
            //
            this.statusBarPanelTime.BorderStyle = System.Windows.Forms.StatusBarPanelBorderStyle.None;
            this.statusBarPanelTime.Text = "0:00";
            //
            // labelPages
            //
            this.labelPages.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
                | System.Windows.Forms.AnchorStyles.Right)));
            this.labelPages.Location = new System.Drawing.Point(16, 16);
            this.labelPages.Name = "labelPages";
            this.labelPages.Size = new System.Drawing.Size(408, 16);
            this.labelPages.TabIndex = 2;
            //
            // timer1
            //
            this.timer1.Enabled = true;
            this.timer1.SynchronizingObject = this;
            this.timer1.Elapsed += new System.Timers.ElapsedEventHandler(this.timer1_Elapsed);
            //
            // PdfProgressDialog
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(448, 122);
            this.ControlBox = false;
            this.Controls.Add(this.labelPages);
            this.Controls.Add(this.statusBar1);
            this.Controls.Add(this.btnCancel);
            this.MaximizeBox = false;
            this.MinimizeBox = false;
            this.Name = "PdfProgressDialog";
            this.ShowInTaskbar = false;
            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
            this.Text = "Please wait...";
            this.Closed += new System.EventHandler(this.PdfProgressDialog_Closed);
            ((System.ComponentModel.ISupportInitialize)(this.statusBarPanel1)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.statusBarPanelTime)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.timer1)).EndInit();
            this.ResumeLayout(false);

        }
        #endregion
    }
}

Program.cs

using System;
using System.Windows.Forms;

namespace CustomPreview
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main(string[] Args)
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new mainForm(Args));
        }
    }
}


Exporting Excel files to PDF (C# / netframework) | FlexCel Studio for the .NET Framework documentation

Exporting Excel files to PDF (C# / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\csharp\VS2022\netframework\25.Printing and Exporting\30.ExportPdf and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​csharp/​VS2022/​netframework/​Modules/​25.​Printing and Exporting/​30.​ExportPdf

Overview

FlexCel can natively export an Excel file to PDF, without needing to have Excel or Adobe Pdf installed.

Concepts

  • FlexCel PDF output is not 100% identical to Excel output, and it can't be that way. But it is very similar, and this includes fonts, colors, margins, headers/footers/images, etc. It can print cells with multiple fonts, it can replace the macros on headers and footers (like "&CPage &P of &N"), export headers and hyperlinks, correctly export conditional formats and the list goes on.

  • Among the things that are not exported you can find:

    • ActiveX objects

    • 3D Charts (They will be rendered as 2d)

    • Not common AutoShapes (most used Autoshapes, as rectangles, rounded rectangles, ellipses, etc are exported)

Files

AssemblyInfo.cs

using System.Reflection;
using System.Runtime.CompilerServices;

//
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
//
[assembly: AssemblyTitle("")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("(c) 2002 - 2024 TMS Software")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

//
// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version
//      Build Number
//      Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:

[assembly: AssemblyVersion("7.21.0.0")]

//
// In order to sign your assembly you must specify a key to use. Refer to the
// Microsoft .NET Framework documentation for more information on assembly signing.
//
// Use the attributes below to control which key is used for signing.
//
// Notes:
//   (*) If no key is specified, the assembly is not signed.
//   (*) KeyName refers to a key that has been installed in the Crypto Service
//       Provider (CSP) on your machine. KeyFile refers to a file which contains
//       a key.
//   (*) If the KeyFile and the KeyName values are both specified, the
//       following processing occurs:
//       (1) If the KeyName can be found in the CSP, that key is used.
//       (2) If the KeyName does not exist and the KeyFile does exist, the key
//           in the KeyFile is installed into the CSP and used.
//   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
//       When specifying the KeyFile, the location of the KeyFile should be
//       relative to the project output directory which is
//       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
//       located in the project directory, you would specify the AssemblyKeyFile
//       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
//   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
//       documentation for more information on this.
//
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]
[assembly: AssemblyKeyName("")]

Form1.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using System.IO;
using System.Diagnostics;
using System.Reflection;
using System.Drawing.Drawing2D;
using FlexCel.Pdf;

//only needed if you want to go unmanaged.
using System.Runtime.InteropServices;

namespace ExportPdf
{
    /// <summary>
    /// Exporting xls files to pdf.
    /// </summary>
    public partial class mainForm: System.Windows.Forms.Form
    {
        private FlexCel.Render.FlexCelPdfExport flexCelPdfExport1;

        public mainForm()
        {
            InitializeComponent();
            cbFontMapping.SelectedIndex = 1;
            cbPdfType.SelectedIndex = 0;
            cbTagged.SelectedIndex = 0;
            cbVersion.SelectedIndex = 1;
            ResizeToolbar(mainToolbar);
        }

        private void ResizeToolbar(ToolStrip toolbar)
        {

            using (Graphics gr = CreateGraphics())
            {
                double xFactor = gr.DpiX / 96.0;
                double yFactor = gr.DpiY / 96.0;
                toolbar.ImageScalingSize = new Size((int)(24 * xFactor), (int)(24 * yFactor));
                toolbar.Width = 0; //force a recalc of the buttons.
            }
        }

        private void button2_Click(object sender, System.EventArgs e)
        {
            Close();
        }

        private void LoadSheetConfig()
        {
            ExcelFile Xls = flexCelPdfExport1.Workbook;

            chGridLines.Checked = Xls.PrintGridLines;
            chFormulaText.Checked = Xls.ShowFormulaText;

            chPrintLeft.Checked = (Xls.PrintOptions & TPrintOptions.LeftToRight) != 0;
            edHeader.Text = Xls.PageHeader;
            edFooter.Text = Xls.PageFooter;
            chFitIn.Checked = Xls.PrintToFit;
            edHPages.Text = Xls.PrintNumberOfHorizontalPages.ToString();
            edVPages.Text = Xls.PrintNumberOfVerticalPages.ToString();
            edVPages.ReadOnly = !chFitIn.Checked;
            edHPages.ReadOnly = !chFitIn.Checked;

            edZoom.ReadOnly = chFitIn.Checked;
            edZoom.Text = Xls.PrintScale.ToString();

            TXlsMargins m = Xls.GetPrintMargins();
            edl.Text = m.Left.ToString();
            edt.Text = m.Top.ToString();
            edr.Text = m.Right.ToString();
            edb.Text = m.Bottom.ToString();
            edf.Text = m.Footer.ToString();
            edh.Text = m.Header.ToString();

            chLandscape.Checked = Xls.PrintLandscape;

            edAuthor.Text = Convert.ToString(Xls.DocumentProperties.GetStandardProperty(TPropertyId.Author));
            edTitle.Text = Convert.ToString(Xls.DocumentProperties.GetStandardProperty(TPropertyId.Title));
            edSubject.Text = Convert.ToString(Xls.DocumentProperties.GetStandardProperty(TPropertyId.Subject));
        }

        private void openFile_Click(object sender, System.EventArgs e)
        {
            if (openFileDialog1.ShowDialog() != DialogResult.OK) return;
            flexCelPdfExport1.Workbook = new XlsFile();

            flexCelPdfExport1.Workbook.Open(openFileDialog1.FileName);

            edFileName.Text = openFileDialog1.FileName;

            ExcelFile Xls = flexCelPdfExport1.Workbook;

            cbSheet.Items.Clear();
            int ActSheet = Xls.ActiveSheet;
            for (int i = 1; i <= Xls.SheetCount; i++)
            {
                Xls.ActiveSheet = i;
                cbSheet.Items.Add(Xls.SheetName);
            }
            Xls.ActiveSheet = ActSheet;
            cbSheet.SelectedIndex = ActSheet - 1;

            LoadSheetConfig();
        }

        private bool HasFileOpen()
        {
            if (flexCelPdfExport1.Workbook == null)
            {
                MessageBox.Show("You need to open a file first.");
                return false;
            }
            return true;
        }

        private bool LoadPreferences()
        {
            //NOTE: THERE SHOULD BE *A LOT* MORE VALIDATION OF VALUES ON THIS METHOD. (For example, validate that margins are between bounds)
            // As this is a simple demo, they are not included.
            try
            {
                ExcelFile Xls = flexCelPdfExport1.Workbook;
                Xls.PrintGridLines = chGridLines.Checked;
                Xls.PageHeader = edHeader.Text;
                Xls.PageFooter = edFooter.Text;
                Xls.ShowFormulaText = chFormulaText.Checked;

                if (chFitIn.Checked)
                {
                    Xls.PrintToFit = true;
                    Xls.PrintNumberOfHorizontalPages = Convert.ToInt32(edHPages.Text);
                    Xls.PrintNumberOfVerticalPages = Convert.ToInt32(edVPages.Text);
                }
                else
                    Xls.PrintToFit = false;

                if (chPrintLeft.Checked) Xls.PrintOptions |= TPrintOptions.LeftToRight;
                else Xls.PrintOptions &= ~TPrintOptions.LeftToRight;

                try
                {
                    Xls.PrintScale = Convert.ToInt32(edZoom.Text);
                }
                catch
                {
                    MessageBox.Show("Invalid Zoom");
                    return false;
                }

                TXlsMargins m = new TXlsMargins();
                m.Left = Convert.ToDouble(edl.Text);
                m.Top = Convert.ToDouble(edt.Text);
                m.Right = Convert.ToDouble(edr.Text);
                m.Bottom = Convert.ToDouble(edb.Text);
                m.Footer = Convert.ToDouble(edf.Text);
                m.Header = Convert.ToDouble(edh.Text);
                Xls.SetPrintMargins(m);

                flexCelPdfExport1.PrintRangeLeft = Convert.ToInt32(edLeft.Text);
                flexCelPdfExport1.PrintRangeTop = Convert.ToInt32(edTop.Text);
                flexCelPdfExport1.PrintRangeRight = Convert.ToInt32(edRight.Text);
                flexCelPdfExport1.PrintRangeBottom = Convert.ToInt32(edBottom.Text);

                if (chEmbed.Checked)
                    flexCelPdfExport1.FontEmbed = TFontEmbed.Embed;
                else flexCelPdfExport1.FontEmbed = TFontEmbed.None;

                if (chSubset.Checked)
                    flexCelPdfExport1.FontSubset = TFontSubset.Subset;
                else flexCelPdfExport1.FontSubset = TFontSubset.DontSubset;

                flexCelPdfExport1.Kerning = cbKerning.Checked;

                switch (cbFontMapping.SelectedIndex)
                {
                    case 0: flexCelPdfExport1.FontMapping = TFontMapping.ReplaceAllFonts; break;
                    case 1: flexCelPdfExport1.FontMapping = TFontMapping.ReplaceStandardFonts; break;
                    case 2: flexCelPdfExport1.FontMapping = TFontMapping.DontReplaceFonts; break;
                }

                switch (cbPdfType.SelectedIndex)
                {
                    case 0:
                        flexCelPdfExport1.PdfType = TPdfType.Standard;
                        break;
                    case 1:
                        flexCelPdfExport1.PdfType = TPdfType.PDFA1;
                        break;
                    case 2:
                        flexCelPdfExport1.PdfType = TPdfType.PDFA2;
                        break;
                    case 3:
                        flexCelPdfExport1.PdfType = TPdfType.PDFA3;
                        break;
                }

                switch (cbTagged.SelectedIndex)
                {
                    case 0: flexCelPdfExport1.TagMode = TTagMode.Full; break;
                    case 1: flexCelPdfExport1.TagMode = TTagMode.None; break;
                }

                switch (cbVersion.SelectedIndex)
                {
                    case 0: flexCelPdfExport1.PdfVersion = TPdfVersion.v14; break;
                    case 1: flexCelPdfExport1.PdfVersion = TPdfVersion.v16; break;
                }

                flexCelPdfExport1.Properties.Author = edAuthor.Text;
                flexCelPdfExport1.Properties.Title = edTitle.Text;
                flexCelPdfExport1.Properties.Subject = edSubject.Text;
                flexCelPdfExport1.Properties.Language = edLang.Text;

                Xls.PrintLandscape = chLandscape.Checked;
            }
            catch (Exception e)
            {
                MessageBox.Show("Error: " + e.Message);
                return false;
            }
            return true;
        }

        private void chFitIn_CheckedChanged(object sender, System.EventArgs e)
        {
            edVPages.ReadOnly = !chFitIn.Checked;
            edHPages.ReadOnly = !chFitIn.Checked;
            edZoom.ReadOnly = chFitIn.Checked;
        }

        private void cbSheet_SelectedIndexChanged(object sender, System.EventArgs e)
        {
            flexCelPdfExport1.Workbook.ActiveSheet = cbSheet.SelectedIndex + 1;
            LoadSheetConfig();
        }

        private void export_Click(object sender, System.EventArgs e)
        {
            if (!HasFileOpen()) return;
            if (!LoadPreferences()) return;

            if (exportDialog.ShowDialog() != DialogResult.OK) return;

            using (FileStream Pdf = new FileStream(exportDialog.FileName, FileMode.Create))
            {
                int SaveSheet = flexCelPdfExport1.Workbook.ActiveSheet;
                try
                {
                    flexCelPdfExport1.BeginExport(Pdf);
                    if (chExportAll.Checked)
                    {
                        flexCelPdfExport1.PageLayout = TPageLayout.Outlines; //To how the bookmarks when opening the file.
                        flexCelPdfExport1.ExportAllVisibleSheets(cbResetPageNumber.Checked, Path.GetFileNameWithoutExtension(exportDialog.FileName));
                    }
                    else
                    {
                        flexCelPdfExport1.PageLayout = TPageLayout.None;
                        flexCelPdfExport1.ExportSheet();
                    }
                    flexCelPdfExport1.EndExport();
                }
                finally
                {
                    flexCelPdfExport1.Workbook.ActiveSheet = SaveSheet;
                }

                if (MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    Process.Start(exportDialog.FileName);
                }
            }
        }

        private void chExportAll_CheckedChanged(object sender, System.EventArgs e)
        {
            cbSheet.Enabled = !chExportAll.Checked;
            cbResetPageNumber.Enabled = chExportAll.Checked;
        }

        /// <summary>
        /// Add a "Confidential" watermark on each page.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void flexCelPdfExport1_AfterGeneratePage(object sender, FlexCel.Render.PageEventArgs e)
        {
            if (!cbConfidential.Checked) return;

            const string s = "Confidential";

            using (Brush ABrush = new SolidBrush(Color.FromArgb(30, 25, 25, 25))) //Red=Green=Blue is a shade of gray. Alpha=30 means it is transparent (255 is pure opaque, 0 is pure transparent).
            {
                using (TUIFont AFont = TUIFont.Create("Arial", 72))
                {
                    double x0 = e.File.PageSize.Width * 72.0 / 100.0 / 2.0;   //PageSize is in inches/100, our coordinate system is in Points, that is inches/72
                    double y0 = e.File.PageSize.Height * 72.0 / 100.0 / 2.0;
                    SizeF sf = e.File.MeasureString(s, AFont);
                    e.File.Rotate(x0, y0, 45);
                    e.File.DrawString(s, AFont, ABrush, x0 - sf.Width / 2.0, y0 + sf.Height / 2.0);  //the y coord means the bottom of the text, and as the y axis grows down, we have to add sf.height/2 instead of substracting it.
                }
            }
        }

        /// <summary>
        /// We show on this event how you can make an unmanaged call to the Win32 API to return font information and avoid
        /// scanning the "fonts" folder. Note that this is <b>UNMANAGED</b> code, and it is not really needed except for small performance concerns,
        /// so avoid using it if you don't really need it. Please read UsingFlexCelPdfExport for more information.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void flexCelPdfExport1_GetFontData(object sender, FlexCel.Pdf.GetFontDataEventArgs e)
        {
            //If the checkbox is not checked, just ignore this event.
            if (!cbUseGetFontData.Checked)
            {
                e.Applied = false;
                return;
            }

            //Actually make the WIN32 call.
            uint ttcf = 0x66637474; //return full true type collections.

            // Allocate a handle for the font
            IntPtr FontHandle = ((FlexCel.Draw.TGdipUIFont)e.InputFont).Handle.ToHfont();
            try
            {
                using (Graphics Gr = Graphics.FromHwnd(IntPtr.Zero))
                {
                    IntPtr GrHandle = Gr.GetHdc();
                    try
                    {
                        IntPtr ObjHandle = SelectObject(GrHandle, FontHandle);
                        try
                        {
                            //First find out the sizes
                            uint Size = GetFontData(GrHandle, ttcf, 0, null, 0);
                            if ((int)Size < 0) //error
                            {
                                ttcf = 0; //This might not be a true type collection, try again.
                                Size = GetFontData(GrHandle, ttcf, 0, null, 0);

                                if ((int)Size < 0) //nothing else to do, exit.
                                {
                                    e.Applied = false;
                                    return;
                                }
                            }

                            //Now get the font data.
                            e.FontData = new byte[(int)Size];
                            uint Result = GetFontData(GrHandle, ttcf, 0, e.FontData, Size);

                            if ((int)Result < 0)
                            {
                                e.Applied = false;
                                return;
                            }
                            e.Applied = true;
                        }
                        finally
                        {
                            DeleteObject(ObjHandle);
                        }
                    }
                    finally
                    {
                        Gr.ReleaseHdc(GrHandle);
                    }
                }
            }
            finally
            {
                DeleteObject(FontHandle);
            }
        }

        /// <summary>
        /// The Win32 call.
        /// </summary>
        /// <param name="hdc"></param>
        /// <param name="dwTable"></param>
        /// <param name="dwOffset"></param>
        /// <param name="lpvBuffer"></param>
        /// <param name="cbData"></param>
        /// <returns></returns>
        [DllImport("gdi32.dll")]
        static extern uint GetFontData(IntPtr hdc, uint dwTable, uint dwOffset,
            [In, Out] byte[] lpvBuffer, uint cbData);

        [DllImport("GDI32.dll")]
        static extern bool DeleteObject(IntPtr objectHandle);

        [DllImport("gdi32.dll")]
        static extern IntPtr SelectObject(IntPtr hdc, IntPtr hgdiobj);

    }
}

Form1.Designer.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using System.IO;
using System.Diagnostics;
using System.Reflection;
using System.Drawing.Drawing2D;
using FlexCel.Pdf;
using System.Runtime.InteropServices;
namespace ExportPdf
{
    public partial class mainForm: System.Windows.Forms.Form
    {
        private System.Windows.Forms.OpenFileDialog openFileDialog1;
        private System.Windows.Forms.Panel panel1;
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.TextBox edFileName;
        private System.Windows.Forms.Panel panel3;
        private System.Windows.Forms.Label label12;
        private System.Windows.Forms.Label label13;
        private System.Windows.Forms.Label label14;
        private System.Windows.Forms.TextBox edTop;
        private System.Windows.Forms.TextBox edLeft;
        private System.Windows.Forms.Label label15;
        private System.Windows.Forms.TextBox edRight;
        private System.Windows.Forms.Label label16;
        private System.Windows.Forms.TextBox edBottom;
        private System.Windows.Forms.Label label17;
        private System.Windows.Forms.ComboBox cbSheet;
        private System.Windows.Forms.Label label18;
        private System.Windows.Forms.CheckBox chExportAll;
        private System.Windows.Forms.SaveFileDialog exportDialog;
        private System.Windows.Forms.Panel panel4;
        private System.Windows.Forms.Label label19;
        private System.Windows.Forms.CheckBox chEmbed;
        private System.Windows.Forms.Label label20;
        private System.Windows.Forms.ComboBox cbFontMapping;
        private System.Windows.Forms.Panel panel5;
        private System.Windows.Forms.Label label4;
        private System.Windows.Forms.TextBox edZoom;
        private System.Windows.Forms.CheckBox chFitIn;
        private System.Windows.Forms.Label label6;
        private System.Windows.Forms.Label label5;
        private System.Windows.Forms.TextBox edVPages;
        private System.Windows.Forms.TextBox edHPages;
        private System.Windows.Forms.Label label21;
        private System.Windows.Forms.Panel panel6;
        private System.Windows.Forms.Label label11;
        private System.Windows.Forms.TextBox edf;
        private System.Windows.Forms.Label labelb;
        private System.Windows.Forms.TextBox edb;
        private System.Windows.Forms.Label label9;
        private System.Windows.Forms.TextBox edr;
        private System.Windows.Forms.Label label8;
        private System.Windows.Forms.TextBox edt;
        private System.Windows.Forms.Label label7;
        private System.Windows.Forms.TextBox edl;
        private System.Windows.Forms.Label label10;
        private System.Windows.Forms.TextBox edh;
        private System.Windows.Forms.Label label22;
        private System.Windows.Forms.Panel panel7;
        private System.Windows.Forms.Label label23;
        private System.Windows.Forms.TextBox edFooter;
        private System.Windows.Forms.Label label3;
        private System.Windows.Forms.TextBox edHeader;
        private System.Windows.Forms.Label label2;
        private System.Windows.Forms.Panel panel8;
        private System.Windows.Forms.CheckBox chPrintLeft;
        private System.Windows.Forms.CheckBox chFormulaText;
        private System.Windows.Forms.CheckBox chGridLines;
        private System.Windows.Forms.Label label24;
        private System.Windows.Forms.Panel panel9;
        private System.Windows.Forms.Label label25;
        private System.Windows.Forms.Label label26;
        private System.Windows.Forms.TextBox edAuthor;
        private System.Windows.Forms.Label label27;
        private System.Windows.Forms.Label label28;
        private System.Windows.Forms.TextBox edTitle;
        private System.Windows.Forms.TextBox edSubject;
        private System.Windows.Forms.CheckBox cbKerning;
        private System.Windows.Forms.CheckBox chLandscape;
        private System.Windows.Forms.CheckBox cbResetPageNumber;
        private System.Windows.Forms.CheckBox cbUseGetFontData;
        private System.Windows.Forms.CheckBox cbConfidential;
        private System.Windows.Forms.CheckBox chSubset;
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(mainForm));
            FlexCel.Pdf.TPdfProperties tPdfProperties1 = new FlexCel.Pdf.TPdfProperties();
            this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
            this.panel1 = new System.Windows.Forms.Panel();
            this.panel2 = new System.Windows.Forms.Panel();
            this.label32 = new System.Windows.Forms.Label();
            this.label31 = new System.Windows.Forms.Label();
            this.label30 = new System.Windows.Forms.Label();
            this.cbTagged = new System.Windows.Forms.ComboBox();
            this.cbVersion = new System.Windows.Forms.ComboBox();
            this.cbPdfType = new System.Windows.Forms.ComboBox();
            this.label34 = new System.Windows.Forms.Label();
            this.cbConfidential = new System.Windows.Forms.CheckBox();
            this.cbUseGetFontData = new System.Windows.Forms.CheckBox();
            this.cbResetPageNumber = new System.Windows.Forms.CheckBox();
            this.panel9 = new System.Windows.Forms.Panel();
            this.label29 = new System.Windows.Forms.Label();
            this.edLang = new System.Windows.Forms.TextBox();
            this.edSubject = new System.Windows.Forms.TextBox();
            this.label28 = new System.Windows.Forms.Label();
            this.edTitle = new System.Windows.Forms.TextBox();
            this.label27 = new System.Windows.Forms.Label();
            this.label26 = new System.Windows.Forms.Label();
            this.edAuthor = new System.Windows.Forms.TextBox();
            this.label25 = new System.Windows.Forms.Label();
            this.edFileName = new System.Windows.Forms.TextBox();
            this.panel8 = new System.Windows.Forms.Panel();
            this.chLandscape = new System.Windows.Forms.CheckBox();
            this.label24 = new System.Windows.Forms.Label();
            this.chPrintLeft = new System.Windows.Forms.CheckBox();
            this.chFormulaText = new System.Windows.Forms.CheckBox();
            this.chGridLines = new System.Windows.Forms.CheckBox();
            this.panel7 = new System.Windows.Forms.Panel();
            this.edFooter = new System.Windows.Forms.TextBox();
            this.label3 = new System.Windows.Forms.Label();
            this.edHeader = new System.Windows.Forms.TextBox();
            this.label2 = new System.Windows.Forms.Label();
            this.label23 = new System.Windows.Forms.Label();
            this.panel6 = new System.Windows.Forms.Panel();
            this.label22 = new System.Windows.Forms.Label();
            this.edf = new System.Windows.Forms.TextBox();
            this.edb = new System.Windows.Forms.TextBox();
            this.edr = new System.Windows.Forms.TextBox();
            this.edt = new System.Windows.Forms.TextBox();
            this.label7 = new System.Windows.Forms.Label();
            this.edl = new System.Windows.Forms.TextBox();
            this.edh = new System.Windows.Forms.TextBox();
            this.label9 = new System.Windows.Forms.Label();
            this.label10 = new System.Windows.Forms.Label();
            this.label8 = new System.Windows.Forms.Label();
            this.labelb = new System.Windows.Forms.Label();
            this.label11 = new System.Windows.Forms.Label();
            this.panel5 = new System.Windows.Forms.Panel();
            this.label21 = new System.Windows.Forms.Label();
            this.label4 = new System.Windows.Forms.Label();
            this.edZoom = new System.Windows.Forms.TextBox();
            this.chFitIn = new System.Windows.Forms.CheckBox();
            this.label6 = new System.Windows.Forms.Label();
            this.label5 = new System.Windows.Forms.Label();
            this.edVPages = new System.Windows.Forms.TextBox();
            this.edHPages = new System.Windows.Forms.TextBox();
            this.panel4 = new System.Windows.Forms.Panel();
            this.chSubset = new System.Windows.Forms.CheckBox();
            this.cbKerning = new System.Windows.Forms.CheckBox();
            this.label20 = new System.Windows.Forms.Label();
            this.cbFontMapping = new System.Windows.Forms.ComboBox();
            this.chEmbed = new System.Windows.Forms.CheckBox();
            this.label19 = new System.Windows.Forms.Label();
            this.label18 = new System.Windows.Forms.Label();
            this.cbSheet = new System.Windows.Forms.ComboBox();
            this.panel3 = new System.Windows.Forms.Panel();
            this.edBottom = new System.Windows.Forms.TextBox();
            this.label17 = new System.Windows.Forms.Label();
            this.edRight = new System.Windows.Forms.TextBox();
            this.label16 = new System.Windows.Forms.Label();
            this.edLeft = new System.Windows.Forms.TextBox();
            this.label15 = new System.Windows.Forms.Label();
            this.edTop = new System.Windows.Forms.TextBox();
            this.label14 = new System.Windows.Forms.Label();
            this.label13 = new System.Windows.Forms.Label();
            this.label12 = new System.Windows.Forms.Label();
            this.chExportAll = new System.Windows.Forms.CheckBox();
            this.label1 = new System.Windows.Forms.Label();
            this.exportDialog = new System.Windows.Forms.SaveFileDialog();
            this.mainToolbar = new System.Windows.Forms.ToolStrip();
            this.openFile = new System.Windows.Forms.ToolStripButton();
            this.export = new System.Windows.Forms.ToolStripButton();
            this.btnClose = new System.Windows.Forms.ToolStripButton();
            this.flexCelPdfExport1 = new FlexCel.Render.FlexCelPdfExport();
            this.panel1.SuspendLayout();
            this.panel2.SuspendLayout();
            this.panel9.SuspendLayout();
            this.panel8.SuspendLayout();
            this.panel7.SuspendLayout();
            this.panel6.SuspendLayout();
            this.panel5.SuspendLayout();
            this.panel4.SuspendLayout();
            this.panel3.SuspendLayout();
            this.mainToolbar.SuspendLayout();
            this.SuspendLayout();
            //
            // openFileDialog1
            //
            this.openFileDialog1.DefaultExt = "xls";
            this.openFileDialog1.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm|Excel 97/2003|*.xls|Excel 2007|*.xlsx;*.xlsm|All " +
    "files|*.*";
            this.openFileDialog1.Title = "Open an Excel File";
            //
            // panel1
            //
            this.panel1.BackColor = System.Drawing.Color.White;
            this.panel1.Controls.Add(this.panel2);
            this.panel1.Controls.Add(this.cbConfidential);
            this.panel1.Controls.Add(this.cbUseGetFontData);
            this.panel1.Controls.Add(this.cbResetPageNumber);
            this.panel1.Controls.Add(this.panel9);
            this.panel1.Controls.Add(this.edFileName);
            this.panel1.Controls.Add(this.panel8);
            this.panel1.Controls.Add(this.panel7);
            this.panel1.Controls.Add(this.panel6);
            this.panel1.Controls.Add(this.panel5);
            this.panel1.Controls.Add(this.panel4);
            this.panel1.Controls.Add(this.label18);
            this.panel1.Controls.Add(this.cbSheet);
            this.panel1.Controls.Add(this.panel3);
            this.panel1.Controls.Add(this.chExportAll);
            this.panel1.Controls.Add(this.label1);
            this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
            this.panel1.Location = new System.Drawing.Point(0, 38);
            this.panel1.Name = "panel1";
            this.panel1.Size = new System.Drawing.Size(768, 593);
            this.panel1.TabIndex = 3;
            //
            // panel2
            //
            this.panel2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
            | System.Windows.Forms.AnchorStyles.Right)));
            this.panel2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(255)))));
            this.panel2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.panel2.Controls.Add(this.label32);
            this.panel2.Controls.Add(this.label31);
            this.panel2.Controls.Add(this.label30);
            this.panel2.Controls.Add(this.cbTagged);
            this.panel2.Controls.Add(this.cbVersion);
            this.panel2.Controls.Add(this.cbPdfType);
            this.panel2.Controls.Add(this.label34);
            this.panel2.Location = new System.Drawing.Point(32, 146);
            this.panel2.Name = "panel2";
            this.panel2.Size = new System.Drawing.Size(688, 53);
            this.panel2.TabIndex = 42;
            //
            // label32
            //
            this.label32.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label32.Location = new System.Drawing.Point(8, 22);
            this.label32.Name = "label32";
            this.label32.Size = new System.Drawing.Size(41, 16);
            this.label32.TabIndex = 41;
            this.label32.Text = "Type:";
            //
            // label31
            //
            this.label31.AutoSize = true;
            this.label31.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label31.Location = new System.Drawing.Point(219, 22);
            this.label31.Name = "label31";
            this.label31.Size = new System.Drawing.Size(53, 14);
            this.label31.TabIndex = 40;
            this.label31.Text = "Version:";
            //
            // label30
            //
            this.label30.AutoSize = true;
            this.label30.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label30.Location = new System.Drawing.Point(467, 22);
            this.label30.Name = "label30";
            this.label30.Size = new System.Drawing.Size(50, 14);
            this.label30.TabIndex = 39;
            this.label30.Text = "Tagged:";
            //
            // cbTagged
            //
            this.cbTagged.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.cbTagged.Items.AddRange(new object[] {
            "Full",
            "None"});
            this.cbTagged.Location = new System.Drawing.Point(523, 19);
            this.cbTagged.Name = "cbTagged";
            this.cbTagged.Size = new System.Drawing.Size(149, 21);
            this.cbTagged.TabIndex = 36;
            //
            // cbVersion
            //
            this.cbVersion.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.cbVersion.Items.AddRange(new object[] {
            "1.4 (Acrobat 5)",
            "1.6 (Acrobat 7)"});
            this.cbVersion.Location = new System.Drawing.Point(278, 19);
            this.cbVersion.Name = "cbVersion";
            this.cbVersion.Size = new System.Drawing.Size(168, 21);
            this.cbVersion.TabIndex = 35;
            //
            // cbPdfType
            //
            this.cbPdfType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.cbPdfType.Items.AddRange(new object[] {
            "Standard",
            "PDF/A1",
            "PDF/A2",
            "PDF/A3"});
            this.cbPdfType.Location = new System.Drawing.Point(56, 19);
            this.cbPdfType.Name = "cbPdfType";
            this.cbPdfType.Size = new System.Drawing.Size(144, 21);
            this.cbPdfType.TabIndex = 34;
            //
            // label34
            //
            this.label34.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label34.Location = new System.Drawing.Point(8, 0);
            this.label34.Name = "label34";
            this.label34.Size = new System.Drawing.Size(192, 16);
            this.label34.TabIndex = 20;
            this.label34.Text = "Pdf options:";
            //
            // cbConfidential
            //
            this.cbConfidential.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.cbConfidential.Location = new System.Drawing.Point(488, 557);
            this.cbConfidential.Name = "cbConfidential";
            this.cbConfidential.Size = new System.Drawing.Size(232, 16);
            this.cbConfidential.TabIndex = 41;
            this.cbConfidential.Text = "Print \"Confidential\" on each page";
            //
            // cbUseGetFontData
            //
            this.cbUseGetFontData.Location = new System.Drawing.Point(32, 557);
            this.cbUseGetFontData.Name = "cbUseGetFontData";
            this.cbUseGetFontData.Size = new System.Drawing.Size(312, 16);
            this.cbUseGetFontData.TabIndex = 40;
            this.cbUseGetFontData.Text = "Use UNMANAGED calls to Win32 API to find the fonts.";
            //
            // cbResetPageNumber
            //
            this.cbResetPageNumber.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.cbResetPageNumber.Location = new System.Drawing.Point(528, 40);
            this.cbResetPageNumber.Name = "cbResetPageNumber";
            this.cbResetPageNumber.Size = new System.Drawing.Size(200, 16);
            this.cbResetPageNumber.TabIndex = 39;
            this.cbResetPageNumber.Text = "Reset Page number on each sheet";
            //
            // panel9
            //
            this.panel9.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
            | System.Windows.Forms.AnchorStyles.Right)));
            this.panel9.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(192)))), ((int)(((byte)(255)))));
            this.panel9.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.panel9.Controls.Add(this.label29);
            this.panel9.Controls.Add(this.edLang);
            this.panel9.Controls.Add(this.edSubject);
            this.panel9.Controls.Add(this.label28);
            this.panel9.Controls.Add(this.edTitle);
            this.panel9.Controls.Add(this.label27);
            this.panel9.Controls.Add(this.label26);
            this.panel9.Controls.Add(this.edAuthor);
            this.panel9.Controls.Add(this.label25);
            this.panel9.Location = new System.Drawing.Point(32, 64);
            this.panel9.Name = "panel9";
            this.panel9.Size = new System.Drawing.Size(688, 76);
            this.panel9.TabIndex = 38;
            //
            // label29
            //
            this.label29.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label29.Location = new System.Drawing.Point(8, 49);
            this.label29.Name = "label29";
            this.label29.Size = new System.Drawing.Size(48, 16);
            this.label29.TabIndex = 38;
            this.label29.Text = "Lang:";
            //
            // edLang
            //
            this.edLang.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.edLang.Location = new System.Drawing.Point(56, 46);
            this.edLang.Name = "edLang";
            this.edLang.Size = new System.Drawing.Size(144, 20);
            this.edLang.TabIndex = 37;
            this.edLang.Text = "en-US";
            //
            // edSubject
            //
            this.edSubject.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
            | System.Windows.Forms.AnchorStyles.Right)));
            this.edSubject.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.edSubject.Location = new System.Drawing.Point(278, 45);
            this.edSubject.Name = "edSubject";
            this.edSubject.Size = new System.Drawing.Size(394, 20);
            this.edSubject.TabIndex = 35;
            //
            // label28
            //
            this.label28.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label28.Location = new System.Drawing.Point(216, 50);
            this.label28.Name = "label28";
            this.label28.Size = new System.Drawing.Size(56, 16);
            this.label28.TabIndex = 36;
            this.label28.Text = "Subject:";
            //
            // edTitle
            //
            this.edTitle.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
            | System.Windows.Forms.AnchorStyles.Right)));
            this.edTitle.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.edTitle.Location = new System.Drawing.Point(278, 19);
            this.edTitle.Name = "edTitle";
            this.edTitle.Size = new System.Drawing.Size(394, 20);
            this.edTitle.TabIndex = 33;
            //
            // label27
            //
            this.label27.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label27.Location = new System.Drawing.Point(232, 22);
            this.label27.Name = "label27";
            this.label27.Size = new System.Drawing.Size(48, 16);
            this.label27.TabIndex = 34;
            this.label27.Text = "Title:";
            //
            // label26
            //
            this.label26.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label26.Location = new System.Drawing.Point(8, 23);
            this.label26.Name = "label26";
            this.label26.Size = new System.Drawing.Size(48, 16);
            this.label26.TabIndex = 32;
            this.label26.Text = "Author:";
            //
            // edAuthor
            //
            this.edAuthor.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.edAuthor.Location = new System.Drawing.Point(56, 20);
            this.edAuthor.Name = "edAuthor";
            this.edAuthor.Size = new System.Drawing.Size(144, 20);
            this.edAuthor.TabIndex = 31;
            //
            // label25
            //
            this.label25.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label25.Location = new System.Drawing.Point(8, 0);
            this.label25.Name = "label25";
            this.label25.Size = new System.Drawing.Size(192, 16);
            this.label25.TabIndex = 20;
            this.label25.Text = "Pdf Properties:";
            //
            // edFileName
            //
            this.edFileName.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
            | System.Windows.Forms.AnchorStyles.Right)));
            this.edFileName.BackColor = System.Drawing.Color.White;
            this.edFileName.BorderStyle = System.Windows.Forms.BorderStyle.None;
            this.edFileName.Location = new System.Drawing.Point(136, 16);
            this.edFileName.Name = "edFileName";
            this.edFileName.ReadOnly = true;
            this.edFileName.Size = new System.Drawing.Size(584, 13);
            this.edFileName.TabIndex = 4;
            this.edFileName.Text = "No file selected";
            //
            // panel8
            //
            this.panel8.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
            this.panel8.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.panel8.Controls.Add(this.chLandscape);
            this.panel8.Controls.Add(this.label24);
            this.panel8.Controls.Add(this.chPrintLeft);
            this.panel8.Controls.Add(this.chFormulaText);
            this.panel8.Controls.Add(this.chGridLines);
            this.panel8.Location = new System.Drawing.Point(32, 205);
            this.panel8.Name = "panel8";
            this.panel8.Size = new System.Drawing.Size(176, 120);
            this.panel8.TabIndex = 37;
            //
            // chLandscape
            //
            this.chLandscape.Location = new System.Drawing.Point(24, 88);
            this.chLandscape.Name = "chLandscape";
            this.chLandscape.Size = new System.Drawing.Size(136, 24);
            this.chLandscape.TabIndex = 20;
            this.chLandscape.Text = "Landscape";
            //
            // label24
            //
            this.label24.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label24.Location = new System.Drawing.Point(8, 8);
            this.label24.Name = "label24";
            this.label24.Size = new System.Drawing.Size(192, 16);
            this.label24.TabIndex = 19;
            this.label24.Text = "Export Options:";
            //
            // chPrintLeft
            //
            this.chPrintLeft.Location = new System.Drawing.Point(24, 47);
            this.chPrintLeft.Name = "chPrintLeft";
            this.chPrintLeft.Size = new System.Drawing.Size(152, 16);
            this.chPrintLeft.TabIndex = 18;
            this.chPrintLeft.Text = "Print Left, then down.";
            //
            // chFormulaText
            //
            this.chFormulaText.Location = new System.Drawing.Point(24, 71);
            this.chFormulaText.Name = "chFormulaText";
            this.chFormulaText.Size = new System.Drawing.Size(136, 16);
            this.chFormulaText.TabIndex = 17;
            this.chFormulaText.Text = "Print Formula Text";
            //
            // chGridLines
            //
            this.chGridLines.Location = new System.Drawing.Point(24, 24);
            this.chGridLines.Name = "chGridLines";
            this.chGridLines.Size = new System.Drawing.Size(128, 16);
            this.chGridLines.TabIndex = 16;
            this.chGridLines.Text = "Print Grid Lines";
            //
            // panel7
            //
            this.panel7.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
            | System.Windows.Forms.AnchorStyles.Right)));
            this.panel7.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.panel7.Controls.Add(this.edFooter);
            this.panel7.Controls.Add(this.label3);
            this.panel7.Controls.Add(this.edHeader);
            this.panel7.Controls.Add(this.label2);
            this.panel7.Controls.Add(this.label23);
            this.panel7.Location = new System.Drawing.Point(224, 333);
            this.panel7.Name = "panel7";
            this.panel7.Size = new System.Drawing.Size(296, 112);
            this.panel7.TabIndex = 36;
            //
            // edFooter
            //
            this.edFooter.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
            | System.Windows.Forms.AnchorStyles.Right)));
            this.edFooter.BackColor = System.Drawing.Color.White;
            this.edFooter.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.edFooter.Location = new System.Drawing.Point(8, 88);
            this.edFooter.Name = "edFooter";
            this.edFooter.Size = new System.Drawing.Size(278, 20);
            this.edFooter.TabIndex = 46;
            //
            // label3
            //
            this.label3.BackColor = System.Drawing.Color.White;
            this.label3.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label3.Location = new System.Drawing.Point(8, 72);
            this.label3.Name = "label3";
            this.label3.Size = new System.Drawing.Size(56, 16);
            this.label3.TabIndex = 45;
            this.label3.Text = "Footer:";
            //
            // edHeader
            //
            this.edHeader.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
            | System.Windows.Forms.AnchorStyles.Right)));
            this.edHeader.BackColor = System.Drawing.Color.White;
            this.edHeader.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.edHeader.Location = new System.Drawing.Point(8, 48);
            this.edHeader.Name = "edHeader";
            this.edHeader.Size = new System.Drawing.Size(278, 20);
            this.edHeader.TabIndex = 44;
            //
            // label2
            //
            this.label2.BackColor = System.Drawing.Color.White;
            this.label2.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label2.Location = new System.Drawing.Point(8, 32);
            this.label2.Name = "label2";
            this.label2.Size = new System.Drawing.Size(56, 16);
            this.label2.TabIndex = 43;
            this.label2.Text = "Header:";
            //
            // label23
            //
            this.label23.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label23.Location = new System.Drawing.Point(8, 8);
            this.label23.Name = "label23";
            this.label23.Size = new System.Drawing.Size(187, 16);
            this.label23.TabIndex = 42;
            this.label23.Text = "Headers and footers:";
            //
            // panel6
            //
            this.panel6.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(224)))), ((int)(((byte)(192)))));
            this.panel6.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.panel6.Controls.Add(this.label22);
            this.panel6.Controls.Add(this.edf);
            this.panel6.Controls.Add(this.edb);
            this.panel6.Controls.Add(this.edr);
            this.panel6.Controls.Add(this.edt);
            this.panel6.Controls.Add(this.label7);
            this.panel6.Controls.Add(this.edl);
            this.panel6.Controls.Add(this.edh);
            this.panel6.Controls.Add(this.label9);
            this.panel6.Controls.Add(this.label10);
            this.panel6.Controls.Add(this.label8);
            this.panel6.Controls.Add(this.labelb);
            this.panel6.Controls.Add(this.label11);
            this.panel6.Location = new System.Drawing.Point(32, 333);
            this.panel6.Name = "panel6";
            this.panel6.Size = new System.Drawing.Size(176, 208);
            this.panel6.TabIndex = 35;
            //
            // label22
            //
            this.label22.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label22.Location = new System.Drawing.Point(8, 8);
            this.label22.Name = "label22";
            this.label22.Size = new System.Drawing.Size(120, 16);
            this.label22.TabIndex = 41;
            this.label22.Text = "Margins:";
            //
            // edf
            //
            this.edf.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.edf.Location = new System.Drawing.Point(56, 152);
            this.edf.Name = "edf";
            this.edf.Size = new System.Drawing.Size(112, 20);
            this.edf.TabIndex = 39;
            //
            // edb
            //
            this.edb.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.edb.Location = new System.Drawing.Point(56, 128);
            this.edb.Name = "edb";
            this.edb.Size = new System.Drawing.Size(112, 20);
            this.edb.TabIndex = 37;
            //
            // edr
            //
            this.edr.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.edr.Location = new System.Drawing.Point(56, 56);
            this.edr.Name = "edr";
            this.edr.Size = new System.Drawing.Size(112, 20);
            this.edr.TabIndex = 35;
            //
            // edt
            //
            this.edt.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.edt.Location = new System.Drawing.Point(56, 104);
            this.edt.Name = "edt";
            this.edt.Size = new System.Drawing.Size(112, 20);
            this.edt.TabIndex = 31;
            //
            // label7
            //
            this.label7.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label7.Location = new System.Drawing.Point(8, 32);
            this.label7.Name = "label7";
            this.label7.Size = new System.Drawing.Size(36, 16);
            this.label7.TabIndex = 30;
            this.label7.Text = "Left:";
            //
            // edl
            //
            this.edl.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.edl.Location = new System.Drawing.Point(56, 32);
            this.edl.Name = "edl";
            this.edl.Size = new System.Drawing.Size(112, 20);
            this.edl.TabIndex = 29;
            //
            // edh
            //
            this.edh.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.edh.Location = new System.Drawing.Point(56, 80);
            this.edh.Name = "edh";
            this.edh.Size = new System.Drawing.Size(112, 20);
            this.edh.TabIndex = 32;
            //
            // label9
            //
            this.label9.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label9.Location = new System.Drawing.Point(8, 56);
            this.label9.Name = "label9";
            this.label9.Size = new System.Drawing.Size(80, 16);
            this.label9.TabIndex = 36;
            this.label9.Text = "Right:";
            //
            // label10
            //
            this.label10.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label10.Location = new System.Drawing.Point(7, 80);
            this.label10.Name = "label10";
            this.label10.Size = new System.Drawing.Size(88, 16);
            this.label10.TabIndex = 34;
            this.label10.Text = "Header:";
            //
            // label8
            //
            this.label8.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label8.Location = new System.Drawing.Point(8, 104);
            this.label8.Name = "label8";
            this.label8.Size = new System.Drawing.Size(80, 16);
            this.label8.TabIndex = 33;
            this.label8.Text = "Top:";
            //
            // labelb
            //
            this.labelb.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.labelb.Location = new System.Drawing.Point(8, 130);
            this.labelb.Name = "labelb";
            this.labelb.Size = new System.Drawing.Size(88, 16);
            this.labelb.TabIndex = 38;
            this.labelb.Text = "Bottom:";
            //
            // label11
            //
            this.label11.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label11.Location = new System.Drawing.Point(8, 160);
            this.label11.Name = "label11";
            this.label11.Size = new System.Drawing.Size(80, 16);
            this.label11.TabIndex = 40;
            this.label11.Text = "Footer:";
            //
            // panel5
            //
            this.panel5.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
            | System.Windows.Forms.AnchorStyles.Right)));
            this.panel5.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
            this.panel5.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.panel5.Controls.Add(this.label21);
            this.panel5.Controls.Add(this.label4);
            this.panel5.Controls.Add(this.edZoom);
            this.panel5.Controls.Add(this.chFitIn);
            this.panel5.Controls.Add(this.label6);
            this.panel5.Controls.Add(this.label5);
            this.panel5.Controls.Add(this.edVPages);
            this.panel5.Controls.Add(this.edHPages);
            this.panel5.Location = new System.Drawing.Point(224, 453);
            this.panel5.Name = "panel5";
            this.panel5.Size = new System.Drawing.Size(296, 88);
            this.panel5.TabIndex = 34;
            //
            // label21
            //
            this.label21.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label21.Location = new System.Drawing.Point(9, 5);
            this.label21.Name = "label21";
            this.label21.Size = new System.Drawing.Size(192, 16);
            this.label21.TabIndex = 26;
            this.label21.Text = "Zoom:";
            //
            // label4
            //
            this.label4.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label4.Location = new System.Drawing.Point(72, 58);
            this.label4.Name = "label4";
            this.label4.Size = new System.Drawing.Size(56, 16);
            this.label4.TabIndex = 25;
            this.label4.Text = "Zoom (%)";
            //
            // edZoom
            //
            this.edZoom.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.edZoom.Location = new System.Drawing.Point(136, 56);
            this.edZoom.Name = "edZoom";
            this.edZoom.Size = new System.Drawing.Size(24, 20);
            this.edZoom.TabIndex = 24;
            //
            // chFitIn
            //
            this.chFitIn.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.chFitIn.Location = new System.Drawing.Point(8, 24);
            this.chFitIn.Name = "chFitIn";
            this.chFitIn.Size = new System.Drawing.Size(56, 24);
            this.chFitIn.TabIndex = 23;
            this.chFitIn.Text = "Fit in";
            this.chFitIn.CheckedChanged += new System.EventHandler(this.chFitIn_CheckedChanged);
            //
            // label6
            //
            this.label6.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label6.Location = new System.Drawing.Point(208, 29);
            this.label6.Name = "label6";
            this.label6.Size = new System.Drawing.Size(80, 16);
            this.label6.TabIndex = 22;
            this.label6.Text = "pages tall.";
            //
            // label5
            //
            this.label5.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label5.Location = new System.Drawing.Point(96, 29);
            this.label5.Name = "label5";
            this.label5.Size = new System.Drawing.Size(80, 16);
            this.label5.TabIndex = 21;
            this.label5.Text = "pages wide x";
            //
            // edVPages
            //
            this.edVPages.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.edVPages.Location = new System.Drawing.Point(176, 24);
            this.edVPages.Name = "edVPages";
            this.edVPages.ReadOnly = true;
            this.edVPages.Size = new System.Drawing.Size(24, 20);
            this.edVPages.TabIndex = 20;
            //
            // edHPages
            //
            this.edHPages.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.edHPages.Location = new System.Drawing.Point(64, 24);
            this.edHPages.Name = "edHPages";
            this.edHPages.ReadOnly = true;
            this.edHPages.Size = new System.Drawing.Size(24, 20);
            this.edHPages.TabIndex = 19;
            //
            // panel4
            //
            this.panel4.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
            | System.Windows.Forms.AnchorStyles.Right)));
            this.panel4.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
            this.panel4.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.panel4.Controls.Add(this.chSubset);
            this.panel4.Controls.Add(this.cbKerning);
            this.panel4.Controls.Add(this.label20);
            this.panel4.Controls.Add(this.cbFontMapping);
            this.panel4.Controls.Add(this.chEmbed);
            this.panel4.Controls.Add(this.label19);
            this.panel4.Location = new System.Drawing.Point(224, 205);
            this.panel4.Name = "panel4";
            this.panel4.Size = new System.Drawing.Size(496, 120);
            this.panel4.TabIndex = 33;
            //
            // chSubset
            //
            this.chSubset.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
            | System.Windows.Forms.AnchorStyles.Right)));
            this.chSubset.Checked = true;
            this.chSubset.CheckState = System.Windows.Forms.CheckState.Checked;
            this.chSubset.Location = new System.Drawing.Point(16, 72);
            this.chSubset.Name = "chSubset";
            this.chSubset.Size = new System.Drawing.Size(464, 16);
            this.chSubset.TabIndex = 36;
            this.chSubset.Text = "Subset fonts when embedding. (That is, embed only the characters used from the fo" +
    "nt)";
            //
            // cbKerning
            //
            this.cbKerning.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
            | System.Windows.Forms.AnchorStyles.Right)));
            this.cbKerning.Location = new System.Drawing.Point(16, 88);
            this.cbKerning.Name = "cbKerning";
            this.cbKerning.Size = new System.Drawing.Size(464, 32);
            this.cbKerning.TabIndex = 35;
            this.cbKerning.Text = "Kerning. (Files with kerning look a little better but are a little bigger too)";
            //
            // label20
            //
            this.label20.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label20.Location = new System.Drawing.Point(16, 24);
            this.label20.Name = "label20";
            this.label20.Size = new System.Drawing.Size(96, 16);
            this.label20.TabIndex = 34;
            this.label20.Text = "Font mapping:";
            //
            // cbFontMapping
            //
            this.cbFontMapping.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
            | System.Windows.Forms.AnchorStyles.Right)));
            this.cbFontMapping.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.cbFontMapping.Items.AddRange(new object[] {
            "Replace all fonts by internal fonts. (smaller file size)",
            "Replace selected fonts by internal fonts. (optimum relation file size/accuracy)",
            "Do not replace any font. (maximum file size)"});
            this.cbFontMapping.Location = new System.Drawing.Point(120, 24);
            this.cbFontMapping.Name = "cbFontMapping";
            this.cbFontMapping.Size = new System.Drawing.Size(360, 21);
            this.cbFontMapping.TabIndex = 33;
            //
            // chEmbed
            //
            this.chEmbed.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
            | System.Windows.Forms.AnchorStyles.Right)));
            this.chEmbed.Checked = true;
            this.chEmbed.CheckState = System.Windows.Forms.CheckState.Checked;
            this.chEmbed.Location = new System.Drawing.Point(16, 40);
            this.chEmbed.Name = "chEmbed";
            this.chEmbed.Size = new System.Drawing.Size(464, 32);
            this.chEmbed.TabIndex = 3;
            this.chEmbed.Text = "Embed all fonts. (if you leave this option off, some fonts might be embedded anyw" +
    "ay)";
            //
            // label19
            //
            this.label19.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label19.Location = new System.Drawing.Point(3, 8);
            this.label19.Name = "label19";
            this.label19.Size = new System.Drawing.Size(192, 16);
            this.label19.TabIndex = 2;
            this.label19.Text = "Fonts:";
            //
            // label18
            //
            this.label18.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label18.Location = new System.Drawing.Point(168, 40);
            this.label18.Name = "label18";
            this.label18.Size = new System.Drawing.Size(96, 16);
            this.label18.TabIndex = 32;
            this.label18.Text = "Sheet to export:";
            //
            // cbSheet
            //
            this.cbSheet.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
            | System.Windows.Forms.AnchorStyles.Right)));
            this.cbSheet.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.cbSheet.Location = new System.Drawing.Point(264, 34);
            this.cbSheet.Name = "cbSheet";
            this.cbSheet.Size = new System.Drawing.Size(256, 21);
            this.cbSheet.TabIndex = 31;
            this.cbSheet.SelectedIndexChanged += new System.EventHandler(this.cbSheet_SelectedIndexChanged);
            //
            // panel3
            //
            this.panel3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.panel3.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
            this.panel3.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.panel3.Controls.Add(this.edBottom);
            this.panel3.Controls.Add(this.label17);
            this.panel3.Controls.Add(this.edRight);
            this.panel3.Controls.Add(this.label16);
            this.panel3.Controls.Add(this.edLeft);
            this.panel3.Controls.Add(this.label15);
            this.panel3.Controls.Add(this.edTop);
            this.panel3.Controls.Add(this.label14);
            this.panel3.Controls.Add(this.label13);
            this.panel3.Controls.Add(this.label12);
            this.panel3.Location = new System.Drawing.Point(536, 333);
            this.panel3.Name = "panel3";
            this.panel3.Size = new System.Drawing.Size(184, 208);
            this.panel3.TabIndex = 30;
            //
            // edBottom
            //
            this.edBottom.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.edBottom.Location = new System.Drawing.Point(80, 136);
            this.edBottom.Name = "edBottom";
            this.edBottom.Size = new System.Drawing.Size(48, 20);
            this.edBottom.TabIndex = 26;
            this.edBottom.Text = "0";
            //
            // label17
            //
            this.label17.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label17.Location = new System.Drawing.Point(16, 160);
            this.label17.Name = "label17";
            this.label17.Size = new System.Drawing.Size(56, 16);
            this.label17.TabIndex = 25;
            this.label17.Text = "Last Col:";
            //
            // edRight
            //
            this.edRight.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.edRight.Location = new System.Drawing.Point(80, 160);
            this.edRight.Name = "edRight";
            this.edRight.Size = new System.Drawing.Size(48, 20);
            this.edRight.TabIndex = 24;
            this.edRight.Text = "0";
            //
            // label16
            //
            this.label16.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label16.Location = new System.Drawing.Point(16, 136);
            this.label16.Name = "label16";
            this.label16.Size = new System.Drawing.Size(85, 16);
            this.label16.TabIndex = 23;
            this.label16.Text = "Last Row:";
            //
            // edLeft
            //
            this.edLeft.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.edLeft.Location = new System.Drawing.Point(80, 112);
            this.edLeft.Name = "edLeft";
            this.edLeft.Size = new System.Drawing.Size(48, 20);
            this.edLeft.TabIndex = 22;
            this.edLeft.Text = "0";
            //
            // label15
            //
            this.label15.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label15.Location = new System.Drawing.Point(16, 112);
            this.label15.Name = "label15";
            this.label15.Size = new System.Drawing.Size(85, 16);
            this.label15.TabIndex = 21;
            this.label15.Text = "First Col:";
            //
            // edTop
            //
            this.edTop.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.edTop.Location = new System.Drawing.Point(80, 88);
            this.edTop.Name = "edTop";
            this.edTop.Size = new System.Drawing.Size(48, 20);
            this.edTop.TabIndex = 20;
            this.edTop.Text = "0";
            //
            // label14
            //
            this.label14.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label14.Location = new System.Drawing.Point(16, 88);
            this.label14.Name = "label14";
            this.label14.Size = new System.Drawing.Size(85, 16);
            this.label14.TabIndex = 3;
            this.label14.Text = "First Row:";
            //
            // label13
            //
            this.label13.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
            | System.Windows.Forms.AnchorStyles.Right)));
            this.label13.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label13.Location = new System.Drawing.Point(8, 32);
            this.label13.Name = "label13";
            this.label13.Size = new System.Drawing.Size(160, 32);
            this.label13.TabIndex = 2;
            this.label13.Text = "If one of this values is <=0 all print_range will be printed";
            //
            // label12
            //
            this.label12.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label12.Location = new System.Drawing.Point(8, 16);
            this.label12.Name = "label12";
            this.label12.Size = new System.Drawing.Size(192, 16);
            this.label12.TabIndex = 1;
            this.label12.Text = "Range to Export:";
            //
            // chExportAll
            //
            this.chExportAll.Location = new System.Drawing.Point(32, 40);
            this.chExportAll.Name = "chExportAll";
            this.chExportAll.Size = new System.Drawing.Size(128, 16);
            this.chExportAll.TabIndex = 1;
            this.chExportAll.Text = "Export all Sheets";
            this.chExportAll.CheckedChanged += new System.EventHandler(this.chExportAll_CheckedChanged);
            //
            // label1
            //
            this.label1.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label1.Location = new System.Drawing.Point(29, 16);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(80, 16);
            this.label1.TabIndex = 0;
            this.label1.Text = "File to print:";
            //
            // exportDialog
            //
            this.exportDialog.DefaultExt = "pdf";
            this.exportDialog.Filter = "Pdf files|*.pdf";
            //
            // mainToolbar
            //
            this.mainToolbar.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.openFile,
            this.export,
            this.btnClose});
            this.mainToolbar.Location = new System.Drawing.Point(0, 0);
            this.mainToolbar.Name = "mainToolbar";
            this.mainToolbar.Size = new System.Drawing.Size(768, 38);
            this.mainToolbar.TabIndex = 4;
            this.mainToolbar.Text = "toolStrip1";
            //
            // openFile
            //
            this.openFile.Image = ((System.Drawing.Image)(resources.GetObject("openFile.Image")));
            this.openFile.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.openFile.Name = "openFile";
            this.openFile.Size = new System.Drawing.Size(61, 35);
            this.openFile.Text = "Open File";
            this.openFile.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
            this.openFile.Click += new System.EventHandler(this.openFile_Click);
            //
            // export
            //
            this.export.Image = ((System.Drawing.Image)(resources.GetObject("export.Image")));
            this.export.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.export.Name = "export";
            this.export.Size = new System.Drawing.Size(82, 35);
            this.export.Text = "Export to PDF";
            this.export.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
            this.export.Click += new System.EventHandler(this.export_Click);
            //
            // btnClose
            //
            this.btnClose.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right;
            this.btnClose.Image = ((System.Drawing.Image)(resources.GetObject("btnClose.Image")));
            this.btnClose.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.btnClose.Name = "btnClose";
            this.btnClose.Size = new System.Drawing.Size(59, 35);
            this.btnClose.Text = "     E&xit     ";
            this.btnClose.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
            this.btnClose.Click += new System.EventHandler(this.button2_Click);
            //
            // flexCelPdfExport1
            //
            this.flexCelPdfExport1.FontEmbed = FlexCel.Pdf.TFontEmbed.Embed;
            this.flexCelPdfExport1.InitialZoomAndPage = null;
            this.flexCelPdfExport1.PageLayout = FlexCel.Pdf.TPageLayout.None;
            this.flexCelPdfExport1.PageLayoutDisplay = FlexCel.Pdf.TPageLayoutDisplay.None;
            this.flexCelPdfExport1.PageSize = null;
            tPdfProperties1.Author = null;
            tPdfProperties1.Creator = null;
            tPdfProperties1.Keywords = null;
            tPdfProperties1.Language = null;
            tPdfProperties1.Subject = null;
            tPdfProperties1.Title = null;
            this.flexCelPdfExport1.Properties = tPdfProperties1;
            this.flexCelPdfExport1.TagMode = FlexCel.Pdf.TTagMode.Full;
            this.flexCelPdfExport1.UnlicensedReplacementFont = null;
            this.flexCelPdfExport1.UseExcelProperties = true;
            this.flexCelPdfExport1.Workbook = null;
            this.flexCelPdfExport1.AfterGeneratePage += new FlexCel.Render.PageEventHandler(this.flexCelPdfExport1_AfterGeneratePage);
            this.flexCelPdfExport1.GetFontData += new FlexCel.Pdf.GetFontDataEventHandler(this.flexCelPdfExport1_GetFontData);
            //
            // mainForm
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(768, 631);
            this.Controls.Add(this.panel1);
            this.Controls.Add(this.mainToolbar);
            this.Name = "mainForm";
            this.Text = "Export an Excel file to pdf";
            this.panel1.ResumeLayout(false);
            this.panel1.PerformLayout();
            this.panel2.ResumeLayout(false);
            this.panel2.PerformLayout();
            this.panel9.ResumeLayout(false);
            this.panel9.PerformLayout();
            this.panel8.ResumeLayout(false);
            this.panel7.ResumeLayout(false);
            this.panel7.PerformLayout();
            this.panel6.ResumeLayout(false);
            this.panel6.PerformLayout();
            this.panel5.ResumeLayout(false);
            this.panel5.PerformLayout();
            this.panel4.ResumeLayout(false);
            this.panel3.ResumeLayout(false);
            this.panel3.PerformLayout();
            this.mainToolbar.ResumeLayout(false);
            this.mainToolbar.PerformLayout();
            this.ResumeLayout(false);
            this.PerformLayout();

        }
        #endregion

        private ToolStrip mainToolbar;
        private ToolStripButton openFile;
        private ToolStripButton export;
        private ToolStripButton btnClose;
        private Label label29;
        private TextBox edLang;
        private Panel panel2;
        private ComboBox cbPdfType;
        private Label label34;
        private ComboBox cbVersion;
        private Label label31;
        private Label label30;
        private ComboBox cbTagged;
        private Label label32;
    }
}

Program.cs

using System;
using System.Windows.Forms;

namespace ExportPdf
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new mainForm());
        }
    }
}


Exporting to PDF/A (C# / netframework) | FlexCel Studio for the .NET Framework documentation

Exporting to PDF/A (C# / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\csharp\VS2022\netframework\25.Printing and Exporting\32.PDFA and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​csharp/​VS2022/​netframework/​Modules/​25.​Printing and Exporting/32.PDFA

Overview

FlexCel can export to PDF/A1, PDF/A2 and PDF/A3 in both their "a" and "b" variants.

Concepts

  • How to export a file to PDF/A

  • How to select between PDF/Ana and PDF/Anb

  • How to embed files in PDF/A3

Files

AssemblyInfo.cs

using System.Reflection;
using System.Runtime.CompilerServices;

//
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
//
[assembly: AssemblyTitle("")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("(c) 2002 - 2024 TMS Software")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

//
// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version
//      Build Number
//      Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:

[assembly: AssemblyVersion("7.21.0.0")]

//
// In order to sign your assembly you must specify a key to use. Refer to the
// Microsoft .NET Framework documentation for more information on assembly signing.
//
// Use the attributes below to control which key is used for signing.
//
// Notes:
//   (*) If no key is specified, the assembly is not signed.
//   (*) KeyName refers to a key that has been installed in the Crypto Service
//       Provider (CSP) on your machine. KeyFile refers to a file which contains
//       a key.
//   (*) If the KeyFile and the KeyName values are both specified, the
//       following processing occurs:
//       (1) If the KeyName can be found in the CSP, that key is used.
//       (2) If the KeyName does not exist and the KeyFile does exist, the key
//           in the KeyFile is installed into the CSP and used.
//   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
//       When specifying the KeyFile, the location of the KeyFile should be
//       relative to the project output directory which is
//       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
//       located in the project directory, you would specify the AssemblyKeyFile
//       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
//   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
//       documentation for more information on this.
//
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]
[assembly: AssemblyKeyName("")]

Form1.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using System.IO;
using System.Diagnostics;
using System.Reflection;
using System.Drawing.Drawing2D;
using FlexCel.Pdf;

using FlexCel.Render;

namespace PDFA
{
    /// <summary>
    /// Exporting xls files to PDF/A.
    /// </summary>
    public partial class mainForm: System.Windows.Forms.Form
    {

        public mainForm()
        {
            InitializeComponent();
            cbPdfType.SelectedIndex = 1;
        }

        private void button2_Click(object sender, System.EventArgs e)
        {
            Close();
        }

        private void export_Click(object sender, System.EventArgs e)
        {
            bool EmbedSource = cbEmbed.Checked;
            TPdfType PdfType = GetPdfType();
            TTagMode TagMode = GetTagMode();

            if (EmbedSource)
            {
                if (PdfType != TPdfType.PDFA3 && PdfType != TPdfType.Standard)
                {
                    MessageBox.Show("To embed a file, you need to use standard PDF or PDF/A3");
                    return;
                }
            }

            if (exportDialog.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            CreateFile(exportDialog.FileName, EmbedSource, PdfType, TagMode);

            if (MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) == DialogResult.Yes)
            {
                Process.Start(exportDialog.FileName);
            }

        }

        private TPdfType GetPdfType()
        {
            switch (cbPdfType.SelectedIndex)
            {
                case 0: return TPdfType.Standard;
                case 1:
                case 2: return TPdfType.PDFA1;
                case 3:
                case 4: return TPdfType.PDFA2;
                case 5:
                case 6: return TPdfType.PDFA3;
            }

            throw new Exception("Unexpected PDF type");
        }

        private TTagMode GetTagMode()
        {
            switch (cbPdfType.SelectedIndex)
            {
                case 0:
                case 1:
                case 3:
                case 5: return TTagMode.Full;
            }
            return TTagMode.None;
        }

        private void CreateFile(string FileName, bool EmbedSource, TPdfType PdfType, TTagMode TagMode)
        {
            ExcelFile xls = CreateSourceFile();
            using (FlexCelPdfExport pdf = new FlexCelPdfExport(xls, true))
            {
                pdf.PdfType = PdfType;
                pdf.TagMode = TagMode;
                if (EmbedSource)
                {
                    pdf.AttachFile("Report.xlsx", StandardMimeType.Xlsx, "This is the source file used to create the PDF", DateTime.Now, TPdfAttachmentKind.Source,
                        (attachWriter) =>
                        {
                            using (MemoryStream ms = new MemoryStream())
                            {
                                xls.Save(ms, TFileFormats.Xlsx);
                                ms.Position = 0;
                                attachWriter.Write(ms);
                            }
                        });
                }
                pdf.Export(FileName);
            }
        }

        private ExcelFile CreateSourceFile()
        {
            ExcelFile xls = new XlsFile();
            xls.NewFile(1, TExcelFileFormat.v2019);
            xls.SetCellValue(1, 1, "This is a test from FlexCel!");
            xls.SetCellValue(2, 1, "Here is some emoji to show unicode surrogate support: 🐜🐏");
            xls.SetCellValue(3, 1, "You might need a font able to show emoji for those characters to show");
            xls.SetCellValue(4, 1, "Windows 7 and 8 have SegoeUISymbol, which can show them and is used automatically by FlexCel.");
            return xls;
        }

    }
}

Form1.Designer.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using System.IO;
using System.Diagnostics;
using System.Reflection;
using System.Drawing.Drawing2D;
using FlexCel.Pdf;
using System.Runtime.InteropServices;
namespace PDFA
{
    public partial class mainForm: System.Windows.Forms.Form
    {
        private System.Windows.Forms.Panel panel1;
        private System.Windows.Forms.SaveFileDialog exportDialog;
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(mainForm));
            this.panel1 = new System.Windows.Forms.Panel();
            this.cbEmbed = new System.Windows.Forms.CheckBox();
            this.cbPdfType = new System.Windows.Forms.ComboBox();
            this.exportDialog = new System.Windows.Forms.SaveFileDialog();
            this.toolStrip1 = new System.Windows.Forms.ToolStrip();
            this.export = new System.Windows.Forms.ToolStripButton();
            this.btnClose = new System.Windows.Forms.ToolStripButton();
            this.panel1.SuspendLayout();
            this.toolStrip1.SuspendLayout();
            this.SuspendLayout();
            //
            // panel1
            //
            this.panel1.BackColor = System.Drawing.Color.White;
            this.panel1.Controls.Add(this.cbEmbed);
            this.panel1.Controls.Add(this.cbPdfType);
            this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
            this.panel1.Location = new System.Drawing.Point(0, 38);
            this.panel1.Name = "panel1";
            this.panel1.Size = new System.Drawing.Size(372, 104);
            this.panel1.TabIndex = 3;
            //
            // cbEmbed
            //
            this.cbEmbed.AutoSize = true;
            this.cbEmbed.Location = new System.Drawing.Point(12, 54);
            this.cbEmbed.Name = "cbEmbed";
            this.cbEmbed.Size = new System.Drawing.Size(351, 17);
            this.cbEmbed.TabIndex = 5;
            this.cbEmbed.Text = "Embed xslx source file inside the PDF. (requires PDF/A3 or Standard)";
            this.cbEmbed.UseVisualStyleBackColor = true;
            //
            // cbPdfType
            //
            this.cbPdfType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.cbPdfType.Items.AddRange(new object[] {
            "Standard",
            "PDF/A1a",
            "PDF/A1b",
            "PDF/A2a",
            "PDF/A2b",
            "PDF/A3a",
            "PDF/A3b"});
            this.cbPdfType.Location = new System.Drawing.Point(12, 14);
            this.cbPdfType.Name = "cbPdfType";
            this.cbPdfType.Size = new System.Drawing.Size(144, 21);
            this.cbPdfType.TabIndex = 35;
            //
            // exportDialog
            //
            this.exportDialog.DefaultExt = "pdf";
            this.exportDialog.Filter = "Pdf files|*.pdf";
            //
            // toolStrip1
            //
            this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.export,
            this.btnClose});
            this.toolStrip1.Location = new System.Drawing.Point(0, 0);
            this.toolStrip1.Name = "toolStrip1";
            this.toolStrip1.Size = new System.Drawing.Size(372, 38);
            this.toolStrip1.TabIndex = 4;
            this.toolStrip1.Text = "mainToolbar";
            //
            // export
            //
            this.export.Image = ((System.Drawing.Image)(resources.GetObject("export.Image")));
            this.export.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.export.Name = "export";
            this.export.Size = new System.Drawing.Size(69, 35);
            this.export.Text = "Create PDF";
            this.export.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
            this.export.Click += new System.EventHandler(this.export_Click);
            //
            // btnClose
            //
            this.btnClose.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right;
            this.btnClose.Image = ((System.Drawing.Image)(resources.GetObject("btnClose.Image")));
            this.btnClose.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.btnClose.Name = "btnClose";
            this.btnClose.Size = new System.Drawing.Size(59, 35);
            this.btnClose.Text = "     E&xit     ";
            this.btnClose.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
            this.btnClose.Click += new System.EventHandler(this.button2_Click);
            //
            // mainForm
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(372, 142);
            this.Controls.Add(this.panel1);
            this.Controls.Add(this.toolStrip1);
            this.Name = "mainForm";
            this.Text = "PDF/A";
            this.panel1.ResumeLayout(false);
            this.panel1.PerformLayout();
            this.toolStrip1.ResumeLayout(false);
            this.toolStrip1.PerformLayout();
            this.ResumeLayout(false);
            this.PerformLayout();

        }
        #endregion

        private ToolStrip toolStrip1;
        private ToolStripButton export;
        private ToolStripButton btnClose;
        private CheckBox cbEmbed;
        private ComboBox cbPdfType;
    }
}

Program.cs

using System;
using System.Windows.Forms;

namespace PDFA
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new mainForm());
        }
    }
}


Signing PDFs (C# / netframework) | FlexCel Studio for the .NET Framework documentation

Signing PDFs (C# / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\csharp\VS2022\netframework\25.Printing and Exporting\35.Signing Pdfs and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​csharp/​VS2022/​netframework/​Modules/​25.​Printing and Exporting/35.Signing Pdfs

Overview

In this example we will show how to add a visible or invisible signature to a generated PDF file.

Concepts

  • In order to sign a PDF file you will need a certificate issued by a valid Certificate Authority, or one issued by yourself. In this example we will use a self signed certificate. This certificate will not validate by default when you open it in Acrobat, you need to add it to your trusted list.

  • The default algorithm for CmsSigner .NET class is SHA-1, which is known to have vulnerabilities and shouldn't be used anymore. So in this example we use SHA512 instead by changing the DigestAlgorithm.

  • In order to sign a file, FlexCel will write a requirement for Acrobat 8 or newer in the generated files. This is because only Acrobat 8 or newer support SHA512. Older versions of acrobat will still display the pages but will not validate the signature.

  • We provide a default signing implementation using standard .NET crypto classes. You can still create your own signature engine by using a third party cryptography library or by calling CryptoApi in windows via p/invoke. This is explained in the section Signing PDF Files in the PDF exporting guide.

Files

mainForm.cs

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using FlexCel.Render;
using FlexCel.XlsAdapter;
using FlexCel.Pdf;
using System.IO;
using System.Security.Cryptography.X509Certificates;
using System.Security.Cryptography.Pkcs;
using System.Drawing.Imaging;
using System.Reflection;
using System.Diagnostics;

namespace SigningPdfs
{
    public partial class mainForm: Form
    {
        public mainForm()
        {
            Application.EnableVisualStyles();
            InitializeComponent();
        }

        private void cbVisibleSignature_CheckedChanged(object sender, EventArgs e)
        {
            SignaturePicture.Visible = cbVisibleSignature.Checked;
            int delta = SignaturePicture.Height + 30;
            if (cbVisibleSignature.Checked) this.Height += delta; else this.Height -= delta;
        }

        private void SignaturePicture_Click(object sender, EventArgs e)
        {
            if (OpenImageDialog.ShowDialog() != DialogResult.OK) return;
            SignaturePicture.Load(OpenImageDialog.FileName);
        }

        private void btnCreateAndSign_Click(object sender, EventArgs e)
        {
            //Load the Excel file.
            if (OpenExcelDialog.ShowDialog() != DialogResult.OK) return;
            XlsFile xls = new XlsFile();
            xls.Open(OpenExcelDialog.FileName);

            string DataPath = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) + @"\..\..\";

            //Export it to pdf.
            using (FlexCelPdfExport pdf = new FlexCelPdfExport(xls, true))
            {
                pdf.FontEmbed = TFontEmbed.Embed;

                //Load the certificate and create a signer.
                //In this example we just have the password in clear. It should be kept in a SecureString.
                //Also make sure to set the flag X509KeyStorageFlags.EphemeralKeySet to avoid files created
                //on disk: https://snede.net/the-most-dangerous-constructor-in-net/
                //As X509KeyStorageFlags.EphemeralKeySet only exists in .NET 4.8 or newer, for older versions we will
                //define it as (X509KeyStorageFlags)32. For .NET 4.8 or newer and  NET Core, you can use X509KeyStorageFlags.EphemeralKeySet
                  X509Certificate2 Cert = new X509Certificate2(DataPath + "flexcel.pfx", "password", X509KeyStorageFlags.EphemeralKeySet);

                //Note that to use the CmsSigner class you need to add a reference to System.Security dll.
                //It is *not* enough to add it to the using clauses, you need to add a reference to the dll.
                CmsSigner Signer = new CmsSigner(Cert);

                //By default CmsSigner uses SHA1, but SHA1 has known vulnerabilities and it is deprecated.
                //So we will use SHA512 instead.
                //"2.16.840.1.101.3.4.2.3" is the Oid for SHA512.
                Signer.DigestAlgorithm = new System.Security.Cryptography.Oid("2.16.840.1.101.3.4.2.3");

                TPdfSignature sig;
                if (cbVisibleSignature.Checked)
                {
                    using (MemoryStream fs = new MemoryStream())
                    {
                        SignaturePicture.Image.Save(fs, ImageFormat.Png);
                        byte[] ImgData = fs.ToArray();

                        //The -1 as "page" parameter means the last page.
                        sig = new TPdfVisibleSignature(new TBuiltInSignerFactory(Signer),
                            "Signature", "I have read the document and certify it is valid.", "Springfield", "adrian@tmssoftware.com", -1, new RectangleF(50, 50, 140, 70), ImgData);
                    }
                }
                else
                {
                    sig = new TPdfSignature(new TBuiltInSignerFactory(Signer),
                                "Signature", "I have read the document and certify it is valid.", "Springfield", "adrian@tmssoftware.com");
                }

                //You must sign the document *BEFORE* starting to write it.
                pdf.Sign(sig);

                if (savePdfDialog.ShowDialog() != DialogResult.OK) return;
                using (FileStream PdfStream = new FileStream(savePdfDialog.FileName, FileMode.Create))
                {
                    pdf.BeginExport(PdfStream);
                    pdf.ExportAllVisibleSheets(false, "Signed Pdf");
                    pdf.EndExport();
                }

            }

            if (MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo, MessageBoxIcon.Question) != DialogResult.Yes) return;
            Process.Start(savePdfDialog.FileName);

        }
    }
}

mainForm.Designer.cs

namespace SigningPdfs
{
    partial class mainForm
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.btnCreateAndSign = new System.Windows.Forms.Button();
            this.cbVisibleSignature = new System.Windows.Forms.CheckBox();
            this.OpenExcelDialog = new System.Windows.Forms.OpenFileDialog();
            this.savePdfDialog = new System.Windows.Forms.SaveFileDialog();
            this.SignaturePicture = new System.Windows.Forms.PictureBox();
            this.OpenImageDialog = new System.Windows.Forms.OpenFileDialog();
            ((System.ComponentModel.ISupportInitialize)(this.SignaturePicture)).BeginInit();
            this.SuspendLayout();
            //
            // btnCreateAndSign
            //
            this.btnCreateAndSign.Image = global::SigningPdfs.Properties.Resources.acroread;
            this.btnCreateAndSign.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
            this.btnCreateAndSign.Location = new System.Drawing.Point(24, 25);
            this.btnCreateAndSign.Name = "btnCreateAndSign";
            this.btnCreateAndSign.Size = new System.Drawing.Size(155, 30);
            this.btnCreateAndSign.TabIndex = 0;
            this.btnCreateAndSign.Text = "Create and Sign Pdf";
            this.btnCreateAndSign.UseVisualStyleBackColor = true;
            this.btnCreateAndSign.Click += new System.EventHandler(this.btnCreateAndSign_Click);
            //
            // cbVisibleSignature
            //
            this.cbVisibleSignature.AutoSize = true;
            this.cbVisibleSignature.Location = new System.Drawing.Point(24, 78);
            this.cbVisibleSignature.Name = "cbVisibleSignature";
            this.cbVisibleSignature.Size = new System.Drawing.Size(167, 17);
            this.cbVisibleSignature.TabIndex = 1;
            this.cbVisibleSignature.Text = "Visible Signature (in last page)";
            this.cbVisibleSignature.UseVisualStyleBackColor = true;
            this.cbVisibleSignature.CheckedChanged += new System.EventHandler(this.cbVisibleSignature_CheckedChanged);
            //
            // OpenExcelDialog
            //
            this.OpenExcelDialog.DefaultExt = "xls";
            this.OpenExcelDialog.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm|Excel 97/2003|*.xls|Excel 2007|*.xlsx;*.xlsm|All files|*.*";
            this.OpenExcelDialog.Title = "Select Excel file to convert...";
            //
            // savePdfDialog
            //
            this.savePdfDialog.DefaultExt = "pdf";
            this.savePdfDialog.Filter = "Pdf Files|*.pdf";
            this.savePdfDialog.Title = "Select where to save the file...";
            //
            // SignaturePicture
            //
            this.SignaturePicture.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.SignaturePicture.Image = global::SigningPdfs.Properties.Resources.sign;
            this.SignaturePicture.Location = new System.Drawing.Point(24, 110);
            this.SignaturePicture.Name = "SignaturePicture";
            this.SignaturePicture.Size = new System.Drawing.Size(155, 100);
            this.SignaturePicture.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
            this.SignaturePicture.TabIndex = 2;
            this.SignaturePicture.TabStop = false;
            this.SignaturePicture.Click += new System.EventHandler(this.SignaturePicture_Click);
            //
            // OpenImageDialog
            //
            this.OpenImageDialog.Filter = "Supported Images|*.png;*.bmp*.jpg|All files|*.*";
            //
            // mainForm
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(205, 100);
            this.Controls.Add(this.SignaturePicture);
            this.Controls.Add(this.cbVisibleSignature);
            this.Controls.Add(this.btnCreateAndSign);
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D;
            this.Name = "mainForm";
            this.Text = "Signing PDFs";
            ((System.ComponentModel.ISupportInitialize)(this.SignaturePicture)).EndInit();
            this.ResumeLayout(false);
            this.PerformLayout();

        }

        #endregion

        private System.Windows.Forms.Button btnCreateAndSign;
        private System.Windows.Forms.CheckBox cbVisibleSignature;
        private System.Windows.Forms.OpenFileDialog OpenExcelDialog;
        private System.Windows.Forms.SaveFileDialog savePdfDialog;
        private System.Windows.Forms.PictureBox SignaturePicture;
        private System.Windows.Forms.OpenFileDialog OpenImageDialog;
    }
}

Program.cs

using System;
using System.Collections.Generic;
using System.Windows.Forms;

namespace SigningPdfs
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new mainForm());
        }
    }
}


Exporting Excel files to HTML (C# / netframework) | FlexCel Studio for the .NET Framework documentation

Exporting Excel files to HTML (C# / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\csharp\VS2022\netframework\25.Printing and Exporting\40.Export HTML and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​csharp/​VS2022/​netframework/​Modules/​25.​Printing and Exporting/40.Export HTML

Overview

FlexCel can natively export an Excel file to HTML, in many formats like XHTML 1.1, HTML 3.2, HTML 4.1 strict or HTML 5.

Concepts

  • HTML is a format that makes emphasis in semantics over presentation, and because of this reason the HTML file will not be as faithful to the original file as a PDF. PDF are targeted especially for handling presentation. Anyway, the output is very similar and in many ways better (and more cross-browser) than the HTML generated by Excel itself when saving to HTML.

  • Among the things that are not exported you can find:

  • ActiveX objects

  • 3D Charts (They will be rendered as 2d)

  • Not common AutoShapes (most used Autoshapes, as rectangles, rounded rectangles, ellipses, etc are exported)

Files

AssemblyInfo.cs

using System.Reflection;
using System.Runtime.CompilerServices;

//
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
//
[assembly: AssemblyTitle("")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("(c) 2002 - 2024 TMS Software")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

//
// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version
//      Build Number
//      Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:

[assembly: AssemblyVersion("7.21.0.0")]

//
// In order to sign your assembly you must specify a key to use. Refer to the
// Microsoft .NET Framework documentation for more information on assembly signing.
//
// Use the attributes below to control which key is used for signing.
//
// Notes:
//   (*) If no key is specified, the assembly is not signed.
//   (*) KeyName refers to a key that has been installed in the Crypto Service
//       Provider (CSP) on your machine. KeyFile refers to a file which contains
//       a key.
//   (*) If the KeyFile and the KeyName values are both specified, the
//       following processing occurs:
//       (1) If the KeyName can be found in the CSP, that key is used.
//       (2) If the KeyName does not exist and the KeyFile does exist, the key
//           in the KeyFile is installed into the CSP and used.
//   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
//       When specifying the KeyFile, the location of the KeyFile should be
//       relative to the project output directory which is
//       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
//       located in the project directory, you would specify the AssemblyKeyFile
//       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
//   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
//       documentation for more information on this.
//
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]
[assembly: AssemblyKeyName("")]

Form1.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using FlexCel.Render;
using System.IO;
using System.Diagnostics;

using System.Text;

namespace ExportHTML
{
    /// <summary>
    /// An Example on how to export to HTML.
    /// </summary>
    public partial class mainForm: System.Windows.Forms.Form
    {
        private FlexCel.Render.FlexCelHtmlExport flexCelHtmlExport1;

        public mainForm()
        {
            InitializeComponent();
        }

        private Mailform MailDialog;

        private void button2_Click(object sender, System.EventArgs e)
        {
            Close();
        }

        private void LoadSheetConfig()
        {
            ExcelFile Xls = flexCelHtmlExport1.Workbook;

            chGridLines.Checked = Xls.PrintGridLines;
            chPrintHeadings.Checked = Xls.PrintHeadings;
            chFormulaText.Checked = Xls.ShowFormulaText;
        }

        private void openFile_Click(object sender, System.EventArgs e)
        {
            if (openFileDialog1.ShowDialog() != DialogResult.OK) return;
            flexCelHtmlExport1.Workbook = new XlsFile();

            flexCelHtmlExport1.Workbook.Open(openFileDialog1.FileName);

            Text = "Export: " + openFileDialog1.FileName;

            ExcelFile Xls = flexCelHtmlExport1.Workbook;

            cbSheet.Items.Clear();
            for (int i = 1; i <= Xls.SheetCount; i++)
            {
                cbSheet.Items.Add(Xls.GetSheetName(i));
            }
            cbSheet.SelectedIndex = Xls.ActiveSheet - 1;

            LoadSheetConfig();
        }

        private bool HasFileOpen()
        {
            if (flexCelHtmlExport1.Workbook == null)
            {
                MessageBox.Show("You need to open a file first.");
                return false;
            }
            return true;
        }

        private bool LoadPreferences()
        {
            //NOTE: THERE SHOULD BE *A LOT* MORE VALIDATION OF VALUES ON THIS METHOD. (For example, validate that margins are between bounds)
            // As this is a simple demo, they are not included.
            try
            {
                ExcelFile Xls = flexCelHtmlExport1.Workbook;

                //Note: In this demo we will only apply this things to the active sheet.
                //If you want to apply the settings to all the sheets, you should loop in the sheets and change them here.
                Xls.PrintGridLines = chGridLines.Checked;
                Xls.PrintHeadings = chPrintHeadings.Checked;
                Xls.ShowFormulaText = chFormulaText.Checked;

                flexCelHtmlExport1.PrintRangeLeft = Convert.ToInt32(edLeft.Text);
                flexCelHtmlExport1.PrintRangeTop = Convert.ToInt32(edTop.Text);
                flexCelHtmlExport1.PrintRangeRight = Convert.ToInt32(edRight.Text);
                flexCelHtmlExport1.PrintRangeBottom = Convert.ToInt32(edBottom.Text);

                if (sbSVG.Checked) flexCelHtmlExport1.SavedImagesFormat = THtmlImageFormat.Svg; else flexCelHtmlExport1.SavedImagesFormat = THtmlImageFormat.Png;
                flexCelHtmlExport1.EmbedImages = cbEmbedImages.Checked;

                flexCelHtmlExport1.FixOutlook2007CssSupport = cbOutlook2007.Checked;
                flexCelHtmlExport1.FixIE6TransparentPngSupport = cbIe6Png.Checked;

                flexCelHtmlExport1.HidePrintObjects = THidePrintObjects.None;
                if (!cbImages.Checked) flexCelHtmlExport1.HidePrintObjects |= THidePrintObjects.Images;
                if (!cbHyperlinks.Checked) flexCelHtmlExport1.HidePrintObjects |= THidePrintObjects.Hyperlynks;
                if (!cbComments.Checked) flexCelHtmlExport1.HidePrintObjects |= THidePrintObjects.Comments;
                if (!cbHeadersFooters.Checked) flexCelHtmlExport1.HidePrintObjects |= THidePrintObjects.HeadersAndFooters;

            }
            catch (Exception e)
            {
                MessageBox.Show("Error: " + e.Message);
                return false;
            }
            return true;
        }

        private void cbSheet_SelectedIndexChanged(object sender, System.EventArgs e)
        {
            flexCelHtmlExport1.Workbook.ActiveSheet = cbSheet.SelectedIndex + 1;
            LoadSheetConfig();
        }

        private void export_Click(object sender, System.EventArgs e)
        {
            if (!HasFileOpen()) return;
            if (!LoadPreferences()) return;

            if (cbFileFormat.SelectedIndex == 1)
            {
                flexCelHtmlExport1.HtmlFileFormat = THtmlFileFormat.MHtml;
                exportDialog.FilterIndex = 2;
            }
            else
            {
                flexCelHtmlExport1.HtmlFileFormat = THtmlFileFormat.Html;
                exportDialog.FilterIndex = 1;
            }

            if (exportDialog.ShowDialog() != DialogResult.OK) return;

            flexCelHtmlExport1.AllowOverwritingFiles = true;

            string CssFileName = null;
            if (cbCss.Checked) CssFileName = edCss.Text;

            string FileNameToOpen = exportDialog.FileName;

            switch (cbHtmlVersion.SelectedIndex)
            {
                case 0: flexCelHtmlExport1.HtmlVersion = THtmlVersion.Html_32; break;
                case 2: flexCelHtmlExport1.HtmlVersion = THtmlVersion.XHTML_10; break;
                case 3: flexCelHtmlExport1.HtmlVersion = THtmlVersion.Html_5; break;
                default:
                    flexCelHtmlExport1.HtmlVersion = THtmlVersion.Html_401;
                    break;
            }

            if (edBodyStart.Text != null) flexCelHtmlExport1.ExtraInfo.BodyStart = new string[] { edBodyStart.Text };

            switch (cbExportObject.SelectedIndex)
            {
                case 0:
                    TSheetSelectorPosition SelectorPosition = TSheetSelectorPosition.None;

                    //If in VB.NET or Delphi.NET, use "if cbTop.Checked then SelectorPosition = SelectorPosition or TSheetSelectorPosition.Top"
                    if (cbTop.Checked) SelectorPosition |= TSheetSelectorPosition.Top;
                    if (cbLeft.Checked) SelectorPosition |= TSheetSelectorPosition.Left;
                    if (cbBottom.Checked) SelectorPosition |= TSheetSelectorPosition.Bottom;
                    if (cbRight.Checked) SelectorPosition |= TSheetSelectorPosition.Right;

                    flexCelHtmlExport1.ExportAllVisibleSheetsAsTabs(Path.GetDirectoryName(exportDialog.FileName),
                        Path.GetFileNameWithoutExtension(exportDialog.FileName), Path.GetExtension(exportDialog.FileName), edImages.Text, CssFileName, new TStandardSheetSelector(SelectorPosition));

                    FileNameToOpen = Path.Combine(Path.GetDirectoryName(exportDialog.FileName), Path.GetFileNameWithoutExtension(exportDialog.FileName));
                    FileNameToOpen = Path.Combine(FileNameToOpen, flexCelHtmlExport1.Workbook.SheetName);
                    FileNameToOpen = Path.Combine(FileNameToOpen, Path.GetExtension(exportDialog.FileName));

                    break;
                case 1:
                    flexCelHtmlExport1.ExportAllVisibleSheetsAsOneHtmlFile(exportDialog.FileName, edImages.Text, CssFileName, edSheetSeparator.Text);
                    break;

                case 2:
                    {
                        flexCelHtmlExport1.Export(exportDialog.FileName, edImages.Text, CssFileName);
                        break;
                    }
            }

            string[] GeneratedFiles = flexCelHtmlExport1.GeneratedFiles.GetHtmlFiles();
            if (GeneratedFiles.Length == 0)
            {
                MessageBox.Show("Error: No file has been generated");
            }
            else
            {
                if (MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    Process.Start(GeneratedFiles[0]);
                }
            }
        }

        private void btnEmail_Click(object sender, System.EventArgs e)
        {
            if (!HasFileOpen()) return;
            if (MailDialog == null) MailDialog = new Mailform();
            MailDialog.MainForm = this;

            if (!flexCelHtmlExport1.FixOutlook2007CssSupport)
            {
                DialogResult dr = MessageBox.Show("You have not checked \"Outlook 2007 support\". If any of your clients has Outlook express, you should turn this on.\n\nUse Outlook 2007 fix?", "Warning", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Warning);

                if (dr == DialogResult.Cancel) return;
                if (dr == DialogResult.Yes)
                {
                    cbOutlook2007.Checked = true;
                    flexCelHtmlExport1.FixOutlook2007CssSupport = true;
                }
            }

            MailDialog.ShowDialog();

        }

        public byte[] GenerateMHTML()
        {
            LoadPreferences();
            flexCelHtmlExport1.HtmlFileFormat = THtmlFileFormat.MHtml;

            flexCelHtmlExport1.AllowOverwritingFiles = true;

            flexCelHtmlExport1.HtmlVersion = THtmlVersion.Html_401;

            if (edBodyStart.Text != null) flexCelHtmlExport1.ExtraInfo.BodyStart = new string[] { edBodyStart.Text };

            using (MemoryStream ms = new MemoryStream())
            {
                using (StreamWriter writer = new StreamWriter(ms, Encoding.UTF8))
                {
                    flexCelHtmlExport1.Export(writer, flexCelHtmlExport1.Workbook.ActiveFileName, null);
                }
                return ms.ToArray();
            }
        }

        private void mainForm_Load(object sender, System.EventArgs e)
        {
            cbExportObject.SelectedIndex = 0;
            cbHtmlVersion.SelectedIndex = 3;
            cbFileFormat.SelectedIndex = 0;
        }

        private void cbExportObject_SelectedIndexChanged(object sender, System.EventArgs e)
        {
            edSheetSeparator.Enabled = cbExportObject.SelectedIndex == 1;
            cbTop.Enabled = cbExportObject.SelectedIndex == 0;
            cbLeft.Enabled = cbExportObject.SelectedIndex == 0;
            cbRight.Enabled = cbExportObject.SelectedIndex == 0;
            cbBottom.Enabled = cbExportObject.SelectedIndex == 0;
            cbSheet.Enabled = cbExportObject.SelectedIndex == 2;
        }

        private void cbCss_CheckedChanged(object sender, System.EventArgs e)
        {
            edCss.Enabled = cbCss.Checked;
        }

        private void flexCelHtmlExport1_HtmlFont(object sender, FlexCel.Core.HtmlFontEventArgs e)
        {
            if (cbReplaceFonts.Checked)
            {
                e.FontFamily = "arial, sans-serif";
            }
        }

    }
}

Form1.Designer.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using FlexCel.Render;
using System.IO;
using System.Diagnostics;
using System.Text;
namespace ExportHTML
{
    public partial class mainForm: System.Windows.Forms.Form
    {
        private System.Windows.Forms.OpenFileDialog openFileDialog1;
        private System.Windows.Forms.Panel panel1;
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.Panel panel3;
        private System.Windows.Forms.Label label12;
        private System.Windows.Forms.Label label13;
        private System.Windows.Forms.Label label14;
        private System.Windows.Forms.TextBox edTop;
        private System.Windows.Forms.TextBox edLeft;
        private System.Windows.Forms.Label label15;
        private System.Windows.Forms.TextBox edRight;
        private System.Windows.Forms.Label label16;
        private System.Windows.Forms.TextBox edBottom;
        private System.Windows.Forms.Label label17;
        private System.Windows.Forms.SaveFileDialog exportDialog;
        private System.Windows.Forms.Panel panel8;
        private System.Windows.Forms.CheckBox chFormulaText;
        private System.Windows.Forms.CheckBox chGridLines;
        private System.Windows.Forms.Label label24;
        private System.Windows.Forms.Panel panel4;
        private System.Windows.Forms.Label label4;
        private System.Windows.Forms.CheckBox cbOutlook2007;
        private System.Windows.Forms.Panel panel5;
        private System.Windows.Forms.Label label5;
        private System.Windows.Forms.Panel panel6;
        private System.Windows.Forms.Label label6;
        private System.Windows.Forms.CheckBox checkBox4;
        private System.Windows.Forms.CheckBox cbIe6Png;
        private System.Windows.Forms.CheckBox cbComments;
        private System.Windows.Forms.CheckBox cbHyperlinks;
        private System.Windows.Forms.CheckBox cbImages;
        private System.Windows.Forms.Panel panel7;
        private System.Windows.Forms.Label label2;
        private System.Windows.Forms.ComboBox cbExportObject;
        private System.Windows.Forms.Label lblSheetToExport;
        private System.Windows.Forms.ComboBox cbSheet;
        private System.Windows.Forms.Panel panel9;
        private System.Windows.Forms.Label label3;
        private System.Windows.Forms.CheckBox cbTop;
        private System.Windows.Forms.CheckBox cbLeft;
        private System.Windows.Forms.CheckBox cbRight;
        private System.Windows.Forms.CheckBox cbBottom;
        private System.Windows.Forms.Panel panel10;
        private System.Windows.Forms.Label label7;
        private System.Windows.Forms.TextBox edSheetSeparator;
        private System.Windows.Forms.Panel panel11;
        private System.Windows.Forms.Label label8;
        private System.Windows.Forms.Panel panel12;
        private System.Windows.Forms.CheckBox cbCss;
        private System.Windows.Forms.TextBox edCss;
        private System.Windows.Forms.TextBox edImages;
        private System.Windows.Forms.ComboBox cbHtmlVersion;
        private System.Windows.Forms.ComboBox cbFileFormat;
        private System.Windows.Forms.Label label9;
        private System.Windows.Forms.Panel panel13;
        private System.Windows.Forms.TextBox edBodyStart;
        private System.Windows.Forms.Label label10;
        private System.Windows.Forms.CheckBox cbReplaceFonts;
        private System.Windows.Forms.CheckBox chPrintHeadings;
        private System.Windows.Forms.CheckBox cbHeadersFooters;
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(mainForm));
            this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
            this.panel1 = new System.Windows.Forms.Panel();
            this.cbReplaceFonts = new System.Windows.Forms.CheckBox();
            this.panel13 = new System.Windows.Forms.Panel();
            this.edBodyStart = new System.Windows.Forms.TextBox();
            this.label10 = new System.Windows.Forms.Label();
            this.panel12 = new System.Windows.Forms.Panel();
            this.cbCss = new System.Windows.Forms.CheckBox();
            this.edCss = new System.Windows.Forms.TextBox();
            this.panel11 = new System.Windows.Forms.Panel();
            this.edImages = new System.Windows.Forms.TextBox();
            this.label8 = new System.Windows.Forms.Label();
            this.panel10 = new System.Windows.Forms.Panel();
            this.edSheetSeparator = new System.Windows.Forms.TextBox();
            this.label7 = new System.Windows.Forms.Label();
            this.panel9 = new System.Windows.Forms.Panel();
            this.cbBottom = new System.Windows.Forms.CheckBox();
            this.cbRight = new System.Windows.Forms.CheckBox();
            this.cbLeft = new System.Windows.Forms.CheckBox();
            this.cbTop = new System.Windows.Forms.CheckBox();
            this.label3 = new System.Windows.Forms.Label();
            this.panel7 = new System.Windows.Forms.Panel();
            this.cbExportObject = new System.Windows.Forms.ComboBox();
            this.lblSheetToExport = new System.Windows.Forms.Label();
            this.cbSheet = new System.Windows.Forms.ComboBox();
            this.label2 = new System.Windows.Forms.Label();
            this.panel6 = new System.Windows.Forms.Panel();
            this.cbHeadersFooters = new System.Windows.Forms.CheckBox();
            this.cbImages = new System.Windows.Forms.CheckBox();
            this.cbHyperlinks = new System.Windows.Forms.CheckBox();
            this.cbComments = new System.Windows.Forms.CheckBox();
            this.label6 = new System.Windows.Forms.Label();
            this.panel5 = new System.Windows.Forms.Panel();
            this.cbIe6Png = new System.Windows.Forms.CheckBox();
            this.label5 = new System.Windows.Forms.Label();
            this.cbOutlook2007 = new System.Windows.Forms.CheckBox();
            this.panel4 = new System.Windows.Forms.Panel();
            this.cbEmbedImages = new System.Windows.Forms.CheckBox();
            this.sbSVG = new System.Windows.Forms.CheckBox();
            this.label9 = new System.Windows.Forms.Label();
            this.cbFileFormat = new System.Windows.Forms.ComboBox();
            this.cbHtmlVersion = new System.Windows.Forms.ComboBox();
            this.label4 = new System.Windows.Forms.Label();
            this.panel3 = new System.Windows.Forms.Panel();
            this.edBottom = new System.Windows.Forms.TextBox();
            this.label17 = new System.Windows.Forms.Label();
            this.edRight = new System.Windows.Forms.TextBox();
            this.label16 = new System.Windows.Forms.Label();
            this.edLeft = new System.Windows.Forms.TextBox();
            this.label15 = new System.Windows.Forms.Label();
            this.edTop = new System.Windows.Forms.TextBox();
            this.label14 = new System.Windows.Forms.Label();
            this.label13 = new System.Windows.Forms.Label();
            this.label12 = new System.Windows.Forms.Label();
            this.label1 = new System.Windows.Forms.Label();
            this.panel8 = new System.Windows.Forms.Panel();
            this.chPrintHeadings = new System.Windows.Forms.CheckBox();
            this.label24 = new System.Windows.Forms.Label();
            this.chFormulaText = new System.Windows.Forms.CheckBox();
            this.chGridLines = new System.Windows.Forms.CheckBox();
            this.checkBox4 = new System.Windows.Forms.CheckBox();
            this.exportDialog = new System.Windows.Forms.SaveFileDialog();
            this.flexCelHtmlExport1 = new FlexCel.Render.FlexCelHtmlExport();
            this.mainToolbar = new System.Windows.Forms.ToolStrip();
            this.openFile = new System.Windows.Forms.ToolStripButton();
            this.export = new System.Windows.Forms.ToolStripButton();
            this.btnEmail = new System.Windows.Forms.ToolStripButton();
            this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
            this.btnClose = new System.Windows.Forms.ToolStripButton();
            this.panel1.SuspendLayout();
            this.panel13.SuspendLayout();
            this.panel12.SuspendLayout();
            this.panel11.SuspendLayout();
            this.panel10.SuspendLayout();
            this.panel9.SuspendLayout();
            this.panel7.SuspendLayout();
            this.panel6.SuspendLayout();
            this.panel5.SuspendLayout();
            this.panel4.SuspendLayout();
            this.panel3.SuspendLayout();
            this.panel8.SuspendLayout();
            this.mainToolbar.SuspendLayout();
            this.SuspendLayout();
            //
            // openFileDialog1
            //
            this.openFileDialog1.DefaultExt = "xls";
            this.openFileDialog1.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm|Excel 97/2003|*.xls|Excel 2007|*.xlsx;*.xlsm|All " +
    "files|*.*";
            this.openFileDialog1.Title = "Open an Excel File";
            //
            // panel1
            //
            this.panel1.BackColor = System.Drawing.Color.White;
            this.panel1.Controls.Add(this.cbReplaceFonts);
            this.panel1.Controls.Add(this.panel13);
            this.panel1.Controls.Add(this.panel12);
            this.panel1.Controls.Add(this.panel11);
            this.panel1.Controls.Add(this.panel10);
            this.panel1.Controls.Add(this.panel9);
            this.panel1.Controls.Add(this.panel7);
            this.panel1.Controls.Add(this.panel6);
            this.panel1.Controls.Add(this.panel5);
            this.panel1.Controls.Add(this.panel4);
            this.panel1.Controls.Add(this.panel3);
            this.panel1.Controls.Add(this.label1);
            this.panel1.Controls.Add(this.panel8);
            this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
            this.panel1.Location = new System.Drawing.Point(0, 0);
            this.panel1.Name = "panel1";
            this.panel1.Size = new System.Drawing.Size(768, 696);
            this.panel1.TabIndex = 3;
            //
            // cbReplaceFonts
            //
            this.cbReplaceFonts.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.cbReplaceFonts.Location = new System.Drawing.Point(40, 634);
            this.cbReplaceFonts.Name = "cbReplaceFonts";
            this.cbReplaceFonts.Size = new System.Drawing.Size(632, 24);
            this.cbReplaceFonts.TabIndex = 50;
            this.cbReplaceFonts.Text = "Replace all fonts with Arial";
            //
            // panel13
            //
            this.panel13.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
            | System.Windows.Forms.AnchorStyles.Right)));
            this.panel13.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
            this.panel13.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.panel13.Controls.Add(this.edBodyStart);
            this.panel13.Controls.Add(this.label10);
            this.panel13.Location = new System.Drawing.Point(32, 562);
            this.panel13.Name = "panel13";
            this.panel13.Size = new System.Drawing.Size(704, 64);
            this.panel13.TabIndex = 49;
            //
            // edBodyStart
            //
            this.edBodyStart.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
            | System.Windows.Forms.AnchorStyles.Right)));
            this.edBodyStart.Location = new System.Drawing.Point(16, 32);
            this.edBodyStart.Name = "edBodyStart";
            this.edBodyStart.Size = new System.Drawing.Size(664, 20);
            this.edBodyStart.TabIndex = 20;
            this.edBodyStart.Text = "<h1>Created with FlexCel</h1>";
            //
            // label10
            //
            this.label10.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label10.Location = new System.Drawing.Point(8, 8);
            this.label10.Name = "label10";
            this.label10.Size = new System.Drawing.Size(584, 16);
            this.label10.TabIndex = 19;
            this.label10.Text = "Text to add at the beginning of the file:";
            //
            // panel12
            //
            this.panel12.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
            | System.Windows.Forms.AnchorStyles.Right)));
            this.panel12.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
            this.panel12.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.panel12.Controls.Add(this.cbCss);
            this.panel12.Controls.Add(this.edCss);
            this.panel12.Location = new System.Drawing.Point(32, 490);
            this.panel12.Name = "panel12";
            this.panel12.Size = new System.Drawing.Size(704, 64);
            this.panel12.TabIndex = 48;
            //
            // cbCss
            //
            this.cbCss.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.cbCss.Location = new System.Drawing.Point(16, 8);
            this.cbCss.Name = "cbCss";
            this.cbCss.Size = new System.Drawing.Size(632, 24);
            this.cbCss.TabIndex = 21;
            this.cbCss.Text = "Save CSS to an external file (path relative to where the html file is)";
            this.cbCss.CheckedChanged += new System.EventHandler(this.cbCss_CheckedChanged);
            //
            // edCss
            //
            this.edCss.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
            | System.Windows.Forms.AnchorStyles.Right)));
            this.edCss.Enabled = false;
            this.edCss.Location = new System.Drawing.Point(16, 32);
            this.edCss.Name = "edCss";
            this.edCss.Size = new System.Drawing.Size(664, 20);
            this.edCss.TabIndex = 20;
            this.edCss.Text = "css\\test.css";
            //
            // panel11
            //
            this.panel11.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
            | System.Windows.Forms.AnchorStyles.Right)));
            this.panel11.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
            this.panel11.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.panel11.Controls.Add(this.edImages);
            this.panel11.Controls.Add(this.label8);
            this.panel11.Location = new System.Drawing.Point(32, 418);
            this.panel11.Name = "panel11";
            this.panel11.Size = new System.Drawing.Size(704, 64);
            this.panel11.TabIndex = 47;
            //
            // edImages
            //
            this.edImages.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
            | System.Windows.Forms.AnchorStyles.Right)));
            this.edImages.Location = new System.Drawing.Point(16, 32);
            this.edImages.Name = "edImages";
            this.edImages.Size = new System.Drawing.Size(664, 20);
            this.edImages.TabIndex = 20;
            this.edImages.Text = "images";
            //
            // label8
            //
            this.label8.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label8.Location = new System.Drawing.Point(8, 8);
            this.label8.Name = "label8";
            this.label8.Size = new System.Drawing.Size(584, 16);
            this.label8.TabIndex = 19;
            this.label8.Text = "Relative path for images (make it empty to save the images in the same folder as " +
    "the html file)";
            //
            // panel10
            //
            this.panel10.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
            | System.Windows.Forms.AnchorStyles.Right)));
            this.panel10.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
            this.panel10.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.panel10.Controls.Add(this.edSheetSeparator);
            this.panel10.Controls.Add(this.label7);
            this.panel10.Location = new System.Drawing.Point(224, 338);
            this.panel10.Name = "panel10";
            this.panel10.Size = new System.Drawing.Size(512, 72);
            this.panel10.TabIndex = 46;
            //
            // edSheetSeparator
            //
            this.edSheetSeparator.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
            | System.Windows.Forms.AnchorStyles.Right)));
            this.edSheetSeparator.Location = new System.Drawing.Point(16, 32);
            this.edSheetSeparator.Name = "edSheetSeparator";
            this.edSheetSeparator.Size = new System.Drawing.Size(472, 20);
            this.edSheetSeparator.TabIndex = 20;
            this.edSheetSeparator.Text = "<p><hr />Sheet <#SheetName>  (<#SheetPos> of <#SheetCount>)";
            //
            // label7
            //
            this.label7.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label7.Location = new System.Drawing.Point(8, 8);
            this.label7.Name = "label7";
            this.label7.Size = new System.Drawing.Size(480, 16);
            this.label7.TabIndex = 19;
            this.label7.Text = "Sheet separator (When exporting all sheets in one file)";
            //
            // panel9
            //
            this.panel9.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
            this.panel9.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.panel9.Controls.Add(this.cbBottom);
            this.panel9.Controls.Add(this.cbRight);
            this.panel9.Controls.Add(this.cbLeft);
            this.panel9.Controls.Add(this.cbTop);
            this.panel9.Controls.Add(this.label3);
            this.panel9.Location = new System.Drawing.Point(224, 266);
            this.panel9.Name = "panel9";
            this.panel9.Size = new System.Drawing.Size(288, 64);
            this.panel9.TabIndex = 45;
            //
            // cbBottom
            //
            this.cbBottom.Location = new System.Drawing.Point(216, 32);
            this.cbBottom.Name = "cbBottom";
            this.cbBottom.Size = new System.Drawing.Size(64, 16);
            this.cbBottom.TabIndex = 23;
            this.cbBottom.Text = "Bottom";
            //
            // cbRight
            //
            this.cbRight.Location = new System.Drawing.Point(144, 32);
            this.cbRight.Name = "cbRight";
            this.cbRight.Size = new System.Drawing.Size(64, 16);
            this.cbRight.TabIndex = 22;
            this.cbRight.Text = "Right";
            //
            // cbLeft
            //
            this.cbLeft.Location = new System.Drawing.Point(24, 32);
            this.cbLeft.Name = "cbLeft";
            this.cbLeft.Size = new System.Drawing.Size(48, 16);
            this.cbLeft.TabIndex = 21;
            this.cbLeft.Text = "Left";
            //
            // cbTop
            //
            this.cbTop.Checked = true;
            this.cbTop.CheckState = System.Windows.Forms.CheckState.Checked;
            this.cbTop.Location = new System.Drawing.Point(88, 32);
            this.cbTop.Name = "cbTop";
            this.cbTop.Size = new System.Drawing.Size(48, 16);
            this.cbTop.TabIndex = 20;
            this.cbTop.Text = "Top";
            //
            // label3
            //
            this.label3.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label3.Location = new System.Drawing.Point(8, 8);
            this.label3.Name = "label3";
            this.label3.Size = new System.Drawing.Size(192, 16);
            this.label3.TabIndex = 19;
            this.label3.Text = "Tabs:";
            //
            // panel7
            //
            this.panel7.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
            | System.Windows.Forms.AnchorStyles.Right)));
            this.panel7.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
            this.panel7.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.panel7.Controls.Add(this.cbExportObject);
            this.panel7.Controls.Add(this.lblSheetToExport);
            this.panel7.Controls.Add(this.cbSheet);
            this.panel7.Controls.Add(this.label2);
            this.panel7.Location = new System.Drawing.Point(32, 52);
            this.panel7.Name = "panel7";
            this.panel7.Size = new System.Drawing.Size(704, 72);
            this.panel7.TabIndex = 44;
            //
            // cbExportObject
            //
            this.cbExportObject.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.cbExportObject.Items.AddRange(new object[] {
            "All sheets as Tabs",
            "All sheets as a single file",
            "Active Sheet:"});
            this.cbExportObject.Location = new System.Drawing.Point(8, 32);
            this.cbExportObject.Name = "cbExportObject";
            this.cbExportObject.Size = new System.Drawing.Size(248, 21);
            this.cbExportObject.TabIndex = 46;
            this.cbExportObject.SelectedIndexChanged += new System.EventHandler(this.cbExportObject_SelectedIndexChanged);
            //
            // lblSheetToExport
            //
            this.lblSheetToExport.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.lblSheetToExport.Location = new System.Drawing.Point(304, 8);
            this.lblSheetToExport.Name = "lblSheetToExport";
            this.lblSheetToExport.Size = new System.Drawing.Size(96, 16);
            this.lblSheetToExport.TabIndex = 45;
            this.lblSheetToExport.Text = "Sheet to export:";
            //
            // cbSheet
            //
            this.cbSheet.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
            | System.Windows.Forms.AnchorStyles.Right)));
            this.cbSheet.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.cbSheet.Location = new System.Drawing.Point(304, 32);
            this.cbSheet.Name = "cbSheet";
            this.cbSheet.Size = new System.Drawing.Size(360, 21);
            this.cbSheet.TabIndex = 44;
            //
            // label2
            //
            this.label2.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label2.Location = new System.Drawing.Point(8, 8);
            this.label2.Name = "label2";
            this.label2.Size = new System.Drawing.Size(192, 16);
            this.label2.TabIndex = 19;
            this.label2.Text = "What to Export:";
            //
            // panel6
            //
            this.panel6.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
            this.panel6.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.panel6.Controls.Add(this.cbHeadersFooters);
            this.panel6.Controls.Add(this.cbImages);
            this.panel6.Controls.Add(this.cbHyperlinks);
            this.panel6.Controls.Add(this.cbComments);
            this.panel6.Controls.Add(this.label6);
            this.panel6.Location = new System.Drawing.Point(32, 226);
            this.panel6.Name = "panel6";
            this.panel6.Size = new System.Drawing.Size(176, 104);
            this.panel6.TabIndex = 42;
            //
            // cbHeadersFooters
            //
            this.cbHeadersFooters.Location = new System.Drawing.Point(96, 40);
            this.cbHeadersFooters.Name = "cbHeadersFooters";
            this.cbHeadersFooters.Size = new System.Drawing.Size(72, 44);
            this.cbHeadersFooters.TabIndex = 23;
            this.cbHeadersFooters.Text = "Headers / Footers";
            //
            // cbImages
            //
            this.cbImages.Checked = true;
            this.cbImages.CheckState = System.Windows.Forms.CheckState.Checked;
            this.cbImages.Location = new System.Drawing.Point(16, 32);
            this.cbImages.Name = "cbImages";
            this.cbImages.Size = new System.Drawing.Size(72, 24);
            this.cbImages.TabIndex = 22;
            this.cbImages.Text = "Images";
            //
            // cbHyperlinks
            //
            this.cbHyperlinks.Checked = true;
            this.cbHyperlinks.CheckState = System.Windows.Forms.CheckState.Checked;
            this.cbHyperlinks.Location = new System.Drawing.Point(16, 80);
            this.cbHyperlinks.Name = "cbHyperlinks";
            this.cbHyperlinks.Size = new System.Drawing.Size(80, 24);
            this.cbHyperlinks.TabIndex = 21;
            this.cbHyperlinks.Text = "HyperLinks";
            //
            // cbComments
            //
            this.cbComments.Checked = true;
            this.cbComments.CheckState = System.Windows.Forms.CheckState.Checked;
            this.cbComments.Location = new System.Drawing.Point(16, 56);
            this.cbComments.Name = "cbComments";
            this.cbComments.Size = new System.Drawing.Size(80, 24);
            this.cbComments.TabIndex = 20;
            this.cbComments.Text = "Comments";
            //
            // label6
            //
            this.label6.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label6.Location = new System.Drawing.Point(8, 16);
            this.label6.Name = "label6";
            this.label6.Size = new System.Drawing.Size(192, 16);
            this.label6.TabIndex = 19;
            this.label6.Text = "Objects to Export:";
            //
            // panel5
            //
            this.panel5.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
            this.panel5.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.panel5.Controls.Add(this.cbIe6Png);
            this.panel5.Controls.Add(this.label5);
            this.panel5.Controls.Add(this.cbOutlook2007);
            this.panel5.Location = new System.Drawing.Point(32, 338);
            this.panel5.Name = "panel5";
            this.panel5.Size = new System.Drawing.Size(176, 72);
            this.panel5.TabIndex = 41;
            //
            // cbIe6Png
            //
            this.cbIe6Png.Location = new System.Drawing.Point(16, 40);
            this.cbIe6Png.Name = "cbIe6Png";
            this.cbIe6Png.Size = new System.Drawing.Size(153, 24);
            this.cbIe6Png.TabIndex = 20;
            this.cbIe6Png.Text = "Fix for IE6 support";
            //
            // label5
            //
            this.label5.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label5.Location = new System.Drawing.Point(8, 8);
            this.label5.Name = "label5";
            this.label5.Size = new System.Drawing.Size(192, 16);
            this.label5.TabIndex = 19;
            this.label5.Text = "Browser Fixes";
            //
            // cbOutlook2007
            //
            this.cbOutlook2007.Location = new System.Drawing.Point(16, 24);
            this.cbOutlook2007.Name = "cbOutlook2007";
            this.cbOutlook2007.Size = new System.Drawing.Size(128, 16);
            this.cbOutlook2007.TabIndex = 16;
            this.cbOutlook2007.Text = "Fix for Outlook2007";
            //
            // panel4
            //
            this.panel4.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
            this.panel4.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.panel4.Controls.Add(this.cbEmbedImages);
            this.panel4.Controls.Add(this.sbSVG);
            this.panel4.Controls.Add(this.label9);
            this.panel4.Controls.Add(this.cbFileFormat);
            this.panel4.Controls.Add(this.cbHtmlVersion);
            this.panel4.Controls.Add(this.label4);
            this.panel4.Location = new System.Drawing.Point(224, 130);
            this.panel4.Name = "panel4";
            this.panel4.Size = new System.Drawing.Size(288, 128);
            this.panel4.TabIndex = 40;
            //
            // cbEmbedImages
            //
            this.cbEmbedImages.Location = new System.Drawing.Point(8, 91);
            this.cbEmbedImages.Name = "cbEmbedImages";
            this.cbEmbedImages.Size = new System.Drawing.Size(128, 28);
            this.cbEmbedImages.TabIndex = 51;
            this.cbEmbedImages.Text = "Embed images";
            //
            // sbSVG
            //
            this.sbSVG.Location = new System.Drawing.Point(141, 91);
            this.sbSVG.Name = "sbSVG";
            this.sbSVG.Size = new System.Drawing.Size(139, 28);
            this.sbSVG.TabIndex = 50;
            this.sbSVG.Text = "Export images as SVG";
            //
            // label9
            //
            this.label9.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label9.Location = new System.Drawing.Point(8, 8);
            this.label9.Name = "label9";
            this.label9.Size = new System.Drawing.Size(192, 16);
            this.label9.TabIndex = 49;
            this.label9.Text = "HTML Version";
            //
            // cbFileFormat
            //
            this.cbFileFormat.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.cbFileFormat.Items.AddRange(new object[] {
            "HTML",
            "MHTML"});
            this.cbFileFormat.Location = new System.Drawing.Point(8, 64);
            this.cbFileFormat.Name = "cbFileFormat";
            this.cbFileFormat.Size = new System.Drawing.Size(272, 21);
            this.cbFileFormat.TabIndex = 48;
            //
            // cbHtmlVersion
            //
            this.cbHtmlVersion.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.cbHtmlVersion.Items.AddRange(new object[] {
            "HTML 3.2",
            "HTML 4.01",
            "XHTML 1.1",
            "HTML 5"});
            this.cbHtmlVersion.Location = new System.Drawing.Point(8, 24);
            this.cbHtmlVersion.Name = "cbHtmlVersion";
            this.cbHtmlVersion.Size = new System.Drawing.Size(272, 21);
            this.cbHtmlVersion.TabIndex = 47;
            //
            // label4
            //
            this.label4.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label4.Location = new System.Drawing.Point(5, 48);
            this.label4.Name = "label4";
            this.label4.Size = new System.Drawing.Size(192, 16);
            this.label4.TabIndex = 19;
            this.label4.Text = "File Format:";
            //
            // panel3
            //
            this.panel3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.panel3.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
            this.panel3.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.panel3.Controls.Add(this.edBottom);
            this.panel3.Controls.Add(this.label17);
            this.panel3.Controls.Add(this.edRight);
            this.panel3.Controls.Add(this.label16);
            this.panel3.Controls.Add(this.edLeft);
            this.panel3.Controls.Add(this.label15);
            this.panel3.Controls.Add(this.edTop);
            this.panel3.Controls.Add(this.label14);
            this.panel3.Controls.Add(this.label13);
            this.panel3.Controls.Add(this.label12);
            this.panel3.Location = new System.Drawing.Point(528, 130);
            this.panel3.Name = "panel3";
            this.panel3.Size = new System.Drawing.Size(208, 200);
            this.panel3.TabIndex = 30;
            //
            // edBottom
            //
            this.edBottom.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.edBottom.Location = new System.Drawing.Point(80, 136);
            this.edBottom.Name = "edBottom";
            this.edBottom.Size = new System.Drawing.Size(48, 20);
            this.edBottom.TabIndex = 26;
            this.edBottom.Text = "0";
            //
            // label17
            //
            this.label17.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label17.Location = new System.Drawing.Point(16, 160);
            this.label17.Name = "label17";
            this.label17.Size = new System.Drawing.Size(56, 16);
            this.label17.TabIndex = 25;
            this.label17.Text = "Last Col:";
            //
            // edRight
            //
            this.edRight.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.edRight.Location = new System.Drawing.Point(80, 160);
            this.edRight.Name = "edRight";
            this.edRight.Size = new System.Drawing.Size(48, 20);
            this.edRight.TabIndex = 24;
            this.edRight.Text = "0";
            //
            // label16
            //
            this.label16.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label16.Location = new System.Drawing.Point(16, 136);
            this.label16.Name = "label16";
            this.label16.Size = new System.Drawing.Size(85, 16);
            this.label16.TabIndex = 23;
            this.label16.Text = "Last Row:";
            //
            // edLeft
            //
            this.edLeft.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.edLeft.Location = new System.Drawing.Point(80, 112);
            this.edLeft.Name = "edLeft";
            this.edLeft.Size = new System.Drawing.Size(48, 20);
            this.edLeft.TabIndex = 22;
            this.edLeft.Text = "0";
            //
            // label15
            //
            this.label15.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label15.Location = new System.Drawing.Point(16, 112);
            this.label15.Name = "label15";
            this.label15.Size = new System.Drawing.Size(85, 16);
            this.label15.TabIndex = 21;
            this.label15.Text = "First Col:";
            //
            // edTop
            //
            this.edTop.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.edTop.Location = new System.Drawing.Point(80, 88);
            this.edTop.Name = "edTop";
            this.edTop.Size = new System.Drawing.Size(48, 20);
            this.edTop.TabIndex = 20;
            this.edTop.Text = "0";
            //
            // label14
            //
            this.label14.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label14.Location = new System.Drawing.Point(16, 88);
            this.label14.Name = "label14";
            this.label14.Size = new System.Drawing.Size(85, 16);
            this.label14.TabIndex = 3;
            this.label14.Text = "First Row:";
            //
            // label13
            //
            this.label13.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
            | System.Windows.Forms.AnchorStyles.Right)));
            this.label13.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label13.Location = new System.Drawing.Point(8, 32);
            this.label13.Name = "label13";
            this.label13.Size = new System.Drawing.Size(184, 32);
            this.label13.TabIndex = 2;
            this.label13.Text = "If any value is <=0 all print_range will be printed";
            //
            // label12
            //
            this.label12.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label12.Location = new System.Drawing.Point(8, 16);
            this.label12.Name = "label12";
            this.label12.Size = new System.Drawing.Size(192, 16);
            this.label12.TabIndex = 1;
            this.label12.Text = "Range to Export:";
            //
            // label1
            //
            this.label1.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label1.Location = new System.Drawing.Point(40, 16);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(80, 16);
            this.label1.TabIndex = 0;
            this.label1.Text = "File to export:";
            //
            // panel8
            //
            this.panel8.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
            this.panel8.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.panel8.Controls.Add(this.chPrintHeadings);
            this.panel8.Controls.Add(this.label24);
            this.panel8.Controls.Add(this.chFormulaText);
            this.panel8.Controls.Add(this.chGridLines);
            this.panel8.Location = new System.Drawing.Point(32, 130);
            this.panel8.Name = "panel8";
            this.panel8.Size = new System.Drawing.Size(176, 88);
            this.panel8.TabIndex = 37;
            //
            // chPrintHeadings
            //
            this.chPrintHeadings.Location = new System.Drawing.Point(16, 44);
            this.chPrintHeadings.Name = "chPrintHeadings";
            this.chPrintHeadings.Size = new System.Drawing.Size(144, 16);
            this.chPrintHeadings.TabIndex = 20;
            this.chPrintHeadings.Text = "Print Headings";
            //
            // label24
            //
            this.label24.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label24.Location = new System.Drawing.Point(8, 8);
            this.label24.Name = "label24";
            this.label24.Size = new System.Drawing.Size(192, 16);
            this.label24.TabIndex = 19;
            this.label24.Text = "Export Options:";
            //
            // chFormulaText
            //
            this.chFormulaText.Location = new System.Drawing.Point(16, 64);
            this.chFormulaText.Name = "chFormulaText";
            this.chFormulaText.Size = new System.Drawing.Size(136, 16);
            this.chFormulaText.TabIndex = 17;
            this.chFormulaText.Text = "Print Formula Text";
            //
            // chGridLines
            //
            this.chGridLines.Location = new System.Drawing.Point(16, 24);
            this.chGridLines.Name = "chGridLines";
            this.chGridLines.Size = new System.Drawing.Size(128, 16);
            this.chGridLines.TabIndex = 16;
            this.chGridLines.Text = "Print Grid Lines";
            //
            // checkBox4
            //
            this.checkBox4.Location = new System.Drawing.Point(0, 0);
            this.checkBox4.Name = "checkBox4";
            this.checkBox4.Size = new System.Drawing.Size(104, 24);
            this.checkBox4.TabIndex = 0;
            //
            // exportDialog
            //
            this.exportDialog.DefaultExt = "htm";
            this.exportDialog.Filter = "HTML files|*.htm|MHTML files|*.mht";
            //
            // flexCelHtmlExport1
            //
            this.flexCelHtmlExport1.HeadingWidth = 50D;
            this.flexCelHtmlExport1.ImageResolution = 96D;
            this.flexCelHtmlExport1.UsePrintScale = false;
            this.flexCelHtmlExport1.Workbook = null;
            this.flexCelHtmlExport1.HtmlFont += new FlexCel.Core.HtmlFontEventHandler(this.flexCelHtmlExport1_HtmlFont);
            //
            // mainToolbar
            //
            this.mainToolbar.ImageScalingSize = new System.Drawing.Size(24, 24);
            this.mainToolbar.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.openFile,
            this.export,
            this.btnEmail,
            this.toolStripSeparator1,
            this.btnClose});
            this.mainToolbar.Location = new System.Drawing.Point(0, 0);
            this.mainToolbar.Name = "mainToolbar";
            this.mainToolbar.Size = new System.Drawing.Size(768, 31);
            this.mainToolbar.TabIndex = 8;
            //
            // openFile
            //
            this.openFile.Image = ((System.Drawing.Image)(resources.GetObject("openFile.Image")));
            this.openFile.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.openFile.Name = "openFile";
            this.openFile.Size = new System.Drawing.Size(85, 28);
            this.openFile.Text = "Open File";
            this.openFile.Click += new System.EventHandler(this.openFile_Click);
            //
            // export
            //
            this.export.Image = ((System.Drawing.Image)(resources.GetObject("export.Image")));
            this.export.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.export.Name = "export";
            this.export.Size = new System.Drawing.Size(118, 28);
            this.export.Text = "Export as HTML";
            this.export.Click += new System.EventHandler(this.export_Click);
            //
            // btnEmail
            //
            this.btnEmail.Image = ((System.Drawing.Image)(resources.GetObject("btnEmail.Image")));
            this.btnEmail.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.btnEmail.Name = "btnEmail";
            this.btnEmail.Size = new System.Drawing.Size(133, 28);
            this.btnEmail.Text = "Email (as MHTML)";
            this.btnEmail.Click += new System.EventHandler(this.btnEmail_Click);
            //
            // toolStripSeparator1
            //
            this.toolStripSeparator1.Name = "toolStripSeparator1";
            this.toolStripSeparator1.Size = new System.Drawing.Size(6, 31);
            //
            // btnClose
            //
            this.btnClose.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right;
            this.btnClose.Image = ((System.Drawing.Image)(resources.GetObject("btnClose.Image")));
            this.btnClose.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.btnClose.Name = "btnClose";
            this.btnClose.Size = new System.Drawing.Size(53, 28);
            this.btnClose.Text = "Exit";
            this.btnClose.Click += new System.EventHandler(this.button2_Click);
            //
            // mainForm
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(768, 696);
            this.Controls.Add(this.mainToolbar);
            this.Controls.Add(this.panel1);
            this.Name = "mainForm";
            this.Text = "Export an Excel file to HTML";
            this.Load += new System.EventHandler(this.mainForm_Load);
            this.panel1.ResumeLayout(false);
            this.panel13.ResumeLayout(false);
            this.panel13.PerformLayout();
            this.panel12.ResumeLayout(false);
            this.panel12.PerformLayout();
            this.panel11.ResumeLayout(false);
            this.panel11.PerformLayout();
            this.panel10.ResumeLayout(false);
            this.panel10.PerformLayout();
            this.panel9.ResumeLayout(false);
            this.panel7.ResumeLayout(false);
            this.panel6.ResumeLayout(false);
            this.panel5.ResumeLayout(false);
            this.panel4.ResumeLayout(false);
            this.panel3.ResumeLayout(false);
            this.panel3.PerformLayout();
            this.panel8.ResumeLayout(false);
            this.mainToolbar.ResumeLayout(false);
            this.mainToolbar.PerformLayout();
            this.ResumeLayout(false);
            this.PerformLayout();

        }
        #endregion

        private ToolStrip mainToolbar;
        private ToolStripButton openFile;
        private ToolStripButton export;
        private ToolStripButton btnEmail;
        private ToolStripSeparator toolStripSeparator1;
        private ToolStripButton btnClose;
        private CheckBox sbSVG;
        private CheckBox cbEmbedImages;
    }
}

Mailform.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;

using FlexCel.Core;
using System.Text;

namespace ExportHTML
{
    /// <summary>
    /// Used for mailing.
    /// </summary>
    public partial class Mailform: System.Windows.Forms.Form
    {
        private string OriginalTo;
        private string OriginalFrom;
        private string OriginalServer;

        public Mailform()
        {
            InitializeComponent();

            OriginalTo = edTo.Text;
            OriginalFrom = edFrom.Text;
            OriginalServer = edOutServer.Text;
        }

        public mainForm MainForm;

        private bool ValidateFields()
        {
            if (OriginalTo == edTo.Text)
            {
                MessageBox.Show("Please change the 'TO' field to the user you want to send the email");
                edTo.Focus();
                return false;
            }

            if (OriginalFrom == edFrom.Text)
            {
                MessageBox.Show("Please change the 'From' field to the user you are using to send the email");
                edFrom.Focus();
                return false;
            }

            if (OriginalServer == edOutServer.Text)
            {
                MessageBox.Show("Please change the 'Outgoing Mail Server' field to the pop3 server you will use to send the email.");
                edOutServer.Focus();
                return false;
            }

            return true;

        }

        private void btnEmail_Click(object sender, System.EventArgs e)
        {
            if (!ValidateFields()) return;

            if (MessageBox.Show("Now we will try to send the email using the server '" + edOutServer.Text + "'\n" +
                "Note that this is a very simple implementation, and it will not work if the SMTP server needs to login.\n" +
                "For this to work, you need a mail server that authenticates when reading the email, and then login into your normal account with your normal mail reader.\n\n" +
                "If you need to authenticate in order to send mail, you will need to modify this code.",
                "Information", MessageBoxButtons.OKCancel, MessageBoxIcon.Information) != DialogResult.OK) return;

            SimpleMailer Mailer = new SimpleMailer();

            Mailer.FromAddress = edFrom.Text;
            Mailer.ToAddress = edTo.Text;
            Mailer.Subject = edSubject.Text;
            Mailer.HostName = edOutServer.Text;
            Mailer.Port = 25;

            try
            {
                Mailer.SendMail(MainForm.GenerateMHTML());
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error trying to send the message: " + ex.Message);
                return;
            }

            MessageBox.Show("Message has been sent. Please verify your JUNK folder or any filters, since it might be filtered as spam");
            Close();
        }

        private void edFrom_Leave(object sender, System.EventArgs e)
        {
            if (OriginalTo == edTo.Text && OriginalFrom != edFrom.Text)
            {
                edTo.Text = edFrom.Text;
            }
            FillServer();
        }

        private void FillServer()
        {
            if (OriginalServer == edOutServer.Text && OriginalFrom != edFrom.Text)
            {
                int AtPos = edFrom.Text.IndexOf("@");
                if (AtPos > 0)
                {
                    string Server = edFrom.Text.Substring(AtPos + 1);
                    edOutServer.Text = "mail." + Server;
                }
            }
        }
        private void edTo_Leave(object sender, System.EventArgs e)
        {
            if (OriginalFrom == edFrom.Text && OriginalTo != edTo.Text)
            {
                edFrom.Text = edTo.Text;
            }
            FillServer();

        }

    }
}

Mailform.Designer.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using FlexCel.Core;
using System.Text;
namespace ExportHTML
{
    public partial class Mailform: System.Windows.Forms.Form
    {

        private System.Windows.Forms.Button btnEmail;
        private System.Windows.Forms.TextBox edOutServer;
        private System.Windows.Forms.Label label2;
        private System.Windows.Forms.TextBox edTo;
        private System.Windows.Forms.Label label3;
        private System.Windows.Forms.TextBox edFrom;
        private System.Windows.Forms.Label label4;
        private System.Windows.Forms.TextBox edSubject;
        private System.Windows.Forms.Label label5;
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.Container components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Mailform));
            this.btnEmail = new System.Windows.Forms.Button();
            this.edOutServer = new System.Windows.Forms.TextBox();
            this.label2 = new System.Windows.Forms.Label();
            this.edTo = new System.Windows.Forms.TextBox();
            this.label3 = new System.Windows.Forms.Label();
            this.edFrom = new System.Windows.Forms.TextBox();
            this.label4 = new System.Windows.Forms.Label();
            this.edSubject = new System.Windows.Forms.TextBox();
            this.label5 = new System.Windows.Forms.Label();
            this.SuspendLayout();
            //
            // btnEmail
            //
            this.btnEmail.BackColor = System.Drawing.SystemColors.Control;
            this.btnEmail.Image = ((System.Drawing.Image)(resources.GetObject("btnEmail.Image")));
            this.btnEmail.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
            this.btnEmail.Location = new System.Drawing.Point(200, 200);
            this.btnEmail.Name = "btnEmail";
            this.btnEmail.Size = new System.Drawing.Size(70, 30);
            this.btnEmail.TabIndex = 4;
            this.btnEmail.Text = "e-mail!";
            this.btnEmail.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            this.btnEmail.UseVisualStyleBackColor = false;
            this.btnEmail.Click += new System.EventHandler(this.btnEmail_Click);
            //
            // edOutServer
            //
            this.edOutServer.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
            | System.Windows.Forms.AnchorStyles.Right)));
            this.edOutServer.Location = new System.Drawing.Point(136, 144);
            this.edOutServer.Name = "edOutServer";
            this.edOutServer.Size = new System.Drawing.Size(304, 20);
            this.edOutServer.TabIndex = 3;
            this.edOutServer.Text = "pop.mycompany.com";
            //
            // label2
            //
            this.label2.Location = new System.Drawing.Point(8, 152);
            this.label2.Name = "label2";
            this.label2.Size = new System.Drawing.Size(128, 16);
            this.label2.TabIndex = 10;
            this.label2.Text = "Outgoing Mail Server:";
            //
            // edTo
            //
            this.edTo.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
            | System.Windows.Forms.AnchorStyles.Right)));
            this.edTo.Location = new System.Drawing.Point(136, 40);
            this.edTo.Name = "edTo";
            this.edTo.Size = new System.Drawing.Size(304, 20);
            this.edTo.TabIndex = 1;
            this.edTo.Text = "user@hiscompany.com";
            this.edTo.Leave += new System.EventHandler(this.edTo_Leave);
            //
            // label3
            //
            this.label3.Location = new System.Drawing.Point(16, 40);
            this.label3.Name = "label3";
            this.label3.Size = new System.Drawing.Size(128, 16);
            this.label3.TabIndex = 14;
            this.label3.Text = "To:";
            //
            // edFrom
            //
            this.edFrom.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
            | System.Windows.Forms.AnchorStyles.Right)));
            this.edFrom.Location = new System.Drawing.Point(136, 8);
            this.edFrom.Name = "edFrom";
            this.edFrom.Size = new System.Drawing.Size(304, 20);
            this.edFrom.TabIndex = 0;
            this.edFrom.Text = "myname@mycompany.com";
            this.edFrom.Leave += new System.EventHandler(this.edFrom_Leave);
            //
            // label4
            //
            this.label4.Location = new System.Drawing.Point(16, 16);
            this.label4.Name = "label4";
            this.label4.Size = new System.Drawing.Size(120, 16);
            this.label4.TabIndex = 12;
            this.label4.Text = "From:";
            //
            // edSubject
            //
            this.edSubject.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
            | System.Windows.Forms.AnchorStyles.Right)));
            this.edSubject.Location = new System.Drawing.Point(136, 80);
            this.edSubject.Name = "edSubject";
            this.edSubject.Size = new System.Drawing.Size(304, 20);
            this.edSubject.TabIndex = 2;
            this.edSubject.Text = "A test from FlexCel";
            //
            // label5
            //
            this.label5.Location = new System.Drawing.Point(16, 80);
            this.label5.Name = "label5";
            this.label5.Size = new System.Drawing.Size(128, 16);
            this.label5.TabIndex = 16;
            this.label5.Text = "Subject:";
            //
            // Mailform
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(472, 246);
            this.Controls.Add(this.edSubject);
            this.Controls.Add(this.edTo);
            this.Controls.Add(this.edFrom);
            this.Controls.Add(this.edOutServer);
            this.Controls.Add(this.label5);
            this.Controls.Add(this.label3);
            this.Controls.Add(this.label4);
            this.Controls.Add(this.label2);
            this.Controls.Add(this.btnEmail);
            this.Name = "Mailform";
            this.ShowInTaskbar = false;
            this.Text = "Send email...";
            this.ResumeLayout(false);
            this.PerformLayout();

        }
        #endregion
    }
}

Program.cs

using System;
using System.Windows.Forms;

namespace ExportHTML
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new mainForm());
        }
    }
}

SimpleMailer.cs

using System;
using System.Net.Sockets;
using System.IO;
using System.Threading;

using System.Globalization;
using System.Text;

namespace ExportHTML
{
    /// <summary>
    /// IMPORTANT: This is a really simple SMTP implementation, and it is not indented to be used in production.
    /// It is just mean to be use on this simple demo, as we cannot use third party solutions here.
    /// You are advised to get a third party solution if you want to implement this in your application.
    /// This code is based directly in RFC 2821: http://www.faqs.org/rfcs/rfc2821.html
    /// </summary>
    public class SimpleMailer
    {
        #region privates
        private string FHostName;
        private int FPort;

        private string FToAddress;
        private string FFromAddress;
        private string FSubject;
        #endregion

        #region Public properties
        public string HostName { get { return FHostName; } set { FHostName = value; } }
        public int Port { get { return FPort; } set { FPort = value; } }
        public string ToAddress { get { return FToAddress; } set { FToAddress = value; } }
        public string FromAddress { get { return FFromAddress; } set { FFromAddress = value; } }
        public string Subject { get { return FSubject; } set { FSubject = value; } }
        #endregion

        public SimpleMailer()
        {
            Port = 25;
        }

        public void SendMail(byte[] MessageData)
        {
            using (TcpClient Tcp = new TcpClient(HostName, Port))
            {
                using (NetworkStream Channel = Tcp.GetStream())
                {
                    try
                    {
                        WaitForAnswer(Channel, 220);
                        WriteCommand(Channel, "EHLO " + HostName);
                        WaitForAnswer(Channel, 250);

                        WriteCommand(Channel, "MAIL FROM:<" + FromAddress + ">");
                        WaitForAnswer(Channel, 250);
                        WriteCommand(Channel, "RCPT TO:<" + ToAddress + ">");
                        WaitForAnswer(Channel, 250);

                        WriteCommand(Channel, "DATA");
                        WaitForAnswer(Channel, 354);
                        SendMessage(Channel, MessageData);
                        WaitForAnswer(Channel, 250);
                    }

                    catch (SimpleMailerException)
                    {
                        //Quit must always be performed.
                        WriteCommand(Channel, "QUIT");
                        WaitForAnswer(Channel, 221);
                        return;
                    }

                    WriteCommand(Channel, "QUIT");
                    WaitForAnswer(Channel, 221);

                }
            }
        }

        public void WaitForAnswer(NetworkStream Channel, int AnswerCode)
        {
            byte[] ReadBuffer = new byte[1024];
            String Message = "";
            int numberOfBytesRead = 0;

            // Incoming message may be larger than the buffer size.
            do
            {
                numberOfBytesRead = Channel.Read(ReadBuffer, 0, ReadBuffer.Length);
                Message += Encoding.ASCII.GetString(ReadBuffer, 0, numberOfBytesRead);
            }
            while (Channel.DataAvailable);

            if (Message.StartsWith(AnswerCode.ToString(CultureInfo.InvariantCulture))) return;

            throw new SimpleMailerException("Error sending email. Answer from the server: " + Message);
        }

        public void WriteCommand(NetworkStream Channel, string Command)
        {
            byte[] WriteBuffer = Encoding.ASCII.GetBytes(Command + "\r\n"); //do not use Environment.NewLine here, since this is invariant and defined in the RFC
            Channel.Write(WriteBuffer, 0, WriteBuffer.Length);
        }

        public void SendMessage(NetworkStream Channel, byte[] MessageData)
        {
            WriteCommand(Channel, "From: " + FromAddress);
            WriteCommand(Channel, "To: " + ToAddress);
            WriteCommand(Channel, "Subject: " + Subject);
            WriteCommand(Channel, "Date: " + DateTime.Now.ToUniversalTime().ToString("r", CultureInfo.InvariantCulture));

            WriteEscapedData(Channel, MessageData);
            WriteCommand(Channel, "\r\n."); //do not use Environment.NewLine here, since this is invariant and defined in the RFC
        }

        /// <summary>
        /// In order to send the data trough the channel, we need to detect any dot at the start of a line and replace it by ".."
        /// If not, it might be interpreted as an EOF sign. We can easily loop in the MessageData array, since it only contains ASCII characters, so there are no
        /// unicode colation issues.
        /// </summary>
        /// <param name="Channel"></param>
        /// <param name="MessageData"></param>
        public void WriteEscapedData(NetworkStream Channel, byte[] MessageData)
        {
            if (MessageData.Length > 0)
            {
                if (MessageData[0] == '.') Channel.WriteByte((byte)'.');
                Channel.WriteByte(MessageData[0]);
            }

            for (int i = 1; i < MessageData.Length; i++)
            {
                if (MessageData[i - 1] == '\n' && MessageData[i] == '.')
                {
                    Channel.WriteByte((byte)'.');
                }
                Channel.WriteByte(MessageData[i]);
            }
        }

    }

    public class SimpleMailerException: IOException
    {
        public SimpleMailerException(string Message) : base(Message)
        {

        }
    }
}


Exporting Excel files to SVG (C# / netframework) | FlexCel Studio for the .NET Framework documentation

Exporting Excel files to SVG (C# / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\csharp\VS2022\netframework\25.Printing and Exporting\42.Export SVG and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​csharp/​VS2022/​netframework/​Modules/​25.​Printing and Exporting/42.Export SVG

Overview

FlexCel can natively export an Excel file to SVG (Scalar Vector Graphics)

Concepts

  • When exporting to SVG you are going to get an image per page exported, so we use an action to notify the correct filename for each page.

Files

AssemblyInfo.cs

using System.Reflection;
using System.Runtime.CompilerServices;

//
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
//
[assembly: AssemblyTitle("")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("(c) 2002 - 2024 TMS Software")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

//
// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version
//      Build Number
//      Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:

[assembly: AssemblyVersion("7.21.0.0")]

//
// In order to sign your assembly you must specify a key to use. Refer to the
// Microsoft .NET Framework documentation for more information on assembly signing.
//
// Use the attributes below to control which key is used for signing.
//
// Notes:
//   (*) If no key is specified, the assembly is not signed.
//   (*) KeyName refers to a key that has been installed in the Crypto Service
//       Provider (CSP) on your machine. KeyFile refers to a file which contains
//       a key.
//   (*) If the KeyFile and the KeyName values are both specified, the
//       following processing occurs:
//       (1) If the KeyName can be found in the CSP, that key is used.
//       (2) If the KeyName does not exist and the KeyFile does exist, the key
//           in the KeyFile is installed into the CSP and used.
//   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
//       When specifying the KeyFile, the location of the KeyFile should be
//       relative to the project output directory which is
//       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
//       located in the project directory, you would specify the AssemblyKeyFile
//       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
//   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
//       documentation for more information on this.
//
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]
[assembly: AssemblyKeyName("")]

Form1.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using FlexCel.Render;
using System.IO;
using System.Diagnostics;

using System.Text;

namespace ExportSVG
{
    /// <summary>
    /// An Example on how to export to SVG.
    /// </summary>
    public partial class mainForm: System.Windows.Forms.Form
    {
        private FlexCelSVGExport SVG = new FlexCelSVGExport();
        public mainForm()
        {
            InitializeComponent();
            ResizeToolbar(mainToolbar);
        }

        private void ResizeToolbar(ToolStrip toolbar)
        {

            using (Graphics gr = CreateGraphics())
            {
                double xFactor = gr.DpiX / 96.0;
                double yFactor = gr.DpiY / 96.0;
                toolbar.ImageScalingSize = new Size((int)(24 * xFactor), (int)(24 * yFactor));
                toolbar.Width = 0; //force a recalc of the buttons.
            }
        }

        private void btnClose_Click(object sender, System.EventArgs e)
        {
            Close();
        }

        private void LoadSheetConfig()
        {
            ExcelFile Xls = SVG.Workbook;

            chGridLines.Checked = Xls.PrintGridLines;
            chPrintHeadings.Checked = Xls.PrintHeadings;
            chFormulaText.Checked = Xls.ShowFormulaText;
        }

        private void openFile_Click(object sender, System.EventArgs e)
        {
            if (openFileDialog1.ShowDialog() != DialogResult.OK) return;
            SVG.Workbook = new XlsFile();

            SVG.Workbook.Open(openFileDialog1.FileName);

            Text = "Export: " + openFileDialog1.FileName;

            ExcelFile Xls = SVG.Workbook;

            cbSheet.Items.Clear();
            for (int i = 1; i <= Xls.SheetCount; i++)
            {
                cbSheet.Items.Add(Xls.GetSheetName(i));
            }
            cbSheet.SelectedIndex = Xls.ActiveSheet - 1;

            LoadSheetConfig();
        }

        private bool CheckFileOpen()
        {
            if (SVG.Workbook == null)
            {
                MessageBox.Show("You need to open a file first.");
                return false;
            }
            return true;
        }

        private bool LoadPreferences()
        {
            //NOTE: THERE SHOULD BE *A LOT* MORE VALIDATION OF VALUES ON THIS METHOD. (For example, validate that margins are between bounds)
            // As this is a simple demo, they are not included.
            try
            {
                ExcelFile Xls = SVG.Workbook;

                //Note: In this demo we will only apply this things to the active sheet.
                //If you want to apply the settings to all the sheets, you should loop in the sheets and change them here.
                Xls.PrintGridLines = chGridLines.Checked;
                Xls.PrintHeadings = chPrintHeadings.Checked;
                Xls.ShowFormulaText = chFormulaText.Checked;

                SVG.PrintRangeLeft = Convert.ToInt32(edLeft.Text);
                SVG.PrintRangeTop = Convert.ToInt32(edTop.Text);
                SVG.PrintRangeRight = Convert.ToInt32(edRight.Text);
                SVG.PrintRangeBottom = Convert.ToInt32(edBottom.Text);

                SVG.HidePrintObjects = THidePrintObjects.None;
                if (!cbImages.Checked) SVG.HidePrintObjects |= THidePrintObjects.Images;
                if (!cbHyperlinks.Checked) SVG.HidePrintObjects |= THidePrintObjects.Hyperlynks;
                if (!cbComments.Checked) SVG.HidePrintObjects |= THidePrintObjects.Comments;
                if (!cbHeadersFooters.Checked) SVG.HidePrintObjects |= THidePrintObjects.HeadersAndFooters;

            }
            catch (Exception e)
            {
                MessageBox.Show("Error: " + e.Message);
                return false;
            }
            return true;
        }

        private void cbSheet_SelectedIndexChanged(object sender, System.EventArgs e)
        {
            SVG.Workbook.ActiveSheet = cbSheet.SelectedIndex + 1;
            LoadSheetConfig();
        }

        private void export_Click(object sender, System.EventArgs e)
        {
            if (!CheckFileOpen()) return;
            if (!LoadPreferences()) return;

            if (exportDialog.ShowDialog() != DialogResult.OK) return;

            SVG.AllowOverwritingFiles = true;

            SVG.AllVisibleSheets = cbExportObject.SelectedIndex == 0;

            SVG.SaveAsImage(
                    (x) =>
                    {
                        x.FileName = Path.ChangeExtension(exportDialog.FileName, "") + "_" + x.Workbook.SheetName + "_" + x.SheetPageNumber.ToString() + ".svg";
                    });

            if (MessageBox.Show("Do you want to open the folder with the generated files?", "Confirm", MessageBoxButtons.YesNo) == DialogResult.Yes)
            {
                Process.Start(Path.GetDirectoryName(exportDialog.FileName));
            }

        }

        private void mainForm_Load(object sender, System.EventArgs e)
        {
            cbExportObject.SelectedIndex = 0;
        }

        private void cbExportObject_SelectedIndexChanged(object sender, System.EventArgs e)
        {
            cbSheet.Enabled = cbExportObject.SelectedIndex == 1;
        }
    }
}

Form1.Designer.cs

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using FlexCel.Render;
using System.IO;
using System.Diagnostics;
using System.Text;
namespace ExportSVG
{
    public partial class mainForm: System.Windows.Forms.Form
    {
        private System.Windows.Forms.OpenFileDialog openFileDialog1;
        private System.Windows.Forms.Panel panel1;
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.Panel panel3;
        private System.Windows.Forms.Label label12;
        private System.Windows.Forms.Label label13;
        private System.Windows.Forms.Label label14;
        private System.Windows.Forms.TextBox edTop;
        private System.Windows.Forms.TextBox edLeft;
        private System.Windows.Forms.Label label15;
        private System.Windows.Forms.TextBox edRight;
        private System.Windows.Forms.Label label16;
        private System.Windows.Forms.TextBox edBottom;
        private System.Windows.Forms.Label label17;
        private System.Windows.Forms.SaveFileDialog exportDialog;
        private System.Windows.Forms.Panel panel8;
        private System.Windows.Forms.CheckBox chFormulaText;
        private System.Windows.Forms.CheckBox chGridLines;
        private System.Windows.Forms.Label label24;
        private System.Windows.Forms.Panel panel6;
        private System.Windows.Forms.Label label6;
        private System.Windows.Forms.CheckBox checkBox4;
        private System.Windows.Forms.CheckBox cbComments;
        private System.Windows.Forms.CheckBox cbHyperlinks;
        private System.Windows.Forms.CheckBox cbImages;
        private System.Windows.Forms.Panel panel7;
        private System.Windows.Forms.Label label2;
        private System.Windows.Forms.ComboBox cbExportObject;
        private System.Windows.Forms.Label lblSheetToExport;
        private System.Windows.Forms.ComboBox cbSheet;
        private System.Windows.Forms.CheckBox chPrintHeadings;
        private System.Windows.Forms.CheckBox cbHeadersFooters;
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(mainForm));
            this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
            this.panel1 = new System.Windows.Forms.Panel();
            this.panel7 = new System.Windows.Forms.Panel();
            this.cbExportObject = new System.Windows.Forms.ComboBox();
            this.lblSheetToExport = new System.Windows.Forms.Label();
            this.cbSheet = new System.Windows.Forms.ComboBox();
            this.label2 = new System.Windows.Forms.Label();
            this.panel6 = new System.Windows.Forms.Panel();
            this.cbHeadersFooters = new System.Windows.Forms.CheckBox();
            this.cbImages = new System.Windows.Forms.CheckBox();
            this.cbHyperlinks = new System.Windows.Forms.CheckBox();
            this.cbComments = new System.Windows.Forms.CheckBox();
            this.label6 = new System.Windows.Forms.Label();
            this.panel3 = new System.Windows.Forms.Panel();
            this.edBottom = new System.Windows.Forms.TextBox();
            this.label17 = new System.Windows.Forms.Label();
            this.edRight = new System.Windows.Forms.TextBox();
            this.label16 = new System.Windows.Forms.Label();
            this.edLeft = new System.Windows.Forms.TextBox();
            this.label15 = new System.Windows.Forms.Label();
            this.edTop = new System.Windows.Forms.TextBox();
            this.label14 = new System.Windows.Forms.Label();
            this.label13 = new System.Windows.Forms.Label();
            this.label12 = new System.Windows.Forms.Label();
            this.label1 = new System.Windows.Forms.Label();
            this.panel8 = new System.Windows.Forms.Panel();
            this.chPrintHeadings = new System.Windows.Forms.CheckBox();
            this.label24 = new System.Windows.Forms.Label();
            this.chFormulaText = new System.Windows.Forms.CheckBox();
            this.chGridLines = new System.Windows.Forms.CheckBox();
            this.checkBox4 = new System.Windows.Forms.CheckBox();
            this.exportDialog = new System.Windows.Forms.SaveFileDialog();
            this.mainToolbar = new System.Windows.Forms.ToolStrip();
            this.openFile = new System.Windows.Forms.ToolStripButton();
            this.export = new System.Windows.Forms.ToolStripButton();
            this.btnClose = new System.Windows.Forms.ToolStripButton();
            this.panel1.SuspendLayout();
            this.panel7.SuspendLayout();
            this.panel6.SuspendLayout();
            this.panel3.SuspendLayout();
            this.panel8.SuspendLayout();
            this.mainToolbar.SuspendLayout();
            this.SuspendLayout();
            //
            // openFileDialog1
            //
            this.openFileDialog1.DefaultExt = "xls";
            this.openFileDialog1.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm|Excel 97/2003|*.xls|Excel 2007|*.xlsx;*.xlsm|All " +
    "files|*.*";
            this.openFileDialog1.Title = "Open an Excel File";
            //
            // panel1
            //
            this.panel1.BackColor = System.Drawing.Color.White;
            this.panel1.Controls.Add(this.panel7);
            this.panel1.Controls.Add(this.panel6);
            this.panel1.Controls.Add(this.panel3);
            this.panel1.Controls.Add(this.label1);
            this.panel1.Controls.Add(this.panel8);
            this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
            this.panel1.Location = new System.Drawing.Point(0, 0);
            this.panel1.Name = "panel1";
            this.panel1.Size = new System.Drawing.Size(768, 268);
            this.panel1.TabIndex = 3;
            //
            // panel7
            //
            this.panel7.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
            | System.Windows.Forms.AnchorStyles.Right)));
            this.panel7.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
            this.panel7.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.panel7.Controls.Add(this.cbExportObject);
            this.panel7.Controls.Add(this.lblSheetToExport);
            this.panel7.Controls.Add(this.cbSheet);
            this.panel7.Controls.Add(this.label2);
            this.panel7.Location = new System.Drawing.Point(32, 52);
            this.panel7.Name = "panel7";
            this.panel7.Size = new System.Drawing.Size(328, 200);
            this.panel7.TabIndex = 44;
            //
            // cbExportObject
            //
            this.cbExportObject.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
            | System.Windows.Forms.AnchorStyles.Right)));
            this.cbExportObject.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.cbExportObject.Items.AddRange(new object[] {
            "All sheets",
            "Active Sheet:"});
            this.cbExportObject.Location = new System.Drawing.Point(8, 32);
            this.cbExportObject.Name = "cbExportObject";
            this.cbExportObject.Size = new System.Drawing.Size(293, 21);
            this.cbExportObject.TabIndex = 46;
            this.cbExportObject.SelectedIndexChanged += new System.EventHandler(this.cbExportObject_SelectedIndexChanged);
            //
            // lblSheetToExport
            //
            this.lblSheetToExport.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.lblSheetToExport.Location = new System.Drawing.Point(8, 66);
            this.lblSheetToExport.Name = "lblSheetToExport";
            this.lblSheetToExport.Size = new System.Drawing.Size(96, 16);
            this.lblSheetToExport.TabIndex = 45;
            this.lblSheetToExport.Text = "Sheet to export:";
            //
            // cbSheet
            //
            this.cbSheet.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
            | System.Windows.Forms.AnchorStyles.Right)));
            this.cbSheet.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.cbSheet.Location = new System.Drawing.Point(8, 82);
            this.cbSheet.Name = "cbSheet";
            this.cbSheet.Size = new System.Drawing.Size(294, 21);
            this.cbSheet.TabIndex = 44;
            //
            // label2
            //
            this.label2.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label2.Location = new System.Drawing.Point(8, 8);
            this.label2.Name = "label2";
            this.label2.Size = new System.Drawing.Size(192, 16);
            this.label2.TabIndex = 19;
            this.label2.Text = "What to Export:";
            //
            // panel6
            //
            this.panel6.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.panel6.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
            this.panel6.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.panel6.Controls.Add(this.cbHeadersFooters);
            this.panel6.Controls.Add(this.cbImages);
            this.panel6.Controls.Add(this.cbHyperlinks);
            this.panel6.Controls.Add(this.cbComments);
            this.panel6.Controls.Add(this.label6);
            this.panel6.Location = new System.Drawing.Point(366, 148);
            this.panel6.Name = "panel6";
            this.panel6.Size = new System.Drawing.Size(176, 104);
            this.panel6.TabIndex = 42;
            //
            // cbHeadersFooters
            //
            this.cbHeadersFooters.Location = new System.Drawing.Point(96, 40);
            this.cbHeadersFooters.Name = "cbHeadersFooters";
            this.cbHeadersFooters.Size = new System.Drawing.Size(72, 44);
            this.cbHeadersFooters.TabIndex = 23;
            this.cbHeadersFooters.Text = "Headers / Footers";
            //
            // cbImages
            //
            this.cbImages.Checked = true;
            this.cbImages.CheckState = System.Windows.Forms.CheckState.Checked;
            this.cbImages.Location = new System.Drawing.Point(16, 32);
            this.cbImages.Name = "cbImages";
            this.cbImages.Size = new System.Drawing.Size(72, 24);
            this.cbImages.TabIndex = 22;
            this.cbImages.Text = "Images";
            //
            // cbHyperlinks
            //
            this.cbHyperlinks.Checked = true;
            this.cbHyperlinks.CheckState = System.Windows.Forms.CheckState.Checked;
            this.cbHyperlinks.Location = new System.Drawing.Point(16, 80);
            this.cbHyperlinks.Name = "cbHyperlinks";
            this.cbHyperlinks.Size = new System.Drawing.Size(80, 24);
            this.cbHyperlinks.TabIndex = 21;
            this.cbHyperlinks.Text = "HyperLinks";
            //
            // cbComments
            //
            this.cbComments.Checked = true;
            this.cbComments.CheckState = System.Windows.Forms.CheckState.Checked;
            this.cbComments.Location = new System.Drawing.Point(16, 56);
            this.cbComments.Name = "cbComments";
            this.cbComments.Size = new System.Drawing.Size(80, 24);
            this.cbComments.TabIndex = 20;
            this.cbComments.Text = "Comments";
            //
            // label6
            //
            this.label6.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label6.Location = new System.Drawing.Point(8, 16);
            this.label6.Name = "label6";
            this.label6.Size = new System.Drawing.Size(192, 16);
            this.label6.TabIndex = 19;
            this.label6.Text = "Objects to Export:";
            //
            // panel3
            //
            this.panel3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.panel3.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
            this.panel3.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.panel3.Controls.Add(this.edBottom);
            this.panel3.Controls.Add(this.label17);
            this.panel3.Controls.Add(this.edRight);
            this.panel3.Controls.Add(this.label16);
            this.panel3.Controls.Add(this.edLeft);
            this.panel3.Controls.Add(this.label15);
            this.panel3.Controls.Add(this.edTop);
            this.panel3.Controls.Add(this.label14);
            this.panel3.Controls.Add(this.label13);
            this.panel3.Controls.Add(this.label12);
            this.panel3.Location = new System.Drawing.Point(548, 52);
            this.panel3.Name = "panel3";
            this.panel3.Size = new System.Drawing.Size(208, 200);
            this.panel3.TabIndex = 30;
            //
            // edBottom
            //
            this.edBottom.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.edBottom.Location = new System.Drawing.Point(80, 136);
            this.edBottom.Name = "edBottom";
            this.edBottom.Size = new System.Drawing.Size(48, 20);
            this.edBottom.TabIndex = 26;
            this.edBottom.Text = "0";
            //
            // label17
            //
            this.label17.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label17.Location = new System.Drawing.Point(16, 160);
            this.label17.Name = "label17";
            this.label17.Size = new System.Drawing.Size(56, 16);
            this.label17.TabIndex = 25;
            this.label17.Text = "Last Col:";
            //
            // edRight
            //
            this.edRight.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.edRight.Location = new System.Drawing.Point(80, 160);
            this.edRight.Name = "edRight";
            this.edRight.Size = new System.Drawing.Size(48, 20);
            this.edRight.TabIndex = 24;
            this.edRight.Text = "0";
            //
            // label16
            //
            this.label16.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label16.Location = new System.Drawing.Point(16, 136);
            this.label16.Name = "label16";
            this.label16.Size = new System.Drawing.Size(85, 16);
            this.label16.TabIndex = 23;
            this.label16.Text = "Last Row:";
            //
            // edLeft
            //
            this.edLeft.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.edLeft.Location = new System.Drawing.Point(80, 112);
            this.edLeft.Name = "edLeft";
            this.edLeft.Size = new System.Drawing.Size(48, 20);
            this.edLeft.TabIndex = 22;
            this.edLeft.Text = "0";
            //
            // label15
            //
            this.label15.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label15.Location = new System.Drawing.Point(16, 112);
            this.label15.Name = "label15";
            this.label15.Size = new System.Drawing.Size(85, 16);
            this.label15.TabIndex = 21;
            this.label15.Text = "First Col:";
            //
            // edTop
            //
            this.edTop.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.edTop.Location = new System.Drawing.Point(80, 88);
            this.edTop.Name = "edTop";
            this.edTop.Size = new System.Drawing.Size(48, 20);
            this.edTop.TabIndex = 20;
            this.edTop.Text = "0";
            //
            // label14
            //
            this.label14.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label14.Location = new System.Drawing.Point(16, 88);
            this.label14.Name = "label14";
            this.label14.Size = new System.Drawing.Size(85, 16);
            this.label14.TabIndex = 3;
            this.label14.Text = "First Row:";
            //
            // label13
            //
            this.label13.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
            | System.Windows.Forms.AnchorStyles.Right)));
            this.label13.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label13.Location = new System.Drawing.Point(8, 32);
            this.label13.Name = "label13";
            this.label13.Size = new System.Drawing.Size(184, 32);
            this.label13.TabIndex = 2;
            this.label13.Text = "If any value is <=0 all print_range will be printed";
            //
            // label12
            //
            this.label12.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label12.Location = new System.Drawing.Point(8, 16);
            this.label12.Name = "label12";
            this.label12.Size = new System.Drawing.Size(192, 16);
            this.label12.TabIndex = 1;
            this.label12.Text = "Range to Export:";
            //
            // label1
            //
            this.label1.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label1.Location = new System.Drawing.Point(40, 16);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(80, 16);
            this.label1.TabIndex = 0;
            this.label1.Text = "File to export:";
            //
            // panel8
            //
            this.panel8.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.panel8.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
            this.panel8.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.panel8.Controls.Add(this.chPrintHeadings);
            this.panel8.Controls.Add(this.label24);
            this.panel8.Controls.Add(this.chFormulaText);
            this.panel8.Controls.Add(this.chGridLines);
            this.panel8.Location = new System.Drawing.Point(366, 52);
            this.panel8.Name = "panel8";
            this.panel8.Size = new System.Drawing.Size(176, 88);
            this.panel8.TabIndex = 37;
            //
            // chPrintHeadings
            //
            this.chPrintHeadings.Location = new System.Drawing.Point(16, 44);
            this.chPrintHeadings.Name = "chPrintHeadings";
            this.chPrintHeadings.Size = new System.Drawing.Size(144, 16);
            this.chPrintHeadings.TabIndex = 20;
            this.chPrintHeadings.Text = "Print Headings";
            //
            // label24
            //
            this.label24.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label24.Location = new System.Drawing.Point(8, 8);
            this.label24.Name = "label24";
            this.label24.Size = new System.Drawing.Size(192, 16);
            this.label24.TabIndex = 19;
            this.label24.Text = "Export Options:";
            //
            // chFormulaText
            //
            this.chFormulaText.Location = new System.Drawing.Point(16, 64);
            this.chFormulaText.Name = "chFormulaText";
            this.chFormulaText.Size = new System.Drawing.Size(136, 16);
            this.chFormulaText.TabIndex = 17;
            this.chFormulaText.Text = "Print Formula Text";
            //
            // chGridLines
            //
            this.chGridLines.Location = new System.Drawing.Point(16, 24);
            this.chGridLines.Name = "chGridLines";
            this.chGridLines.Size = new System.Drawing.Size(128, 16);
            this.chGridLines.TabIndex = 16;
            this.chGridLines.Text = "Print Grid Lines";
            //
            // checkBox4
            //
            this.checkBox4.Location = new System.Drawing.Point(0, 0);
            this.checkBox4.Name = "checkBox4";
            this.checkBox4.Size = new System.Drawing.Size(104, 24);
            this.checkBox4.TabIndex = 0;
            //
            // exportDialog
            //
            this.exportDialog.DefaultExt = "svg";
            this.exportDialog.Filter = "SVG Files|*.svg";
            this.exportDialog.Title = "Files will be saved as Filename_sheetname_pagenumber.svg";
            //
            // mainToolbar
            //
            this.mainToolbar.ImageScalingSize = new System.Drawing.Size(24, 24);
            this.mainToolbar.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.openFile,
            this.export,
            this.btnClose});
            this.mainToolbar.Location = new System.Drawing.Point(0, 0);
            this.mainToolbar.Name = "mainToolbar";
            this.mainToolbar.Size = new System.Drawing.Size(768, 31);
            this.mainToolbar.TabIndex = 8;
            //
            // openFile
            //
            this.openFile.Image = ((System.Drawing.Image)(resources.GetObject("openFile.Image")));
            this.openFile.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.openFile.Name = "openFile";
            this.openFile.Size = new System.Drawing.Size(85, 28);
            this.openFile.Text = "Open File";
            this.openFile.Click += new System.EventHandler(this.openFile_Click);
            //
            // export
            //
            this.export.Image = ((System.Drawing.Image)(resources.GetObject("export.Image")));
            this.export.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.export.Name = "export";
            this.export.Size = new System.Drawing.Size(106, 28);
            this.export.Text = "Export as SVG";
            this.export.Click += new System.EventHandler(this.export_Click);
            //
            // btnClose
            //
            this.btnClose.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right;
            this.btnClose.Image = ((System.Drawing.Image)(resources.GetObject("btnClose.Image")));
            this.btnClose.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.btnClose.Name = "btnClose";
            this.btnClose.Size = new System.Drawing.Size(53, 28);
            this.btnClose.Text = "Exit";
            this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
            //
            // mainForm
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(768, 268);
            this.Controls.Add(this.mainToolbar);
            this.Controls.Add(this.panel1);
            this.Name = "mainForm";
            this.Text = "Export an Excel file to SVG";
            this.Load += new System.EventHandler(this.mainForm_Load);
            this.panel1.ResumeLayout(false);
            this.panel7.ResumeLayout(false);
            this.panel6.ResumeLayout(false);
            this.panel3.ResumeLayout(false);
            this.panel3.PerformLayout();
            this.panel8.ResumeLayout(false);
            this.mainToolbar.ResumeLayout(false);
            this.mainToolbar.PerformLayout();
            this.ResumeLayout(false);
            this.PerformLayout();

        }
        #endregion

        private ToolStrip mainToolbar;
        private ToolStripButton openFile;
        private ToolStripButton export;
        private ToolStripButton btnClose;
    }
}

Program.cs

using System;
using System.Windows.Forms;

namespace ExportSVG
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new mainForm());
        }
    }
}


Rendering standalone objects (C# / netframework) | FlexCel Studio for the .NET Framework documentation

Rendering standalone objects (C# / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\csharp\VS2022\netframework\25.Printing and Exporting\45.Render Objects and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​csharp/​VS2022/​netframework/​Modules/​25.​Printing and Exporting/45.Render Objects

Overview

While you might normally want to render a full sheet (or a range of cells), you can also use FlexCel to render specific objects in the workbook.

Concepts

  • This is a simple application where we periodically update a number, and use FlexCel to recalculate the formulas and render a chart of the values. While you would normally not use FlexCel this way (and it is probably better to use a separate chart package), it gives a nice tasting on FlexCel capabilities.

  • How to use RenderObject to render a simple object in a sheet. In this demo, we are rendering the object named "datachart".

  • As the chart and the calculations are defined in the spreadsheet, you can add new themes to the application or modify the existing ones by creating and modifying the xls files in the templates folders, without needing to recompile the application. You can even do it in real time. Have a template open in Excel, make changes, save, and reload the template in the application by selecting it again in the listbox. Changes will appear instantly without needing to close the main application. This technique can be quite useful to let users customize your application.

  • In this example, we named the chart "DataChart", so we can identify it from the application. In order to name a chart object, ctrl-click in the chart (it should show white handles, not black), and then change the name in the name box at the top left in Excel.

Files

AssemblyInfo.cs

using System.Reflection;
using System.Runtime.CompilerServices;

//
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
//
[assembly: AssemblyTitle("")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("(c) 2002 - 2024 TMS Software")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

//
// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version
//      Build Number
//      Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:

[assembly: AssemblyVersion("7.21.0.0")]

//
// In order to sign your assembly you must specify a key to use. Refer to the
// Microsoft .NET Framework documentation for more information on assembly signing.
//
// Use the attributes below to control which key is used for signing.
//
// Notes:
//   (*) If no key is specified, the assembly is not signed.
//   (*) KeyName refers to a key that has been installed in the Crypto Service
//       Provider (CSP) on your machine. KeyFile refers to a file which contains
//       a key.
//   (*) If the KeyFile and the KeyName values are both specified, the
//       following processing occurs:
//       (1) If the KeyName can be found in the CSP, that key is used.
//       (2) If the KeyName does not exist and the KeyFile does exist, the key
//           in the KeyFile is installed into the CSP and used.
//   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
//       When specifying the KeyFile, the location of the KeyFile should be
//       relative to the project output directory which is
//       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
//       located in the project directory, you would specify the AssemblyKeyFile
//       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
//   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
//       documentation for more information on this.
//
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]
[assembly: AssemblyKeyName("")]

Form1.cs

using System;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using FlexCel.Render;
using System.IO;
using System.Diagnostics;
using System.Reflection;

using System.Text;

namespace RenderObjects
{
    /// <summary>
    /// An Example on how to render a chart.
    /// </summary>
    public partial class mainForm: System.Windows.Forms.Form
    {
        public mainForm()
        {
            InitializeComponent();
            ResizeToolbar(mainToolbar);
        }

        private void ResizeToolbar(ToolStrip toolbar)
        {

            using (Graphics gr = CreateGraphics())
            {
                double xFactor = gr.DpiX / 96.0;
                double yFactor = gr.DpiY / 96.0;
                toolbar.ImageScalingSize = new Size((int)(24 * xFactor), (int)(24 * yFactor));
                toolbar.Width = 0; //force a recalc of the buttons.
            }
        }

        #region Global variables
        private XlsFile Xls;
        private TXlsNamedRange ValueRange;
        private double MinValue;
        private double MaxValue;
        private double StepValue;
        private double ActualValue;

        private int ChartIndex;
        private TShapeProperties ChartProps;
        #endregion

        private void InitApp()
        {
            Xls = new XlsFile();

            string TemplatePath = Path.Combine(Path.Combine(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), ".."), ".."), "templates") + Path.DirectorySeparatorChar;
            DirectoryInfo di = new DirectoryInfo(TemplatePath);
            FileInfo[] fi = di.GetFiles("*.xls");
            if (fi.Length == 0) throw new Exception("Sorry, no templates found in the templates folder.");

            cbTheme.Items.Clear();
            foreach (FileInfo f in fi)
            {
                cbTheme.Items.Add(new FileHolder(f.FullName));
            }

            cbTheme.SelectedIndex = 0;
        }

        private void LoadFile(string FileName)
        {
            Xls.Open(FileName);

            ActualValue = 0;

            ValueRange = Xls.GetNamedRange("Value", 0);
            if (ValueRange == null) throw new Exception("There is no range named \"value\" in the template");

            MinValue = ReadDoubleName("Minimum");
            MaxValue = ReadDoubleName("Maximum");
            StepValue = ReadDoubleName("Step");

            ChartIndex = -1;
            for (int i = 1; i <= Xls.ObjectCount; i++)
            {
                string ObjName = Xls.GetObjectName(i);
                if (String.Compare(ObjName, "DataChart", true) == 0)
                {
                    ChartIndex = i;
                    break;
                }
            }

            if (ChartIndex < 0) throw new Exception("There is no object named \"DataChart\" in the template");
            ChartProps = Xls.GetObjectProperties(ChartIndex, true);
        }

        private double ReadDoubleName(string Name)
        {
            TXlsCellRange Range = Xls.GetNamedRange(Name, 0);
            if (Range == null) throw new Exception("There is no range named " + Name + " in the template");

            object val = Xls.GetCellValue(Range.Top, Range.Left);
            if (!(val is Double)) throw new Exception("The range named " + Name + " does not contain a number");
            return (Double)val;
        }

        private void button2_Click(object sender, System.EventArgs e)
        {
            Close();
        }

        private void updater_Tick(object sender, System.EventArgs e)
        {
            try
            {
                ActualValue += StepValue;
                if (ActualValue > MaxValue) ActualValue = MinValue;
                Xls.SetCellValue(ValueRange.Top, ValueRange.Left, ActualValue);
                Xls.Recalc();

                if (chartBox.Image != null) chartBox.Image.Dispose();
                chartBox.Image = GetChart();
            }
            catch (Exception ex)  //We don't want any dialog popping up every second.
            {
                labelError.Text = ex.Message;
                labelError.Dock = DockStyle.Fill;
                panelError.Dock = DockStyle.Fill;
                panelError.Visible = true;
                updater.Enabled = false;

            }
        }

        private Image GetChart()
        {
            //We could get the chart with the following command,
            //but it would be fixed size. In this example we are going to be a little more complex.

            //Xls.RenderObject(ChartIndex);

            //A more complex way to retrieve the chart, to show how to use
            //all parameters in renderobject.

            TUIRectangle ImageDimensions;
            TPointF Origin;
            TUISize SizePixels;

            //First calculate the chart dimensions without actually rendering it. This is fast.
            Xls.RenderObject(ChartIndex, 96, ChartProps,
                SmoothingMode.AntiAlias, InterpolationMode.HighQualityBicubic, true, false,
                out Origin, out ImageDimensions, out SizePixels);

            double dpi = 96;  //default screen resolution
            if (SizePixels.Height > 0 && SizePixels.Width > 0)
            {
                double AspectX = (double)chartBox.Width / SizePixels.Width;
                double AspectY = (double)chartBox.Height / SizePixels.Height;

                double Aspect = Math.Max(AspectX, AspectY);
                //Make the dpi adjust the screen resolution and the size of the form.
                dpi = (double)(96 * Aspect);
                if (dpi < 20) dpi = 20;
                if (dpi > 500) dpi = 500;
            }

            return Xls.RenderObject(ChartIndex, dpi, ChartProps,
                SmoothingMode.AntiAlias, InterpolationMode.HighQualityBicubic, true, true,
                out Origin, out ImageDimensions, out SizePixels);

        }

        private void cbTheme_SelectedIndexChanged(object sender, System.EventArgs e)
        {
            if (cbTheme.SelectedItem == null) return;
            LoadFile((cbTheme.SelectedItem as FileHolder).FullName);
        }

        private void btnRun_Click(object sender, System.EventArgs e)
        {
            if (Xls == null) InitApp();
            updater.Enabled = true;
            btnRun.Enabled = false;
            btnCancel.Enabled = true;
        }

        private void btnCancel_Click(object sender, System.EventArgs e)
        {
            updater.Enabled = false;
            btnRun.Enabled = true;
            btnCancel.Enabled = false;
            panelError.Visible = false;
        }

    }

    internal class FileHolder
    {
        internal string FullName;
        private string Caption;

        internal FileHolder(string aFullName)
        {
            FullName = aFullName;
            Caption = Path.GetFileNameWithoutExtension(aFullName);
        }

        public override string ToString()
        {
            return Caption;
        }

    }
}

Form1.Designer.cs

using System;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using FlexCel.Render;
using System.IO;
using System.Diagnostics;
using System.Reflection;
using System.Text;
namespace RenderObjects
{
    public partial class mainForm: System.Windows.Forms.Form
    {
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.components = new System.ComponentModel.Container();
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(mainForm));
            this.panel1 = new System.Windows.Forms.Panel();
            this.panelError = new System.Windows.Forms.Panel();
            this.labelError = new System.Windows.Forms.Label();
            this.chartBox = new System.Windows.Forms.PictureBox();
            this.panel7 = new System.Windows.Forms.Panel();
            this.cbTheme = new System.Windows.Forms.ComboBox();
            this.label2 = new System.Windows.Forms.Label();
            this.checkBox4 = new System.Windows.Forms.CheckBox();
            this.updater = new System.Windows.Forms.Timer(this.components);
            this.mainToolbar = new System.Windows.Forms.ToolStrip();
            this.btnRun = new System.Windows.Forms.ToolStripButton();
            this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
            this.btnExit = new System.Windows.Forms.ToolStripButton();
            this.btnCancel = new System.Windows.Forms.ToolStripButton();
            this.panel1.SuspendLayout();
            this.panelError.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.chartBox)).BeginInit();
            this.panel7.SuspendLayout();
            this.mainToolbar.SuspendLayout();
            this.SuspendLayout();
            //
            // panel1
            //
            this.panel1.BackColor = System.Drawing.Color.White;
            this.panel1.Controls.Add(this.panelError);
            this.panel1.Controls.Add(this.chartBox);
            this.panel1.Controls.Add(this.panel7);
            this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
            this.panel1.Location = new System.Drawing.Point(0, 38);
            this.panel1.Name = "panel1";
            this.panel1.Size = new System.Drawing.Size(464, 392);
            this.panel1.TabIndex = 3;
            //
            // panelError
            //
            this.panelError.Controls.Add(this.labelError);
            this.panelError.Location = new System.Drawing.Point(136, 128);
            this.panelError.Name = "panelError";
            this.panelError.Size = new System.Drawing.Size(200, 100);
            this.panelError.TabIndex = 52;
            this.panelError.Visible = false;
            //
            // labelError
            //
            this.labelError.Location = new System.Drawing.Point(8, 16);
            this.labelError.Name = "labelError";
            this.labelError.Size = new System.Drawing.Size(100, 23);
            this.labelError.TabIndex = 0;
            //
            // chartBox
            //
            this.chartBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
            | System.Windows.Forms.AnchorStyles.Left)
            | System.Windows.Forms.AnchorStyles.Right)));
            this.chartBox.Location = new System.Drawing.Point(24, 120);
            this.chartBox.Name = "chartBox";
            this.chartBox.Size = new System.Drawing.Size(416, 250);
            this.chartBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
            this.chartBox.TabIndex = 51;
            this.chartBox.TabStop = false;
            //
            // panel7
            //
            this.panel7.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
            | System.Windows.Forms.AnchorStyles.Right)));
            this.panel7.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
            this.panel7.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.panel7.Controls.Add(this.cbTheme);
            this.panel7.Controls.Add(this.label2);
            this.panel7.Location = new System.Drawing.Point(16, 16);
            this.panel7.Name = "panel7";
            this.panel7.Size = new System.Drawing.Size(432, 72);
            this.panel7.TabIndex = 44;
            //
            // cbTheme
            //
            this.cbTheme.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.cbTheme.Location = new System.Drawing.Point(8, 32);
            this.cbTheme.Name = "cbTheme";
            this.cbTheme.Size = new System.Drawing.Size(248, 21);
            this.cbTheme.TabIndex = 46;
            this.cbTheme.SelectedIndexChanged += new System.EventHandler(this.cbTheme_SelectedIndexChanged);
            //
            // label2
            //
            this.label2.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label2.Location = new System.Drawing.Point(8, 8);
            this.label2.Name = "label2";
            this.label2.Size = new System.Drawing.Size(192, 16);
            this.label2.TabIndex = 19;
            this.label2.Text = "Select Theme:";
            //
            // checkBox4
            //
            this.checkBox4.Location = new System.Drawing.Point(0, 0);
            this.checkBox4.Name = "checkBox4";
            this.checkBox4.Size = new System.Drawing.Size(104, 24);
            this.checkBox4.TabIndex = 0;
            //
            // updater
            //
            this.updater.Tick += new System.EventHandler(this.updater_Tick);
            //
            // mainToolbar
            //
            this.mainToolbar.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.btnRun,
            this.toolStripSeparator1,
            this.btnExit,
            this.btnCancel});
            this.mainToolbar.Location = new System.Drawing.Point(0, 0);
            this.mainToolbar.Name = "mainToolbar";
            this.mainToolbar.Size = new System.Drawing.Size(464, 38);
            this.mainToolbar.TabIndex = 11;
            this.mainToolbar.Text = "toolStrip1";
            //
            // btnRun
            //
            this.btnRun.Image = ((System.Drawing.Image)(resources.GetObject("btnRun.Image")));
            this.btnRun.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.btnRun.Name = "btnRun";
            this.btnRun.Size = new System.Drawing.Size(35, 35);
            this.btnRun.Text = "Run!";
            this.btnRun.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
            this.btnRun.Click += new System.EventHandler(this.btnRun_Click);
            //
            // toolStripSeparator1
            //
            this.toolStripSeparator1.Name = "toolStripSeparator1";
            this.toolStripSeparator1.Size = new System.Drawing.Size(6, 38);
            //
            // btnExit
            //
            this.btnExit.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right;
            this.btnExit.Image = ((System.Drawing.Image)(resources.GetObject("btnExit.Image")));
            this.btnExit.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.btnExit.Name = "btnExit";
            this.btnExit.Size = new System.Drawing.Size(59, 35);
            this.btnExit.Text = "     E&xit     ";
            this.btnExit.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
            this.btnExit.Click += new System.EventHandler(this.button2_Click);
            //
            // btnCancel
            //
            this.btnCancel.Enabled = false;
            this.btnCancel.Image = ((System.Drawing.Image)(resources.GetObject("btnCancel.Image")));
            this.btnCancel.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.btnCancel.Name = "btnCancel";
            this.btnCancel.Size = new System.Drawing.Size(47, 35);
            this.btnCancel.Text = "Cancel";
            this.btnCancel.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
            this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
            //
            // mainForm
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(464, 430);
            this.Controls.Add(this.panel1);
            this.Controls.Add(this.mainToolbar);
            this.MaximumSize = new System.Drawing.Size(800, 800);
            this.Name = "mainForm";
            this.Text = "Using FlexCel to render just a part of a spreadshet";
            this.panel1.ResumeLayout(false);
            this.panelError.ResumeLayout(false);
            ((System.ComponentModel.ISupportInitialize)(this.chartBox)).EndInit();
            this.panel7.ResumeLayout(false);
            this.mainToolbar.ResumeLayout(false);
            this.mainToolbar.PerformLayout();
            this.ResumeLayout(false);
            this.PerformLayout();

        }
        #endregion

        private System.Windows.Forms.Panel panel1;
        private System.Windows.Forms.CheckBox checkBox4;
        private System.Windows.Forms.Panel panel7;
        private System.Windows.Forms.Label label2;
        private System.Windows.Forms.PictureBox chartBox;
        private System.Windows.Forms.Timer updater;
        private System.Windows.Forms.ComboBox cbTheme;
        private System.Windows.Forms.Panel panelError;
        private System.Windows.Forms.Label labelError;
        private ToolStrip mainToolbar;
        private ToolStripButton btnRun;
        private ToolStripSeparator toolStripSeparator1;
        private ToolStripButton btnExit;
        private ToolStripButton btnCancel;
    }
}

Program.cs

using System;
using System.Windows.Forms;

namespace RenderObjects
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new mainForm());
        }
    }
}


Using the FlexCel ASP viewer component (C# / netframework) | FlexCel Studio for the .NET Framework documentation

Using the FlexCel ASP viewer component (C# / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\csharp\VS2022\netframework\25.Printing and Exporting\50.ASP.NET HTML Viewer and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​csharp/​VS2022/​netframework/​Modules/​25.​Printing and Exporting/50.ASP.NET HTML Viewer

Overview

A simple example on how to use the component FlexCelAspViewer to display xls files as html in a web browser.

Note

This demo does not run from MainDemo and it needs **.NET 2.0 or newer.

In order to run this demo, open the website from Visual Studio 2005 or newer, by doing: Menu->File->Open->Website

and pointing to the Modules\25.Printing and Exporting\50.ASP.NET HTML Viewer folder.

Concepts

  • In this demo we will use .TemporaryFiles to create the images. This will create all images as GUIDs in the "images" folder. Images older than 15 minutes will be deleted when a new page is requested, and there is an "overflow guard" that prevents having more than 5000 images in the images folder.

  • If you wanted to use HttpHandlers to return the images, you would need to add the following lines to web.config:

      <httpHandlers>
  <add verb="*" path="flexcelviewer.ashx"
    type="FlexCel.AspNet.UniqueTemporaryFilesImageHandler,FlexCel.AspNet"/>
  </httpHandlers>

This has already been done in the example, so you just need to switch the image mode to use UniqueTemporaryFiles.

  • In order to delete the temporary images once the timeout has happened, we use ImageTimeout and MaxTemporaryImages. Make sure you have rights to delete images in the image folders for this to work. You could also manually delete the images with a script on the server.

  • FlexCelAspViewer is great for small sites, but due to the way it handles images, (make sure you read the [

    ) it might not scale enough if you do not provide a custom image handler. ](~/guides/html-exporting-guide.md# -----it-might-not-scale-enough-if-you-do-not-provide --a-custom-image-handler )

Files

Default.aspx.cs

using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

using FlexCel.Core;
using FlexCel.XlsAdapter;
using FlexCel.Render;
using FlexCel.AspNet;

public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        XlsFile xls = new XlsFile();

        string DefaultFile = Server.MapPath("~/default.xls");
        if (IsPostBack)
        {
            if (Uploader.HasFile)
            {
                xls.Open(Uploader.FileContent);
            }
            else
            {
                xls.Open(DefaultFile);
            }
        }
        else
        {
            xls.Open(DefaultFile);
        }

        Viewer.HtmlExport.ImageNaming = TImageNaming.Guid;
        Viewer.HtmlExport.Workbook = xls;
        Viewer.RelativeImagePath = "images";
        Viewer.HtmlExport.FixIE6TransparentPngSupport = true;  //This is only needed if you are using IE and there are transparent png files.
        Viewer.ImageExportMode = TImageExportMode.TemporaryFiles;

    }
}


Thanks (C# / netframework) | FlexCel Studio for the .NET Framework documentation

Thanks (C# / netframework)

Overview

Last but not least, we would like to thank all the people that contributed with this project. They are too many to be mentioned here, because FlexCel is built on the help of many people, but here there are some:

  • Frédérick Jacquet for his implementation of the MD5 code for running on Compact Framework.

  • People of the Mono project for providing such an amazing implementation of the .NET framework.

  • People at Juice Analitics for their ideas on "infographics" we used on the "VIRTUAL DATASETS" demo ([http://www.juiceanalytics.com/weblog/?p=236]{.underline})

  • Scott Hanselman for his implementation of a custom http handler at [http://www.hanselman.com/blog/PermaLink,guid,5c59d662-b250-4eb2-96e4-f274295bd52e.aspx]{.underline}

  • Everybody who is mentioned in the file copyright.txt.

  • You.

  • And everybody else we forgot.


Android Examples (C#) | FlexCel Studio for the .NET Framework documentation

Android Examples (C#)

Overview

The examples in this section require Xamarin with Android support.

In this section

  • FlexCalc

  • LangWars


FlexCalc (C# / android) | FlexCel Studio for the .NET Framework documentation

FlexCalc (C# / android)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\csharp\VS2022\android\FlexCalc and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​csharp/​VS2022/​android/​FlexCalc

Overview

This example shows how to use the FlexCel calculating engine as a calculator for the device.

Under the hood, every textbox in the app is mapped to a cell in a spreadsheet (A1, A2, A3...), and whenever a textbox changes, the sheet is recalculated and the results of the new calculations are shown at the column on the right. You can use the full range of Excel functions in this demo, and reference cells in the usual way (for example, you can write "=A2 + 1" in the textbox for A3)

As in Excel, any text that starts with "=" will be considered a formula.

The backing spreadsheet will be saved when you exit the app and loaded when open it, and this will allow to persist the formulas between sessions.

Files

MainActivity.cs

using System;
using Android.App;
using Android.Content;
using Android.Runtime;
using Android.Views;
using Android.Widget;
using Android.OS;
using FlexCel.XlsAdapter;
using FlexCel.Core;
using System.IO;

namespace FlexCalc
{

    [Activity (Label = "FlexCalc", MainLauncher = true)]
    public class MainActivity : Activity
    {
        XlsFile xls;
        string ConfigFile = Path.Combine(System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal), "config.xls");

        protected override void OnCreate(Bundle bundle)
        {
            string[] Predefined = new string[]
            {
                "5", "=A1 * 3 + 7", "=Sum(A1, A2)*9", "=Sin(a1) + cos(a2)", "=Average(a1:a4)",
                "", "", "", "", "", "", "", "", "", "", ""
            };

            base.OnCreate(bundle);

            bool Restoring = false;
            xls = new XlsFile(true);
            if (File.Exists(ConfigFile))
            {
                try
                {
                    xls.Open(ConfigFile);
                    Restoring = true;
                }
                catch
                {
                    //if the file is corrupt, we'll just ignore it.
                    //Restoring will be false, and we will create a new file.
                }
            }

            if (!Restoring)
            {
                xls.NewFile(1, TExcelFileFormat.v2019);

                for (int k = 0; k < Predefined.Length; k++)
                {
                    xls.SetCellFromString(k + 1, 1, Predefined [k]); //Initialize the grid with something so users know what they have to do.
                }
            }
            xls.Recalc();

            TextView[] Results = new TextView[xls.RowCount];

            var Layout = new TableLayout(this);
            for (int i = 0; i < Results.Length; i++)
            {
                var Row = new TableRow(Layout.Context);

                var ColHeading = new TextView(Row.Context);
                ColHeading.Text = new TCellAddress(i + 1, 1).CellRef;
                ColHeading.Gravity = GravityFlags.Left;

                EditText CellValue = new EditText(Row.Context);
                CellValue.Gravity = GravityFlags.Fill;
                CellValue.Text = GetCellOrFormula(i + 1);
                CellValue.Tag = i;

                CellValue.AfterTextChanged += (object sender, Android.Text.AfterTextChangedEventArgs e) =>
                {
                    int z = (int)(sender as EditText).Tag;
                    xls.SetCellFromString(z + 1, 1, (sender as EditText).Text);
                    xls.Recalc();
                    for (int k = 0; k < Results.Length; k++)
                    {
                        Results[k].Text = xls.GetStringFromCell(k + 1, 1);
                    }
                };

                Results[i] = new TextView(Row.Context);
                Results[i].Gravity = GravityFlags.Right;
                Results[i].Text = xls.GetStringFromCell(i + 1, 1);

                Row.AddView(ColHeading);
                Row.AddView(CellValue);
                Row.AddView(Results[i]);

                Layout.AddView(Row);
                SetContentView(Layout);

            }
        }

        string GetCellOrFormula(int row)
        {
            object cell = xls.GetCellValue(row, 1);
            if (cell == null)
                return "";
            TFormula fmla = (cell as TFormula);
            if (fmla != null)
                return fmla.Text;

            return Convert.ToString(cell);
        }

       protected override void OnPause()
        {
            if (xls != null)
            {
                xls.Save(ConfigFile);
            }
            base.OnPause();
        }
    }
}


LangWars (C# / android) | FlexCel Studio for the .NET Framework documentation

LangWars (C# / android)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\csharp\VS2022\android\LangWars and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​csharp/​VS2022/​android/​Lang​Wars

Overview

This example shows how to do a simple report doing FlexCel. It will fetch the most used tags from Stack Overflow and rank and provide a chart to visualize them. You can work with online or offline data, in case you don't have access to Stack Overflow.

In this example, we are exporting the results to an html file and showing the results in a web browser. We could also export to pdf.

Files

LangData.cs

using System;
using System.Drawing;
using System.Runtime.Serialization;
using System.Collections.Generic;

namespace LangWars
{
    [DataContract]
    class LangDataList
    {
        [DataMember]
        public LangData[] items{ get; set; }
    }

    [DataContract]
    class LangData
    {
        [DataMember]
        public string name{ get; set; }
        [DataMember]
        public int count{ get; set; }
    }
}

MainActivity.cs

using System;
using Android.App;
using Android.Content;
using Android.Runtime;
using Android.Views;
using Android.Widget;
using Android.OS;
using System.Net;
using System.Runtime.Serialization.Json;
using System.IO;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using FlexCel.Report;
using FlexCel.Render;
using Android.Webkit;
using System.Threading.Tasks;

namespace LangWars
{
    [Activity (Label = "LangWars", MainLauncher = true)]
    public class MainActivity : Activity
    {
        WebView ResultsWindow;
        CheckBox OnlineSwitch;
        ProgressBar LoadSpinner;
        Button FightButton;
        Button ShareButton;
        bool HTMLLoaded = false;

        async protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);

            FightButton = FindViewById<Button>(Resource.Id.FightButton);

            FightButton.Click += async delegate
            {
                await TryCreateReport();
            };

            ShareButton = FindViewById<Button>(Resource.Id.ShareButton);

            ShareButton.Click += delegate
            {
                SendFile();
            };

            ResultsWindow = FindViewById<WebView>(Resource.Id.ResultsWindow);
            OnlineSwitch = FindViewById<CheckBox>(Resource.Id.OnlineSwitch);
            LoadSpinner = FindViewById<ProgressBar>(Resource.Id.LoadSpinner);
            LoadSpinner.Visibility = ViewStates.Gone;
            await DisplayLastReport();
        }

        async Task<bool> TryCreateReport()
        {
            try
            {
                LoadSpinner.Visibility = ViewStates.Visible;
                FightButton.Enabled = false;
                ShareButton.Enabled = false;
                try
                {
                    bool Offline = !OnlineSwitch.Checked;
                    await Task.Run(()=>CreateReport(Offline));
                }
                finally
                {
                    ShareButton.Enabled = true;
                    FightButton.Enabled = true;
                    LoadSpinner.Visibility = ViewStates.Gone;
                }
            }
            catch (Exception ex)
            {
                SetHTML("<html>" + System.Security.SecurityElement.Escape(ex.Message) + "</html>");
                return false;
            }

            LoadHTML();
            return true;
        }

        async Task DisplayLastReport()
        {
            if (!File.Exists(TempHtmlPath))
            {
                await TryCreateReport();
                return;
            }

            LoadHTML();
        }

        void CreateReport(bool Offline)
        {
            var Langs = Offline? LoadData(): FetchData();
            var xls = RunReport(Langs);
            if (TempXlsPath != null) xls.Save(TempXlsPath); //we save it to share it and to display it on startup.
            GenerateHTML(xls);
        }

        LangDataList FetchData()
        {
            var httpWebRequest = (HttpWebRequest)WebRequest.Create("https://api.stackexchange.com/2.1/tags?order=desc&sort=popular&site=stackoverflow&pagesize=5");
            httpWebRequest.AutomaticDecompression = DecompressionMethods.Deflate | DecompressionMethods.GZip;
            httpWebRequest.Method = "GET";
            var httpResponse = (HttpWebResponse)httpWebRequest.GetResponse();

            DataContractJsonSerializer ser = new DataContractJsonSerializer(typeof(LangDataList));
            return (LangDataList)ser.ReadObject(httpResponse.GetResponseStream());
        }

        LangDataList LoadData()
        {
            using (var offlineData = Assets.Open("OfflineData.txt"))
            {
                DataContractJsonSerializer ser = new DataContractJsonSerializer(typeof(LangDataList));
                return (LangDataList)ser.ReadObject(offlineData);
            }
        }

        ExcelFile RunReport(LangDataList langs)
        {
            ExcelFile Result = new XlsFile(true);
            using(var template = Assets.Open("report.template.xls"))
            {
                //we can't load directly from the asset stream, as we need a seekable stream.
                using (var memtemplate = new MemoryStream())
                {
                    template.CopyTo(memtemplate);
                    memtemplate.Position = 0;
                    Result.Open(memtemplate);
                }
            }
            using (FlexCelReport fr = new FlexCelReport(true))
            {
                fr.AddTable("lang", langs.items);
                fr.Run(Result);
            }
            return Result;
        }

        string TempHtmlPath
        {
            get
            {
                return Path.Combine(
                    ApplicationContext.CacheDir.AbsolutePath,
                    "langwars.html");
            }
        }

        string TempXlsPath
        {
            get
            {
                return Path.Combine(
                    ApplicationContext.FilesDir.AbsolutePath,
                    "langwars.xls");
            }
        }

        void GenerateHTML(ExcelFile xls)
        {

            using (FlexCelHtmlExport html = new FlexCelHtmlExport(xls, true))
            {
                //If we were using png, we would have to set
                //a high resolution so this looks nice in high resolution displays.
                //html.ImageResolution = 326;

                //but we will use SVG, which is vectorial:
                html.HtmlVersion = THtmlVersion.Html_5;
                html.SavedImagesFormat = THtmlImageFormat.Svg;
                html.EmbedImages = true;

                html.Export(TempHtmlPath, ".");
            }
        }

        void LoadHTML()
        {
            ResultsWindow.Settings.AllowContentAccess = true;
            ResultsWindow.Settings.AllowFileAccess = true;
            if (!HTMLLoaded)
            {
                ResultsWindow.LoadUrl(new Uri(TempHtmlPath).AbsoluteUri);
                HTMLLoaded = true;
            }
            else
            {
                //WebView doesn't refresh the images if you just load the request again (even if ignoring the cache). So we need to call Reload instead
                ResultsWindow.Reload();
            }
        }

        void SetHTML(string html)
        {
            ResultsWindow.LoadData(html, "text/html; charset=UTF-8", null);
            HTMLLoaded = false;
        }

        async void SendFile()
        {
            // To send the file, we need to define a file provider in AndrodiManifest.xml
            // See https://doc.tmssoftware.com/flexcel/net/guides/android-guide.html#sharing-files
            if (!File.Exists(TempXlsPath))
            {
                if (!await TryCreateReport()) return;
            }

            Intent Sender = new Intent(Intent.ActionSend);
            Sender.SetType(StandardMimeType.Xls);
            Java.IO.File xlsFile = new Java.IO.File(TempXlsPath);
            var contentUri = AndroidX.Core.Content.FileProvider.GetUriForFile(this, ApplicationContext.PackageName + ".fileprovider", xlsFile);
            Sender.PutExtra(Intent.ExtraStream, contentUri);
            Sender.SetFlags(ActivityFlags.GrantReadUriPermission);
            StartActivity(Intent.CreateChooser(Sender, "Select application"));
        }
    }
}


iOS Examples (C#) | FlexCel Studio for the .NET Framework documentation

iOS Examples (C#)

Overview

The examples in this section require Xamarin with iOS support.

In this section

  • FlexCalc

  • FlexView

  • LangWars


FlexCalc (C# / ios-unified) | FlexCel Studio for the .NET Framework documentation

FlexCalc (C# / ios-unified)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\csharp\VS2022\ios-unified\FlexCalc and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​csharp/​VS2022/​ios-​unified/​FlexCalc

Overview

This example shows how to use the FlexCel calculating engine as a calculator for the device.

Under the hood, every textbox in the app is mapped to a cell in a spreadsheet (A1, A2, A3...), and whenever a textbox changes, the sheet is recalculated and the results of the new calculations are shown at the column on the right. You can use the full range of Excel functions in this demo, and reference cells in the usual way (for example, you can write "=A2 + 1" in the textbox for A3)

As in Excel, any text that starts with "=" will be considered a formula.

The backing spreadsheet will be saved when you exit the app and loaded when open it, and this will allow to persist the formulas between sessions.

Files

AppDelegate.cs

using System;
using System.Collections.Generic;
using System.Linq;
using Foundation;
using UIKit;

namespace FlexCalc
{
    // The UIApplicationDelegate for the application. This class is responsible for launching the
    // User Interface of the application, as well as listening (and optionally responding) to
    // application events from iOS.
    [Register ("AppDelegate")]
    public partial class AppDelegate : UIApplicationDelegate
    {
        // class-level declarations
        public override UIWindow Window
        {
            get;
            set;
        }
        // This method is invoked when the application is about to move from active to inactive state.
        // OpenGL applications should use this method to pause.
        public override void OnResignActivation(UIApplication application)
        {
        }
        // This method should be used to release shared resources and it should store the application state.
        // If your application supports background exection this method is called instead of WillTerminate
        // when the user quits.
        public override void DidEnterBackground(UIApplication application)
        {
            ((FlexCalcViewController)(Window.RootViewController)).SaveConfig();
        }

        /// This method is called as part of the transiton from background to active state.
        public override void WillEnterForeground(UIApplication application)
        {
        }

        /// This method is called when the application is about to terminate. Save data, if needed.
        public override void WillTerminate(UIApplication application)
        {
            ((FlexCalcViewController)(Window.RootViewController)).SaveConfig();
        }

        public override void FinishedLaunching(UIApplication application)
        {
        }

    }
}

CalcCell.cs

// This file has been autogenerated from a class added in the UI designer.

using System;

using Foundation;
using UIKit;
using CoreGraphics;
using System.Drawing;

namespace FlexCalc
{
    public partial class CalcCell : UICollectionViewCell
    {
        private UILabel CellHeading;
        private UITextView CellContent;
        private UILabel CellResult;
        public int XlsRow{ get; set; }
        public Action<CalcCell> ActiveCell{ get; set; }

        [Export ("initWithFrame:")]
        public CalcCell (System.Drawing.RectangleF frame) : base (frame)
        {
            CellHeading = new UILabel(new RectangleF(5, 5, 35, 40));
            CellHeading.TextColor = UIColor.DarkTextColor;
            ContentView.AddSubview(CellHeading);

            CellContent = new UITextView(new RectangleF(45, 5, 135, 40));

            CellContent.ReturnKeyType = UIReturnKeyType.Done;
            CellContent.Delegate = new CalcTextViewDelegate(x => ActiveCell( x == null? null: this), ()=> OnRefresh(this));
            CellContent.KeyboardType = UIKeyboardType.NumbersAndPunctuation;

            ContentView.AddSubview(CellContent);

            CellResult = new UILabel(new RectangleF(180, 5, frame.Width - 180 - 10, 40));
            CellResult.TextColor = UIColor.DarkTextColor;
            CellResult.TextAlignment = UITextAlignment.Right;
            ContentView.AddSubview(CellResult);
        }

        public Action<CalcCell> OnRefresh { get; set; }

        public string Heading{ set { CellHeading.Text = value; } }
        public string Content{ get { return CellContent.Text; } set { CellContent.Text = value; } }
        public string Result { set { CellResult.Text = value; } }

    }

    class CalcTextViewDelegate: UITextViewDelegate
    {
        Action<UITextView> SetActive;
        Action OnRefresh;

        public CalcTextViewDelegate(Action<UITextView> setActive, Action onRefresh)
        {
            SetActive = setActive;
            OnRefresh = onRefresh;
        }

        public override bool ShouldChangeText(UITextView textView, NSRange range, string text)
        {
            if (text == "\n")
            {
                textView.ResignFirstResponder();
                return false;
            }
            return true;
        }

        public override void Changed(UITextView textView)
        {
            OnRefresh();
        }

        public override void EditingStarted(UITextView textView)
        {
            SetActive(textView);
        }

        public override void EditingEnded(UITextView textView)
        {
            SetActive(null);
        }

    }
}

CalcCell.designer.cs

// WARNING
//
// This file has been generated automatically by Xamarin Studio from the outlets and
// actions declared in your storyboard file.
// Manual changes to this file will not be maintained.
//
using Foundation;
using System;
using System.CodeDom.Compiler;
using UIKit;

namespace FlexCalc
{
   [Register ("CalcCell")]
    partial class CalcCell
    {
        void ReleaseDesignerOutlets ()
        {
        }
    }
}

FlexCalcViewController.cs

using System;
using System.Drawing;
using Foundation;
using UIKit;
using FlexCel.Core;
using FlexCel.XlsAdapter;
using System.IO;
using ObjCRuntime;

namespace FlexCalc
{
    public partial class FlexCalcViewController : UICollectionViewController
    {
        static NSString CalcCellId = new NSString ("CalcCell");
        string FileName
        {
            get { return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "FlexCalc.xls"); }
        }

        ExcelFile xls;
        CalcCell ActiveEdit;
        RectangleF keybRect;

        static bool UserInterfaceIdiomIsPhone
        {
            get { return UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Phone; }
        }

        public FlexCalcViewController(IntPtr handle) : base (handle)
        {
        }

        public override void DidReceiveMemoryWarning()
        {
            // Releases the view if it doesn't have a superview.
            base.DidReceiveMemoryWarning();

            // Release any cached data, images, etc that aren't in use.
        }

        #region View lifecycle

        public override void ViewWillAppear(bool animated)
        {
            base.ViewWillAppear(animated);
        }

        public override void ViewDidAppear(bool animated)
        {
            base.ViewDidAppear(animated);
        }

        public override void ViewWillDisappear(bool animated)
        {
            base.ViewWillDisappear(animated);
        }

        public override void ViewDidDisappear(bool animated)
        {
            base.ViewDidDisappear(animated);
        }

        #endregion

        public override void ViewDidLoad ()
        {
            base.ViewDidLoad ();

            xls = new XlsFile(true);
            if (File.Exists(FileName))
                xls.Open(FileName);
            else
                CreateInitialFile(xls);

            CollectionView.RegisterClassForCell (typeof(CalcCell), CalcCellId);
            FixKeyboard();

            var Layout = new UICollectionViewFlowLayout();
            var w = CalcCellWidth(CollectionView.Bounds.Width);
            Layout.ItemSize = new SizeF(w, 50);
            CollectionView.SetCollectionViewLayout(Layout, false);

            //register the keyboard so we make the text fields visible
            NSNotificationCenter.DefaultCenter.AddObserver(UIKeyboard.DidShowNotification,  (x) =>
            {
                if (ActiveEdit == null) return;
                var keybRectObj = x.UserInfo.ObjectForKey(UIKeyboard.FrameBeginUserInfoKey);
                keybRect = ((NSValue)keybRectObj).RectangleFValue;
                FixKeyboard();

                var FrameRec = View.Frame;
                FrameRec.Height -=  keybRect.Height;
                if (!FrameRec.Contains(ActiveEdit.Frame.Location))
                {
                    this.CollectionView.ScrollRectToVisible(ActiveEdit.Frame, true);
                }
            });

            NSNotificationCenter.DefaultCenter.AddObserver(UIKeyboard.DidHideNotification, (x) =>
            {
                keybRect = new RectangleF(0, 0, 0, 0);
                FixKeyboard();

            });

        }

        void CreateInitialFile(ExcelFile xls)
        {
            xls.NewFile(1, TExcelFileFormat.v2019);
            xls.SetCellValue(1, 1, 7);
            xls.SetCellValue(2, 1, 5);
            xls.SetCellValue(3,1, new TFormula("=sum(a1:a2)^2"));
            xls.Recalc();
        }

        public void SaveConfig()
        {
            if (xls != null) xls.Save(FileName);
        }

        public override void DidRotate(UIInterfaceOrientation fromInterfaceOrientation)
        {
            FixKeyboard();
            var Layout = new UICollectionViewFlowLayout();
            var w = CalcCellWidth(CollectionView.Bounds.Width);
            Layout.ItemSize = new SizeF(w, 50);
            CollectionView.SetCollectionViewLayout(Layout, true);

        }

        void FixKeyboard()
        {
            if (InterfaceOrientation == UIInterfaceOrientation.Portrait || InterfaceOrientation == UIInterfaceOrientation.PortraitUpsideDown)
            {
                CollectionView.ContentInset = new UIEdgeInsets(20, 0, keybRect.Height + 40, 0);
            }
            else
            {
                CollectionView.ContentInset = new UIEdgeInsets(20, 0, keybRect.Width + 40, 0);
            }
        }

        public float CalcCellWidth(nfloat wd)
        {
            return 320;
        }

        public override UICollectionViewCell GetCell(UICollectionView collectionView, NSIndexPath indexPath)
        {
            var cell = (CalcCell)collectionView.DequeueReusableCell (CalcCellId, indexPath);
            cell.XlsRow = indexPath.Row + 1;
            cell.Heading = new TCellAddress(indexPath.Row + 1, 1).CellRef;
            cell.Content = GetCellOrFormula(indexPath.Row + 1);
            cell.ActiveCell = x => ActiveEdit = x;
            cell.Result = xls.GetStringFromCell(indexPath.Row + 1, 1);
            cell.OnRefresh = RefreshData;
            return cell;
        }

        string GetCellOrFormula(int row)
        {
            object cell = xls.GetCellValue(row, 1);
            if (cell == null)
                return "";
            TFormula fmla = (cell as TFormula);
            if (fmla != null)
                return fmla.Text;

            return Convert.ToString(cell);
        }

        private void RefreshData(CalcCell changedCell)
        {
            xls.SetCellFromString(changedCell.XlsRow, 1, changedCell.Content);
            xls.Recalc();

            foreach (CalcCell cell in CollectionView.VisibleCells)
            {
                cell.Result = xls.GetStringFromCell(cell.XlsRow, 1);
            }

        }

        public override nint NumberOfSections (UICollectionView collectionView)
        {
            return 1;
        }

        public override nint GetItemsCount (UICollectionView collectionView, nint section)
        {
            return 20;
        }

        public override void ItemHighlighted(UICollectionView collectionView, NSIndexPath indexPath)
        {
            collectionView.EndEditing(false);
        }

    }
}

FlexCalcViewController.designer.cs

// WARNING
//
// This file has been generated automatically by Xamarin Studio from the outlets and
// actions declared in your storyboard file.
// Manual changes to this file will not be maintained.
//
using Foundation;
using System;
using System.CodeDom.Compiler;
using UIKit;

namespace FlexCalc
{
   [Register ("FlexCalcViewController")]
    partial class FlexCalcViewController
    {
        void ReleaseDesignerOutlets ()
        {
        }
    }
}

Main.cs

using System;
using System.Collections.Generic;
using System.Linq;
using Foundation;
using UIKit;

namespace FlexCalc
{
    public class Application
    {
        // This is the main entry point of the application.
        static void Main(string[] args)
        {
            // if you want to use a different Application Delegate class from "AppDelegate"
            // you can specify it here.
            UIApplication.Main(args, null, "AppDelegate");
        }

    }
}


FlexView (C# / ios-unified) | FlexCel Studio for the .NET Framework documentation

FlexView (C# / ios-unified)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\csharp\VS2022\ios-unified\FlexView and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​csharp/​VS2022/​ios-​unified/​Flex​View

Overview

This example shows how to import xls and xlsx files from other applications (like mail or dropbox) into a Xamarin.iOS app using FlexCel, and also how to export pdf files from your app to other applications and for printing.

In order to use this sample, you need to first open a different app, like mail, locate an xls or xlsx attachment, press "Share", and select "FlexView". FlexView will convert that file to pdf and show it in a browser.

Once you have the file in FlexView, you can export the generated pdf back to mail, or dropbox, or any other app that can handle pdf files in your device. You can also print the pdf file.

There is a step-by-step tutorial on how this app was created available at https://doc.tmssoftware.com/flexcel/net/tutorials/ios-tutorial.html

Files

AppDelegate.cs

using System;
using System.Collections.Generic;
using System.Linq;
using Foundation;
using UIKit;

namespace FlexView
{
    // The UIApplicationDelegate for the application. This class is responsible for launching the
    // User Interface of the application, as well as listening (and optionally responding) to
    // application events from iOS.
    [Register ("AppDelegate")]
    public partial class AppDelegate : UIApplicationDelegate
    {
        // class-level declarations
        public override UIWindow Window
        {
            get;
            set;
        }
        // This method is invoked when the application is about to move from active to inactive state.
        // OpenGL applications should use this method to pause.
        public override void OnResignActivation(UIApplication application)
        {
        }
        // This method should be used to release shared resources and it should store the application state.
        // If your application supports background exection this method is called instead of WillTerminate
        // when the user quits.
        public override void DidEnterBackground(UIApplication application)
        {
        }

        /// This method is called as part of the transiton from background to active state.
        public override void WillEnterForeground(UIApplication application)
        {
        }

        /// This method is called when the application is about to terminate. Save data, if needed.
        public override void WillTerminate(UIApplication application)
        {
        }

        public override bool OpenUrl(UIApplication application, NSUrl url, string sourceApplication, NSObject annotation)
        {
            return ((FlexViewViewController)Window.RootViewController).Open(url);
        }
    }
}

FlexViewViewController.cs

using System;
using System.Drawing;
using Foundation;
using UIKit;
using FlexCel.Render;
using FlexCel.XlsAdapter;
using System.IO;
using System.Collections.Generic;

namespace FlexView
{
    public partial class FlexViewViewController : UIViewController
    {
        static bool UserInterfaceIdiomIsPhone
        {
            get { return UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Phone; }
        }

        public FlexViewViewController(IntPtr handle) : base (handle)
        {
        }

        public override void DidReceiveMemoryWarning()
        {
            // Releases the view if it doesn't have a superview.
            base.DidReceiveMemoryWarning();

            // Release any cached data, images, etc that aren't in use.
        }

        #region View lifecycle

        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            Viewer.LoadHtmlString("<html><h1>Please share an xls or xlsx file <br>from other app into FlexView.<br/ >" +
                                  "For help on how to use this example, please read the " + "" +
                                  "<a href=\"https://www.tmssoftware.com/flexcel/docs/net/FlexCelViewTutorial.pdf\">tutorial</a></h1></html>", null);

        }

        public override void ViewWillAppear(bool animated)
        {
            base.ViewWillAppear(animated);
        }

        public override void ViewDidAppear(bool animated)
        {
            base.ViewDidAppear(animated);
        }

        public override void ViewWillDisappear(bool animated)
        {
            base.ViewWillDisappear(animated);
        }

        public override void ViewDidDisappear(bool animated)
        {
            base.ViewDidDisappear(animated);
        }

        #endregion

        NSUrl XlsUrl;
        string XlsPath;
        string PdfPath;

        public bool Open(NSUrl url)
        {
            XlsUrl = url;
            XlsPath = url.Path;
            return Refresh();
        }

        private void RemoveOldPdf()
        {
            if (PdfPath != null)
            {
                try
                {
                    File.Delete(PdfPath);
                }
                catch
                {
                    //do nothing, this was just a cache that will get deleted anyway.
                }
                PdfPath = null;
            }
        }

        private bool Refresh()
        {
            RemoveOldPdf();
            try
            {
                XlsFile xls = new XlsFile(XlsPath);

                PdfPath = Path.Combine(
                    Environment.GetFolderPath(Environment.SpecialFolder.InternetCache),
                    Path.ChangeExtension(Path.GetFileName(XlsUrl.Path), ".pdf"));

                using (FlexCelPdfExport pdf = new FlexCelPdfExport(xls, true))
                {
                    using (FileStream fs = new FileStream(PdfPath, FileMode.Create))
                    {
                        pdf.Export(fs);
                    }
                }
                Viewer.LoadRequest(new NSUrlRequest(NSUrl.FromFilename(PdfPath)));

            }
            catch (Exception ex)
            {
                Viewer.LoadHtmlString("<html>Error opening " + System.Security.SecurityElement.Escape(Path.GetFileName(XlsUrl.Path))
                    + "<br><br>" + System.Security.SecurityElement.Escape(ex.Message) + "</html>", null);
                return false;
            }
            return true;
        }

        partial void ShareClick(UIKit.UIBarButtonItem sender)
        {
            if (PdfPath == null)
            {
                ShowHowToUse();
                return;
            }

            UIDocumentInteractionController docController = new UIDocumentInteractionController();
            docController.Url = NSUrl.FromFilename(PdfPath);
            docController.PresentOptionsMenu(ShareButton, true);

        }

        partial void RandomizeClick(UIKit.UIBarButtonItem sender)
        {
            if (XlsUrl == null)
            {
                ShowHowToUse();
                return;
            }

            XlsFile xls = new XlsFile(XlsPath, true);
            //We'll go through all the numeric cells and make them random numbers
            Random rnd = new Random();

            for (int row = 1; row <= xls.RowCount; row++)
            {
                for (int colIndex = 1; colIndex < xls.ColCountInRow(row); colIndex++)
                {
                    int XF = -1;
                    object val = xls.GetCellValueIndexed(row, colIndex, ref XF);
                    if (val is double) xls.SetCellValue(row, xls.ColFromIndex(row, colIndex), rnd.Next());
                }
            }

            //We can't save to the original file, we don't have permissions.
            XlsPath = Path.Combine(
                Environment.GetFolderPath(Environment.SpecialFolder.InternetCache),
                "tmpFlexCel" + Path.GetExtension(XlsUrl.Path));

            xls.Save(XlsPath);
            Refresh();
        }

        void ShowHowToUse()
        {
            using (var alert = UIAlertController.Create("Please open FlexView from other Application.",
                "In order to use this example you need to go to another app"
                + " like dropbox or mail, and share an xls or xlsx file with FlexView."
                + " When you click \"Share\" and select \"FlexView\" in the other app,"
                + " the file will be converted to pdf and previewed with FlexView.", UIAlertControllerStyle.Alert))
            {
                alert.AddAction(UIAlertAction.Create("Ok", UIAlertActionStyle.Cancel, null));
                PresentViewController(alert, animated: true, completionHandler: null);
            }
        }
    }
}

FlexViewViewController.designer.cs

// WARNING
//
// This file has been generated automatically by Xamarin Studio to store outlets and
// actions made in the UI designer. If it is removed, they will be lost.
// Manual changes to this file may not be handled correctly.
//
using Foundation;
using System.CodeDom.Compiler;

namespace FlexView
{
   [Register ("FlexViewViewController")]
    partial class FlexViewViewController
    {

       [Outlet]
        UIKit.UIBarButtonItem RandomizeButton { get; set; }

       [Outlet]
        UIKit.UIBarButtonItem ShareButton { get; set; }

       [Outlet]
        UIKit.UIWebView Viewer { get; set; }

       [Action ("RandomizeClick:")]
       [GeneratedCodeAttribute ("iOS Designer", "1.0")]
        partial void RandomizeClick (UIKit.UIBarButtonItem sender);

       [Action ("ShareClick:")]
        partial void ShareClick (UIKit.UIBarButtonItem sender);

        void ReleaseDesignerOutlets ()
        {
            if (RandomizeButton != null) {
                RandomizeButton.Dispose ();
                RandomizeButton = null;
            }

            if (ShareButton != null) {
                ShareButton.Dispose ();
                ShareButton = null;
            }

            if (Viewer != null) {
                Viewer.Dispose ();
                Viewer = null;
            }
        }
    }
}

Main.cs

using System;
using System.Collections.Generic;
using System.Linq;
using Foundation;
using UIKit;

namespace FlexView
{
    public class Application
    {
        // This is the main entry point of the application.
        static void Main(string[] args)
        {
            // if you want to use a different Application Delegate class from "AppDelegate"
            // you can specify it here.
            UIApplication.Main(args, null, "AppDelegate");
        }
    }
}


LangWars (C# / ios-unified) | FlexCel Studio for the .NET Framework documentation

LangWars (C# / ios-unified)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\csharp\VS2022\ios-unified\LangWars and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​csharp/​VS2022/​ios-​unified/​Lang​Wars

Overview

This example shows how to do a simple report doing FlexCel. It will fetch the most used tags from Stack Overflow and rank and provide a chart to visualize them. You can work with online or offline data, in case you don't have access to Stack Overflow.

In this example, we are exporting the results to an html file and showing the results in a web browser. We could also export to pdf, as shown in the "FlexView" demo.

Files

AppDelegate.cs

using System;
using System.Collections.Generic;
using System.Linq;
using Foundation;
using UIKit;

namespace LangWars
{
    // The UIApplicationDelegate for the application. This class is responsible for launching the
    // User Interface of the application, as well as listening (and optionally responding) to
    // application events from iOS.
    [Register("AppDelegate")]
    public partial class AppDelegate : UIApplicationDelegate
    {
        // class-level declarations
        public override UIWindow Window
        {
            get;
            set;
        }
        // This method is invoked when the application is about to move from active to inactive state.
        // OpenGL applications should use this method to pause.
        public override void OnResignActivation(UIApplication application)
        {
        }
        // This method should be used to release shared resources and it should store the application state.
        // If your application supports background exection this method is called instead of WillTerminate
        // when the user quits.
        public override void DidEnterBackground(UIApplication application)
        {
        }

        /// This method is called as part of the transiton from background to active state.
        public override void WillEnterForeground(UIApplication application)
        {
        }

        /// This method is called when the application is about to terminate. Save data, if needed.
        public override void WillTerminate(UIApplication application)
        {
        }
    }
}

LangData.cs

using System;
using System.Drawing;
using System.Runtime.Serialization;
using System.Collections.Generic;

namespace LangWars
{
    [DataContract]
    class LangDataList
    {
        [DataMember]
        public LangData[] items{ get; set; }
    }

    [DataContract]
    class LangData
    {
        [DataMember]
        public string name{ get; set; }
        [DataMember]
        public int count{ get; set; }
    }
}

LangWarsViewController.cs

using System;
using System.Drawing;
using Foundation;
using UIKit;
using System.Collections.Generic;
using FlexCel.Core;
using System.Net;
using System.IO;
using System.Runtime.Serialization.Json;
using FlexCel.Report;
using FlexCel.Render;
using FlexCel.XlsAdapter;
using System.Threading.Tasks;

namespace LangWars
{
    public partial class LangWarsViewController : UIViewController
    {
        bool HTMLLoaded = false;

        static bool UserInterfaceIdiomIsPhone
        {
            get { return UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Phone; }
        }

        public LangWarsViewController(IntPtr handle) : base (handle)
        {
        }

        public override void DidReceiveMemoryWarning()
        {
            // Releases the view if it doesn't have a superview.
            base.DidReceiveMemoryWarning();

            // Release any cached data, images, etc that aren't in use.
        }

        async public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            if (File.Exists(TempHtmlPath))
            {
                try
                {
                    await DisplayLastReport();
                }
                catch (Exception ex)
                {
                    SetHTML("<html>" + System.Security.SecurityElement.Escape(ex.Message) + "</html>");
                }

            }

            // Perform any additional setup after loading the view, typically from a nib.
        }

        async partial void FightClick(NSObject sender)
        {
            await TryCreateReport();

        }

        async Task<bool> TryCreateReport()
        {
            try
            {
                ProgressIndicator.StartAnimating();
                try
                {
                    bool Offline = OfflineSwitch.SelectedSegment == 0;
                    await Task.Run(()=>CreateReport(Offline));
                }
                finally
                {
                    ProgressIndicator.StopAnimating();
                }
            }
            catch (Exception ex)
            {
                SetHTML("<html>" + System.Security.SecurityElement.Escape(ex.Message) + "</html>");
                return false;
            }

            LoadHTML();
            return true;
        }

        async Task DisplayLastReport()
        {
            if (!File.Exists(TempHtmlPath))
            {
                await TryCreateReport();
                return;
            }

            LoadHTML();
        }

        void CreateReport(bool Offline)
        {
            var Langs = Offline? LoadData(): FetchData();
            var xls = RunReport(Langs);
            xls.Save(TempXlsPath); //we save it to share it and to display it on startup.
            GenerateHTML(xls);
        }

        LangDataList FetchData()
        {
            var httpWebRequest = (HttpWebRequest)WebRequest.Create("https://api.stackexchange.com/2.1/tags?order=desc&sort=popular&site=stackoverflow&pagesize=5");
            httpWebRequest.AutomaticDecompression = DecompressionMethods.Deflate | DecompressionMethods.GZip;
            httpWebRequest.Method = "GET";
            var httpResponse = (HttpWebResponse)httpWebRequest.GetResponse();

            DataContractJsonSerializer ser = new DataContractJsonSerializer(typeof(LangDataList));
            return (LangDataList)ser.ReadObject(httpResponse.GetResponseStream());
        }

        LangDataList LoadData()
        {
            using (var offlineData = new FileStream(Path.Combine(NSBundle.MainBundle.BundlePath, "OfflineData.txt"), FileMode.Open, FileAccess.Read))
            {
                DataContractJsonSerializer ser = new DataContractJsonSerializer(typeof(LangDataList));
                return (LangDataList)ser.ReadObject(offlineData);
            }
        }

        ExcelFile RunReport(LangDataList langs)
        {
            ExcelFile Result = new XlsFile(Path.Combine(NSBundle.MainBundle.BundlePath, "report.template.xls"), true);
            using (FlexCelReport fr = new FlexCelReport(true))
            {
                fr.AddTable("lang", langs.items);
                fr.Run(Result);
            }
            return Result;
        }

        string TempHtmlPath
        {
            get
            {
                return Path.Combine(
                    Environment.GetFolderPath(Environment.SpecialFolder.InternetCache),
                    "langwars.html");
            }
        }

        string TempXlsPath
        {
            get
            {
                return Path.Combine(
                    Environment.GetFolderPath(Environment.SpecialFolder.InternetCache),
                    "langwars.xls");
            }
        }

        void GenerateHTML(ExcelFile xls)
        {

            using (FlexCelHtmlExport html = new FlexCelHtmlExport(xls, true))
            {
                //If we were using png, we would have to set
                //a high resolution so this looks nice in high resolution displays.
                //html.ImageResolution = 326;

                //but we will use SVG, which is vectorial:
                html.HtmlVersion = THtmlVersion.Html_5;
                html.SavedImagesFormat = THtmlImageFormat.Svg;
                html.EmbedImages = true;

                html.Export(TempHtmlPath, ".");
            }

        }

        void LoadHTML()
        {
            if (!HTMLLoaded)
            {
                ResultsWindow.LoadRequest(new NSMutableUrlRequest(NSUrl.FromFilename(TempHtmlPath),
                                                                  NSUrlRequestCachePolicy.ReloadIgnoringLocalAndRemoteCacheData, 60));
                HTMLLoaded = true;
            }
            else
            {
                //WebView doesn't refresh the images if you just load the request again (even if ignoring the cache). So we need to call Reload instead
                ResultsWindow.Reload();
            }
        }

        void SetHTML(string html)
        {
            ResultsWindow.LoadHtmlString(html, null);
            HTMLLoaded = false;
        }

        async partial void ShareClick(NSObject sender)
        {
            if (!File.Exists(TempXlsPath))
            {
                if (!await TryCreateReport()) return;
            }
            UIDocumentInteractionController docController = new UIDocumentInteractionController();
            docController.Url = NSUrl.FromFilename(TempXlsPath);
            docController.PresentOptionsMenu((UIBarButtonItem) sender, true);

        }
    }
}

LangWarsViewController.designer.cs

// WARNING
//
// This file has been generated automatically by Xamarin Studio to store outlets and
// actions made in the UI designer. If it is removed, they will be lost.
// Manual changes to this file may not be handled correctly.
//
using Foundation;
using System.CodeDom.Compiler;

namespace LangWars
{
   [Register ("LangWarsViewController")]
    partial class LangWarsViewController
    {
       [Outlet]
        UIKit.UISegmentedControl OfflineSwitch { get; set; }

       [Outlet]
        UIKit.UIActivityIndicatorView ProgressIndicator { get; set; }

       [Outlet]
        UIKit.UIWebView ResultsWindow { get; set; }

       [Outlet]
        UIKit.UIBarButtonItem ShareButton { get; set; }

       [Action ("FightClick:")]
        partial void FightClick (Foundation.NSObject sender);

       [Action ("ShareClick:")]
        partial void ShareClick (Foundation.NSObject sender);

        void ReleaseDesignerOutlets ()
        {
            if (OfflineSwitch != null) {
                OfflineSwitch.Dispose ();
                OfflineSwitch = null;
            }

            if (ResultsWindow != null) {
                ResultsWindow.Dispose ();
                ResultsWindow = null;
            }

            if (ProgressIndicator != null) {
                ProgressIndicator.Dispose ();
                ProgressIndicator = null;
            }

            if (ShareButton != null) {
                ShareButton.Dispose ();
                ShareButton = null;
            }
        }
    }
}

Main.cs

using System;
using System.Collections.Generic;
using System.Linq;
using Foundation;
using UIKit;

namespace LangWars
{
    public class Application
    {
        // This is the main entry point of the application.
        static void Main(string[] args)
        {
            // if you want to use a different Application Delegate class from "AppDelegate"
            // you can specify it here.
            UIApplication.Main(args, null, "AppDelegate");
        }
    }
}


macOS Examples (C#) | FlexCel Studio for the .NET Framework documentation

macOS Examples (C#)

Overview

The examples in this section require Xamarin with macOS support.

In this section

  • Getting started with FlexCel and macOS


Getting started with FlexCel and macOS (C# / mac-unified) | FlexCel Studio for the .NET Framework documentation

Getting started with FlexCel and macOS (C# / mac-unified)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\csharp\VS2022\mac-unified\GettingStarted and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​csharp/​VS2022/​mac-​unified/​Getting​Started

Overview

The examples in this section apply to FlexCel for macOS.

We only include a getting started example for macOS. For all the functionality, take a look at the netframework demos.

Files

AppDelegate.cs

using System;
using System.Drawing;
using Foundation;
using AppKit;
using ObjCRuntime;

namespace GettingStarted
{
    public partial class AppDelegate : NSApplicationDelegate
    {
        MainWindowController mainWindowController;

        public AppDelegate()
        {
        }

        public override void DidFinishLaunching (NSNotification notification)
        {
            mainWindowController = new MainWindowController();
            mainWindowController.Window.MakeKeyAndOrderFront(this);
        }

        public override bool ApplicationShouldTerminateAfterLastWindowClosed(NSApplication sender)
        {
            return true;

        }
    }
}

AppDelegate.designer.cs

namespace GettingStarted
{
    // Should subclass MonoMac.AppKit.NSResponder
    [Foundation.Register("AppDelegate")]
    public partial class AppDelegate
    {
    }
}

Main.cs

using System;
using System.Drawing;
using Foundation;
using AppKit;
using ObjCRuntime;

namespace GettingStarted
{
    class MainClass
    {
        static void Main(string[] args)
        {
            NSApplication.Init();
            NSApplication.Main(args);
        }
    }
}

MainWindow.cs

using System;
using System.Collections.Generic;
using System.Linq;
using Foundation;
using AppKit;

namespace GettingStarted
{
    public partial class MainWindow : NSWindow
    {
        #region Constructors
        // Called when created from unmanaged code
        public MainWindow(IntPtr handle) : base (handle)
        {
            Initialize();
        }
        // Called when created directly from a XIB file
        [Export ("initWithCoder:")]
        public MainWindow(NSCoder coder) : base (coder)
        {
            Initialize();
        }
        // Shared initialization code
        void Initialize()
        {
        }
        #endregion
    }
}

MainWindow.designer.cs

// WARNING
//
// This file has been generated automatically by Xamarin Studio to store outlets and
// actions made in the UI designer. If it is removed, they will be lost.
// Manual changes to this file may not be handled correctly.
//
using Foundation;
using System.CodeDom.Compiler;

namespace GettingStarted
{
   [Register ("MainWindow")]
    partial class MainWindow
    {

        void ReleaseDesignerOutlets ()
        {
        }
    }

   [Register ("MainWindowController")]
    partial class MainWindowController
    {
       [Action ("CreateFile:")]
        partial void CreateFile (Foundation.NSObject sender);

        void ReleaseDesignerOutlets ()
        {
        }
    }
}

MainWindowController.cs

using System;
using System.Collections.Generic;
using System.Linq;
using Foundation;
using AppKit;
using FlexCel.XlsAdapter;
using FlexCel.Core;

namespace GettingStarted
{
    public partial class MainWindowController : AppKit.NSWindowController
    {
        #region Constructors
        // Called when created from unmanaged code
        public MainWindowController(IntPtr handle) : base (handle)
        {
            Initialize();
        }
        // Called when created directly from a XIB file
        [Export ("initWithCoder:")]
        public MainWindowController(NSCoder coder) : base (coder)
        {
            Initialize();
        }
        // Call to load from the XIB/NIB file
        public MainWindowController() : base ("MainWindow")
        {
            Initialize();
        }
        // Shared initialization code
        void Initialize()
        {
        }
        #endregion
        //strongly typed window accessor
        public new MainWindow Window
        {
            get
            {
                return (MainWindow)base.Window;
            }
        }

        partial void CreateFile(NSObject sender)
        {
            var xls = new XlsFile(1, true);
            xls.SetCellValue(1, 1, "Hello OSX Unified!");
            xls.SetCellValue(2, 1, new TFormula("=\"Make sure to \" & \"look at the Windows examples\""));
            xls.SetCellValue(3, 1, "for information on how to use FlexCel");
            xls.SetCellValue(5, 1, "Concepts are similar, so it doesn't make sense to repeat them all here.");

            xls.AutofitCol(1, false, 1.2);

            NSSavePanel SaveDialog = new NSSavePanel();
            {
                SaveDialog.Title = "Save file as...";
                SaveDialog.AllowedFileTypes = new string[] {"xlsx", "xls"};
                SaveDialog.BeginSheet(Window,
                (x) =>
                {
                    if (SaveDialog.Url != null)
                    {
                        xls.Save(SaveDialog.Url.Path);
                    }
                });
            }

        }

    }
}


.NET Core Examples (C#) | FlexCel Studio for the .NET Framework documentation

.NET Core Examples (C#)

Overview

The examples in this section apply to FlexCel for .NET Core.

In this section

  • Getting Started with .NET Core


Getting Started with .NET Core (C# / netcore) | FlexCel Studio for the .NET Framework documentation

Getting Started with .NET Core (C# / netcore)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\csharp\VS2022\netcore\10.GettingStarted and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​csharp/​VS2022/​netcore/​10.​Getting​Started

Overview

In this simple example we just create a basic file. We won't be repeating all the examples here since they are identical to the "Classic" Framework examples.

Just make sure to look at the csharp examples instead.

Files

Program.cs

using FlexCel.Core;
using FlexCel.Render;
using FlexCel.XlsAdapter;
using System;

namespace GettingStarted
{
    class Program
    {
        static void Main(string[] args)
        {
            var xls = new XlsFile(1, TExcelFileFormat.v2019, true);
            xls.SetCellValue(1, 1, "Hello");
            xls.SetCellValue(2, 1, "World");
            xls.SetCellValue(3, 1, new TFormula("=A1 & \" \" & A2"));

            xls.Save("helloworld.xlsx");
            using (FlexCelPdfExport pdf = new FlexCelPdfExport(xls, true))
            {
                pdf.Export("helloworld.pdf");
            }

            Console.WriteLine("All done!");

        }
    }
}


Universal Windows Platform (UWP) Examples (C#) | FlexCel Studio for the .NET Framework documentation

Universal Windows Platform (UWP) Examples (C#)

Overview

Here are a list of examples that run in Windows Universal Platform using the UWP FlexCel dll. Note that the demos require Visual Studio 2017 or newer.

You can also use .NET core to create apps for UWP.

In this section

  • FlexCalc Example

  • LangWars Example


FlexCalc Example (C# / uwp10) | FlexCel Studio for the .NET Framework documentation

FlexCalc Example (C# / uwp10)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\csharp\VS2022\uwp10\FlexCalc and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​csharp/​VS2022/​uwp10/​FlexCalc

Overview

This example shows how to use the FlexCel calculating engine as a calculator for the device.

Under the hood, every textbox in the app is mapped to a cell in a spreadsheet (A1, A2, A3...), and whenever a textbox changes, the sheet is recalculated and the results of the new calculations are shown at the column on the right. You can use the full range of Excel functions in this demo, and reference cells in the usual way (for example, you can write "=A2 + 1" in the textbox for A3)

As in Excel, any text that starts with "=" will be considered a formula.

The backing spreadsheet will be saved when you exit the app and loaded when open it, and this will allow to persist the formulas between sessions.

Files

App.xaml.cs

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.ApplicationModel;
using Windows.ApplicationModel.Activation;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;

namespace FlexCalc
{
    /// <summary>
    /// Provides application-specific behavior to supplement the default Application class.
    /// </summary>
    sealed partial class App : Application
    {
        /// <summary>
        /// Initializes the singleton application object.  This is the first line of authored code
        /// executed, and as such is the logical equivalent of main() or WinMain().
        /// </summary>
        public App()
        {
            this.InitializeComponent();
            this.Suspending += OnSuspending;
        }

        /// <summary>
        /// Invoked when the application is launched normally by the end user.  Other entry points
        /// will be used such as when the application is launched to open a specific file.
        /// </summary>
        /// <param name="e">Details about the launch request and process.</param>
        protected override void OnLaunched(LaunchActivatedEventArgs e)
        {
            Frame rootFrame = Window.Current.Content as Frame;

            // Do not repeat app initialization when the Window already has content,
            // just ensure that the window is active
            if (rootFrame == null)
            {
                // Create a Frame to act as the navigation context and navigate to the first page
                rootFrame = new Frame();

                rootFrame.NavigationFailed += OnNavigationFailed;

                if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
                {

                }

                // Place the frame in the current Window
                Window.Current.Content = rootFrame;
            }

            if (e.PrelaunchActivated == false)
            {
                if (rootFrame.Content == null)
                {
                    // When the navigation stack isn't restored navigate to the first page,
                    // configuring the new page by passing required information as a navigation
                    // parameter
                    rootFrame.Navigate(typeof(MainPage), e.Arguments);
                }
                // Ensure the current window is active
                Window.Current.Activate();
            }
        }

        /// <summary>
        /// Invoked when Navigation to a certain page fails
        /// </summary>
        /// <param name="sender">The Frame which failed navigation</param>
        /// <param name="e">Details about the navigation failure</param>
        void OnNavigationFailed(object sender, NavigationFailedEventArgs e)
        {
            throw new Exception("Failed to load Page " + e.SourcePageType.FullName);
        }

        /// <summary>
        /// Invoked when application execution is being suspended.  Application state is saved
        /// without knowing whether the application will be terminated or resumed with the contents
        /// of memory still intact.
        /// </summary>
        /// <param name="sender">The source of the suspend request.</param>
        /// <param name="e">Details about the suspend request.</param>
        private void OnSuspending(object sender, SuspendingEventArgs e)
        {
            var deferral = e.SuspendingOperation.GetDeferral();

            deferral.Complete();
        }
    }
}

DataModel.cs

using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using FlexCel.Core;
using FlexCel.XlsAdapter;

namespace FlexCalc
{
    class DataModel
    {
        ExcelFile xls;
        bool Saving;

        public void LoadSpreadsheet(string FileName)
        {
            if (xls == null) xls = new XlsFile(true);
            try
            {
                xls.Open(FileName);
            }
            catch
            {
                xls.NewFile(1, TExcelFileFormat.v2019);
                xls.SetCellValue(1, 1, "Example");
                xls.SetCellValue(2, 1, 42);
                xls.SetCellValue(3, 1, new TFormula("=Sqrt(A2) * A2^2"));
            }

        }

        public bool Loaded
        {
            get { return xls != null; }
        }

        public string GetCellOrFormula(int row)
        {
            object cell = xls.GetCellValue(row, 1);
            if (cell == null)
                return "";
            TFormula fmla = (cell as TFormula);
            if (fmla != null)
                return fmla.Text;

            return Convert.ToString(cell);
        }

        public string GetStringFromCell(int row, int col)
        {
            return xls.GetStringFromCell(row, col);
        }

        public void SetCellFromString(int row, int col, string value)
        {
            xls.SetCellFromString(row, col, value);
        }

        internal void SaveState(string FileName)
        {
            if (Saving) return; //if 2 or more events try to save, only listen to one.
            Saving = true;
            try
            {
                xls.Save(FileName);
            }
            finally
            {
                Saving = false;
            }
        }

        public void Recalc()
        {
            xls.Recalc();
        }
    }
}

MainPage.xaml.cs

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;

namespace FlexCalc
{
    /// <summary>
    /// An empty page that can be used on its own or navigated to within a Frame.
    /// </summary>
    public sealed partial class MainPage : Page
    {
        DataModel Model = new DataModel();
        readonly string FileName = Path.Combine(Windows.Storage.ApplicationData.Current.TemporaryFolder.Path,  "result.xlsx");
        bool UpdatingInput;

        public MainPage()
        {
            this.InitializeComponent();
        }

        private void Page_Loaded(object sender, RoutedEventArgs e)
        {
            UpdatingInput = true;
            try
            {
                Model.LoadSpreadsheet(FileName);
                CreateCells();
                FillInput();
            }
            finally
            {
                UpdatingInput = false;
            }
        }

        private void CreateCells()
        {
            for (int i = 0; i < 10; i++)
            {
                ContentPanel.RowDefinitions.Add(new RowDefinition());
            }

            for (int r = 0; r < ContentPanel.RowDefinitions.Count; r++)
            {
                var Head = new TextBlock() { Text = "A" + (r + 1).ToString(), VerticalAlignment = VerticalAlignment.Center, FontSize = 16 };
                ContentPanel.Children.Add(Head);
                Grid.SetRow(Head, r);
                Grid.SetColumn(Head, 0);

                var Formula = new TextBox() { TextWrapping = TextWrapping.Wrap };
                ContentPanel.Children.Add(Formula);
                Grid.SetRow(Formula, r);
                Grid.SetColumn(Formula, 1);
                Formula.InputScope = new InputScope() { Names = { new InputScopeName() { NameValue = InputScopeNameValue.Formula } } };
                Formula.TextChanged += Formula_TextChanged;

                var Result = new TextBlock() { VerticalAlignment = VerticalAlignment.Center, FontSize = 16 };
                ContentPanel.Children.Add(Result);
                Grid.SetRow(Result, r);
                Grid.SetColumn(Result, 2);

            }
        }

        private void FillInput()
        {
            var boxes = from b in ContentPanel.Children where (b is TextBox) && Grid.GetColumn(b as TextBox) == 1 select b;
            foreach (TextBox b in boxes)
            {
                b.Text = Model.GetCellOrFormula(Grid.GetRow(b) + 1);
            }
        }

        void Formula_TextChanged(object sender, TextChangedEventArgs e)
        {
            if (!Model.Loaded || UpdatingInput) return;
            TextBox tb = sender as TextBox;
            if (tb == null) return;
            Model.SetCellFromString(Grid.GetRow(tb) + 1, 1, tb.Text);
            Model.SaveState(FileName);
            Model.Recalc();
            UpdateResults();
        }

        private void UpdateResults()
        {
            var boxes = from b in ContentPanel.Children where (b is TextBlock) && Grid.GetColumn(b as TextBlock) == 2 select b;
            foreach (TextBlock b in boxes)
            {
                b.Text = Model.GetStringFromCell(Grid.GetRow(b) + 1, 1);
            }
        }
    }
}


LangWars Example (C# / uwp10) | FlexCel Studio for the .NET Framework documentation

LangWars Example (C# / uwp10)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\csharp\VS2022\uwp10\LangWars and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​csharp/​VS2022/​uwp10/​Lang​Wars

Overview

This example shows how to do a simple report doing FlexCel. It will fetch the most used tags from Stack Overflow and rank and provide a chart to visualize them. You can work with online or offline data, in case you don't have access to Stack Overflow.

In this example, we are exporting the results to an html file and showing the results in a web browser. We could also export to pdf, as shown in the "FlexView" demo.

Files

App.xaml.cs

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.ApplicationModel;
using Windows.ApplicationModel.Activation;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;

namespace LangWars
{
    /// <summary>
    /// Provides application-specific behavior to supplement the default Application class.
    /// </summary>
    sealed partial class App : Application
    {
        /// <summary>
        /// Initializes the singleton application object.  This is the first line of authored code
        /// executed, and as such is the logical equivalent of main() or WinMain().
        /// </summary>
        public App()
        {
            this.InitializeComponent();
            this.Suspending += OnSuspending;
        }

        /// <summary>
        /// Invoked when the application is launched normally by the end user.  Other entry points
        /// will be used such as when the application is launched to open a specific file.
        /// </summary>
        /// <param name="e">Details about the launch request and process.</param>
        protected override void OnLaunched(LaunchActivatedEventArgs e)
        {
            Frame rootFrame = Window.Current.Content as Frame;

            // Do not repeat app initialization when the Window already has content,
            // just ensure that the window is active
            if (rootFrame == null)
            {
                // Create a Frame to act as the navigation context and navigate to the first page
                rootFrame = new Frame();

                rootFrame.NavigationFailed += OnNavigationFailed;

                if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
                {

                }

                // Place the frame in the current Window
                Window.Current.Content = rootFrame;
            }

            if (e.PrelaunchActivated == false)
            {
                if (rootFrame.Content == null)
                {
                    // When the navigation stack isn't restored navigate to the first page,
                    // configuring the new page by passing required information as a navigation
                    // parameter
                    rootFrame.Navigate(typeof(MainPage), e.Arguments);
                }
                // Ensure the current window is active
                Window.Current.Activate();
            }
        }

        /// <summary>
        /// Invoked when Navigation to a certain page fails
        /// </summary>
        /// <param name="sender">The Frame which failed navigation</param>
        /// <param name="e">Details about the navigation failure</param>
        void OnNavigationFailed(object sender, NavigationFailedEventArgs e)
        {
            throw new Exception("Failed to load Page " + e.SourcePageType.FullName);
        }

        /// <summary>
        /// Invoked when application execution is being suspended.  Application state is saved
        /// without knowing whether the application will be terminated or resumed with the contents
        /// of memory still intact.
        /// </summary>
        /// <param name="sender">The source of the suspend request.</param>
        /// <param name="e">Details about the suspend request.</param>
        private void OnSuspending(object sender, SuspendingEventArgs e)
        {
            var deferral = e.SuspendingOperation.GetDeferral();

            deferral.Complete();
        }
    }
}

FileShare.cs

using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using Windows.ApplicationModel.DataTransfer;
using Windows.Storage;

namespace LangWars
{
    static class FileShare
    {
        public static void Register()
        {
            var dtm = DataTransferManager.GetForCurrentView();
            dtm.DataRequested += dtm_DataRequested;
        }

        public static void Share()
        {
            DataTransferManager.ShowShareUI();
        }

        public static async void dtm_DataRequested(DataTransferManager sender, DataRequestedEventArgs args)
        {
            try
            {
                args.Request.Data.Properties.Title = "Language Wars";
                args.Request.Data.Properties.Description = "Send the file with statistics to another app.";
                args.Request.Data.Properties.FileTypes.Add(".xlsx");
                var file = await ReportGenerator.TempXlsPath.GetFileAsync(ReportGenerator.TempXlsName);
                args.Request.Data.SetStorageItems(new IStorageFile[] { file });
            }
            catch (FileNotFoundException)
            {
                args.Request.FailWithDisplayText("There is no generated file to share. Make sure to press the 'Fight' button first.");
            }
            catch (Exception ex)
            {
                args.Request.FailWithDisplayText("There was an error: " + ex.Message);
            }
        }

    }
}

LangData.cs

using System;
using System.Runtime.Serialization;
using System.Collections.Generic;

namespace LangWars
{
    [DataContract]
    class LangDataList
    {
        [DataMember]
        public LangData[] items{ get; set; }
    }

    [DataContract]
    class LangData
    {
        [DataMember]
        public string name{ get; set; }
        [DataMember]
        public int count{ get; set; }
    }
}

MainPage.xaml.cs

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Runtime.InteropServices.WindowsRuntime;
using System.Text;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;

namespace LangWars
{
    /// <summary>
    /// An empty page that can be used on its own or navigated to within a Frame.
    /// </summary>
    public sealed partial class MainPage : Page
    {
        bool Offline => !OnlineButton.IsChecked.GetValueOrDefault(false);

        public MainPage()
        {
            this.InitializeComponent();
            Encoding.RegisterProvider(CodePagesEncodingProvider.Instance); //Make all encodings available. Not really necessary as the app will work anyway with other encodings.
            this.NavigationCacheMode = NavigationCacheMode.Required;
            ResultsWindow.NavigationCompleted += ResultsWindow_NavigationCompleted;
            FileShare.Register();
        }

        private void ResultsWindow_NavigationCompleted(WebView sender, WebViewNavigationCompletedEventArgs args)
        {
            if (!args.IsSuccess)
            {
                SetHTML("<html>" + WebUtility.HtmlEncode("Press the Fight button!") + "</html>");
            }
        }

        private void StartProgress()
        {
            // see http://code.msdn.microsoft.com/windowsapps/How-to-put-a-ProgressRing-a92f2530
            Progress.IsActive = true;
            Progress.Visibility = Windows.UI.Xaml.Visibility.Visible;
            WebViewBrush brush = new WebViewBrush();
            brush.SourceName = "ResultsWindow";
            brush.Redraw();
            MaskRectangle.Fill = brush;
            MaskRectangle.Visibility = Windows.UI.Xaml.Visibility.Visible;
            ResultsWindow.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
        }

        private void EndProgress()
        {
            Progress.IsActive = false;
            Progress.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
            ResultsWindow.Visibility = Windows.UI.Xaml.Visibility.Visible;
            MaskRectangle.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
        }

        private void PhoneApplicationPage_Loaded(object sender, RoutedEventArgs e)
        {
            //OpenLastReport();
        }

        private void OpenLastReport()
        {
            try
            {
                LoadHTML();
            }
            catch (Exception ex)
            {
                SetHTML("<html>" + WebUtility.HtmlEncode(ex.Message) + "</html>");
            }
        }

        private async void appBarFightButton_Click(object sender, RoutedEventArgs e)
        {
            appBar.IsEnabled = false;
            try
            {
                await new ReportGenerator().TryCreateReport(Offline, StartProgress, EndProgress, LoadHTML, SetHTML);
            }
            finally
            {
                appBar.IsEnabled = true;
            }
        }

        void LoadHTML()
        {
            ResultsWindow.Navigate(new System.Uri("ms-appdata:///local/" + ReportGenerator.TempHtmlRelFolder + "/" + ReportGenerator.TempHtmlName));
        }

        void SetHTML(string html)
        {
            ResultsWindow.NavigateToString(html);
        }

        private void ShareButton_Click(object sender, RoutedEventArgs e)
        {
            FileShare.Share();
        }
    }
}

ReportGenerator.cs

using System;
using System.IO;
using System.Collections.Generic;
using System.Net;
using System.Net.Http;
using System.Runtime.Serialization.Json;
using System.Text;
using System.Threading.Tasks;
using FlexCel.Core;
using FlexCel.Report;
using FlexCel.XlsAdapter;
using Windows.Storage;
using FlexCel.Render;

namespace LangWars
{
    class ReportGenerator
    {
        public const string TempHtmlRelFolder = "htm";
        public const string TempHtmlName = "langwars.html";
        public const string TempXlsName = "langwars.xlsx";

        public async Task<bool> TryCreateReport(bool Offline, Action StartProgress, Action EndProgress, Action LoadHTML, Action<string> SetHTML)
        {
            try
            {
                StartProgress();
                try
                {
                    await Task.Run(() => CreateReport(Offline));
                }
                finally
                {
                    EndProgress();
                }
            }
            catch (Exception ex)
            {
                SetHTML("<html>" + WebUtility.HtmlEncode(ex.Message) + "</html>");
                return false;
            }

            LoadHTML();
            return true;
        }

        async Task CreateReport(bool Offline)
        {
            var Langs = Offline ? await LoadData() : await FetchData();
            var xls = await RunReport(Langs);
            xls.Save(Path.Combine(TempXlsPath.Path, TempXlsName)); //we save it to share it and to display it on startup.
            await GenerateHTML(xls);
        }

        async Task<LangDataList> FetchData()
        {
            const string url = "https://api.stackexchange.com/2.1/tags?order=desc&sort=popular&site=stackoverflow&pagesize=5";

            var handler = new HttpClientHandler();
            if (handler.SupportsAutomaticDecompression)
            {
                handler.AutomaticDecompression = DecompressionMethods.GZip |
                                                 DecompressionMethods.Deflate;
            }
            var client = new HttpClient(handler);
            var response = await client.SendAsync(new HttpRequestMessage(HttpMethod.Get, new Uri(url)));

            string s = await response.Content.ReadAsStringAsync();
            DataContractJsonSerializer ser = new DataContractJsonSerializer(typeof(LangDataList));

            return (LangDataList)ser.ReadObject(await response.Content.ReadAsStreamAsync());
        }

        async Task<LangDataList> LoadData()
        {
            var offlineFile = await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///Assets/Data/OfflineData.txt"));
            using (var offlineData = await offlineFile.OpenStreamForReadAsync())
            {
                DataContractJsonSerializer ser = new DataContractJsonSerializer(typeof(LangDataList));
                return (LangDataList)ser.ReadObject(offlineData);
            }
        }

        async Task<ExcelFile> RunReport(LangDataList langs)
        {
            ExcelFile Result = new XlsFile(true);
            var template = await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///Assets/Templates/report.template.xlsx"));
            using (var templateStream = await template.OpenStreamForReadAsync())
            {
                Result.Open(templateStream);
                using (FlexCelReport fr = new FlexCelReport(true))
                {
                    fr.AddTable("lang", langs.items);
                    fr.Run(Result);
                }
            }
            return Result;
        }

        public static StorageFolder TempXlsPath
        {
            get
            {
                return ApplicationData.Current.LocalFolder;
            }
        }

        public async static Task<StorageFolder> TempHtmlPath()
        {
            return await ApplicationData.Current.LocalFolder.CreateFolderAsync(TempHtmlRelFolder, CreationCollisionOption.OpenIfExists);
        }

        public async static Task<string> TempHtmlPathString()
        {
            var folder = await TempHtmlPath();
            return folder.Path;
        }

        async Task GenerateHTML(ExcelFile xls)
        {

            using (FlexCelHtmlExport html = new FlexCelHtmlExport(xls, true))
            {
                html.SavedImagesFormat = THtmlImageFormat.Svg; //vectorial so it can zoom.
                html.EmbedImages = true;

                //see http://blogs.windows.com/windows_phone/b/wpdev/archive/2011/03/14/managing-the-windows-phone-browser-viewport.aspx
                html.ExtraInfo.Meta = new string[] { "<meta name=\"viewport\" content=\"width=device-width\" />" };
                html.Export(Path.Combine(await TempHtmlPathString(), TempHtmlName), ".");
            }

        }
    }
}


Examples for VB.Net | FlexCel Studio for the .NET Framework documentation

Examples for VB.Net

In this section

  • .NET Framework Examples


.NET Framework Examples (VB.Net) | FlexCel Studio for the .NET Framework documentation

.NET Framework Examples (VB.Net)

Overview

The main demos for FlexCel Studio. The demos here are in Winforms, but they apply to most of the .NET framework variations.

In this section

  • API Demos

  • Report demos

  • Printing, previewing and exporting files

  • Thanks


API Demos (VB.Net / netframework) | FlexCel Studio for the .NET Framework documentation

API Demos (VB.Net / netframework)

Overview

This section contains demos for reading and writing Excel files using the native FlexCel engine.

In this section

  • Getting started

  • Advanced API

  • Chart API

  • Reading Excel files

  • Working in virtual mode

  • Reading and writing encrypted files

  • FlexCel image explorer

  • Flexcel object explorer

  • Copy and paste

  • Using hyperlinks

  • Intelligent page breaks

  • Validating FlexCel recalculation

  • Recalculation of linked files

  • Excel user defined functions (UDF)

  • Consolidating files

  • Creating pdf files with the PDF API

  • Handling non-fatal errors


Getting started (VB.Net / netframework) | FlexCel Studio for the .NET Framework documentation

Getting started (VB.Net / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\vb\VS2022\netframework\10.API\10.GettingStarted and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​vb/​VS2022/​netframework/​Modules/​10.​API/​10.​Getting​Started

Overview

A simple demo showing how to create an Excel file with the API from scratch.

Concepts

  • Before using FlexCel, you have to add it to the references, and add "using FlexCel.Core" and "using FlexCel.XlsAdapter" to your using statements.

  • The most important class here is the XlsFile class, from where you can read and write to any Excel 2 or newer file.

  • To set the value for a cell, use XlsFile.SetCellValue. You can set any kind of object here, not just text. If you set it to a TFormula object, you will enter a formula.

  • As explained in the FlexCel API Developer Guide, formats in Excel are indexes to an XF (eXtended Format list) To modify the format on a cell, you have to assign an XF index to that cell. To create new XF formats, use XlsFile.AddFormat

Files

AssemblyInfo.vb

Imports System.Reflection
Imports System.Runtime.CompilerServices

'
' General Information about an assembly is controlled through the following
' set of attributes. Change these attribute values to modify the information
' associated with an assembly.
'
<Assembly: AssemblyTitle("")>
<Assembly: AssemblyDescription("")>
<Assembly: AssemblyConfiguration("")>
<Assembly: AssemblyCompany("")>
<Assembly: AssemblyProduct("")>
<Assembly: AssemblyCopyright("(c) 2002 - 2014 TMS Software")>
<Assembly: AssemblyTrademark("")>
<Assembly: AssemblyCulture("")>

'
' Version information for an assembly consists of the following four values:
'
'      Major Version
'      Minor Version
'      Build Number
'      Revision
'
' You can specify all the values or you can default the Revision and Build Numbers
' by using the '*' as shown below:

<Assembly: AssemblyVersion("6.2.1.0")>

'
' In order to sign your assembly you must specify a key to use. Refer to the
' Microsoft .NET Framework documentation for more information on assembly signing.
'
' Use the attributes below to control which key is used for signing.
'
' Notes:
'   (*) If no key is specified, the assembly is not signed.
'   (*) KeyName refers to a key that has been installed in the Crypto Service
'       Provider (CSP) on your machine. KeyFile refers to a file which contains
'       a key.
'   (*) If the KeyFile and the KeyName values are both specified, the
'       following processing occurs:
'       (1) If the KeyName can be found in the CSP, that key is used.
'       (2) If the KeyName does not exist and the KeyFile does exist, the key
'           in the KeyFile is installed into the CSP and used.
'   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
'       When specifying the KeyFile, the location of the KeyFile should be
'       relative to the project output directory which is
'       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
'       located in the project directory, you would specify the AssemblyKeyFile
'       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
'   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
'       documentation for more information on this.
'
<Assembly: AssemblyDelaySign(False)>
<Assembly: AssemblyKeyFile("")>
<Assembly: AssemblyKeyName("")>

Form1.Designer.vb

Imports System.Collections
Imports System.ComponentModel
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports System.IO
Imports System.Reflection
Namespace GettingStarted
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        ''' <summary>
        ''' Required designer variable.
        ''' </summary>
        Private components As System.ComponentModel.Container = Nothing

        ''' <summary>
        ''' Clean up any resources being used.
        ''' </summary>
        Protected Overrides Sub Dispose(ByVal disposing As Boolean)
            If disposing Then
                If components IsNot Nothing Then
                    components.Dispose()
                End If
            End If
            MyBase.Dispose(disposing)
        End Sub

        #Region "Windows Form Designer generated code"
        ''' <summary>
        ''' Required method for Designer support - do not modify
        ''' the contents of this method with the code editor.
        ''' </summary>
        Private Sub InitializeComponent()
            Me.button1 = New System.Windows.Forms.Button()
            Me.saveFileDialog1 = New System.Windows.Forms.SaveFileDialog()
            Me.label1 = New System.Windows.Forms.Label()
            Me.cbAutoOpen = New System.Windows.Forms.CheckBox()
            Me.SuspendLayout()
            '
            ' button1
            '
            Me.button1.Anchor = System.Windows.Forms.AnchorStyles.Bottom
            Me.button1.Location = New System.Drawing.Point(78, 160)
            Me.button1.Name = "button1"
            Me.button1.Size = New System.Drawing.Size(75, 23)
            Me.button1.TabIndex = 0
            Me.button1.Text = "GO!"
'           Me.button1.Click += New System.EventHandler(Me.button1_Click)
            '
            ' saveFileDialog1
            '
            Me.saveFileDialog1.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm|Excel 97/2003|*.xls|Excel 2007|*.xlsx;*.xlsm|All " & "files|*.*"
            Me.saveFileDialog1.RestoreDirectory = True
            '
            ' label1
            '
            Me.label1.Anchor = (CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) Or System.Windows.Forms.AnchorStyles.Left) Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.label1.BackColor = System.Drawing.Color.FromArgb((CInt((CByte(255)))), (CInt((CByte(255)))), (CInt((CByte(192)))))
            Me.label1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
            Me.label1.Location = New System.Drawing.Point(16, 16)
            Me.label1.Name = "label1"
            Me.label1.Size = New System.Drawing.Size(205, 80)
            Me.label1.TabIndex = 1
            Me.label1.Text = "A first demo on how to create basic things with FlexCel API."
            '
            ' cbAutoOpen
            '
            Me.cbAutoOpen.Location = New System.Drawing.Point(16, 104)
            Me.cbAutoOpen.Name = "cbAutoOpen"
            Me.cbAutoOpen.Size = New System.Drawing.Size(144, 48)
            Me.cbAutoOpen.TabIndex = 2
            Me.cbAutoOpen.Text = "Auto open the generated file without saving it"
            '
            ' mainForm
            '
            Me.AutoScaleDimensions = New System.Drawing.SizeF(6F, 13F)
            Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
            Me.ClientSize = New System.Drawing.Size(229, 197)
            Me.Controls.Add(Me.cbAutoOpen)
            Me.Controls.Add(Me.label1)
            Me.Controls.Add(Me.button1)
            Me.Name = "mainForm"
            Me.Text = "Getting Started"
            Me.ResumeLayout(False)

        End Sub
        #End Region

        Private WithEvents button1 As System.Windows.Forms.Button
        Private saveFileDialog1 As System.Windows.Forms.SaveFileDialog
        Private label1 As System.Windows.Forms.Label
        Private cbAutoOpen As System.Windows.Forms.CheckBox

    End Class
End Namespace

Form1.vb

Imports System.Collections
Imports System.ComponentModel
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports System.IO
Imports System.Reflection
Imports System.Threading

Namespace GettingStarted
    ''' <summary>
    ''' A small example on how to create a simple file with the API.
    ''' Note that you can use the APIMate tool (in Start Menu->TMS FlexCel Studio->Tools) to find out the
    ''' methods you need to call.
    ''' </summary>
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Public Sub New()
            InitializeComponent()
        End Sub

        Private Sub button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button1.Click
            Dim Xls As ExcelFile = New XlsFile(True)
            AddData(Xls)

            If cbAutoOpen.Checked Then
                AutoOpen(Xls)
            Else
                NormalOpen(Xls)
            End If
        End Sub

        Private Sub AddData(ByVal Xls As ExcelFile)
            'Create a new file. We could also open an existing file with Xls.Open
            Xls.NewFile(1, TExcelFileFormat.v2019)
            'Set some cell values.
            Xls.SetCellValue(1, 1, "Hello to the world")
            Xls.SetCellValue(2, 1, 3)
            Xls.SetCellValue(3, 1, 2.1)
            Xls.SetCellValue(4, 1, New TFormula("=Sum(A2,A3)"))

            'Load an image from disk.
            Dim AssemblyPath As String = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location)
            Using Img As Image = Image.FromFile(AssemblyPath & Path.DirectorySeparatorChar & ".." & Path.DirectorySeparatorChar & ".." & Path.DirectorySeparatorChar & "Test.bmp")

                'Add a new image on cell E2
                Xls.AddImage(2, 6, Img)
                'Add a new image with custom properties at cell F6
                Xls.AddImage(Img, New TImageProperties(New TClientAnchor(TFlxAnchorType.DontMoveAndDontResize, 2, 10, 6, 10, 100, 100, Xls), ""))
                'Swap the order of the images. it is not really necessary here, we could have loaded them on the inverse order.
                Xls.BringToFront(1)
            End Using

            'Add a comment on cell a2
            Xls.SetComment(2, 1, "This is 3")

            'Custom Format cells a2 and a3
            Dim f As TFlxFormat = Xls.GetDefaultFormat
            f.Font.Name = "Times New Roman"
            f.Font.Color = Color.Red
            f.FillPattern.Pattern = TFlxPatternStyle.LightDown
            f.FillPattern.FgColor = Color.Blue
            f.FillPattern.BgColor = Color.White

            'You can call AddFormat as many times as you want, it will never add a format twice.
            'But if you know the format you are going to use, you can get some extra CPU cycles by
            'calling addformat once and saving the result into a variable.
            Dim XF As Integer = Xls.AddFormat(f)

            Xls.SetCellFormat(2, 1, XF)
            Xls.SetCellFormat(3, 1, XF)

            f.Rotation = 45
            f.FillPattern.Pattern = TFlxPatternStyle.Solid
            Dim XF2 As Integer = Xls.AddFormat(f)
            'Apply a custom format to all the row.
            Xls.SetRowFormat(1, XF2)

            'Merge cells
            Xls.MergeCells(5, 1, 10, 6)
            'Note how this one merges with the previous range, creating a final range (5,1,15,6)
            Xls.MergeCells(10, 6, 15, 6)

            'Make the page print in landscape or portrait mode
            Xls.PrintLandscape = False

        End Sub

        'This is part of an advanced feature (showing the user using a file) , you do not need to use
        'this method on normal places.
        Private Function GetLockingUser(ByVal FileName As String) As String
            Try
                Dim xerr As New XlsFile()
                xerr.Open(FileName)
                Return " - File might be in use by: " & xerr.Protection.WriteAccess
            Catch
                Return String.Empty
            End Try
        End Function

        Private Sub NormalOpen(ByVal Xls As ExcelFile)
            If saveFileDialog1.ShowDialog() = System.Windows.Forms.DialogResult.OK Then
                Try
                    Xls.Save(saveFileDialog1.FileName)
                Catch ex As IOException 'This is not really needed, just to show the username of the user locking the file.
                    Throw New IOException(ex.Message & GetLockingUser(saveFileDialog1.FileName), ex)
                End Try

                If MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) = System.Windows.Forms.DialogResult.Yes Then
                    Process.Start(saveFileDialog1.FileName)
                End If
            End If
        End Sub

        'This method will use a "trick" to create a temporary file and delete it even when it is open on Excel.
        'We will create a "template" (xlt/x file), and tell Excel to create a new file based on this template.
        'Then we can safely delete the xlt/x file, since Excel opened a copy.
        Private Sub AutoOpen(ByVal Xls As ExcelFile)
            Dim FilePath As String = Path.GetTempPath() 'GetTempFileName does not allow us to specify the "xltx" extension.
            Dim FileName As String = Path.Combine(FilePath, Guid.NewGuid().ToString() & ".xltx") 'xltx is the extension for excel templates.
            Try
                Using OutStream As New FileStream(FileName, FileMode.Create, FileAccess.ReadWrite)
                    Xls.IsXltTemplate = True 'Make it an xltx template.
                    Xls.Save(OutStream)
                End Using
                Process.Start(FileName)
            Finally
                'For .Net 4 and newer you can use Task.Run here. See https://doc.tmssoftware.com/flexcel/net/tips/automatically-open-generated-excel-files.html
                Dim t As New Thread(AddressOf RemoveTempAfterUse)
                t.Start(FileName)
            End Try
        End Sub

        Private Sub RemoveTempAfterUse(ByVal FileName As Object)
            'As it is an xltx file, we can delete it even when it is open on Excel. - wait for 30 secs to give Excel time to start.
            Thread.Sleep(30000)
            File.Delete(CType(FileName, String))
        End Sub

        ''' <summary>
        ''' This is the method that will be called by the ASP.NET front end. It returns an array of bytes
        ''' with the report data, so the ASP.NET application can stream it to the client.
        ''' </summary>
        ''' <returns>The generated file as a byte array.</returns>
        Public Function WebRun() As Byte()
            Dim Xls As ExcelFile = New XlsFile(True)
            AddData(Xls)

            Using OutStream As New MemoryStream()
                Xls.Save(OutStream)
                Return OutStream.ToArray()
            End Using
        End Function

    End Class
End Namespace

Program.vb

Namespace GettingStarted
    Friend NotInheritable Class Program

        Private Sub New()
        End Sub

        ''' <summary>
        ''' The main entry point for the application.
        ''' </summary>
       <STAThread> _
        Shared Sub Main()
            Application.EnableVisualStyles()
            Application.SetCompatibleTextRenderingDefault(False)
            Application.Run(New mainForm())
        End Sub
    End Class
End Namespace


Advanced API (VB.Net / netframework) | FlexCel Studio for the .NET Framework documentation

Advanced API (VB.Net / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\vb\VS2022\netframework\10.API\12.Advanced API and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​vb/​VS2022/​netframework/​Modules/​10.​API/​12.​Advanced API

Overview

This demo shows a lot of unrelated things you can do with the FlexCel API.

It is a complement of what was shown in GettingStarted: this means things that were shown there (like how to insert an image) will not be repeated here. You should look at both demos when studying the API.

The things shown here do not make much sense in the real world; they are explicitly designed to show what can be done.

Also remember that most of this stuff can be found easier with APIMate

The created file will be password protected, and all the passwords are "flexcel" (without quotes)

Concepts

  • FlexCel shines at modifying existing Excel files. It has been designed from the start with that in mind, and to not losing anything in the original file. So we will start from an existing file with the skeleton of what we want to do, and modify it with code. This starting file (template.xls/x) could be embedded in the exe file, but this is not shown here. To see an example on how to embed the template inside the exe, look at Templates On The Exe

  • The starting template has a macro. At this time we can not create macros with FlexCel, but we can modify a file with existing macros and those macros will be in the final file.

  • How to copy a chart from other template and fill the values.

  • How to add Outlines.

  • How to freeze panes.

  • How to add data validation.

  • How to search and replace in a range of cells.

  • How to sort a range of cells.

  • How to Autofit the rows in a sheet.

  • How to protect the file and cells with a password.

  • As FlexCel doesn't convert charts between xlsx and xls, if you want to create an xls file you need to start with an xls template, and the same goes for xlsx. So we need two templates.

Files

AssemblyInfo.vb

Imports System.Reflection
Imports System.Runtime.CompilerServices

'
' General Information about an assembly is controlled through the following
' set of attributes. Change these attribute values to modify the information
' associated with an assembly.
'
<Assembly: AssemblyTitle("")>
<Assembly: AssemblyDescription("")>
<Assembly: AssemblyConfiguration("")>
<Assembly: AssemblyCompany("")>
<Assembly: AssemblyProduct("")>
<Assembly: AssemblyCopyright("(c) 2002 - 2014 TMS Software")>
<Assembly: AssemblyTrademark("")>
<Assembly: AssemblyCulture("")>

'
' Version information for an assembly consists of the following four values:
'
'      Major Version
'      Minor Version
'      Build Number
'      Revision
'
' You can specify all the values or you can default the Revision and Build Numbers
' by using the '*' as shown below:

<Assembly: AssemblyVersion("6.2.1.0")>

'
' In order to sign your assembly you must specify a key to use. Refer to the
' Microsoft .NET Framework documentation for more information on assembly signing.
'
' Use the attributes below to control which key is used for signing.
'
' Notes:
'   (*) If no key is specified, the assembly is not signed.
'   (*) KeyName refers to a key that has been installed in the Crypto Service
'       Provider (CSP) on your machine. KeyFile refers to a file which contains
'       a key.
'   (*) If the KeyFile and the KeyName values are both specified, the
'       following processing occurs:
'       (1) If the KeyName can be found in the CSP, that key is used.
'       (2) If the KeyName does not exist and the KeyFile does exist, the key
'           in the KeyFile is installed into the CSP and used.
'   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
'       When specifying the KeyFile, the location of the KeyFile should be
'       relative to the project output directory which is
'       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
'       located in the project directory, you would specify the AssemblyKeyFile
'       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
'   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
'       documentation for more information on this.
'
<Assembly: AssemblyDelaySign(False)>
<Assembly: AssemblyKeyFile("")>
<Assembly: AssemblyKeyName("")>

Form1.Designer.vb

Imports System.Collections
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports System.IO
Imports System.Reflection
Imports System.Text
Namespace AdvancedAPI
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Private WithEvents button1 As System.Windows.Forms.Button
        Private saveFileDialog1 As System.Windows.Forms.SaveFileDialog
        Private label1 As System.Windows.Forms.Label
        ''' <summary>
        ''' Required designer variable.
        ''' </summary>
        Private components As System.ComponentModel.Container = Nothing

        ''' <summary>
        ''' Clean up any resources being used.
        ''' </summary>
        Protected Overrides Sub Dispose(ByVal disposing As Boolean)
            If disposing Then
                If components IsNot Nothing Then
                    components.Dispose()
                End If
            End If
            MyBase.Dispose(disposing)
        End Sub

        #Region "Windows Form Designer generated code"
        ''' <summary>
        ''' Required method for Designer support - do not modify
        ''' the contents of this method with the code editor.
        ''' </summary>
        Private Sub InitializeComponent()
            Dim resources As New System.ComponentModel.ComponentResourceManager(GetType(mainForm))
            Me.button1 = New System.Windows.Forms.Button()
            Me.saveFileDialog1 = New System.Windows.Forms.SaveFileDialog()
            Me.label1 = New System.Windows.Forms.Label()
            Me.cbXlsxTemplate = New System.Windows.Forms.CheckBox()
            Me.SuspendLayout()
            '
            ' button1
            '
            Me.button1.Anchor = System.Windows.Forms.AnchorStyles.Bottom
            Me.button1.Location = New System.Drawing.Point(136, 160)
            Me.button1.Name = "button1"
            Me.button1.Size = New System.Drawing.Size(75, 23)
            Me.button1.TabIndex = 0
            Me.button1.Text = "GO!"
'           Me.button1.Click += New System.EventHandler(Me.button1_Click)
            '
            ' saveFileDialog1
            '
            Me.saveFileDialog1.Filter = "Excel Files (97-2003)|*.xls|Excel Files (2007 or newer)|*.xlsm"
            Me.saveFileDialog1.RestoreDirectory = True
            '
            ' label1
            '
            Me.label1.Anchor = (CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) Or System.Windows.Forms.AnchorStyles.Left) Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.label1.BackColor = System.Drawing.Color.FromArgb((CInt((CByte(255)))), (CInt((CByte(255)))), (CInt((CByte(192)))))
            Me.label1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
            Me.label1.Location = New System.Drawing.Point(16, 16)
            Me.label1.Name = "label1"
            Me.label1.Size = New System.Drawing.Size(320, 90)
            Me.label1.TabIndex = 1
            Me.label1.Text = resources.GetString("label1.Text")
            '
            ' cbXlsxTemplate
            '
            Me.cbXlsxTemplate.AutoSize = True
            Me.cbXlsxTemplate.Location = New System.Drawing.Point(16, 120)
            Me.cbXlsxTemplate.Name = "cbXlsxTemplate"
            Me.cbXlsxTemplate.Size = New System.Drawing.Size(108, 17)
            Me.cbXlsxTemplate.TabIndex = 2
            Me.cbXlsxTemplate.Text = "Use xlsx template"
            Me.cbXlsxTemplate.UseVisualStyleBackColor = True
            '
            ' mainForm
            '
            Me.AutoScaleDimensions = New System.Drawing.SizeF(6F, 13F)
            Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
            Me.ClientSize = New System.Drawing.Size(344, 197)
            Me.Controls.Add(Me.cbXlsxTemplate)
            Me.Controls.Add(Me.label1)
            Me.Controls.Add(Me.button1)
            Me.Name = "mainForm"
            Me.Text = "Advanced API"
            Me.ResumeLayout(False)
            Me.PerformLayout()

        End Sub
        #End Region

        Private cbXlsxTemplate As CheckBox
    End Class
End Namespace

Form1.vb

Imports System.Collections
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports System.IO
Imports System.Reflection
Imports System.Text

Namespace AdvancedAPI
    ''' <summary>
    ''' A demo on creating a file using more advanced features.
    ''' </summary>
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Public Sub New()
            InitializeComponent()
        End Sub

        Private Sub button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button1.Click
            Dim Xls As ExcelFile = New XlsFile(True)
            AddData(Xls)

            NormalOpen(Xls)
        End Sub

        ''' <summary>
        ''' We will use this path to find the template.xls. Code is a little complex because it has to run in mono.
        ''' </summary>
        Private ReadOnly Property PathToExe() As String
            Get
                Return Path.Combine(Path.Combine(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), ".."), "..") & Path.DirectorySeparatorChar
            End Get
        End Property

        'some silly data to fill in the cells. A real app would read this from somewhere else.
        Private Country() As String = { "USA", "Canada", "Spain", "France", "United Kingdom", "Australia", "Brazil", "Unknown" }

        Private DataRows As Integer = 100

        ''' <summary>
        ''' Will return a list of countries separated by Character(0) so it can be used as input for a built in list.
        ''' </summary>
        ''' <returns></returns>
        Private Function GetCountryList() As String
            Dim sb As New StringBuilder()
            Dim sep As String = ""
            For Each c As String In Country
                sb.Append(sep)
                sb.Append(c)
                sep = vbNullChar 'not very efficient method to concat, but good enough for this demo.
            Next c

            Return sb.ToString()
        End Function

        Private Sub AddChart(ByVal DataCell As TXlsNamedRange, ByVal Xls As ExcelFile)
            'Find the cell where the cart will go.
            Dim ChartRange As TXlsNamedRange = Xls.GetNamedRange("ChartData", -1)

            'Insert cells to expand the range for the chart. It already has 2 rows, so we need to insert Country.Length - 2
            'Note also that we insert after ChartRange.Top, so the chart is updates with the new range.
            Xls.InsertAndCopyRange(New TXlsCellRange(ChartRange.Top, ChartRange.Left, ChartRange.Top, ChartRange.Left + 1), ChartRange.Top + 1, ChartRange.Left, Country.Length - 2, TFlxInsertMode.ShiftRangeDown) 'we use shiftrangedown so not all the row goes down and the chart stays in place.

            'Get the cell addresses of the data range.
            Dim FirstCell As New TCellAddress(DataCell.Top, DataCell.Left)
            Dim SecondCell As New TCellAddress(DataCell.Top + DataRows, DataCell.Left + 1)
            Dim FirstSumCell As New TCellAddress(DataCell.Top, DataCell.Left + 1)

            'Fill a table with the data to be used in the chart.
            For r As Integer = ChartRange.Top To ChartRange.Top + Country.Length - 1
                Xls.SetCellValue(r, ChartRange.Left, Country(r - ChartRange.Top))
                Xls.SetCellValue(r, ChartRange.Left + 1, New TFormula("=SUMIF(" & FirstCell.CellRef & ":" & SecondCell.CellRef & ",""" & Country(r - ChartRange.Top) & """, " & FirstSumCell.CellRef & ":" & SecondCell.CellRef & ")"))
            Next r

        End Sub

        Private Sub AddData(ByVal Xls As ExcelFile)
            Dim TemplateFile As String = "template.xls"
            If cbXlsxTemplate.Checked Then
                If Not XlsFile.SupportsXlsx Then
                    Throw New Exception("Xlsx files are not supported in this version of the .NET framework")
                End If
                TemplateFile = "template.xlsm"
            End If

            ' Open an existing file to be used as template. In this example this file has
            ' little data, in a real situation it should have as much as possible. (Or even better, be a report)
            Xls.Open(Path.Combine(PathToExe, TemplateFile))

            'Find the cell where we want to fill the data. In this case, we have created a named range "data" so the address
            'is not hardcoded here.
            Dim DataCell As TXlsNamedRange = Xls.GetNamedRange("Data", -1)

            'Add a chart with totals
            AddChart(DataCell, Xls)
            'Note that "DataCell" will change because we inserted rows above it when creating the chart. But we will keep using the old one.

            'Add the captions. This should probably go into the template, but in a dynamic environment it might go here.
            Xls.SetCellValue(DataCell.Top - 1, DataCell.Left, "Country")
            Xls.SetCellValue(DataCell.Top - 1, DataCell.Left + 1, "Quantity")

            'Add a rectangle around the cells
            Dim ApplyFormat As New TFlxApplyFormat()
            ApplyFormat.SetAllMembers(False)
            ApplyFormat.Borders.SetAllMembers(True) 'We will only apply the borders to the existing cell formats
            Dim fmt As TFlxFormat = Xls.GetDefaultFormat
            fmt.Borders.Left.Style = TFlxBorderStyle.Double
            fmt.Borders.Left.Color = Color.Black
            fmt.Borders.Right.Style = TFlxBorderStyle.Double
            fmt.Borders.Right.Color = Color.Black
            fmt.Borders.Top.Style = TFlxBorderStyle.Double
            fmt.Borders.Top.Color = Color.Black
            fmt.Borders.Bottom.Style = TFlxBorderStyle.Double
            fmt.Borders.Bottom.Color = Color.Black
            Xls.SetCellFormat(DataCell.Top - 1, DataCell.Left, DataCell.Top, DataCell.Left + 1, fmt, ApplyFormat, True) 'Set last parameter to true so it draws a box.

            'Freeze panes
            Xls.FreezePanes(New TCellAddress(DataCell.Top, 1))

            Dim Rnd As New Random()

            'Fill the data
            Dim z As Integer = 0
            Dim OutlineLevel As Integer = 0
            For r As Integer = 0 To DataRows

                'Fill the values.
                Xls.SetCellValue(DataCell.Top + r, DataCell.Left, Country(z Mod Country.Length)) 'For non C# users, "%" means "mod" or modulus in other languages. It is the rest of the integer division.
                Xls.SetCellValue(DataCell.Top + r, DataCell.Left + 1, Rnd.Next(1000))

                'Add the country to the outline
                Xls.SetRowOutlineLevel(DataCell.Top + r, OutlineLevel)
                'increment the country randomly
                If Rnd.Next(3) = 0 Then
                    z += 1
                    OutlineLevel = 0 'Break the group and create a new one.
                Else
                    OutlineLevel = 1
                End If
            Next r

            'Make the "+" signs of the outline appear at the top.
            Xls.OutlineSummaryRowsBelowDetail = False

            'Collapse the outline to the first level.
            Xls.CollapseOutlineRows(1, TCollapseChildrenMode.Collapsed)

            'Add Data Validation for the first column, it must be a country.
            Dim dv As New TDataValidationInfo(TDataValidationDataType.List, TDataValidationConditionType.Between, "=""" & GetCountryList() & """", Nothing, False, True, True, True, "Unknown country", "Please make sure that the country is in the list", False, Nothing, Nothing, TDataValidationIcon.Stop) 'We will use the stop icon so no invalid input is permitted. - We will not use an input box, so this is false and the 2 next entries are null - Note that as we entered the data directly in FirstFormula, we need to set this to true - no need for a second formula, not used in List - We could have used a range of cells here with the values (like "=C1..C4") Instead, we directly entered the list in the formula. - This parameter does not matter since it is a list. It will not be used. - We will use a built in list.
            Xls.AddDataValidation(New TXlsCellRange(DataCell.Top, DataCell.Left, DataCell.Top + DataRows, DataCell.Left), dv)

            'Add Data Validation for the second column, it must be an integer between 0 and 1000.
            dv = New TDataValidationInfo(TDataValidationDataType.WholeNumber, TDataValidationConditionType.Between, "=0", "=1000", False, False, False, True, "Invalid Quantity", Nothing, True, "Quantity:", "Please enter a quantity between 0 and 1000", TDataValidationIcon.Stop) 'We will use the stop icon so no invalid input is permitted. - We will leave the default error message. - Second formula is the second part. - First formula marks the first part of the "between" condition. - We will request a number.
            Xls.AddDataValidation(New TXlsCellRange(DataCell.Top, DataCell.Left + 1, DataCell.Top + DataRows, DataCell.Left + 1), dv)

            'Search country "Unknown" and replace it by "no".
            'This does not make any sense here (we could just have entered "no" to begin)
            'but it shows how to do it when modifying an existing file
            Xls.Replace("Unknown", "no", TXlsCellRange.FullRange(), True, False, True)

            'Autofit the rows. As we keep the row height automatic this will not show when opening in Excel, but will work when directly printing from FlexCel.
            Xls.AutofitRowsOnWorkbook(False, True, 1)

            Xls.Recalc() 'Calculate the SUMIF formulas so we can sort by them. Note that FlexCel automatically recalculates before saving,
                          'but in this case we haven't saved yet, so the sheet is not recalculated. You do not normally need to call Recalc directly.

            'Sort the data. As in the case with replace, this does not make much sense. We could have entered the data sorted to begin
            'But it shows how you can use the feature.

            'Find the cell where the chart goes.
            Dim ChartRange As TXlsNamedRange = Xls.GetNamedRange("ChartData", -1)
            Xls.Sort(New TXlsCellRange(ChartRange.Top, ChartRange.Left, ChartRange.Top + Country.Length, ChartRange.Left + 1), True, New Integer() { 2 }, New TSortOrder() { TSortOrder.Descending }, Nothing)

            'Protect the Sheet
            Dim Sp As New TSheetProtectionOptions(False) 'Create default protection options that allows everything.
            Sp.InsertColumns = False 'Restrict inserting columns.
            Xls.Protection.SetSheetProtection("flexcel", Sp)
            'Set a modify password. Note that this does *not* encrypt the file.
            Xls.Protection.SetModifyPassword("flexcel", True, "flexcel")

            Xls.Protection.OpenPassword = "flexcel" 'OpenPasword is the only password that will actually encrypt the file, so you will not be able to open it with flexcel if you do not know the password.

            'Select cell A1
            Xls.SelectCell(1, 1, True)
        End Sub

        'This is part of an advanced feature (showing the user using a file) , you do not need to use
        'this method on normal places.
        Private Function GetLockingUser(ByVal FileName As String) As String
            Try
                Dim xerr As New XlsFile()
                xerr.Open(FileName)
                Return " - File might be in use by: " & xerr.Protection.WriteAccess
            Catch
                Return String.Empty
            End Try
        End Function

        Private Sub NormalOpen(ByVal Xls As ExcelFile)
            If cbXlsxTemplate.Checked Then
                saveFileDialog1.FilterIndex = 1
            Else
                saveFileDialog1.FilterIndex = 0
            End If
            If saveFileDialog1.ShowDialog() = System.Windows.Forms.DialogResult.OK Then
                If (Not XlsFile.SupportsXlsx) AndAlso Path.GetExtension(saveFileDialog1.FileName) = ".xlsm" Then
                    Throw New Exception("Xlsx files are not supported in this version of the .NET framework")
                End If

                Try
                    Xls.Save(saveFileDialog1.FileName)
                Catch ex As IOException 'This is not really needed, just to show the username of the user locking the file.
                    Throw New IOException(ex.Message & GetLockingUser(saveFileDialog1.FileName), ex)
                End Try

                If MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) = System.Windows.Forms.DialogResult.Yes Then
                    Process.Start(saveFileDialog1.FileName)
                End If
            End If
        End Sub
    End Class
End Namespace

Program.vb

Namespace AdvancedAPI
    Friend NotInheritable Class Program

        Private Sub New()
        End Sub

        ''' <summary>
        ''' The main entry point for the application.
        ''' </summary>
       <STAThread> _
        Shared Sub Main()
            Application.EnableVisualStyles()
            Application.SetCompatibleTextRenderingDefault(False)
            Application.Run(New mainForm())
        End Sub
    End Class
End Namespace


Chart API (VB.Net / netframework) | FlexCel Studio for the .NET Framework documentation

Chart API (VB.Net / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\vb\VS2022\netframework\10.API\16.Chart API and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​vb/​VS2022/​netframework/​Modules/​10.​API/​16.​Chart API

Overview

Here we will show how to create a simple chart only with code. Note that as charts are complex and have many configuration options, the best way to find out how to create a particular chart is to create it in Excel, and then open it with APIMate. APIMate has full support for showing the chart API.

Concepts

  • How you can use ExcelFile.AddChart, ExcelChart.AddSeries and other commands to create a simple chart.

  • The chart API works only in xlsx files, so this demo wouldn't work with xls files.

Files

AssemblyInfo.vb

Imports System.Reflection
Imports System.Runtime.CompilerServices

'
' General Information about an assembly is controlled through the following
' set of attributes. Change these attribute values to modify the information
' associated with an assembly.
'
<Assembly: AssemblyTitle("")>
<Assembly: AssemblyDescription("")>
<Assembly: AssemblyConfiguration("")>
<Assembly: AssemblyCompany("")>
<Assembly: AssemblyProduct("")>
<Assembly: AssemblyCopyright("(c) 2002 - 2014 TMS Software")>
<Assembly: AssemblyTrademark("")>
<Assembly: AssemblyCulture("")>

'
' Version information for an assembly consists of the following four values:
'
'      Major Version
'      Minor Version
'      Build Number
'      Revision
'
' You can specify all the values or you can default the Revision and Build Numbers
' by using the '*' as shown below:

<Assembly: AssemblyVersion("6.2.1.0")>

'
' In order to sign your assembly you must specify a key to use. Refer to the
' Microsoft .NET Framework documentation for more information on assembly signing.
'
' Use the attributes below to control which key is used for signing.
'
' Notes:
'   (*) If no key is specified, the assembly is not signed.
'   (*) KeyName refers to a key that has been installed in the Crypto Service
'       Provider (CSP) on your machine. KeyFile refers to a file which contains
'       a key.
'   (*) If the KeyFile and the KeyName values are both specified, the
'       following processing occurs:
'       (1) If the KeyName can be found in the CSP, that key is used.
'       (2) If the KeyName does not exist and the KeyFile does exist, the key
'           in the KeyFile is installed into the CSP and used.
'   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
'       When specifying the KeyFile, the location of the KeyFile should be
'       relative to the project output directory which is
'       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
'       located in the project directory, you would specify the AssemblyKeyFile
'       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
'   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
'       documentation for more information on this.
'
<Assembly: AssemblyDelaySign(False)>
<Assembly: AssemblyKeyFile("")>
<Assembly: AssemblyKeyName("")>

Form1.Designer.vb

Imports System.Collections
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports System.IO
Imports System.Reflection
Imports System.Text
Namespace ChartAPI
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Private WithEvents button1 As System.Windows.Forms.Button
        Private saveFileDialog1 As System.Windows.Forms.SaveFileDialog
        Private label1 As System.Windows.Forms.Label
        ''' <summary>
        ''' Required designer variable.
        ''' </summary>
        Private components As System.ComponentModel.Container = Nothing

        ''' <summary>
        ''' Clean up any resources being used.
        ''' </summary>
        Protected Overrides Sub Dispose(ByVal disposing As Boolean)
            If disposing Then
                If components IsNot Nothing Then
                    components.Dispose()
                End If
            End If
            MyBase.Dispose(disposing)
        End Sub

        #Region "Windows Form Designer generated code"
        ''' <summary>
        ''' Required method for Designer support - do not modify
        ''' the contents of this method with the code editor.
        ''' </summary>
        Private Sub InitializeComponent()
            Me.button1 = New System.Windows.Forms.Button()
            Me.saveFileDialog1 = New System.Windows.Forms.SaveFileDialog()
            Me.label1 = New System.Windows.Forms.Label()
            Me.SuspendLayout()
            '
            ' button1
            '
            Me.button1.Anchor = System.Windows.Forms.AnchorStyles.Bottom
            Me.button1.Location = New System.Drawing.Point(136, 160)
            Me.button1.Name = "button1"
            Me.button1.Size = New System.Drawing.Size(75, 23)
            Me.button1.TabIndex = 0
            Me.button1.Text = "GO!"
'           Me.button1.Click += New System.EventHandler(Me.button1_Click)
            '
            ' saveFileDialog1
            '
            Me.saveFileDialog1.DefaultExt = "xlsx"
            Me.saveFileDialog1.Filter = "Excel Files (2007 or newer)|*.xlsx"
            Me.saveFileDialog1.RestoreDirectory = True
            '
            ' label1
            '
            Me.label1.Anchor = (CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) Or System.Windows.Forms.AnchorStyles.Left) Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.label1.BackColor = System.Drawing.Color.FromArgb((CInt((CByte(255)))), (CInt((CByte(255)))), (CInt((CByte(192)))))
            Me.label1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
            Me.label1.Location = New System.Drawing.Point(16, 16)
            Me.label1.Name = "label1"
            Me.label1.Size = New System.Drawing.Size(320, 90)
            Me.label1.TabIndex = 1
            Me.label1.Text = "A demo showing how to create a simple chart with code. Use APIMate for more compl" & "ex charts"
            '
            ' mainForm
            '
            Me.AutoScaleDimensions = New System.Drawing.SizeF(6F, 13F)
            Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
            Me.ClientSize = New System.Drawing.Size(344, 197)
            Me.Controls.Add(Me.label1)
            Me.Controls.Add(Me.button1)
            Me.Name = "mainForm"
            Me.Text = "Chart API"
            Me.ResumeLayout(False)

        End Sub
        #End Region
    End Class
End Namespace

Form1.vb

Imports System.Collections
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports System.IO
Imports System.Reflection
Imports System.Text

Namespace ChartAPI
    ''' <summary>
    ''' A demo on creating a chart with code.
    ''' </summary>
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Public Sub New()
            InitializeComponent()
        End Sub

        Private Sub button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button1.Click
            AutoRun()
        End Sub

        Private ReadOnly Property PathToExe() As String
            Get
                Return Path.Combine(Path.Combine(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), ".."), "..") & Path.DirectorySeparatorChar
            End Get
        End Property

        Private Sub AutoRun()
            'We will use data already stored in a file. For a real case, you would
            'probably fill this data from some database.
            Dim fileName As String = Path.Combine(PathToExe, "git-stats.xlsx")
            Dim Xls As ExcelFile = New XlsFile(fileName, True)

            'Add a new empty sheet for adding the chart.
            Xls.InsertAndCopySheets(0, 1, 1)
            Xls.ActiveSheet = 1
            Xls.SheetName = "Chart"
            Xls.PrintToFit = True
            Xls.PrintScale = 70
            Xls.PrintXResolution = 600
            Xls.PrintYResolution = 600
            Xls.PrintOptions = TPrintOptions.None
            Xls.PrintPaperSize = TPaperSize.Letter
            Xls.PrintLandscape = True

            AddChart(Xls)
            NormalOpen(Xls)
        End Sub

        Private Sub AddChart(ByVal xls As ExcelFile)
            'This code is adapted from APIMate.
            'Objects
            Dim ChartOptions1 As New TShapeProperties()
            ChartOptions1.Anchor = New TClientAnchor(TFlxAnchorType.MoveAndResize, 1, 215, 1, 608, 30, 228, 17, 736)
            ChartOptions1.ShapeName = "Lines of code"
            ChartOptions1.Print = True
            ChartOptions1.Visible = True
            ChartOptions1.ShapeOptions.SetValue(TShapeOption.fLockText, True)
            ChartOptions1.ShapeOptions.SetValue(TShapeOption.LockRotation, True)
            ChartOptions1.ShapeOptions.SetValue(TShapeOption.fAutoTextMargin, True)
            ChartOptions1.ShapeOptions.SetValue(TShapeOption.fillColor, 134217806)
            ChartOptions1.ShapeOptions.SetValue(TShapeOption.wzName, "Lines of code")
            Dim Chart1 As ExcelChart = xls.AddChart(ChartOptions1, TChartType.Area, New ChartStyle(102), False)

            Dim Title As New TDataLabel()
            Title.PositionZeroBased = Nothing
            Dim TextFillOptions As New ChartFillOptions(New TShapeFill(New TSolidFill(TDrawingColor.FromRgb(&H80, &H80, &H80)), True, TFormattingType.Subtle, TDrawingColor.FromRgb(&H0, &H0, &H0, New TColorTransform(TColorTransformType.Alpha, 0)), False))
            Dim LabelTextOptions As New TChartTextOptions(New TFlxChartFont("Calibri Light", 320, TExcelColor.FromArgb(&H80, &H80, &H80), TFlxFontStyles.Bold, TFlxUnderline.None, TFontScheme.Major), THFlxAlignment.center, TVFlxAlignment.center, TBackgroundMode.Transparent, TextFillOptions)
            Title.TextOptions = LabelTextOptions
            Dim LabelOptions As New TDataLabelOptions()
            Title.LabelOptions = LabelOptions
            Dim ChartLineOptions As New ChartLineOptions(New TShapeLine(True, New TLineStyle(New TNoFill(), Nothing), Nothing, TFormattingType.Subtle))
            Dim ChartFillOptions As New ChartFillOptions(New TShapeFill(New TNoFill(), False, TFormattingType.Subtle, Nothing, False))
            Title.Frame = New TChartFrameOptions(ChartLineOptions, ChartFillOptions, False)

            Dim Runs() As TRTFRun
            Runs = New TRTFRun(0){}
            Runs(0).FirstChar = 0
            Dim fnt As TFlxFont
            fnt = xls.GetDefaultFont
            fnt.Name = "Calibri Light"
            fnt.Size20 = 320
            fnt.Color = TExcelColor.FromArgb(&H80, &H80, &H80)
            fnt.Style = TFlxFontStyles.Bold
            fnt.Family = 0
            fnt.CharSet = 1
            fnt.Scheme = TFontScheme.Major
            Runs(0).FontIndex = xls.AddFont(fnt)
            Dim LabelValue1 As New TRichString("FlexCel: Lines of code over time", Runs, xls)

            Title.LabelValues = New Object() { LabelValue1 }

            Chart1.SetTitle(Title)

            Chart1.Background = New TChartFrameOptions(TDrawingColor.FromTheme(TThemeColor.Dark1, New TColorTransform(TColorTransformType.LumMod, 0.15), New TColorTransform(TColorTransformType.LumOff, 0.85)), 9525, TDrawingColor.FromTheme(TThemeColor.Light1), False)

            Dim PlotAreaFrame As TChartFrameOptions
            ChartLineOptions = New ChartLineOptions(New TShapeLine(True, New TLineStyle(New TNoFill(), Nothing), Nothing, TFormattingType.Subtle))
            ChartFillOptions = New ChartFillOptions(New TShapeFill(New TPatternFill(TDrawingColor.FromTheme(TThemeColor.Dark1, New TColorTransform(TColorTransformType.LumMod, 0.15), New TColorTransform(TColorTransformType.LumOff, 0.85)), TDrawingColor.FromTheme(TThemeColor.Light1), TDrawingPattern.ltDnDiag), True, TFormattingType.Subtle, Nothing, False))
            PlotAreaFrame = New TChartFrameOptions(ChartLineOptions, ChartFillOptions, False)
            Dim PlotAreaPos As New TChartPlotAreaPosition(True, TChartRelativeRectangle.Automatic, TChartLayoutTarget.Inner, True)
            Chart1.PlotArea = New TChartPlotArea(PlotAreaFrame, PlotAreaPos, False)

            Chart1.SetChartOptions(1, New TAreaChartOptions(False, TStackedMode.Stacked, Nothing))

            Dim LastYear As Integer = 0
            Dim shade As Double = 1
            For i As Integer = 2 To 189
                Dim Series As New ChartSeries("=" & (New TCellAddress("Data", 1, i, True, True)).CellRef, "=" & (New TCellAddress("Data", 2, i, True, True)).CellRef & ":" & (New TCellAddress("Data", 189, i, True, True)).CellRef, "=Data!$A$2:$A$189")

                'We will display every year in a single color. Each month gets its own shade.
                Dim xf As Integer = -1
                Dim Year As Integer = FlxDateTime.FromOADate((CDbl(xls.GetCellValue(2, 1, i, xf))), False).Year
                If LastYear <> Year Then
                    shade = 1
                ElseIf shade > 0.3 Then
                    shade -= 0.05
                End If
                    LastYear = Year
                Dim SeriesColor As TDrawingColor = TDrawingColor.FromTheme(CType(TThemeColor.Accent1 + (Year Mod 6), TThemeColor), New TColorTransform(TColorTransformType.Shade, shade))

                Dim SeriesFill As New ChartSeriesFillOptions(New TShapeFill(New TSolidFill(SeriesColor), True, TFormattingType.Subtle, Nothing, False), Nothing, False, False)
                Dim SeriesLine As New ChartSeriesLineOptions(New TShapeLine(True, New TLineStyle(New TNoFill(), Nothing), Nothing, TFormattingType.Subtle), False)
                Series.Options.Add(New ChartSeriesOptions(-1, SeriesFill, SeriesLine, Nothing, Nothing, Nothing, True))

                Chart1.AddSeries(Series)
            Next i

            Chart1.PlotEmptyCells = TPlotEmptyCells.Zero
            Chart1.ShowDataInHiddenRowsAndCols = False

            Dim AxisFont As New TFlxChartFont("Calibri", 180, TExcelColor.FromArgb(&H59, &H59, &H59), TFlxFontStyles.None, TFlxUnderline.None, TFontScheme.Minor)
            Dim AxisLine As New TAxisLineOptions()
            AxisLine.MainAxis = New ChartLineOptions(New TShapeLine(True, New TLineStyle(New TSolidFill(TDrawingColor.FromTheme(TThemeColor.Dark1, New TColorTransform(TColorTransformType.LumMod, 0.15), New TColorTransform(TColorTransformType.LumOff, 0.85))), 9525, TPenAlignment.Center, TLineCap.Flat, TCompoundLineType.Single, Nothing, TLineJoin.Round, Nothing, Nothing, Nothing), Nothing, TFormattingType.Subtle))
            AxisLine.DoNotDrawLabelsIfNotDrawingAxis = False
            Dim AxisTicks As New TAxisTickOptions(TTickType.Outside, TTickType.None, TAxisLabelPosition.NextToAxis, TBackgroundMode.Transparent, TDrawingColor.FromRgb(&H59, &H59, &H59), 0)
            Dim AxisRangeOptions As New TAxisRangeOptions(12, 1, False, False, False)
            Dim CatAxis As TBaseAxis = New TCategoryAxis(0, 0, 12, TDateUnits.Days, 12, TDateUnits.Days, TDateUnits.Months, 0, TCategoryAxisOptions.AutoMin Or TCategoryAxisOptions.AutoMax Or TCategoryAxisOptions.DateAxis Or TCategoryAxisOptions.AutoCrossDate Or TCategoryAxisOptions.AutoDate, AxisFont, "yyyy\-mm\-dd;@", True, AxisLine, AxisTicks, AxisRangeOptions, Nothing, TChartAxisPos.Bottom, 1)
            AxisFont = New TFlxChartFont("Calibri", 180, TExcelColor.FromArgb(&H59, &H59, &H59), TFlxFontStyles.None, TFlxUnderline.None, TFontScheme.Minor)
            AxisLine = New TAxisLineOptions()
            AxisLine.MainAxis = New ChartLineOptions(New TShapeLine(True, New TLineStyle(New TSolidFill(TDrawingColor.FromTheme(TThemeColor.Dark1, New TColorTransform(TColorTransformType.LumMod, 0.15), New TColorTransform(TColorTransformType.LumOff, 0.85))), 9525, TPenAlignment.Center, TLineCap.Flat, TCompoundLineType.Single, Nothing, TLineJoin.Round, Nothing, Nothing, Nothing), Nothing, TFormattingType.Subtle))
            AxisLine.MajorGridLines = New ChartLineOptions(New TShapeLine(True, New TLineStyle(New TSolidFill(TDrawingColor.FromTheme(TThemeColor.Dark1, New TColorTransform(TColorTransformType.LumMod, 0.15), New TColorTransform(TColorTransformType.LumOff, 0.85))), 9525, TPenAlignment.Center, TLineCap.Flat, TCompoundLineType.Single, Nothing, TLineJoin.Round, Nothing, Nothing, Nothing), Nothing, TFormattingType.Subtle))
            AxisLine.DoNotDrawLabelsIfNotDrawingAxis = False
            AxisTicks = New TAxisTickOptions(TTickType.None, TTickType.None, TAxisLabelPosition.NextToAxis, TBackgroundMode.Transparent, TDrawingColor.FromRgb(&H59, &H59, &H59), 0)
            CatAxis.NumberFormat = "yyyy-mm"
            CatAxis.NumberFormatLinkedToSource = False

            Dim ValAxis As TBaseAxis = New TValueAxis(0, 0, 0, 0, 0, TValueAxisOptions.AutoMin Or TValueAxisOptions.AutoMax Or TValueAxisOptions.AutoMajor Or TValueAxisOptions.AutoMinor Or TValueAxisOptions.AutoCross, AxisFont, "General", True, AxisLine, AxisTicks, Nothing, TChartAxisPos.Left)
            Chart1.SetChartAxis(New TChartAxis(0, CatAxis, ValAxis))

        End Sub

        Private Sub NormalOpen(ByVal Xls As ExcelFile)
            If saveFileDialog1.ShowDialog() = System.Windows.Forms.DialogResult.OK Then
                Xls.Save(saveFileDialog1.FileName)

                If MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) = System.Windows.Forms.DialogResult.Yes Then
                    Process.Start(saveFileDialog1.FileName)
                End If
            End If
        End Sub
    End Class
End Namespace

Program.vb

Namespace ChartAPI
    Friend NotInheritable Class Program

        Private Sub New()
        End Sub

        ''' <summary>
        ''' The main entry point for the application.
        ''' </summary>
       <STAThread> _
        Shared Sub Main()
            Application.EnableVisualStyles()
            Application.SetCompatibleTextRenderingDefault(False)
            Application.Run(New mainForm())
        End Sub
    End Class
End Namespace


Reading Excel files (VB.Net / netframework) | FlexCel Studio for the .NET Framework documentation

Reading Excel files (VB.Net / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\vb\VS2022\netframework\10.API\20.Reading Files and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​vb/​VS2022/​netframework/​Modules/​10.​API/​20.​Reading Files

Overview

A demo showing how to read the contents of an Excel file using FlexCel.

Concepts

  • To read an Excel file you use the XlsFile class, from where you can read and write to any Excel 2.0 or newer file.

  • To get the value for a single cell, use XlsFile.GetCellValue.

  • To get the value for a cell when looping a full sheet, use XlsFile.GetCellValueIndexed. It is faster than using GetCellValue since you will only read the used cells.

  • XlsFile.GetCellValue and XlsFile.GetCellValueIndexed can return one of the following objects:

    • null

    • Double

    • Boolean

    • String

    • TRichString

    • TFormula

  • With GetCellValue and GetCellValueIndexed you will get the actual values. But if you want to actually display formatted data (for example if you have the number 2 with 2 decimals, and you want to display 2.00 instead of 2), you need to use other methods. There are 2 ways to do it:

    1. XlsFile.GetStringFromCell will return a rich string with the cell formatted.

    2. FormatValue will format an object with a specified format and then return the corresponding rich string. TFlxNumberFormat.FormatValue is used internally by GetStringFromCell.

  • In Excel, Dates are doubles. The only difference between a date and a double is on the format on the cell. With FormatValue you can get the actual string that is displayed on Excel. Also, to convert this double to a DateTime, you can use FlxDateTime.FromOADate.

Files

AssemblyInfo.vb

Imports System.Reflection
Imports System.Runtime.CompilerServices

'
' General Information about an assembly is controlled through the following
' set of attributes. Change these attribute values to modify the information
' associated with an assembly.
'
<Assembly: AssemblyTitle("")>
<Assembly: AssemblyDescription("")>
<Assembly: AssemblyConfiguration("")>
<Assembly: AssemblyCompany("")>
<Assembly: AssemblyProduct("")>
<Assembly: AssemblyCopyright("(c) 2002 - 2014 TMS Software")>
<Assembly: AssemblyTrademark("")>
<Assembly: AssemblyCulture("")>

'
' Version information for an assembly consists of the following four values:
'
'      Major Version
'      Minor Version
'      Build Number
'      Revision
'
' You can specify all the values or you can default the Revision and Build Numbers
' by using the '*' as shown below:

<Assembly: AssemblyVersion("6.2.1.0")>

'
' In order to sign your assembly you must specify a key to use. Refer to the
' Microsoft .NET Framework documentation for more information on assembly signing.
'
' Use the attributes below to control which key is used for signing.
'
' Notes:
'   (*) If no key is specified, the assembly is not signed.
'   (*) KeyName refers to a key that has been installed in the Crypto Service
'       Provider (CSP) on your machine. KeyFile refers to a file which contains
'       a key.
'   (*) If the KeyFile and the KeyName values are both specified, the
'       following processing occurs:
'       (1) If the KeyName can be found in the CSP, that key is used.
'       (2) If the KeyName does not exist and the KeyFile does exist, the key
'           in the KeyFile is installed into the CSP and used.
'   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
'       When specifying the KeyFile, the location of the KeyFile should be
'       relative to the project output directory which is
'       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
'       located in the project directory, you would specify the AssemblyKeyFile
'       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
'   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
'       documentation for more information on this.
'
<Assembly: AssemblyDelaySign(False)>
<Assembly: AssemblyKeyFile("")>
<Assembly: AssemblyKeyName("")>

Form1.Designer.vb

Imports System.Collections
Imports System.ComponentModel
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Namespace ReadingFiles
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Private openFileDialog1 As System.Windows.Forms.OpenFileDialog
        Private DisplayGrid As System.Windows.Forms.DataGrid
        Private panel1 As System.Windows.Forms.Panel
        Private label1 As System.Windows.Forms.Label
        Private WithEvents sheetCombo As System.Windows.Forms.ComboBox
        Private statusBar As System.Windows.Forms.StatusBar
        Private components As System.ComponentModel.IContainer = Nothing

        ''' <summary>
        ''' Clean up any resources being used.
        ''' </summary>
        Protected Overrides Sub Dispose(ByVal disposing As Boolean)
            If disposing Then
                If components IsNot Nothing Then
                    components.Dispose()
                End If
            End If
            MyBase.Dispose(disposing)
        End Sub

        #Region "Windows Form Designer generated code"
        ''' <summary>
        ''' Required method for Designer support - do not modify
        ''' the contents of this method with the code editor.
        ''' </summary>
        Private Sub InitializeComponent()
            Dim resources As New System.ComponentModel.ComponentResourceManager(GetType(mainForm))
            Me.openFileDialog1 = New System.Windows.Forms.OpenFileDialog()
            Me.DisplayGrid = New System.Windows.Forms.DataGrid()
            Me.panel1 = New System.Windows.Forms.Panel()
            Me.sheetCombo = New System.Windows.Forms.ComboBox()
            Me.label1 = New System.Windows.Forms.Label()
            Me.statusBar = New System.Windows.Forms.StatusBar()
            Me.mainToolbar = New System.Windows.Forms.ToolStrip()
            Me.btnOpenFile = New System.Windows.Forms.ToolStripButton()
            Me.toolStripSeparator1 = New System.Windows.Forms.ToolStripSeparator()
            Me.btnFormatValues = New System.Windows.Forms.ToolStripButton()
            Me.toolStripSeparator2 = New System.Windows.Forms.ToolStripSeparator()
            Me.btnValueInCellA1 = New System.Windows.Forms.ToolStripButton()
            Me.btnExit = New System.Windows.Forms.ToolStripButton()
            Me.btnInfo = New System.Windows.Forms.ToolStripButton()
            CType(Me.DisplayGrid, System.ComponentModel.ISupportInitialize).BeginInit()
            Me.panel1.SuspendLayout()
            Me.mainToolbar.SuspendLayout()
            Me.SuspendLayout()
            '
            ' openFileDialog1
            '
            Me.openFileDialog1.DefaultExt = "xls"
            Me.openFileDialog1.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm|Excel 97/2003|*.xls|Excel 2007|*.xlsx;*.xlsm|All " & "files|*.*"
            Me.openFileDialog1.Title = "Open an Excel File"
            '
            ' DisplayGrid
            '
            Me.DisplayGrid.DataMember = ""
            Me.DisplayGrid.Dock = System.Windows.Forms.DockStyle.Fill
            Me.DisplayGrid.HeaderForeColor = System.Drawing.SystemColors.ControlText
            Me.DisplayGrid.Location = New System.Drawing.Point(0, 67)
            Me.DisplayGrid.Name = "DisplayGrid"
            Me.DisplayGrid.Size = New System.Drawing.Size(880, 372)
            Me.DisplayGrid.TabIndex = 5
            '
            ' panel1
            '
            Me.panel1.BackColor = System.Drawing.SystemColors.ControlDark
            Me.panel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
            Me.panel1.Controls.Add(Me.sheetCombo)
            Me.panel1.Controls.Add(Me.label1)
            Me.panel1.Dock = System.Windows.Forms.DockStyle.Top
            Me.panel1.Location = New System.Drawing.Point(0, 38)
            Me.panel1.Name = "panel1"
            Me.panel1.Size = New System.Drawing.Size(880, 29)
            Me.panel1.TabIndex = 6
            '
            ' sheetCombo
            '
            Me.sheetCombo.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
            Me.sheetCombo.Location = New System.Drawing.Point(65, 3)
            Me.sheetCombo.Name = "sheetCombo"
            Me.sheetCombo.Size = New System.Drawing.Size(391, 21)
            Me.sheetCombo.TabIndex = 1
'           Me.sheetCombo.SelectedIndexChanged += New System.EventHandler(Me.sheetCombo_SelectedIndexChanged)
            '
            ' label1
            '
            Me.label1.ForeColor = System.Drawing.SystemColors.HighlightText
            Me.label1.Location = New System.Drawing.Point(8, 8)
            Me.label1.Name = "label1"
            Me.label1.Size = New System.Drawing.Size(40, 23)
            Me.label1.TabIndex = 0
            Me.label1.Text = "Sheet:"
            '
            ' statusBar
            '
            Me.statusBar.Location = New System.Drawing.Point(0, 439)
            Me.statusBar.Name = "statusBar"
            Me.statusBar.Size = New System.Drawing.Size(880, 22)
            Me.statusBar.TabIndex = 7
            '
            ' mainToolbar
            '
            Me.mainToolbar.Items.AddRange(New System.Windows.Forms.ToolStripItem() { Me.btnOpenFile, Me.toolStripSeparator1, Me.btnFormatValues, Me.toolStripSeparator2, Me.btnValueInCellA1, Me.btnExit, Me.btnInfo})
            Me.mainToolbar.Location = New System.Drawing.Point(0, 0)
            Me.mainToolbar.Name = "mainToolbar"
            Me.mainToolbar.Size = New System.Drawing.Size(880, 38)
            Me.mainToolbar.TabIndex = 11
            Me.mainToolbar.Text = "mainToolbar"
            '
            ' btnOpenFile
            '
            Me.btnOpenFile.Image = (CType(resources.GetObject("btnOpenFile.Image"), System.Drawing.Image))
            Me.btnOpenFile.ImageTransparentColor = System.Drawing.Color.Magenta
            Me.btnOpenFile.Name = "btnOpenFile"
            Me.btnOpenFile.Size = New System.Drawing.Size(59, 35)
            Me.btnOpenFile.Text = "Open file"
            Me.btnOpenFile.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText
'           Me.btnOpenFile.Click += New System.EventHandler(Me.btnOpenFile_Click)
            '
            ' toolStripSeparator1
            '
            Me.toolStripSeparator1.Name = "toolStripSeparator1"
            Me.toolStripSeparator1.Size = New System.Drawing.Size(6, 38)
            '
            ' btnFormatValues
            '
            Me.btnFormatValues.CheckOnClick = True
            Me.btnFormatValues.Image = (CType(resources.GetObject("btnFormatValues.Image"), System.Drawing.Image))
            Me.btnFormatValues.ImageTransparentColor = System.Drawing.Color.Magenta
            Me.btnFormatValues.Name = "btnFormatValues"
            Me.btnFormatValues.Size = New System.Drawing.Size(85, 35)
            Me.btnFormatValues.Text = "&Format values"
            Me.btnFormatValues.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText
            '
            ' toolStripSeparator2
            '
            Me.toolStripSeparator2.Name = "toolStripSeparator2"
            Me.toolStripSeparator2.Size = New System.Drawing.Size(6, 38)
            '
            ' btnValueInCellA1
            '
            Me.btnValueInCellA1.Image = (CType(resources.GetObject("btnValueInCellA1.Image"), System.Drawing.Image))
            Me.btnValueInCellA1.ImageTransparentColor = System.Drawing.Color.Magenta
            Me.btnValueInCellA1.Name = "btnValueInCellA1"
            Me.btnValueInCellA1.Size = New System.Drawing.Size(91, 35)
            Me.btnValueInCellA1.Text = "&Value in cell A1"
            Me.btnValueInCellA1.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText
'           Me.btnValueInCellA1.Click += New System.EventHandler(Me.btnValueInCurrentCell_Click)
            '
            ' btnExit
            '
            Me.btnExit.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right
            Me.btnExit.Image = (CType(resources.GetObject("btnExit.Image"), System.Drawing.Image))
            Me.btnExit.ImageTransparentColor = System.Drawing.Color.Magenta
            Me.btnExit.Name = "btnExit"
            Me.btnExit.Size = New System.Drawing.Size(59, 35)
            Me.btnExit.Text = "     E&xit     "
            Me.btnExit.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText
'           Me.btnExit.Click += New System.EventHandler(Me.btnExit_Click)
            '
            ' btnInfo
            '
            Me.btnInfo.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right
            Me.btnInfo.Image = (CType(resources.GetObject("btnInfo.Image"), System.Drawing.Image))
            Me.btnInfo.ImageTransparentColor = System.Drawing.Color.Magenta
            Me.btnInfo.Name = "btnInfo"
            Me.btnInfo.Size = New System.Drawing.Size(74, 35)
            Me.btnInfo.Text = "Information"
            Me.btnInfo.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText
'           Me.btnInfo.Click += New System.EventHandler(Me.btnInfo_Click)
            '
            ' mainForm
            '
            Me.AutoScaleDimensions = New System.Drawing.SizeF(6F, 13F)
            Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
            Me.ClientSize = New System.Drawing.Size(880, 461)
            Me.Controls.Add(Me.DisplayGrid)
            Me.Controls.Add(Me.panel1)
            Me.Controls.Add(Me.statusBar)
            Me.Controls.Add(Me.mainToolbar)
            Me.Name = "mainForm"
            Me.Text = "Reading Excel Files"
            CType(Me.DisplayGrid, System.ComponentModel.ISupportInitialize).EndInit()
            Me.panel1.ResumeLayout(False)
            Me.mainToolbar.ResumeLayout(False)
            Me.mainToolbar.PerformLayout()
            Me.ResumeLayout(False)
            Me.PerformLayout()

        End Sub
        #End Region

        Private mainToolbar As ToolStrip
        Private WithEvents btnOpenFile As ToolStripButton
        Private toolStripSeparator1 As ToolStripSeparator
        Private WithEvents btnInfo As ToolStripButton
        Private WithEvents btnExit As ToolStripButton
        Private WithEvents btnValueInCellA1 As ToolStripButton
        Private toolStripSeparator2 As ToolStripSeparator
        Private btnFormatValues As ToolStripButton
    End Class
End Namespace

Form1.vb

Imports System.Collections
Imports System.ComponentModel

Imports FlexCel.Core
Imports FlexCel.XlsAdapter

Namespace ReadingFiles
    ''' <summary>
    ''' A demo on how to read a file from FlexCel and display the results.
    ''' </summary>
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Public Sub New()
            InitializeComponent()
            ResizeToolbar(mainToolbar)
        End Sub

        Private Sub ResizeToolbar(ByVal toolbar As ToolStrip)

            Using gr As Graphics = CreateGraphics()
                Dim xFactor As Double = gr.DpiX / 96.0
                Dim yFactor As Double = gr.DpiY / 96.0
                toolbar.ImageScalingSize = New Size(CInt(Fix(24 * xFactor)), CInt(Fix(24 * yFactor)))
                toolbar.Width = 0 'force a recalc of the buttons.
            End Using
        End Sub

        Private Sub btnExit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnExit.Click
            Close()
        End Sub

        Private Sub btnOpenFile_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnOpenFile.Click
            If openFileDialog1.ShowDialog() <> System.Windows.Forms.DialogResult.OK Then
                Return
            End If
            ImportFile(openFileDialog1.FileName, btnFormatValues.Checked)
        End Sub

        Private Sub ImportFile(ByVal FileName As String, ByVal Formatted As Boolean)
            Try
                'Open the Excel file.
                Dim xls As New XlsFile(False)
                Dim StartOpen As Date = Date.Now
                xls.Open(FileName)
                Dim EndOpen As Date = Date.Now

                'Set up the Grid
                DisplayGrid.DataBindings.Clear()
                DisplayGrid.DataSource = Nothing
                DisplayGrid.DataMember = Nothing
                Dim dataSet1 As New DataSet()
                sheetCombo.Items.Clear()

                'We will create a DataTable "SheetN" for each sheet on the Excel sheet.
                For sheet As Integer = 1 To xls.SheetCount
                    xls.ActiveSheet = sheet

                    sheetCombo.Items.Add(xls.SheetName)

                    Dim Data As DataTable = dataSet1.Tables.Add("Sheet" & sheet.ToString())
                    Data.BeginLoadData()
                    Try
                        Dim ColCount As Integer = xls.ColCount
                        'Add one column on the dataset for each used column on Excel.
                        For c As Integer = 1 To ColCount
                            Data.Columns.Add(TCellAddress.EncodeColumn(c), GetType(String)) 'Here we will add all strings, since we do not know what we are waiting for.
                        Next c

                        Dim dr(ColCount - 1) As String

                        Dim RowCount As Integer = xls.RowCount
                        For r As Integer = 1 To RowCount
                            Array.Clear(dr, 0, dr.Length)
                            'This loop will only loop on used cells. It is more efficient than looping on all the columns.
                            For cIndex As Integer = xls.ColCountInRow(r) To 1 Step -1 'reverse the loop to avoid calling ColCountInRow more than once.
                                Dim Col As Integer = xls.ColFromIndex(r, cIndex)

                                If Formatted Then
                                    Dim rs As TRichString = xls.GetStringFromCell(r, Col)
                                    dr(Col - 1) = rs.Value
                                Else
                                    Dim XF As Integer = 0 'This is the cell format, we will not use it here.
                                    Dim val As Object = xls.GetCellValueIndexed(r, cIndex, XF)

                                    Dim Fmla As TFormula = TryCast(val, TFormula)
                                    If Fmla IsNot Nothing Then
                                        'When we have formulas, we want to write the formula result.
                                        'If we wanted the formula text, we would not need this part.
                                        dr(Col - 1) = Convert.ToString(Fmla.Result)
                                    Else
                                        dr(Col - 1) = Convert.ToString(val)
                                    End If
                                End If
                            Next cIndex
                            Data.Rows.Add(dr)
                        Next r
                    Finally
                        Data.EndLoadData()
                    End Try

                    Dim EndFill As Date = Date.Now
                    statusBar.Text = String.Format("Time to load file: {0}    Time to fill dataset: {1}     Total time: {2}", (EndOpen.Subtract(StartOpen)).ToString(), (EndFill.Subtract(EndOpen)).ToString(), (EndFill.Subtract(StartOpen)).ToString())

                Next sheet

                'Set up grid.
                DisplayGrid.DataSource = dataSet1
                DisplayGrid.DataMember = "Sheet1"
                sheetCombo.SelectedIndex = 0
                DisplayGrid.CaptionText = FileName

            Catch
                DisplayGrid.CaptionText = "Error Loading File"
                DisplayGrid.DataSource = Nothing
                DisplayGrid.DataMember = ""
                sheetCombo.Items.Clear()
                Throw
            End Try
        End Sub

        Private Sub sheetCombo_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles sheetCombo.SelectedIndexChanged
            If (TryCast(sender, ComboBox)).SelectedIndex < 0 Then
                Return
            End If
            DisplayGrid.DataMember = "Sheet" & ((TryCast(sender, ComboBox)).SelectedIndex + 1).ToString()
        End Sub

        Private Sub AnalizeFile(ByVal FileName As String, ByVal Row As Integer, ByVal Col As Integer)
            Dim xls As New XlsFile()
            xls.Open(FileName)

            Dim XF As Integer = 0
            MessageBox.Show("Active sheet is """ & xls.ActiveSheetByName & """")
            Dim v As Object = xls.GetCellValue(Row, Col, XF)

            If v Is Nothing Then
                MessageBox.Show("Cell A1 is empty")
                Return
            End If

            'Here we have all the kind of objects FlexCel can return.
            Select Case Type.GetTypeCode(v.GetType())
                Case TypeCode.Boolean
                    MessageBox.Show("Cell A1 is a boolean: " & CBool(v))
                    Return
                Case TypeCode.Double 'Remember, dates are doubles with date format.
                    Dim CellColor As TUIColor = Color.Empty
                    Dim HasDate, HasTime As Boolean
                    Dim CellValue As String = TFlxNumberFormat.FormatValue(v, xls.GetFormat(XF).Format, CellColor, xls, HasDate, HasTime).ToString()

                    If HasDate OrElse HasTime Then
                        MessageBox.Show("Cell A1 is a DateTime value: " & FlxDateTime.FromOADate(CDbl(v), xls.OptionsDates1904).ToString() & vbLf & "The value is displayed as: " & CellValue)
                    Else
                        MessageBox.Show("Cell A1 is a double: " & CDbl(v) & vbLf & "The value is displayed as: " & CellValue & vbLf)
                    End If
                    Return
                Case TypeCode.String
                    MessageBox.Show("Cell A1 is a string: " & v.ToString())
                    Return
            End Select

            Dim Fmla As TFormula = TryCast(v, TFormula)
            If Fmla IsNot Nothing Then
                MessageBox.Show("Cell A1 is a formula: " & Fmla.Text & "   Value: " & Convert.ToString(Fmla.Result))
                Return
            End If

            Dim RSt As TRichString = TryCast(v, TRichString)
            If RSt IsNot Nothing Then
                MessageBox.Show("Cell A1 is a formatted string: " & RSt.Value)
                Return
            End If

            If TypeOf v Is TFlxFormulaErrorValue Then
                MessageBox.Show("Cell A1 is an error: " & TFormulaMessages.ErrString(CType(v, TFlxFormulaErrorValue)))
                Return
            End If

            Throw New Exception("Unexpected value on cell")

        End Sub

        Private Sub btnInfo_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnInfo.Click
            MessageBox.Show("This demo shows how to read the contents of an xls file" & vbLf & "The 'Open File' button will load an Excel file into a dataset. Depending on the button 'Format Values' it will load the actual values (this is the fastest) or the formatted values." & vbLf & "The 'Format Values' button will modify how the files are read when you press 'Open File'. Formated values are slower, but they will look just how Excel shows them." & vbLf & "The 'Value in Cell A1' button will load an Excel file and show the contents of cell a1 on the active sheet.")
        End Sub

        ''' <summary>
        ''' This method will not do anything truly useful, but it alows you to see how to
        ''' process the different types of objects that GetCellValue can return
        ''' </summary>
        ''' <param name="sender"></param>
        ''' <param name="e"></param>
        Private Sub btnValueInCurrentCell_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnValueInCellA1.Click
            If openFileDialog1.ShowDialog() <> System.Windows.Forms.DialogResult.OK Then
                Return
            End If
            AnalizeFile(openFileDialog1.FileName, 1, 1)
        End Sub
    End Class
End Namespace

Program.vb

Namespace ReadingFiles
    Friend NotInheritable Class Program

        Private Sub New()
        End Sub

        ''' <summary>
        ''' The main entry point for the application.
        ''' </summary>
       <STAThread> _
        Shared Sub Main()
            Application.EnableVisualStyles()
            Application.SetCompatibleTextRenderingDefault(False)
            Application.Run(New mainForm())
        End Sub
    End Class
End Namespace


Working in virtual mode (VB.Net / netframework) | FlexCel Studio for the .NET Framework documentation

Working in virtual mode (VB.Net / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\vb\VS2022\netframework\10.API\22.Virtual Mode and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​vb/​VS2022/​netframework/​Modules/​10.​API/​22.​Virtual Mode

Overview

This example shows how to read or write Excel files without fully loading them in memory. See the FlexCel Performance Guide for more information in how Virtual Mode works.

Concepts

  • How to read xls, xlsx or txt files without loading them into memory.

Files

AssemblyInfo.vb

Imports System.Reflection
Imports System.Runtime.CompilerServices

'
' General Information about an assembly is controlled through the following
' set of attributes. Change these attribute values to modify the information
' associated with an assembly.
'
<Assembly: AssemblyTitle("")>
<Assembly: AssemblyDescription("")>
<Assembly: AssemblyConfiguration("")>
<Assembly: AssemblyCompany("")>
<Assembly: AssemblyProduct("")>
<Assembly: AssemblyCopyright("(c) 2002 - 2014 TMS Software")>
<Assembly: AssemblyTrademark("")>
<Assembly: AssemblyCulture("")>

'
' Version information for an assembly consists of the following four values:
'
'      Major Version
'      Minor Version
'      Build Number
'      Revision
'
' You can specify all the values or you can default the Revision and Build Numbers
' by using the '*' as shown below:

<Assembly: AssemblyVersion("6.2.1.0")>

'
' In order to sign your assembly you must specify a key to use. Refer to the
' Microsoft .NET Framework documentation for more information on assembly signing.
'
' Use the attributes below to control which key is used for signing.
'
' Notes:
'   (*) If no key is specified, the assembly is not signed.
'   (*) KeyName refers to a key that has been installed in the Crypto Service
'       Provider (CSP) on your machine. KeyFile refers to a file which contains
'       a key.
'   (*) If the KeyFile and the KeyName values are both specified, the
'       following processing occurs:
'       (1) If the KeyName can be found in the CSP, that key is used.
'       (2) If the KeyName does not exist and the KeyFile does exist, the key
'           in the KeyFile is installed into the CSP and used.
'   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
'       When specifying the KeyFile, the location of the KeyFile should be
'       relative to the project output directory which is
'       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
'       located in the project directory, you would specify the AssemblyKeyFile
'       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
'   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
'       documentation for more information on this.
'
<Assembly: AssemblyDelaySign(False)>
<Assembly: AssemblyKeyFile("")>
<Assembly: AssemblyKeyName("")>

CellReader.vb

Imports System.Text
Imports FlexCel.Core

Namespace VirtualMode
    'A simple cell reader that will get the values from FlexCel and put them into a grid.
    Friend Class CellReader
        Private Only50Rows As Boolean
        Private CellData As SparseCellArray
        Private FormatValues As Boolean
        Private SheetToRead As Integer
        Public StartSheetSelect As Date
        Public EndSheetSelect As Date

        Public Sub New(ByVal aOnly50Rows As Boolean, ByVal aCellData As SparseCellArray, ByVal aFormatValues As Boolean)
            Only50Rows = aOnly50Rows
            CellData = aCellData
            FormatValues = aFormatValues
        End Sub

        Public Sub OnStartReading(ByVal sender As Object, ByVal e As VirtualCellStartReadingEventArgs)
            StartSheetSelect = Date.Now
            Using SheetSelector As New SheetSelectorForm(e.SheetNames)

                If Not SheetSelector.Execute() Then
                    EndSheetSelect = Date.Now
                    e.NextSheet = Nothing 'stop reading
                    Return
                End If

                EndSheetSelect = Date.Now
                e.NextSheet = SheetSelector.SelectedSheet
                SheetToRead = SheetSelector.SelectedSheetIndex + 1
            End Using
        End Sub

        Public Sub OnCellRead(ByVal sender As Object, ByVal e As VirtualCellReadEventArgs)
            If Only50Rows AndAlso e.Cell.Row > 50 Then
                e.NextSheet = Nothing 'Stop reading all sheets.
                Return
            End If

            If e.Cell.Sheet <> SheetToRead Then
                e.NextSheet = Nothing 'Stop reading all sheets.
                Return
            End If

            If FormatValues Then
                Dim Clr As TUIColor = Color.Empty
                CellData.AddValue(e.Cell.Row, e.Cell.Col, TFlxNumberFormat.FormatValue(e.Cell.Value, CType(sender, ExcelFile).GetFormat(e.Cell.XF).Format, Clr, (CType(sender, ExcelFile))))
            Else
                CellData.AddValue(e.Cell.Row, e.Cell.Col, Convert.ToString(e.Cell.Value))
            End If
        End Sub
    End Class
End Namespace

Form1.Designer.vb

Imports System.Collections
Imports System.ComponentModel
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Namespace VirtualMode
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Private openFileDialog1 As System.Windows.Forms.OpenFileDialog
        Private panel2 As System.Windows.Forms.Panel
        Private statusBar As System.Windows.Forms.StatusBar
        Private components As System.ComponentModel.IContainer = Nothing

        ''' <summary>
        ''' Clean up any resources being used.
        ''' </summary>
        Protected Overrides Sub Dispose(ByVal disposing As Boolean)
            If disposing Then
                If components IsNot Nothing Then
                    components.Dispose()
                End If
            End If
            MyBase.Dispose(disposing)
        End Sub

        #Region "Windows Form Designer generated code"
        ''' <summary>
        ''' Required method for Designer support - do not modify
        ''' the contents of this method with the code editor.
        ''' </summary>
        Private Sub InitializeComponent()
            Dim dataGridViewCellStyle1 As New System.Windows.Forms.DataGridViewCellStyle()
            Dim resources As New System.ComponentModel.ComponentResourceManager(GetType(mainForm))
            Me.openFileDialog1 = New System.Windows.Forms.OpenFileDialog()
            Me.panel2 = New System.Windows.Forms.Panel()
            Me.cbFormatValues = New System.Windows.Forms.CheckBox()
            Me.cbIgnoreFormulaText = New System.Windows.Forms.CheckBox()
            Me.cbFirst50Rows = New System.Windows.Forms.CheckBox()
            Me.statusBar = New System.Windows.Forms.StatusBar()
            Me.DisplayGrid = New System.Windows.Forms.DataGridView()
            Me.GridCaptionPanel = New System.Windows.Forms.Panel()
            Me.GridCaption = New System.Windows.Forms.Label()
            Me.mainToolbar = New System.Windows.Forms.ToolStrip()
            Me.toolStripSeparator1 = New System.Windows.Forms.ToolStripSeparator()
            Me.btnOpenFile = New System.Windows.Forms.ToolStripButton()
            Me.btnExit = New System.Windows.Forms.ToolStripButton()
            Me.btnInfo = New System.Windows.Forms.ToolStripButton()
            Me.panel2.SuspendLayout()
            CType(Me.DisplayGrid, System.ComponentModel.ISupportInitialize).BeginInit()
            Me.GridCaptionPanel.SuspendLayout()
            Me.mainToolbar.SuspendLayout()
            Me.SuspendLayout()
            '
            ' openFileDialog1
            '
            Me.openFileDialog1.DefaultExt = "xls"
            Me.openFileDialog1.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm|Excel 97/2003|*.xls|Excel 2007|*.xlsx;*.xlsm|All " & "files|*.*"
            Me.openFileDialog1.Title = "Open an Excel File"
            '
            ' panel2
            '
            Me.panel2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
            Me.panel2.Controls.Add(Me.cbFormatValues)
            Me.panel2.Controls.Add(Me.cbIgnoreFormulaText)
            Me.panel2.Controls.Add(Me.cbFirst50Rows)
            Me.panel2.Dock = System.Windows.Forms.DockStyle.Top
            Me.panel2.Location = New System.Drawing.Point(0, 38)
            Me.panel2.Name = "panel2"
            Me.panel2.Size = New System.Drawing.Size(880, 25)
            Me.panel2.TabIndex = 4
            '
            ' cbFormatValues
            '
            Me.cbFormatValues.AutoSize = True
            Me.cbFormatValues.Location = New System.Drawing.Point(269, 5)
            Me.cbFormatValues.Name = "cbFormatValues"
            Me.cbFormatValues.Size = New System.Drawing.Size(131, 17)
            Me.cbFormatValues.TabIndex = 2
            Me.cbFormatValues.Text = "Format values (slower)"
            Me.cbFormatValues.UseVisualStyleBackColor = True
            '
            ' cbIgnoreFormulaText
            '
            Me.cbIgnoreFormulaText.AutoSize = True
            Me.cbIgnoreFormulaText.Checked = True
            Me.cbIgnoreFormulaText.CheckState = System.Windows.Forms.CheckState.Checked
            Me.cbIgnoreFormulaText.Location = New System.Drawing.Point(150, 5)
            Me.cbIgnoreFormulaText.Name = "cbIgnoreFormulaText"
            Me.cbIgnoreFormulaText.Size = New System.Drawing.Size(113, 17)
            Me.cbIgnoreFormulaText.TabIndex = 1
            Me.cbIgnoreFormulaText.Text = "Ignore formula text"
            Me.cbIgnoreFormulaText.UseVisualStyleBackColor = True
            '
            ' cbFirst50Rows
            '
            Me.cbFirst50Rows.AutoSize = True
            Me.cbFirst50Rows.Checked = True
            Me.cbFirst50Rows.CheckState = System.Windows.Forms.CheckState.Checked
            Me.cbFirst50Rows.Location = New System.Drawing.Point(11, 5)
            Me.cbFirst50Rows.Name = "cbFirst50Rows"
            Me.cbFirst50Rows.Size = New System.Drawing.Size(133, 17)
            Me.cbFirst50Rows.TabIndex = 0
            Me.cbFirst50Rows.Text = "Read only first 50 rows"
            Me.cbFirst50Rows.UseVisualStyleBackColor = True
            '
            ' statusBar
            '
            Me.statusBar.Location = New System.Drawing.Point(0, 439)
            Me.statusBar.Name = "statusBar"
            Me.statusBar.Size = New System.Drawing.Size(880, 22)
            Me.statusBar.TabIndex = 7
            '
            ' DisplayGrid
            '
            Me.DisplayGrid.AllowUserToAddRows = False
            Me.DisplayGrid.AllowUserToDeleteRows = False
            dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter
            dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Control
            dataGridViewCellStyle1.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, (CByte(0)))
            dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.WindowText
            dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight
            dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText
            dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.True
            Me.DisplayGrid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1
            Me.DisplayGrid.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
            Me.DisplayGrid.Dock = System.Windows.Forms.DockStyle.Fill
            Me.DisplayGrid.Location = New System.Drawing.Point(0, 86)
            Me.DisplayGrid.Name = "DisplayGrid"
            Me.DisplayGrid.ReadOnly = True
            Me.DisplayGrid.Size = New System.Drawing.Size(880, 353)
            Me.DisplayGrid.TabIndex = 8
            Me.DisplayGrid.VirtualMode = True
'           Me.DisplayGrid.CellValueNeeded += New System.Windows.Forms.DataGridViewCellValueEventHandler(Me.DisplayGrid_CellValueNeeded)
'           Me.DisplayGrid.RowPostPaint += New System.Windows.Forms.DataGridViewRowPostPaintEventHandler(Me.DisplayGrid_RowPostPaint)
            '
            ' GridCaptionPanel
            '
            Me.GridCaptionPanel.BackColor = System.Drawing.SystemColors.ActiveCaption
            Me.GridCaptionPanel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
            Me.GridCaptionPanel.Controls.Add(Me.GridCaption)
            Me.GridCaptionPanel.Dock = System.Windows.Forms.DockStyle.Top
            Me.GridCaptionPanel.ForeColor = System.Drawing.SystemColors.ActiveCaptionText
            Me.GridCaptionPanel.Location = New System.Drawing.Point(0, 63)
            Me.GridCaptionPanel.Name = "GridCaptionPanel"
            Me.GridCaptionPanel.Size = New System.Drawing.Size(880, 23)
            Me.GridCaptionPanel.TabIndex = 9
            '
            ' GridCaption
            '
            Me.GridCaption.AutoSize = True
            Me.GridCaption.Location = New System.Drawing.Point(13, 6)
            Me.GridCaption.Name = "GridCaption"
            Me.GridCaption.Size = New System.Drawing.Size(0, 13)
            Me.GridCaption.TabIndex = 0
            '
            ' mainToolbar
            '
            Me.mainToolbar.Items.AddRange(New System.Windows.Forms.ToolStripItem() { Me.btnOpenFile, Me.toolStripSeparator1, Me.btnExit, Me.btnInfo})
            Me.mainToolbar.Location = New System.Drawing.Point(0, 0)
            Me.mainToolbar.Name = "mainToolbar"
            Me.mainToolbar.Size = New System.Drawing.Size(880, 38)
            Me.mainToolbar.TabIndex = 10
            Me.mainToolbar.Text = "toolStrip1"
            '
            ' toolStripSeparator1
            '
            Me.toolStripSeparator1.Name = "toolStripSeparator1"
            Me.toolStripSeparator1.Size = New System.Drawing.Size(6, 38)
            '
            ' btnOpenFile
            '
            Me.btnOpenFile.Image = (CType(resources.GetObject("btnOpenFile.Image"), System.Drawing.Image))
            Me.btnOpenFile.ImageTransparentColor = System.Drawing.Color.Magenta
            Me.btnOpenFile.Name = "btnOpenFile"
            Me.btnOpenFile.Size = New System.Drawing.Size(59, 35)
            Me.btnOpenFile.Text = "Open file"
            Me.btnOpenFile.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText
'           Me.btnOpenFile.Click += New System.EventHandler(Me.btnOpenFile_Click)
            '
            ' btnExit
            '
            Me.btnExit.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right
            Me.btnExit.Image = (CType(resources.GetObject("btnExit.Image"), System.Drawing.Image))
            Me.btnExit.ImageTransparentColor = System.Drawing.Color.Magenta
            Me.btnExit.Name = "btnExit"
            Me.btnExit.Size = New System.Drawing.Size(59, 35)
            Me.btnExit.Text = "     E&xit     "
            Me.btnExit.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText
'           Me.btnExit.Click += New System.EventHandler(Me.btnExit_Click)
            '
            ' btnInfo
            '
            Me.btnInfo.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right
            Me.btnInfo.Image = (CType(resources.GetObject("btnInfo.Image"), System.Drawing.Image))
            Me.btnInfo.ImageTransparentColor = System.Drawing.Color.Magenta
            Me.btnInfo.Name = "btnInfo"
            Me.btnInfo.Size = New System.Drawing.Size(74, 35)
            Me.btnInfo.Text = "Information"
            Me.btnInfo.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText
'           Me.btnInfo.Click += New System.EventHandler(Me.btnInfo_Click)
            '
            ' mainForm
            '
            Me.AutoScaleDimensions = New System.Drawing.SizeF(6F, 13F)
            Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
            Me.ClientSize = New System.Drawing.Size(880, 461)
            Me.Controls.Add(Me.DisplayGrid)
            Me.Controls.Add(Me.GridCaptionPanel)
            Me.Controls.Add(Me.panel2)
            Me.Controls.Add(Me.statusBar)
            Me.Controls.Add(Me.mainToolbar)
            Me.Name = "mainForm"
            Me.Text = "Virtual Mode Example - Cells are not stored in memory"
            Me.panel2.ResumeLayout(False)
            Me.panel2.PerformLayout()
            CType(Me.DisplayGrid, System.ComponentModel.ISupportInitialize).EndInit()
            Me.GridCaptionPanel.ResumeLayout(False)
            Me.GridCaptionPanel.PerformLayout()
            Me.mainToolbar.ResumeLayout(False)
            Me.mainToolbar.PerformLayout()
            Me.ResumeLayout(False)
            Me.PerformLayout()

        End Sub
        #End Region

        Private WithEvents DisplayGrid As DataGridView
        Private GridCaptionPanel As Panel
        Private GridCaption As Label
        Private mainToolbar As ToolStrip
        Private WithEvents btnOpenFile As ToolStripButton
        Private toolStripSeparator1 As ToolStripSeparator
        Private WithEvents btnInfo As ToolStripButton
        Private WithEvents btnExit As ToolStripButton
        Private cbFirst50Rows As CheckBox
        Private cbIgnoreFormulaText As CheckBox
        Private cbFormatValues As CheckBox
    End Class
End Namespace

Form1.vb

Imports System.Collections
Imports System.ComponentModel

Imports FlexCel.Core
Imports FlexCel.XlsAdapter

Namespace VirtualMode
    ''' <summary>
    ''' A demo on how to read a file from FlexCel and display the results.
    ''' </summary>
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Private CellData As SparseCellArray 'we will store the data here. This is an example, in real world you would use "Virtual mode" to load the cells into your own structures.

        Public Sub New()
            InitializeComponent()
            ResizeToolbar(mainToolbar)
        End Sub

        Private Sub ResizeToolbar(ByVal toolbar As ToolStrip)

            Using gr As Graphics = CreateGraphics()
                Dim xFactor As Double = gr.DpiX / 96.0
                Dim yFactor As Double = gr.DpiY / 96.0
                toolbar.ImageScalingSize = New Size(CInt(Fix(24 * xFactor)), CInt(Fix(24 * yFactor)))
                toolbar.Width = 0 'force a recalc of the buttons.
            End Using
        End Sub

        Private Sub btnExit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnExit.Click
            Close()
        End Sub

        Private Sub btnInfo_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnInfo.Click
            MessageBox.Show("This demo shows how to read the contents of an xls file without loading the file in memory." & vbLf & "We will first load the sheet names in the file, then open just a single sheet, and read all or just the 50 first rows of it.")
        End Sub

        Private Sub btnOpenFile_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnOpenFile.Click
            If openFileDialog1.ShowDialog() <> System.Windows.Forms.DialogResult.OK Then
                Return
            End If
            ImportFile(openFileDialog1.FileName)
        End Sub

        Private Sub ImportFile(ByVal FileName As String)
            Try
                Dim xls As New XlsFile()
                xls.VirtualMode = True 'Remember to turn virtual mode on, or the event won't be called.

                'By default, FlexCel returns the formula text for the formulas, besides its calculated value.
                'If you are not interested in formula texts, you can gain a little performance by ignoring it.
                'This also works in non virtual mode.
                xls.IgnoreFormulaText = cbIgnoreFormulaText.Checked

                CellData = New SparseCellArray()

                'Attach the CellReader handler.
                Dim cr As New CellReader(cbFirst50Rows.Checked, CellData, cbFormatValues.Checked)
                AddHandler xls.VirtualCellStartReading, AddressOf cr.OnStartReading
                AddHandler xls.VirtualCellRead, AddressOf cr.OnCellRead

                Dim StartOpen As Date = Date.Now

                'Open the file. As we have a CellReader attached, the cells won't be loaded into memory, they will be passed to the CellReader
                xls.Open(FileName)
                Dim StartSheetSelect As Date = cr.StartSheetSelect
                Dim EndSheetSelect As Date = cr.EndSheetSelect

                Dim EndOpen As Date = Date.Now
                statusBar.Text = "Time to open file: " & (StartSheetSelect.Subtract(StartOpen)).ToString() & "     Time to load file and fill grid: " & (EndOpen.Subtract(EndSheetSelect)).ToString()

                'Set up grid.
                GridCaption.Text = FileName
                If CellData IsNot Nothing Then
                    DisplayGrid.ColumnCount = CellData.ColCount
                    DisplayGrid.RowCount = CellData.RowCount
                Else
                    DisplayGrid.ColumnCount = 0
                    DisplayGrid.RowCount = 0
                End If

                For i As Integer = 0 To DisplayGrid.ColumnCount - 1
                    DisplayGrid.Columns(i).Name = TCellAddress.EncodeColumn(i + 1)
                Next i
            Catch
                GridCaption.Text = "Error Loading File"
                CellData = Nothing
                Throw
            End Try
        End Sub

        Private Sub DisplayGrid_RowPostPaint(ByVal sender As Object, ByVal e As DataGridViewRowPostPaintEventArgs) Handles DisplayGrid.RowPostPaint
            'Show the row number in the grid at the left
            Dim r As String = (e.RowIndex + 1).ToString()
            Dim textSize As SizeF = e.Graphics.MeasureString(r, DisplayGrid.Font)
            If DisplayGrid.RowHeadersWidth < CInt(textSize.Width + 20) Then
                DisplayGrid.RowHeadersWidth = CInt(textSize.Width + 20)
            End If
            e.Graphics.DrawString(r, DisplayGrid.Font, SystemBrushes.ControlText, e.RowBounds.Left + DisplayGrid.RowHeadersWidth - textSize.Width - 5, e.RowBounds.Location.Y + ((e.RowBounds.Height - textSize.Height) / 2F))
        End Sub

        Private Sub DisplayGrid_CellValueNeeded(ByVal sender As Object, ByVal e As DataGridViewCellValueEventArgs) Handles DisplayGrid.CellValueNeeded
            If CellData Is Nothing Then
                e.Value = Nothing
                Return
            End If

            If e.RowIndex >= CellData.RowCount Then
                e.Value = Nothing
                Return
            End If

            e.Value = CellData.GetValue(e.RowIndex + 1, e.ColumnIndex + 1)
        End Sub
    End Class
End Namespace

Program.vb

Namespace VirtualMode
    Friend NotInheritable Class Program

        Private Sub New()
        End Sub

        ''' <summary>
        ''' The main entry point for the application.
        ''' </summary>
       <STAThread> _
        Shared Sub Main()
            Application.EnableVisualStyles()
            Application.SetCompatibleTextRenderingDefault(False)
            Application.Run(New mainForm())
        End Sub
    End Class
End Namespace

SheetSelectorForm.Designer.vb

Namespace VirtualMode
    Partial Public Class SheetSelectorForm
        ''' <summary>
        ''' Required designer variable.
        ''' </summary>
        Private components As System.ComponentModel.IContainer = Nothing

        ''' <summary>
        ''' Clean up any resources being used.
        ''' </summary>
        ''' <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        Protected Overrides Sub Dispose(ByVal disposing As Boolean)
            If disposing AndAlso (components IsNot Nothing) Then
                components.Dispose()
            End If
            MyBase.Dispose(disposing)
        End Sub

        #Region "Windows Form Designer generated code"

        ''' <summary>
        ''' Required method for Designer support - do not modify
        ''' the contents of this method with the code editor.
        ''' </summary>
        Private Sub InitializeComponent()
            Me.panel1 = New System.Windows.Forms.Panel()
            Me.btnOk = New System.Windows.Forms.Button()
            Me.btnCancel = New System.Windows.Forms.Button()
            Me.SheetList = New System.Windows.Forms.ListBox()
            Me.panel1.SuspendLayout()
            Me.SuspendLayout()
            '
            ' panel1
            '
            Me.panel1.Controls.Add(Me.btnCancel)
            Me.panel1.Controls.Add(Me.btnOk)
            Me.panel1.Dock = System.Windows.Forms.DockStyle.Bottom
            Me.panel1.Location = New System.Drawing.Point(0, 217)
            Me.panel1.Name = "panel1"
            Me.panel1.Size = New System.Drawing.Size(284, 45)
            Me.panel1.TabIndex = 0
            '
            ' btnOk
            '
            Me.btnOk.DialogResult = System.Windows.Forms.DialogResult.OK
            Me.btnOk.Location = New System.Drawing.Point(116, 10)
            Me.btnOk.Name = "btnOk"
            Me.btnOk.Size = New System.Drawing.Size(75, 23)
            Me.btnOk.TabIndex = 0
            Me.btnOk.Text = "Ok"
            Me.btnOk.UseVisualStyleBackColor = True
            '
            ' btnCancel
            '
            Me.btnCancel.Anchor = (CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel
            Me.btnCancel.Location = New System.Drawing.Point(197, 10)
            Me.btnCancel.Name = "btnCancel"
            Me.btnCancel.Size = New System.Drawing.Size(75, 23)
            Me.btnCancel.TabIndex = 1
            Me.btnCancel.Text = "Cancel"
            Me.btnCancel.UseVisualStyleBackColor = True
            '
            ' SheetList
            '
            Me.SheetList.Dock = System.Windows.Forms.DockStyle.Fill
            Me.SheetList.FormattingEnabled = True
            Me.SheetList.Location = New System.Drawing.Point(0, 0)
            Me.SheetList.Name = "SheetList"
            Me.SheetList.Size = New System.Drawing.Size(284, 217)
            Me.SheetList.TabIndex = 1
'           Me.SheetList.DoubleClick += New System.EventHandler(Me.SheetList_DoubleClick)
            '
            ' SheetSelectorForm
            '
            Me.AcceptButton = Me.btnOk
            Me.AutoScaleDimensions = New System.Drawing.SizeF(6F, 13F)
            Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
            Me.CancelButton = Me.btnCancel
            Me.ClientSize = New System.Drawing.Size(284, 262)
            Me.Controls.Add(Me.SheetList)
            Me.Controls.Add(Me.panel1)
            Me.Name = "SheetSelectorForm"
            Me.Text = "Select sheet to load..."
            Me.panel1.ResumeLayout(False)
            Me.ResumeLayout(False)

        End Sub

        #End Region

        Private panel1 As System.Windows.Forms.Panel
        Private btnCancel As System.Windows.Forms.Button
        Private btnOk As System.Windows.Forms.Button
        Private WithEvents SheetList As System.Windows.Forms.ListBox
    End Class
End Namespace

SheetSelectorForm.vb

Imports System.ComponentModel
Imports System.Text

Namespace VirtualMode
    Partial Public Class SheetSelectorForm
        Inherits Form

        Public Sub New()
            InitializeComponent()
        End Sub

        Public Sub New(ByVal SheetNames() As String)
            Me.New()
            For Each s As String In SheetNames
                SheetList.Items.Add(s)
            Next s

            SheetList.SelectedIndex = 0
        End Sub

        Friend Function Execute() As Boolean
            Return ShowDialog() = System.Windows.Forms.DialogResult.OK
        End Function

        Public ReadOnly Property SelectedSheet() As String
            Get
                Return Convert.ToString(SheetList.SelectedItem)
            End Get
        End Property

        Public ReadOnly Property SelectedSheetIndex() As Integer
            Get
                Return SheetList.SelectedIndex
            End Get
        End Property

        Private Sub SheetList_DoubleClick(ByVal sender As Object, ByVal e As EventArgs) Handles SheetList.DoubleClick
            DialogResult = System.Windows.Forms.DialogResult.OK
        End Sub
    End Class
End Namespace

SparseCellArray.vb

Imports System.Text

Namespace VirtualMode
    ''' <summary>
    '''   This is a simple class that holds cell values. Items are supposed to
    '''   be entered in sorted order, and it isn't really production-ready, just
    '''   to be used in a demo.
    ''' </summary>
    Friend Class SparseCellArray
        Private Data As List(Of SparseRow)
        Private FColCount As Integer

        Public Sub New()
            FColCount = 0
        End Sub
        Public Sub AddValue(ByVal Row As Integer, ByVal Col As Integer, ByVal Value As String)
            If Col > FColCount Then
                FColCount = Col
            End If
            If Data Is Nothing Then
                Data = New List(Of SparseRow)()
            End If
            Dim SpRow As New SparseRow(Row)
            Dim Idx As Integer = Data.BinarySearch(SpRow)
            If Idx < 0 Then
                SpRow.CreateData()
                Data.Insert((Not Idx), SpRow)
            Else
                SpRow = Data(Idx)
            End If

            Dim SpCell As New SparseCell(Col, Value)
            Idx = SpRow.Data.BinarySearch(SpCell)
            If Idx < 0 Then
                SpRow.Data.Insert((Not Idx), SpCell)
            Else
                SpRow.Data(Idx) = SpCell
            End If

        End Sub

        Public Function GetValue(ByVal Row As Integer, ByVal Col As Integer) As String
            If Data Is Nothing Then
                Return Nothing
            End If

            Dim SpRow As New SparseRow(Row)
            Dim Idx As Integer = Data.BinarySearch(SpRow)
            If Idx < 0 Then
                Return Nothing
            End If
            SpRow = Data(Idx)
            Dim SpCell As New SparseCell(Col, Nothing)
            Idx = SpRow.Data.BinarySearch(SpCell)
            If Idx < 0 Then
                Return Nothing
            End If
            Return SpRow.Data(Idx).Value
        End Function

        Public ReadOnly Property ColCount() As Integer
            Get
                Return FColCount
            End Get
        End Property
        Public ReadOnly Property RowCount() As Integer
            Get
                If Data Is Nothing OrElse Data.Count = 0 Then
                    Return 0
                End If
                Return Data(Data.Count - 1).Row
            End Get
        End Property
    End Class

    Friend Structure SparseRow
        Implements IComparable(Of SparseRow)

        Public Row As Integer
        Public Data As List(Of SparseCell)

        Public Sub New(ByVal aRow As Integer)
            Row = aRow
            Data = Nothing
        End Sub

        Public Sub CreateData()
            Data = New List(Of SparseCell)()
        End Sub

        #Region "IComparable<SparseRow> Members"

        Public Function CompareTo(ByVal other As SparseRow) As Integer Implements IComparable(Of SparseRow).CompareTo
            Return Row.CompareTo(other.Row)
        End Function

        #End Region
    End Structure

    Friend Class SparseCell
        Implements IComparable(Of SparseCell)

        Public Col As Integer
        Public Value As String

        Public Sub New(ByVal aCol As Integer, ByVal aValue As String)
            Col = aCol
            Value = aValue
        End Sub

        #Region "IComparable<SparseCell> Members"

        Public Function CompareTo(ByVal other As SparseCell) As Integer Implements IComparable(Of SparseCell).CompareTo
            Return Col.CompareTo(other.Col)
        End Function

        #End Region
    End Class
End Namespace


Reading and writing encrypted files (VB.Net / netframework) | FlexCel Studio for the .NET Framework documentation

Reading and writing encrypted files (VB.Net / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\vb\VS2022\netframework\10.API\25.Encrypted Files and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​vb/​VS2022/​netframework/​Modules/​10.​API/​25.​Encrypted Files

Overview

How to read and write Encrypted Excel files using FlexCel.

Concepts

  • Concepts on this demo are similar to the ones shown in Encryption And Subtotals example, but are repeated here so you can see them even if you are not using reports.

  • There are 4 ways to protect data in Excel:

    1. A password to open. This is the only way that will actually encrypt the file. All other methods just will add a record telling Excel not to modify the file. On Excel, this option is on ->Tools->Options... Security tab.

    2. A password to modify. Also on ->Tools->Options->Security tab, this password will allow you to open the file, but not to save it. The file will not be encrypted, and you can always use Save As to save the file.

    3. Protecting the workbook. This will cause a pseudo-encryption of the file, but the password used to encrypt will be always the same, no matter what password you enter. On Excel, this option is at ->Tools->Protection->Protect Workbook.

    4. Protecting the sheet. This option will protect the cells, objects, etc on a particular sheet. ->Tools->Protection->Protect Sheet.

  • When the file is encrypted (using a password to open) FlexCel supports four different encryption modes: Excel 95, Standard Excel97/2000 encryption, Excel 2007 xlsx encryption and Excel 2010 "agile" xlsx encryption.

  • To open an encrypted file, you can set the OpenPassword property or the OnPassword event. Use the OnPassword event when you want to interactively ask for a password if the file is encrypted.

Files

AssemblyInfo.vb

Imports System.Reflection
Imports System.Runtime.CompilerServices

'
' General Information about an assembly is controlled through the following
' set of attributes. Change these attribute values to modify the information
' associated with an assembly.
'
<Assembly: AssemblyTitle("")>
<Assembly: AssemblyDescription("")>
<Assembly: AssemblyConfiguration("")>
<Assembly: AssemblyCompany("")>
<Assembly: AssemblyProduct("")>
<Assembly: AssemblyCopyright("(c) 2002 - 2014 TMS Software")>
<Assembly: AssemblyTrademark("")>
<Assembly: AssemblyCulture("")>

'
' Version information for an assembly consists of the following four values:
'
'      Major Version
'      Minor Version
'      Build Number
'      Revision
'
' You can specify all the values or you can default the Revision and Build Numbers
' by using the '*' as shown below:

<Assembly: AssemblyVersion("6.2.1.0")>

'
' In order to sign your assembly you must specify a key to use. Refer to the
' Microsoft .NET Framework documentation for more information on assembly signing.
'
' Use the attributes below to control which key is used for signing.
'
' Notes:
'   (*) If no key is specified, the assembly is not signed.
'   (*) KeyName refers to a key that has been installed in the Crypto Service
'       Provider (CSP) on your machine. KeyFile refers to a file which contains
'       a key.
'   (*) If the KeyFile and the KeyName values are both specified, the
'       following processing occurs:
'       (1) If the KeyName can be found in the CSP, that key is used.
'       (2) If the KeyName does not exist and the KeyFile does exist, the key
'           in the KeyFile is installed into the CSP and used.
'   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
'       When specifying the KeyFile, the location of the KeyFile should be
'       relative to the project output directory which is
'       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
'       located in the project directory, you would specify the AssemblyKeyFile
'       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
'   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
'       documentation for more information on this.
'
<Assembly: AssemblyDelaySign(False)>
<Assembly: AssemblyKeyFile("")>
<Assembly: AssemblyKeyName("")>

Form1.Designer.vb

Imports System.Collections
Imports System.ComponentModel
Imports System.IO
Imports System.Reflection
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Namespace EncryptedFiles
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Private panel2 As System.Windows.Forms.Panel
        Private WithEvents btnExit As System.Windows.Forms.Button
        Private WithEvents btnGo As System.Windows.Forms.Button
        Private saveFileDialog1 As System.Windows.Forms.SaveFileDialog
        Private components As System.ComponentModel.IContainer = Nothing

        ''' <summary>
        ''' Clean up any resources being used.
        ''' </summary>
        Protected Overrides Sub Dispose(ByVal disposing As Boolean)
            If disposing Then
                If components IsNot Nothing Then
                    components.Dispose()
                End If
            End If
            MyBase.Dispose(disposing)
        End Sub

        #Region "Windows Form Designer generated code"
        ''' <summary>
        ''' Required method for Designer support - do not modify
        ''' the contents of this method with the code editor.
        ''' </summary>
        Private Sub InitializeComponent()
            Me.panel2 = New System.Windows.Forms.Panel()
            Me.btnExit = New System.Windows.Forms.Button()
            Me.saveFileDialog1 = New System.Windows.Forms.SaveFileDialog()
            Me.btnGo = New System.Windows.Forms.Button()
            Me.panel2.SuspendLayout()
            Me.SuspendLayout()
            '
            ' panel2
            '
            Me.panel2.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D
            Me.panel2.Controls.Add(Me.btnExit)
            Me.panel2.Dock = System.Windows.Forms.DockStyle.Top
            Me.panel2.Location = New System.Drawing.Point(0, 0)
            Me.panel2.Name = "panel2"
            Me.panel2.Size = New System.Drawing.Size(336, 35)
            Me.panel2.TabIndex = 4
            '
            ' btnExit
            '
            Me.btnExit.Anchor = (CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.btnExit.BackColor = System.Drawing.SystemColors.Control
            Me.btnExit.Image = My.Resources._4close
            Me.btnExit.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft
            Me.btnExit.Location = New System.Drawing.Point(272, 2)
            Me.btnExit.Name = "btnExit"
            Me.btnExit.Size = New System.Drawing.Size(56, 26)
            Me.btnExit.TabIndex = 2
            Me.btnExit.Text = "Exit"
            Me.btnExit.TextAlign = System.Drawing.ContentAlignment.MiddleRight
            Me.btnExit.UseVisualStyleBackColor = False
'           Me.btnExit.Click += New System.EventHandler(Me.btnExit_Click)
            '
            ' saveFileDialog1
            '
            Me.saveFileDialog1.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm|Excel 97/2003|*.xls|Excel 2007|*.xlsx;*.xlsm|All " & "files|*.*"
            Me.saveFileDialog1.RestoreDirectory = True
            '
            ' btnGo
            '
            Me.btnGo.BackColor = System.Drawing.SystemColors.Control
            Me.btnGo.Image = My.Resources._4gears
            Me.btnGo.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft
            Me.btnGo.Location = New System.Drawing.Point(96, 72)
            Me.btnGo.Name = "btnGo"
            Me.btnGo.Size = New System.Drawing.Size(152, 30)
            Me.btnGo.TabIndex = 5
            Me.btnGo.Text = "Create Encrypted File"
            Me.btnGo.TextAlign = System.Drawing.ContentAlignment.MiddleRight
            Me.btnGo.UseVisualStyleBackColor = False
'           Me.btnGo.Click += New System.EventHandler(Me.btnGo_Click)
            '
            ' mainForm
            '
            Me.AutoScaleDimensions = New System.Drawing.SizeF(6F, 13F)
            Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
            Me.ClientSize = New System.Drawing.Size(336, 122)
            Me.Controls.Add(Me.btnGo)
            Me.Controls.Add(Me.panel2)
            Me.Name = "mainForm"
            Me.Text = "Encrypted Excel Files"
            Me.panel2.ResumeLayout(False)
            Me.ResumeLayout(False)

        End Sub
        #End Region
    End Class
End Namespace

Form1.vb

Imports System.Collections
Imports System.ComponentModel
Imports System.IO
Imports System.Reflection

Imports FlexCel.Core
Imports FlexCel.XlsAdapter

Namespace EncryptedFiles
    ''' <summary>
    ''' Shows how to deal with Encrypted files.
    ''' </summary>
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Public Sub New()
            InitializeComponent()
        End Sub

        Private Sub btnExit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnExit.Click
            Close()
        End Sub

        'The event that will actually provide the password to open the empty form.
        Private Sub GetPassword(ByVal e As OnPasswordEventArgs)
            Dim Pwd As New PasswordDialog()
            e.Password = String.Empty
            If Pwd.ShowDialog() <> System.Windows.Forms.DialogResult.OK Then
                Return
            End If
            e.Password = Pwd.Password
        End Sub

        Private Sub btnGo_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnGo.Click
            ' On this demo we will fill data on an existing file with the api, starting with an encrypted file holding the starting formats.

            ' Declare some data for the chart.
            Dim Names() As String = { "Dog", "Cat", "Cow", "Horse", "Fish" }
            Dim Quantities() As Integer = { 123, 200, 150, 0, 180 }

            ' Use two folders up to where the exe is to store the data. (Exe is stored at bin\debug)
            Dim DataPath As String = Path.Combine(Path.Combine(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), ".."), "..") & Path.DirectorySeparatorChar

            Dim xls As New XlsFile(True)

            ' We will use the OnPassword event here to show how to
            ' open a file if you don't know a priory if it is encrypted or not.
            ' If you already knew the file was encrypted, (as in this case)you could use:
            ' xls.Protection.OpenPassword = "42";

            AddHandler xls.Protection.OnPassword, AddressOf GetPassword
            xls.Open(Path.Combine(DataPath, "EmptyForm.xls"))

            ' Insert rows so the chart range grows. On this case we assume the data is at least 2 rows long. If not, we should handle
            ' the case and do a xls.DeleteRange.
            xls.InsertAndCopyRange(New TXlsCellRange(1, 1, 1, 2), 5, 1, Names.Length - 2, TFlxInsertMode.ShiftRangeDown, TRangeCopyMode.None)

            ' Fill the data.
            For i As Integer = 0 To Names.Length - 1
                xls.SetCellValue(4 + i, 1, Names(i))
                xls.SetCellValue(4 + i, 2, Quantities(i))
            Next i

            ' Set a new password for opening.
            xls.Protection.OpenPassword = "43"
            xls.Protection.SetModifyPassword("43", False, "Ford Prefect")

            If saveFileDialog1.ShowDialog() = System.Windows.Forms.DialogResult.OK Then
                xls.Save(saveFileDialog1.FileName)

                If MessageBox.Show("Do you want to open the generated file? (Remember password is 43)", "Confirm", MessageBoxButtons.YesNo) = System.Windows.Forms.DialogResult.Yes Then
                    Process.Start(saveFileDialog1.FileName)
                End If
            End If
        End Sub

    End Class
End Namespace

PasswordDialog.Designer.vb

Imports System.Collections
Imports System.ComponentModel
Namespace EncryptedFiles
    Partial Public Class PasswordDialog
        Inherits System.Windows.Forms.Form

        Private label1 As System.Windows.Forms.Label
        Private label2 As System.Windows.Forms.Label
        Private PasswordEdit As System.Windows.Forms.TextBox
        Private label3 As System.Windows.Forms.Label
        Private btnOk As System.Windows.Forms.Button
        Public btnCancel As System.Windows.Forms.Button
        ''' <summary>
        ''' Required designer variable.
        ''' </summary>
        Private components As System.ComponentModel.Container = Nothing

        ''' <summary>
        ''' Clean up any resources being used.
        ''' </summary>
        Protected Overrides Sub Dispose(ByVal disposing As Boolean)
            If disposing Then
                If components IsNot Nothing Then
                    components.Dispose()
                End If
            End If
            MyBase.Dispose(disposing)
        End Sub

        #Region "Windows Form Designer generated code"
        ''' <summary>
        ''' Required method for Designer support - do not modify
        ''' the contents of this method with the code editor.
        ''' </summary>
        Private Sub InitializeComponent()
            Me.label1 = New System.Windows.Forms.Label()
            Me.label2 = New System.Windows.Forms.Label()
            Me.PasswordEdit = New System.Windows.Forms.TextBox()
            Me.label3 = New System.Windows.Forms.Label()
            Me.btnOk = New System.Windows.Forms.Button()
            Me.btnCancel = New System.Windows.Forms.Button()
            Me.SuspendLayout()
            '
            ' label1
            '
            Me.label1.Location = New System.Drawing.Point(16, 8)
            Me.label1.Name = "label1"
            Me.label1.Size = New System.Drawing.Size(280, 23)
            Me.label1.TabIndex = 0
            Me.label1.Text = "Please enter the password to open the template."
            '
            ' label2
            '
            Me.label2.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (CByte(0)))
            Me.label2.Location = New System.Drawing.Point(16, 32)
            Me.label2.Name = "label2"
            Me.label2.Size = New System.Drawing.Size(176, 23)
            Me.label2.TabIndex = 1
            Me.label2.Text = "HINT: The password is 42"
            '
            ' PasswordEdit
            '
            Me.PasswordEdit.Anchor = (CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.PasswordEdit.Location = New System.Drawing.Point(128, 64)
            Me.PasswordEdit.Name = "PasswordEdit"
            Me.PasswordEdit.PasswordChar = "*"c
            Me.PasswordEdit.Size = New System.Drawing.Size(360, 20)
            Me.PasswordEdit.TabIndex = 0
            Me.PasswordEdit.Text = ""
            '
            ' label3
            '
            Me.label3.Location = New System.Drawing.Point(56, 64)
            Me.label3.Name = "label3"
            Me.label3.Size = New System.Drawing.Size(64, 23)
            Me.label3.TabIndex = 3
            Me.label3.Text = "Password:"
            '
            ' btnOk
            '
            Me.btnOk.DialogResult = System.Windows.Forms.DialogResult.OK
            Me.btnOk.Location = New System.Drawing.Point(128, 112)
            Me.btnOk.Name = "btnOk"
            Me.btnOk.TabIndex = 1
            Me.btnOk.Text = "Ok"
            '
            ' btnCancel
            '
            Me.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel
            Me.btnCancel.Location = New System.Drawing.Point(216, 112)
            Me.btnCancel.Name = "btnCancel"
            Me.btnCancel.TabIndex = 2
            Me.btnCancel.Text = "Cancel"
            '
            ' PasswordDialog
            '
            Me.AcceptButton = Me.btnOk
            Me.AutoScaleDimensions = New System.Drawing.SizeF(6F, 13F)
            Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
            Me.ClientSize = New System.Drawing.Size(520, 154)
            Me.Controls.Add(Me.btnCancel)
            Me.Controls.Add(Me.btnOk)
            Me.Controls.Add(Me.label3)
            Me.Controls.Add(Me.PasswordEdit)
            Me.Controls.Add(Me.label2)
            Me.Controls.Add(Me.label1)
            Me.Name = "PasswordDialog"
            Me.ShowInTaskbar = False
            Me.Text = "Information"
            Me.ResumeLayout(False)

        End Sub
        #End Region
    End Class
End Namespace

PasswordDialog.vb

Imports System.Collections
Imports System.ComponentModel

Namespace EncryptedFiles
    ''' <summary>
    ''' Summary description for PasswordDialog.
    ''' </summary>
    Partial Public Class PasswordDialog
        Inherits System.Windows.Forms.Form

        Public Sub New()
            '
            ' Required for Windows Form Designer support
            '
            InitializeComponent()

            '
            ' TODO: Add any constructor code after InitializeComponent call
            '
        End Sub

        Public ReadOnly Property Password() As String
            Get
                Return PasswordEdit.Text
            End Get
        End Property
    End Class
End Namespace

Program.vb

Namespace EncryptedFiles
    Friend NotInheritable Class Program

        Private Sub New()
        End Sub

        ''' <summary>
        ''' The main entry point for the application.
        ''' </summary>
       <STAThread> _
        Shared Sub Main()
            Application.EnableVisualStyles()
            Application.SetCompatibleTextRenderingDefault(False)
            Application.Run(New mainForm())
        End Sub
    End Class
End Namespace


FlexCel image explorer (VB.Net / netframework) | FlexCel Studio for the .NET Framework documentation

FlexCel image explorer (VB.Net / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\vb\VS2022\netframework\10.API\30.FlexCelImageExplorer and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​vb/​VS2022/​netframework/​Modules/​10.​API/​30.​FlexCel​Image​Explorer

Overview

This is an application that will show all the images in an Excel file, to show their real size and bit depth. It will also allow you to extract those images to files. Note that the first time you open a file it can take some time, as it opens ALL the xls files on the folder and extracts all the image information so it can highlight files with problems.

Concepts

  • How to use the API to read the images on a file.

  • How to convert the images to 256 colors or black and white using GDI+

  • On the left pane, files in red are files that have a cropped image. (that is, the image stored is larger than the image shown on Excel). Having this cropped image only consumes disk space, and makes rendering to pdf slower, as the image has to be decoded, cropped to the real size and encoded again.

  • Bold entries on the left pane are images with true color and transparency. Those images can get very big quite fast, so it is better if you can convert them to indexed color. Also, file with true color and transparency have to be re-encoded when exporting to pdf, making the process slower.

Files

AssemblyInfo.vb

Imports System.Reflection
Imports System.Runtime.CompilerServices

'
' General Information about an assembly is controlled through the following
' set of attributes. Change these attribute values to modify the information
' associated with an assembly.
'
<Assembly: AssemblyTitle("")>
<Assembly: AssemblyDescription("")>
<Assembly: AssemblyConfiguration("")>
<Assembly: AssemblyCompany("")>
<Assembly: AssemblyProduct("")>
<Assembly: AssemblyCopyright("(c) 2002 - 2014 TMS Software")>
<Assembly: AssemblyTrademark("")>
<Assembly: AssemblyCulture("")>

'
' Version information for an assembly consists of the following four values:
'
'      Major Version
'      Minor Version
'      Build Number
'      Revision
'
' You can specify all the values or you can default the Revision and Build Numbers
' by using the '*' as shown below:

<Assembly: AssemblyVersion("6.2.1.0")>

'
' In order to sign your assembly you must specify a key to use. Refer to the
' Microsoft .NET Framework documentation for more information on assembly signing.
'
' Use the attributes below to control which key is used for signing.
'
' Notes:
'   (*) If no key is specified, the assembly is not signed.
'   (*) KeyName refers to a key that has been installed in the Crypto Service
'       Provider (CSP) on your machine. KeyFile refers to a file which contains
'       a key.
'   (*) If the KeyFile and the KeyName values are both specified, the
'       following processing occurs:
'       (1) If the KeyName can be found in the CSP, that key is used.
'       (2) If the KeyName does not exist and the KeyFile does exist, the key
'           in the KeyFile is installed into the CSP and used.
'   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
'       When specifying the KeyFile, the location of the KeyFile should be
'       relative to the project output directory which is
'       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
'       located in the project directory, you would specify the AssemblyKeyFile
'       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
'   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
'       documentation for more information on this.
'
<Assembly: AssemblyDelaySign(False)>
<Assembly: AssemblyKeyFile("")>
<Assembly: AssemblyKeyName("")>

MainForm.Designer.vb

Imports System.Collections
Imports System.ComponentModel
Imports System.IO
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Namespace FlexCelImageExplorer
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Private openFileDialog1 As System.Windows.Forms.OpenFileDialog
        Private panel1 As System.Windows.Forms.Panel
        Private splitter1 As System.Windows.Forms.Splitter
        Private panel3 As System.Windows.Forms.Panel
        Private WithEvents FilesListBox As System.Windows.Forms.ListBox
        Private lblFolder As System.Windows.Forms.Label
        Private dataGrid As System.Windows.Forms.DataGrid
        Private dataSet1 As System.Data.DataSet
        Private ImageDataTable As System.Data.DataTable
        Private Index As System.Data.DataColumn
        Private Cell1 As System.Data.DataColumn
        Private Cell2 As System.Data.DataColumn
        Private [cType] As System.Data.DataColumn
        Private cText As System.Data.DataColumn
        Private Description As System.Data.DataColumn
        Private dataColumn1 As System.Data.DataColumn
        Private panel4 As System.Windows.Forms.Panel
        Private splitter2 As System.Windows.Forms.Splitter
        Private dataColumn2 As System.Data.DataColumn
        Private PreviewBox As System.Windows.Forms.PictureBox
        Private dataColumn3 As System.Data.DataColumn
        Private saveImageDialog As System.Windows.Forms.SaveFileDialog
        Private dataColumn4 As System.Data.DataColumn
        Private components As System.ComponentModel.IContainer = Nothing

        ''' <summary>
        ''' Clean up any resources being used.
        ''' </summary>
        Protected Overrides Sub Dispose(ByVal disposing As Boolean)
            If disposing Then
                If components IsNot Nothing Then
                    components.Dispose()
                End If
            End If
            MyBase.Dispose(disposing)
        End Sub

        #Region "Windows Form Designer generated code"
        ''' <summary>
        ''' Required method for Designer support - do not modify
        ''' the contents of this method with the code editor.
        ''' </summary>
        Private Sub InitializeComponent()
            Dim resources As New System.ComponentModel.ComponentResourceManager(GetType(mainForm))
            Me.openFileDialog1 = New System.Windows.Forms.OpenFileDialog()
            Me.panel1 = New System.Windows.Forms.Panel()
            Me.FilesListBox = New System.Windows.Forms.ListBox()
            Me.panel3 = New System.Windows.Forms.Panel()
            Me.lblFolder = New System.Windows.Forms.Label()
            Me.splitter1 = New System.Windows.Forms.Splitter()
            Me.dataGrid = New System.Windows.Forms.DataGrid()
            Me.ImageDataTable = New System.Data.DataTable()
            Me.dataColumn4 = New System.Data.DataColumn()
            Me.Index = New System.Data.DataColumn()
            Me.Cell1 = New System.Data.DataColumn()
            Me.Cell2 = New System.Data.DataColumn()
            Me.cType = New System.Data.DataColumn()
            Me.cText = New System.Data.DataColumn()
            Me.Description = New System.Data.DataColumn()
            Me.dataColumn1 = New System.Data.DataColumn()
            Me.dataColumn2 = New System.Data.DataColumn()
            Me.dataColumn3 = New System.Data.DataColumn()
            Me.dataSet1 = New System.Data.DataSet()
            Me.panel4 = New System.Windows.Forms.Panel()
            Me.PreviewBox = New System.Windows.Forms.PictureBox()
            Me.splitter2 = New System.Windows.Forms.Splitter()
            Me.saveImageDialog = New System.Windows.Forms.SaveFileDialog()
            Me.mainToolbar = New System.Windows.Forms.ToolStrip()
            Me.cbScanFolder = New System.Windows.Forms.ToolStripButton()
            Me.btnOpenFile = New System.Windows.Forms.ToolStripButton()
            Me.toolStripSeparator1 = New System.Windows.Forms.ToolStripSeparator()
            Me.btnShowInExcel = New System.Windows.Forms.ToolStripButton()
            Me.btnSaveAsImage = New System.Windows.Forms.ToolStripButton()
            Me.btnExit = New System.Windows.Forms.ToolStripButton()
            Me.btnInfo = New System.Windows.Forms.ToolStripButton()
            Me.toolStripSeparator2 = New System.Windows.Forms.ToolStripSeparator()
            Me.btnStretchPreview = New System.Windows.Forms.ToolStripButton()
            Me.panel1.SuspendLayout()
            Me.panel3.SuspendLayout()
            CType(Me.dataGrid, System.ComponentModel.ISupportInitialize).BeginInit()
            CType(Me.ImageDataTable, System.ComponentModel.ISupportInitialize).BeginInit()
            CType(Me.dataSet1, System.ComponentModel.ISupportInitialize).BeginInit()
            Me.panel4.SuspendLayout()
            CType(Me.PreviewBox, System.ComponentModel.ISupportInitialize).BeginInit()
            Me.mainToolbar.SuspendLayout()
            Me.SuspendLayout()
            '
            ' openFileDialog1
            '
            Me.openFileDialog1.DefaultExt = "xls"
            Me.openFileDialog1.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm|Excel 97/2003|*.xls|Excel 2007|*.xlsx;*.xlsm|All " & "files|*.*"
            Me.openFileDialog1.Title = "Open an Excel File"
            '
            ' panel1
            '
            Me.panel1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D
            Me.panel1.Controls.Add(Me.FilesListBox)
            Me.panel1.Controls.Add(Me.panel3)
            Me.panel1.Dock = System.Windows.Forms.DockStyle.Left
            Me.panel1.Location = New System.Drawing.Point(0, 38)
            Me.panel1.Name = "panel1"
            Me.panel1.Size = New System.Drawing.Size(176, 400)
            Me.panel1.TabIndex = 4
            '
            ' FilesListBox
            '
            Me.FilesListBox.Dock = System.Windows.Forms.DockStyle.Fill
            Me.FilesListBox.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed
            Me.FilesListBox.Location = New System.Drawing.Point(0, 40)
            Me.FilesListBox.Name = "FilesListBox"
            Me.FilesListBox.Size = New System.Drawing.Size(172, 356)
            Me.FilesListBox.TabIndex = 1
'           Me.FilesListBox.DrawItem += New System.Windows.Forms.DrawItemEventHandler(Me.FilesListBox_DrawItem)
'           Me.FilesListBox.SelectedIndexChanged += New System.EventHandler(Me.FilesListBox_SelectedIndexChanged)
            '
            ' panel3
            '
            Me.panel3.BackColor = System.Drawing.Color.DarkSeaGreen
            Me.panel3.Controls.Add(Me.lblFolder)
            Me.panel3.Dock = System.Windows.Forms.DockStyle.Top
            Me.panel3.Location = New System.Drawing.Point(0, 0)
            Me.panel3.Name = "panel3"
            Me.panel3.Size = New System.Drawing.Size(172, 40)
            Me.panel3.TabIndex = 0
            '
            ' lblFolder
            '
            Me.lblFolder.Dock = System.Windows.Forms.DockStyle.Fill
            Me.lblFolder.ForeColor = System.Drawing.Color.Black
            Me.lblFolder.Location = New System.Drawing.Point(0, 0)
            Me.lblFolder.Name = "lblFolder"
            Me.lblFolder.Size = New System.Drawing.Size(172, 40)
            Me.lblFolder.TabIndex = 0
            Me.lblFolder.Text = "No Selected Folder."
            '
            ' splitter1
            '
            Me.splitter1.Location = New System.Drawing.Point(176, 38)
            Me.splitter1.Name = "splitter1"
            Me.splitter1.Size = New System.Drawing.Size(3, 400)
            Me.splitter1.TabIndex = 5
            Me.splitter1.TabStop = False
            '
            ' dataGrid
            '
            Me.dataGrid.CaptionText = "No file selected"
            Me.dataGrid.DataMember = ""
            Me.dataGrid.DataSource = Me.ImageDataTable
            Me.dataGrid.Dock = System.Windows.Forms.DockStyle.Top
            Me.dataGrid.HeaderForeColor = System.Drawing.SystemColors.ControlText
            Me.dataGrid.Location = New System.Drawing.Point(179, 38)
            Me.dataGrid.Name = "dataGrid"
            Me.dataGrid.PreferredColumnWidth = 120
            Me.dataGrid.ReadOnly = True
            Me.dataGrid.Size = New System.Drawing.Size(709, 128)
            Me.dataGrid.TabIndex = 7
            '
            ' ImageDataTable
            '
            Me.ImageDataTable.Columns.AddRange(New System.Data.DataColumn() { Me.dataColumn4, Me.Index, Me.Cell1, Me.Cell2, Me.cType, Me.cText, Me.Description, Me.dataColumn1, Me.dataColumn2, Me.dataColumn3})
            Me.ImageDataTable.TableName = "ImageDataTable"
            '
            ' dataColumn4
            '
            Me.dataColumn4.ColumnName = "Sheet"
            '
            ' Index
            '
            Me.Index.ColumnName = "Index"
            '
            ' Cell1
            '
            Me.Cell1.Caption = "Width (Pixels)"
            Me.Cell1.ColumnName = "Width (Pixels)"
            '
            ' Cell2
            '
            Me.Cell2.Caption = "Height (Pixels)"
            Me.Cell2.ColumnName = "Height (Pixels)"
            '
            ' cType
            '
            Me.cType.ColumnName = "Type"
            '
            ' cText
            '
            Me.cText.Caption = "Image Format"
            Me.cText.ColumnName = "Image Format"
            '
            ' Description
            '
            Me.Description.Caption = "Uncompressed size"
            Me.Description.ColumnName = "Uncompressed size"
            '
            ' dataColumn1
            '
            Me.dataColumn1.Caption = "Name"
            Me.dataColumn1.ColumnName = "Name"
            '
            ' dataColumn2
            '
            Me.dataColumn2.ColumnMapping = System.Data.MappingType.Hidden
            Me.dataColumn2.ColumnName = "Image"
            Me.dataColumn2.DataType = GetType(Byte())
            '
            ' dataColumn3
            '
            Me.dataColumn3.ColumnName = "Cropped"
            Me.dataColumn3.DataType = GetType(Boolean)
            '
            ' dataSet1
            '
            Me.dataSet1.DataSetName = "ImageDataSet"
            Me.dataSet1.Locale = New System.Globalization.CultureInfo("")
            Me.dataSet1.Tables.AddRange(New System.Data.DataTable() { Me.ImageDataTable})
            '
            ' panel4
            '
            Me.panel4.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D
            Me.panel4.Controls.Add(Me.PreviewBox)
            Me.panel4.Dock = System.Windows.Forms.DockStyle.Fill
            Me.panel4.Location = New System.Drawing.Point(179, 169)
            Me.panel4.Name = "panel4"
            Me.panel4.Size = New System.Drawing.Size(709, 269)
            Me.panel4.TabIndex = 8
            '
            ' PreviewBox
            '
            Me.PreviewBox.Dock = System.Windows.Forms.DockStyle.Fill
            Me.PreviewBox.Location = New System.Drawing.Point(0, 0)
            Me.PreviewBox.Name = "PreviewBox"
            Me.PreviewBox.Size = New System.Drawing.Size(705, 265)
            Me.PreviewBox.TabIndex = 0
            Me.PreviewBox.TabStop = False
            '
            ' splitter2
            '
            Me.splitter2.Dock = System.Windows.Forms.DockStyle.Top
            Me.splitter2.Location = New System.Drawing.Point(179, 166)
            Me.splitter2.Name = "splitter2"
            Me.splitter2.Size = New System.Drawing.Size(709, 3)
            Me.splitter2.TabIndex = 9
            Me.splitter2.TabStop = False
            '
            ' mainToolbar
            '
            Me.mainToolbar.Items.AddRange(New System.Windows.Forms.ToolStripItem() { Me.cbScanFolder, Me.btnOpenFile, Me.toolStripSeparator1, Me.btnShowInExcel, Me.btnSaveAsImage, Me.btnExit, Me.btnInfo, Me.toolStripSeparator2, Me.btnStretchPreview})
            Me.mainToolbar.Location = New System.Drawing.Point(0, 0)
            Me.mainToolbar.Name = "mainToolbar"
            Me.mainToolbar.Size = New System.Drawing.Size(888, 38)
            Me.mainToolbar.TabIndex = 12
            Me.mainToolbar.Text = "toolStrip1"
            '
            ' cbScanFolder
            '
            Me.cbScanFolder.CheckOnClick = True
            Me.cbScanFolder.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text
            Me.cbScanFolder.Image = (CType(resources.GetObject("cbScanFolder.Image"), System.Drawing.Image))
            Me.cbScanFolder.ImageTransparentColor = System.Drawing.Color.Magenta
            Me.cbScanFolder.Name = "cbScanFolder"
            Me.cbScanFolder.Size = New System.Drawing.Size(122, 35)
            Me.cbScanFolder.Text = "Scan all files in folder"
            Me.cbScanFolder.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText
            '
            ' btnOpenFile
            '
            Me.btnOpenFile.Image = (CType(resources.GetObject("btnOpenFile.Image"), System.Drawing.Image))
            Me.btnOpenFile.ImageTransparentColor = System.Drawing.Color.Magenta
            Me.btnOpenFile.Name = "btnOpenFile"
            Me.btnOpenFile.Size = New System.Drawing.Size(59, 35)
            Me.btnOpenFile.Text = "Open file"
            Me.btnOpenFile.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText
'           Me.btnOpenFile.Click += New System.EventHandler(Me.btnOpenFile_Click)
            '
            ' toolStripSeparator1
            '
            Me.toolStripSeparator1.Name = "toolStripSeparator1"
            Me.toolStripSeparator1.Size = New System.Drawing.Size(6, 38)
            '
            ' btnShowInExcel
            '
            Me.btnShowInExcel.Image = (CType(resources.GetObject("btnShowInExcel.Image"), System.Drawing.Image))
            Me.btnShowInExcel.ImageTransparentColor = System.Drawing.Color.Magenta
            Me.btnShowInExcel.Name = "btnShowInExcel"
            Me.btnShowInExcel.Size = New System.Drawing.Size(82, 35)
            Me.btnShowInExcel.Text = "Show in Excel"
            Me.btnShowInExcel.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText
'           Me.btnShowInExcel.Click += New System.EventHandler(Me.btnOpen_Click)
            '
            ' btnSaveAsImage
            '
            Me.btnSaveAsImage.Image = (CType(resources.GetObject("btnSaveAsImage.Image"), System.Drawing.Image))
            Me.btnSaveAsImage.ImageTransparentColor = System.Drawing.Color.Magenta
            Me.btnSaveAsImage.Name = "btnSaveAsImage"
            Me.btnSaveAsImage.Size = New System.Drawing.Size(85, 35)
            Me.btnSaveAsImage.Text = "Save as image"
            Me.btnSaveAsImage.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText
'           Me.btnSaveAsImage.Click += New System.EventHandler(Me.btnSaveImage_Click)
            '
            ' btnExit
            '
            Me.btnExit.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right
            Me.btnExit.Image = (CType(resources.GetObject("btnExit.Image"), System.Drawing.Image))
            Me.btnExit.ImageTransparentColor = System.Drawing.Color.Magenta
            Me.btnExit.Name = "btnExit"
            Me.btnExit.Size = New System.Drawing.Size(59, 35)
            Me.btnExit.Text = "     E&xit     "
            Me.btnExit.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText
'           Me.btnExit.Click += New System.EventHandler(Me.btnExit_Click)
            '
            ' btnInfo
            '
            Me.btnInfo.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right
            Me.btnInfo.Image = (CType(resources.GetObject("btnInfo.Image"), System.Drawing.Image))
            Me.btnInfo.ImageTransparentColor = System.Drawing.Color.Magenta
            Me.btnInfo.Name = "btnInfo"
            Me.btnInfo.Size = New System.Drawing.Size(74, 35)
            Me.btnInfo.Text = "Information"
            Me.btnInfo.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText
'           Me.btnInfo.Click += New System.EventHandler(Me.btnInfo_Click)
            '
            ' toolStripSeparator2
            '
            Me.toolStripSeparator2.Name = "toolStripSeparator2"
            Me.toolStripSeparator2.Size = New System.Drawing.Size(6, 38)
            '
            ' btnStretchPreview
            '
            Me.btnStretchPreview.CheckOnClick = True
            Me.btnStretchPreview.Image = (CType(resources.GetObject("btnStretchPreview.Image"), System.Drawing.Image))
            Me.btnStretchPreview.ImageTransparentColor = System.Drawing.Color.Magenta
            Me.btnStretchPreview.Name = "btnStretchPreview"
            Me.btnStretchPreview.Size = New System.Drawing.Size(92, 35)
            Me.btnStretchPreview.Text = "Stretch preview"
            Me.btnStretchPreview.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText
'           Me.btnStretchPreview.Click += New System.EventHandler(Me.btnStretchPreview_Click)
            '
            ' mainForm
            '
            Me.AutoScaleDimensions = New System.Drawing.SizeF(6F, 13F)
            Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
            Me.ClientSize = New System.Drawing.Size(888, 438)
            Me.Controls.Add(Me.panel4)
            Me.Controls.Add(Me.splitter2)
            Me.Controls.Add(Me.dataGrid)
            Me.Controls.Add(Me.splitter1)
            Me.Controls.Add(Me.panel1)
            Me.Controls.Add(Me.mainToolbar)
            Me.Name = "mainForm"
            Me.Text = "FlexCel Image Explorer"
            Me.WindowState = System.Windows.Forms.FormWindowState.Maximized
            Me.panel1.ResumeLayout(False)
            Me.panel3.ResumeLayout(False)
            CType(Me.dataGrid, System.ComponentModel.ISupportInitialize).EndInit()
            CType(Me.ImageDataTable, System.ComponentModel.ISupportInitialize).EndInit()
            CType(Me.dataSet1, System.ComponentModel.ISupportInitialize).EndInit()
            Me.panel4.ResumeLayout(False)
            CType(Me.PreviewBox, System.ComponentModel.ISupportInitialize).EndInit()
            Me.mainToolbar.ResumeLayout(False)
            Me.mainToolbar.PerformLayout()
            Me.ResumeLayout(False)
            Me.PerformLayout()

        End Sub
        #End Region

        Private mainToolbar As ToolStrip
        Private WithEvents btnOpenFile As ToolStripButton
        Private toolStripSeparator1 As ToolStripSeparator
        Private WithEvents btnShowInExcel As ToolStripButton
        Private WithEvents btnSaveAsImage As ToolStripButton
        Private WithEvents btnExit As ToolStripButton
        Private WithEvents btnInfo As ToolStripButton
        Private toolStripSeparator2 As ToolStripSeparator
        Private WithEvents btnStretchPreview As ToolStripButton
        Private cbScanFolder As ToolStripButton
    End Class
End Namespace

MainForm.vb

Imports System.Collections
Imports System.ComponentModel
Imports System.IO

Imports FlexCel.Core
Imports FlexCel.XlsAdapter

Namespace FlexCelImageExplorer
    ''' <summary>
    ''' Image Explorer.
    ''' </summary>
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Public Sub New()
            InitializeComponent()
            AddHandler GetCurrencyManager.CurrentChanged, AddressOf CurrentRowChanged
            ResizeToolbar(mainToolbar)
        End Sub

        Private Sub ResizeToolbar(ByVal toolbar As ToolStrip)

            Using gr As Graphics = CreateGraphics()
                Dim xFactor As Double = gr.DpiX / 96.0
                Dim yFactor As Double = gr.DpiY / 96.0
                toolbar.ImageScalingSize = New Size(CInt(Fix(24 * xFactor)), CInt(Fix(24 * yFactor)))
                toolbar.Width = 0 'force a recalc of the buttons.
            End Using
        End Sub

        Private CurrentFilename As String = Nothing
        Private CompressForm As TCompressForm

        Private ReadOnly Property GetCurrencyManager() As CurrencyManager
            Get
                Return CType(Me.BindingContext(dataGrid.DataSource, dataGrid.DataMember), CurrencyManager)
            End Get
        End Property

        Private ReadOnly Property GetImagePos() As Integer
            Get
                Return GetCurrencyManager.Position
            End Get
        End Property

        Private Sub btnExit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnExit.Click
            Close()
        End Sub

        Private Sub btnOpenFile_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnOpenFile.Click
            If openFileDialog1.ShowDialog() <> System.Windows.Forms.DialogResult.OK Then
                Return
            End If
            OpenFile(openFileDialog1.FileName)
            If cbScanFolder.Checked Then
                FillListBox()
            End If
        End Sub

        Private Function GetHasCrop(ByVal ImgProps As TImageProperties) As Boolean
            Return ImgProps.CropArea.CropFromLeft <> 0 OrElse ImgProps.CropArea.CropFromRight <> 0 OrElse ImgProps.CropArea.CropFromTop <> 0 OrElse ImgProps.CropArea.CropFromBottom <> 0
        End Function

        Private Sub FillListBox()
            lblFolder.Text = "Files on folder: " & Path.GetDirectoryName(openFileDialog1.FileName)
            Dim di As New DirectoryInfo(Path.GetDirectoryName(openFileDialog1.FileName))
            Dim Fi() As FileInfo = di.GetFiles("*.xls")
            FilesListBox.Items.Clear()

            Dim Files(Fi.Length - 1) As TImageInfo

            For k As Integer = 0 To Fi.Length - 1
                Dim f As FileInfo = Fi(k)
                Dim HasCrop As Boolean = False
                Dim HasARGB As Boolean = False
                Dim x1 As New XlsFile()

                Dim HasImages As Boolean = False

                Try
                    x1.Open(f.FullName)
                    For sheet As Integer = 1 To x1.SheetCount
                        x1.ActiveSheet = sheet
                        For i As Integer = x1.ImageCount To 1 Step -1
                            HasImages = True
                            Dim ip As TImageProperties = x1.GetImageProperties(i)
                            If Not HasCrop Then
                                HasCrop = GetHasCrop(ip)
                            End If

                            Dim imgType As TXlsImgType = TXlsImgType.Unknown
                            Using ms As New MemoryStream()
                                x1.GetImage(i, imgType, ms)
                                Dim PngInfo As FlexCel.Pdf.TPngInformation = FlexCel.Pdf.TPdfPng.GetPngInfo(ms)
                                If PngInfo IsNot Nothing Then
                                    HasARGB = PngInfo.ColorType = 6
                                End If
                            End Using

                        Next i
                    Next sheet
                Catch e1 As Exception
                    Files(k) = New TImageInfo(f, False, False, False, False)
                    Continue For
                End Try

                Files(k) = New TImageInfo(f, True, HasCrop, HasImages, HasARGB)
            Next k

            FilesListBox.Items.AddRange(Files)
        End Sub

        Private Sub OpenFile(ByVal FileName As String)
            ImageDataTable.Rows.Clear()

            Try
                Dim Xls As New XlsFile(True)
                CurrentFilename = FileName
                Xls.Open(FileName)

                For sheet As Integer = 1 To Xls.SheetCount
                    Xls.ActiveSheet = sheet
                    For i As Integer = Xls.ImageCount To 1 Step -1
                        Dim ImageType As TXlsImgType = TXlsImgType.Unknown
                        Dim ImgBytes() As Byte = Xls.GetImage(i, ImageType)
                        Dim ImgProps As TImageProperties = Xls.GetImageProperties(i)
                        Dim ImgData(ImageDataTable.Columns.Count - 1) As Object
                        ImgData(0) = Xls.SheetName
                        ImgData(1) = i
                        ImgData(4) = ImageType.ToString()
                        ImgData(7) = Xls.GetImageName(i)
                        ImgData(8) = ImgBytes
                        ImgData(9) = GetHasCrop(ImgProps)

                        Using ms As New MemoryStream(ImgBytes)
                            Dim PngInfo As FlexCel.Pdf.TPngInformation = FlexCel.Pdf.TPdfPng.GetPngInfo(ms)
                            If PngInfo IsNot Nothing Then
                                ImgData(2) = PngInfo.Width
                                ImgData(3) = PngInfo.Height
                                Dim s As String = String.Empty
                                Dim bpp As Integer = 0

                                If (PngInfo.ColorType And 4) <> 0 Then
                                    s &= "ALPHA-"
                                    bpp = 1
                                End If
                                If (PngInfo.ColorType And 2) = 0 Then
                                    s &= "Grayscale -" & (1 << PngInfo.BitDepth).ToString() & " shades. "
                                    bpp = 1
                                Else
                                    If (PngInfo.ColorType And 1) = 0 Then
                                        bpp += 3
                                        s &= "RGB - " & (PngInfo.BitDepth * (bpp)).ToString() & "bpp.  "
                                    Else
                                        s &= "Indexed - " & (1 << PngInfo.BitDepth).ToString() & " colors. "
                                        bpp = 1
                                    End If
                                End If

                                ImgData(5) = s

                                ImgData(6) = (Math.Round(PngInfo.Width * PngInfo.Height * PngInfo.BitDepth * bpp / 8F / 1024F)).ToString() & " kb."
                            Else
                                ms.Position = 0
                                Try
                                    Using Img As Image = Image.FromStream(ms)
                                        Dim Bmp As Bitmap = TryCast(Img, Bitmap)
                                        If Bmp IsNot Nothing Then
                                            ImgData(5) = Bmp.PixelFormat.ToString() & "bpp"
                                        End If
                                        ImgData(2) = Img.Width
                                        ImgData(3) = Img.Height
                                    End Using
                                Catch e1 As Exception
                                    ImgData(2) = -1
                                    ImgData(3) = -1
                                    ImgData(5) = Nothing
                                    ImgData(8) = Nothing

                                End Try
                            End If
                        End Using

                        ImageDataTable.Rows.Add(ImgData)
                    Next i
                Next sheet

            Catch ex As Exception
                MessageBox.Show(ex.Message, "Error")
                dataGrid.CaptionText = "No file selected"
                CurrentFilename = Nothing
                Return
            End Try
            dataGrid.CaptionText = "Selected file: " & FileName
            CurrentRowChanged(GetCurrencyManager, Nothing)
        End Sub

        Private Sub FilesListBox_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles FilesListBox.SelectedIndexChanged
            Dim ImageInfo As TImageInfo = CType(FilesListBox.SelectedItem, TImageInfo)
            If ImageInfo Is Nothing Then
                Return
            End If
            OpenFile(ImageInfo.File.FullName)
        End Sub

        Public Sub CurrentRowChanged(ByVal sender As Object, ByVal e As System.EventArgs)
            Dim Pos As Integer = CType(sender, BindingManagerBase).Position
            If Pos < 0 Then
                PreviewBox.Image = Nothing
                Return
            End If

            Dim r As DataRowCollection = dataSet1.Tables("ImageDataTable").Rows
            If Pos < 0 OrElse Pos >= r.Count Then
                PreviewBox.Image = Nothing
            Else
                Dim ImgData() As Byte = TryCast(r(Pos).ItemArray(8), Byte())
                If ImgData Is Nothing Then
                    PreviewBox.Image = Nothing
                Else
                    Using ms As New MemoryStream(ImgData)
                        PreviewBox.Image = Image.FromStream(ms)
                    End Using
                End If
            End If
        End Sub

        Private Sub btnOpen_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnShowInExcel.Click
            If CurrentFilename Is Nothing Then
                MessageBox.Show("There is no open file")
                Return
            End If
            System.Diagnostics.Process.Start(CurrentFilename)
        End Sub

        Private Sub btnConvert_Click(ByVal sender As Object, ByVal e As System.EventArgs)
            'This is not yet implemented...
            Dim Pos As Integer = GetImagePos
            If Pos < 0 Then
                MessageBox.Show("There is no selected image", "Error")
                Return
            End If
            If CompressForm Is Nothing Then
                CompressForm = New TCompressForm()
            End If
            CompressForm.ImageToUse = CType(dataSet1.Tables("ImageDataTable").Rows(Pos).ItemArray(8), Byte())
            CompressForm.XlsFilename = CurrentFilename
            CompressForm.ShowDialog()
        End Sub

        Private Sub FilesListBox_DrawItem(ByVal sender As Object, ByVal e As System.Windows.Forms.DrawItemEventArgs) Handles FilesListBox.DrawItem
            If e.Index < 0 Then
                Return
            End If
            e.DrawBackground()
            Dim myBrush As Brush = Brushes.Black

            Dim ImageInfo As TImageInfo = CType(CType(sender, ListBox).Items(e.Index), TImageInfo)
            If Not ImageInfo.HasImages Then
                myBrush = Brushes.Silver
            End If
            If ImageInfo.HasCrop Then
                myBrush = Brushes.Red
            End If

            Dim NewStyle As FontStyle
            If ImageInfo.HasARGB Then
                NewStyle = FontStyle.Bold
            Else
                NewStyle = FontStyle.Regular
            End If
            Using MyFont As New Font(e.Font, NewStyle)
                e.Graphics.DrawString(ImageInfo.ToString(), MyFont, myBrush, e.Bounds, StringFormat.GenericDefault)
            End Using
            e.DrawFocusRectangle()
        End Sub

        Private Sub btnSaveImage_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSaveAsImage.Click
            Dim Pos As Integer = GetImagePos
            If Pos < 0 Then
                MessageBox.Show("There is no selected image to save", "Error")
                Return
            End If

            Dim ext As String = dataSet1.Tables("ImageDataTable").Rows(Pos).ItemArray(4).ToString().ToLower()
            saveImageDialog.DefaultExt = ext
            saveImageDialog.Filter = ext & " Images|*." & ext
            If saveImageDialog.ShowDialog() <> System.Windows.Forms.DialogResult.OK Then
                Return
            End If
            Dim ImgData() As Byte = CType(dataSet1.Tables("ImageDataTable").Rows(Pos).ItemArray(8), Byte())
            Using fs As New FileStream(saveImageDialog.FileName, FileMode.Create)
                fs.Write(ImgData, 0, ImgData.Length)
            End Using

        End Sub

        Private Sub btnInfo_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnInfo.Click
            MessageBox.Show("FlexCelImageExplorer is a small application targeted to reduce the size on images inside Excel files." & vbLf & "On the current version you can see the image properties and extract the images to disk.")

        End Sub

        Private Sub btnStretchPreview_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnStretchPreview.Click
            If btnStretchPreview.Checked Then
                PreviewBox.SizeMode = PictureBoxSizeMode.StretchImage
            Else
                PreviewBox.SizeMode = PictureBoxSizeMode.Normal
            End If
        End Sub

    End Class

    Friend Class TImageInfo
        Friend File As FileInfo
        Friend IsValidFile As Boolean
        Friend HasCrop As Boolean
        Friend HasImages As Boolean
        Friend HasARGB As Boolean

        Public Sub New(ByVal aFile As FileInfo, ByVal aIsValidFile As Boolean, ByVal aHasCrop As Boolean, ByVal aHasImages As Boolean, ByVal aHasARGB As Boolean)
            File = aFile
            HasCrop = aHasCrop
            HasImages = aHasImages
            IsValidFile = aIsValidFile
            HasARGB = aHasARGB
        End Sub

        Public Overrides Function ToString() As String
            If Not IsValidFile Then
                Return " (*)" & File.ToString()
            End If
            Return File.ToString()
        End Function

    End Class
End Namespace

Program.vb

Namespace FlexCelImageExplorer
    Friend NotInheritable Class Program

        Private Sub New()
        End Sub

        ''' <summary>
        ''' The main entry point for the application.
        ''' </summary>
       <STAThread> _
        Shared Sub Main()
            Application.EnableVisualStyles()
            Application.SetCompatibleTextRenderingDefault(False)
            Application.Run(New mainForm())
        End Sub
    End Class
End Namespace

TCompressForm.Designer.vb

Imports System.Collections
Imports System.ComponentModel
Imports System.IO
Namespace FlexCelImageExplorer
    Partial Public Class TCompressForm
        Inherits System.Windows.Forms.Form

        Private label1 As System.Windows.Forms.Label
        Private edPercent As System.Windows.Forms.NumericUpDown
        Private cbPixelFormat As System.Windows.Forms.ComboBox
        Private WithEvents btnOk As System.Windows.Forms.Button
        Private WithEvents btnCancel As System.Windows.Forms.Button
        Private panel1 As System.Windows.Forms.Panel
        Private panel2 As System.Windows.Forms.Panel
        Private pictureBox1 As System.Windows.Forms.PictureBox
        Private cbTransparent As System.Windows.Forms.CheckBox
        ''' <summary>
        ''' Required designer variable.
        ''' </summary>
        Private components As System.ComponentModel.Container = Nothing

        ''' <summary>
        ''' Clean up any resources being used.
        ''' </summary>
        Protected Overrides Sub Dispose(ByVal disposing As Boolean)
            If disposing Then
                If components IsNot Nothing Then
                    components.Dispose()
                End If
            End If
            MyBase.Dispose(disposing)
        End Sub

        #Region "Windows Form Designer generated code"
        ''' <summary>
        ''' Required method for Designer support - do not modify
        ''' the contents of this method with the code editor.
        ''' </summary>
        Private Sub InitializeComponent()
            Me.label1 = New System.Windows.Forms.Label()
            Me.edPercent = New System.Windows.Forms.NumericUpDown()
            Me.cbPixelFormat = New System.Windows.Forms.ComboBox()
            Me.btnOk = New System.Windows.Forms.Button()
            Me.btnCancel = New System.Windows.Forms.Button()
            Me.panel1 = New System.Windows.Forms.Panel()
            Me.panel2 = New System.Windows.Forms.Panel()
            Me.pictureBox1 = New System.Windows.Forms.PictureBox()
            Me.cbTransparent = New System.Windows.Forms.CheckBox()
            CType(Me.edPercent, System.ComponentModel.ISupportInitialize).BeginInit()
            Me.panel1.SuspendLayout()
            Me.panel2.SuspendLayout()
            Me.SuspendLayout()
            '
            ' label1
            '
            Me.label1.Location = New System.Drawing.Point(16, 8)
            Me.label1.Name = "label1"
            Me.label1.Size = New System.Drawing.Size(144, 16)
            Me.label1.TabIndex = 0
            Me.label1.Text = "Change Resolution (%):"
            '
            ' edPercent
            '
            Me.edPercent.Increment = New System.Decimal(New Integer() { 5, 0, 0, 0})
            Me.edPercent.Location = New System.Drawing.Point(176, 8)
            Me.edPercent.Minimum = New System.Decimal(New Integer() { 10, 0, 0, 0})
            Me.edPercent.Name = "edPercent"
            Me.edPercent.Size = New System.Drawing.Size(48, 20)
            Me.edPercent.TabIndex = 2
            Me.edPercent.Value = New System.Decimal(New Integer() { 60, 0, 0, 0})
            '
            ' cbPixelFormat
            '
            Me.cbPixelFormat.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
            Me.cbPixelFormat.Items.AddRange(New Object() { "1bpp (Black and White)", "8bpp (256 colors optimized palette)", "24bpp (true color)"})
            Me.cbPixelFormat.Location = New System.Drawing.Point(16, 40)
            Me.cbPixelFormat.Name = "cbPixelFormat"
            Me.cbPixelFormat.Size = New System.Drawing.Size(208, 21)
            Me.cbPixelFormat.TabIndex = 3
            '
            ' btnOk
            '
            Me.btnOk.Anchor = System.Windows.Forms.AnchorStyles.Bottom
            Me.btnOk.FlatStyle = System.Windows.Forms.FlatStyle.System
            Me.btnOk.Location = New System.Drawing.Point(148, 168)
            Me.btnOk.Name = "btnOk"
            Me.btnOk.TabIndex = 4
            Me.btnOk.Text = "Ok"
'           Me.btnOk.Click += New System.EventHandler(Me.btnOk_Click)
            '
            ' btnCancel
            '
            Me.btnCancel.Anchor = System.Windows.Forms.AnchorStyles.Bottom
            Me.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel
            Me.btnCancel.FlatStyle = System.Windows.Forms.FlatStyle.System
            Me.btnCancel.Location = New System.Drawing.Point(244, 168)
            Me.btnCancel.Name = "btnCancel"
            Me.btnCancel.TabIndex = 5
            Me.btnCancel.Text = "Cancel"
'           Me.btnCancel.Click += New System.EventHandler(Me.btnCancel_Click)
            '
            ' panel1
            '
            Me.panel1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D
            Me.panel1.Controls.Add(Me.cbTransparent)
            Me.panel1.Controls.Add(Me.edPercent)
            Me.panel1.Controls.Add(Me.cbPixelFormat)
            Me.panel1.Controls.Add(Me.label1)
            Me.panel1.Location = New System.Drawing.Point(16, 16)
            Me.panel1.Name = "panel1"
            Me.panel1.Size = New System.Drawing.Size(240, 136)
            Me.panel1.TabIndex = 6
            '
            ' panel2
            '
            Me.panel2.Anchor = (CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) Or System.Windows.Forms.AnchorStyles.Left) Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.panel2.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D
            Me.panel2.Controls.Add(Me.pictureBox1)
            Me.panel2.Location = New System.Drawing.Point(280, 16)
            Me.panel2.Name = "panel2"
            Me.panel2.Size = New System.Drawing.Size(168, 136)
            Me.panel2.TabIndex = 7
            '
            ' pictureBox1
            '
            Me.pictureBox1.Dock = System.Windows.Forms.DockStyle.Fill
            Me.pictureBox1.Location = New System.Drawing.Point(0, 0)
            Me.pictureBox1.Name = "pictureBox1"
            Me.pictureBox1.Size = New System.Drawing.Size(164, 132)
            Me.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage
            Me.pictureBox1.TabIndex = 0
            Me.pictureBox1.TabStop = False
            '
            ' cbTransparent
            '
            Me.cbTransparent.Location = New System.Drawing.Point(16, 88)
            Me.cbTransparent.Name = "cbTransparent"
            Me.cbTransparent.TabIndex = 4
            Me.cbTransparent.Text = "Transparent"
            '
            ' TCompressForm
            '
            Me.AcceptButton = Me.btnOk
            Me.CancelButton = Me.btnCancel
            Me.AutoScaleDimensions = New System.Drawing.SizeF(6F, 13F)
            Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
            Me.ClientSize = New System.Drawing.Size(472, 214)
            Me.Controls.Add(Me.panel2)
            Me.Controls.Add(Me.panel1)
            Me.Controls.Add(Me.btnCancel)
            Me.Controls.Add(Me.btnOk)
            Me.Name = "TCompressForm"
            Me.Text = "Compression Options..."
'           Me.Load += New System.EventHandler(Me.TCompressForm_Load)
            CType(Me.edPercent, System.ComponentModel.ISupportInitialize).EndInit()
            Me.panel1.ResumeLayout(False)
            Me.panel2.ResumeLayout(False)
            Me.ResumeLayout(False)

        End Sub
        #End Region
    End Class
End Namespace

TCompressForm.vb

Imports System.Collections
Imports System.ComponentModel
Imports System.IO

Namespace FlexCelImageExplorer
    ''' <summary>
    ''' Summary description for TCompressForm.
    ''' </summary>
    Partial Public Class TCompressForm
        Inherits System.Windows.Forms.Form

        Public Sub New()
            '
            ' Required for Windows Form Designer support
            '
            InitializeComponent()
            cbPixelFormat.SelectedIndex = 2

            '
            ' TODO: Add any constructor code after InitializeComponent call
            '
        End Sub

        Private FImageToUse() As Byte
        Private FXlsFilename As String

        Friend Property ImageToUse() As Byte()
            Get
                Return FImageToUse
            End Get
            Set(ByVal value As Byte())
                FImageToUse = value
                Using ms As New MemoryStream(value)
                    pictureBox1.Image = Image.FromStream(ms)
                End Using
            End Set
        End Property

        Friend Property XlsFilename() As String
            Get
                Return FXlsFilename
            End Get
            Set(ByVal value As String)
                FXlsFilename = value
            End Set
        End Property

        Private Sub btnCancel_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnCancel.Click
            Close()
        End Sub

        Private Sub TCompressForm_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
        End Sub

        Private Sub btnOk_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnOk.Click
            Close()
        End Sub
    End Class
End Namespace


Flexcel object explorer (VB.Net / netframework) | FlexCel Studio for the .NET Framework documentation

Flexcel object explorer (VB.Net / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\vb\VS2022\netframework\10.API\35.Object Explorer and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​vb/​VS2022/​netframework/​Modules/​10.​API/​35.​Object Explorer

Overview

Shapes in an Excel file can be nested in complex ways. For example, you might have a "Group" shape that inside has a "Picture" shape and other "Group" shape with other pictures inside. You can access the whole hierarchy of objects with ExcelFile.GetObjectProperties but it can be hard to visualize. This application shows a tree view of all the objects in a sheet, and can be useful when trying to understand the structure of the objects in an xls file.

Concepts

  • How to use the API to read the objects and properties in a file.

  • How to use ExcelFile.RenderObject to visually render the object (as shown in the preview pane). Internally, RenderObject uses ExcelFile.GetObjectProperties in the same way as this application, and draws the properties into a .NET image.

  • Custom properties (The ones shown in the grid at the top) can hold integers, booleans, strings or other datatypes. You need to know of which type is the property you are trying to read. Since FlexCel does not know it, it will try to show it as a string or as an integer.

Files

AssemblyInfo.vb

Imports System.Reflection
Imports System.Runtime.CompilerServices

'
' General Information about an assembly is controlled through the following
' set of attributes. Change these attribute values to modify the information
' associated with an assembly.
'
<Assembly: AssemblyTitle("")>
<Assembly: AssemblyDescription("")>
<Assembly: AssemblyConfiguration("")>
<Assembly: AssemblyCompany("")>
<Assembly: AssemblyProduct("")>
<Assembly: AssemblyCopyright("(c) 2002 - 2014 TMS Software")>
<Assembly: AssemblyTrademark("")>
<Assembly: AssemblyCulture("")>

'
' Version information for an assembly consists of the following four values:
'
'      Major Version
'      Minor Version
'      Build Number
'      Revision
'
' You can specify all the values or you can default the Revision and Build Numbers
' by using the '*' as shown below:

<Assembly: AssemblyVersion("6.2.1.0")>

'
' In order to sign your assembly you must specify a key to use. Refer to the
' Microsoft .NET Framework documentation for more information on assembly signing.
'
' Use the attributes below to control which key is used for signing.
'
' Notes:
'   (*) If no key is specified, the assembly is not signed.
'   (*) KeyName refers to a key that has been installed in the Crypto Service
'       Provider (CSP) on your machine. KeyFile refers to a file which contains
'       a key.
'   (*) If the KeyFile and the KeyName values are both specified, the
'       following processing occurs:
'       (1) If the KeyName can be found in the CSP, that key is used.
'       (2) If the KeyName does not exist and the KeyFile does exist, the key
'           in the KeyFile is installed into the CSP and used.
'   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
'       When specifying the KeyFile, the location of the KeyFile should be
'       relative to the project output directory which is
'       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
'       located in the project directory, you would specify the AssemblyKeyFile
'       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
'   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
'       documentation for more information on this.
'
<Assembly: AssemblyDelaySign(False)>
<Assembly: AssemblyKeyFile("")>
<Assembly: AssemblyKeyName("")>

MainForm.Designer.vb

Imports System.Collections
Imports System.ComponentModel
Imports System.IO
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Namespace ObjectExplorer
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Private openFileDialog1 As System.Windows.Forms.OpenFileDialog
        Private panel1 As System.Windows.Forms.Panel
        Private splitter1 As System.Windows.Forms.Splitter
        Private panel3 As System.Windows.Forms.Panel
        Private dataGrid As System.Windows.Forms.DataGrid
        Private panel4 As System.Windows.Forms.Panel
        Private splitter2 As System.Windows.Forms.Splitter
        Private PreviewBox As System.Windows.Forms.PictureBox
        Private saveImageDialog As System.Windows.Forms.SaveFileDialog
        Private lblObjects As System.Windows.Forms.Label
        Private WithEvents ObjTree As System.Windows.Forms.TreeView
        Private panel5 As System.Windows.Forms.Panel
        Private lblObjName As System.Windows.Forms.Label
        Private lblObjText As System.Windows.Forms.Label
        Private panel6 As System.Windows.Forms.Panel
        Private label1 As System.Windows.Forms.Label
        Private WithEvents cbSheet As System.Windows.Forms.ComboBox
        Private components As System.ComponentModel.IContainer = Nothing

        ''' <summary>
        ''' Clean up any resources being used.
        ''' </summary>
        Protected Overrides Sub Dispose(ByVal disposing As Boolean)
            If disposing Then
                If components IsNot Nothing Then
                    components.Dispose()
                End If
            End If
            MyBase.Dispose(disposing)
        End Sub

        #Region "Windows Form Designer generated code"
        ''' <summary>
        ''' Required method for Designer support - do not modify
        ''' the contents of this method with the code editor.
        ''' </summary>
        Private Sub InitializeComponent()
            Dim resources As New System.ComponentModel.ComponentResourceManager(GetType(mainForm))
            Me.openFileDialog1 = New System.Windows.Forms.OpenFileDialog()
            Me.panel1 = New System.Windows.Forms.Panel()
            Me.ObjTree = New System.Windows.Forms.TreeView()
            Me.panel6 = New System.Windows.Forms.Panel()
            Me.cbSheet = New System.Windows.Forms.ComboBox()
            Me.label1 = New System.Windows.Forms.Label()
            Me.panel3 = New System.Windows.Forms.Panel()
            Me.lblObjects = New System.Windows.Forms.Label()
            Me.splitter1 = New System.Windows.Forms.Splitter()
            Me.dataGrid = New System.Windows.Forms.DataGrid()
            Me.panel4 = New System.Windows.Forms.Panel()
            Me.PreviewBox = New System.Windows.Forms.PictureBox()
            Me.splitter2 = New System.Windows.Forms.Splitter()
            Me.saveImageDialog = New System.Windows.Forms.SaveFileDialog()
            Me.panel5 = New System.Windows.Forms.Panel()
            Me.lblObjText = New System.Windows.Forms.Label()
            Me.lblObjName = New System.Windows.Forms.Label()
            Me.mainToolbar = New System.Windows.Forms.ToolStrip()
            Me.btnOpenFile = New System.Windows.Forms.ToolStripButton()
            Me.toolStripSeparator1 = New System.Windows.Forms.ToolStripSeparator()
            Me.btnShowInExcel = New System.Windows.Forms.ToolStripButton()
            Me.btnSaveAsImage = New System.Windows.Forms.ToolStripButton()
            Me.btnExit = New System.Windows.Forms.ToolStripButton()
            Me.btnInfo = New System.Windows.Forms.ToolStripButton()
            Me.toolStripSeparator2 = New System.Windows.Forms.ToolStripSeparator()
            Me.btnStretchPreview = New System.Windows.Forms.ToolStripButton()
            Me.panel1.SuspendLayout()
            Me.panel6.SuspendLayout()
            Me.panel3.SuspendLayout()
            CType(Me.dataGrid, System.ComponentModel.ISupportInitialize).BeginInit()
            Me.panel4.SuspendLayout()
            CType(Me.PreviewBox, System.ComponentModel.ISupportInitialize).BeginInit()
            Me.panel5.SuspendLayout()
            Me.mainToolbar.SuspendLayout()
            Me.SuspendLayout()
            '
            ' openFileDialog1
            '
            Me.openFileDialog1.DefaultExt = "xls"
            Me.openFileDialog1.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm|Excel 97/2003|*.xls|Excel 2007|*.xlsx;*.xlsm|All " & "files|*.*"
            Me.openFileDialog1.Title = "Open an Excel File"
            '
            ' panel1
            '
            Me.panel1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D
            Me.panel1.Controls.Add(Me.ObjTree)
            Me.panel1.Controls.Add(Me.panel6)
            Me.panel1.Controls.Add(Me.panel3)
            Me.panel1.Dock = System.Windows.Forms.DockStyle.Left
            Me.panel1.Location = New System.Drawing.Point(0, 38)
            Me.panel1.Name = "panel1"
            Me.panel1.Size = New System.Drawing.Size(176, 472)
            Me.panel1.TabIndex = 4
            '
            ' ObjTree
            '
            Me.ObjTree.Dock = System.Windows.Forms.DockStyle.Fill
            Me.ObjTree.HideSelection = False
            Me.ObjTree.Location = New System.Drawing.Point(0, 112)
            Me.ObjTree.Name = "ObjTree"
            Me.ObjTree.Size = New System.Drawing.Size(172, 356)
            Me.ObjTree.TabIndex = 1
'           Me.ObjTree.AfterSelect += New System.Windows.Forms.TreeViewEventHandler(Me.ObjTree_AfterSelect)
            '
            ' panel6
            '
            Me.panel6.BackColor = System.Drawing.Color.DarkSeaGreen
            Me.panel6.Controls.Add(Me.cbSheet)
            Me.panel6.Controls.Add(Me.label1)
            Me.panel6.Dock = System.Windows.Forms.DockStyle.Top
            Me.panel6.Location = New System.Drawing.Point(0, 64)
            Me.panel6.Name = "panel6"
            Me.panel6.Size = New System.Drawing.Size(172, 48)
            Me.panel6.TabIndex = 2
            '
            ' cbSheet
            '
            Me.cbSheet.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
            Me.cbSheet.Location = New System.Drawing.Point(6, 16)
            Me.cbSheet.Name = "cbSheet"
            Me.cbSheet.Size = New System.Drawing.Size(160, 21)
            Me.cbSheet.TabIndex = 33
'           Me.cbSheet.SelectedIndexChanged += New System.EventHandler(Me.cbSheet_SelectedIndexChanged)
            '
            ' label1
            '
            Me.label1.BackColor = System.Drawing.Color.LightGoldenrodYellow
            Me.label1.Dock = System.Windows.Forms.DockStyle.Fill
            Me.label1.ForeColor = System.Drawing.Color.Black
            Me.label1.Location = New System.Drawing.Point(0, 0)
            Me.label1.Name = "label1"
            Me.label1.Size = New System.Drawing.Size(172, 48)
            Me.label1.TabIndex = 1
            Me.label1.Text = "Sheet:"
            '
            ' panel3
            '
            Me.panel3.BackColor = System.Drawing.Color.DarkSeaGreen
            Me.panel3.Controls.Add(Me.lblObjects)
            Me.panel3.Dock = System.Windows.Forms.DockStyle.Top
            Me.panel3.Location = New System.Drawing.Point(0, 0)
            Me.panel3.Name = "panel3"
            Me.panel3.Size = New System.Drawing.Size(172, 64)
            Me.panel3.TabIndex = 0
            '
            ' lblObjects
            '
            Me.lblObjects.BackColor = System.Drawing.Color.LightGoldenrodYellow
            Me.lblObjects.Dock = System.Windows.Forms.DockStyle.Fill
            Me.lblObjects.ForeColor = System.Drawing.Color.Black
            Me.lblObjects.Location = New System.Drawing.Point(0, 0)
            Me.lblObjects.Name = "lblObjects"
            Me.lblObjects.Size = New System.Drawing.Size(172, 64)
            Me.lblObjects.TabIndex = 1
            Me.lblObjects.Text = "File:"
            '
            ' splitter1
            '
            Me.splitter1.Location = New System.Drawing.Point(176, 91)
            Me.splitter1.Name = "splitter1"
            Me.splitter1.Size = New System.Drawing.Size(3, 419)
            Me.splitter1.TabIndex = 5
            Me.splitter1.TabStop = False
            '
            ' dataGrid
            '
            Me.dataGrid.CaptionText = "Object Properties"
            Me.dataGrid.DataMember = ""
            Me.dataGrid.Dock = System.Windows.Forms.DockStyle.Top
            Me.dataGrid.HeaderForeColor = System.Drawing.SystemColors.ControlText
            Me.dataGrid.Location = New System.Drawing.Point(179, 91)
            Me.dataGrid.Name = "dataGrid"
            Me.dataGrid.PreferredColumnWidth = 120
            Me.dataGrid.ReadOnly = True
            Me.dataGrid.Size = New System.Drawing.Size(557, 213)
            Me.dataGrid.TabIndex = 7
            '
            ' panel4
            '
            Me.panel4.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D
            Me.panel4.Controls.Add(Me.PreviewBox)
            Me.panel4.Dock = System.Windows.Forms.DockStyle.Fill
            Me.panel4.Location = New System.Drawing.Point(179, 307)
            Me.panel4.Name = "panel4"
            Me.panel4.Size = New System.Drawing.Size(557, 203)
            Me.panel4.TabIndex = 8
            '
            ' PreviewBox
            '
            Me.PreviewBox.Dock = System.Windows.Forms.DockStyle.Fill
            Me.PreviewBox.Location = New System.Drawing.Point(0, 0)
            Me.PreviewBox.Name = "PreviewBox"
            Me.PreviewBox.Size = New System.Drawing.Size(553, 199)
            Me.PreviewBox.TabIndex = 0
            Me.PreviewBox.TabStop = False
            '
            ' splitter2
            '
            Me.splitter2.Dock = System.Windows.Forms.DockStyle.Top
            Me.splitter2.Location = New System.Drawing.Point(179, 304)
            Me.splitter2.Name = "splitter2"
            Me.splitter2.Size = New System.Drawing.Size(557, 3)
            Me.splitter2.TabIndex = 9
            Me.splitter2.TabStop = False
            '
            ' saveImageDialog
            '
            Me.saveImageDialog.DefaultExt = "png"
            Me.saveImageDialog.Filter = "PNG Files|*.png"
            '
            ' panel5
            '
            Me.panel5.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
            Me.panel5.Controls.Add(Me.lblObjText)
            Me.panel5.Controls.Add(Me.lblObjName)
            Me.panel5.Dock = System.Windows.Forms.DockStyle.Top
            Me.panel5.Location = New System.Drawing.Point(176, 38)
            Me.panel5.Name = "panel5"
            Me.panel5.Size = New System.Drawing.Size(560, 53)
            Me.panel5.TabIndex = 10
            '
            ' lblObjText
            '
            Me.lblObjText.AutoSize = True
            Me.lblObjText.Location = New System.Drawing.Point(16, 32)
            Me.lblObjText.Name = "lblObjText"
            Me.lblObjText.Size = New System.Drawing.Size(31, 13)
            Me.lblObjText.TabIndex = 1
            Me.lblObjText.Text = "Text:"
            '
            ' lblObjName
            '
            Me.lblObjName.AutoSize = True
            Me.lblObjName.Location = New System.Drawing.Point(16, 8)
            Me.lblObjName.Name = "lblObjName"
            Me.lblObjName.Size = New System.Drawing.Size(38, 13)
            Me.lblObjName.TabIndex = 0
            Me.lblObjName.Text = "Name:"
            '
            ' mainToolbar
            '
            Me.mainToolbar.Items.AddRange(New System.Windows.Forms.ToolStripItem() { Me.btnOpenFile, Me.toolStripSeparator1, Me.btnShowInExcel, Me.btnSaveAsImage, Me.btnExit, Me.btnInfo, Me.toolStripSeparator2, Me.btnStretchPreview})
            Me.mainToolbar.Location = New System.Drawing.Point(0, 0)
            Me.mainToolbar.Name = "mainToolbar"
            Me.mainToolbar.Size = New System.Drawing.Size(736, 38)
            Me.mainToolbar.TabIndex = 11
            Me.mainToolbar.Text = "toolStrip1"
            '
            ' btnOpenFile
            '
            Me.btnOpenFile.Image = (CType(resources.GetObject("btnOpenFile.Image"), System.Drawing.Image))
            Me.btnOpenFile.ImageTransparentColor = System.Drawing.Color.Magenta
            Me.btnOpenFile.Name = "btnOpenFile"
            Me.btnOpenFile.Size = New System.Drawing.Size(59, 35)
            Me.btnOpenFile.Text = "Open file"
            Me.btnOpenFile.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText
'           Me.btnOpenFile.Click += New System.EventHandler(Me.btnOpenFile_Click)
            '
            ' toolStripSeparator1
            '
            Me.toolStripSeparator1.Name = "toolStripSeparator1"
            Me.toolStripSeparator1.Size = New System.Drawing.Size(6, 38)
            '
            ' btnShowInExcel
            '
            Me.btnShowInExcel.Image = (CType(resources.GetObject("btnShowInExcel.Image"), System.Drawing.Image))
            Me.btnShowInExcel.ImageTransparentColor = System.Drawing.Color.Magenta
            Me.btnShowInExcel.Name = "btnShowInExcel"
            Me.btnShowInExcel.Size = New System.Drawing.Size(82, 35)
            Me.btnShowInExcel.Text = "Show in Excel"
            Me.btnShowInExcel.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText
'           Me.btnShowInExcel.Click += New System.EventHandler(Me.btnOpen_Click)
            '
            ' btnSaveAsImage
            '
            Me.btnSaveAsImage.Image = (CType(resources.GetObject("btnSaveAsImage.Image"), System.Drawing.Image))
            Me.btnSaveAsImage.ImageTransparentColor = System.Drawing.Color.Magenta
            Me.btnSaveAsImage.Name = "btnSaveAsImage"
            Me.btnSaveAsImage.Size = New System.Drawing.Size(85, 35)
            Me.btnSaveAsImage.Text = "Save as image"
            Me.btnSaveAsImage.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText
'           Me.btnSaveAsImage.Click += New System.EventHandler(Me.btnSaveImage_Click)
            '
            ' btnExit
            '
            Me.btnExit.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right
            Me.btnExit.Image = (CType(resources.GetObject("btnExit.Image"), System.Drawing.Image))
            Me.btnExit.ImageTransparentColor = System.Drawing.Color.Magenta
            Me.btnExit.Name = "btnExit"
            Me.btnExit.Size = New System.Drawing.Size(59, 35)
            Me.btnExit.Text = "     E&xit     "
            Me.btnExit.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText
'           Me.btnExit.Click += New System.EventHandler(Me.btnExit_Click)
            '
            ' btnInfo
            '
            Me.btnInfo.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right
            Me.btnInfo.Image = (CType(resources.GetObject("btnInfo.Image"), System.Drawing.Image))
            Me.btnInfo.ImageTransparentColor = System.Drawing.Color.Magenta
            Me.btnInfo.Name = "btnInfo"
            Me.btnInfo.Size = New System.Drawing.Size(74, 35)
            Me.btnInfo.Text = "Information"
            Me.btnInfo.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText
'           Me.btnInfo.Click += New System.EventHandler(Me.btnInfo_Click)
            '
            ' toolStripSeparator2
            '
            Me.toolStripSeparator2.Name = "toolStripSeparator2"
            Me.toolStripSeparator2.Size = New System.Drawing.Size(6, 38)
            '
            ' btnStretchPreview
            '
            Me.btnStretchPreview.CheckOnClick = True
            Me.btnStretchPreview.Image = (CType(resources.GetObject("btnStretchPreview.Image"), System.Drawing.Image))
            Me.btnStretchPreview.ImageTransparentColor = System.Drawing.Color.Magenta
            Me.btnStretchPreview.Name = "btnStretchPreview"
            Me.btnStretchPreview.Size = New System.Drawing.Size(92, 35)
            Me.btnStretchPreview.Text = "Stretch preview"
            Me.btnStretchPreview.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText
'           Me.btnStretchPreview.Click += New System.EventHandler(Me.btnStretchPreview_Click)
            '
            ' mainForm
            '
            Me.AutoScaleDimensions = New System.Drawing.SizeF(6F, 13F)
            Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
            Me.ClientSize = New System.Drawing.Size(736, 510)
            Me.Controls.Add(Me.panel4)
            Me.Controls.Add(Me.splitter2)
            Me.Controls.Add(Me.dataGrid)
            Me.Controls.Add(Me.splitter1)
            Me.Controls.Add(Me.panel5)
            Me.Controls.Add(Me.panel1)
            Me.Controls.Add(Me.mainToolbar)
            Me.Name = "mainForm"
            Me.Text = "FlexCel Object Explorer"
            Me.WindowState = System.Windows.Forms.FormWindowState.Maximized
            Me.panel1.ResumeLayout(False)
            Me.panel6.ResumeLayout(False)
            Me.panel3.ResumeLayout(False)
            CType(Me.dataGrid, System.ComponentModel.ISupportInitialize).EndInit()
            Me.panel4.ResumeLayout(False)
            CType(Me.PreviewBox, System.ComponentModel.ISupportInitialize).EndInit()
            Me.panel5.ResumeLayout(False)
            Me.panel5.PerformLayout()
            Me.mainToolbar.ResumeLayout(False)
            Me.mainToolbar.PerformLayout()
            Me.ResumeLayout(False)
            Me.PerformLayout()

        End Sub
        #End Region

        Private mainToolbar As ToolStrip
        Private WithEvents btnOpenFile As ToolStripButton
        Private toolStripSeparator1 As ToolStripSeparator
        Private WithEvents btnShowInExcel As ToolStripButton
        Private WithEvents btnExit As ToolStripButton
        Private WithEvents btnSaveAsImage As ToolStripButton
        Private WithEvents btnInfo As ToolStripButton
        Private toolStripSeparator2 As ToolStripSeparator
        Private WithEvents btnStretchPreview As ToolStripButton

    End Class
End Namespace

MainForm.vb

Imports System.Collections
Imports System.ComponentModel
Imports System.IO

Imports FlexCel.Core
Imports FlexCel.XlsAdapter

Namespace ObjectExplorer
    ''' <summary>
    ''' Object explorer.
    ''' </summary>
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Public Sub New()
            InitializeComponent()
            ResizeToolbar(mainToolbar)
        End Sub

        Private Sub ResizeToolbar(ByVal toolbar As ToolStrip)

            Using gr As Graphics = CreateGraphics()
                Dim xFactor As Double = gr.DpiX / 96.0
                Dim yFactor As Double = gr.DpiY / 96.0
                toolbar.ImageScalingSize = New Size(CInt(Fix(24 * xFactor)), CInt(Fix(24 * yFactor)))
                toolbar.Width = 0 'force a recalc of the buttons.
            End Using
        End Sub

        #Region "Global variables"
        Private Xls As XlsFile
        #End Region

        Private Sub btnExit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnExit.Click
            Close()
        End Sub

        Private Sub btnOpenFile_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnOpenFile.Click
            If openFileDialog1.ShowDialog() <> System.Windows.Forms.DialogResult.OK Then
                Return
            End If

            Xls = New XlsFile()
            Xls.Open(openFileDialog1.FileName)

            cbSheet.Items.Clear()
            Dim ActSheet As Integer = Xls.ActiveSheet
            For i As Integer = 1 To Xls.SheetCount
                Xls.ActiveSheet = i
                cbSheet.Items.Add(Xls.SheetName)
            Next i
            Xls.ActiveSheet = ActSheet
            cbSheet.SelectedIndex = ActSheet - 1

            FillListBox()
        End Sub

        Private Sub FillListBox()
            lblObjects.Text = openFileDialog1.FileName
            dataGrid.DataSource = Nothing

            ObjTree.BeginUpdate()
            Try
                ObjTree.Nodes.Clear()

                For i As Integer = 1 To Xls.ObjectCount
                    Dim ShapeProps As TShapeProperties = Xls.GetObjectProperties(i, True)
                    Dim s As String = "Object " & i.ToString()
                    If ShapeProps.ShapeName IsNot Nothing Then
                        s = ShapeProps.ShapeName
                    End If

                    Dim RootNode As New TreeNode(s)
                    FillNodes(ShapeProps, RootNode)

                    ObjTree.Nodes.Add(RootNode)
                Next i
            Finally
                ObjTree.EndUpdate()
            End Try
        End Sub

        Private Sub FillNodes(ByVal ShapeProps As TShapeProperties, ByVal Node As TreeNode)
            Node.Tag = ShapeProps 'In this simple demo we will use the tag property to store the Shape properties. This is not indented for 'real' use.

            For i As Integer = 1 To ShapeProps.ChildrenCount
                Dim ChildProps As TShapeProperties = ShapeProps.Children(i)
                Dim ShapeName As String = ChildProps.ShapeName
                If ShapeName Is Nothing Then
                    ShapeName = "Object " & i.ToString()
                End If
                Dim Child As New TreeNode(ShapeName)
                FillNodes(ChildProps, Child)
                Node.Nodes.Add(Child)
            Next i
        End Sub

        Private Sub btnOpen_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnShowInExcel.Click
            If Xls Is Nothing Then
                MessageBox.Show("There is no open file")
                Return
            End If
            System.Diagnostics.Process.Start(Xls.ActiveFileName)
        End Sub

        Private Sub btnSaveImage_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSaveAsImage.Click
            If PreviewBox.Image Is Nothing Then
                MessageBox.Show("There is no selected image to save", "Error")
                Return
            End If
            If saveImageDialog.ShowDialog() <> System.Windows.Forms.DialogResult.OK Then
                Return
            End If

            PreviewBox.Image.Save(saveImageDialog.FileName)
        End Sub

        Private Sub btnInfo_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnInfo.Click
            MessageBox.Show("Object Explorer allows to explore inside the objects in an Excel file." & vbLf & "Objects in xls files are hierachily distributed, you can have two objects grouped as a third object, " & "and this hierarchy is shown in the 'Objects' pane at the left. The properties for the selected object are displayed at the 'Object properties' pane.")
        End Sub

        Private Sub ObjTree_AfterSelect(ByVal sender As Object, ByVal e As System.Windows.Forms.TreeViewEventArgs) Handles ObjTree.AfterSelect
            RenderNode(e.Node)
            FillProperties(e.Node)
        End Sub

        Private Sub RenderNode(ByVal Node As TreeNode)
            If Xls Is Nothing Then
                PreviewBox.Image = Nothing
                Return
            End If

            Dim t As TreeNode = Node
            If t Is Nothing Then
                PreviewBox.Image = Nothing
                Return
            End If

            Do While t.Parent IsNot Nothing 'Only root level objects will be rendered.
                t = t.Parent
            Loop

            If t.Index + 1 > Xls.ObjectCount Then
                PreviewBox.Image = Nothing
                Return
            End If

            PreviewBox.Image = Xls.RenderObject(t.Index + 1)

        End Sub

        Private Sub FillProperties(ByVal Node As TreeNode)
            lblObjName.Text = "Name:"
            lblObjText.Text = "Text:"
            Dim Props As TShapeProperties = CType(Node.Tag, TShapeProperties)
            If Props Is Nothing Then
                dataGrid.DataSource = Nothing
                Return
            End If

            Dim ShapeOptions As TShapeOptionList = (TryCast(Node.Tag, TShapeProperties)).ShapeOptions
            If ShapeOptions Is Nothing Then
                dataGrid.DataSource = Nothing
                Return
            End If

            lblObjName.Text = "Name: " & Props.ShapeName
            lblObjText.Text = "Text: " & Convert.ToString(Props.Text)

            Dim ShapeOpts As New ArrayList()
            For Each opt As KeyValuePair(Of TShapeOption, Object) In ShapeOptions
                ShapeOpts.Add(New KeyValue(opt.Key, ShapeOptions))
            Next opt
            dataGrid.DataSource = ShapeOpts
        End Sub

        Private Sub cbSheet_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles cbSheet.SelectedIndexChanged
            Xls.ActiveSheet = cbSheet.SelectedIndex + 1
            FillListBox()
        End Sub

        Private Sub btnStretchPreview_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnStretchPreview.Click
            If btnStretchPreview.Checked Then
                PreviewBox.SizeMode = PictureBoxSizeMode.StretchImage
            Else
                PreviewBox.SizeMode = PictureBoxSizeMode.Normal
            End If

        End Sub

    End Class

    Friend Class KeyValue
        Private FKey As String
        Private FAs1616 As String
        Private FAsLong As String
        Private FAsString As String

        Public Sub New(ByVal aKey As TShapeOption, ByVal List As TShapeOptionList)
            FKey = Convert.ToString(aKey)
            FAs1616 = Convert.ToString(List.As1616(aKey, 0))
            FAsLong = Convert.ToString(List.AsLong(aKey, 0))
            FAsString = List.AsUnicodeString(aKey, "")
        End Sub

        Public Property Key() As String
            Get
                Return FKey
            End Get
            Set(ByVal value As String)
                FKey = value
            End Set
        End Property
        Public Property As1616() As String
            Get
                Return FAs1616
            End Get
            Set(ByVal value As String)
                FAs1616 = value
            End Set
        End Property
        Public Property AsLong() As String
            Get
                Return FAsLong
            End Get
            Set(ByVal value As String)
                FAsLong = value
            End Set
        End Property
        Public Property AsString() As String
            Get
                Return FAsString
            End Get
            Set(ByVal value As String)
                FAsString = value
            End Set
        End Property

        Public Overrides Function ToString() As String
            Return Key
        End Function

    End Class
End Namespace

Program.vb

Namespace ObjectExplorer
    Friend NotInheritable Class Program

        Private Sub New()
        End Sub

        ''' <summary>
        ''' The main entry point for the application.
        ''' </summary>
       <STAThread> _
        Shared Sub Main()
            Application.EnableVisualStyles()
            Application.SetCompatibleTextRenderingDefault(False)
            Application.Run(New mainForm())
        End Sub
    End Class
End Namespace


Copy and paste (VB.Net / netframework) | FlexCel Studio for the .NET Framework documentation

Copy and paste (VB.Net / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\vb\VS2022\netframework\10.API\40.Copy And Paste and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​vb/​VS2022/​netframework/​Modules/​10.​API/​40.​Copy And Paste

Overview

ExcelFile has a group of methods allowing you to copy/paste from/to FlexCel to/from Excel in native Excel format. All methods copy and paste the data on BIFF8 and Tabbed-Text format, to allow for copying/pasting from other sources besides Excel.

Copying and pasting in native BIFF8 format is a great advance over copying/pasting on plain text only. It allows you to keep cell formats/colors/rounding decimals/merged cells/etc. It allows a new world of interoperation between your applications and Excel. Your users will be able to interchange data back and forward between your application and Excel just by copying and pasting. But keep in mind that it has its limitations too:

  • It can't copy/paste images

  • It can't copy/paste strings longer than 255 characters

  • It can't copy the data on multiple sheets.

I would like to say that these limitations are not FlexCel's fault. The BIFF8 specification is correctly implemented, those are limitations on Excel's part.

Of course, Excel can copy and paste everything without problems, but this is so because Excel doesn't use the clipboard to do the operation. If you close all instances of Excel, open a Worksheet, copy some cells to the clipboard, close Excel and open it again you will run into the same limitations. Copy/paste limitations on Excel don't show when it is kept in memory.

Concepts

  • FlexCel methods return datastreams for maximum flexibility. No data will be actually copied/pasted from/to the clipboard by FlexCel, this is your task. Here you can see how it is done.

Files

AssemblyInfo.vb

Imports System.Reflection
Imports System.Runtime.CompilerServices

'
' General Information about an assembly is controlled through the following
' set of attributes. Change these attribute values to modify the information
' associated with an assembly.
'
<Assembly: AssemblyTitle("")>
<Assembly: AssemblyDescription("")>
<Assembly: AssemblyConfiguration("")>
<Assembly: AssemblyCompany("")>
<Assembly: AssemblyProduct("")>
<Assembly: AssemblyCopyright("(c) 2002 - 2014 TMS Software")>
<Assembly: AssemblyTrademark("")>
<Assembly: AssemblyCulture("")>

'
' Version information for an assembly consists of the following four values:
'
'      Major Version
'      Minor Version
'      Build Number
'      Revision
'
' You can specify all the values or you can default the Revision and Build Numbers
' by using the '*' as shown below:

<Assembly: AssemblyVersion("6.2.1.0")>

'
' In order to sign your assembly you must specify a key to use. Refer to the
' Microsoft .NET Framework documentation for more information on assembly signing.
'
' Use the attributes below to control which key is used for signing.
'
' Notes:
'   (*) If no key is specified, the assembly is not signed.
'   (*) KeyName refers to a key that has been installed in the Crypto Service
'       Provider (CSP) on your machine. KeyFile refers to a file which contains
'       a key.
'   (*) If the KeyFile and the KeyName values are both specified, the
'       following processing occurs:
'       (1) If the KeyName can be found in the CSP, that key is used.
'       (2) If the KeyName does not exist and the KeyFile does exist, the key
'           in the KeyFile is installed into the CSP and used.
'   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
'       When specifying the KeyFile, the location of the KeyFile should be
'       relative to the project output directory which is
'       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
'       located in the project directory, you would specify the AssemblyKeyFile
'       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
'   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
'       documentation for more information on this.
'
<Assembly: AssemblyDelaySign(False)>
<Assembly: AssemblyKeyFile("")>
<Assembly: AssemblyKeyName("")>

Form1.Designer.vb

Imports System.Collections
Imports System.ComponentModel
Imports System.IO
Imports System.Text
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Namespace CopyAndPaste
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        ''' <summary>
        ''' Required designer variable.
        ''' </summary>
        Private components As System.ComponentModel.Container = Nothing

        ''' <summary>
        ''' Clean up any resources being used.
        ''' </summary>
        Protected Overrides Sub Dispose(ByVal disposing As Boolean)
            If disposing Then
                If components IsNot Nothing Then
                    components.Dispose()
                End If
            End If
            MyBase.Dispose(disposing)
        End Sub

        #Region "Windows Form Designer generated code"
        ''' <summary>
        ''' Required method for Designer support - do not modify
        ''' the contents of this method with the code editor.
        ''' </summary>
        Private Sub InitializeComponent()
            Me.btnPaste = New System.Windows.Forms.Button()
            Me.btnNewFile = New System.Windows.Forms.Button()
            Me.btnCopy = New System.Windows.Forms.Button()
            Me.label1 = New System.Windows.Forms.Label()
            Me.label2 = New System.Windows.Forms.Label()
            Me.label3 = New System.Windows.Forms.Label()
            Me.label4 = New System.Windows.Forms.Label()
            Me.btnDragMe = New System.Windows.Forms.Button()
            Me.label5 = New System.Windows.Forms.Label()
            Me.DropHere = New System.Windows.Forms.Label()
            Me.btnOpenFile = New System.Windows.Forms.Button()
            Me.openFileDialog = New System.Windows.Forms.OpenFileDialog()
            Me.SuspendLayout()
            '
            ' btnPaste
            '
            Me.btnPaste.Location = New System.Drawing.Point(44, 251)
            Me.btnPaste.Margin = New System.Windows.Forms.Padding(6, 6, 6, 6)
            Me.btnPaste.Name = "btnPaste"
            Me.btnPaste.Size = New System.Drawing.Size(138, 42)
            Me.btnPaste.TabIndex = 0
            Me.btnPaste.Text = "Paste"
'           Me.btnPaste.Click += New System.EventHandler(Me.btnPaste_Click)
            '
            ' btnNewFile
            '
            Me.btnNewFile.Location = New System.Drawing.Point(44, 74)
            Me.btnNewFile.Margin = New System.Windows.Forms.Padding(6, 6, 6, 6)
            Me.btnNewFile.Name = "btnNewFile"
            Me.btnNewFile.Size = New System.Drawing.Size(138, 42)
            Me.btnNewFile.TabIndex = 1
            Me.btnNewFile.Text = "New File"
'           Me.btnNewFile.Click += New System.EventHandler(Me.btnNewFile_Click)
            '
            ' btnCopy
            '
            Me.btnCopy.Location = New System.Drawing.Point(44, 428)
            Me.btnCopy.Margin = New System.Windows.Forms.Padding(6, 6, 6, 6)
            Me.btnCopy.Name = "btnCopy"
            Me.btnCopy.Size = New System.Drawing.Size(138, 42)
            Me.btnCopy.TabIndex = 2
            Me.btnCopy.Text = "Copy"
'           Me.btnCopy.Click += New System.EventHandler(Me.btnCopy_Click)
            '
            ' label1
            '
            Me.label1.BackColor = System.Drawing.Color.LightSkyBlue
            Me.label1.Location = New System.Drawing.Point(44, 15)
            Me.label1.Margin = New System.Windows.Forms.Padding(6, 0, 6, 0)
            Me.label1.Name = "label1"
            Me.label1.Size = New System.Drawing.Size(719, 44)
            Me.label1.TabIndex = 4
            Me.label1.Text = "1) Begin by creating a new file or opening an existing file..."
            Me.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
            '
            ' label2
            '
            Me.label2.BackColor = System.Drawing.Color.LightSkyBlue
            Me.label2.Location = New System.Drawing.Point(44, 148)
            Me.label2.Margin = New System.Windows.Forms.Padding(6, 0, 6, 0)
            Me.label2.Name = "label2"
            Me.label2.Size = New System.Drawing.Size(719, 44)
            Me.label2.TabIndex = 5
            Me.label2.Text = "2) Now go to Excel, copy some cells and paste them here..."
            Me.label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
            '
            ' label3
            '
            Me.label3.BackColor = System.Drawing.Color.LightSkyBlue
            Me.label3.Location = New System.Drawing.Point(44, 325)
            Me.label3.Margin = New System.Windows.Forms.Padding(6, 0, 6, 0)
            Me.label3.Name = "label3"
            Me.label3.Size = New System.Drawing.Size(719, 44)
            Me.label3.TabIndex = 6
            Me.label3.Text = "3) After pasting, you can copy back the results to the clipboard"
            Me.label3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
            '
            ' label4
            '
            Me.label4.BackColor = System.Drawing.Color.SteelBlue
            Me.label4.ForeColor = System.Drawing.Color.White
            Me.label4.Location = New System.Drawing.Point(44, 369)
            Me.label4.Margin = New System.Windows.Forms.Padding(6, 0, 6, 0)
            Me.label4.Name = "label4"
            Me.label4.Size = New System.Drawing.Size(719, 44)
            Me.label4.TabIndex = 7
            Me.label4.Text = "Press the ""Copy"" button or drag the ""Drag Me!"" into Excel."
            Me.label4.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
            '
            ' btnDragMe
            '
            Me.btnDragMe.AllowDrop = True
            Me.btnDragMe.Location = New System.Drawing.Point(205, 428)
            Me.btnDragMe.Margin = New System.Windows.Forms.Padding(6, 6, 6, 6)
            Me.btnDragMe.Name = "btnDragMe"
            Me.btnDragMe.Size = New System.Drawing.Size(138, 42)
            Me.btnDragMe.TabIndex = 8
            Me.btnDragMe.Text = "Drag Me!"
'           Me.btnDragMe.MouseDown += New System.Windows.Forms.MouseEventHandler(Me.btnDragMe_MouseDown)
            '
            ' label5
            '
            Me.label5.BackColor = System.Drawing.Color.SteelBlue
            Me.label5.ForeColor = System.Drawing.Color.White
            Me.label5.Location = New System.Drawing.Point(44, 192)
            Me.label5.Margin = New System.Windows.Forms.Padding(6, 0, 6, 0)
            Me.label5.Name = "label5"
            Me.label5.Size = New System.Drawing.Size(719, 44)
            Me.label5.TabIndex = 10
            Me.label5.Text = "Press the ""Paste"" button or drag some cells from Excel into ""Drop Here!""."
            Me.label5.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
            '
            ' DropHere
            '
            Me.DropHere.AllowDrop = True
            Me.DropHere.BackColor = System.Drawing.Color.FromArgb((CInt((CByte(192)))), (CInt((CByte(255)))), (CInt((CByte(192)))))
            Me.DropHere.Location = New System.Drawing.Point(200, 251)
            Me.DropHere.Margin = New System.Windows.Forms.Padding(6, 0, 6, 0)
            Me.DropHere.Name = "DropHere"
            Me.DropHere.Size = New System.Drawing.Size(183, 42)
            Me.DropHere.TabIndex = 11
            Me.DropHere.Text = "Drop Here!"
            Me.DropHere.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
'           Me.DropHere.DragDrop += New System.Windows.Forms.DragEventHandler(Me.DropHere_DragDrop)
'           Me.DropHere.DragOver += New System.Windows.Forms.DragEventHandler(Me.DropHere_DragOver)
            '
            ' btnOpenFile
            '
            Me.btnOpenFile.Location = New System.Drawing.Point(205, 74)
            Me.btnOpenFile.Margin = New System.Windows.Forms.Padding(6)
            Me.btnOpenFile.Name = "btnOpenFile"
            Me.btnOpenFile.Size = New System.Drawing.Size(138, 42)
            Me.btnOpenFile.TabIndex = 12
            Me.btnOpenFile.Text = "Open File"
'           Me.btnOpenFile.Click += New System.EventHandler(Me.btnOpenFile_Click)
            '
            ' openFileDialog
            '
            Me.openFileDialog.DefaultExt = "xls"
            Me.openFileDialog.Filter = "Excel Files|*.xls|All files|*.*"
            Me.openFileDialog.Title = "Select a file to preview"
            '
            ' mainForm
            '
            Me.AutoScaleDimensions = New System.Drawing.SizeF(11F, 24F)
            Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
            Me.ClientSize = New System.Drawing.Size(836, 615)
            Me.Controls.Add(Me.btnOpenFile)
            Me.Controls.Add(Me.DropHere)
            Me.Controls.Add(Me.label5)
            Me.Controls.Add(Me.btnDragMe)
            Me.Controls.Add(Me.label4)
            Me.Controls.Add(Me.label3)
            Me.Controls.Add(Me.label2)
            Me.Controls.Add(Me.label1)
            Me.Controls.Add(Me.btnCopy)
            Me.Controls.Add(Me.btnNewFile)
            Me.Controls.Add(Me.btnPaste)
            Me.Margin = New System.Windows.Forms.Padding(6, 6, 6, 6)
            Me.Name = "mainForm"
            Me.Text = "Copy and Paste Demo"
            Me.ResumeLayout(False)

        End Sub
        #End Region

        Private WithEvents btnPaste As Button
        Private WithEvents btnNewFile As Button
        Private WithEvents btnCopy As Button
        Private label1 As Label
        Private label2 As Label
        Private label3 As Label
        Private label4 As Label
        Private label5 As Label
        Private WithEvents btnDragMe As Button
        Private WithEvents DropHere As Label
        Private WithEvents btnOpenFile As Button
        Private openFileDialog As OpenFileDialog

    End Class
End Namespace

Form1.vb

Imports System.Collections
Imports System.ComponentModel
Imports System.IO
Imports System.Text
Imports FlexCel.Core
Imports FlexCel.XlsAdapter

Namespace CopyAndPaste
    ''' <summary>
    ''' Copy and Paste Example.
    ''' </summary>
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Public Sub New()
            InitializeComponent()
        End Sub

        Private Xls As XlsFile

        Private Sub btnNewFile_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnNewFile.Click
            Try
                Xls = New XlsFile()
                Xls.NewFile(1, TExcelFileFormat.v2019)
            Catch ex As Exception
                MessageBox.Show(ex.Message)
            End Try
        End Sub

        Private Sub btnOpenFile_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnOpenFile.Click
            Try
                If openFileDialog.ShowDialog() <> System.Windows.Forms.DialogResult.OK Then
                    Return
                End If
                Xls = New XlsFile(openFileDialog.FileName)
            Catch ex As Exception
                MessageBox.Show(ex.Message)
            End Try

        End Sub

        Private Sub DoPaste(ByVal iData As IDataObject)
            If Xls Is Nothing Then
                MessageBox.Show("Please push the New File button before pasting")
                Return
            End If

            Try
                If iData.GetDataPresent(FlexCelDataFormats.Excel97) Then
                    'DO NOT CALL -> using (MemoryStream ms = (MemoryStream)iData.GetData(FlexCelDataFormats.Excel97))
                    'You shouldn't dispose the stream, as it belongs to the Clipboard.
                    Dim o As Object = iData.GetData(FlexCelDataFormats.Excel97)
                    Dim ms As MemoryStream = CType(o, MemoryStream)
                        Xls.PasteFromXlsClipboardFormat(1, 1, TFlxInsertMode.NoneDown, ms)
                        MessageBox.Show("NATIVE Data has been pasted at cell A1")
                Else
                    If iData.GetDataPresent(DataFormats.UnicodeText) Then
                    Xls.PasteFromTextClipboardFormat(1, 1, TFlxInsertMode.NoneDown, CStr(iData.GetData(DataFormats.UnicodeText)))
                    MessageBox.Show("UNICODE TEXT Data has been pasted at cell A1")
                Else
                        If iData.GetDataPresent(DataFormats.Text) Then
                    Xls.PasteFromTextClipboardFormat(1, 1, TFlxInsertMode.NoneDown, CStr(iData.GetData(DataFormats.Text)))
                    MessageBox.Show("TEXT Data has been pasted at cell A1")

                Else
                    MessageBox.Show("There is no Excel or Text data on the clipboard")
                End If
                End If
                End If
            Catch ex As Exception
                MessageBox.Show(ex.Message)
                Xls = New XlsFile()
                Xls.NewFile(1, TExcelFileFormat.v2019)
            End Try
        End Sub

        Private Sub btnPaste_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnPaste.Click
            DoPaste(Clipboard.GetDataObject())
        End Sub

        Private Sub DropHere_DragOver(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles DropHere.DragOver
            If e.Data.GetDataPresent(FlexCelDataFormats.Excel97) OrElse e.Data.GetDataPresent(DataFormats.UnicodeText) OrElse e.Data.GetDataPresent(DataFormats.Text) Then
                e.Effect = DragDropEffects.Copy
            End If
        End Sub

        Private Sub DropHere_DragDrop(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles DropHere.DragDrop
            DoPaste(e.Data)
        End Sub

        Private Sub DoCopy(ByVal ToClipboard As Boolean)
            If Xls Is Nothing Then
                MessageBox.Show("Please push the New File button before copying")
                Return
            End If

            'VERY IMPORTANT!!!!!
            '****************************************************************************
            'The MemoryStreams CAN NOT BE DISPOSED UNTIL WE CALL Clipboard.SetObjectData.
            'Even when we assigned the Stream with the DataObject Data, it is still in use and can't be freed.
            '****************************************************************************

            Try
                Dim data As New DataObject()
                Dim dataStreams As New List(Of MemoryStream)() 'we will use this list to dispose the memorystreams after they have been used.
                Try
                    For Each cf As FlexCelClipboardFormat In System.Enum.GetValues(GetType(FlexCelClipboardFormat))
                        Dim dataStream As New MemoryStream()
                        dataStreams.Add(dataStream)
                        Xls.CopyToClipboard(cf, dataStream)
                        dataStream.Position = 0
                        data.SetData(FlexCelDataFormats.GetString(cf), dataStream)

                    Next cf
                    If ToClipboard Then
                        Clipboard.SetDataObject(data, True)
                    Else
                        DoDragDrop(data, DragDropEffects.Copy)
                    End If
                Finally
                    For Each ms As MemoryStream In dataStreams
                        ms.Dispose()
                    Next ms
                End Try
            Catch ex As Exception
                MessageBox.Show(ex.Message)
            End Try
        End Sub

        Private Sub btnCopy_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnCopy.Click
            DoCopy(True)
        End Sub

        Private Sub btnDragMe_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles btnDragMe.MouseDown
            DoCopy(False)
        End Sub

    End Class
End Namespace

Program.vb

Namespace CopyAndPaste
    Friend NotInheritable Class Program

        Private Sub New()
        End Sub

        ''' <summary>
        ''' The main entry point for the application.
        ''' </summary>
       <STAThread> _
        Shared Sub Main()
            Application.EnableVisualStyles()
            Application.SetCompatibleTextRenderingDefault(False)
            Application.Run(New mainForm())
        End Sub
    End Class
End Namespace


Using hyperlinks (VB.Net / netframework) | FlexCel Studio for the .NET Framework documentation

Using hyperlinks (VB.Net / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\vb\VS2022\netframework\10.API\70.HyperLinks and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​vb/​VS2022/​netframework/​Modules/​10.​API/​70.​Hyper​Links

Overview

This is a small application to show how to use hyperlinks. Parameters in a hyperlink are not straightforward, so the idea is that you can go to Excel, create a Worksheet with your desired hyperlinks, and use this app to see what parameters they have.

Columns in the Grid

  • Cell1, Cell2:

    These are the first and last cell on the range of the hyperlink. Normally they will be the same cell

  • Type: There are 4 types of Hyperlinks:

    1. URL: This can be http, https, ftp, or mailto://

    2. UNC: This is a path to a network site on universal naming convention, like \\server\folder\your_file.xls.

    3. Local File: This is a file stored relative to the path of the sheet. (for example, on the upper folder)

    4. Current Workbook: this is a link to a cell on the file. Note that this option always has Text=''

  • Text:

    Text of the HyperLink. This is empty when linking to a cell.

  • Description:

    Description of the HyperLink.

  • Target Frame:

    This parameter is not documented. You can leave it empty.

  • Text Mark:

    When entering an URL on Excel, you can enter additional text following the url with a "#" character (for example www.your_url.com#myurl") The text Mark is the text after the "#" char. When entering an address to a cell, the address goes here too.

  • Hint:

    This is the hint Excel will show when hovering the mouse over the hyperlink.

Files

AssemblyInfo.vb

Imports System.Reflection
Imports System.Runtime.CompilerServices

'
' General Information about an assembly is controlled through the following
' set of attributes. Change these attribute values to modify the information
' associated with an assembly.
'
<Assembly: AssemblyTitle("")>
<Assembly: AssemblyDescription("")>
<Assembly: AssemblyConfiguration("")>
<Assembly: AssemblyCompany("")>
<Assembly: AssemblyProduct("")>
<Assembly: AssemblyCopyright("(c) 2002 - 2014 TMS Software")>
<Assembly: AssemblyTrademark("")>
<Assembly: AssemblyCulture("")>

'
' Version information for an assembly consists of the following four values:
'
'      Major Version
'      Minor Version
'      Build Number
'      Revision
'
' You can specify all the values or you can default the Revision and Build Numbers
' by using the '*' as shown below:

<Assembly: AssemblyVersion("6.2.1.0")>

'
' In order to sign your assembly you must specify a key to use. Refer to the
' Microsoft .NET Framework documentation for more information on assembly signing.
'
' Use the attributes below to control which key is used for signing.
'
' Notes:
'   (*) If no key is specified, the assembly is not signed.
'   (*) KeyName refers to a key that has been installed in the Crypto Service
'       Provider (CSP) on your machine. KeyFile refers to a file which contains
'       a key.
'   (*) If the KeyFile and the KeyName values are both specified, the
'       following processing occurs:
'       (1) If the KeyName can be found in the CSP, that key is used.
'       (2) If the KeyName does not exist and the KeyFile does exist, the key
'           in the KeyFile is installed into the CSP and used.
'   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
'       When specifying the KeyFile, the location of the KeyFile should be
'       relative to the project output directory which is
'       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
'       located in the project directory, you would specify the AssemblyKeyFile
'       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
'   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
'       documentation for more information on this.
'
<Assembly: AssemblyDelaySign(False)>
<Assembly: AssemblyKeyFile("")>
<Assembly: AssemblyKeyName("")>

Form1.Designer.vb

Imports System.Collections
Imports System.ComponentModel
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports System.IO
Imports System.Reflection
Namespace HyperLinks
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Private saveFileDialog1 As System.Windows.Forms.SaveFileDialog
        Private openFileDialog1 As System.Windows.Forms.OpenFileDialog
        Private dataGrid As System.Windows.Forms.DataGrid
        Private dataSet1 As System.Data.DataSet
        Private HlDataTable As System.Data.DataTable
        Private Index As System.Data.DataColumn
        Private Cell1 As System.Data.DataColumn
        Private Cell2 As System.Data.DataColumn
        Private [cType] As System.Data.DataColumn
        Private Description As System.Data.DataColumn
        Private TextMark As System.Data.DataColumn
        Private TargetFrame As System.Data.DataColumn
        Private cText As System.Data.DataColumn
        Private cHint As System.Data.DataColumn
        Private dataGridTableStyle1 As System.Windows.Forms.DataGridTableStyle
        Private dataGridTextBoxColumn1 As System.Windows.Forms.DataGridTextBoxColumn
        Private dataGridTextBoxColumn2 As System.Windows.Forms.DataGridTextBoxColumn
        Private dataGridTextBoxColumn3 As System.Windows.Forms.DataGridTextBoxColumn
        Private dataGridTextBoxColumn4 As System.Windows.Forms.DataGridTextBoxColumn
        Private dataGridTextBoxColumn5 As System.Windows.Forms.DataGridTextBoxColumn
        Private dataGridTextBoxColumn6 As System.Windows.Forms.DataGridTextBoxColumn
        Private dataGridTextBoxColumn7 As System.Windows.Forms.DataGridTextBoxColumn
        Private dataGridTextBoxColumn8 As System.Windows.Forms.DataGridTextBoxColumn
        Private dataGridTextBoxColumn9 As System.Windows.Forms.DataGridTextBoxColumn
        Private components As System.ComponentModel.IContainer = Nothing

        ''' <summary>
        ''' Clean up any resources being used.
        ''' </summary>
        Protected Overrides Sub Dispose(ByVal disposing As Boolean)
            If disposing Then
                If components IsNot Nothing Then
                    components.Dispose()
                End If
            End If
            MyBase.Dispose(disposing)
        End Sub

        #Region "Windows Form Designer generated code"
        ''' <summary>
        ''' Required method for Designer support - do not modify
        ''' the contents of this method with the code editor.
        ''' </summary>
        Private Sub InitializeComponent()
            Dim resources As New System.ComponentModel.ComponentResourceManager(GetType(mainForm))
            Me.saveFileDialog1 = New System.Windows.Forms.SaveFileDialog()
            Me.dataGrid = New System.Windows.Forms.DataGrid()
            Me.HlDataTable = New System.Data.DataTable()
            Me.Index = New System.Data.DataColumn()
            Me.Cell1 = New System.Data.DataColumn()
            Me.Cell2 = New System.Data.DataColumn()
            Me.cType = New System.Data.DataColumn()
            Me.cText = New System.Data.DataColumn()
            Me.Description = New System.Data.DataColumn()
            Me.TextMark = New System.Data.DataColumn()
            Me.TargetFrame = New System.Data.DataColumn()
            Me.cHint = New System.Data.DataColumn()
            Me.dataGridTableStyle1 = New System.Windows.Forms.DataGridTableStyle()
            Me.dataGridTextBoxColumn1 = New System.Windows.Forms.DataGridTextBoxColumn()
            Me.dataGridTextBoxColumn2 = New System.Windows.Forms.DataGridTextBoxColumn()
            Me.dataGridTextBoxColumn3 = New System.Windows.Forms.DataGridTextBoxColumn()
            Me.dataGridTextBoxColumn4 = New System.Windows.Forms.DataGridTextBoxColumn()
            Me.dataGridTextBoxColumn5 = New System.Windows.Forms.DataGridTextBoxColumn()
            Me.dataGridTextBoxColumn6 = New System.Windows.Forms.DataGridTextBoxColumn()
            Me.dataGridTextBoxColumn7 = New System.Windows.Forms.DataGridTextBoxColumn()
            Me.dataGridTextBoxColumn8 = New System.Windows.Forms.DataGridTextBoxColumn()
            Me.dataGridTextBoxColumn9 = New System.Windows.Forms.DataGridTextBoxColumn()
            Me.openFileDialog1 = New System.Windows.Forms.OpenFileDialog()
            Me.dataSet1 = New System.Data.DataSet()
            Me.mainToolbar = New System.Windows.Forms.ToolStrip()
            Me.btnReadHyperlinks = New System.Windows.Forms.ToolStripButton()
            Me.btnWriteHyperlinks = New System.Windows.Forms.ToolStripButton()
            Me.btnExit = New System.Windows.Forms.ToolStripButton()
            CType(Me.dataGrid, System.ComponentModel.ISupportInitialize).BeginInit()
            CType(Me.HlDataTable, System.ComponentModel.ISupportInitialize).BeginInit()
            CType(Me.dataSet1, System.ComponentModel.ISupportInitialize).BeginInit()
            Me.mainToolbar.SuspendLayout()
            Me.SuspendLayout()
            '
            ' saveFileDialog1
            '
            Me.saveFileDialog1.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm|Excel 97/2003|*.xls|Excel 2007|*.xlsx;*.xlsm|All " & "files|*.*"
            Me.saveFileDialog1.RestoreDirectory = True
            Me.saveFileDialog1.Title = "Save the file as..."
            '
            ' dataGrid
            '
            Me.dataGrid.CaptionText = "No file selected"
            Me.dataGrid.DataMember = ""
            Me.dataGrid.DataSource = Me.HlDataTable
            Me.dataGrid.Dock = System.Windows.Forms.DockStyle.Fill
            Me.dataGrid.HeaderForeColor = System.Drawing.SystemColors.ControlText
            Me.dataGrid.Location = New System.Drawing.Point(0, 38)
            Me.dataGrid.Name = "dataGrid"
            Me.dataGrid.ReadOnly = True
            Me.dataGrid.Size = New System.Drawing.Size(768, 327)
            Me.dataGrid.TabIndex = 3
            Me.dataGrid.TableStyles.AddRange(New System.Windows.Forms.DataGridTableStyle() { Me.dataGridTableStyle1})
            '
            ' HlDataTable
            '
            Me.HlDataTable.Columns.AddRange(New System.Data.DataColumn() { Me.Index, Me.Cell1, Me.Cell2, Me.cType, Me.cText, Me.Description, Me.TextMark, Me.TargetFrame, Me.cHint})
            Me.HlDataTable.TableName = "HlDataTable"
            '
            ' Index
            '
            Me.Index.ColumnName = "Index"
            '
            ' Cell1
            '
            Me.Cell1.ColumnName = "Cell1"
            '
            ' Cell2
            '
            Me.Cell2.ColumnName = "Cell2"
            '
            ' cType
            '
            Me.cType.ColumnName = "Type"
            '
            ' cText
            '
            Me.cText.ColumnName = "Text"
            '
            ' Description
            '
            Me.Description.ColumnName = "Description"
            '
            ' TextMark
            '
            Me.TextMark.ColumnName = "TextMark"
            '
            ' TargetFrame
            '
            Me.TargetFrame.ColumnName = "TargetFrame"
            '
            ' cHint
            '
            Me.cHint.ColumnName = "Hint"
            '
            ' dataGridTableStyle1
            '
            Me.dataGridTableStyle1.DataGrid = Me.dataGrid
            Me.dataGridTableStyle1.GridColumnStyles.AddRange(New System.Windows.Forms.DataGridColumnStyle() { Me.dataGridTextBoxColumn1, Me.dataGridTextBoxColumn2, Me.dataGridTextBoxColumn3, Me.dataGridTextBoxColumn4, Me.dataGridTextBoxColumn5, Me.dataGridTextBoxColumn6, Me.dataGridTextBoxColumn7, Me.dataGridTextBoxColumn8, Me.dataGridTextBoxColumn9})
            Me.dataGridTableStyle1.HeaderForeColor = System.Drawing.SystemColors.ControlText
            Me.dataGridTableStyle1.MappingName = "HlDataTable"
            Me.dataGridTableStyle1.PreferredColumnWidth = 15
            '
            ' dataGridTextBoxColumn1
            '
            Me.dataGridTextBoxColumn1.Format = ""
            Me.dataGridTextBoxColumn1.FormatInfo = Nothing
            Me.dataGridTextBoxColumn1.HeaderText = "Index"
            Me.dataGridTextBoxColumn1.MappingName = "Index"
            Me.dataGridTextBoxColumn1.Width = 35
            '
            ' dataGridTextBoxColumn2
            '
            Me.dataGridTextBoxColumn2.Format = ""
            Me.dataGridTextBoxColumn2.FormatInfo = Nothing
            Me.dataGridTextBoxColumn2.HeaderText = "Cell1"
            Me.dataGridTextBoxColumn2.MappingName = "Cell1"
            Me.dataGridTextBoxColumn2.Width = 40
            '
            ' dataGridTextBoxColumn3
            '
            Me.dataGridTextBoxColumn3.Format = ""
            Me.dataGridTextBoxColumn3.FormatInfo = Nothing
            Me.dataGridTextBoxColumn3.HeaderText = "Cell2"
            Me.dataGridTextBoxColumn3.MappingName = "Cell2"
            Me.dataGridTextBoxColumn3.Width = 40
            '
            ' dataGridTextBoxColumn4
            '
            Me.dataGridTextBoxColumn4.Format = ""
            Me.dataGridTextBoxColumn4.FormatInfo = Nothing
            Me.dataGridTextBoxColumn4.HeaderText = "Type"
            Me.dataGridTextBoxColumn4.MappingName = "Type"
            Me.dataGridTextBoxColumn4.Width = 75
            '
            ' dataGridTextBoxColumn5
            '
            Me.dataGridTextBoxColumn5.Format = ""
            Me.dataGridTextBoxColumn5.FormatInfo = Nothing
            Me.dataGridTextBoxColumn5.HeaderText = "Text"
            Me.dataGridTextBoxColumn5.MappingName = "Text"
            Me.dataGridTextBoxColumn5.Width = 150
            '
            ' dataGridTextBoxColumn6
            '
            Me.dataGridTextBoxColumn6.Format = ""
            Me.dataGridTextBoxColumn6.FormatInfo = Nothing
            Me.dataGridTextBoxColumn6.HeaderText = "Description"
            Me.dataGridTextBoxColumn6.MappingName = "Description"
            Me.dataGridTextBoxColumn6.Width = 150
            '
            ' dataGridTextBoxColumn7
            '
            Me.dataGridTextBoxColumn7.Format = ""
            Me.dataGridTextBoxColumn7.FormatInfo = Nothing
            Me.dataGridTextBoxColumn7.HeaderText = "TextMark"
            Me.dataGridTextBoxColumn7.MappingName = "TextMark"
            Me.dataGridTextBoxColumn7.Width = 75
            '
            ' dataGridTextBoxColumn8
            '
            Me.dataGridTextBoxColumn8.Format = ""
            Me.dataGridTextBoxColumn8.FormatInfo = Nothing
            Me.dataGridTextBoxColumn8.HeaderText = "TargetFrame"
            Me.dataGridTextBoxColumn8.MappingName = "TargetFrame"
            Me.dataGridTextBoxColumn8.Width = 75
            '
            ' dataGridTextBoxColumn9
            '
            Me.dataGridTextBoxColumn9.Format = ""
            Me.dataGridTextBoxColumn9.FormatInfo = Nothing
            Me.dataGridTextBoxColumn9.HeaderText = "Hint"
            Me.dataGridTextBoxColumn9.MappingName = "Hint"
            Me.dataGridTextBoxColumn9.Width = 75
            '
            ' openFileDialog1
            '
            Me.openFileDialog1.DefaultExt = "xls"
            Me.openFileDialog1.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm|Excel 97/2003|*.xls|Excel 2007|*.xlsx;*.xlsm|All " & "files|*.*"
            Me.openFileDialog1.Title = "Open an Excel File"
            '
            ' dataSet1
            '
            Me.dataSet1.DataSetName = "HlDataSet"
            Me.dataSet1.Locale = New System.Globalization.CultureInfo("")
            Me.dataSet1.Tables.AddRange(New System.Data.DataTable() { Me.HlDataTable})
            '
            ' mainToolbar
            '
            Me.mainToolbar.Items.AddRange(New System.Windows.Forms.ToolStripItem() { Me.btnReadHyperlinks, Me.btnWriteHyperlinks, Me.btnExit})
            Me.mainToolbar.Location = New System.Drawing.Point(0, 0)
            Me.mainToolbar.Name = "mainToolbar"
            Me.mainToolbar.Size = New System.Drawing.Size(768, 38)
            Me.mainToolbar.TabIndex = 11
            Me.mainToolbar.Text = "toolStrip1"
            '
            ' btnReadHyperlinks
            '
            Me.btnReadHyperlinks.Image = (CType(resources.GetObject("btnReadHyperlinks.Image"), System.Drawing.Image))
            Me.btnReadHyperlinks.ImageTransparentColor = System.Drawing.Color.Magenta
            Me.btnReadHyperlinks.Name = "btnReadHyperlinks"
            Me.btnReadHyperlinks.Size = New System.Drawing.Size(96, 35)
            Me.btnReadHyperlinks.Text = "Read Hyperlinks"
            Me.btnReadHyperlinks.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText
'           Me.btnReadHyperlinks.Click += New System.EventHandler(Me.ReadHyperLinks_Click)
            '
            ' btnWriteHyperlinks
            '
            Me.btnWriteHyperlinks.Image = (CType(resources.GetObject("btnWriteHyperlinks.Image"), System.Drawing.Image))
            Me.btnWriteHyperlinks.ImageTransparentColor = System.Drawing.Color.Magenta
            Me.btnWriteHyperlinks.Name = "btnWriteHyperlinks"
            Me.btnWriteHyperlinks.Size = New System.Drawing.Size(98, 43)
            Me.btnWriteHyperlinks.Text = "Write Hyperlinks"
            Me.btnWriteHyperlinks.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText
'           Me.btnWriteHyperlinks.Click += New System.EventHandler(Me.writeHyperLinks_Click)
            '
            ' btnExit
            '
            Me.btnExit.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right
            Me.btnExit.Image = (CType(resources.GetObject("btnExit.Image"), System.Drawing.Image))
            Me.btnExit.ImageTransparentColor = System.Drawing.Color.Magenta
            Me.btnExit.Name = "btnExit"
            Me.btnExit.Size = New System.Drawing.Size(59, 35)
            Me.btnExit.Text = "     E&xit     "
            Me.btnExit.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText
'           Me.btnExit.Click += New System.EventHandler(Me.button2_Click)
            '
            ' mainForm
            '
            Me.AutoScaleDimensions = New System.Drawing.SizeF(6F, 13F)
            Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
            Me.ClientSize = New System.Drawing.Size(768, 365)
            Me.Controls.Add(Me.dataGrid)
            Me.Controls.Add(Me.mainToolbar)
            Me.Name = "mainForm"
            Me.Text = "Form1"
            CType(Me.dataGrid, System.ComponentModel.ISupportInitialize).EndInit()
            CType(Me.HlDataTable, System.ComponentModel.ISupportInitialize).EndInit()
            CType(Me.dataSet1, System.ComponentModel.ISupportInitialize).EndInit()
            Me.mainToolbar.ResumeLayout(False)
            Me.mainToolbar.PerformLayout()
            Me.ResumeLayout(False)
            Me.PerformLayout()

        End Sub
        #End Region

        Private mainToolbar As ToolStrip
        Private WithEvents btnReadHyperlinks As ToolStripButton
        Private WithEvents btnWriteHyperlinks As ToolStripButton
        Private WithEvents btnExit As ToolStripButton
    End Class
End Namespace

Form1.vb

Imports System.Collections
Imports System.ComponentModel
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports System.IO
Imports System.Reflection

Namespace HyperLinks
    ''' <summary>
    ''' How to deal with Hyperlinks in FlexCel.
    ''' </summary>
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Public Sub New()
            InitializeComponent()
            ResizeToolbar(mainToolbar)
        End Sub

        Private Sub ResizeToolbar(ByVal toolbar As ToolStrip)

            Using gr As Graphics = CreateGraphics()
                Dim xFactor As Double = gr.DpiX / 96.0
                Dim yFactor As Double = gr.DpiY / 96.0
                toolbar.ImageScalingSize = New Size(CInt(Fix(24 * xFactor)), CInt(Fix(24 * yFactor)))
                toolbar.Width = 0 'force a recalc of the buttons.
            End Using

        End Sub

        Private Sub button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnExit.Click
            Close()
        End Sub

        Private Xls As ExcelFile = Nothing

        Private Sub ReadHyperLinks_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnReadHyperlinks.Click
            If openFileDialog1.ShowDialog() <> System.Windows.Forms.DialogResult.OK Then
                Return
            End If
            Xls = New XlsFile()

            Xls.Open(openFileDialog1.FileName)

            dataGrid.CaptionText = "Hyperlinks on file: " & openFileDialog1.FileName
            HlDataTable.Rows.Clear()

            For i As Integer = 1 To Xls.HyperLinkCount
                Dim Range As TXlsCellRange = Xls.GetHyperLinkCellRange(i)
                Dim HLink As THyperLink = Xls.GetHyperLink(i)

                Dim HLinkType As String = System.Enum.GetName(GetType(THyperLinkType), HLink.LinkType)

                Dim values() As Object ={i, TCellAddress.EncodeColumn(Range.Left) &Range.Top.ToString(), TCellAddress.EncodeColumn(Range.Right) &Range.Bottom.ToString(), HLinkType, HLink.Text, HLink.Description, HLink.TextMark, HLink.TargetFrame, HLink.Hint }
                HlDataTable.Rows.Add(values)

            Next i

        End Sub

        Private Sub writeHyperLinks_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnWriteHyperlinks.Click
            If Xls Is Nothing Then
                MessageBox.Show("You need to open a file first.")
                Return
            End If

            Dim XlsOut As ExcelFile = New XlsFile(True)
            XlsOut.NewFile(1, TExcelFileFormat.v2019)

            For i As Integer = 1 To Xls.HyperLinkCount
                Dim Range As TXlsCellRange = Xls.GetHyperLinkCellRange(i)
                Dim HLink As THyperLink = Xls.GetHyperLink(i)

                Dim XF As Integer = -1
                Dim Value As Object = Xls.GetCellValue(Range.Top, Range.Left, XF)
                XlsOut.SetCellValue(i, 1, Value, XlsOut.AddFormat(Xls.GetFormat(XF)))
                XlsOut.AddHyperLink(New TXlsCellRange(i, 1, i, 1), HLink)
            Next i

            If saveFileDialog1.ShowDialog() <> System.Windows.Forms.DialogResult.OK Then
                Return
            End If
            XlsOut.Save(saveFileDialog1.FileName)
            If MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) = System.Windows.Forms.DialogResult.Yes Then
                Process.Start(saveFileDialog1.FileName)
            End If
        End Sub

    End Class
End Namespace

Program.vb

Namespace HyperLinks
    Friend NotInheritable Class Program

        Private Sub New()
        End Sub

        ''' <summary>
        ''' The main entry point for the application.
        ''' </summary>
       <STAThread> _
        Shared Sub Main()
            Application.EnableVisualStyles()
            Application.SetCompatibleTextRenderingDefault(False)
            Application.Run(New mainForm())
        End Sub
    End Class
End Namespace


Intelligent page breaks (VB.Net / netframework) | FlexCel Studio for the .NET Framework documentation

Intelligent page breaks (VB.Net / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\vb\VS2022\netframework\10.API\72.Intelligent Page Breaks and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​vb/​VS2022/​netframework/​Modules/​10.​API/​72.​Intelligent Page Breaks

Overview

While there is no direct support in Excel for Widow/Orphan control, FlexCel has the capacity to add page breaks to your file, so you can keep interesting sections together.

Make sure to read the conceptual documentation about Intelligent Page Breaks to better understand what we are doing here.

Concepts

  • How to add automatic page breaks to a sheet. In this case, we are dumping a C# file to PDF, and we want to keep procedures in the same page is possible.

  • How to deal with different levels of "keep together". FlexCel allows you to make some rows more "keep together" than others, if it can't fit everything in the same page, it will try to keep the rows of higher "keep together". We use this here to try to keep full classes first, if it is not possible full procedures, if not full for/while loops, etc.\ Each "{" sign in the source file means higher level of "keep together", and each "}" decreases the level.

  • The method ExcelFile.AutoPageBreaks must be called after everything is done, so the sheet is in a final state when applying the page breaks.

Files

AssemblyInfo.vb

Imports System.Reflection
Imports System.Runtime.CompilerServices

'
' General Information about an assembly is controlled through the following
' set of attributes. Change these attribute values to modify the information
' associated with an assembly.
'
<Assembly: AssemblyTitle("")>
<Assembly: AssemblyDescription("")>
<Assembly: AssemblyConfiguration("")>
<Assembly: AssemblyCompany("")>
<Assembly: AssemblyProduct("")>
<Assembly: AssemblyCopyright("(c) 2002 - 2014 TMS Software")>
<Assembly: AssemblyTrademark("")>
<Assembly: AssemblyCulture("")>

'
' Version information for an assembly consists of the following four values:
'
'      Major Version
'      Minor Version
'      Build Number
'      Revision
'
' You can specify all the values or you can default the Revision and Build Numbers
' by using the '*' as shown below:

<Assembly: AssemblyVersion("6.2.1.0")>

'
' In order to sign your assembly you must specify a key to use. Refer to the
' Microsoft .NET Framework documentation for more information on assembly signing.
'
' Use the attributes below to control which key is used for signing.
'
' Notes:
'   (*) If no key is specified, the assembly is not signed.
'   (*) KeyName refers to a key that has been installed in the Crypto Service
'       Provider (CSP) on your machine. KeyFile refers to a file which contains
'       a key.
'   (*) If the KeyFile and the KeyName values are both specified, the
'       following processing occurs:
'       (1) If the KeyName can be found in the CSP, that key is used.
'       (2) If the KeyName does not exist and the KeyFile does exist, the key
'           in the KeyFile is installed into the CSP and used.
'   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
'       When specifying the KeyFile, the location of the KeyFile should be
'       relative to the project output directory which is
'       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
'       located in the project directory, you would specify the AssemblyKeyFile
'       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
'   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
'       documentation for more information on this.
'
<Assembly: AssemblyDelaySign(False)>
<Assembly: AssemblyKeyFile("")>
<Assembly: AssemblyKeyName("")>

Form1.Designer.vb

Imports System.Collections
Imports System.ComponentModel
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports System.IO
Imports System.Reflection
Imports System.Text
Imports FlexCel.Render
Namespace IntelligentPageBreaks
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        ''' <summary>
        ''' Required designer variable.
        ''' </summary>
        Private components As System.ComponentModel.Container = Nothing

        ''' <summary>
        ''' Clean up any resources being used.
        ''' </summary>
        Protected Overrides Sub Dispose(ByVal disposing As Boolean)
            If disposing Then
                If components IsNot Nothing Then
                    components.Dispose()
                End If
            End If
            MyBase.Dispose(disposing)
        End Sub

        #Region "Windows Form Designer generated code"
        ''' <summary>
        ''' Required method for Designer support - do not modify
        ''' the contents of this method with the code editor.
        ''' </summary>
        Private Sub InitializeComponent()
            Me.button1 = New System.Windows.Forms.Button()
            Me.saveFileDialog1 = New System.Windows.Forms.SaveFileDialog()
            Me.label1 = New System.Windows.Forms.Label()
            Me.SuspendLayout()
            '
            ' button1
            '
            Me.button1.Anchor = System.Windows.Forms.AnchorStyles.Bottom
            Me.button1.Location = New System.Drawing.Point(132, 73)
            Me.button1.Name = "button1"
            Me.button1.TabIndex = 0
            Me.button1.Text = "GO!"
'           Me.button1.Click += New System.EventHandler(Me.button1_Click)
            '
            ' saveFileDialog1
            '
            Me.saveFileDialog1.Filter = "Pdf Files|*.pdf"
            Me.saveFileDialog1.RestoreDirectory = True
            Me.saveFileDialog1.Title = "Select PDF file to save"
            '
            ' label1
            '
            Me.label1.Anchor = (CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) Or System.Windows.Forms.AnchorStyles.Left) Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.label1.BackColor = System.Drawing.Color.FromArgb((CByte(255)), (CByte(255)), (CByte(192)))
            Me.label1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
            Me.label1.Location = New System.Drawing.Point(16, 16)
            Me.label1.Name = "label1"
            Me.label1.Size = New System.Drawing.Size(312, 32)
            Me.label1.TabIndex = 1
            Me.label1.Text = "A  demo on how to have FlexCel paginate your documents so they keep their section" & "s together."
            '
            ' mainForm
            '
            Me.AutoScaleDimensions = New System.Drawing.SizeF(6F, 13F)
            Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
            Me.ClientSize = New System.Drawing.Size(336, 110)
            Me.Controls.Add(Me.label1)
            Me.Controls.Add(Me.button1)
            Me.Name = "mainForm"
            Me.Text = "Intelligent Page Breaks"
            Me.ResumeLayout(False)

        End Sub
        #End Region

        Private WithEvents button1 As System.Windows.Forms.Button
        Private saveFileDialog1 As System.Windows.Forms.SaveFileDialog
        Private label1 As System.Windows.Forms.Label

    End Class
End Namespace

Form1.vb

Imports System.ComponentModel
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports System.IO
Imports System.Reflection
Imports System.Text

Imports FlexCel.Render

Namespace IntelligentPageBreaks
    ''' <summary>
    ''' Demo showing how to create intelligent page breaks with the API.
    ''' </summary>
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Public Sub New()
            InitializeComponent()
        End Sub

        Private Keywords As Dictionary(Of String, String) = CreateKeywords()

        Private Shared Function CreateKeywords() As Dictionary(Of String, String)
            ' A very silly syntax highlighter. We don't have any context here, so for example "get" will be highlighted when it is a property or when it is not, but it is ok for this demo.
            Dim Result As New Dictionary(Of String, String)()

            Result.Add("private", Nothing)
            Result.Add("public", Nothing)
            Result.Add("protected", Nothing)
            Result.Add("internal", Nothing)
            Result.Add("static", Nothing)
            Result.Add("void", Nothing)
            Result.Add("get", Nothing)
            Result.Add("set", Nothing)
            Result.Add("return", Nothing)
            Result.Add("while", Nothing)
            Result.Add("for", Nothing)
            Result.Add("foreach", Nothing)
            Result.Add("using", Nothing)
            Result.Add("true", Nothing)
            Result.Add("false", Nothing)

            Return Result
        End Function

        Private ReadOnly Property PathToExe() As String
            Get
                Return Path.Combine(Path.Combine(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), ".."), "..") & Path.DirectorySeparatorChar
            End Get
        End Property

        Private Function SyntaxColor(ByVal Xls As ExcelFile, ByVal NormalFont As Integer, ByVal CommentFont As Integer, ByVal HighlightFont As Integer, ByVal line As String) As TRichString
            Dim RTFRunList As New List(Of TRTFRun)()

            Dim i As Integer = 0
            Do While i < line.Length
                If i > 0 AndAlso line.Chars(i - 1) = "/"c AndAlso line.Chars(i) = "/"c Then
                    Dim rtf As TRTFRun
                    rtf.FirstChar = i - 1
                    rtf.FontIndex = CommentFont
                    RTFRunList.Add(rtf)
                    Return New TRichString(line, RTFRunList.ToArray(), Xls)

                End If

                Dim start As Integer = i
                Do While i < line.Length AndAlso Char.IsLetterOrDigit(line.Chars(i))
                    i += 1
                Loop

                If i > start AndAlso Keywords.ContainsKey(line.Substring(start, i - start)) Then
                    Dim rtf As TRTFRun
                    rtf.FirstChar = start
                    rtf.FontIndex = HighlightFont
                    RTFRunList.Add(rtf)
                    rtf.FirstChar = i
                    rtf.FontIndex = NormalFont
                    RTFRunList.Add(rtf)
                End If

                i += 1
            Loop

            Return New TRichString(line, RTFRunList.ToArray(), Xls)
        End Function

        Private Sub DumpFile(ByVal Xls As ExcelFile, ByRef Row As Integer)
            Dim fnt As TFlxFont = Xls.GetDefaultFont
            fnt.Color = Color.Blue
            Dim HighlightFont As Integer = Xls.AddFont(fnt)
            fnt.Color = Color.Green
            Dim CommentFont As Integer = Xls.AddFont(fnt)

            Dim Level As Integer = 0
            Dim LevelStart As New Stack(Of Integer)()
            LevelStart.Push(Row)

            Using sr As New StreamReader(Path.Combine(PathToExe, "Form1.cs"))
                Dim line As String
                line = sr.ReadLine()
                Do While line IsNot Nothing
                    'Find the level of "keep together" for the row. We will use #region and "{" delimiters
                    'to increase the level. If possible, we would want those blocks together in one page.
                    Dim s As String = line.Trim()
                    If s.StartsWith("#region") Then
                        Level += 1
                        LevelStart.Push(Row)
                    End If
                    If s = "{" Then
                        Level += 1
                        LevelStart.Push(Row - 1) 'On {} blocks, we want to keep lines together starting with the previous statement.
                    End If

                    If s = "#endregion" OrElse s = "}" Then
                        Level -= 1
                        Xls.KeepRowsTogether(LevelStart.Pop(), Row, Level + 1, False)
                    End If

                    Xls.KeepRowsTogether(Row, Row, Level, True)

                    Xls.SetCellValue(Row, 1, SyntaxColor(Xls, 0, CommentFont, HighlightFont, line.Replace(vbTab, "    ")))
                    Row += 1
                    line = sr.ReadLine()
                Loop
            End Using
        End Sub

        Private Sub AddData(ByVal Xls As ExcelFile)

            'Fill the file with the contents of this c# file, many times so we can see many page breaks.
            Dim Row As Integer = 3
            DumpFile(Xls, Row)

            Xls.AutofitRowsOnWorkbook(False, True, 1)
            Xls.AutoPageBreaks(50, 100) ' we will use a 100% of page scale since we are printing to pdf.
                                         'If this was to create an Excel file, pagescale should be lower to
                                         'compensate the differences between page sizes in diiferent printers in Excel

            'Export the file to PDF so we can see the page breaks.
            Using pdf As New FlexCelPdfExport(Xls, True)
                pdf.Export(saveFileDialog1.FileName)
            End Using

        End Sub

        Private Sub button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button1.Click
            AutoRun()
        End Sub

        Public Sub AutoRun()
            If saveFileDialog1.ShowDialog() <> System.Windows.Forms.DialogResult.OK Then
                Return
            End If
            Dim Xls As ExcelFile = New XlsFile(True)
            Xls.NewFile(1, TExcelFileFormat.v2019)
            Xls.SetColWidth(1, 78 * 256) ';make longer lines wrap in the cell.
            Dim fmt As TFlxFormat = Xls.GetFormat(Xls.GetColFormat(1))
            fmt.WrapText = True

            Xls.SetColFormat(1, Xls.AddFormat(fmt))
            AddData(Xls)
            If MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) = System.Windows.Forms.DialogResult.Yes Then
                Process.Start(saveFileDialog1.FileName)
            End If

        End Sub
    End Class
End Namespace

Program.vb

Namespace IntelligentPageBreaks
    Friend NotInheritable Class Program

        Private Sub New()
        End Sub

        ''' <summary>
        ''' The main entry point for the application.
        ''' </summary>
       <STAThread> _
        Shared Sub Main()
            Application.EnableVisualStyles()
            Application.SetCompatibleTextRenderingDefault(False)
            Application.Run(New mainForm())
        End Sub
    End Class
End Namespace


Validating FlexCel recalculation (VB.Net / netframework) | FlexCel Studio for the .NET Framework documentation

Validating FlexCel recalculation (VB.Net / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\vb\VS2022\netframework\10.API\75.Validate Recalc and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​vb/​VS2022/​netframework/​Modules/​10.​API/​75.​Validate Recalc

Overview

By default, FlexCel recalculates the files it generates before saving. This is not completely necessary for normal xls/x files, because Excel will recalculate the file again when opening. But when natively printing or exporting to PDF, you need the values from the recalculation, because no Excel is involved in the process.

While most files will recalculate fine, if you have complex formulas and need to verify they will recalculate ok, this is the application to use.

Concepts

  • Button "Validate Recalc": This will verify that flexcel can understand all the formulas on your sheet.

  • Button "Compare with Excel": This will open a file you saved with Excel, force a recalculation in FlexCel and then compare all formula results with the original ones. You can use this to verify the results are actually what you expect them to be.

Files

AssemblyInfo.vb

Imports System.Reflection
Imports System.Runtime.CompilerServices

'
' General Information about an assembly is controlled through the following
' set of attributes. Change these attribute values to modify the information
' associated with an assembly.
'
<Assembly: AssemblyTitle("")>
<Assembly: AssemblyDescription("")>
<Assembly: AssemblyConfiguration("")>
<Assembly: AssemblyCompany("")>
<Assembly: AssemblyProduct("")>
<Assembly: AssemblyCopyright("(c) 2002 - 2014 TMS Software")>
<Assembly: AssemblyTrademark("")>
<Assembly: AssemblyCulture("")>

'
' Version information for an assembly consists of the following four values:
'
'      Major Version
'      Minor Version
'      Build Number
'      Revision
'
' You can specify all the values or you can default the Revision and Build Numbers
' by using the '*' as shown below:

<Assembly: AssemblyVersion("6.2.1.0")>

'
' In order to sign your assembly you must specify a key to use. Refer to the
' Microsoft .NET Framework documentation for more information on assembly signing.
'
' Use the attributes below to control which key is used for signing.
'
' Notes:
'   (*) If no key is specified, the assembly is not signed.
'   (*) KeyName refers to a key that has been installed in the Crypto Service
'       Provider (CSP) on your machine. KeyFile refers to a file which contains
'       a key.
'   (*) If the KeyFile and the KeyName values are both specified, the
'       following processing occurs:
'       (1) If the KeyName can be found in the CSP, that key is used.
'       (2) If the KeyName does not exist and the KeyFile does exist, the key
'           in the KeyFile is installed into the CSP and used.
'   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
'       When specifying the KeyFile, the location of the KeyFile should be
'       relative to the project output directory which is
'       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
'       located in the project directory, you would specify the AssemblyKeyFile
'       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
'   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
'       documentation for more information on this.
'
<Assembly: AssemblyDelaySign(False)>
<Assembly: AssemblyKeyFile("")>
<Assembly: AssemblyKeyName("")>

Form1.Designer.vb

Imports System.Collections
Imports System.ComponentModel
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports System.IO
Imports System.Reflection
Namespace ValidateRecalc
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Private openFileDialog1 As System.Windows.Forms.OpenFileDialog
        Private report As System.Windows.Forms.RichTextBox
        Private linkedFileDialog As System.Windows.Forms.OpenFileDialog
        Private components As System.ComponentModel.IContainer = Nothing

        ''' <summary>
        ''' Clean up any resources being used.
        ''' </summary>
        Protected Overrides Sub Dispose(ByVal disposing As Boolean)
            If disposing Then
                If components IsNot Nothing Then
                    components.Dispose()
                End If
            End If
            MyBase.Dispose(disposing)
        End Sub

        #Region "Windows Form Designer generated code"
        ''' <summary>
        ''' Required method for Designer support - do not modify
        ''' the contents of this method with the code editor.
        ''' </summary>
        Private Sub InitializeComponent()
            Dim resources As New System.ComponentModel.ComponentResourceManager(GetType(mainForm))
            Me.openFileDialog1 = New System.Windows.Forms.OpenFileDialog()
            Me.report = New System.Windows.Forms.RichTextBox()
            Me.XlsReport = New FlexCel.Report.FlexCelReport()
            Me.linkedFileDialog = New System.Windows.Forms.OpenFileDialog()
            Me.mainToolbar = New System.Windows.Forms.ToolStrip()
            Me.validateRecalc = New System.Windows.Forms.ToolStripButton()
            Me.compareWithExcel = New System.Windows.Forms.ToolStripButton()
            Me.toolStripSeparator1 = New System.Windows.Forms.ToolStripSeparator()
            Me.btnInfo = New System.Windows.Forms.ToolStripButton()
            Me.btnExit = New System.Windows.Forms.ToolStripButton()
            Me.mainToolbar.SuspendLayout()
            Me.SuspendLayout()
            '
            ' openFileDialog1
            '
            Me.openFileDialog1.DefaultExt = "xls"
            Me.openFileDialog1.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm|Excel 97/2003|*.xls|Excel 2007|*.xlsx;*.xlsm|All " & "files|*.*"
            Me.openFileDialog1.Title = "Open an Excel File"
            '
            ' report
            '
            Me.report.Dock = System.Windows.Forms.DockStyle.Fill
            Me.report.Font = New System.Drawing.Font("Courier New", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, (CByte(0)))
            Me.report.Location = New System.Drawing.Point(0, 38)
            Me.report.Name = "report"
            Me.report.ReadOnly = True
            Me.report.Size = New System.Drawing.Size(768, 327)
            Me.report.TabIndex = 3
            Me.report.Text = ""
            '
            ' linkedFileDialog
            '
            Me.linkedFileDialog.DefaultExt = "xls"
            Me.linkedFileDialog.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm|Excel 97/2003|*.xls|Excel 2007|*.xlsx;*.xlsm|All " & "files|*.*"
            Me.linkedFileDialog.Title = "Please supply the location for the following linked file."
            '
            ' mainToolbar
            '
            Me.mainToolbar.Items.AddRange(New System.Windows.Forms.ToolStripItem() { Me.validateRecalc, Me.compareWithExcel, Me.toolStripSeparator1, Me.btnInfo, Me.btnExit})
            Me.mainToolbar.Location = New System.Drawing.Point(0, 0)
            Me.mainToolbar.Name = "mainToolbar"
            Me.mainToolbar.Size = New System.Drawing.Size(768, 38)
            Me.mainToolbar.TabIndex = 11
            Me.mainToolbar.Text = "toolStrip1"
            '
            ' validateRecalc
            '
            Me.validateRecalc.Image = (CType(resources.GetObject("validateRecalc.Image"), System.Drawing.Image))
            Me.validateRecalc.ImageTransparentColor = System.Drawing.Color.Magenta
            Me.validateRecalc.Name = "validateRecalc"
            Me.validateRecalc.Size = New System.Drawing.Size(90, 35)
            Me.validateRecalc.Text = "&Validate Recalc"
            Me.validateRecalc.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText
'           Me.validateRecalc.Click += New System.EventHandler(Me.validateRecalc_Click)
            '
            ' compareWithExcel
            '
            Me.compareWithExcel.Image = (CType(resources.GetObject("compareWithExcel.Image"), System.Drawing.Image))
            Me.compareWithExcel.ImageTransparentColor = System.Drawing.Color.Magenta
            Me.compareWithExcel.Name = "compareWithExcel"
            Me.compareWithExcel.Size = New System.Drawing.Size(115, 43)
            Me.compareWithExcel.Text = "Compare with Excel"
            Me.compareWithExcel.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText
'           Me.compareWithExcel.Click += New System.EventHandler(Me.compareWithExcel_Click)
            '
            ' toolStripSeparator1
            '
            Me.toolStripSeparator1.Name = "toolStripSeparator1"
            Me.toolStripSeparator1.Size = New System.Drawing.Size(6, 46)
            '
            ' btnInfo
            '
            Me.btnInfo.Image = (CType(resources.GetObject("btnInfo.Image"), System.Drawing.Image))
            Me.btnInfo.ImageTransparentColor = System.Drawing.Color.Magenta
            Me.btnInfo.Name = "btnInfo"
            Me.btnInfo.Size = New System.Drawing.Size(74, 43)
            Me.btnInfo.Text = "Information"
            Me.btnInfo.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText
'           Me.btnInfo.Click += New System.EventHandler(Me.btnInfo_Click)
            '
            ' btnExit
            '
            Me.btnExit.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right
            Me.btnExit.Image = (CType(resources.GetObject("btnExit.Image"), System.Drawing.Image))
            Me.btnExit.ImageTransparentColor = System.Drawing.Color.Magenta
            Me.btnExit.Name = "btnExit"
            Me.btnExit.Size = New System.Drawing.Size(59, 35)
            Me.btnExit.Text = "     E&xit     "
            Me.btnExit.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText
'           Me.btnExit.Click += New System.EventHandler(Me.button2_Click)
            '
            ' mainForm
            '
            Me.AutoScaleDimensions = New System.Drawing.SizeF(6F, 13F)
            Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
            Me.ClientSize = New System.Drawing.Size(768, 365)
            Me.Controls.Add(Me.report)
            Me.Controls.Add(Me.mainToolbar)
            Me.Name = "mainForm"
            Me.Text = "Validate FlexCel recalculation"
            Me.mainToolbar.ResumeLayout(False)
            Me.mainToolbar.PerformLayout()
            Me.ResumeLayout(False)
            Me.PerformLayout()

        End Sub
        #End Region

        Private mainToolbar As ToolStrip
        Private WithEvents validateRecalc As ToolStripButton
        Private WithEvents compareWithExcel As ToolStripButton
        Private toolStripSeparator1 As ToolStripSeparator
        Private WithEvents btnInfo As ToolStripButton
        Private WithEvents btnExit As ToolStripButton
    End Class
End Namespace

Form1.vb

Imports System.Collections
Imports System.ComponentModel
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports System.IO
Imports System.Reflection

Namespace ValidateRecalc
    ''' <summary>
    ''' Use this demo to validate the recalculation made by FlexCel.
    ''' </summary>
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Private XlsReport As FlexCel.Report.FlexCelReport

        Public Sub New()
            InitializeComponent()
            ResizeToolbar(mainToolbar)
        End Sub

        Private Sub ResizeToolbar(ByVal toolbar As ToolStrip)

            Using gr As Graphics = CreateGraphics()
                Dim xFactor As Double = gr.DpiX / 96.0
                Dim yFactor As Double = gr.DpiY / 96.0
                toolbar.ImageScalingSize = New Size(CInt(Fix(24 * xFactor)), CInt(Fix(24 * yFactor)))
                toolbar.Width = 0 'force a recalc of the buttons.
            End Using
        End Sub

        Private Sub button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnExit.Click
            Close()
        End Sub

        Private Sub btnInfo_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnInfo.Click
            MessageBox.Show("This example will validate the calculations performed by the FlexCel engine." & vbLf & "It can do it in 2 different ways:" & vbLf & "  1) The button 'Validate Recalc' will analyze a file, and report if there is anything that FlexCel doesn't support on it." & vbLf & "  2) The button 'Compare with Excel' will open a file saved by Excel, recalculate it with FlexCel, compare the values reported by both FlexCel and Excel and report if there are any differences.")
        End Sub

        Private Sub validateRecalc_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles validateRecalc.Click
            If openFileDialog1.ShowDialog() <> System.Windows.Forms.DialogResult.OK Then
                Return
            End If
            Dim Xls As New XlsFile()

            Xls.Open(openFileDialog1.FileName)

            ' /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
            ' ////////Code here is only needed if you have linked files. In this example we don't know, so we will use it /////////
            Dim Work As New TWorkspace() 'Create a workspace
            Work.Add(Path.GetFileName(openFileDialog1.FileName), Xls) 'Add the original file to it
            AddHandler Work.LoadLinkedFile, AddressOf Work_LoadLinkedFile 'Set up an event to load the linked files.
                                                                                ' /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

            report.Text = "Results on file: " & openFileDialog1.FileName
            Dim Usl As TUnsupportedFormulaList = Xls.RecalcAndVerify()
            If Usl.Count = 0 Then
                report.Text &= vbLf & "**********All formulas supported!**********"
                Return
            End If

            report.Text &= vbLf & "Issues Found:"
            For i As Integer = 0 To Usl.Count - 1
                Dim FileName As String = String.Empty
                If Usl(i).FileName IsNot Nothing Then
                    FileName = "File: " & Usl(i).FileName & "  => "
                End If
                report.Text &= vbLf & "     " & FileName & Usl(i).Cell.CellRef & ": " & Usl(i).ErrorType.ToString()
                If Usl(i).StackTrace IsNot Nothing Then
                    For k As Integer = 0 To Usl(i).StackTrace.Length - 1
                        If Usl(i).StackTrace(k).Address IsNot Nothing Then
                            Dim TraceFileName As String = ""
                            If Usl(i).StackTrace(k).FileName Is Nothing Then TraceFileName = "[" & Usl(i).StackTrace(k).FileName & "]"
                            report.Text &= vbLf & "         -> References cell: " & TraceFileName & Usl(i).StackTrace(k).Address.CellRef
                        End If
                    Next k
                End If
                If Usl(i).FunctionName IsNot Nothing Then
                    Dim FunctionStr As String = "Function"
                    If Usl(i).ErrorType = TUnsupportedFormulaErrorType.ExternalReference Then
                        FunctionStr = "Linked file not found"
                    End If
                    report.Text &= " ->" & FunctionStr & ": " & Usl(i).FunctionName
                End If
            Next i
        End Sub

        Private Sub compareWithExcel_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles compareWithExcel.Click
            If openFileDialog1.ShowDialog() <> System.Windows.Forms.DialogResult.OK Then
                Return
            End If
            compareWithExcel.Enabled = False
            validateRecalc.Enabled = False
            Try
                Dim xls1 As New XlsFile()
                Dim xls2 As New XlsFile()

                xls1.Open(openFileDialog1.FileName)
                xls2.Open(openFileDialog1.FileName)
                report.Text = "Compare with Excel: " & openFileDialog1.FileName

                ' /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
                ' ////////Code here is only needed if you have linked files. In this example we don't know, so we will use it /////////
                Dim Work As New TWorkspace() 'Create a workspace
                Work.Add(Path.GetFileName(openFileDialog1.FileName), xls1) 'Add the original file to it
                AddHandler Work.LoadLinkedFile, AddressOf Work_LoadLinkedFile 'Set up an event to load the linked files.
                                                                                ' /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

                CompareXls(xls1, xls2, Nothing)
            Finally
                compareWithExcel.Enabled = True
                validateRecalc.Enabled = True
            End Try
        End Sub

        Private Sub CompareXls(ByVal xls1 As XlsFile, ByVal xls2 As XlsFile, ByVal table As DataTable)
            Dim DiffCount As Integer = 0
            xls1.Recalc()

            For sheet As Integer = 1 To xls1.SheetCount
                xls1.ActiveSheet = sheet
                xls2.ActiveSheet = sheet
                Dim aColCount As Integer = xls1.ColCount
                For r As Integer = 1 To xls1.RowCount
                    For c As Integer = 1 To aColCount
                        Dim f As TFormula = TryCast(xls1.GetCellValue(r, c), TFormula)
                        If f IsNot Nothing Then
                            Dim ad As New TCellAddress(r, c)
                            Dim f2 As TFormula = CType(xls2.GetCellValue(r, c), TFormula)
                            If f.Result Is Nothing Then
                                f.Result = ""
                            End If
                            If f2.Result Is Nothing Then
                                f2.Result = ""
                            End If
                            Dim eps As Double = 0
                            If TypeOf f.Result Is Double AndAlso TypeOf f2.Result Is Double Then
                                If CDbl(f2.Result) = 0 Then
                                    If Math.Abs(CDbl(f.Result)) < Double.Epsilon Then
                                        eps = 0
                                    Else
                                        eps = Double.NaN
                                    End If
                                Else
                                    eps = CDbl(f.Result) / CDbl(f2.Result)
                                End If
                                If Math.Abs(eps - 1) < 0.001 Then
                                    f.Result = f2.Result
                                End If
                            End If
                            If Not f.Result.Equals(f2.Result) Then
                                If table Is Nothing Then
                                    report.Text &= vbLf & "Sheet:" & xls1.SheetName & " --- Cell:" & ad.CellRef & " --- Calculated: " & f.Result.ToString() & "    Excel: " & f2.Result.ToString() & "  dif: " & eps.ToString() & "   formula: " & f.Text
                                    Application.DoEvents()
                                Else
                                    table.Rows.Add(New Object() { xls1.SheetName, ad.CellRef, f.Result.ToString(), f2.Result.ToString(), eps.ToString(), f.Text })
                                End If
                                DiffCount += 1

                            End If
                        End If
                    Next c
                Next r
            Next sheet

            If table Is Nothing Then
                report.Text &= vbLf & "Finished Comparing."
                If DiffCount = 0 Then
                    report.Text &= vbLf & "**********No differences found!**********"
                Else
                    report.Text &= String.Format(vbLf & "  --->Found {0} differences", DiffCount)
                End If
            End If
        End Sub

        Private Sub ValidateXls(ByVal xls As XlsFile, ByVal table As DataTable)
            Dim Usl As TUnsupportedFormulaList = xls.RecalcAndVerify()
            For i As Integer = 0 To Usl.Count - 1
                table.Rows.Add(New Object() { Usl(i).FileName, Usl(i).Cell.CellRef, Usl(i).ErrorType.ToString(), Usl(i).FunctionName })
            Next i
        End Sub

        ''' <summary>
        ''' This is the method that will be called by the ASP.NET front end. It returns an array of bytes
        ''' with the report data, so the ASP.NET application can stream it to the client.
        ''' </summary>
        ''' <returns>The generated file as a byte array.</returns>
        Public Function WebRun(ByVal DataStream As Stream, ByVal FileName As String) As Byte()
            XlsReport.SetValue("Date", Date.Now)
            XlsReport.SetValue("FileName", FileName)
            Dim Data As New DataSet()
            Dim ValidateResult As DataTable = Data.Tables.Add("ValidateResult")
            ValidateResult.Columns.Add("FileName", GetType(String))
            ValidateResult.Columns.Add("CellRef", GetType(String))
            ValidateResult.Columns.Add("ErrorType", GetType(String))
            ValidateResult.Columns.Add("FunctionName", GetType(String))

            Dim CompareResult As DataTable = Data.Tables.Add("CompareResult")
            CompareResult.Columns.Add("SheetName", GetType(String))
            CompareResult.Columns.Add("CellRef", GetType(String))
            CompareResult.Columns.Add("CalcResult", GetType(String))
            CompareResult.Columns.Add("XlsResult", GetType(String))
            CompareResult.Columns.Add("Diff", GetType(String))
            CompareResult.Columns.Add("FormulaText", GetType(String))

            XlsReport.AddTable(Data)

            Dim xls1 As New XlsFile()
            Dim xls2 As New XlsFile()

            xls1.Open(DataStream)
            DataStream.Position = 0
            xls2.Open(DataStream)

            CompareXls(xls1, xls2, CompareResult)
            ValidateXls(xls1, ValidateResult)

            Dim DataPath As String = Path.Combine(Path.Combine(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), ".."), "..") & Path.DirectorySeparatorChar

            Using OutStream As New MemoryStream()
                Using InStream As New FileStream(DataPath & "ValidateReport.xls", FileMode.Open, FileAccess.Read, FileShare.ReadWrite)
                    XlsReport.Run(InStream, OutStream)
                    Return OutStream.ToArray()
                End Using
            End Using
        End Function

        ''' <summary>
        ''' This event is used when there are linked files, to load them on demand.
        ''' </summary>
        ''' <param name="sender"></param>
        ''' <param name="e"></param>
        Private Sub Work_LoadLinkedFile(ByVal sender As Object, ByVal e As LoadLinkedFileEventArgs)
            'IMPORTANT: DO NOT USE THIS METHOD IN PRODUCTION IF SECURITY IS IMPORTANT.
            'This method will access any file in your harddisk, as long as it is linked in the spreaadhseet, and
            'that could mean an IMPORTANT SECURITY RISK. You should limit the places where the app can search for
            'linked files. Look at the "Recalculating Linked Files" in the PDF API Guide for more information.

            Dim FilePath As String = Path.Combine(Path.GetDirectoryName(openFileDialog1.FileName), e.FileName)

            If File.Exists(FilePath) Then 'If we find the path, just load the file.
                e.Xls = New XlsFile()
                e.Xls.Open(FilePath)
                Return
            End If

            'If we couldn't find the file, ask the user for its location.
            linkedFileDialog.FileName = FilePath
            If linkedFileDialog.ShowDialog() <> System.Windows.Forms.DialogResult.OK Then 'if user cancels, e.Xls will be null, so no file will be used and an #errna error will show in the formulas.
                Return
            End If

            e.Xls = New XlsFile()
            e.Xls.Open(linkedFileDialog.FileName)

        End Sub

    End Class

End Namespace

Program.vb

Namespace ValidateRecalc
    Friend NotInheritable Class Program

        Private Sub New()
        End Sub

        ''' <summary>
        ''' The main entry point for the application.
        ''' </summary>
       <STAThread> _
        Shared Sub Main()
            Application.EnableVisualStyles()
            Application.SetCompatibleTextRenderingDefault(False)
            Application.Run(New mainForm())
        End Sub
    End Class
End Namespace


Recalculation of linked files (VB.Net / netframework) | FlexCel Studio for the .NET Framework documentation

Recalculation of linked files (VB.Net / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\vb\VS2022\netframework\10.API\77.Recalculation Of Linked Files and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​vb/​VS2022/​netframework/​Modules/​10.​API/​77.​Recalculation Of Linked Files

Overview

FlexCel allows complete control over recalculation of linked files. In this demo, we will show how to create 3 linked files and how to recalculate them.

Concepts

  • How to create files with formulas that link to other files.

  • There are two ways to create a workspace to calculate linked files:

    1. When you know all the files needed in advance, you just add them to the workspace before recalculating.

    2. If you don't know which files (if any) you are going to need, you can use an event to load them on demand. This is the approach we use in the Validate Recalc example, since it deals with arbitrary files. Whenever you know which files are needed, it is better to use the first method.

  • Workspaces can take a lot of memory. Make sure you make them null after recalculating, and also the XlsFiles used in it. If you keep the files, those files will point to the workspace even if you make it null, and it will not be released. You can also Clear() the workspace before making it null to make sure you leave no references to it.

Files

AssemblyInfo.vb

Imports System.Reflection
Imports System.Runtime.CompilerServices

'
' General Information about an assembly is controlled through the following
' set of attributes. Change these attribute values to modify the information
' associated with an assembly.
'
<Assembly: AssemblyTitle("")>
<Assembly: AssemblyDescription("")>
<Assembly: AssemblyConfiguration("")>
<Assembly: AssemblyCompany("")>
<Assembly: AssemblyProduct("")>
<Assembly: AssemblyCopyright("(c) 2002 - 2014 TMS Software")>
<Assembly: AssemblyTrademark("")>
<Assembly: AssemblyCulture("")>

'
' Version information for an assembly consists of the following four values:
'
'      Major Version
'      Minor Version
'      Build Number
'      Revision
'
' You can specify all the values or you can default the Revision and Build Numbers
' by using the '*' as shown below:

<Assembly: AssemblyVersion("6.2.1.0")>

'
' In order to sign your assembly you must specify a key to use. Refer to the
' Microsoft .NET Framework documentation for more information on assembly signing.
'
' Use the attributes below to control which key is used for signing.
'
' Notes:
'   (*) If no key is specified, the assembly is not signed.
'   (*) KeyName refers to a key that has been installed in the Crypto Service
'       Provider (CSP) on your machine. KeyFile refers to a file which contains
'       a key.
'   (*) If the KeyFile and the KeyName values are both specified, the
'       following processing occurs:
'       (1) If the KeyName can be found in the CSP, that key is used.
'       (2) If the KeyName does not exist and the KeyFile does exist, the key
'           in the KeyFile is installed into the CSP and used.
'   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
'       When specifying the KeyFile, the location of the KeyFile should be
'       relative to the project output directory which is
'       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
'       located in the project directory, you would specify the AssemblyKeyFile
'       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
'   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
'       documentation for more information on this.
'
<Assembly: AssemblyDelaySign(False)>
<Assembly: AssemblyKeyFile("")>
<Assembly: AssemblyKeyName("")>

Form1.Designer.vb

Imports System.Collections
Imports System.ComponentModel
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports System.IO
Imports System.Reflection
Imports System.Globalization
Imports System.Drawing.Imaging
Imports System.Drawing.Drawing2D
Namespace RecalculationOfLinkedFiles
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Private panel2 As System.Windows.Forms.Panel
        Private WithEvents button2 As System.Windows.Forms.Button
        Private WithEvents CellA1 As System.Windows.Forms.TextBox
        Private panel1 As System.Windows.Forms.Panel
        Private label1 As System.Windows.Forms.Label
        Private label2 As System.Windows.Forms.Label
        Private label3 As System.Windows.Forms.Label
        Private Cell2 As System.Windows.Forms.TextBox
        Private label4 As System.Windows.Forms.Label
        Private label5 As System.Windows.Forms.Label
        Private label6 As System.Windows.Forms.Label
        Private label7 As System.Windows.Forms.Label
        Private Cell3 As System.Windows.Forms.TextBox
        Private label8 As System.Windows.Forms.Label
        Private label9 As System.Windows.Forms.Label
        Private Cell4 As System.Windows.Forms.TextBox
        Private label18 As System.Windows.Forms.Label
        Private panel3 As System.Windows.Forms.Panel
        Private WithEvents ChartA1 As System.Windows.Forms.TextBox
        Private WithEvents ChartB1 As System.Windows.Forms.TextBox
        Private WithEvents ChartB2 As System.Windows.Forms.TextBox
        Private WithEvents ChartA2 As System.Windows.Forms.TextBox
        Private WithEvents ChartB3 As System.Windows.Forms.TextBox
        Private WithEvents ChartA3 As System.Windows.Forms.TextBox
        Private chartBox As System.Windows.Forms.PictureBox
        Private components As System.ComponentModel.IContainer = Nothing

        ''' <summary>
        ''' Clean up any resources being used.
        ''' </summary>
        Protected Overrides Sub Dispose(ByVal disposing As Boolean)
            If disposing Then
                If components IsNot Nothing Then
                    components.Dispose()
                End If
            End If
            MyBase.Dispose(disposing)
        End Sub

        #Region "Windows Form Designer generated code"
        ''' <summary>
        ''' Required method for Designer support - do not modify
        ''' the contents of this method with the code editor.
        ''' </summary>
        Private Sub InitializeComponent()
            Dim resources As New System.ComponentModel.ComponentResourceManager(GetType(mainForm))
            Me.panel2 = New System.Windows.Forms.Panel()
            Me.button2 = New System.Windows.Forms.Button()
            Me.CellA1 = New System.Windows.Forms.TextBox()
            Me.panel1 = New System.Windows.Forms.Panel()
            Me.label8 = New System.Windows.Forms.Label()
            Me.label9 = New System.Windows.Forms.Label()
            Me.Cell4 = New System.Windows.Forms.TextBox()
            Me.label6 = New System.Windows.Forms.Label()
            Me.label7 = New System.Windows.Forms.Label()
            Me.Cell3 = New System.Windows.Forms.TextBox()
            Me.label5 = New System.Windows.Forms.Label()
            Me.label4 = New System.Windows.Forms.Label()
            Me.label3 = New System.Windows.Forms.Label()
            Me.Cell2 = New System.Windows.Forms.TextBox()
            Me.label2 = New System.Windows.Forms.Label()
            Me.label1 = New System.Windows.Forms.Label()
            Me.label18 = New System.Windows.Forms.Label()
            Me.ChartA1 = New System.Windows.Forms.TextBox()
            Me.panel3 = New System.Windows.Forms.Panel()
            Me.chartBox = New System.Windows.Forms.PictureBox()
            Me.ChartB3 = New System.Windows.Forms.TextBox()
            Me.ChartA3 = New System.Windows.Forms.TextBox()
            Me.ChartB2 = New System.Windows.Forms.TextBox()
            Me.ChartA2 = New System.Windows.Forms.TextBox()
            Me.ChartB1 = New System.Windows.Forms.TextBox()
            Me.panel2.SuspendLayout()
            Me.panel1.SuspendLayout()
            Me.panel3.SuspendLayout()
            CType(Me.chartBox, System.ComponentModel.ISupportInitialize).BeginInit()
            Me.SuspendLayout()
            '
            ' panel2
            '
            Me.panel2.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D
            Me.panel2.Controls.Add(Me.button2)
            Me.panel2.Dock = System.Windows.Forms.DockStyle.Bottom
            Me.panel2.Location = New System.Drawing.Point(0, 422)
            Me.panel2.Name = "panel2"
            Me.panel2.Size = New System.Drawing.Size(760, 32)
            Me.panel2.TabIndex = 2
            '
            ' button2
            '
            Me.button2.Anchor = (CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.button2.BackColor = System.Drawing.SystemColors.Control
            Me.button2.Image = (CType(resources.GetObject("button2.Image"), System.Drawing.Image))
            Me.button2.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft
            Me.button2.Location = New System.Drawing.Point(697, 2)
            Me.button2.Name = "button2"
            Me.button2.Size = New System.Drawing.Size(56, 26)
            Me.button2.TabIndex = 2
            Me.button2.Text = "Exit"
            Me.button2.TextAlign = System.Drawing.ContentAlignment.MiddleRight
            Me.button2.UseVisualStyleBackColor = False
'           Me.button2.Click += New System.EventHandler(Me.button2_Click)
            '
            ' CellA1
            '
            Me.CellA1.Location = New System.Drawing.Point(24, 88)
            Me.CellA1.Name = "CellA1"
            Me.CellA1.Size = New System.Drawing.Size(100, 20)
            Me.CellA1.TabIndex = 3
'           Me.CellA1.TextChanged += New System.EventHandler(Me.CellA1_TextChanged)
            '
            ' panel1
            '
            Me.panel1.Anchor = (CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.panel1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D
            Me.panel1.Controls.Add(Me.label8)
            Me.panel1.Controls.Add(Me.label9)
            Me.panel1.Controls.Add(Me.Cell4)
            Me.panel1.Controls.Add(Me.label6)
            Me.panel1.Controls.Add(Me.label7)
            Me.panel1.Controls.Add(Me.Cell3)
            Me.panel1.Controls.Add(Me.label5)
            Me.panel1.Controls.Add(Me.label4)
            Me.panel1.Controls.Add(Me.label3)
            Me.panel1.Controls.Add(Me.Cell2)
            Me.panel1.Controls.Add(Me.label2)
            Me.panel1.Controls.Add(Me.label1)
            Me.panel1.Controls.Add(Me.CellA1)
            Me.panel1.Location = New System.Drawing.Point(8, 8)
            Me.panel1.Name = "panel1"
            Me.panel1.Size = New System.Drawing.Size(736, 136)
            Me.panel1.TabIndex = 4
            '
            ' label8
            '
            Me.label8.Location = New System.Drawing.Point(520, 72)
            Me.label8.Name = "label8"
            Me.label8.Size = New System.Drawing.Size(160, 16)
            Me.label8.TabIndex = 15
            Me.label8.Text = "=[Third File.xls]Sheet1!A1 + 7"
            '
            ' label9
            '
            Me.label9.Location = New System.Drawing.Point(520, 56)
            Me.label9.Name = "label9"
            Me.label9.Size = New System.Drawing.Size(100, 16)
            Me.label9.TabIndex = 14
            Me.label9.Text = "First File: A2"
            '
            ' Cell4
            '
            Me.Cell4.Enabled = False
            Me.Cell4.Location = New System.Drawing.Point(520, 88)
            Me.Cell4.Name = "Cell4"
            Me.Cell4.Size = New System.Drawing.Size(152, 20)
            Me.Cell4.TabIndex = 13
            '
            ' label6
            '
            Me.label6.Location = New System.Drawing.Point(328, 72)
            Me.label6.Name = "label6"
            Me.label6.Size = New System.Drawing.Size(184, 16)
            Me.label6.TabIndex = 12
            Me.label6.Text = "=[Second File.xls]Sheet1!A1 * 5"
            '
            ' label7
            '
            Me.label7.Location = New System.Drawing.Point(328, 56)
            Me.label7.Name = "label7"
            Me.label7.Size = New System.Drawing.Size(100, 16)
            Me.label7.TabIndex = 11
            Me.label7.Text = "Third File: A1"
            '
            ' Cell3
            '
            Me.Cell3.Enabled = False
            Me.Cell3.Location = New System.Drawing.Point(328, 88)
            Me.Cell3.Name = "Cell3"
            Me.Cell3.Size = New System.Drawing.Size(152, 20)
            Me.Cell3.TabIndex = 10
            '
            ' label5
            '
            Me.label5.Location = New System.Drawing.Point(152, 72)
            Me.label5.Name = "label5"
            Me.label5.Size = New System.Drawing.Size(152, 16)
            Me.label5.TabIndex = 9
            Me.label5.Text = "=[First File.xls]Sheet1!A1 * 2"
            '
            ' label4
            '
            Me.label4.Location = New System.Drawing.Point(24, 72)
            Me.label4.Name = "label4"
            Me.label4.Size = New System.Drawing.Size(100, 16)
            Me.label4.TabIndex = 8
            Me.label4.Text = "Constant"
            '
            ' label3
            '
            Me.label3.Location = New System.Drawing.Point(152, 56)
            Me.label3.Name = "label3"
            Me.label3.Size = New System.Drawing.Size(100, 16)
            Me.label3.TabIndex = 7
            Me.label3.Text = "Second File: A1"
            '
            ' Cell2
            '
            Me.Cell2.Enabled = False
            Me.Cell2.Location = New System.Drawing.Point(152, 88)
            Me.Cell2.Name = "Cell2"
            Me.Cell2.Size = New System.Drawing.Size(144, 20)
            Me.Cell2.TabIndex = 6
            '
            ' label2
            '
            Me.label2.Location = New System.Drawing.Point(24, 56)
            Me.label2.Name = "label2"
            Me.label2.Size = New System.Drawing.Size(100, 16)
            Me.label2.TabIndex = 5
            Me.label2.Text = "First File: A1"
            '
            ' label1
            '
            Me.label1.Anchor = (CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.label1.Location = New System.Drawing.Point(16, 16)
            Me.label1.Name = "label1"
            Me.label1.Size = New System.Drawing.Size(704, 32)
            Me.label1.TabIndex = 4
            Me.label1.Text = "In this first example we will dynamically create 3 linked files. We will create a" & " workspace to link the files, and see how recalculation works."
            '
            ' label18
            '
            Me.label18.Anchor = (CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.label18.Location = New System.Drawing.Point(16, 16)
            Me.label18.Name = "label18"
            Me.label18.Size = New System.Drawing.Size(704, 32)
            Me.label18.TabIndex = 4
            Me.label18.Text = "This second example shows how to load files when we don't know a priori which fil" & "es we need to recalculate a file. To make it more interesting, we will use a cha" & "rt linked to other file."
            '
            ' ChartA1
            '
            Me.ChartA1.Location = New System.Drawing.Point(16, 56)
            Me.ChartA1.Name = "ChartA1"
            Me.ChartA1.Size = New System.Drawing.Size(64, 20)
            Me.ChartA1.TabIndex = 3
            Me.ChartA1.Text = "1"
'           Me.ChartA1.TextChanged += New System.EventHandler(Me.Chart_TextChanged)
            '
            ' panel3
            '
            Me.panel3.Anchor = (CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) Or System.Windows.Forms.AnchorStyles.Left) Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.panel3.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D
            Me.panel3.Controls.Add(Me.chartBox)
            Me.panel3.Controls.Add(Me.ChartB3)
            Me.panel3.Controls.Add(Me.ChartA3)
            Me.panel3.Controls.Add(Me.ChartB2)
            Me.panel3.Controls.Add(Me.ChartA2)
            Me.panel3.Controls.Add(Me.ChartB1)
            Me.panel3.Controls.Add(Me.label18)
            Me.panel3.Controls.Add(Me.ChartA1)
            Me.panel3.Location = New System.Drawing.Point(8, 176)
            Me.panel3.Name = "panel3"
            Me.panel3.Size = New System.Drawing.Size(736, 225)
            Me.panel3.TabIndex = 5
            '
            ' chartBox
            '
            Me.chartBox.Anchor = (CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) Or System.Windows.Forms.AnchorStyles.Left) Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.chartBox.Location = New System.Drawing.Point(176, 56)
            Me.chartBox.Name = "chartBox"
            Me.chartBox.Size = New System.Drawing.Size(544, 152)
            Me.chartBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage
            Me.chartBox.TabIndex = 52
            Me.chartBox.TabStop = False
            '
            ' ChartB3
            '
            Me.ChartB3.Location = New System.Drawing.Point(88, 104)
            Me.ChartB3.Name = "ChartB3"
            Me.ChartB3.Size = New System.Drawing.Size(64, 20)
            Me.ChartB3.TabIndex = 9
            Me.ChartB3.Text = "5"
'           Me.ChartB3.TextChanged += New System.EventHandler(Me.Chart_TextChanged)
            '
            ' ChartA3
            '
            Me.ChartA3.Location = New System.Drawing.Point(16, 104)
            Me.ChartA3.Name = "ChartA3"
            Me.ChartA3.Size = New System.Drawing.Size(64, 20)
            Me.ChartA3.TabIndex = 8
            Me.ChartA3.Text = "3"
'           Me.ChartA3.TextChanged += New System.EventHandler(Me.Chart_TextChanged)
            '
            ' ChartB2
            '
            Me.ChartB2.Location = New System.Drawing.Point(88, 80)
            Me.ChartB2.Name = "ChartB2"
            Me.ChartB2.Size = New System.Drawing.Size(64, 20)
            Me.ChartB2.TabIndex = 7
            Me.ChartB2.Text = "4"
'           Me.ChartB2.TextChanged += New System.EventHandler(Me.Chart_TextChanged)
            '
            ' ChartA2
            '
            Me.ChartA2.Location = New System.Drawing.Point(16, 80)
            Me.ChartA2.Name = "ChartA2"
            Me.ChartA2.Size = New System.Drawing.Size(64, 20)
            Me.ChartA2.TabIndex = 6
            Me.ChartA2.Text = "2"
'           Me.ChartA2.TextChanged += New System.EventHandler(Me.Chart_TextChanged)
            '
            ' ChartB1
            '
            Me.ChartB1.Location = New System.Drawing.Point(88, 56)
            Me.ChartB1.Name = "ChartB1"
            Me.ChartB1.Size = New System.Drawing.Size(64, 20)
            Me.ChartB1.TabIndex = 5
            Me.ChartB1.Text = "3"
'           Me.ChartB1.TextChanged += New System.EventHandler(Me.Chart_TextChanged)
            '
            ' mainForm
            '
            Me.AutoScaleDimensions = New System.Drawing.SizeF(6F, 13F)
            Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
            Me.ClientSize = New System.Drawing.Size(760, 454)
            Me.Controls.Add(Me.panel3)
            Me.Controls.Add(Me.panel1)
            Me.Controls.Add(Me.panel2)
            Me.Name = "mainForm"
            Me.Text = "Calculation of linked files"
            Me.panel2.ResumeLayout(False)
            Me.panel1.ResumeLayout(False)
            Me.panel1.PerformLayout()
            Me.panel3.ResumeLayout(False)
            Me.panel3.PerformLayout()
            CType(Me.chartBox, System.ComponentModel.ISupportInitialize).EndInit()
            Me.ResumeLayout(False)

        End Sub
        #End Region
    End Class
End Namespace

Form1.vb

Imports System.Collections
Imports System.ComponentModel
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports System.IO
Imports System.Reflection
Imports System.Globalization
Imports System.Drawing.Imaging
Imports System.Drawing.Drawing2D

Namespace RecalculationOfLinkedFiles
    ''' <summary>
    ''' Shows how to recalculate linked files.
    ''' </summary>
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Public Sub New()
            InitializeComponent()
        End Sub

        Private Sub button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button2.Click
            Close()
        End Sub

        Private Sub CellA1_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles CellA1.TextChanged
            'This is a very slow way to do this (recreating the full 3 files each time you type a character)
            'but it is the best for what we want to show. (how to create and recalculate spreadsheets)
            'In a real world example you would keep the created files in memory and just recalculate them
            'when there is a change.
            CreateFilesAndRecalculate()
        End Sub

        ''' <summary>
        ''' This method will try to convert a text to a string, and if not possible, return the text.
        ''' </summary>
        ''' <param name="s"></param>
        ''' <returns></returns>
        Private Function GetValue(ByVal s As String) As Object
            Dim d As Double
            If Double.TryParse(s, NumberStyles.Any, CultureInfo.CurrentCulture, d) Then
                Return d
            End If
            Return s
        End Function

        Private Sub CreateFilesAndRecalculate()
            'Set up the files.
            Dim xls1 As New XlsFile()
            xls1.NewFile(1, TExcelFileFormat.v2019)

            xls1.SetCellValue(1, 1, GetValue(CellA1.Text))
            xls1.SetCellValue(2, 1, New TFormula("=[Third File.xls]Sheet1!A1 + 7"))

            Dim xls2 As New XlsFile()
            xls2.NewFile(1, TExcelFileFormat.v2019)
            xls2.SetCellValue(1, 1, New TFormula("=[First File.xls]Sheet1!A1 * 2"))

            Dim xls3 As New XlsFile()
            xls3.NewFile(1, TExcelFileFormat.v2019)
            xls3.SetCellValue(1, 1, New TFormula("=[Second File.xls]Sheet1!A1 * 5"))

            'Create a workspace to recalculate them.
            'In this case, as we know what files we need in advance, we will just add them to the workspace
            'For an example on how to load files on demand, take a look at the chart example in this demo.
            Dim Workspace As New TWorkspace()
            Workspace.Add("First File.xls", xls1)
            Workspace.Add("Second File.xls", xls2)
            Workspace.Add("Third File.xls", xls3)

            'Now that the workspace is set, we can recalculate. We could recalc() in the Workspace object or in any of the files in it.
            'The effect is the same, all files will be recalculated.
            'DO NOT RECALCULATE EVERY FILE. EACH TIME YOU CALCULATE ONE, YOU ARE CALCULATING THEM ALL.
            xls1.Recalc()

            'Ok, now it is time to show the results.
            Cell2.Text = Convert.ToString(CType(xls2.GetCellValue(1, 1), TFormula).Result)
            Cell3.Text = Convert.ToString(CType(xls3.GetCellValue(1, 1), TFormula).Result)
            Cell4.Text = Convert.ToString(CType(xls1.GetCellValue(2, 1), TFormula).Result)

            'In this example both the workspace and the xls files are local objects, so we don't need to worry about memory
            'If any of them is a global object, remember that keeping a reference to it will keep a reference to *ALL* the
            'files in the workspace (even if you make Workspace = null). You might want to call Workspace.Clear() in that case before setting it to null.
        End Sub

        Private Sub Chart_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ChartA1.TextChanged, ChartB3.TextChanged, ChartA3.TextChanged, ChartB2.TextChanged, ChartA2.TextChanged, ChartB1.TextChanged
            'Again, loading the file each time we press a key is incredibly silly. But for this example is ok,
            'since loading the files is what we actually want to show.

            Dim TemplatePath As String = Path.Combine(Path.Combine(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), ".."), "..")
            Dim xlsChart As New XlsFile()
            xlsChart.Open(Path.Combine(TemplatePath, "Chart.xls"))

            'Create a Workspace.
            'Note that if we didn't create this workspace, the chart would not show, since it wouldn't be able to
            'find the linked file. You can verify it by commenting the following lines
            Dim Workspace As New TWorkspace()
            Workspace.Add("Chart.xls", xlsChart) 'We always need to have the main file in the workspace.

            'The best thing here would be to also add "ChartData.xls" to the workspace, since we already know which file we need.
            'But since we already saw how to do that in the other example in this demo, we are going to pretend we don't know which files
            'we need, and load them on demand.
            'NOTE: DON'T LOAD FILES ON DEMAND UNLESS YOU REALLY NEED TO, SINCE YOU MIGHT BE CREATING A SECURITY RISK. Read the API GUIDE PDF for more information.
            AddHandler Workspace.LoadLinkedFile, AddressOf Workspace_LoadLinkedFile

            'Now that the Workspace is created, we can render the chart. We will use the code from "Render Objects" demo.
            If chartBox.Image IsNot Nothing Then
                chartBox.Image.Dispose()
            End If
            chartBox.Image = GetChart(xlsChart, 1) 'To do this well, we should name the chart, retrieve the object index and use it here.
                                                     'To see how this should be done, look at the Render Objects demo. Here we won't care about that, and just use "1" since we know the chart is the only object in the file.

        End Sub

        ''' <summary>
        ''' This event is used when there are linked files, to load them on demand.
        ''' </summary>
        Private Sub Workspace_LoadLinkedFile(ByVal sender As Object, ByVal e As LoadLinkedFileEventArgs)
            'In order to reduce the risk of opening any file, in this demo we are going to only open files in the same folder we are working on.
            Dim xls As New XlsFile()
            Dim TemplatePath As String = Path.Combine(Path.Combine(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), ".."), "..")
            xls.Open(Path.Combine(TemplatePath, Path.GetFileName(e.FileName)))

            e.Xls = xls

            'A normal event should end here. Since we need to change the values of the file we loaded in demand, we will do that here.
            xls.SetCellValue(4, 2, GetValue(ChartA1.Text))
            xls.SetCellValue(5, 2, GetValue(ChartA2.Text))
            xls.SetCellValue(6, 2, GetValue(ChartA3.Text))
            xls.SetCellValue(4, 3, GetValue(ChartB1.Text))
            xls.SetCellValue(5, 3, GetValue(ChartB2.Text))
            xls.SetCellValue(6, 3, GetValue(ChartB3.Text))
        End Sub

        'This code is from the "Render objects" demo, and returns the image of a chart.
        Private Function GetChart(ByVal Xls As ExcelFile, ByVal ChartIndex As Integer) As Image
            Dim ChartProps As TShapeProperties = Xls.GetObjectProperties(ChartIndex, True)

            'We could get the chart with the following command,
            'but it would be fixed size. In this example we are going to be a little more complex.

            'Xls.RenderObject(ChartIndex);

            'A more complex way to retrieve the chart, to show how to use
            'all parameters in renderobject.

            Dim ImageDimensions As TUIRectangle
            Dim Origin As TPointF
            Dim SizePixels As TUISize

            'First calculate the chart dimensions without actually rendering it. This is fast.
            Xls.RenderObject(ChartIndex, 96, ChartProps, SmoothingMode.AntiAlias, InterpolationMode.HighQualityBicubic, True, False, Origin, ImageDimensions, SizePixels)

            Dim dpi As Single = 96 'default screen resolution
            If SizePixels.Height > 0 AndAlso SizePixels.Width > 0 Then
                Dim AspectX As Double = CDbl(chartBox.Width) / SizePixels.Width
                Dim AspectY As Double = CDbl(chartBox.Height) / SizePixels.Height

                Dim Aspect As Double = Math.Max(AspectX, AspectY)
                'Make the dpi adjust the screen resolution and the size of the form.
                dpi = CSng(96 * Aspect)
                If dpi < 20 Then
                    dpi = 20
                End If
                If dpi > 500 Then
                    dpi = 500
                End If
            End If

            Return Xls.RenderObject(ChartIndex, dpi, ChartProps, SmoothingMode.AntiAlias, InterpolationMode.HighQualityBicubic, True, True, Origin, ImageDimensions, SizePixels)

        End Function

    End Class

End Namespace

Program.vb

Namespace RecalculationOfLinkedFiles
    Friend NotInheritable Class Program

        Private Sub New()
        End Sub

        ''' <summary>
        ''' The main entry point for the application.
        ''' </summary>
       <STAThread> _
        Shared Sub Main()
            Application.EnableVisualStyles()
            Application.SetCompatibleTextRenderingDefault(False)
            Application.Run(New mainForm())
        End Sub
    End Class
End Namespace


Excel user defined functions (UDF) (VB.Net / netframework) | FlexCel Studio for the .NET Framework documentation

Excel user defined functions (UDF) (VB.Net / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\vb\VS2022\netframework\10.API\78.Excel User Defined Functions and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​vb/​VS2022/​netframework/​Modules/​10.​API/​78.​Excel User Defined Functions

Overview

Here we will explore how to handle Excel files with UDFs. FlexCel has full support for adding Excel UDFs to cells, retrieving UDFs from cells or recalculating files containing UDFs. But you need to create .NET functions that will mimic the UDF behavior, and add them to the FlexCel recalculation engine.

Make sure you read Using Excel's User-defined Functions (UDF) in the API developers guide for a conceptual explanation of what we are doing here.

Concepts

  • How to recalculate a sheet containing User Defined Functions (UDfs).

  • How to read and write UDFs from and to an Excel file.

  • In order to compare the results calculated by Excel and By FlexCel, this demo will save two files: one pdf (that will not use Excel recalculation) and one xls (that will be recalculated by Excel when opened).

Files

AssemblyInfo.vb

Imports System.Reflection
Imports System.Runtime.CompilerServices

'
' General Information about an assembly is controlled through the following
' set of attributes. Change these attribute values to modify the information
' associated with an assembly.
'
<Assembly: AssemblyTitle("")>
<Assembly: AssemblyDescription("")>
<Assembly: AssemblyConfiguration("")>
<Assembly: AssemblyCompany("")>
<Assembly: AssemblyProduct("")>
<Assembly: AssemblyCopyright("(c) 2002 - 2014 TMS Software")>
<Assembly: AssemblyTrademark("")>
<Assembly: AssemblyCulture("")>

'
' Version information for an assembly consists of the following four values:
'
'      Major Version
'      Minor Version
'      Build Number
'      Revision
'
' You can specify all the values or you can default the Revision and Build Numbers
' by using the '*' as shown below:

<Assembly: AssemblyVersion("6.2.1.0")>

'
' In order to sign your assembly you must specify a key to use. Refer to the
' Microsoft .NET Framework documentation for more information on assembly signing.
'
' Use the attributes below to control which key is used for signing.
'
' Notes:
'   (*) If no key is specified, the assembly is not signed.
'   (*) KeyName refers to a key that has been installed in the Crypto Service
'       Provider (CSP) on your machine. KeyFile refers to a file which contains
'       a key.
'   (*) If the KeyFile and the KeyName values are both specified, the
'       following processing occurs:
'       (1) If the KeyName can be found in the CSP, that key is used.
'       (2) If the KeyName does not exist and the KeyFile does exist, the key
'           in the KeyFile is installed into the CSP and used.
'   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
'       When specifying the KeyFile, the location of the KeyFile should be
'       relative to the project output directory which is
'       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
'       located in the project directory, you would specify the AssemblyKeyFile
'       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
'   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
'       documentation for more information on this.
'
<Assembly: AssemblyDelaySign(False)>
<Assembly: AssemblyKeyFile("")>
<Assembly: AssemblyKeyName("")>

Form1.Designer.vb

Imports System.Collections
Imports System.ComponentModel
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports System.IO
Imports System.Reflection
Imports System.Text
Imports FlexCel.Render
Namespace ExcelUserDefinedFunctions
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        ''' <summary>
        ''' Required designer variable.
        ''' </summary>
        Private components As System.ComponentModel.Container = Nothing

        ''' <summary>
        ''' Clean up any resources being used.
        ''' </summary>
        Protected Overrides Sub Dispose(ByVal disposing As Boolean)
            If disposing Then
                If components IsNot Nothing Then
                    components.Dispose()
                End If
            End If
            MyBase.Dispose(disposing)
        End Sub

        #Region "Windows Form Designer generated code"
        ''' <summary>
        ''' Required method for Designer support - do not modify
        ''' the contents of this method with the code editor.
        ''' </summary>
        Private Sub InitializeComponent()
            Me.button1 = New System.Windows.Forms.Button()
            Me.saveFileDialog1 = New System.Windows.Forms.SaveFileDialog()
            Me.label1 = New System.Windows.Forms.Label()
            Me.SuspendLayout()
            '
            ' button1
            '
            Me.button1.Anchor = System.Windows.Forms.AnchorStyles.Bottom
            Me.button1.Location = New System.Drawing.Point(132, 73)
            Me.button1.Name = "button1"
            Me.button1.TabIndex = 0
            Me.button1.Text = "GO!"
'           Me.button1.Click += New System.EventHandler(Me.button1_Click)
            '
            ' saveFileDialog1
            '
            Me.saveFileDialog1.Filter = "Pdf Files|*.pdf"
            Me.saveFileDialog1.RestoreDirectory = True
            Me.saveFileDialog1.Title = "The Application will save BOTH AN XLS AND A PDF file in this folder"
            '
            ' label1
            '
            Me.label1.Anchor = (CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) Or System.Windows.Forms.AnchorStyles.Left) Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.label1.BackColor = System.Drawing.Color.FromArgb((CByte(255)), (CByte(255)), (CByte(192)))
            Me.label1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
            Me.label1.Location = New System.Drawing.Point(16, 16)
            Me.label1.Name = "label1"
            Me.label1.Size = New System.Drawing.Size(312, 32)
            Me.label1.TabIndex = 1
            Me.label1.Text = "A  demo on how to handle Excel UDFs with the API."
            '
            ' mainForm
            '
            Me.AutoScaleDimensions = New System.Drawing.SizeF(6F, 13F)
            Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
            Me.ClientSize = New System.Drawing.Size(336, 110)
            Me.Controls.Add(Me.label1)
            Me.Controls.Add(Me.button1)
            Me.Name = "mainForm"
            Me.Text = "Excel User Defined Functions"
            Me.ResumeLayout(False)

        End Sub
        #End Region

        Private WithEvents button1 As System.Windows.Forms.Button
        Private saveFileDialog1 As System.Windows.Forms.SaveFileDialog
        Private label1 As System.Windows.Forms.Label
    End Class
End Namespace

Form1.vb

Imports System.Collections
Imports System.ComponentModel
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports System.IO
Imports System.Reflection
Imports System.Text

Imports FlexCel.Render

Namespace ExcelUserDefinedFunctions
    ''' <summary>
    ''' An example on how to recalculate user defined functions.
    ''' </summary>
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Public Sub New()
            InitializeComponent()
        End Sub

        Private ReadOnly Property PathToExe() As String
            Get
                Return Path.Combine(Path.Combine(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), ".."), "..") & Path.DirectorySeparatorChar
            End Get
        End Property

        ''' <summary>
        ''' Loads the user defined functions into the Excel recalculating engine.
        ''' </summary>
        ''' <param name="Xls"></param>
        Private Sub LoadUdfs(ByVal Xls As ExcelFile)
            Xls.AddUserDefinedFunction(TUserDefinedFunctionScope.Local, TUserDefinedFunctionLocation.Internal, New SumCellsWithSameColor())
            Xls.AddUserDefinedFunction(TUserDefinedFunctionScope.Local, TUserDefinedFunctionLocation.Internal, New IsPrime())
            Xls.AddUserDefinedFunction(TUserDefinedFunctionScope.Local, TUserDefinedFunctionLocation.Internal, New BoolChoose())
            Xls.AddUserDefinedFunction(TUserDefinedFunctionScope.Local, TUserDefinedFunctionLocation.Internal, New Lowest())
        End Sub

        Private Sub AddData(ByVal Xls As ExcelFile)
            LoadUdfs(Xls) 'Register our custom functions. As we are using a local scope, we need to register them each time.

            Xls.Open(Path.Combine(PathToExe, "udfs.xls")) 'Open the file we want to manipulate.

            'Fill the cell range with other values so we can see how the sheet is recalculated by FlexCel.
            Dim Data As TXlsCellRange = Xls.GetNamedRange("Data", -1)
            For r As Integer = Data.Top To Data.Bottom - 1
                Xls.SetCellValue(r, Data.Left, r - Data.Top)
            Next r

            'Add an UDF to the sheet. We can enter the fucntion "BoolChoose" here because it was registered into FlexCel in LoadUDF()
            'If it hadn't been registered, this line would raise an Exception of an unknown function.
            Dim FmlaText As String = "=BoolChoose(TRUE,""This formula was entered with FlexCel!"",""It shouldn't display this"")"
            Xls.SetCellValue(11, 1, New TFormula(FmlaText))

            'Verify the UDF entered is correct. We can read any udf from Excel, even if it is not registered with AddUserDefinedFunction.
            Dim o As Object = Xls.GetCellValue(11, 1)
            Dim fm As TFormula = TryCast(o, TFormula)
            Debug.Assert(fm IsNot Nothing, "The cell must contain a formula")
            If fm IsNot Nothing Then
                Debug.Assert(fm.Text = FmlaText, "Error in Formula: It should be """ & FmlaText & """ and it is """ & fm.Text & """")
            End If

            'Recalc the sheet. As we are not saving it yet, we ned to make a manual recalc.
            Xls.Recalc()

            'Export the file to PDF so we can see the values calculated by FlexCel without Excel recalculating them.
            Using pdf As New FlexCelPdfExport(Xls, True)
                pdf.Export(saveFileDialog1.FileName)
            End Using

            'Save the file as xls too so we can compare.
            Xls.Save(Path.ChangeExtension(saveFileDialog1.FileName, "xls"))
        End Sub

        Private Sub button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button1.Click
            AutoRun()
        End Sub

        Public Sub AutoRun()
            If saveFileDialog1.ShowDialog() <> System.Windows.Forms.DialogResult.OK Then
                Return
            End If
            Dim Xls As ExcelFile = New XlsFile(True)
            AddData(Xls)
            If MessageBox.Show("Do you want to open the generated files (PDF and XLS)?", "Confirm", MessageBoxButtons.YesNo) = System.Windows.Forms.DialogResult.Yes Then
                Process.Start(saveFileDialog1.FileName)
                Process.Start(Path.ChangeExtension(saveFileDialog1.FileName, "xls"))
            End If

        End Sub

        ''' <summary>
        ''' This is the method that will be called by the ASP.NET front end. It returns an array of bytes
        ''' with the report data, so the ASP.NET application can stream it to the client.
        ''' </summary>
        ''' <returns>The generated file as a byte array.</returns>
        Public Function WebRun() As Byte()
            Dim Xls As ExcelFile = New XlsFile(True)
            AddData(Xls)

            Using OutStream As New MemoryStream()
                Xls.Save(OutStream)
                Return OutStream.ToArray()
            End Using
        End Function
    End Class

    #Region "UDF definitions"
    ''' <summary>
    ''' Implements a custom function that will sum the cells in a range that have the same
    ''' color of the source cell. This function mimics the VBA macro in the example, so when
    ''' recalculating the sheet with FlexCel you will get the same results as with Excel.
    ''' </summary>
    Public Class SumCellsWithSameColor
        Inherits TUserDefinedFunction

        ''' <summary>
        ''' Creates a new instance and registers the class in the FlexCel recalculating engine as "SumCellsWithSameColor".
        ''' </summary>
        Public Sub New()
            MyBase.New("SumCellsWithSameColor")
        End Sub

        ''' <summary>
        ''' Returns the sum of cells in a range that have the same color as a reference cell.
        ''' </summary>
        ''' <param name="arguments"></param>
        ''' <param name="parameters">In this case we expect 2 parameters, first the reference cell and then
        ''' the range in which to sum. We will return an error otherwise.</param>
        ''' <returns></returns>
        Public Overrides Function Evaluate(ByVal arguments As TUdfEventArgs, ByVal parameters() As Object) As Object
'           #Region "Get Parameters"
            Dim Err As TFlxFormulaErrorValue
            If Not CheckParameters(parameters, 2, Err) Then
                Return Err
            End If

            'The first parameter should be a range
            Dim SourceCell As TXls3DRange = Nothing
            If Not TryGetCellRange(parameters(0), SourceCell, Err) Then
                Return Err
            End If

            'The second parameter should be a range too.
            Dim SumRange As TXls3DRange = Nothing
            If Not TryGetCellRange(parameters(1), SumRange, Err) Then
                Return Err
            End If
'           #End Region

            'Get the color in SourceCell. Note that if Source cell is a range with more than one cell,
            'we will use the first cell in the range. Also, as different colors can have the same rgb value, we will compare the actual RGB values, not the ExcelColors
            Dim fmt As TFlxFormat = arguments.Xls.GetCellVisibleFormatDef(SourceCell.Sheet1, SourceCell.Top, SourceCell.Left)
            Dim SourceColor As Integer = fmt.FillPattern.FgColor.ToColor(arguments.Xls).ToArgb()

            Dim Result As Double = 0
            'Loop in the sum range and sum the corresponding values.
            For s As Integer = SumRange.Sheet1 To SumRange.Sheet2
                For r As Integer = SumRange.Top To SumRange.Bottom
                    For c As Integer = SumRange.Left To SumRange.Right
                        Dim XF As Integer = -1
                        Dim val As Object = arguments.Xls.GetCellValue(s, r, c, XF)
                        If TypeOf val Is Double Then 'we will only sum numeric values.
                            Dim sumfmt As TFlxFormat = arguments.Xls.GetCellVisibleFormatDef(s, r, c)
                            If sumfmt.FillPattern.FgColor.ToColor(arguments.Xls).ToArgb() = SourceColor Then
                                Result += CDbl(val)
                            End If
                        End If
                    Next c
                Next r
            Next s
            Return Result
        End Function
    End Class

    ''' <summary>
    ''' Implements a custom function that will return true if a number is prime.
    ''' This function mimics the VBA macro in the example, so when
    ''' recalculating the sheet with FlexCel you will get the same results as with Excel.
    ''' </summary>
    Public Class IsPrime
        Inherits TUserDefinedFunction

        ''' <summary>
        ''' Creates a new instance and registers the class in the FlexCel recalculating engine as "IsPrime".
        ''' </summary>
        Public Sub New()
            MyBase.New("IsPrime")
        End Sub

        ''' <summary>
        ''' Returns true if a number is prime.
        ''' </summary>
        ''' <param name="arguments"></param>
        ''' <param name="parameters">In this case we expect 1 parameter with the number. We will return an error otherwise.</param>
        ''' <returns></returns>
        Public Overrides Function Evaluate(ByVal arguments As TUdfEventArgs, ByVal parameters() As Object) As Object
'           #Region "Get Parameters"
            Dim Err As TFlxFormulaErrorValue
            If Not CheckParameters(parameters, 1, Err) Then
                Return Err
            End If

            'The parameter should be a double or a range.
            Dim Number As Double
            If Not TryGetDouble(arguments.Xls, parameters(0), Number, Err) Then
                Return Err
            End If
'           #End Region

            'Return true if the number is prime.
            Dim n As Integer = Convert.ToInt32(Number)
            If n = 2 Then
                Return True
            End If
            If n < 2 OrElse n Mod 2 = 0 Then
                Return False
            End If
            For i As Integer = 3 To Convert.ToInt32(Fix(Math.Sqrt(n))) Step 2
                If n Mod i = 0 Then
                    Return False
                End If
            Next i
            Return True
        End Function
    End Class

    ''' <summary>
    ''' Implements a custom function that will choose between two different strings.
    ''' This function mimics the VBA macro in the example, so when
    ''' recalculating the sheet with FlexCel you will get the same results as with Excel.
    ''' </summary>
    Public Class BoolChoose
        Inherits TUserDefinedFunction

        ''' <summary>
        ''' Creates a new instance and registers the class in the FlexCel recalculating engine as "BoolChoose".
        ''' </summary>
        Public Sub New()
            MyBase.New("BoolChoose")
        End Sub

        ''' <summary>
        ''' Chooses between 2 different strings.
        ''' </summary>
        ''' <param name="arguments"></param>
        ''' <param name="parameters">In this case we expect 3 parameters: The first is a boolean, and the other 2 strings. We will return an error otherwise.</param>
        ''' <returns></returns>
        Public Overrides Function Evaluate(ByVal arguments As TUdfEventArgs, ByVal parameters() As Object) As Object
'           #Region "Get Parameters"
            Dim Err As TFlxFormulaErrorValue
            If Not CheckParameters(parameters, 3, Err) Then
                Return Err
            End If

            'The first parameter should be a boolean.
            Dim ChooseFirst As Boolean
            If Not TryGetBoolean(arguments.Xls, parameters(0), ChooseFirst, Err) Then
                Return Err
            End If

            'The second parameter should be a string.
            Dim s1 As String = Nothing
            If Not TryGetString(arguments.Xls, parameters(1), s1, Err) Then
                Return Err
            End If

            'The third parameter should be a string.
            Dim s2 As String = Nothing
            If Not TryGetString(arguments.Xls, parameters(2), s2, Err) Then
                Return Err
            End If
'           #End Region

            'Return s1 or s2 depending on ChooseFirst
            If ChooseFirst Then
                Return s1
            Else
                Return s2
            End If
        End Function
    End Class

    ''' <summary>
    ''' Implements a custom function that will choose the lowest member in an array.
    ''' This function mimics the VBA macro in the example, so when
    ''' recalculating the sheet with FlexCel you will get the same results as with Excel.
    ''' </summary>
    Public Class Lowest
        Inherits TUserDefinedFunction

        ''' <summary>
        ''' Creates a new instance and registers the class in the FlexCel recalculating engine as "Lowest".
        ''' </summary>
        Public Sub New()
            MyBase.New("Lowest")
        End Sub

        ''' <summary>
        ''' Chooses the lowest element in an array.
        ''' </summary>
        ''' <param name="arguments"></param>
        ''' <param name="parameters">In this case we expect 1 parameter that should be an array. We will return an error otherwise.</param>
        ''' <returns></returns>
        Public Overrides Function Evaluate(ByVal arguments As TUdfEventArgs, ByVal parameters() As Object) As Object
'           #Region "Get Parameters"
            Dim Err As TFlxFormulaErrorValue
            If Not CheckParameters(parameters, 1, Err) Then
                Return Err
            End If

            'The first parameter should be an array.
            Dim SourceArray(,) As Object = Nothing
            If Not TryGetArray(arguments.Xls, parameters(0), SourceArray, Err) Then
                Return Err
            End If
'           #End Region

            Dim Result As Double = 0
            Dim First As Boolean = True
            For Each o As Object In SourceArray
                If TypeOf o Is Double Then
                    If First Then
                        First = False
                        Result = CDbl(o)
                    Else
                        If CDbl(o) < Result Then
                            Result = CDbl(o)
                        End If
                    End If
                Else
                    Return TFlxFormulaErrorValue.ErrValue
                End If
            Next o

            Return Result
        End Function

    End Class
    #End Region

End Namespace

Program.vb

Namespace ExcelUserDefinedFunctions
    Friend NotInheritable Class Program

        Private Sub New()
        End Sub

        ''' <summary>
        ''' The main entry point for the application.
        ''' </summary>
       <STAThread> _
        Shared Sub Main()
            Application.EnableVisualStyles()
            Application.SetCompatibleTextRenderingDefault(False)
            Application.Run(New mainForm())
        End Sub
    End Class
End Namespace


Consolidating files (VB.Net / netframework) | FlexCel Studio for the .NET Framework documentation

Consolidating files (VB.Net / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\vb\VS2022\netframework\10.API\80.Consolidating Files and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​vb/​VS2022/​netframework/​Modules/​10.​API/​80.​Consolidating Files

Overview

The FlexCel API is oriented to modifying files, instead of reading and creating files as different things. So, some most important commands on it are ExcelFile.InsertAndCopyRange and ExcelFile.DeleteRange, that copy and delete ranges on existing sheets.

This is a real-world example on how you can use ExcelFile.InsertAndCopyRange to copy the first sheet of many different Excel files into one big file.

Concepts

  • You can use ExcelFile.InsertAndCopyRange and/or ExcelFile.InsertAndCopySheets to copy ranges across different files. Even when it is not as complete as copying from the same file, it does copy most of the things.

  • ExcelFile.InsertAndCopyRange behaves the same way as Excel. That is, if you copy whole rows, the row height and format will be copied, not only the values. The same happens with columns, only when copying full columns the format and width will be copied to the destination. On this demo, we want to copy all Column and Row format, so we have to select the whole sheet. If we selected a smaller range, say (1,1,65535,255) instead of (1,1,65536,256) no full column or full row would be selected and not column or row format would be copied.

  • If the sheets you are copying have formulas or names with references to other files or sheets, you might not get the expected results. You could use ExcelFile.ConvertFormulasToValues and ExcelFile.ConvertFormulasToValues

Files

AssemblyInfo.vb

Imports System.Reflection
Imports System.Runtime.CompilerServices

'
' General Information about an assembly is controlled through the following
' set of attributes. Change these attribute values to modify the information
' associated with an assembly.
'
<Assembly: AssemblyTitle("")>
<Assembly: AssemblyDescription("")>
<Assembly: AssemblyConfiguration("")>
<Assembly: AssemblyCompany("")>
<Assembly: AssemblyProduct("")>
<Assembly: AssemblyCopyright("(c) 2002 - 2014 TMS Software")>
<Assembly: AssemblyTrademark("")>
<Assembly: AssemblyCulture("")>

'
' Version information for an assembly consists of the following four values:
'
'      Major Version
'      Minor Version
'      Build Number
'      Revision
'
' You can specify all the values or you can default the Revision and Build Numbers
' by using the '*' as shown below:

<Assembly: AssemblyVersion("6.2.1.0")>

'
' In order to sign your assembly you must specify a key to use. Refer to the
' Microsoft .NET Framework documentation for more information on assembly signing.
'
' Use the attributes below to control which key is used for signing.
'
' Notes:
'   (*) If no key is specified, the assembly is not signed.
'   (*) KeyName refers to a key that has been installed in the Crypto Service
'       Provider (CSP) on your machine. KeyFile refers to a file which contains
'       a key.
'   (*) If the KeyFile and the KeyName values are both specified, the
'       following processing occurs:
'       (1) If the KeyName can be found in the CSP, that key is used.
'       (2) If the KeyName does not exist and the KeyFile does exist, the key
'           in the KeyFile is installed into the CSP and used.
'   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
'       When specifying the KeyFile, the location of the KeyFile should be
'       relative to the project output directory which is
'       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
'       located in the project directory, you would specify the AssemblyKeyFile
'       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
'   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
'       documentation for more information on this.
'
<Assembly: AssemblyDelaySign(False)>
<Assembly: AssemblyKeyFile("")>
<Assembly: AssemblyKeyName("")>

Form1.Designer.vb

Imports System.Collections
Imports System.ComponentModel
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports System.IO
Imports System.Reflection
Namespace ConsolidatingFiles
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Private WithEvents button1 As System.Windows.Forms.Button
        Private saveFileDialog1 As System.Windows.Forms.SaveFileDialog
        Private label1 As System.Windows.Forms.Label
        Private openFileDialog1 As System.Windows.Forms.OpenFileDialog
        Private label2 As System.Windows.Forms.Label
        Private cbOnlyData As System.Windows.Forms.CheckBox
        ''' <summary>
        ''' Required designer variable.
        ''' </summary>
        Private components As System.ComponentModel.Container = Nothing

        ''' <summary>
        ''' Clean up any resources being used.
        ''' </summary>
        Protected Overrides Sub Dispose(ByVal disposing As Boolean)
            If disposing Then
                If components IsNot Nothing Then
                    components.Dispose()
                End If
            End If
            MyBase.Dispose(disposing)
        End Sub

        #Region "Windows Form Designer generated code"
        ''' <summary>
        ''' Required method for Designer support - do not modify
        ''' the contents of this method with the code editor.
        ''' </summary>
        Private Sub InitializeComponent()
            Me.button1 = New System.Windows.Forms.Button()
            Me.saveFileDialog1 = New System.Windows.Forms.SaveFileDialog()
            Me.label1 = New System.Windows.Forms.Label()
            Me.openFileDialog1 = New System.Windows.Forms.OpenFileDialog()
            Me.label2 = New System.Windows.Forms.Label()
            Me.cbOnlyData = New System.Windows.Forms.CheckBox()
            Me.SuspendLayout()
            '
            ' button1
            '
            Me.button1.Anchor = System.Windows.Forms.AnchorStyles.Bottom
            Me.button1.Location = New System.Drawing.Point(180, 152)
            Me.button1.Name = "button1"
            Me.button1.TabIndex = 0
            Me.button1.Text = "GO!"
'           Me.button1.Click += New System.EventHandler(Me.button1_Click)
            '
            ' saveFileDialog1
            '
            Me.saveFileDialog1.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm|Excel 97/2003|*.xls|Excel 2007|*.xlsx;*.xlsm|All files|*.*"
            Me.saveFileDialog1.RestoreDirectory = True
            '
            ' label1
            '
            Me.label1.Anchor = (CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) Or System.Windows.Forms.AnchorStyles.Left) Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.label1.BackColor = System.Drawing.Color.FromArgb((CByte(255)), (CByte(255)), (CByte(192)))
            Me.label1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
            Me.label1.Location = New System.Drawing.Point(16, 16)
            Me.label1.Name = "label1"
            Me.label1.Size = New System.Drawing.Size(408, 32)
            Me.label1.TabIndex = 1
            Me.label1.Text = "A demo on how to consolidate several files into one."
            '
            ' openFileDialog1
            '
            Me.openFileDialog1.DefaultExt = "xls"
            Me.openFileDialog1.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm|Excel 97/2003|*.xls|Excel 2007|*.xlsx;*.xlsm|All files|*.*"
            Me.openFileDialog1.Multiselect = True
            Me.openFileDialog1.Title = "Select ALL the files you want to consolidate."
            '
            ' label2
            '
            Me.label2.Anchor = (CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) Or System.Windows.Forms.AnchorStyles.Left) Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.label2.BackColor = System.Drawing.Color.White
            Me.label2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
            Me.label2.Location = New System.Drawing.Point(16, 64)
            Me.label2.Name = "label2"
            Me.label2.Size = New System.Drawing.Size(408, 32)
            Me.label2.TabIndex = 2
            Me.label2.Text = "After pressing the button, multi-select all the files you want with ctrl and shif" & "t."
            '
            ' cbOnlyData
            '
            Me.cbOnlyData.Location = New System.Drawing.Point(24, 112)
            Me.cbOnlyData.Name = "cbOnlyData"
            Me.cbOnlyData.Size = New System.Drawing.Size(344, 24)
            Me.cbOnlyData.TabIndex = 3
            Me.cbOnlyData.Text = "Copy only data. (dont copy margins zoom, etc)"
            '
            ' mainForm
            '
            Me.AutoScaleDimensions = New System.Drawing.SizeF(6F, 13F)
            Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
            Me.ClientSize = New System.Drawing.Size(432, 197)
            Me.Controls.Add(Me.cbOnlyData)
            Me.Controls.Add(Me.label2)
            Me.Controls.Add(Me.label1)
            Me.Controls.Add(Me.button1)
            Me.Name = "mainForm"
            Me.Text = "Form1"
            Me.ResumeLayout(False)

        End Sub
        #End Region
    End Class
End Namespace

Form1.vb

Imports System.Collections
Imports System.ComponentModel
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports System.IO
Imports System.Reflection

Namespace ConsolidatingFiles
    ''' <summary>
    ''' A demo on how to copy many sheets from different files into one file.
    ''' </summary>
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Public Sub New()
            InitializeComponent()
        End Sub

        ''' <summary>
        ''' This is the method that will be called by the ASP.NET front end. It returns an array of bytes
        ''' with the report data, so the ASP.NET application can stream it to the client.
        ''' </summary>
        ''' <param name="fileDatas"></param>
        ''' <param name="fileNames"></param>
        ''' <param name="OnlyData"></param>
        ''' <returns>The generated file as a byte array.</returns>
        Public Function WebRun(ByVal fileDatas() As Stream, ByVal fileNames() As String, ByVal OnlyData As Boolean) As Byte()
            If fileNames.Length <= 0 Then
                Throw New ApplicationException("You must select at least one file")
            End If

            Dim XlsOut As ExcelFile = Consolidate(fileDatas, fileNames, OnlyData)

            Using OutStream As New MemoryStream()
                XlsOut.Save(OutStream)
                Return OutStream.ToArray()
            End Using

        End Function

        Private Function Consolidate(ByVal fileDatas() As Stream, ByVal fileNames() As String, ByVal OnlyData As Boolean) As ExcelFile
            Dim XlsIn As ExcelFile = New XlsFile()
            Dim XlsOut As ExcelFile = New XlsFile(True)
            XlsOut.NewFile(1, TExcelFileFormat.v2019)

            If fileNames.Length > 1 AndAlso cbOnlyData.Checked Then
                XlsOut.InsertAndCopySheets(1, 2, fileNames.Length - 1)
            End If

            For i As Integer = 0 To fileNames.Length - 1
                If fileDatas IsNot Nothing Then
                    XlsIn.Open(fileDatas(i))
                Else
                    XlsIn.Open(fileNames(i))
                End If
                XlsIn.ConvertFormulasToValues(True) 'If there is any formula referring to other sheet, convert it to value.
                                                     'We could also call an overloaded version of InsertAndCopySheets() that
                                                     'copies many sheets at the same time, so references are kept.
                XlsOut.ActiveSheet = i + 1

                If OnlyData Then
                    XlsOut.InsertAndCopyRange(TXlsCellRange.FullRange(), 1, 1, 1, TFlxInsertMode.ShiftRangeDown, TRangeCopyMode.All, XlsIn, 1)
                Else
                    XlsOut.InsertAndCopySheets(1, XlsOut.ActiveSheet, 1, XlsIn)
                End If

                'Change sheet name.
                Dim s As String = Path.GetFileName(fileNames(i))
                If s.Length > 32 Then
                    XlsOut.SheetName = s.Substring(0, 29) & "..."
                Else
                    XlsOut.SheetName = s
                End If

            Next i

            If Not cbOnlyData.Checked Then
                XlsOut.ActiveSheet = XlsOut.SheetCount
                XlsOut.DeleteSheet(1) 'Remove the empty sheet that came with the workbook.
            End If

            XlsOut.ActiveSheet = 1
            Return XlsOut
        End Function

        Private Sub button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button1.Click
            If openFileDialog1.ShowDialog() <> System.Windows.Forms.DialogResult.OK Then
                Return
            End If
            Dim fileNames() As String = openFileDialog1.FileNames
            If fileNames.Length <= 0 Then
                MessageBox.Show("You must select at least one file")
                Return
            End If

            Dim XlsOut As ExcelFile = Consolidate(Nothing, fileNames, cbOnlyData.Checked)

            If saveFileDialog1.ShowDialog() = System.Windows.Forms.DialogResult.OK Then
                XlsOut.Save(saveFileDialog1.FileName)

                If MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) = System.Windows.Forms.DialogResult.Yes Then
                    Process.Start(saveFileDialog1.FileName)
                End If
            End If

        End Sub
    End Class
End Namespace

Program.vb

Namespace ConsolidatingFiles
    Friend NotInheritable Class Program

        Private Sub New()
        End Sub

        ''' <summary>
        ''' The main entry point for the application.
        ''' </summary>
       <STAThread> _
        Shared Sub Main()
            Application.EnableVisualStyles()
            Application.SetCompatibleTextRenderingDefault(False)
            Application.Run(New mainForm())
        End Sub
    End Class
End Namespace


Creating pdf files with the PDF API (VB.Net / netframework) | FlexCel Studio for the .NET Framework documentation

Creating pdf files with the PDF API (VB.Net / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\vb\VS2022\netframework\10.API\A0.Creating Pdf Files With PDF API and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​vb/​VS2022/​netframework/​Modules/​10.​API/​A0.​Creating Pdf Files With PDF API

Overview

Even when FlexCel is not a full featured PDF package, it does have a basic PDF API that you can use to create PDF files from scratch.

Concepts

  • How to create a PDF file using FlexCel's internal PDF API. The API is very similar to GDI+, and allows you to use a PDF "Canvas" where you can draw things in. To use the API, you need to use the class PdfWriter

  • The PDF API on FlexCel is designed to support exporting Excel documents to PDF using FlexCelPdfExport. But you can use the same API FlexCelPdfExport uses to create your own PDF files with code.

Files

AssemblyInfo.vb

Imports System.Reflection
Imports System.Runtime.CompilerServices

'
' General Information about an assembly is controlled through the following
' set of attributes. Change these attribute values to modify the information
' associated with an assembly.
'
<Assembly: AssemblyTitle("")>
<Assembly: AssemblyDescription("")>
<Assembly: AssemblyConfiguration("")>
<Assembly: AssemblyCompany("")>
<Assembly: AssemblyProduct("")>
<Assembly: AssemblyCopyright("(c) 2002 - 2014 TMS Software")>
<Assembly: AssemblyTrademark("")>
<Assembly: AssemblyCulture("")>

'
' Version information for an assembly consists of the following four values:
'
'      Major Version
'      Minor Version
'      Build Number
'      Revision
'
' You can specify all the values or you can default the Revision and Build Numbers
' by using the '*' as shown below:

<Assembly: AssemblyVersion("6.2.1.0")>

'
' In order to sign your assembly you must specify a key to use. Refer to the
' Microsoft .NET Framework documentation for more information on assembly signing.
'
' Use the attributes below to control which key is used for signing.
'
' Notes:
'   (*) If no key is specified, the assembly is not signed.
'   (*) KeyName refers to a key that has been installed in the Crypto Service
'       Provider (CSP) on your machine. KeyFile refers to a file which contains
'       a key.
'   (*) If the KeyFile and the KeyName values are both specified, the
'       following processing occurs:
'       (1) If the KeyName can be found in the CSP, that key is used.
'       (2) If the KeyName does not exist and the KeyFile does exist, the key
'           in the KeyFile is installed into the CSP and used.
'   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
'       When specifying the KeyFile, the location of the KeyFile should be
'       relative to the project output directory which is
'       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
'       located in the project directory, you would specify the AssemblyKeyFile
'       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
'   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
'       documentation for more information on this.
'
<Assembly: AssemblyDelaySign(False)>
<Assembly: AssemblyKeyFile("")>
<Assembly: AssemblyKeyName("")>

Form1.Designer.vb

Imports System.Collections
Imports System.ComponentModel
Imports FlexCel.Core
Imports FlexCel.Pdf
Imports System.IO
Imports System.Reflection
Imports System.Drawing.Drawing2D
Namespace CreatingPdfFilesWithPDFAPI
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Private WithEvents button1 As System.Windows.Forms.Button
        Private saveFileDialog1 As System.Windows.Forms.SaveFileDialog
        Private label1 As System.Windows.Forms.Label
        ''' <summary>
        ''' Required designer variable.
        ''' </summary>
        Private components As System.ComponentModel.Container = Nothing

        ''' <summary>
        ''' Clean up any resources being used.
        ''' </summary>
        Protected Overrides Sub Dispose(ByVal disposing As Boolean)
            If disposing Then
                If components IsNot Nothing Then
                    components.Dispose()
                End If
            End If
            MyBase.Dispose(disposing)
        End Sub

        #Region "Windows Form Designer generated code"
        ''' <summary>
        ''' Required method for Designer support - do not modify
        ''' the contents of this method with the code editor.
        ''' </summary>
        Private Sub InitializeComponent()
            Me.button1 = New System.Windows.Forms.Button()
            Me.saveFileDialog1 = New System.Windows.Forms.SaveFileDialog()
            Me.label1 = New System.Windows.Forms.Label()
            Me.SuspendLayout()
            '
            ' button1
            '
            Me.button1.Anchor = System.Windows.Forms.AnchorStyles.Bottom
            Me.button1.Location = New System.Drawing.Point(48, 160)
            Me.button1.Name = "button1"
            Me.button1.TabIndex = 0
            Me.button1.Text = "GO!"
'           Me.button1.Click += New System.EventHandler(Me.button1_Click)
            '
            ' saveFileDialog1
            '
            Me.saveFileDialog1.Filter = "Pdf Files|*.pdf"
            Me.saveFileDialog1.RestoreDirectory = True
            '
            ' label1
            '
            Me.label1.Anchor = (CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) Or System.Windows.Forms.AnchorStyles.Left) Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.label1.BackColor = System.Drawing.Color.FromArgb((CByte(255)), (CByte(255)), (CByte(192)))
            Me.label1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
            Me.label1.Location = New System.Drawing.Point(16, 16)
            Me.label1.Name = "label1"
            Me.label1.Size = New System.Drawing.Size(144, 80)
            Me.label1.TabIndex = 1
            Me.label1.Text = "A demo on how to create a PDF file with the PDF API."
            '
            ' mainForm
            '
            Me.AutoScaleDimensions = New System.Drawing.SizeF(6F, 13F)
            Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
            Me.ClientSize = New System.Drawing.Size(168, 197)
            Me.Controls.Add(Me.label1)
            Me.Controls.Add(Me.button1)
            Me.Name = "mainForm"
            Me.Text = "Form1"
            Me.ResumeLayout(False)

        End Sub
        #End Region
    End Class
End Namespace

Form1.vb

Imports System.Collections
Imports System.ComponentModel
Imports FlexCel.Core
Imports FlexCel.Pdf
Imports System.IO
Imports System.Reflection
Imports System.Drawing.Drawing2D

Namespace CreatingPdfFilesWithPDFAPI
    ''' <summary>
    ''' Jow to create PDF files directly with FlexCel.
    ''' </summary>
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Public Sub New()
            InitializeComponent()
        End Sub

        Private Sub button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button1.Click
            If saveFileDialog1.ShowDialog() <> System.Windows.Forms.DialogResult.OK Then
                Return
            End If

            Dim Underline As TUITextDecoration = New TUITextDecoration(TUIUnderline.Single)

            Dim pdf As New PdfWriter()

            Using file As New FileStream(saveFileDialog1.FileName, FileMode.Create)
                pdf.Compress = True
                pdf.BeginDoc(file)
                pdf.YAxisGrowsDown = True 'To keep it compatible with GDI+
                Using f As TUIFont = TUIFont.Create("times new roman", CSng(22.5), TUIFontStyle.Italic)
                    Using f2 As TUIFont = TUIFont.Create("Arial", CSng(12), TUIFontStyle.Italic)
                        pdf.DrawString("This is the first line on a test of many lines.", f, Underline, Brushes.Navy, 100, 100)
                        pdf.DrawString("Some unicode: " & ChrW(&HE2A).ToString() & ChrW(&HE27).ToString() & ChrW(&HE31).ToString() & ChrW(&HE2A).ToString() & ChrW(&HE14).ToString() & ChrW(&HE35).ToString(), f, Underline, Brushes.ForestGreen, 100, 200)
                        pdf.DrawString("More lines here!", f, Underline, Brushes.ForestGreen, 200, 300)
                        pdf.DrawString("And this is the last line.", f, Underline, Brushes.Black, 200, 400)
                        pdf.Properties.Author = "Adrian"
                        pdf.Properties.Title = "This is a test of FlexCel Api"
                        pdf.Properties.Keywords = "test" & vbLf & "flexcel" & vbLf & "api"
                        pdf.NewPage()
                        pdf.SaveState()
                        pdf.Rotate(200, 100, 45)
                        pdf.DrawString("Some rotated test", f, Underline, Brushes.Black, 200, 200)
                        pdf.RestoreState()
                        pdf.DrawString("Some NOT rotated text", f, Underline, Brushes.Black, 200, 200)
                        pdf.DrawString("Hello from FlexCel!", f2, Brushes.Black, 200, 50)

                        Dim points() As TPointF = { _
                            New TPointF(200, 100), _
                            New TPointF(200, 50), _
                            New TPointF(500, 50), _
                            New TPointF(700, 100) _
                        }
                        pdf.DrawLines(Pens.DarkOrchid, points)

                        Dim Coords As New RectangleF(100, 300, 100, 100)
                        Using Gradient As Brush = New LinearGradientBrush(Coords, Color.Red, Color.Blue, 0F)
                            pdf.DrawAndFillRectangle(Pens.Red, Gradient, 100, 300, 100, 100)
                        End Using
                        pdf.DrawRectangle(Pens.DarkSlateBlue, 100, 300, 50, 50)
                        pdf.DrawLine(Pens.Black, 100, 300, 200, 400)

                        Dim AssemblyPath As String = Path.GetDirectoryName(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location))
                        Using Img As Image = Image.FromFile(AssemblyPath & Path.DirectorySeparatorChar & ".." & Path.DirectorySeparatorChar & ".." & Path.DirectorySeparatorChar & "test.jpg")
                            pdf.DrawImage(Img, New RectangleF(200, 300, 200, 150), Nothing)
                        End Using
                        pdf.IntersectClipRegion(New RectangleF(100, 100, 50, 50))
                        pdf.FillRectangle(Brushes.DarkTurquoise, 100, 100, 100, 100)

                        pdf.EndDoc()
                    End Using
                End Using
            End Using
            If MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) = System.Windows.Forms.DialogResult.Yes Then
                Process.Start(saveFileDialog1.FileName)
            End If

        End Sub
    End Class
End Namespace

Program.vb

Namespace CreatingPdfFilesWithPDFAPI
    Friend NotInheritable Class Program

        Private Sub New()
        End Sub

        ''' <summary>
        ''' The main entry point for the application.
        ''' </summary>
       <STAThread> _
        Shared Sub Main()
            Application.EnableVisualStyles()
            Application.SetCompatibleTextRenderingDefault(False)
            Application.Run(New mainForm())
        End Sub
    End Class
End Namespace


Handling non-fatal errors (VB.Net / netframework) | FlexCel Studio for the .NET Framework documentation

Handling non-fatal errors (VB.Net / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\vb\VS2022\netframework\10.API\X0.Handling Errors and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​vb/​VS2022/​netframework/​Modules/​10.​API/​X0.​Handling Errors

Overview

On this demo we are going to see how to deal with errors that are not fatal and will normally be ignored, but that can degrade the generated files.

You can hook your own listener to the FlexCelTrace static class to gain control on what should be done when a non-fatal error happens.

Concepts

  • How to hook a listener to the static FlexCelTrace class. In a normal application you would just hook the listener at the beginning of the application. On this case, since our demo can be used standalone or from the MainDemo browser, we need to make sure we unhook the event when the form is disposed.

  • How to stop the file generation when a non-fatal error happens.

  • How we should take care of threading issues, since FlexCelTrace is a static class that could be called from more than one place.

  • How to ignore different types of errors.

Files

AssemblyInfo.vb

Imports System.Reflection
Imports System.Runtime.CompilerServices

'
' General Information about an assembly is controlled through the following
' set of attributes. Change these attribute values to modify the information
' associated with an assembly.
'
<Assembly: AssemblyTitle("")>
<Assembly: AssemblyDescription("")>
<Assembly: AssemblyConfiguration("")>
<Assembly: AssemblyCompany("")>
<Assembly: AssemblyProduct("")>
<Assembly: AssemblyCopyright("(c) 2002 - 2014 TMS Software")>
<Assembly: AssemblyTrademark("")>
<Assembly: AssemblyCulture("")>

'
' Version information for an assembly consists of the following four values:
'
'      Major Version
'      Minor Version
'      Build Number
'      Revision
'
' You can specify all the values or you can default the Revision and Build Numbers
' by using the '*' as shown below:

<Assembly: AssemblyVersion("6.2.1.0")>

'
' In order to sign your assembly you must specify a key to use. Refer to the
' Microsoft .NET Framework documentation for more information on assembly signing.
'
' Use the attributes below to control which key is used for signing.
'
' Notes:
'   (*) If no key is specified, the assembly is not signed.
'   (*) KeyName refers to a key that has been installed in the Crypto Service
'       Provider (CSP) on your machine. KeyFile refers to a file which contains
'       a key.
'   (*) If the KeyFile and the KeyName values are both specified, the
'       following processing occurs:
'       (1) If the KeyName can be found in the CSP, that key is used.
'       (2) If the KeyName does not exist and the KeyFile does exist, the key
'           in the KeyFile is installed into the CSP and used.
'   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
'       When specifying the KeyFile, the location of the KeyFile should be
'       relative to the project output directory which is
'       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
'       located in the project directory, you would specify the AssemblyKeyFile
'       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
'   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
'       documentation for more information on this.
'
<Assembly: AssemblyDelaySign(False)>
<Assembly: AssemblyKeyFile("")>
<Assembly: AssemblyKeyName("")>

Form1.Designer.vb

Imports System.Collections
Imports System.ComponentModel
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports System.IO
Imports System.Reflection
Imports System.Text
Imports FlexCel.Render
Namespace HandlingErrors
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        ''' <summary>
        ''' Required designer variable.
        ''' </summary>
        Private components As System.ComponentModel.Container = Nothing

        ''' <summary>
        ''' Clean up any resources being used.
        ''' </summary>
        Protected Overrides Sub Dispose(ByVal disposing As Boolean)
            If disposing Then
                If components IsNot Nothing Then
                    components.Dispose()
                End If
            End If

            'Onhook the event handler. Since this is a form, we need to onhook the event when it is disposed or it would live forever.
            RemoveHandler FlexCelTrace.OnError, FlexCelTrace_OnErrorHandler

            MyBase.Dispose(disposing)
        End Sub

        #Region "Windows Form Designer generated code"
        ''' <summary>
        ''' Required method for Designer support - do not modify
        ''' the contents of this method with the code editor.
        ''' </summary>
        Private Sub InitializeComponent()
            Me.button1 = New System.Windows.Forms.Button()
            Me.saveFileDialog1 = New System.Windows.Forms.SaveFileDialog()
            Me.label1 = New System.Windows.Forms.Label()
            Me.cbStopOnErrors = New System.Windows.Forms.CheckBox()
            Me.errorBox = New System.Windows.Forms.TextBox()
            Me.cbIgnoreFontErrors = New System.Windows.Forms.CheckBox()
            Me.SuspendLayout()
            '
            ' button1
            '
            Me.button1.Anchor = System.Windows.Forms.AnchorStyles.Bottom
            Me.button1.Location = New System.Drawing.Point(244, 313)
            Me.button1.Name = "button1"
            Me.button1.TabIndex = 0
            Me.button1.Text = "GO!"
'           Me.button1.Click += New System.EventHandler(Me.button1_Click)
            '
            ' saveFileDialog1
            '
            Me.saveFileDialog1.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm|Excel 97/2003|*.xls|Excel 2007|*.xlsx;*.xlsm|All files|*.*"
            Me.saveFileDialog1.RestoreDirectory = True
            Me.saveFileDialog1.Title = "Save file as: (FILE WILL BE SAVED AS PDF TOO)"
            '
            ' label1
            '
            Me.label1.Anchor = (CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.label1.BackColor = System.Drawing.Color.FromArgb((CByte(255)), (CByte(255)), (CByte(192)))
            Me.label1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
            Me.label1.Location = New System.Drawing.Point(16, 16)
            Me.label1.Name = "label1"
            Me.label1.Size = New System.Drawing.Size(536, 32)
            Me.label1.TabIndex = 1
            Me.label1.Text = "This demo shows how to handle non fatal errors in FlexCel by using the FlexCelTra" & "ce static class."
            '
            ' cbStopOnErrors
            '
            Me.cbStopOnErrors.Location = New System.Drawing.Point(16, 64)
            Me.cbStopOnErrors.Name = "cbStopOnErrors"
            Me.cbStopOnErrors.Size = New System.Drawing.Size(400, 24)
            Me.cbStopOnErrors.TabIndex = 2
            Me.cbStopOnErrors.Text = "Stop on non fatal errors"
            '
            ' errorBox
            '
            Me.errorBox.Anchor = (CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) Or System.Windows.Forms.AnchorStyles.Left) Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.errorBox.Font = New System.Drawing.Font("Arial Unicode MS", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, (CByte(0)))
            Me.errorBox.Location = New System.Drawing.Point(16, 128)
            Me.errorBox.Multiline = True
            Me.errorBox.Name = "errorBox"
            Me.errorBox.ReadOnly = True
            Me.errorBox.ScrollBars = System.Windows.Forms.ScrollBars.Both
            Me.errorBox.Size = New System.Drawing.Size(536, 160)
            Me.errorBox.TabIndex = 3
            Me.errorBox.Text = ""
            Me.errorBox.WordWrap = False
            '
            ' cbIgnoreFontErrors
            '
            Me.cbIgnoreFontErrors.Location = New System.Drawing.Point(16, 88)
            Me.cbIgnoreFontErrors.Name = "cbIgnoreFontErrors"
            Me.cbIgnoreFontErrors.Size = New System.Drawing.Size(208, 24)
            Me.cbIgnoreFontErrors.TabIndex = 4
            Me.cbIgnoreFontErrors.Text = "Ignore font errors"
            '
            ' mainForm
            '
            Me.AutoScaleDimensions = New System.Drawing.SizeF(6F, 13F)
            Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
            Me.ClientSize = New System.Drawing.Size(560, 350)
            Me.Controls.Add(Me.cbIgnoreFontErrors)
            Me.Controls.Add(Me.errorBox)
            Me.Controls.Add(Me.cbStopOnErrors)
            Me.Controls.Add(Me.label1)
            Me.Controls.Add(Me.button1)
            Me.Name = "mainForm"
            Me.Text = "Handling non fatal errors."
            Me.ResumeLayout(False)

        End Sub
        #End Region

        Private WithEvents button1 As System.Windows.Forms.Button
        Private saveFileDialog1 As System.Windows.Forms.SaveFileDialog
        Private label1 As System.Windows.Forms.Label
        Private errorBox As System.Windows.Forms.TextBox
        Private cbStopOnErrors As System.Windows.Forms.CheckBox
        Private cbIgnoreFontErrors As System.Windows.Forms.CheckBox

    End Class
End Namespace

Form1.vb

Imports System.Collections
Imports System.ComponentModel
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports System.IO
Imports System.Reflection
Imports System.Text

Imports FlexCel.Render

Namespace HandlingErrors
    ''' <summary>
    ''' How to handle non fatal errors with FlexCel.
    ''' </summary>
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Private FlexCelTrace_OnErrorHandler As FlexCelErrorEventHandler
        Public Sub New()
            InitializeComponent()

            'Create a list to hold error messages. Keeping all error messages in memory is normally not a good thing to do,
            'but for this demo it is ok.
            ErrorList = New ArrayList()

            'Hook our error handler to FlexCel error handler.
            FlexCelTrace_OnErrorHandler = New FlexCelErrorEventHandler(AddressOf FlexCelTrace_OnError) 'We will save the value of the delegate here so we can unhook the event on dispose.
            AddHandler FlexCelTrace.OnError, FlexCelTrace_OnErrorHandler
        End Sub

        Private ErrorList As ArrayList
        Private Shared ErrorListLock As New Object() 'Used to lock ErrorList and ensure no more than one thread writes to it.

        Private ReadOnly Property PathToExe() As String
            Get
                Return Path.Combine(Path.Combine(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), ".."), "..") & Path.DirectorySeparatorChar
            End Get
        End Property

        Private Sub button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button1.Click
            ErrorList.Clear()
            errorBox.Text = ""

            Try
                DoThings()
            Catch ex As MyAbortException
                MessageBox.Show(ex.Message)
            End Try

            If ErrorList.Count = 0 Then
                errorBox.Text = "No errors!"
            Else
                errorBox.Text = String.Format("There were {0} error messages" & Environment.NewLine, ErrorList.Count)
                For Each s As String In ErrorList
                    errorBox.AppendText(s & Environment.NewLine)
                Next s
            End If
        End Sub

        Private Sub DoThings()
            Dim xls As ExcelFile = New XlsFile(True)
            xls.NewFile(1, TExcelFileFormat.v2019)

            For r As Integer = 1 To 1999
                xls.InsertHPageBreak(r) 'This won't throw an exception here, since FlexCel allows to have more than 1025 page breaks, but at the moment of saving. (since an xls file can't have more than that)
            Next r

            xls.SetCellValue(1, 1, "We have a page break on each row, so this will print/export as one row per page")
            xls.SetCellValue(2, 1, "??? ? ? ? ???? ????") 'Since we leave the font at arial, this won't show when exporting to pdf.

            Dim fmt As TFlxFormat = xls.GetDefaultFormat
            fmt.Font.Name = "Arial Unicode MS"
            xls.SetCellValue(3, 1, "??? ? ? ? ???? ????", xls.AddFormat(fmt)) 'this will display fine in the pdf.

            fmt.Font.Name = "ThisFontDoesntExists"
            xls.SetCellValue(4, 1, "This font doesn't exists", xls.AddFormat(fmt))

            'Tahoma doesn't have italic variant. See http://help.lockergnome.com/office/Tahoma-italic-ftopict705661.html
            'You shouldn't normally use Tahoma italics in a document. If we embedded the fonts in this pdf, the fake italics wouldn't work.
            fmt.Font.Name = "Tahoma"
            fmt.Font.Style = TFlxFontStyles.Italic
            xls.SetCellValue(5, 1, "This is fake italics", xls.AddFormat(fmt))

            If saveFileDialog1.ShowDialog() <> System.Windows.Forms.DialogResult.OK Then
                Return
            End If

            Using pdf As New FlexCelPdfExport(xls, True)
                pdf.Export(Path.ChangeExtension(saveFileDialog1.FileName, ".pdf"))
            End Using

            xls.Save(saveFileDialog1.FileName & ".xls")
        End Sub

        ''' <summary>
        ''' This is the generic event handler for non fatal errors. We hooked it in the mainForm constructor.
        ''' </summary>
        ''' <param name="e"></param>
        Private Sub FlexCelTrace_OnError(ByVal e As TFlexCelErrorInfo)

            If cbIgnoreFontErrors.Checked Then
                Select Case e.Error
                    'Ignore this errors:
                    Case FlexCelError.PdfFontNotFound, FlexCelError.PdfGlyphNotInFont, FlexCelError.PdfFauxBoldOrItalics
                        Return
                End Select
            End If

            'Normally tracing non fatal errors is a good idea.
            'Depending on the listener of your trace object, you can redirect this to a log, the event viewer or wherever else.
            Trace.WriteLine(e.Message)

            'If we selected "Stop On Errors" we will abort file generation by throwing an exception that will be
            'catched in the main block.
            If cbStopOnErrors.Checked Then
                Throw New MyAbortException(e.Message)
            End If

            'In this case this is a single thread app so locking is not really necessary,
            'but it is a good practice to always lock access to global objects in this error handler.
            'This event handler might me called from more than one thread, and you don't want to mess
            'the object collecting the messages (in this case ErrorList).
            SyncLock ErrorListLock
                ErrorList.Add(System.Threading.Thread.CurrentThread.Name & ": - " & e.Message)
            End SyncLock
        End Sub
    End Class

    ''' <summary>
    ''' A custom exception designed to notify us when a non fatal error must be aborted.
    ''' </summary>
    Public Class MyAbortException
        Inherits Exception

        Public Sub New(ByVal aMessage As String)
            MyBase.New(aMessage)
        End Sub
    End Class
End Namespace

Program.vb

Namespace HandlingErrors
    Friend NotInheritable Class Program

        Private Sub New()
        End Sub

        ''' <summary>
        ''' The main entry point for the application.
        ''' </summary>
       <STAThread> _
        Shared Sub Main()
            Application.EnableVisualStyles()
            Application.SetCompatibleTextRenderingDefault(False)
            Application.Run(New mainForm())
        End Sub
    End Class
End Namespace


Report demos (VB.Net / netframework) | FlexCel Studio for the .NET Framework documentation

Report demos (VB.Net / netframework)

Overview

Here you can find how to make templates and code to create full featured Excel reports.

In this section

  • Getting started with Reports

  • Range reports

  • Using Linq as datasource

  • Advanced Linq

  • Tables as datasources

  • Using Entity Framework datasources

  • Multiple sheet report

  • Exporting Web Services

  • Includes

  • Bidirectional reports

  • Lookups

  • Aggregates

  • Regular expressions

  • Manual formulas

  • Parameters inside expressions

  • Intelligent page breaks in reports

  • Debugging reports

  • Fixed forms with datasets

  • Balanced columns

  • Join and Union

  • Templates in the executable

  • Images

  • Charts

  • Charts With Dynamic Series

  • Pivot tables

  • HTML

  • Autofiting rows and columns

  • Generic reports

  • Generic reports Part 2

  • Meta templates

  • User defined tables

  • Direct SQL

  • Master detail report on one table

  • Merging similar cells

  • Splitting datasets

  • Fixed footer

  • Overflowing data in different sheets

  • User defined functions

  • User defined formats

  • Virtual datasets

  • Encryption and subtotals

  • Step by step tutorial on FlexCel reports

  • Features


Getting started with Reports (VB.Net / netframework) | FlexCel Studio for the .NET Framework documentation

Getting started with Reports (VB.Net / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\vb\VS2022\netframework\20.Reports\10.Getting Started Reports and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​vb/​VS2022/​netframework/​Modules/​20.​Reports/​10.​Getting Started Reports

Overview

A really simple demo on how to create an Excel report. No database is used, only report variables.

Concepts

  • A template is an Excel file with tags that will be replaced by report variables or fields from a dataset. Tags are always on the form <#tag> If a tag has parameters, it always has the form <#tag(param1; param2...)>. You can read the FlexCel Reports Tag Reference. for more information.

  • To set the value for report variable, use FlexCelReport.SetValue. You can set any kind of object from here, not just text. If you set it to a TFormula object, you will enter a formula.

  • <#Tags> will be replaced inside Cells, Comments, Sheet names, Images, Hyperlinks, AutoShapes, Headers and Footers. All of this is shown here. To see the headers and footers, you must do a print preview.

  • There are 2 special datatypes you must be aware:

    1. Dates: Dates in Excel are just numbers, with a special cell format. To enter a date in Excel, make sure the cell has a date format.

    2. Multiline Text:To be able to show carriage return on a cell, it must have "Wrap text" enabled on its cell format.

  • Hyperlinks are a special case for 2 reasons:

    1. You can't enter <# into an hyperlink, as # is a reserved keyword. So, tags in hyperlinks are on the form "*.TAG.*" (On older FlexCelVersions we would use "<.tag>". This will still work, but you can't enter this text into Excel 2003 or newer)

    2. If you do not begin the hyperlink text with "http://" or "https://" while creating the link in Excel, it will be created as local file. As this is not what you would normally want, all "local file" hyperlinks will be changed to URL hyperlinks if the replaced text starts with "http:" or "https:". So do not create links like "www.tmssoftware.com", make your hyperlinks "https://www.tmssoftware.com"

  • To create an hyperlink to a cell in the same file using tags, start the definition of the hyperlink with a "#", like "*.sheetvar.*!*.#cellvar.*"

  • There are special tags, like the <#If( condition, iftrue, iffalse)> that might contain other tags inside. You can use any composition of tags on any of the places where they will be replaced.

  • Empty comments will be removed. This is a feature so you can selectively comment cells based on the comment text. If comment text is blank, no comment will be made.

  • To replace images, name them as <#tag>. To see or change the name of an image, use the combo box at the upper left corner on Excel.

  • You can use tags as usual on sheet names. But, as the maximum sheet name length is 32, it is kind of limited. You can use Equal tag (<#=(cell)>) to solve this limitation.

  • You can define reusable variables on the config sheet. For example, here we define an expression containing the name and "anonymous" if the name is null, and we use it on the sheet name and the print header. Then we can use this expression on many places. <#=(cell)> is conceptually the same as report expressions, but report expressions are normally cleaner on what they mean.

  • Rich text will be preserved on cells. If for example you write "<#name> and <#date>", the result will be "your name and thedate"

Files

AssemblyInfo.vb

Imports System.Reflection
Imports System.Runtime.CompilerServices

'
' General Information about an assembly is controlled through the following
' set of attributes. Change these attribute values to modify the information
' associated with an assembly.
'
<Assembly: AssemblyTitle("")>
<Assembly: AssemblyDescription("")>
<Assembly: AssemblyConfiguration("")>
<Assembly: AssemblyCompany("")>
<Assembly: AssemblyProduct("")>
<Assembly: AssemblyCopyright("(c) 2002 - 2014 TMS Software")>
<Assembly: AssemblyTrademark("")>
<Assembly: AssemblyCulture("")>

'
' Version information for an assembly consists of the following four values:
'
'      Major Version
'      Minor Version
'      Build Number
'      Revision
'
' You can specify all the values or you can default the Revision and Build Numbers
' by using the '*' as shown below:

<Assembly: AssemblyVersion("6.2.1.0")>

'
' In order to sign your assembly you must specify a key to use. Refer to the
' Microsoft .NET Framework documentation for more information on assembly signing.
'
' Use the attributes below to control which key is used for signing.
'
' Notes:
'   (*) If no key is specified, the assembly is not signed.
'   (*) KeyName refers to a key that has been installed in the Crypto Service
'       Provider (CSP) on your machine. KeyFile refers to a file which contains
'       a key.
'   (*) If the KeyFile and the KeyName values are both specified, the
'       following processing occurs:
'       (1) If the KeyName can be found in the CSP, that key is used.
'       (2) If the KeyName does not exist and the KeyFile does exist, the key
'           in the KeyFile is installed into the CSP and used.
'   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
'       When specifying the KeyFile, the location of the KeyFile should be
'       relative to the project output directory which is
'       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
'       located in the project directory, you would specify the AssemblyKeyFile
'       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
'   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
'       documentation for more information on this.
'
<Assembly: AssemblyDelaySign(False)>
<Assembly: AssemblyKeyFile("")>
<Assembly: AssemblyKeyName("")>

Form1.Designer.vb

Imports System.Collections
Imports System.ComponentModel
Imports System.IO
Imports System.Reflection
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports FlexCel.Report
Namespace GettingStartedReports
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Private WithEvents btnGo As System.Windows.Forms.Button
        Private saveFileDialog1 As System.Windows.Forms.SaveFileDialog

        Private edName As System.Windows.Forms.TextBox
        Private label1 As System.Windows.Forms.Label
        Private WithEvents btnCancel As System.Windows.Forms.Button
        Private label2 As System.Windows.Forms.Label
        Private edUrl As System.Windows.Forms.TextBox
        Private cbAutoOpen As System.Windows.Forms.CheckBox
        Private reportStart As FlexCel.Report.FlexCelReport

        ''' <summary>
        ''' Required designer variable.
        ''' </summary>
        Private components As System.ComponentModel.Container = Nothing

        ''' <summary>
        ''' Clean up any resources being used.
        ''' </summary>
        Protected Overrides Sub Dispose(ByVal disposing As Boolean)
            If disposing Then
                If components IsNot Nothing Then
                    components.Dispose()
                End If
            End If
            MyBase.Dispose(disposing)
        End Sub

        #Region "Windows Form Designer generated code"
        ''' <summary>
        ''' Required method for Designer support - do not modify
        ''' the contents of this method with the code editor.
        ''' </summary>
        Private Sub InitializeComponent()
            Me.btnGo = New System.Windows.Forms.Button()
            Me.saveFileDialog1 = New System.Windows.Forms.SaveFileDialog()
            Me.reportStart = New FlexCel.Report.FlexCelReport()
            Me.edName = New System.Windows.Forms.TextBox()
            Me.label1 = New System.Windows.Forms.Label()
            Me.btnCancel = New System.Windows.Forms.Button()
            Me.label2 = New System.Windows.Forms.Label()
            Me.edUrl = New System.Windows.Forms.TextBox()
            Me.cbAutoOpen = New System.Windows.Forms.CheckBox()
            Me.SuspendLayout()
            '
            ' btnGo
            '
            Me.btnGo.Anchor = (CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.btnGo.BackColor = System.Drawing.Color.Green
            Me.btnGo.ForeColor = System.Drawing.Color.White
            Me.btnGo.Location = New System.Drawing.Point(152, 152)
            Me.btnGo.Name = "btnGo"
            Me.btnGo.Size = New System.Drawing.Size(112, 24)
            Me.btnGo.TabIndex = 0
            Me.btnGo.Text = "GO!"
            Me.btnGo.UseVisualStyleBackColor = False
'           Me.btnGo.Click += New System.EventHandler(Me.btnGo_Click)
            '
            ' saveFileDialog1
            '
            Me.saveFileDialog1.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm|Excel 97/2003|*.xls|Excel 2007|*.xlsx;*.xlsm|All " & "files|*.*"
            Me.saveFileDialog1.RestoreDirectory = True
            '
            ' reportStart
            '
            Me.reportStart.AllowOverwritingFiles = True
            Me.reportStart.DeleteEmptyRanges = False
            '
            ' edName
            '
            Me.edName.Anchor = (CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.edName.Location = New System.Drawing.Point(24, 40)
            Me.edName.Name = "edName"
            Me.edName.Size = New System.Drawing.Size(360, 20)
            Me.edName.TabIndex = 1
            '
            ' label1
            '
            Me.label1.Location = New System.Drawing.Point(24, 24)
            Me.label1.Name = "label1"
            Me.label1.Size = New System.Drawing.Size(160, 16)
            Me.label1.TabIndex = 2
            Me.label1.Text = "Tell me your name:"
            '
            ' btnCancel
            '
            Me.btnCancel.Anchor = (CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.btnCancel.BackColor = System.Drawing.Color.FromArgb((CInt((CByte(192)))), (CInt((CByte(0)))), (CInt((CByte(0)))))
            Me.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel
            Me.btnCancel.ForeColor = System.Drawing.Color.White
            Me.btnCancel.Location = New System.Drawing.Point(272, 152)
            Me.btnCancel.Name = "btnCancel"
            Me.btnCancel.Size = New System.Drawing.Size(112, 23)
            Me.btnCancel.TabIndex = 3
            Me.btnCancel.Text = "Cancel"
            Me.btnCancel.UseVisualStyleBackColor = False
'           Me.btnCancel.Click += New System.EventHandler(Me.btnCancel_Click)
            '
            ' label2
            '
            Me.label2.Location = New System.Drawing.Point(28, 60)
            Me.label2.Name = "label2"
            Me.label2.Size = New System.Drawing.Size(228, 16)
            Me.label2.TabIndex = 5
            Me.label2.Text = "Your Home page (without http://)"
            '
            ' edUrl
            '
            Me.edUrl.Anchor = (CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.edUrl.Location = New System.Drawing.Point(28, 76)
            Me.edUrl.Name = "edUrl"
            Me.edUrl.Size = New System.Drawing.Size(360, 20)
            Me.edUrl.TabIndex = 4
            Me.edUrl.Text = "www.tmssoftware.com"
            '
            ' cbAutoOpen
            '
            Me.cbAutoOpen.Location = New System.Drawing.Point(24, 104)
            Me.cbAutoOpen.Name = "cbAutoOpen"
            Me.cbAutoOpen.Size = New System.Drawing.Size(264, 24)
            Me.cbAutoOpen.TabIndex = 6
            Me.cbAutoOpen.Text = "Auto open the generated file without saving it"
            '
            ' mainForm
            '
            Me.AutoScaleDimensions = New System.Drawing.SizeF(6F, 13F)
            Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
            Me.ClientSize = New System.Drawing.Size(416, 190)
            Me.Controls.Add(Me.cbAutoOpen)
            Me.Controls.Add(Me.label2)
            Me.Controls.Add(Me.edUrl)
            Me.Controls.Add(Me.btnCancel)
            Me.Controls.Add(Me.label1)
            Me.Controls.Add(Me.edName)
            Me.Controls.Add(Me.btnGo)
            Me.Name = "mainForm"
            Me.Text = "Getting Started"
            Me.ResumeLayout(False)
            Me.PerformLayout()

        End Sub
        #End Region
    End Class
End Namespace

Form1.vb

Imports System.Collections
Imports System.ComponentModel
Imports System.IO
Imports System.Reflection
Imports System.Threading
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports FlexCel.Report

Namespace GettingStartedReports
    ''' <summary>
    ''' Simple report
    ''' </summary>
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Public Sub New()
            InitializeComponent()
        End Sub

        Private Sub btnGo_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnGo.Click
            'Note that we are using a FlexCelReport component in a form here. We could also create the FlexCelReport component dynamically.

            If cbAutoOpen.Checked Then
                AutoOpenRun()
            Else
                NormalRun()
            End If
        End Sub

        Private Sub Setup(ByVal UserName As String, ByVal UserUrl As String, ByVal DataPath As String)
            'Set report variables, including an image.

            reportStart.SetValue("Date", Date.Now)
            reportStart.SetValue("Name", UserName)
            reportStart.SetValue("TwoLines", "First line" & Environment.NewLine & "Second Line")
            reportStart.SetValue("Empty", Nothing)
            reportStart.SetValue("LinkPage", UserUrl)
            reportStart.SetValue("Img", File.ReadAllBytes(Path.Combine(DataPath, "img.png")))
        End Sub

        Private Sub NormalRun()
            Dim DataPath As String = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location)
            DataPath = Path.Combine(DataPath, "..")
            DataPath = Path.Combine(DataPath, "..")
            Setup(edName.Text, edUrl.Text, DataPath)

            If saveFileDialog1.ShowDialog() = System.Windows.Forms.DialogResult.OK Then
                'FlexCel isn't a conversion tool. While it does a good job converting a lot of stuff
                'between xls and xlsx, for best results we will use an xlsx template if the user choose xlsx and xls if the user choose xls.
                reportStart.Run(Path.Combine(DataPath, "Getting Started Reports.template" & Path.GetExtension(saveFileDialog1.FileName)), saveFileDialog1.FileName)

                If MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) = System.Windows.Forms.DialogResult.Yes Then
                    Process.Start(saveFileDialog1.FileName)
                End If
            End If
        End Sub

        Private Sub AutoOpenRun()
            Dim DataPath As String = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location)
            DataPath = Path.Combine(DataPath, "..")
            DataPath = Path.Combine(DataPath, "..")
            Setup(edName.Text, edUrl.Text, DataPath)

            Dim Xls As New XlsFile()
            Xls.Open(Path.Combine(DataPath, "Getting Started Reports.template.xlsx"))
            reportStart.Run(Xls)

            Dim FilePath As String = Path.GetTempPath() 'GetTempFileName does not allow us to specify the "xltx" extension.
            Dim FileName As String = Path.Combine(FilePath, Guid.NewGuid().ToString() & ".xltx") 'xltx is the extension for excel templates.
            Try
                Using OutStream As New FileStream(FileName, FileMode.Create, FileAccess.ReadWrite)
                    Xls.IsXltTemplate = True 'Make it an xltx template.
                    Xls.Save(OutStream)
                End Using
                Process.Start(FileName)
            Finally
                'For .Net 4 and newer you can use Task.Run here. See https://doc.tmssoftware.com/flexcel/net/tips/automatically-open-generated-excel-files.html
                Dim t As New Thread(AddressOf RemoveTempAfterUse)
                t.Start(FileName)
            End Try
        End Sub

        Private Sub RemoveTempAfterUse(ByVal FileName As Object)
            'As it is an xltx file, we can delete it even when it is open on Excel. - wait for 30 secs to give Excel time to start.
            Thread.Sleep(30000)
            File.Delete(CType(FileName, String))
        End Sub

        ''' <summary>
        ''' This is the method that will be called by the ASP.NET front end. It returns an array of bytes
        ''' with the report data, so the ASP.NET application can stream it to the client.
        ''' </summary>
        ''' <param name="UserName"></param>
        ''' <param name="UserUrl"></param>
        ''' <returns>The generated file as a byte array.</returns>
        Public Function WebRun(ByVal UserName As String, ByVal UserUrl As String) As Byte()
            Dim DataPath As String = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location)
            DataPath = Path.Combine(DataPath, "..")
            DataPath = Path.Combine(DataPath, "..")
            Setup(UserName, UserUrl, DataPath)

            Using OutStream As New MemoryStream()
                Using InStream As New FileStream(Path.Combine(DataPath, "Getting Started Reports.template.xls"), FileMode.Open, FileAccess.Read, FileShare.ReadWrite)
                    reportStart.Run(InStream, OutStream)
                    Return OutStream.ToArray()
                End Using
            End Using
        End Function

        Private Sub btnCancel_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnCancel.Click
            Close()
        End Sub

    End Class

End Namespace

Program.vb

Namespace GettingStartedReports
    Friend NotInheritable Class Program

        Private Sub New()
        End Sub

        ''' <summary>
        ''' The main entry point for the application.
        ''' </summary>
       <STAThread> _
        Shared Sub Main()
            Application.EnableVisualStyles()
            Application.SetCompatibleTextRenderingDefault(False)
            Application.Run(New mainForm())
        End Sub
    End Class
End Namespace


Range reports (VB.Net / netframework) | FlexCel Studio for the .NET Framework documentation

Range reports (VB.Net / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\vb\VS2022\netframework\20.Reports\20.Range Reports and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​vb/​VS2022/​netframework/​Modules/​20.​Reports/​20.​Range Reports

Overview

On the GettingStarted demo we saw how to write tags on a template, and have FlexCel replace them. Now we are going to replace whole ranges with values from a database.

Concepts

  • To be able to use a database, you have to define a named range on the template, to tell FlexCel which rows or columns to use. Also, you need to add the table on the code.

  • You can arrange the ranges in many different ways. Take a look at all the sheets, they have different reports from the Northwind demo recreated with FlexCel.

  • There are four kinds of named ranges:

    • "__" Ranges: They are the most common, and the ones you should probably use. The table will be inserted horizontally, and the full rows will be moved down.

    • "_" Ranges: They work as the "__" ranges, but only the range and not the full row is moved down. Row properties (like row height) are not copied because not the full row is copied.

    • "II_" Ranges: Use them to insert the table by columns, not by rows. Full columns will be inserted.

    • "I_" Ranges: Tables will be inserted by columns, but only the selected range will move. Column properties (like column width) are not copied.

  • Ranges can be defined inside ranges, to create Master-Detail reports. On the dataset schema on your application, you have to define the corresponding relations for this to work.

  • It might happen that you need to use the same datatable, lets say __Categories__ on more than one sheet. You can't define more than one __Categories__ named range, but you can define an alias on the Config sheet, (for example Categories2=Categories) and then use __Categories2__ on the second sheet. Another alternative not shown in this example would be to use Alias Bands.

  • We used Intelligent Page Breaks in the first sheet so categories are kept in their own pages when printing.

Files

AssemblyInfo.vb

Imports System.Reflection
Imports System.Runtime.CompilerServices

'
' General Information about an assembly is controlled through the following
' set of attributes. Change these attribute values to modify the information
' associated with an assembly.
'
<Assembly: AssemblyTitle("")>
<Assembly: AssemblyDescription("")>
<Assembly: AssemblyConfiguration("")>
<Assembly: AssemblyCompany("")>
<Assembly: AssemblyProduct("")>
<Assembly: AssemblyCopyright("(c) 2002 - 2014 TMS Software")>
<Assembly: AssemblyTrademark("")>
<Assembly: AssemblyCulture("")>

'
' Version information for an assembly consists of the following four values:
'
'      Major Version
'      Minor Version
'      Build Number
'      Revision
'
' You can specify all the values or you can default the Revision and Build Numbers
' by using the '*' as shown below:

<Assembly: AssemblyVersion("6.2.1.0")>

'
' In order to sign your assembly you must specify a key to use. Refer to the
' Microsoft .NET Framework documentation for more information on assembly signing.
'
' Use the attributes below to control which key is used for signing.
'
' Notes:
'   (*) If no key is specified, the assembly is not signed.
'   (*) KeyName refers to a key that has been installed in the Crypto Service
'       Provider (CSP) on your machine. KeyFile refers to a file which contains
'       a key.
'   (*) If the KeyFile and the KeyName values are both specified, the
'       following processing occurs:
'       (1) If the KeyName can be found in the CSP, that key is used.
'       (2) If the KeyName does not exist and the KeyFile does exist, the key
'           in the KeyFile is installed into the CSP and used.
'   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
'       When specifying the KeyFile, the location of the KeyFile should be
'       relative to the project output directory which is
'       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
'       located in the project directory, you would specify the AssemblyKeyFile
'       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
'   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
'       documentation for more information on this.
'
<Assembly: AssemblyDelaySign(False)>
<Assembly: AssemblyKeyFile("")>
<Assembly: AssemblyKeyName("")>

Form1.Designer.vb

Imports System.Collections
Imports System.ComponentModel
Imports System.IO
Imports System.Reflection
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports FlexCel.Report
Imports FlexCel.Demo.SharedData
Namespace RangeReports
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Private WithEvents button1 As System.Windows.Forms.Button
        Private saveFileDialog1 As System.Windows.Forms.SaveFileDialog
        Private label1 As System.Windows.Forms.Label
        Private WithEvents btnCancel As System.Windows.Forms.Button
        ''' <summary>
        ''' Required designer variable.
        ''' </summary>
        Private components As System.ComponentModel.Container = Nothing

        ''' <summary>
        ''' Clean up any resources being used.
        ''' </summary>
        Protected Overrides Sub Dispose(ByVal disposing As Boolean)
            If disposing Then
                If components IsNot Nothing Then
                    components.Dispose()
                End If
            End If
            MyBase.Dispose(disposing)
        End Sub

        #Region "Windows Form Designer generated code"
        ''' <summary>
        ''' Required method for Designer support - do not modify
        ''' the contents of this method with the code editor.
        ''' </summary>
        Private Sub InitializeComponent()
            Me.button1 = New System.Windows.Forms.Button()
            Me.saveFileDialog1 = New System.Windows.Forms.SaveFileDialog()
            Me.label1 = New System.Windows.Forms.Label()
            Me.btnCancel = New System.Windows.Forms.Button()
            Me.SuspendLayout()
            '
            ' button1
            '
            Me.button1.Anchor = (CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.button1.BackColor = System.Drawing.Color.Green
            Me.button1.ForeColor = System.Drawing.Color.White
            Me.button1.Location = New System.Drawing.Point(152, 88)
            Me.button1.Name = "button1"
            Me.button1.Size = New System.Drawing.Size(112, 23)
            Me.button1.TabIndex = 0
            Me.button1.Text = "GO!"
            Me.button1.UseVisualStyleBackColor = False
'           Me.button1.Click += New System.EventHandler(Me.button1_Click)
            '
            ' saveFileDialog1
            '
            Me.saveFileDialog1.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm|Excel 97/2003|*.xls|Excel 2007|*.xlsx;*.xlsm|All files|*.*"
            Me.saveFileDialog1.RestoreDirectory = True
            '
            ' label1
            '
            Me.label1.Location = New System.Drawing.Point(24, 24)
            Me.label1.Name = "label1"
            Me.label1.Size = New System.Drawing.Size(272, 24)
            Me.label1.TabIndex = 2
            Me.label1.Text = "Press ""GO"" to create a database Report."
            '
            ' btnCancel
            '
            Me.btnCancel.Anchor = (CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.btnCancel.BackColor = System.Drawing.Color.FromArgb((CInt((CByte(192)))), (CInt((CByte(0)))), (CInt((CByte(0)))))
            Me.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel
            Me.btnCancel.ForeColor = System.Drawing.Color.White
            Me.btnCancel.Location = New System.Drawing.Point(272, 88)
            Me.btnCancel.Name = "btnCancel"
            Me.btnCancel.Size = New System.Drawing.Size(112, 23)
            Me.btnCancel.TabIndex = 3
            Me.btnCancel.Text = "Cancel"
            Me.btnCancel.UseVisualStyleBackColor = False
'           Me.btnCancel.Click += New System.EventHandler(Me.btnCancel_Click)
            '
            ' mainForm
            '
            Me.AutoScaleDimensions = New System.Drawing.SizeF(6F, 13F)
            Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
            Me.ClientSize = New System.Drawing.Size(416, 133)
            Me.Controls.Add(Me.btnCancel)
            Me.Controls.Add(Me.label1)
            Me.Controls.Add(Me.button1)
            Me.Name = "mainForm"
            Me.Text = "Range Reports"
            Me.ResumeLayout(False)

        End Sub
        #End Region
    End Class
End Namespace

Form1.vb

Imports System.Collections
Imports System.ComponentModel
Imports System.IO
Imports System.Reflection
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports FlexCel.Report
Imports FlexCel.Demo.SharedData

Namespace RangeReports
    ''' <summary>
    ''' Summary description for Form1.
    ''' </summary>
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Public Sub New()
            InitializeComponent()
        End Sub

        Private Sub button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button1.Click
            AutoRun()
        End Sub

        Public Sub AutoRun()
            Using ordersReport As FlexCelReport = SharedData.CreateReport()
                ordersReport.SetValue("Date", Date.Now)

                Dim DataPath As String = Path.Combine(Path.Combine(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), ".."), "..") & Path.DirectorySeparatorChar

                If saveFileDialog1.ShowDialog() = System.Windows.Forms.DialogResult.OK Then
                    ordersReport.Run(DataPath & "Range Reports.template.xls", saveFileDialog1.FileName)

                    If MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) = System.Windows.Forms.DialogResult.Yes Then
                        Process.Start(saveFileDialog1.FileName)
                    End If
                End If
            End Using
        End Sub

        Private Sub btnCancel_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnCancel.Click
            Close()
        End Sub
    End Class

End Namespace

Program.vb

Namespace RangeReports
    Friend NotInheritable Class Program

        Private Sub New()
        End Sub

        ''' <summary>
        ''' The main entry point for the application.
        ''' </summary>
       <STAThread> _
        Shared Sub Main()
            Application.EnableVisualStyles()
            Application.SetCompatibleTextRenderingDefault(False)
            Application.Run(New mainForm())
        End Sub
    End Class
End Namespace


Using Linq as datasource (VB.Net / netframework) | FlexCel Studio for the .NET Framework documentation

Using Linq as datasource (VB.Net / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\vb\VS2022\netframework\20.Reports\22.Linq and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​vb/​VS2022/​netframework/​Modules/​20.​Reports/​22.​Linq

Overview

THIS DEMO NEEDS .NET 3.5 OR NEWER.

Most of the demos here use datasets as datasources. This is just for convenience, because Linq is not supported in .NET 2.0 and so if we used Linq those demos wouldn't work for everybody, and also because the focus is in the Excel templates, not so much in the data layer. But you can use any IQueryable<T> collection as a datasource in a FlexCel report, and this is what we will show here.

Concepts

  • How to run a report from a List<> of objects.

  • When using IQueryable<T> as datasource, you can use any public property of T in the report. So if type T has a public property "LastName", you can access it with <#dt.LastName>.

  • Master detail with implicit relationships. When a public property of a collection of objects is other collection of objects, the property is considered as a detail of the main collection. In this example "Elements" is a property of "Categories", and so there is an implicit relationship between them.

  • Master detail with explicit relationships. While when using LINQ you will normally use implicit relationships, you can also relate any two collections of objects with a relationship, as you could with datasets. In this example, "ElementName" is explicitly related to "Elements" with a call to FlexCelReport.AddRelationship.

Files

AssemblyInfo.vb

Imports System.Reflection
Imports System.Runtime.CompilerServices

'
' General Information about an assembly is controlled through the following
' set of attributes. Change these attribute values to modify the information
' associated with an assembly.
'
<Assembly: AssemblyTitle("")>
<Assembly: AssemblyDescription("")>
<Assembly: AssemblyConfiguration("")>
<Assembly: AssemblyCompany("")>
<Assembly: AssemblyProduct("")>
<Assembly: AssemblyCopyright("(c) 2002 - 2014 TMS Software")>
<Assembly: AssemblyTrademark("")>
<Assembly: AssemblyCulture("")>

'
' Version information for an assembly consists of the following four values:
'
'      Major Version
'      Minor Version
'      Build Number
'      Revision
'
' You can specify all the values or you can default the Revision and Build Numbers
' by using the '*' as shown below:

<Assembly: AssemblyVersion("6.2.1.0")>

'
' In order to sign your assembly you must specify a key to use. Refer to the
' Microsoft .NET Framework documentation for more information on assembly signing.
'
' Use the attributes below to control which key is used for signing.
'
' Notes:
'   (*) If no key is specified, the assembly is not signed.
'   (*) KeyName refers to a key that has been installed in the Crypto Service
'       Provider (CSP) on your machine. KeyFile refers to a file which contains
'       a key.
'   (*) If the KeyFile and the KeyName values are both specified, the
'       following processing occurs:
'       (1) If the KeyName can be found in the CSP, that key is used.
'       (2) If the KeyName does not exist and the KeyFile does exist, the key
'           in the KeyFile is installed into the CSP and used.
'   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
'       When specifying the KeyFile, the location of the KeyFile should be
'       relative to the project output directory which is
'       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
'       located in the project directory, you would specify the AssemblyKeyFile
'       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
'   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
'       documentation for more information on this.
'
<Assembly: AssemblyDelaySign(False)>
<Assembly: AssemblyKeyFile("")>
<Assembly: AssemblyKeyName("")>

Form1.Designer.vb

Imports System.Collections
Imports System.ComponentModel
Imports System.IO
Imports System.Reflection
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports FlexCel.Report
Namespace Linq
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Private WithEvents button1 As System.Windows.Forms.Button
        Private saveFileDialog1 As System.Windows.Forms.SaveFileDialog
        Private label1 As System.Windows.Forms.Label
        Private WithEvents btnCancel As System.Windows.Forms.Button
        ''' <summary>
        ''' Required designer variable.
        ''' </summary>
        Private components As System.ComponentModel.Container = Nothing

        ''' <summary>
        ''' Clean up any resources being used.
        ''' </summary>
        Protected Overrides Sub Dispose(ByVal disposing As Boolean)
            If disposing Then
                If components IsNot Nothing Then
                    components.Dispose()
                End If
            End If
            MyBase.Dispose(disposing)
        End Sub

        #Region "Windows Form Designer generated code"
        ''' <summary>
        ''' Required method for Designer support - do not modify
        ''' the contents of this method with the code editor.
        ''' </summary>
        Private Sub InitializeComponent()
            Me.button1 = New System.Windows.Forms.Button()
            Me.saveFileDialog1 = New System.Windows.Forms.SaveFileDialog()
            Me.label1 = New System.Windows.Forms.Label()
            Me.btnCancel = New System.Windows.Forms.Button()
            Me.SuspendLayout()
            '
            ' button1
            '
            Me.button1.Anchor = (CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.button1.BackColor = System.Drawing.Color.Green
            Me.button1.ForeColor = System.Drawing.Color.White
            Me.button1.Location = New System.Drawing.Point(152, 88)
            Me.button1.Name = "button1"
            Me.button1.Size = New System.Drawing.Size(112, 23)
            Me.button1.TabIndex = 0
            Me.button1.Text = "GO!"
            Me.button1.UseVisualStyleBackColor = False
'           Me.button1.Click += New System.EventHandler(Me.button1_Click)
            '
            ' saveFileDialog1
            '
            Me.saveFileDialog1.Filter = "Excel Files|*.xls"
            Me.saveFileDialog1.RestoreDirectory = True
            '
            ' label1
            '
            Me.label1.Location = New System.Drawing.Point(24, 24)
            Me.label1.Name = "label1"
            Me.label1.Size = New System.Drawing.Size(272, 24)
            Me.label1.TabIndex = 2
            Me.label1.Text = "Press ""GO"" to create a report from a List<> of objects."
            '
            ' btnCancel
            '
            Me.btnCancel.Anchor = (CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.btnCancel.BackColor = System.Drawing.Color.FromArgb((CInt((CByte(192)))), (CInt((CByte(0)))), (CInt((CByte(0)))))
            Me.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel
            Me.btnCancel.ForeColor = System.Drawing.Color.White
            Me.btnCancel.Location = New System.Drawing.Point(272, 88)
            Me.btnCancel.Name = "btnCancel"
            Me.btnCancel.Size = New System.Drawing.Size(112, 23)
            Me.btnCancel.TabIndex = 3
            Me.btnCancel.Text = "Cancel"
            Me.btnCancel.UseVisualStyleBackColor = False
'           Me.btnCancel.Click += New System.EventHandler(Me.btnCancel_Click)
            '
            ' mainForm
            '
            Me.AutoScaleDimensions = New System.Drawing.SizeF(6F, 13F)
            Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
            Me.ClientSize = New System.Drawing.Size(416, 133)
            Me.Controls.Add(Me.btnCancel)
            Me.Controls.Add(Me.label1)
            Me.Controls.Add(Me.button1)
            Me.Name = "mainForm"
            Me.Text = "Linq Reports"
            Me.ResumeLayout(False)

        End Sub
        #End Region
    End Class
End Namespace

Form1.vb

Imports System.Collections
Imports System.ComponentModel
Imports System.IO
Imports System.Reflection
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports FlexCel.Report

Namespace Linq
    ''' <summary>
    ''' Summary description for Form1.
    ''' </summary>
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Public Sub New()
            InitializeComponent()
        End Sub

        Private Sub button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button1.Click
            AutoRun()
        End Sub

        Public Sub AutoRun()
            Using report As New FlexCelReport(True)
                LoadTables(report)

                Dim DataPath As String = Path.Combine(Path.Combine(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), ".."), "..") & Path.DirectorySeparatorChar

                If saveFileDialog1.ShowDialog() = System.Windows.Forms.DialogResult.OK Then
                    report.Run(DataPath & "Linq.template.xls", saveFileDialog1.FileName)

                    If MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) = System.Windows.Forms.DialogResult.Yes Then
                        Process.Start(saveFileDialog1.FileName)
                    End If
                End If
            End Using
        End Sub

        Private Sub LoadTables(ByVal report As FlexCelReport)
            Dim Categories As New List(Of Categories)()
            Dim Animals As New Categories("Animals")
            Animals.Elements.Add(New Elements(1, "Penguin"))
            Animals.Elements.Add(New Elements(2, "Cat"))
            Animals.Elements.Add(New Elements(3, "Unicorn"))
            Categories.Add(Animals)

            Dim Flowers As New Categories("Flowers")
            Flowers.Elements.Add(New Elements(4, "Daisy"))
            Flowers.Elements.Add(New Elements(5, "Rose"))
            Flowers.Elements.Add(New Elements(6, "Orchid"))
            Categories.Add(Flowers)

            report.AddTable("Categories", Categories)
            'We don't need to call AddTable for elements since it is already added when we add Categories.

            Dim ElementNames As New List(Of ElementName)()
            ElementNames.Add(New ElementName(1, "Linus"))
            ElementNames.Add(New ElementName(1, "Gerard"))
            ElementNames.Add(New ElementName(2, "Rover"))
            ElementNames.Add(New ElementName(3, "Mike"))
            ElementNames.Add(New ElementName(5, "Rosalyn"))
            ElementNames.Add(New ElementName(5, "Monica"))
            ElementNames.Add(New ElementName(6, "Lisa"))

            report.AddTable("ElementName", ElementNames)
            'ElementName doesn't have an intrinsic relationship with categories, so we will have to manually add a relationship.
            'Non intrinsic relationships should be rare, but we do it here to show how it can be done.
            report.AddRelationship("Elements", "ElementName", "ElementID", "ElementID")
        End Sub

        Private Sub btnCancel_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnCancel.Click
            Close()
        End Sub
    End Class

    Public Class Categories
        'Public properties can be used in reports.
        Private privateName As String
        Public Property Name() As String
            Get
                Return privateName
            End Get
            Private Set(ByVal value As String)
                privateName = value
            End Set
        End Property

        'Elements is in master-detail relationship with this element, even when we don't explicitly add a relationship.
        'Relationship is inferred because Elements is a property of this object
        Private privateElements As List(Of Elements)
        Public Property Elements() As List(Of Elements)
            Get
                Return privateElements
            End Get
            Private Set(ByVal value As List(Of Elements))
                privateElements = value
            End Set
        End Property

        Public Sub New(ByVal name As String)
            Me.Name = name
            Elements = New List(Of Elements)()
        End Sub

    End Class

    Public Class Elements
        'We will relate this property with the table of colors by adding a relationship.
        Private privateElementID As Integer
        Public Property ElementID() As Integer
            Get
                Return privateElementID
            End Get
            Private Set(ByVal value As Integer)
                privateElementID = value
            End Set
        End Property

        Private privateName As String
        Public Property Name() As String
            Get
                Return privateName
            End Get
            Private Set(ByVal value As String)
                privateName = value
            End Set
        End Property

        Public Sub New(ByVal elementID As Integer, ByVal name As String)
            Me.Name = name
            Me.ElementID = elementID
        End Sub

    End Class

    Public Class ElementName
        Private privateElementID As Integer
        Public Property ElementID() As Integer
            Get
                Return privateElementID
            End Get
            Private Set(ByVal value As Integer)
                privateElementID = value
            End Set
        End Property
        Private privateName As String
        Public Property Name() As String
            Get
                Return privateName
            End Get
            Private Set(ByVal value As String)
                privateName = value
            End Set
        End Property

        Public Sub New(ByVal elementID As Integer, ByVal name As String)
            Me.ElementID = elementID
            Me.Name = name
        End Sub
    End Class

End Namespace

Program.vb

Namespace Linq
    Friend NotInheritable Class Program

        Private Sub New()
        End Sub

        ''' <summary>
        ''' The main entry point for the application.
        ''' </summary>
       <STAThread> _
        Shared Sub Main()
            Application.EnableVisualStyles()
            Application.SetCompatibleTextRenderingDefault(False)
            Application.Run(New mainForm())
        End Sub
    End Class
End Namespace


Advanced Linq (VB.Net / netframework) | FlexCel Studio for the .NET Framework documentation

Advanced Linq (VB.Net / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\vb\VS2022\netframework\20.Reports\22b.Advanced Linq and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​vb/​VS2022/​netframework/​Modules/​20.​Reports/​22b.​Advanced Linq

Overview

THIS DEMO REQUIRES .NET 3.5 OR NEWER.

Most of the demos here use datasets as datasources. This is just for convenience, because Linq is not supported in .NET 2.0 and so if we used Linq those demos wouldn't work for everybody, and also because the focus is in the Excel templates, not so much in the data layer. But you can use any IQueryable<T> collection as a datasource in a FlexCel report, and this is what we will show here.

This demo shows some features not shown in the Linq example.

Concepts

  • How to do a master-detail report when the details are nested many levels inside the master. In this case, the class Country has a People class, and the People class has a list of Language objects. If People was a List<> inside Country and you wanted to use that list, you would just define a __People__ band (this is shown in the Linq example). But as the List<> is inside People which in turn is inside Country, you need to define a __People.Language__ band.

  • How to reference a table with dots using [square brackets]. If you write in a cell <#tablename.section.field> FlexCel will interpret this as table "tablename", field "section.field". The text up to the first dot is always the table, and the rest is the field. But sometimes you might want this to being interpreted as table "tablename.section", field "field". To do so, you need to write <#[tablename.section].field>. In this particular case, we have a table "People.Language" which we defined in the previous point. If we wrote in cell B1: "<#people.language.speakers.percent> FlexCel would interpret this is the table "people", not "people.language" which is what we need. To make FlexCel understand that we want a table "people.language" we use <#[people.language].speakers.percent>

Files

AssemblyInfo.vb

Imports System.Reflection
Imports System.Runtime.CompilerServices

'
' General Information about an assembly is controlled through the following
' set of attributes. Change these attribute values to modify the information
' associated with an assembly.
'
<Assembly: AssemblyTitle("")>
<Assembly: AssemblyDescription("")>
<Assembly: AssemblyConfiguration("")>
<Assembly: AssemblyCompany("")>
<Assembly: AssemblyProduct("")>
<Assembly: AssemblyCopyright("(c) 2002 - 2014 TMS Software")>
<Assembly: AssemblyTrademark("")>
<Assembly: AssemblyCulture("")>

'
' Version information for an assembly consists of the following four values:
'
'      Major Version
'      Minor Version
'      Build Number
'      Revision
'
' You can specify all the values or you can default the Revision and Build Numbers
' by using the '*' as shown below:

<Assembly: AssemblyVersion("6.2.1.0")>

'
' In order to sign your assembly you must specify a key to use. Refer to the
' Microsoft .NET Framework documentation for more information on assembly signing.
'
' Use the attributes below to control which key is used for signing.
'
' Notes:
'   (*) If no key is specified, the assembly is not signed.
'   (*) KeyName refers to a key that has been installed in the Crypto Service
'       Provider (CSP) on your machine. KeyFile refers to a file which contains
'       a key.
'   (*) If the KeyFile and the KeyName values are both specified, the
'       following processing occurs:
'       (1) If the KeyName can be found in the CSP, that key is used.
'       (2) If the KeyName does not exist and the KeyFile does exist, the key
'           in the KeyFile is installed into the CSP and used.
'   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
'       When specifying the KeyFile, the location of the KeyFile should be
'       relative to the project output directory which is
'       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
'       located in the project directory, you would specify the AssemblyKeyFile
'       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
'   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
'       documentation for more information on this.
'
<Assembly: AssemblyDelaySign(False)>
<Assembly: AssemblyKeyFile("")>
<Assembly: AssemblyKeyName("")>

Form1.Designer.vb

Imports System.Collections
Imports System.ComponentModel
Imports System.IO
Imports System.Reflection
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports FlexCel.Report
Namespace AdvancedLinq
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Private WithEvents button1 As System.Windows.Forms.Button
        Private saveFileDialog1 As System.Windows.Forms.SaveFileDialog
        Private label1 As System.Windows.Forms.Label
        Private WithEvents btnCancel As System.Windows.Forms.Button
        ''' <summary>
        ''' Required designer variable.
        ''' </summary>
        Private components As System.ComponentModel.Container = Nothing

        ''' <summary>
        ''' Clean up any resources being used.
        ''' </summary>
        Protected Overrides Sub Dispose(ByVal disposing As Boolean)
            If disposing Then
                If components IsNot Nothing Then
                    components.Dispose()
                End If
            End If
            MyBase.Dispose(disposing)
        End Sub

        #Region "Windows Form Designer generated code"
        ''' <summary>
        ''' Required method for Designer support - do not modify
        ''' the contents of this method with the code editor.
        ''' </summary>
        Private Sub InitializeComponent()
            Me.button1 = New System.Windows.Forms.Button()
            Me.saveFileDialog1 = New System.Windows.Forms.SaveFileDialog()
            Me.label1 = New System.Windows.Forms.Label()
            Me.btnCancel = New System.Windows.Forms.Button()
            Me.SuspendLayout()
            '
            ' button1
            '
            Me.button1.Anchor = (CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.button1.BackColor = System.Drawing.Color.Green
            Me.button1.ForeColor = System.Drawing.Color.White
            Me.button1.Location = New System.Drawing.Point(152, 88)
            Me.button1.Name = "button1"
            Me.button1.Size = New System.Drawing.Size(112, 23)
            Me.button1.TabIndex = 0
            Me.button1.Text = "GO!"
            Me.button1.UseVisualStyleBackColor = False
'           Me.button1.Click += New System.EventHandler(Me.button1_Click)
            '
            ' saveFileDialog1
            '
            Me.saveFileDialog1.Filter = "Excel Files|*.xlsx"
            Me.saveFileDialog1.RestoreDirectory = True
            '
            ' label1
            '
            Me.label1.Location = New System.Drawing.Point(24, 24)
            Me.label1.Name = "label1"
            Me.label1.Size = New System.Drawing.Size(272, 24)
            Me.label1.TabIndex = 2
            Me.label1.Text = "Press ""GO"" to create a report from a List<> of objects."
            '
            ' btnCancel
            '
            Me.btnCancel.Anchor = (CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.btnCancel.BackColor = System.Drawing.Color.FromArgb((CInt((CByte(192)))), (CInt((CByte(0)))), (CInt((CByte(0)))))
            Me.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel
            Me.btnCancel.ForeColor = System.Drawing.Color.White
            Me.btnCancel.Location = New System.Drawing.Point(272, 88)
            Me.btnCancel.Name = "btnCancel"
            Me.btnCancel.Size = New System.Drawing.Size(112, 23)
            Me.btnCancel.TabIndex = 3
            Me.btnCancel.Text = "Cancel"
            Me.btnCancel.UseVisualStyleBackColor = False
'           Me.btnCancel.Click += New System.EventHandler(Me.btnCancel_Click)
            '
            ' mainForm
            '
            Me.AutoScaleDimensions = New System.Drawing.SizeF(6F, 13F)
            Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
            Me.ClientSize = New System.Drawing.Size(416, 133)
            Me.Controls.Add(Me.btnCancel)
            Me.Controls.Add(Me.label1)
            Me.Controls.Add(Me.button1)
            Me.Name = "mainForm"
            Me.Text = "Advanced Linq Reports"
            Me.ResumeLayout(False)

        End Sub
        #End Region
    End Class
End Namespace

Form1.vb

Imports System.Collections
Imports System.ComponentModel
Imports System.IO
Imports System.Reflection
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports FlexCel.Report

Namespace AdvancedLinq
    ''' <summary>
    ''' Summary description for Form1.
    ''' </summary>
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Public Sub New()
            InitializeComponent()
        End Sub

        Private Sub button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button1.Click
            AutoRun()
        End Sub

        Public Sub AutoRun()
            Using report As New FlexCelReport(True)
                LoadTables(report)

                Dim DataPath As String = Path.Combine(Path.Combine(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), ".."), "..") & Path.DirectorySeparatorChar

                If saveFileDialog1.ShowDialog() = System.Windows.Forms.DialogResult.OK Then
                    report.Run(DataPath & "Advanced Linq.template.xlsx", saveFileDialog1.FileName)

                    If MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) = System.Windows.Forms.DialogResult.Yes Then
                        Process.Start(saveFileDialog1.FileName)
                    End If
                End If
            End Using
        End Sub

        Private Sub LoadTables(ByVal report As FlexCelReport)
            Dim Countries = New List(Of Country)()
            Countries.Add(New Country("China", New People(1384688986), New Geography(New Area(270550, 9326410))))

            Dim country = Countries(Countries.Count - 1)
            country.People.Language.Add(New Language(New LanguageName("Md", "Mandarin"), New LanguageSpeakers(0, 66.2)))

            country.People.Language.Add(New Language(New LanguageName("Yue", "Yue"), New LanguageSpeakers(0, 4.9)))

            country.People.Language.Add(New Language(New LanguageName("Wu", "Wu"), New LanguageSpeakers(0, 6.1)))

            country.People.Language.Add(New Language(New LanguageName("Mb", "Minbei"), New LanguageSpeakers(0, 6.2)))

            country.People.Language.Add(New Language(New LanguageName("Mn", "Minnan"), New LanguageSpeakers(0, 5.2)))

            country.People.Language.Add(New Language(New LanguageName("Xi", "Xiang"), New LanguageSpeakers(0, 3.0)))

            country.People.Language.Add(New Language(New LanguageName("Gan", "Gan"), New LanguageSpeakers(0, 4.0)))

            Countries.Add(New Country("India", New People(1296834042), New Geography(New Area(314070, 2973193))))

            country = Countries(Countries.Count - 1)
            country.People.Language.Add(New Language(New LanguageName("Hi", "Hindi"), New LanguageSpeakers(0, 43.6)))

            country.People.Language.Add(New Language(New LanguageName("Bg", "Bengali"), New LanguageSpeakers(0, 8)))

            country.People.Language.Add(New Language(New LanguageName("Ma", "Marath"), New LanguageSpeakers(0, 6.9)))

            country.People.Language.Add(New Language(New LanguageName("Te", "Telugu"), New LanguageSpeakers(0, 6.7)))

            country.People.Language.Add(New Language(New LanguageName("Ta", "Tamil"), New LanguageSpeakers(0, 5.7)))

            country.People.Language.Add(New Language(New LanguageName("Gu", "Gujarati"), New LanguageSpeakers(0, 4.6)))

            country.People.Language.Add(New Language(New LanguageName("Ur", "Urdu"), New LanguageSpeakers(0, 4.2)))

            country.People.Language.Add(New Language(New LanguageName("Ka", "Kannada"), New LanguageSpeakers(0, 3.6)))

            country.People.Language.Add(New Language(New LanguageName("Od", "Odia"), New LanguageSpeakers(0, 3.1)))

            country.People.Language.Add(New Language(New LanguageName("Ma", "Malayalam"), New LanguageSpeakers(0, 2.9)))

            country.People.Language.Add(New Language(New LanguageName("Pu", "Punjabi"), New LanguageSpeakers(0, 2.7)))

            country.People.Language.Add(New Language(New LanguageName("As", "Assamese"), New LanguageSpeakers(0, 1.3)))

            country.People.Language.Add(New Language(New LanguageName("Mi", "Maithili"), New LanguageSpeakers(0, 1.1)))

            country.People.Language.Add(New Language(New LanguageName("O", "Other"), New LanguageSpeakers(0, 5.6)))

            Countries.Add(New Country("United States", New People(329256465), New Geography(New Area(685924, 9147593))))

            country = Countries(Countries.Count - 1)
            country.People.Language.Add(New Language(New LanguageName("En", "English"), New LanguageSpeakers(0, 78.2)))

            country.People.Language.Add(New Language(New LanguageName("Sp", "Spanish"), New LanguageSpeakers(0, 13.4)))

            country.People.Language.Add(New Language(New LanguageName("Ch", "Chinese"), New LanguageSpeakers(0, 1.1)))

            country.People.Language.Add(New Language(New LanguageName("O", "Other"), New LanguageSpeakers(0, 7.3)))

            report.AddTable("country", Countries)
        End Sub

        Private Sub btnCancel_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnCancel.Click
            Close()
        End Sub
    End Class

    Public Class Country
        Private privateName As String
        Public Property Name() As String
            Get
                Return privateName
            End Get
            Private Set(ByVal value As String)
                privateName = value
            End Set
        End Property

        Public Property People() As People
        Public Property Geography() As Geography

        Public Sub New(ByVal name As String, ByVal people As People, ByVal geography As Geography)
            Me.Name = name
            Me.People = people
            Me.Geography = geography
        End Sub

    End Class

    Public Class Geography
        Private privateArea As Area
        Public Property Area() As Area
            Get
                Return privateArea
            End Get
            Private Set(ByVal value As Area)
                privateArea = value
            End Set
        End Property

        Public Sub New(ByVal area As Area)
            Me.Area = area
        End Sub
    End Class

    Public Class Area
        Public ReadOnly Property Total() As Integer
            Get
                Return Water + Land
            End Get
        End Property
        Private privateWater As Integer
        Public Property Water() As Integer
            Get
                Return privateWater
            End Get
            Private Set(ByVal value As Integer)
                privateWater = value
            End Set
        End Property
        Private privateLand As Integer
        Public Property Land() As Integer
            Get
                Return privateLand
            End Get
            Private Set(ByVal value As Integer)
                privateLand = value
            End Set
        End Property

        Public Sub New(ByVal water As Integer, ByVal land As Integer)
            Me.Water = water
            Me.Land = land
        End Sub
    End Class

    Public Class People
        Private privatePopulation As Integer
        Public Property Population() As Integer
            Get
                Return privatePopulation
            End Get
            Private Set(ByVal value As Integer)
                privatePopulation = value
            End Set
        End Property
        Private privateLanguage As List(Of Language)
        Public Property Language() As List(Of Language)
            Get
                Return privateLanguage
            End Get
            Private Set(ByVal value As List(Of Language))
                privateLanguage = value
            End Set
        End Property

        Public Sub New(ByVal population As Integer)
            Me.Population = population
            Language = New List(Of Language)()
        End Sub
    End Class

    Public Class Language
        Private privateName As LanguageName
        Public Property Name() As LanguageName
            Get
                Return privateName
            End Get
            Private Set(ByVal value As LanguageName)
                privateName = value
            End Set
        End Property
        Private privateSpeakers As LanguageSpeakers
        Public Property Speakers() As LanguageSpeakers
            Get
                Return privateSpeakers
            End Get
            Private Set(ByVal value As LanguageSpeakers)
                privateSpeakers = value
            End Set
        End Property

        Public Sub New(ByVal name As LanguageName, ByVal speakers As LanguageSpeakers)
            Me.Name = name
            Me.Speakers = speakers
        End Sub

    End Class

    Public Class LanguageName
        Private privateShortName As String
        Public Property ShortName() As String
            Get
                Return privateShortName
            End Get
            Private Set(ByVal value As String)
                privateShortName = value
            End Set
        End Property
        Private privateLongName As String
        Public Property LongName() As String
            Get
                Return privateLongName
            End Get
            Private Set(ByVal value As String)
                privateLongName = value
            End Set
        End Property

        Public Sub New(ByVal shortName As String, ByVal longName As String)
            Me.ShortName = shortName
            Me.LongName = longName
        End Sub
    End Class

    Public Class LanguageSpeakers
        Private privateAbsoluteNumber As Integer
        Public Property AbsoluteNumber() As Integer
            Get
                Return privateAbsoluteNumber
            End Get
            Private Set(ByVal value As Integer)
                privateAbsoluteNumber = value
            End Set
        End Property
        Private privatePercent As Double
        Public Property Percent() As Double
            Get
                Return privatePercent
            End Get
            Private Set(ByVal value As Double)
                privatePercent = value
            End Set
        End Property

        Public Sub New(ByVal absoluteNumber As Integer, ByVal percent As Double)
            Me.AbsoluteNumber = absoluteNumber
            Me.Percent = percent / 100.0
        End Sub
    End Class
End Namespace

Program.vb

Namespace AdvancedLinq
    Friend NotInheritable Class Program

        Private Sub New()
        End Sub

        ''' <summary>
        ''' The main entry point for the application.
        ''' </summary>
       <STAThread> _
        Shared Sub Main()
            Application.EnableVisualStyles()
            Application.SetCompatibleTextRenderingDefault(False)
            Application.Run(New mainForm())
        End Sub
    End Class
End Namespace


Tables as datasources (VB.Net / netframework) | FlexCel Studio for the .NET Framework documentation

Tables as datasources (VB.Net / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\vb\VS2022\netframework\20.Reports\23.Tables As Datasources and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​vb/​VS2022/​netframework/​Modules/​20.​Reports/​23.​Tables As Datasources

Overview

On the other examples here, we use __NAMES__ to define where the data has to go in the template. Here, we use tables instead.

Concepts

  • Tables can work like names to define data bands, if they are named starting with "__", "_" and ending with the same, just as named ranges.

  • To have the table expand when data is inserted, the table must have an empty row after the data.

  • Tables behave like "X" ranges, even if you don't name them as "__Table__X". You can name them with an X at the end or not, but no matter what you do, they will behave as if the "X" was in the name, and remove the empty row that you need to have for the tables to expand.

  • Tables will be renamed after the report runs, by removing the "_" or "__" from the start and the end. If you don't want them to be renamed, you can change the property FlexCelReport.RenameExcelTablesUsedAsBands.

  • A __Table__ is just a shortcut for defining a __Table__X named range. In this example you could have got the same results by having the table named "Products" instead of "__Products__" and defining a name "__Products__X" from A38 to D38.

  • __Tables__ can be embedded in a master detail relationship with other __Names__. It is impossible to have a table inside a table (this is an Excel limitation), but you can have a __Table__ inside a __Name__ as in this example and the table will be copied for every record of __Name__

Files

AssemblyInfo.vb

Imports System.Reflection
Imports System.Runtime.CompilerServices

'
' General Information about an assembly is controlled through the following
' set of attributes. Change these attribute values to modify the information
' associated with an assembly.
'
<Assembly: AssemblyTitle("")>
<Assembly: AssemblyDescription("")>
<Assembly: AssemblyConfiguration("")>
<Assembly: AssemblyCompany("")>
<Assembly: AssemblyProduct("")>
<Assembly: AssemblyCopyright("(c) 2002 - 2014 TMS Software")>
<Assembly: AssemblyTrademark("")>
<Assembly: AssemblyCulture("")>

'
' Version information for an assembly consists of the following four values:
'
'      Major Version
'      Minor Version
'      Build Number
'      Revision
'
' You can specify all the values or you can default the Revision and Build Numbers
' by using the '*' as shown below:

<Assembly: AssemblyVersion("6.2.1.0")>

'
' In order to sign your assembly you must specify a key to use. Refer to the
' Microsoft .NET Framework documentation for more information on assembly signing.
'
' Use the attributes below to control which key is used for signing.
'
' Notes:
'   (*) If no key is specified, the assembly is not signed.
'   (*) KeyName refers to a key that has been installed in the Crypto Service
'       Provider (CSP) on your machine. KeyFile refers to a file which contains
'       a key.
'   (*) If the KeyFile and the KeyName values are both specified, the
'       following processing occurs:
'       (1) If the KeyName can be found in the CSP, that key is used.
'       (2) If the KeyName does not exist and the KeyFile does exist, the key
'           in the KeyFile is installed into the CSP and used.
'   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
'       When specifying the KeyFile, the location of the KeyFile should be
'       relative to the project output directory which is
'       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
'       located in the project directory, you would specify the AssemblyKeyFile
'       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
'   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
'       documentation for more information on this.
'
<Assembly: AssemblyDelaySign(False)>
<Assembly: AssemblyKeyFile("")>
<Assembly: AssemblyKeyName("")>

Form1.Designer.vb

Imports System.Collections
Imports System.ComponentModel
Imports System.IO
Imports System.Reflection
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports FlexCel.Report
Imports FlexCel.Demo.SharedData
Namespace TablesAsDatasources
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Private WithEvents button1 As System.Windows.Forms.Button
        Private saveFileDialog1 As System.Windows.Forms.SaveFileDialog
        Private label1 As System.Windows.Forms.Label
        Private WithEvents btnCancel As System.Windows.Forms.Button
        ''' <summary>
        ''' Required designer variable.
        ''' </summary>
        Private components As System.ComponentModel.Container = Nothing

        ''' <summary>
        ''' Clean up any resources being used.
        ''' </summary>
        Protected Overrides Sub Dispose(ByVal disposing As Boolean)
            If disposing Then
                If components IsNot Nothing Then
                    components.Dispose()
                End If
            End If
            MyBase.Dispose(disposing)
        End Sub

        #Region "Windows Form Designer generated code"
        ''' <summary>
        ''' Required method for Designer support - do not modify
        ''' the contents of this method with the code editor.
        ''' </summary>
        Private Sub InitializeComponent()
            Me.button1 = New System.Windows.Forms.Button()
            Me.saveFileDialog1 = New System.Windows.Forms.SaveFileDialog()
            Me.label1 = New System.Windows.Forms.Label()
            Me.btnCancel = New System.Windows.Forms.Button()
            Me.SuspendLayout()
            '
            ' button1
            '
            Me.button1.Anchor = (CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.button1.BackColor = System.Drawing.Color.Green
            Me.button1.ForeColor = System.Drawing.Color.White
            Me.button1.Location = New System.Drawing.Point(152, 88)
            Me.button1.Name = "button1"
            Me.button1.Size = New System.Drawing.Size(112, 23)
            Me.button1.TabIndex = 0
            Me.button1.Text = "GO!"
            Me.button1.UseVisualStyleBackColor = False
'           Me.button1.Click += New System.EventHandler(Me.button1_Click)
            '
            ' saveFileDialog1
            '
            Me.saveFileDialog1.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm|Excel 97/2003|*.xls|Excel 2007|*.xlsx;*.xlsm|All files|*.*"
            Me.saveFileDialog1.RestoreDirectory = True
            '
            ' label1
            '
            Me.label1.Location = New System.Drawing.Point(24, 24)
            Me.label1.Name = "label1"
            Me.label1.Size = New System.Drawing.Size(272, 24)
            Me.label1.TabIndex = 2
            Me.label1.Text = "Press ""GO"" to create a database Report with a table."
            '
            ' btnCancel
            '
            Me.btnCancel.Anchor = (CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.btnCancel.BackColor = System.Drawing.Color.FromArgb((CInt((CByte(192)))), (CInt((CByte(0)))), (CInt((CByte(0)))))
            Me.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel
            Me.btnCancel.ForeColor = System.Drawing.Color.White
            Me.btnCancel.Location = New System.Drawing.Point(272, 88)
            Me.btnCancel.Name = "btnCancel"
            Me.btnCancel.Size = New System.Drawing.Size(112, 23)
            Me.btnCancel.TabIndex = 3
            Me.btnCancel.Text = "Cancel"
            Me.btnCancel.UseVisualStyleBackColor = False
'           Me.btnCancel.Click += New System.EventHandler(Me.btnCancel_Click)
            '
            ' mainForm
            '
            Me.AutoScaleDimensions = New System.Drawing.SizeF(6F, 13F)
            Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
            Me.ClientSize = New System.Drawing.Size(416, 133)
            Me.Controls.Add(Me.btnCancel)
            Me.Controls.Add(Me.label1)
            Me.Controls.Add(Me.button1)
            Me.Name = "mainForm"
            Me.Text = "Tables as datasources"
            Me.ResumeLayout(False)

        End Sub
        #End Region
    End Class
End Namespace

Form1.vb

Imports System.Collections
Imports System.ComponentModel
Imports System.IO
Imports System.Reflection
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports FlexCel.Report
Imports FlexCel.Demo.SharedData

Namespace TablesAsDatasources
    ''' <summary>
    ''' Summary description for Form1.
    ''' </summary>
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Public Sub New()
            InitializeComponent()
        End Sub

        Private Sub button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button1.Click
            AutoRun()
        End Sub

        Public Sub AutoRun()
            Using ordersReport As FlexCelReport = SharedData.CreateReport()
                ordersReport.SetValue("Date", Date.Now)

                Dim DataPath As String = Path.Combine(Path.Combine(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), ".."), "..") & Path.DirectorySeparatorChar

                If saveFileDialog1.ShowDialog() = System.Windows.Forms.DialogResult.OK Then
                    ordersReport.Run(DataPath & "Tables As Datasources.template.xlsx", saveFileDialog1.FileName)

                    If MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) = System.Windows.Forms.DialogResult.Yes Then
                        Process.Start(saveFileDialog1.FileName)
                    End If
                End If
            End Using
        End Sub

        Private Sub btnCancel_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnCancel.Click
            Close()
        End Sub
    End Class

End Namespace

Program.vb

Namespace TablesAsDatasources
    Friend NotInheritable Class Program

        Private Sub New()
        End Sub

        ''' <summary>
        ''' The main entry point for the application.
        ''' </summary>
       <STAThread> _
        Shared Sub Main()
            Application.EnableVisualStyles()
            Application.SetCompatibleTextRenderingDefault(False)
            Application.Run(New mainForm())
        End Sub
    End Class
End Namespace


Using Entity Framework datasources (VB.Net / netframework) | FlexCel Studio for the .NET Framework documentation

Using Entity Framework datasources (VB.Net / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\vb\VS2022\netframework\20.Reports\24.Entity Framework Reports and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​vb/​VS2022/​netframework/​Modules/​20.​Reports/​24.​Entity Framework Reports

Overview

Note

To run this example, you need to have SQL Server (LocalDB) installed. For this reason, and because it uses NuGet, this demo doesn't run from MainDemo. You need to open this solution and run it alone.

While you can use any generic IQueryable<T> object as a source of reports, here we provide a concrete example of redoing the "range reports" demo using Entity Framework.

Concepts

  • Entity Framework reports should be run inside a serializable or snapshot transaction. While snapshot transactions are preferred as they won't block other users from changing the data while the report is running, in this example we use serializable (Because LocalDB doesn't support snapshot)

  • Here we have an implicit relationship between categories and products, so we don't need to add an explicit one. The report will just work.

Files

AssemblyInfo.vb

Imports System.Reflection
Imports System.Runtime.CompilerServices

'
' General Information about an assembly is controlled through the following
' set of attributes. Change these attribute values to modify the information
' associated with an assembly.
'
<Assembly: AssemblyTitle("")>
<Assembly: AssemblyDescription("")>
<Assembly: AssemblyConfiguration("")>
<Assembly: AssemblyCompany("")>
<Assembly: AssemblyProduct("")>
<Assembly: AssemblyCopyright("")>
<Assembly: AssemblyTrademark("")>
<Assembly: AssemblyCulture("")>

'
' Version information for an assembly consists of the following four values:
'
'      Major Version
'      Minor Version
'      Build Number
'      Revision
'
' You can specify all the values or you can default the Revision and Build Numbers
' by using the '*' as shown below:

<Assembly: AssemblyVersion("1.0.*")>

'
' In order to sign your assembly you must specify a key to use. Refer to the
' Microsoft .NET Framework documentation for more information on assembly signing.
'
' Use the attributes below to control which key is used for signing.
'
' Notes:
'   (*) If no key is specified, the assembly is not signed.
'   (*) KeyName refers to a key that has been installed in the Crypto Service
'       Provider (CSP) on your machine. KeyFile refers to a file which contains
'       a key.
'   (*) If the KeyFile and the KeyName values are both specified, the
'       following processing occurs:
'       (1) If the KeyName can be found in the CSP, that key is used.
'       (2) If the KeyName does not exist and the KeyFile does exist, the key
'           in the KeyFile is installed into the CSP and used.
'   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
'       When specifying the KeyFile, the location of the KeyFile should be
'       relative to the project output directory which is
'       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
'       located in the project directory, you would specify the AssemblyKeyFile
'       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
'   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
'       documentation for more information on this.
'
<Assembly: AssemblyDelaySign(False)>
<Assembly: AssemblyKeyFile("")>
<Assembly: AssemblyKeyName("")>

Category.vb

'------------------------------------------------------------------------------
' <auto-generated>
'     This code was generated from a template.
'
'     Manual changes to this file may cause unexpected behavior in your application.
'     Manual changes to this file will be overwritten if the code is regenerated.
' </auto-generated>
'------------------------------------------------------------------------------

Namespace EntityFrameworkReports

    Partial Public Class Category
        <System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")> _
        Public Sub New()
            Me.Products = New HashSet(Of Product)()
        End Sub

        Public Property CategoryID() As Integer
        Public Property CategoryName() As String
        Public Property Description() As String
        Public Property Picture() As Byte()

        <System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")> _
        Public Overridable Property Products() As ICollection(Of Product)
    End Class
End Namespace

Customer.vb

'------------------------------------------------------------------------------
' <auto-generated>
'     This code was generated from a template.
'
'     Manual changes to this file may cause unexpected behavior in your application.
'     Manual changes to this file will be overwritten if the code is regenerated.
' </auto-generated>
'------------------------------------------------------------------------------

Namespace EntityFrameworkReports

    Partial Public Class Customer
        <System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")> _
        Public Sub New()
            Me.Orders = New HashSet(Of Order)()
            Me.CustomerDemographics = New HashSet(Of CustomerDemographic)()
        End Sub

        Public Property CustomerID() As String
        Public Property CompanyName() As String
        Public Property ContactName() As String
        Public Property ContactTitle() As String
        Public Property Address() As String
        Public Property City() As String
        Public Property Region() As String
        Public Property PostalCode() As String
        Public Property Country() As String
        Public Property Phone() As String
        Public Property Fax() As String

        <System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")> _
        Public Overridable Property Orders() As ICollection(Of Order)
        <System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")> _
        Public Overridable Property CustomerDemographics() As ICollection(Of CustomerDemographic)
    End Class
End Namespace

CustomerDemographic.vb

'------------------------------------------------------------------------------
' <auto-generated>
'     This code was generated from a template.
'
'     Manual changes to this file may cause unexpected behavior in your application.
'     Manual changes to this file will be overwritten if the code is regenerated.
' </auto-generated>
'------------------------------------------------------------------------------

Namespace EntityFrameworkReports

    Partial Public Class CustomerDemographic
        <System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")> _
        Public Sub New()
            Me.Customers = New HashSet(Of Customer)()
        End Sub

        Public Property CustomerTypeID() As String
        Public Property CustomerDesc() As String

        <System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")> _
        Public Overridable Property Customers() As ICollection(Of Customer)
    End Class
End Namespace

Employee.vb

'------------------------------------------------------------------------------
' <auto-generated>
'     This code was generated from a template.
'
'     Manual changes to this file may cause unexpected behavior in your application.
'     Manual changes to this file will be overwritten if the code is regenerated.
' </auto-generated>
'------------------------------------------------------------------------------

Namespace EntityFrameworkReports

    Partial Public Class Employee
        <System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")> _
        Public Sub New()
            Me.Employees1 = New HashSet(Of Employee)()
            Me.Orders = New HashSet(Of Order)()
            Me.Territories = New HashSet(Of Territory)()
        End Sub

        Public Property EmployeeID() As Integer
        Public Property LastName() As String
        Public Property FirstName() As String
        Public Property Title() As String
        Public Property TitleOfCourtesy() As String
        Public Property BirthDate() As Date?
        Public Property HireDate() As Date?
        Public Property Address() As String
        Public Property City() As String
        Public Property Region() As String
        Public Property PostalCode() As String
        Public Property Country() As String
        Public Property HomePhone() As String
        Public Property Extension() As String
        Public Property Photo() As Byte()
        Public Property Notes() As String
        Public Property ReportsTo() As Integer?
        Public Property PhotoPath() As String

        <System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")> _
        Public Overridable Property Employees1() As ICollection(Of Employee)
        Public Overridable Property Employee1() As Employee
        <System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")> _
        Public Overridable Property Orders() As ICollection(Of Order)
        <System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")> _
        Public Overridable Property Territories() As ICollection(Of Territory)
    End Class
End Namespace

Form1.Designer.vb

Imports System.Collections
Imports System.ComponentModel
Imports System.IO
Imports System.Reflection
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports FlexCel.Report

Namespace EntityFrameworkReports
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Private WithEvents button1 As System.Windows.Forms.Button
        Private saveFileDialog1 As System.Windows.Forms.SaveFileDialog
        Private label1 As System.Windows.Forms.Label
        Private WithEvents btnCancel As System.Windows.Forms.Button
        ''' <summary>
        ''' Required designer variable.
        ''' </summary>
        Private components As System.ComponentModel.Container = Nothing

        ''' <summary>
        ''' Clean up any resources being used.
        ''' </summary>
        Protected Overrides Sub Dispose(ByVal disposing As Boolean)
            If disposing Then
                If components IsNot Nothing Then
                    components.Dispose()
                End If
            End If
            MyBase.Dispose(disposing)
        End Sub

        #Region "Windows Form Designer generated code"
        ''' <summary>
        ''' Required method for Designer support - do not modify
        ''' the contents of this method with the code editor.
        ''' </summary>
        Private Sub InitializeComponent()
            Me.button1 = New System.Windows.Forms.Button()
            Me.saveFileDialog1 = New System.Windows.Forms.SaveFileDialog()
            Me.label1 = New System.Windows.Forms.Label()
            Me.btnCancel = New System.Windows.Forms.Button()
            Me.SuspendLayout()
            '
            ' button1
            '
            Me.button1.Anchor = (CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.button1.BackColor = System.Drawing.Color.Green
            Me.button1.ForeColor = System.Drawing.Color.White
            Me.button1.Location = New System.Drawing.Point(152, 88)
            Me.button1.Name = "button1"
            Me.button1.Size = New System.Drawing.Size(112, 23)
            Me.button1.TabIndex = 0
            Me.button1.Text = "GO!"
            Me.button1.UseVisualStyleBackColor = False
'           Me.button1.Click += New System.EventHandler(Me.button1_Click)
            '
            ' saveFileDialog1
            '
            Me.saveFileDialog1.Filter = "Excel Files|*.xls"
            Me.saveFileDialog1.RestoreDirectory = True
            '
            ' label1
            '
            Me.label1.Location = New System.Drawing.Point(24, 24)
            Me.label1.Name = "label1"
            Me.label1.Size = New System.Drawing.Size(272, 24)
            Me.label1.TabIndex = 2
            Me.label1.Text = "Press ""GO"" to create a database Report."
            '
            ' btnCancel
            '
            Me.btnCancel.Anchor = (CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.btnCancel.BackColor = System.Drawing.Color.FromArgb((CInt((CByte(192)))), (CInt((CByte(0)))), (CInt((CByte(0)))))
            Me.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel
            Me.btnCancel.ForeColor = System.Drawing.Color.White
            Me.btnCancel.Location = New System.Drawing.Point(272, 88)
            Me.btnCancel.Name = "btnCancel"
            Me.btnCancel.Size = New System.Drawing.Size(112, 23)
            Me.btnCancel.TabIndex = 3
            Me.btnCancel.Text = "Cancel"
            Me.btnCancel.UseVisualStyleBackColor = False
'           Me.btnCancel.Click += New System.EventHandler(Me.btnCancel_Click)
            '
            ' mainForm
            '
            Me.AutoScaleDimensions = New System.Drawing.SizeF(6F, 13F)
            Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
            Me.ClientSize = New System.Drawing.Size(416, 133)
            Me.Controls.Add(Me.btnCancel)
            Me.Controls.Add(Me.label1)
            Me.Controls.Add(Me.button1)
            Me.Name = "mainForm"
            Me.Text = "Entity Framework Reports"
            Me.ResumeLayout(False)

        End Sub
        #End Region
    End Class
End Namespace

Form1.vb

Imports System.Collections
Imports System.ComponentModel
Imports System.IO
Imports System.Reflection
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports FlexCel.Report
Imports System.Transactions
Imports System.Configuration

Namespace EntityFrameworkReports
    ''' <summary>
    ''' Summary description for Form1.
    ''' </summary>
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Public Sub New()
            InitializeComponent()
        End Sub

        Private Sub button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button1.Click
            AutoRun()
        End Sub

        Public Sub AutoRun()
            Using ordersReport As New FlexCelReport(True)
                Dim DataPath As String = Path.Combine(Path.Combine(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), ".."), "..") & Path.DirectorySeparatorChar
                ordersReport.SetValue("Date", Date.Now)

                Using Northwind As New northwndEntities()
                    ordersReport.AddTable("Categories", Northwind.Categories)
                    ordersReport.AddTable("Products", Northwind.Products)

                    If saveFileDialog1.ShowDialog() = System.Windows.Forms.DialogResult.OK Then
                        Dim transactionOptions As New TransactionOptions()
                        transactionOptions.IsolationLevel = System.Transactions.IsolationLevel.Serializable 'it would be better to sue Snapshot here, but it isn't supported by SQL Sever CE
                        Using transactionScope As New TransactionScope(TransactionScopeOption.Required, transactionOptions)
                            ordersReport.Run(DataPath & "Entity Framework Reports.template.xls", saveFileDialog1.FileName)
                            transactionScope.Complete()
                        End Using

                        If MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) = System.Windows.Forms.DialogResult.Yes Then
                            Process.Start(saveFileDialog1.FileName)
                        End If
                    End If
                End Using
            End Using
        End Sub

        Private Sub btnCancel_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnCancel.Click
            Close()
        End Sub
    End Class

End Namespace

ModelNorthwind.Context.vb

Imports System.Data.Entity.Infrastructure
Imports System.Data.Entity

'------------------------------------------------------------------------------
' <auto-generated>
'     This code was generated from a template.
'
'     Manual changes to this file may cause unexpected behavior in your application.
'     Manual changes to this file will be overwritten if the code is regenerated.
' </auto-generated>
'------------------------------------------------------------------------------

Namespace EntityFrameworkReports

    Partial Public Class northwndEntities
        Inherits DbContext

        Public Sub New()
            MyBase.New("name=northwndEntities")
        End Sub

        Protected Overrides Sub OnModelCreating(ByVal modelBuilder As DbModelBuilder)
            Throw New UnintentionalCodeFirstException()
        End Sub

        Public Overridable Property Categories() As DbSet(Of Category)
        Public Overridable Property CustomerDemographics() As DbSet(Of CustomerDemographic)
        Public Overridable Property Customers() As DbSet(Of Customer)
        Public Overridable Property Employees() As DbSet(Of Employee)
        Public Overridable Property Order_Details() As DbSet(Of Order_Detail)
        Public Overridable Property Orders() As DbSet(Of Order)
        Public Overridable Property Products() As DbSet(Of Product)
        Public Overridable Property Regions() As DbSet(Of Region)
        Public Overridable Property Shippers() As DbSet(Of Shipper)
        Public Overridable Property Suppliers() As DbSet(Of Supplier)
        Public Overridable Property Territories() As DbSet(Of Territory)
    End Class
End Namespace

ModelNorthwind.Designer.vb

' T4 code generation is enabled for model ''.
' To enable legacy code generation, change the value of the 'Code Generation Strategy' designer
' property to 'Legacy ObjectContext'. This property is available in the Properties Window when the model
' is open in the designer.

' If no context and entity classes have been generated, it may be because you created an empty model but
' have not yet chosen which version of Entity Framework to use. To generate a context class and entity
' classes for your model, open the model in the designer, right-click on the designer surface, and
' select 'Update Model from Database...', 'Generate Database from Model...', or 'Add Code Generation
' Item...'.

ModelNorthwind.vb

'------------------------------------------------------------------------------
' <auto-generated>
'     This code was generated from a template.
'
'     Manual changes to this file may cause unexpected behavior in your application.
'     Manual changes to this file will be overwritten if the code is regenerated.
' </auto-generated>
'------------------------------------------------------------------------------

Order.vb

'------------------------------------------------------------------------------
' <auto-generated>
'     This code was generated from a template.
'
'     Manual changes to this file may cause unexpected behavior in your application.
'     Manual changes to this file will be overwritten if the code is regenerated.
' </auto-generated>
'------------------------------------------------------------------------------

Namespace EntityFrameworkReports

    Partial Public Class Order
        <System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")> _
        Public Sub New()
            Me.Order_Details = New HashSet(Of Order_Detail)()
        End Sub

        Public Property OrderID() As Integer
        Public Property CustomerID() As String
        Public Property EmployeeID() As Integer?
        Public Property OrderDate() As Date?
        Public Property RequiredDate() As Date?
        Public Property ShippedDate() As Date?
        Public Property ShipVia() As Integer?
        Public Property Freight() As Decimal?
        Public Property ShipName() As String
        Public Property ShipAddress() As String
        Public Property ShipCity() As String
        Public Property ShipRegion() As String
        Public Property ShipPostalCode() As String
        Public Property ShipCountry() As String

        Public Overridable Property Customer() As Customer
        Public Overridable Property Employee() As Employee
        <System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")> _
        Public Overridable Property Order_Details() As ICollection(Of Order_Detail)
        Public Overridable Property Shipper() As Shipper
    End Class
End Namespace

Order_Detail.vb

'------------------------------------------------------------------------------
' <auto-generated>
'     This code was generated from a template.
'
'     Manual changes to this file may cause unexpected behavior in your application.
'     Manual changes to this file will be overwritten if the code is regenerated.
' </auto-generated>
'------------------------------------------------------------------------------

Namespace EntityFrameworkReports

    Partial Public Class Order_Detail
        Public Property OrderID() As Integer
        Public Property ProductID() As Integer
        Public Property UnitPrice() As Decimal
        Public Property Quantity() As Short
        Public Property Discount() As Single

        Public Overridable Property Order() As Order
        Public Overridable Property Product() As Product
    End Class
End Namespace

Product.vb

'------------------------------------------------------------------------------
' <auto-generated>
'     This code was generated from a template.
'
'     Manual changes to this file may cause unexpected behavior in your application.
'     Manual changes to this file will be overwritten if the code is regenerated.
' </auto-generated>
'------------------------------------------------------------------------------

Namespace EntityFrameworkReports

    Partial Public Class Product
        <System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")> _
        Public Sub New()
            Me.Order_Details = New HashSet(Of Order_Detail)()
        End Sub

        Public Property ProductID() As Integer
        Public Property ProductName() As String
        Public Property SupplierID() As Integer?
        Public Property CategoryID() As Integer?
        Public Property QuantityPerUnit() As String
        Public Property UnitPrice() As Decimal?
        Public Property UnitsInStock() As Short?
        Public Property UnitsOnOrder() As Short?
        Public Property ReorderLevel() As Short?
        Public Property Discontinued() As Boolean

        Public Overridable Property Category() As Category
        <System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")> _
        Public Overridable Property Order_Details() As ICollection(Of Order_Detail)
        Public Overridable Property Supplier() As Supplier
    End Class
End Namespace

Program.vb

Namespace EntityFrameworkReports
    Friend NotInheritable Class Program

        Private Sub New()
        End Sub

        ''' <summary>
        ''' The main entry point for the application.
        ''' </summary>
       <STAThread> _
        Shared Sub Main()
            Application.EnableVisualStyles()
            Application.SetCompatibleTextRenderingDefault(False)
            Application.Run(New mainForm())
        End Sub
    End Class
End Namespace

Region.vb

'------------------------------------------------------------------------------
' <auto-generated>
'     This code was generated from a template.
'
'     Manual changes to this file may cause unexpected behavior in your application.
'     Manual changes to this file will be overwritten if the code is regenerated.
' </auto-generated>
'------------------------------------------------------------------------------

Namespace EntityFrameworkReports

    Partial Public Class Region
        <System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")> _
        Public Sub New()
            Me.Territories = New HashSet(Of Territory)()
        End Sub

        Public Property RegionID() As Integer
        Public Property RegionDescription() As String

        <System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")> _
        Public Overridable Property Territories() As ICollection(Of Territory)
    End Class
End Namespace

Shipper.vb

'------------------------------------------------------------------------------
' <auto-generated>
'     This code was generated from a template.
'
'     Manual changes to this file may cause unexpected behavior in your application.
'     Manual changes to this file will be overwritten if the code is regenerated.
' </auto-generated>
'------------------------------------------------------------------------------

Namespace EntityFrameworkReports

    Partial Public Class Shipper
        <System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")> _
        Public Sub New()
            Me.Orders = New HashSet(Of Order)()
        End Sub

        Public Property ShipperID() As Integer
        Public Property CompanyName() As String
        Public Property Phone() As String

        <System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")> _
        Public Overridable Property Orders() As ICollection(Of Order)
    End Class
End Namespace

Supplier.vb

'------------------------------------------------------------------------------
' <auto-generated>
'     This code was generated from a template.
'
'     Manual changes to this file may cause unexpected behavior in your application.
'     Manual changes to this file will be overwritten if the code is regenerated.
' </auto-generated>
'------------------------------------------------------------------------------

Namespace EntityFrameworkReports

    Partial Public Class Supplier
        <System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")> _
        Public Sub New()
            Me.Products = New HashSet(Of Product)()
        End Sub

        Public Property SupplierID() As Integer
        Public Property CompanyName() As String
        Public Property ContactName() As String
        Public Property ContactTitle() As String
        Public Property Address() As String
        Public Property City() As String
        Public Property Region() As String
        Public Property PostalCode() As String
        Public Property Country() As String
        Public Property Phone() As String
        Public Property Fax() As String
        Public Property HomePage() As String

        <System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")> _
        Public Overridable Property Products() As ICollection(Of Product)
    End Class
End Namespace

Territory.vb

'------------------------------------------------------------------------------
' <auto-generated>
'     This code was generated from a template.
'
'     Manual changes to this file may cause unexpected behavior in your application.
'     Manual changes to this file will be overwritten if the code is regenerated.
' </auto-generated>
'------------------------------------------------------------------------------

Namespace EntityFrameworkReports

    Partial Public Class Territory
        <System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")> _
        Public Sub New()
            Me.Employees = New HashSet(Of Employee)()
        End Sub

        Public Property TerritoryID() As String
        Public Property TerritoryDescription() As String
        Public Property RegionID() As Integer

        Public Overridable Property Region() As Region
        <System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")> _
        Public Overridable Property Employees() As ICollection(Of Employee)
    End Class
End Namespace


Multiple sheet report (VB.Net / netframework) | FlexCel Studio for the .NET Framework documentation

Multiple sheet report (VB.Net / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\vb\VS2022\netframework\20.Reports\25.Multiple sheet report and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​vb/​VS2022/​netframework/​Modules/​20.​Reports/​25.​Multiple sheet report

Overview

Here we are going to create a report using each entry on the table Categories to create a new sheet. For each category, we will list the products and the order details of each product.

Concepts

  • How to use a table to create a report on multiple sheets.

  • Defining Custom Formats to have alternating color rows

  • This is a three level master detail report: Category -> Products -> Order Details. The first level is on the sheet, and this is handled automatically. Any datatable with a relation defined with "category" datatable will be filtered accordingly on each sheet.

  • Grouping and Outlining. To create a report using outlining, just define the outline on the template and it will expand as needed.

Files

AssemblyInfo.vb

Imports System.Reflection
Imports System.Runtime.CompilerServices

'
' General Information about an assembly is controlled through the following
' set of attributes. Change these attribute values to modify the information
' associated with an assembly.
'
<Assembly: AssemblyTitle("")>
<Assembly: AssemblyDescription("")>
<Assembly: AssemblyConfiguration("")>
<Assembly: AssemblyCompany("")>
<Assembly: AssemblyProduct("")>
<Assembly: AssemblyCopyright("(c) 2002 - 2014 TMS Software")>
<Assembly: AssemblyTrademark("")>
<Assembly: AssemblyCulture("")>

'
' Version information for an assembly consists of the following four values:
'
'      Major Version
'      Minor Version
'      Build Number
'      Revision
'
' You can specify all the values or you can default the Revision and Build Numbers
' by using the '*' as shown below:

<Assembly: AssemblyVersion("6.2.1.0")>

'
' In order to sign your assembly you must specify a key to use. Refer to the
' Microsoft .NET Framework documentation for more information on assembly signing.
'
' Use the attributes below to control which key is used for signing.
'
' Notes:
'   (*) If no key is specified, the assembly is not signed.
'   (*) KeyName refers to a key that has been installed in the Crypto Service
'       Provider (CSP) on your machine. KeyFile refers to a file which contains
'       a key.
'   (*) If the KeyFile and the KeyName values are both specified, the
'       following processing occurs:
'       (1) If the KeyName can be found in the CSP, that key is used.
'       (2) If the KeyName does not exist and the KeyFile does exist, the key
'           in the KeyFile is installed into the CSP and used.
'   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
'       When specifying the KeyFile, the location of the KeyFile should be
'       relative to the project output directory which is
'       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
'       located in the project directory, you would specify the AssemblyKeyFile
'       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
'   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
'       documentation for more information on this.
'
<Assembly: AssemblyDelaySign(False)>
<Assembly: AssemblyKeyFile("")>
<Assembly: AssemblyKeyName("")>

Form1.Designer.vb

Imports System.Collections
Imports System.ComponentModel
Imports System.IO
Imports System.Reflection
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports FlexCel.Report
Imports FlexCel.Demo.SharedData
Namespace Multiplesheetreport
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Private WithEvents button1 As System.Windows.Forms.Button
        Private saveFileDialog1 As System.Windows.Forms.SaveFileDialog
        Private label1 As System.Windows.Forms.Label
        Private WithEvents btnCancel As System.Windows.Forms.Button
        ''' <summary>
        ''' Required designer variable.
        ''' </summary>
        Private components As System.ComponentModel.Container = Nothing

        ''' <summary>
        ''' Clean up any resources being used.
        ''' </summary>
        Protected Overrides Sub Dispose(ByVal disposing As Boolean)
            If disposing Then
                If components IsNot Nothing Then
                    components.Dispose()
                End If
            End If
            MyBase.Dispose(disposing)
        End Sub

        #Region "Windows Form Designer generated code"
        ''' <summary>
        ''' Required method for Designer support - do not modify
        ''' the contents of this method with the code editor.
        ''' </summary>
        Private Sub InitializeComponent()
            Me.button1 = New System.Windows.Forms.Button()
            Me.saveFileDialog1 = New System.Windows.Forms.SaveFileDialog()
            Me.label1 = New System.Windows.Forms.Label()
            Me.btnCancel = New System.Windows.Forms.Button()
            Me.SuspendLayout()
            '
            ' button1
            '
            Me.button1.Anchor = (CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.button1.BackColor = System.Drawing.Color.Green
            Me.button1.ForeColor = System.Drawing.Color.White
            Me.button1.Location = New System.Drawing.Point(152, 88)
            Me.button1.Name = "button1"
            Me.button1.Size = New System.Drawing.Size(112, 23)
            Me.button1.TabIndex = 0
            Me.button1.Text = "GO!"
            Me.button1.UseVisualStyleBackColor = False
'           Me.button1.Click += New System.EventHandler(Me.button1_Click)
            '
            ' saveFileDialog1
            '
            Me.saveFileDialog1.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm|Excel 97/2003|*.xls|Excel 2007|*.xlsx;*.xlsm|All files|*.*"
            Me.saveFileDialog1.RestoreDirectory = True
            '
            ' label1
            '
            Me.label1.Location = New System.Drawing.Point(24, 24)
            Me.label1.Name = "label1"
            Me.label1.Size = New System.Drawing.Size(288, 24)
            Me.label1.TabIndex = 2
            Me.label1.Text = "A report with a sheet per category."
            '
            ' btnCancel
            '
            Me.btnCancel.Anchor = (CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.btnCancel.BackColor = System.Drawing.Color.FromArgb((CInt((CByte(192)))), (CInt((CByte(0)))), (CInt((CByte(0)))))
            Me.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel
            Me.btnCancel.ForeColor = System.Drawing.Color.White
            Me.btnCancel.Location = New System.Drawing.Point(272, 88)
            Me.btnCancel.Name = "btnCancel"
            Me.btnCancel.Size = New System.Drawing.Size(112, 23)
            Me.btnCancel.TabIndex = 3
            Me.btnCancel.Text = "Cancel"
            Me.btnCancel.UseVisualStyleBackColor = False
'           Me.btnCancel.Click += New System.EventHandler(Me.btnCancel_Click)
            '
            ' mainForm
            '
            Me.AutoScaleDimensions = New System.Drawing.SizeF(6F, 13F)
            Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
            Me.ClientSize = New System.Drawing.Size(416, 133)
            Me.Controls.Add(Me.btnCancel)
            Me.Controls.Add(Me.label1)
            Me.Controls.Add(Me.button1)
            Me.Name = "mainForm"
            Me.Text = "Multiple Sheet Report"
            Me.ResumeLayout(False)

        End Sub
        #End Region
    End Class
End Namespace

Form1.vb

Imports System.Collections
Imports System.ComponentModel
Imports System.IO
Imports System.Reflection
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports FlexCel.Report
Imports FlexCel.Demo.SharedData

Namespace Multiplesheetreport
    ''' <summary>
    ''' Multiple range reports
    ''' </summary>
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Public Sub New()
            InitializeComponent()
        End Sub

        Private Sub button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button1.Click
            AutoRun()
        End Sub

        Public Sub AutoRun()
            Using ordersReport As FlexCelReport = SharedData.CreateReport()
                ordersReport.SetValue("Date", Date.Now)

                Dim DataPath As String = Path.Combine(Path.Combine(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), ".."), "..") & Path.DirectorySeparatorChar

                If saveFileDialog1.ShowDialog() = System.Windows.Forms.DialogResult.OK Then
                    ordersReport.Run(DataPath & "Multiple sheet report.template.xls", saveFileDialog1.FileName)

                    If MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) = System.Windows.Forms.DialogResult.Yes Then
                        Process.Start(saveFileDialog1.FileName)
                    End If
                End If
            End Using
        End Sub

        Private Sub btnCancel_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnCancel.Click
            Close()
        End Sub
    End Class

End Namespace

Program.vb

Namespace Multiplesheetreport
    Friend NotInheritable Class Program

        Private Sub New()
        End Sub

        ''' <summary>
        ''' The main entry point for the application.
        ''' </summary>
       <STAThread> _
        Shared Sub Main()
            Application.EnableVisualStyles()
            Application.SetCompatibleTextRenderingDefault(False)
            Application.Run(New mainForm())
        End Sub
    End Class
End Namespace


Exporting Web Services (VB.Net / netframework) | FlexCel Studio for the .NET Framework documentation

Exporting Web Services (VB.Net / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\vb\VS2022\netframework\20.Reports\27.Exporting Web Services and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​vb/​VS2022/​netframework/​Modules/​20.​Reports/​27.​Exporting Web Services

Overview

A demo that accesses the NOAA Meteorological web service and returns an Excel file with the forecast. Just in case you do not have an Internet connection available, some sample data is included to work offline too.

Concepts

How to export the data on a Web Service to Excel or PDF.

Files

AssemblyInfo.vb

Imports System.Reflection
Imports System.Runtime.CompilerServices

'
' General Information about an assembly is controlled through the following
' set of attributes. Change these attribute values to modify the information
' associated with an assembly.
'
<Assembly: AssemblyTitle("")>
<Assembly: AssemblyDescription("")>
<Assembly: AssemblyConfiguration("")>
<Assembly: AssemblyCompany("")>
<Assembly: AssemblyProduct("")>
<Assembly: AssemblyCopyright("(c) 2002 - 2014 TMS Software")>
<Assembly: AssemblyTrademark("")>
<Assembly: AssemblyCulture("")>

'
' Version information for an assembly consists of the following four values:
'
'      Major Version
'      Minor Version
'      Build Number
'      Revision
'
' You can specify all the values or you can default the Revision and Build Numbers
' by using the '*' as shown below:

<Assembly: AssemblyVersion("6.2.1.0")>

'
' In order to sign your assembly you must specify a key to use. Refer to the
' Microsoft .NET Framework documentation for more information on assembly signing.
'
' Use the attributes below to control which key is used for signing.
'
' Notes:
'   (*) If no key is specified, the assembly is not signed.
'   (*) KeyName refers to a key that has been installed in the Crypto Service
'       Provider (CSP) on your machine. KeyFile refers to a file which contains
'       a key.
'   (*) If the KeyFile and the KeyName values are both specified, the
'       following processing occurs:
'       (1) If the KeyName can be found in the CSP, that key is used.
'       (2) If the KeyName does not exist and the KeyFile does exist, the key
'           in the KeyFile is installed into the CSP and used.
'   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
'       When specifying the KeyFile, the location of the KeyFile should be
'       relative to the project output directory which is
'       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
'       located in the project directory, you would specify the AssemblyKeyFile
'       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
'   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
'       documentation for more information on this.
'
<Assembly: AssemblyDelaySign(False)>
<Assembly: AssemblyKeyFile("")>
<Assembly: AssemblyKeyName("")>

Form1.Designer.vb

Imports System.Collections
Imports System.ComponentModel
Imports System.IO
Imports System.Reflection
Imports System.Xml
Imports System.Net
Imports System.Threading
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports FlexCel.Report
Imports FlexCel.Render
Namespace ExportingWebServices
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        ''' <summary>
        ''' Required designer variable.
        ''' </summary>
        Private components As System.ComponentModel.Container = Nothing

        ''' <summary>
        ''' Clean up any resources being used.
        ''' </summary>
        Protected Overrides Sub Dispose(ByVal disposing As Boolean)
            If disposing Then
                If components IsNot Nothing Then
                    components.Dispose()
                End If
            End If
            MyBase.Dispose(disposing)
        End Sub

#Region "Windows Form Designer generated code"
        ''' <summary>
        ''' Required method for Designer support - do not modify
        ''' the contents of this method with the code editor.
        ''' </summary>
        Private Sub InitializeComponent()
            Me.btnExportXls = New System.Windows.Forms.Button()
            Me.saveFileDialogXls = New System.Windows.Forms.SaveFileDialog()
            Me.reportStart = New FlexCel.Report.FlexCelReport()
            Me.btnCancel = New System.Windows.Forms.Button()
            Me.label3 = New System.Windows.Forms.Label()
            Me.cbOffline = New System.Windows.Forms.CheckBox()
            Me.btnExportPdf = New System.Windows.Forms.Button()
            Me.saveFileDialogPdf = New System.Windows.Forms.SaveFileDialog()
            Me.edcity = New System.Windows.Forms.ComboBox()
            Me.SuspendLayout()
            '
            ' btnExportXls
            '
            Me.btnExportXls.Anchor = (CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.btnExportXls.BackColor = System.Drawing.Color.Green
            Me.btnExportXls.ForeColor = System.Drawing.Color.White
            Me.btnExportXls.Location = New System.Drawing.Point(16, 120)
            Me.btnExportXls.Name = "btnExportXls"
            Me.btnExportXls.Size = New System.Drawing.Size(112, 23)
            Me.btnExportXls.TabIndex = 0
            Me.btnExportXls.Text = "Export to Excel"
            Me.btnExportXls.UseVisualStyleBackColor = False
            '           Me.btnExportXls.Click += New System.EventHandler(Me.btnExportXls_Click)
            '
            ' saveFileDialogXls
            '
            Me.saveFileDialogXls.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm|Excel 97/2003|*.xls|Excel 2007|*.xlsx;*.xlsm|All " & "files|*.*"
            Me.saveFileDialogXls.RestoreDirectory = True
            '
            ' reportStart
            '
            Me.reportStart.AllowOverwritingFiles = True
            Me.reportStart.DeleteEmptyRanges = False
            '
            ' btnCancel
            '
            Me.btnCancel.Anchor = (CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.btnCancel.BackColor = System.Drawing.Color.FromArgb((CInt((CByte(192)))), (CInt((CByte(0)))), (CInt((CByte(0)))))
            Me.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel
            Me.btnCancel.ForeColor = System.Drawing.Color.White
            Me.btnCancel.Location = New System.Drawing.Point(272, 120)
            Me.btnCancel.Name = "btnCancel"
            Me.btnCancel.Size = New System.Drawing.Size(112, 23)
            Me.btnCancel.TabIndex = 3
            Me.btnCancel.Text = "Cancel"
            Me.btnCancel.UseVisualStyleBackColor = False
            '           Me.btnCancel.Click += New System.EventHandler(Me.btnCancel_Click)
            '
            ' label3
            '
            Me.label3.Location = New System.Drawing.Point(32, 19)
            Me.label3.Name = "label3"
            Me.label3.Size = New System.Drawing.Size(40, 85)
            Me.label3.TabIndex = 8
            Me.label3.Text = "City:"
            '
            ' cbOffline
            '
            Me.cbOffline.Checked = True
            Me.cbOffline.CheckState = System.Windows.Forms.CheckState.Checked
            Me.cbOffline.Location = New System.Drawing.Point(32, 80)
            Me.cbOffline.Name = "cbOffline"
            Me.cbOffline.Size = New System.Drawing.Size(352, 24)
            Me.cbOffline.TabIndex = 10
            Me.cbOffline.Text = "Use offline data. (do not actually connect to the web service)"
            '
            ' btnExportPdf
            '
            Me.btnExportPdf.Anchor = (CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.btnExportPdf.BackColor = System.Drawing.Color.SteelBlue
            Me.btnExportPdf.ForeColor = System.Drawing.Color.White
            Me.btnExportPdf.Location = New System.Drawing.Point(144, 120)
            Me.btnExportPdf.Name = "btnExportPdf"
            Me.btnExportPdf.Size = New System.Drawing.Size(112, 23)
            Me.btnExportPdf.TabIndex = 11
            Me.btnExportPdf.Text = "Export to Pdf"
            Me.btnExportPdf.UseVisualStyleBackColor = False
            '           Me.btnExportPdf.Click += New System.EventHandler(Me.btnExportPdf_Click)
            '
            ' saveFileDialogPdf
            '
            Me.saveFileDialogPdf.Filter = "Pdf Files|*.pdf"
            Me.saveFileDialogPdf.RestoreDirectory = True
            '
            ' edcity
            '
            Me.edcity.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend
            Me.edcity.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems
            Me.edcity.FormattingEnabled = True
            Me.edcity.Location = New System.Drawing.Point(78, 12)
            Me.edcity.MaxDropDownItems = 32
            Me.edcity.Name = "edcity"
            Me.edcity.Size = New System.Drawing.Size(306, 21)
            Me.edcity.TabIndex = 12
            '           Me.edcity.KeyDown += New System.Windows.Forms.KeyEventHandler(Me.edcity_KeyDown)
            '
            ' mainForm
            '
            Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0F, 13.0F)
            Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
            Me.ClientSize = New System.Drawing.Size(416, 157)
            Me.Controls.Add(Me.edcity)
            Me.Controls.Add(Me.btnExportPdf)
            Me.Controls.Add(Me.cbOffline)
            Me.Controls.Add(Me.label3)
            Me.Controls.Add(Me.btnCancel)
            Me.Controls.Add(Me.btnExportXls)
            Me.Name = "mainForm"
            Me.Text = "Exporting Web Services"
            Me.ResumeLayout(False)

        End Sub
#End Region

        Private WithEvents btnCancel As System.Windows.Forms.Button
        Private label3 As System.Windows.Forms.Label
        Private cbOffline As System.Windows.Forms.CheckBox
        Private WithEvents btnExportXls As System.Windows.Forms.Button
        Private WithEvents btnExportPdf As System.Windows.Forms.Button
        Private saveFileDialogXls As System.Windows.Forms.SaveFileDialog
        Private saveFileDialogPdf As System.Windows.Forms.SaveFileDialog
        Private reportStart As FlexCel.Report.FlexCelReport
        Private WithEvents edcity As ComboBox

    End Class
End Namespace

Form1.vb

'This program is inspired on the progam by Mikhail Arkhipov
' * at http://blogs.msdn.com/mikhailarkhipov/archive/2004/08/12/213963.aspx
' * Thanks!
'

' UPDATE: This was patched with the info on
' * http://weblogs.asp.net/jan/archive/2004/01/28/63771.aspx
' * to make it work.
' *
' * Thanks again...
' *
' * UPDATE 2!
' * The NOAA broke the service again, and it has not fixed it for more than a year.
' * I give up. We will use http://www.webservicex.net/WeatherForecast.asmx instead.
' * The code for NOAA is still there on the SetupNOAA method, just not used so you can see it (and try it if it ever starts working again)
' *
' * UPDATE 3!
' * Now WebserviceX is not working, going back to NOAA. As you can see, it isn't very trustable that a webservice will be there in the
' * future, so this demo might not work in online mode when you try it. But you can always look at in in offline mode.
' *

Imports System.ComponentModel
Imports System.IO
Imports System.Reflection
Imports System.Xml
Imports System.Net
Imports System.Threading

Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports FlexCel.Report
Imports FlexCel.Render

Imports gov.weather.www
Imports System.Globalization

Namespace ExportingWebServices
    ''' <summary>
    ''' An example that will read data from a webservice.
    ''' </summary>
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Private Cities As New Dictionary(Of String, LatLong)(StringComparer.CurrentCultureIgnoreCase)
        Public Sub New()
            InitializeComponent()
            LoadCities()
        End Sub

        Private Sub LoadCities()
            Dim xml As New XmlDocument()
                Dim DataPath As String = Path.Combine(Path.Combine(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), ".."), "..") & Path.DirectorySeparatorChar
                xml.Load(Path.Combine(DataPath, "cities.xml"))
                Dim latLonList As XmlNodeList = xml.GetElementsByTagName("latLonList")
                Dim cityNameList As XmlNodeList = xml.GetElementsByTagName("cityNameList")

                If latLonList.Count <> 1 Then
                    Throw New Exception("Invalid city list")
                End If
                If cityNameList.Count <> 1 Then
                    Throw New Exception("Invalid city list")
                End If

                Dim lats As String = latLonList.Item(0).InnerText
                Dim cits As String = cityNameList.Item(0).InnerText

                Dim latsParsed() As String = lats.Split(" "c)
                Dim citsParsed() As String = cits.Split("|"c)

                If citsParsed.Length <> latsParsed.Length Then
                    Throw New Exception("Invalid city list")
                End If

                edcity.BeginUpdate()
                Try
                    For i As Integer = 0 To citsParsed.Length - 1
                        Dim ll() As String = latsParsed(i).Split(","c)
                        If ll.Length <> 2 Then
                            Throw New Exception("Invalid city list")
                        End If
                        Cities.Add(citsParsed(i), New LatLong(Convert.ToDecimal(ll(0), CultureInfo.InvariantCulture), Convert.ToDecimal(ll(1), CultureInfo.InvariantCulture)))
                        edcity.Items.Add(citsParsed(i))
                    Next i

                    edcity.Text = "New York,NY"
                Finally
                    edcity.EndUpdate()
                End Try

        End Sub

        Private Sub Export(ByVal SaveDialog As SaveFileDialog, ByVal ToPdf As Boolean)
            Try
                Dim DataPath As String = Path.Combine(Path.Combine(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), ".."), "..") & Path.DirectorySeparatorChar

                'We will use a thread to connect, to avoid "freezing" the GUI
                Dim MyWebConnect As New WebConnectThread(reportStart, edcity.Text, DataPath, cbOffline.Checked, Cities)
                Dim WebConnect As New Thread(New ThreadStart(AddressOf MyWebConnect.SetupNOAA))
                WebConnect.Start()
                Using Pg As New ProgressDialog()
                    Pg.ShowProgress(WebConnect)
                    If MyWebConnect IsNot Nothing AndAlso MyWebConnect.MainException IsNot Nothing Then
                        Throw MyWebConnect.MainException
                    End If
                End Using

                If SaveDialog.ShowDialog() = System.Windows.Forms.DialogResult.OK Then
                    If ToPdf Then
                        Dim xls As New XlsFile()
                        xls.Open(DataPath & "Exporting Web Services.template.xls")
                        reportStart.Run(xls)
                        Using PdfExport As New FlexCelPdfExport(xls, True)
                            PdfExport.Export(SaveDialog.FileName)
                        End Using
                    Else
                        reportStart.Run(DataPath & "Exporting Web Services.template.xls", SaveDialog.FileName)
                    End If

                    If MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) = System.Windows.Forms.DialogResult.Yes Then
                        Process.Start(SaveDialog.FileName)
                    End If
                End If
            Catch ex As Exception
                MessageBox.Show(ex.Message)
            End Try

        End Sub

        Private Sub btnCancel_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnCancel.Click
            Close()
        End Sub

        Private Sub btnExportPdf_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnExportPdf.Click
            Export(saveFileDialogPdf, True)
        End Sub

        Private Sub btnExportXls_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnExportXls.Click
            Export(saveFileDialogXls, False)
        End Sub

        Private Sub edcity_KeyDown(ByVal sender As Object, ByVal e As KeyEventArgs) Handles edcity.KeyDown
            edcity.DroppedDown = False
        End Sub

    End Class

    Friend Structure LatLong
        Public Latitude As Decimal
        Public Longitude As Decimal

        Public Sub New(ByVal aLatitude As Decimal, ByVal aLongitude As Decimal)
            Latitude = aLatitude
            Longitude = aLongitude
        End Sub
    End Structure

    Friend Class WebConnectThread
        Private CityName As String
        Private DataPath As String
        Private UseOfflineData As Boolean
        Private Cities As Dictionary(Of String, LatLong)
        Private ReportStart As FlexCelReport
        Private FMainException As Exception

        Public Sub New(ByVal aReportStart As FlexCelReport, ByVal aCityName As String, ByVal aDataPath As String, ByVal aUseOfflineData As Boolean, ByVal aCities As Dictionary(Of String, LatLong))
            CityName = aCityName
            DataPath = aDataPath
            UseOfflineData = aUseOfflineData
            ReportStart = aReportStart
            Cities = aCities
        End Sub

        Public Sub SetupNOAA()
            Try
                SetupNOAA(ReportStart, CityName, DataPath, UseOfflineData, Cities)
            Catch ex As Exception
                FMainException = ex
            End Try

        End Sub

        Public Shared Sub SetupNOAA(ByVal reportStart As FlexCelReport, ByVal CityName As String, ByVal DataPath As String, ByVal UseOfflineData As Boolean, ByVal Cities As Dictionary(Of String, LatLong))
            Dim CityCoords As LatLong
            GetCity(Cities, CityName, CityCoords)
            reportStart.SetValue("Date", Date.Now)
            Dim forecasts As String
            Dim dtStart As Date = Date.Now

            If UseOfflineData Then
                Using fs As New StreamReader(Path.Combine(DataPath, "OfflineData.xml"))
                    forecasts = fs.ReadToEnd()
                End Using
            Else
                Dim nd As New ndfdXML()
                forecasts = nd.NDFDgen(CityCoords.Latitude, CityCoords.Longitude, productType.glance, dtStart, dtStart.AddDays(7), unitType.m, New weatherParametersType())

#If(SAVEOFFLINEDATA) Then
                Using sw As New StreamWriter(Path.Combine(DataPath, "OfflineData.xml"))
                    sw.Write(forecasts)
                End Using
#End If
            End If

            If String.IsNullOrEmpty(forecasts) Then
                Throw New Exception("Can't find the place " & CityName)
            End If

            Dim ds As New DataSet()
            'Load the data into a dataset. On this web service, we cannot just call DataSet.ReadXml as the data is not on the correct format.
            Dim xmlDoc As New XmlDocument()
                xmlDoc.LoadXml(forecasts)
                Dim HighList As XmlNodeList = xmlDoc.SelectNodes("/dwml/data/parameters/temperature[@type='maximum']/value/text()")
                Dim LowList As XmlNodeList = xmlDoc.SelectNodes("/dwml/data/parameters/temperature[@type='minimum']/value/text()")
                Dim IconList As XmlNodeList = xmlDoc.SelectNodes("/dwml/data/parameters/conditions-icon/icon-link/text()")

                Dim WeatherTable As DataTable = ds.Tables.Add("Weather")

                WeatherTable.Columns.Add("Day", GetType(Date))
                WeatherTable.Columns.Add("Low", GetType(Double))
                WeatherTable.Columns.Add("High", GetType(Double))
                WeatherTable.Columns.Add("Icon", GetType(Byte()))

                For i As Integer = 0 To Math.Min(Math.Min(HighList.Count, LowList.Count), IconList.Count) - 1
                    WeatherTable.Rows.Add(New Object(){ dtStart.AddDays(i), Convert.ToDouble(LowList(i).Value), Convert.ToDouble(HighList(i).Value), LoadIcon(IconList(i).Value, UseOfflineData, DataPath)})
                Next i

            reportStart.AddTable(ds, TDisposeMode.DisposeAfterRun)
            reportStart.SetValue("Latitude", CityCoords.Latitude)
            reportStart.SetValue("Longitude", CityCoords.Longitude)
            reportStart.SetValue("Place", CityName)

        End Sub

        Private Shared Sub GetCity(ByVal Cities As Dictionary(Of String, LatLong), ByVal CityName As String, ByRef CityCoords As LatLong)
            If Not Cities.TryGetValue(CityName, CityCoords) Then
                Throw New Exception("Can't find the city " & CityName)
            End If
        End Sub

        Friend ReadOnly Property MainException() As Exception
            Get
                Return FMainException
            End Get
        End Property

        Friend Shared Function LoadIcon(ByVal url As String, ByVal useOfflineData As Boolean, ByVal dataPath As String) As Byte()
            If url Is Nothing OrElse url.Length = 0 Then
                Return Nothing 'no icon for this image.
            End If

            If useOfflineData Then
                Dim u As New Uri(url)
                Return LoadFileIcon(Path.Combine(dataPath, u.Segments(u.Segments.Length - 1)))
            Else
#If (SAVEOFFLINEDATA) Then
                Dim u As New Uri(url)
                Dim IconData() As Byte = LoadWebIcon(url)
                Using fs As New FileStream(Path.Combine(dataPath, u.Segments(u.Segments.Length - 1)), FileMode.Create)
                    fs.Write(IconData, 0, IconData.Length)
                End Using
#End If

                Return LoadWebIcon(url)

            End If
        End Function

        ''' <summary>
        ''' On a real implementation this should be cached.
        ''' </summary>
        ''' <param name="url"></param>
        ''' <returns></returns>
        Friend Shared Function LoadWebIcon(ByVal url As String) As Byte()
            Using wc As New WebClient()
                wc.Headers.Add("user-agent", "FlexCel Webservice Example")
                Return wc.DownloadData(url)
            End Using
        End Function

        Private Shared Function LoadFileIcon(ByVal filename As String) As Byte()
            Using fs As New FileStream(filename, FileMode.Open)
                Dim Result(CInt(fs.Length) - 1) As Byte
                fs.Read(Result, 0, Result.Length)
                Return Result
            End Using
        End Function

    End Class

End Namespace

Program.vb

Namespace ExportingWebServices
    Friend NotInheritable Class Program

        Private Sub New()
        End Sub

        ''' <summary>
        ''' The main entry point for the application.
        ''' </summary>
       <STAThread> _
        Shared Sub Main()
            Application.EnableVisualStyles()
            Application.SetCompatibleTextRenderingDefault(False)
            Application.Run(New mainForm())
        End Sub
    End Class
End Namespace

ProgressDialog.Designer.vb

Imports System.Collections
Imports System.ComponentModel
Imports System.Threading
Imports FlexCel.Render
Namespace ExportingWebServices
    Partial Public Class ProgressDialog
        Inherits System.Windows.Forms.Form

        Private statusBar1 As System.Windows.Forms.StatusBar
        Private statusBarPanel1 As System.Windows.Forms.StatusBarPanel
        Private statusBarPanelTime As System.Windows.Forms.StatusBarPanel
        Private labelCaption As System.Windows.Forms.Label
        ''' <summary>
        ''' Required designer variable.
        ''' </summary>
        Private components As System.ComponentModel.Container = Nothing

        ''' <summary>
        ''' Clean up any resources being used.
        ''' </summary>
        Protected Overrides Sub Dispose(ByVal disposing As Boolean)
            If disposing Then
                If components IsNot Nothing Then
                    components.Dispose()
                End If
            End If
            MyBase.Dispose(disposing)
        End Sub

        #Region "Windows Form Designer generated code"
        ''' <summary>
        ''' Required method for Designer support - do not modify
        ''' the contents of this method with the code editor.
        ''' </summary>
        Private Sub InitializeComponent()
            Me.statusBar1 = New System.Windows.Forms.StatusBar()
            Me.statusBarPanel1 = New System.Windows.Forms.StatusBarPanel()
            Me.statusBarPanelTime = New System.Windows.Forms.StatusBarPanel()
            Me.labelCaption = New System.Windows.Forms.Label()
            Me.timer1 = New System.Timers.Timer()
            CType(Me.statusBarPanel1, System.ComponentModel.ISupportInitialize).BeginInit()
            CType(Me.statusBarPanelTime, System.ComponentModel.ISupportInitialize).BeginInit()
            CType(Me.timer1, System.ComponentModel.ISupportInitialize).BeginInit()
            Me.SuspendLayout()
            '
            ' statusBar1
            '
            Me.statusBar1.Location = New System.Drawing.Point(0, 100)
            Me.statusBar1.Name = "statusBar1"
            Me.statusBar1.Panels.AddRange(New System.Windows.Forms.StatusBarPanel() { Me.statusBarPanel1, Me.statusBarPanelTime})
            Me.statusBar1.ShowPanels = True
            Me.statusBar1.Size = New System.Drawing.Size(448, 22)
            Me.statusBar1.TabIndex = 1
            '
            ' statusBarPanel1
            '
            Me.statusBarPanel1.BorderStyle = System.Windows.Forms.StatusBarPanelBorderStyle.None
            Me.statusBarPanel1.Text = "Elapsed Time:"
            Me.statusBarPanel1.Width = 80
            '
            ' statusBarPanelTime
            '
            Me.statusBarPanelTime.BorderStyle = System.Windows.Forms.StatusBarPanelBorderStyle.None
            Me.statusBarPanelTime.Text = "0:00"
            '
            ' labelCaption
            '
            Me.labelCaption.Anchor = (CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.labelCaption.Location = New System.Drawing.Point(16, 16)
            Me.labelCaption.Name = "labelCaption"
            Me.labelCaption.Size = New System.Drawing.Size(408, 16)
            Me.labelCaption.TabIndex = 2
            Me.labelCaption.Text = "Connecting to Webservice..."
            '
            ' timer1
            '
            Me.timer1.Enabled = True
            Me.timer1.SynchronizingObject = Me
'           Me.timer1.Elapsed += New System.Timers.ElapsedEventHandler(Me.timer1_Elapsed)
            '
            ' ProgressDialog
            '
            Me.AutoScaleDimensions = New System.Drawing.SizeF(6F, 13F)
            Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
            Me.ClientSize = New System.Drawing.Size(448, 122)
            Me.Controls.Add(Me.labelCaption)
            Me.Controls.Add(Me.statusBar1)
            Me.Name = "ProgressDialog"
            Me.ShowInTaskbar = False
            Me.Text = "Please wait..."
'           Me.Closed += New System.EventHandler(Me.ProgressDialog_Closed)
            CType(Me.statusBarPanel1, System.ComponentModel.ISupportInitialize).EndInit()
            CType(Me.statusBarPanelTime, System.ComponentModel.ISupportInitialize).EndInit()
            CType(Me.timer1, System.ComponentModel.ISupportInitialize).EndInit()
            Me.ResumeLayout(False)

        End Sub
        #End Region
    End Class
End Namespace

ProgressDialog.vb

Imports System.Collections
Imports System.ComponentModel

Imports System.Threading

Imports FlexCel.Render

Namespace ExportingWebServices
    ''' <summary>
    ''' A dialog box to show progress. This could be done with a BackgroundWorker, it was done this way for .NET 1.1 compatibility.
    ''' </summary>
    Partial Public Class ProgressDialog
        Inherits System.Windows.Forms.Form

        Private WithEvents timer1 As System.Timers.Timer

        Public Sub New()
            InitializeComponent()
        End Sub

        Private StartTime As Date
        Private RunningThread As Thread

        Private Sub timer1_Elapsed(ByVal sender As Object, ByVal e As System.Timers.ElapsedEventArgs) Handles timer1.Elapsed
            UpdateStatus()
        End Sub

        Public Sub ShowProgress(ByVal aRunningThread As Thread)
            RunningThread = aRunningThread

            If Not RunningThread.IsAlive Then
                DialogResult = System.Windows.Forms.DialogResult.OK
                Return
            End If
            timer1.Enabled = True
            StartTime = Date.Now
            ShowDialog()
        End Sub

        Private Sub UpdateStatus()
            Dim ts As TimeSpan = Date.Now.Subtract(StartTime)
            Dim hours As String
            If ts.Hours = 0 Then
                hours = ""
            Else
                hours = ts.Hours.ToString("00") & ":"
            End If
            statusBarPanelTime.Text = hours & ts.Minutes.ToString("00") & ":" & ts.Seconds.ToString("00")

            If Not RunningThread.IsAlive Then
                DialogResult = System.Windows.Forms.DialogResult.OK
            End If
        End Sub

        Private Sub ProgressDialog_Closed(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Closed
            timer1.Enabled = False
        End Sub

    End Class
End Namespace


Includes (VB.Net / netframework) | FlexCel Studio for the .NET Framework documentation

Includes (VB.Net / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\vb\VS2022\netframework\20.Reports\40.Includes and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​vb/​VS2022/​netframework/​Modules/​20.​Reports/​40.​Includes

Overview

The <#Include> tag is very useful to keep your reports modular.

Concepts

  • Included files can contain nested included files inside.

  • There are two main ways to use the includes: As a common reusable part of your reports (like a header), or together with <#if> tag to create different layouts of subreports depending on the data. Use the "different layouts" only if data on the detail changes in fact very much depending on the data on the parent. If not, using <#If> and <#format cell> will probably be better.

  • An included report "inherits" all the variables and datasets of the parent. The included report is a subreport that is precompiled separated from the parent and run on its own sandbox. It is *not* pasted on the main report until it is run, and it can't modify things on the parent.

  • When creating an included report it can happen that column widths are different on the including and the included report. You might have a template header.xls that you include on every report, but the including reports can have different column widths, changing the header. One solution to this is to use only textboxes and images on header.xls, group them all together, and finally right click on the group and select "Move but not size with cells". This way, the included header will look the same everywhere.

Files

AssemblyInfo.vb

Imports System.Reflection
Imports System.Runtime.CompilerServices

'
' General Information about an assembly is controlled through the following
' set of attributes. Change these attribute values to modify the information
' associated with an assembly.
'
<Assembly: AssemblyTitle("")>
<Assembly: AssemblyDescription("")>
<Assembly: AssemblyConfiguration("")>
<Assembly: AssemblyCompany("")>
<Assembly: AssemblyProduct("")>
<Assembly: AssemblyCopyright("(c) 2002 - 2014 TMS Software")>
<Assembly: AssemblyTrademark("")>
<Assembly: AssemblyCulture("")>

'
' Version information for an assembly consists of the following four values:
'
'      Major Version
'      Minor Version
'      Build Number
'      Revision
'
' You can specify all the values or you can default the Revision and Build Numbers
' by using the '*' as shown below:

<Assembly: AssemblyVersion("6.2.1.0")>

'
' In order to sign your assembly you must specify a key to use. Refer to the
' Microsoft .NET Framework documentation for more information on assembly signing.
'
' Use the attributes below to control which key is used for signing.
'
' Notes:
'   (*) If no key is specified, the assembly is not signed.
'   (*) KeyName refers to a key that has been installed in the Crypto Service
'       Provider (CSP) on your machine. KeyFile refers to a file which contains
'       a key.
'   (*) If the KeyFile and the KeyName values are both specified, the
'       following processing occurs:
'       (1) If the KeyName can be found in the CSP, that key is used.
'       (2) If the KeyName does not exist and the KeyFile does exist, the key
'           in the KeyFile is installed into the CSP and used.
'   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
'       When specifying the KeyFile, the location of the KeyFile should be
'       relative to the project output directory which is
'       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
'       located in the project directory, you would specify the AssemblyKeyFile
'       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
'   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
'       documentation for more information on this.
'
<Assembly: AssemblyDelaySign(False)>
<Assembly: AssemblyKeyFile("")>
<Assembly: AssemblyKeyName("")>

Form1.Designer.vb

Imports System.Collections
Imports System.ComponentModel
Imports System.IO
Imports System.Reflection
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports FlexCel.Report
Imports FlexCel.Demo.SharedData
Namespace Includes
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Private WithEvents button1 As System.Windows.Forms.Button
        Private saveFileDialog1 As System.Windows.Forms.SaveFileDialog
        Private label1 As System.Windows.Forms.Label
        Private WithEvents btnCancel As System.Windows.Forms.Button
        ''' <summary>
        ''' Required designer variable.
        ''' </summary>
        Private components As System.ComponentModel.Container = Nothing

        ''' <summary>
        ''' Clean up any resources being used.
        ''' </summary>
        Protected Overrides Sub Dispose(ByVal disposing As Boolean)
            If disposing Then
                If components IsNot Nothing Then
                    components.Dispose()
                End If
            End If
            MyBase.Dispose(disposing)
        End Sub

        #Region "Windows Form Designer generated code"
        ''' <summary>
        ''' Required method for Designer support - do not modify
        ''' the contents of this method with the code editor.
        ''' </summary>
        Private Sub InitializeComponent()
            Me.button1 = New System.Windows.Forms.Button()
            Me.saveFileDialog1 = New System.Windows.Forms.SaveFileDialog()
            Me.label1 = New System.Windows.Forms.Label()
            Me.btnCancel = New System.Windows.Forms.Button()
            Me.SuspendLayout()
            '
            ' button1
            '
            Me.button1.Anchor = (CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.button1.BackColor = System.Drawing.Color.Green
            Me.button1.ForeColor = System.Drawing.Color.White
            Me.button1.Location = New System.Drawing.Point(152, 88)
            Me.button1.Name = "button1"
            Me.button1.Size = New System.Drawing.Size(112, 23)
            Me.button1.TabIndex = 0
            Me.button1.Text = "GO!"
            Me.button1.UseVisualStyleBackColor = False
'           Me.button1.Click += New System.EventHandler(Me.button1_Click)
            '
            ' saveFileDialog1
            '
            Me.saveFileDialog1.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm|Excel 97/2003|*.xls|Excel 2007|*.xlsx;*.xlsm|All files|*.*"
            Me.saveFileDialog1.RestoreDirectory = True
            '
            ' label1
            '
            Me.label1.Location = New System.Drawing.Point(24, 24)
            Me.label1.Name = "label1"
            Me.label1.Size = New System.Drawing.Size(272, 24)
            Me.label1.TabIndex = 2
            Me.label1.Text = "Including subreports demo."
            '
            ' btnCancel
            '
            Me.btnCancel.Anchor = (CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.btnCancel.BackColor = System.Drawing.Color.FromArgb((CInt((CByte(192)))), (CInt((CByte(0)))), (CInt((CByte(0)))))
            Me.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel
            Me.btnCancel.ForeColor = System.Drawing.Color.White
            Me.btnCancel.Location = New System.Drawing.Point(272, 88)
            Me.btnCancel.Name = "btnCancel"
            Me.btnCancel.Size = New System.Drawing.Size(112, 23)
            Me.btnCancel.TabIndex = 3
            Me.btnCancel.Text = "Cancel"
            Me.btnCancel.UseVisualStyleBackColor = False
'           Me.btnCancel.Click += New System.EventHandler(Me.btnCancel_Click)
            '
            ' mainForm
            '
            Me.AutoScaleDimensions = New System.Drawing.SizeF(6F, 13F)
            Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
            Me.ClientSize = New System.Drawing.Size(416, 133)
            Me.Controls.Add(Me.btnCancel)
            Me.Controls.Add(Me.label1)
            Me.Controls.Add(Me.button1)
            Me.Name = "mainForm"
            Me.Text = "Including Reports"
            Me.ResumeLayout(False)

        End Sub
        #End Region
    End Class
End Namespace

Form1.vb

Imports System.Collections
Imports System.ComponentModel
Imports System.IO
Imports System.Reflection
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports FlexCel.Report
Imports FlexCel.Demo.SharedData

Namespace Includes
    ''' <summary>
    ''' Including reports
    ''' </summary>
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Public Sub New()
            InitializeComponent()
        End Sub

        Private Sub button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button1.Click
            AutoRun()
        End Sub

        Public Sub AutoRun()
            Using ordersReport As FlexCelReport = SharedData.CreateReport()
                ordersReport.SetValue("Date", Date.Now)
                ordersReport.SetValue("ReportCaption", "ORDERS")

                Dim DataPath As String = Path.Combine(Path.Combine(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), ".."), "..") & Path.DirectorySeparatorChar

                If saveFileDialog1.ShowDialog() = System.Windows.Forms.DialogResult.OK Then
                    ordersReport.Run(DataPath & "Includes.template.xls", saveFileDialog1.FileName)

                    If MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) = System.Windows.Forms.DialogResult.Yes Then
                        Process.Start(saveFileDialog1.FileName)
                    End If
                End If
            End Using
        End Sub

        Private Sub btnCancel_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnCancel.Click
            Close()
        End Sub
    End Class

End Namespace

Program.vb

Namespace Includes
    Friend NotInheritable Class Program

        Private Sub New()
        End Sub

        ''' <summary>
        ''' The main entry point for the application.
        ''' </summary>
       <STAThread> _
        Shared Sub Main()
            Application.EnableVisualStyles()
            Application.SetCompatibleTextRenderingDefault(False)
            Application.Run(New mainForm())
        End Sub
    End Class
End Namespace


Bidirectional reports (VB.Net / netframework) | FlexCel Studio for the .NET Framework documentation

Bidirectional reports (VB.Net / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\vb\VS2022\netframework\20.Reports\42.Bidirectional Reports and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​vb/​VS2022/​netframework/​Modules/​20.​Reports/​42.​Bidirectional Reports

Overview

In this example we will create a report that grows both horizontally and vertically.

Concepts

  • Normally ranges in FlexCel reports can't intercept. But there is an exception: If you define a range in the shape of a cross, FlexCel will do a bidirectional report.

  • In Bidirectional reports the row range acts as the master, and the column range as the detail. You can have more than one column range for the same row, but not more than one row range for the same column.

  • In this example we have two different column reports using the same row report. In the first column we show which employees have orders for a given customer, and in the second we show the orders for that customer.

  • Those two columns are conceptually different: In the first we use a column and row dataset which are not related. This will create a square with all the records of the column dataset for the column, and all the records of the row dataset for the rows. In the second column, the column dataset (orders) is related to the row dataset (customers). So the number of columns will be different for each row, depending in how many orders that customer has. FlexCel will insert as many columns as the maximum numbers of orders for any customer.

  • You can look at the User Defined Functions example for another demo on how bidirectional reports work.

Files

AssemblyInfo.vb

Imports System.Reflection
Imports System.Runtime.CompilerServices

'
' General Information about an assembly is controlled through the following
' set of attributes. Change these attribute values to modify the information
' associated with an assembly.
'
<Assembly: AssemblyTitle("")>
<Assembly: AssemblyDescription("")>
<Assembly: AssemblyConfiguration("")>
<Assembly: AssemblyCompany("")>
<Assembly: AssemblyProduct("")>
<Assembly: AssemblyCopyright("(c) 2002 - 2014 TMS Software")>
<Assembly: AssemblyTrademark("")>
<Assembly: AssemblyCulture("")>

'
' Version information for an assembly consists of the following four values:
'
'      Major Version
'      Minor Version
'      Build Number
'      Revision
'
' You can specify all the values or you can default the Revision and Build Numbers
' by using the '*' as shown below:

<Assembly: AssemblyVersion("6.2.1.0")>

'
' In order to sign your assembly you must specify a key to use. Refer to the
' Microsoft .NET Framework documentation for more information on assembly signing.
'
' Use the attributes below to control which key is used for signing.
'
' Notes:
'   (*) If no key is specified, the assembly is not signed.
'   (*) KeyName refers to a key that has been installed in the Crypto Service
'       Provider (CSP) on your machine. KeyFile refers to a file which contains
'       a key.
'   (*) If the KeyFile and the KeyName values are both specified, the
'       following processing occurs:
'       (1) If the KeyName can be found in the CSP, that key is used.
'       (2) If the KeyName does not exist and the KeyFile does exist, the key
'           in the KeyFile is installed into the CSP and used.
'   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
'       When specifying the KeyFile, the location of the KeyFile should be
'       relative to the project output directory which is
'       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
'       located in the project directory, you would specify the AssemblyKeyFile
'       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
'   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
'       documentation for more information on this.
'
<Assembly: AssemblyDelaySign(False)>
<Assembly: AssemblyKeyFile("")>
<Assembly: AssemblyKeyName("")>

Form1.Designer.vb

Imports System.Collections
Imports System.ComponentModel
Imports System.IO
Imports System.Reflection
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports FlexCel.Report
Imports FlexCel.Demo.SharedData
Namespace BidirectionalReports
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        ''' <summary>
        ''' Required designer variable.
        ''' </summary>
        Private components As System.ComponentModel.Container = Nothing

        ''' <summary>
        ''' Clean up any resources being used.
        ''' </summary>
        Protected Overrides Sub Dispose(ByVal disposing As Boolean)
            If disposing Then
                If components IsNot Nothing Then
                    components.Dispose()
                End If
            End If
            MyBase.Dispose(disposing)
        End Sub

        #Region "Windows Form Designer generated code"
        ''' <summary>
        ''' Required method for Designer support - do not modify
        ''' the contents of this method with the code editor.
        ''' </summary>
        Private Sub InitializeComponent()
            Me.button1 = New System.Windows.Forms.Button()
            Me.saveFileDialog1 = New System.Windows.Forms.SaveFileDialog()
            Me.label1 = New System.Windows.Forms.Label()
            Me.btnCancel = New System.Windows.Forms.Button()
            Me.SuspendLayout()
            '
            ' button1
            '
            Me.button1.Anchor = (CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.button1.BackColor = System.Drawing.Color.Green
            Me.button1.ForeColor = System.Drawing.Color.White
            Me.button1.Location = New System.Drawing.Point(279, 162)
            Me.button1.Margin = New System.Windows.Forms.Padding(6, 6, 6, 6)
            Me.button1.Name = "button1"
            Me.button1.Size = New System.Drawing.Size(205, 42)
            Me.button1.TabIndex = 0
            Me.button1.Text = "GO!"
            Me.button1.UseVisualStyleBackColor = False
'           Me.button1.Click += New System.EventHandler(Me.button1_Click)
            '
            ' saveFileDialog1
            '
            Me.saveFileDialog1.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm|Excel 97/2003|*.xls|Excel 2007|*.xlsx;*.xlsm|All " & "files|*.*"
            Me.saveFileDialog1.RestoreDirectory = True
            '
            ' label1
            '
            Me.label1.Location = New System.Drawing.Point(44, 44)
            Me.label1.Margin = New System.Windows.Forms.Padding(6, 0, 6, 0)
            Me.label1.Name = "label1"
            Me.label1.Size = New System.Drawing.Size(528, 44)
            Me.label1.TabIndex = 2
            Me.label1.Text = "A report that grows both horizontally and vertically."
            '
            ' btnCancel
            '
            Me.btnCancel.Anchor = (CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.btnCancel.BackColor = System.Drawing.Color.FromArgb((CInt((CByte(192)))), (CInt((CByte(0)))), (CInt((CByte(0)))))
            Me.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel
            Me.btnCancel.ForeColor = System.Drawing.Color.White
            Me.btnCancel.Location = New System.Drawing.Point(499, 162)
            Me.btnCancel.Margin = New System.Windows.Forms.Padding(6, 6, 6, 6)
            Me.btnCancel.Name = "btnCancel"
            Me.btnCancel.Size = New System.Drawing.Size(205, 42)
            Me.btnCancel.TabIndex = 3
            Me.btnCancel.Text = "Cancel"
            Me.btnCancel.UseVisualStyleBackColor = False
'           Me.btnCancel.Click += New System.EventHandler(Me.btnCancel_Click)
            '
            ' mainForm
            '
            Me.AutoScaleDimensions = New System.Drawing.SizeF(11F, 24F)
            Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
            Me.ClientSize = New System.Drawing.Size(763, 246)
            Me.Controls.Add(Me.btnCancel)
            Me.Controls.Add(Me.label1)
            Me.Controls.Add(Me.button1)
            Me.Margin = New System.Windows.Forms.Padding(6, 6, 6, 6)
            Me.Name = "mainForm"
            Me.Text = "Bidirectional Reports"
            Me.ResumeLayout(False)

        End Sub
        #End Region

        Private WithEvents button1 As System.Windows.Forms.Button
        Private saveFileDialog1 As System.Windows.Forms.SaveFileDialog
        Private label1 As System.Windows.Forms.Label
        Private WithEvents btnCancel As System.Windows.Forms.Button
    End Class
End Namespace

Form1.vb

Imports System.Collections
Imports System.ComponentModel
Imports System.IO
Imports System.Reflection
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports FlexCel.Report
Imports FlexCel.Demo.SharedData

Namespace BidirectionalReports
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Public Sub New()
            InitializeComponent()
        End Sub

        Private Sub button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button1.Click
            AutoRun()
        End Sub

        Public Sub AutoRun()
            Using ordersReport As FlexCelReport = SharedData.CreateReport()
                ordersReport.SetValue("Date", Date.Now)
                Dim DataPath As String = Path.Combine(Path.Combine(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), ".."), "..") & Path.DirectorySeparatorChar

                If saveFileDialog1.ShowDialog() = System.Windows.Forms.DialogResult.OK Then
                    ordersReport.Run(DataPath & "Bidirectional Reports.template.xlsx", saveFileDialog1.FileName)

                    If MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) = System.Windows.Forms.DialogResult.Yes Then
                        Process.Start(saveFileDialog1.FileName)
                    End If
                End If
            End Using
        End Sub

        Private Sub btnCancel_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnCancel.Click
            Close()
        End Sub

    End Class
End Namespace

Program.vb

Namespace BidirectionalReports
    Friend NotInheritable Class Program

        Private Sub New()
        End Sub

        ''' <summary>
        ''' The main entry point for the application.
        ''' </summary>
       <STAThread> _
        Shared Sub Main()
            Application.EnableVisualStyles()
            Application.SetCompatibleTextRenderingDefault(False)
            Application.Run(New mainForm())
        End Sub
    End Class
End Namespace


Lookups (VB.Net / netframework) | FlexCel Studio for the .NET Framework documentation

Lookups (VB.Net / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\vb\VS2022\netframework\20.Reports\45.Lookups and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​vb/​VS2022/​netframework/​Modules/​20.​Reports/​45.​Lookups

Overview

Sometimes you have a field with a value that is read from another table. On this example, the field Employees.ReportsTo is a number, which points to the EmployeeID of the supervisor. Using the <#lookup()> tag, you can write the name of the supervisor, not only his EmployeeID.

Concepts

  • How to use the <#Lookup> tag to search for a field in another table.

  • Normally you will make lookup on one field, as in the example: <#lookup(Employees;EmployeeID;<#Employees.ReportsTo>;LastName)>. (This code lookups the value of ReportsTo, on the table Employees, searches for the field EmployeeId and returns LastName. Now, sometimes you might want to lookup on more than on field. Imagine that you wanted to search on the table Employee, but the record that not only has EmployeeID = ReportsTo, but Country="Spain". You can use the Array> tag to search here: <#lookup(Employees;EmployeeID,Country;<#array(<#Employees.ReportsTo>;Spain)>;FirstName)>

  • Unrelated to Lookups, we show two other Excel features you can use: We froze the top panel so when you scroll down, the header is always visible, and we added an AutoFilter to find Employees. We just added them on the template, and they continue to exist on the generated report. Note that you can't define them in an include.

Files

AssemblyInfo.vb

Imports System.Reflection
Imports System.Runtime.CompilerServices

'
' General Information about an assembly is controlled through the following
' set of attributes. Change these attribute values to modify the information
' associated with an assembly.
'
<Assembly: AssemblyTitle("")>
<Assembly: AssemblyDescription("")>
<Assembly: AssemblyConfiguration("")>
<Assembly: AssemblyCompany("")>
<Assembly: AssemblyProduct("")>
<Assembly: AssemblyCopyright("(c) 2002 - 2014 TMS Software")>
<Assembly: AssemblyTrademark("")>
<Assembly: AssemblyCulture("")>

'
' Version information for an assembly consists of the following four values:
'
'      Major Version
'      Minor Version
'      Build Number
'      Revision
'
' You can specify all the values or you can default the Revision and Build Numbers
' by using the '*' as shown below:

<Assembly: AssemblyVersion("6.2.1.0")>

'
' In order to sign your assembly you must specify a key to use. Refer to the
' Microsoft .NET Framework documentation for more information on assembly signing.
'
' Use the attributes below to control which key is used for signing.
'
' Notes:
'   (*) If no key is specified, the assembly is not signed.
'   (*) KeyName refers to a key that has been installed in the Crypto Service
'       Provider (CSP) on your machine. KeyFile refers to a file which contains
'       a key.
'   (*) If the KeyFile and the KeyName values are both specified, the
'       following processing occurs:
'       (1) If the KeyName can be found in the CSP, that key is used.
'       (2) If the KeyName does not exist and the KeyFile does exist, the key
'           in the KeyFile is installed into the CSP and used.
'   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
'       When specifying the KeyFile, the location of the KeyFile should be
'       relative to the project output directory which is
'       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
'       located in the project directory, you would specify the AssemblyKeyFile
'       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
'   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
'       documentation for more information on this.
'
<Assembly: AssemblyDelaySign(False)>
<Assembly: AssemblyKeyFile("")>
<Assembly: AssemblyKeyName("")>

Form1.Designer.vb

Imports System.Collections
Imports System.ComponentModel
Imports System.IO
Imports System.Reflection
Imports System.Resources
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports FlexCel.Report
Imports FlexCel.Demo.SharedData
Namespace Lookups
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Private WithEvents button1 As System.Windows.Forms.Button
        Private saveFileDialog1 As System.Windows.Forms.SaveFileDialog
        Private label1 As System.Windows.Forms.Label
        Private WithEvents btnCancel As System.Windows.Forms.Button
        ''' <summary>
        ''' Required designer variable.
        ''' </summary>
        Private components As System.ComponentModel.Container = Nothing

        ''' <summary>
        ''' Clean up any resources being used.
        ''' </summary>
        Protected Overrides Sub Dispose(ByVal disposing As Boolean)
            If disposing Then
                If components IsNot Nothing Then
                    components.Dispose()
                End If
            End If
            MyBase.Dispose(disposing)
        End Sub

        #Region "Windows Form Designer generated code"
        ''' <summary>
        ''' Required method for Designer support - do not modify
        ''' the contents of this method with the code editor.
        ''' </summary>
        Private Sub InitializeComponent()
            Me.button1 = New System.Windows.Forms.Button()
            Me.saveFileDialog1 = New System.Windows.Forms.SaveFileDialog()
            Me.label1 = New System.Windows.Forms.Label()
            Me.btnCancel = New System.Windows.Forms.Button()
            Me.SuspendLayout()
            '
            ' button1
            '
            Me.button1.Anchor = (CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.button1.BackColor = System.Drawing.Color.Green
            Me.button1.ForeColor = System.Drawing.Color.White
            Me.button1.Location = New System.Drawing.Point(152, 88)
            Me.button1.Name = "button1"
            Me.button1.Size = New System.Drawing.Size(112, 23)
            Me.button1.TabIndex = 0
            Me.button1.Text = "GO!"
            Me.button1.UseVisualStyleBackColor = False
'           Me.button1.Click += New System.EventHandler(Me.button1_Click)
            '
            ' saveFileDialog1
            '
            Me.saveFileDialog1.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm|Excel 97/2003|*.xls|Excel 2007|*.xlsx;*.xlsm|All files|*.*"
            Me.saveFileDialog1.RestoreDirectory = True
            '
            ' label1
            '
            Me.label1.Location = New System.Drawing.Point(24, 24)
            Me.label1.Name = "label1"
            Me.label1.Size = New System.Drawing.Size(288, 24)
            Me.label1.TabIndex = 2
            Me.label1.Text = "A demo on how to use lookup fields. "
            '
            ' btnCancel
            '
            Me.btnCancel.Anchor = (CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.btnCancel.BackColor = System.Drawing.Color.FromArgb((CInt((CByte(192)))), (CInt((CByte(0)))), (CInt((CByte(0)))))
            Me.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel
            Me.btnCancel.ForeColor = System.Drawing.Color.White
            Me.btnCancel.Location = New System.Drawing.Point(272, 88)
            Me.btnCancel.Name = "btnCancel"
            Me.btnCancel.Size = New System.Drawing.Size(112, 23)
            Me.btnCancel.TabIndex = 3
            Me.btnCancel.Text = "Cancel"
            Me.btnCancel.UseVisualStyleBackColor = False
'           Me.btnCancel.Click += New System.EventHandler(Me.btnCancel_Click)
            '
            ' mainForm
            '
            Me.AutoScaleDimensions = New System.Drawing.SizeF(6F, 13F)
            Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
            Me.ClientSize = New System.Drawing.Size(416, 133)
            Me.Controls.Add(Me.btnCancel)
            Me.Controls.Add(Me.label1)
            Me.Controls.Add(Me.button1)
            Me.Name = "mainForm"
            Me.Text = "Lookups"
            Me.ResumeLayout(False)

        End Sub
        #End Region
    End Class
End Namespace

Form1.vb

Imports System.Collections
Imports System.ComponentModel
Imports System.IO
Imports System.Reflection
Imports System.Resources
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports FlexCel.Report
Imports FlexCel.Demo.SharedData

Namespace Lookups
    ''' <summary>
    ''' Lookups
    ''' </summary>
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Public Sub New()
            InitializeComponent()
        End Sub

        Private Sub button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button1.Click
            AutoRun()
        End Sub

        Public Sub AutoRun()
            Using ordersReport As FlexCelReport = SharedData.CreateReport()
                ordersReport.SetValue("Date", Date.Now)
                Dim DataPath As String = Path.Combine(Path.Combine(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), ".."), "..") & Path.DirectorySeparatorChar

                If saveFileDialog1.ShowDialog() = System.Windows.Forms.DialogResult.OK Then
                    ordersReport.Run(DataPath & "Lookups.template.xls", saveFileDialog1.FileName)

                    If MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) = System.Windows.Forms.DialogResult.Yes Then
                        Process.Start(saveFileDialog1.FileName)
                    End If
                End If
            End Using
        End Sub

        Private Sub btnCancel_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnCancel.Click
            Close()
        End Sub

    End Class

End Namespace

Program.vb

Namespace Lookups
    Friend NotInheritable Class Program

        Private Sub New()
        End Sub

        ''' <summary>
        ''' The main entry point for the application.
        ''' </summary>
       <STAThread> _
        Shared Sub Main()
            Application.EnableVisualStyles()
            Application.SetCompatibleTextRenderingDefault(False)
            Application.Run(New mainForm())
        End Sub
    End Class
End Namespace


Aggregates (VB.Net / netframework) | FlexCel Studio for the .NET Framework documentation

Aggregates (VB.Net / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\vb\VS2022\netframework\20.Reports\46.Aggregates and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​vb/​VS2022/​netframework/​Modules/​20.​Reports/​46.​Aggregates

Overview

FlexCel allows you to aggregate tables on the fly, providing you with the sum, average, maximum or minimum of the records in a table.

Note

You will normally not want to use in-memory aggregates, since they are slower and consume more memory than aggregates made directly in the database. (using an expression like "select sum(field1) from table group by field2")

Concepts

  • Different ways to use the <#aggregate> tag to aggregate the values in a table.

Files

AssemblyInfo.vb

Imports System.Reflection
Imports System.Runtime.CompilerServices

'
' General Information about an assembly is controlled through the following
' set of attributes. Change these attribute values to modify the information
' associated with an assembly.
'
<Assembly: AssemblyTitle("")>
<Assembly: AssemblyDescription("")>
<Assembly: AssemblyConfiguration("")>
<Assembly: AssemblyCompany("")>
<Assembly: AssemblyProduct("")>
<Assembly: AssemblyCopyright("(c) 2002 - 2014 TMS Software")>
<Assembly: AssemblyTrademark("")>
<Assembly: AssemblyCulture("")>

'
' Version information for an assembly consists of the following four values:
'
'      Major Version
'      Minor Version
'      Build Number
'      Revision
'
' You can specify all the values or you can default the Revision and Build Numbers
' by using the '*' as shown below:

<Assembly: AssemblyVersion("6.2.1.0")>

'
' In order to sign your assembly you must specify a key to use. Refer to the
' Microsoft .NET Framework documentation for more information on assembly signing.
'
' Use the attributes below to control which key is used for signing.
'
' Notes:
'   (*) If no key is specified, the assembly is not signed.
'   (*) KeyName refers to a key that has been installed in the Crypto Service
'       Provider (CSP) on your machine. KeyFile refers to a file which contains
'       a key.
'   (*) If the KeyFile and the KeyName values are both specified, the
'       following processing occurs:
'       (1) If the KeyName can be found in the CSP, that key is used.
'       (2) If the KeyName does not exist and the KeyFile does exist, the key
'           in the KeyFile is installed into the CSP and used.
'   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
'       When specifying the KeyFile, the location of the KeyFile should be
'       relative to the project output directory which is
'       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
'       located in the project directory, you would specify the AssemblyKeyFile
'       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
'   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
'       documentation for more information on this.
'
<Assembly: AssemblyDelaySign(False)>
<Assembly: AssemblyKeyFile("")>
<Assembly: AssemblyKeyName("")>

Form1.Designer.vb

Imports System.Collections
Imports System.ComponentModel
Imports System.IO
Imports System.Reflection
Imports System.Resources
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports FlexCel.Report
Imports FlexCel.Demo.SharedData
Namespace Aggregates
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Private WithEvents button1 As System.Windows.Forms.Button
        Private saveFileDialog1 As System.Windows.Forms.SaveFileDialog
        Private label1 As System.Windows.Forms.Label
        Private WithEvents btnCancel As System.Windows.Forms.Button
        ''' <summary>
        ''' Required designer variable.
        ''' </summary>
        Private components As System.ComponentModel.Container = Nothing

        ''' <summary>
        ''' Clean up any resources being used.
        ''' </summary>
        Protected Overrides Sub Dispose(ByVal disposing As Boolean)
            If disposing Then
                If components IsNot Nothing Then
                    components.Dispose()
                End If
            End If
            MyBase.Dispose(disposing)
        End Sub

        #Region "Windows Form Designer generated code"
        ''' <summary>
        ''' Required method for Designer support - do not modify
        ''' the contents of this method with the code editor.
        ''' </summary>
        Private Sub InitializeComponent()
            Me.button1 = New System.Windows.Forms.Button()
            Me.saveFileDialog1 = New System.Windows.Forms.SaveFileDialog()
            Me.label1 = New System.Windows.Forms.Label()
            Me.btnCancel = New System.Windows.Forms.Button()
            Me.SuspendLayout()
            '
            ' button1
            '
            Me.button1.Anchor = (CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.button1.BackColor = System.Drawing.Color.Green
            Me.button1.ForeColor = System.Drawing.Color.White
            Me.button1.Location = New System.Drawing.Point(152, 88)
            Me.button1.Name = "button1"
            Me.button1.Size = New System.Drawing.Size(112, 23)
            Me.button1.TabIndex = 0
            Me.button1.Text = "GO!"
            Me.button1.UseVisualStyleBackColor = False
'           Me.button1.Click += New System.EventHandler(Me.button1_Click)
            '
            ' saveFileDialog1
            '
            Me.saveFileDialog1.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm|Excel 97/2003|*.xls|Excel 2007|*.xlsx;*.xlsm|All files|*.*"
            Me.saveFileDialog1.RestoreDirectory = True
            '
            ' label1
            '
            Me.label1.Location = New System.Drawing.Point(24, 24)
            Me.label1.Name = "label1"
            Me.label1.Size = New System.Drawing.Size(288, 24)
            Me.label1.TabIndex = 2
            Me.label1.Text = "A demo on how to use the Aggregate tag. "
            '
            ' btnCancel
            '
            Me.btnCancel.Anchor = (CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.btnCancel.BackColor = System.Drawing.Color.FromArgb((CInt((CByte(192)))), (CInt((CByte(0)))), (CInt((CByte(0)))))
            Me.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel
            Me.btnCancel.ForeColor = System.Drawing.Color.White
            Me.btnCancel.Location = New System.Drawing.Point(272, 88)
            Me.btnCancel.Name = "btnCancel"
            Me.btnCancel.Size = New System.Drawing.Size(112, 23)
            Me.btnCancel.TabIndex = 3
            Me.btnCancel.Text = "Cancel"
            Me.btnCancel.UseVisualStyleBackColor = False
'           Me.btnCancel.Click += New System.EventHandler(Me.btnCancel_Click)
            '
            ' mainForm
            '
            Me.AutoScaleDimensions = New System.Drawing.SizeF(6F, 13F)
            Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
            Me.ClientSize = New System.Drawing.Size(416, 133)
            Me.Controls.Add(Me.btnCancel)
            Me.Controls.Add(Me.label1)
            Me.Controls.Add(Me.button1)
            Me.Name = "mainForm"
            Me.Text = "Aggregates"
            Me.ResumeLayout(False)

        End Sub
        #End Region
    End Class
End Namespace

Form1.vb

Imports System.Collections
Imports System.ComponentModel
Imports System.IO
Imports System.Reflection
Imports System.Resources
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports FlexCel.Report
Imports FlexCel.Demo.SharedData

Namespace Aggregates
    ''' <summary>
    ''' How to sumarize many records into one.
    ''' </summary>
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Public Sub New()
            InitializeComponent()
        End Sub

        Private Sub button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button1.Click
            AutoRun()
        End Sub

        Public Sub AutoRun()
            Using ordersReport As FlexCelReport = SharedData.CreateReport()
                ordersReport.SetValue("Date", Date.Now)
                Dim DataPath As String = Path.Combine(Path.Combine(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), ".."), "..") & Path.DirectorySeparatorChar

                If saveFileDialog1.ShowDialog() = System.Windows.Forms.DialogResult.OK Then
                    ordersReport.Run(DataPath & "Aggregates.template.xls", saveFileDialog1.FileName)

                    If MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) = System.Windows.Forms.DialogResult.Yes Then
                        Process.Start(saveFileDialog1.FileName)
                    End If
                End If
            End Using
        End Sub

        Private Sub btnCancel_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnCancel.Click
            Close()
        End Sub

    End Class

End Namespace

Program.vb

Namespace Aggregates
    Friend NotInheritable Class Program

        Private Sub New()
        End Sub

        ''' <summary>
        ''' The main entry point for the application.
        ''' </summary>
       <STAThread> _
        Shared Sub Main()
            Application.EnableVisualStyles()
            Application.SetCompatibleTextRenderingDefault(False)
            Application.Run(New mainForm())
        End Sub
    End Class
End Namespace


Regular expressions (VB.Net / netframework) | FlexCel Studio for the .NET Framework documentation

Regular expressions (VB.Net / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\vb\VS2022\netframework\20.Reports\47.Regular Expressions and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​vb/​VS2022/​netframework/​Modules/​20.​Reports/​47.​Regular Expressions

Overview

Regular expressions give you both the power to transform the text in your reports in any way you like, and also to obfuscate and make unmaintainable your templates if you abuse them. The <#regex()> tag lets you write your own Regular Expressions in a FlexCel report.

Concepts

  • There are 2 versions of the <#regex> tag:

  • RegEx(IgnoreCase, Expression, Search): This will search for the expression inside "Search" string, and return the part of "Search" that matches the expression.

  • RegEx(IgnoreCase, Expression, Search, Replace): This will Replace the matching string inside "Search" by the "Replace" string.

  • Both "Search" and "Replace" parameters are evaluated at runtime, so they will evaluate to different strings as the row changes. The "Expression" parameter is evaluated only once before starting the report, so it will not change.

  • As formerly said, use regular expressions with care. Sometimes they are just invaluable to get your desired output, but on other times they can make maintaining the templates a lot of work. Depending on the case, you might find better to define your own user function to do a complex transformation. (See the User Defined Functions example)

  • Regular Expressions are a complex subject, and we will not explain how to use them here. There is a lot of information out there available on them.

Files

AssemblyInfo.vb

Imports System.Reflection
Imports System.Runtime.CompilerServices

'
' General Information about an assembly is controlled through the following
' set of attributes. Change these attribute values to modify the information
' associated with an assembly.
'
<Assembly: AssemblyTitle("")>
<Assembly: AssemblyDescription("")>
<Assembly: AssemblyConfiguration("")>
<Assembly: AssemblyCompany("")>
<Assembly: AssemblyProduct("")>
<Assembly: AssemblyCopyright("(c) 2002 - 2014 TMS Software")>
<Assembly: AssemblyTrademark("")>
<Assembly: AssemblyCulture("")>

'
' Version information for an assembly consists of the following four values:
'
'      Major Version
'      Minor Version
'      Build Number
'      Revision
'
' You can specify all the values or you can default the Revision and Build Numbers
' by using the '*' as shown below:

<Assembly: AssemblyVersion("6.2.1.0")>

'
' In order to sign your assembly you must specify a key to use. Refer to the
' Microsoft .NET Framework documentation for more information on assembly signing.
'
' Use the attributes below to control which key is used for signing.
'
' Notes:
'   (*) If no key is specified, the assembly is not signed.
'   (*) KeyName refers to a key that has been installed in the Crypto Service
'       Provider (CSP) on your machine. KeyFile refers to a file which contains
'       a key.
'   (*) If the KeyFile and the KeyName values are both specified, the
'       following processing occurs:
'       (1) If the KeyName can be found in the CSP, that key is used.
'       (2) If the KeyName does not exist and the KeyFile does exist, the key
'           in the KeyFile is installed into the CSP and used.
'   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
'       When specifying the KeyFile, the location of the KeyFile should be
'       relative to the project output directory which is
'       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
'       located in the project directory, you would specify the AssemblyKeyFile
'       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
'   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
'       documentation for more information on this.
'
<Assembly: AssemblyDelaySign(False)>
<Assembly: AssemblyKeyFile("")>
<Assembly: AssemblyKeyName("")>

Form1.Designer.vb

Imports System.Collections
Imports System.ComponentModel
Imports System.IO
Imports System.Reflection
Imports System.Resources
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports FlexCel.Report
Imports FlexCel.Demo.SharedData
Namespace RegularExpressions
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Private WithEvents button1 As System.Windows.Forms.Button
        Private saveFileDialog1 As System.Windows.Forms.SaveFileDialog
        Private label1 As System.Windows.Forms.Label
        Private WithEvents btnCancel As System.Windows.Forms.Button
        ''' <summary>
        ''' Required designer variable.
        ''' </summary>
        Private components As System.ComponentModel.Container = Nothing

        ''' <summary>
        ''' Clean up any resources being used.
        ''' </summary>
        Protected Overrides Sub Dispose(ByVal disposing As Boolean)
            If disposing Then
                If components IsNot Nothing Then
                    components.Dispose()
                End If
            End If
            MyBase.Dispose(disposing)
        End Sub

        #Region "Windows Form Designer generated code"
        ''' <summary>
        ''' Required method for Designer support - do not modify
        ''' the contents of this method with the code editor.
        ''' </summary>
        Private Sub InitializeComponent()
            Me.button1 = New System.Windows.Forms.Button()
            Me.saveFileDialog1 = New System.Windows.Forms.SaveFileDialog()
            Me.label1 = New System.Windows.Forms.Label()
            Me.btnCancel = New System.Windows.Forms.Button()
            Me.SuspendLayout()
            '
            ' button1
            '
            Me.button1.Anchor = (CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.button1.BackColor = System.Drawing.Color.Green
            Me.button1.ForeColor = System.Drawing.Color.White
            Me.button1.Location = New System.Drawing.Point(152, 88)
            Me.button1.Name = "button1"
            Me.button1.Size = New System.Drawing.Size(112, 23)
            Me.button1.TabIndex = 0
            Me.button1.Text = "GO!"
            Me.button1.UseVisualStyleBackColor = False
'           Me.button1.Click += New System.EventHandler(Me.button1_Click)
            '
            ' saveFileDialog1
            '
            Me.saveFileDialog1.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm|Excel 97/2003|*.xls|Excel 2007|*.xlsx;*.xlsm|All files|*.*"
            Me.saveFileDialog1.RestoreDirectory = True
            '
            ' label1
            '
            Me.label1.Location = New System.Drawing.Point(24, 24)
            Me.label1.Name = "label1"
            Me.label1.Size = New System.Drawing.Size(288, 24)
            Me.label1.TabIndex = 2
            Me.label1.Text = "A demo on how to use Regular Expressions in fields. "
            '
            ' btnCancel
            '
            Me.btnCancel.Anchor = (CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.btnCancel.BackColor = System.Drawing.Color.FromArgb((CInt((CByte(192)))), (CInt((CByte(0)))), (CInt((CByte(0)))))
            Me.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel
            Me.btnCancel.ForeColor = System.Drawing.Color.White
            Me.btnCancel.Location = New System.Drawing.Point(272, 88)
            Me.btnCancel.Name = "btnCancel"
            Me.btnCancel.Size = New System.Drawing.Size(112, 23)
            Me.btnCancel.TabIndex = 3
            Me.btnCancel.Text = "Cancel"
            Me.btnCancel.UseVisualStyleBackColor = False
'           Me.btnCancel.Click += New System.EventHandler(Me.btnCancel_Click)
            '
            ' mainForm
            '
            Me.AutoScaleDimensions = New System.Drawing.SizeF(6F, 13F)
            Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
            Me.ClientSize = New System.Drawing.Size(416, 133)
            Me.Controls.Add(Me.btnCancel)
            Me.Controls.Add(Me.label1)
            Me.Controls.Add(Me.button1)
            Me.Name = "mainForm"
            Me.Text = "Regular Expressions"
            Me.ResumeLayout(False)

        End Sub
        #End Region
    End Class
End Namespace

Form1.vb

Imports System.Collections
Imports System.ComponentModel
Imports System.IO
Imports System.Reflection
Imports System.Resources
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports FlexCel.Report
Imports FlexCel.Demo.SharedData

Namespace RegularExpressions
    ''' <summary>
    ''' How to make your reports criptic using regexps...
    ''' </summary>
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Public Sub New()
            InitializeComponent()
        End Sub

        Private Sub button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button1.Click
            AutoRun()
        End Sub

        Public Sub AutoRun()
            Using ordersReport As FlexCelReport = SharedData.CreateReport()
                ordersReport.SetValue("Date", Date.Now)
                ordersReport.SetValue("ReportCaption", "Suppliers")
                Dim DataPath As String = Path.Combine(Path.Combine(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), ".."), "..") & Path.DirectorySeparatorChar

                If saveFileDialog1.ShowDialog() = System.Windows.Forms.DialogResult.OK Then
                    ordersReport.Run(DataPath & "Regular Expressions.template.xls", saveFileDialog1.FileName)

                    If MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) = System.Windows.Forms.DialogResult.Yes Then
                        Process.Start(saveFileDialog1.FileName)
                    End If
                End If
            End Using
        End Sub

        Private Sub btnCancel_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnCancel.Click
            Close()
        End Sub

    End Class

End Namespace

Program.vb

Namespace RegularExpressions
    Friend NotInheritable Class Program

        Private Sub New()
        End Sub

        ''' <summary>
        ''' The main entry point for the application.
        ''' </summary>
       <STAThread> _
        Shared Sub Main()
            Application.EnableVisualStyles()
            Application.SetCompatibleTextRenderingDefault(False)
            Application.Run(New mainForm())
        End Sub
    End Class
End Namespace


Manual formulas (VB.Net / netframework) | FlexCel Studio for the .NET Framework documentation

Manual formulas (VB.Net / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\vb\VS2022\netframework\20.Reports\48.Manual Formulas and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​vb/​VS2022/​netframework/​Modules/​20.​Reports/​48.​Manual Formulas

Overview

Here we will create a small fully functional Minesweeper in Excel, and without any macros.

Most of the time, you will just want to write the formulas directly on the report, and let FlexCel change them when inserting rows. But sometimes, you might want to create a formula using flexcel tags. You can do it by using <#formula> and <#ref> tags, but don't do it unless you really need to.

Concepts

  • How to replace <#tags> inside a formula.

  • When you use the <#Formula> tag, formulas are just strings on the template. So we could define inside a cell: "<#formula>=b3", but then if we want to change the template, and insert a row below row 1, the string will still be "<#formula>=b3". That is why we need to use a <#Ref> tag. For example <#formula>=<#ref(0;-1)> on cell c3 will point to b3, but if you insert a row below row 1, it will point to b4 as it should be.

  • There is never a real need to use the <#formula> tag, you can always workaround it. On this particular case we used it so we could change the font, (since it is not possible to change the font on a conditional format), but we could have also used the approach we used on the Expression Parameters demo. In fact, it might have been better that way (by adding the <#format range> tag in the data). But this demo is to show how to use this feature, it is up to you to decide if it is worth or not.

  • How to use conditional formatting, locked cells and data validation to make a nice application.

Files

AssemblyInfo.vb

Imports System.Reflection
Imports System.Runtime.CompilerServices

'
' General Information about an assembly is controlled through the following
' set of attributes. Change these attribute values to modify the information
' associated with an assembly.
'
<Assembly: AssemblyTitle("")>
<Assembly: AssemblyDescription("")>
<Assembly: AssemblyConfiguration("")>
<Assembly: AssemblyCompany("")>
<Assembly: AssemblyProduct("")>
<Assembly: AssemblyCopyright("(c) 2002 - 2014 TMS Software")>
<Assembly: AssemblyTrademark("")>
<Assembly: AssemblyCulture("")>

'
' Version information for an assembly consists of the following four values:
'
'      Major Version
'      Minor Version
'      Build Number
'      Revision
'
' You can specify all the values or you can default the Revision and Build Numbers
' by using the '*' as shown below:

<Assembly: AssemblyVersion("6.2.1.0")>

'
' In order to sign your assembly you must specify a key to use. Refer to the
' Microsoft .NET Framework documentation for more information on assembly signing.
'
' Use the attributes below to control which key is used for signing.
'
' Notes:
'   (*) If no key is specified, the assembly is not signed.
'   (*) KeyName refers to a key that has been installed in the Crypto Service
'       Provider (CSP) on your machine. KeyFile refers to a file which contains
'       a key.
'   (*) If the KeyFile and the KeyName values are both specified, the
'       following processing occurs:
'       (1) If the KeyName can be found in the CSP, that key is used.
'       (2) If the KeyName does not exist and the KeyFile does exist, the key
'           in the KeyFile is installed into the CSP and used.
'   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
'       When specifying the KeyFile, the location of the KeyFile should be
'       relative to the project output directory which is
'       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
'       located in the project directory, you would specify the AssemblyKeyFile
'       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
'   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
'       documentation for more information on this.
'
<Assembly: AssemblyDelaySign(False)>
<Assembly: AssemblyKeyFile("")>
<Assembly: AssemblyKeyName("")>

Form1.Designer.vb

Imports System.Collections
Imports System.ComponentModel
Imports System.IO
Imports System.Reflection
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports FlexCel.Report
Namespace ManualFormulas
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Private WithEvents button1 As System.Windows.Forms.Button
        Private saveFileDialog1 As System.Windows.Forms.SaveFileDialog
        Private label1 As System.Windows.Forms.Label
        Private WithEvents btnCancel As System.Windows.Forms.Button
        ''' <summary>
        ''' Required designer variable.
        ''' </summary>
        Private components As System.ComponentModel.Container = Nothing

        ''' <summary>
        ''' Clean up any resources being used.
        ''' </summary>
        Protected Overrides Sub Dispose(ByVal disposing As Boolean)
            If disposing Then
                If components IsNot Nothing Then
                    components.Dispose()
                End If
            End If
            MyBase.Dispose(disposing)
        End Sub

        #Region "Windows Form Designer generated code"
        ''' <summary>
        ''' Required method for Designer support - do not modify
        ''' the contents of this method with the code editor.
        ''' </summary>
        Private Sub InitializeComponent()
            Me.button1 = New System.Windows.Forms.Button()
            Me.saveFileDialog1 = New System.Windows.Forms.SaveFileDialog()
            Me.label1 = New System.Windows.Forms.Label()
            Me.btnCancel = New System.Windows.Forms.Button()
            Me.SuspendLayout()
            '
            ' button1
            '
            Me.button1.Anchor = (CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.button1.BackColor = System.Drawing.Color.Green
            Me.button1.ForeColor = System.Drawing.Color.White
            Me.button1.Location = New System.Drawing.Point(152, 88)
            Me.button1.Name = "button1"
            Me.button1.Size = New System.Drawing.Size(112, 23)
            Me.button1.TabIndex = 0
            Me.button1.Text = "GO!"
            Me.button1.UseVisualStyleBackColor = False
'           Me.button1.Click += New System.EventHandler(Me.button1_Click)
            '
            ' saveFileDialog1
            '
            Me.saveFileDialog1.Filter = "Excel Files|*.xls"
            Me.saveFileDialog1.RestoreDirectory = True
            '
            ' label1
            '
            Me.label1.Location = New System.Drawing.Point(24, 24)
            Me.label1.Name = "label1"
            Me.label1.Size = New System.Drawing.Size(288, 24)
            Me.label1.TabIndex = 2
            Me.label1.Text = "A report with formulas created with tags."
            '
            ' btnCancel
            '
            Me.btnCancel.Anchor = (CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.btnCancel.BackColor = System.Drawing.Color.FromArgb((CInt((CByte(192)))), (CInt((CByte(0)))), (CInt((CByte(0)))))
            Me.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel
            Me.btnCancel.ForeColor = System.Drawing.Color.White
            Me.btnCancel.Location = New System.Drawing.Point(272, 88)
            Me.btnCancel.Name = "btnCancel"
            Me.btnCancel.Size = New System.Drawing.Size(112, 23)
            Me.btnCancel.TabIndex = 3
            Me.btnCancel.Text = "Cancel"
            Me.btnCancel.UseVisualStyleBackColor = False
'           Me.btnCancel.Click += New System.EventHandler(Me.btnCancel_Click)
            '
            ' mainForm
            '
            Me.AutoScaleDimensions = New System.Drawing.SizeF(6F, 13F)
            Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
            Me.ClientSize = New System.Drawing.Size(416, 133)
            Me.Controls.Add(Me.btnCancel)
            Me.Controls.Add(Me.label1)
            Me.Controls.Add(Me.button1)
            Me.Name = "mainForm"
            Me.Text = "Manual Formulas Report"
            Me.ResumeLayout(False)

        End Sub
        #End Region
    End Class
End Namespace

Form1.vb

Imports System.Collections
Imports System.ComponentModel
Imports System.IO
Imports System.Reflection
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports FlexCel.Report

Namespace ManualFormulas
    ''' <summary>
    ''' Shows the formula tag.
    ''' </summary>
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Public Sub New()
            InitializeComponent()
        End Sub

        Private Sub SetupMines(ByVal MinesReport As FlexCelReport)
            Dim ds As New DataSet()
            Dim dtrows As DataTable = ds.Tables.Add("datarow")
            dtrows.Columns.Add("position", GetType(Integer))

            Dim dtcols As DataTable = ds.Tables.Add("datacol")
            dtcols.Columns.Add("position", GetType(Integer))
            dtcols.Columns.Add("value", GetType(Integer))

            ds.Relations.Add(dtrows.Columns("position"), dtcols.Columns("position"))

            'let's create 10 mines.
            Dim mines As New ArrayList()
            Dim rnd As New Random()
            Do While mines.Count < 10
                Dim nextMine As Integer = rnd.Next(9 * 9 - 1)
                Dim minepos As Integer = mines.BinarySearch(nextMine)
                If minepos >= 0 Then 'the value already exists
                    Continue Do
                End If
                mines.Insert((Not minepos), nextMine)
            Loop

            'Fill the tables on master detail
            For r As Integer = 0 To 8
                dtrows.Rows.Add(New Object() { r })
                For c As Integer = 0 To 8
                    Dim values(1) As Object
                    values(0) = r
                    If mines.BinarySearch(r * 9 + c) >= 0 Then
                        values(1) = 1
                    Else
                        values(1) = DBNull.Value
                    End If
                    dtcols.Rows.Add(values)
                Next c
            Next r

            'finally, add the tables to the report.
            MinesReport.ClearTables()
            MinesReport.AddTable(ds, TDisposeMode.DisposeAfterRun) 'leave to Flexcel to delete the dataset.
        End Sub

        Private Sub button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button1.Click
            AutoRun()
        End Sub

        Public Sub AutoRun()
            Using MinesReport As New FlexCelReport(True)
                AddHandler MinesReport.AfterGenerateWorkbook, AddressOf MinesReport_AfterGenerateWorkbook
                SetupMines(MinesReport)
                Dim DataPath As String = Path.Combine(Path.Combine(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), ".."), "..") & Path.DirectorySeparatorChar

                If saveFileDialog1.ShowDialog() = System.Windows.Forms.DialogResult.OK Then
                    MinesReport.Run(DataPath & "Manual Formulas.template.xls", saveFileDialog1.FileName)

                    If MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) = System.Windows.Forms.DialogResult.Yes Then
                        Process.Start(saveFileDialog1.FileName)
                    End If
                End If
            End Using
        End Sub

        Private Sub btnCancel_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnCancel.Click
            Close()
        End Sub

        Private Sub MinesReport_AfterGenerateWorkbook(ByVal sender As Object, ByVal e As FlexCel.Report.GenerateEventArgs)
            'do some "pretty" up for the final user.
            'we could do this directly on the template, but doing it here allows us to keep the template unprotected and easier to modify.

            e.File.ActiveSheet = 2
            e.File.SheetVisible = TXlsSheetVisible.Hidden
            e.File.ActiveSheet = 1
            e.File.Protection.SetSheetProtection(Nothing, New TSheetProtectionOptions(True))
            For r As Integer = 20 To FlxConsts.Max_Rows97_2003 + 1
                e.File.SetRowHidden(r, True)
            Next r
            For c As Integer = 12 To FlxConsts.Max_Columns97_2003 + 1
                e.File.SetColHidden(c, True)
            Next c
        End Sub
    End Class

End Namespace

Program.vb

Namespace ManualFormulas
    Friend NotInheritable Class Program

        Private Sub New()
        End Sub

        ''' <summary>
        ''' The main entry point for the application.
        ''' </summary>
       <STAThread> _
        Shared Sub Main()
            Application.EnableVisualStyles()
            Application.SetCompatibleTextRenderingDefault(False)
            Application.Run(New mainForm())
        End Sub
    End Class
End Namespace


Parameters inside expressions (VB.Net / netframework) | FlexCel Studio for the .NET Framework documentation

Parameters inside expressions (VB.Net / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\vb\VS2022\netframework\20.Reports\50.Expression Parameters and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​vb/​VS2022/​netframework/​Modules/​20.​Reports/​50.​Expression Parameters

Overview

In FlexCel it is possible to create Expressions that include parameters.

Concepts

  • How to create report Expressions using parameters.

  • How to apply an Expression Format to a formula. You can't directly write a formula like: =a1+1<#format cell(blue)> because of course Excel will not recognize it as a valid formula. > But you can use the <#format range> tag to format the formula. On this example, formula is on column "D" and the formatting tag for the formula is on column "E"

Files

AssemblyInfo.vb

Imports System.Reflection
Imports System.Runtime.CompilerServices

'
' General Information about an assembly is controlled through the following
' set of attributes. Change these attribute values to modify the information
' associated with an assembly.
'
<Assembly: AssemblyTitle("")>
<Assembly: AssemblyDescription("")>
<Assembly: AssemblyConfiguration("")>
<Assembly: AssemblyCompany("")>
<Assembly: AssemblyProduct("")>
<Assembly: AssemblyCopyright("(c) 2002 - 2014 TMS Software")>
<Assembly: AssemblyTrademark("")>
<Assembly: AssemblyCulture("")>

'
' Version information for an assembly consists of the following four values:
'
'      Major Version
'      Minor Version
'      Build Number
'      Revision
'
' You can specify all the values or you can default the Revision and Build Numbers
' by using the '*' as shown below:

<Assembly: AssemblyVersion("6.2.1.0")>

'
' In order to sign your assembly you must specify a key to use. Refer to the
' Microsoft .NET Framework documentation for more information on assembly signing.
'
' Use the attributes below to control which key is used for signing.
'
' Notes:
'   (*) If no key is specified, the assembly is not signed.
'   (*) KeyName refers to a key that has been installed in the Crypto Service
'       Provider (CSP) on your machine. KeyFile refers to a file which contains
'       a key.
'   (*) If the KeyFile and the KeyName values are both specified, the
'       following processing occurs:
'       (1) If the KeyName can be found in the CSP, that key is used.
'       (2) If the KeyName does not exist and the KeyFile does exist, the key
'           in the KeyFile is installed into the CSP and used.
'   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
'       When specifying the KeyFile, the location of the KeyFile should be
'       relative to the project output directory which is
'       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
'       located in the project directory, you would specify the AssemblyKeyFile
'       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
'   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
'       documentation for more information on this.
'
<Assembly: AssemblyDelaySign(False)>
<Assembly: AssemblyKeyFile("")>
<Assembly: AssemblyKeyName("")>

Form1.Designer.vb

Imports System.Collections
Imports System.ComponentModel
Imports System.IO
Imports System.Reflection
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports FlexCel.Report
Imports FlexCel.Demo.SharedData
Namespace ExpressionParameters
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Private WithEvents button1 As System.Windows.Forms.Button
        Private saveFileDialog1 As System.Windows.Forms.SaveFileDialog
        Private label1 As System.Windows.Forms.Label
        Private WithEvents btnCancel As System.Windows.Forms.Button
        ''' <summary>
        ''' Required designer variable.
        ''' </summary>
        Private components As System.ComponentModel.Container = Nothing

        ''' <summary>
        ''' Clean up any resources being used.
        ''' </summary>
        Protected Overrides Sub Dispose(ByVal disposing As Boolean)
            If disposing Then
                If components IsNot Nothing Then
                    components.Dispose()
                End If
            End If
            MyBase.Dispose(disposing)
        End Sub

        #Region "Windows Form Designer generated code"
        ''' <summary>
        ''' Required method for Designer support - do not modify
        ''' the contents of this method with the code editor.
        ''' </summary>
        Private Sub InitializeComponent()
            Me.button1 = New System.Windows.Forms.Button()
            Me.saveFileDialog1 = New System.Windows.Forms.SaveFileDialog()
            Me.ordersReport = New FlexCel.Report.FlexCelReport()
            Me.label1 = New System.Windows.Forms.Label()
            Me.btnCancel = New System.Windows.Forms.Button()
            Me.SuspendLayout()
            '
            ' button1
            '
            Me.button1.Anchor = (CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.button1.BackColor = System.Drawing.Color.Green
            Me.button1.ForeColor = System.Drawing.Color.White
            Me.button1.Location = New System.Drawing.Point(152, 88)
            Me.button1.Name = "button1"
            Me.button1.Size = New System.Drawing.Size(112, 23)
            Me.button1.TabIndex = 0
            Me.button1.Text = "GO!"
'           Me.button1.Click += New System.EventHandler(Me.button1_Click)
            '
            ' saveFileDialog1
            '
            Me.saveFileDialog1.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm|Excel 97/2003|*.xls|Excel 2007|*.xlsx;*.xlsm|All files|*.*"
            Me.saveFileDialog1.RestoreDirectory = True
            '
            ' ordersReport
            '
            Me.ordersReport.DeleteEmptyRanges = False
            Me.ordersReport.ErrorActions = FlexCel.Report.TErrorActions.None
            '
            ' label1
            '
            Me.label1.Location = New System.Drawing.Point(24, 24)
            Me.label1.Name = "label1"
            Me.label1.Size = New System.Drawing.Size(288, 24)
            Me.label1.TabIndex = 2
            Me.label1.Text = "A report with parameters in Expressions"
            '
            ' btnCancel
            '
            Me.btnCancel.Anchor = (CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.btnCancel.BackColor = System.Drawing.Color.FromArgb((CByte(192)), (CByte(0)), (CByte(0)))
            Me.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel
            Me.btnCancel.ForeColor = System.Drawing.Color.White
            Me.btnCancel.Location = New System.Drawing.Point(272, 88)
            Me.btnCancel.Name = "btnCancel"
            Me.btnCancel.Size = New System.Drawing.Size(112, 23)
            Me.btnCancel.TabIndex = 3
            Me.btnCancel.Text = "Cancel"
'           Me.btnCancel.Click += New System.EventHandler(Me.btnCancel_Click)
            '
            ' mainForm
            '
            Me.AutoScaleDimensions = New System.Drawing.SizeF(6F, 13F)
            Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
            Me.ClientSize = New System.Drawing.Size(416, 133)
            Me.Controls.Add(Me.btnCancel)
            Me.Controls.Add(Me.label1)
            Me.Controls.Add(Me.button1)
            Me.Name = "mainForm"
            Me.Text = "Expression Parameters  Report"
            Me.ResumeLayout(False)

        End Sub
        #End Region
    End Class
End Namespace

Form1.vb

Imports System.Collections
Imports System.ComponentModel
Imports System.IO
Imports System.Reflection
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports FlexCel.Report
Imports FlexCel.Demo.SharedData

Namespace ExpressionParameters
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Private ordersReport As FlexCel.Report.FlexCelReport

        Public Sub New()
            InitializeComponent()
        End Sub

        Private Sub button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button1.Click
            AutoRun()
        End Sub

        Public Sub AutoRun()
            Using ordersReport As FlexCelReport = SharedData.CreateReport()
                ordersReport.SetValue("Date", Date.Now)

                Dim DataPath As String = Path.Combine(Path.Combine(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), ".."), "..") & Path.DirectorySeparatorChar

                If saveFileDialog1.ShowDialog() = System.Windows.Forms.DialogResult.OK Then
                    ordersReport.Run(DataPath & "Expression Parameters.template.xls", saveFileDialog1.FileName)

                    If MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) = System.Windows.Forms.DialogResult.Yes Then
                        Process.Start(saveFileDialog1.FileName)
                    End If
                End If
            End Using
        End Sub

        Private Sub btnCancel_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnCancel.Click
            Close()
        End Sub
    End Class

End Namespace

Program.vb

Namespace ExpressionParameters
    Friend NotInheritable Class Program

        Private Sub New()
        End Sub

        ''' <summary>
        ''' The main entry point for the application.
        ''' </summary>
       <STAThread> _
        Shared Sub Main()
            Application.EnableVisualStyles()
            Application.SetCompatibleTextRenderingDefault(False)
            Application.Run(New mainForm())
        End Sub
    End Class
End Namespace


Intelligent page breaks in reports (VB.Net / netframework) | FlexCel Studio for the .NET Framework documentation

Intelligent page breaks in reports (VB.Net / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\vb\VS2022\netframework\20.Reports\51.Intelligent Page Breaks In Reports and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​vb/​VS2022/​netframework/​Modules/​20.​Reports/​51.​Intelligent Page Breaks In Reports

Overview

Intelligent page breaks are a FlexCel feature that lets you keep together selected rows when printing.

In this demo we will see how to use them on a report.

Make sure to read the conceptual documentation about Intelligent Page Breaks to better understand what we are doing here.

Concepts

  • How to create Multi-level "keep together" ranges. In most reports one level is normally enough, but in master detail cases or situations like this one, you might need more than one.

  • Take a look at the "keeprows_x_" named ranges in the template. Those are the ranges you use to tell FlexCel which rows to keep together. To have an interesting data sample for our demo, we will write a chart of the customers only if they are from Germany or USA.

  • In this example, we want to keep full customers in the same page. But if that isn't possible, we would like the chart not to split in the middle of a page break. That is why we defined a "keeprows_2_" inside "keeprows_1_" protecting the chart. You can see an example of how this works at pages 43-44 when doing a print preview. The chart is completely in a page 44, instead of half in 43 and half in the 44. If you remove the "keeprows_2_" range from the template you will see how that would be otherwise.

Files

AssemblyInfo.vb

Imports System.Reflection
Imports System.Runtime.CompilerServices

'
' General Information about an assembly is controlled through the following
' set of attributes. Change these attribute values to modify the information
' associated with an assembly.
'
<Assembly: AssemblyTitle("")>
<Assembly: AssemblyDescription("")>
<Assembly: AssemblyConfiguration("")>
<Assembly: AssemblyCompany("")>
<Assembly: AssemblyProduct("")>
<Assembly: AssemblyCopyright("(c) 2002 - 2014 TMS Software")>
<Assembly: AssemblyTrademark("")>
<Assembly: AssemblyCulture("")>

'
' Version information for an assembly consists of the following four values:
'
'      Major Version
'      Minor Version
'      Build Number
'      Revision
'
' You can specify all the values or you can default the Revision and Build Numbers
' by using the '*' as shown below:

<Assembly: AssemblyVersion("6.2.1.0")>

'
' In order to sign your assembly you must specify a key to use. Refer to the
' Microsoft .NET Framework documentation for more information on assembly signing.
'
' Use the attributes below to control which key is used for signing.
'
' Notes:
'   (*) If no key is specified, the assembly is not signed.
'   (*) KeyName refers to a key that has been installed in the Crypto Service
'       Provider (CSP) on your machine. KeyFile refers to a file which contains
'       a key.
'   (*) If the KeyFile and the KeyName values are both specified, the
'       following processing occurs:
'       (1) If the KeyName can be found in the CSP, that key is used.
'       (2) If the KeyName does not exist and the KeyFile does exist, the key
'           in the KeyFile is installed into the CSP and used.
'   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
'       When specifying the KeyFile, the location of the KeyFile should be
'       relative to the project output directory which is
'       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
'       located in the project directory, you would specify the AssemblyKeyFile
'       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
'   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
'       documentation for more information on this.
'
<Assembly: AssemblyDelaySign(False)>
<Assembly: AssemblyKeyFile("")>
<Assembly: AssemblyKeyName("")>

Form1.Designer.vb

Imports System.Collections
Imports System.ComponentModel
Imports System.IO
Imports System.Reflection
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports FlexCel.Report
Imports FlexCel.Demo.SharedData
Namespace IntelligentPageBreaksInReports
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Private WithEvents button1 As System.Windows.Forms.Button
        Private saveFileDialog1 As System.Windows.Forms.SaveFileDialog
        Private label1 As System.Windows.Forms.Label
        Private WithEvents btnCancel As System.Windows.Forms.Button
        ''' <summary>
        ''' Required designer variable.
        ''' </summary>
        Private components As System.ComponentModel.Container = Nothing

        ''' <summary>
        ''' Clean up any resources being used.
        ''' </summary>
        Protected Overrides Sub Dispose(ByVal disposing As Boolean)
            If disposing Then
                If components IsNot Nothing Then
                    components.Dispose()
                End If
            End If
            MyBase.Dispose(disposing)
        End Sub

        #Region "Windows Form Designer generated code"
        ''' <summary>
        ''' Required method for Designer support - do not modify
        ''' the contents of this method with the code editor.
        ''' </summary>
        Private Sub InitializeComponent()
            Me.button1 = New System.Windows.Forms.Button()
            Me.saveFileDialog1 = New System.Windows.Forms.SaveFileDialog()
            Me.label1 = New System.Windows.Forms.Label()
            Me.btnCancel = New System.Windows.Forms.Button()
            Me.SuspendLayout()
            '
            ' button1
            '
            Me.button1.Anchor = (CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.button1.BackColor = System.Drawing.Color.Green
            Me.button1.ForeColor = System.Drawing.Color.White
            Me.button1.Location = New System.Drawing.Point(152, 88)
            Me.button1.Name = "button1"
            Me.button1.Size = New System.Drawing.Size(112, 23)
            Me.button1.TabIndex = 0
            Me.button1.Text = "GO!"
'           Me.button1.Click += New System.EventHandler(Me.button1_Click)
            '
            ' saveFileDialog1
            '
            Me.saveFileDialog1.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm|Excel 97/2003|*.xls|Excel 2007|*.xlsx;*.xlsm|All files|*.*"
            Me.saveFileDialog1.RestoreDirectory = True
            '
            ' label1
            '
            Me.label1.Location = New System.Drawing.Point(24, 24)
            Me.label1.Name = "label1"
            Me.label1.Size = New System.Drawing.Size(288, 24)
            Me.label1.TabIndex = 2
            Me.label1.Text = "A small example on a multilevel ""keep together"" report"
            '
            ' btnCancel
            '
            Me.btnCancel.Anchor = (CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.btnCancel.BackColor = System.Drawing.Color.FromArgb((CByte(192)), (CByte(0)), (CByte(0)))
            Me.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel
            Me.btnCancel.ForeColor = System.Drawing.Color.White
            Me.btnCancel.Location = New System.Drawing.Point(272, 88)
            Me.btnCancel.Name = "btnCancel"
            Me.btnCancel.Size = New System.Drawing.Size(112, 23)
            Me.btnCancel.TabIndex = 3
            Me.btnCancel.Text = "Cancel"
'           Me.btnCancel.Click += New System.EventHandler(Me.btnCancel_Click)
            '
            ' mainForm
            '
            Me.AutoScaleDimensions = New System.Drawing.SizeF(6F, 13F)
            Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
            Me.ClientSize = New System.Drawing.Size(416, 133)
            Me.Controls.Add(Me.btnCancel)
            Me.Controls.Add(Me.label1)
            Me.Controls.Add(Me.button1)
            Me.Name = "mainForm"
            Me.Text = "Intelligent Page Breaks In  Reports"
            Me.ResumeLayout(False)

        End Sub
        #End Region
    End Class
End Namespace

Form1.vb

Imports System.Collections
Imports System.ComponentModel
Imports System.IO
Imports System.Reflection
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports FlexCel.Report
Imports FlexCel.Demo.SharedData

Namespace IntelligentPageBreaksInReports
    ''' <summary>
    ''' How to keep things together when doing reports.
    ''' </summary>
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Public Sub New()
            InitializeComponent()
        End Sub

        Private Sub button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button1.Click
            AutoRun()
        End Sub

        Public Sub AutoRun()
            Using ordersReport As FlexCelReport = SharedData.CreateReport()
                ordersReport.SetValue("Date", Date.Now)

                Dim DataPath As String = Path.Combine(Path.Combine(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), ".."), "..") & Path.DirectorySeparatorChar

                If saveFileDialog1.ShowDialog() = System.Windows.Forms.DialogResult.OK Then
                    ordersReport.Run(DataPath & "Intelligent Page Breaks In Reports.template" & Path.GetExtension(saveFileDialog1.FileName), saveFileDialog1.FileName)

                    If MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) = System.Windows.Forms.DialogResult.Yes Then
                        Process.Start(saveFileDialog1.FileName)
                    End If
                End If
            End Using
        End Sub

        Private Sub btnCancel_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnCancel.Click
            Close()
        End Sub
    End Class

End Namespace

Program.vb

Namespace IntelligentPageBreaksInReports
    Friend NotInheritable Class Program

        Private Sub New()
        End Sub

        ''' <summary>
        ''' The main entry point for the application.
        ''' </summary>
       <STAThread> _
        Shared Sub Main()
            Application.EnableVisualStyles()
            Application.SetCompatibleTextRenderingDefault(False)
            Application.Run(New mainForm())
        End Sub
    End Class
End Namespace


Debugging reports (VB.Net / netframework) | FlexCel Studio for the .NET Framework documentation

Debugging reports (VB.Net / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\vb\VS2022\netframework\20.Reports\52.Debugging Reports and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​vb/​VS2022/​netframework/​Modules/​20.​Reports/​52.​Debugging Reports

Overview

As you have seen in the previous demos, tags can get complex once you start nesting them one inside the other to get a result. This demo shows how to investigate expressions on your report, and deal with bugs in your expressions by looking at what is going on inside the hood. Make sure you read Debugging Reports in the Report designer's guide for more in depth information.

Concepts

  • How to use the <#debug> tag in the config sheet to activate debug mode. Note that we could get the same effect by setting FlexCelReport.DebugExpressions and FlexCelReport.ErrorsInResultFile.

Files

AssemblyInfo.vb

Imports System.Reflection
Imports System.Runtime.CompilerServices

'
' General Information about an assembly is controlled through the following
' set of attributes. Change these attribute values to modify the information
' associated with an assembly.
'
<Assembly: AssemblyTitle("")>
<Assembly: AssemblyDescription("")>
<Assembly: AssemblyConfiguration("")>
<Assembly: AssemblyCompany("")>
<Assembly: AssemblyProduct("")>
<Assembly: AssemblyCopyright("(c) 2002 - 2014 TMS Software")>
<Assembly: AssemblyTrademark("")>
<Assembly: AssemblyCulture("")>

'
' Version information for an assembly consists of the following four values:
'
'      Major Version
'      Minor Version
'      Build Number
'      Revision
'
' You can specify all the values or you can default the Revision and Build Numbers
' by using the '*' as shown below:

<Assembly: AssemblyVersion("6.2.1.0")>

'
' In order to sign your assembly you must specify a key to use. Refer to the
' Microsoft .NET Framework documentation for more information on assembly signing.
'
' Use the attributes below to control which key is used for signing.
'
' Notes:
'   (*) If no key is specified, the assembly is not signed.
'   (*) KeyName refers to a key that has been installed in the Crypto Service
'       Provider (CSP) on your machine. KeyFile refers to a file which contains
'       a key.
'   (*) If the KeyFile and the KeyName values are both specified, the
'       following processing occurs:
'       (1) If the KeyName can be found in the CSP, that key is used.
'       (2) If the KeyName does not exist and the KeyFile does exist, the key
'           in the KeyFile is installed into the CSP and used.
'   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
'       When specifying the KeyFile, the location of the KeyFile should be
'       relative to the project output directory which is
'       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
'       located in the project directory, you would specify the AssemblyKeyFile
'       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
'   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
'       documentation for more information on this.
'
<Assembly: AssemblyDelaySign(False)>
<Assembly: AssemblyKeyFile("")>
<Assembly: AssemblyKeyName("")>

Form1.Designer.vb

Imports System.Collections
Imports System.ComponentModel
Imports System.IO
Imports System.Reflection
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports FlexCel.Report
Namespace DebuggingReports
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Private WithEvents button1 As System.Windows.Forms.Button
        Private saveFileDialog1 As System.Windows.Forms.SaveFileDialog
        Private label1 As System.Windows.Forms.Label
        Private WithEvents btnCancel As System.Windows.Forms.Button
        ''' <summary>
        ''' Required designer variable.
        ''' </summary>
        Private components As System.ComponentModel.Container = Nothing

        ''' <summary>
        ''' Clean up any resources being used.
        ''' </summary>
        Protected Overrides Sub Dispose(ByVal disposing As Boolean)
            If disposing Then
                If components IsNot Nothing Then
                    components.Dispose()
                End If
            End If
            MyBase.Dispose(disposing)
        End Sub

        #Region "Windows Form Designer generated code"
        ''' <summary>
        ''' Required method for Designer support - do not modify
        ''' the contents of this method with the code editor.
        ''' </summary>
        Private Sub InitializeComponent()
            Me.button1 = New System.Windows.Forms.Button()
            Me.saveFileDialog1 = New System.Windows.Forms.SaveFileDialog()
            Me.label1 = New System.Windows.Forms.Label()
            Me.btnCancel = New System.Windows.Forms.Button()
            Me.SuspendLayout()
            '
            ' button1
            '
            Me.button1.Anchor = (CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.button1.BackColor = System.Drawing.Color.Green
            Me.button1.ForeColor = System.Drawing.Color.White
            Me.button1.Location = New System.Drawing.Point(152, 88)
            Me.button1.Name = "button1"
            Me.button1.Size = New System.Drawing.Size(112, 23)
            Me.button1.TabIndex = 0
            Me.button1.Text = "GO!"
'           Me.button1.Click += New System.EventHandler(Me.button1_Click)
            '
            ' saveFileDialog1
            '
            Me.saveFileDialog1.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm|Excel 97/2003|*.xls|Excel 2007|*.xlsx;*.xlsm|All files|*.*"
            Me.saveFileDialog1.RestoreDirectory = True
            '
            ' label1
            '
            Me.label1.Location = New System.Drawing.Point(24, 24)
            Me.label1.Name = "label1"
            Me.label1.Size = New System.Drawing.Size(288, 24)
            Me.label1.TabIndex = 2
            Me.label1.Text = "A demo showing how to debug reports"
            '
            ' btnCancel
            '
            Me.btnCancel.Anchor = (CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.btnCancel.BackColor = System.Drawing.Color.FromArgb((CByte(192)), (CByte(0)), (CByte(0)))
            Me.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel
            Me.btnCancel.ForeColor = System.Drawing.Color.White
            Me.btnCancel.Location = New System.Drawing.Point(272, 88)
            Me.btnCancel.Name = "btnCancel"
            Me.btnCancel.Size = New System.Drawing.Size(112, 23)
            Me.btnCancel.TabIndex = 3
            Me.btnCancel.Text = "Cancel"
'           Me.btnCancel.Click += New System.EventHandler(Me.btnCancel_Click)
            '
            ' mainForm
            '
            Me.AutoScaleDimensions = New System.Drawing.SizeF(6F, 13F)
            Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
            Me.ClientSize = New System.Drawing.Size(416, 133)
            Me.Controls.Add(Me.btnCancel)
            Me.Controls.Add(Me.label1)
            Me.Controls.Add(Me.button1)
            Me.Name = "mainForm"
            Me.Text = "Debugging  Reports"
            Me.ResumeLayout(False)

        End Sub
        #End Region
    End Class
End Namespace

Form1.vb

Imports System.Collections
Imports System.ComponentModel
Imports System.IO
Imports System.Reflection
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports FlexCel.Report

Namespace DebuggingReports
    ''' <summary>
    ''' How to debug a report.
    ''' </summary>
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Public Sub New()
            InitializeComponent()
        End Sub

        Private Sub button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button1.Click
            AutoRun()
        End Sub

        Private Function CreateReport() As FlexCelReport
            Dim Result As New FlexCelReport(True)

            Result.SetValue("test", 3)
            Result.SetValue("tagval", 1)
            Result.SetValue("refval", "l")

            'Here we will add a dummy table with some fantasy values
            Dim dt As New DataTable("testdb")
            dt.Columns.Add("key", GetType(Integer))
            dt.Columns.Add("data", GetType(String))
            dt.Rows.Add(New Object() { 5, "cat" })
            dt.Rows.Add(New Object() { 6, "dog" })
            Result.AddTable("testdb", dt, TDisposeMode.DisposeAfterRun)

            Return Result
        End Function

        Public Sub AutoRun()
            Using Report As FlexCelReport = CreateReport()
                Dim DataPath As String = Path.Combine(Path.Combine(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), ".."), "..") & Path.DirectorySeparatorChar

                If saveFileDialog1.ShowDialog() = System.Windows.Forms.DialogResult.OK Then
                    Report.Run(DataPath & "Debugging Reports.template.xls", saveFileDialog1.FileName)

                    If MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) = System.Windows.Forms.DialogResult.Yes Then
                        Process.Start(saveFileDialog1.FileName)
                    End If
                End If
            End Using
        End Sub

        Private Sub btnCancel_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnCancel.Click
            Close()
        End Sub
    End Class

End Namespace

Program.vb

Namespace DebuggingReports
    Friend NotInheritable Class Program

        Private Sub New()
        End Sub

        ''' <summary>
        ''' The main entry point for the application.
        ''' </summary>
       <STAThread> _
        Shared Sub Main()
            Application.EnableVisualStyles()
            Application.SetCompatibleTextRenderingDefault(False)
            Application.Run(New mainForm())
        End Sub
    End Class
End Namespace


Fixed forms with datasets (VB.Net / netframework) | FlexCel Studio for the .NET Framework documentation

Fixed forms with datasets (VB.Net / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\vb\VS2022\netframework\20.Reports\55.Fixed Forms With Datasets and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​vb/​VS2022/​netframework/​Modules/​20.​Reports/​55.​Fixed Forms With Datasets

Overview

Sometimes you need to have a normal entry form, but a part of that form is a table from a dataset. Under normal FlexCel mode, the rows will be inserted, and the bottom of the form moved down, and this is what you normally would like. But using __dataset__FIXED ranges, you can create a band that will not insert any row, keeping the format of the form unchanged. Look at Fixed Bands in the Reports designer guide for more information.

Concepts

  • How to create bands that do not insert rows.

  • How to use the "TOP" tag to filter the top 10 items in the list. (look at Retrieving TOP N Records from a table in the Reports designer guide) Note: The top tag is not recommended as a general way to filter datasets. If for example you need 10 records from a dataset, with this tag you will still retrieve the full table from the database. Whenever possible, you must filter at the data layer level, avoiding retrieving those records at all.

Files

AssemblyInfo.vb

Imports System.Reflection
Imports System.Runtime.CompilerServices

'
' General Information about an assembly is controlled through the following
' set of attributes. Change these attribute values to modify the information
' associated with an assembly.
'
<Assembly: AssemblyTitle("")>
<Assembly: AssemblyDescription("")>
<Assembly: AssemblyConfiguration("")>
<Assembly: AssemblyCompany("")>
<Assembly: AssemblyProduct("")>
<Assembly: AssemblyCopyright("(c) 2002 - 2014 TMS Software")>
<Assembly: AssemblyTrademark("")>
<Assembly: AssemblyCulture("")>

'
' Version information for an assembly consists of the following four values:
'
'      Major Version
'      Minor Version
'      Build Number
'      Revision
'
' You can specify all the values or you can default the Revision and Build Numbers
' by using the '*' as shown below:

<Assembly: AssemblyVersion("6.2.1.0")>

'
' In order to sign your assembly you must specify a key to use. Refer to the
' Microsoft .NET Framework documentation for more information on assembly signing.
'
' Use the attributes below to control which key is used for signing.
'
' Notes:
'   (*) If no key is specified, the assembly is not signed.
'   (*) KeyName refers to a key that has been installed in the Crypto Service
'       Provider (CSP) on your machine. KeyFile refers to a file which contains
'       a key.
'   (*) If the KeyFile and the KeyName values are both specified, the
'       following processing occurs:
'       (1) If the KeyName can be found in the CSP, that key is used.
'       (2) If the KeyName does not exist and the KeyFile does exist, the key
'           in the KeyFile is installed into the CSP and used.
'   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
'       When specifying the KeyFile, the location of the KeyFile should be
'       relative to the project output directory which is
'       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
'       located in the project directory, you would specify the AssemblyKeyFile
'       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
'   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
'       documentation for more information on this.
'
<Assembly: AssemblyDelaySign(False)>
<Assembly: AssemblyKeyFile("")>
<Assembly: AssemblyKeyName("")>

Form1.Designer.vb

Imports System.Collections
Imports System.ComponentModel
Imports System.IO
Imports System.Reflection
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports FlexCel.Report
Imports FlexCel.Demo.SharedData
Namespace FixedFormsWithDatasets
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Private WithEvents button1 As System.Windows.Forms.Button
        Private saveFileDialog1 As System.Windows.Forms.SaveFileDialog
        Private label1 As System.Windows.Forms.Label
        Private WithEvents btnCancel As System.Windows.Forms.Button
        ''' <summary>
        ''' Required designer variable.
        ''' </summary>
        Private components As System.ComponentModel.Container = Nothing

        ''' <summary>
        ''' Clean up any resources being used.
        ''' </summary>
        Protected Overrides Sub Dispose(ByVal disposing As Boolean)
            If disposing Then
                If components IsNot Nothing Then
                    components.Dispose()
                End If
            End If
            MyBase.Dispose(disposing)
        End Sub

        #Region "Windows Form Designer generated code"
        ''' <summary>
        ''' Required method for Designer support - do not modify
        ''' the contents of this method with the code editor.
        ''' </summary>
        Private Sub InitializeComponent()
            Me.button1 = New System.Windows.Forms.Button()
            Me.saveFileDialog1 = New System.Windows.Forms.SaveFileDialog()
            Me.label1 = New System.Windows.Forms.Label()
            Me.btnCancel = New System.Windows.Forms.Button()
            Me.SuspendLayout()
            '
            ' button1
            '
            Me.button1.Anchor = (CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.button1.BackColor = System.Drawing.Color.Green
            Me.button1.ForeColor = System.Drawing.Color.White
            Me.button1.Location = New System.Drawing.Point(152, 88)
            Me.button1.Name = "button1"
            Me.button1.Size = New System.Drawing.Size(112, 23)
            Me.button1.TabIndex = 0
            Me.button1.Text = "GO!"
            Me.button1.UseVisualStyleBackColor = False
'           Me.button1.Click += New System.EventHandler(Me.button1_Click)
            '
            ' saveFileDialog1
            '
            Me.saveFileDialog1.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm|Excel 97/2003|*.xls|Excel 2007|*.xlsx;*.xlsm|All files|*.*"
            Me.saveFileDialog1.RestoreDirectory = True
            '
            ' label1
            '
            Me.label1.Location = New System.Drawing.Point(24, 24)
            Me.label1.Name = "label1"
            Me.label1.Size = New System.Drawing.Size(288, 24)
            Me.label1.TabIndex = 2
            Me.label1.Text = "A form with a table inside"
            '
            ' btnCancel
            '
            Me.btnCancel.Anchor = (CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.btnCancel.BackColor = System.Drawing.Color.FromArgb((CInt((CByte(192)))), (CInt((CByte(0)))), (CInt((CByte(0)))))
            Me.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel
            Me.btnCancel.ForeColor = System.Drawing.Color.White
            Me.btnCancel.Location = New System.Drawing.Point(272, 88)
            Me.btnCancel.Name = "btnCancel"
            Me.btnCancel.Size = New System.Drawing.Size(112, 23)
            Me.btnCancel.TabIndex = 3
            Me.btnCancel.Text = "Cancel"
            Me.btnCancel.UseVisualStyleBackColor = False
'           Me.btnCancel.Click += New System.EventHandler(Me.btnCancel_Click)
            '
            ' mainForm
            '
            Me.AutoScaleDimensions = New System.Drawing.SizeF(6F, 13F)
            Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
            Me.ClientSize = New System.Drawing.Size(416, 133)
            Me.Controls.Add(Me.btnCancel)
            Me.Controls.Add(Me.label1)
            Me.Controls.Add(Me.button1)
            Me.Name = "mainForm"
            Me.Text = "Fixed Form  Report"
            Me.ResumeLayout(False)

        End Sub
        #End Region
    End Class
End Namespace

Form1.vb

Imports System.Collections
Imports System.ComponentModel
Imports System.IO
Imports System.Reflection
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports FlexCel.Report
Imports FlexCel.Demo.SharedData

Namespace FixedFormsWithDatasets
    ''' <summary>
    ''' Form-Like reports
    ''' </summary>
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Public Sub New()
            InitializeComponent()
        End Sub

        Private Sub button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button1.Click
            AutoRun()
        End Sub

        Public Sub AutoRun()
            Using ordersReport As FlexCelReport = SharedData.CreateReport()
                ordersReport.SetValue("Date", Date.Now)

                Dim DataPath As String = Path.Combine(Path.Combine(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), ".."), "..") & Path.DirectorySeparatorChar

                If saveFileDialog1.ShowDialog() = System.Windows.Forms.DialogResult.OK Then
                    ordersReport.Run(DataPath & "Fixed Forms With Datasets.template.xls", saveFileDialog1.FileName)

                    If MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) = System.Windows.Forms.DialogResult.Yes Then
                        Process.Start(saveFileDialog1.FileName)
                    End If
                End If
            End Using
        End Sub

        Private Sub btnCancel_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnCancel.Click
            Close()
        End Sub
    End Class

End Namespace

Program.vb

Namespace FixedFormsWithDatasets
    Friend NotInheritable Class Program

        Private Sub New()
        End Sub

        ''' <summary>
        ''' The main entry point for the application.
        ''' </summary>
       <STAThread> _
        Shared Sub Main()
            Application.EnableVisualStyles()
            Application.SetCompatibleTextRenderingDefault(False)
            Application.Run(New mainForm())
        End Sub
    End Class
End Namespace


Balanced columns (VB.Net / netframework) | FlexCel Studio for the .NET Framework documentation

Balanced columns (VB.Net / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\vb\VS2022\netframework\20.Reports\57.Balanced Columns and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​vb/​VS2022/​netframework/​Modules/​20.​Reports/​57.​Balanced Columns

Overview

The FlexCel reporting engine will automatically balance the ranges that are inside a master range so the master range will stay in place. You can use this feature for creating master detail reports with balanced columns inside (where the master will grow to cover the longest column), or use a fake "master" report to ensure the columns inside the report have the same number of rows.

Concepts

  • How to create a master detail report with detail columns, and where the master grows with the biggest of the columns. In columns where the number is less, the last cell of the column will be copied to fill the missing rows, so all columns have the same height.

  • How to use Fixed N Bands to avoid having empty rows at the end of each master record.

  • How to use the "ROWS" function in the config sheet (see Creating empty datasets with N rows) to create a database with a single row, that you can use as a master from the main report, and so ensure balanced columns.

For more information in balanced columns please take a look at the section Fixed N Bands in the Reports designer's guide.

Files

AssemblyInfo.vb

Imports System.Reflection
Imports System.Runtime.CompilerServices

'
' General Information about an assembly is controlled through the following
' set of attributes. Change these attribute values to modify the information
' associated with an assembly.
'
<Assembly: AssemblyTitle("")>
<Assembly: AssemblyDescription("")>
<Assembly: AssemblyConfiguration("")>
<Assembly: AssemblyCompany("")>
<Assembly: AssemblyProduct("")>
<Assembly: AssemblyCopyright("(c) 2002 - 2014 TMS Software")>
<Assembly: AssemblyTrademark("")>
<Assembly: AssemblyCulture("")>

'
' Version information for an assembly consists of the following four values:
'
'      Major Version
'      Minor Version
'      Build Number
'      Revision
'
' You can specify all the values or you can default the Revision and Build Numbers
' by using the '*' as shown below:

<Assembly: AssemblyVersion("6.2.1.0")>

'
' In order to sign your assembly you must specify a key to use. Refer to the
' Microsoft .NET Framework documentation for more information on assembly signing.
'
' Use the attributes below to control which key is used for signing.
'
' Notes:
'   (*) If no key is specified, the assembly is not signed.
'   (*) KeyName refers to a key that has been installed in the Crypto Service
'       Provider (CSP) on your machine. KeyFile refers to a file which contains
'       a key.
'   (*) If the KeyFile and the KeyName values are both specified, the
'       following processing occurs:
'       (1) If the KeyName can be found in the CSP, that key is used.
'       (2) If the KeyName does not exist and the KeyFile does exist, the key
'           in the KeyFile is installed into the CSP and used.
'   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
'       When specifying the KeyFile, the location of the KeyFile should be
'       relative to the project output directory which is
'       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
'       located in the project directory, you would specify the AssemblyKeyFile
'       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
'   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
'       documentation for more information on this.
'
<Assembly: AssemblyDelaySign(False)>
<Assembly: AssemblyKeyFile("")>
<Assembly: AssemblyKeyName("")>

Form1.Designer.vb

Imports System.Collections
Imports System.ComponentModel
Imports System.IO
Imports System.Reflection
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports FlexCel.Report
Imports FlexCel.Demo.SharedData
Namespace BalancedColumns
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Private WithEvents button1 As System.Windows.Forms.Button
        Private saveFileDialog1 As System.Windows.Forms.SaveFileDialog
        Private label1 As System.Windows.Forms.Label
        Private WithEvents btnCancel As System.Windows.Forms.Button
        ''' <summary>
        ''' Required designer variable.
        ''' </summary>
        Private components As System.ComponentModel.Container = Nothing

        ''' <summary>
        ''' Clean up any resources being used.
        ''' </summary>
        Protected Overrides Sub Dispose(ByVal disposing As Boolean)
            If disposing Then
                If components IsNot Nothing Then
                    components.Dispose()
                End If
            End If
            MyBase.Dispose(disposing)
        End Sub

        #Region "Windows Form Designer generated code"
        ''' <summary>
        ''' Required method for Designer support - do not modify
        ''' the contents of this method with the code editor.
        ''' </summary>
        Private Sub InitializeComponent()
            Me.button1 = New System.Windows.Forms.Button()
            Me.saveFileDialog1 = New System.Windows.Forms.SaveFileDialog()
            Me.label1 = New System.Windows.Forms.Label()
            Me.btnCancel = New System.Windows.Forms.Button()
            Me.SuspendLayout()
            '
            ' button1
            '
            Me.button1.Anchor = (CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.button1.BackColor = System.Drawing.Color.Green
            Me.button1.ForeColor = System.Drawing.Color.White
            Me.button1.Location = New System.Drawing.Point(152, 88)
            Me.button1.Name = "button1"
            Me.button1.Size = New System.Drawing.Size(112, 23)
            Me.button1.TabIndex = 0
            Me.button1.Text = "GO!"
            Me.button1.UseVisualStyleBackColor = False
'           Me.button1.Click += New System.EventHandler(Me.button1_Click)
            '
            ' saveFileDialog1
            '
            Me.saveFileDialog1.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm|Excel 97/2003|*.xls|Excel 2007|*.xlsx;*.xlsm|All files|*.*"
            Me.saveFileDialog1.RestoreDirectory = True
            '
            ' label1
            '
            Me.label1.Location = New System.Drawing.Point(24, 24)
            Me.label1.Name = "label1"
            Me.label1.Size = New System.Drawing.Size(288, 24)
            Me.label1.TabIndex = 2
            Me.label1.Text = "A report with side-by-side columns with different lenghts."
            '
            ' btnCancel
            '
            Me.btnCancel.Anchor = (CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.btnCancel.BackColor = System.Drawing.Color.FromArgb((CInt((CByte(192)))), (CInt((CByte(0)))), (CInt((CByte(0)))))
            Me.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel
            Me.btnCancel.ForeColor = System.Drawing.Color.White
            Me.btnCancel.Location = New System.Drawing.Point(272, 88)
            Me.btnCancel.Name = "btnCancel"
            Me.btnCancel.Size = New System.Drawing.Size(112, 23)
            Me.btnCancel.TabIndex = 3
            Me.btnCancel.Text = "Cancel"
            Me.btnCancel.UseVisualStyleBackColor = False
'           Me.btnCancel.Click += New System.EventHandler(Me.btnCancel_Click)
            '
            ' mainForm
            '
            Me.AutoScaleDimensions = New System.Drawing.SizeF(6F, 13F)
            Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
            Me.ClientSize = New System.Drawing.Size(416, 133)
            Me.Controls.Add(Me.btnCancel)
            Me.Controls.Add(Me.label1)
            Me.Controls.Add(Me.button1)
            Me.Name = "mainForm"
            Me.Text = "Balanced Columns"
            Me.ResumeLayout(False)

        End Sub
        #End Region
    End Class
End Namespace

Form1.vb

Imports System.Collections
Imports System.ComponentModel
Imports System.IO
Imports System.Reflection
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports FlexCel.Report
Imports FlexCel.Demo.SharedData

Namespace BalancedColumns
    ''' <summary>
    ''' Form-Like reports
    ''' </summary>
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Public Sub New()
            InitializeComponent()
        End Sub

        Private Sub button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button1.Click
            AutoRun()
        End Sub

        Public Sub AutoRun()
            Using report As FlexCelReport = SharedData.CreateReport()
                Dim DataPath As String = Path.Combine(Path.Combine(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), ".."), "..") & Path.DirectorySeparatorChar

                If saveFileDialog1.ShowDialog() = System.Windows.Forms.DialogResult.OK Then
                    report.Run(DataPath & "Balanced Columns.template.xls", saveFileDialog1.FileName)

                    If MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) = System.Windows.Forms.DialogResult.Yes Then
                        Process.Start(saveFileDialog1.FileName)
                    End If
                End If
            End Using
        End Sub

        Private Sub btnCancel_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnCancel.Click
            Close()
        End Sub
    End Class

End Namespace

Program.vb

Namespace BalancedColumns
    Friend NotInheritable Class Program

        Private Sub New()
        End Sub

        ''' <summary>
        ''' The main entry point for the application.
        ''' </summary>
       <STAThread> _
        Shared Sub Main()
            Application.EnableVisualStyles()
            Application.SetCompatibleTextRenderingDefault(False)
            Application.Run(New mainForm())
        End Sub
    End Class
End Namespace


Join and Union (VB.Net / netframework) | FlexCel Studio for the .NET Framework documentation

Join and Union (VB.Net / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\vb\VS2022\netframework\20.Reports\58.Join and Union and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​vb/​VS2022/​netframework/​Modules/​20.​Reports/​58.​Join and Union

Overview

Sometimes you want to run unrelated reports in columns. One option is to run them as "_" ranges instead of "__" (see the Balanced Columns example). But this will break merged cells and ranges might not expand (see Joining Tables in the Report Designers guide). So other option is to "join" those unrelated tables into a single table, and run a single "__" range.

Also shown in this example is how to do a Union of Tables.

Concepts

  • How to join unrelated tables into a bigger table. In this example we join Categories, Products and Shippers into a single table (CSP) which we use to run the report.

  • How to access the fields of the joined table. If the joined tables have different column names, you can access those fields directly. For example, we write "<#CSP.CategoryName>" and this will access the column CategoryName of the Categories table in the CSP table, as none of the other joined tables has a similar column. But when we want to access CategoryId, that column is present in both Categories and Products. So we need to explicitly write the table name after CSP and before CategoryID. In this example, <#CSP.Products.CategoryId> references the column CategoryId of the table Prodcuts, and not Categories.

  • It might be a good idea to always prefix the table being accessed when using a joined table. In this example we write <#CSP.Shippers.CompanyName> even when CompanyName is not in the other tables and we could just write <#CSP.CompanyName>. But somehow writing the full name will make it more future proof, not breaking if we later add another table. As in this example we wanted to show both variants, we used both forms (the short one: <#CSP.CategoryName> and the long one: <#CSP.Shippers.CompanyName>) But depending on your case and if there are chances of column names being the same, you might want to just use only the long form.

  • How to use the "UNION" function to append the records of one table after another. In this example we do a union of Suppliers, Shippers and Customers and write the phone numbers of all of them into a single table.

For more information in balanced columns please take a look at the sections Joining Tables and Union of Tables in the Report Designers guide.

Files

AssemblyInfo.vb

Imports System.Reflection
Imports System.Runtime.CompilerServices

'
' General Information about an assembly is controlled through the following
' set of attributes. Change these attribute values to modify the information
' associated with an assembly.
'
<Assembly: AssemblyTitle("")>
<Assembly: AssemblyDescription("")>
<Assembly: AssemblyConfiguration("")>
<Assembly: AssemblyCompany("")>
<Assembly: AssemblyProduct("")>
<Assembly: AssemblyCopyright("(c) 2002 - 2014 TMS Software")>
<Assembly: AssemblyTrademark("")>
<Assembly: AssemblyCulture("")>

'
' Version information for an assembly consists of the following four values:
'
'      Major Version
'      Minor Version
'      Build Number
'      Revision
'
' You can specify all the values or you can default the Revision and Build Numbers
' by using the '*' as shown below:

<Assembly: AssemblyVersion("6.2.1.0")>

'
' In order to sign your assembly you must specify a key to use. Refer to the
' Microsoft .NET Framework documentation for more information on assembly signing.
'
' Use the attributes below to control which key is used for signing.
'
' Notes:
'   (*) If no key is specified, the assembly is not signed.
'   (*) KeyName refers to a key that has been installed in the Crypto Service
'       Provider (CSP) on your machine. KeyFile refers to a file which contains
'       a key.
'   (*) If the KeyFile and the KeyName values are both specified, the
'       following processing occurs:
'       (1) If the KeyName can be found in the CSP, that key is used.
'       (2) If the KeyName does not exist and the KeyFile does exist, the key
'           in the KeyFile is installed into the CSP and used.
'   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
'       When specifying the KeyFile, the location of the KeyFile should be
'       relative to the project output directory which is
'       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
'       located in the project directory, you would specify the AssemblyKeyFile
'       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
'   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
'       documentation for more information on this.
'
<Assembly: AssemblyDelaySign(False)>
<Assembly: AssemblyKeyFile("")>
<Assembly: AssemblyKeyName("")>

Form1.Designer.vb

Imports System.Collections
Imports System.ComponentModel
Imports System.IO
Imports System.Reflection
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports FlexCel.Report
Imports FlexCel.Demo.SharedData
Namespace JoinandUnion
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Private WithEvents button1 As System.Windows.Forms.Button
        Private saveFileDialog1 As System.Windows.Forms.SaveFileDialog
        Private label1 As System.Windows.Forms.Label
        Private WithEvents btnCancel As System.Windows.Forms.Button
        ''' <summary>
        ''' Required designer variable.
        ''' </summary>
        Private components As System.ComponentModel.Container = Nothing

        ''' <summary>
        ''' Clean up any resources being used.
        ''' </summary>
        Protected Overrides Sub Dispose(ByVal disposing As Boolean)
            If disposing Then
                If components IsNot Nothing Then
                    components.Dispose()
                End If
            End If
            MyBase.Dispose(disposing)
        End Sub

        #Region "Windows Form Designer generated code"
        ''' <summary>
        ''' Required method for Designer support - do not modify
        ''' the contents of this method with the code editor.
        ''' </summary>
        Private Sub InitializeComponent()
            Me.button1 = New System.Windows.Forms.Button()
            Me.saveFileDialog1 = New System.Windows.Forms.SaveFileDialog()
            Me.label1 = New System.Windows.Forms.Label()
            Me.btnCancel = New System.Windows.Forms.Button()
            Me.SuspendLayout()
            '
            ' button1
            '
            Me.button1.Anchor = (CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.button1.BackColor = System.Drawing.Color.Green
            Me.button1.ForeColor = System.Drawing.Color.White
            Me.button1.Location = New System.Drawing.Point(279, 162)
            Me.button1.Margin = New System.Windows.Forms.Padding(6, 6, 6, 6)
            Me.button1.Name = "button1"
            Me.button1.Size = New System.Drawing.Size(205, 42)
            Me.button1.TabIndex = 0
            Me.button1.Text = "GO!"
            Me.button1.UseVisualStyleBackColor = False
'           Me.button1.Click += New System.EventHandler(Me.button1_Click)
            '
            ' saveFileDialog1
            '
            Me.saveFileDialog1.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm|Excel 97/2003|*.xls|Excel 2007|*.xlsx;*.xlsm|All " & "files|*.*"
            Me.saveFileDialog1.RestoreDirectory = True
            '
            ' label1
            '
            Me.label1.Location = New System.Drawing.Point(44, 44)
            Me.label1.Margin = New System.Windows.Forms.Padding(6, 0, 6, 0)
            Me.label1.Name = "label1"
            Me.label1.Size = New System.Drawing.Size(528, 44)
            Me.label1.TabIndex = 2
            Me.label1.Text = "A reportshowing JOIN and UNION tags."
            '
            ' btnCancel
            '
            Me.btnCancel.Anchor = (CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.btnCancel.BackColor = System.Drawing.Color.FromArgb((CInt((CByte(192)))), (CInt((CByte(0)))), (CInt((CByte(0)))))
            Me.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel
            Me.btnCancel.ForeColor = System.Drawing.Color.White
            Me.btnCancel.Location = New System.Drawing.Point(499, 162)
            Me.btnCancel.Margin = New System.Windows.Forms.Padding(6, 6, 6, 6)
            Me.btnCancel.Name = "btnCancel"
            Me.btnCancel.Size = New System.Drawing.Size(205, 42)
            Me.btnCancel.TabIndex = 3
            Me.btnCancel.Text = "Cancel"
            Me.btnCancel.UseVisualStyleBackColor = False
'           Me.btnCancel.Click += New System.EventHandler(Me.btnCancel_Click)
            '
            ' mainForm
            '
            Me.AutoScaleDimensions = New System.Drawing.SizeF(11F, 24F)
            Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
            Me.ClientSize = New System.Drawing.Size(763, 246)
            Me.Controls.Add(Me.btnCancel)
            Me.Controls.Add(Me.label1)
            Me.Controls.Add(Me.button1)
            Me.Margin = New System.Windows.Forms.Padding(6, 6, 6, 6)
            Me.Name = "mainForm"
            Me.Text = "Join and Union"
            Me.ResumeLayout(False)

        End Sub
        #End Region
    End Class
End Namespace

Form1.vb

Imports System.Collections
Imports System.ComponentModel
Imports System.IO
Imports System.Reflection
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports FlexCel.Report
Imports FlexCel.Demo.SharedData

Namespace JoinandUnion
    ''' <summary>
    ''' Form-Like reports
    ''' </summary>
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Public Sub New()
            InitializeComponent()
        End Sub

        Private Sub button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button1.Click
            AutoRun()
        End Sub

        Public Sub AutoRun()
            Using report As FlexCelReport = SharedData.CreateReport()
                Dim DataPath As String = Path.Combine(Path.Combine(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), ".."), "..") & Path.DirectorySeparatorChar

                If saveFileDialog1.ShowDialog() = System.Windows.Forms.DialogResult.OK Then
                    report.Run(DataPath & "Join and Union.template.xls", saveFileDialog1.FileName)

                    If MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) = System.Windows.Forms.DialogResult.Yes Then
                        Process.Start(saveFileDialog1.FileName)
                    End If
                End If
            End Using
        End Sub

        Private Sub btnCancel_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnCancel.Click
            Close()
        End Sub
    End Class

End Namespace

Program.vb

Namespace JoinandUnion
    Friend NotInheritable Class Program

        Private Sub New()
        End Sub

        ''' <summary>
        ''' The main entry point for the application.
        ''' </summary>
       <STAThread> _
        Shared Sub Main()
            Application.EnableVisualStyles()
            Application.SetCompatibleTextRenderingDefault(False)
            Application.Run(New mainForm())
        End Sub
    End Class
End Namespace


Templates in the executable (VB.Net / netframework) | FlexCel Studio for the .NET Framework documentation

Templates in the executable (VB.Net / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\vb\VS2022\netframework\20.Reports\60.Templates On The Exe and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​vb/​VS2022/​netframework/​Modules/​20.​Reports/​60.​Templates On The Exe

Overview

Sometimes you might want to distribute your templates embedded in your application, instead of shipping the separately.

Concepts

  • How to embed a template directly in the exe file. For step-by-step instructions please read Embedding Excel files in your application

  • Dealing with includes. Included files are normally searched on the same path as the original file, but here, as we are reading from a stream, we must tell FlexCel where to find the embedded template. This is done with the FlexCelReport.GetInclude event.

  • While here we show how to use a stream to read a template from the executable, you can use a very similar approach to store your templates on a database, or on any place you like. Just call the FlexCelReport.Run with a stream with your data, and assign the FlexCelReport.GetInclude event to assign the data for the included files.

Files

AssemblyInfo.vb

Imports System.Reflection
Imports System.Runtime.CompilerServices

'
' General Information about an assembly is controlled through the following
' set of attributes. Change these attribute values to modify the information
' associated with an assembly.
'
<Assembly: AssemblyTitle("")>
<Assembly: AssemblyDescription("")>
<Assembly: AssemblyConfiguration("")>
<Assembly: AssemblyCompany("")>
<Assembly: AssemblyProduct("")>
<Assembly: AssemblyCopyright("(c) 2002 - 2014 TMS Software")>
<Assembly: AssemblyTrademark("")>
<Assembly: AssemblyCulture("")>

'
' Version information for an assembly consists of the following four values:
'
'      Major Version
'      Minor Version
'      Build Number
'      Revision
'
' You can specify all the values or you can default the Revision and Build Numbers
' by using the '*' as shown below:

<Assembly: AssemblyVersion("6.2.1.0")>

'
' In order to sign your assembly you must specify a key to use. Refer to the
' Microsoft .NET Framework documentation for more information on assembly signing.
'
' Use the attributes below to control which key is used for signing.
'
' Notes:
'   (*) If no key is specified, the assembly is not signed.
'   (*) KeyName refers to a key that has been installed in the Crypto Service
'       Provider (CSP) on your machine. KeyFile refers to a file which contains
'       a key.
'   (*) If the KeyFile and the KeyName values are both specified, the
'       following processing occurs:
'       (1) If the KeyName can be found in the CSP, that key is used.
'       (2) If the KeyName does not exist and the KeyFile does exist, the key
'           in the KeyFile is installed into the CSP and used.
'   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
'       When specifying the KeyFile, the location of the KeyFile should be
'       relative to the project output directory which is
'       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
'       located in the project directory, you would specify the AssemblyKeyFile
'       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
'   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
'       documentation for more information on this.
'
<Assembly: AssemblyDelaySign(False)>
<Assembly: AssemblyKeyFile("")>
<Assembly: AssemblyKeyName("")>

Form1.Bds.vb

'On Borland Developer Studio you can not embed xls files directly.
'On this demo you can see how to do it, converting it to resx files with the
'XlsEmbed utility included on the Tools folder.

Imports System
Imports System.Drawing
Imports System.Collections
Imports System.ComponentModel
Imports System.Windows.Forms
Imports System.Data
Imports System.IO
Imports System.Diagnostics
Imports System.Reflection
Imports System.Resources
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports FlexCel.Report
Imports FlexCel.Demo.SharedData

Namespace TemplatesOnTheExe
    ''' <summary>
    ''' Summary description for Form1.
    ''' </summary>
    Public Class mainForm
        Inherits System.Windows.Forms.Form

        Private WithEvents button1 As System.Windows.Forms.Button
        Private saveFileDialog1 As System.Windows.Forms.SaveFileDialog
        Private label1 As System.Windows.Forms.Label
        Private WithEvents btnCancel As System.Windows.Forms.Button
        Private WithEvents ordersReport As FlexCel.Report.FlexCelReport
        ''' <summary>
        ''' Required designer variable.
        ''' </summary>
        Private components As System.ComponentModel.Container = Nothing

        Public Sub New()
            InitializeComponent()
            InitializeReports()
        End Sub

        ''' <summary>
        ''' Clean up any resources being used.
        ''' </summary>
        Protected Overrides Sub Dispose(ByVal disposing As Boolean)
            If disposing Then
                If components IsNot Nothing Then
                    components.Dispose()
                End If
            End If
            MyBase.Dispose(disposing)
        End Sub

        #Region "Windows Form Designer generated code"
        ''' <summary>
        ''' Required method for Designer support - do not modify
        ''' the contents of this method with the code editor.
        ''' </summary>
        Private Sub InitializeComponent()
            Me.button1 = New System.Windows.Forms.Button()
            Me.saveFileDialog1 = New System.Windows.Forms.SaveFileDialog()
            Me.ordersReport = New FlexCel.Report.FlexCelReport()
            Me.label1 = New System.Windows.Forms.Label()
            Me.btnCancel = New System.Windows.Forms.Button()
            Me.SuspendLayout()
            '
            ' button1
            '
            Me.button1.Anchor = (CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.button1.BackColor = System.Drawing.Color.Green
            Me.button1.ForeColor = System.Drawing.Color.White
            Me.button1.Location = New System.Drawing.Point(152, 88)
            Me.button1.Name = "button1"
            Me.button1.Size = New System.Drawing.Size(112, 23)
            Me.button1.TabIndex = 0
            Me.button1.Text = "GO!"
'           Me.button1.Click += New System.EventHandler(Me.button1_Click)
            '
            ' saveFileDialog1
            '
            Me.saveFileDialog1.Filter = "Excel Files|*.xls"
            Me.saveFileDialog1.RestoreDirectory = True
            '
            ' ordersReport
            '
            Me.ordersReport.Canceled = False
            Me.ordersReport.DeleteEmptyRanges = False
            Me.ordersReport.ErrorActions = FlexCel.Report.TErrorActions.None
'           Me.ordersReport.GetInclude += New FlexCel.Report.GetIncludeEventHandler(Me.ordersReport_GetInclude)
            '
            ' label1
            '
            Me.label1.Location = New System.Drawing.Point(24, 24)
            Me.label1.Name = "label1"
            Me.label1.Size = New System.Drawing.Size(288, 24)
            Me.label1.TabIndex = 2
            Me.label1.Text = "How to read a template from the executable instead of an external file."
            '
            ' btnCancel
            '
            Me.btnCancel.Anchor = (CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.btnCancel.BackColor = System.Drawing.Color.FromArgb((CByte(192)), (CByte(0)), (CByte(0)))
            Me.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel
            Me.btnCancel.ForeColor = System.Drawing.Color.White
            Me.btnCancel.Location = New System.Drawing.Point(272, 88)
            Me.btnCancel.Name = "btnCancel"
            Me.btnCancel.Size = New System.Drawing.Size(112, 23)
            Me.btnCancel.TabIndex = 3
            Me.btnCancel.Text = "Cancel"
'           Me.btnCancel.Click += New System.EventHandler(Me.btnCancel_Click)
            '
            ' mainForm
            '
            Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
            Me.ClientSize = New System.Drawing.Size(416, 133)
            Me.Controls.Add(Me.btnCancel)
            Me.Controls.Add(Me.label1)
            Me.Controls.Add(Me.button1)
            Me.Name = "mainForm"
            Me.Text = "Templates on the exe"
            Me.ResumeLayout(False)

        End Sub
        #End Region

        ''' <summary>
        ''' The main entry point for the application.
        ''' </summary>
       <STAThread> _
        Shared Sub Main()
            Application.Run(New mainForm())
        End Sub

        ''' <summary>
        ''' The datamodule with the access tables.
        ''' </summary>
        Private dataModule As SharedData

        ''' <summary>
        ''' This method will add the databases used by the report. As they won't change, we will do it only once.
        ''' </summary>
        Private Sub InitializeReports()
            dataModule= New SharedData()
            ordersReport.AddTable(dataModule.nwind)
        End Sub

        Private Sub button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button1.Click
            AutoRun()
        End Sub

        Public Sub AutoRun()
            dataModule.LoadData()
            ordersReport.SetValue("Date", Date.Now)

            If saveFileDialog1.ShowDialog() = System.Windows.Forms.DialogResult.OK Then
                Dim a As System.Reflection.Assembly = System.Reflection.Assembly.GetExecutingAssembly()

                Dim rm As New System.Resources.ResourceManager("template", a)
                Dim WbData() As Byte=CType(rm.GetObject("Templates On The Exe.template.xls"), Byte())
                Using InStream As Stream = New MemoryStream(WbData)
                    Using OutStream As New FileStream(saveFileDialog1.FileName, FileMode.Create)
                        ordersReport.Run(InStream, OutStream)
                    End Using
                End Using

                If MessageBox.Show("Do you want to open the generated file?","Confirm", MessageBoxButtons.YesNo)=System.Windows.Forms.DialogResult.Yes Then
                    Process.Start(saveFileDialog1.FileName)
                End If
            End If

        End Sub

        ''' <summary>
        ''' This is the method that will be called by the ASP.NET front end. It returns an array of bytes
        ''' with the report data, so the ASP.NET application can stream it to the client.
        ''' </summary>
        ''' <returns>The generated file as a byte array.</returns>
        Public Function WebRun() As Byte()
            dataModule.LoadData()
            ordersReport.SetValue("Date", Date.Now)

            Dim DataPath As String= Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) &"\..\..\"

            Dim a As System.Reflection.Assembly = System.Reflection.Assembly.GetExecutingAssembly()
            Using OutStream As New MemoryStream()
                Dim rm As New System.Resources.ResourceManager("template", a)
                Dim WbData() As Byte=CType(rm.GetObject("Templates On The Exe.template.xls"), Byte())
                Using InStream As Stream = New MemoryStream(WbData)
                    ordersReport.Run(InStream, OutStream)
                    Return OutStream.ToArray()
                End Using
            End Using
        End Function

        Private Sub btnCancel_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnCancel.Click
            Close()
        End Sub

        Private Sub ordersReport_GetInclude(ByVal sender As Object, ByVal e As FlexCel.Report.GetIncludeEventArgs) Handles ordersReport.GetInclude
            Dim a As System.Reflection.Assembly = System.Reflection.Assembly.GetExecutingAssembly()
            Dim rm As New System.Resources.ResourceManager("FileName), a)
            Dim Data() As Byte=CType(rm.GetObject(e.FileName), Byte())
            e.IncludeData=Data
        End Sub
    End Class

End Namespace

Form1.Designer.vb

Imports System.Collections
Imports System.ComponentModel
Imports System.IO
Imports System.Reflection
Imports System.Resources
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports FlexCel.Report
Imports FlexCel.Demo.SharedData
Namespace TemplatesOnTheExe
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Private WithEvents button1 As System.Windows.Forms.Button
        Private saveFileDialog1 As System.Windows.Forms.SaveFileDialog
        Private label1 As System.Windows.Forms.Label
        Private WithEvents btnCancel As System.Windows.Forms.Button
        ''' <summary>
        ''' Required designer variable.
        ''' </summary>
        Private components As System.ComponentModel.Container = Nothing

        ''' <summary>
        ''' Clean up any resources being used.
        ''' </summary>
        Protected Overrides Sub Dispose(ByVal disposing As Boolean)
            If disposing Then
                If components IsNot Nothing Then
                    components.Dispose()
                End If
            End If
            MyBase.Dispose(disposing)
        End Sub

        #Region "Windows Form Designer generated code"
        ''' <summary>
        ''' Required method for Designer support - do not modify
        ''' the contents of this method with the code editor.
        ''' </summary>
        Private Sub InitializeComponent()
            Me.button1 = New System.Windows.Forms.Button()
            Me.saveFileDialog1 = New System.Windows.Forms.SaveFileDialog()
            Me.label1 = New System.Windows.Forms.Label()
            Me.btnCancel = New System.Windows.Forms.Button()
            Me.SuspendLayout()
            '
            ' button1
            '
            Me.button1.Anchor = (CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.button1.BackColor = System.Drawing.Color.Green
            Me.button1.ForeColor = System.Drawing.Color.White
            Me.button1.Location = New System.Drawing.Point(152, 88)
            Me.button1.Name = "button1"
            Me.button1.Size = New System.Drawing.Size(112, 23)
            Me.button1.TabIndex = 0
            Me.button1.Text = "GO!"
            Me.button1.UseVisualStyleBackColor = False
'           Me.button1.Click += New System.EventHandler(Me.button1_Click)
            '
            ' saveFileDialog1
            '
            Me.saveFileDialog1.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm|Excel 97/2003|*.xls|Excel 2007|*.xlsx;*.xlsm|All files|*.*"
            Me.saveFileDialog1.RestoreDirectory = True
            '
            ' label1
            '
            Me.label1.Location = New System.Drawing.Point(24, 24)
            Me.label1.Name = "label1"
            Me.label1.Size = New System.Drawing.Size(360, 24)
            Me.label1.TabIndex = 2
            Me.label1.Text = "How to read a template from the executable instead of an external file."
            '
            ' btnCancel
            '
            Me.btnCancel.Anchor = (CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.btnCancel.BackColor = System.Drawing.Color.FromArgb((CInt((CByte(192)))), (CInt((CByte(0)))), (CInt((CByte(0)))))
            Me.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel
            Me.btnCancel.ForeColor = System.Drawing.Color.White
            Me.btnCancel.Location = New System.Drawing.Point(272, 88)
            Me.btnCancel.Name = "btnCancel"
            Me.btnCancel.Size = New System.Drawing.Size(112, 23)
            Me.btnCancel.TabIndex = 3
            Me.btnCancel.Text = "Cancel"
            Me.btnCancel.UseVisualStyleBackColor = False
'           Me.btnCancel.Click += New System.EventHandler(Me.btnCancel_Click)
            '
            ' mainForm
            '
            Me.AutoScaleDimensions = New System.Drawing.SizeF(6F, 13F)
            Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
            Me.ClientSize = New System.Drawing.Size(416, 133)
            Me.Controls.Add(Me.btnCancel)
            Me.Controls.Add(Me.label1)
            Me.Controls.Add(Me.button1)
            Me.Name = "mainForm"
            Me.Text = "Templates on the exe"
            Me.ResumeLayout(False)

        End Sub
        #End Region
    End Class
End Namespace

Form1.vb

Imports System.Collections
Imports System.ComponentModel
Imports System.IO
Imports System.Reflection
Imports System.Resources
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports FlexCel.Report
Imports FlexCel.Demo.SharedData

Namespace TemplatesOnTheExe
    ''' <summary>
    ''' How to embed the reports in the executable, including "included" reports.
    ''' </summary>
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Public Sub New()
            InitializeComponent()
        End Sub

        Private Sub button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button1.Click
            AutoRun()
        End Sub

        Public Sub AutoRun()
            Using ordersReport As FlexCelReport = SharedData.CreateReport()
                AddHandler ordersReport.GetInclude, AddressOf ordersReport_GetInclude
                ordersReport.SetValue("Date", Date.Now)

                If saveFileDialog1.ShowDialog() = System.Windows.Forms.DialogResult.OK Then
                    Dim a As System.Reflection.Assembly = System.Reflection.Assembly.GetExecutingAssembly()
                    Using InStream As Stream = a.GetManifestResourceStream("Templates On The Exe.template.xls")
                        Using OutStream As New FileStream(saveFileDialog1.FileName, FileMode.Create)
                            ordersReport.Run(InStream, OutStream)
                        End Using
                    End Using

                    If MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) = System.Windows.Forms.DialogResult.Yes Then
                        Process.Start(saveFileDialog1.FileName)
                    End If
                End If
            End Using

        End Sub

        Private Sub btnCancel_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnCancel.Click
            Close()
        End Sub

        Private Sub ordersReport_GetInclude(ByVal sender As Object, ByVal e As FlexCel.Report.GetIncludeEventArgs)
            Dim a As System.Reflection.Assembly = System.Reflection.Assembly.GetExecutingAssembly()
            Using InStream As Stream = a.GetManifestResourceStream(e.FileName)
                Dim data(CInt(InStream.Length) - 1) As Byte
                InStream.Position = 0
                InStream.Read(data, 0, data.Length)
                e.IncludeData = data
            End Using
        End Sub
    End Class

End Namespace

Program.vb

Namespace TemplatesOnTheExe
    Friend NotInheritable Class Program

        Private Sub New()
        End Sub

        ''' <summary>
        ''' The main entry point for the application.
        ''' </summary>
       <STAThread> _
        Shared Sub Main()
            Application.EnableVisualStyles()
            Application.SetCompatibleTextRenderingDefault(False)
            Application.Run(New mainForm())
        End Sub
    End Class
End Namespace


Images (VB.Net / netframework) | FlexCel Studio for the .NET Framework documentation

Images (VB.Net / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\vb\VS2022\netframework\20.Reports\65.Images and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​vb/​VS2022/​netframework/​Modules/​20.​Reports/​65.​Images

Overview

Inserting images from a database on a FlexCel report is simple, just insert a blank image and name it as <#table.field>. All the complexity is handled by FlexCel. But when you need more options, there are always things you can do.

Concepts

  • Using the Image Size (<#IMGSIZE(Zoom, AspectRatio)>) tag. This tag only works when written on an image name, and allows you to define which size the inserted image will have. Use this tag only if the image dimension changes on the database. If all images are the same size (most common scenario) just set the size of the image at design time, as it is faster.

  • Using an Alias on the config sheet. As the image name has a small length, we defined the report variables <#Photo>, <Photo100>, etc. on the config sheet.

  • Using the ImgPos, ImgFit and ImgDelete tags. On the second sheet of this report you can see those tags in action.

  • Using the FlexCelReport.GetImageData event. This is a last resort option. If you need to do some further processing on the image, you can do it on this event. The preferred order of option then is:

    1. If all images are the same size and on a standard format, just name the image as <#table.field> and do nothing more.

    2. If you need to adjust dynamically the image dimensions, use Image Size tag. It can be a little slower than 1, as the image has to be processed to calculate its dimensions.

    3. If you need to define a custom image size, or the image is on a proprietary format you need to convert, use FlexCelReport.GetImageData event.

Files

AssemblyInfo.vb

Imports System.Reflection
Imports System.Runtime.CompilerServices

'
' General Information about an assembly is controlled through the following
' set of attributes. Change these attribute values to modify the information
' associated with an assembly.
'
<Assembly: AssemblyTitle("")>
<Assembly: AssemblyDescription("")>
<Assembly: AssemblyConfiguration("")>
<Assembly: AssemblyCompany("")>
<Assembly: AssemblyProduct("")>
<Assembly: AssemblyCopyright("(c) 2002 - 2014 TMS Software")>
<Assembly: AssemblyTrademark("")>
<Assembly: AssemblyCulture("")>

'
' Version information for an assembly consists of the following four values:
'
'      Major Version
'      Minor Version
'      Build Number
'      Revision
'
' You can specify all the values or you can default the Revision and Build Numbers
' by using the '*' as shown below:

<Assembly: AssemblyVersion("6.2.1.0")>

'
' In order to sign your assembly you must specify a key to use. Refer to the
' Microsoft .NET Framework documentation for more information on assembly signing.
'
' Use the attributes below to control which key is used for signing.
'
' Notes:
'   (*) If no key is specified, the assembly is not signed.
'   (*) KeyName refers to a key that has been installed in the Crypto Service
'       Provider (CSP) on your machine. KeyFile refers to a file which contains
'       a key.
'   (*) If the KeyFile and the KeyName values are both specified, the
'       following processing occurs:
'       (1) If the KeyName can be found in the CSP, that key is used.
'       (2) If the KeyName does not exist and the KeyFile does exist, the key
'           in the KeyFile is installed into the CSP and used.
'   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
'       When specifying the KeyFile, the location of the KeyFile should be
'       relative to the project output directory which is
'       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
'       located in the project directory, you would specify the AssemblyKeyFile
'       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
'   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
'       documentation for more information on this.
'
<Assembly: AssemblyDelaySign(False)>
<Assembly: AssemblyKeyFile("")>
<Assembly: AssemblyKeyName("")>

Form1.Designer.vb

Imports System.Collections
Imports System.ComponentModel
Imports System.IO
Imports System.Reflection
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports FlexCel.Report
Imports FlexCel.Demo.SharedData
Namespace Images
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Private WithEvents button1 As System.Windows.Forms.Button
        Private saveFileDialog1 As System.Windows.Forms.SaveFileDialog
        Private label1 As System.Windows.Forms.Label
        Private WithEvents btnCancel As System.Windows.Forms.Button
        ''' <summary>
        ''' Required designer variable.
        ''' </summary>
        Private components As System.ComponentModel.Container = Nothing

        ''' <summary>
        ''' Clean up any resources being used.
        ''' </summary>
        Protected Overrides Sub Dispose(ByVal disposing As Boolean)
            If disposing Then
                If components IsNot Nothing Then
                    components.Dispose()
                End If
            End If
            MyBase.Dispose(disposing)
        End Sub

        #Region "Windows Form Designer generated code"
        ''' <summary>
        ''' Required method for Designer support - do not modify
        ''' the contents of this method with the code editor.
        ''' </summary>
        Private Sub InitializeComponent()
            Me.button1 = New System.Windows.Forms.Button()
            Me.saveFileDialog1 = New System.Windows.Forms.SaveFileDialog()
            Me.label1 = New System.Windows.Forms.Label()
            Me.btnCancel = New System.Windows.Forms.Button()
            Me.SuspendLayout()
            '
            ' button1
            '
            Me.button1.Anchor = (CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.button1.BackColor = System.Drawing.Color.Green
            Me.button1.ForeColor = System.Drawing.Color.White
            Me.button1.Location = New System.Drawing.Point(152, 88)
            Me.button1.Name = "button1"
            Me.button1.Size = New System.Drawing.Size(112, 23)
            Me.button1.TabIndex = 0
            Me.button1.Text = "GO!"
            Me.button1.UseVisualStyleBackColor = False
'           Me.button1.Click += New System.EventHandler(Me.button1_Click)
            '
            ' saveFileDialog1
            '
            Me.saveFileDialog1.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm|Excel 97/2003|*.xls|Excel 2007|*.xlsx;*.xlsm|All files|*.*"
            Me.saveFileDialog1.RestoreDirectory = True
            '
            ' label1
            '
            Me.label1.Location = New System.Drawing.Point(24, 24)
            Me.label1.Name = "label1"
            Me.label1.Size = New System.Drawing.Size(288, 24)
            Me.label1.TabIndex = 2
            Me.label1.Text = "Different ways to include images on a report."
            '
            ' btnCancel
            '
            Me.btnCancel.Anchor = (CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.btnCancel.BackColor = System.Drawing.Color.FromArgb((CInt((CByte(192)))), (CInt((CByte(0)))), (CInt((CByte(0)))))
            Me.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel
            Me.btnCancel.ForeColor = System.Drawing.Color.White
            Me.btnCancel.Location = New System.Drawing.Point(272, 88)
            Me.btnCancel.Name = "btnCancel"
            Me.btnCancel.Size = New System.Drawing.Size(112, 23)
            Me.btnCancel.TabIndex = 3
            Me.btnCancel.Text = "Cancel"
            Me.btnCancel.UseVisualStyleBackColor = False
'           Me.btnCancel.Click += New System.EventHandler(Me.btnCancel_Click)
            '
            ' mainForm
            '
            Me.AutoScaleDimensions = New System.Drawing.SizeF(6F, 13F)
            Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
            Me.ClientSize = New System.Drawing.Size(416, 133)
            Me.Controls.Add(Me.btnCancel)
            Me.Controls.Add(Me.label1)
            Me.Controls.Add(Me.button1)
            Me.Name = "mainForm"
            Me.Text = "Images"
            Me.ResumeLayout(False)

        End Sub
        #End Region
    End Class
End Namespace

Form1.vb

Imports System.Collections
Imports System.ComponentModel
Imports System.IO
Imports System.Reflection
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports FlexCel.Report
Imports FlexCel.Demo.SharedData

Namespace Images
    ''' <summary>
    ''' A report with lots of images.
    ''' </summary>
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Public Sub New()
            InitializeComponent()
        End Sub

        Private Sub button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button1.Click
            AutoRun()
        End Sub

        Public Sub AutoRun()
            Using ordersReport As FlexCelReport = SharedData.CreateReport()
                AddHandler ordersReport.GetImageData, AddressOf ordersReport_GetImageData
                ordersReport.SetValue("Date", Date.Now)

                Dim DataPath As String = Path.Combine(Path.Combine(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), ".."), "..") & Path.DirectorySeparatorChar

                If saveFileDialog1.ShowDialog() = System.Windows.Forms.DialogResult.OK Then
                    ordersReport.Run(DataPath & "Images.template.xls", saveFileDialog1.FileName)

                    If MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) = System.Windows.Forms.DialogResult.Yes Then
                        Process.Start(saveFileDialog1.FileName)
                    End If
                End If
            End Using
        End Sub

        Private Sub btnCancel_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnCancel.Click
            Close()
        End Sub

        Private Sub ordersReport_GetImageData(ByVal sender As Object, ByVal e As FlexCel.Report.GetImageDataEventArgs)
            If String.Compare(e.ImageName, "<#PhotoCode>", True) = 0 Then
                Dim RealImageData() As Byte = ImageUtils.StripOLEHeader(e.ImageData) 'On access databases, images are stored with an OLE
                'header that we have to strip to get the real image.
                'This is done automatically by flexcel in most cases,
                'but here we have the original image format.
                Using MemStream As New MemoryStream(RealImageData) 'Keep stream open until bitmap has been used
                    Using bmp As New Bitmap(MemStream)
                        bmp.RotateFlip(RotateFlipType.Rotate90FlipNone)
                        Using OutStream As New MemoryStream()
                            bmp.Save(OutStream, System.Drawing.Imaging.ImageFormat.Png)
                            e.Width = bmp.Width
                            e.Height = bmp.Height
                            e.ImageData = OutStream.ToArray()
                        End Using
                    End Using
                End Using
            End If

        End Sub
    End Class

End Namespace

Program.vb

Namespace Images
    Friend NotInheritable Class Program

        Private Sub New()
        End Sub

        ''' <summary>
        ''' The main entry point for the application.
        ''' </summary>
       <STAThread> _
        Shared Sub Main()
            Application.EnableVisualStyles()
            Application.SetCompatibleTextRenderingDefault(False)
            Application.Run(New mainForm())
        End Sub
    End Class
End Namespace


Charts (VB.Net / netframework) | FlexCel Studio for the .NET Framework documentation

Charts (VB.Net / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\vb\VS2022\netframework\20.Reports\70.Charts and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​vb/​VS2022/​netframework/​Modules/​20.​Reports/​70.​Charts

Overview

Some examples of how to create Charts with FlexCel.

Concepts

  • Charts might be difficult: Sometimes Excel goes out of its way guessing what you want to do and what are the cells you want to use. While this is very good in normal situations (Excel almost always gets it right), it gets difficult when you are trying to define a chart out of <#xx.yy> fields. So a nice trick is to write two rows of real data first, define the chart, and after that substitute the first row of real data with <#...> fields. You can leave the second with the test data, because as long as you use x-ranges, it will be deleted.

  • You can't use a <#delete row> tag to remove the extra row. <#delete row> tags are executed from bottom to top, at the same time that the insertions are made. So, the row will be deleted before the actual data is inserted and the range will not expand. To solve this, we now have x-ranges. If you put "X" as the last char on a named range (as in "_Products_X" on this demo), the range will work as a normal one, but after being inserted it will delete the next empty row. (or column if it is a column range)

  • Usually when you create a chart, series remain fixed and the data range expands. But some special charts might need that the data range is fixed and new series are created. For those cases, you can use swap series> tags. Look at the example Charts With Dynamic Series

  • FlexCelReport will not replace <#tags> inside the main title or the x/y axis titles. But you can drop a textbox inside the chart, and this text will be replaced.

  • Try and open the generated xls file with Custom Preview demo. You will see it looks very similar to the the way Excel displays it.

Files

AssemblyInfo.vb

Imports System.Reflection
Imports System.Runtime.CompilerServices

'
' General Information about an assembly is controlled through the following
' set of attributes. Change these attribute values to modify the information
' associated with an assembly.
'
<Assembly: AssemblyTitle("")>
<Assembly: AssemblyDescription("")>
<Assembly: AssemblyConfiguration("")>
<Assembly: AssemblyCompany("")>
<Assembly: AssemblyProduct("")>
<Assembly: AssemblyCopyright("(c) 2002 - 2014 TMS Software")>
<Assembly: AssemblyTrademark("")>
<Assembly: AssemblyCulture("")>

'
' Version information for an assembly consists of the following four values:
'
'      Major Version
'      Minor Version
'      Build Number
'      Revision
'
' You can specify all the values or you can default the Revision and Build Numbers
' by using the '*' as shown below:

<Assembly: AssemblyVersion("6.2.1.0")>

'
' In order to sign your assembly you must specify a key to use. Refer to the
' Microsoft .NET Framework documentation for more information on assembly signing.
'
' Use the attributes below to control which key is used for signing.
'
' Notes:
'   (*) If no key is specified, the assembly is not signed.
'   (*) KeyName refers to a key that has been installed in the Crypto Service
'       Provider (CSP) on your machine. KeyFile refers to a file which contains
'       a key.
'   (*) If the KeyFile and the KeyName values are both specified, the
'       following processing occurs:
'       (1) If the KeyName can be found in the CSP, that key is used.
'       (2) If the KeyName does not exist and the KeyFile does exist, the key
'           in the KeyFile is installed into the CSP and used.
'   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
'       When specifying the KeyFile, the location of the KeyFile should be
'       relative to the project output directory which is
'       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
'       located in the project directory, you would specify the AssemblyKeyFile
'       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
'   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
'       documentation for more information on this.
'
<Assembly: AssemblyDelaySign(False)>
<Assembly: AssemblyKeyFile("")>
<Assembly: AssemblyKeyName("")>

Form1.Designer.vb

Imports System.Collections
Imports System.ComponentModel
Imports System.IO
Imports System.Reflection
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports FlexCel.Report
Imports FlexCel.Demo.SharedData
Namespace Charts
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Private WithEvents button1 As System.Windows.Forms.Button
        Private saveFileDialog1 As System.Windows.Forms.SaveFileDialog
        Private label1 As System.Windows.Forms.Label
        Private WithEvents btnCancel As System.Windows.Forms.Button
        ''' <summary>
        ''' Required designer variable.
        ''' </summary>
        Private components As System.ComponentModel.Container = Nothing

        ''' <summary>
        ''' Clean up any resources being used.
        ''' </summary>
        Protected Overrides Sub Dispose(ByVal disposing As Boolean)
            If disposing Then
                If components IsNot Nothing Then
                    components.Dispose()
                End If
            End If
            MyBase.Dispose(disposing)
        End Sub

        #Region "Windows Form Designer generated code"
        ''' <summary>
        ''' Required method for Designer support - do not modify
        ''' the contents of this method with the code editor.
        ''' </summary>
        Private Sub InitializeComponent()
            Me.button1 = New System.Windows.Forms.Button()
            Me.saveFileDialog1 = New System.Windows.Forms.SaveFileDialog()
            Me.label1 = New System.Windows.Forms.Label()
            Me.btnCancel = New System.Windows.Forms.Button()
            Me.SuspendLayout()
            '
            ' button1
            '
            Me.button1.Anchor = (CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.button1.BackColor = System.Drawing.Color.Green
            Me.button1.ForeColor = System.Drawing.Color.White
            Me.button1.Location = New System.Drawing.Point(152, 88)
            Me.button1.Name = "button1"
            Me.button1.Size = New System.Drawing.Size(112, 23)
            Me.button1.TabIndex = 0
            Me.button1.Text = "GO!"
            Me.button1.UseVisualStyleBackColor = False
'           Me.button1.Click += New System.EventHandler(Me.button1_Click)
            '
            ' saveFileDialog1
            '
            Me.saveFileDialog1.Filter = "Excel Files|*.xls"
            Me.saveFileDialog1.RestoreDirectory = True
            '
            ' label1
            '
            Me.label1.Location = New System.Drawing.Point(24, 24)
            Me.label1.Name = "label1"
            Me.label1.Size = New System.Drawing.Size(288, 24)
            Me.label1.TabIndex = 2
            Me.label1.Text = "A report including some charts."
            '
            ' btnCancel
            '
            Me.btnCancel.Anchor = (CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.btnCancel.BackColor = System.Drawing.Color.FromArgb((CInt((CByte(192)))), (CInt((CByte(0)))), (CInt((CByte(0)))))
            Me.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel
            Me.btnCancel.ForeColor = System.Drawing.Color.White
            Me.btnCancel.Location = New System.Drawing.Point(272, 88)
            Me.btnCancel.Name = "btnCancel"
            Me.btnCancel.Size = New System.Drawing.Size(112, 23)
            Me.btnCancel.TabIndex = 3
            Me.btnCancel.Text = "Cancel"
            Me.btnCancel.UseVisualStyleBackColor = False
'           Me.btnCancel.Click += New System.EventHandler(Me.btnCancel_Click)
            '
            ' mainForm
            '
            Me.AutoScaleDimensions = New System.Drawing.SizeF(6F, 13F)
            Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
            Me.ClientSize = New System.Drawing.Size(416, 133)
            Me.Controls.Add(Me.btnCancel)
            Me.Controls.Add(Me.label1)
            Me.Controls.Add(Me.button1)
            Me.Name = "mainForm"
            Me.Text = "Charts"
            Me.ResumeLayout(False)

        End Sub
        #End Region
    End Class
End Namespace

Form1.vb

Imports System.Collections
Imports System.ComponentModel
Imports System.IO
Imports System.Reflection
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports FlexCel.Report
Imports FlexCel.Demo.SharedData

Namespace Charts
    ''' <summary>
    ''' A report including charts.
    ''' </summary>
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Public Sub New()
            InitializeComponent()
        End Sub

        Private Sub button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button1.Click
            AutoRun()
        End Sub

        Public Sub AutoRun()
            Using ordersReport As FlexCelReport = SharedData.CreateReport()
                ordersReport.SetValue("Date", Date.Now)

                Dim DataPath As String = Path.Combine(Path.Combine(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), ".."), "..") & Path.DirectorySeparatorChar

                If saveFileDialog1.ShowDialog() = System.Windows.Forms.DialogResult.OK Then
                    ordersReport.Run(DataPath & "Charts.template.xls", saveFileDialog1.FileName)

                    If MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) = System.Windows.Forms.DialogResult.Yes Then
                        Process.Start(saveFileDialog1.FileName)
                    End If
                End If
            End Using
        End Sub

        Private Sub btnCancel_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnCancel.Click
            Close()
        End Sub
    End Class

End Namespace

Program.vb

Namespace Charts
    Friend NotInheritable Class Program

        Private Sub New()
        End Sub

        ''' <summary>
        ''' The main entry point for the application.
        ''' </summary>
       <STAThread> _
        Shared Sub Main()
            Application.EnableVisualStyles()
            Application.SetCompatibleTextRenderingDefault(False)
            Application.Run(New mainForm())
        End Sub
    End Class
End Namespace


Charts With Dynamic Series (VB.Net / netframework) | FlexCel Studio for the .NET Framework documentation

Charts With Dynamic Series (VB.Net / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\vb\VS2022\netframework\20.Reports\75.Charts With Dynamic Series and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​vb/​VS2022/​netframework/​Modules/​20.​Reports/​75.​Charts With Dynamic Series

Overview

Examples of how to create a chart with one series per row. Charts with one series per row are not a common thing to do. You will normally want your series in columns, as shown in the example Charts. Even for this demo, the charts would probably look better if we had them with one series per column. But if you need to do it, you can use this example as a base.

Concepts

  • How to use swap series to create a chart with a series per row, as explained in Creating charts with dynamic series.

  • To use <#swap series> in an embedded chart, you name the chart with a name containing <#swap series>.The tag will be removed from the final chart name. To use <#swap series> in a chart sheet, you write it on the sheet name. And again, the tag will be removed from the final sheet name.

  • How to use the FlexCelReport.CustomizeChart event to further customize the chart.

Files

AssemblyInfo.vb

Imports System.Reflection
Imports System.Runtime.CompilerServices

'
' General Information about an assembly is controlled through the following
' set of attributes. Change these attribute values to modify the information
' associated with an assembly.
'
<Assembly: AssemblyTitle("")>
<Assembly: AssemblyDescription("")>
<Assembly: AssemblyConfiguration("")>
<Assembly: AssemblyCompany("")>
<Assembly: AssemblyProduct("")>
<Assembly: AssemblyCopyright("(c) 2002 - 2014 TMS Software")>
<Assembly: AssemblyTrademark("")>
<Assembly: AssemblyCulture("")>

'
' Version information for an assembly consists of the following four values:
'
'      Major Version
'      Minor Version
'      Build Number
'      Revision
'
' You can specify all the values or you can default the Revision and Build Numbers
' by using the '*' as shown below:

<Assembly: AssemblyVersion("6.2.1.0")>

'
' In order to sign your assembly you must specify a key to use. Refer to the
' Microsoft .NET Framework documentation for more information on assembly signing.
'
' Use the attributes below to control which key is used for signing.
'
' Notes:
'   (*) If no key is specified, the assembly is not signed.
'   (*) KeyName refers to a key that has been installed in the Crypto Service
'       Provider (CSP) on your machine. KeyFile refers to a file which contains
'       a key.
'   (*) If the KeyFile and the KeyName values are both specified, the
'       following processing occurs:
'       (1) If the KeyName can be found in the CSP, that key is used.
'       (2) If the KeyName does not exist and the KeyFile does exist, the key
'           in the KeyFile is installed into the CSP and used.
'   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
'       When specifying the KeyFile, the location of the KeyFile should be
'       relative to the project output directory which is
'       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
'       located in the project directory, you would specify the AssemblyKeyFile
'       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
'   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
'       documentation for more information on this.
'
<Assembly: AssemblyDelaySign(False)>
<Assembly: AssemblyKeyFile("")>
<Assembly: AssemblyKeyName("")>

Form1.Designer.vb

Imports System.Collections
Imports System.ComponentModel
Imports System.IO
Imports System.Reflection
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports FlexCel.Report
Imports FlexCel.Demo.SharedData
Namespace ChartsWithDynamicSeries
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Private WithEvents button1 As System.Windows.Forms.Button
        Private saveFileDialog1 As System.Windows.Forms.SaveFileDialog
        Private label1 As System.Windows.Forms.Label
        Private WithEvents btnCancel As System.Windows.Forms.Button
        ''' <summary>
        ''' Required designer variable.
        ''' </summary>
        Private components As System.ComponentModel.Container = Nothing

        ''' <summary>
        ''' Clean up any resources being used.
        ''' </summary>
        Protected Overrides Sub Dispose(ByVal disposing As Boolean)
            If disposing Then
                If components IsNot Nothing Then
                    components.Dispose()
                End If
            End If
            MyBase.Dispose(disposing)
        End Sub

        #Region "Windows Form Designer generated code"
        ''' <summary>
        ''' Required method for Designer support - do not modify
        ''' the contents of this method with the code editor.
        ''' </summary>
        Private Sub InitializeComponent()
            Me.button1 = New System.Windows.Forms.Button()
            Me.saveFileDialog1 = New System.Windows.Forms.SaveFileDialog()
            Me.label1 = New System.Windows.Forms.Label()
            Me.btnCancel = New System.Windows.Forms.Button()
            Me.SuspendLayout()
            '
            ' button1
            '
            Me.button1.Anchor = (CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.button1.BackColor = System.Drawing.Color.Green
            Me.button1.ForeColor = System.Drawing.Color.White
            Me.button1.Location = New System.Drawing.Point(152, 88)
            Me.button1.Name = "button1"
            Me.button1.Size = New System.Drawing.Size(112, 23)
            Me.button1.TabIndex = 0
            Me.button1.Text = "GO!"
            Me.button1.UseVisualStyleBackColor = False
'           Me.button1.Click += New System.EventHandler(Me.button1_Click)
            '
            ' saveFileDialog1
            '
            Me.saveFileDialog1.Filter = "Excel Files|*.xlsx"
            Me.saveFileDialog1.RestoreDirectory = True
            '
            ' label1
            '
            Me.label1.Location = New System.Drawing.Point(24, 24)
            Me.label1.Name = "label1"
            Me.label1.Size = New System.Drawing.Size(288, 24)
            Me.label1.TabIndex = 2
            Me.label1.Text = "A report including charts which have a series per row."
            '
            ' btnCancel
            '
            Me.btnCancel.Anchor = (CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.btnCancel.BackColor = System.Drawing.Color.FromArgb((CInt((CByte(192)))), (CInt((CByte(0)))), (CInt((CByte(0)))))
            Me.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel
            Me.btnCancel.ForeColor = System.Drawing.Color.White
            Me.btnCancel.Location = New System.Drawing.Point(272, 88)
            Me.btnCancel.Name = "btnCancel"
            Me.btnCancel.Size = New System.Drawing.Size(112, 23)
            Me.btnCancel.TabIndex = 3
            Me.btnCancel.Text = "Cancel"
            Me.btnCancel.UseVisualStyleBackColor = False
'           Me.btnCancel.Click += New System.EventHandler(Me.btnCancel_Click)
            '
            ' mainForm
            '
            Me.AutoScaleDimensions = New System.Drawing.SizeF(6F, 13F)
            Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
            Me.ClientSize = New System.Drawing.Size(416, 133)
            Me.Controls.Add(Me.btnCancel)
            Me.Controls.Add(Me.label1)
            Me.Controls.Add(Me.button1)
            Me.Name = "mainForm"
            Me.Text = "Charts With Dynamic Series"
            Me.ResumeLayout(False)

        End Sub
        #End Region
    End Class
End Namespace

Form1.vb

Imports System.Collections
Imports System.ComponentModel
Imports System.IO
Imports System.Reflection
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports FlexCel.Report
Imports FlexCel.Demo.SharedData

Namespace ChartsWithDynamicSeries
    ''' <summary>
    ''' A report including charts which have a series per row.
    ''' </summary>
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Public Sub New()
            InitializeComponent()
        End Sub

        Private Sub button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button1.Click
            AutoRun()
        End Sub

        Public Sub AutoRun()
            Using ordersReport As FlexCelReport = SharedData.CreateReport()
                AddHandler ordersReport.CustomizeChart, AddressOf OrdersReport_CustomizeChart
                Dim DataPath As String = Path.Combine(Path.Combine(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), ".."), "..") & Path.DirectorySeparatorChar

                If saveFileDialog1.ShowDialog() = System.Windows.Forms.DialogResult.OK Then
                    ordersReport.Run(DataPath & "Charts With Dynamic Series.template.xlsx", saveFileDialog1.FileName)

                    If MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) = System.Windows.Forms.DialogResult.Yes Then
                        Process.Start(saveFileDialog1.FileName)
                    End If
                End If
            End Using
        End Sub

        Private Sub OrdersReport_CustomizeChart(ByVal sender As Object, ByVal e As CustomizeChartEventArgs)
            If e.ChartName = "Stock<#swap series>" Then
                'In this event we will set the colors of the series depending on the product.
                'Let's image each product has an associated color that we want to use for its series.
                For subChart As Integer = 1 To e.Chart.SubchartCount
                    For series As Integer = 1 To e.Chart.SeriesInSubchart(subChart)
                        Dim seriesDef = e.Chart.GetSeriesInSubchart(subChart, series, True, True, True)
                        Dim seriesOptions = seriesDef.Options(-1)
                        seriesOptions.FillOptions = New ChartSeriesFillOptions(New TShapeFill(True, New TSolidFill(ColorForProduct(series))), Nothing, False, False)
                        e.Chart.SetSeriesInSubchart(subChart, series, seriesDef)
                    Next series
                Next subChart
            End If
        End Sub

        Private Shared Function ColorForProduct(ByVal series As Integer) As TDrawingColor
            Return TDrawingColor.FromRgb(CByte((series * 24) Mod 255), CByte((series * 32) Mod 255), CByte((series * 16) Mod 255))
        End Function

        Private Sub btnCancel_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnCancel.Click
            Close()
        End Sub
    End Class

End Namespace

Program.vb

Namespace ChartsWithDynamicSeries
    Friend NotInheritable Class Program

        Private Sub New()
        End Sub

        ''' <summary>
        ''' The main entry point for the application.
        ''' </summary>
       <STAThread> _
        Shared Sub Main()
            Application.EnableVisualStyles()
            Application.SetCompatibleTextRenderingDefault(False)
            Application.Run(New mainForm())
        End Sub
    End Class
End Namespace


Pivot tables (VB.Net / netframework) | FlexCel Studio for the .NET Framework documentation

Pivot tables (VB.Net / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\vb\VS2022\netframework\20.Reports\80.Pivot Tables and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​vb/​VS2022/​netframework/​Modules/​20.​Reports/​80.​Pivot Tables

Overview

Pivot Tables are a very useful (and complex) Excel feature that allows you to summarize data and see it from different points of view just by clicking on fields.

FlexCel doesn't have support on the API for Pivot tables, but as usual, you can define one on the template, fill in the data as you would in a normal report, and the Pivot Table will be refreshed with it. There are some issues and things you have to take in account to make it work, but it is usually worth it.

Pivot tables work in both xls and xlsx, but FlexCel won't convert between them. A report made from an xls template must be saved as xls, and a report made from an xlsx template must be saved as xlsx for pivot tables to be preserved.

Concepts

  • Xls Templates: Excel saves a cache data for opening the pivot faster next time, and you can't use this on FlexCel because it is not implemented (FlexCel does not calculate the data in the pivot table). So, in the template, right-click the table, select "Don't save on open", and deselect "Update on open". Note: FlexCel will make this automatically in xlsx templates, so you don't need to do it.

  • Xls Templates: Defining a Named Range for the table data: The only way to get the Pivot Table range updated as you insert rows, is to define a named range ("TableData" in this example). When asked for the range to the Pivot table, refer to it. Do not select the range directly, or it won't be expanded. Note: This doesn't apply to xlsx templates, in those cases FlexCel will also expand direct ranges and you don't need to use a name, even when it isn't a bad idea anyway.

  • X ranges again! We need the pivot table range to be 2 rows at least, but we don't want the second row to be on the generated report. Same as in Charts, we use an "X" range that will erase the last row once it is done.

  • "." Sheets and "_." ranges . As FlexCel by default processes all sheets on the file, we would have a problem because it doesn't find the datasets on the Pivot Table sheet. One way to exclude FlexCel from reading a sheet, prefix its name with a dot "." The dot will be erased from the final sheet name. Here it doesn't work because the name of the sheet changes, and then the pivot chart loses its reference. So, we use a "." range. Ranges starting with a dot ("_.", "__.", "I_." and "II_.") are ignored by FlexCel.

  • When you insert cells the pivot table won't move. On this example, we included a file on cell A1, but we left the rows empty before inserting the pivot table. In general, the best you can do is to leave the pivot table alone on a sheet, without any <#tags>, and inside a "_." range.

  • There is a know issue with Excel and Internet explorer if you are doing a web application and trying to open the file directly from ie. When opening the file, ie will save it in a temporary folder with a name like "filename[1].xls" and then open it with Excel. The problem is that Excel does not allow [] characters in a filename, because it uses them in formulas to specify external files. In this case you will get an error and Excel won't update the pivot chart. Note that this is not related in any way to FlexCel, nor we can do anything to solve it. The problem happens with any Excel file with pivot tables that you open directly from ie, and the only solution is to save the file to disk before opening it, or use other browser. You can find more information at: http://www.microsoft.com/office/community/en-us/default.mspx?mid=146e209c-7f5d-4c5c-865c-42cfdb09d79b&dg=microsoft.public.excel.crashesgpfs and http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1398316&SiteID=1

  • Excel by default does not delete old entries in the comboboxes inside the pivot table, no matter how much you refresh the pivot table. This means that you will see "...delete row..." inside those comboboxes, since those entries were there when you created the template and they won't be deleted. You could get rid of them with a macro, but adding a macro to a sheet will add a security warning, so probably it is not worth it. But there is other undocumented way: If you can get a copy of Excel 2007 or newer to edit the template, you can set the "Pivot Table options", "Data" tab, "Number of items to retain per field" and set it to "none". The good thing about it is that once you change it, it will work also in Excel 2003, even when there is no way to change that option from Excel 2003 user interface.

Files

AssemblyInfo.vb

Imports System.Reflection
Imports System.Runtime.CompilerServices

'
' General Information about an assembly is controlled through the following
' set of attributes. Change these attribute values to modify the information
' associated with an assembly.
'
<Assembly: AssemblyTitle("")>
<Assembly: AssemblyDescription("")>
<Assembly: AssemblyConfiguration("")>
<Assembly: AssemblyCompany("")>
<Assembly: AssemblyProduct("")>
<Assembly: AssemblyCopyright("(c) 2002 - 2014 TMS Software")>
<Assembly: AssemblyTrademark("")>
<Assembly: AssemblyCulture("")>

'
' Version information for an assembly consists of the following four values:
'
'      Major Version
'      Minor Version
'      Build Number
'      Revision
'
' You can specify all the values or you can default the Revision and Build Numbers
' by using the '*' as shown below:

<Assembly: AssemblyVersion("6.2.1.0")>

'
' In order to sign your assembly you must specify a key to use. Refer to the
' Microsoft .NET Framework documentation for more information on assembly signing.
'
' Use the attributes below to control which key is used for signing.
'
' Notes:
'   (*) If no key is specified, the assembly is not signed.
'   (*) KeyName refers to a key that has been installed in the Crypto Service
'       Provider (CSP) on your machine. KeyFile refers to a file which contains
'       a key.
'   (*) If the KeyFile and the KeyName values are both specified, the
'       following processing occurs:
'       (1) If the KeyName can be found in the CSP, that key is used.
'       (2) If the KeyName does not exist and the KeyFile does exist, the key
'           in the KeyFile is installed into the CSP and used.
'   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
'       When specifying the KeyFile, the location of the KeyFile should be
'       relative to the project output directory which is
'       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
'       located in the project directory, you would specify the AssemblyKeyFile
'       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
'   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
'       documentation for more information on this.
'
<Assembly: AssemblyDelaySign(False)>
<Assembly: AssemblyKeyFile("")>
<Assembly: AssemblyKeyName("")>

Form1.Designer.vb

Imports System.Collections
Imports System.ComponentModel
Imports System.IO
Imports System.Reflection
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports FlexCel.Report
Imports FlexCel.Demo.SharedData
Namespace PivotTables
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Private WithEvents button1 As System.Windows.Forms.Button
        Private saveFileDialog1 As System.Windows.Forms.SaveFileDialog
        Private label1 As System.Windows.Forms.Label
        Private WithEvents btnCancel As System.Windows.Forms.Button
        ''' <summary>
        ''' Required designer variable.
        ''' </summary>
        Private components As System.ComponentModel.Container = Nothing

        ''' <summary>
        ''' Clean up any resources being used.
        ''' </summary>
        Protected Overrides Sub Dispose(ByVal disposing As Boolean)
            If disposing Then
                If components IsNot Nothing Then
                    components.Dispose()
                End If
            End If
            MyBase.Dispose(disposing)
        End Sub

        #Region "Windows Form Designer generated code"
        ''' <summary>
        ''' Required method for Designer support - do not modify
        ''' the contents of this method with the code editor.
        ''' </summary>
        Private Sub InitializeComponent()
            Me.button1 = New System.Windows.Forms.Button()
            Me.saveFileDialog1 = New System.Windows.Forms.SaveFileDialog()
            Me.label1 = New System.Windows.Forms.Label()
            Me.btnCancel = New System.Windows.Forms.Button()
            Me.SuspendLayout()
            '
            ' button1
            '
            Me.button1.Anchor = (CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.button1.BackColor = System.Drawing.Color.Green
            Me.button1.ForeColor = System.Drawing.Color.White
            Me.button1.Location = New System.Drawing.Point(152, 88)
            Me.button1.Name = "button1"
            Me.button1.Size = New System.Drawing.Size(112, 23)
            Me.button1.TabIndex = 0
            Me.button1.Text = "GO!"
            Me.button1.UseVisualStyleBackColor = False
'           Me.button1.Click += New System.EventHandler(Me.button1_Click)
            '
            ' saveFileDialog1
            '
            Me.saveFileDialog1.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm|Excel 97/2003|*.xls|Excel 2007|*.xlsx;*.xlsm|All files|*.*"
            Me.saveFileDialog1.RestoreDirectory = True
            '
            ' label1
            '
            Me.label1.Location = New System.Drawing.Point(24, 24)
            Me.label1.Name = "label1"
            Me.label1.Size = New System.Drawing.Size(288, 24)
            Me.label1.TabIndex = 2
            Me.label1.Text = "A pivot table with data refreshed from FlexCel."
            '
            ' btnCancel
            '
            Me.btnCancel.Anchor = (CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.btnCancel.BackColor = System.Drawing.Color.FromArgb((CInt((CByte(192)))), (CInt((CByte(0)))), (CInt((CByte(0)))))
            Me.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel
            Me.btnCancel.ForeColor = System.Drawing.Color.White
            Me.btnCancel.Location = New System.Drawing.Point(272, 88)
            Me.btnCancel.Name = "btnCancel"
            Me.btnCancel.Size = New System.Drawing.Size(112, 23)
            Me.btnCancel.TabIndex = 3
            Me.btnCancel.Text = "Cancel"
            Me.btnCancel.UseVisualStyleBackColor = False
'           Me.btnCancel.Click += New System.EventHandler(Me.btnCancel_Click)
            '
            ' mainForm
            '
            Me.AutoScaleDimensions = New System.Drawing.SizeF(6F, 13F)
            Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
            Me.ClientSize = New System.Drawing.Size(416, 133)
            Me.Controls.Add(Me.btnCancel)
            Me.Controls.Add(Me.label1)
            Me.Controls.Add(Me.button1)
            Me.Name = "mainForm"
            Me.Text = "Pivot Tables"
            Me.ResumeLayout(False)

        End Sub
        #End Region
    End Class
End Namespace

Form1.vb

Imports System.Collections
Imports System.ComponentModel
Imports System.IO
Imports System.Reflection
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports FlexCel.Report
Imports FlexCel.Demo.SharedData

Namespace PivotTables
    ''' <summary>
    ''' How to keep pivot tabels in reports.
    ''' </summary>
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Public Sub New()
            InitializeComponent()
        End Sub

        Private Sub button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button1.Click
            AutoRun()
        End Sub

        Public Sub AutoRun()
            Using ordersReport As FlexCelReport = SharedData.CreateReport()
                ordersReport.SetValue("Date", Date.Now)

                Dim DataPath As String = Path.Combine(Path.Combine(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), ".."), "..") & Path.DirectorySeparatorChar

                If saveFileDialog1.ShowDialog() = System.Windows.Forms.DialogResult.OK Then
                    Dim Template As String
                    If Path.GetExtension(saveFileDialog1.FileName) = ".xlsx" Then Template = "Pivot Tables.template.xlsx" Else Template = "Pivot Tables.template.xls"
                    ordersReport.Run(DataPath & Template, saveFileDialog1.FileName)

                    If MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) = System.Windows.Forms.DialogResult.Yes Then
                        Process.Start(saveFileDialog1.FileName)
                    End If
                End If
            End Using

        End Sub

        Private Sub btnCancel_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnCancel.Click
            Close()
        End Sub
    End Class

End Namespace

Program.vb

Namespace PivotTables
    Friend NotInheritable Class Program

        Private Sub New()
        End Sub

        ''' <summary>
        ''' The main entry point for the application.
        ''' </summary>
       <STAThread> _
        Shared Sub Main()
            Application.EnableVisualStyles()
            Application.SetCompatibleTextRenderingDefault(False)
            Application.Run(New mainForm())
        End Sub
    End Class
End Namespace


HTML (VB.Net / netframework) | FlexCel Studio for the .NET Framework documentation

HTML (VB.Net / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\vb\VS2022\netframework\20.Reports\83.HTML and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​vb/​VS2022/​netframework/​Modules/​20.​Reports/​83.​HTML

Overview

A demo that shows how to use HTML formatted strings directly on FlexCel. On this example we used to connect to Yahoo Travel web service, and format the results into an Excel or pdf sheet. As Yahoo Travel doesn't exist anymore, some sample data is included to work offline without connecting.

Concepts

  • FlexCel supports a light subset of HTML commands, like <b>, <br>, and the escaped characters like &. But this should be enough to for having rich format inside cells.

  • Any HTML tag that FlexCel cannot parse will be ignored.

  • Note how the word "London" is in bold in titles like "London and Paris". This is because the HTML returned contained those tags.

  • You can allow HTML in a FlexCelReport in two ways:

    1. You can enable it globally by setting FlexCelReport.HTMLMode = true, and disable it where not needed with the <#HTML(false)> tag. This is not normally recommended, since when in HTML mode all strings have to be html strings, where for example two spaces mean only one, and carriage returns are created with <br> tags.

    2. You can enable it on a cell by cell basis, by using the <#HTML(true)> tag. This is the approach we use here.

  • How to set Intelligent Page Breaks. FlexCel will add page breaks so all entries are kept together when printing or exporting to pdf.

  • You can also set an hyperlink in an image. In this case, we wrote an hyperlink in the image pointing to the URL in the database. This link is also exported to pdf.

Files

AssemblyInfo.vb

Imports System.Reflection
Imports System.Runtime.CompilerServices

'
' General Information about an assembly is controlled through the following
' set of attributes. Change these attribute values to modify the information
' associated with an assembly.
'
<Assembly: AssemblyTitle("")>
<Assembly: AssemblyDescription("")>
<Assembly: AssemblyConfiguration("")>
<Assembly: AssemblyCompany("")>
<Assembly: AssemblyProduct("")>
<Assembly: AssemblyCopyright("(c) 2002 - 2014 TMS Software")>
<Assembly: AssemblyTrademark("")>
<Assembly: AssemblyCulture("")>

'
' Version information for an assembly consists of the following four values:
'
'      Major Version
'      Minor Version
'      Build Number
'      Revision
'
' You can specify all the values or you can default the Revision and Build Numbers
' by using the '*' as shown below:

<Assembly: AssemblyVersion("6.2.1.0")>

'
' In order to sign your assembly you must specify a key to use. Refer to the
' Microsoft .NET Framework documentation for more information on assembly signing.
'
' Use the attributes below to control which key is used for signing.
'
' Notes:
'   (*) If no key is specified, the assembly is not signed.
'   (*) KeyName refers to a key that has been installed in the Crypto Service
'       Provider (CSP) on your machine. KeyFile refers to a file which contains
'       a key.
'   (*) If the KeyFile and the KeyName values are both specified, the
'       following processing occurs:
'       (1) If the KeyName can be found in the CSP, that key is used.
'       (2) If the KeyName does not exist and the KeyFile does exist, the key
'           in the KeyFile is installed into the CSP and used.
'   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
'       When specifying the KeyFile, the location of the KeyFile should be
'       relative to the project output directory which is
'       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
'       located in the project directory, you would specify the AssemblyKeyFile
'       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
'   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
'       documentation for more information on this.
'
<Assembly: AssemblyDelaySign(False)>
<Assembly: AssemblyKeyFile("")>
<Assembly: AssemblyKeyName("")>

Form1.Designer.vb

Imports System.Collections
Imports System.ComponentModel
Imports System.IO
Imports System.Reflection
Imports System.Xml
Imports System.Net
Imports System.Threading
Imports System.Globalization
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports FlexCel.Report
Imports FlexCel.Render
Namespace HTML
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        ''' <summary>
        ''' Required designer variable.
        ''' </summary>
        Private components As System.ComponentModel.Container = Nothing

        ''' <summary>
        ''' Clean up any resources being used.
        ''' </summary>
        Protected Overrides Sub Dispose(ByVal disposing As Boolean)
            If disposing Then
                If components IsNot Nothing Then
                    components.Dispose()
                End If
            End If
            MyBase.Dispose(disposing)
        End Sub

        #Region "Windows Form Designer generated code"
        ''' <summary>
        ''' Required method for Designer support - do not modify
        ''' the contents of this method with the code editor.
        ''' </summary>
        Private Sub InitializeComponent()
            Me.btnExportXls = New System.Windows.Forms.Button()
            Me.saveFileDialogXls = New System.Windows.Forms.SaveFileDialog()
            Me.btnCancel = New System.Windows.Forms.Button()
            Me.cbOffline = New System.Windows.Forms.CheckBox()
            Me.btnExportPdf = New System.Windows.Forms.Button()
            Me.saveFileDialogPdf = New System.Windows.Forms.SaveFileDialog()
            Me.edCity = New System.Windows.Forms.TextBox()
            Me.labelCity = New System.Windows.Forms.Label()
            Me.label1 = New System.Windows.Forms.Label()
            Me.linkLabel1 = New System.Windows.Forms.LinkLabel()
            Me.panel1 = New System.Windows.Forms.Panel()
            Me.label2 = New System.Windows.Forms.Label()
            Me.panel1.SuspendLayout()
            Me.SuspendLayout()
            '
            ' btnExportXls
            '
            Me.btnExportXls.Anchor = (CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.btnExportXls.BackColor = System.Drawing.Color.Green
            Me.btnExportXls.ForeColor = System.Drawing.Color.White
            Me.btnExportXls.Location = New System.Drawing.Point(16, 258)
            Me.btnExportXls.Name = "btnExportXls"
            Me.btnExportXls.Size = New System.Drawing.Size(112, 24)
            Me.btnExportXls.TabIndex = 0
            Me.btnExportXls.Text = "Export to Excel"
            Me.btnExportXls.UseVisualStyleBackColor = False
'           Me.btnExportXls.Click += New System.EventHandler(Me.btnExportXls_Click)
            '
            ' saveFileDialogXls
            '
            Me.saveFileDialogXls.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm|Excel 97/2003|*.xls|Excel 2007|*.xlsx;*.xlsm|All " & "files|*.*"
            Me.saveFileDialogXls.RestoreDirectory = True
            '
            ' btnCancel
            '
            Me.btnCancel.Anchor = (CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.btnCancel.BackColor = System.Drawing.Color.FromArgb((CInt((CByte(192)))), (CInt((CByte(0)))), (CInt((CByte(0)))))
            Me.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel
            Me.btnCancel.ForeColor = System.Drawing.Color.White
            Me.btnCancel.Location = New System.Drawing.Point(272, 258)
            Me.btnCancel.Name = "btnCancel"
            Me.btnCancel.Size = New System.Drawing.Size(112, 24)
            Me.btnCancel.TabIndex = 3
            Me.btnCancel.Text = "Cancel"
            Me.btnCancel.UseVisualStyleBackColor = False
'           Me.btnCancel.Click += New System.EventHandler(Me.btnCancel_Click)
            '
            ' cbOffline
            '
            Me.cbOffline.Checked = True
            Me.cbOffline.CheckState = System.Windows.Forms.CheckState.Checked
            Me.cbOffline.Location = New System.Drawing.Point(13, 200)
            Me.cbOffline.Name = "cbOffline"
            Me.cbOffline.Size = New System.Drawing.Size(352, 24)
            Me.cbOffline.TabIndex = 10
            Me.cbOffline.Text = "Use offline data. (do not actually connect to the web service)"
            '
            ' btnExportPdf
            '
            Me.btnExportPdf.Anchor = (CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.btnExportPdf.BackColor = System.Drawing.Color.SteelBlue
            Me.btnExportPdf.ForeColor = System.Drawing.Color.White
            Me.btnExportPdf.Location = New System.Drawing.Point(144, 258)
            Me.btnExportPdf.Name = "btnExportPdf"
            Me.btnExportPdf.Size = New System.Drawing.Size(112, 24)
            Me.btnExportPdf.TabIndex = 11
            Me.btnExportPdf.Text = "Export to Pdf"
            Me.btnExportPdf.UseVisualStyleBackColor = False
'           Me.btnExportPdf.Click += New System.EventHandler(Me.btnExportPdf_Click)
            '
            ' saveFileDialogPdf
            '
            Me.saveFileDialogPdf.Filter = "Pdf Files|*.pdf"
            Me.saveFileDialogPdf.RestoreDirectory = True
            '
            ' edCity
            '
            Me.edCity.Location = New System.Drawing.Point(157, 160)
            Me.edCity.Name = "edCity"
            Me.edCity.Size = New System.Drawing.Size(208, 20)
            Me.edCity.TabIndex = 12
            Me.edCity.Text = "london"
            '
            ' labelCity
            '
            Me.labelCity.Location = New System.Drawing.Point(5, 152)
            Me.labelCity.Name = "labelCity"
            Me.labelCity.Size = New System.Drawing.Size(144, 40)
            Me.labelCity.TabIndex = 13
            Me.labelCity.Text = "City Name: (try things like tokio, sydney, new york, madrid, rio de janeiro)"
            '
            ' label1
            '
            Me.label1.Font = New System.Drawing.Font("Times New Roman", 10.25F, System.Drawing.FontStyle.Italic)
            Me.label1.Location = New System.Drawing.Point(13, 88)
            Me.label1.Name = "label1"
            Me.label1.Size = New System.Drawing.Size(352, 32)
            Me.label1.TabIndex = 14
            Me.label1.Text = "This application uses Yahoo Travel APIs to load demo trips and export them to Exc" & "el. For more information, visit:"
            '
            ' linkLabel1
            '
            Me.linkLabel1.Location = New System.Drawing.Point(13, 128)
            Me.linkLabel1.Name = "linkLabel1"
            Me.linkLabel1.Size = New System.Drawing.Size(320, 16)
            Me.linkLabel1.TabIndex = 15
            Me.linkLabel1.TabStop = True
            Me.linkLabel1.Text = "http://developer.yahoo.com/travel/"
'           Me.linkLabel1.LinkClicked += New System.Windows.Forms.LinkLabelLinkClickedEventHandler(Me.linkLabel1_LinkClicked)
            '
            ' panel1
            '
            Me.panel1.BackColor = System.Drawing.Color.LightGoldenrodYellow
            Me.panel1.Controls.Add(Me.label2)
            Me.panel1.Dock = System.Windows.Forms.DockStyle.Top
            Me.panel1.Location = New System.Drawing.Point(0, 0)
            Me.panel1.Name = "panel1"
            Me.panel1.Size = New System.Drawing.Size(416, 69)
            Me.panel1.TabIndex = 16
            '
            ' label2
            '
            Me.label2.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (CByte(0)))
            Me.label2.Location = New System.Drawing.Point(12, 9)
            Me.label2.Name = "label2"
            Me.label2.Size = New System.Drawing.Size(392, 49)
            Me.label2.TabIndex = 0
            Me.label2.Text = "IMPORTANT: Yahoo has discontinued this service, so this demo will only work with " & "offline data. As the online functionality isn't essential to this demo, we have " & "decided to keep it."
            '
            ' mainForm
            '
            Me.AutoScaleDimensions = New System.Drawing.SizeF(6F, 13F)
            Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
            Me.ClientSize = New System.Drawing.Size(416, 292)
            Me.Controls.Add(Me.panel1)
            Me.Controls.Add(Me.linkLabel1)
            Me.Controls.Add(Me.label1)
            Me.Controls.Add(Me.labelCity)
            Me.Controls.Add(Me.edCity)
            Me.Controls.Add(Me.btnExportPdf)
            Me.Controls.Add(Me.cbOffline)
            Me.Controls.Add(Me.btnCancel)
            Me.Controls.Add(Me.btnExportXls)
            Me.Name = "mainForm"
            Me.Text = "Using HTML formatted text with FlexCel"
            Me.panel1.ResumeLayout(False)
            Me.ResumeLayout(False)
            Me.PerformLayout()

        End Sub
        #End Region
        Private WithEvents btnCancel As System.Windows.Forms.Button
        Private cbOffline As System.Windows.Forms.CheckBox
        Private WithEvents btnExportXls As System.Windows.Forms.Button
        Private WithEvents btnExportPdf As System.Windows.Forms.Button
        Private saveFileDialogXls As System.Windows.Forms.SaveFileDialog
        Private saveFileDialogPdf As System.Windows.Forms.SaveFileDialog
        Private edCity As System.Windows.Forms.TextBox
        Private labelCity As System.Windows.Forms.Label
        Private label1 As System.Windows.Forms.Label
        Private WithEvents linkLabel1 As System.Windows.Forms.LinkLabel
        Private panel1 As Panel
        Private label2 As Label
    End Class
End Namespace

Form1.vb

Imports System.Collections
Imports System.ComponentModel
Imports System.IO
Imports System.Reflection
Imports System.Xml
Imports System.Net
Imports System.Threading
Imports System.Globalization

Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports FlexCel.Report
Imports FlexCel.Render

Namespace HTML
    ''' <summary>
    ''' Shows the limited HTML support.
    ''' </summary>
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Public Sub New()
            InitializeComponent()
        End Sub

        Private Sub Export(ByVal SaveDialog As SaveFileDialog, ByVal ToPdf As Boolean)
            Using reportStart As New FlexCelReport(True)

                If cbOffline.Checked AndAlso edCity.Text <> "london" Then
                    MessageBox.Show("Offline mode is selected, so we will show the data of london. The actual city you wrote will not be used unless you select online mode.", "Warning")
                End If
                Try
                    Dim DataPath As String = Path.Combine(Path.Combine(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), ".."), "..") & Path.DirectorySeparatorChar
                    Dim OfflineDataPath As String = Path.Combine(DataPath, "OfflineData") & Path.DirectorySeparatorChar

                    'We will use a thread to connect, to avoid "freezing" the GUI
                    Dim MyWebConnect As New WebConnectThread(reportStart, edCity.Text, OfflineDataPath, cbOffline.Checked)
                    Dim WebConnect As New Thread(New ThreadStart(AddressOf MyWebConnect.LoadData))
                    WebConnect.Start()
                    Using Pg As New ProgressDialog()
                        Pg.ShowProgress(WebConnect)
                        If MyWebConnect IsNot Nothing AndAlso MyWebConnect.MainException IsNot Nothing Then
                            Throw MyWebConnect.MainException
                        End If
                    End Using

                    If SaveDialog.ShowDialog() = System.Windows.Forms.DialogResult.OK Then
                        If ToPdf Then
                            Dim xls As New XlsFile()
                            xls.Open(DataPath & "HTML.template.xls")
                            reportStart.Run(xls)
                            Using PdfExport As New FlexCelPdfExport(xls, True)
                                PdfExport.Export(SaveDialog.FileName)
                            End Using
                        Else
                            reportStart.Run(DataPath & "HTML.template.xls", SaveDialog.FileName)
                        End If

                        If MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) = System.Windows.Forms.DialogResult.Yes Then
                            Process.Start(SaveDialog.FileName)
                        End If
                    End If
                Catch ex As Exception
                    MessageBox.Show(ex.Message)
                End Try
            End Using
        End Sub

        Private Sub btnCancel_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnCancel.Click
            Close()
        End Sub

        Private Sub btnExportPdf_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnExportPdf.Click
            Export(saveFileDialogPdf, True)
        End Sub

        Private Sub btnExportXls_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnExportXls.Click
            Export(saveFileDialogXls, False)
        End Sub

        Private Sub linkLabel1_LinkClicked(ByVal sender As Object, ByVal e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles linkLabel1.LinkClicked
            System.Diagnostics.Process.Start((TryCast(sender, LinkLabel)).Text)
        End Sub
    End Class

    Friend Class WebConnectThread
        Private CityName As String
        Private DataPath As String
        Private UseOfflineData As Boolean
        Private ReportStart As FlexCelReport
        Private FMainException As Exception

        Public Sub New(ByVal aReportStart As FlexCelReport, ByVal aCityName As String, ByVal aDataPath As String, ByVal aUseOfflineData As Boolean)
            CityName = aCityName
            DataPath = aDataPath
            UseOfflineData = aUseOfflineData
            ReportStart = aReportStart
        End Sub

        ''' <summary>
        ''' This is the method we will call form a thread. It catches any internal exception.
        ''' </summary>
        Public Sub LoadData()
            Try
                LoadData(ReportStart, CityName, DataPath, UseOfflineData)
            Catch ex As Exception
                FMainException = ex
            End Try

        End Sub

        Public Shared Sub LoadData(ByVal reportStart As FlexCelReport, ByVal CityName As String, ByVal DataPath As String, ByVal UseOfflineData As Boolean)
            reportStart.SetValue("Date", Date.Now)
            Dim ds As New DataSet()
            ds.Locale = CultureInfo.InvariantCulture
            ds.EnforceConstraints = False
            ds.ReadXmlSchema(Path.Combine(DataPath, "TripSearchResponse.xsd"))
            ds.Tables("Result").Columns.Add("ImageData", GetType(Byte())) 'Add a column for the actual images.
            If UseOfflineData Then
                ds.ReadXml(Path.Combine(DataPath, "OfflineData.xml"))
            Else
                ' Create the web request
                Dim url As String = String.Format("http://travel.yahooapis.com/TripService/V1.1/tripSearch?appid=YahooDemo&query={0}&results=20", CityName)
                Dim uri As New UriBuilder(url)
                Dim request As HttpWebRequest = TryCast(WebRequest.Create(uri.Uri.AbsoluteUri), HttpWebRequest)

                ' Get response
                Using response As HttpWebResponse = TryCast(request.GetResponse(), HttpWebResponse)
                    ' Load data into a dataset
                    ds.ReadXml(response.GetResponseStream())
                End Using
            End If

            If ds.Tables("ResultSet").Rows.Count <= 0 Then
                Throw New Exception("Error loading the data.")
            End If
            If Convert.ToInt32(ds.Tables("ResultSet").Rows(0)("totalResultsReturned")) <= 0 Then
                Throw New Exception("There are no travel plans for this location")
            End If

            LoadImageData(ds, UseOfflineData, DataPath)

            ' Uncomment this code to create an offline image of the data.
#If (CreateOffline) Then
            ds.WriteXml(Path.Combine(DataPath, "OfflineData.xml"))
#End If

            reportStart.AddTable(ds)
        End Sub

        Friend ReadOnly Property MainException() As Exception
            Get
                Return FMainException
            End Get
        End Property

        Private Shared Sub LoadImageData(ByVal ds As DataSet, ByVal UseOfflineData As Boolean, ByVal DataPath As String)
            Dim Images As DataTable = ds.Tables("Image")
            Images.PrimaryKey = New DataColumn() { Images.Columns("Result_Id") }
            For Each dr As DataRow In ds.Tables("Result").Rows
                Dim ImageRow As DataRow = Images.Rows.Find(dr("Result_Id"))

                If ImageRow Is Nothing Then
                    Continue For
                End If
                Dim url As String = Convert.ToString(ImageRow("Url"))
                If url IsNot Nothing AndAlso url.Length > 0 Then
                    dr("ImageData") = LoadIcon(url, UseOfflineData, DataPath)
                End If
            Next dr

        End Sub

        Friend Shared Function LoadIcon(ByVal url As String, ByVal useOfflineData As Boolean, ByVal dataPath As String) As Byte()
            If useOfflineData Then
                Dim u As New Uri(url)
                Return LoadFileIcon(Path.Combine(dataPath, u.Segments(u.Segments.Length - 1)))
            Else
                ' Uncomment this code to create an offline image of the data.
#If (CreateOffline) Then
                Dim u As New Uri(url)
                Dim IconData() As Byte = LoadWebIcon(url)
                Using fs As New FileStream(Path.Combine(dataPath, u.Segments(u.Segments.Length - 1)), FileMode.Create)
                    fs.Write(IconData, 0, IconData.Length)
                End Using
#End If

                Return LoadWebIcon(url)

            End If
        End Function

        ''' <summary>
        ''' On a real implementation this should be cached.
        ''' </summary>
        ''' <param name="url"></param>
        ''' <returns></returns>
        Friend Shared Function LoadWebIcon(ByVal url As String) As Byte()
            Using wc As New WebClient()
                Return wc.DownloadData(url)
            End Using
        End Function

        Private Shared Function LoadFileIcon(ByVal filename As String) As Byte()
            Using fs As New FileStream(filename, FileMode.Open)
                Dim Result(CInt(fs.Length) - 1) As Byte
                fs.Read(Result, 0, Result.Length)
                Return Result
            End Using
        End Function

    End Class

End Namespace

Program.vb

Namespace HTML
    Friend NotInheritable Class Program

        Private Sub New()
        End Sub

        ''' <summary>
        ''' The main entry point for the application.
        ''' </summary>
       <STAThread> _
        Shared Sub Main()
            Application.EnableVisualStyles()
            Application.SetCompatibleTextRenderingDefault(False)
            Application.Run(New mainForm())
        End Sub
    End Class
End Namespace

ProgressDialog.Designer.vb

Imports System.Collections
Imports System.ComponentModel
Imports System.Threading
Imports FlexCel.Render
Namespace HTML
    Partial Public Class ProgressDialog
        Inherits System.Windows.Forms.Form

        Private statusBar1 As System.Windows.Forms.StatusBar
        Private statusBarPanel1 As System.Windows.Forms.StatusBarPanel
        Private statusBarPanelTime As System.Windows.Forms.StatusBarPanel
        Private labelCaption As System.Windows.Forms.Label
        Private pictureBox1 As System.Windows.Forms.PictureBox
        ''' <summary>
        ''' Required designer variable.
        ''' </summary>
        Private components As System.ComponentModel.Container = Nothing

        ''' <summary>
        ''' Clean up any resources being used.
        ''' </summary>
        Protected Overrides Sub Dispose(ByVal disposing As Boolean)
            If disposing Then
                If components IsNot Nothing Then
                    components.Dispose()
                End If
            End If
            MyBase.Dispose(disposing)
        End Sub

        #Region "Windows Form Designer generated code"
        ''' <summary>
        ''' Required method for Designer support - do not modify
        ''' the contents of this method with the code editor.
        ''' </summary>
        Private Sub InitializeComponent()
            Dim resources As New System.Resources.ResourceManager(GetType(ProgressDialog))
            Me.statusBar1 = New System.Windows.Forms.StatusBar()
            Me.statusBarPanel1 = New System.Windows.Forms.StatusBarPanel()
            Me.statusBarPanelTime = New System.Windows.Forms.StatusBarPanel()
            Me.labelCaption = New System.Windows.Forms.Label()
            Me.timer1 = New System.Timers.Timer()
            Me.pictureBox1 = New System.Windows.Forms.PictureBox()
            CType(Me.statusBarPanel1, System.ComponentModel.ISupportInitialize).BeginInit()
            CType(Me.statusBarPanelTime, System.ComponentModel.ISupportInitialize).BeginInit()
            CType(Me.timer1, System.ComponentModel.ISupportInitialize).BeginInit()
            Me.SuspendLayout()
            '
            ' statusBar1
            '
            Me.statusBar1.Location = New System.Drawing.Point(0, 128)
            Me.statusBar1.Name = "statusBar1"
            Me.statusBar1.Panels.AddRange(New System.Windows.Forms.StatusBarPanel() { Me.statusBarPanel1, Me.statusBarPanelTime})
            Me.statusBar1.ShowPanels = True
            Me.statusBar1.Size = New System.Drawing.Size(448, 22)
            Me.statusBar1.TabIndex = 1
            '
            ' statusBarPanel1
            '
            Me.statusBarPanel1.BorderStyle = System.Windows.Forms.StatusBarPanelBorderStyle.None
            Me.statusBarPanel1.Text = "Elapsed Time:"
            Me.statusBarPanel1.Width = 80
            '
            ' statusBarPanelTime
            '
            Me.statusBarPanelTime.BorderStyle = System.Windows.Forms.StatusBarPanelBorderStyle.None
            Me.statusBarPanelTime.Text = "0:00"
            '
            ' labelCaption
            '
            Me.labelCaption.Anchor = (CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.labelCaption.Location = New System.Drawing.Point(16, 16)
            Me.labelCaption.Name = "labelCaption"
            Me.labelCaption.Size = New System.Drawing.Size(408, 16)
            Me.labelCaption.TabIndex = 2
            Me.labelCaption.Text = "Retrieving data from Webservice..."
            '
            ' timer1
            '
            Me.timer1.Enabled = True
            Me.timer1.SynchronizingObject = Me
'           Me.timer1.Elapsed += New System.Timers.ElapsedEventHandler(Me.timer1_Elapsed)
            '
            ' pictureBox1
            '
            Me.pictureBox1.Image = (CType(resources.GetObject("pictureBox1.Image"), System.Drawing.Image))
            Me.pictureBox1.Location = New System.Drawing.Point(64, 40)
            Me.pictureBox1.Name = "pictureBox1"
            Me.pictureBox1.Size = New System.Drawing.Size(296, 64)
            Me.pictureBox1.TabIndex = 3
            Me.pictureBox1.TabStop = False
            '
            ' ProgressDialog
            '
            Me.AutoScaleDimensions = New System.Drawing.SizeF(6F, 13F)
            Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
            Me.ClientSize = New System.Drawing.Size(448, 150)
            Me.ControlBox = False
            Me.Controls.Add(Me.pictureBox1)
            Me.Controls.Add(Me.labelCaption)
            Me.Controls.Add(Me.statusBar1)
            Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle
            Me.MaximizeBox = False
            Me.MinimizeBox = False
            Me.Name = "ProgressDialog"
            Me.ShowInTaskbar = False
            Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent
            Me.Text = "Please wait..."
'           Me.Closed += New System.EventHandler(Me.ProgressDialog_Closed)
            CType(Me.statusBarPanel1, System.ComponentModel.ISupportInitialize).EndInit()
            CType(Me.statusBarPanelTime, System.ComponentModel.ISupportInitialize).EndInit()
            CType(Me.timer1, System.ComponentModel.ISupportInitialize).EndInit()
            Me.ResumeLayout(False)

        End Sub
        #End Region
    End Class
End Namespace

ProgressDialog.vb

Imports System.Collections
Imports System.ComponentModel

Imports System.Threading

Imports FlexCel.Render

Namespace HTML
    ''' <summary>
    ''' A dialog box to show progress.
    ''' </summary>
    Partial Public Class ProgressDialog
        Inherits System.Windows.Forms.Form

        Private WithEvents timer1 As System.Timers.Timer

        Public Sub New()
            InitializeComponent()
        End Sub

        Private StartTime As Date
        Private RunningThread As Thread

        Private Sub timer1_Elapsed(ByVal sender As Object, ByVal e As System.Timers.ElapsedEventArgs) Handles timer1.Elapsed
            UpdateStatus()
        End Sub

        Public Sub ShowProgress(ByVal aRunningThread As Thread)
            RunningThread = aRunningThread

            If Not RunningThread.IsAlive Then
                DialogResult = System.Windows.Forms.DialogResult.OK
                Return
            End If
            timer1.Enabled = True
            StartTime = Date.Now
            ShowDialog()
        End Sub

        Private Sub UpdateStatus()
            Dim ts As TimeSpan = Date.Now.Subtract(StartTime)
            Dim hours As String
            If ts.Hours = 0 Then
                hours = ""
            Else
                hours = ts.Hours.ToString("00") & ":"
            End If
            statusBarPanelTime.Text = hours & ts.Minutes.ToString("00") & ":" & ts.Seconds.ToString("00")

            If Not RunningThread.IsAlive Then
                DialogResult = System.Windows.Forms.DialogResult.OK
            End If
        End Sub

        Private Sub ProgressDialog_Closed(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Closed
            timer1.Enabled = False
        End Sub
    End Class
End Namespace


Autofiting rows and columns (VB.Net / netframework) | FlexCel Studio for the .NET Framework documentation

Autofiting rows and columns (VB.Net / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\vb\VS2022\netframework\20.Reports\85.Autofit and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​vb/​VS2022/​netframework/​Modules/​20.​Reports/​85.​Autofit

Overview

When using FlexCel, you can opt for autofit certain rows so they adjust to their content. By default, this is not done automatically for all rows since most rows do not need autofit, and so you need to use a special <#Row Height(autofit)> tag. Make sure you read Autofitting Rows and Columns in the API developer's guide for more information on autofitting.

Concepts

  • With default settings, autofitting rows in FlexCel will not change the autofitting status of the row. So, when you open this file in Excel, all row heights will be recalculated again, changing page breaks, but guaranteeing that all text is visible. If you prefer to keep autofitted row fixed when you open them on Excel, make the row fixed on the template or use the <#Autofit Settings> tag.

  • You can use an "Adjustment" parameter on the <#Row Height> and <#Autofit Settings> tags, to leave a margin for text. Remember that normally Excel text is a little wider than FlexCel's, so it might need more room. "AdjustmentFixed" is other parameter that can be used for the same thing.

  • You can use different types of autofit depending on your needs, and they are shown on different sheets on this demo. There are normally 2 "modes" of autofit:

    1. The default. FlexCel autofits the rows so it can print/export fine, but leaves the rows to autofit so Excel will autofit them again when you open the file. This mode ensures text will not be "cropped" in Excel or FlexCel, but the row heights will be different in both.

    2. "Fixed" mode. Here, FlexCel calculates the Autofit and fixes the row to that size. When you open the file in Excel rows will not change, so the page will print the same. But, as Excel normally uses more space to print the words, some words might be cropped when opening on Excel. To avoid cropping, it is recommended that you use a large Adjustment, of about 150.

Files

AssemblyInfo.vb

Imports System.Reflection
Imports System.Runtime.CompilerServices

'
' General Information about an assembly is controlled through the following
' set of attributes. Change these attribute values to modify the information
' associated with an assembly.
'
<Assembly: AssemblyTitle("")>
<Assembly: AssemblyDescription("")>
<Assembly: AssemblyConfiguration("")>
<Assembly: AssemblyCompany("")>
<Assembly: AssemblyProduct("")>
<Assembly: AssemblyCopyright("(c) 2002 - 2014 TMS Software")>
<Assembly: AssemblyTrademark("")>
<Assembly: AssemblyCulture("")>

'
' Version information for an assembly consists of the following four values:
'
'      Major Version
'      Minor Version
'      Build Number
'      Revision
'
' You can specify all the values or you can default the Revision and Build Numbers
' by using the '*' as shown below:

<Assembly: AssemblyVersion("6.2.1.0")>

'
' In order to sign your assembly you must specify a key to use. Refer to the
' Microsoft .NET Framework documentation for more information on assembly signing.
'
' Use the attributes below to control which key is used for signing.
'
' Notes:
'   (*) If no key is specified, the assembly is not signed.
'   (*) KeyName refers to a key that has been installed in the Crypto Service
'       Provider (CSP) on your machine. KeyFile refers to a file which contains
'       a key.
'   (*) If the KeyFile and the KeyName values are both specified, the
'       following processing occurs:
'       (1) If the KeyName can be found in the CSP, that key is used.
'       (2) If the KeyName does not exist and the KeyFile does exist, the key
'           in the KeyFile is installed into the CSP and used.
'   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
'       When specifying the KeyFile, the location of the KeyFile should be
'       relative to the project output directory which is
'       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
'       located in the project directory, you would specify the AssemblyKeyFile
'       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
'   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
'       documentation for more information on this.
'
<Assembly: AssemblyDelaySign(False)>
<Assembly: AssemblyKeyFile("")>
<Assembly: AssemblyKeyName("")>

Form1.Designer.vb

Imports System.Collections
Imports System.ComponentModel
Imports System.IO
Imports System.Reflection
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports FlexCel.Report
Imports FlexCel.Demo.SharedData
Namespace Autofit
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Private WithEvents button1 As System.Windows.Forms.Button
        Private saveFileDialog1 As System.Windows.Forms.SaveFileDialog
        Private label1 As System.Windows.Forms.Label
        Private WithEvents btnCancel As System.Windows.Forms.Button
        ''' <summary>
        ''' Required designer variable.
        ''' </summary>
        Private components As System.ComponentModel.Container = Nothing

        ''' <summary>
        ''' Clean up any resources being used.
        ''' </summary>
        Protected Overrides Sub Dispose(ByVal disposing As Boolean)
            If disposing Then
                If components IsNot Nothing Then
                    components.Dispose()
                End If
            End If
            MyBase.Dispose(disposing)
        End Sub

        #Region "Windows Form Designer generated code"
        ''' <summary>
        ''' Required method for Designer support - do not modify
        ''' the contents of this method with the code editor.
        ''' </summary>
        Private Sub InitializeComponent()
            Me.button1 = New System.Windows.Forms.Button()
            Me.saveFileDialog1 = New System.Windows.Forms.SaveFileDialog()
            Me.label1 = New System.Windows.Forms.Label()
            Me.btnCancel = New System.Windows.Forms.Button()
            Me.SuspendLayout()
            '
            ' button1
            '
            Me.button1.Anchor = (CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.button1.BackColor = System.Drawing.Color.Green
            Me.button1.ForeColor = System.Drawing.Color.White
            Me.button1.Location = New System.Drawing.Point(152, 88)
            Me.button1.Name = "button1"
            Me.button1.Size = New System.Drawing.Size(112, 23)
            Me.button1.TabIndex = 0
            Me.button1.Text = "GO!"
            Me.button1.UseVisualStyleBackColor = False
'           Me.button1.Click += New System.EventHandler(Me.button1_Click)
            '
            ' saveFileDialog1
            '
            Me.saveFileDialog1.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm|Excel 97/2003|*.xls|Excel 2007|*.xlsx;*.xlsm|All files|*.*"
            Me.saveFileDialog1.RestoreDirectory = True
            '
            ' label1
            '
            Me.label1.Location = New System.Drawing.Point(24, 24)
            Me.label1.Name = "label1"
            Me.label1.Size = New System.Drawing.Size(272, 24)
            Me.label1.TabIndex = 2
            Me.label1.Text = "Shows how to autofit some rows or columns."
            '
            ' btnCancel
            '
            Me.btnCancel.Anchor = (CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.btnCancel.BackColor = System.Drawing.Color.FromArgb((CInt((CByte(192)))), (CInt((CByte(0)))), (CInt((CByte(0)))))
            Me.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel
            Me.btnCancel.ForeColor = System.Drawing.Color.White
            Me.btnCancel.Location = New System.Drawing.Point(272, 88)
            Me.btnCancel.Name = "btnCancel"
            Me.btnCancel.Size = New System.Drawing.Size(112, 23)
            Me.btnCancel.TabIndex = 3
            Me.btnCancel.Text = "Cancel"
            Me.btnCancel.UseVisualStyleBackColor = False
'           Me.btnCancel.Click += New System.EventHandler(Me.btnCancel_Click)
            '
            ' mainForm
            '
            Me.AutoScaleDimensions = New System.Drawing.SizeF(6F, 13F)
            Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
            Me.ClientSize = New System.Drawing.Size(416, 133)
            Me.Controls.Add(Me.btnCancel)
            Me.Controls.Add(Me.label1)
            Me.Controls.Add(Me.button1)
            Me.Name = "mainForm"
            Me.Text = "Autofit"
            Me.ResumeLayout(False)

        End Sub
        #End Region
    End Class
End Namespace

Form1.vb

Imports System.Collections
Imports System.ComponentModel
Imports System.IO
Imports System.Reflection
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports FlexCel.Report
Imports FlexCel.Demo.SharedData

Namespace Autofit
    ''' <summary>
    ''' How to autofit rows and columns.
    ''' </summary>
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Public Sub New()
            InitializeComponent()
        End Sub

        Private Sub button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button1.Click
            AutoRun()
        End Sub

        Public Sub AutoRun()
            Using ordersReport As FlexCelReport = SharedData.CreateReport()
                Dim DataPath As String = Path.Combine(Path.Combine(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), ".."), "..") & Path.DirectorySeparatorChar

                If saveFileDialog1.ShowDialog() = System.Windows.Forms.DialogResult.OK Then
                    ordersReport.Run(DataPath & "Autofit.template.xls", saveFileDialog1.FileName)

                    If MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) = System.Windows.Forms.DialogResult.Yes Then
                        Process.Start(saveFileDialog1.FileName)
                    End If
                End If
            End Using
        End Sub

        Private Sub btnCancel_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnCancel.Click
            Close()
        End Sub
    End Class

End Namespace

Program.vb

Namespace Autofit
    Friend NotInheritable Class Program

        Private Sub New()
        End Sub

        ''' <summary>
        ''' The main entry point for the application.
        ''' </summary>
       <STAThread> _
        Shared Sub Main()
            Application.EnableVisualStyles()
            Application.SetCompatibleTextRenderingDefault(False)
            Application.Run(New mainForm())
        End Sub
    End Class
End Namespace


Generic reports (VB.Net / netframework) | FlexCel Studio for the .NET Framework documentation

Generic reports (VB.Net / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\vb\VS2022\netframework\20.Reports\88.Generic Reports and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​vb/​VS2022/​netframework/​Modules/​20.​Reports/​88.​Generic Reports

Overview

When you are reporting from an unknown database (for example if you are writing a DbExport app) you can't use a fixed template, because you don't know what the columns will be. While FlexCelReport is designed to handle fixed-form templates, there is some support also for generic reports. This example together with the Meta Templates and Generic Reports 2 examples show what can be done. For more advanced generic reports, you should probably use the API directly.

Concepts

  • You can use <#DataTable.*> to write a full row of data from a datatable. Cells at the right of the cell containing the <#DataTable.*> tag will be overwritten.

  • You can use <#DataTable.**> to write a full row with the column captions on a datatable. Cells at the right of the cell containing the <#DataTable.**> tag will be overwritten.

  • <DataTable.**> can be placed anywhere, it doesn't need to be inside a named range. <DataTable.*> should be inside a named range populating DataTable.

  • Dates: As dates on Excel are just numbers formatted as date, <#DataTable.*> will format the cell when the column has a DateTime value. If the time part of the datetime is 0, time will not be entered.

  • You can use expressions in cells with <#DataTable.*> and <#DataTable.**> tags. You can also get the current value of the tag in the cell by writing <#DataTable.*> or <#DataTable.**> again in the same cell. For example, the tags:

      <#Table.**><#Column Width(autofit;110)>

    Will autofit all the columns in the range expanded by the <#Table.**> tag. While the tags:

      <#Table.*><#if(<#evaluate(mod(column(),2)=0)>;<#format cell(light)>;)>
  <#if(<#table.*>="BONAP";<#format cell(blue)>;)>
  <#if(<#table.**>="OrderDate";<#format cell(longdate)>;)>

    will perform 3 things: On the first, it will paint alternating columns with the "light" format. On the second, it will it will highlight cells that contain the string "BONAP" in blue. On the third, it will format the cells in the "OrderDate" column to have a longer date format.

  • Autofilters will be automatically expanded with the <#DataTable.**> tag. You only need to set them in the cell with the tag.

Files

AssemblyInfo.vb

Imports System.Reflection
Imports System.Runtime.CompilerServices

'
' General Information about an assembly is controlled through the following
' set of attributes. Change these attribute values to modify the information
' associated with an assembly.
'
<Assembly: AssemblyTitle("")>
<Assembly: AssemblyDescription("")>
<Assembly: AssemblyConfiguration("")>
<Assembly: AssemblyCompany("")>
<Assembly: AssemblyProduct("")>
<Assembly: AssemblyCopyright("(c) 2002 - 2014 TMS Software")>
<Assembly: AssemblyTrademark("")>
<Assembly: AssemblyCulture("")>

'
' Version information for an assembly consists of the following four values:
'
'      Major Version
'      Minor Version
'      Build Number
'      Revision
'
' You can specify all the values or you can default the Revision and Build Numbers
' by using the '*' as shown below:

<Assembly: AssemblyVersion("6.2.1.0")>

'
' In order to sign your assembly you must specify a key to use. Refer to the
' Microsoft .NET Framework documentation for more information on assembly signing.
'
' Use the attributes below to control which key is used for signing.
'
' Notes:
'   (*) If no key is specified, the assembly is not signed.
'   (*) KeyName refers to a key that has been installed in the Crypto Service
'       Provider (CSP) on your machine. KeyFile refers to a file which contains
'       a key.
'   (*) If the KeyFile and the KeyName values are both specified, the
'       following processing occurs:
'       (1) If the KeyName can be found in the CSP, that key is used.
'       (2) If the KeyName does not exist and the KeyFile does exist, the key
'           in the KeyFile is installed into the CSP and used.
'   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
'       When specifying the KeyFile, the location of the KeyFile should be
'       relative to the project output directory which is
'       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
'       located in the project directory, you would specify the AssemblyKeyFile
'       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
'   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
'       documentation for more information on this.
'
<Assembly: AssemblyDelaySign(False)>
<Assembly: AssemblyKeyFile("")>
<Assembly: AssemblyKeyName("")>

EnterSQLDialog.Designer.vb

Imports System.Collections
Imports System.ComponentModel
Namespace GenericReports
    Partial Public Class EnterSQLDialog
        Inherits System.Windows.Forms.Form

        Private edSQL As System.Windows.Forms.TextBox
        Private panel1 As System.Windows.Forms.Panel
        Private label1 As System.Windows.Forms.Label
        Private panel2 As System.Windows.Forms.Panel
        Private btnCancel As System.Windows.Forms.Button
        Private button1 As System.Windows.Forms.Button
        ''' <summary>
        ''' Required designer variable.
        ''' </summary>
        Private components As System.ComponentModel.Container = Nothing

        ''' <summary>
        ''' Clean up any resources being used.
        ''' </summary>
        Protected Overrides Sub Dispose(ByVal disposing As Boolean)
            If disposing Then
                If components IsNot Nothing Then
                    components.Dispose()
                End If
            End If
            MyBase.Dispose(disposing)
        End Sub

        #Region "Windows Form Designer generated code"
        ''' <summary>
        ''' Required method for Designer support - do not modify
        ''' the contents of this method with the code editor.
        ''' </summary>
        Private Sub InitializeComponent()
            Me.edSQL = New System.Windows.Forms.TextBox()
            Me.panel1 = New System.Windows.Forms.Panel()
            Me.label1 = New System.Windows.Forms.Label()
            Me.panel2 = New System.Windows.Forms.Panel()
            Me.btnCancel = New System.Windows.Forms.Button()
            Me.button1 = New System.Windows.Forms.Button()
            Me.panel1.SuspendLayout()
            Me.panel2.SuspendLayout()
            Me.SuspendLayout()
            '
            ' edSQL
            '
            Me.edSQL.Dock = System.Windows.Forms.DockStyle.Fill
            Me.edSQL.Location = New System.Drawing.Point(0, 24)
            Me.edSQL.Multiline = True
            Me.edSQL.Name = "edSQL"
            Me.edSQL.Size = New System.Drawing.Size(520, 125)
            Me.edSQL.TabIndex = 0
            Me.edSQL.Text = "Select * from orders"
            '
            ' panel1
            '
            Me.panel1.BackColor = System.Drawing.Color.Gray
            Me.panel1.Controls.Add(Me.label1)
            Me.panel1.Dock = System.Windows.Forms.DockStyle.Top
            Me.panel1.ForeColor = System.Drawing.Color.White
            Me.panel1.Location = New System.Drawing.Point(0, 0)
            Me.panel1.Name = "panel1"
            Me.panel1.Size = New System.Drawing.Size(520, 24)
            Me.panel1.TabIndex = 1
            '
            ' label1
            '
            Me.label1.Font = New System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (CByte(0)))
            Me.label1.Location = New System.Drawing.Point(17, 6)
            Me.label1.Name = "label1"
            Me.label1.Size = New System.Drawing.Size(296, 23)
            Me.label1.TabIndex = 0
            Me.label1.Text = "Enter SQL to execute"
            '
            ' panel2
            '
            Me.panel2.BackColor = System.Drawing.Color.Gray
            Me.panel2.Controls.Add(Me.btnCancel)
            Me.panel2.Controls.Add(Me.button1)
            Me.panel2.Dock = System.Windows.Forms.DockStyle.Bottom
            Me.panel2.ForeColor = System.Drawing.Color.White
            Me.panel2.Location = New System.Drawing.Point(0, 149)
            Me.panel2.Name = "panel2"
            Me.panel2.Size = New System.Drawing.Size(520, 40)
            Me.panel2.TabIndex = 2
            '
            ' btnCancel
            '
            Me.btnCancel.Anchor = (CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.btnCancel.BackColor = System.Drawing.Color.FromArgb((CByte(192)), (CByte(0)), (CByte(0)))
            Me.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel
            Me.btnCancel.ForeColor = System.Drawing.Color.White
            Me.btnCancel.Location = New System.Drawing.Point(400, 9)
            Me.btnCancel.Name = "btnCancel"
            Me.btnCancel.Size = New System.Drawing.Size(112, 23)
            Me.btnCancel.TabIndex = 5
            Me.btnCancel.Text = "Cancel"
            '
            ' button1
            '
            Me.button1.Anchor = (CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.button1.BackColor = System.Drawing.Color.Green
            Me.button1.DialogResult = System.Windows.Forms.DialogResult.OK
            Me.button1.ForeColor = System.Drawing.Color.White
            Me.button1.Location = New System.Drawing.Point(280, 9)
            Me.button1.Name = "button1"
            Me.button1.Size = New System.Drawing.Size(112, 23)
            Me.button1.TabIndex = 4
            Me.button1.Text = "Ok"
            '
            ' EnterSQLDialog
            '
            Me.AutoScaleDimensions = New System.Drawing.SizeF(6F, 13F)
            Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
            Me.ClientSize = New System.Drawing.Size(520, 189)
            Me.Controls.Add(Me.edSQL)
            Me.Controls.Add(Me.panel2)
            Me.Controls.Add(Me.panel1)
            Me.Name = "EnterSQLDialog"
            Me.Text = "Information"
            Me.panel1.ResumeLayout(False)
            Me.panel2.ResumeLayout(False)
            Me.ResumeLayout(False)

        End Sub
        #End Region
    End Class
End Namespace

EnterSQLDialog.vb

Imports System.Collections
Imports System.ComponentModel

Namespace GenericReports
    ''' <summary>
    ''' A dialog where you can enter any SQL.
    ''' </summary>
    Partial Public Class EnterSQLDialog
        Inherits System.Windows.Forms.Form

        Public Sub New()
            InitializeComponent()
        End Sub

        Public ReadOnly Property SQL() As String
            Get
                Return edSQL.Text
            End Get
        End Property
    End Class
End Namespace

Form1.Designer.vb

Imports System.Collections
Imports System.ComponentModel
Imports System.IO
Imports System.Reflection
Imports System.Data.OleDb
Imports System.Threading
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports FlexCel.Report
Namespace GenericReports
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Private saveFileDialog1 As System.Windows.Forms.SaveFileDialog
        Private dataSet As System.Data.DataSet
        Private dataGrid As System.Windows.Forms.DataGrid
        Private Connection As System.Data.OleDb.OleDbConnection
        Private dbDataAdapter As System.Data.OleDb.OleDbDataAdapter
        Private Report As FlexCel.Report.FlexCelReport
        Private components As System.ComponentModel.IContainer = Nothing

        ''' <summary>
        ''' Clean up any resources being used.
        ''' </summary>
        Protected Overrides Sub Dispose(ByVal disposing As Boolean)
            If disposing Then
                If components IsNot Nothing Then
                    components.Dispose()
                End If
            End If
            MyBase.Dispose(disposing)
        End Sub

        #Region "Windows Form Designer generated code"
        ''' <summary>
        ''' Required method for Designer support - do not modify
        ''' the contents of this method with the code editor.
        ''' </summary>
        Private Sub InitializeComponent()
            Dim resources As New System.ComponentModel.ComponentResourceManager(GetType(mainForm))
            Me.saveFileDialog1 = New System.Windows.Forms.SaveFileDialog()
            Me.Report = New FlexCel.Report.FlexCelReport()
            Me.Connection = New System.Data.OleDb.OleDbConnection()
            Me.dataSet = New System.Data.DataSet()
            Me.dataGrid = New System.Windows.Forms.DataGrid()
            Me.dbDataAdapter = New System.Data.OleDb.OleDbDataAdapter()
            Me.mainToolbar = New System.Windows.Forms.ToolStrip()
            Me.btnOpenConnection = New System.Windows.Forms.ToolStripButton()
            Me.btnQuery = New System.Windows.Forms.ToolStripButton()
            Me.toolStripSeparator1 = New System.Windows.Forms.ToolStripSeparator()
            Me.btnExportExcel = New System.Windows.Forms.ToolStripButton()
            Me.btnExit = New System.Windows.Forms.ToolStripButton()
            CType(Me.dataSet, System.ComponentModel.ISupportInitialize).BeginInit()
            CType(Me.dataGrid, System.ComponentModel.ISupportInitialize).BeginInit()
            Me.mainToolbar.SuspendLayout()
            Me.SuspendLayout()
            '
            ' saveFileDialog1
            '
            Me.saveFileDialog1.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm|Excel 97/2003|*.xls|Excel 2007|*.xlsx;*.xlsm|All " & "files|*.*"
            Me.saveFileDialog1.RestoreDirectory = True
            '
            ' Report
            '
            Me.Report.AllowOverwritingFiles = True
            Me.Report.DeleteEmptyBands = FlexCel.Report.TDeleteEmptyBands.ClearDataAndFormats
            Me.Report.DeleteEmptyRanges = False
            '
            ' dataSet
            '
            Me.dataSet.DataSetName = "NewDataSet"
            Me.dataSet.Locale = New System.Globalization.CultureInfo("es-ES")
            '
            ' dataGrid
            '
            Me.dataGrid.DataMember = ""
            Me.dataGrid.Dock = System.Windows.Forms.DockStyle.Fill
            Me.dataGrid.HeaderForeColor = System.Drawing.SystemColors.ControlText
            Me.dataGrid.Location = New System.Drawing.Point(0, 38)
            Me.dataGrid.Name = "dataGrid"
            Me.dataGrid.Size = New System.Drawing.Size(528, 239)
            Me.dataGrid.TabIndex = 4
            '
            ' mainToolbar
            '
            Me.mainToolbar.Items.AddRange(New System.Windows.Forms.ToolStripItem() { Me.btnOpenConnection, Me.btnQuery, Me.toolStripSeparator1, Me.btnExportExcel, Me.btnExit})
            Me.mainToolbar.Location = New System.Drawing.Point(0, 0)
            Me.mainToolbar.Name = "mainToolbar"
            Me.mainToolbar.Size = New System.Drawing.Size(528, 38)
            Me.mainToolbar.TabIndex = 12
            Me.mainToolbar.Text = "mainToolbar"
            '
            ' btnOpenConnection
            '
            Me.btnOpenConnection.Image = (CType(resources.GetObject("btnOpenConnection.Image"), System.Drawing.Image))
            Me.btnOpenConnection.ImageTransparentColor = System.Drawing.Color.Magenta
            Me.btnOpenConnection.Name = "btnOpenConnection"
            Me.btnOpenConnection.Size = New System.Drawing.Size(103, 35)
            Me.btnOpenConnection.Text = "Open connection"
            Me.btnOpenConnection.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText
'           Me.btnOpenConnection.Click += New System.EventHandler(Me.btnOpenconnection_Click)
            '
            ' btnQuery
            '
            Me.btnQuery.Image = (CType(resources.GetObject("btnQuery.Image"), System.Drawing.Image))
            Me.btnQuery.ImageTransparentColor = System.Drawing.Color.Magenta
            Me.btnQuery.Name = "btnQuery"
            Me.btnQuery.Size = New System.Drawing.Size(70, 35)
            Me.btnQuery.Text = "Query Data"
            Me.btnQuery.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText
'           Me.btnQuery.Click += New System.EventHandler(Me.btnQuery_Click)
            '
            ' toolStripSeparator1
            '
            Me.toolStripSeparator1.Name = "toolStripSeparator1"
            Me.toolStripSeparator1.Size = New System.Drawing.Size(6, 38)
            '
            ' btnExportExcel
            '
            Me.btnExportExcel.Image = (CType(resources.GetObject("btnExportExcel.Image"), System.Drawing.Image))
            Me.btnExportExcel.ImageTransparentColor = System.Drawing.Color.Magenta
            Me.btnExportExcel.Name = "btnExportExcel"
            Me.btnExportExcel.Size = New System.Drawing.Size(87, 35)
            Me.btnExportExcel.Text = "Export to Excel"
            Me.btnExportExcel.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText
'           Me.btnExportExcel.Click += New System.EventHandler(Me.btnExportExcel_Click)
            '
            ' btnExit
            '
            Me.btnExit.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right
            Me.btnExit.Image = (CType(resources.GetObject("btnExit.Image"), System.Drawing.Image))
            Me.btnExit.ImageTransparentColor = System.Drawing.Color.Magenta
            Me.btnExit.Name = "btnExit"
            Me.btnExit.Size = New System.Drawing.Size(59, 35)
            Me.btnExit.Text = "     E&xit     "
            Me.btnExit.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText
'           Me.btnExit.Click += New System.EventHandler(Me.button2_Click)
            '
            ' mainForm
            '
            Me.AutoScaleDimensions = New System.Drawing.SizeF(6F, 13F)
            Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
            Me.ClientSize = New System.Drawing.Size(528, 277)
            Me.Controls.Add(Me.dataGrid)
            Me.Controls.Add(Me.mainToolbar)
            Me.Name = "mainForm"
            Me.Text = "Generic Reports"
            CType(Me.dataSet, System.ComponentModel.ISupportInitialize).EndInit()
            CType(Me.dataGrid, System.ComponentModel.ISupportInitialize).EndInit()
            Me.mainToolbar.ResumeLayout(False)
            Me.mainToolbar.PerformLayout()
            Me.ResumeLayout(False)
            Me.PerformLayout()

        End Sub
        #End Region

        Private mainToolbar As ToolStrip
        Private WithEvents btnOpenConnection As ToolStripButton
        Private WithEvents btnQuery As ToolStripButton
        Private toolStripSeparator1 As ToolStripSeparator
        Private WithEvents btnExportExcel As ToolStripButton
        Private WithEvents btnExit As ToolStripButton
    End Class
End Namespace

Form1.vb

Imports System.Collections
Imports System.ComponentModel
Imports System.IO
Imports System.Reflection
Imports System.Data.OleDb
Imports System.Threading
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports FlexCel.Report

Namespace GenericReports
    ''' <summary>
    ''' A generic report.
    ''' </summary>
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Private SqlDialog As EnterSQLDialog

        Public Sub New()
            InitializeComponent()
            ResizeToolbar(mainToolbar)
        End Sub

        Private Sub ResizeToolbar(ByVal toolbar As ToolStrip)

            Using gr As Graphics = CreateGraphics()
                Dim xFactor As Double = gr.DpiX / 96.0
                Dim yFactor As Double = gr.DpiY / 96.0
                toolbar.ImageScalingSize = New Size(CInt(Fix(24 * xFactor)), CInt(Fix(24 * yFactor)))
                toolbar.Width = 0 'force a recalc of the buttons.
            End Using
        End Sub

        Private Sub button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnExit.Click
            Close()
        End Sub

        Private Sub btnOpenconnection_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnOpenConnection.Click
            Dim DataPath As String = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) & Path.DirectorySeparatorChar
            Dim ConfigFile As String = DataPath & "GenericReports.udl"
            If Not File.Exists(ConfigFile) Then
                Using f As FileStream = File.Create(ConfigFile)
                    'Nothing, create an empty udl.
                End Using
            End If

            Process.Start(ConfigFile)
        End Sub

        Private Sub btnQuery_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnQuery.Click
            Dim DataPath As String = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) & Path.DirectorySeparatorChar
            Dim ConfigFile As String = DataPath & "GenericReports.udl"
            Connection.Close()
            dataSet = New DataSet()

            Connection.ConnectionString = "File Name = " & ConfigFile

            Connection.Open()

            If SqlDialog Is Nothing Then
                SqlDialog = New EnterSQLDialog()
            End If

            If SqlDialog.ShowDialog() <> System.Windows.Forms.DialogResult.OK Then
                Return
            End If

            dbDataAdapter.SelectCommand = New OleDbCommand(SqlDialog.SQL, Connection)
            dbDataAdapter.Fill(dataSet, "Table")
            dataGrid.CaptionText = dbDataAdapter.SelectCommand.CommandText
            dataGrid.SetDataBinding(dataSet, "Table")
        End Sub

        Private Sub Export(ByVal SQL As String, ByRef DataPath As String)
            Report.ClearTables()
            Report.AddTable(dataSet)
            Report.SetValue("Date", Date.Now)
            Report.SetValue("ReportCaption", SQL)

            DataPath = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) & Path.DirectorySeparatorChar 'First try to find the template on exe folder.

            If Not File.Exists(DataPath & "Generic Reports.template.xls") Then 'When on design mode, search for the template 2 folders up.
                DataPath = Path.Combine(DataPath, Path.Combine("..", "..")) & Path.DirectorySeparatorChar
            End If
        End Sub

        Private Sub btnExportExcel_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnExportExcel.Click
            Dim DataPath As String = Nothing
            If dbDataAdapter Is Nothing OrElse dbDataAdapter.SelectCommand Is Nothing OrElse dbDataAdapter.SelectCommand.CommandText Is Nothing Then
                MessageBox.Show("You need to select a query first")
                Return
            End If
            Export(dbDataAdapter.SelectCommand.CommandText, DataPath)

            If saveFileDialog1.ShowDialog() = System.Windows.Forms.DialogResult.OK Then
                Report.Run(DataPath & "Generic Reports.template.xls", saveFileDialog1.FileName)

                If MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) = System.Windows.Forms.DialogResult.Yes Then
                    Process.Start(saveFileDialog1.FileName)
                End If
            End If
        End Sub
    End Class
End Namespace

Program.vb

Imports System.Threading

Namespace GenericReports
    Friend NotInheritable Class Program

        Private Sub New()
        End Sub

        ''' <summary>
        ''' The main entry point for the application.
        ''' </summary>
       <STAThread> _
        Shared Sub Main()
            Dim handler As New ThreadExceptionHandler()

            AddHandler Application.ThreadException, AddressOf handler.Application_ThreadException

            Application.EnableVisualStyles()
            Application.SetCompatibleTextRenderingDefault(False)
            Application.Run(New mainForm())
        End Sub
    End Class

    Friend Class ThreadExceptionHandler
        Public Sub Application_ThreadException(ByVal sender As Object, ByVal e As ThreadExceptionEventArgs)
            Try
                Dim result As DialogResult = ShowThreadExceptionDialog(e.Exception)

                If result = DialogResult.Abort Then
                    Application.Exit()
                End If
            Catch
                ' Fatal error, terminate program
                Try
                    MessageBox.Show("Fatal Error", "Fatal Error", MessageBoxButtons.OK, MessageBoxIcon.Stop)
                Finally
                    Application.Exit()
                End Try
            End Try
        End Sub

        '''
        ''' Creates and displays the error message.
        '''
        Private Function ShowThreadExceptionDialog(ByVal ex As Exception) As DialogResult
            Dim errorMessage As String = "Unhandled Exception:" & vbLf & vbLf & ex.Message & vbLf & vbLf & ex.GetType().ToString() & vbLf & vbLf & "Stack Trace:" & vbLf & ex.StackTrace

            Return MessageBox.Show(errorMessage, "Application Error", MessageBoxButtons.AbortRetryIgnore, MessageBoxIcon.Stop)
        End Function
    End Class

End Namespace


Generic reports Part 2 (VB.Net / netframework) | FlexCel Studio for the .NET Framework documentation

Generic reports Part 2 (VB.Net / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\vb\VS2022\netframework\20.Reports\89.Generic Reports 2 and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​vb/​VS2022/​netframework/​Modules/​20.​Reports/​89.​Generic Reports 2

Overview

In the previous example we saw how to use <#DataTable.*> and <#DataTable.**> to create generic reports. While this works in most common cases, there are times when you might need a more complex but also more powerful approach.

Concepts

  • You can create a generic report by doing a report that grows both in columns and in rows.

  • You can use Columns(Dataset) table definition in the config sheet to have a datasource that contains the columns of the dataset. You can then use this new datasource as a source for the horizontal report (with an I_range_I), so every column in the Excel file will have one entry in the datasource.

  • Different from "*" reports, here you can filter this column datasource and only show some columns, or order them.

  • You can use <#dbvalue> tag to get the value for a column or a row. Here we use it inside a report expression in the config sheet so we don't need to write the full dbvalue tag every time.

  • Different from "*" reports, columns here are not overwritten, they are inserted.

  • A problem with this type of reports is formatting. You will want to format all dates as dates, not numbers, and you might want to format numbers as currency and so on. Here we will use a simple user-defined function to return the datatype of the value, and if it is a date then format it as date.

Files

AssemblyInfo.vb

Imports System.Reflection
Imports System.Runtime.CompilerServices

'
' General Information about an assembly is controlled through the following
' set of attributes. Change these attribute values to modify the information
' associated with an assembly.
'
<Assembly: AssemblyTitle("")>
<Assembly: AssemblyDescription("")>
<Assembly: AssemblyConfiguration("")>
<Assembly: AssemblyCompany("")>
<Assembly: AssemblyProduct("")>
<Assembly: AssemblyCopyright("(c) 2002 - 2014 TMS Software")>
<Assembly: AssemblyTrademark("")>
<Assembly: AssemblyCulture("")>

'
' Version information for an assembly consists of the following four values:
'
'      Major Version
'      Minor Version
'      Build Number
'      Revision
'
' You can specify all the values or you can default the Revision and Build Numbers
' by using the '*' as shown below:

<Assembly: AssemblyVersion("6.2.1.0")>

'
' In order to sign your assembly you must specify a key to use. Refer to the
' Microsoft .NET Framework documentation for more information on assembly signing.
'
' Use the attributes below to control which key is used for signing.
'
' Notes:
'   (*) If no key is specified, the assembly is not signed.
'   (*) KeyName refers to a key that has been installed in the Crypto Service
'       Provider (CSP) on your machine. KeyFile refers to a file which contains
'       a key.
'   (*) If the KeyFile and the KeyName values are both specified, the
'       following processing occurs:
'       (1) If the KeyName can be found in the CSP, that key is used.
'       (2) If the KeyName does not exist and the KeyFile does exist, the key
'           in the KeyFile is installed into the CSP and used.
'   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
'       When specifying the KeyFile, the location of the KeyFile should be
'       relative to the project output directory which is
'       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
'       located in the project directory, you would specify the AssemblyKeyFile
'       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
'   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
'       documentation for more information on this.
'
<Assembly: AssemblyDelaySign(False)>
<Assembly: AssemblyKeyFile("")>
<Assembly: AssemblyKeyName("")>

EnterSQLDialog.Designer.vb

Imports System.Collections
Imports System.ComponentModel
Namespace GenericReports2
    Partial Public Class EnterSQLDialog
        Inherits System.Windows.Forms.Form

        Private edSQL As System.Windows.Forms.TextBox
        Private panel1 As System.Windows.Forms.Panel
        Private label1 As System.Windows.Forms.Label
        Private panel2 As System.Windows.Forms.Panel
        Private btnCancel As System.Windows.Forms.Button
        Private button1 As System.Windows.Forms.Button
        ''' <summary>
        ''' Required designer variable.
        ''' </summary>
        Private components As System.ComponentModel.Container = Nothing

        ''' <summary>
        ''' Clean up any resources being used.
        ''' </summary>
        Protected Overrides Sub Dispose(ByVal disposing As Boolean)
            If disposing Then
                If components IsNot Nothing Then
                    components.Dispose()
                End If
            End If
            MyBase.Dispose(disposing)
        End Sub

        #Region "Windows Form Designer generated code"
        ''' <summary>
        ''' Required method for Designer support - do not modify
        ''' the contents of this method with the code editor.
        ''' </summary>
        Private Sub InitializeComponent()
            Me.edSQL = New System.Windows.Forms.TextBox()
            Me.panel1 = New System.Windows.Forms.Panel()
            Me.label1 = New System.Windows.Forms.Label()
            Me.panel2 = New System.Windows.Forms.Panel()
            Me.btnCancel = New System.Windows.Forms.Button()
            Me.button1 = New System.Windows.Forms.Button()
            Me.panel1.SuspendLayout()
            Me.panel2.SuspendLayout()
            Me.SuspendLayout()
            '
            ' edSQL
            '
            Me.edSQL.Dock = System.Windows.Forms.DockStyle.Fill
            Me.edSQL.Location = New System.Drawing.Point(0, 24)
            Me.edSQL.Multiline = True
            Me.edSQL.Name = "edSQL"
            Me.edSQL.Size = New System.Drawing.Size(520, 125)
            Me.edSQL.TabIndex = 0
            Me.edSQL.Text = "Select * from orders"
            '
            ' panel1
            '
            Me.panel1.BackColor = System.Drawing.Color.Gray
            Me.panel1.Controls.Add(Me.label1)
            Me.panel1.Dock = System.Windows.Forms.DockStyle.Top
            Me.panel1.ForeColor = System.Drawing.Color.White
            Me.panel1.Location = New System.Drawing.Point(0, 0)
            Me.panel1.Name = "panel1"
            Me.panel1.Size = New System.Drawing.Size(520, 24)
            Me.panel1.TabIndex = 1
            '
            ' label1
            '
            Me.label1.Font = New System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (CByte(0)))
            Me.label1.Location = New System.Drawing.Point(17, 6)
            Me.label1.Name = "label1"
            Me.label1.Size = New System.Drawing.Size(296, 23)
            Me.label1.TabIndex = 0
            Me.label1.Text = "Enter SQL to execute"
            '
            ' panel2
            '
            Me.panel2.BackColor = System.Drawing.Color.Gray
            Me.panel2.Controls.Add(Me.btnCancel)
            Me.panel2.Controls.Add(Me.button1)
            Me.panel2.Dock = System.Windows.Forms.DockStyle.Bottom
            Me.panel2.ForeColor = System.Drawing.Color.White
            Me.panel2.Location = New System.Drawing.Point(0, 149)
            Me.panel2.Name = "panel2"
            Me.panel2.Size = New System.Drawing.Size(520, 40)
            Me.panel2.TabIndex = 2
            '
            ' btnCancel
            '
            Me.btnCancel.Anchor = (CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.btnCancel.BackColor = System.Drawing.Color.FromArgb((CByte(192)), (CByte(0)), (CByte(0)))
            Me.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel
            Me.btnCancel.ForeColor = System.Drawing.Color.White
            Me.btnCancel.Location = New System.Drawing.Point(400, 9)
            Me.btnCancel.Name = "btnCancel"
            Me.btnCancel.Size = New System.Drawing.Size(112, 23)
            Me.btnCancel.TabIndex = 5
            Me.btnCancel.Text = "Cancel"
            '
            ' button1
            '
            Me.button1.Anchor = (CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.button1.BackColor = System.Drawing.Color.Green
            Me.button1.DialogResult = System.Windows.Forms.DialogResult.OK
            Me.button1.ForeColor = System.Drawing.Color.White
            Me.button1.Location = New System.Drawing.Point(280, 9)
            Me.button1.Name = "button1"
            Me.button1.Size = New System.Drawing.Size(112, 23)
            Me.button1.TabIndex = 4
            Me.button1.Text = "Ok"
            '
            ' EnterSQLDialog
            '
            Me.AutoScaleDimensions = New System.Drawing.SizeF(6F, 13F)
            Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
            Me.ClientSize = New System.Drawing.Size(520, 189)
            Me.Controls.Add(Me.edSQL)
            Me.Controls.Add(Me.panel2)
            Me.Controls.Add(Me.panel1)
            Me.Name = "EnterSQLDialog"
            Me.Text = "Information"
            Me.panel1.ResumeLayout(False)
            Me.panel2.ResumeLayout(False)
            Me.ResumeLayout(False)

        End Sub
        #End Region
    End Class
End Namespace

EnterSQLDialog.vb

Imports System.Collections
Imports System.ComponentModel

Namespace GenericReports2
    ''' <summary>
    ''' A dialog where you can enter any SQL.
    ''' </summary>
    Partial Public Class EnterSQLDialog
        Inherits System.Windows.Forms.Form

        Public Sub New()
            InitializeComponent()
        End Sub

        Public ReadOnly Property SQL() As String
            Get
                Return edSQL.Text
            End Get
        End Property
    End Class
End Namespace

Form1.Designer.vb

Imports System.Collections
Imports System.ComponentModel
Imports System.IO
Imports System.Reflection
Imports System.Data.OleDb
Imports System.Threading
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports FlexCel.Report

Namespace GenericReports2
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Private saveFileDialog1 As System.Windows.Forms.SaveFileDialog
        Private dataSet As System.Data.DataSet
        Private dataGrid As System.Windows.Forms.DataGrid
        Private Connection As System.Data.OleDb.OleDbConnection
        Private dbDataAdapter As System.Data.OleDb.OleDbDataAdapter
        Private Report As FlexCel.Report.FlexCelReport
        Private components As System.ComponentModel.IContainer = Nothing

        ''' <summary>
        ''' Clean up any resources being used.
        ''' </summary>
        Protected Overrides Sub Dispose(ByVal disposing As Boolean)
            If disposing Then
                If components IsNot Nothing Then
                    components.Dispose()
                End If
            End If
            MyBase.Dispose(disposing)
        End Sub

        #Region "Windows Form Designer generated code"
        ''' <summary>
        ''' Required method for Designer support - do not modify
        ''' the contents of this method with the code editor.
        ''' </summary>
        Private Sub InitializeComponent()
            Dim resources As New System.ComponentModel.ComponentResourceManager(GetType(mainForm))
            Me.saveFileDialog1 = New System.Windows.Forms.SaveFileDialog()
            Me.Report = New FlexCel.Report.FlexCelReport()
            Me.Connection = New System.Data.OleDb.OleDbConnection()
            Me.dataSet = New System.Data.DataSet()
            Me.dataGrid = New System.Windows.Forms.DataGrid()
            Me.dbDataAdapter = New System.Data.OleDb.OleDbDataAdapter()
            Me.mainToolbar = New System.Windows.Forms.ToolStrip()
            Me.btnOpenConnection = New System.Windows.Forms.ToolStripButton()
            Me.btnQuery = New System.Windows.Forms.ToolStripButton()
            Me.toolStripSeparator1 = New System.Windows.Forms.ToolStripSeparator()
            Me.btnExportExcel = New System.Windows.Forms.ToolStripButton()
            Me.btnExit = New System.Windows.Forms.ToolStripButton()
            CType(Me.dataSet, System.ComponentModel.ISupportInitialize).BeginInit()
            CType(Me.dataGrid, System.ComponentModel.ISupportInitialize).BeginInit()
            Me.mainToolbar.SuspendLayout()
            Me.SuspendLayout()
            '
            ' saveFileDialog1
            '
            Me.saveFileDialog1.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm|Excel 97/2003|*.xls|Excel 2007|*.xlsx;*.xlsm|All " & "files|*.*"
            Me.saveFileDialog1.RestoreDirectory = True
            '
            ' Report
            '
            Me.Report.AllowOverwritingFiles = True
            Me.Report.DeleteEmptyBands = FlexCel.Report.TDeleteEmptyBands.ClearDataAndFormats
            Me.Report.DeleteEmptyRanges = False
            '
            ' dataSet
            '
            Me.dataSet.DataSetName = "NewDataSet"
            Me.dataSet.Locale = New System.Globalization.CultureInfo("es-ES")
            '
            ' dataGrid
            '
            Me.dataGrid.DataMember = ""
            Me.dataGrid.Dock = System.Windows.Forms.DockStyle.Fill
            Me.dataGrid.HeaderForeColor = System.Drawing.SystemColors.ControlText
            Me.dataGrid.Location = New System.Drawing.Point(0, 38)
            Me.dataGrid.Name = "dataGrid"
            Me.dataGrid.Size = New System.Drawing.Size(528, 239)
            Me.dataGrid.TabIndex = 4
            '
            ' mainToolbar
            '
            Me.mainToolbar.Items.AddRange(New System.Windows.Forms.ToolStripItem() { Me.btnOpenConnection, Me.btnQuery, Me.toolStripSeparator1, Me.btnExportExcel, Me.btnExit})
            Me.mainToolbar.Location = New System.Drawing.Point(0, 0)
            Me.mainToolbar.Name = "mainToolbar"
            Me.mainToolbar.Size = New System.Drawing.Size(528, 38)
            Me.mainToolbar.TabIndex = 11
            Me.mainToolbar.Text = "mainToolbar"
            '
            ' btnOpenConnection
            '
            Me.btnOpenConnection.Image = (CType(resources.GetObject("btnOpenConnection.Image"), System.Drawing.Image))
            Me.btnOpenConnection.ImageTransparentColor = System.Drawing.Color.Magenta
            Me.btnOpenConnection.Name = "btnOpenConnection"
            Me.btnOpenConnection.Size = New System.Drawing.Size(103, 35)
            Me.btnOpenConnection.Text = "Open connection"
            Me.btnOpenConnection.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText
'           Me.btnOpenConnection.Click += New System.EventHandler(Me.btnOpenconnection_Click)
            '
            ' btnQuery
            '
            Me.btnQuery.Image = (CType(resources.GetObject("btnQuery.Image"), System.Drawing.Image))
            Me.btnQuery.ImageTransparentColor = System.Drawing.Color.Magenta
            Me.btnQuery.Name = "btnQuery"
            Me.btnQuery.Size = New System.Drawing.Size(70, 35)
            Me.btnQuery.Text = "Query Data"
            Me.btnQuery.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText
'           Me.btnQuery.Click += New System.EventHandler(Me.btnQuery_Click)
            '
            ' toolStripSeparator1
            '
            Me.toolStripSeparator1.Name = "toolStripSeparator1"
            Me.toolStripSeparator1.Size = New System.Drawing.Size(6, 38)
            '
            ' btnExportExcel
            '
            Me.btnExportExcel.Image = (CType(resources.GetObject("btnExportExcel.Image"), System.Drawing.Image))
            Me.btnExportExcel.ImageTransparentColor = System.Drawing.Color.Magenta
            Me.btnExportExcel.Name = "btnExportExcel"
            Me.btnExportExcel.Size = New System.Drawing.Size(87, 35)
            Me.btnExportExcel.Text = "Export to Excel"
            Me.btnExportExcel.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText
'           Me.btnExportExcel.Click += New System.EventHandler(Me.btnExportExcel_Click)
            '
            ' btnExit
            '
            Me.btnExit.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right
            Me.btnExit.Image = (CType(resources.GetObject("btnExit.Image"), System.Drawing.Image))
            Me.btnExit.ImageTransparentColor = System.Drawing.Color.Magenta
            Me.btnExit.Name = "btnExit"
            Me.btnExit.Size = New System.Drawing.Size(59, 35)
            Me.btnExit.Text = "     E&xit     "
            Me.btnExit.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText
'           Me.btnExit.Click += New System.EventHandler(Me.button2_Click)
            '
            ' mainForm
            '
            Me.AutoScaleDimensions = New System.Drawing.SizeF(6F, 13F)
            Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
            Me.ClientSize = New System.Drawing.Size(528, 277)
            Me.Controls.Add(Me.dataGrid)
            Me.Controls.Add(Me.mainToolbar)
            Me.Name = "mainForm"
            Me.Text = "Generic Reports 2"
            CType(Me.dataSet, System.ComponentModel.ISupportInitialize).EndInit()
            CType(Me.dataGrid, System.ComponentModel.ISupportInitialize).EndInit()
            Me.mainToolbar.ResumeLayout(False)
            Me.mainToolbar.PerformLayout()
            Me.ResumeLayout(False)
            Me.PerformLayout()

        End Sub
        #End Region

        Private mainToolbar As ToolStrip
        Private WithEvents btnOpenConnection As ToolStripButton
        Private WithEvents btnQuery As ToolStripButton
        Private toolStripSeparator1 As ToolStripSeparator
        Private WithEvents btnExportExcel As ToolStripButton
        Private WithEvents btnExit As ToolStripButton
    End Class
End Namespace

Form1.vb

Imports System.Collections
Imports System.ComponentModel
Imports System.IO
Imports System.Reflection
Imports System.Data.OleDb
Imports System.Threading
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports FlexCel.Report

Namespace GenericReports2
    ''' <summary>
    ''' A generic report.
    ''' </summary>
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Private SqlDialog As EnterSQLDialog

        Public Sub New()
            InitializeComponent()
            ResizeToolbar(mainToolbar)
        End Sub

        Private Sub ResizeToolbar(ByVal toolbar As ToolStrip)

            Using gr As Graphics = CreateGraphics()
                Dim xFactor As Double = gr.DpiX / 96.0
                Dim yFactor As Double = gr.DpiY / 96.0
                toolbar.ImageScalingSize = New Size(CInt(Fix(24 * xFactor)), CInt(Fix(24 * yFactor)))
                toolbar.Width = 0 'force a recalc of the buttons.
            End Using
        End Sub

        Private Sub button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnExit.Click
            Close()
        End Sub

        Private Sub btnOpenconnection_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnOpenConnection.Click
            Dim DataPath As String = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) & Path.DirectorySeparatorChar
            Dim ConfigFile As String = DataPath & "GenericReports2.udl"
            If Not File.Exists(ConfigFile) Then
                Using f As FileStream = File.Create(ConfigFile)
                    'Nothing, create an empty udl.
                End Using
            End If

            Process.Start(ConfigFile)
        End Sub

        Private Sub btnQuery_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnQuery.Click
            Dim DataPath As String = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) & Path.DirectorySeparatorChar
            Dim ConfigFile As String = DataPath & "GenericReports2.udl"
            Connection.Close()
            dataSet = New DataSet()

            Connection.ConnectionString = "File Name = " & ConfigFile

            Connection.Open()

            If SqlDialog Is Nothing Then
                SqlDialog = New EnterSQLDialog()
            End If

            If SqlDialog.ShowDialog() <> System.Windows.Forms.DialogResult.OK Then
                Return
            End If

            dbDataAdapter.SelectCommand = New OleDbCommand(SqlDialog.SQL, Connection)
            dbDataAdapter.Fill(dataSet, "Table")
            dataGrid.CaptionText = dbDataAdapter.SelectCommand.CommandText
            dataGrid.SetDataBinding(dataSet, "Table")
        End Sub

        Private Sub Export(ByVal SQL As String, ByRef DataPath As String)
            Report.ClearTables()
            Report.AddTable(dataSet)
            Report.SetValue("Date", Date.Now)
            Report.SetValue("ReportCaption", SQL)
            Report.SetUserFunction("datatype", New DataTypeImp())

            DataPath = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) & Path.DirectorySeparatorChar 'First try to find the template on exe folder.

            If Not File.Exists(DataPath & "Generic Reports 2.template.xls") Then 'When on design mode, search for the template 2 folders up.
                DataPath = Path.Combine(DataPath, Path.Combine("..", "..")) & Path.DirectorySeparatorChar
            End If
        End Sub

        Private Sub btnExportExcel_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnExportExcel.Click
            Dim DataPath As String = Nothing
            If dbDataAdapter Is Nothing OrElse dbDataAdapter.SelectCommand Is Nothing OrElse dbDataAdapter.SelectCommand.CommandText Is Nothing Then
                MessageBox.Show("You need to select a query first")
                Return
            End If
            Export(dbDataAdapter.SelectCommand.CommandText, DataPath)

            If saveFileDialog1.ShowDialog() = System.Windows.Forms.DialogResult.OK Then
                Report.Run(DataPath & "Generic Reports 2.template.xls", saveFileDialog1.FileName)

                If MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) = System.Windows.Forms.DialogResult.Yes Then
                    Process.Start(saveFileDialog1.FileName)
                End If
            End If
        End Sub
    End Class

    ''' <summary>
    ''' A small used-defined function to know the type of the value inserted.
    ''' </summary>
    Public Class DataTypeImp
        Inherits TFlexCelUserFunction

        Public Overrides Function Evaluate(ByVal parameters() As Object) As Object
            If parameters Is Nothing OrElse parameters.Length <> 1 Then
                Throw New Exception("DataType must be called with 1 parameter.")
            End If

            If TypeOf parameters(0) Is Double Then
                Return "double"
            End If
            If TypeOf parameters(0) Is Date Then
                Return "datetime"
            End If
            Return ""
        End Function
    End Class
End Namespace

Program.vb

Imports System.Threading

Namespace GenericReports2
    Friend NotInheritable Class Program

        Private Sub New()
        End Sub

        ''' <summary>
        ''' The main entry point for the application.
        ''' </summary>
       <STAThread> _
        Shared Sub Main()
            Dim handler As New ThreadExceptionHandler()

            AddHandler Application.ThreadException, AddressOf handler.Application_ThreadException

            Application.EnableVisualStyles()
            Application.SetCompatibleTextRenderingDefault(False)
            Application.Run(New mainForm())
        End Sub
    End Class

    Friend Class ThreadExceptionHandler
        Public Sub Application_ThreadException(ByVal sender As Object, ByVal e As ThreadExceptionEventArgs)
            Try
                Dim result As DialogResult = ShowThreadExceptionDialog(e.Exception)

                If result = DialogResult.Abort Then
                    Application.Exit()
                End If
            Catch
                ' Fatal error, terminate program
                Try
                    MessageBox.Show("Fatal Error", "Fatal Error", MessageBoxButtons.OK, MessageBoxIcon.Stop)
                Finally
                    Application.Exit()
                End Try
            End Try
        End Sub

        '''
        ''' Creates and displays the error message.
        '''
        Private Function ShowThreadExceptionDialog(ByVal ex As Exception) As DialogResult
            Dim errorMessage As String = "Unhandled Exception:" & vbLf & vbLf & ex.Message & vbLf & vbLf & ex.GetType().ToString() & vbLf & vbLf & "Stack Trace:" & vbLf & ex.StackTrace

            Return MessageBox.Show(errorMessage, "Application Error", MessageBoxButtons.AbortRetryIgnore, MessageBoxIcon.Stop)
        End Function
    End Class

End Namespace


Meta templates (VB.Net / netframework) | FlexCel Studio for the .NET Framework documentation

Meta templates (VB.Net / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\vb\VS2022\netframework\20.Reports\90.Meta Templates and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​vb/​VS2022/​netframework/​Modules/​20.​Reports/​90.​Meta Templates

Overview

FlexCel allows self-modifying templates, that can adapt themselves to the data that is going to be reported. This provides other way to create generic reports, besides what is shown in the Generic Reports example. But the utility of meta templates can go much further.

In this example, we have a template that will show rss feeds. If the feed contains a pubDate field, it will be added. If it doesn't, the row will be deleted from the template before running the report.

Concepts

  • You can use the <#Preprocess> tag to evaluate expressions when the template is being read. You can delete columns and rows, clear fields, etc. Once the preprocessing is over, the report will be run on the modified template.

  • Database fields and expressions can have default values, that will be applied when the field or expression does not exist. For example: <#DataTable.field;20> will evaluate to the value in DataTable.Field if Field exists, or 20 otherwise.

  • The <#Defined> tag can be used to know wheter a field or table is defined or not, and to for example delete the column if the field does not exist.

Files

AssemblyInfo.vb

Imports System.Reflection
Imports System.Runtime.CompilerServices

'
' General Information about an assembly is controlled through the following
' set of attributes. Change these attribute values to modify the information
' associated with an assembly.
'
<Assembly: AssemblyTitle("")>
<Assembly: AssemblyDescription("")>
<Assembly: AssemblyConfiguration("")>
<Assembly: AssemblyCompany("")>
<Assembly: AssemblyProduct("")>
<Assembly: AssemblyCopyright("(c) 2002 - 2014 TMS Software")>
<Assembly: AssemblyTrademark("")>
<Assembly: AssemblyCulture("")>

'
' Version information for an assembly consists of the following four values:
'
'      Major Version
'      Minor Version
'      Build Number
'      Revision
'
' You can specify all the values or you can default the Revision and Build Numbers
' by using the '*' as shown below:

<Assembly: AssemblyVersion("6.2.1.0")>

'
' In order to sign your assembly you must specify a key to use. Refer to the
' Microsoft .NET Framework documentation for more information on assembly signing.
'
' Use the attributes below to control which key is used for signing.
'
' Notes:
'   (*) If no key is specified, the assembly is not signed.
'   (*) KeyName refers to a key that has been installed in the Crypto Service
'       Provider (CSP) on your machine. KeyFile refers to a file which contains
'       a key.
'   (*) If the KeyFile and the KeyName values are both specified, the
'       following processing occurs:
'       (1) If the KeyName can be found in the CSP, that key is used.
'       (2) If the KeyName does not exist and the KeyFile does exist, the key
'           in the KeyFile is installed into the CSP and used.
'   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
'       When specifying the KeyFile, the location of the KeyFile should be
'       relative to the project output directory which is
'       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
'       located in the project directory, you would specify the AssemblyKeyFile
'       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
'   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
'       documentation for more information on this.
'
<Assembly: AssemblyDelaySign(False)>
<Assembly: AssemblyKeyFile("")>
<Assembly: AssemblyKeyName("")>

Form1.Designer.vb

Imports System.Collections
Imports System.ComponentModel
Imports System.IO
Imports System.Reflection
Imports System.Data.OleDb
Imports System.Threading
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports FlexCel.Report
Imports System.Xml
Namespace MetaTemplates
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Private saveFileDialog1 As System.Windows.Forms.SaveFileDialog
        Private panel2 As System.Windows.Forms.Panel
        Private WithEvents button2 As System.Windows.Forms.Button
        Private WithEvents btnExportExcel As System.Windows.Forms.Button
        Private cbFeeds As System.Windows.Forms.ComboBox
        Private cbOffline As System.Windows.Forms.CheckBox
        Private cbShowFeedCount As System.Windows.Forms.CheckBox
        Private components As System.ComponentModel.IContainer = Nothing

        ''' <summary>
        ''' Clean up any resources being used.
        ''' </summary>
        Protected Overrides Sub Dispose(ByVal disposing As Boolean)
            If disposing Then
                If components IsNot Nothing Then
                    components.Dispose()
                End If
            End If
            MyBase.Dispose(disposing)
        End Sub

        #Region "Windows Form Designer generated code"
        ''' <summary>
        ''' Required method for Designer support - do not modify
        ''' the contents of this method with the code editor.
        ''' </summary>
        Private Sub InitializeComponent()
            Dim resources As New System.ComponentModel.ComponentResourceManager(GetType(mainForm))
            Me.saveFileDialog1 = New System.Windows.Forms.SaveFileDialog()
            Me.panel2 = New System.Windows.Forms.Panel()
            Me.button2 = New System.Windows.Forms.Button()
            Me.btnExportExcel = New System.Windows.Forms.Button()
            Me.cbFeeds = New System.Windows.Forms.ComboBox()
            Me.cbOffline = New System.Windows.Forms.CheckBox()
            Me.cbShowFeedCount = New System.Windows.Forms.CheckBox()
            Me.panel2.SuspendLayout()
            Me.SuspendLayout()
            '
            ' saveFileDialog1
            '
            Me.saveFileDialog1.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm|Excel 97/2003|*.xls|Excel 2007|*.xlsx;*.xlsm|All " & "files|*.*"
            Me.saveFileDialog1.RestoreDirectory = True
            '
            ' panel2
            '
            Me.panel2.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D
            Me.panel2.Controls.Add(Me.button2)
            Me.panel2.Controls.Add(Me.btnExportExcel)
            Me.panel2.Controls.Add(Me.cbFeeds)
            Me.panel2.Dock = System.Windows.Forms.DockStyle.Top
            Me.panel2.Location = New System.Drawing.Point(0, 0)
            Me.panel2.Name = "panel2"
            Me.panel2.Size = New System.Drawing.Size(528, 40)
            Me.panel2.TabIndex = 3
            '
            ' button2
            '
            Me.button2.Anchor = (CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.button2.BackColor = System.Drawing.SystemColors.Control
            Me.button2.Image = (CType(resources.GetObject("button2.Image"), System.Drawing.Image))
            Me.button2.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft
            Me.button2.Location = New System.Drawing.Point(464, 2)
            Me.button2.Name = "button2"
            Me.button2.Size = New System.Drawing.Size(56, 26)
            Me.button2.TabIndex = 2
            Me.button2.Text = "Exit"
            Me.button2.TextAlign = System.Drawing.ContentAlignment.MiddleRight
            Me.button2.UseVisualStyleBackColor = False
'           Me.button2.Click += New System.EventHandler(Me.button2_Click)
            '
            ' btnExportExcel
            '
            Me.btnExportExcel.BackColor = System.Drawing.SystemColors.Control
            Me.btnExportExcel.Image = (CType(resources.GetObject("btnExportExcel.Image"), System.Drawing.Image))
            Me.btnExportExcel.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft
            Me.btnExportExcel.Location = New System.Drawing.Point(16, 2)
            Me.btnExportExcel.Name = "btnExportExcel"
            Me.btnExportExcel.Size = New System.Drawing.Size(120, 30)
            Me.btnExportExcel.TabIndex = 1
            Me.btnExportExcel.Text = "Export to Excel"
            Me.btnExportExcel.TextAlign = System.Drawing.ContentAlignment.MiddleRight
            Me.btnExportExcel.UseVisualStyleBackColor = False
'           Me.btnExportExcel.Click += New System.EventHandler(Me.btnExportExcel_Click)
            '
            ' cbFeeds
            '
            Me.cbFeeds.DisplayMember = "1"
            Me.cbFeeds.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
            Me.cbFeeds.Location = New System.Drawing.Point(200, 8)
            Me.cbFeeds.Name = "cbFeeds"
            Me.cbFeeds.Size = New System.Drawing.Size(216, 21)
            Me.cbFeeds.TabIndex = 4
            Me.cbFeeds.ValueMember = "1"
            '
            ' cbOffline
            '
            Me.cbOffline.Checked = True
            Me.cbOffline.CheckState = System.Windows.Forms.CheckState.Checked
            Me.cbOffline.Location = New System.Drawing.Point(40, 56)
            Me.cbOffline.Name = "cbOffline"
            Me.cbOffline.Size = New System.Drawing.Size(368, 24)
            Me.cbOffline.TabIndex = 5
            Me.cbOffline.Text = "Use offline data (do not connect to internet)"
            '
            ' cbShowFeedCount
            '
            Me.cbShowFeedCount.Location = New System.Drawing.Point(40, 80)
            Me.cbShowFeedCount.Name = "cbShowFeedCount"
            Me.cbShowFeedCount.Size = New System.Drawing.Size(360, 24)
            Me.cbShowFeedCount.TabIndex = 6
            Me.cbShowFeedCount.Text = "Show feed number column in the generated report."
            '
            ' mainForm
            '
            Me.AutoScaleDimensions = New System.Drawing.SizeF(6F, 13F)
            Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
            Me.ClientSize = New System.Drawing.Size(528, 126)
            Me.Controls.Add(Me.cbShowFeedCount)
            Me.Controls.Add(Me.cbOffline)
            Me.Controls.Add(Me.panel2)
            Me.Name = "mainForm"
            Me.Text = "Meta Templates"
'           Me.Load += New System.EventHandler(Me.mainForm_Load)
            Me.panel2.ResumeLayout(False)
            Me.ResumeLayout(False)

        End Sub
        #End Region
    End Class
End Namespace

Form1.vb

Imports System.Collections
Imports System.ComponentModel
Imports System.IO
Imports System.Reflection
Imports System.Data.OleDb
Imports System.Threading
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports FlexCel.Report

Imports System.Xml

Namespace MetaTemplates
    ''' <summary>
    ''' Templates that self-modify themselves before running.
    ''' </summary>
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Public Sub New()
            InitializeComponent()
        End Sub

        Public Structure FeedData
            Public Name As String
            Public Url As String
            Public Logo As String

            Public Sub New(ByVal aName As String, ByVal aUrl As String, ByVal aLogo As String)
                Name = aName
                Url = aUrl
                Logo = aLogo
            End Sub

            Public Overrides Function ToString() As String
                Return Name
            End Function
        End Structure

        Private Feeds() As FeedData = { _
            New FeedData("TMS", "https://www.tmssoftware.com/rss/tms.xml", "tms.gif"), _
            New FeedData("MSDN","https://sxpdata.microsoft.com/feeds/3.0/msdntn/MSDNMagazine_enus", "msdn.jpg"), _
            New FeedData("SLASHDOT", "http://rss.slashdot.org/Slashdot/slashdot", "slashdot.gif") _
        }

        Private Sub button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button2.Click
            Close()
        End Sub

        Private ReadOnly Property DataPath() As String
            Get
                Return Path.Combine(Path.Combine(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), ".."), "..") & Path.DirectorySeparatorChar
            End Get
        End Property

        Private Sub Export(ByVal data As DataSet)
            Using Report As New FlexCelReport(True)
                Report.AddTable(data)
                Report.SetValue("FeedName", CType(cbFeeds.SelectedValue, FeedData).Name)
                Report.SetValue("FeedUrl", CType(cbFeeds.SelectedValue, FeedData).Url)
                Report.SetValue("ShowCount", cbShowFeedCount.Checked)

                Using fs As New FileStream(Path.Combine(Path.Combine(DataPath, "logos"), CType(cbFeeds.SelectedValue, FeedData).Logo), FileMode.Open)
                    Dim b(CInt(fs.Length) - 1) As Byte
                    fs.Read(b, 0, b.Length)
                    Report.SetValue("Logo", b)
                End Using
                Report.Run(DataPath & "Meta Templates.template.xls", saveFileDialog1.FileName)
            End Using

        End Sub

        Private Sub btnExportExcel_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnExportExcel.Click

            Using data As New DataSet()
                Dim LocalData As String = Path.Combine(Path.Combine(DataPath, "data"), CType(cbFeeds.SelectedValue, FeedData).Name & ".xml")

                If cbOffline.Checked Then
                    data.ReadXml(LocalData)
                Else
                    'In a real world example, this should be done on a thread, as it is done in the HTML example.
                    'To keep things simple here ,we will just "freeze" the gui while downloading the data, without
                    'providing feedback to the user.
                    Dim FeedReader As New XmlTextReader(CType(cbFeeds.SelectedValue, FeedData).Url)
                    data.ReadXml(FeedReader)
                End If

#If (SaveForOffline) Then
                data.WriteXml(LocalData)
#End If

                If saveFileDialog1.ShowDialog() = System.Windows.Forms.DialogResult.OK Then
                    Export(data)

                    If MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) = System.Windows.Forms.DialogResult.Yes Then
                        Process.Start(saveFileDialog1.FileName)
                    End If
                End If
            End Using
        End Sub

        Private Sub mainForm_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
            cbFeeds.DataSource = Feeds
            cbFeeds.SelectedIndex = 0
        End Sub

    End Class
End Namespace

Program.vb

Namespace MetaTemplates
    Friend NotInheritable Class Program

        Private Sub New()
        End Sub

        ''' <summary>
        ''' The main entry point for the application.
        ''' </summary>
       <STAThread> _
        Shared Sub Main()
            Application.EnableVisualStyles()
            Application.SetCompatibleTextRenderingDefault(False)
            Application.Run(New mainForm())
        End Sub
    End Class
End Namespace


User defined tables (VB.Net / netframework) | FlexCel Studio for the .NET Framework documentation

User defined tables (VB.Net / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\vb\VS2022\netframework\20.Reports\91.User Tables and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​vb/​VS2022/​netframework/​Modules/​20.​Reports/​91.​User Tables

Overview

User defined tables allow you to specify the datasets in the report part of the data layer. Different from Direct SQL, user tables work in a more controlled environment, where you can specifically deny or grant access to the data. User Tables also allow access not SQL databases.

Concepts

  • To use User Tables you need the following things:

    1. On the config sheet, write "User Table(parameters)" on the "Source Name" column, and something else on the "Table Name" column. What you write on the "Table Name" column is really not important, but you need to write something so FlexCel knows that the row has information. Normally you would use this column to tell FlexCel what is the name of the datatable you want to add, but this is not a requirement.

    2. On the code, you need to define a UserTable event that will actually add the tables to the report base on what you write on the "parameters" and "table name" columns.

  • On this example, we just use the parameter as the name of the table we want to load, and use the "table name" column as the name of the table we will insert on the report. We could also use the parameter string as parameter to an SQL, but when doing this, please make sure you validate the parameter string against a hashtable of possible values, to avoid SQL injections attacks.

  • Even when we do not show it here, you could pass many parameters on the "Parameters" string, using your own defined parameter separator, and process this string on the event.

  • Unrelated to user tables, on this demo we also show how you can delete the categories that have no products, using a <#delete range> tag inside a <#if(<#products.#Rowcount>0 ) = 0> tag. Important note:* As FlexCel already deletes products that have no records, this will interfere with the <#Delete range> tag that will delete whole categories, and it would in fact delete one more row that what we need. So it is important that you make* **genericReport.DeleteEmptyRanges = false on the code before running the report.

Files

AssemblyInfo.vb

Imports System.Reflection
Imports System.Runtime.CompilerServices

'
' General Information about an assembly is controlled through the following
' set of attributes. Change these attribute values to modify the information
' associated with an assembly.
'
<Assembly: AssemblyTitle("")>
<Assembly: AssemblyDescription("")>
<Assembly: AssemblyConfiguration("")>
<Assembly: AssemblyCompany("")>
<Assembly: AssemblyProduct("")>
<Assembly: AssemblyCopyright("(c) 2002 - 2014 TMS Software")>
<Assembly: AssemblyTrademark("")>
<Assembly: AssemblyCulture("")>

'
' Version information for an assembly consists of the following four values:
'
'      Major Version
'      Minor Version
'      Build Number
'      Revision
'
' You can specify all the values or you can default the Revision and Build Numbers
' by using the '*' as shown below:

<Assembly: AssemblyVersion("6.2.1.0")>

'
' In order to sign your assembly you must specify a key to use. Refer to the
' Microsoft .NET Framework documentation for more information on assembly signing.
'
' Use the attributes below to control which key is used for signing.
'
' Notes:
'   (*) If no key is specified, the assembly is not signed.
'   (*) KeyName refers to a key that has been installed in the Crypto Service
'       Provider (CSP) on your machine. KeyFile refers to a file which contains
'       a key.
'   (*) If the KeyFile and the KeyName values are both specified, the
'       following processing occurs:
'       (1) If the KeyName can be found in the CSP, that key is used.
'       (2) If the KeyName does not exist and the KeyFile does exist, the key
'           in the KeyFile is installed into the CSP and used.
'   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
'       When specifying the KeyFile, the location of the KeyFile should be
'       relative to the project output directory which is
'       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
'       located in the project directory, you would specify the AssemblyKeyFile
'       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
'   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
'       documentation for more information on this.
'
<Assembly: AssemblyDelaySign(False)>
<Assembly: AssemblyKeyFile("")>
<Assembly: AssemblyKeyName("")>

Form1.Designer.vb

Imports System.Collections
Imports System.ComponentModel
Imports System.IO
Imports System.Reflection
Imports System.Resources
Imports System.Globalization
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports FlexCel.Report
Namespace UserTables
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Private WithEvents button1 As System.Windows.Forms.Button
        Private saveFileDialog1 As System.Windows.Forms.SaveFileDialog
        Private label1 As System.Windows.Forms.Label
        Private WithEvents btnCancel As System.Windows.Forms.Button
        ''' <summary>
        ''' Required designer variable.
        ''' </summary>
        Private components As System.ComponentModel.Container = Nothing

        ''' <summary>
        ''' Clean up any resources being used.
        ''' </summary>
        Protected Overrides Sub Dispose(ByVal disposing As Boolean)
            If disposing Then
                If components IsNot Nothing Then
                    components.Dispose()
                End If
            End If
            MyBase.Dispose(disposing)
        End Sub

        #Region "Windows Form Designer generated code"
        ''' <summary>
        ''' Required method for Designer support - do not modify
        ''' the contents of this method with the code editor.
        ''' </summary>
        Private Sub InitializeComponent()
            Me.button1 = New System.Windows.Forms.Button()
            Me.saveFileDialog1 = New System.Windows.Forms.SaveFileDialog()
            Me.label1 = New System.Windows.Forms.Label()
            Me.btnCancel = New System.Windows.Forms.Button()
            Me.SuspendLayout()
            '
            ' button1
            '
            Me.button1.Anchor = (CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.button1.BackColor = System.Drawing.Color.Green
            Me.button1.ForeColor = System.Drawing.Color.White
            Me.button1.Location = New System.Drawing.Point(112, 136)
            Me.button1.Name = "button1"
            Me.button1.Size = New System.Drawing.Size(112, 23)
            Me.button1.TabIndex = 0
            Me.button1.Text = "GO!"
            Me.button1.UseVisualStyleBackColor = False
'           Me.button1.Click += New System.EventHandler(Me.button1_Click)
            '
            ' saveFileDialog1
            '
            Me.saveFileDialog1.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm|Excel 97/2003|*.xls|Excel 2007|*.xlsx;*.xlsm|All files|*.*"
            Me.saveFileDialog1.RestoreDirectory = True
            '
            ' label1
            '
            Me.label1.Location = New System.Drawing.Point(24, 24)
            Me.label1.Name = "label1"
            Me.label1.Size = New System.Drawing.Size(288, 24)
            Me.label1.TabIndex = 2
            Me.label1.Text = "A demo on how to use user tables on a report. "
            '
            ' btnCancel
            '
            Me.btnCancel.Anchor = (CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.btnCancel.BackColor = System.Drawing.Color.FromArgb((CInt((CByte(192)))), (CInt((CByte(0)))), (CInt((CByte(0)))))
            Me.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel
            Me.btnCancel.ForeColor = System.Drawing.Color.White
            Me.btnCancel.Location = New System.Drawing.Point(232, 136)
            Me.btnCancel.Name = "btnCancel"
            Me.btnCancel.Size = New System.Drawing.Size(112, 23)
            Me.btnCancel.TabIndex = 3
            Me.btnCancel.Text = "Cancel"
            Me.btnCancel.UseVisualStyleBackColor = False
'           Me.btnCancel.Click += New System.EventHandler(Me.btnCancel_Click)
            '
            ' mainForm
            '
            Me.AutoScaleDimensions = New System.Drawing.SizeF(6F, 13F)
            Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
            Me.ClientSize = New System.Drawing.Size(376, 166)
            Me.Controls.Add(Me.btnCancel)
            Me.Controls.Add(Me.label1)
            Me.Controls.Add(Me.button1)
            Me.Name = "mainForm"
            Me.Text = "User Tables"
            Me.ResumeLayout(False)

        End Sub
        #End Region
    End Class
End Namespace

Form1.vb

Imports System.Collections
Imports System.ComponentModel
Imports System.IO
Imports System.Reflection
Imports System.Resources
Imports System.Globalization
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports FlexCel.Report
Imports FlexCel.Demo.SharedData

Namespace UserTables
    ''' <summary>
    ''' Using tables that are defined in the template.
    ''' </summary>
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Public Sub New()
            InitializeComponent()
        End Sub

        Private Sub button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button1.Click
            AutoRun()
        End Sub

        Public Sub AutoRun()
            Using genericReport As New FlexCelReport(True)
                AddHandler genericReport.UserTable, AddressOf genericReport_UserTable
                genericReport.DeleteEmptyRanges = False

                Dim DataPath As String = Path.Combine(Path.Combine(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), ".."), "..") & Path.DirectorySeparatorChar

                If saveFileDialog1.ShowDialog() = System.Windows.Forms.DialogResult.OK Then
                    genericReport.Run(DataPath & "User Tables.template" & Path.GetExtension(saveFileDialog1.FileName), saveFileDialog1.FileName)

                    If MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) = System.Windows.Forms.DialogResult.Yes Then
                        Process.Start(saveFileDialog1.FileName)
                    End If
                End If
            End Using
        End Sub

        Private Sub genericReport_UserTable(ByVal sender As Object, ByVal e As UserTableEventArgs)
            Dim ds As New DataSet()

            'On this example we will just return the table with the name specified on parameters
            'but you could return whatever you wanted here.
            'As always, remember to *validate* what the user can enter on the parameters string.

            Select Case e.Parameters.ToUpper(CultureInfo.InvariantCulture)
                Case "SUPPLIERS"
                    SharedData.Fill(ds, "select * from suppliers", e.TableName)
                Case "CATEGORIES"
                    SharedData.Fill(ds, "select * from categories", e.TableName)
                Case "PRODUCTS"
                    SharedData.Fill(ds, "select * from products", e.TableName)

                Case Else
                    Throw New Exception("Invalid parameter to user table: " & e.Parameters)
            End Select

            CType(sender, FlexCelReport).AddTable(ds, TDisposeMode.DisposeAfterRun)
        End Sub

        Private Sub btnCancel_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnCancel.Click
            Close()
        End Sub
    End Class

End Namespace

Program.vb

Namespace UserTables
    Friend NotInheritable Class Program

        Private Sub New()
        End Sub

        ''' <summary>
        ''' The main entry point for the application.
        ''' </summary>
       <STAThread> _
        Shared Sub Main()
            Application.EnableVisualStyles()
            Application.SetCompatibleTextRenderingDefault(False)
            Application.Run(New mainForm())
        End Sub
    End Class
End Namespace


Direct SQL (VB.Net / netframework) | FlexCel Studio for the .NET Framework documentation

Direct SQL (VB.Net / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\vb\VS2022\netframework\20.Reports\92.Direct SQL and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​vb/​VS2022/​netframework/​Modules/​20.​Reports/​92.​Direct SQL

Overview

In normal FlexCel reports, you create the data layer in code and the template in Excel. This allows your user to easily modify the presentation layer with Excel and without needing to modify the code.

While this is a very good choice for most reports (as the data layer does not change much, and the presentation does), sometimes you might want to allow your users to directly modify the data layer from Excel. This is when you can use Direct SQL in templates.

Concepts

  • By default, you can't use Direct SQL on reports. To be able to use it, you need to add a connection to the report with FlexCelReport.AddConnection in the code.

  • Allowing the final user to specify the SQL directly on the report might carry big security risks.

    1. A user might use the SQL to modify the data. For example, instead of a normal SQL like "select * from customer" he might write "delete from customers" and erase all information. While FlexCel does a little validation on the SQL string, (for example it will not allow SQLs not starting with "SELECT") there are always ways to modify the data.

    2. A user might get access to data you don't intend him to. For example, he might know the user passwords are on the table "Users" and use an existing unrelated report to get the data from this table.

  • To keep your application secure, it is recommended that:

  • You give Read Only access rights to the connection you add to the report, and only give access to the tables the report needs to use

  • You enable Direct SQL on cases where you can control the templates. For example on a web application (where the templates are always on the server) or a GUI App where templates are kept on a server. Or, of course, if you don't care about the data because it is not important, or the customer has administrator access to all the database anyway.

  • Do not use Encrypted templates to give security to the system. While this can give some extra security, encrypted xls files can be cracked with tools available in Internet.

  • To use Direct SQL on the templates, you write SQL(connection, sqlstring) on the "Source name" column in the config sheet.

  • You can't use expressions inside an SQL statement. The "sqlstring" you pass as parameter to the SQL() command will not allow any expression replacement. Again, this is a security decision to avoid SQL Injection attacks. (If you don't know what this is, you can search for "SQL injection" in Internet to get a more in-depth description of the problem)

  • As you can't use expressions inside the SQL, you need to be able to pass parameters to it. To pass a parameter to the SQL:

  • In SQL databases you can normally use two types of parameters: positional ("?") and named ("@param" or ":param"). On order to keep your templates database-independent, FlexCel Templates will always use named parameters starting with "@". Even if you are accessing ODBC, you should write "SELECT * from table where field = @field" and never "SELECT * from table where field = ?" in the template. The only supported syntax in templates is "@" parameters; FlexCel will convert the parameters to what's needed when calling the actual SQL.

  • You then can set the parameters in the code, by using FlexCelReport.AddSqlParameter This is not database independent, and you need to add the correct type of parameter for the actual database here.

Files

AssemblyInfo.vb

Imports System.Reflection
Imports System.Runtime.CompilerServices

'
' General Information about an assembly is controlled through the following
' set of attributes. Change these attribute values to modify the information
' associated with an assembly.
'
<Assembly: AssemblyTitle("")>
<Assembly: AssemblyDescription("")>
<Assembly: AssemblyConfiguration("")>
<Assembly: AssemblyCompany("")>
<Assembly: AssemblyProduct("")>
<Assembly: AssemblyCopyright("(c) 2002 - 2014 TMS Software")>
<Assembly: AssemblyTrademark("")>
<Assembly: AssemblyCulture("")>

'
' Version information for an assembly consists of the following four values:
'
'      Major Version
'      Minor Version
'      Build Number
'      Revision
'
' You can specify all the values or you can default the Revision and Build Numbers
' by using the '*' as shown below:

<Assembly: AssemblyVersion("6.2.1.0")>

'
' In order to sign your assembly you must specify a key to use. Refer to the
' Microsoft .NET Framework documentation for more information on assembly signing.
'
' Use the attributes below to control which key is used for signing.
'
' Notes:
'   (*) If no key is specified, the assembly is not signed.
'   (*) KeyName refers to a key that has been installed in the Crypto Service
'       Provider (CSP) on your machine. KeyFile refers to a file which contains
'       a key.
'   (*) If the KeyFile and the KeyName values are both specified, the
'       following processing occurs:
'       (1) If the KeyName can be found in the CSP, that key is used.
'       (2) If the KeyName does not exist and the KeyFile does exist, the key
'           in the KeyFile is installed into the CSP and used.
'   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
'       When specifying the KeyFile, the location of the KeyFile should be
'       relative to the project output directory which is
'       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
'       located in the project directory, you would specify the AssemblyKeyFile
'       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
'   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
'       documentation for more information on this.
'
<Assembly: AssemblyDelaySign(False)>
<Assembly: AssemblyKeyFile("")>
<Assembly: AssemblyKeyName("")>

Form1.Designer.vb

Imports System.Collections
Imports System.ComponentModel
Imports System.IO
Imports System.Reflection
Imports System.Resources
Imports System.Globalization
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports FlexCel.Report
Namespace DirectSQL
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Private WithEvents button1 As System.Windows.Forms.Button
        Private saveFileDialog1 As System.Windows.Forms.SaveFileDialog
        Private label1 As System.Windows.Forms.Label
        Private WithEvents btnCancel As System.Windows.Forms.Button
        Private startDate As System.Windows.Forms.DateTimePicker
        Private label2 As System.Windows.Forms.Label
        Private endDate As System.Windows.Forms.DateTimePicker
        ''' <summary>
        ''' Required designer variable.
        ''' </summary>
        Private components As System.ComponentModel.Container = Nothing

        ''' <summary>
        ''' Clean up any resources being used.
        ''' </summary>
        Protected Overrides Sub Dispose(ByVal disposing As Boolean)
            If disposing Then
                If components IsNot Nothing Then
                    components.Dispose()
                End If
            End If
            MyBase.Dispose(disposing)
        End Sub

        #Region "Windows Form Designer generated code"
        ''' <summary>
        ''' Required method for Designer support - do not modify
        ''' the contents of this method with the code editor.
        ''' </summary>
        Private Sub InitializeComponent()
            Me.button1 = New System.Windows.Forms.Button()
            Me.saveFileDialog1 = New System.Windows.Forms.SaveFileDialog()
            Me.label1 = New System.Windows.Forms.Label()
            Me.btnCancel = New System.Windows.Forms.Button()
            Me.startDate = New System.Windows.Forms.DateTimePicker()
            Me.label2 = New System.Windows.Forms.Label()
            Me.endDate = New System.Windows.Forms.DateTimePicker()
            Me.SuspendLayout()
            '
            ' button1
            '
            Me.button1.Anchor = (CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.button1.BackColor = System.Drawing.Color.Green
            Me.button1.ForeColor = System.Drawing.Color.White
            Me.button1.Location = New System.Drawing.Point(104, 136)
            Me.button1.Name = "button1"
            Me.button1.Size = New System.Drawing.Size(112, 23)
            Me.button1.TabIndex = 0
            Me.button1.Text = "GO!"
            Me.button1.UseVisualStyleBackColor = False
'           Me.button1.Click += New System.EventHandler(Me.button1_Click)
            '
            ' saveFileDialog1
            '
            Me.saveFileDialog1.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm|Excel 97/2003|*.xls|Excel 2007|*.xlsx;*.xlsm|All files|*.*"
            Me.saveFileDialog1.RestoreDirectory = True
            '
            ' label1
            '
            Me.label1.Location = New System.Drawing.Point(24, 24)
            Me.label1.Name = "label1"
            Me.label1.Size = New System.Drawing.Size(288, 24)
            Me.label1.TabIndex = 2
            Me.label1.Text = "A demo on how to use direct SQL on a report. "
            '
            ' btnCancel
            '
            Me.btnCancel.Anchor = (CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.btnCancel.BackColor = System.Drawing.Color.FromArgb((CInt((CByte(192)))), (CInt((CByte(0)))), (CInt((CByte(0)))))
            Me.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel
            Me.btnCancel.ForeColor = System.Drawing.Color.White
            Me.btnCancel.Location = New System.Drawing.Point(224, 136)
            Me.btnCancel.Name = "btnCancel"
            Me.btnCancel.Size = New System.Drawing.Size(112, 23)
            Me.btnCancel.TabIndex = 3
            Me.btnCancel.Text = "Cancel"
            Me.btnCancel.UseVisualStyleBackColor = False
'           Me.btnCancel.Click += New System.EventHandler(Me.btnCancel_Click)
            '
            ' startDate
            '
            Me.startDate.Format = System.Windows.Forms.DateTimePickerFormat.Short
            Me.startDate.Location = New System.Drawing.Point(24, 80)
            Me.startDate.Name = "startDate"
            Me.startDate.Size = New System.Drawing.Size(144, 20)
            Me.startDate.TabIndex = 4
            Me.startDate.Value = New Date(1996, 1, 1, 15, 55, 0, 0)
            '
            ' label2
            '
            Me.label2.Location = New System.Drawing.Point(24, 56)
            Me.label2.Name = "label2"
            Me.label2.Size = New System.Drawing.Size(224, 16)
            Me.label2.TabIndex = 5
            Me.label2.Text = "Get orders between:"
            '
            ' endDate
            '
            Me.endDate.Format = System.Windows.Forms.DateTimePickerFormat.Short
            Me.endDate.Location = New System.Drawing.Point(192, 80)
            Me.endDate.Name = "endDate"
            Me.endDate.Size = New System.Drawing.Size(144, 20)
            Me.endDate.TabIndex = 6
            Me.endDate.Value = New Date(1997, 1, 1, 0, 0, 0, 0)
            '
            ' mainForm
            '
            Me.AutoScaleDimensions = New System.Drawing.SizeF(6F, 13F)
            Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
            Me.ClientSize = New System.Drawing.Size(368, 182)
            Me.Controls.Add(Me.endDate)
            Me.Controls.Add(Me.label2)
            Me.Controls.Add(Me.startDate)
            Me.Controls.Add(Me.btnCancel)
            Me.Controls.Add(Me.label1)
            Me.Controls.Add(Me.button1)
            Me.Name = "mainForm"
            Me.Text = "Direct SQL"
            Me.ResumeLayout(False)

        End Sub
        #End Region
    End Class
End Namespace

Form1.vb

Imports System.Collections
Imports System.ComponentModel
Imports System.IO
Imports System.Reflection
Imports System.Resources
Imports System.Globalization
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports FlexCel.Report
Imports FlexCel.Demo.SharedData

Namespace DirectSQL
    ''' <summary>
    ''' Summary description for Form1.
    ''' </summary>
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Public Sub New()
            InitializeComponent()
        End Sub

        Private Sub button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button1.Click
            Using genericReport As New FlexCelReport(True)
                Dim genericAdapter As IDbDataAdapter = SharedData.GetDataAdapter()
                Try
                    genericReport.SetValue("ReportCaption", "Sales by Country and Employee")
                    genericReport.AddConnection("Northwind", genericAdapter, CultureInfo.CurrentCulture)

                    'In OleDb the parameters are positional, you don't really need to name them when creating them.
                    'But when you are using an SQL Server connection, you *need*
                    'to specify the parameter name ("@StartDate") and make it equal to "@" + the name
                    'of the parameter. It is recommended that you always specify the name, even in OleDb connections.

                    'Also, we are not going to create the parameters directly here (using new SqlCeParameter(...).
                    'We are going to centralize all data access for the demos in SharedData, so we can change it and change all demos.
                    genericReport.AddSqlParameter("StartDate", SharedData.CreateParameter("@StartDate", startDate.Value.Date))
                    genericReport.AddSqlParameter("EndDate", SharedData.CreateParameter("@EndDate", endDate.Value.Date))
                    Dim DataPath As String = Path.Combine(Path.Combine(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), ".."), "..") & Path.DirectorySeparatorChar

                    If saveFileDialog1.ShowDialog() = System.Windows.Forms.DialogResult.OK Then
                        genericReport.Run(DataPath & "Direct SQL.template.xls", saveFileDialog1.FileName)

                        If MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) = System.Windows.Forms.DialogResult.Yes Then
                            Process.Start(saveFileDialog1.FileName)
                        End If
                    End If
                Finally
                    CType(genericAdapter, IDisposable).Dispose()
                End Try
            End Using
        End Sub

        Private Sub btnCancel_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnCancel.Click
            Close()
        End Sub
    End Class

End Namespace

Program.vb

Namespace DirectSQL
    Friend NotInheritable Class Program

        Private Sub New()
        End Sub

        ''' <summary>
        ''' The main entry point for the application.
        ''' </summary>
       <STAThread> _
        Shared Sub Main()
            Application.EnableVisualStyles()
            Application.SetCompatibleTextRenderingDefault(False)
            Application.Run(New mainForm())
        End Sub
    End Class
End Namespace


Master detail report on one table (VB.Net / netframework) | FlexCel Studio for the .NET Framework documentation

Master detail report on one table (VB.Net / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\vb\VS2022\netframework\20.Reports\93.Master Detail on one Table and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​vb/​VS2022/​netframework/​Modules/​20.​Reports/​93.​Master Detail on one Table

Overview

On this demo we see how to "split" one table into a master and a detail table, in order to group the data. If you have the choice on how to supply the report data is better to read different tables for master-report (to avoid duplicate data). But if you already have the data joined into one table, the Distinct and Relationship tags can help you get it back into different tables.

Look at Grouping Tables in the Report designer's guide for more information.

Concepts

  • How to use the "DISTINCT" filter to create a new master dataset with the unique records on a table.

  • You can use the DISTINCT filter on more than one column, by separating them with ";". Only records that have any of the columns different will be included.

  • How to use the "RELATIONSHIP" tag on the configuration sheet to relate two tables in master-detail. Note that different from the relationships you can set on the Data Layer, the relationships on the config sheet can be between tables on different datasets.

  • The Relationship syntax is a little more complex than distinct. You need to write "RELATIONSHIP" on the table name, then "Master->Detail" on source name (where Master is the parent table and Detail the child). After that, you need to write the field names that relate both tables on the "Filter" column. You can relate more than one field, with the syntax: MasterTableField1->CDetailTableField1;MasterTableField2->CDetailTableField2...etc.

  • How to use the <#Merge Range> tag to merge all the cells in the country column.

Files

AssemblyInfo.vb

Imports System.Reflection
Imports System.Runtime.CompilerServices

'
' General Information about an assembly is controlled through the following
' set of attributes. Change these attribute values to modify the information
' associated with an assembly.
'
<Assembly: AssemblyTitle("")>
<Assembly: AssemblyDescription("")>
<Assembly: AssemblyConfiguration("")>
<Assembly: AssemblyCompany("")>
<Assembly: AssemblyProduct("")>
<Assembly: AssemblyCopyright("(c) 2002 - 2014 TMS Software")>
<Assembly: AssemblyTrademark("")>
<Assembly: AssemblyCulture("")>

'
' Version information for an assembly consists of the following four values:
'
'      Major Version
'      Minor Version
'      Build Number
'      Revision
'
' You can specify all the values or you can default the Revision and Build Numbers
' by using the '*' as shown below:

<Assembly: AssemblyVersion("6.2.1.0")>

'
' In order to sign your assembly you must specify a key to use. Refer to the
' Microsoft .NET Framework documentation for more information on assembly signing.
'
' Use the attributes below to control which key is used for signing.
'
' Notes:
'   (*) If no key is specified, the assembly is not signed.
'   (*) KeyName refers to a key that has been installed in the Crypto Service
'       Provider (CSP) on your machine. KeyFile refers to a file which contains
'       a key.
'   (*) If the KeyFile and the KeyName values are both specified, the
'       following processing occurs:
'       (1) If the KeyName can be found in the CSP, that key is used.
'       (2) If the KeyName does not exist and the KeyFile does exist, the key
'           in the KeyFile is installed into the CSP and used.
'   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
'       When specifying the KeyFile, the location of the KeyFile should be
'       relative to the project output directory which is
'       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
'       located in the project directory, you would specify the AssemblyKeyFile
'       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
'   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
'       documentation for more information on this.
'
<Assembly: AssemblyDelaySign(False)>
<Assembly: AssemblyKeyFile("")>
<Assembly: AssemblyKeyName("")>

Form1.Designer.vb

Imports System.Collections
Imports System.ComponentModel
Imports System.IO
Imports System.Reflection
Imports System.Resources
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports FlexCel.Report
Namespace MasterDetailononeTable
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Private WithEvents button1 As System.Windows.Forms.Button
        Private saveFileDialog1 As System.Windows.Forms.SaveFileDialog
        Private label1 As System.Windows.Forms.Label
        Private WithEvents btnCancel As System.Windows.Forms.Button
        ''' <summary>
        ''' Required designer variable.
        ''' </summary>
        Private components As System.ComponentModel.Container = Nothing

        ''' <summary>
        ''' Clean up any resources being used.
        ''' </summary>
        Protected Overrides Sub Dispose(ByVal disposing As Boolean)
            If disposing Then
                If components IsNot Nothing Then
                    components.Dispose()
                End If
            End If
            MyBase.Dispose(disposing)
        End Sub

        #Region "Windows Form Designer generated code"
        ''' <summary>
        ''' Required method for Designer support - do not modify
        ''' the contents of this method with the code editor.
        ''' </summary>
        Private Sub InitializeComponent()
            Me.button1 = New System.Windows.Forms.Button()
            Me.saveFileDialog1 = New System.Windows.Forms.SaveFileDialog()
            Me.label1 = New System.Windows.Forms.Label()
            Me.btnCancel = New System.Windows.Forms.Button()
            Me.SuspendLayout()
            '
            ' button1
            '
            Me.button1.Anchor = (CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.button1.BackColor = System.Drawing.Color.Green
            Me.button1.ForeColor = System.Drawing.Color.White
            Me.button1.Location = New System.Drawing.Point(152, 88)
            Me.button1.Name = "button1"
            Me.button1.Size = New System.Drawing.Size(112, 23)
            Me.button1.TabIndex = 0
            Me.button1.Text = "GO!"
            Me.button1.UseVisualStyleBackColor = False
'           Me.button1.Click += New System.EventHandler(Me.button1_Click)
            '
            ' saveFileDialog1
            '
            Me.saveFileDialog1.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm|Excel 97/2003|*.xls|Excel 2007|*.xlsx;*.xlsm|All files|*.*"
            Me.saveFileDialog1.RestoreDirectory = True
            '
            ' label1
            '
            Me.label1.Location = New System.Drawing.Point(24, 24)
            Me.label1.Name = "label1"
            Me.label1.Size = New System.Drawing.Size(352, 24)
            Me.label1.TabIndex = 2
            Me.label1.Text = "A demo on how to create a Master-Detail report with only one table"
            '
            ' btnCancel
            '
            Me.btnCancel.Anchor = (CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.btnCancel.BackColor = System.Drawing.Color.FromArgb((CInt((CByte(192)))), (CInt((CByte(0)))), (CInt((CByte(0)))))
            Me.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel
            Me.btnCancel.ForeColor = System.Drawing.Color.White
            Me.btnCancel.Location = New System.Drawing.Point(272, 88)
            Me.btnCancel.Name = "btnCancel"
            Me.btnCancel.Size = New System.Drawing.Size(112, 23)
            Me.btnCancel.TabIndex = 3
            Me.btnCancel.Text = "Cancel"
            Me.btnCancel.UseVisualStyleBackColor = False
'           Me.btnCancel.Click += New System.EventHandler(Me.btnCancel_Click)
            '
            ' mainForm
            '
            Me.AutoScaleDimensions = New System.Drawing.SizeF(6F, 13F)
            Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
            Me.ClientSize = New System.Drawing.Size(416, 133)
            Me.Controls.Add(Me.btnCancel)
            Me.Controls.Add(Me.label1)
            Me.Controls.Add(Me.button1)
            Me.Name = "mainForm"
            Me.Text = "Master-Detail on one table"
            Me.ResumeLayout(False)

        End Sub
        #End Region
    End Class
End Namespace

Form1.vb

Imports System.Collections
Imports System.ComponentModel
Imports System.IO
Imports System.Reflection
Imports System.Resources
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports FlexCel.Report
Imports FlexCel.Demo.SharedData

Namespace MasterDetailononeTable
    ''' <summary>
    ''' How to split a table into 2.
    ''' </summary>
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Public Sub New()
            InitializeComponent()
        End Sub

        Private Sub button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button1.Click
            AutoRun()
        End Sub

        Public Sub AutoRun()
            Using ordersReport As FlexCelReport = SharedData.CreateReport()
                ordersReport.SetValue("Date", Date.Now)
                ordersReport.SetValue("ReportCaption", "Sales by year and country")

                Using ds As New DataSet()
                    SharedData.Fill(ds, "SELECT Employees.Country, SUM([Order Details].UnitPrice * [Order Details].Quantity) AS Sales, COUNT([Order Details].Quantity) AS OrderCount, DatePart(yyyy, Orders.OrderDate) AS SaleYear, DatePart(q, Orders.OrderDate) AS Quarter FROM ((Employees INNER JOIN Orders ON Employees.EmployeeID = Orders.EmployeeID) INNER JOIN [Order Details] ON Orders.OrderID = [Order Details].OrderID) GROUP BY Employees.Country, DatePart(yyyy, Orders.OrderDate), DatePart(q, Orders.OrderDate)", "Data")
                    ordersReport.AddTable(ds)
                    Dim DataPath As String = Path.Combine(Path.Combine(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), ".."), "..") & Path.DirectorySeparatorChar

                    If saveFileDialog1.ShowDialog() = System.Windows.Forms.DialogResult.OK Then
                        ordersReport.Run(DataPath & "Master Detail on one Table.template.xls", saveFileDialog1.FileName)

                        If MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) = System.Windows.Forms.DialogResult.Yes Then
                            Process.Start(saveFileDialog1.FileName)
                        End If
                    End If
                End Using
            End Using
        End Sub

        Private Sub btnCancel_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnCancel.Click
            Close()
        End Sub
    End Class

End Namespace

Program.vb

Namespace MasterDetailononeTable
    Friend NotInheritable Class Program

        Private Sub New()
        End Sub

        ''' <summary>
        ''' The main entry point for the application.
        ''' </summary>
       <STAThread> _
        Shared Sub Main()
            Application.EnableVisualStyles()
            Application.SetCompatibleTextRenderingDefault(False)
            Application.Run(New mainForm())
        End Sub
    End Class
End Namespace


Merging similar cells (VB.Net / netframework) | FlexCel Studio for the .NET Framework documentation

Merging similar cells (VB.Net / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\vb\VS2022\netframework\20.Reports\935.Merging Similar Cells and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​vb/​VS2022/​netframework/​Modules/​20.​Reports/​935.​Merging Similar Cells

Overview

This demo is about how to perform a common task: Merging similar cells into one.

Concepts

  • There are 2 ways to merge similar cells in a sheet:

    1. Use a master-detail relationship. This is normally the way to go, just merge the master cells and have the details not merged. You can use as many master-detail levels as you want, and you can see this in the technique used in the first column of this demo.

    2. Use <#Merge Range> tags together with <#DbValue> tags. This can be useful when you want to do the merging in every column and you don't want to define a master and a detail table for each one of them. You need to be careful when using this method to check all the columns at the left (as shown in the "Ship country" column comment), not just the value at the last record.

Files

AssemblyInfo.vb

Imports System.Reflection
Imports System.Runtime.CompilerServices

'
' General Information about an assembly is controlled through the following
' set of attributes. Change these attribute values to modify the information
' associated with an assembly.
'
<Assembly: AssemblyTitle("")>
<Assembly: AssemblyDescription("")>
<Assembly: AssemblyConfiguration("")>
<Assembly: AssemblyCompany("")>
<Assembly: AssemblyProduct("")>
<Assembly: AssemblyCopyright("(c) 2002 - 2014 TMS Software")>
<Assembly: AssemblyTrademark("")>
<Assembly: AssemblyCulture("")>

'
' Version information for an assembly consists of the following four values:
'
'      Major Version
'      Minor Version
'      Build Number
'      Revision
'
' You can specify all the values or you can default the Revision and Build Numbers
' by using the '*' as shown below:

<Assembly: AssemblyVersion("6.2.1.0")>

'
' In order to sign your assembly you must specify a key to use. Refer to the
' Microsoft .NET Framework documentation for more information on assembly signing.
'
' Use the attributes below to control which key is used for signing.
'
' Notes:
'   (*) If no key is specified, the assembly is not signed.
'   (*) KeyName refers to a key that has been installed in the Crypto Service
'       Provider (CSP) on your machine. KeyFile refers to a file which contains
'       a key.
'   (*) If the KeyFile and the KeyName values are both specified, the
'       following processing occurs:
'       (1) If the KeyName can be found in the CSP, that key is used.
'       (2) If the KeyName does not exist and the KeyFile does exist, the key
'           in the KeyFile is installed into the CSP and used.
'   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
'       When specifying the KeyFile, the location of the KeyFile should be
'       relative to the project output directory which is
'       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
'       located in the project directory, you would specify the AssemblyKeyFile
'       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
'   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
'       documentation for more information on this.
'
<Assembly: AssemblyDelaySign(False)>
<Assembly: AssemblyKeyFile("")>
<Assembly: AssemblyKeyName("")>

Form1.Designer.vb

Imports System.Collections
Imports System.ComponentModel
Imports System.IO
Imports System.Reflection
Imports System.Resources
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports FlexCel.Report
Imports FlexCel.Demo.SharedData
Namespace MergingSimilarCells
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Private WithEvents button1 As System.Windows.Forms.Button
        Private saveFileDialog1 As System.Windows.Forms.SaveFileDialog
        Private label1 As System.Windows.Forms.Label
        Private WithEvents btnCancel As System.Windows.Forms.Button
        ''' <summary>
        ''' Required designer variable.
        ''' </summary>
        Private components As System.ComponentModel.Container = Nothing

        ''' <summary>
        ''' Clean up any resources being used.
        ''' </summary>
        Protected Overrides Sub Dispose(ByVal disposing As Boolean)
            If disposing Then
                If (components IsNot Nothing) Then
                    components.Dispose()
                End If
            End If
            MyBase.Dispose(disposing)
        End Sub

        #region "Windows Form Designer generated code"
        ''' <summary>
        ''' Required method for Designer support - do not modify
        ''' the contents of this method with the code editor.
        ''' </summary>
        Private Sub InitializeComponent()
            Me.button1 = New System.Windows.Forms.Button()
            Me.saveFileDialog1 = New System.Windows.Forms.SaveFileDialog()
            Me.label1 = New System.Windows.Forms.Label()
            Me.btnCancel = New System.Windows.Forms.Button()
            Me.SuspendLayout()
            '
            ' button1
            '
            Me.button1.Anchor = (CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.button1.BackColor = System.Drawing.Color.Green
            Me.button1.ForeColor = System.Drawing.Color.White
            Me.button1.Location = New System.Drawing.Point(152, 88)
            Me.button1.Name = "button1"
            Me.button1.Size = New System.Drawing.Size(112, 23)
            Me.button1.TabIndex = 0
            Me.button1.Text = "GO!"
            Me.button1.UseVisualStyleBackColor = False
'           Me.button1.Click += New System.EventHandler(Me.button1_Click)
            '
            ' saveFileDialog1
            '
            Me.saveFileDialog1.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm|Excel 97/2003|*.xls|Excel 2007|*.xlsx;*.xlsm|All files|*.*"
            Me.saveFileDialog1.RestoreDirectory = True
            '
            ' label1
            '
            Me.label1.Location = New System.Drawing.Point(24, 24)
            Me.label1.Name = "label1"
            Me.label1.Size = New System.Drawing.Size(352, 24)
            Me.label1.TabIndex = 2
            Me.label1.Text = "A demo on how to merge similar cells when creating a report"
            '
            ' btnCancel
            '
            Me.btnCancel.Anchor = (CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.btnCancel.BackColor = System.Drawing.Color.FromArgb((CInt((CByte(192)))), (CInt((CByte(0)))), (CInt((CByte(0)))))
            Me.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel
            Me.btnCancel.ForeColor = System.Drawing.Color.White
            Me.btnCancel.Location = New System.Drawing.Point(272, 88)
            Me.btnCancel.Name = "btnCancel"
            Me.btnCancel.Size = New System.Drawing.Size(112, 23)
            Me.btnCancel.TabIndex = 3
            Me.btnCancel.Text = "Cancel"
            Me.btnCancel.UseVisualStyleBackColor = False
'           Me.btnCancel.Click += New System.EventHandler(Me.btnCancel_Click)
            '
            ' mainForm
            '
            Me.AutoScaleDimensions = New System.Drawing.SizeF(6F, 13F)
            Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
            Me.ClientSize = New System.Drawing.Size(416, 133)
            Me.Controls.Add(Me.btnCancel)
            Me.Controls.Add(Me.label1)
            Me.Controls.Add(Me.button1)
            Me.Name = "mainForm"
            Me.Text = "Merging similar cells"
            Me.ResumeLayout(False)

        End Sub
        #End Region

    End Class
End Namespace

Form1.vb

Imports System.Collections
Imports System.ComponentModel
Imports System.IO
Imports System.Reflection
Imports System.Resources
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports FlexCel.Report
Imports FlexCel.Demo.SharedData

Namespace MergingSimilarCells
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Public Sub New()
            InitializeComponent()
        End Sub

        Private Sub button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button1.Click
            AutoRun()
        End Sub

        Public Sub AutoRun()
            Using ordersReport As FlexCelReport = SharedData.CreateReport()

                Dim DataPath As String = Path.Combine(Path.Combine(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), ".."), "..") & Path.DirectorySeparatorChar

                If saveFileDialog1.ShowDialog() = System.Windows.Forms.DialogResult.OK Then
                    ordersReport.Run(DataPath & "Merging Similar Cells.template.xls", saveFileDialog1.FileName)

                    If MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) = System.Windows.Forms.DialogResult.Yes Then
                        Process.Start(saveFileDialog1.FileName)
                    End If
                End If
            End Using
        End Sub

        Private Sub btnCancel_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnCancel.Click
            Close()
        End Sub
    End Class
End Namespace

Program.vb

Namespace MergingSimilarCells
    Friend NotInheritable Class Program

        Private Sub New()
        End Sub

        ''' <summary>
        ''' The main entry point for the application.
        ''' </summary>
       <STAThread> _
        Shared Sub Main()
            Application.EnableVisualStyles()
            Application.SetCompatibleTextRenderingDefault(False)
            Application.Run(New mainForm())
        End Sub
    End Class
End Namespace


Splitting datasets (VB.Net / netframework) | FlexCel Studio for the .NET Framework documentation

Splitting datasets (VB.Net / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\vb\VS2022\netframework\20.Reports\94.Split Datasets and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​vb/​VS2022/​netframework/​Modules/​20.​Reports/​94.​Split Datasets

Overview

It is a normal request when doing a report for printing, to be able to manipulate the page breaks so there are no "hanging" lines at the end or beginning of a page. Since Excel does not provide this functionality, it is impossible for us to do it. But, you can use the <#SPLIT> tag on the config sheet to for example fit 40 records on each page.

Concepts

  • How to use the SPLIT tag to create a master-detail relationship of a dataset with itself, where each detail has a fixed number of records.

  • The SPLIT tag is a little special in that it does not create a real dataset, but it filters the data on the fly instead. This has some restrictions, the most important being that the master dataset and the clhild must be in direct relationship one with the other. If MasterOrders and Orders are both master and detail, you can not have MasterOrders/Other/Orders ranges each one inside the other. You must have Other/MasterOrders/Orders or Orders/MasterOrders/Other. This restriction normally is harmless.

  • It is not shown on this demo, but note that you could use a parameter on the "record count" parameter of the split tag. For example: <#Split(table;<#splitcount>)> and dinamically change the split range on the application before running the report.

Files

AssemblyInfo.vb

Imports System.Reflection
Imports System.Runtime.CompilerServices

'
' General Information about an assembly is controlled through the following
' set of attributes. Change these attribute values to modify the information
' associated with an assembly.
'
<Assembly: AssemblyTitle("")>
<Assembly: AssemblyDescription("")>
<Assembly: AssemblyConfiguration("")>
<Assembly: AssemblyCompany("")>
<Assembly: AssemblyProduct("")>
<Assembly: AssemblyCopyright("(c) 2002 - 2014 TMS Software")>
<Assembly: AssemblyTrademark("")>
<Assembly: AssemblyCulture("")>

'
' Version information for an assembly consists of the following four values:
'
'      Major Version
'      Minor Version
'      Build Number
'      Revision
'
' You can specify all the values or you can default the Revision and Build Numbers
' by using the '*' as shown below:

<Assembly: AssemblyVersion("6.2.1.0")>

'
' In order to sign your assembly you must specify a key to use. Refer to the
' Microsoft .NET Framework documentation for more information on assembly signing.
'
' Use the attributes below to control which key is used for signing.
'
' Notes:
'   (*) If no key is specified, the assembly is not signed.
'   (*) KeyName refers to a key that has been installed in the Crypto Service
'       Provider (CSP) on your machine. KeyFile refers to a file which contains
'       a key.
'   (*) If the KeyFile and the KeyName values are both specified, the
'       following processing occurs:
'       (1) If the KeyName can be found in the CSP, that key is used.
'       (2) If the KeyName does not exist and the KeyFile does exist, the key
'           in the KeyFile is installed into the CSP and used.
'   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
'       When specifying the KeyFile, the location of the KeyFile should be
'       relative to the project output directory which is
'       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
'       located in the project directory, you would specify the AssemblyKeyFile
'       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
'   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
'       documentation for more information on this.
'
<Assembly: AssemblyDelaySign(False)>
<Assembly: AssemblyKeyFile("")>
<Assembly: AssemblyKeyName("")>

Form1.Designer.vb

Imports System.Collections
Imports System.ComponentModel
Imports System.IO
Imports System.Reflection
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports FlexCel.Report
Imports FlexCel.Demo.SharedData
Namespace SplitDatasets
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Private WithEvents button1 As System.Windows.Forms.Button
        Private saveFileDialog1 As System.Windows.Forms.SaveFileDialog
        Private label1 As System.Windows.Forms.Label
        Private WithEvents btnCancel As System.Windows.Forms.Button
        ''' <summary>
        ''' Required designer variable.
        ''' </summary>
        Private components As System.ComponentModel.Container = Nothing

        ''' <summary>
        ''' Clean up any resources being used.
        ''' </summary>
        Protected Overrides Sub Dispose(ByVal disposing As Boolean)
            If disposing Then
                If components IsNot Nothing Then
                    components.Dispose()
                End If
            End If
            MyBase.Dispose(disposing)
        End Sub

        #Region "Windows Form Designer generated code"
        ''' <summary>
        ''' Required method for Designer support - do not modify
        ''' the contents of this method with the code editor.
        ''' </summary>
        Private Sub InitializeComponent()
            Me.button1 = New System.Windows.Forms.Button()
            Me.saveFileDialog1 = New System.Windows.Forms.SaveFileDialog()
            Me.label1 = New System.Windows.Forms.Label()
            Me.btnCancel = New System.Windows.Forms.Button()
            Me.SuspendLayout()
            '
            ' button1
            '
            Me.button1.Anchor = (CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.button1.BackColor = System.Drawing.Color.Green
            Me.button1.ForeColor = System.Drawing.Color.White
            Me.button1.Location = New System.Drawing.Point(152, 88)
            Me.button1.Name = "button1"
            Me.button1.Size = New System.Drawing.Size(112, 23)
            Me.button1.TabIndex = 0
            Me.button1.Text = "GO!"
            Me.button1.UseVisualStyleBackColor = False
'           Me.button1.Click += New System.EventHandler(Me.button1_Click)
            '
            ' saveFileDialog1
            '
            Me.saveFileDialog1.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm|Excel 97/2003|*.xls|Excel 2007|*.xlsx;*.xlsm|All files|*.*"
            Me.saveFileDialog1.RestoreDirectory = True
            '
            ' label1
            '
            Me.label1.Location = New System.Drawing.Point(24, 24)
            Me.label1.Name = "label1"
            Me.label1.Size = New System.Drawing.Size(328, 24)
            Me.label1.TabIndex = 2
            Me.label1.Text = "Shows how to split a dataset into groups of n records."
            '
            ' btnCancel
            '
            Me.btnCancel.Anchor = (CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.btnCancel.BackColor = System.Drawing.Color.FromArgb((CInt((CByte(192)))), (CInt((CByte(0)))), (CInt((CByte(0)))))
            Me.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel
            Me.btnCancel.ForeColor = System.Drawing.Color.White
            Me.btnCancel.Location = New System.Drawing.Point(272, 88)
            Me.btnCancel.Name = "btnCancel"
            Me.btnCancel.Size = New System.Drawing.Size(112, 23)
            Me.btnCancel.TabIndex = 3
            Me.btnCancel.Text = "Cancel"
            Me.btnCancel.UseVisualStyleBackColor = False
'           Me.btnCancel.Click += New System.EventHandler(Me.btnCancel_Click)
            '
            ' mainForm
            '
            Me.AutoScaleDimensions = New System.Drawing.SizeF(6F, 13F)
            Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
            Me.ClientSize = New System.Drawing.Size(416, 133)
            Me.Controls.Add(Me.btnCancel)
            Me.Controls.Add(Me.label1)
            Me.Controls.Add(Me.button1)
            Me.Name = "mainForm"
            Me.Text = "Split Datasets"
            Me.ResumeLayout(False)

        End Sub
        #End Region
    End Class
End Namespace

Form1.vb

Imports System.Collections
Imports System.ComponentModel
Imports System.IO
Imports System.Reflection
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports FlexCel.Report
Imports FlexCel.Demo.SharedData

Namespace SplitDatasets
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Public Sub New()
            InitializeComponent()
        End Sub

        Private Sub button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button1.Click
            AutoRun()
        End Sub

        Public Sub AutoRun()
            Using ordersReport As FlexCelReport = SharedData.CreateReport()
                Dim DataPath As String = Path.Combine(Path.Combine(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), ".."), "..") & Path.DirectorySeparatorChar

                If saveFileDialog1.ShowDialog() = System.Windows.Forms.DialogResult.OK Then
                    ordersReport.Run(DataPath & "Split Datasets.template.xls", saveFileDialog1.FileName)

                    If MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) = System.Windows.Forms.DialogResult.Yes Then
                        Process.Start(saveFileDialog1.FileName)
                    End If
                End If
            End Using
        End Sub

        Private Sub btnCancel_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnCancel.Click
            Close()
        End Sub
    End Class

End Namespace

Program.vb

Namespace SplitDatasets
    Friend NotInheritable Class Program

        Private Sub New()
        End Sub

        ''' <summary>
        ''' The main entry point for the application.
        ''' </summary>
       <STAThread> _
        Shared Sub Main()
            Application.EnableVisualStyles()
            Application.SetCompatibleTextRenderingDefault(False)
            Application.Run(New mainForm())
        End Sub
    End Class
End Namespace


Fixed footer (VB.Net / netframework) | FlexCel Studio for the .NET Framework documentation

Fixed footer (VB.Net / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\vb\VS2022\netframework\20.Reports\94a.Fixed Footer and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​vb/​VS2022/​netframework/​Modules/​20.​Reports/​94a.​Fixed Footer

Overview

When doing simple headers and footers, like for example printing "Page n of m" in every page, then Excel's built-in headers and footers should be enough. But sometimes you need more complex headers or footers, and you need to define them in the cells.

For headers, Excel provides a "Rows to repeat at top" and "Columns to repeat at left" command that allow you to repeat a range of cells in every printed page. But to do footers, Excel doesn't provide a similar "Rows to repeat at bottom" or "Columns to repeat at right". If you need complex footers, then the only option is to manually split the dataset in groups of n rows, and manually copy the footer every time.

Concepts

  • How to use the SPLIT tag (look at Splitting Tables in the Reports designer's guide) to create a report with 40 records per page.

  • How to use the "multiple of" parameter in ATLEAST (look at Ensuring a table has at least N records in the Reports designer's guide) to ensure the dataset has a number of records multiple of 40. This makes sure that the footer will be at the bottom of the last page, not after the last record.

Files

AssemblyInfo.vb

Imports System.Reflection
Imports System.Runtime.CompilerServices

'
' General Information about an assembly is controlled through the following
' set of attributes. Change these attribute values to modify the information
' associated with an assembly.
'
<Assembly: AssemblyTitle("")>
<Assembly: AssemblyDescription("")>
<Assembly: AssemblyConfiguration("")>
<Assembly: AssemblyCompany("")>
<Assembly: AssemblyProduct("")>
<Assembly: AssemblyCopyright("(c) 2002 - 2014 TMS Software")>
<Assembly: AssemblyTrademark("")>
<Assembly: AssemblyCulture("")>

'
' Version information for an assembly consists of the following four values:
'
'      Major Version
'      Minor Version
'      Build Number
'      Revision
'
' You can specify all the values or you can default the Revision and Build Numbers
' by using the '*' as shown below:

<Assembly: AssemblyVersion("6.2.1.0")>

'
' In order to sign your assembly you must specify a key to use. Refer to the
' Microsoft .NET Framework documentation for more information on assembly signing.
'
' Use the attributes below to control which key is used for signing.
'
' Notes:
'   (*) If no key is specified, the assembly is not signed.
'   (*) KeyName refers to a key that has been installed in the Crypto Service
'       Provider (CSP) on your machine. KeyFile refers to a file which contains
'       a key.
'   (*) If the KeyFile and the KeyName values are both specified, the
'       following processing occurs:
'       (1) If the KeyName can be found in the CSP, that key is used.
'       (2) If the KeyName does not exist and the KeyFile does exist, the key
'           in the KeyFile is installed into the CSP and used.
'   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
'       When specifying the KeyFile, the location of the KeyFile should be
'       relative to the project output directory which is
'       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
'       located in the project directory, you would specify the AssemblyKeyFile
'       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
'   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
'       documentation for more information on this.
'
<Assembly: AssemblyDelaySign(False)>
<Assembly: AssemblyKeyFile("")>
<Assembly: AssemblyKeyName("")>

Form1.Designer.vb

Imports System.Collections
Imports System.ComponentModel
Imports System.IO
Imports System.Reflection
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports FlexCel.Report
Imports FlexCel.Demo.SharedData
Namespace FixedFooter
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Private WithEvents button1 As System.Windows.Forms.Button
        Private saveFileDialog1 As System.Windows.Forms.SaveFileDialog
        Private label1 As System.Windows.Forms.Label
        Private WithEvents btnCancel As System.Windows.Forms.Button
        ''' <summary>
        ''' Required designer variable.
        ''' </summary>
        Private components As System.ComponentModel.Container = Nothing

        ''' <summary>
        ''' Clean up any resources being used.
        ''' </summary>
        Protected Overrides Sub Dispose(ByVal disposing As Boolean)
            If disposing Then
                If components IsNot Nothing Then
                    components.Dispose()
                End If
            End If
            MyBase.Dispose(disposing)
        End Sub

        #Region "Windows Form Designer generated code"
        ''' <summary>
        ''' Required method for Designer support - do not modify
        ''' the contents of this method with the code editor.
        ''' </summary>
        Private Sub InitializeComponent()
            Me.button1 = New System.Windows.Forms.Button()
            Me.saveFileDialog1 = New System.Windows.Forms.SaveFileDialog()
            Me.label1 = New System.Windows.Forms.Label()
            Me.btnCancel = New System.Windows.Forms.Button()
            Me.SuspendLayout()
            '
            ' button1
            '
            Me.button1.Anchor = (CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.button1.BackColor = System.Drawing.Color.Green
            Me.button1.ForeColor = System.Drawing.Color.White
            Me.button1.Location = New System.Drawing.Point(152, 88)
            Me.button1.Name = "button1"
            Me.button1.Size = New System.Drawing.Size(112, 23)
            Me.button1.TabIndex = 0
            Me.button1.Text = "GO!"
            Me.button1.UseVisualStyleBackColor = False
'           Me.button1.Click += New System.EventHandler(Me.button1_Click)
            '
            ' saveFileDialog1
            '
            Me.saveFileDialog1.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm|Excel 97/2003|*.xls|Excel 2007|*.xlsx;*.xlsm|All files|*.*"
            Me.saveFileDialog1.RestoreDirectory = True
            '
            ' label1
            '
            Me.label1.Location = New System.Drawing.Point(24, 24)
            Me.label1.Name = "label1"
            Me.label1.Size = New System.Drawing.Size(288, 24)
            Me.label1.TabIndex = 2
            Me.label1.Text = "A report with a fixed footer"
            '
            ' btnCancel
            '
            Me.btnCancel.Anchor = (CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.btnCancel.BackColor = System.Drawing.Color.FromArgb((CInt((CByte(192)))), (CInt((CByte(0)))), (CInt((CByte(0)))))
            Me.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel
            Me.btnCancel.ForeColor = System.Drawing.Color.White
            Me.btnCancel.Location = New System.Drawing.Point(272, 88)
            Me.btnCancel.Name = "btnCancel"
            Me.btnCancel.Size = New System.Drawing.Size(112, 23)
            Me.btnCancel.TabIndex = 3
            Me.btnCancel.Text = "Cancel"
            Me.btnCancel.UseVisualStyleBackColor = False
'           Me.btnCancel.Click += New System.EventHandler(Me.btnCancel_Click)
            '
            ' mainForm
            '
            Me.AutoScaleDimensions = New System.Drawing.SizeF(6F, 13F)
            Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
            Me.ClientSize = New System.Drawing.Size(416, 133)
            Me.Controls.Add(Me.btnCancel)
            Me.Controls.Add(Me.label1)
            Me.Controls.Add(Me.button1)
            Me.Name = "mainForm"
            Me.Text = "Fixed Footer Report"
            Me.ResumeLayout(False)

        End Sub
        #End Region
    End Class
End Namespace

Form1.vb

Imports System.Collections
Imports System.ComponentModel
Imports System.IO
Imports System.Reflection
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports FlexCel.Report
Imports FlexCel.Demo.SharedData

Namespace FixedFooter
    ''' <summary>
    ''' Form-Like reports
    ''' </summary>
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Public Sub New()
            InitializeComponent()
        End Sub

        Private Sub button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button1.Click
            AutoRun()
        End Sub

        Public Sub AutoRun()
            Using ordersReport As FlexCelReport = SharedData.CreateReport()
                ordersReport.SetValue("Date", Date.Now)

                Dim DataPath As String = Path.Combine(Path.Combine(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), ".."), "..") & Path.DirectorySeparatorChar

                If saveFileDialog1.ShowDialog() = System.Windows.Forms.DialogResult.OK Then
                    ordersReport.Run(DataPath & "Fixed Footer.template" & Path.GetExtension(saveFileDialog1.FileName), saveFileDialog1.FileName)

                    If MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) = System.Windows.Forms.DialogResult.Yes Then
                        Process.Start(saveFileDialog1.FileName)
                    End If
                End If
            End Using
        End Sub

        Private Sub btnCancel_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnCancel.Click
            Close()
        End Sub
    End Class

End Namespace

Program.vb

Namespace FixedFooter
    Friend NotInheritable Class Program

        Private Sub New()
        End Sub

        ''' <summary>
        ''' The main entry point for the application.
        ''' </summary>
       <STAThread> _
        Shared Sub Main()
            Application.EnableVisualStyles()
            Application.SetCompatibleTextRenderingDefault(False)
            Application.Run(New mainForm())
        End Sub
    End Class
End Namespace


Overflowing data in different sheets (VB.Net / netframework) | FlexCel Studio for the .NET Framework documentation

Overflowing data in different sheets (VB.Net / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\vb\VS2022\netframework\20.Reports\94b.Overflow sheets and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​vb/​VS2022/​netframework/​Modules/​20.​Reports/​94b.​Overflow sheets

Overview

THIS DEMO NEEDS .NET 3.5 OR NEWER. YOU COULD DO THE SAME IN .NET 2.0, BUT THIS PARTICULAR DEMO USES LINQ.

For very big datasets, it might happen that they don't fit in a single sheet. In xls files, you can have a maximum of 65536 rows, and in xlsx 1048576 rows. If you want to dump bigger datasets than the maximum available (or you just want to allow say a maximum of 100 records in a sheet and after it is reached move to the next), then you might use the SPLIT tag as a master in the sheet.

Take a look at Splitting Tables in the Report designer's guide for more information.

Concepts

  • How to use the SPLIT tag to create a master-detail relationship of a dataset with itself, where each detail has a fixed number of records. This way you can limit the number of records that you show in each sheet.

  • How to use the Evaluate tag to provide a meaningful sheet name.

Files

AssemblyInfo.vb

Imports System.Reflection
Imports System.Runtime.CompilerServices

'
' General Information about an assembly is controlled through the following
' set of attributes. Change these attribute values to modify the information
' associated with an assembly.
'
<Assembly: AssemblyTitle("")>
<Assembly: AssemblyDescription("")>
<Assembly: AssemblyConfiguration("")>
<Assembly: AssemblyCompany("")>
<Assembly: AssemblyProduct("")>
<Assembly: AssemblyCopyright("(c) 2002 - 2014 TMS Software")>
<Assembly: AssemblyTrademark("")>
<Assembly: AssemblyCulture("")>

'
' Version information for an assembly consists of the following four values:
'
'      Major Version
'      Minor Version
'      Build Number
'      Revision
'
' You can specify all the values or you can default the Revision and Build Numbers
' by using the '*' as shown below:

<Assembly: AssemblyVersion("6.2.1.0")>

'
' In order to sign your assembly you must specify a key to use. Refer to the
' Microsoft .NET Framework documentation for more information on assembly signing.
'
' Use the attributes below to control which key is used for signing.
'
' Notes:
'   (*) If no key is specified, the assembly is not signed.
'   (*) KeyName refers to a key that has been installed in the Crypto Service
'       Provider (CSP) on your machine. KeyFile refers to a file which contains
'       a key.
'   (*) If the KeyFile and the KeyName values are both specified, the
'       following processing occurs:
'       (1) If the KeyName can be found in the CSP, that key is used.
'       (2) If the KeyName does not exist and the KeyFile does exist, the key
'           in the KeyFile is installed into the CSP and used.
'   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
'       When specifying the KeyFile, the location of the KeyFile should be
'       relative to the project output directory which is
'       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
'       located in the project directory, you would specify the AssemblyKeyFile
'       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
'   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
'       documentation for more information on this.
'
<Assembly: AssemblyDelaySign(False)>
<Assembly: AssemblyKeyFile("")>
<Assembly: AssemblyKeyName("")>

Form1.Designer.vb

Imports System.Collections
Imports System.ComponentModel
Imports System.IO
Imports System.Reflection
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports FlexCel.Report
Namespace Overflowsheets
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Private WithEvents button1 As System.Windows.Forms.Button
        Private saveFileDialog1 As System.Windows.Forms.SaveFileDialog
        Private label1 As System.Windows.Forms.Label
        Private WithEvents btnCancel As System.Windows.Forms.Button
        ''' <summary>
        ''' Required designer variable.
        ''' </summary>
        Private components As System.ComponentModel.Container = Nothing

        ''' <summary>
        ''' Clean up any resources being used.
        ''' </summary>
        Protected Overrides Sub Dispose(ByVal disposing As Boolean)
            If disposing Then
                If components IsNot Nothing Then
                    components.Dispose()
                End If
            End If
            MyBase.Dispose(disposing)
        End Sub

        #Region "Windows Form Designer generated code"
        ''' <summary>
        ''' Required method for Designer support - do not modify
        ''' the contents of this method with the code editor.
        ''' </summary>
        Private Sub InitializeComponent()
            Me.button1 = New System.Windows.Forms.Button()
            Me.saveFileDialog1 = New System.Windows.Forms.SaveFileDialog()
            Me.label1 = New System.Windows.Forms.Label()
            Me.btnCancel = New System.Windows.Forms.Button()
            Me.SuspendLayout()
            '
            ' button1
            '
            Me.button1.Anchor = (CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.button1.BackColor = System.Drawing.Color.Green
            Me.button1.ForeColor = System.Drawing.Color.White
            Me.button1.Location = New System.Drawing.Point(152, 88)
            Me.button1.Name = "btnGo"
            Me.button1.Size = New System.Drawing.Size(112, 23)
            Me.button1.TabIndex = 0
            Me.button1.Text = "GO!"
            Me.button1.UseVisualStyleBackColor = False
'           Me.button1.Click += New System.EventHandler(Me.button1_Click)
            '
            ' saveFileDialog1
            '
            Me.saveFileDialog1.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm|Excel 97/2003|*.xls|Excel 2007|*.xlsx;*.xlsm|All files|*.*"
            Me.saveFileDialog1.RestoreDirectory = True
            '
            ' label1
            '
            Me.label1.Location = New System.Drawing.Point(24, 24)
            Me.label1.Name = "label1"
            Me.label1.Size = New System.Drawing.Size(428, 24)
            Me.label1.TabIndex = 2
            Me.label1.Text = "Shows how to split a report in multiple sheets with n records per sheet."
            '
            ' btnCancel
            '
            Me.btnCancel.Anchor = (CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.btnCancel.BackColor = System.Drawing.Color.FromArgb((CInt((CByte(192)))), (CInt((CByte(0)))), (CInt((CByte(0)))))
            Me.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel
            Me.btnCancel.ForeColor = System.Drawing.Color.White
            Me.btnCancel.Location = New System.Drawing.Point(272, 88)
            Me.btnCancel.Name = "btnCancel"
            Me.btnCancel.Size = New System.Drawing.Size(112, 23)
            Me.btnCancel.TabIndex = 3
            Me.btnCancel.Text = "Cancel"
            Me.btnCancel.UseVisualStyleBackColor = False
'           Me.btnCancel.Click += New System.EventHandler(Me.btnCancel_Click)
            '
            ' mainForm
            '
            Me.AutoScaleDimensions = New System.Drawing.SizeF(6F, 13F)
            Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
            Me.ClientSize = New System.Drawing.Size(416, 133)
            Me.Controls.Add(Me.btnCancel)
            Me.Controls.Add(Me.label1)
            Me.Controls.Add(Me.button1)
            Me.Name = "mainForm"
            Me.Text = "Overflow Sheets"
            Me.ResumeLayout(False)

        End Sub
        #End Region
    End Class
End Namespace

Form1.vb

Imports System.Collections
Imports System.ComponentModel
Imports System.IO
Imports System.Reflection
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports FlexCel.Report

Namespace Overflowsheets
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Public Sub New()
            InitializeComponent()
        End Sub

        Private Sub button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button1.Click
            AutoRun()
        End Sub

        Public Sub AutoRun()
            Using Report As New FlexCelReport(True)
                Dim Data(1009) As TMyData
                For i As Integer = 0 To Data.Length - 1
                    Data(i) = New TMyData("Customer " & i.ToString())
                Next i
                Report.AddTable("data", Data)
                Report.SetValue("split", 40)

                Dim DataPath As String = Path.Combine(Path.Combine(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), ".."), "..") & Path.DirectorySeparatorChar

                If saveFileDialog1.ShowDialog() = System.Windows.Forms.DialogResult.OK Then
                    Report.Run(DataPath & "Overflow Sheets.template.xlsx", saveFileDialog1.FileName)

                    If MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) = System.Windows.Forms.DialogResult.Yes Then
                        Process.Start(saveFileDialog1.FileName)
                    End If
                End If
            End Using
        End Sub

        Private Sub btnCancel_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnCancel.Click
            Close()
        End Sub
    End Class

    Friend Class TMyData
        Public Property Name() As String

        Public Sub New(ByVal name As String)
            Me.Name = name
        End Sub
    End Class

End Namespace

Program.vb

Namespace Overflowsheets
    Friend NotInheritable Class Program

        Private Sub New()
        End Sub

        ''' <summary>
        ''' The main entry point for the application.
        ''' </summary>
       <STAThread> _
        Shared Sub Main()
            Application.EnableVisualStyles()
            Application.SetCompatibleTextRenderingDefault(False)
            Application.Run(New mainForm())
        End Sub
    End Class
End Namespace


User defined functions (VB.Net / netframework) | FlexCel Studio for the .NET Framework documentation

User defined functions (VB.Net / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\vb\VS2022\netframework\20.Reports\95.User Defined Functions and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​vb/​VS2022/​netframework/​Modules/​20.​Reports/​95.​User Defined Functions

Overview

Here we will see how to define a user function to calculate the number of orders by employee and shipper. This example is similar to the Pivot Tables example, but using only static normal cells.

Concepts

  • How to define user functions for non-standard needs. By the way: Try to define only as little user functions as you really need. User functions are on code, and a change on them means that you have to recompile the code.

  • We defined two ranges here, one horizontal and one vertical. The user defined function here will return a value for a couple of those values, allowing us to create a "static" pivot table.

Files

AssemblyInfo.vb

Imports System.Reflection
Imports System.Runtime.CompilerServices

'
' General Information about an assembly is controlled through the following
' set of attributes. Change these attribute values to modify the information
' associated with an assembly.
'
<Assembly: AssemblyTitle("")>
<Assembly: AssemblyDescription("")>
<Assembly: AssemblyConfiguration("")>
<Assembly: AssemblyCompany("")>
<Assembly: AssemblyProduct("")>
<Assembly: AssemblyCopyright("(c) 2002 - 2014 TMS Software")>
<Assembly: AssemblyTrademark("")>
<Assembly: AssemblyCulture("")>

'
' Version information for an assembly consists of the following four values:
'
'      Major Version
'      Minor Version
'      Build Number
'      Revision
'
' You can specify all the values or you can default the Revision and Build Numbers
' by using the '*' as shown below:

<Assembly: AssemblyVersion("6.2.1.0")>

'
' In order to sign your assembly you must specify a key to use. Refer to the
' Microsoft .NET Framework documentation for more information on assembly signing.
'
' Use the attributes below to control which key is used for signing.
'
' Notes:
'   (*) If no key is specified, the assembly is not signed.
'   (*) KeyName refers to a key that has been installed in the Crypto Service
'       Provider (CSP) on your machine. KeyFile refers to a file which contains
'       a key.
'   (*) If the KeyFile and the KeyName values are both specified, the
'       following processing occurs:
'       (1) If the KeyName can be found in the CSP, that key is used.
'       (2) If the KeyName does not exist and the KeyFile does exist, the key
'           in the KeyFile is installed into the CSP and used.
'   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
'       When specifying the KeyFile, the location of the KeyFile should be
'       relative to the project output directory which is
'       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
'       located in the project directory, you would specify the AssemblyKeyFile
'       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
'   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
'       documentation for more information on this.
'
<Assembly: AssemblyDelaySign(False)>
<Assembly: AssemblyKeyFile("")>
<Assembly: AssemblyKeyName("")>

Form1.Designer.vb

Imports System.Collections
Imports System.ComponentModel
Imports System.IO
Imports System.Reflection
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports FlexCel.Report
Imports FlexCel.Demo.SharedData
Namespace UserDefinedFunctions
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        ''' <summary>
        ''' Required designer variable.
        ''' </summary>
        Private components As System.ComponentModel.Container = Nothing

        ''' <summary>
        ''' Clean up any resources being used.
        ''' </summary>
        Protected Overrides Sub Dispose(ByVal disposing As Boolean)
            If disposing Then
                If components IsNot Nothing Then
                    components.Dispose()
                End If
            End If
            MyBase.Dispose(disposing)
        End Sub

        #Region "Windows Form Designer generated code"
        ''' <summary>
        ''' Required method for Designer support - do not modify
        ''' the contents of this method with the code editor.
        ''' </summary>
        Private Sub InitializeComponent()
            Me.button1 = New System.Windows.Forms.Button()
            Me.saveFileDialog1 = New System.Windows.Forms.SaveFileDialog()
            Me.label1 = New System.Windows.Forms.Label()
            Me.btnCancel = New System.Windows.Forms.Button()
            Me.SuspendLayout()
            '
            ' button1
            '
            Me.button1.Anchor = (CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.button1.BackColor = System.Drawing.Color.Green
            Me.button1.ForeColor = System.Drawing.Color.White
            Me.button1.Location = New System.Drawing.Point(152, 88)
            Me.button1.Name = "button1"
            Me.button1.Size = New System.Drawing.Size(112, 23)
            Me.button1.TabIndex = 0
            Me.button1.Text = "GO!"
            Me.button1.UseVisualStyleBackColor = False
'           Me.button1.Click += New System.EventHandler(Me.button1_Click)
            '
            ' saveFileDialog1
            '
            Me.saveFileDialog1.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm|Excel 97/2003|*.xls|Excel 2007|*.xlsx;*.xlsm|All files|*.*"
            Me.saveFileDialog1.RestoreDirectory = True
            '
            ' label1
            '
            Me.label1.Location = New System.Drawing.Point(24, 24)
            Me.label1.Name = "label1"
            Me.label1.Size = New System.Drawing.Size(288, 24)
            Me.label1.TabIndex = 2
            Me.label1.Text = "A Crosstab report using an user defined function."
            '
            ' btnCancel
            '
            Me.btnCancel.Anchor = (CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.btnCancel.BackColor = System.Drawing.Color.FromArgb((CInt((CByte(192)))), (CInt((CByte(0)))), (CInt((CByte(0)))))
            Me.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel
            Me.btnCancel.ForeColor = System.Drawing.Color.White
            Me.btnCancel.Location = New System.Drawing.Point(272, 88)
            Me.btnCancel.Name = "btnCancel"
            Me.btnCancel.Size = New System.Drawing.Size(112, 23)
            Me.btnCancel.TabIndex = 3
            Me.btnCancel.Text = "Cancel"
            Me.btnCancel.UseVisualStyleBackColor = False
'           Me.btnCancel.Click += New System.EventHandler(Me.btnCancel_Click)
            '
            ' mainForm
            '
            Me.AutoScaleDimensions = New System.Drawing.SizeF(6F, 13F)
            Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
            Me.ClientSize = New System.Drawing.Size(416, 133)
            Me.Controls.Add(Me.btnCancel)
            Me.Controls.Add(Me.label1)
            Me.Controls.Add(Me.button1)
            Me.Name = "mainForm"
            Me.Text = "User defined functions"
            Me.ResumeLayout(False)

        End Sub
        #End Region

        Private WithEvents button1 As System.Windows.Forms.Button
        Private saveFileDialog1 As System.Windows.Forms.SaveFileDialog
        Private label1 As System.Windows.Forms.Label
        Private WithEvents btnCancel As System.Windows.Forms.Button
    End Class
End Namespace

Form1.vb

Imports System.Collections
Imports System.ComponentModel
Imports System.IO
Imports System.Reflection
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports FlexCel.Report
Imports FlexCel.Demo.SharedData

Namespace UserDefinedFunctions
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Public Sub New()
            InitializeComponent()
        End Sub

        Private Sub button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button1.Click
            AutoRun()
        End Sub

        Public Sub AutoRun()
            Using ordersReport As FlexCelReport = SharedData.CreateReport()
                ordersReport.SetValue("Date", Date.Now)
                ordersReport.SetUserFunction("Orders", New OrdersImp(SharedData.GetOrders()))

                Dim DataPath As String = Path.Combine(Path.Combine(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), ".."), "..") & Path.DirectorySeparatorChar

                If saveFileDialog1.ShowDialog() = System.Windows.Forms.DialogResult.OK Then
                    ordersReport.Run(DataPath & "User Defined Functions.template.xls", saveFileDialog1.FileName)

                    If MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) = System.Windows.Forms.DialogResult.Yes Then
                        Process.Start(saveFileDialog1.FileName)
                    End If
                End If
            End Using
        End Sub

        Private Sub btnCancel_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnCancel.Click
            Close()
        End Sub

    End Class

    #Region "Orders Implementation"
    Friend Class OrdersImp
        Inherits TFlexCelUserFunction

        Private OrdersDv As DataView

        Public Sub New(ByVal OrdersTable As DataTable)
            OrdersDv = New DataView(OrdersTable, String.Empty, "EmployeeID,ShipVia", DataViewRowState.CurrentRows)
        End Sub
        Public Overrides Function Evaluate(ByVal parameters() As Object) As Object
            If parameters Is Nothing OrElse parameters.Length <> 2 Then
                Throw New ArgumentException("Bad parameter count in call to Orders() user-defined function")
            End If

            Dim Count As Integer = OrdersDv.FindRows(parameters).Length
            If Count > 0 Then
                Return Count
            Else
                Return Nothing
            End If
        End Function
    End Class
    #End Region

End Namespace

Program.vb

Namespace UserDefinedFunctions
    Friend NotInheritable Class Program

        Private Sub New()
        End Sub

        ''' <summary>
        ''' The main entry point for the application.
        ''' </summary>
       <STAThread> _
        Shared Sub Main()
            Application.EnableVisualStyles()
            Application.SetCompatibleTextRenderingDefault(False)
            Application.Run(New mainForm())
        End Sub
    End Class
End Namespace


User defined formats (VB.Net / netframework) | FlexCel Studio for the .NET Framework documentation

User defined formats (VB.Net / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\vb\VS2022\netframework\20.Reports\95b.User Defined Formats and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​vb/​VS2022/​netframework/​Modules/​20.​Reports/​95b.​User Defined Formats

Overview

User defined formats are a way to format cells in a report with code. Normally you will want to use them if the data to format the cells is in the database and it is not known at compile time, so you can't use conditional formatting or formats defined in the config sheet.

Concepts

  • How to define and use a user defined format.

  • You can pass parameters to the user defined format by writing them after the format name. In this example we show passing one parameter (in user format "ZipCode") and two parameters (in user format "ShipFormat").

  • If you don't want to modify the format then return a null TFlxFormat and a null TFlxApplyFormat. We do this in the ZipCode user format, when the zip code is not numeric. If you wanted to return a format but not apply, you could set only the TFlxApplyFormat to null and the full TFlxFormat would be applied.

  • As you can see, the colors in this demo don't make much sense. There is a reason for that: trying to find an example of stuff that can only be made with user defined formats is not easy. If you wanted for example to mark red the cells where a value is > 100, then you would just use an Excel conditional format instead. The recommended order of preference would be:

    1. If you can do it with Excel conditional formats, then use that.

    2. If you can't use conditional formats then use formats defined in the config sheet

    3. For more complex formats where you can't use any of the above (like for example if the color of the cell is stored in the database, or the rules are too complex to code them in a conditional format or the config sheet), then use user defined formats.

  • You can use user defined formats to format rows, columns or cells. As format cell has more priority than format row, in this example there are cells which override the row format.

Files

AssemblyInfo.vb

Imports System.Reflection
Imports System.Runtime.CompilerServices

'
' General Information about an assembly is controlled through the following
' set of attributes. Change these attribute values to modify the information
' associated with an assembly.
'
<Assembly: AssemblyTitle("")>
<Assembly: AssemblyDescription("")>
<Assembly: AssemblyConfiguration("")>
<Assembly: AssemblyCompany("")>
<Assembly: AssemblyProduct("")>
<Assembly: AssemblyCopyright("(c) 2002 - 2014 TMS Software")>
<Assembly: AssemblyTrademark("")>
<Assembly: AssemblyCulture("")>

'
' Version information for an assembly consists of the following four values:
'
'      Major Version
'      Minor Version
'      Build Number
'      Revision
'
' You can specify all the values or you can default the Revision and Build Numbers
' by using the '*' as shown below:

<Assembly: AssemblyVersion("6.2.1.0")>

'
' In order to sign your assembly you must specify a key to use. Refer to the
' Microsoft .NET Framework documentation for more information on assembly signing.
'
' Use the attributes below to control which key is used for signing.
'
' Notes:
'   (*) If no key is specified, the assembly is not signed.
'   (*) KeyName refers to a key that has been installed in the Crypto Service
'       Provider (CSP) on your machine. KeyFile refers to a file which contains
'       a key.
'   (*) If the KeyFile and the KeyName values are both specified, the
'       following processing occurs:
'       (1) If the KeyName can be found in the CSP, that key is used.
'       (2) If the KeyName does not exist and the KeyFile does exist, the key
'           in the KeyFile is installed into the CSP and used.
'   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
'       When specifying the KeyFile, the location of the KeyFile should be
'       relative to the project output directory which is
'       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
'       located in the project directory, you would specify the AssemblyKeyFile
'       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
'   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
'       documentation for more information on this.
'
<Assembly: AssemblyDelaySign(False)>
<Assembly: AssemblyKeyFile("")>
<Assembly: AssemblyKeyName("")>

Form1.Designer.vb

Imports System.Collections
Imports System.ComponentModel
Imports System.IO
Imports System.Reflection
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports FlexCel.Report
Imports FlexCel.Demo.SharedData
Namespace UserDefinedFormats
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        ''' <summary>
        ''' Required designer variable.
        ''' </summary>
        Private components As System.ComponentModel.Container = Nothing

        ''' <summary>
        ''' Clean up any resources being used.
        ''' </summary>
        Protected Overrides Sub Dispose(ByVal disposing As Boolean)
            If disposing Then
                If components IsNot Nothing Then
                    components.Dispose()
                End If
            End If
            MyBase.Dispose(disposing)
        End Sub

        #Region "Windows Form Designer generated code"
        ''' <summary>
        ''' Required method for Designer support - do not modify
        ''' the contents of this method with the code editor.
        ''' </summary>
        Private Sub InitializeComponent()
            Me.button1 = New System.Windows.Forms.Button()
            Me.saveFileDialog1 = New System.Windows.Forms.SaveFileDialog()
            Me.label1 = New System.Windows.Forms.Label()
            Me.btnCancel = New System.Windows.Forms.Button()
            Me.SuspendLayout()
            '
            ' button1
            '
            Me.button1.Anchor = (CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.button1.BackColor = System.Drawing.Color.Green
            Me.button1.ForeColor = System.Drawing.Color.White
            Me.button1.Location = New System.Drawing.Point(152, 88)
            Me.button1.Name = "button1"
            Me.button1.Size = New System.Drawing.Size(112, 23)
            Me.button1.TabIndex = 0
            Me.button1.Text = "GO!"
            Me.button1.UseVisualStyleBackColor = False
'           Me.button1.Click += New System.EventHandler(Me.button1_Click)
            '
            ' saveFileDialog1
            '
            Me.saveFileDialog1.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm|Excel 97/2003|*.xls|Excel 2007|*.xlsx;*.xlsm|All files|*.*"
            Me.saveFileDialog1.RestoreDirectory = True
            '
            ' label1
            '
            Me.label1.Location = New System.Drawing.Point(24, 24)
            Me.label1.Name = "label1"
            Me.label1.Size = New System.Drawing.Size(288, 24)
            Me.label1.TabIndex = 2
            Me.label1.Text = "A report using an user defined format."
            '
            ' btnCancel
            '
            Me.btnCancel.Anchor = (CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.btnCancel.BackColor = System.Drawing.Color.FromArgb((CInt((CByte(192)))), (CInt((CByte(0)))), (CInt((CByte(0)))))
            Me.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel
            Me.btnCancel.ForeColor = System.Drawing.Color.White
            Me.btnCancel.Location = New System.Drawing.Point(272, 88)
            Me.btnCancel.Name = "btnCancel"
            Me.btnCancel.Size = New System.Drawing.Size(112, 23)
            Me.btnCancel.TabIndex = 3
            Me.btnCancel.Text = "Cancel"
            Me.btnCancel.UseVisualStyleBackColor = False
'           Me.btnCancel.Click += New System.EventHandler(Me.btnCancel_Click)
            '
            ' mainForm
            '
            Me.AutoScaleDimensions = New System.Drawing.SizeF(6F, 13F)
            Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
            Me.ClientSize = New System.Drawing.Size(416, 133)
            Me.Controls.Add(Me.btnCancel)
            Me.Controls.Add(Me.label1)
            Me.Controls.Add(Me.button1)
            Me.Name = "mainForm"
            Me.Text = "User defined formats"
            Me.ResumeLayout(False)

        End Sub
        #End Region

        Private WithEvents button1 As System.Windows.Forms.Button
        Private saveFileDialog1 As System.Windows.Forms.SaveFileDialog
        Private label1 As System.Windows.Forms.Label
        Private WithEvents btnCancel As System.Windows.Forms.Button
    End Class
End Namespace

Form1.vb

Imports System.Collections
Imports System.ComponentModel
Imports System.IO
Imports System.Reflection
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports FlexCel.Report
Imports FlexCel.Demo.SharedData

Namespace UserDefinedFormats
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Public Sub New()
            InitializeComponent()
        End Sub

        Private Sub button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button1.Click
            AutoRun()
        End Sub

        Public Sub AutoRun()
            Using ordersReport As FlexCelReport = SharedData.CreateReport()
                ordersReport.SetValue("Date", Date.Now)
                ordersReport.SetUserFormat("ZipCode", New ZipCodeImp())
                ordersReport.SetUserFormat("ShipFormat", New ShipFormatImp())

                Dim DataPath As String = Path.Combine(Path.Combine(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), ".."), "..") & Path.DirectorySeparatorChar

                If saveFileDialog1.ShowDialog() = System.Windows.Forms.DialogResult.OK Then
                    ordersReport.Run(DataPath & "User Defined Formats.template.xlsx", saveFileDialog1.FileName)

                    If MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) = System.Windows.Forms.DialogResult.Yes Then
                        Process.Start(saveFileDialog1.FileName)
                    End If
                End If
            End Using
        End Sub

        Private Sub btnCancel_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnCancel.Click
            Close()
        End Sub

    End Class

    #Region "ZipCode Implementation"
    Friend Class ZipCodeImp
        Inherits TFlexCelUserFormat

        Public Sub New()
        End Sub

        Public Overrides Function Evaluate(ByVal workbook As ExcelFile, ByVal rangeToFormat As TXlsCellRange, ByVal parameters() As Object) As TFlxPartialFormat
            If parameters Is Nothing OrElse parameters.Length <> 1 Then
                Throw New ArgumentException("Bad parameter count in call to ZipCode() user-defined format")
            End If

            Dim color As Integer
            'If the zip code is not valid, don't modify the format.
            If parameters(0) Is Nothing OrElse (Not Integer.TryParse(Convert.ToString(parameters(0)), color)) Then
                Return New TFlxPartialFormat(Nothing, Nothing, False)
            End If

            'This code is not supposed to make sense. We will convert the zip code to a color based in the numeric value.
            Dim fmt As TFlxFormat = workbook.GetDefaultFormat
            fmt.FillPattern.Pattern = TFlxPatternStyle.Solid
            fmt.FillPattern.FgColor = TExcelColor.FromArgb(color)
            fmt.FillPattern.BgColor = TExcelColor.Automatic

            fmt.Font.Color = TExcelColor.FromArgb((Not color))

            Dim apply As New TFlxApplyFormat()
            apply.FillPattern.SetAllMembers(True)
            apply.Font.Color = True
            Return New TFlxPartialFormat(fmt, apply, False)
        End Function
    End Class
    #End Region

    #Region "ShipFormat Implementation"
    Friend Class ShipFormatImp
        Inherits TFlexCelUserFormat

        Public Sub New()
        End Sub

        Public Overrides Function Evaluate(ByVal workbook As ExcelFile, ByVal rangeToFormat As TXlsCellRange, ByVal parameters() As Object) As TFlxPartialFormat
            'Again, this example is not supposed to make sense, only to show how you can code a complex rule.
            'This method will format the rows with a color that depends in the length of the first parameter,
            'and if the second parameter starts with "B" it will make the text red.

            If parameters Is Nothing OrElse parameters.Length <> 2 Then
                Throw New ArgumentException("Bad parameter count in call to ShipFormat() user-defined format")
            End If

            Dim len As Integer = Convert.ToString(parameters(0)).Length
            Dim country As String = Convert.ToString(parameters(1))

            Dim color As Int32 = &HFFFFFF - len * 100
            Dim fmt As TFlxFormat = workbook.GetDefaultFormat
            fmt.FillPattern.Pattern = TFlxPatternStyle.Solid
            fmt.FillPattern.FgColor = TExcelColor.FromArgb(color)
            fmt.FillPattern.BgColor = TExcelColor.Automatic

            Dim apply As New TFlxApplyFormat()
            apply.FillPattern.SetAllMembers(True)

            If country.StartsWith("B") Then
                fmt.Font.Color = Colors.OrangeRed
                apply.Font.Color = True
            End If

            Return New TFlxPartialFormat(fmt, apply, False)
        End Function
    End Class
    #End Region

End Namespace

Program.vb

Namespace UserDefinedFormats
    Friend NotInheritable Class Program

        Private Sub New()
        End Sub

        ''' <summary>
        ''' The main entry point for the application.
        ''' </summary>
       <STAThread> _
        Shared Sub Main()
            Application.EnableVisualStyles()
            Application.SetCompatibleTextRenderingDefault(False)
            Application.Run(New mainForm())
        End Sub
    End Class
End Namespace


Virtual datasets (VB.Net / netframework) | FlexCel Studio for the .NET Framework documentation

Virtual datasets (VB.Net / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\vb\VS2022\netframework\20.Reports\96.Virtual Datasets and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​vb/​VS2022/​netframework/​Modules/​20.​Reports/​96.​Virtual Datasets

Overview

Normally FlexCelReport uses DataTables for its data. On reporting we can see DataTables as "overcharged" arrays, with added functionality like filtering or sorting. They are also really powerful and fast, so using them is normally the best option. But in some cases you might have very large bussiness objects and would like to use them directly without copying them first into a DataTable. On those cases, you can create your own VirtualDataset and VirtualDatasetState descendants to do this task.

This is an advanced topic. Remember to read the [Appendix: Virtual DataSets on](~/guides/reports-developer-guide.md#appendix:-virtual-datasets -on) the Reports developer guide.

Concepts

  • How to create a VirtualDataset descendant to encapsulate an arbitrary object and make a report with it. Two descendants are shown, one very simple with the minimum functionality needed, and other that fully implements all the features.

  • As you can see on the ComplexVirtualArrayDataSource example, to provide all the functionality you do not need to override too many methods. But you should implement very efficient methods. If you do not, probably the performance dumping everything to a DataSet would be faster.

  • How to create "infographics". this is based on the article: http://www.juiceanalytics.com/weblog/?p=236

Files

AssemblyInfo.vb

Imports System.Reflection
Imports System.Runtime.CompilerServices

'
' General Information about an assembly is controlled through the following
' set of attributes. Change these attribute values to modify the information
' associated with an assembly.
'
<Assembly: AssemblyTitle("")>
<Assembly: AssemblyDescription("")>
<Assembly: AssemblyConfiguration("")>
<Assembly: AssemblyCompany("")>
<Assembly: AssemblyProduct("")>
<Assembly: AssemblyCopyright("(c) 2002 - 2014 TMS Software")>
<Assembly: AssemblyTrademark("")>
<Assembly: AssemblyCulture("")>

'
' Version information for an assembly consists of the following four values:
'
'      Major Version
'      Minor Version
'      Build Number
'      Revision
'
' You can specify all the values or you can default the Revision and Build Numbers
' by using the '*' as shown below:

<Assembly: AssemblyVersion("6.2.1.0")>

'
' In order to sign your assembly you must specify a key to use. Refer to the
' Microsoft .NET Framework documentation for more information on assembly signing.
'
' Use the attributes below to control which key is used for signing.
'
' Notes:
'   (*) If no key is specified, the assembly is not signed.
'   (*) KeyName refers to a key that has been installed in the Crypto Service
'       Provider (CSP) on your machine. KeyFile refers to a file which contains
'       a key.
'   (*) If the KeyFile and the KeyName values are both specified, the
'       following processing occurs:
'       (1) If the KeyName can be found in the CSP, that key is used.
'       (2) If the KeyName does not exist and the KeyFile does exist, the key
'           in the KeyFile is installed into the CSP and used.
'   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
'       When specifying the KeyFile, the location of the KeyFile should be
'       relative to the project output directory which is
'       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
'       located in the project directory, you would specify the AssemblyKeyFile
'       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
'   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
'       documentation for more information on this.
'
<Assembly: AssemblyDelaySign(False)>
<Assembly: AssemblyKeyFile("")>
<Assembly: AssemblyKeyName("")>

ComplexVirtualArrayDataSource.vb

Imports System.Globalization

Imports FlexCel.Report
Imports System.Collections

Namespace VirtualDatasets
    ''' <summary>
    ''' This class implements the complete functionality needed to run a FlexCelReport from an array of objects.
    ''' Sorting/Filtering on the config sheet is allowed for this datasource, but they are not implemented on an efficient way.
    ''' If you do not have an efficient way to do those things (using indexes) and you plan to do them, you will probably get better performance
    ''' using Datasets.
    ''' </summary>
    Public Class ComplexVirtualArrayDataSource
        Inherits VirtualDataTable

        #Region "Private variables"
        Private FData()() As Object
        Private FColumnCaptions() As String
        #End Region

        #Region "Constructors"
        Public Sub New(ByVal aCreatedBy As VirtualDataTable, ByVal aData()() As Object, ByVal aColumnCaptions() As String, ByVal aTableName As String)
            MyBase.New(aTableName, aCreatedBy)
            FData = aData
            FColumnCaptions = aColumnCaptions
        End Sub
        #End Region

        #Region "Columns"
        Public Overrides ReadOnly Property ColumnCount() As Integer
            Get
                Return FColumnCaptions.Length
            End Get
        End Property

        Public Overrides Function GetColumn(ByVal columnName As String) As Integer
            'not very optimized method, but this is just a demo.
            If columnName Is Nothing Then
                Return -1
            End If
            columnName = columnName.Trim()
            For i As Integer = 0 To FColumnCaptions.Length - 1
                If String.Compare(FColumnCaptions(i), columnName, True) = 0 Then
                    Return i
                End If
            Next i
            Return -1
        End Function

        Public Overrides Function GetColumnName(ByVal columnIndex As Integer) As String
            Return FColumnCaptions(columnIndex)
        End Function

        Public Overrides Function GetColumnCaption(ByVal columnIndex As Integer) As String
            Return FColumnCaptions(columnIndex)
        End Function

        #End Region

        #Region "Settings"
        Public Overrides ReadOnly Property Locale() As System.Globalization.CultureInfo
            Get
                Return CultureInfo.CurrentCulture
            End Get
        End Property
        #End Region

        #Region "Create State"
        Public Overrides Function CreateState(ByVal sort As String, ByVal masterDetailLinks() As TMasterDetailLink, ByVal splitLink As TSplitLink) As VirtualDataTableState
            Return New ComplexVirtualArrayDataSourceState(Me, sort, masterDetailLinks, splitLink)
        End Function

        #End Region

        #Region "Data"
        Public ReadOnly Property Data() As Object()()
            Get
                Return FData
            End Get
        End Property

        Public Overrides Function FilterData(ByVal newDataName As String, ByVal rowFilter As String) As VirtualDataTable
            If rowFilter Is Nothing OrElse rowFilter.Length = 0 Then
                Return New ComplexVirtualArrayDataSource(Me, FData, FColumnCaptions, newDataName) 'no need to copy the data since it is invariant.
            End If

            Dim Relationship As RelationshipType = RelationshipType.Equals
            'on this demo we will only support filters of the type: "field = value", "field > value" or "field < value"
            Dim filteredData() As String = rowFilter.Split("="c)
            If filteredData Is Nothing OrElse filteredData.Length <> 2 Then
                filteredData = rowFilter.Split("<"c)
                If filteredData Is Nothing OrElse filteredData.Length <> 2 Then
                    filteredData = rowFilter.Split(">"c)
                    If filteredData Is Nothing OrElse filteredData.Length <> 2 Then
                        Throw New Exception("Filter """ & rowFilter & """ is invalid. The dataset """ & TableName & """ only supports filters of the type ""field =/>/< value"".")
                    Else
                        Relationship = RelationshipType.BiggerThan
                    End If
                Else
                    Relationship = RelationshipType.LessThan
                End If

            End If

            Dim ColIndex As Integer = GetColumn(filteredData(0).Trim())
            If ColIndex < 0 Then
                Throw New Exception("Filter """ & rowFilter & """ is invalid. Can not find column """ & filteredData(0).Trim() & """")
            End If

            'Remember, this is only a demo to show what to do in this event. This code is not good code to use on
            'a real application!. You should use some index here to find the data or this would crawl on large objects.

            Dim Result As New List(Of Object())()
            Dim SearchValue As String = filteredData(1).Trim()
            Dim Searchfloat As Double = 0
            If Relationship <> RelationshipType.Equals Then 'when relationship is not equals, we will assume columns are numbers. This is because we do not have any type definition for our columns on this simple example.
                Searchfloat = Convert.ToDouble(filteredData(1).Trim())
            End If

            For Each Row As Object() In Data
                Select Case Relationship
                    Case RelationshipType.Equals
                        If Convert.ToString(Row(ColIndex)) = SearchValue Then
                            Result.Add(Row) 'remember, data is invariant, so we do not need to clone Row.
                        End If
                    Case RelationshipType.LessThan
                        If Convert.ToDouble(Row(ColIndex)) < Searchfloat Then
                            Result.Add(Row) 'remember, data is invariant, so we do not need to clone Row.
                        End If
                    Case RelationshipType.BiggerThan
                        If Convert.ToDouble(Row(ColIndex)) > Searchfloat Then
                            Result.Add(Row) 'remember, data is invariant, so we do not need to clone Row.
                        End If
                End Select
            Next Row

            Return New ComplexVirtualArrayDataSource(Me, Result.ToArray(), FColumnCaptions, newDataName)

        End Function

        Public Overrides Function GetDistinct(ByVal newDataName As String, ByVal filterFields() As Integer) As VirtualDataTable
            If filterFields Is Nothing OrElse filterFields.Length = 0 Then
                Return New ComplexVirtualArrayDataSource(Me, FData, FColumnCaptions, newDataName) 'no need to copy the data since it is invariant.
            End If

            Dim Result As New Dictionary(Of Object() , Object())()
            Dim Keys(filterFields.Length - 1) As Object
            For Each Row As Object() In FData
                For i As Integer = 0 To filterFields.Length - 1
                    Keys(i) = Row(filterFields(i))
                Next i
                Result(Keys) = Keys
            Next Row

            Dim R(Data.Length - 1)() As Object
            Result.Keys.CopyTo(R, 0)

            Dim NewColumnCaptions(filterFields.Length - 1) As String
            For i As Integer = 0 To filterFields.Length - 1
                NewColumnCaptions(i) = FColumnCaptions(filterFields(i))
            Next i
            Return New ComplexVirtualArrayDataSource(Me, R, NewColumnCaptions, newDataName)

        End Function

        #End Region

    End Class

    Public Class ComplexVirtualArrayDataSourceState
        Inherits VirtualDataTableState

        #Region "Privates"
        Private SortedData()() As Object
        Private FilteredData As List(Of Object())
        #End Region

        #Region "Constructors"
        Public Sub New(ByVal aTableData As ComplexVirtualArrayDataSource, ByVal sort As String, ByVal masterDetailLinks() As TMasterDetailLink, ByVal splitLink As TSplitLink)
            MyBase.New(aTableData)
            If sort Is Nothing OrElse sort.Trim().Length = 0 Then
                SortedData = aTableData.Data 'no need to clone, this is invariant.
            Else
                SortedData = CType(aTableData.Data.Clone(), Object()())
                Dim sortcolumn As Integer = aTableData.GetColumn(sort)
                If sortcolumn < 0 Then
                    Throw New Exception("Can not find column """ & sort & """ in dataset """ & TableName)
                End If
                Array.Sort(SortedData, New ArrayComparer(sortcolumn))
            End If

            'here we should use the data in masterdetaillinks and splitlink to create indexes to make the FilteredrowCount and MoveMasterRecord methods faster.
            'on this demo we are not going to do it.
            If (masterDetailLinks IsNot Nothing AndAlso masterDetailLinks.Length > 0) OrElse splitLink IsNot Nothing Then
                FilteredData = New List(Of Object())()
            End If
        End Sub
        #End Region

        #Region "Data"
        Private ReadOnly Property Data() As Object()()
            Get
                Return CType(TableData, SimpleVirtualArrayDataSource).Data
            End Get
        End Property

        ''' <summary>
        ''' Remember that this method should be fast!
        ''' </summary>
        Public Overrides ReadOnly Property RowCount() As Integer
            Get
                If FilteredData Is Nothing Then
                    Return SortedData.Length
                End If
                Return FilteredData.Count
            End Get
        End Property

        Public Overrides Function GetValue(ByVal column As Integer) As Object
            If FilteredData Is Nothing Then
                Return SortedData(Position)(column)
            End If
            Return CType(FilteredData(Position), Object())(column)
        End Function

        Public Overrides Function GetValue(ByVal row As Integer, ByVal column As Integer) As Object
            If FilteredData Is Nothing Then
                Return SortedData(row)(column)
            End If
            Return CType(FilteredData(row), Object())(column)
        End Function
        #End Region

        #Region "Move"
        Public Overrides Sub MoveFirst()
            'No need to do anything in an array, since "Position" is moved for us.
            'If we had an IEnumerator for example as data backend, we would reset it here.
        End Sub

        Public Overrides Sub MoveNext()
            'No need to do anything in an array, since "Position" is moved for us.
            'If we had an IEnumerator for example as data backend, we would move it here.
        End Sub

        #End Region

        #Region "Relationships"
        Public Overrides Sub MoveMasterRecord(ByVal masterDetailLinks() As TMasterDetailLink, ByVal splitLink As TSplitLink)
            'Here we need to modify FilteredData to contain only those records on FilteredData that are visible on this state.
            'If we created indexes on this method constructor's, this can be done fast.

            'on this example, as always, we will use a very slow method. The idea of this demo is not to demostrate how to do efficient code
            ' (you probably have efficient methods on the bussines objects you are wrapping), but how to override the methods.

            If FilteredData Is Nothing Then 'this dataset is not on master-detail relationship and does not have any split relationship either.
                Return
            End If

            FilteredData.Clear()
            Dim ChildColumn(masterDetailLinks.Length - 1) As Integer
            For i As Integer = 0 To masterDetailLinks.Length - 1
                ChildColumn(i) = TableData.GetColumn(masterDetailLinks(i).ChildFieldName)
            Next i

            Dim SplitPos As Integer = 0
            Dim StartRow As Integer = 0
            If splitLink IsNot Nothing Then
                StartRow = splitLink.SplitCount * splitLink.ParentDataSource.Position
            End If

            For r As Integer = 0 To SortedData.Length - 1
                Dim Row() As Object = SortedData(r)
                Dim RowApplies As Boolean = True
                For i As Integer = 0 To masterDetailLinks.Length - 1
                    Dim key As Object = masterDetailLinks(i).ParentDataSource.GetValue(masterDetailLinks(i).ParentField)
                    If Convert.ToString(Row(ChildColumn(i))) <> Convert.ToString(key) Then
                        RowApplies = False
                        Exit For
                    End If
                Next i

                If Not RowApplies Then 'the row does not fit this master detail relationship.
                    Continue For
                End If

                SplitPos += 1
                If SplitPos <= StartRow Then 'we are not filling the correct split slot.
                    Continue For
                End If

                FilteredData.Add(Row)
                If splitLink IsNot Nothing AndAlso FilteredData.Count >= splitLink.SplitCount Then
                    Return
                End If
            Next r

        End Sub

        Public Overrides Function FilteredRowCount(ByVal masterDetailLinks() As TMasterDetailLink) As Integer
            Dim Result As Integer = 0

            Dim ChildColumn(masterDetailLinks.Length - 1) As Integer
            For i As Integer = 0 To masterDetailLinks.Length - 1
                ChildColumn(i) = TableData.GetColumn(masterDetailLinks(i).ChildFieldName)
            Next i

            For r As Integer = 0 To SortedData.Length - 1
                Dim Row() As Object = SortedData(r)
                Dim RowApplies As Boolean = True
                For i As Integer = 0 To masterDetailLinks.Length - 1
                    Dim key As Object = masterDetailLinks(i).ParentDataSource.GetValue(masterDetailLinks(i).ParentField)
                    If Convert.ToString(Row(ChildColumn(i))) <> Convert.ToString(key) Then
                        RowApplies = False
                        Exit For
                    End If
                Next i

                If Not RowApplies Then 'the row does not fit this master detail relationship.
                    Continue For
                End If

                Result += 1
            Next r

            Return Result

        End Function

        #End Region

    End Class

    Friend Enum RelationshipType
        Equals
        LessThan
        BiggerThan
    End Enum

    Public Class ArrayComparer
        Implements IComparer(Of Object())

        Private Column As Integer
        Private Shared Comparer As New CaseInsensitiveComparer()

        Public Sub New(ByVal aColumn As Integer)
            Column = aColumn
        End Sub

        Private Function IComparerGeneric_Compare(ByVal x() As Object, ByVal y() As Object) As Integer Implements IComparer(Of Object()).Compare
            Return (Comparer.Compare(x(Column), y(Column)))
        End Function

    End Class

End Namespace

Form1.Designer.vb

Imports System.Collections
Imports System.ComponentModel
Imports System.IO
Imports System.Reflection
Imports System.Resources
Imports System.Globalization
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports FlexCel.Report
Namespace VirtualDatasets
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Private WithEvents button1 As System.Windows.Forms.Button
        Private saveFileDialog1 As System.Windows.Forms.SaveFileDialog
        Private label1 As System.Windows.Forms.Label
        Private WithEvents btnCancel As System.Windows.Forms.Button
        ''' <summary>
        ''' Required designer variable.
        ''' </summary>
        Private components As System.ComponentModel.Container = Nothing

        ''' <summary>
        ''' Clean up any resources being used.
        ''' </summary>
        Protected Overrides Sub Dispose(ByVal disposing As Boolean)
            If disposing Then
                If components IsNot Nothing Then
                    components.Dispose()
                End If
            End If
            MyBase.Dispose(disposing)
        End Sub

        #Region "Windows Form Designer generated code"
        ''' <summary>
        ''' Required method for Designer support - do not modify
        ''' the contents of this method with the code editor.
        ''' </summary>
        Private Sub InitializeComponent()
            Me.button1 = New System.Windows.Forms.Button()
            Me.saveFileDialog1 = New System.Windows.Forms.SaveFileDialog()
            Me.label1 = New System.Windows.Forms.Label()
            Me.btnCancel = New System.Windows.Forms.Button()
            Me.SuspendLayout()
            '
            ' button1
            '
            Me.button1.Anchor = (CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.button1.BackColor = System.Drawing.Color.Green
            Me.button1.ForeColor = System.Drawing.Color.White
            Me.button1.Location = New System.Drawing.Point(96, 80)
            Me.button1.Name = "button1"
            Me.button1.Size = New System.Drawing.Size(112, 23)
            Me.button1.TabIndex = 0
            Me.button1.Text = "GO!"
            Me.button1.UseVisualStyleBackColor = False
'           Me.button1.Click += New System.EventHandler(Me.button1_Click)
            '
            ' saveFileDialog1
            '
            Me.saveFileDialog1.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm|Excel 97/2003|*.xls|Excel 2007|*.xlsx;*.xlsm|All files|*.*"
            Me.saveFileDialog1.RestoreDirectory = True
            '
            ' label1
            '
            Me.label1.Location = New System.Drawing.Point(24, 24)
            Me.label1.Name = "label1"
            Me.label1.Size = New System.Drawing.Size(288, 24)
            Me.label1.TabIndex = 2
            Me.label1.Text = "A demo on how to use arbitrary objects on a report. "
            '
            ' btnCancel
            '
            Me.btnCancel.Anchor = (CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.btnCancel.BackColor = System.Drawing.Color.FromArgb((CInt((CByte(192)))), (CInt((CByte(0)))), (CInt((CByte(0)))))
            Me.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel
            Me.btnCancel.ForeColor = System.Drawing.Color.White
            Me.btnCancel.Location = New System.Drawing.Point(216, 80)
            Me.btnCancel.Name = "btnCancel"
            Me.btnCancel.Size = New System.Drawing.Size(112, 23)
            Me.btnCancel.TabIndex = 3
            Me.btnCancel.Text = "Cancel"
            Me.btnCancel.UseVisualStyleBackColor = False
'           Me.btnCancel.Click += New System.EventHandler(Me.btnCancel_Click)
            '
            ' mainForm
            '
            Me.AutoScaleDimensions = New System.Drawing.SizeF(6F, 13F)
            Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
            Me.ClientSize = New System.Drawing.Size(360, 130)
            Me.Controls.Add(Me.btnCancel)
            Me.Controls.Add(Me.label1)
            Me.Controls.Add(Me.button1)
            Me.Name = "mainForm"
            Me.Text = "Virtual Datasets"
            Me.ResumeLayout(False)

        End Sub
        #End Region
    End Class
End Namespace

Form1.vb

Imports System.Collections
Imports System.ComponentModel
Imports System.IO
Imports System.Reflection
Imports System.Resources
Imports System.Globalization
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports FlexCel.Report

Namespace VirtualDatasets
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Public Sub New()
            InitializeComponent()
        End Sub

        Private Sub button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button1.Click
            AutoRun()
        End Sub

        Public Sub AutoRun()
            Dim DataPath As String = Path.Combine(Path.Combine(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), ".."), "..") & Path.DirectorySeparatorChar

            If saveFileDialog1.ShowDialog() = System.Windows.Forms.DialogResult.OK Then
                Dim SimpleData()() As Object = LoadDataSet(Path.Combine(DataPath, "Countries.txt"))
                Dim SimpleTable As New SimpleVirtualArrayDataSource(Nothing, SimpleData, New String() { "Rank", "Country", "Area", "Date" }, "SimpleTable")

                Using genericReport As New FlexCelReport(True)
                    genericReport.AddTable("SimpleData", SimpleTable)

                    Dim Complex1()() As Object = LoadDataSet(Path.Combine(DataPath, "Countries.txt"))
                    Dim ComplexAreas As New ComplexVirtualArrayDataSource(Nothing, Complex1, New String() { "Rank", "Country", "Area", "Date" }, "ComplexAreas")
                    Dim Complex2()() As Object = LoadDataSet(Path.Combine(DataPath, "Populations.txt"))
                    Dim ComplexPopulations As New ComplexVirtualArrayDataSource(Nothing, Complex2, New String() { "Rank", "Country", "Population", "Date" }, "ComplexPopulations")

                    genericReport.AddTable("ComplexAreas", ComplexAreas, TDisposeMode.DisposeAfterRun)
                    genericReport.AddTable("ComplexPopulations", ComplexPopulations, TDisposeMode.DisposeAfterRun)

                    genericReport.Run(Path.Combine(DataPath, "Virtual Datasets.template.xls"), saveFileDialog1.FileName)
                End Using

                If MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) = System.Windows.Forms.DialogResult.Yes Then
                    Process.Start(saveFileDialog1.FileName)
                End If
            End If
        End Sub

        Private Sub btnCancel_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnCancel.Click
            Close()
        End Sub

        Private Function LoadDataSet(ByVal filename As String) As Object()()
            'Let's create some bussiness object with random data.

            Dim Result As New ArrayList()
            Using sr As New StreamReader(Path.GetFullPath(filename))
                Dim line As String
                line = sr.ReadLine()
                Do While line IsNot Nothing
                    Dim fields() As String = line.Split(ControlChars.Tab)
                    'Zero validation here since this is a demo and will use always the same data. On a real app you should not expect your data to play nice
                    Dim f(fields.Length - 1) As Object
                    Dim s As String = TryCast(fields(0), String)
                    f(0) = Convert.ToInt64(s)
                    f(1) = fields(1)
                    s = TryCast(fields(2), String)
                    f(2) = CObj(Convert.ToInt64(s.Replace(",", "")))
                    f(3) = fields(3)
                    Result.Add(f)
                    line = sr.ReadLine()
                Loop
            End Using

            Return CType(Result.ToArray(GetType(Object())), Object()())
        End Function
    End Class

End Namespace

Program.vb

Namespace VirtualDatasets
    Friend NotInheritable Class Program

        Private Sub New()
        End Sub

        ''' <summary>
        ''' The main entry point for the application.
        ''' </summary>
       <STAThread> _
        Shared Sub Main()
            Application.EnableVisualStyles()
            Application.SetCompatibleTextRenderingDefault(False)
            Application.Run(New mainForm())
        End Sub
    End Class
End Namespace

SimpleVirtualArrayDataSource.vb

Imports System.Globalization

Imports FlexCel.Report

Namespace VirtualDatasets
    ''' <summary>
    ''' This class implements the minimum functionality needed to run a FlexCelReport from an array of objects.
    ''' No Sorting/Filtering on the config sheet is allowed for this datasource, and you can not use it on master detail relationships.
    ''' </summary>
    Public Class SimpleVirtualArrayDataSource
        Inherits VirtualDataTable

        #Region "Private variables"
        Private FData()() As Object
        Private FColumnCaptions() As String
        #End Region

        #Region "Constructors"
        Public Sub New(ByVal aCreatedBy As VirtualDataTable, ByVal aData()() As Object, ByVal aColumnCaptions() As String, ByVal aTableName As String)
            MyBase.New(aTableName, aCreatedBy)
            FData = aData
            FColumnCaptions = aColumnCaptions
        End Sub
        #End Region

        #Region "Columns"
        Public Overrides ReadOnly Property ColumnCount() As Integer
            Get
                Return FColumnCaptions.Length
            End Get
        End Property

        Public Overrides Function GetColumn(ByVal columnName As String) As Integer
            'not very optimized method, but this is just a demo.
            If columnName Is Nothing Then
                Return -1
            End If
            columnName = columnName.Trim()
            For i As Integer = 0 To FColumnCaptions.Length - 1
                If String.Compare(FColumnCaptions(i), columnName, True) = 0 Then
                    Return i
                End If
            Next i
            Return -1
        End Function

        Public Overrides Function GetColumnName(ByVal columnIndex As Integer) As String
            Return FColumnCaptions(columnIndex)
        End Function

        Public Overrides Function GetColumnCaption(ByVal columnIndex As Integer) As String
            Return FColumnCaptions(columnIndex)
        End Function

        #End Region

        #Region "Settings"
        Public Overrides ReadOnly Property Locale() As System.Globalization.CultureInfo
            Get
                Return CultureInfo.CurrentCulture
            End Get
        End Property
        #End Region

        #Region "Create State"
        Public Overrides Function CreateState(ByVal sort As String, ByVal masterDetailLinks() As TMasterDetailLink, ByVal splitLink As TSplitLink) As VirtualDataTableState
            Return New SimpleVirtualArrayDataSourceState(Me)
        End Function

        #End Region

        #Region "Data"
        Public ReadOnly Property Data() As Object()()
            Get
                Return FData
            End Get
        End Property
        #End Region

        #Region "Filter"
        ''' <summary>
        ''' Even when we don't implement filter, we need to return a new instance when rowFilter is null.
        ''' </summary>
        ''' <param name="newDataName"></param>
        ''' <param name="rowFilter"></param>
        ''' <returns></returns>
        Public Overrides Function FilterData(ByVal newDataName As String, ByVal rowFilter As String) As VirtualDataTable
            If String.IsNullOrEmpty(rowFilter) Then
                Return New SimpleVirtualArrayDataSource(Me, Data, FColumnCaptions, TableName)
            End If
            Return MyBase.FilterData(newDataName, rowFilter)
        End Function
        #End Region

    End Class

    Public Class SimpleVirtualArrayDataSourceState
        Inherits VirtualDataTableState

        #Region "Constructors"
        Public Sub New(ByVal aTableData As SimpleVirtualArrayDataSource)
            MyBase.New(aTableData)
        End Sub
        #End Region

        #Region "Data"
        Private ReadOnly Property Data() As Object()()
            Get
                Return CType(TableData, SimpleVirtualArrayDataSource).Data
            End Get
        End Property

        ''' <summary>
        ''' Remember that this method should be fast!
        ''' </summary>
        Public Overrides ReadOnly Property RowCount() As Integer
            Get
                Return Data.Length
            End Get
        End Property

        Public Overrides Function GetValue(ByVal column As Integer) As Object
            Return Data(Position)(column)
        End Function

        Public Overrides Function GetValue(ByVal row As Integer, ByVal column As Integer) As Object
            Return Data(row)(column)
        End Function

        Public Overrides Sub MoveFirst()
            'No need to do anything in an array, since "Position" is moved for us.
            'If we had an IEnumerator for example as data backend, we would reset it here.
        End Sub

        Public Overrides Sub MoveNext()
            'No need to do anything in an array, since "Position" is moved for us.
            'If we had an IEnumerator for example as data backend, we would move it here.
        End Sub

        #End Region

    End Class

End Namespace


Encryption and subtotals (VB.Net / netframework) | FlexCel Studio for the .NET Framework documentation

Encryption and subtotals (VB.Net / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\vb\VS2022\netframework\20.Reports\98.Encryption And Subtotals and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​vb/​VS2022/​netframework/​Modules/​20.​Reports/​98.​Encryption And Subtotals

Overview

Two unrelated concepts are shown here. First, how to protect and encrypt a report. Second a frequently asked question: how to make a grand total out of sub totals.

Concepts

  • There are 4 ways to protect data in Excel:

    1. A password to open. This is the only way that will actually encrypt the file. All other methods just will add a record telling Excel not to modify the file. In Excel, this option is on ->Tools->Options... Security tab.

    2. A password to modify. Also on ->Tools->Options->Security tab, this password will allow you to open the file, but not to save it. The file will not be encrypted, and you can always use Save As to save the file.

    3. Protecting the workbook. This will cause a pseudo-encryption of the file, but the password used to encrypt will be always the same, no matter what password you enter. On Excel, this option is at ->Tools->Protection->Protect Workbook.

    4. Protecting the sheet. This option will protect the cells, objects, etc on a particular sheet. ->Tools->Protection->Protect Sheet.

  • When the file is encrypted (using a password to open) FlexCel supports four different encryption modes: Excel 95, Standard Excel97/2000 encryption, Excel 2007 xlsx encryption and Excel 2010 "agile" xlsx encryption.

  • To open an encrypted file, you can set the OpenPassword property or the OnPassword event. Use the OnPassword event when you want to interactively ask for a password *if* the file is encrypted.

  • Calculating a grand total. This is not related with encryption, but we used this example to show how it can be done. It is not really 100% FlexCel related either, but it is a frequently asked question. Imagine you have a master-detail report, with subtotals, and you want to calculate the sum of subtotals. You could do this on three ways:

    1. You could manually add a formula like "=Sum(A50, A60, A63...)" after the report is generated to calculate the sum of sub totals. Even when this sound like the natural approach, it is highly not recommended. Besides the effort needed to dynamically calculate the formula, formulas on Excel have a maximum of characters and you could end up on a formula too long message. Also, the sheet will become slow to calculate, and the formulas too complicated to follow. And you would be adding a lot of code to the report, that will not let the final user change the cells on the template.

    2. You can do it all on the template. By using different columns to hold different values and then merging the cells and hiding a column, you can get it to look as if it were done with way 1. But the formulas are much simpler here, and you do not need code to adapt them. This way is what we show here.

    3. There is a third option using the SubTotal Excel function. The SubTotal Excel function is unique in that it does not take other SubTotal() functions in account when doing its job. So you can have multiple SubTotal() functions in the same column, and they will not interfere with each other.

Files

AssemblyInfo.vb

Imports System.Reflection
Imports System.Runtime.CompilerServices

'
' General Information about an assembly is controlled through the following
' set of attributes. Change these attribute values to modify the information
' associated with an assembly.
'
<Assembly: AssemblyTitle("")>
<Assembly: AssemblyDescription("")>
<Assembly: AssemblyConfiguration("")>
<Assembly: AssemblyCompany("")>
<Assembly: AssemblyProduct("")>
<Assembly: AssemblyCopyright("(c) 2002 - 2014 TMS Software")>
<Assembly: AssemblyTrademark("")>
<Assembly: AssemblyCulture("")>

'
' Version information for an assembly consists of the following four values:
'
'      Major Version
'      Minor Version
'      Build Number
'      Revision
'
' You can specify all the values or you can default the Revision and Build Numbers
' by using the '*' as shown below:

<Assembly: AssemblyVersion("6.2.1.0")>

'
' In order to sign your assembly you must specify a key to use. Refer to the
' Microsoft .NET Framework documentation for more information on assembly signing.
'
' Use the attributes below to control which key is used for signing.
'
' Notes:
'   (*) If no key is specified, the assembly is not signed.
'   (*) KeyName refers to a key that has been installed in the Crypto Service
'       Provider (CSP) on your machine. KeyFile refers to a file which contains
'       a key.
'   (*) If the KeyFile and the KeyName values are both specified, the
'       following processing occurs:
'       (1) If the KeyName can be found in the CSP, that key is used.
'       (2) If the KeyName does not exist and the KeyFile does exist, the key
'           in the KeyFile is installed into the CSP and used.
'   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
'       When specifying the KeyFile, the location of the KeyFile should be
'       relative to the project output directory which is
'       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
'       located in the project directory, you would specify the AssemblyKeyFile
'       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
'   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
'       documentation for more information on this.
'
<Assembly: AssemblyDelaySign(False)>
<Assembly: AssemblyKeyFile("")>
<Assembly: AssemblyKeyName("")>

Form1.Designer.vb

Imports System.Collections
Imports System.ComponentModel
Imports System.IO
Imports System.Reflection
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports FlexCel.Report
Imports FlexCel.Demo.SharedData
Namespace EncryptionAndSubtotals
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Private WithEvents button1 As System.Windows.Forms.Button
        Private saveFileDialog1 As System.Windows.Forms.SaveFileDialog
        Private WithEvents btnCancel As System.Windows.Forms.Button
        Private panel1 As System.Windows.Forms.Panel
        Private label2 As System.Windows.Forms.Label
        Private OpenPassTemplate As System.Windows.Forms.TextBox
        Private label1 As System.Windows.Forms.Label
        Private panel2 As System.Windows.Forms.Panel
        Private label3 As System.Windows.Forms.Label
        Private OpenPassGenerated As System.Windows.Forms.TextBox
        Private label4 As System.Windows.Forms.Label
        Private label5 As System.Windows.Forms.Label
        Private ModifyPassGenerated As System.Windows.Forms.TextBox
        Private label6 As System.Windows.Forms.Label
        Private ProtectWorkbookPass As System.Windows.Forms.TextBox
        Private label7 As System.Windows.Forms.Label
        Private ProtectSheetPass As System.Windows.Forms.TextBox
        Private label8 As System.Windows.Forms.Label
        Private encryptionType As System.Windows.Forms.ComboBox
        Private label9 As System.Windows.Forms.Label
        Private ReservingUser As System.Windows.Forms.TextBox
        Private RecommendReadOnly As System.Windows.Forms.CheckBox
        Private ProtectWorkbook As System.Windows.Forms.CheckBox
        Private ProtectSheet As System.Windows.Forms.CheckBox
        ''' <summary>
        ''' Required designer variable.
        ''' </summary>
        Private components As System.ComponentModel.Container = Nothing

        ''' <summary>
        ''' Clean up any resources being used.
        ''' </summary>
        Protected Overrides Sub Dispose(ByVal disposing As Boolean)
            If disposing Then
                If components IsNot Nothing Then
                    components.Dispose()
                End If
            End If
            MyBase.Dispose(disposing)
        End Sub

        #Region "Windows Form Designer generated code"
        ''' <summary>
        ''' Required method for Designer support - do not modify
        ''' the contents of this method with the code editor.
        ''' </summary>
        Private Sub InitializeComponent()
            Me.button1 = New System.Windows.Forms.Button()
            Me.saveFileDialog1 = New System.Windows.Forms.SaveFileDialog()
            Me.btnCancel = New System.Windows.Forms.Button()
            Me.panel1 = New System.Windows.Forms.Panel()
            Me.label2 = New System.Windows.Forms.Label()
            Me.OpenPassTemplate = New System.Windows.Forms.TextBox()
            Me.label1 = New System.Windows.Forms.Label()
            Me.panel2 = New System.Windows.Forms.Panel()
            Me.ProtectSheet = New System.Windows.Forms.CheckBox()
            Me.ProtectWorkbook = New System.Windows.Forms.CheckBox()
            Me.RecommendReadOnly = New System.Windows.Forms.CheckBox()
            Me.label9 = New System.Windows.Forms.Label()
            Me.ReservingUser = New System.Windows.Forms.TextBox()
            Me.encryptionType = New System.Windows.Forms.ComboBox()
            Me.label8 = New System.Windows.Forms.Label()
            Me.ProtectSheetPass = New System.Windows.Forms.TextBox()
            Me.label7 = New System.Windows.Forms.Label()
            Me.label6 = New System.Windows.Forms.Label()
            Me.ProtectWorkbookPass = New System.Windows.Forms.TextBox()
            Me.label5 = New System.Windows.Forms.Label()
            Me.ModifyPassGenerated = New System.Windows.Forms.TextBox()
            Me.label3 = New System.Windows.Forms.Label()
            Me.OpenPassGenerated = New System.Windows.Forms.TextBox()
            Me.label4 = New System.Windows.Forms.Label()
            Me.panel1.SuspendLayout()
            Me.panel2.SuspendLayout()
            Me.SuspendLayout()
            '
            ' button1
            '
            Me.button1.Anchor = (CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.button1.BackColor = System.Drawing.Color.Green
            Me.button1.ForeColor = System.Drawing.Color.White
            Me.button1.Location = New System.Drawing.Point(312, 414)
            Me.button1.Name = "button1"
            Me.button1.Size = New System.Drawing.Size(112, 23)
            Me.button1.TabIndex = 0
            Me.button1.Text = "GO!"
            Me.button1.UseVisualStyleBackColor = False
'           Me.button1.Click += New System.EventHandler(Me.button1_Click)
            '
            ' saveFileDialog1
            '
            Me.saveFileDialog1.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm|Excel 97/2003|*.xls|Excel 2007|*.xlsx;*.xlsm|All " & "files|*.*"
            Me.saveFileDialog1.RestoreDirectory = True
            '
            ' btnCancel
            '
            Me.btnCancel.Anchor = (CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.btnCancel.BackColor = System.Drawing.Color.FromArgb((CInt((CByte(192)))), (CInt((CByte(0)))), (CInt((CByte(0)))))
            Me.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel
            Me.btnCancel.ForeColor = System.Drawing.Color.White
            Me.btnCancel.Location = New System.Drawing.Point(432, 414)
            Me.btnCancel.Name = "btnCancel"
            Me.btnCancel.Size = New System.Drawing.Size(112, 23)
            Me.btnCancel.TabIndex = 3
            Me.btnCancel.Text = "Cancel"
            Me.btnCancel.UseVisualStyleBackColor = False
'           Me.btnCancel.Click += New System.EventHandler(Me.btnCancel_Click)
            '
            ' panel1
            '
            Me.panel1.Anchor = (CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.panel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
            Me.panel1.Controls.Add(Me.label2)
            Me.panel1.Controls.Add(Me.OpenPassTemplate)
            Me.panel1.Controls.Add(Me.label1)
            Me.panel1.Location = New System.Drawing.Point(24, 16)
            Me.panel1.Name = "panel1"
            Me.panel1.Size = New System.Drawing.Size(496, 80)
            Me.panel1.TabIndex = 6
            '
            ' label2
            '
            Me.label2.Location = New System.Drawing.Point(8, 32)
            Me.label2.Name = "label2"
            Me.label2.Size = New System.Drawing.Size(200, 16)
            Me.label2.TabIndex = 8
            Me.label2.Text = "Password to open the template:"
            '
            ' OpenPassTemplate
            '
            Me.OpenPassTemplate.Location = New System.Drawing.Point(8, 48)
            Me.OpenPassTemplate.Name = "OpenPassTemplate"
            Me.OpenPassTemplate.Size = New System.Drawing.Size(200, 20)
            Me.OpenPassTemplate.TabIndex = 7
            Me.OpenPassTemplate.Text = "flexcel"
            '
            ' label1
            '
            Me.label1.Location = New System.Drawing.Point(8, 8)
            Me.label1.Name = "label1"
            Me.label1.Size = New System.Drawing.Size(416, 24)
            Me.label1.TabIndex = 6
            Me.label1.Text = "The template is protected with a password to open. On this demo, it is ""flexcel"""
            '
            ' panel2
            '
            Me.panel2.Anchor = (CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) Or System.Windows.Forms.AnchorStyles.Left) Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.panel2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
            Me.panel2.Controls.Add(Me.ProtectSheet)
            Me.panel2.Controls.Add(Me.ProtectWorkbook)
            Me.panel2.Controls.Add(Me.RecommendReadOnly)
            Me.panel2.Controls.Add(Me.label9)
            Me.panel2.Controls.Add(Me.ReservingUser)
            Me.panel2.Controls.Add(Me.encryptionType)
            Me.panel2.Controls.Add(Me.label8)
            Me.panel2.Controls.Add(Me.ProtectSheetPass)
            Me.panel2.Controls.Add(Me.label7)
            Me.panel2.Controls.Add(Me.label6)
            Me.panel2.Controls.Add(Me.ProtectWorkbookPass)
            Me.panel2.Controls.Add(Me.label5)
            Me.panel2.Controls.Add(Me.ModifyPassGenerated)
            Me.panel2.Controls.Add(Me.label3)
            Me.panel2.Controls.Add(Me.OpenPassGenerated)
            Me.panel2.Controls.Add(Me.label4)
            Me.panel2.Location = New System.Drawing.Point(24, 112)
            Me.panel2.Name = "panel2"
            Me.panel2.Size = New System.Drawing.Size(496, 296)
            Me.panel2.TabIndex = 7
            '
            ' ProtectSheet
            '
            Me.ProtectSheet.Checked = True
            Me.ProtectSheet.CheckState = System.Windows.Forms.CheckState.Checked
            Me.ProtectSheet.Location = New System.Drawing.Point(368, 203)
            Me.ProtectSheet.Name = "ProtectSheet"
            Me.ProtectSheet.Size = New System.Drawing.Size(64, 16)
            Me.ProtectSheet.TabIndex = 22
            Me.ProtectSheet.Text = "Protect"
            '
            ' ProtectWorkbook
            '
            Me.ProtectWorkbook.Checked = True
            Me.ProtectWorkbook.CheckState = System.Windows.Forms.CheckState.Checked
            Me.ProtectWorkbook.Location = New System.Drawing.Point(368, 147)
            Me.ProtectWorkbook.Name = "ProtectWorkbook"
            Me.ProtectWorkbook.Size = New System.Drawing.Size(64, 16)
            Me.ProtectWorkbook.TabIndex = 21
            Me.ProtectWorkbook.Text = "Protect"
            '
            ' RecommendReadOnly
            '
            Me.RecommendReadOnly.Location = New System.Drawing.Point(240, 243)
            Me.RecommendReadOnly.Name = "RecommendReadOnly"
            Me.RecommendReadOnly.Size = New System.Drawing.Size(168, 24)
            Me.RecommendReadOnly.TabIndex = 20
            Me.RecommendReadOnly.Text = "Recommend read only"
            '
            ' label9
            '
            Me.label9.Location = New System.Drawing.Point(8, 227)
            Me.label9.Name = "label9"
            Me.label9.Size = New System.Drawing.Size(200, 16)
            Me.label9.TabIndex = 19
            Me.label9.Text = "Reserving user: (for modify password)"
            '
            ' ReservingUser
            '
            Me.ReservingUser.Location = New System.Drawing.Point(8, 243)
            Me.ReservingUser.Name = "ReservingUser"
            Me.ReservingUser.Size = New System.Drawing.Size(200, 20)
            Me.ReservingUser.TabIndex = 18
            Me.ReservingUser.Text = "Flexcel User"
            '
            ' encryptionType
            '
            Me.encryptionType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
            Me.encryptionType.Items.AddRange(New Object() { "Default Excel 97/2000 Encryption", "Excel 95 XOR Encryption"})
            Me.encryptionType.Location = New System.Drawing.Point(8, 84)
            Me.encryptionType.Name = "encryptionType"
            Me.encryptionType.Size = New System.Drawing.Size(424, 21)
            Me.encryptionType.TabIndex = 17
            '
            ' label8
            '
            Me.label8.Location = New System.Drawing.Point(8, 48)
            Me.label8.Name = "label8"
            Me.label8.Size = New System.Drawing.Size(488, 33)
            Me.label8.TabIndex = 16
            Me.label8.Text = "Encryption type for xls files (xlsx uses Agile encryption). Note that this is onl" & "y needed when saving, as the encryption type is autodetected when opening:"
            '
            ' ProtectSheetPass
            '
            Me.ProtectSheetPass.Location = New System.Drawing.Point(232, 176)
            Me.ProtectSheetPass.Name = "ProtectSheetPass"
            Me.ProtectSheetPass.Size = New System.Drawing.Size(120, 20)
            Me.ProtectSheetPass.TabIndex = 15
            Me.ProtectSheetPass.Text = "sheet"
            '
            ' label7
            '
            Me.label7.Location = New System.Drawing.Point(232, 179)
            Me.label7.Name = "label7"
            Me.label7.Size = New System.Drawing.Size(248, 16)
            Me.label7.TabIndex = 14
            Me.label7.Text = "Password to protect the generated sheets:"
            '
            ' label6
            '
            Me.label6.Location = New System.Drawing.Point(232, 131)
            Me.label6.Name = "label6"
            Me.label6.Size = New System.Drawing.Size(248, 16)
            Me.label6.TabIndex = 12
            Me.label6.Text = "Password to protect the generated workbook:"
            '
            ' ProtectWorkbookPass
            '
            Me.ProtectWorkbookPass.Location = New System.Drawing.Point(232, 147)
            Me.ProtectWorkbookPass.Name = "ProtectWorkbookPass"
            Me.ProtectWorkbookPass.Size = New System.Drawing.Size(120, 20)
            Me.ProtectWorkbookPass.TabIndex = 11
            Me.ProtectWorkbookPass.Text = "workbook"
            '
            ' label5
            '
            Me.label5.Location = New System.Drawing.Point(8, 179)
            Me.label5.Name = "label5"
            Me.label5.Size = New System.Drawing.Size(200, 16)
            Me.label5.TabIndex = 10
            Me.label5.Text = "Password to modify the generated file:"
            '
            ' ModifyPassGenerated
            '
            Me.ModifyPassGenerated.Location = New System.Drawing.Point(8, 195)
            Me.ModifyPassGenerated.Name = "ModifyPassGenerated"
            Me.ModifyPassGenerated.Size = New System.Drawing.Size(200, 20)
            Me.ModifyPassGenerated.TabIndex = 9
            Me.ModifyPassGenerated.Text = "modify"
            '
            ' label3
            '
            Me.label3.Location = New System.Drawing.Point(8, 131)
            Me.label3.Name = "label3"
            Me.label3.Size = New System.Drawing.Size(200, 16)
            Me.label3.TabIndex = 8
            Me.label3.Text = "Password to open the generated file:"
            '
            ' OpenPassGenerated
            '
            Me.OpenPassGenerated.Location = New System.Drawing.Point(8, 147)
            Me.OpenPassGenerated.Name = "OpenPassGenerated"
            Me.OpenPassGenerated.Size = New System.Drawing.Size(200, 20)
            Me.OpenPassGenerated.TabIndex = 7
            Me.OpenPassGenerated.Text = "open"
            '
            ' label4
            '
            Me.label4.Location = New System.Drawing.Point(8, 8)
            Me.label4.Name = "label4"
            Me.label4.Size = New System.Drawing.Size(416, 40)
            Me.label4.TabIndex = 6
            Me.label4.Text = "Here we enter the passwords we want to protect the generated sheets and workbook." & " Leave them blank to have no password."
            '
            ' mainForm
            '
            Me.AutoScaleDimensions = New System.Drawing.SizeF(6F, 13F)
            Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
            Me.ClientSize = New System.Drawing.Size(552, 443)
            Me.Controls.Add(Me.panel2)
            Me.Controls.Add(Me.panel1)
            Me.Controls.Add(Me.btnCancel)
            Me.Controls.Add(Me.button1)
            Me.Name = "mainForm"
            Me.Text = "Encryption And Subtotals"
'           Me.Load += New System.EventHandler(Me.mainForm_Load)
            Me.panel1.ResumeLayout(False)
            Me.panel1.PerformLayout()
            Me.panel2.ResumeLayout(False)
            Me.panel2.PerformLayout()
            Me.ResumeLayout(False)

        End Sub
        #End Region
    End Class
End Namespace

Form1.vb

Imports System.Collections
Imports System.ComponentModel
Imports System.IO
Imports System.Reflection
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports FlexCel.Report
Imports FlexCel.Demo.SharedData

Namespace EncryptionAndSubtotals
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Public Sub New()
            InitializeComponent()
        End Sub

        Private Sub button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button1.Click
            ManualRun()
        End Sub

        Public Sub ManualRun()
            Using ordersReport As FlexCelReport = SharedData.CreateReport()
                AddHandler ordersReport.BeforeReadTemplate, AddressOf ordersReport_BeforeReadTemplate
                AddHandler ordersReport.AfterGenerateSheet, AddressOf ordersReport_AfterGenerateSheet
                AddHandler ordersReport.AfterGenerateWorkbook, AddressOf ordersReport_AfterGenerateWorkbook

                ordersReport.SetValue("Date", Date.Now)

                Dim DataPath As String = Path.Combine(Path.Combine(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), ".."), "..") & Path.DirectorySeparatorChar

                If saveFileDialog1.ShowDialog() = System.Windows.Forms.DialogResult.OK Then
                    ordersReport.Run(DataPath & "Encryption And Subtotals.template.xls", saveFileDialog1.FileName)

                    If MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) = System.Windows.Forms.DialogResult.Yes Then
                        Process.Start(saveFileDialog1.FileName)
                    End If
                End If
            End Using
        End Sub

        Private Sub btnCancel_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnCancel.Click
            Close()
        End Sub

        Private Sub mainForm_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
            encryptionType.SelectedItem = encryptionType.Items(0)
        End Sub

        Private Sub ordersReport_BeforeReadTemplate(ByVal sender As Object, ByVal e As FlexCel.Report.GenerateEventArgs)
            e.File.Protection.OpenPassword = OpenPassTemplate.Text
        End Sub

        Private Sub ordersReport_AfterGenerateSheet(ByVal sender As Object, ByVal e As FlexCel.Report.GenerateEventArgs)
            e.File.Protection.SetSheetProtection(ProtectSheetPass.Text, New TSheetProtectionOptions(ProtectSheet.Checked))
        End Sub

        Private Sub ordersReport_AfterGenerateWorkbook(ByVal sender As Object, ByVal e As FlexCel.Report.GenerateEventArgs)
            If encryptionType.SelectedItem Is encryptionType.Items(1) Then
                e.File.Protection.EncryptionType = TEncryptionType.Xor
            Else
                e.File.Protection.EncryptionType = TEncryptionType.Standard
            End If
            e.File.Protection.OpenPassword = OpenPassGenerated.Text
            e.File.Protection.SetModifyPassword(ModifyPassGenerated.Text, RecommendReadOnly.Checked, ReservingUser.Text)
            e.File.Protection.SetWorkbookProtection(ProtectWorkbookPass.Text, New TWorkbookProtectionOptions(False, ProtectWorkbook.Checked))
        End Sub
    End Class

End Namespace

Program.vb

Namespace EncryptionAndSubtotals
    Friend NotInheritable Class Program

        Private Sub New()
        End Sub

        ''' <summary>
        ''' The main entry point for the application.
        ''' </summary>
       <STAThread> _
        Shared Sub Main()
            Application.EnableVisualStyles()
            Application.SetCompatibleTextRenderingDefault(False)
            Application.Run(New mainForm())
        End Sub
    End Class
End Namespace


Step by step tutorial on FlexCel reports (VB.Net / netframework) | FlexCel Studio for the .NET Framework documentation

Step by step tutorial on FlexCel reports (VB.Net / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\vb\VS2022\netframework\20.Reports\A0.Reporting Tutorial and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​vb/​VS2022/​netframework/​Modules/​20.​Reports/​A0.​Reporting Tutorial

Overview

This demo is the completed project from the FlexCel reporting tutorial video at

https://www.tmssoftware.com/flexcel/tutorial.htm

Note: This demo does not run from MainDemo and it needs .NET 2.0 or newer.

It also needs the Adventure Works demo database from

http://www.codeplex.com/MSFTDBProdSamples/Release/ProjectReleases.aspx?ReleaseId=4004 (SQLServer 2005)

or

http://www.codeplex.com/MSFTDBProdSamples/Release/ProjectReleases.aspx?ReleaseId=8392 (SQLServer 2008)

In order to run this demo, open the website from Visual Studio 2005 or newer, by doing: Menu->File->Open->Website

and pointing to the "Modules\20.Reports\A0.Reporting Tutorial" folder.

Concepts

  • Concepts are explained in the video. This is just the finished code and template so you can take a look at it.

  • In order to actually run this demo, you might need to edit web.config and change the connection settings for your SQL Server.

Files

Default.aspx.vb

Imports System
Imports System.Collections
Imports System.Configuration
Imports System.Data
Imports System.Web
Imports System.Web.Security
Imports System.Web.UI
Imports System.Web.UI.HtmlControls
Imports System.Web.UI.WebControls
Imports System.Web.UI.WebControls.WebParts
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports FlexCel.Render
Imports FlexCel.Report
Imports System.IO

Partial Public Class _Default
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)

    End Sub

    Private Function CreateReport() As ExcelFile
        Dim Result As New XlsFile(True)
        Result.Open(MapPath("~/App_Data/template.xls"))
        Using fr As New FlexCelReport()
            LoadData(fr)

            fr.SetValue("ReportCaption", "Hello from FlexCel!")
            fr.Run(Result)
            Return Result
        End Using
    End Function

    Private Sub LoadData(ByVal fr As FlexCelReport)
        Dim Data As New DataSet1()
        Dim ProductAdapter As New DataSet1TableAdapters.ProductTableAdapter()
        ProductAdapter.Fill(Data.Product)

        Dim ProductPhotoAdapter As New DataSet1TableAdapters.ProductPhotoTableAdapter()
        ProductPhotoAdapter.Fill(Data.ProductPhoto)

        Dim ProductProductPhotoAdapter As New DataSet1TableAdapters.ProductProductPhotoTableAdapter()
        ProductProductPhotoAdapter.Fill(Data.ProductProductPhoto)

        fr.AddTable(Data)
    End Sub

    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs)
        Dim xls As ExcelFile = CreateReport()
        FlexCelAspViewer1.HtmlExport.Workbook = xls
    End Sub
    Protected Sub Button2_Click(ByVal sender As Object, ByVal e As EventArgs)
        Dim xls As ExcelFile = CreateReport()

        Using ms As New MemoryStream()
            xls.Save(ms)
            ms.Position = 0
            Response.Clear()
            Response.AddHeader("Content-Disposition", "attachment; filename=Test.xls")
            Response.AddHeader("Content-Length", ms.Length.ToString())
            Response.ContentType = "application/excel" 'octet-stream";
            Response.BinaryWrite(ms.ToArray())
            Response.End()
        End Using

    End Sub
    Protected Sub Button3_Click(ByVal sender As Object, ByVal e As EventArgs)
        Dim xls As ExcelFile = CreateReport()

        Using ms As New MemoryStream()
            Using pdf As New FlexCelPdfExport()
                pdf.Workbook = xls
                pdf.BeginExport(ms)
                pdf.ExportAllVisibleSheets(False, "FlexCel")
                pdf.EndExport()
                ms.Position = 0
                Response.Clear()
                Response.AddHeader("Content-Disposition", "attachment; filename=Test.pdf")
                Response.AddHeader("Content-Length", ms.Length.ToString())
                Response.ContentType = "application/pdf" 'octet-stream";
                Response.BinaryWrite(ms.ToArray())
                Response.End()
            End Using
        End Using

    End Sub
End Class


Features (VB.Net / netframework) | FlexCel Studio for the .NET Framework documentation

Features (VB.Net / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\vb\VS2022\netframework\20.Reports\B0.Features Page and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​vb/​VS2022/​netframework/​Modules/​20.​Reports/​B0.​Features Page

Overview

This is a real world demo, showing how we create the "features" HTML sheet you can find at

https://www.tmssoftware.com/flexcel/featuresflexcel.htm

Concepts

  • Everything in this demo is shown in more detail somewhere else. This is just a showcase of a real application of a FlexCel report, but anyway there are some ideas worth noting.

  • We use the Image Fit tag in the image to autofit the containing cell to the height of the image. Bus as we also need to autofit the whole row, we need to do an autofit with a "Dont Shrink" option on the rows. If we didn't, when autofitting the rows the images would get outside their cells again.

  • We use Intelligent Page Breaks to have a nice PDF output.

  • As we wanted to use Access so we can distribute this demo easily to you, we did not store the images in the database. (Access is not good at storing images). So we saved the images in a folder, and used an user defined function to load them and feed the report.

Files

AssemblyInfo.vb

Imports System.Reflection
Imports System.Runtime.CompilerServices

'
' General Information about an assembly is controlled through the following
' set of attributes. Change these attribute values to modify the information
' associated with an assembly.
'
<Assembly: AssemblyTitle("")>
<Assembly: AssemblyDescription("")>
<Assembly: AssemblyConfiguration("")>
<Assembly: AssemblyCompany("")>
<Assembly: AssemblyProduct("")>
<Assembly: AssemblyCopyright("(c) 2002 - 2014 TMS Software")>
<Assembly: AssemblyTrademark("")>
<Assembly: AssemblyCulture("")>

'
' Version information for an assembly consists of the following four values:
'
'      Major Version
'      Minor Version
'      Build Number
'      Revision
'
' You can specify all the values or you can default the Revision and Build Numbers
' by using the '*' as shown below:

<Assembly: AssemblyVersion("6.2.1.0")>

'
' In order to sign your assembly you must specify a key to use. Refer to the
' Microsoft .NET Framework documentation for more information on assembly signing.
'
' Use the attributes below to control which key is used for signing.
'
' Notes:
'   (*) If no key is specified, the assembly is not signed.
'   (*) KeyName refers to a key that has been installed in the Crypto Service
'       Provider (CSP) on your machine. KeyFile refers to a file which contains
'       a key.
'   (*) If the KeyFile and the KeyName values are both specified, the
'       following processing occurs:
'       (1) If the KeyName can be found in the CSP, that key is used.
'       (2) If the KeyName does not exist and the KeyFile does exist, the key
'           in the KeyFile is installed into the CSP and used.
'   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
'       When specifying the KeyFile, the location of the KeyFile should be
'       relative to the project output directory which is
'       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
'       located in the project directory, you would specify the AssemblyKeyFile
'       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
'   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
'       documentation for more information on this.
'
<Assembly: AssemblyDelaySign(False)>
<Assembly: AssemblyKeyFile("")>
<Assembly: AssemblyKeyName("")>

Form1.Designer.vb

Imports System.Collections
Imports System.ComponentModel
Imports System.IO
Imports System.Reflection
Imports System.Data.OleDb
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports FlexCel.Report
Imports FlexCel.Render
Imports FlexCel.Pdf
Imports System.Globalization
Imports System.Xml
Namespace FeaturesPage
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Private label1 As System.Windows.Forms.Label
        Private oleDbSelectCommand1 As System.Data.OleDb.OleDbCommand
        Private oleDbInsertCommand1 As System.Data.OleDb.OleDbCommand
        Private oleDbUpdateCommand1 As System.Data.OleDb.OleDbCommand
        Private oleDbDeleteCommand1 As System.Data.OleDb.OleDbCommand
        Private dbconnection As System.Data.OleDb.OleDbConnection
        Private categoriesAdapter As System.Data.OleDb.OleDbDataAdapter
        Private featuresAdapter As System.Data.OleDb.OleDbDataAdapter
        Private oleDbSelectCommand2 As System.Data.OleDb.OleDbCommand
        Private oleDbInsertCommand2 As System.Data.OleDb.OleDbCommand
        Private oleDbUpdateCommand2 As System.Data.OleDb.OleDbCommand
        Private oleDbDeleteCommand2 As System.Data.OleDb.OleDbCommand
        Private oleDbSelectCommand3 As System.Data.OleDb.OleDbCommand
        Private hyperlinksAdapter As System.Data.OleDb.OleDbDataAdapter
        Private components As System.ComponentModel.IContainer = Nothing

        ''' <summary>
        ''' Clean up any resources being used.
        ''' </summary>
        Protected Overrides Sub Dispose(ByVal disposing As Boolean)
            If disposing Then
                If components IsNot Nothing Then
                    components.Dispose()
                End If
            End If
            MyBase.Dispose(disposing)
        End Sub

        #Region "Windows Form Designer generated code"
        ''' <summary>
        ''' Required method for Designer support - do not modify
        ''' the contents of this method with the code editor.
        ''' </summary>
        Private Sub InitializeComponent()
            Dim resources As New System.ComponentModel.ComponentResourceManager(GetType(mainForm))
            Me.label1 = New System.Windows.Forms.Label()
            Me.oleDbSelectCommand1 = New System.Data.OleDb.OleDbCommand()
            Me.dbconnection = New System.Data.OleDb.OleDbConnection()
            Me.oleDbInsertCommand1 = New System.Data.OleDb.OleDbCommand()
            Me.oleDbUpdateCommand1 = New System.Data.OleDb.OleDbCommand()
            Me.oleDbDeleteCommand1 = New System.Data.OleDb.OleDbCommand()
            Me.categoriesAdapter = New System.Data.OleDb.OleDbDataAdapter()
            Me.featuresAdapter = New System.Data.OleDb.OleDbDataAdapter()
            Me.oleDbDeleteCommand2 = New System.Data.OleDb.OleDbCommand()
            Me.oleDbInsertCommand2 = New System.Data.OleDb.OleDbCommand()
            Me.oleDbSelectCommand2 = New System.Data.OleDb.OleDbCommand()
            Me.oleDbUpdateCommand2 = New System.Data.OleDb.OleDbCommand()
            Me.oleDbSelectCommand3 = New System.Data.OleDb.OleDbCommand()
            Me.hyperlinksAdapter = New System.Data.OleDb.OleDbDataAdapter()
            Me.mainToolbar = New System.Windows.Forms.ToolStrip()
            Me.toolStripButton4 = New System.Windows.Forms.ToolStripButton()
            Me.toolStripButton3 = New System.Windows.Forms.ToolStripButton()
            Me.toolStripButton2 = New System.Windows.Forms.ToolStripButton()
            Me.toolStripButton1 = New System.Windows.Forms.ToolStripButton()
            Me.mainToolbar.SuspendLayout()
            Me.SuspendLayout()
            '
            ' label1
            '
            Me.label1.Location = New System.Drawing.Point(179, 69)
            Me.label1.Name = "label1"
            Me.label1.Size = New System.Drawing.Size(200, 48)
            Me.label1.TabIndex = 4
            Me.label1.Text = "Files will be saved under a ""Features"" Folder in under where the application is r" & "unning."
            '
            ' oleDbSelectCommand1
            '
            Me.oleDbSelectCommand1.CommandText = "SELECT Caption, CategoryId, CategoryName, Description FROM Categories"
            Me.oleDbSelectCommand1.Connection = Me.dbconnection
            '
            ' dbconnection
            '
            Me.dbconnection.ConnectionString = resources.GetString("dbconnection.ConnectionString")
            '
            ' oleDbInsertCommand1
            '
            Me.oleDbInsertCommand1.CommandText = "INSERT INTO Categories(Caption, CategoryName, Description) VALUES (?, ?, ?)"
            Me.oleDbInsertCommand1.Connection = Me.dbconnection
            Me.oleDbInsertCommand1.Parameters.AddRange(New System.Data.OleDb.OleDbParameter() { _
                New System.Data.OleDb.OleDbParameter("Caption", System.Data.OleDb.OleDbType.VarWChar, 255, "Caption"), _
                New System.Data.OleDb.OleDbParameter("CategoryName", System.Data.OleDb.OleDbType.VarWChar, 255, "CategoryName"), _
                New System.Data.OleDb.OleDbParameter("Description", System.Data.OleDb.OleDbType.VarWChar, 0, "Description") _
            })
            '
            ' oleDbUpdateCommand1
            '
            Me.oleDbUpdateCommand1.CommandText = resources.GetString("oleDbUpdateCommand1.CommandText")
            Me.oleDbUpdateCommand1.Connection = Me.dbconnection
            Me.oleDbUpdateCommand1.Parameters.AddRange(New System.Data.OleDb.OleDbParameter() { _
                New System.Data.OleDb.OleDbParameter("Caption", System.Data.OleDb.OleDbType.VarWChar, 255, "Caption"), _
                New System.Data.OleDb.OleDbParameter("CategoryName", System.Data.OleDb.OleDbType.VarWChar, 255, "CategoryName"), _
                New System.Data.OleDb.OleDbParameter("Description", System.Data.OleDb.OleDbType.VarWChar, 0, "Description"), _
                New System.Data.OleDb.OleDbParameter("Original_CategoryId", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, False, (CByte(0)), (CByte(0)), "CategoryId", System.Data.DataRowVersion.Original, Nothing), _
                New System.Data.OleDb.OleDbParameter("Original_Caption", System.Data.OleDb.OleDbType.VarWChar, 255, System.Data.ParameterDirection.Input, False, (CByte(0)), (CByte(0)), "Caption", System.Data.DataRowVersion.Original, Nothing), _
                New System.Data.OleDb.OleDbParameter("Original_Caption1", System.Data.OleDb.OleDbType.VarWChar, 255, System.Data.ParameterDirection.Input, False, (CByte(0)), (CByte(0)), "Caption", System.Data.DataRowVersion.Original, Nothing), _
                New System.Data.OleDb.OleDbParameter("Original_CategoryName", System.Data.OleDb.OleDbType.VarWChar, 255, System.Data.ParameterDirection.Input, False, (CByte(0)), (CByte(0)), "CategoryName", System.Data.DataRowVersion.Original, Nothing), _
                New System.Data.OleDb.OleDbParameter("Original_CategoryName1", System.Data.OleDb.OleDbType.VarWChar, 255, System.Data.ParameterDirection.Input, False, (CByte(0)), (CByte(0)), "CategoryName", System.Data.DataRowVersion.Original, Nothing) _
            })
            '
            ' oleDbDeleteCommand1
            '
            Me.oleDbDeleteCommand1.CommandText = "DELETE FROM Categories WHERE (CategoryId = ?) AND (Caption = ? OR ? IS NULL AND C" & "aption IS NULL) AND (CategoryName = ? OR ? IS NULL AND CategoryName IS NULL)"
            Me.oleDbDeleteCommand1.Connection = Me.dbconnection
            Me.oleDbDeleteCommand1.Parameters.AddRange(New System.Data.OleDb.OleDbParameter() { _
                New System.Data.OleDb.OleDbParameter("Original_CategoryId", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, False, (CByte(0)), (CByte(0)), "CategoryId", System.Data.DataRowVersion.Original, Nothing), _
                New System.Data.OleDb.OleDbParameter("Original_Caption", System.Data.OleDb.OleDbType.VarWChar, 255, System.Data.ParameterDirection.Input, False, (CByte(0)), (CByte(0)), "Caption", System.Data.DataRowVersion.Original, Nothing), _
                New System.Data.OleDb.OleDbParameter("Original_Caption1", System.Data.OleDb.OleDbType.VarWChar, 255, System.Data.ParameterDirection.Input, False, (CByte(0)), (CByte(0)), "Caption", System.Data.DataRowVersion.Original, Nothing), _
                New System.Data.OleDb.OleDbParameter("Original_CategoryName", System.Data.OleDb.OleDbType.VarWChar, 255, System.Data.ParameterDirection.Input, False, (CByte(0)), (CByte(0)), "CategoryName", System.Data.DataRowVersion.Original, Nothing), _
                New System.Data.OleDb.OleDbParameter("Original_CategoryName1", System.Data.OleDb.OleDbType.VarWChar, 255, System.Data.ParameterDirection.Input, False, (CByte(0)), (CByte(0)), "CategoryName", System.Data.DataRowVersion.Original, Nothing) _
            })
            '
            ' categoriesAdapter
            '
            Me.categoriesAdapter.DeleteCommand = Me.oleDbDeleteCommand1
            Me.categoriesAdapter.InsertCommand = Me.oleDbInsertCommand1
            Me.categoriesAdapter.SelectCommand = Me.oleDbSelectCommand1
            Me.categoriesAdapter.TableMappings.AddRange(New System.Data.Common.DataTableMapping() { New System.Data.Common.DataTableMapping("Table", "Categories", New System.Data.Common.DataColumnMapping() { New System.Data.Common.DataColumnMapping("Caption", "Caption"), New System.Data.Common.DataColumnMapping("CategoryId", "CategoryId"), New System.Data.Common.DataColumnMapping("CategoryName", "CategoryName"), New System.Data.Common.DataColumnMapping("Description", "Description")})})
            Me.categoriesAdapter.UpdateCommand = Me.oleDbUpdateCommand1
            '
            ' featuresAdapter
            '
            Me.featuresAdapter.DeleteCommand = Me.oleDbDeleteCommand2
            Me.featuresAdapter.InsertCommand = Me.oleDbInsertCommand2
            Me.featuresAdapter.SelectCommand = Me.oleDbSelectCommand2
            Me.featuresAdapter.TableMappings.AddRange(New System.Data.Common.DataTableMapping() { New System.Data.Common.DataTableMapping("Table", "Features", New System.Data.Common.DataColumnMapping() { New System.Data.Common.DataColumnMapping("Caption", "Caption"), New System.Data.Common.DataColumnMapping("CategoryId", "CategoryId"), New System.Data.Common.DataColumnMapping("Description", "Description"), New System.Data.Common.DataColumnMapping("FeaturesId", "FeaturesId")})})
            Me.featuresAdapter.UpdateCommand = Me.oleDbUpdateCommand2
            '
            ' oleDbDeleteCommand2
            '
            Me.oleDbDeleteCommand2.CommandText = "DELETE FROM Features WHERE (FeaturesId = ?) AND (Caption = ?) AND (CategoryId = ?" & ")"
            Me.oleDbDeleteCommand2.Parameters.AddRange(New System.Data.OleDb.OleDbParameter() { _
                New System.Data.OleDb.OleDbParameter("Original_FeaturesId", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, False, (CByte(0)), (CByte(0)), "FeaturesId", System.Data.DataRowVersion.Original, Nothing), _
                New System.Data.OleDb.OleDbParameter("Original_Caption", System.Data.OleDb.OleDbType.VarWChar, 255, System.Data.ParameterDirection.Input, False, (CByte(0)), (CByte(0)), "Caption", System.Data.DataRowVersion.Original, Nothing), _
                New System.Data.OleDb.OleDbParameter("Original_CategoryId", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, False, (CByte(0)), (CByte(0)), "CategoryId", System.Data.DataRowVersion.Original, Nothing) _
            })
            '
            ' oleDbInsertCommand2
            '
            Me.oleDbInsertCommand2.CommandText = "INSERT INTO Features(Caption, CategoryId, Description) VALUES (?, ?, ?)"
            Me.oleDbInsertCommand2.Parameters.AddRange(New System.Data.OleDb.OleDbParameter() { _
                New System.Data.OleDb.OleDbParameter("Caption", System.Data.OleDb.OleDbType.VarWChar, 255, "Caption"), _
                New System.Data.OleDb.OleDbParameter("CategoryId", System.Data.OleDb.OleDbType.Integer, 0, "CategoryId"), _
                New System.Data.OleDb.OleDbParameter("Description", System.Data.OleDb.OleDbType.VarWChar, 0, "Description") _
            })
            '
            ' oleDbSelectCommand2
            '
            Me.oleDbSelectCommand2.CommandText = "SELECT Caption, CategoryId, Description, FeaturesId FROM Features order by Positi" & "onInSheet"
            Me.oleDbSelectCommand2.Connection = Me.dbconnection
            '
            ' oleDbUpdateCommand2
            '
            Me.oleDbUpdateCommand2.CommandText = "UPDATE Features SET Caption = ?, CategoryId = ?, Description = ? WHERE (FeaturesI" & "d = ?) AND (Caption = ?) AND (CategoryId = ?)"
            Me.oleDbUpdateCommand2.Parameters.AddRange(New System.Data.OleDb.OleDbParameter() { _
                New System.Data.OleDb.OleDbParameter("Caption", System.Data.OleDb.OleDbType.VarWChar, 255, "Caption"), _
                New System.Data.OleDb.OleDbParameter("CategoryId", System.Data.OleDb.OleDbType.Integer, 0, "CategoryId"), _
                New System.Data.OleDb.OleDbParameter("Description", System.Data.OleDb.OleDbType.VarWChar, 0, "Description"), _
                New System.Data.OleDb.OleDbParameter("Original_FeaturesId", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, False, (CByte(0)), (CByte(0)), "FeaturesId", System.Data.DataRowVersion.Original, Nothing), _
                New System.Data.OleDb.OleDbParameter("Original_Caption", System.Data.OleDb.OleDbType.VarWChar, 255, System.Data.ParameterDirection.Input, False, (CByte(0)), (CByte(0)), "Caption", System.Data.DataRowVersion.Original, Nothing), _
                New System.Data.OleDb.OleDbParameter("Original_CategoryId", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, False, (CByte(0)), (CByte(0)), "CategoryId", System.Data.DataRowVersion.Original, Nothing) _
            })
            '
            ' oleDbSelectCommand3
            '
            Me.oleDbSelectCommand3.CommandText = "SELECT FeaturesId, HiperlinksId, LinkName, Url FROM Hyperlinks"
            Me.oleDbSelectCommand3.Connection = Me.dbconnection
            '
            ' hyperlinksAdapter
            '
            Me.hyperlinksAdapter.SelectCommand = Me.oleDbSelectCommand3
            Me.hyperlinksAdapter.TableMappings.AddRange(New System.Data.Common.DataTableMapping() { New System.Data.Common.DataTableMapping("Table", "Hyperlinks", New System.Data.Common.DataColumnMapping() { New System.Data.Common.DataColumnMapping("FeaturesId", "FeaturesId"), New System.Data.Common.DataColumnMapping("HiperlinksId", "HiperlinksId"), New System.Data.Common.DataColumnMapping("LinkName", "LinkName"), New System.Data.Common.DataColumnMapping("Url", "Url")})})
            '
            ' mainToolbar
            '
            Me.mainToolbar.Items.AddRange(New System.Windows.Forms.ToolStripItem() { Me.toolStripButton4, Me.toolStripButton3, Me.toolStripButton2, Me.toolStripButton1})
            Me.mainToolbar.Location = New System.Drawing.Point(0, 0)
            Me.mainToolbar.Name = "mainToolbar"
            Me.mainToolbar.Size = New System.Drawing.Size(528, 38)
            Me.mainToolbar.TabIndex = 5
            Me.mainToolbar.Text = "mainToolbar"
            '
            ' toolStripButton4
            '
            Me.toolStripButton4.Image = (CType(resources.GetObject("toolStripButton4.Image"), System.Drawing.Image))
            Me.toolStripButton4.ImageTransparentColor = System.Drawing.Color.Magenta
            Me.toolStripButton4.Name = "toolStripButton4"
            Me.toolStripButton4.Size = New System.Drawing.Size(78, 35)
            Me.toolStripButton4.Text = "Save to Excel"
            Me.toolStripButton4.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText
'           Me.toolStripButton4.Click += New System.EventHandler(Me.btnExportExcel_Click)
            '
            ' toolStripButton3
            '
            Me.toolStripButton3.Image = (CType(resources.GetObject("toolStripButton3.Image"), System.Drawing.Image))
            Me.toolStripButton3.ImageTransparentColor = System.Drawing.Color.Magenta
            Me.toolStripButton3.Name = "toolStripButton3"
            Me.toolStripButton3.Size = New System.Drawing.Size(94, 35)
            Me.toolStripButton3.Text = "Export to HTML"
            Me.toolStripButton3.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText
'           Me.toolStripButton3.Click += New System.EventHandler(Me.btnExportHtml_Click)
            '
            ' toolStripButton2
            '
            Me.toolStripButton2.Image = (CType(resources.GetObject("toolStripButton2.Image"), System.Drawing.Image))
            Me.toolStripButton2.ImageTransparentColor = System.Drawing.Color.Magenta
            Me.toolStripButton2.Name = "toolStripButton2"
            Me.toolStripButton2.Size = New System.Drawing.Size(82, 35)
            Me.toolStripButton2.Text = "Export to PDF"
            Me.toolStripButton2.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText
'           Me.toolStripButton2.Click += New System.EventHandler(Me.btnExportPDF_Click)
            '
            ' toolStripButton1
            '
            Me.toolStripButton1.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right
            Me.toolStripButton1.Image = (CType(resources.GetObject("toolStripButton1.Image"), System.Drawing.Image))
            Me.toolStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta
            Me.toolStripButton1.Name = "toolStripButton1"
            Me.toolStripButton1.Size = New System.Drawing.Size(59, 35)
            Me.toolStripButton1.Text = "     E&xit     "
            Me.toolStripButton1.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText
'           Me.toolStripButton1.Click += New System.EventHandler(Me.button2_Click)
            '
            ' mainForm
            '
            Me.AutoScaleDimensions = New System.Drawing.SizeF(6F, 13F)
            Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
            Me.ClientSize = New System.Drawing.Size(528, 126)
            Me.Controls.Add(Me.label1)
            Me.Controls.Add(Me.mainToolbar)
            Me.Name = "mainForm"
            Me.Text = "Features FlexCel"
            Me.mainToolbar.ResumeLayout(False)
            Me.mainToolbar.PerformLayout()
            Me.ResumeLayout(False)
            Me.PerformLayout()

        End Sub
        #End Region

        Private mainToolbar As ToolStrip
        Private WithEvents toolStripButton4 As ToolStripButton
        Private WithEvents toolStripButton3 As ToolStripButton
        Private WithEvents toolStripButton2 As ToolStripButton
        Private WithEvents toolStripButton1 As ToolStripButton
    End Class
End Namespace

Form1.vb

Imports System.Collections
Imports System.ComponentModel
Imports System.IO
Imports System.Reflection
Imports System.Data.OleDb
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports FlexCel.Report
Imports FlexCel.Render
Imports FlexCel.Pdf
Imports System.Globalization

Imports System.Xml

Namespace FeaturesPage
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Public Sub New()
            InitializeComponent()
            'initialize the db.
            dbconnection.ConnectionString = dbconnection.ConnectionString.Replace("Features.mdb", Path.Combine(DataPath, "features.mdb"))
            ResizeToolbar(mainToolbar)
            FlexCelConfig.DpiForImages = 192 'Make the exports in hidpi.
        End Sub

        Private Sub ResizeToolbar(ByVal toolbar As ToolStrip)

            Using gr As Graphics = CreateGraphics()
                Dim xFactor As Double = gr.DpiX / 96.0
                Dim yFactor As Double = gr.DpiY / 96.0
                toolbar.ImageScalingSize = New Size(CInt(Fix(24 * xFactor)), CInt(Fix(24 * yFactor)))
                toolbar.Width = 0 'force a recalc of the buttons.
            End Using
        End Sub

        Private Sub button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles toolStripButton1.Click
            Close()
        End Sub

        Private Shared ReadOnly Property DataPath() As String
            Get
                Return Path.Combine(Path.Combine(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), ".."), "..") & Path.DirectorySeparatorChar
            End Get
        End Property

        Private ReadOnly Property ResultPath() As String
            Get
                Dim BasePath As String = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location)
                Return Path.Combine(BasePath, "Features")
            End Get
        End Property

        Private Function Export(ByVal data As DataSet) As XlsFile
            Using Report As New FlexCelReport(True)
                Report.AddTable(data)
                Report.SetUserFunction("Images", New ImagesImp())
                Dim Xls As New XlsFile(True)
                Xls.Open(Path.Combine(DataPath, "Features Page.template.xls"))

                Report.Run(Xls)
                Return Xls
            End Using

        End Function

        Private Function LoadDataSet() As DataSet
            Dim Result As New DataSet()
            featuresAdapter.Fill(Result, "Features")
            categoriesAdapter.Fill(Result, "Categories")
            hyperlinksAdapter.Fill(Result, "Hyperlinks")
            Result.Relations.Add(Result.Tables("Categories").Columns("CategoryId"), Result.Tables("Features").Columns("CategoryId"))
            Result.Relations.Add(Result.Tables("Features").Columns("FeaturesId"), Result.Tables("Hyperlinks").Columns("FeaturesId"))

            Return Result
        End Function

        Private Sub btnExportExcel_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles toolStripButton4.Click

            Dim XlsPath As String = Path.Combine(ResultPath, "FeaturesFlexCel.xls")
            Using data As DataSet = LoadDataSet()
                Dim Xls As XlsFile = Export(data)

                Directory.CreateDirectory(ResultPath)
                Xls.Save(XlsPath)
            End Using

            If MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) = System.Windows.Forms.DialogResult.Yes Then
                Process.Start(XlsPath)
            End If

        End Sub

        Private Sub btnExportHtml_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles toolStripButton3.Click
            Dim MainHtmlPath As String = Path.Combine(ResultPath, "featuresflexcel.htm")

            Using data As DataSet = LoadDataSet()
                Dim Xls As XlsFile = Export(data)

                Directory.CreateDirectory(ResultPath)
                Using html As New FlexCelHtmlExport(Xls, True)
                    html.ImageResolution = 192
                    html.ImageBackground = Color.White 'Since we are not setting html.FixIE6TransparentPngSupport, we must ensure tehre are no transparent images.
                    Dim SheetSelector As New TStandardSheetSelector(TSheetSelectorPosition.Top)
                    AddHandler SheetSelector.SheetSelectorEntry, AddressOf SheetSelector_SheetSelectorEntry
                    SheetSelector.CssGeneral.Main &= "font-family:Verdana;font-size:10pt;"

                    html.ExportAllVisibleSheetsAsTabs(ResultPath, "Features", ".htm", Nothing, Nothing, SheetSelector)

                    'Rename the first tab so it is "featuresflexcel.htm";
                    Dim Sheets() As String = html.GeneratedFiles.GetHtmlFiles()
                    File.Delete(MainHtmlPath)
                    File.Move(Sheets(0), MainHtmlPath)

                End Using
            End Using
            If MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) = System.Windows.Forms.DialogResult.Yes Then
                Process.Start(MainHtmlPath)
            End If

        End Sub

        Private Shared Sub SheetSelector_SheetSelectorEntry(ByVal sender As Object, ByVal e As SheetSelectorEntryEventArgs)
            'We will rename the first sheet, so we need to update the links here.
            If e.ActiveSheet = 1 Then
                e.Link = "featuresflexcel.htm"
            End If
        End Sub

        Private Sub btnExportPDF_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles toolStripButton2.Click
            Dim PdfPath As String = Path.Combine(ResultPath, "FeaturesFlexCel.pdf")

            Using data As DataSet = LoadDataSet()
                Dim Xls As XlsFile = Export(data)
                Directory.CreateDirectory(ResultPath)

                Using pdf As New FlexCelPdfExport(Xls, True)
                    Using pdfStream As New FileStream(PdfPath, FileMode.Create)
                        pdf.BeginExport(pdfStream)
                        pdf.FontMapping = TFontMapping.ReplaceAllFonts

                        pdf.Properties.Subject = "A list of FlexCel.NET features"
                        pdf.Properties.Author = "TMS Software"
                        pdf.Properties.Title = "List of FlexCel.NET features"
                        pdf.PageLayout = TPageLayout.Outlines
                        pdf.ExportAllVisibleSheets(False, "Features")
                        pdf.EndExport()
                    End Using
                End Using
            End Using

            If MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) = System.Windows.Forms.DialogResult.Yes Then
                Process.Start(PdfPath)
            End If

        End Sub

        Private Class ImagesImp
            Inherits TFlexCelUserFunction

            Public Sub New()
            End Sub

            Public Overrides Function Evaluate(ByVal parameters() As Object) As Object
                If parameters Is Nothing OrElse parameters.Length <> 1 Then
                    Throw New ArgumentException("Bad parameter count in call to Images() user-defined function")
                End If

                Dim ImageFilename As String = Path.Combine(Path.Combine(DataPath, "images"), "Features" & Convert.ToString(parameters(0), CultureInfo.InvariantCulture) & ".png")
                If File.Exists(ImageFilename) Then
                    Using fs As New FileStream(ImageFilename, FileMode.Open)
                        Dim Result(CInt(fs.Length) - 1) As Byte
                        fs.Read(Result, 0, Result.Length)
                        Return Result
                    End Using
                End If

                Return Nothing
            End Function
        End Class

    End Class

End Namespace

Program.vb

Namespace FeaturesPage
    Friend NotInheritable Class Program

        Private Sub New()
        End Sub

        ''' <summary>
        ''' The main entry point for the application.
        ''' </summary>
       <STAThread> _
        Shared Sub Main()
            Application.EnableVisualStyles()
            Application.SetCompatibleTextRenderingDefault(False)
            Application.Run(New mainForm())
        End Sub
    End Class
End Namespace


Printing, previewing and exporting files (VB.Net / netframework) | FlexCel Studio for the .NET Framework documentation

Printing, previewing and exporting files (VB.Net / netframework)

Overview

FlexCel reporting is oriented to creating files, not to print them. Once you have the files you can save them, email them or just print them if that's what you really need. But, sometimes you might want to directly print the report, and here is where FlexCelPrintDocument can be helpful. You might want also to export the report to PDF, and then you would use FlexCelPdfExport. Or you might want to export the Excel file as an image, or to fax it, using FlexCelImgExport.

All of those components share a common rendering engine, that "renders" the xls file to a canvas, so it can be printed or saved. Keep in mind that results are not 100% the same, and they cannot be, but they are very similar.

FlexCelPrintDocument is a Winforms PrintDocument descendant, and you can use it on the same way. This means you can use it with a standard PrintPreviewDialog or PrintPreviewControl as you would do with any PrintDocument.

In this section

  • Printing, previewing and exporting

  • Custom previewing

  • Exporting Excel files to PDF

  • Exporting to PDF/A

  • Signing PDFs

  • Exporting Excel files to HTML

  • Exporting Excel files to SVG

  • Rendering standalone objects

  • Using the FlexCel ASP viewer component


Printing, previewing and exporting (VB.Net / netframework) | FlexCel Studio for the .NET Framework documentation

Printing, previewing and exporting (VB.Net / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\vb\VS2022\netframework\25.Printing and Exporting\10.Print Preview and Export and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​vb/​VS2022/​netframework/​Modules/​25.​Printing and Exporting/10.Print Preview and Export

Overview

A small demo on how to use FlexCelPrintDocument to natively print and preview any existing Excel File, and on how to use FlexCelImgExport to convert any Excel file to images. Pdf export is not shown here, but it is on other examples.

Concepts

  • FlexCelPrintDocument output is not 100% identical to Excel output, and it can't be that way. But it is very similar, and this includes fonts, colors, margins, headers/footers/images, etc. It can print cells with multiple fonts, it can replace the macros on headers and footers (like "&CPage &P of &N"), it can show conditional formats, and the list goes on.

  • You can customize the final output by assigning a PagePrint event. On this demo, it is customized so it prints "Confidential" on each page. (if you select the checkbox)

  • How to export the generated output to images or a multipage tiff, which is the format used to send faxes. On this example, the tiff quality is hard-coded on the demo to 96 DPI, but you can increase to get better-looking pictures (and higher file sizes)

Files

AssemblyInfo.vb

Imports System.Reflection
Imports System.Runtime.CompilerServices

'
' General Information about an assembly is controlled through the following
' set of attributes. Change these attribute values to modify the information
' associated with an assembly.
'
<Assembly: AssemblyTitle("")>
<Assembly: AssemblyDescription("")>
<Assembly: AssemblyConfiguration("")>
<Assembly: AssemblyCompany("")>
<Assembly: AssemblyProduct("")>
<Assembly: AssemblyCopyright("(c) 2002 - 2014 TMS Software")>
<Assembly: AssemblyTrademark("")>
<Assembly: AssemblyCulture("")>

'
' Version information for an assembly consists of the following four values:
'
'      Major Version
'      Minor Version
'      Build Number
'      Revision
'
' You can specify all the values or you can default the Revision and Build Numbers
' by using the '*' as shown below:

<Assembly: AssemblyVersion("6.2.1.0")>

'
' In order to sign your assembly you must specify a key to use. Refer to the
' Microsoft .NET Framework documentation for more information on assembly signing.
'
' Use the attributes below to control which key is used for signing.
'
' Notes:
'   (*) If no key is specified, the assembly is not signed.
'   (*) KeyName refers to a key that has been installed in the Crypto Service
'       Provider (CSP) on your machine. KeyFile refers to a file which contains
'       a key.
'   (*) If the KeyFile and the KeyName values are both specified, the
'       following processing occurs:
'       (1) If the KeyName can be found in the CSP, that key is used.
'       (2) If the KeyName does not exist and the KeyFile does exist, the key
'           in the KeyFile is installed into the CSP and used.
'   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
'       When specifying the KeyFile, the location of the KeyFile should be
'       relative to the project output directory which is
'       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
'       located in the project directory, you would specify the AssemblyKeyFile
'       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
'   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
'       documentation for more information on this.
'
<Assembly: AssemblyDelaySign(False)>
<Assembly: AssemblyKeyFile("")>
<Assembly: AssemblyKeyName("")>

Form1.Designer.vb

Imports System.Drawing.Imaging
Imports System.Collections
Imports System.ComponentModel
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports FlexCel.Render
Imports System.IO
Imports System.Reflection
Imports System.Drawing.Drawing2D
Imports System.Drawing.Printing
Imports System.Runtime.InteropServices
Namespace PrintPreviewandExport
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Private openFileDialog1 As System.Windows.Forms.OpenFileDialog
        Private printDialog1 As System.Windows.Forms.PrintDialog
        Private printPreviewDialog1 As System.Windows.Forms.PrintPreviewDialog
        Private panel1 As System.Windows.Forms.Panel
        Private label1 As System.Windows.Forms.Label
        Private edFileName As System.Windows.Forms.TextBox
        Private chFormulaText As System.Windows.Forms.CheckBox
        Private chAntiAlias As System.Windows.Forms.CheckBox
        Private chGridLines As System.Windows.Forms.CheckBox
        Private edHeader As System.Windows.Forms.TextBox
        Private label2 As System.Windows.Forms.Label
        Private edFooter As System.Windows.Forms.TextBox
        Private label3 As System.Windows.Forms.Label
        Private edHPages As System.Windows.Forms.TextBox
        Private edVPages As System.Windows.Forms.TextBox
        Private label5 As System.Windows.Forms.Label
        Private label6 As System.Windows.Forms.Label
        Private chPrintLeft As System.Windows.Forms.CheckBox
        Private WithEvents chFitIn As System.Windows.Forms.CheckBox
        Private label4 As System.Windows.Forms.Label
        Private edZoom As System.Windows.Forms.TextBox
        Private label7 As System.Windows.Forms.Label
        Private edl As System.Windows.Forms.TextBox
        Private label8 As System.Windows.Forms.Label
        Private edt As System.Windows.Forms.TextBox
        Private label9 As System.Windows.Forms.Label
        Private edr As System.Windows.Forms.TextBox
        Private labelb As System.Windows.Forms.Label
        Private edb As System.Windows.Forms.TextBox
        Private label10 As System.Windows.Forms.Label
        Private edh As System.Windows.Forms.TextBox
        Private label11 As System.Windows.Forms.Label
        Private edf As System.Windows.Forms.TextBox
        Private Landscape As System.Windows.Forms.CheckBox
        Private panel3 As System.Windows.Forms.Panel
        Private label12 As System.Windows.Forms.Label
        Private label13 As System.Windows.Forms.Label
        Private label14 As System.Windows.Forms.Label
        Private edTop As System.Windows.Forms.TextBox
        Private edLeft As System.Windows.Forms.TextBox
        Private label15 As System.Windows.Forms.Label
        Private edRight As System.Windows.Forms.TextBox
        Private label16 As System.Windows.Forms.Label
        Private edBottom As System.Windows.Forms.TextBox
        Private label17 As System.Windows.Forms.Label
        Private WithEvents cbSheet As System.Windows.Forms.ComboBox
        Private label18 As System.Windows.Forms.Label
        Private cbConfidential As System.Windows.Forms.CheckBox
        Private exportImageDialog As System.Windows.Forms.SaveFileDialog
        Private chHeadings As System.Windows.Forms.CheckBox
        Private label19 As System.Windows.Forms.Label
        Private cbInterpolation As System.Windows.Forms.ComboBox
        Private exportTiffDialog As System.Windows.Forms.SaveFileDialog
        Private WithEvents cbAllSheets As System.Windows.Forms.CheckBox
        Private panel4 As System.Windows.Forms.Panel
        Private cbResetPageNumber As System.Windows.Forms.CheckBox
        Private components As System.ComponentModel.IContainer = Nothing

        ''' <summary>
        ''' Clean up any resources being used.
        ''' </summary>
        Protected Overrides Sub Dispose(ByVal disposing As Boolean)
            If disposing Then
                If components IsNot Nothing Then
                    components.Dispose()
                End If
            End If
            MyBase.Dispose(disposing)
        End Sub

        #Region "Windows Form Designer generated code"
        ''' <summary>
        ''' Required method for Designer support - do not modify
        ''' the contents of this method with the code editor.
        ''' </summary>
        Private Sub InitializeComponent()
            Dim resources As New System.ComponentModel.ComponentResourceManager(GetType(mainForm))
            Me.openFileDialog1 = New System.Windows.Forms.OpenFileDialog()
            Me.printDialog1 = New System.Windows.Forms.PrintDialog()
            Me.flexCelPrintDocument1 = New FlexCel.Render.FlexCelPrintDocument()
            Me.printPreviewDialog1 = New System.Windows.Forms.PrintPreviewDialog()
            Me.panel1 = New System.Windows.Forms.Panel()
            Me.cbResetPageNumber = New System.Windows.Forms.CheckBox()
            Me.panel4 = New System.Windows.Forms.Panel()
            Me.cbAllSheets = New System.Windows.Forms.CheckBox()
            Me.label19 = New System.Windows.Forms.Label()
            Me.cbInterpolation = New System.Windows.Forms.ComboBox()
            Me.chHeadings = New System.Windows.Forms.CheckBox()
            Me.cbConfidential = New System.Windows.Forms.CheckBox()
            Me.label18 = New System.Windows.Forms.Label()
            Me.cbSheet = New System.Windows.Forms.ComboBox()
            Me.panel3 = New System.Windows.Forms.Panel()
            Me.edBottom = New System.Windows.Forms.TextBox()
            Me.label17 = New System.Windows.Forms.Label()
            Me.edRight = New System.Windows.Forms.TextBox()
            Me.label16 = New System.Windows.Forms.Label()
            Me.edLeft = New System.Windows.Forms.TextBox()
            Me.label15 = New System.Windows.Forms.Label()
            Me.edTop = New System.Windows.Forms.TextBox()
            Me.label14 = New System.Windows.Forms.Label()
            Me.label13 = New System.Windows.Forms.Label()
            Me.label12 = New System.Windows.Forms.Label()
            Me.Landscape = New System.Windows.Forms.CheckBox()
            Me.label11 = New System.Windows.Forms.Label()
            Me.edf = New System.Windows.Forms.TextBox()
            Me.labelb = New System.Windows.Forms.Label()
            Me.edb = New System.Windows.Forms.TextBox()
            Me.label9 = New System.Windows.Forms.Label()
            Me.edr = New System.Windows.Forms.TextBox()
            Me.label8 = New System.Windows.Forms.Label()
            Me.edt = New System.Windows.Forms.TextBox()
            Me.label7 = New System.Windows.Forms.Label()
            Me.edl = New System.Windows.Forms.TextBox()
            Me.label4 = New System.Windows.Forms.Label()
            Me.edZoom = New System.Windows.Forms.TextBox()
            Me.chFitIn = New System.Windows.Forms.CheckBox()
            Me.chPrintLeft = New System.Windows.Forms.CheckBox()
            Me.label6 = New System.Windows.Forms.Label()
            Me.label5 = New System.Windows.Forms.Label()
            Me.edVPages = New System.Windows.Forms.TextBox()
            Me.edHPages = New System.Windows.Forms.TextBox()
            Me.edFooter = New System.Windows.Forms.TextBox()
            Me.label3 = New System.Windows.Forms.Label()
            Me.edHeader = New System.Windows.Forms.TextBox()
            Me.label2 = New System.Windows.Forms.Label()
            Me.edFileName = New System.Windows.Forms.TextBox()
            Me.chFormulaText = New System.Windows.Forms.CheckBox()
            Me.chGridLines = New System.Windows.Forms.CheckBox()
            Me.chAntiAlias = New System.Windows.Forms.CheckBox()
            Me.label1 = New System.Windows.Forms.Label()
            Me.label10 = New System.Windows.Forms.Label()
            Me.edh = New System.Windows.Forms.TextBox()
            Me.exportImageDialog = New System.Windows.Forms.SaveFileDialog()
            Me.exportTiffDialog = New System.Windows.Forms.SaveFileDialog()
            Me.mainToolbar = New System.Windows.Forms.ToolStrip()
            Me.btnOpenFile = New System.Windows.Forms.ToolStripButton()
            Me.toolStripSeparator1 = New System.Windows.Forms.ToolStripSeparator()
            Me.btnSetup = New System.Windows.Forms.ToolStripButton()
            Me.btnPreview = New System.Windows.Forms.ToolStripButton()
            Me.btnPrint = New System.Windows.Forms.ToolStripButton()
            Me.toolStripSeparator2 = New System.Windows.Forms.ToolStripSeparator()
            Me.btnExportAsImages = New System.Windows.Forms.ToolStripDropDownButton()
            Me.usingFlexCelImgExportAllPagesrecommendedWayToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
            Me.blackAndWhiteToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
            Me.colorsToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
            Me.trueColorToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
            Me.usingFlexCelImgExport1PagerecommendedWayToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
            Me.blackAndWhiteToolStripMenuItem1 = New System.Windows.Forms.ToolStripMenuItem()
            Me.colorsToolStripMenuItem1 = New System.Windows.Forms.ToolStripMenuItem()
            Me.trueColorToolStripMenuItem1 = New System.Windows.Forms.ToolStripMenuItem()
            Me.multiPageTIFFUsingFlexCelImgExportToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
            Me.faxToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
            Me.blackAndWhiteToolStripMenuItem2 = New System.Windows.Forms.ToolStripMenuItem()
            Me.colorsToolStripMenuItem2 = New System.Windows.Forms.ToolStripMenuItem()
            Me.trueColorToolStripMenuItem2 = New System.Windows.Forms.ToolStripMenuItem()
            Me.btnExit = New System.Windows.Forms.ToolStripButton()
            Me.panel1.SuspendLayout()
            Me.panel3.SuspendLayout()
            Me.mainToolbar.SuspendLayout()
            Me.SuspendLayout()
            '
            ' openFileDialog1
            '
            Me.openFileDialog1.DefaultExt = "xls"
            Me.openFileDialog1.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm|Excel 97/2003|*.xls|Excel 2007|*.xlsx;*.xlsm|All " & "files|*.*"
            Me.openFileDialog1.Title = "Open an Excel File"
            '
            ' printDialog1
            '
            Me.printDialog1.AllowSomePages = True
            Me.printDialog1.Document = Me.flexCelPrintDocument1
            '
            ' flexCelPrintDocument1
            '
            Me.flexCelPrintDocument1.AllVisibleSheets = False
            Me.flexCelPrintDocument1.ResetPageNumberOnEachSheet = False
            Me.flexCelPrintDocument1.Workbook = Nothing
'           Me.flexCelPrintDocument1.GetPrinterHardMargins += New FlexCel.Render.PrintHardMarginsEventHandler(Me.flexCelPrintDocument1_GetPrinterHardMargins)
'           Me.flexCelPrintDocument1.BeforePrintPage += New System.Drawing.Printing.PrintPageEventHandler(Me.flexCelPrintDocument1_BeforePrintPage)
'           Me.flexCelPrintDocument1.PrintPage += New System.Drawing.Printing.PrintPageEventHandler(Me.flexCelPrintDocument1_PrintPage)
            '
            ' printPreviewDialog1
            '
            Me.printPreviewDialog1.AutoScrollMargin = New System.Drawing.Size(0, 0)
            Me.printPreviewDialog1.AutoScrollMinSize = New System.Drawing.Size(0, 0)
            Me.printPreviewDialog1.ClientSize = New System.Drawing.Size(400, 300)
            Me.printPreviewDialog1.Document = Me.flexCelPrintDocument1
            Me.printPreviewDialog1.Enabled = True
            Me.printPreviewDialog1.Icon = (CType(resources.GetObject("printPreviewDialog1.Icon"), System.Drawing.Icon))
            Me.printPreviewDialog1.Name = "printPreviewDialog1"
            Me.printPreviewDialog1.Visible = False
            '
            ' panel1
            '
            Me.panel1.BackColor = System.Drawing.Color.White
            Me.panel1.Controls.Add(Me.cbResetPageNumber)
            Me.panel1.Controls.Add(Me.panel4)
            Me.panel1.Controls.Add(Me.cbAllSheets)
            Me.panel1.Controls.Add(Me.label19)
            Me.panel1.Controls.Add(Me.cbInterpolation)
            Me.panel1.Controls.Add(Me.chHeadings)
            Me.panel1.Controls.Add(Me.cbConfidential)
            Me.panel1.Controls.Add(Me.label18)
            Me.panel1.Controls.Add(Me.cbSheet)
            Me.panel1.Controls.Add(Me.panel3)
            Me.panel1.Controls.Add(Me.Landscape)
            Me.panel1.Controls.Add(Me.label11)
            Me.panel1.Controls.Add(Me.edf)
            Me.panel1.Controls.Add(Me.labelb)
            Me.panel1.Controls.Add(Me.edb)
            Me.panel1.Controls.Add(Me.label9)
            Me.panel1.Controls.Add(Me.edr)
            Me.panel1.Controls.Add(Me.label8)
            Me.panel1.Controls.Add(Me.edt)
            Me.panel1.Controls.Add(Me.label7)
            Me.panel1.Controls.Add(Me.edl)
            Me.panel1.Controls.Add(Me.label4)
            Me.panel1.Controls.Add(Me.edZoom)
            Me.panel1.Controls.Add(Me.chFitIn)
            Me.panel1.Controls.Add(Me.chPrintLeft)
            Me.panel1.Controls.Add(Me.label6)
            Me.panel1.Controls.Add(Me.label5)
            Me.panel1.Controls.Add(Me.edVPages)
            Me.panel1.Controls.Add(Me.edHPages)
            Me.panel1.Controls.Add(Me.edFooter)
            Me.panel1.Controls.Add(Me.label3)
            Me.panel1.Controls.Add(Me.edHeader)
            Me.panel1.Controls.Add(Me.label2)
            Me.panel1.Controls.Add(Me.edFileName)
            Me.panel1.Controls.Add(Me.chFormulaText)
            Me.panel1.Controls.Add(Me.chGridLines)
            Me.panel1.Controls.Add(Me.chAntiAlias)
            Me.panel1.Controls.Add(Me.label1)
            Me.panel1.Controls.Add(Me.label10)
            Me.panel1.Controls.Add(Me.edh)
            Me.panel1.Dock = System.Windows.Forms.DockStyle.Fill
            Me.panel1.Location = New System.Drawing.Point(0, 38)
            Me.panel1.Name = "panel1"
            Me.panel1.Size = New System.Drawing.Size(768, 479)
            Me.panel1.TabIndex = 3
            '
            ' cbResetPageNumber
            '
            Me.cbResetPageNumber.Enabled = False
            Me.cbResetPageNumber.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, (CByte(0)))
            Me.cbResetPageNumber.Location = New System.Drawing.Point(528, 48)
            Me.cbResetPageNumber.Name = "cbResetPageNumber"
            Me.cbResetPageNumber.Size = New System.Drawing.Size(216, 16)
            Me.cbResetPageNumber.TabIndex = 39
            Me.cbResetPageNumber.Text = "Reset Page number on each sheet."
            '
            ' panel4
            '
            Me.panel4.Anchor = (CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.panel4.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
            Me.panel4.Location = New System.Drawing.Point(16, 72)
            Me.panel4.Name = "panel4"
            Me.panel4.Size = New System.Drawing.Size(736, 3)
            Me.panel4.TabIndex = 38
            '
            ' cbAllSheets
            '
            Me.cbAllSheets.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (CByte(0)))
            Me.cbAllSheets.Location = New System.Drawing.Point(32, 48)
            Me.cbAllSheets.Name = "cbAllSheets"
            Me.cbAllSheets.Size = New System.Drawing.Size(104, 16)
            Me.cbAllSheets.TabIndex = 37
            Me.cbAllSheets.Text = "All Sheets"
'           Me.cbAllSheets.CheckedChanged += New System.EventHandler(Me.cbAllSheets_CheckedChanged)
            '
            ' label19
            '
            Me.label19.Location = New System.Drawing.Point(392, 80)
            Me.label19.Name = "label19"
            Me.label19.Size = New System.Drawing.Size(160, 40)
            Me.label19.TabIndex = 36
            Me.label19.Text = "Interpolation mode for images: Sometimes a lower mode might give crisper results." & ""
            '
            ' cbInterpolation
            '
            Me.cbInterpolation.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
            Me.cbInterpolation.Items.AddRange(New Object() { "Bicubic", "Bilinear", "Default", "High", "HighQualityBicubic", "HighQualityBilinear ", "Low", "NearestNeighbor"})
            Me.cbInterpolation.Location = New System.Drawing.Point(560, 88)
            Me.cbInterpolation.Name = "cbInterpolation"
            Me.cbInterpolation.Size = New System.Drawing.Size(152, 21)
            Me.cbInterpolation.TabIndex = 35
            '
            ' chHeadings
            '
            Me.chHeadings.Location = New System.Drawing.Point(176, 136)
            Me.chHeadings.Name = "chHeadings"
            Me.chHeadings.Size = New System.Drawing.Size(128, 24)
            Me.chHeadings.TabIndex = 34
            Me.chHeadings.Text = "Print Headings"
            '
            ' cbConfidential
            '
            Me.cbConfidential.Location = New System.Drawing.Point(56, 112)
            Me.cbConfidential.Name = "cbConfidential"
            Me.cbConfidential.Size = New System.Drawing.Size(232, 16)
            Me.cbConfidential.TabIndex = 33
            Me.cbConfidential.Text = "Print ""Confidential"" on each page"
            '
            ' label18
            '
            Me.label18.Font = New System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (CByte(0)))
            Me.label18.Location = New System.Drawing.Point(168, 48)
            Me.label18.Name = "label18"
            Me.label18.Size = New System.Drawing.Size(88, 16)
            Me.label18.TabIndex = 32
            Me.label18.Text = "Sheet to print:"
            '
            ' cbSheet
            '
            Me.cbSheet.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
            Me.cbSheet.Location = New System.Drawing.Point(256, 43)
            Me.cbSheet.Name = "cbSheet"
            Me.cbSheet.Size = New System.Drawing.Size(160, 21)
            Me.cbSheet.TabIndex = 31
'           Me.cbSheet.SelectedIndexChanged += New System.EventHandler(Me.cbSheet_SelectedIndexChanged)
            '
            ' panel3
            '
            Me.panel3.Anchor = (CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.panel3.BackColor = System.Drawing.Color.FromArgb((CInt((CByte(255)))), (CInt((CByte(255)))), (CInt((CByte(192)))))
            Me.panel3.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
            Me.panel3.Controls.Add(Me.edBottom)
            Me.panel3.Controls.Add(Me.label17)
            Me.panel3.Controls.Add(Me.edRight)
            Me.panel3.Controls.Add(Me.label16)
            Me.panel3.Controls.Add(Me.edLeft)
            Me.panel3.Controls.Add(Me.label15)
            Me.panel3.Controls.Add(Me.edTop)
            Me.panel3.Controls.Add(Me.label14)
            Me.panel3.Controls.Add(Me.label13)
            Me.panel3.Controls.Add(Me.label12)
            Me.panel3.Location = New System.Drawing.Point(504, 232)
            Me.panel3.Name = "panel3"
            Me.panel3.Size = New System.Drawing.Size(216, 224)
            Me.panel3.TabIndex = 30
            '
            ' edBottom
            '
            Me.edBottom.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
            Me.edBottom.Location = New System.Drawing.Point(80, 136)
            Me.edBottom.Name = "edBottom"
            Me.edBottom.Size = New System.Drawing.Size(48, 20)
            Me.edBottom.TabIndex = 26
            Me.edBottom.Text = "0"
            '
            ' label17
            '
            Me.label17.Font = New System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (CByte(0)))
            Me.label17.Location = New System.Drawing.Point(16, 160)
            Me.label17.Name = "label17"
            Me.label17.Size = New System.Drawing.Size(56, 16)
            Me.label17.TabIndex = 25
            Me.label17.Text = "Last Col:"
            '
            ' edRight
            '
            Me.edRight.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
            Me.edRight.Location = New System.Drawing.Point(80, 160)
            Me.edRight.Name = "edRight"
            Me.edRight.Size = New System.Drawing.Size(48, 20)
            Me.edRight.TabIndex = 24
            Me.edRight.Text = "0"
            '
            ' label16
            '
            Me.label16.Font = New System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (CByte(0)))
            Me.label16.Location = New System.Drawing.Point(16, 136)
            Me.label16.Name = "label16"
            Me.label16.Size = New System.Drawing.Size(85, 16)
            Me.label16.TabIndex = 23
            Me.label16.Text = "Last Row:"
            '
            ' edLeft
            '
            Me.edLeft.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
            Me.edLeft.Location = New System.Drawing.Point(80, 112)
            Me.edLeft.Name = "edLeft"
            Me.edLeft.Size = New System.Drawing.Size(48, 20)
            Me.edLeft.TabIndex = 22
            Me.edLeft.Text = "0"
            '
            ' label15
            '
            Me.label15.Font = New System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (CByte(0)))
            Me.label15.Location = New System.Drawing.Point(16, 112)
            Me.label15.Name = "label15"
            Me.label15.Size = New System.Drawing.Size(85, 16)
            Me.label15.TabIndex = 21
            Me.label15.Text = "First Col:"
            '
            ' edTop
            '
            Me.edTop.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
            Me.edTop.Location = New System.Drawing.Point(80, 88)
            Me.edTop.Name = "edTop"
            Me.edTop.Size = New System.Drawing.Size(48, 20)
            Me.edTop.TabIndex = 20
            Me.edTop.Text = "0"
            '
            ' label14
            '
            Me.label14.Font = New System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (CByte(0)))
            Me.label14.Location = New System.Drawing.Point(8, 88)
            Me.label14.Name = "label14"
            Me.label14.Size = New System.Drawing.Size(85, 16)
            Me.label14.TabIndex = 3
            Me.label14.Text = "First Row:"
            '
            ' label13
            '
            Me.label13.Anchor = (CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.label13.Font = New System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, (CByte(0)))
            Me.label13.Location = New System.Drawing.Point(8, 32)
            Me.label13.Name = "label13"
            Me.label13.Size = New System.Drawing.Size(192, 32)
            Me.label13.TabIndex = 2
            Me.label13.Text = "If one of this values is <=0 all print_range will be printed"
            '
            ' label12
            '
            Me.label12.Font = New System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (CByte(0)))
            Me.label12.Location = New System.Drawing.Point(8, 16)
            Me.label12.Name = "label12"
            Me.label12.Size = New System.Drawing.Size(192, 16)
            Me.label12.TabIndex = 1
            Me.label12.Text = "Range to Print:"
            '
            ' Landscape
            '
            Me.Landscape.Location = New System.Drawing.Point(456, 136)
            Me.Landscape.Name = "Landscape"
            Me.Landscape.Size = New System.Drawing.Size(96, 24)
            Me.Landscape.TabIndex = 29
            Me.Landscape.Text = "Landscape"
            '
            ' label11
            '
            Me.label11.Font = New System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (CByte(0)))
            Me.label11.Location = New System.Drawing.Point(264, 416)
            Me.label11.Name = "label11"
            Me.label11.Size = New System.Drawing.Size(80, 16)
            Me.label11.TabIndex = 28
            Me.label11.Text = "Footer Margin"
            '
            ' edf
            '
            Me.edf.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
            Me.edf.Location = New System.Drawing.Point(344, 416)
            Me.edf.Name = "edf"
            Me.edf.Size = New System.Drawing.Size(128, 20)
            Me.edf.TabIndex = 27
            '
            ' labelb
            '
            Me.labelb.Font = New System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (CByte(0)))
            Me.labelb.Location = New System.Drawing.Point(256, 368)
            Me.labelb.Name = "labelb"
            Me.labelb.Size = New System.Drawing.Size(88, 16)
            Me.labelb.TabIndex = 26
            Me.labelb.Text = "Bottom Margin"
            '
            ' edb
            '
            Me.edb.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
            Me.edb.Location = New System.Drawing.Point(344, 368)
            Me.edb.Name = "edb"
            Me.edb.Size = New System.Drawing.Size(128, 20)
            Me.edb.TabIndex = 25
            '
            ' label9
            '
            Me.label9.Font = New System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (CByte(0)))
            Me.label9.Location = New System.Drawing.Point(56, 368)
            Me.label9.Name = "label9"
            Me.label9.Size = New System.Drawing.Size(80, 16)
            Me.label9.TabIndex = 24
            Me.label9.Text = "Right Margin"
            '
            ' edr
            '
            Me.edr.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
            Me.edr.Location = New System.Drawing.Point(136, 368)
            Me.edr.Name = "edr"
            Me.edr.Size = New System.Drawing.Size(112, 20)
            Me.edr.TabIndex = 23
            '
            ' label8
            '
            Me.label8.Font = New System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (CByte(0)))
            Me.label8.Location = New System.Drawing.Point(264, 328)
            Me.label8.Name = "label8"
            Me.label8.Size = New System.Drawing.Size(80, 16)
            Me.label8.TabIndex = 22
            Me.label8.Text = "Top Margin"
            '
            ' edt
            '
            Me.edt.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
            Me.edt.Location = New System.Drawing.Point(344, 328)
            Me.edt.Name = "edt"
            Me.edt.Size = New System.Drawing.Size(128, 20)
            Me.edt.TabIndex = 21
            '
            ' label7
            '
            Me.label7.Font = New System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (CByte(0)))
            Me.label7.Location = New System.Drawing.Point(56, 328)
            Me.label7.Name = "label7"
            Me.label7.Size = New System.Drawing.Size(80, 16)
            Me.label7.TabIndex = 20
            Me.label7.Text = "Left Margin"
            '
            ' edl
            '
            Me.edl.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
            Me.edl.Location = New System.Drawing.Point(136, 328)
            Me.edl.Name = "edl"
            Me.edl.Size = New System.Drawing.Size(112, 20)
            Me.edl.TabIndex = 19
            '
            ' label4
            '
            Me.label4.Font = New System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (CByte(0)))
            Me.label4.Location = New System.Drawing.Point(120, 280)
            Me.label4.Name = "label4"
            Me.label4.Size = New System.Drawing.Size(56, 16)
            Me.label4.TabIndex = 18
            Me.label4.Text = "Zoom (%)"
            '
            ' edZoom
            '
            Me.edZoom.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
            Me.edZoom.Location = New System.Drawing.Point(184, 280)
            Me.edZoom.Name = "edZoom"
            Me.edZoom.Size = New System.Drawing.Size(24, 20)
            Me.edZoom.TabIndex = 17
            '
            ' chFitIn
            '
            Me.chFitIn.Font = New System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (CByte(0)))
            Me.chFitIn.Location = New System.Drawing.Point(56, 248)
            Me.chFitIn.Name = "chFitIn"
            Me.chFitIn.Size = New System.Drawing.Size(56, 24)
            Me.chFitIn.TabIndex = 16
            Me.chFitIn.Text = "Fit in"
'           Me.chFitIn.CheckedChanged += New System.EventHandler(Me.chFitIn_CheckedChanged)
            '
            ' chPrintLeft
            '
            Me.chPrintLeft.Location = New System.Drawing.Point(312, 136)
            Me.chPrintLeft.Name = "chPrintLeft"
            Me.chPrintLeft.Size = New System.Drawing.Size(136, 24)
            Me.chPrintLeft.TabIndex = 15
            Me.chPrintLeft.Text = "Print Left, then down."
            '
            ' label6
            '
            Me.label6.Font = New System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (CByte(0)))
            Me.label6.Location = New System.Drawing.Point(256, 248)
            Me.label6.Name = "label6"
            Me.label6.Size = New System.Drawing.Size(80, 16)
            Me.label6.TabIndex = 14
            Me.label6.Text = "pages tall."
            '
            ' label5
            '
            Me.label5.Font = New System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (CByte(0)))
            Me.label5.Location = New System.Drawing.Point(144, 248)
            Me.label5.Name = "label5"
            Me.label5.Size = New System.Drawing.Size(80, 16)
            Me.label5.TabIndex = 13
            Me.label5.Text = "pages wide x"
            '
            ' edVPages
            '
            Me.edVPages.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
            Me.edVPages.Location = New System.Drawing.Point(224, 248)
            Me.edVPages.Name = "edVPages"
            Me.edVPages.ReadOnly = True
            Me.edVPages.Size = New System.Drawing.Size(24, 20)
            Me.edVPages.TabIndex = 12
            '
            ' edHPages
            '
            Me.edHPages.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
            Me.edHPages.Location = New System.Drawing.Point(112, 248)
            Me.edHPages.Name = "edHPages"
            Me.edHPages.ReadOnly = True
            Me.edHPages.Size = New System.Drawing.Size(24, 20)
            Me.edHPages.TabIndex = 10
            '
            ' edFooter
            '
            Me.edFooter.Anchor = (CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.edFooter.BackColor = System.Drawing.Color.White
            Me.edFooter.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
            Me.edFooter.Location = New System.Drawing.Point(112, 200)
            Me.edFooter.Name = "edFooter"
            Me.edFooter.Size = New System.Drawing.Size(608, 20)
            Me.edFooter.TabIndex = 8
            '
            ' label3
            '
            Me.label3.Font = New System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (CByte(0)))
            Me.label3.Location = New System.Drawing.Point(56, 200)
            Me.label3.Name = "label3"
            Me.label3.Size = New System.Drawing.Size(56, 16)
            Me.label3.TabIndex = 7
            Me.label3.Text = "Footer:"
            '
            ' edHeader
            '
            Me.edHeader.Anchor = (CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.edHeader.BackColor = System.Drawing.Color.White
            Me.edHeader.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
            Me.edHeader.Location = New System.Drawing.Point(112, 176)
            Me.edHeader.Name = "edHeader"
            Me.edHeader.Size = New System.Drawing.Size(608, 20)
            Me.edHeader.TabIndex = 6
            '
            ' label2
            '
            Me.label2.Font = New System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (CByte(0)))
            Me.label2.Location = New System.Drawing.Point(56, 176)
            Me.label2.Name = "label2"
            Me.label2.Size = New System.Drawing.Size(56, 16)
            Me.label2.TabIndex = 5
            Me.label2.Text = "Header:"
            '
            ' edFileName
            '
            Me.edFileName.Anchor = (CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.edFileName.BackColor = System.Drawing.Color.White
            Me.edFileName.BorderStyle = System.Windows.Forms.BorderStyle.None
            Me.edFileName.Location = New System.Drawing.Point(112, 16)
            Me.edFileName.Name = "edFileName"
            Me.edFileName.ReadOnly = True
            Me.edFileName.Size = New System.Drawing.Size(632, 13)
            Me.edFileName.TabIndex = 4
            Me.edFileName.Text = "No file selected"
            '
            ' chFormulaText
            '
            Me.chFormulaText.Location = New System.Drawing.Point(576, 136)
            Me.chFormulaText.Name = "chFormulaText"
            Me.chFormulaText.Size = New System.Drawing.Size(136, 24)
            Me.chFormulaText.TabIndex = 3
            Me.chFormulaText.Text = "Print Formula Text"
            '
            ' chGridLines
            '
            Me.chGridLines.Location = New System.Drawing.Point(56, 136)
            Me.chGridLines.Name = "chGridLines"
            Me.chGridLines.Size = New System.Drawing.Size(104, 24)
            Me.chGridLines.TabIndex = 2
            Me.chGridLines.Text = "Print Grid Lines"
            '
            ' chAntiAlias
            '
            Me.chAntiAlias.Location = New System.Drawing.Point(56, 88)
            Me.chAntiAlias.Name = "chAntiAlias"
            Me.chAntiAlias.Size = New System.Drawing.Size(152, 16)
            Me.chAntiAlias.TabIndex = 1
            Me.chAntiAlias.Text = "Antialias Text"
            '
            ' label1
            '
            Me.label1.Font = New System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (CByte(0)))
            Me.label1.Location = New System.Drawing.Point(24, 16)
            Me.label1.Name = "label1"
            Me.label1.Size = New System.Drawing.Size(80, 16)
            Me.label1.TabIndex = 0
            Me.label1.Text = "File to print:"
            '
            ' label10
            '
            Me.label10.Font = New System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (CByte(0)))
            Me.label10.Location = New System.Drawing.Point(48, 416)
            Me.label10.Name = "label10"
            Me.label10.Size = New System.Drawing.Size(88, 16)
            Me.label10.TabIndex = 22
            Me.label10.Text = "Header Margin"
            '
            ' edh
            '
            Me.edh.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
            Me.edh.Location = New System.Drawing.Point(136, 416)
            Me.edh.Name = "edh"
            Me.edh.Size = New System.Drawing.Size(112, 20)
            Me.edh.TabIndex = 21
            '
            ' exportImageDialog
            '
            Me.exportImageDialog.DefaultExt = "png"
            Me.exportImageDialog.Filter = "Png files|*.png|Jpg files|*.jpg"
            Me.exportImageDialog.Title = "Save image as..."
            '
            ' exportTiffDialog
            '
            Me.exportTiffDialog.DefaultExt = "tif"
            Me.exportTiffDialog.Filter = "TIFF Files|*.tif"
            Me.exportTiffDialog.Title = "Save image as multi page tiff..."
            '
            ' mainToolbar
            '
            Me.mainToolbar.Items.AddRange(New System.Windows.Forms.ToolStripItem() { Me.btnOpenFile, Me.toolStripSeparator1, Me.btnSetup, Me.btnPreview, Me.btnPrint, Me.toolStripSeparator2, Me.btnExportAsImages, Me.btnExit})
            Me.mainToolbar.Location = New System.Drawing.Point(0, 0)
            Me.mainToolbar.Name = "mainToolbar"
            Me.mainToolbar.Size = New System.Drawing.Size(768, 38)
            Me.mainToolbar.TabIndex = 11
            Me.mainToolbar.Text = "toolStrip1"
            '
            ' btnOpenFile
            '
            Me.btnOpenFile.Image = (CType(resources.GetObject("btnOpenFile.Image"), System.Drawing.Image))
            Me.btnOpenFile.ImageTransparentColor = System.Drawing.Color.Magenta
            Me.btnOpenFile.Name = "btnOpenFile"
            Me.btnOpenFile.Size = New System.Drawing.Size(59, 35)
            Me.btnOpenFile.Text = "Open file"
            Me.btnOpenFile.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText
'           Me.btnOpenFile.Click += New System.EventHandler(Me.openFile_Click)
            '
            ' toolStripSeparator1
            '
            Me.toolStripSeparator1.Name = "toolStripSeparator1"
            Me.toolStripSeparator1.Size = New System.Drawing.Size(6, 46)
            '
            ' btnSetup
            '
            Me.btnSetup.Image = (CType(resources.GetObject("btnSetup.Image"), System.Drawing.Image))
            Me.btnSetup.ImageTransparentColor = System.Drawing.Color.Magenta
            Me.btnSetup.Name = "btnSetup"
            Me.btnSetup.Size = New System.Drawing.Size(69, 35)
            Me.btnSetup.Text = "Print &Setup"
            Me.btnSetup.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText
'           Me.btnSetup.Click += New System.EventHandler(Me.setup_Click)
            '
            ' btnPreview
            '
            Me.btnPreview.Image = (CType(resources.GetObject("btnPreview.Image"), System.Drawing.Image))
            Me.btnPreview.ImageTransparentColor = System.Drawing.Color.Magenta
            Me.btnPreview.Name = "btnPreview"
            Me.btnPreview.Size = New System.Drawing.Size(80, 35)
            Me.btnPreview.Text = "Print Pre&view"
            Me.btnPreview.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText
'           Me.btnPreview.Click += New System.EventHandler(Me.preview_Click)
            '
            ' btnPrint
            '
            Me.btnPrint.Image = (CType(resources.GetObject("btnPrint.Image"), System.Drawing.Image))
            Me.btnPrint.ImageTransparentColor = System.Drawing.Color.Magenta
            Me.btnPrint.Name = "btnPrint"
            Me.btnPrint.Size = New System.Drawing.Size(36, 35)
            Me.btnPrint.Text = "&Print"
            Me.btnPrint.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText
'           Me.btnPrint.Click += New System.EventHandler(Me.print_Click)
            '
            ' toolStripSeparator2
            '
            Me.toolStripSeparator2.Name = "toolStripSeparator2"
            Me.toolStripSeparator2.Size = New System.Drawing.Size(6, 46)
            '
            ' btnExportAsImages
            '
            Me.btnExportAsImages.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() { Me.usingFlexCelImgExportAllPagesrecommendedWayToolStripMenuItem, Me.usingFlexCelImgExport1PagerecommendedWayToolStripMenuItem, Me.multiPageTIFFUsingFlexCelImgExportToolStripMenuItem})
            Me.btnExportAsImages.Image = (CType(resources.GetObject("btnExportAsImages.Image"), System.Drawing.Image))
            Me.btnExportAsImages.ImageTransparentColor = System.Drawing.Color.Magenta
            Me.btnExportAsImages.Name = "btnExportAsImages"
            Me.btnExportAsImages.Size = New System.Drawing.Size(108, 35)
            Me.btnExportAsImages.Text = "Export as &Images"
            Me.btnExportAsImages.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText
            '
            ' usingFlexCelImgExportAllPagesrecommendedWayToolStripMenuItem
            '
            Me.usingFlexCelImgExportAllPagesrecommendedWayToolStripMenuItem.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() { Me.blackAndWhiteToolStripMenuItem, Me.colorsToolStripMenuItem, Me.trueColorToolStripMenuItem})
            Me.usingFlexCelImgExportAllPagesrecommendedWayToolStripMenuItem.Name = "usingFlexCelImgExportAllPagesrecommendedWayToolStripMenuItem"
            Me.usingFlexCelImgExportAllPagesrecommendedWayToolStripMenuItem.Size = New System.Drawing.Size(153, 22)
            Me.usingFlexCelImgExportAllPagesrecommendedWayToolStripMenuItem.Text = "All pages"
            '
            ' blackAndWhiteToolStripMenuItem
            '
            Me.blackAndWhiteToolStripMenuItem.Name = "blackAndWhiteToolStripMenuItem"
            Me.blackAndWhiteToolStripMenuItem.Size = New System.Drawing.Size(161, 22)
            Me.blackAndWhiteToolStripMenuItem.Text = "Black And White"
'           Me.blackAndWhiteToolStripMenuItem.Click += New System.EventHandler(Me.ImgBlackAndWhite_Click)
            '
            ' colorsToolStripMenuItem
            '
            Me.colorsToolStripMenuItem.Name = "colorsToolStripMenuItem"
            Me.colorsToolStripMenuItem.Size = New System.Drawing.Size(161, 22)
            Me.colorsToolStripMenuItem.Text = "256 Colors"
'           Me.colorsToolStripMenuItem.Click += New System.EventHandler(Me.Img256Colors_Click)
            '
            ' trueColorToolStripMenuItem
            '
            Me.trueColorToolStripMenuItem.Name = "trueColorToolStripMenuItem"
            Me.trueColorToolStripMenuItem.Size = New System.Drawing.Size(161, 22)
            Me.trueColorToolStripMenuItem.Text = "True Color"
'           Me.trueColorToolStripMenuItem.Click += New System.EventHandler(Me.ImgTrueColor_Click)
            '
            ' usingFlexCelImgExport1PagerecommendedWayToolStripMenuItem
            '
            Me.usingFlexCelImgExport1PagerecommendedWayToolStripMenuItem.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() { Me.blackAndWhiteToolStripMenuItem1, Me.colorsToolStripMenuItem1, Me.trueColorToolStripMenuItem1})
            Me.usingFlexCelImgExport1PagerecommendedWayToolStripMenuItem.Name = "usingFlexCelImgExport1PagerecommendedWayToolStripMenuItem"
            Me.usingFlexCelImgExport1PagerecommendedWayToolStripMenuItem.Size = New System.Drawing.Size(153, 22)
            Me.usingFlexCelImgExport1PagerecommendedWayToolStripMenuItem.Text = "1 page"
            '
            ' blackAndWhiteToolStripMenuItem1
            '
            Me.blackAndWhiteToolStripMenuItem1.Name = "blackAndWhiteToolStripMenuItem1"
            Me.blackAndWhiteToolStripMenuItem1.Size = New System.Drawing.Size(161, 22)
            Me.blackAndWhiteToolStripMenuItem1.Text = "Black And White"
'           Me.blackAndWhiteToolStripMenuItem1.Click += New System.EventHandler(Me.ImgBlackAndWhite2_Click)
            '
            ' colorsToolStripMenuItem1
            '
            Me.colorsToolStripMenuItem1.Name = "colorsToolStripMenuItem1"
            Me.colorsToolStripMenuItem1.Size = New System.Drawing.Size(161, 22)
            Me.colorsToolStripMenuItem1.Text = "256 Colors"
'           Me.colorsToolStripMenuItem1.Click += New System.EventHandler(Me.Img256Colors2_Click)
            '
            ' trueColorToolStripMenuItem1
            '
            Me.trueColorToolStripMenuItem1.Name = "trueColorToolStripMenuItem1"
            Me.trueColorToolStripMenuItem1.Size = New System.Drawing.Size(161, 22)
            Me.trueColorToolStripMenuItem1.Text = "True Color"
'           Me.trueColorToolStripMenuItem1.Click += New System.EventHandler(Me.ImgTrueColor2_Click)
            '
            ' multiPageTIFFUsingFlexCelImgExportToolStripMenuItem
            '
            Me.multiPageTIFFUsingFlexCelImgExportToolStripMenuItem.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() { Me.faxToolStripMenuItem, Me.blackAndWhiteToolStripMenuItem2, Me.colorsToolStripMenuItem2, Me.trueColorToolStripMenuItem2})
            Me.multiPageTIFFUsingFlexCelImgExportToolStripMenuItem.Name = "multiPageTIFFUsingFlexCelImgExportToolStripMenuItem"
            Me.multiPageTIFFUsingFlexCelImgExportToolStripMenuItem.Size = New System.Drawing.Size(153, 22)
            Me.multiPageTIFFUsingFlexCelImgExportToolStripMenuItem.Text = "MultiPage TIFF"
            '
            ' faxToolStripMenuItem
            '
            Me.faxToolStripMenuItem.Name = "faxToolStripMenuItem"
            Me.faxToolStripMenuItem.Size = New System.Drawing.Size(161, 22)
            Me.faxToolStripMenuItem.Text = "Fax"
'           Me.faxToolStripMenuItem.Click += New System.EventHandler(Me.TiffFax_Click)
            '
            ' blackAndWhiteToolStripMenuItem2
            '
            Me.blackAndWhiteToolStripMenuItem2.Name = "blackAndWhiteToolStripMenuItem2"
            Me.blackAndWhiteToolStripMenuItem2.Size = New System.Drawing.Size(161, 22)
            Me.blackAndWhiteToolStripMenuItem2.Text = "Black And White"
'           Me.blackAndWhiteToolStripMenuItem2.Click += New System.EventHandler(Me.TiffBlackAndWhite_Click)
            '
            ' colorsToolStripMenuItem2
            '
            Me.colorsToolStripMenuItem2.Name = "colorsToolStripMenuItem2"
            Me.colorsToolStripMenuItem2.Size = New System.Drawing.Size(161, 22)
            Me.colorsToolStripMenuItem2.Text = "256 Colors"
'           Me.colorsToolStripMenuItem2.Click += New System.EventHandler(Me.Tiff256Colors_Click)
            '
            ' trueColorToolStripMenuItem2
            '
            Me.trueColorToolStripMenuItem2.Name = "trueColorToolStripMenuItem2"
            Me.trueColorToolStripMenuItem2.Size = New System.Drawing.Size(161, 22)
            Me.trueColorToolStripMenuItem2.Text = "True Color"
'           Me.trueColorToolStripMenuItem2.Click += New System.EventHandler(Me.TiffTrueColor_Click)
            '
            ' btnExit
            '
            Me.btnExit.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right
            Me.btnExit.Image = (CType(resources.GetObject("btnExit.Image"), System.Drawing.Image))
            Me.btnExit.ImageTransparentColor = System.Drawing.Color.Magenta
            Me.btnExit.Name = "btnExit"
            Me.btnExit.Size = New System.Drawing.Size(59, 35)
            Me.btnExit.Text = "     E&xit     "
            Me.btnExit.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText
'           Me.btnExit.Click += New System.EventHandler(Me.button2_Click)
            '
            ' mainForm
            '
            Me.AutoScaleDimensions = New System.Drawing.SizeF(6F, 13F)
            Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
            Me.ClientSize = New System.Drawing.Size(768, 517)
            Me.Controls.Add(Me.panel1)
            Me.Controls.Add(Me.mainToolbar)
            Me.Name = "mainForm"
            Me.Text = "Print and preview a file"
            Me.panel1.ResumeLayout(False)
            Me.panel1.PerformLayout()
            Me.panel3.ResumeLayout(False)
            Me.panel3.PerformLayout()
            Me.mainToolbar.ResumeLayout(False)
            Me.mainToolbar.PerformLayout()
            Me.ResumeLayout(False)
            Me.PerformLayout()

        End Sub
        #End Region

        Private mainToolbar As ToolStrip
        Private WithEvents btnOpenFile As ToolStripButton
        Private toolStripSeparator1 As ToolStripSeparator
        Private WithEvents btnSetup As ToolStripButton
        Private WithEvents btnPreview As ToolStripButton
        Private WithEvents btnPrint As ToolStripButton
        Private toolStripSeparator2 As ToolStripSeparator
        Private WithEvents btnExit As ToolStripButton
        Private btnExportAsImages As ToolStripDropDownButton
        Private usingFlexCelImgExportAllPagesrecommendedWayToolStripMenuItem As ToolStripMenuItem
        Private WithEvents blackAndWhiteToolStripMenuItem As ToolStripMenuItem
        Private WithEvents colorsToolStripMenuItem As ToolStripMenuItem
        Private WithEvents trueColorToolStripMenuItem As ToolStripMenuItem
        Private usingFlexCelImgExport1PagerecommendedWayToolStripMenuItem As ToolStripMenuItem
        Private WithEvents blackAndWhiteToolStripMenuItem1 As ToolStripMenuItem
        Private WithEvents colorsToolStripMenuItem1 As ToolStripMenuItem
        Private WithEvents trueColorToolStripMenuItem1 As ToolStripMenuItem
        Private multiPageTIFFUsingFlexCelImgExportToolStripMenuItem As ToolStripMenuItem
        Private WithEvents faxToolStripMenuItem As ToolStripMenuItem
        Private WithEvents blackAndWhiteToolStripMenuItem2 As ToolStripMenuItem
        Private WithEvents colorsToolStripMenuItem2 As ToolStripMenuItem
        Private WithEvents trueColorToolStripMenuItem2 As ToolStripMenuItem
    End Class
End Namespace

Form1.vb

Imports System.Drawing.Imaging
Imports System.Collections
Imports System.ComponentModel

Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports FlexCel.Render

Imports System.IO
Imports System.Reflection
Imports System.Drawing.Drawing2D
Imports System.Drawing.Printing

Imports System.Runtime.InteropServices
Imports FlexCel.Draw

Namespace PrintPreviewandExport
    ''' <summary>
    ''' Printing / Previewing and Exporting xls files.
    ''' </summary>
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Private WithEvents flexCelPrintDocument1 As FlexCel.Render.FlexCelPrintDocument

        Public Sub New()
            InitializeComponent()
            cbInterpolation.SelectedIndex = 1
            ResizeToolbar(mainToolbar)
        End Sub

        Private Sub ResizeToolbar(ByVal toolbar As ToolStrip)

            Using gr As Graphics = CreateGraphics()
                Dim xFactor As Double = gr.DpiX / 96.0
                Dim yFactor As Double = gr.DpiY / 96.0
                toolbar.ImageScalingSize = New Size(CInt(Fix(24 * xFactor)), CInt(Fix(24 * yFactor)))
                toolbar.Width = 0 'force a recalc of the buttons.
            End Using
        End Sub

        Private Sub button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnExit.Click
            Close()
        End Sub

        Private Sub LoadSheetConfig()
            Dim Xls As ExcelFile = flexCelPrintDocument1.Workbook

            chGridLines.Checked = Xls.PrintGridLines
            chHeadings.Checked = Xls.PrintHeadings
            chFormulaText.Checked = Xls.ShowFormulaText

            chPrintLeft.Checked = (Xls.PrintOptions And TPrintOptions.LeftToRight) <> 0
            edHeader.Text = Xls.PageHeader
            edFooter.Text = Xls.PageFooter
            chFitIn.Checked = Xls.PrintToFit
            edHPages.Text = Xls.PrintNumberOfHorizontalPages.ToString()
            edVPages.Text = Xls.PrintNumberOfVerticalPages.ToString()
            edVPages.ReadOnly = Not chFitIn.Checked
            edHPages.ReadOnly = Not chFitIn.Checked

            edZoom.ReadOnly = chFitIn.Checked
            edZoom.Text = Xls.PrintScale.ToString()

            Dim m As TXlsMargins = Xls.GetPrintMargins()
            edl.Text = m.Left.ToString()
            edt.Text = m.Top.ToString()
            edr.Text = m.Right.ToString()
            edb.Text = m.Bottom.ToString()
            edf.Text = m.Footer.ToString()
            edh.Text = m.Header.ToString()

            Landscape.Checked = (Xls.PrintOptions And TPrintOptions.Orientation) = 0

        End Sub

        Private Sub openFile_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnOpenFile.Click
            If openFileDialog1.ShowDialog() <> System.Windows.Forms.DialogResult.OK Then
                Return
            End If
            flexCelPrintDocument1.Workbook = New XlsFile()

            flexCelPrintDocument1.Workbook.Open(openFileDialog1.FileName)

            edFileName.Text = openFileDialog1.FileName

            Dim Xls As ExcelFile = flexCelPrintDocument1.Workbook

            cbSheet.Items.Clear()
            Dim ActSheet As Integer = Xls.ActiveSheet
            For i As Integer = 1 To Xls.SheetCount
                Xls.ActiveSheet = i
                cbSheet.Items.Add(Xls.SheetName)
            Next i
            Xls.ActiveSheet = ActSheet
            cbSheet.SelectedIndex = ActSheet - 1

            LoadSheetConfig()
        End Sub

        Private Function HasFileOpen() As Boolean
            If flexCelPrintDocument1.Workbook Is Nothing Then
                MessageBox.Show("You need to open a file first.")
                Return False
            End If
            Return True
        End Function

        Private Function LoadPreferences() As Boolean
            'NOTE: THERE SHOULD BE *A LOT* MORE VALIDATION OF VALUES ON THIS METHOD. (For example, validate that margins are between bounds)
            ' As this is a simple demo, they are not included.
            Try
                flexCelPrintDocument1.AllVisibleSheets = cbAllSheets.Checked
                flexCelPrintDocument1.ResetPageNumberOnEachSheet = cbResetPageNumber.Checked
                flexCelPrintDocument1.AntiAliasedText = chAntiAlias.Checked

                Dim Xls As ExcelFile = flexCelPrintDocument1.Workbook
                Xls.PrintGridLines = chGridLines.Checked
                Xls.PrintHeadings = chHeadings.Checked
                Xls.PageHeader = edHeader.Text
                Xls.PageFooter = edFooter.Text
                Xls.ShowFormulaText = chFormulaText.Checked

                If chFitIn.Checked Then
                    Xls.PrintToFit = True
                    Xls.PrintNumberOfHorizontalPages = Convert.ToInt32(edHPages.Text)
                    Xls.PrintNumberOfVerticalPages = Convert.ToInt32(edVPages.Text)
                Else
                    Xls.PrintToFit = False
                End If

                If chPrintLeft.Checked Then
                    Xls.PrintOptions = Xls.PrintOptions Or TPrintOptions.LeftToRight
                Else
                    Xls.PrintOptions = Xls.PrintOptions And Not TPrintOptions.LeftToRight
                End If

                Try
                    Xls.PrintScale = Convert.ToInt32(edZoom.Text)
                Catch
                    MessageBox.Show("Invalid Zoom")
                    Return False
                End Try

                Dim m As New TXlsMargins()
                m.Left = Convert.ToDouble(edl.Text)
                m.Top = Convert.ToDouble(edt.Text)
                m.Right = Convert.ToDouble(edr.Text)
                m.Bottom = Convert.ToDouble(edb.Text)
                m.Footer = Convert.ToDouble(edf.Text)
                m.Header = Convert.ToDouble(edh.Text)
                Xls.SetPrintMargins(m)

                flexCelPrintDocument1.PrintRangeLeft = Convert.ToInt32(edLeft.Text)
                flexCelPrintDocument1.PrintRangeTop = Convert.ToInt32(edTop.Text)
                flexCelPrintDocument1.PrintRangeRight = Convert.ToInt32(edRight.Text)
                flexCelPrintDocument1.PrintRangeBottom = Convert.ToInt32(edBottom.Text)

                flexCelPrintDocument1.DocumentName = flexCelPrintDocument1.Workbook.ActiveFileName & " - Sheet " & flexCelPrintDocument1.Workbook.ActiveSheetByName

                flexCelPrintDocument1.DefaultPageSettings.Landscape = Landscape.Checked
            Catch e As Exception
                MessageBox.Show("Error: " & e.Message)
                Return False
            End Try
            Return True
        End Function

        Private Sub preview_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnPreview.Click
            If Not HasFileOpen() Then
                Return
            End If
            If Not LoadPreferences() Then
                Return
            End If
            If Not DoSetup() Then
                Return
            End If

            'If you want to bypass the paper size selected on the dialog and use the one on Excel, uncomment
            'the following lines:
            'TPaperDimensions t= flexCelPrintDocument1.Workbook.PrintPaperDimensions;
            'flexCelPrintDocument1.DefaultPageSettings.PaperSize = new PaperSize(t.PaperName, Convert.ToInt32(t.Width), Convert.ToInt32(t.Height));

            printPreviewDialog1.ShowDialog()

        End Sub

        Private Function DoSetup() As Boolean
            Dim Result As Boolean = printDialog1.ShowDialog() = System.Windows.Forms.DialogResult.OK
            Landscape.Checked = flexCelPrintDocument1.DefaultPageSettings.Landscape
            Return Result
        End Function

        Private Sub setup_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSetup.Click
            DoSetup()
        End Sub

        Private Sub chFitIn_CheckedChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles chFitIn.CheckedChanged
            edVPages.ReadOnly = Not chFitIn.Checked
            edHPages.ReadOnly = Not chFitIn.Checked
            edZoom.ReadOnly = chFitIn.Checked
        End Sub

        Private Sub print_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnPrint.Click
            If Not HasFileOpen() Then
                Return
            End If
            If Not LoadPreferences() Then
                Return
            End If
            If Not DoSetup() Then
                Return
            End If
            flexCelPrintDocument1.Print()
        End Sub

        Private Sub cbSheet_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles cbSheet.SelectedIndexChanged
            flexCelPrintDocument1.Workbook.ActiveSheet = cbSheet.SelectedIndex + 1
            LoadSheetConfig()

        End Sub

        ''' <summary>
        ''' Add a "Confidential" watermark on each page.
        ''' </summary>
        ''' <param name="sender"></param>
        ''' <param name="e"></param>
        Private Sub flexCelPrintDocument1_PrintPage(ByVal sender As Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles flexCelPrintDocument1.PrintPage
            If Not cbConfidential.Checked Then
                Return
            End If

            Using myMatrix As New Matrix()
                myMatrix.RotateAt(45, New PointF(e.PageBounds.Left + e.MarginBounds.Width / 2F, e.PageBounds.Top + e.MarginBounds.Height / 2F), MatrixOrder.Append)
                e.Graphics.Transform = myMatrix
            End Using

            Using ABrush As Brush = New SolidBrush(Color.FromArgb(30, 25, 25, 25)) 'Red=Green=Blue is a shade of gray. Alpha=30 means it is transparent (255 is pure opaque, 0 is pure transparent).
                Using AFont As New Font("Arial", 72)
                    Using sf As New StringFormat()

                        sf.Alignment = StringAlignment.Center
                        sf.LineAlignment = StringAlignment.Center
                        e.Graphics.DrawString("Confidential", AFont, ABrush, e.PageBounds, sf)
                    End Using
                End Using
            End Using
        End Sub

        #Region "Hard Margins"
        'Shows how to read the hard margins from a printer if you really need to.

        Private Sub flexCelPrintDocument1_BeforePrintPage(ByVal sender As Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles flexCelPrintDocument1.BeforePrintPage
            Select Case cbInterpolation.SelectedIndex
                Case 0
                    e.Graphics.InterpolationMode = InterpolationMode.Bicubic
                Case 1
                    e.Graphics.InterpolationMode = InterpolationMode.Bilinear
                Case 2
                    e.Graphics.InterpolationMode = InterpolationMode.Default
                Case 3
                    e.Graphics.InterpolationMode = InterpolationMode.High
                Case 4
                    e.Graphics.InterpolationMode = InterpolationMode.HighQualityBicubic
                Case 5
                    e.Graphics.InterpolationMode = InterpolationMode.HighQualityBilinear
                Case 6
                    e.Graphics.InterpolationMode = InterpolationMode.Low
                Case 7
                    e.Graphics.InterpolationMode = InterpolationMode.NearestNeighbor
            End Select

        End Sub

        <DllImport("gdi32.dll")> _
        Private Shared Function GetDeviceCaps(ByVal hdc As IntPtr, ByVal capindex As Int32) As Int32
        End Function

        ''' <summary>
        ''' This event will adjust for a better position on the page for some printers.
        ''' It is not normally necessary, and it has to make an unmanaged call to GetDeviceCaps,
        ''' but it is given here as an example of how it could be done.
        ''' </summary>
        ''' <param name="sender"></param>
        ''' <param name="e"></param>
        Private Sub flexCelPrintDocument1_GetPrinterHardMargins(ByVal sender As Object, ByVal e As FlexCel.Render.PrintHardMarginsEventArgs) Handles flexCelPrintDocument1.GetPrinterHardMargins
            Const PHYSICALOFFSETX As Integer = 112
            Const PHYSICALOFFSETY As Integer = 113

            Dim DpiX As Double = e.Graphics.DpiX
            Dim DpiY As Double = e.Graphics.DpiY

            Dim Hdc As IntPtr = e.Graphics.GetHdc()
            Try
                e.XMargin = CSng(GetDeviceCaps(Hdc, PHYSICALOFFSETX) * 100.0 / DpiX)
                e.YMargin = CSng(GetDeviceCaps(Hdc, PHYSICALOFFSETY) * 100.0 / DpiY)

            Finally
                e.Graphics.ReleaseHdc(Hdc)
            End Try

        End Sub
        #End Region

        #Region "Export as image"

        #Region "Common methods to Export with FlexCelImgExport"
        Private Function CreateBitmap(ByVal Resolution As Double, ByVal pd As TPaperDimensions, ByVal PxFormat As PixelFormat) As Bitmap
            Dim Result As New Bitmap(CInt(Fix(Math.Ceiling(pd.Width / 96F * Resolution))), CInt(Fix(Math.Ceiling(pd.Height / 96F * Resolution))), PxFormat)
            Result.SetResolution(CSng(Resolution), CSng(Resolution))
            Return Result

        End Function
        #End Region

        #Region "Export using FlexCelImgExport - simple images the hard way. DO NOT USE IF NOT DESPERATE!"
        'The methods shows how to use FlexCelImgExport the "hard way", without using SaveAsImage.
        'For normal operation you should only need to call SaveAsImage, but you could use the code here
        'if you need to customize the ImgExport output, or if you need to get all the images as different files.
        Private Sub CreateImg(ByVal OutStream As Stream, ByVal ImgExport As FlexCelImgExport, ByVal ImgFormat As ImageFormat, ByVal Colors As ImageColorDepth, ByRef ExportInfo As TImgExportInfo)
            Dim pd As TPaperDimensions = ImgExport.GetRealPageSize()

            Dim RgbPixFormat As PixelFormat
            If Colors <> ImageColorDepth.TrueColor Then
                RgbPixFormat = PixelFormat.Format32bppPArgb
            Else
                RgbPixFormat = PixelFormat.Format24bppRgb
            End If
            Dim PixFormat As PixelFormat = PixelFormat.Format1bppIndexed
            Select Case Colors
                Case ImageColorDepth.TrueColor
                    PixFormat = RgbPixFormat
                Case ImageColorDepth.Color256
                    PixFormat = PixelFormat.Format8bppIndexed
            End Select

            Using OutImg As Bitmap = CreateBitmap(ImgExport.Resolution, pd, PixFormat)
                Dim ActualOutImg As Bitmap
                If Colors <> ImageColorDepth.TrueColor Then
                    ActualOutImg = CreateBitmap(ImgExport.Resolution, pd, RgbPixFormat)
                Else
                    ActualOutImg = OutImg
                End If
                Try
                    Using Gr As Graphics = Graphics.FromImage(ActualOutImg)
                        Gr.FillRectangle(Brushes.White, 0, 0, ActualOutImg.Width, ActualOutImg.Height) 'Clear the background
                        ImgExport.ExportNext(Gr, ExportInfo)
                    End Using

                    If Colors = ImageColorDepth.BlackAndWhite Then
                        FloydSteinbergDither.ConvertToBlackAndWhite(ActualOutImg, OutImg)
                    Else
                        If Colors = ImageColorDepth.Color256 Then
                        OctreeQuantizer.ConvertTo256Colors(ActualOutImg, OutImg)
                        End If
                    End If
                Finally
                    If ActualOutImg IsNot OutImg Then
                        ActualOutImg.Dispose()
                    End If
                End Try

                OutImg.Save(OutStream, ImgFormat)
            End Using
        End Sub

        Private Sub ExportAllImages(ByVal ImgExport As FlexCelImgExport, ByVal ImgFormat As ImageFormat, ByVal ColorDepth As ImageColorDepth)
            Dim ExportInfo As TImgExportInfo = Nothing 'For first page.
            Dim i As Integer = 0
            Do
                Dim FileName As String = Path.GetDirectoryName(exportImageDialog.FileName) & Path.DirectorySeparatorChar & Path.GetFileNameWithoutExtension(exportImageDialog.FileName) & "_" & ImgExport.Workbook.SheetName & String.Format("_{0:0000}", i) & Path.GetExtension(exportImageDialog.FileName)
                Using ImageStream As New FileStream(FileName, FileMode.Create)
                    CreateImg(ImageStream, ImgExport, ImgFormat, ColorDepth, ExportInfo)
                End Using
                i += 1
            Loop While ExportInfo.CurrentPage < ExportInfo.TotalPages
        End Sub

        Private Sub DoExportUsingFlexCelImgExportComplex(ByVal ColorDepth As ImageColorDepth)
            If Not HasFileOpen() Then
                Return
            End If
            If Not LoadPreferences() Then
                Return
            End If

            If exportImageDialog.ShowDialog() <> System.Windows.Forms.DialogResult.OK Then
                Return
            End If

            Dim ImgFormat As System.Drawing.Imaging.ImageFormat = System.Drawing.Imaging.ImageFormat.Png
            If String.Compare(Path.GetExtension(exportImageDialog.FileName), ".jpg", True) = 0 Then
                ImgFormat = System.Drawing.Imaging.ImageFormat.Jpeg
            End If

            Using ImgExport As New FlexCelImgExport(flexCelPrintDocument1.Workbook)
                ImgExport.Resolution = 96 'To get a better quality image but with larger file size too, increate this value. (for example to 300 or 600 dpi)

                If cbAllSheets.Checked Then
                    Dim SaveActiveSheet As Integer = ImgExport.Workbook.ActiveSheet
                    Try
                        ImgExport.Workbook.ActiveSheet = 1
                        Dim Finished As Boolean = False
                        Do While Not Finished
                            ExportAllImages(ImgExport, ImgFormat, ColorDepth)
                            If ImgExport.Workbook.ActiveSheet < ImgExport.Workbook.SheetCount Then
                                ImgExport.Workbook.ActiveSheet += 1
                            Else
                                Finished = True
                            End If

                        Loop
                    Finally
                        ImgExport.Workbook.ActiveSheet = SaveActiveSheet
                    End Try
                Else
                    ExportAllImages(ImgExport, ImgFormat, ColorDepth)
                End If

            End Using

        End Sub
        #End Region

        #Region "Export using FlexCelImgExport - simple images the simple way."

        Private Sub DoExportUsingFlexCelImgExportSimple(ByVal ColorDepth As ImageColorDepth)
            If Not HasFileOpen() Then
                Return
            End If
            If Not LoadPreferences() Then
                Return
            End If

            If exportImageDialog.ShowDialog() <> System.Windows.Forms.DialogResult.OK Then
                Return
            End If

            Dim ImgFormat As ImageExportType = ImageExportType.Png
            If String.Compare(Path.GetExtension(exportImageDialog.FileName), ".jpg", True) = 0 Then
                ImgFormat = ImageExportType.Jpeg
            End If

            Using ImgExport As New FlexCelImgExport(flexCelPrintDocument1.Workbook)
                ImgExport.AllVisibleSheets = cbAllSheets.Checked
                ImgExport.ResetPageNumberOnEachSheet = cbResetPageNumber.Checked
                ImgExport.Resolution = 96 'To get a better quality image but with larger file size too, increate this value. (for example to 300 or 600 dpi)
                ImgExport.SaveAsImage(exportImageDialog.FileName, ImgFormat, ColorDepth)
            End Using
        End Sub

        #End Region

        #Region "Export using FlexCelImageExport - MultiPageTiff"
        'How to create a multipage tiff using FlexCelImgExport.
        'This will create a multipage tiff with the data.
        Private Sub DoExportMultiPageTiff(ByVal ColorDepth As ImageColorDepth, ByVal IsFax As Boolean)
            If Not HasFileOpen() Then
                Return
            End If
            If Not LoadPreferences() Then
                Return
            End If

            If exportTiffDialog.ShowDialog() <> System.Windows.Forms.DialogResult.OK Then
                Return
            End If

            Dim ExportType As ImageExportType = ImageExportType.Tiff
            If IsFax Then
                ExportType = ImageExportType.Fax
            End If

            Using ImgExport As New FlexCelImgExport(flexCelPrintDocument1.Workbook)
                ImgExport.AllVisibleSheets = cbAllSheets.Checked
                ImgExport.ResetPageNumberOnEachSheet = cbResetPageNumber.Checked

                ImgExport.Resolution = 96 'To get a better quality image but with larger file size too, increate this value. (for example to 300 or 600 dpi)
                Using TiffStream As New FileStream(exportTiffDialog.FileName, FileMode.Create)
                    ImgExport.SaveAsImage(TiffStream, ExportType, ColorDepth)
                End Using
            End Using
            If MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) = System.Windows.Forms.DialogResult.Yes Then
                Process.Start(exportTiffDialog.FileName)
            End If

        End Sub
        #End Region

        #Region "Event handlers"
        Private Sub ImgBlackAndWhite_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles blackAndWhiteToolStripMenuItem.Click
            DoExportUsingFlexCelImgExportComplex(ImageColorDepth.BlackAndWhite)
        End Sub

        Private Sub Img256Colors_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles colorsToolStripMenuItem.Click
            DoExportUsingFlexCelImgExportComplex(ImageColorDepth.Color256)
        End Sub

        Private Sub ImgTrueColor_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles trueColorToolStripMenuItem.Click
            DoExportUsingFlexCelImgExportComplex(ImageColorDepth.TrueColor)
        End Sub

        Private Sub ImgBlackAndWhite2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles blackAndWhiteToolStripMenuItem1.Click
            DoExportUsingFlexCelImgExportSimple(ImageColorDepth.BlackAndWhite)
        End Sub

        Private Sub Img256Colors2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles colorsToolStripMenuItem1.Click
            DoExportUsingFlexCelImgExportSimple(ImageColorDepth.Color256)
        End Sub

        Private Sub ImgTrueColor2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles trueColorToolStripMenuItem1.Click
            DoExportUsingFlexCelImgExportSimple(ImageColorDepth.TrueColor)
        End Sub

        Private Sub TiffFax_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles faxToolStripMenuItem.Click
            DoExportMultiPageTiff(ImageColorDepth.BlackAndWhite, True)
        End Sub

        Private Sub TiffBlackAndWhite_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles blackAndWhiteToolStripMenuItem2.Click
            DoExportMultiPageTiff(ImageColorDepth.BlackAndWhite, False)
        End Sub

        Private Sub Tiff256Colors_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles colorsToolStripMenuItem2.Click
            DoExportMultiPageTiff(ImageColorDepth.Color256, False)
        End Sub

        Private Sub TiffTrueColor_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles trueColorToolStripMenuItem2.Click
            DoExportMultiPageTiff(ImageColorDepth.TrueColor, False)
        End Sub

        #End Region

        Private Sub cbAllSheets_CheckedChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles cbAllSheets.CheckedChanged
            cbSheet.Enabled = Not cbAllSheets.Checked
            cbResetPageNumber.Enabled = cbAllSheets.Checked
            Landscape.Enabled = Not cbAllSheets.Checked 'When exporting many sheets, we will honor the landscape/portrait setting on each one.
        End Sub

        #End Region

    End Class
End Namespace

Program.vb

Namespace PrintPreviewandExport
    Friend NotInheritable Class Program

        Private Sub New()
        End Sub

        ''' <summary>
        ''' The main entry point for the application.
        ''' </summary>
       <STAThread> _
        Shared Sub Main()
            Application.EnableVisualStyles()
            Application.SetCompatibleTextRenderingDefault(False)
            Application.Run(New mainForm())
        End Sub
    End Class
End Namespace


Custom previewing (VB.Net / netframework) | FlexCel Studio for the .NET Framework documentation

Custom previewing (VB.Net / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\vb\VS2022\netframework\25.Printing and Exporting\20.CustomPreview and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​vb/​VS2022/​netframework/​Modules/​25.​Printing and Exporting/​20.​Custom​Preview

Overview

FlexCel comes with a full featured viewer that you can use to display a preview of Excel files in your application, and without having any printer installed.

Concepts

  • How to create a preview form that you can embed inside your application, including thumbnails, navigation, etc.

  • How to Export to PDF from a thread, allowing the user to cancel it.

Files

AssemblyInfo.vb

Imports System.Reflection
Imports System.Runtime.CompilerServices

'
' General Information about an assembly is controlled through the following
' set of attributes. Change these attribute values to modify the information
' associated with an assembly.
'
<Assembly: AssemblyTitle("Custom Preview")>
<Assembly: AssemblyDescription("A custom previewer of xls files using FlexCel engine.")>
<Assembly: AssemblyConfiguration("")>
<Assembly: AssemblyCompany("TMS Software")>
<Assembly: AssemblyProduct("")>
<Assembly: AssemblyCopyright("(c) 2002 - 2014 TMS Software")>
<Assembly: AssemblyTrademark("")>
<Assembly: AssemblyCulture("")>

'
' Version information for an assembly consists of the following four values:
'
'      Major Version
'      Minor Version
'      Build Number
'      Revision
'
' You can specify all the values or you can default the Revision and Build Numbers
' by using the '*' as shown below:

<Assembly: AssemblyVersion("6.2.1.0")>

'
' In order to sign your assembly you must specify a key to use. Refer to the
' Microsoft .NET Framework documentation for more information on assembly signing.
'
' Use the attributes below to control which key is used for signing.
'
' Notes:
'   (*) If no key is specified, the assembly is not signed.
'   (*) KeyName refers to a key that has been installed in the Crypto Service
'       Provider (CSP) on your machine. KeyFile refers to a file which contains
'       a key.
'   (*) If the KeyFile and the KeyName values are both specified, the
'       following processing occurs:
'       (1) If the KeyName can be found in the CSP, that key is used.
'       (2) If the KeyName does not exist and the KeyFile does exist, the key
'           in the KeyFile is installed into the CSP and used.
'   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
'       When specifying the KeyFile, the location of the KeyFile should be
'       relative to the project output directory which is
'       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
'       located in the project directory, you would specify the AssemblyKeyFile
'       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
'   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
'       documentation for more information on this.
'
<Assembly: AssemblyDelaySign(False)>
<Assembly: AssemblyKeyFile("")>
<Assembly: AssemblyKeyName("")>

Form1.Designer.vb

Imports System.ComponentModel
Imports System.IO
Imports System.Drawing.Drawing2D
Imports System.Threading
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports FlexCel.Winforms
Imports FlexCel.Render
Imports FlexCel.Pdf
Namespace CustomPreview
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        ''' <summary>
        ''' Required designer variable.
        ''' </summary>
        Private components As System.ComponentModel.IContainer = Nothing

        ''' <summary>
        ''' Clean up any resources being used.
        ''' </summary>
        Protected Overrides Sub Dispose(ByVal disposing As Boolean)
            If disposing Then
                If components IsNot Nothing Then
                    components.Dispose()
                End If
            End If
            MyBase.Dispose(disposing)
        End Sub

        #Region "Windows Form Designer generated code"
        ''' <summary>
        ''' Required method for Designer support - do not modify
        ''' the contents of this method with the code editor.
        ''' </summary>
        Private Sub InitializeComponent()
            Me.components = New System.ComponentModel.Container()
            Dim resources As New System.ComponentModel.ComponentResourceManager(GetType(mainForm))
            Me.flexCelImgExport1 = New FlexCel.Render.FlexCelImgExport()
            Me.openFileDialog = New System.Windows.Forms.OpenFileDialog()
            Me.panel1 = New System.Windows.Forms.Panel()
            Me.MainPreview = New FlexCel.Winforms.FlexCelPreview()
            Me.thumbs = New FlexCel.Winforms.FlexCelPreview()
            Me.splitter1 = New System.Windows.Forms.Splitter()
            Me.panelLeft = New System.Windows.Forms.Panel()
            Me.cbAllSheets = New System.Windows.Forms.CheckBox()
            Me.label2 = New System.Windows.Forms.Label()
            Me.sheetSplitter = New System.Windows.Forms.Splitter()
            Me.lbSheets = New System.Windows.Forms.ListBox()
            Me.label1 = New System.Windows.Forms.Label()
            Me.PdfSaveFileDialog = New System.Windows.Forms.SaveFileDialog()
            Me.toolTip1 = New System.Windows.Forms.ToolTip(Me.components)
            Me.mainToolbar = New System.Windows.Forms.ToolStrip()
            Me.openFile = New System.Windows.Forms.ToolStripButton()
            Me.toolStripSeparator2 = New System.Windows.Forms.ToolStripSeparator()
            Me.btnFirst = New System.Windows.Forms.ToolStripButton()
            Me.btnPrev = New System.Windows.Forms.ToolStripButton()
            Me.edPage = New System.Windows.Forms.ToolStripTextBox()
            Me.btnNext = New System.Windows.Forms.ToolStripButton()
            Me.btnLast = New System.Windows.Forms.ToolStripButton()
            Me.toolStripSeparator1 = New System.Windows.Forms.ToolStripSeparator()
            Me.btnAutofit = New System.Windows.Forms.ToolStripDropDownButton()
            Me.noneToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
            Me.fitToWidthToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
            Me.fitToHeightToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
            Me.fitToPageToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
            Me.btnZoomOut = New System.Windows.Forms.ToolStripButton()
            Me.edZoom = New System.Windows.Forms.ToolStripTextBox()
            Me.btnZoomIn = New System.Windows.Forms.ToolStripButton()
            Me.toolStripSeparator3 = New System.Windows.Forms.ToolStripSeparator()
            Me.btnGridLines = New System.Windows.Forms.ToolStripButton()
            Me.btnHeadings = New System.Windows.Forms.ToolStripButton()
            Me.toolStripSeparator4 = New System.Windows.Forms.ToolStripSeparator()
            Me.btnRecalc = New System.Windows.Forms.ToolStripButton()
            Me.btnPdf = New System.Windows.Forms.ToolStripButton()
            Me.btnClose = New System.Windows.Forms.ToolStripButton()
            Me.panel1.SuspendLayout()
            Me.panelLeft.SuspendLayout()
            Me.mainToolbar.SuspendLayout()
            Me.SuspendLayout()
            '
            ' flexCelImgExport1
            '
            Me.flexCelImgExport1.AllVisibleSheets = False
            Me.flexCelImgExport1.PageSize = Nothing
            Me.flexCelImgExport1.ResetPageNumberOnEachSheet = False
            Me.flexCelImgExport1.Resolution = 96R
            Me.flexCelImgExport1.Workbook = Nothing
            '
            ' openFileDialog
            '
            Me.openFileDialog.DefaultExt = "xls"
            Me.openFileDialog.Filter = "Excel Files|*.xls|All files|*.*"
            Me.openFileDialog.Title = "Select a file to preview"
            '
            ' panel1
            '
            Me.panel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
            Me.panel1.Controls.Add(Me.MainPreview)
            Me.panel1.Controls.Add(Me.splitter1)
            Me.panel1.Controls.Add(Me.panelLeft)
            Me.panel1.Dock = System.Windows.Forms.DockStyle.Fill
            Me.panel1.Location = New System.Drawing.Point(0, 46)
            Me.panel1.Name = "panel1"
            Me.panel1.Size = New System.Drawing.Size(808, 375)
            Me.panel1.TabIndex = 8
            '
            ' MainPreview
            '
            Me.MainPreview.AutoScrollMinSize = New System.Drawing.Size(40, 383)
            Me.MainPreview.Dock = System.Windows.Forms.DockStyle.Fill
            Me.MainPreview.Document = Me.flexCelImgExport1
            Me.MainPreview.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic
            Me.MainPreview.Location = New System.Drawing.Point(144, 0)
            Me.MainPreview.Name = "MainPreview"
            Me.MainPreview.PageXSeparation = 20
            Me.MainPreview.Size = New System.Drawing.Size(662, 373)
            Me.MainPreview.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias
            Me.MainPreview.StartPage = 1
            Me.MainPreview.TabIndex = 2
            Me.MainPreview.ThumbnailLarge = Nothing
            Me.MainPreview.ThumbnailSmall = Me.thumbs
'           Me.MainPreview.StartPageChanged += New System.EventHandler(Me.flexCelPreview1_StartPageChanged)
'           Me.MainPreview.ZoomChanged += New System.EventHandler(Me.flexCelPreview1_ZoomChanged)
            '
            ' thumbs
            '
            Me.thumbs.AutoScrollMinSize = New System.Drawing.Size(20, 10)
            Me.thumbs.Dock = System.Windows.Forms.DockStyle.Fill
            Me.thumbs.Document = Me.flexCelImgExport1
            Me.thumbs.Location = New System.Drawing.Point(0, 115)
            Me.thumbs.Name = "thumbs"
            Me.thumbs.Size = New System.Drawing.Size(136, 258)
            Me.thumbs.StartPage = 1
            Me.thumbs.TabIndex = 3
            Me.thumbs.ThumbnailLarge = Me.MainPreview
            Me.thumbs.ThumbnailSmall = Nothing
            Me.thumbs.Zoom = 0.1R
            '
            ' splitter1
            '
            Me.splitter1.BackColor = System.Drawing.SystemColors.ControlLightLight
            Me.splitter1.Location = New System.Drawing.Point(136, 0)
            Me.splitter1.MinSize = 0
            Me.splitter1.Name = "splitter1"
            Me.splitter1.Size = New System.Drawing.Size(8, 373)
            Me.splitter1.TabIndex = 11
            Me.splitter1.TabStop = False
            '
            ' panelLeft
            '
            Me.panelLeft.Controls.Add(Me.cbAllSheets)
            Me.panelLeft.Controls.Add(Me.thumbs)
            Me.panelLeft.Controls.Add(Me.label2)
            Me.panelLeft.Controls.Add(Me.sheetSplitter)
            Me.panelLeft.Controls.Add(Me.lbSheets)
            Me.panelLeft.Controls.Add(Me.label1)
            Me.panelLeft.Dock = System.Windows.Forms.DockStyle.Left
            Me.panelLeft.Location = New System.Drawing.Point(0, 0)
            Me.panelLeft.Name = "panelLeft"
            Me.panelLeft.Size = New System.Drawing.Size(136, 373)
            Me.panelLeft.TabIndex = 9
            '
            ' cbAllSheets
            '
            Me.cbAllSheets.Location = New System.Drawing.Point(16, 16)
            Me.cbAllSheets.Name = "cbAllSheets"
            Me.cbAllSheets.Size = New System.Drawing.Size(104, 16)
            Me.cbAllSheets.TabIndex = 14
            Me.cbAllSheets.Text = "All Sheets"
'           Me.cbAllSheets.CheckedChanged += New System.EventHandler(Me.cbAllSheets_CheckedChanged)
            '
            ' label2
            '
            Me.label2.Dock = System.Windows.Forms.DockStyle.Top
            Me.label2.Location = New System.Drawing.Point(0, 99)
            Me.label2.Name = "label2"
            Me.label2.Size = New System.Drawing.Size(136, 16)
            Me.label2.TabIndex = 13
            Me.label2.Text = "Thumbs"
            '
            ' sheetSplitter
            '
            Me.sheetSplitter.BackColor = System.Drawing.SystemColors.ControlLightLight
            Me.sheetSplitter.Dock = System.Windows.Forms.DockStyle.Top
            Me.sheetSplitter.Location = New System.Drawing.Point(0, 91)
            Me.sheetSplitter.Name = "sheetSplitter"
            Me.sheetSplitter.Size = New System.Drawing.Size(136, 8)
            Me.sheetSplitter.TabIndex = 11
            Me.sheetSplitter.TabStop = False
            '
            ' lbSheets
            '
            Me.lbSheets.Dock = System.Windows.Forms.DockStyle.Top
            Me.lbSheets.Items.AddRange(New Object() { "No open file"})
            Me.lbSheets.Location = New System.Drawing.Point(0, 35)
            Me.lbSheets.Name = "lbSheets"
            Me.lbSheets.Size = New System.Drawing.Size(136, 56)
            Me.lbSheets.TabIndex = 10
'           Me.lbSheets.SelectedIndexChanged += New System.EventHandler(Me.lbSheets_SelectedIndexChanged)
            '
            ' label1
            '
            Me.label1.Dock = System.Windows.Forms.DockStyle.Top
            Me.label1.Location = New System.Drawing.Point(0, 0)
            Me.label1.Name = "label1"
            Me.label1.Size = New System.Drawing.Size(136, 35)
            Me.label1.TabIndex = 12
            Me.label1.Text = "Sheets"
            '
            ' PdfSaveFileDialog
            '
            Me.PdfSaveFileDialog.DefaultExt = "pdf"
            Me.PdfSaveFileDialog.Filter = "Pdf Files|*.pdf"
            Me.PdfSaveFileDialog.Title = "Select the file to export to:"
            '
            ' mainToolbar
            '
            Me.mainToolbar.ImageScalingSize = New System.Drawing.Size(24, 24)
            Me.mainToolbar.Items.AddRange(New System.Windows.Forms.ToolStripItem() { Me.openFile, Me.toolStripSeparator2, Me.btnFirst, Me.btnPrev, Me.edPage, Me.btnNext, Me.btnLast, Me.toolStripSeparator1, Me.btnAutofit, Me.btnZoomOut, Me.edZoom, Me.btnZoomIn, Me.toolStripSeparator3, Me.btnGridLines, Me.btnHeadings, Me.toolStripSeparator4, Me.btnRecalc, Me.btnPdf, Me.btnClose})
            Me.mainToolbar.LayoutStyle = System.Windows.Forms.ToolStripLayoutStyle.HorizontalStackWithOverflow
            Me.mainToolbar.Location = New System.Drawing.Point(0, 0)
            Me.mainToolbar.Name = "mainToolbar"
            Me.mainToolbar.Size = New System.Drawing.Size(808, 46)
            Me.mainToolbar.TabIndex = 14
            '
            ' openFile
            '
            Me.openFile.Image = My.Resources.open
            Me.openFile.ImageAlign = System.Drawing.ContentAlignment.TopCenter
            Me.openFile.ImageTransparentColor = System.Drawing.Color.Magenta
            Me.openFile.Name = "openFile"
            Me.openFile.Size = New System.Drawing.Size(61, 43)
            Me.openFile.Text = "&Open File"
            Me.openFile.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText
            Me.openFile.ToolTipText = "Open an Excel file"
'           Me.openFile.Click += New System.EventHandler(Me.openFile_Click)
            '
            ' toolStripSeparator2
            '
            Me.toolStripSeparator2.AutoSize = False
            Me.toolStripSeparator2.Name = "toolStripSeparator2"
            Me.toolStripSeparator2.Size = New System.Drawing.Size(20, 46)
            '
            ' btnFirst
            '
            Me.btnFirst.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text
            Me.btnFirst.Enabled = False
            Me.btnFirst.Image = (CType(resources.GetObject("btnFirst.Image"), System.Drawing.Image))
            Me.btnFirst.ImageTransparentColor = System.Drawing.Color.Magenta
            Me.btnFirst.Name = "btnFirst"
            Me.btnFirst.Size = New System.Drawing.Size(27, 43)
            Me.btnFirst.Text = "<<"
            Me.btnFirst.ToolTipText = "First page"
'           Me.btnFirst.Click += New System.EventHandler(Me.btnFirst_Click)
            '
            ' btnPrev
            '
            Me.btnPrev.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text
            Me.btnPrev.Enabled = False
            Me.btnPrev.Image = (CType(resources.GetObject("btnPrev.Image"), System.Drawing.Image))
            Me.btnPrev.ImageTransparentColor = System.Drawing.Color.Magenta
            Me.btnPrev.Name = "btnPrev"
            Me.btnPrev.Size = New System.Drawing.Size(23, 43)
            Me.btnPrev.Text = "<"
            Me.btnPrev.ToolTipText = "Previous page"
'           Me.btnPrev.Click += New System.EventHandler(Me.btnPrev_Click)
            '
            ' edPage
            '
            Me.edPage.AutoSize = False
            Me.edPage.Enabled = False
            Me.edPage.Name = "edPage"
            Me.edPage.Size = New System.Drawing.Size(100, 18)
            Me.edPage.TextBoxTextAlign = System.Windows.Forms.HorizontalAlignment.Right
'           Me.edPage.Leave += New System.EventHandler(Me.edPage_Leave)
'           Me.edPage.KeyPress += New System.Windows.Forms.KeyPressEventHandler(Me.edPage_KeyPress)
            '
            ' btnNext
            '
            Me.btnNext.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text
            Me.btnNext.Enabled = False
            Me.btnNext.Image = (CType(resources.GetObject("btnNext.Image"), System.Drawing.Image))
            Me.btnNext.ImageTransparentColor = System.Drawing.Color.Magenta
            Me.btnNext.Name = "btnNext"
            Me.btnNext.Size = New System.Drawing.Size(23, 43)
            Me.btnNext.Text = ">"
            Me.btnNext.ToolTipText = "Next page"
'           Me.btnNext.Click += New System.EventHandler(Me.btnNext_Click)
            '
            ' btnLast
            '
            Me.btnLast.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text
            Me.btnLast.Enabled = False
            Me.btnLast.Image = (CType(resources.GetObject("btnLast.Image"), System.Drawing.Image))
            Me.btnLast.ImageTransparentColor = System.Drawing.Color.Magenta
            Me.btnLast.Name = "btnLast"
            Me.btnLast.Size = New System.Drawing.Size(27, 43)
            Me.btnLast.Text = ">>"
            Me.btnLast.ToolTipText = "Last page"
'           Me.btnLast.Click += New System.EventHandler(Me.btnLast_Click)
            '
            ' toolStripSeparator1
            '
            Me.toolStripSeparator1.Name = "toolStripSeparator1"
            Me.toolStripSeparator1.Size = New System.Drawing.Size(6, 46)
            '
            ' btnAutofit
            '
            Me.btnAutofit.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() { Me.noneToolStripMenuItem, Me.fitToWidthToolStripMenuItem, Me.fitToHeightToolStripMenuItem, Me.fitToPageToolStripMenuItem})
            Me.btnAutofit.Image = My.Resources.autofit
            Me.btnAutofit.ImageTransparentColor = System.Drawing.Color.Magenta
            Me.btnAutofit.Name = "btnAutofit"
            Me.btnAutofit.Size = New System.Drawing.Size(76, 43)
            Me.btnAutofit.Text = "No Autofit"
            Me.btnAutofit.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText
            '
            ' noneToolStripMenuItem
            '
            Me.noneToolStripMenuItem.Name = "noneToolStripMenuItem"
            Me.noneToolStripMenuItem.Size = New System.Drawing.Size(140, 22)
            Me.noneToolStripMenuItem.Text = "No Autofit"
'           Me.noneToolStripMenuItem.Click += New System.EventHandler(Me.noneToolStripMenuItem_Click)
            '
            ' fitToWidthToolStripMenuItem
            '
            Me.fitToWidthToolStripMenuItem.Name = "fitToWidthToolStripMenuItem"
            Me.fitToWidthToolStripMenuItem.Size = New System.Drawing.Size(140, 22)
            Me.fitToWidthToolStripMenuItem.Text = "Fit to Width"
'           Me.fitToWidthToolStripMenuItem.Click += New System.EventHandler(Me.fitToWidthToolStripMenuItem_Click)
            '
            ' fitToHeightToolStripMenuItem
            '
            Me.fitToHeightToolStripMenuItem.Name = "fitToHeightToolStripMenuItem"
            Me.fitToHeightToolStripMenuItem.Size = New System.Drawing.Size(140, 22)
            Me.fitToHeightToolStripMenuItem.Text = "Fit to Height"
'           Me.fitToHeightToolStripMenuItem.Click += New System.EventHandler(Me.fitToHeightToolStripMenuItem_Click)
            '
            ' fitToPageToolStripMenuItem
            '
            Me.fitToPageToolStripMenuItem.Name = "fitToPageToolStripMenuItem"
            Me.fitToPageToolStripMenuItem.Size = New System.Drawing.Size(140, 22)
            Me.fitToPageToolStripMenuItem.Text = "Fit to Page"
'           Me.fitToPageToolStripMenuItem.Click += New System.EventHandler(Me.fitToPageToolStripMenuItem_Click)
            '
            ' btnZoomOut
            '
            Me.btnZoomOut.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text
            Me.btnZoomOut.Enabled = False
            Me.btnZoomOut.Image = (CType(resources.GetObject("btnZoomOut.Image"), System.Drawing.Image))
            Me.btnZoomOut.ImageTransparentColor = System.Drawing.Color.Magenta
            Me.btnZoomOut.Name = "btnZoomOut"
            Me.btnZoomOut.Size = New System.Drawing.Size(23, 43)
            Me.btnZoomOut.Text = "-"
            Me.btnZoomOut.ToolTipText = "Zoom out"
'           Me.btnZoomOut.Click += New System.EventHandler(Me.btnZoomOut_Click)
            '
            ' edZoom
            '
            Me.edZoom.AutoSize = False
            Me.edZoom.Enabled = False
            Me.edZoom.Name = "edZoom"
            Me.edZoom.Size = New System.Drawing.Size(40, 18)
            Me.edZoom.TextBoxTextAlign = System.Windows.Forms.HorizontalAlignment.Right
'           Me.edZoom.Enter += New System.EventHandler(Me.edZoom_Enter)
'           Me.edZoom.KeyPress += New System.Windows.Forms.KeyPressEventHandler(Me.edZoom_KeyPress)
            '
            ' btnZoomIn
            '
            Me.btnZoomIn.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text
            Me.btnZoomIn.Enabled = False
            Me.btnZoomIn.Image = (CType(resources.GetObject("btnZoomIn.Image"), System.Drawing.Image))
            Me.btnZoomIn.ImageTransparentColor = System.Drawing.Color.Magenta
            Me.btnZoomIn.Name = "btnZoomIn"
            Me.btnZoomIn.Size = New System.Drawing.Size(23, 43)
            Me.btnZoomIn.Text = "+"
            Me.btnZoomIn.ToolTipText = "Zoom in"
'           Me.btnZoomIn.Click += New System.EventHandler(Me.btnZoomIn_Click)
            '
            ' toolStripSeparator3
            '
            Me.toolStripSeparator3.AutoSize = False
            Me.toolStripSeparator3.Name = "toolStripSeparator3"
            Me.toolStripSeparator3.Size = New System.Drawing.Size(20, 46)
            '
            ' btnGridLines
            '
            Me.btnGridLines.CheckOnClick = True
            Me.btnGridLines.Enabled = False
            Me.btnGridLines.Image = My.Resources.grid
            Me.btnGridLines.ImageTransparentColor = System.Drawing.Color.Magenta
            Me.btnGridLines.Name = "btnGridLines"
            Me.btnGridLines.Size = New System.Drawing.Size(57, 43)
            Me.btnGridLines.Text = "&Gridlines"
            Me.btnGridLines.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText
            Me.btnGridLines.ToolTipText = "Show gridlines"
'           Me.btnGridLines.Click += New System.EventHandler(Me.btnGridLines_Click)
            '
            ' btnHeadings
            '
            Me.btnHeadings.CheckOnClick = True
            Me.btnHeadings.Enabled = False
            Me.btnHeadings.Image = My.Resources.Head
            Me.btnHeadings.ImageTransparentColor = System.Drawing.Color.Magenta
            Me.btnHeadings.Name = "btnHeadings"
            Me.btnHeadings.Size = New System.Drawing.Size(61, 43)
            Me.btnHeadings.Text = "&Headings"
            Me.btnHeadings.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText
            Me.btnHeadings.ToolTipText = "Show the headings"
'           Me.btnHeadings.Click += New System.EventHandler(Me.btnHeadings_Click)
            '
            ' toolStripSeparator4
            '
            Me.toolStripSeparator4.Name = "toolStripSeparator4"
            Me.toolStripSeparator4.Size = New System.Drawing.Size(6, 46)
            '
            ' btnRecalc
            '
            Me.btnRecalc.Enabled = False
            Me.btnRecalc.Image = My.Resources.calc
            Me.btnRecalc.ImageAlign = System.Drawing.ContentAlignment.TopCenter
            Me.btnRecalc.ImageTransparentColor = System.Drawing.Color.Magenta
            Me.btnRecalc.Name = "btnRecalc"
            Me.btnRecalc.Size = New System.Drawing.Size(45, 43)
            Me.btnRecalc.Text = "&Recalc"
            Me.btnRecalc.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText
            Me.btnRecalc.ToolTipText = "Recalculate the file"
'           Me.btnRecalc.Click += New System.EventHandler(Me.btnRecalc_Click)
            '
            ' btnPdf
            '
            Me.btnPdf.Enabled = False
            Me.btnPdf.Image = My.Resources.pdf
            Me.btnPdf.ImageAlign = System.Drawing.ContentAlignment.TopCenter
            Me.btnPdf.ImageTransparentColor = System.Drawing.Color.Magenta
            Me.btnPdf.Name = "btnPdf"
            Me.btnPdf.Size = New System.Drawing.Size(79, 43)
            Me.btnPdf.Text = "Export to &Pdf"
            Me.btnPdf.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText
            Me.btnPdf.ToolTipText = "Export the file to Pdf"
'           Me.btnPdf.Click += New System.EventHandler(Me.btnPdf_Click)
            '
            ' btnClose
            '
            Me.btnClose.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right
            Me.btnClose.Image = My.Resources.close
            Me.btnClose.ImageAlign = System.Drawing.ContentAlignment.TopCenter
            Me.btnClose.ImageTransparentColor = System.Drawing.Color.Magenta
            Me.btnClose.Name = "btnClose"
            Me.btnClose.Size = New System.Drawing.Size(59, 43)
            Me.btnClose.Text = "     E&xit     "
            Me.btnClose.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText
            Me.btnClose.ToolTipText = "Exit from the application"
'           Me.btnClose.Click += New System.EventHandler(Me.btnClose_Click)
            '
            ' mainForm
            '
            Me.AutoScaleDimensions = New System.Drawing.SizeF(6F, 13F)
            Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
            Me.ClientSize = New System.Drawing.Size(808, 421)
            Me.Controls.Add(Me.panel1)
            Me.Controls.Add(Me.mainToolbar)
            Me.Name = "mainForm"
            Me.Text = "Custom Preview Demo"
'           Me.Load += New System.EventHandler(Me.mainForm_Load)
            Me.panel1.ResumeLayout(False)
            Me.panelLeft.ResumeLayout(False)
            Me.mainToolbar.ResumeLayout(False)
            Me.mainToolbar.PerformLayout()
            Me.ResumeLayout(False)
            Me.PerformLayout()

        End Sub
        #End Region

        Private openFileDialog As System.Windows.Forms.OpenFileDialog
        Private panel1 As System.Windows.Forms.Panel
        Private panelLeft As System.Windows.Forms.Panel
        Private WithEvents lbSheets As System.Windows.Forms.ListBox
        Private splitter1 As System.Windows.Forms.Splitter
        Private label1 As System.Windows.Forms.Label
        Private label2 As System.Windows.Forms.Label
        Private PdfSaveFileDialog As System.Windows.Forms.SaveFileDialog
        Private WithEvents cbAllSheets As System.Windows.Forms.CheckBox
        Private sheetSplitter As System.Windows.Forms.Splitter
        Private toolTip1 As System.Windows.Forms.ToolTip
        Private flexCelImgExport1 As FlexCel.Render.FlexCelImgExport
        Private WithEvents MainPreview As FlexCel.Winforms.FlexCelPreview
        Private thumbs As FlexCel.Winforms.FlexCelPreview
        Private mainToolbar As ToolStrip
        Private WithEvents openFile As ToolStripButton
        Private toolStripSeparator1 As ToolStripSeparator
        Private WithEvents btnRecalc As ToolStripButton
        Private WithEvents btnPdf As ToolStripButton
        Private WithEvents btnClose As ToolStripButton
        Private toolStripSeparator2 As ToolStripSeparator
        Private WithEvents btnFirst As ToolStripButton
        Private WithEvents btnPrev As ToolStripButton
        Private WithEvents edPage As ToolStripTextBox
        Private WithEvents btnNext As ToolStripButton
        Private WithEvents btnLast As ToolStripButton
        Private WithEvents btnZoomOut As ToolStripButton
        Private WithEvents edZoom As ToolStripTextBox
        Private WithEvents btnZoomIn As ToolStripButton
        Private toolStripSeparator3 As ToolStripSeparator
        Private WithEvents btnHeadings As ToolStripButton
        Private WithEvents btnGridLines As ToolStripButton
        Private toolStripSeparator4 As ToolStripSeparator
        Private btnAutofit As ToolStripDropDownButton
        Private WithEvents noneToolStripMenuItem As ToolStripMenuItem
        Private WithEvents fitToWidthToolStripMenuItem As ToolStripMenuItem
        Private WithEvents fitToHeightToolStripMenuItem As ToolStripMenuItem
        Private WithEvents fitToPageToolStripMenuItem As ToolStripMenuItem
    End Class
End Namespace

Form1.vb

Imports System.ComponentModel
Imports System.IO
Imports System.Drawing.Drawing2D

Imports System.Threading

Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports FlexCel.Winforms
Imports FlexCel.Render
Imports FlexCel.Pdf

Namespace CustomPreview
    ''' <summary>
    ''' Previewer of files.
    ''' </summary>
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Public Sub New()
            Me.New(New String(){})
        End Sub

        Public Sub New(ByVal Args() As String)
            InitializeComponent()
            ResizeToolbar(mainToolbar)
            If Args.Length > 0 Then
                LoadFile(Args(0))
            End If

            If ExcelFile.SupportsXlsx Then
                Me.openFileDialog.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm|Excel 97/2003|*.xls|Excel 2007|*.xlsx;*.xlsm|All files|*.*"
            End If

            MainPreview.CenteredPreview = True
            thumbs.CenteredPreview = True
        End Sub

        Private Sub ResizeToolbar(ByVal toolbar As ToolStrip)

            Using gr As Graphics = CreateGraphics()
                Dim xFactor As Double = gr.DpiX / 96.0
                Dim yFactor As Double = gr.DpiY / 96.0
                toolbar.ImageScalingSize = New Size(CInt(Fix(24 * xFactor)), CInt(Fix(24 * yFactor)))
                toolbar.Width = 0 'force a recalc of the buttons.
            End Using
        End Sub

        Private Sub UpdatePages()
            edPage.Text = String.Format("{0} of {1}", MainPreview.StartPage, MainPreview.TotalPages)
        End Sub

        Private Sub flexCelPreview1_StartPageChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles MainPreview.StartPageChanged
            UpdatePages()
        End Sub

        Private Sub ChangePages()
            Dim s As String = edPage.Text.Trim()
            Dim pos As Integer = 0
            Do While pos < s.Length AndAlso s.Chars(pos) >= "0"c AndAlso s.Chars(pos) <= "9"c
                pos += 1
            Loop
            If pos > 0 Then
                Dim page As Integer = MainPreview.StartPage
                Try
                    page = Convert.ToInt32(s.Substring(0, pos))
                Catch e1 As Exception
                End Try

                MainPreview.StartPage = page
            End If
            UpdatePages()
        End Sub

        Private Sub edPage_Leave(ByVal sender As Object, ByVal e As System.EventArgs) Handles edPage.Leave
            ChangePages()
        End Sub

        Private Sub edPage_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles edPage.KeyPress
            If e.KeyChar = ChrW(13) Then
                ChangePages()
            End If
            If e.KeyChar = ChrW(27) Then
                UpdatePages()
            End If
        End Sub

        Private Sub flexCelPreview1_ZoomChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles MainPreview.ZoomChanged
            UpdateZoom()
        End Sub

        Private Sub UpdateZoom()
            edZoom.Text = String.Format("{0}%", CInt(Fix(Math.Round(MainPreview.Zoom * 100))))
            If MainPreview.AutofitPreview = TAutofitPreview.None Then
                UpdateAutofitText()
            End If
        End Sub

        Private Sub ChangeZoom()
            Dim s As String = edZoom.Text.Trim()
            Dim pos As Integer = 0
            Do While pos < s.Length AndAlso s.Chars(pos) >= "0"c AndAlso s.Chars(pos) <= "9"c
                pos += 1
            Loop
            If pos > 0 Then
                Dim zoom As Integer = CInt(Fix(Math.Round(MainPreview.Zoom * 100)))
                Try
                    zoom = Convert.ToInt32(s.Substring(0, pos))
                Catch e1 As Exception
                End Try

                MainPreview.Zoom = zoom / 100.0
            End If
            UpdateZoom()
        End Sub

        Private Sub edZoom_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles edZoom.KeyPress
            If e.KeyChar = ChrW(13) Then
                ChangeZoom()
            End If
            If e.KeyChar = ChrW(27) Then
                UpdateZoom()
            End If
        End Sub

        Private Sub edZoom_Enter(ByVal sender As Object, ByVal e As System.EventArgs) Handles edZoom.Enter
            ChangeZoom()
        End Sub

        Private Sub btnClose_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnClose.Click
            Close()
        End Sub

        Private Sub openFile_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles openFile.Click
            If openFileDialog.ShowDialog() <> System.Windows.Forms.DialogResult.OK Then
                Return
            End If
            LoadFile(openFileDialog.FileName)
        End Sub

        'The event that will actually provide the password to open the empty form.
        Private Sub GetPassword(ByVal e As OnPasswordEventArgs)
            Dim Pwd As New PasswordForm()
            e.Password = String.Empty
            If Pwd.ShowDialog() <> System.Windows.Forms.DialogResult.OK Then
                Return
            End If
            e.Password = Pwd.Password
        End Sub

        Friend Sub LoadFile(ByVal FileName As String)
            openFileDialog.FileName = FileName
            lbSheets.Items.Clear()

            Dim xls As New XlsFile()
            xls.HeadingColWidth = -1
            xls.HeadingRowHeight = -1
            AddHandler xls.Protection.OnPassword, AddressOf GetPassword
            xls.Open(FileName)

            For i As Integer = 1 To xls.SheetCount
                lbSheets.Items.Add(xls.GetSheetName(i))
            Next i

            lbSheets.SelectedIndex = xls.ActiveSheet - 1

            flexCelImgExport1.Workbook = xls
            MainPreview.InvalidatePreview()
            Text = "Custom Preview: " & openFileDialog.FileName
            'btnHeadings.Checked = flexCelImgExport1.Workbook.PrintHeadings;
            'btnGridLines.Checked = flexCelImgExport1.Workbook.PrintGridLines;
            btnFirst.Enabled = True
            btnPrev.Enabled = True
            btnNext.Enabled = True
            btnLast.Enabled = True
            edPage.Enabled = True
            btnZoomIn.Enabled = True
            edZoom.Enabled = True
            btnZoomOut.Enabled = True
            btnGridLines.Enabled = True
            btnHeadings.Enabled = True
            btnRecalc.Enabled = True
            btnPdf.Enabled = True

        End Sub

        Private Sub btnFirst_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnFirst.Click
            MainPreview.StartPage = 1
        End Sub

        Private Sub btnPrev_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnPrev.Click
            MainPreview.StartPage -= 1
        End Sub

        Private Sub btnNext_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnNext.Click
            MainPreview.StartPage += 1
        End Sub

        Private Sub btnLast_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnLast.Click
            MainPreview.StartPage = MainPreview.TotalPages
        End Sub

        Private Sub btnZoomOut_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnZoomOut.Click
            MainPreview.Zoom -= 0.1
        End Sub

        Private Sub btnZoomIn_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnZoomIn.Click
            MainPreview.Zoom += 0.1
        End Sub

        Private Sub lbSheets_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles lbSheets.SelectedIndexChanged
            If flexCelImgExport1.Workbook Is Nothing Then
                Return
            End If
            If lbSheets.Items.Count > flexCelImgExport1.Workbook.SheetCount Then
                Return
            End If
            flexCelImgExport1.Workbook.ActiveSheet = lbSheets.SelectedIndex + 1
            MainPreview.InvalidatePreview()
        End Sub

        Private Sub btnPdf_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnPdf.Click
            If flexCelImgExport1.Workbook Is Nothing Then
                MessageBox.Show("There is no open file")
                Return
            End If
            If PdfSaveFileDialog.ShowDialog() <> System.Windows.Forms.DialogResult.OK Then
                Return
            End If

            Using PdfExport As New FlexCelPdfExport(flexCelImgExport1.Workbook, True)
                If Not DoExportToPdf(PdfExport) Then
                    Return
                End If
            End Using

            If MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo, MessageBoxIcon.Question) <> System.Windows.Forms.DialogResult.Yes Then
                Return
            End If
            Process.Start(PdfSaveFileDialog.FileName)
        End Sub

        Private Function DoExportToPdf(ByVal PdfExport As FlexCelPdfExport) As Boolean
            Dim MyPdfThread As New PdfThread(PdfExport, PdfSaveFileDialog.FileName, cbAllSheets.Checked)
            Dim PdfExportThread As New Thread(New ThreadStart(AddressOf MyPdfThread.ExportToPdf))
            PdfExportThread.Start()
            Using Pg As New PdfProgressDialog()
                Pg.ShowProgress(PdfExportThread, PdfExport)
                If Pg.DialogResult <> System.Windows.Forms.DialogResult.OK Then
                    PdfExport.Cancel()
                    PdfExportThread.Join() 'We could just leave the thread running until it dies, but there are 2 reasons for waiting until it finishes:
                                            '1) We could dispose it before it ends. This is workaroundable.
                                            '2) We might change its workbook object before it ends (by loading other file). This will surely bring issues.
                    Return False
                End If

                If MyPdfThread IsNot Nothing AndAlso MyPdfThread.MainException IsNot Nothing Then
                    Throw MyPdfThread.MainException
                End If
            End Using
            Return True
        End Function

        Private Sub cbAllSheets_CheckedChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles cbAllSheets.CheckedChanged
            lbSheets.Visible = Not cbAllSheets.Checked
            sheetSplitter.Visible = lbSheets.Visible
            flexCelImgExport1.AllVisibleSheets = cbAllSheets.Checked
            If flexCelImgExport1.Workbook Is Nothing Then
                Return
            End If
            MainPreview.InvalidatePreview()

        End Sub

        Private Sub btnRecalc_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnRecalc.Click
            If flexCelImgExport1.Workbook Is Nothing Then
                MessageBox.Show("Please open a file before recalculating.")
                Return
            End If
            flexCelImgExport1.Workbook.Recalc(True)
            MainPreview.InvalidatePreview()

        End Sub

        Private Sub mainForm_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
        End Sub

        Private Sub btnHeadings_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnHeadings.Click
            Dim xls As ExcelFile = flexCelImgExport1.Workbook
            If xls Is Nothing Then
                Return
            End If

            If cbAllSheets.Checked Then
                Dim SaveActiveSheet As Integer = xls.ActiveSheet
                For sheet As Integer = 1 To xls.SheetCount
                    xls.ActiveSheet = sheet
                    xls.PrintHeadings = btnHeadings.Checked
                Next sheet
                xls.ActiveSheet = SaveActiveSheet
            Else
                xls.PrintHeadings = btnHeadings.Checked
            End If
            MainPreview.InvalidatePreview()

        End Sub

        Private Sub btnGridLines_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnGridLines.Click
            Dim xls As ExcelFile = flexCelImgExport1.Workbook
            If xls Is Nothing Then
                Return
            End If

            If cbAllSheets.Checked Then
                Dim SaveActiveSheet As Integer = xls.ActiveSheet
                For sheet As Integer = 1 To xls.SheetCount
                    xls.ActiveSheet = sheet
                    xls.PrintGridLines = btnGridLines.Checked
                Next sheet
                xls.ActiveSheet = SaveActiveSheet
            Else
                xls.PrintGridLines = btnGridLines.Checked
            End If
            MainPreview.InvalidatePreview()

        End Sub

        Private Sub noneToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles noneToolStripMenuItem.Click
            MainPreview.AutofitPreview = TAutofitPreview.None
            UpdateAutofitText()
        End Sub

        Private Sub fitToWidthToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles fitToWidthToolStripMenuItem.Click
            MainPreview.AutofitPreview = TAutofitPreview.Width
            UpdateAutofitText()
        End Sub

        Private Sub fitToHeightToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles fitToHeightToolStripMenuItem.Click
            MainPreview.AutofitPreview = TAutofitPreview.Height
            UpdateAutofitText()
        End Sub

        Private Sub fitToPageToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles fitToPageToolStripMenuItem.Click
            MainPreview.AutofitPreview = TAutofitPreview.Full
            UpdateAutofitText()
        End Sub

        Private Sub UpdateAutofitText()
            Select Case MainPreview.AutofitPreview
                Case TAutofitPreview.None
                    btnAutofit.Text = "No Autofit"
                Case TAutofitPreview.Width
                    btnAutofit.Text = "Fit to Width"
                Case TAutofitPreview.Height
                    btnAutofit.Text = "Fit to Height"
                Case TAutofitPreview.Full
                    btnAutofit.Text = "Fit to Page"
                Case Else
            End Select

        End Sub

    End Class

    #Region "PdfThread"
    Friend Class PdfThread
        Private PdfExport As FlexCelPdfExport
        Private FileName As String
        Private AllVisibleSheets As Boolean
        Private FMainException As Exception

        Friend Sub New(ByVal aPdfExport As FlexCelPdfExport, ByVal aFileName As String, ByVal aAllVisibleSheets As Boolean)
            PdfExport = aPdfExport
            FileName = aFileName
            AllVisibleSheets = aAllVisibleSheets
        End Sub

        Friend Sub ExportToPdf()
            Try
                If AllVisibleSheets Then
                    Try
                        Using f As New FileStream(FileName, FileMode.Create, FileAccess.Write)
                            PdfExport.BeginExport(f)
                            PdfExport.PageLayout = TPageLayout.Outlines
                            PdfExport.ExportAllVisibleSheets(False, System.IO.Path.GetFileNameWithoutExtension(FileName))
                            PdfExport.EndExport()
                        End Using
                    Catch
                        Try
                            File.Delete(FileName)
                        Catch
                            'Not here.
                        End Try
                        Throw
                    End Try
                Else
                    PdfExport.PageLayout = TPageLayout.None
                    PdfExport.Export(FileName)
                End If
            Catch ex As Exception
                FMainException = ex
            End Try
        End Sub

        Friend ReadOnly Property MainException() As Exception
            Get
                Return FMainException
            End Get
        End Property
    End Class
    #End Region

End Namespace

PasswordForm.Designer.vb

Imports System.ComponentModel
Namespace CustomPreview
    Partial Public Class PasswordForm
        Inherits System.Windows.Forms.Form

        Private label1 As System.Windows.Forms.Label
        Private btnOk As System.Windows.Forms.Button
        Private label3 As System.Windows.Forms.Label
        Private PasswordEdit As System.Windows.Forms.TextBox
        ''' <summary>
        ''' Required designer variable.
        ''' </summary>
        Private components As System.ComponentModel.Container = Nothing

        ''' <summary>
        ''' Clean up any resources being used.
        ''' </summary>
        Protected Overrides Sub Dispose(ByVal disposing As Boolean)
            If disposing Then
                If components IsNot Nothing Then
                    components.Dispose()
                End If
            End If
            MyBase.Dispose(disposing)
        End Sub

        #Region "Windows Form Designer generated code"
        ''' <summary>
        ''' Required method for Designer support - do not modify
        ''' the contents of this method with the code editor.
        ''' </summary>
        Private Sub InitializeComponent()
            Me.label1 = New System.Windows.Forms.Label()
            Me.btnOk = New System.Windows.Forms.Button()
            Me.label3 = New System.Windows.Forms.Label()
            Me.PasswordEdit = New System.Windows.Forms.TextBox()
            Me.SuspendLayout()
            '
            ' label1
            '
            Me.label1.Location = New System.Drawing.Point(24, 16)
            Me.label1.Name = "label1"
            Me.label1.Size = New System.Drawing.Size(240, 23)
            Me.label1.TabIndex = 0
            Me.label1.Text = "Please enter the password to open this file:"
            '
            ' btnOk
            '
            Me.btnOk.DialogResult = System.Windows.Forms.DialogResult.OK
            Me.btnOk.Location = New System.Drawing.Point(152, 112)
            Me.btnOk.Name = "btnOk"
            Me.btnOk.TabIndex = 1
            Me.btnOk.Text = "Ok"
            '
            ' label3
            '
            Me.label3.Location = New System.Drawing.Point(40, 64)
            Me.label3.Name = "label3"
            Me.label3.Size = New System.Drawing.Size(64, 23)
            Me.label3.TabIndex = 5
            Me.label3.Text = "Password:"
            '
            ' PasswordEdit
            '
            Me.PasswordEdit.Anchor = (CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.PasswordEdit.Location = New System.Drawing.Point(112, 64)
            Me.PasswordEdit.Name = "PasswordEdit"
            Me.PasswordEdit.PasswordChar = "*"c
            Me.PasswordEdit.Size = New System.Drawing.Size(200, 20)
            Me.PasswordEdit.TabIndex = 0
            Me.PasswordEdit.Text = ""
            '
            ' PasswordForm
            '
            Me.AcceptButton = Me.btnOk
            Me.AutoScaleDimensions = New System.Drawing.SizeF(6F, 13F)
            Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
            Me.ClientSize = New System.Drawing.Size(408, 154)
            Me.Controls.Add(Me.label3)
            Me.Controls.Add(Me.PasswordEdit)
            Me.Controls.Add(Me.btnOk)
            Me.Controls.Add(Me.label1)
            Me.Name = "PasswordForm"
            Me.ShowInTaskbar = False
            Me.Text = "File is password protected."
            Me.ResumeLayout(False)

        End Sub
        #End Region
    End Class
End Namespace

PasswordForm.vb

Imports System.ComponentModel

Namespace CustomPreview
    ''' <summary>
    ''' Form for asking for a password when the file is password protected.
    ''' </summary>
    Partial Public Class PasswordForm
        Inherits System.Windows.Forms.Form

        Public Sub New()
            InitializeComponent()
        End Sub

        Public ReadOnly Property Password() As String
            Get
                Return PasswordEdit.Text
            End Get
        End Property
    End Class
End Namespace

PdfProgressDialog.Designer.vb

Imports System.ComponentModel
Imports System.Threading
Imports FlexCel.Render
Namespace CustomPreview
    Partial Public Class PdfProgressDialog
        Inherits System.Windows.Forms.Form

        Private btnCancel As System.Windows.Forms.Button
        Private statusBar1 As System.Windows.Forms.StatusBar
        Private statusBarPanel1 As System.Windows.Forms.StatusBarPanel
        Private statusBarPanelTime As System.Windows.Forms.StatusBarPanel
        Private labelPages As System.Windows.Forms.Label
        ''' <summary>
        ''' Required designer variable.
        ''' </summary>
        Private components As System.ComponentModel.Container = Nothing

        ''' <summary>
        ''' Clean up any resources being used.
        ''' </summary>
        Protected Overrides Sub Dispose(ByVal disposing As Boolean)
            If disposing Then
                If components IsNot Nothing Then
                    components.Dispose()
                End If
            End If
            MyBase.Dispose(disposing)
        End Sub

        #Region "Windows Form Designer generated code"
        ''' <summary>
        ''' Required method for Designer support - do not modify
        ''' the contents of this method with the code editor.
        ''' </summary>
        Private Sub InitializeComponent()
            Me.btnCancel = New System.Windows.Forms.Button()
            Me.statusBar1 = New System.Windows.Forms.StatusBar()
            Me.statusBarPanel1 = New System.Windows.Forms.StatusBarPanel()
            Me.statusBarPanelTime = New System.Windows.Forms.StatusBarPanel()
            Me.labelPages = New System.Windows.Forms.Label()
            Me.timer1 = New System.Timers.Timer()
            CType(Me.statusBarPanel1, System.ComponentModel.ISupportInitialize).BeginInit()
            CType(Me.statusBarPanelTime, System.ComponentModel.ISupportInitialize).BeginInit()
            CType(Me.timer1, System.ComponentModel.ISupportInitialize).BeginInit()
            Me.SuspendLayout()
            '
            ' btnCancel
            '
            Me.btnCancel.Anchor = System.Windows.Forms.AnchorStyles.Bottom
            Me.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel
            Me.btnCancel.Location = New System.Drawing.Point(184, 64)
            Me.btnCancel.Name = "btnCancel"
            Me.btnCancel.TabIndex = 0
            Me.btnCancel.Text = "Cancel"
            '
            ' statusBar1
            '
            Me.statusBar1.Location = New System.Drawing.Point(0, 100)
            Me.statusBar1.Name = "statusBar1"
            Me.statusBar1.Panels.AddRange(New System.Windows.Forms.StatusBarPanel() { Me.statusBarPanel1, Me.statusBarPanelTime})
            Me.statusBar1.ShowPanels = True
            Me.statusBar1.Size = New System.Drawing.Size(448, 22)
            Me.statusBar1.TabIndex = 1
            '
            ' statusBarPanel1
            '
            Me.statusBarPanel1.BorderStyle = System.Windows.Forms.StatusBarPanelBorderStyle.None
            Me.statusBarPanel1.Text = "Elapsed Time:"
            Me.statusBarPanel1.Width = 80
            '
            ' statusBarPanelTime
            '
            Me.statusBarPanelTime.BorderStyle = System.Windows.Forms.StatusBarPanelBorderStyle.None
            Me.statusBarPanelTime.Text = "0:00"
            '
            ' labelPages
            '
            Me.labelPages.Anchor = (CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.labelPages.Location = New System.Drawing.Point(16, 16)
            Me.labelPages.Name = "labelPages"
            Me.labelPages.Size = New System.Drawing.Size(408, 16)
            Me.labelPages.TabIndex = 2
            '
            ' timer1
            '
            Me.timer1.Enabled = True
            Me.timer1.SynchronizingObject = Me
'           Me.timer1.Elapsed += New System.Timers.ElapsedEventHandler(Me.timer1_Elapsed)
            '
            ' PdfProgressDialog
            '
            Me.AutoScaleDimensions = New System.Drawing.SizeF(6F, 13F)
            Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
            Me.ClientSize = New System.Drawing.Size(448, 122)
            Me.ControlBox = False
            Me.Controls.Add(Me.labelPages)
            Me.Controls.Add(Me.statusBar1)
            Me.Controls.Add(Me.btnCancel)
            Me.MaximizeBox = False
            Me.MinimizeBox = False
            Me.Name = "PdfProgressDialog"
            Me.ShowInTaskbar = False
            Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent
            Me.Text = "Please wait..."
'           Me.Closed += New System.EventHandler(Me.PdfProgressDialog_Closed)
            CType(Me.statusBarPanel1, System.ComponentModel.ISupportInitialize).EndInit()
            CType(Me.statusBarPanelTime, System.ComponentModel.ISupportInitialize).EndInit()
            CType(Me.timer1, System.ComponentModel.ISupportInitialize).EndInit()
            Me.ResumeLayout(False)

        End Sub
        #End Region
    End Class
End Namespace

PdfProgressDialog.vb

Imports System.ComponentModel

Imports System.Threading

Imports FlexCel.Render

Namespace CustomPreview
    ''' <summary>
    ''' Shows progress as we are exporting to pdf.
    ''' </summary>
    Partial Public Class PdfProgressDialog
        Inherits System.Windows.Forms.Form

        Private WithEvents timer1 As System.Timers.Timer

        Public Sub New()
            InitializeComponent()
        End Sub

        Private StartTime As Date
        Private RunningThread As Thread
        Private PdfExport As FlexCelPdfExport

        Private Sub timer1_Elapsed(ByVal sender As Object, ByVal e As System.Timers.ElapsedEventArgs) Handles timer1.Elapsed
            UpdateStatus()
        End Sub

        Public Sub ShowProgress(ByVal aRunningThread As Thread, ByVal aPdfExport As FlexCelPdfExport)
            RunningThread = aRunningThread

            If Not RunningThread.IsAlive Then
                DialogResult = System.Windows.Forms.DialogResult.OK
                Return
            End If
            timer1.Enabled = True
            StartTime = Date.Now
            PdfExport = aPdfExport
            ShowDialog()
        End Sub

        Private Sub UpdateStatus()
            Dim ts As TimeSpan = Date.Now.Subtract(StartTime)
            Dim hours As String
            If ts.Hours = 0 Then
                hours = ""
            Else
                hours = ts.Hours.ToString("00") & ":"
            End If
            statusBarPanelTime.Text = hours & ts.Minutes.ToString("00") & ":" & ts.Seconds.ToString("00")

            If Not RunningThread.IsAlive Then
                DialogResult = System.Windows.Forms.DialogResult.OK
            End If

            If PdfExport.Progress.TotalPage > 0 Then
                labelPages.Text = String.Format("Generating Page {0} of {1}", PdfExport.Progress.Page, PdfExport.Progress.TotalPage)
            End If
        End Sub

        Private Sub PdfProgressDialog_Closed(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Closed
            timer1.Enabled = False
        End Sub

    End Class
End Namespace

Program.vb

Namespace CustomPreview
    Friend NotInheritable Class Program

        Private Sub New()
        End Sub

        ''' <summary>
        ''' The main entry point for the application.
        ''' </summary>
       <STAThread> _
        Shared Sub Main(ByVal Args() As String)
            Application.EnableVisualStyles()
            Application.SetCompatibleTextRenderingDefault(False)
            Application.Run(New mainForm(Args))
        End Sub
    End Class
End Namespace


Exporting Excel files to PDF (VB.Net / netframework) | FlexCel Studio for the .NET Framework documentation

Exporting Excel files to PDF (VB.Net / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\vb\VS2022\netframework\25.Printing and Exporting\30.ExportPdf and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​vb/​VS2022/​netframework/​Modules/​25.​Printing and Exporting/​30.​ExportPdf

Overview

FlexCel can natively export an Excel file to PDF, without needing to have Excel or Adobe Pdf installed.

Concepts

  • FlexCel PDF output is not 100% identical to Excel output, and it can't be that way. But it is very similar, and this includes fonts, colors, margins, headers/footers/images, etc. It can print cells with multiple fonts, it can replace the macros on headers and footers (like "&CPage &P of &N"), export headers and hyperlinks, correctly export conditional formats and the list goes on.

  • Among the things that are not exported you can find:

    • ActiveX objects

    • 3D Charts (They will be rendered as 2d)

    • Not common AutoShapes (most used Autoshapes, as rectangles, rounded rectangles, ellipses, etc are exported)

Files

AssemblyInfo.vb

Imports System.Reflection
Imports System.Runtime.CompilerServices

'
' General Information about an assembly is controlled through the following
' set of attributes. Change these attribute values to modify the information
' associated with an assembly.
'
<Assembly: AssemblyTitle("")>
<Assembly: AssemblyDescription("")>
<Assembly: AssemblyConfiguration("")>
<Assembly: AssemblyCompany("")>
<Assembly: AssemblyProduct("")>
<Assembly: AssemblyCopyright("(c) 2002 - 2014 TMS Software")>
<Assembly: AssemblyTrademark("")>
<Assembly: AssemblyCulture("")>

'
' Version information for an assembly consists of the following four values:
'
'      Major Version
'      Minor Version
'      Build Number
'      Revision
'
' You can specify all the values or you can default the Revision and Build Numbers
' by using the '*' as shown below:

<Assembly: AssemblyVersion("6.2.1.0")>

'
' In order to sign your assembly you must specify a key to use. Refer to the
' Microsoft .NET Framework documentation for more information on assembly signing.
'
' Use the attributes below to control which key is used for signing.
'
' Notes:
'   (*) If no key is specified, the assembly is not signed.
'   (*) KeyName refers to a key that has been installed in the Crypto Service
'       Provider (CSP) on your machine. KeyFile refers to a file which contains
'       a key.
'   (*) If the KeyFile and the KeyName values are both specified, the
'       following processing occurs:
'       (1) If the KeyName can be found in the CSP, that key is used.
'       (2) If the KeyName does not exist and the KeyFile does exist, the key
'           in the KeyFile is installed into the CSP and used.
'   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
'       When specifying the KeyFile, the location of the KeyFile should be
'       relative to the project output directory which is
'       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
'       located in the project directory, you would specify the AssemblyKeyFile
'       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
'   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
'       documentation for more information on this.
'
<Assembly: AssemblyDelaySign(False)>
<Assembly: AssemblyKeyFile("")>
<Assembly: AssemblyKeyName("")>

Form1.Designer.vb

Imports System.Collections
Imports System.ComponentModel
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports System.IO
Imports System.Reflection
Imports System.Drawing.Drawing2D
Imports FlexCel.Pdf
Imports System.Runtime.InteropServices
Namespace ExportPdf
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Private openFileDialog1 As System.Windows.Forms.OpenFileDialog
        Private panel1 As System.Windows.Forms.Panel
        Private label1 As System.Windows.Forms.Label
        Private edFileName As System.Windows.Forms.TextBox
        Private panel3 As System.Windows.Forms.Panel
        Private label12 As System.Windows.Forms.Label
        Private label13 As System.Windows.Forms.Label
        Private label14 As System.Windows.Forms.Label
        Private edTop As System.Windows.Forms.TextBox
        Private edLeft As System.Windows.Forms.TextBox
        Private label15 As System.Windows.Forms.Label
        Private edRight As System.Windows.Forms.TextBox
        Private label16 As System.Windows.Forms.Label
        Private edBottom As System.Windows.Forms.TextBox
        Private label17 As System.Windows.Forms.Label
        Private WithEvents cbSheet As System.Windows.Forms.ComboBox
        Private label18 As System.Windows.Forms.Label
        Private WithEvents chExportAll As System.Windows.Forms.CheckBox
        Private exportDialog As System.Windows.Forms.SaveFileDialog
        Private panel4 As System.Windows.Forms.Panel
        Private label19 As System.Windows.Forms.Label
        Private chEmbed As System.Windows.Forms.CheckBox
        Private label20 As System.Windows.Forms.Label
        Private cbFontMapping As System.Windows.Forms.ComboBox
        Private panel5 As System.Windows.Forms.Panel
        Private label4 As System.Windows.Forms.Label
        Private edZoom As System.Windows.Forms.TextBox
        Private WithEvents chFitIn As System.Windows.Forms.CheckBox
        Private label6 As System.Windows.Forms.Label
        Private label5 As System.Windows.Forms.Label
        Private edVPages As System.Windows.Forms.TextBox
        Private edHPages As System.Windows.Forms.TextBox
        Private label21 As System.Windows.Forms.Label
        Private panel6 As System.Windows.Forms.Panel
        Private label11 As System.Windows.Forms.Label
        Private edf As System.Windows.Forms.TextBox
        Private labelb As System.Windows.Forms.Label
        Private edb As System.Windows.Forms.TextBox
        Private label9 As System.Windows.Forms.Label
        Private edr As System.Windows.Forms.TextBox
        Private label8 As System.Windows.Forms.Label
        Private edt As System.Windows.Forms.TextBox
        Private label7 As System.Windows.Forms.Label
        Private edl As System.Windows.Forms.TextBox
        Private label10 As System.Windows.Forms.Label
        Private edh As System.Windows.Forms.TextBox
        Private label22 As System.Windows.Forms.Label
        Private panel7 As System.Windows.Forms.Panel
        Private label23 As System.Windows.Forms.Label
        Private edFooter As System.Windows.Forms.TextBox
        Private label3 As System.Windows.Forms.Label
        Private edHeader As System.Windows.Forms.TextBox
        Private label2 As System.Windows.Forms.Label
        Private panel8 As System.Windows.Forms.Panel
        Private chPrintLeft As System.Windows.Forms.CheckBox
        Private chFormulaText As System.Windows.Forms.CheckBox
        Private chGridLines As System.Windows.Forms.CheckBox
        Private label24 As System.Windows.Forms.Label
        Private panel9 As System.Windows.Forms.Panel
        Private label25 As System.Windows.Forms.Label
        Private label26 As System.Windows.Forms.Label
        Private edAuthor As System.Windows.Forms.TextBox
        Private label27 As System.Windows.Forms.Label
        Private label28 As System.Windows.Forms.Label
        Private edTitle As System.Windows.Forms.TextBox
        Private edSubject As System.Windows.Forms.TextBox
        Private cbKerning As System.Windows.Forms.CheckBox
        Private chLandscape As System.Windows.Forms.CheckBox
        Private cbResetPageNumber As System.Windows.Forms.CheckBox
        Private cbUseGetFontData As System.Windows.Forms.CheckBox
        Private cbConfidential As System.Windows.Forms.CheckBox
        Private chSubset As System.Windows.Forms.CheckBox
        Private components As System.ComponentModel.IContainer = Nothing

        ''' <summary>
        ''' Clean up any resources being used.
        ''' </summary>
        Protected Overrides Sub Dispose(ByVal disposing As Boolean)
            If disposing Then
                If components IsNot Nothing Then
                    components.Dispose()
                End If
            End If
            MyBase.Dispose(disposing)
        End Sub

        #Region "Windows Form Designer generated code"
        ''' <summary>
        ''' Required method for Designer support - do not modify
        ''' the contents of this method with the code editor.
        ''' </summary>
        Private Sub InitializeComponent()
            Dim resources As New System.ComponentModel.ComponentResourceManager(GetType(mainForm))
            Dim tPdfProperties1 As New FlexCel.Pdf.TPdfProperties()
            Me.openFileDialog1 = New System.Windows.Forms.OpenFileDialog()
            Me.panel1 = New System.Windows.Forms.Panel()
            Me.panel2 = New System.Windows.Forms.Panel()
            Me.label32 = New System.Windows.Forms.Label()
            Me.label31 = New System.Windows.Forms.Label()
            Me.label30 = New System.Windows.Forms.Label()
            Me.cbTagged = New System.Windows.Forms.ComboBox()
            Me.cbVersion = New System.Windows.Forms.ComboBox()
            Me.cbPdfType = New System.Windows.Forms.ComboBox()
            Me.label34 = New System.Windows.Forms.Label()
            Me.cbConfidential = New System.Windows.Forms.CheckBox()
            Me.cbUseGetFontData = New System.Windows.Forms.CheckBox()
            Me.cbResetPageNumber = New System.Windows.Forms.CheckBox()
            Me.panel9 = New System.Windows.Forms.Panel()
            Me.label29 = New System.Windows.Forms.Label()
            Me.edLang = New System.Windows.Forms.TextBox()
            Me.edSubject = New System.Windows.Forms.TextBox()
            Me.label28 = New System.Windows.Forms.Label()
            Me.edTitle = New System.Windows.Forms.TextBox()
            Me.label27 = New System.Windows.Forms.Label()
            Me.label26 = New System.Windows.Forms.Label()
            Me.edAuthor = New System.Windows.Forms.TextBox()
            Me.label25 = New System.Windows.Forms.Label()
            Me.edFileName = New System.Windows.Forms.TextBox()
            Me.panel8 = New System.Windows.Forms.Panel()
            Me.chLandscape = New System.Windows.Forms.CheckBox()
            Me.label24 = New System.Windows.Forms.Label()
            Me.chPrintLeft = New System.Windows.Forms.CheckBox()
            Me.chFormulaText = New System.Windows.Forms.CheckBox()
            Me.chGridLines = New System.Windows.Forms.CheckBox()
            Me.panel7 = New System.Windows.Forms.Panel()
            Me.edFooter = New System.Windows.Forms.TextBox()
            Me.label3 = New System.Windows.Forms.Label()
            Me.edHeader = New System.Windows.Forms.TextBox()
            Me.label2 = New System.Windows.Forms.Label()
            Me.label23 = New System.Windows.Forms.Label()
            Me.panel6 = New System.Windows.Forms.Panel()
            Me.label22 = New System.Windows.Forms.Label()
            Me.edf = New System.Windows.Forms.TextBox()
            Me.edb = New System.Windows.Forms.TextBox()
            Me.edr = New System.Windows.Forms.TextBox()
            Me.edt = New System.Windows.Forms.TextBox()
            Me.label7 = New System.Windows.Forms.Label()
            Me.edl = New System.Windows.Forms.TextBox()
            Me.edh = New System.Windows.Forms.TextBox()
            Me.label9 = New System.Windows.Forms.Label()
            Me.label10 = New System.Windows.Forms.Label()
            Me.label8 = New System.Windows.Forms.Label()
            Me.labelb = New System.Windows.Forms.Label()
            Me.label11 = New System.Windows.Forms.Label()
            Me.panel5 = New System.Windows.Forms.Panel()
            Me.label21 = New System.Windows.Forms.Label()
            Me.label4 = New System.Windows.Forms.Label()
            Me.edZoom = New System.Windows.Forms.TextBox()
            Me.chFitIn = New System.Windows.Forms.CheckBox()
            Me.label6 = New System.Windows.Forms.Label()
            Me.label5 = New System.Windows.Forms.Label()
            Me.edVPages = New System.Windows.Forms.TextBox()
            Me.edHPages = New System.Windows.Forms.TextBox()
            Me.panel4 = New System.Windows.Forms.Panel()
            Me.chSubset = New System.Windows.Forms.CheckBox()
            Me.cbKerning = New System.Windows.Forms.CheckBox()
            Me.label20 = New System.Windows.Forms.Label()
            Me.cbFontMapping = New System.Windows.Forms.ComboBox()
            Me.chEmbed = New System.Windows.Forms.CheckBox()
            Me.label19 = New System.Windows.Forms.Label()
            Me.label18 = New System.Windows.Forms.Label()
            Me.cbSheet = New System.Windows.Forms.ComboBox()
            Me.panel3 = New System.Windows.Forms.Panel()
            Me.edBottom = New System.Windows.Forms.TextBox()
            Me.label17 = New System.Windows.Forms.Label()
            Me.edRight = New System.Windows.Forms.TextBox()
            Me.label16 = New System.Windows.Forms.Label()
            Me.edLeft = New System.Windows.Forms.TextBox()
            Me.label15 = New System.Windows.Forms.Label()
            Me.edTop = New System.Windows.Forms.TextBox()
            Me.label14 = New System.Windows.Forms.Label()
            Me.label13 = New System.Windows.Forms.Label()
            Me.label12 = New System.Windows.Forms.Label()
            Me.chExportAll = New System.Windows.Forms.CheckBox()
            Me.label1 = New System.Windows.Forms.Label()
            Me.exportDialog = New System.Windows.Forms.SaveFileDialog()
            Me.mainToolbar = New System.Windows.Forms.ToolStrip()
            Me.openFile = New System.Windows.Forms.ToolStripButton()
            Me.export = New System.Windows.Forms.ToolStripButton()
            Me.btnClose = New System.Windows.Forms.ToolStripButton()
            Me.flexCelPdfExport1 = New FlexCel.Render.FlexCelPdfExport()
            Me.panel1.SuspendLayout()
            Me.panel2.SuspendLayout()
            Me.panel9.SuspendLayout()
            Me.panel8.SuspendLayout()
            Me.panel7.SuspendLayout()
            Me.panel6.SuspendLayout()
            Me.panel5.SuspendLayout()
            Me.panel4.SuspendLayout()
            Me.panel3.SuspendLayout()
            Me.mainToolbar.SuspendLayout()
            Me.SuspendLayout()
            '
            ' openFileDialog1
            '
            Me.openFileDialog1.DefaultExt = "xls"
            Me.openFileDialog1.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm|Excel 97/2003|*.xls|Excel 2007|*.xlsx;*.xlsm|All " & "files|*.*"
            Me.openFileDialog1.Title = "Open an Excel File"
            '
            ' panel1
            '
            Me.panel1.BackColor = System.Drawing.Color.White
            Me.panel1.Controls.Add(Me.panel2)
            Me.panel1.Controls.Add(Me.cbConfidential)
            Me.panel1.Controls.Add(Me.cbUseGetFontData)
            Me.panel1.Controls.Add(Me.cbResetPageNumber)
            Me.panel1.Controls.Add(Me.panel9)
            Me.panel1.Controls.Add(Me.edFileName)
            Me.panel1.Controls.Add(Me.panel8)
            Me.panel1.Controls.Add(Me.panel7)
            Me.panel1.Controls.Add(Me.panel6)
            Me.panel1.Controls.Add(Me.panel5)
            Me.panel1.Controls.Add(Me.panel4)
            Me.panel1.Controls.Add(Me.label18)
            Me.panel1.Controls.Add(Me.cbSheet)
            Me.panel1.Controls.Add(Me.panel3)
            Me.panel1.Controls.Add(Me.chExportAll)
            Me.panel1.Controls.Add(Me.label1)
            Me.panel1.Dock = System.Windows.Forms.DockStyle.Fill
            Me.panel1.Location = New System.Drawing.Point(0, 38)
            Me.panel1.Name = "panel1"
            Me.panel1.Size = New System.Drawing.Size(768, 593)
            Me.panel1.TabIndex = 3
            '
            ' panel2
            '
            Me.panel2.Anchor = (CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.panel2.BackColor = System.Drawing.Color.FromArgb((CInt((CByte(192)))), (CInt((CByte(192)))), (CInt((CByte(255)))))
            Me.panel2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
            Me.panel2.Controls.Add(Me.label32)
            Me.panel2.Controls.Add(Me.label31)
            Me.panel2.Controls.Add(Me.label30)
            Me.panel2.Controls.Add(Me.cbTagged)
            Me.panel2.Controls.Add(Me.cbVersion)
            Me.panel2.Controls.Add(Me.cbPdfType)
            Me.panel2.Controls.Add(Me.label34)
            Me.panel2.Location = New System.Drawing.Point(32, 146)
            Me.panel2.Name = "panel2"
            Me.panel2.Size = New System.Drawing.Size(688, 53)
            Me.panel2.TabIndex = 42
            '
            ' label32
            '
            Me.label32.Font = New System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (CByte(0)))
            Me.label32.Location = New System.Drawing.Point(8, 22)
            Me.label32.Name = "label32"
            Me.label32.Size = New System.Drawing.Size(41, 16)
            Me.label32.TabIndex = 41
            Me.label32.Text = "Type:"
            '
            ' label31
            '
            Me.label31.AutoSize = True
            Me.label31.Font = New System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (CByte(0)))
            Me.label31.Location = New System.Drawing.Point(219, 22)
            Me.label31.Name = "label31"
            Me.label31.Size = New System.Drawing.Size(53, 14)
            Me.label31.TabIndex = 40
            Me.label31.Text = "Version:"
            '
            ' label30
            '
            Me.label30.AutoSize = True
            Me.label30.Font = New System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (CByte(0)))
            Me.label30.Location = New System.Drawing.Point(467, 22)
            Me.label30.Name = "label30"
            Me.label30.Size = New System.Drawing.Size(50, 14)
            Me.label30.TabIndex = 39
            Me.label30.Text = "Tagged:"
            '
            ' cbTagged
            '
            Me.cbTagged.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
            Me.cbTagged.Items.AddRange(New Object() { "Full", "None"})
            Me.cbTagged.Location = New System.Drawing.Point(523, 19)
            Me.cbTagged.Name = "cbTagged"
            Me.cbTagged.Size = New System.Drawing.Size(149, 21)
            Me.cbTagged.TabIndex = 36
            '
            ' cbVersion
            '
            Me.cbVersion.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
            Me.cbVersion.Items.AddRange(New Object() { "1.4 (Acrobat 5)", "1.6 (Acrobat 7)"})
            Me.cbVersion.Location = New System.Drawing.Point(278, 19)
            Me.cbVersion.Name = "cbVersion"
            Me.cbVersion.Size = New System.Drawing.Size(168, 21)
            Me.cbVersion.TabIndex = 35
            '
            ' cbPdfType
            '
            Me.cbPdfType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
            Me.cbPdfType.Items.AddRange(New Object() { "Standard", "PDF/A1", "PDF/A2", "PDF/A3"})
            Me.cbPdfType.Location = New System.Drawing.Point(56, 19)
            Me.cbPdfType.Name = "cbPdfType"
            Me.cbPdfType.Size = New System.Drawing.Size(144, 21)
            Me.cbPdfType.TabIndex = 34
            '
            ' label34
            '
            Me.label34.Font = New System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (CByte(0)))
            Me.label34.Location = New System.Drawing.Point(8, 0)
            Me.label34.Name = "label34"
            Me.label34.Size = New System.Drawing.Size(192, 16)
            Me.label34.TabIndex = 20
            Me.label34.Text = "Pdf options:"
            '
            ' cbConfidential
            '
            Me.cbConfidential.Anchor = (CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.cbConfidential.Location = New System.Drawing.Point(488, 557)
            Me.cbConfidential.Name = "cbConfidential"
            Me.cbConfidential.Size = New System.Drawing.Size(232, 16)
            Me.cbConfidential.TabIndex = 41
            Me.cbConfidential.Text = "Print ""Confidential"" on each page"
            '
            ' cbUseGetFontData
            '
            Me.cbUseGetFontData.Location = New System.Drawing.Point(32, 557)
            Me.cbUseGetFontData.Name = "cbUseGetFontData"
            Me.cbUseGetFontData.Size = New System.Drawing.Size(312, 16)
            Me.cbUseGetFontData.TabIndex = 40
            Me.cbUseGetFontData.Text = "Use UNMANAGED calls to Win32 API to find the fonts."
            '
            ' cbResetPageNumber
            '
            Me.cbResetPageNumber.Anchor = (CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.cbResetPageNumber.Location = New System.Drawing.Point(528, 40)
            Me.cbResetPageNumber.Name = "cbResetPageNumber"
            Me.cbResetPageNumber.Size = New System.Drawing.Size(200, 16)
            Me.cbResetPageNumber.TabIndex = 39
            Me.cbResetPageNumber.Text = "Reset Page number on each sheet"
            '
            ' panel9
            '
            Me.panel9.Anchor = (CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.panel9.BackColor = System.Drawing.Color.FromArgb((CInt((CByte(255)))), (CInt((CByte(192)))), (CInt((CByte(255)))))
            Me.panel9.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
            Me.panel9.Controls.Add(Me.label29)
            Me.panel9.Controls.Add(Me.edLang)
            Me.panel9.Controls.Add(Me.edSubject)
            Me.panel9.Controls.Add(Me.label28)
            Me.panel9.Controls.Add(Me.edTitle)
            Me.panel9.Controls.Add(Me.label27)
            Me.panel9.Controls.Add(Me.label26)
            Me.panel9.Controls.Add(Me.edAuthor)
            Me.panel9.Controls.Add(Me.label25)
            Me.panel9.Location = New System.Drawing.Point(32, 64)
            Me.panel9.Name = "panel9"
            Me.panel9.Size = New System.Drawing.Size(688, 76)
            Me.panel9.TabIndex = 38
            '
            ' label29
            '
            Me.label29.Font = New System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (CByte(0)))
            Me.label29.Location = New System.Drawing.Point(8, 49)
            Me.label29.Name = "label29"
            Me.label29.Size = New System.Drawing.Size(48, 16)
            Me.label29.TabIndex = 38
            Me.label29.Text = "Lang:"
            '
            ' edLang
            '
            Me.edLang.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
            Me.edLang.Location = New System.Drawing.Point(56, 46)
            Me.edLang.Name = "edLang"
            Me.edLang.Size = New System.Drawing.Size(144, 20)
            Me.edLang.TabIndex = 37
            Me.edLang.Text = "en-US"
            '
            ' edSubject
            '
            Me.edSubject.Anchor = (CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.edSubject.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
            Me.edSubject.Location = New System.Drawing.Point(278, 45)
            Me.edSubject.Name = "edSubject"
            Me.edSubject.Size = New System.Drawing.Size(394, 20)
            Me.edSubject.TabIndex = 35
            '
            ' label28
            '
            Me.label28.Font = New System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (CByte(0)))
            Me.label28.Location = New System.Drawing.Point(216, 50)
            Me.label28.Name = "label28"
            Me.label28.Size = New System.Drawing.Size(56, 16)
            Me.label28.TabIndex = 36
            Me.label28.Text = "Subject:"
            '
            ' edTitle
            '
            Me.edTitle.Anchor = (CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.edTitle.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
            Me.edTitle.Location = New System.Drawing.Point(278, 19)
            Me.edTitle.Name = "edTitle"
            Me.edTitle.Size = New System.Drawing.Size(394, 20)
            Me.edTitle.TabIndex = 33
            '
            ' label27
            '
            Me.label27.Font = New System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (CByte(0)))
            Me.label27.Location = New System.Drawing.Point(232, 22)
            Me.label27.Name = "label27"
            Me.label27.Size = New System.Drawing.Size(48, 16)
            Me.label27.TabIndex = 34
            Me.label27.Text = "Title:"
            '
            ' label26
            '
            Me.label26.Font = New System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (CByte(0)))
            Me.label26.Location = New System.Drawing.Point(8, 23)
            Me.label26.Name = "label26"
            Me.label26.Size = New System.Drawing.Size(48, 16)
            Me.label26.TabIndex = 32
            Me.label26.Text = "Author:"
            '
            ' edAuthor
            '
            Me.edAuthor.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
            Me.edAuthor.Location = New System.Drawing.Point(56, 20)
            Me.edAuthor.Name = "edAuthor"
            Me.edAuthor.Size = New System.Drawing.Size(144, 20)
            Me.edAuthor.TabIndex = 31
            '
            ' label25
            '
            Me.label25.Font = New System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (CByte(0)))
            Me.label25.Location = New System.Drawing.Point(8, 0)
            Me.label25.Name = "label25"
            Me.label25.Size = New System.Drawing.Size(192, 16)
            Me.label25.TabIndex = 20
            Me.label25.Text = "Pdf Properties:"
            '
            ' edFileName
            '
            Me.edFileName.Anchor = (CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.edFileName.BackColor = System.Drawing.Color.White
            Me.edFileName.BorderStyle = System.Windows.Forms.BorderStyle.None
            Me.edFileName.Location = New System.Drawing.Point(136, 16)
            Me.edFileName.Name = "edFileName"
            Me.edFileName.ReadOnly = True
            Me.edFileName.Size = New System.Drawing.Size(584, 13)
            Me.edFileName.TabIndex = 4
            Me.edFileName.Text = "No file selected"
            '
            ' panel8
            '
            Me.panel8.BackColor = System.Drawing.Color.FromArgb((CInt((CByte(224)))), (CInt((CByte(224)))), (CInt((CByte(224)))))
            Me.panel8.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
            Me.panel8.Controls.Add(Me.chLandscape)
            Me.panel8.Controls.Add(Me.label24)
            Me.panel8.Controls.Add(Me.chPrintLeft)
            Me.panel8.Controls.Add(Me.chFormulaText)
            Me.panel8.Controls.Add(Me.chGridLines)
            Me.panel8.Location = New System.Drawing.Point(32, 205)
            Me.panel8.Name = "panel8"
            Me.panel8.Size = New System.Drawing.Size(176, 120)
            Me.panel8.TabIndex = 37
            '
            ' chLandscape
            '
            Me.chLandscape.Location = New System.Drawing.Point(24, 88)
            Me.chLandscape.Name = "chLandscape"
            Me.chLandscape.Size = New System.Drawing.Size(136, 24)
            Me.chLandscape.TabIndex = 20
            Me.chLandscape.Text = "Landscape"
            '
            ' label24
            '
            Me.label24.Font = New System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (CByte(0)))
            Me.label24.Location = New System.Drawing.Point(8, 8)
            Me.label24.Name = "label24"
            Me.label24.Size = New System.Drawing.Size(192, 16)
            Me.label24.TabIndex = 19
            Me.label24.Text = "Export Options:"
            '
            ' chPrintLeft
            '
            Me.chPrintLeft.Location = New System.Drawing.Point(24, 47)
            Me.chPrintLeft.Name = "chPrintLeft"
            Me.chPrintLeft.Size = New System.Drawing.Size(152, 16)
            Me.chPrintLeft.TabIndex = 18
            Me.chPrintLeft.Text = "Print Left, then down."
            '
            ' chFormulaText
            '
            Me.chFormulaText.Location = New System.Drawing.Point(24, 71)
            Me.chFormulaText.Name = "chFormulaText"
            Me.chFormulaText.Size = New System.Drawing.Size(136, 16)
            Me.chFormulaText.TabIndex = 17
            Me.chFormulaText.Text = "Print Formula Text"
            '
            ' chGridLines
            '
            Me.chGridLines.Location = New System.Drawing.Point(24, 24)
            Me.chGridLines.Name = "chGridLines"
            Me.chGridLines.Size = New System.Drawing.Size(128, 16)
            Me.chGridLines.TabIndex = 16
            Me.chGridLines.Text = "Print Grid Lines"
            '
            ' panel7
            '
            Me.panel7.Anchor = (CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.panel7.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
            Me.panel7.Controls.Add(Me.edFooter)
            Me.panel7.Controls.Add(Me.label3)
            Me.panel7.Controls.Add(Me.edHeader)
            Me.panel7.Controls.Add(Me.label2)
            Me.panel7.Controls.Add(Me.label23)
            Me.panel7.Location = New System.Drawing.Point(224, 333)
            Me.panel7.Name = "panel7"
            Me.panel7.Size = New System.Drawing.Size(296, 112)
            Me.panel7.TabIndex = 36
            '
            ' edFooter
            '
            Me.edFooter.Anchor = (CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.edFooter.BackColor = System.Drawing.Color.White
            Me.edFooter.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
            Me.edFooter.Location = New System.Drawing.Point(8, 88)
            Me.edFooter.Name = "edFooter"
            Me.edFooter.Size = New System.Drawing.Size(278, 20)
            Me.edFooter.TabIndex = 46
            '
            ' label3
            '
            Me.label3.BackColor = System.Drawing.Color.White
            Me.label3.Font = New System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (CByte(0)))
            Me.label3.Location = New System.Drawing.Point(8, 72)
            Me.label3.Name = "label3"
            Me.label3.Size = New System.Drawing.Size(56, 16)
            Me.label3.TabIndex = 45
            Me.label3.Text = "Footer:"
            '
            ' edHeader
            '
            Me.edHeader.Anchor = (CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.edHeader.BackColor = System.Drawing.Color.White
            Me.edHeader.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
            Me.edHeader.Location = New System.Drawing.Point(8, 48)
            Me.edHeader.Name = "edHeader"
            Me.edHeader.Size = New System.Drawing.Size(278, 20)
            Me.edHeader.TabIndex = 44
            '
            ' label2
            '
            Me.label2.BackColor = System.Drawing.Color.White
            Me.label2.Font = New System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (CByte(0)))
            Me.label2.Location = New System.Drawing.Point(8, 32)
            Me.label2.Name = "label2"
            Me.label2.Size = New System.Drawing.Size(56, 16)
            Me.label2.TabIndex = 43
            Me.label2.Text = "Header:"
            '
            ' label23
            '
            Me.label23.Font = New System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (CByte(0)))
            Me.label23.Location = New System.Drawing.Point(8, 8)
            Me.label23.Name = "label23"
            Me.label23.Size = New System.Drawing.Size(187, 16)
            Me.label23.TabIndex = 42
            Me.label23.Text = "Headers and footers:"
            '
            ' panel6
            '
            Me.panel6.BackColor = System.Drawing.Color.FromArgb((CInt((CByte(255)))), (CInt((CByte(224)))), (CInt((CByte(192)))))
            Me.panel6.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
            Me.panel6.Controls.Add(Me.label22)
            Me.panel6.Controls.Add(Me.edf)
            Me.panel6.Controls.Add(Me.edb)
            Me.panel6.Controls.Add(Me.edr)
            Me.panel6.Controls.Add(Me.edt)
            Me.panel6.Controls.Add(Me.label7)
            Me.panel6.Controls.Add(Me.edl)
            Me.panel6.Controls.Add(Me.edh)
            Me.panel6.Controls.Add(Me.label9)
            Me.panel6.Controls.Add(Me.label10)
            Me.panel6.Controls.Add(Me.label8)
            Me.panel6.Controls.Add(Me.labelb)
            Me.panel6.Controls.Add(Me.label11)
            Me.panel6.Location = New System.Drawing.Point(32, 333)
            Me.panel6.Name = "panel6"
            Me.panel6.Size = New System.Drawing.Size(176, 208)
            Me.panel6.TabIndex = 35
            '
            ' label22
            '
            Me.label22.Font = New System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (CByte(0)))
            Me.label22.Location = New System.Drawing.Point(8, 8)
            Me.label22.Name = "label22"
            Me.label22.Size = New System.Drawing.Size(120, 16)
            Me.label22.TabIndex = 41
            Me.label22.Text = "Margins:"
            '
            ' edf
            '
            Me.edf.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
            Me.edf.Location = New System.Drawing.Point(56, 152)
            Me.edf.Name = "edf"
            Me.edf.Size = New System.Drawing.Size(112, 20)
            Me.edf.TabIndex = 39
            '
            ' edb
            '
            Me.edb.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
            Me.edb.Location = New System.Drawing.Point(56, 128)
            Me.edb.Name = "edb"
            Me.edb.Size = New System.Drawing.Size(112, 20)
            Me.edb.TabIndex = 37
            '
            ' edr
            '
            Me.edr.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
            Me.edr.Location = New System.Drawing.Point(56, 56)
            Me.edr.Name = "edr"
            Me.edr.Size = New System.Drawing.Size(112, 20)
            Me.edr.TabIndex = 35
            '
            ' edt
            '
            Me.edt.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
            Me.edt.Location = New System.Drawing.Point(56, 104)
            Me.edt.Name = "edt"
            Me.edt.Size = New System.Drawing.Size(112, 20)
            Me.edt.TabIndex = 31
            '
            ' label7
            '
            Me.label7.Font = New System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (CByte(0)))
            Me.label7.Location = New System.Drawing.Point(8, 32)
            Me.label7.Name = "label7"
            Me.label7.Size = New System.Drawing.Size(36, 16)
            Me.label7.TabIndex = 30
            Me.label7.Text = "Left:"
            '
            ' edl
            '
            Me.edl.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
            Me.edl.Location = New System.Drawing.Point(56, 32)
            Me.edl.Name = "edl"
            Me.edl.Size = New System.Drawing.Size(112, 20)
            Me.edl.TabIndex = 29
            '
            ' edh
            '
            Me.edh.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
            Me.edh.Location = New System.Drawing.Point(56, 80)
            Me.edh.Name = "edh"
            Me.edh.Size = New System.Drawing.Size(112, 20)
            Me.edh.TabIndex = 32
            '
            ' label9
            '
            Me.label9.Font = New System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (CByte(0)))
            Me.label9.Location = New System.Drawing.Point(8, 56)
            Me.label9.Name = "label9"
            Me.label9.Size = New System.Drawing.Size(80, 16)
            Me.label9.TabIndex = 36
            Me.label9.Text = "Right:"
            '
            ' label10
            '
            Me.label10.Font = New System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (CByte(0)))
            Me.label10.Location = New System.Drawing.Point(7, 80)
            Me.label10.Name = "label10"
            Me.label10.Size = New System.Drawing.Size(88, 16)
            Me.label10.TabIndex = 34
            Me.label10.Text = "Header:"
            '
            ' label8
            '
            Me.label8.Font = New System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (CByte(0)))
            Me.label8.Location = New System.Drawing.Point(8, 104)
            Me.label8.Name = "label8"
            Me.label8.Size = New System.Drawing.Size(80, 16)
            Me.label8.TabIndex = 33
            Me.label8.Text = "Top:"
            '
            ' labelb
            '
            Me.labelb.Font = New System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (CByte(0)))
            Me.labelb.Location = New System.Drawing.Point(8, 130)
            Me.labelb.Name = "labelb"
            Me.labelb.Size = New System.Drawing.Size(88, 16)
            Me.labelb.TabIndex = 38
            Me.labelb.Text = "Bottom:"
            '
            ' label11
            '
            Me.label11.Font = New System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (CByte(0)))
            Me.label11.Location = New System.Drawing.Point(8, 160)
            Me.label11.Name = "label11"
            Me.label11.Size = New System.Drawing.Size(80, 16)
            Me.label11.TabIndex = 40
            Me.label11.Text = "Footer:"
            '
            ' panel5
            '
            Me.panel5.Anchor = (CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.panel5.BackColor = System.Drawing.Color.FromArgb((CInt((CByte(192)))), (CInt((CByte(255)))), (CInt((CByte(192)))))
            Me.panel5.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
            Me.panel5.Controls.Add(Me.label21)
            Me.panel5.Controls.Add(Me.label4)
            Me.panel5.Controls.Add(Me.edZoom)
            Me.panel5.Controls.Add(Me.chFitIn)
            Me.panel5.Controls.Add(Me.label6)
            Me.panel5.Controls.Add(Me.label5)
            Me.panel5.Controls.Add(Me.edVPages)
            Me.panel5.Controls.Add(Me.edHPages)
            Me.panel5.Location = New System.Drawing.Point(224, 453)
            Me.panel5.Name = "panel5"
            Me.panel5.Size = New System.Drawing.Size(296, 88)
            Me.panel5.TabIndex = 34
            '
            ' label21
            '
            Me.label21.Font = New System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (CByte(0)))
            Me.label21.Location = New System.Drawing.Point(9, 5)
            Me.label21.Name = "label21"
            Me.label21.Size = New System.Drawing.Size(192, 16)
            Me.label21.TabIndex = 26
            Me.label21.Text = "Zoom:"
            '
            ' label4
            '
            Me.label4.Font = New System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (CByte(0)))
            Me.label4.Location = New System.Drawing.Point(72, 58)
            Me.label4.Name = "label4"
            Me.label4.Size = New System.Drawing.Size(56, 16)
            Me.label4.TabIndex = 25
            Me.label4.Text = "Zoom (%)"
            '
            ' edZoom
            '
            Me.edZoom.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
            Me.edZoom.Location = New System.Drawing.Point(136, 56)
            Me.edZoom.Name = "edZoom"
            Me.edZoom.Size = New System.Drawing.Size(24, 20)
            Me.edZoom.TabIndex = 24
            '
            ' chFitIn
            '
            Me.chFitIn.Font = New System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (CByte(0)))
            Me.chFitIn.Location = New System.Drawing.Point(8, 24)
            Me.chFitIn.Name = "chFitIn"
            Me.chFitIn.Size = New System.Drawing.Size(56, 24)
            Me.chFitIn.TabIndex = 23
            Me.chFitIn.Text = "Fit in"
'           Me.chFitIn.CheckedChanged += New System.EventHandler(Me.chFitIn_CheckedChanged)
            '
            ' label6
            '
            Me.label6.Font = New System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (CByte(0)))
            Me.label6.Location = New System.Drawing.Point(208, 29)
            Me.label6.Name = "label6"
            Me.label6.Size = New System.Drawing.Size(80, 16)
            Me.label6.TabIndex = 22
            Me.label6.Text = "pages tall."
            '
            ' label5
            '
            Me.label5.Font = New System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (CByte(0)))
            Me.label5.Location = New System.Drawing.Point(96, 29)
            Me.label5.Name = "label5"
            Me.label5.Size = New System.Drawing.Size(80, 16)
            Me.label5.TabIndex = 21
            Me.label5.Text = "pages wide x"
            '
            ' edVPages
            '
            Me.edVPages.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
            Me.edVPages.Location = New System.Drawing.Point(176, 24)
            Me.edVPages.Name = "edVPages"
            Me.edVPages.ReadOnly = True
            Me.edVPages.Size = New System.Drawing.Size(24, 20)
            Me.edVPages.TabIndex = 20
            '
            ' edHPages
            '
            Me.edHPages.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
            Me.edHPages.Location = New System.Drawing.Point(64, 24)
            Me.edHPages.Name = "edHPages"
            Me.edHPages.ReadOnly = True
            Me.edHPages.Size = New System.Drawing.Size(24, 20)
            Me.edHPages.TabIndex = 19
            '
            ' panel4
            '
            Me.panel4.Anchor = (CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.panel4.BackColor = System.Drawing.Color.FromArgb((CInt((CByte(192)))), (CInt((CByte(255)))), (CInt((CByte(255)))))
            Me.panel4.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
            Me.panel4.Controls.Add(Me.chSubset)
            Me.panel4.Controls.Add(Me.cbKerning)
            Me.panel4.Controls.Add(Me.label20)
            Me.panel4.Controls.Add(Me.cbFontMapping)
            Me.panel4.Controls.Add(Me.chEmbed)
            Me.panel4.Controls.Add(Me.label19)
            Me.panel4.Location = New System.Drawing.Point(224, 205)
            Me.panel4.Name = "panel4"
            Me.panel4.Size = New System.Drawing.Size(496, 120)
            Me.panel4.TabIndex = 33
            '
            ' chSubset
            '
            Me.chSubset.Anchor = (CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.chSubset.Checked = True
            Me.chSubset.CheckState = System.Windows.Forms.CheckState.Checked
            Me.chSubset.Location = New System.Drawing.Point(16, 72)
            Me.chSubset.Name = "chSubset"
            Me.chSubset.Size = New System.Drawing.Size(464, 16)
            Me.chSubset.TabIndex = 36
            Me.chSubset.Text = "Subset fonts when embedding. (That is, embed only the characters used from the fo" & "nt)"
            '
            ' cbKerning
            '
            Me.cbKerning.Anchor = (CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.cbKerning.Location = New System.Drawing.Point(16, 88)
            Me.cbKerning.Name = "cbKerning"
            Me.cbKerning.Size = New System.Drawing.Size(464, 32)
            Me.cbKerning.TabIndex = 35
            Me.cbKerning.Text = "Kerning. (Files with kerning look a little better but are a little bigger too)"
            '
            ' label20
            '
            Me.label20.Font = New System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (CByte(0)))
            Me.label20.Location = New System.Drawing.Point(16, 24)
            Me.label20.Name = "label20"
            Me.label20.Size = New System.Drawing.Size(96, 16)
            Me.label20.TabIndex = 34
            Me.label20.Text = "Font mapping:"
            '
            ' cbFontMapping
            '
            Me.cbFontMapping.Anchor = (CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.cbFontMapping.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
            Me.cbFontMapping.Items.AddRange(New Object() { "Replace all fonts by internal fonts. (smaller file size)", "Replace selected fonts by internal fonts. (optimum relation file size/accuracy)", "Do not replace any font. (maximum file size)"})
            Me.cbFontMapping.Location = New System.Drawing.Point(120, 24)
            Me.cbFontMapping.Name = "cbFontMapping"
            Me.cbFontMapping.Size = New System.Drawing.Size(360, 21)
            Me.cbFontMapping.TabIndex = 33
            '
            ' chEmbed
            '
            Me.chEmbed.Anchor = (CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.chEmbed.Checked = True
            Me.chEmbed.CheckState = System.Windows.Forms.CheckState.Checked
            Me.chEmbed.Location = New System.Drawing.Point(16, 40)
            Me.chEmbed.Name = "chEmbed"
            Me.chEmbed.Size = New System.Drawing.Size(464, 32)
            Me.chEmbed.TabIndex = 3
            Me.chEmbed.Text = "Embed all fonts. (if you leave this option off, some fonts might be embedded anyw" & "ay)"
            '
            ' label19
            '
            Me.label19.Font = New System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (CByte(0)))
            Me.label19.Location = New System.Drawing.Point(3, 8)
            Me.label19.Name = "label19"
            Me.label19.Size = New System.Drawing.Size(192, 16)
            Me.label19.TabIndex = 2
            Me.label19.Text = "Fonts:"
            '
            ' label18
            '
            Me.label18.Font = New System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (CByte(0)))
            Me.label18.Location = New System.Drawing.Point(168, 40)
            Me.label18.Name = "label18"
            Me.label18.Size = New System.Drawing.Size(96, 16)
            Me.label18.TabIndex = 32
            Me.label18.Text = "Sheet to export:"
            '
            ' cbSheet
            '
            Me.cbSheet.Anchor = (CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.cbSheet.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
            Me.cbSheet.Location = New System.Drawing.Point(264, 34)
            Me.cbSheet.Name = "cbSheet"
            Me.cbSheet.Size = New System.Drawing.Size(256, 21)
            Me.cbSheet.TabIndex = 31
'           Me.cbSheet.SelectedIndexChanged += New System.EventHandler(Me.cbSheet_SelectedIndexChanged)
            '
            ' panel3
            '
            Me.panel3.Anchor = (CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.panel3.BackColor = System.Drawing.Color.FromArgb((CInt((CByte(255)))), (CInt((CByte(255)))), (CInt((CByte(192)))))
            Me.panel3.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
            Me.panel3.Controls.Add(Me.edBottom)
            Me.panel3.Controls.Add(Me.label17)
            Me.panel3.Controls.Add(Me.edRight)
            Me.panel3.Controls.Add(Me.label16)
            Me.panel3.Controls.Add(Me.edLeft)
            Me.panel3.Controls.Add(Me.label15)
            Me.panel3.Controls.Add(Me.edTop)
            Me.panel3.Controls.Add(Me.label14)
            Me.panel3.Controls.Add(Me.label13)
            Me.panel3.Controls.Add(Me.label12)
            Me.panel3.Location = New System.Drawing.Point(536, 333)
            Me.panel3.Name = "panel3"
            Me.panel3.Size = New System.Drawing.Size(184, 208)
            Me.panel3.TabIndex = 30
            '
            ' edBottom
            '
            Me.edBottom.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
            Me.edBottom.Location = New System.Drawing.Point(80, 136)
            Me.edBottom.Name = "edBottom"
            Me.edBottom.Size = New System.Drawing.Size(48, 20)
            Me.edBottom.TabIndex = 26
            Me.edBottom.Text = "0"
            '
            ' label17
            '
            Me.label17.Font = New System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (CByte(0)))
            Me.label17.Location = New System.Drawing.Point(16, 160)
            Me.label17.Name = "label17"
            Me.label17.Size = New System.Drawing.Size(56, 16)
            Me.label17.TabIndex = 25
            Me.label17.Text = "Last Col:"
            '
            ' edRight
            '
            Me.edRight.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
            Me.edRight.Location = New System.Drawing.Point(80, 160)
            Me.edRight.Name = "edRight"
            Me.edRight.Size = New System.Drawing.Size(48, 20)
            Me.edRight.TabIndex = 24
            Me.edRight.Text = "0"
            '
            ' label16
            '
            Me.label16.Font = New System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (CByte(0)))
            Me.label16.Location = New System.Drawing.Point(16, 136)
            Me.label16.Name = "label16"
            Me.label16.Size = New System.Drawing.Size(85, 16)
            Me.label16.TabIndex = 23
            Me.label16.Text = "Last Row:"
            '
            ' edLeft
            '
            Me.edLeft.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
            Me.edLeft.Location = New System.Drawing.Point(80, 112)
            Me.edLeft.Name = "edLeft"
            Me.edLeft.Size = New System.Drawing.Size(48, 20)
            Me.edLeft.TabIndex = 22
            Me.edLeft.Text = "0"
            '
            ' label15
            '
            Me.label15.Font = New System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (CByte(0)))
            Me.label15.Location = New System.Drawing.Point(16, 112)
            Me.label15.Name = "label15"
            Me.label15.Size = New System.Drawing.Size(85, 16)
            Me.label15.TabIndex = 21
            Me.label15.Text = "First Col:"
            '
            ' edTop
            '
            Me.edTop.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
            Me.edTop.Location = New System.Drawing.Point(80, 88)
            Me.edTop.Name = "edTop"
            Me.edTop.Size = New System.Drawing.Size(48, 20)
            Me.edTop.TabIndex = 20
            Me.edTop.Text = "0"
            '
            ' label14
            '
            Me.label14.Font = New System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (CByte(0)))
            Me.label14.Location = New System.Drawing.Point(16, 88)
            Me.label14.Name = "label14"
            Me.label14.Size = New System.Drawing.Size(85, 16)
            Me.label14.TabIndex = 3
            Me.label14.Text = "First Row:"
            '
            ' label13
            '
            Me.label13.Anchor = (CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.label13.Font = New System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, (CByte(0)))
            Me.label13.Location = New System.Drawing.Point(8, 32)
            Me.label13.Name = "label13"
            Me.label13.Size = New System.Drawing.Size(160, 32)
            Me.label13.TabIndex = 2
            Me.label13.Text = "If one of this values is <=0 all print_range will be printed"
            '
            ' label12
            '
            Me.label12.Font = New System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (CByte(0)))
            Me.label12.Location = New System.Drawing.Point(8, 16)
            Me.label12.Name = "label12"
            Me.label12.Size = New System.Drawing.Size(192, 16)
            Me.label12.TabIndex = 1
            Me.label12.Text = "Range to Export:"
            '
            ' chExportAll
            '
            Me.chExportAll.Location = New System.Drawing.Point(32, 40)
            Me.chExportAll.Name = "chExportAll"
            Me.chExportAll.Size = New System.Drawing.Size(128, 16)
            Me.chExportAll.TabIndex = 1
            Me.chExportAll.Text = "Export all Sheets"
'           Me.chExportAll.CheckedChanged += New System.EventHandler(Me.chExportAll_CheckedChanged)
            '
            ' label1
            '
            Me.label1.Font = New System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (CByte(0)))
            Me.label1.Location = New System.Drawing.Point(29, 16)
            Me.label1.Name = "label1"
            Me.label1.Size = New System.Drawing.Size(80, 16)
            Me.label1.TabIndex = 0
            Me.label1.Text = "File to print:"
            '
            ' exportDialog
            '
            Me.exportDialog.DefaultExt = "pdf"
            Me.exportDialog.Filter = "Pdf files|*.pdf"
            '
            ' mainToolbar
            '
            Me.mainToolbar.Items.AddRange(New System.Windows.Forms.ToolStripItem() { Me.openFile, Me.export, Me.btnClose})
            Me.mainToolbar.Location = New System.Drawing.Point(0, 0)
            Me.mainToolbar.Name = "mainToolbar"
            Me.mainToolbar.Size = New System.Drawing.Size(768, 38)
            Me.mainToolbar.TabIndex = 4
            Me.mainToolbar.Text = "toolStrip1"
            '
            ' openFile
            '
            Me.openFile.Image = (CType(resources.GetObject("openFile.Image"), System.Drawing.Image))
            Me.openFile.ImageTransparentColor = System.Drawing.Color.Magenta
            Me.openFile.Name = "openFile"
            Me.openFile.Size = New System.Drawing.Size(61, 35)
            Me.openFile.Text = "Open File"
            Me.openFile.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText
'           Me.openFile.Click += New System.EventHandler(Me.openFile_Click)
            '
            ' export
            '
            Me.export.Image = (CType(resources.GetObject("export.Image"), System.Drawing.Image))
            Me.export.ImageTransparentColor = System.Drawing.Color.Magenta
            Me.export.Name = "export"
            Me.export.Size = New System.Drawing.Size(82, 35)
            Me.export.Text = "Export to PDF"
            Me.export.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText
'           Me.export.Click += New System.EventHandler(Me.export_Click)
            '
            ' btnClose
            '
            Me.btnClose.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right
            Me.btnClose.Image = (CType(resources.GetObject("btnClose.Image"), System.Drawing.Image))
            Me.btnClose.ImageTransparentColor = System.Drawing.Color.Magenta
            Me.btnClose.Name = "btnClose"
            Me.btnClose.Size = New System.Drawing.Size(59, 35)
            Me.btnClose.Text = "     E&xit     "
            Me.btnClose.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText
'           Me.btnClose.Click += New System.EventHandler(Me.button2_Click)
            '
            ' flexCelPdfExport1
            '
            Me.flexCelPdfExport1.FontEmbed = FlexCel.Pdf.TFontEmbed.Embed
            Me.flexCelPdfExport1.InitialZoomAndPage = Nothing
            Me.flexCelPdfExport1.PageLayout = FlexCel.Pdf.TPageLayout.None
            Me.flexCelPdfExport1.PageLayoutDisplay = FlexCel.Pdf.TPageLayoutDisplay.None
            Me.flexCelPdfExport1.PageSize = Nothing
            tPdfProperties1.Author = Nothing
            tPdfProperties1.Creator = Nothing
            tPdfProperties1.Keywords = Nothing
            tPdfProperties1.Language = Nothing
            tPdfProperties1.Subject = Nothing
            tPdfProperties1.Title = Nothing
            Me.flexCelPdfExport1.Properties = tPdfProperties1
            Me.flexCelPdfExport1.TagMode = FlexCel.Pdf.TTagMode.Full
            Me.flexCelPdfExport1.UnlicensedReplacementFont = Nothing
            Me.flexCelPdfExport1.UseExcelProperties = True
            Me.flexCelPdfExport1.Workbook = Nothing
'           Me.flexCelPdfExport1.AfterGeneratePage += New FlexCel.Render.PageEventHandler(Me.flexCelPdfExport1_AfterGeneratePage)
'           Me.flexCelPdfExport1.GetFontData += New FlexCel.Pdf.GetFontDataEventHandler(Me.flexCelPdfExport1_GetFontData)
            '
            ' mainForm
            '
            Me.AutoScaleDimensions = New System.Drawing.SizeF(6F, 13F)
            Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
            Me.ClientSize = New System.Drawing.Size(768, 631)
            Me.Controls.Add(Me.panel1)
            Me.Controls.Add(Me.mainToolbar)
            Me.Name = "mainForm"
            Me.Text = "Export an Excel file to pdf"
            Me.panel1.ResumeLayout(False)
            Me.panel1.PerformLayout()
            Me.panel2.ResumeLayout(False)
            Me.panel2.PerformLayout()
            Me.panel9.ResumeLayout(False)
            Me.panel9.PerformLayout()
            Me.panel8.ResumeLayout(False)
            Me.panel7.ResumeLayout(False)
            Me.panel7.PerformLayout()
            Me.panel6.ResumeLayout(False)
            Me.panel6.PerformLayout()
            Me.panel5.ResumeLayout(False)
            Me.panel5.PerformLayout()
            Me.panel4.ResumeLayout(False)
            Me.panel3.ResumeLayout(False)
            Me.panel3.PerformLayout()
            Me.mainToolbar.ResumeLayout(False)
            Me.mainToolbar.PerformLayout()
            Me.ResumeLayout(False)
            Me.PerformLayout()

        End Sub
        #End Region

        Private mainToolbar As ToolStrip
        Private WithEvents openFile As ToolStripButton
        Private WithEvents export As ToolStripButton
        Private WithEvents btnClose As ToolStripButton
        Private label29 As Label
        Private edLang As TextBox
        Private panel2 As Panel
        Private cbPdfType As ComboBox
        Private label34 As Label
        Private cbVersion As ComboBox
        Private label31 As Label
        Private label30 As Label
        Private cbTagged As ComboBox
        Private label32 As Label
    End Class
End Namespace

Form1.vb

Imports System.Collections
Imports System.ComponentModel
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports System.IO
Imports System.Reflection
Imports System.Drawing.Drawing2D
Imports FlexCel.Pdf

'only needed if you want to go unmanaged.
Imports System.Runtime.InteropServices

Namespace ExportPdf
    ''' <summary>
    ''' Exporting xls files to pdf.
    ''' </summary>
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Private WithEvents flexCelPdfExport1 As FlexCel.Render.FlexCelPdfExport

        Public Sub New()
            InitializeComponent()
            cbFontMapping.SelectedIndex = 1
            cbPdfType.SelectedIndex = 0
            cbTagged.SelectedIndex = 0
            cbVersion.SelectedIndex = 1
            ResizeToolbar(mainToolbar)
        End Sub

        Private Sub ResizeToolbar(ByVal toolbar As ToolStrip)

            Using gr As Graphics = CreateGraphics()
                Dim xFactor As Double = gr.DpiX / 96.0
                Dim yFactor As Double = gr.DpiY / 96.0
                toolbar.ImageScalingSize = New Size(CInt(Fix(24 * xFactor)), CInt(Fix(24 * yFactor)))
                toolbar.Width = 0 'force a recalc of the buttons.
            End Using
        End Sub

        Private Sub button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnClose.Click
            Close()
        End Sub

        Private Sub LoadSheetConfig()
            Dim Xls As ExcelFile = flexCelPdfExport1.Workbook

            chGridLines.Checked = Xls.PrintGridLines
            chFormulaText.Checked = Xls.ShowFormulaText

            chPrintLeft.Checked = (Xls.PrintOptions And TPrintOptions.LeftToRight) <> 0
            edHeader.Text = Xls.PageHeader
            edFooter.Text = Xls.PageFooter
            chFitIn.Checked = Xls.PrintToFit
            edHPages.Text = Xls.PrintNumberOfHorizontalPages.ToString()
            edVPages.Text = Xls.PrintNumberOfVerticalPages.ToString()
            edVPages.ReadOnly = Not chFitIn.Checked
            edHPages.ReadOnly = Not chFitIn.Checked

            edZoom.ReadOnly = chFitIn.Checked
            edZoom.Text = Xls.PrintScale.ToString()

            Dim m As TXlsMargins = Xls.GetPrintMargins()
            edl.Text = m.Left.ToString()
            edt.Text = m.Top.ToString()
            edr.Text = m.Right.ToString()
            edb.Text = m.Bottom.ToString()
            edf.Text = m.Footer.ToString()
            edh.Text = m.Header.ToString()

            chLandscape.Checked = Xls.PrintLandscape

            edAuthor.Text = Convert.ToString(Xls.DocumentProperties.GetStandardProperty(TPropertyId.Author))
            edTitle.Text = Convert.ToString(Xls.DocumentProperties.GetStandardProperty(TPropertyId.Title))
            edSubject.Text = Convert.ToString(Xls.DocumentProperties.GetStandardProperty(TPropertyId.Subject))
        End Sub

        Private Sub openFile_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles openFile.Click
            If openFileDialog1.ShowDialog() <> System.Windows.Forms.DialogResult.OK Then
                Return
            End If
            flexCelPdfExport1.Workbook = New XlsFile()

            flexCelPdfExport1.Workbook.Open(openFileDialog1.FileName)

            edFileName.Text = openFileDialog1.FileName

            Dim Xls As ExcelFile = flexCelPdfExport1.Workbook

            cbSheet.Items.Clear()
            Dim ActSheet As Integer = Xls.ActiveSheet
            For i As Integer = 1 To Xls.SheetCount
                Xls.ActiveSheet = i
                cbSheet.Items.Add(Xls.SheetName)
            Next i
            Xls.ActiveSheet = ActSheet
            cbSheet.SelectedIndex = ActSheet - 1

            LoadSheetConfig()
        End Sub

        Private Function HasFileOpen() As Boolean
            If flexCelPdfExport1.Workbook Is Nothing Then
                MessageBox.Show("You need to open a file first.")
                Return False
            End If
            Return True
        End Function

        Private Function LoadPreferences() As Boolean
            'NOTE: THERE SHOULD BE *A LOT* MORE VALIDATION OF VALUES ON THIS METHOD. (For example, validate that margins are between bounds)
            ' As this is a simple demo, they are not included.
            Try
                Dim Xls As ExcelFile = flexCelPdfExport1.Workbook
                Xls.PrintGridLines = chGridLines.Checked
                Xls.PageHeader = edHeader.Text
                Xls.PageFooter = edFooter.Text
                Xls.ShowFormulaText = chFormulaText.Checked

                If chFitIn.Checked Then
                    Xls.PrintToFit = True
                    Xls.PrintNumberOfHorizontalPages = Convert.ToInt32(edHPages.Text)
                    Xls.PrintNumberOfVerticalPages = Convert.ToInt32(edVPages.Text)
                Else
                    Xls.PrintToFit = False
                End If

                If chPrintLeft.Checked Then
                    Xls.PrintOptions = Xls.PrintOptions Or TPrintOptions.LeftToRight
                Else
                    Xls.PrintOptions = Xls.PrintOptions And Not TPrintOptions.LeftToRight
                End If

                Try
                    Xls.PrintScale = Convert.ToInt32(edZoom.Text)
                Catch
                    MessageBox.Show("Invalid Zoom")
                    Return False
                End Try

                Dim m As New TXlsMargins()
                m.Left = Convert.ToDouble(edl.Text)
                m.Top = Convert.ToDouble(edt.Text)
                m.Right = Convert.ToDouble(edr.Text)
                m.Bottom = Convert.ToDouble(edb.Text)
                m.Footer = Convert.ToDouble(edf.Text)
                m.Header = Convert.ToDouble(edh.Text)
                Xls.SetPrintMargins(m)

                flexCelPdfExport1.PrintRangeLeft = Convert.ToInt32(edLeft.Text)
                flexCelPdfExport1.PrintRangeTop = Convert.ToInt32(edTop.Text)
                flexCelPdfExport1.PrintRangeRight = Convert.ToInt32(edRight.Text)
                flexCelPdfExport1.PrintRangeBottom = Convert.ToInt32(edBottom.Text)

                If chEmbed.Checked Then
                    flexCelPdfExport1.FontEmbed = TFontEmbed.Embed
                Else
                    flexCelPdfExport1.FontEmbed = TFontEmbed.None
                End If

                If chSubset.Checked Then
                    flexCelPdfExport1.FontSubset = TFontSubset.Subset
                Else
                    flexCelPdfExport1.FontSubset = TFontSubset.DontSubset
                End If

                flexCelPdfExport1.Kerning = cbKerning.Checked

                Select Case cbFontMapping.SelectedIndex
                    Case 0
                        flexCelPdfExport1.FontMapping = TFontMapping.ReplaceAllFonts
                    Case 1
                        flexCelPdfExport1.FontMapping = TFontMapping.ReplaceStandardFonts
                    Case 2
                        flexCelPdfExport1.FontMapping = TFontMapping.DontReplaceFonts
                End Select

                Select Case cbPdfType.SelectedIndex
                    Case 0
                        flexCelPdfExport1.PdfType = TPdfType.Standard
                    Case 1
                        flexCelPdfExport1.PdfType = TPdfType.PDFA1
                    Case 2
                        flexCelPdfExport1.PdfType = TPdfType.PDFA2
                    Case 3
                        flexCelPdfExport1.PdfType = TPdfType.PDFA3
                End Select

                Select Case cbTagged.SelectedIndex
                    Case 0
                        flexCelPdfExport1.TagMode = TTagMode.Full
                    Case 1
                        flexCelPdfExport1.TagMode = TTagMode.None
                End Select

                Select Case cbVersion.SelectedIndex
                    Case 0
                        flexCelPdfExport1.PdfVersion = TPdfVersion.v14
                    Case 1
                        flexCelPdfExport1.PdfVersion = TPdfVersion.v16
                End Select

                flexCelPdfExport1.Properties.Author = edAuthor.Text
                flexCelPdfExport1.Properties.Title = edTitle.Text
                flexCelPdfExport1.Properties.Subject = edSubject.Text
                flexCelPdfExport1.Properties.Language = edLang.Text

                Xls.PrintLandscape = chLandscape.Checked
            Catch e As Exception
                MessageBox.Show("Error: " & e.Message)
                Return False
            End Try
            Return True
        End Function

        Private Sub chFitIn_CheckedChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles chFitIn.CheckedChanged
            edVPages.ReadOnly = Not chFitIn.Checked
            edHPages.ReadOnly = Not chFitIn.Checked
            edZoom.ReadOnly = chFitIn.Checked
        End Sub

        Private Sub cbSheet_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles cbSheet.SelectedIndexChanged
            flexCelPdfExport1.Workbook.ActiveSheet = cbSheet.SelectedIndex + 1
            LoadSheetConfig()
        End Sub

        Private Sub export_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles export.Click
            If Not HasFileOpen() Then
                Return
            End If
            If Not LoadPreferences() Then
                Return
            End If

            If exportDialog.ShowDialog() <> System.Windows.Forms.DialogResult.OK Then
                Return
            End If

            Using Pdf As New FileStream(exportDialog.FileName, FileMode.Create)
                Dim SaveSheet As Integer = flexCelPdfExport1.Workbook.ActiveSheet
                Try
                    flexCelPdfExport1.BeginExport(Pdf)
                    If chExportAll.Checked Then
                        flexCelPdfExport1.PageLayout = TPageLayout.Outlines 'To how the bookmarks when opening the file.
                        flexCelPdfExport1.ExportAllVisibleSheets(cbResetPageNumber.Checked, Path.GetFileNameWithoutExtension(exportDialog.FileName))
                    Else
                        flexCelPdfExport1.PageLayout = TPageLayout.None
                        flexCelPdfExport1.ExportSheet()
                    End If
                    flexCelPdfExport1.EndExport()
                Finally
                    flexCelPdfExport1.Workbook.ActiveSheet = SaveSheet
                End Try

                If MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) = System.Windows.Forms.DialogResult.Yes Then
                    Process.Start(exportDialog.FileName)
                End If
            End Using
        End Sub

        Private Sub chExportAll_CheckedChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles chExportAll.CheckedChanged
            cbSheet.Enabled = Not chExportAll.Checked
            cbResetPageNumber.Enabled = chExportAll.Checked
        End Sub

        ''' <summary>
        ''' Add a "Confidential" watermark on each page.
        ''' </summary>
        ''' <param name="sender"></param>
        ''' <param name="e"></param>
        Private Sub flexCelPdfExport1_AfterGeneratePage(ByVal sender As Object, ByVal e As FlexCel.Render.PageEventArgs) Handles flexCelPdfExport1.AfterGeneratePage
            If Not cbConfidential.Checked Then
                Return
            End If

            Const s As String = "Confidential"

            Using ABrush As Brush = New SolidBrush(Color.FromArgb(30, 25, 25, 25)) 'Red=Green=Blue is a shade of gray. Alpha=30 means it is transparent (255 is pure opaque, 0 is pure transparent).
                Using AFont As TUIFont = TUIFont.Create("Arial", 72)
                    Dim x0 As Double = e.File.PageSize.Width * 72.0 / 100.0 / 2.0 'PageSize is in inches/100, our coordinate system is in Points, that is inches/72
                    Dim y0 As Double = e.File.PageSize.Height * 72.0 / 100.0 / 2.0
                    Dim sf As SizeF = e.File.MeasureString(s, AFont)
                    e.File.Rotate(x0, y0, 45)
                    e.File.DrawString(s, AFont, ABrush, x0 - sf.Width / 2.0, y0 + sf.Height / 2.0) 'the y coord means the bottom of the text, and as the y axis grows down, we have to add sf.height/2 instead of substracting it.
                End Using
            End Using
        End Sub

        ''' <summary>
        ''' We show on this event how you can make an unmanaged call to the Win32 API to return font information and avoid
        ''' scanning the "fonts" folder. Note that this is <b>UNMANAGED</b> code, and it is not really needed except for small performance concerns,
        ''' so avoid using it if you don't really need it. Please read UsingFlexCelPdfExport for more information.
        ''' </summary>
        ''' <param name="sender"></param>
        ''' <param name="e"></param>
        Private Sub flexCelPdfExport1_GetFontData(ByVal sender As Object, ByVal e As FlexCel.Pdf.GetFontDataEventArgs) Handles flexCelPdfExport1.GetFontData
            'If the checkbox is not checked, just ignore this event.
            If Not cbUseGetFontData.Checked Then
                e.Applied = False
                Return
            End If

            'Actually make the WIN32 call.
            Dim ttcf As UInteger = &H66637474 'return full true type collections.

            ' Allocate a handle for the font
            Dim FontHandle As IntPtr = CType(e.InputFont, FlexCel.Draw.TGdipUIFont).Handle.ToHfont()
            Try
                Using Gr As Graphics = Graphics.FromHwnd(IntPtr.Zero)
                    Dim GrHandle As IntPtr = Gr.GetHdc()
                    Try
                        Dim ObjHandle As IntPtr = SelectObject(GrHandle, FontHandle)
                        Try
                            'First find out the sizes
                            Dim Size As UInteger = GetFontData(GrHandle, ttcf, 0, Nothing, 0)
                            If CInt(Size) < 0 Then 'error
                                ttcf = 0 'This might not be a true type collection, try again.
                                Size = GetFontData(GrHandle, ttcf, 0, Nothing, 0)

                                If CInt(Size) < 0 Then 'nothing else to do, exit.
                                    e.Applied = False
                                    Return
                                End If
                            End If

                            'Now get the font data.
                            e.FontData = New Byte(CInt(Size) - 1){}
                            Dim Result As UInteger = GetFontData(GrHandle, ttcf, 0, e.FontData, Size)

                            If CInt(Result) < 0 Then
                                e.Applied = False
                                Return
                            End If
                            e.Applied = True
                        Finally
                            DeleteObject(ObjHandle)
                        End Try
                    Finally
                        Gr.ReleaseHdc(GrHandle)
                    End Try
                End Using
            Finally
                DeleteObject(FontHandle)
            End Try
        End Sub

        ''' <summary>
        ''' The Win32 call.
        ''' </summary>
        ''' <param name="hdc"></param>
        ''' <param name="dwTable"></param>
        ''' <param name="dwOffset"></param>
        ''' <param name="lpvBuffer"></param>
        ''' <param name="cbData"></param>
        ''' <returns></returns>
       <DllImport("gdi32.dll")> _
        Shared Function GetFontData(ByVal hdc As IntPtr, ByVal dwTable As UInteger, ByVal dwOffset As UInteger, <[In](), Out()> ByVal lpvBuffer() As Byte, ByVal cbData As UInteger) As UInteger
        End Function

        <DllImport("GDI32.dll")> _
        Shared Function DeleteObject(ByVal objectHandle As IntPtr) As Boolean
        End Function

        <DllImport("gdi32.dll")> _
        Shared Function SelectObject(ByVal hdc As IntPtr, ByVal hgdiobj As IntPtr) As IntPtr
        End Function

    End Class
End Namespace

Program.vb

Namespace ExportPdf
    Friend NotInheritable Class Program

        Private Sub New()
        End Sub

        ''' <summary>
        ''' The main entry point for the application.
        ''' </summary>
       <STAThread> _
        Shared Sub Main()
            Application.EnableVisualStyles()
            Application.SetCompatibleTextRenderingDefault(False)
            Application.Run(New mainForm())
        End Sub
    End Class
End Namespace


Exporting to PDF/A (VB.Net / netframework) | FlexCel Studio for the .NET Framework documentation

Exporting to PDF/A (VB.Net / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\vb\VS2022\netframework\25.Printing and Exporting\32.PDFA and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​vb/​VS2022/​netframework/​Modules/​25.​Printing and Exporting/32.PDFA

Overview

FlexCel can export to PDF/A1, PDF/A2 and PDF/A3 in both their "a" and "b" variants.

Concepts

  • How to export a file to PDF/A

  • How to select between PDF/Ana and PDF/Anb

  • How to embed files in PDF/A3

Files

AssemblyInfo.vb

Imports System.Reflection
Imports System.Runtime.CompilerServices

'
' General Information about an assembly is controlled through the following
' set of attributes. Change these attribute values to modify the information
' associated with an assembly.
'
<Assembly: AssemblyTitle("")>
<Assembly: AssemblyDescription("")>
<Assembly: AssemblyConfiguration("")>
<Assembly: AssemblyCompany("")>
<Assembly: AssemblyProduct("")>
<Assembly: AssemblyCopyright("(c) 2002 - 2014 TMS Software")>
<Assembly: AssemblyTrademark("")>
<Assembly: AssemblyCulture("")>

'
' Version information for an assembly consists of the following four values:
'
'      Major Version
'      Minor Version
'      Build Number
'      Revision
'
' You can specify all the values or you can default the Revision and Build Numbers
' by using the '*' as shown below:

<Assembly: AssemblyVersion("6.2.1.0")>

'
' In order to sign your assembly you must specify a key to use. Refer to the
' Microsoft .NET Framework documentation for more information on assembly signing.
'
' Use the attributes below to control which key is used for signing.
'
' Notes:
'   (*) If no key is specified, the assembly is not signed.
'   (*) KeyName refers to a key that has been installed in the Crypto Service
'       Provider (CSP) on your machine. KeyFile refers to a file which contains
'       a key.
'   (*) If the KeyFile and the KeyName values are both specified, the
'       following processing occurs:
'       (1) If the KeyName can be found in the CSP, that key is used.
'       (2) If the KeyName does not exist and the KeyFile does exist, the key
'           in the KeyFile is installed into the CSP and used.
'   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
'       When specifying the KeyFile, the location of the KeyFile should be
'       relative to the project output directory which is
'       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
'       located in the project directory, you would specify the AssemblyKeyFile
'       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
'   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
'       documentation for more information on this.
'
<Assembly: AssemblyDelaySign(False)>
<Assembly: AssemblyKeyFile("")>
<Assembly: AssemblyKeyName("")>

Form1.Designer.vb

Imports System.Collections
Imports System.ComponentModel
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports System.IO
Imports System.Reflection
Imports System.Drawing.Drawing2D
Imports FlexCel.Pdf
Imports System.Runtime.InteropServices
Namespace PDFA
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Private panel1 As System.Windows.Forms.Panel
        Private exportDialog As System.Windows.Forms.SaveFileDialog
        Private components As System.ComponentModel.IContainer = Nothing

        ''' <summary>
        ''' Clean up any resources being used.
        ''' </summary>
        Protected Overrides Sub Dispose(ByVal disposing As Boolean)
            If disposing Then
                If components IsNot Nothing Then
                    components.Dispose()
                End If
            End If
            MyBase.Dispose(disposing)
        End Sub

        #Region "Windows Form Designer generated code"
        ''' <summary>
        ''' Required method for Designer support - do not modify
        ''' the contents of this method with the code editor.
        ''' </summary>
        Private Sub InitializeComponent()
            Dim resources As New System.ComponentModel.ComponentResourceManager(GetType(mainForm))
            Me.panel1 = New System.Windows.Forms.Panel()
            Me.cbEmbed = New System.Windows.Forms.CheckBox()
            Me.cbPdfType = New System.Windows.Forms.ComboBox()
            Me.exportDialog = New System.Windows.Forms.SaveFileDialog()
            Me.toolStrip1 = New System.Windows.Forms.ToolStrip()
            Me.export = New System.Windows.Forms.ToolStripButton()
            Me.btnClose = New System.Windows.Forms.ToolStripButton()
            Me.panel1.SuspendLayout()
            Me.toolStrip1.SuspendLayout()
            Me.SuspendLayout()
            '
            ' panel1
            '
            Me.panel1.BackColor = System.Drawing.Color.White
            Me.panel1.Controls.Add(Me.cbEmbed)
            Me.panel1.Controls.Add(Me.cbPdfType)
            Me.panel1.Dock = System.Windows.Forms.DockStyle.Fill
            Me.panel1.Location = New System.Drawing.Point(0, 38)
            Me.panel1.Name = "panel1"
            Me.panel1.Size = New System.Drawing.Size(372, 104)
            Me.panel1.TabIndex = 3
            '
            ' cbEmbed
            '
            Me.cbEmbed.AutoSize = True
            Me.cbEmbed.Location = New System.Drawing.Point(12, 54)
            Me.cbEmbed.Name = "cbEmbed"
            Me.cbEmbed.Size = New System.Drawing.Size(351, 17)
            Me.cbEmbed.TabIndex = 5
            Me.cbEmbed.Text = "Embed xslx source file inside the PDF. (requires PDF/A3 or Standard)"
            Me.cbEmbed.UseVisualStyleBackColor = True
            '
            ' cbPdfType
            '
            Me.cbPdfType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
            Me.cbPdfType.Items.AddRange(New Object() { "Standard", "PDF/A1a", "PDF/A1b", "PDF/A2a", "PDF/A2b", "PDF/A3a", "PDF/A3b"})
            Me.cbPdfType.Location = New System.Drawing.Point(12, 14)
            Me.cbPdfType.Name = "cbPdfType"
            Me.cbPdfType.Size = New System.Drawing.Size(144, 21)
            Me.cbPdfType.TabIndex = 35
            '
            ' exportDialog
            '
            Me.exportDialog.DefaultExt = "pdf"
            Me.exportDialog.Filter = "Pdf files|*.pdf"
            '
            ' toolStrip1
            '
            Me.toolStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() { Me.export, Me.btnClose})
            Me.toolStrip1.Location = New System.Drawing.Point(0, 0)
            Me.toolStrip1.Name = "toolStrip1"
            Me.toolStrip1.Size = New System.Drawing.Size(372, 38)
            Me.toolStrip1.TabIndex = 4
            Me.toolStrip1.Text = "mainToolbar"
            '
            ' export
            '
            Me.export.Image = (CType(resources.GetObject("export.Image"), System.Drawing.Image))
            Me.export.ImageTransparentColor = System.Drawing.Color.Magenta
            Me.export.Name = "export"
            Me.export.Size = New System.Drawing.Size(69, 35)
            Me.export.Text = "Create PDF"
            Me.export.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText
'           Me.export.Click += New System.EventHandler(Me.export_Click)
            '
            ' btnClose
            '
            Me.btnClose.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right
            Me.btnClose.Image = (CType(resources.GetObject("btnClose.Image"), System.Drawing.Image))
            Me.btnClose.ImageTransparentColor = System.Drawing.Color.Magenta
            Me.btnClose.Name = "btnClose"
            Me.btnClose.Size = New System.Drawing.Size(59, 35)
            Me.btnClose.Text = "     E&xit     "
            Me.btnClose.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText
'           Me.btnClose.Click += New System.EventHandler(Me.button2_Click)
            '
            ' mainForm
            '
            Me.AutoScaleDimensions = New System.Drawing.SizeF(6F, 13F)
            Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
            Me.ClientSize = New System.Drawing.Size(372, 142)
            Me.Controls.Add(Me.panel1)
            Me.Controls.Add(Me.toolStrip1)
            Me.Name = "mainForm"
            Me.Text = "PDF/A"
            Me.panel1.ResumeLayout(False)
            Me.panel1.PerformLayout()
            Me.toolStrip1.ResumeLayout(False)
            Me.toolStrip1.PerformLayout()
            Me.ResumeLayout(False)
            Me.PerformLayout()

        End Sub
        #End Region

        Private toolStrip1 As ToolStrip
        Private WithEvents export As ToolStripButton
        Private WithEvents btnClose As ToolStripButton
        Private cbEmbed As CheckBox
        Private cbPdfType As ComboBox
    End Class
End Namespace

Form1.vb

Imports System.Collections
Imports System.ComponentModel
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports System.IO
Imports System.Reflection
Imports System.Drawing.Drawing2D
Imports FlexCel.Pdf

Imports FlexCel.Render

Namespace PDFA
    ''' <summary>
    ''' Exporting xls files to PDF/A.
    ''' </summary>
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Public Sub New()
            InitializeComponent()
            cbPdfType.SelectedIndex = 1
        End Sub

        Private Sub button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnClose.Click
            Close()
        End Sub

        Private Sub export_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles export.Click
            Dim EmbedSource As Boolean = cbEmbed.Checked
            Dim PdfType As TPdfType = GetPdfType()
            Dim TagMode As TTagMode = GetTagMode()

            If EmbedSource Then
                If PdfType <> TPdfType.PDFA3 AndAlso PdfType <> TPdfType.Standard Then
                    MessageBox.Show("To embed a file, you need to use standard PDF or PDF/A3")
                    Return
                End If
            End If

            If exportDialog.ShowDialog() <> System.Windows.Forms.DialogResult.OK Then
                Return
            End If

            CreateFile(exportDialog.FileName, EmbedSource, PdfType, TagMode)

            If MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) = System.Windows.Forms.DialogResult.Yes Then
                Process.Start(exportDialog.FileName)
            End If

        End Sub

        Private Function GetPdfType() As TPdfType
            Select Case cbPdfType.SelectedIndex
                Case 0
                    Return TPdfType.Standard
                Case 1, 2
                    Return TPdfType.PDFA1
                Case 3, 4
                    Return TPdfType.PDFA2
                Case 5, 6
                    Return TPdfType.PDFA3
            End Select

            Throw New Exception("Unexpected PDF type")
        End Function

        Private Function GetTagMode() As TTagMode
            Select Case cbPdfType.SelectedIndex
                Case 0, 1, 3, 5
                    Return TTagMode.Full
            End Select
            Return TTagMode.None
        End Function

        Private Sub CreateFile(ByVal FileName As String, ByVal EmbedSource As Boolean, ByVal PdfType As TPdfType, ByVal TagMode As TTagMode)
            Dim xls As ExcelFile = CreateSourceFile()
            Using pdf As New FlexCelPdfExport(xls, True)
                pdf.PdfType = PdfType
                pdf.TagMode = TagMode
                If EmbedSource Then
                    pdf.AttachFile("Report.xlsx", StandardMimeType.Xlsx, "This is the source file used to create the PDF", Date.Now,  TPdfAttachmentKind.Source, _
                    Sub(attachWriter)
                        Using ms As New MemoryStream()
                            xls.Save(ms, TFileFormats.Xlsx)
                            ms.Position = 0
                            attachWriter.Write(ms)
                        End Using
                    End Sub)
                End If
                pdf.Export(FileName)
            End Using
        End Sub

        Private Function CreateSourceFile() As ExcelFile
            Dim xls As ExcelFile = New XlsFile()
            xls.NewFile(1, TExcelFileFormat.v2019)
            xls.SetCellValue(1, 1, "This is a test from FlexCel!")
            xls.SetCellValue(2, 1, "Here is some emoji to show unicode surrogate support: 🐜🐏")
            xls.SetCellValue(3, 1, "You might need a font able to show emoji for those characters to show")
            xls.SetCellValue(4, 1, "Windows 7 and 8 have SegoeUISymbol, which can show them and is used automatically by FlexCel.")
            Return xls
        End Function

    End Class

End Namespace

Program.vb

Namespace PDFA
    Friend NotInheritable Class Program

        Private Sub New()
        End Sub

        ''' <summary>
        ''' The main entry point for the application.
        ''' </summary>
       <STAThread> _
        Shared Sub Main()
            Application.EnableVisualStyles()
            Application.SetCompatibleTextRenderingDefault(False)
            Application.Run(New mainForm())
        End Sub
    End Class
End Namespace


Signing PDFs (VB.Net / netframework) | FlexCel Studio for the .NET Framework documentation

Signing PDFs (VB.Net / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\vb\VS2022\netframework\25.Printing and Exporting\35.Signing Pdfs and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​vb/​VS2022/​netframework/​Modules/​25.​Printing and Exporting/35.Signing Pdfs

Overview

In this example we will show how to add a visible or invisible signature to a generated PDF file.

Concepts

  • In order to sign a PDF file you will need a certificate issued by a valid Certificate Authority, or one issued by yourself. In this example we will use a self signed certificate. This certificate will not validate by default when you open it in Acrobat, you need to add it to your trusted list.

  • The default algorithm for CmsSigner .NET class is SHA-1, which is known to have vulnerabilities and shouldn't be used anymore. So in this example we use SHA512 instead by changing the DigestAlgorithm.

  • In order to sign a file, FlexCel will write a requirement for Acrobat 8 or newer in the generated files. This is because only Acrobat 8 or newer support SHA512. Older versions of acrobat will still display the pages but will not validate the signature.

  • We provide a default signing implementation using standard .NET crypto classes. You can still create your own signature engine by using a third party cryptography library or by calling CryptoApi in windows via p/invoke. This is explained in the section Signing PDF Files in the PDF exporting guide.

Files

mainForm.Designer.vb

Namespace SigningPdfs
    Partial Public Class mainForm
        ''' <summary>
        ''' Required designer variable.
        ''' </summary>
        Private components As System.ComponentModel.IContainer = Nothing

        ''' <summary>
        ''' Clean up any resources being used.
        ''' </summary>
        ''' <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        Protected Overrides Sub Dispose(ByVal disposing As Boolean)
            If disposing AndAlso (components IsNot Nothing) Then
                components.Dispose()
            End If
            MyBase.Dispose(disposing)
        End Sub

        #Region "Windows Form Designer generated code"

        ''' <summary>
        ''' Required method for Designer support - do not modify
        ''' the contents of this method with the code editor.
        ''' </summary>
        Private Sub InitializeComponent()
            Me.btnCreateAndSign = New System.Windows.Forms.Button()
            Me.cbVisibleSignature = New System.Windows.Forms.CheckBox()
            Me.OpenExcelDialog = New System.Windows.Forms.OpenFileDialog()
            Me.savePdfDialog = New System.Windows.Forms.SaveFileDialog()
            Me.SignaturePicture = New System.Windows.Forms.PictureBox()
            Me.OpenImageDialog = New System.Windows.Forms.OpenFileDialog()
            CType(Me.SignaturePicture, System.ComponentModel.ISupportInitialize).BeginInit()
            Me.SuspendLayout()
            '
            ' btnCreateAndSign
            '
            Me.btnCreateAndSign.Image = My.Resources.acroread
            Me.btnCreateAndSign.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft
            Me.btnCreateAndSign.Location = New System.Drawing.Point(24, 25)
            Me.btnCreateAndSign.Name = "btnCreateAndSign"
            Me.btnCreateAndSign.Size = New System.Drawing.Size(155, 30)
            Me.btnCreateAndSign.TabIndex = 0
            Me.btnCreateAndSign.Text = "Create and Sign Pdf"
            Me.btnCreateAndSign.UseVisualStyleBackColor = True
'           Me.btnCreateAndSign.Click += New System.EventHandler(Me.btnCreateAndSign_Click)
            '
            ' cbVisibleSignature
            '
            Me.cbVisibleSignature.AutoSize = True
            Me.cbVisibleSignature.Location = New System.Drawing.Point(24, 78)
            Me.cbVisibleSignature.Name = "cbVisibleSignature"
            Me.cbVisibleSignature.Size = New System.Drawing.Size(167, 17)
            Me.cbVisibleSignature.TabIndex = 1
            Me.cbVisibleSignature.Text = "Visible Signature (in last page)"
            Me.cbVisibleSignature.UseVisualStyleBackColor = True
'           Me.cbVisibleSignature.CheckedChanged += New System.EventHandler(Me.cbVisibleSignature_CheckedChanged)
            '
            ' OpenExcelDialog
            '
            Me.OpenExcelDialog.DefaultExt = "xls"
            Me.OpenExcelDialog.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm|Excel 97/2003|*.xls|Excel 2007|*.xlsx;*.xlsm|All files|*.*"
            Me.OpenExcelDialog.Title = "Select Excel file to convert..."
            '
            ' savePdfDialog
            '
            Me.savePdfDialog.DefaultExt = "pdf"
            Me.savePdfDialog.Filter = "Pdf Files|*.pdf"
            Me.savePdfDialog.Title = "Select where to save the file..."
            '
            ' SignaturePicture
            '
            Me.SignaturePicture.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
            Me.SignaturePicture.Image = My.Resources.sign
            Me.SignaturePicture.Location = New System.Drawing.Point(24, 110)
            Me.SignaturePicture.Name = "SignaturePicture"
            Me.SignaturePicture.Size = New System.Drawing.Size(155, 100)
            Me.SignaturePicture.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom
            Me.SignaturePicture.TabIndex = 2
            Me.SignaturePicture.TabStop = False
'           Me.SignaturePicture.Click += New System.EventHandler(Me.SignaturePicture_Click)
            '
            ' OpenImageDialog
            '
            Me.OpenImageDialog.Filter = "Supported Images|*.png;*.bmp*.jpg|All files|*.*"
            '
            ' mainForm
            '
            Me.AutoScaleDimensions = New System.Drawing.SizeF(6F, 13F)
            Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
            Me.ClientSize = New System.Drawing.Size(205, 100)
            Me.Controls.Add(Me.SignaturePicture)
            Me.Controls.Add(Me.cbVisibleSignature)
            Me.Controls.Add(Me.btnCreateAndSign)
            Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D
            Me.Name = "mainForm"
            Me.Text = "Signing PDFs"
            CType(Me.SignaturePicture, System.ComponentModel.ISupportInitialize).EndInit()
            Me.ResumeLayout(False)
            Me.PerformLayout()

        End Sub

        #End Region

        Private WithEvents btnCreateAndSign As System.Windows.Forms.Button
        Private WithEvents cbVisibleSignature As System.Windows.Forms.CheckBox
        Private OpenExcelDialog As System.Windows.Forms.OpenFileDialog
        Private savePdfDialog As System.Windows.Forms.SaveFileDialog
        Private WithEvents SignaturePicture As System.Windows.Forms.PictureBox
        Private OpenImageDialog As System.Windows.Forms.OpenFileDialog
    End Class
End Namespace

mainForm.vb

Imports System.ComponentModel
Imports System.Text
Imports FlexCel.Render
Imports FlexCel.XlsAdapter
Imports FlexCel.Pdf
Imports System.IO
Imports System.Security.Cryptography.X509Certificates
Imports System.Security.Cryptography.Pkcs
Imports System.Drawing.Imaging
Imports System.Reflection

Namespace SigningPdfs
    Partial Public Class mainForm
        Inherits Form

        Public Sub New()
            Application.EnableVisualStyles()
            InitializeComponent()
        End Sub

        Private Sub cbVisibleSignature_CheckedChanged(ByVal sender As Object, ByVal e As EventArgs) Handles cbVisibleSignature.CheckedChanged
            SignaturePicture.Visible = cbVisibleSignature.Checked
            Dim delta As Integer = SignaturePicture.Height + 30
            If cbVisibleSignature.Checked Then
                Me.Height += delta
            Else
                Me.Height -= delta
            End If
        End Sub

        Private Sub SignaturePicture_Click(ByVal sender As Object, ByVal e As EventArgs) Handles SignaturePicture.Click
            If OpenImageDialog.ShowDialog() <> System.Windows.Forms.DialogResult.OK Then
                Return
            End If
            SignaturePicture.Load(OpenImageDialog.FileName)
        End Sub

        Private Sub btnCreateAndSign_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnCreateAndSign.Click
            'Load the Excel file.
            If OpenExcelDialog.ShowDialog() <> System.Windows.Forms.DialogResult.OK Then
                Return
            End If
            Dim xls As New XlsFile()
            xls.Open(OpenExcelDialog.FileName)

            Dim DataPath As String = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) & "\..\..\"

            'Export it to pdf.
            Using pdf As New FlexCelPdfExport(xls, True)
                pdf.FontEmbed = TFontEmbed.Embed

                'Load the certificate and create a signer.
                'In this example we just have the password in clear. It should be kept in a SecureString.
                'Also make sure to set the flag X509KeyStorageFlags.EphemeralKeySet to avoid files created
                'on disk: https://snede.net/the-most-dangerous-constructor-in-net/
                'As X509KeyStorageFlags.EphemeralKeySet only exists in .NET 4.8 or newer, for older versions we will
                'define it as (X509KeyStorageFlags)32. For .NET 4.8 or newer and  NET Core, you can use X509KeyStorageFlags.EphemeralKeySet
               Dim Cert As New X509Certificate2(DataPath & "flexcel.pfx", "password", X509KeyStorageFlags.EphemeralKeySet)

                'Note that to use the CmsSigner class you need to add a reference to System.Security dll.
                'It is *not* enough to add it to the using clauses, you need to add a reference to the dll.
                Dim Signer As New CmsSigner(Cert)

                'By default CmsSigner uses SHA1, but SHA1 has known vulnerabilities and it is deprecated.
                'So we will use SHA512 instead.
                '"2.16.840.1.101.3.4.2.3" is the Oid for SHA512.
                Signer.DigestAlgorithm = New System.Security.Cryptography.Oid("2.16.840.1.101.3.4.2.3")

                Dim sig As TPdfSignature
                If cbVisibleSignature.Checked Then
                    Using fs As New MemoryStream()
                        SignaturePicture.Image.Save(fs, ImageFormat.Png)
                        Dim ImgData() As Byte = fs.ToArray()

                        'The -1 as "page" parameter means the last page.
                        sig = New TPdfVisibleSignature(New TBuiltInSignerFactory(Signer), "Signature", "I have read the document and certify it is valid.", "Springfield", "adrian@tmssoftware.com", -1, New RectangleF(50, 50, 140, 70), ImgData)
                    End Using
                Else
                    sig = New TPdfSignature(New TBuiltInSignerFactory(Signer), "Signature", "I have read the document and certify it is valid.", "Springfield", "adrian@tmssoftware.com")
                End If

                'You must sign the document *BEFORE* starting to write it.
                pdf.Sign(sig)

                If savePdfDialog.ShowDialog() <> System.Windows.Forms.DialogResult.OK Then
                    Return
                End If
                Using PdfStream As New FileStream(savePdfDialog.FileName, FileMode.Create)
                    pdf.BeginExport(PdfStream)
                    pdf.ExportAllVisibleSheets(False, "Signed Pdf")
                    pdf.EndExport()
                End Using

            End Using

            If MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo, MessageBoxIcon.Question) <> System.Windows.Forms.DialogResult.Yes Then
                Return
            End If
            Process.Start(savePdfDialog.FileName)

        End Sub
    End Class
End Namespace

Program.vb

Namespace SigningPdfs
    Friend NotInheritable Class Program

        Private Sub New()
        End Sub

        ''' <summary>
        ''' The main entry point for the application.
        ''' </summary>
       <STAThread> _
        Shared Sub Main()
            Application.EnableVisualStyles()
            Application.SetCompatibleTextRenderingDefault(False)
            Application.Run(New mainForm())
        End Sub
    End Class
End Namespace


Exporting Excel files to HTML (VB.Net / netframework) | FlexCel Studio for the .NET Framework documentation

Exporting Excel files to HTML (VB.Net / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\vb\VS2022\netframework\25.Printing and Exporting\40.Export HTML and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​vb/​VS2022/​netframework/​Modules/​25.​Printing and Exporting/40.Export HTML

Overview

FlexCel can natively export an Excel file to HTML, in many formats like XHTML 1.1, HTML 3.2, HTML 4.1 strict or HTML 5.

Concepts

  • HTML is a format that makes emphasis in semantics over presentation, and because of this reason the HTML file will not be as faithful to the original file as a PDF. PDF are targeted especially for handling presentation. Anyway, the output is very similar and in many ways better (and more cross-browser) than the HTML generated by Excel itself when saving to HTML.

  • Among the things that are not exported you can find:

  • ActiveX objects

  • 3D Charts (They will be rendered as 2d)

  • Not common AutoShapes (most used Autoshapes, as rectangles, rounded rectangles, ellipses, etc are exported)

Files

AssemblyInfo.vb

Imports System.Reflection
Imports System.Runtime.CompilerServices

'
' General Information about an assembly is controlled through the following
' set of attributes. Change these attribute values to modify the information
' associated with an assembly.
'
<Assembly: AssemblyTitle("")>
<Assembly: AssemblyDescription("")>
<Assembly: AssemblyConfiguration("")>
<Assembly: AssemblyCompany("")>
<Assembly: AssemblyProduct("")>
<Assembly: AssemblyCopyright("(c) 2002 - 2014 TMS Software")>
<Assembly: AssemblyTrademark("")>
<Assembly: AssemblyCulture("")>

'
' Version information for an assembly consists of the following four values:
'
'      Major Version
'      Minor Version
'      Build Number
'      Revision
'
' You can specify all the values or you can default the Revision and Build Numbers
' by using the '*' as shown below:

<Assembly: AssemblyVersion("6.2.1.0")>

'
' In order to sign your assembly you must specify a key to use. Refer to the
' Microsoft .NET Framework documentation for more information on assembly signing.
'
' Use the attributes below to control which key is used for signing.
'
' Notes:
'   (*) If no key is specified, the assembly is not signed.
'   (*) KeyName refers to a key that has been installed in the Crypto Service
'       Provider (CSP) on your machine. KeyFile refers to a file which contains
'       a key.
'   (*) If the KeyFile and the KeyName values are both specified, the
'       following processing occurs:
'       (1) If the KeyName can be found in the CSP, that key is used.
'       (2) If the KeyName does not exist and the KeyFile does exist, the key
'           in the KeyFile is installed into the CSP and used.
'   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
'       When specifying the KeyFile, the location of the KeyFile should be
'       relative to the project output directory which is
'       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
'       located in the project directory, you would specify the AssemblyKeyFile
'       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
'   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
'       documentation for more information on this.
'
<Assembly: AssemblyDelaySign(False)>
<Assembly: AssemblyKeyFile("")>
<Assembly: AssemblyKeyName("")>

Form1.Designer.vb

Imports System.Collections
Imports System.ComponentModel
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports FlexCel.Render
Imports System.IO
Imports System.Text
Namespace ExportHTML
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Private openFileDialog1 As System.Windows.Forms.OpenFileDialog
        Private panel1 As System.Windows.Forms.Panel
        Private label1 As System.Windows.Forms.Label
        Private panel3 As System.Windows.Forms.Panel
        Private label12 As System.Windows.Forms.Label
        Private label13 As System.Windows.Forms.Label
        Private label14 As System.Windows.Forms.Label
        Private edTop As System.Windows.Forms.TextBox
        Private edLeft As System.Windows.Forms.TextBox
        Private label15 As System.Windows.Forms.Label
        Private edRight As System.Windows.Forms.TextBox
        Private label16 As System.Windows.Forms.Label
        Private edBottom As System.Windows.Forms.TextBox
        Private label17 As System.Windows.Forms.Label
        Private exportDialog As System.Windows.Forms.SaveFileDialog
        Private panel8 As System.Windows.Forms.Panel
        Private chFormulaText As System.Windows.Forms.CheckBox
        Private chGridLines As System.Windows.Forms.CheckBox
        Private label24 As System.Windows.Forms.Label
        Private panel4 As System.Windows.Forms.Panel
        Private label4 As System.Windows.Forms.Label
        Private cbOutlook2007 As System.Windows.Forms.CheckBox
        Private panel5 As System.Windows.Forms.Panel
        Private label5 As System.Windows.Forms.Label
        Private panel6 As System.Windows.Forms.Panel
        Private label6 As System.Windows.Forms.Label
        Private checkBox4 As System.Windows.Forms.CheckBox
        Private cbIe6Png As System.Windows.Forms.CheckBox
        Private cbComments As System.Windows.Forms.CheckBox
        Private cbHyperlinks As System.Windows.Forms.CheckBox
        Private cbImages As System.Windows.Forms.CheckBox
        Private panel7 As System.Windows.Forms.Panel
        Private label2 As System.Windows.Forms.Label
        Private WithEvents cbExportObject As System.Windows.Forms.ComboBox
        Private lblSheetToExport As System.Windows.Forms.Label
        Private cbSheet As System.Windows.Forms.ComboBox
        Private panel9 As System.Windows.Forms.Panel
        Private label3 As System.Windows.Forms.Label
        Private cbTop As System.Windows.Forms.CheckBox
        Private cbLeft As System.Windows.Forms.CheckBox
        Private cbRight As System.Windows.Forms.CheckBox
        Private cbBottom As System.Windows.Forms.CheckBox
        Private panel10 As System.Windows.Forms.Panel
        Private label7 As System.Windows.Forms.Label
        Private edSheetSeparator As System.Windows.Forms.TextBox
        Private panel11 As System.Windows.Forms.Panel
        Private label8 As System.Windows.Forms.Label
        Private panel12 As System.Windows.Forms.Panel
        Private WithEvents cbCss As System.Windows.Forms.CheckBox
        Private edCss As System.Windows.Forms.TextBox
        Private edImages As System.Windows.Forms.TextBox
        Private cbHtmlVersion As System.Windows.Forms.ComboBox
        Private cbFileFormat As System.Windows.Forms.ComboBox
        Private label9 As System.Windows.Forms.Label
        Private panel13 As System.Windows.Forms.Panel
        Private edBodyStart As System.Windows.Forms.TextBox
        Private label10 As System.Windows.Forms.Label
        Private cbReplaceFonts As System.Windows.Forms.CheckBox
        Private chPrintHeadings As System.Windows.Forms.CheckBox
        Private cbHeadersFooters As System.Windows.Forms.CheckBox
        Private components As System.ComponentModel.IContainer = Nothing

        ''' <summary>
        ''' Clean up any resources being used.
        ''' </summary>
        Protected Overrides Sub Dispose(ByVal disposing As Boolean)
            If disposing Then
                If components IsNot Nothing Then
                    components.Dispose()
                End If
            End If
            MyBase.Dispose(disposing)
        End Sub

        #Region "Windows Form Designer generated code"
        ''' <summary>
        ''' Required method for Designer support - do not modify
        ''' the contents of this method with the code editor.
        ''' </summary>
        Private Sub InitializeComponent()
            Dim resources As New System.ComponentModel.ComponentResourceManager(GetType(mainForm))
            Me.openFileDialog1 = New System.Windows.Forms.OpenFileDialog()
            Me.panel1 = New System.Windows.Forms.Panel()
            Me.cbReplaceFonts = New System.Windows.Forms.CheckBox()
            Me.panel13 = New System.Windows.Forms.Panel()
            Me.edBodyStart = New System.Windows.Forms.TextBox()
            Me.label10 = New System.Windows.Forms.Label()
            Me.panel12 = New System.Windows.Forms.Panel()
            Me.cbCss = New System.Windows.Forms.CheckBox()
            Me.edCss = New System.Windows.Forms.TextBox()
            Me.panel11 = New System.Windows.Forms.Panel()
            Me.edImages = New System.Windows.Forms.TextBox()
            Me.label8 = New System.Windows.Forms.Label()
            Me.panel10 = New System.Windows.Forms.Panel()
            Me.edSheetSeparator = New System.Windows.Forms.TextBox()
            Me.label7 = New System.Windows.Forms.Label()
            Me.panel9 = New System.Windows.Forms.Panel()
            Me.cbBottom = New System.Windows.Forms.CheckBox()
            Me.cbRight = New System.Windows.Forms.CheckBox()
            Me.cbLeft = New System.Windows.Forms.CheckBox()
            Me.cbTop = New System.Windows.Forms.CheckBox()
            Me.label3 = New System.Windows.Forms.Label()
            Me.panel7 = New System.Windows.Forms.Panel()
            Me.cbExportObject = New System.Windows.Forms.ComboBox()
            Me.lblSheetToExport = New System.Windows.Forms.Label()
            Me.cbSheet = New System.Windows.Forms.ComboBox()
            Me.label2 = New System.Windows.Forms.Label()
            Me.panel6 = New System.Windows.Forms.Panel()
            Me.cbHeadersFooters = New System.Windows.Forms.CheckBox()
            Me.cbImages = New System.Windows.Forms.CheckBox()
            Me.cbHyperlinks = New System.Windows.Forms.CheckBox()
            Me.cbComments = New System.Windows.Forms.CheckBox()
            Me.label6 = New System.Windows.Forms.Label()
            Me.panel5 = New System.Windows.Forms.Panel()
            Me.cbIe6Png = New System.Windows.Forms.CheckBox()
            Me.label5 = New System.Windows.Forms.Label()
            Me.cbOutlook2007 = New System.Windows.Forms.CheckBox()
            Me.panel4 = New System.Windows.Forms.Panel()
            Me.cbEmbedImages = New System.Windows.Forms.CheckBox()
            Me.sbSVG = New System.Windows.Forms.CheckBox()
            Me.label9 = New System.Windows.Forms.Label()
            Me.cbFileFormat = New System.Windows.Forms.ComboBox()
            Me.cbHtmlVersion = New System.Windows.Forms.ComboBox()
            Me.label4 = New System.Windows.Forms.Label()
            Me.panel3 = New System.Windows.Forms.Panel()
            Me.edBottom = New System.Windows.Forms.TextBox()
            Me.label17 = New System.Windows.Forms.Label()
            Me.edRight = New System.Windows.Forms.TextBox()
            Me.label16 = New System.Windows.Forms.Label()
            Me.edLeft = New System.Windows.Forms.TextBox()
            Me.label15 = New System.Windows.Forms.Label()
            Me.edTop = New System.Windows.Forms.TextBox()
            Me.label14 = New System.Windows.Forms.Label()
            Me.label13 = New System.Windows.Forms.Label()
            Me.label12 = New System.Windows.Forms.Label()
            Me.label1 = New System.Windows.Forms.Label()
            Me.panel8 = New System.Windows.Forms.Panel()
            Me.chPrintHeadings = New System.Windows.Forms.CheckBox()
            Me.label24 = New System.Windows.Forms.Label()
            Me.chFormulaText = New System.Windows.Forms.CheckBox()
            Me.chGridLines = New System.Windows.Forms.CheckBox()
            Me.checkBox4 = New System.Windows.Forms.CheckBox()
            Me.exportDialog = New System.Windows.Forms.SaveFileDialog()
            Me.flexCelHtmlExport1 = New FlexCel.Render.FlexCelHtmlExport()
            Me.mainToolbar = New System.Windows.Forms.ToolStrip()
            Me.openFile = New System.Windows.Forms.ToolStripButton()
            Me.export = New System.Windows.Forms.ToolStripButton()
            Me.btnEmail = New System.Windows.Forms.ToolStripButton()
            Me.toolStripSeparator1 = New System.Windows.Forms.ToolStripSeparator()
            Me.btnClose = New System.Windows.Forms.ToolStripButton()
            Me.panel1.SuspendLayout()
            Me.panel13.SuspendLayout()
            Me.panel12.SuspendLayout()
            Me.panel11.SuspendLayout()
            Me.panel10.SuspendLayout()
            Me.panel9.SuspendLayout()
            Me.panel7.SuspendLayout()
            Me.panel6.SuspendLayout()
            Me.panel5.SuspendLayout()
            Me.panel4.SuspendLayout()
            Me.panel3.SuspendLayout()
            Me.panel8.SuspendLayout()
            Me.mainToolbar.SuspendLayout()
            Me.SuspendLayout()
            '
            ' openFileDialog1
            '
            Me.openFileDialog1.DefaultExt = "xls"
            Me.openFileDialog1.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm|Excel 97/2003|*.xls|Excel 2007|*.xlsx;*.xlsm|All " & "files|*.*"
            Me.openFileDialog1.Title = "Open an Excel File"
            '
            ' panel1
            '
            Me.panel1.BackColor = System.Drawing.Color.White
            Me.panel1.Controls.Add(Me.cbReplaceFonts)
            Me.panel1.Controls.Add(Me.panel13)
            Me.panel1.Controls.Add(Me.panel12)
            Me.panel1.Controls.Add(Me.panel11)
            Me.panel1.Controls.Add(Me.panel10)
            Me.panel1.Controls.Add(Me.panel9)
            Me.panel1.Controls.Add(Me.panel7)
            Me.panel1.Controls.Add(Me.panel6)
            Me.panel1.Controls.Add(Me.panel5)
            Me.panel1.Controls.Add(Me.panel4)
            Me.panel1.Controls.Add(Me.panel3)
            Me.panel1.Controls.Add(Me.label1)
            Me.panel1.Controls.Add(Me.panel8)
            Me.panel1.Dock = System.Windows.Forms.DockStyle.Fill
            Me.panel1.Location = New System.Drawing.Point(0, 0)
            Me.panel1.Name = "panel1"
            Me.panel1.Size = New System.Drawing.Size(768, 696)
            Me.panel1.TabIndex = 3
            '
            ' cbReplaceFonts
            '
            Me.cbReplaceFonts.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (CByte(0)))
            Me.cbReplaceFonts.Location = New System.Drawing.Point(40, 634)
            Me.cbReplaceFonts.Name = "cbReplaceFonts"
            Me.cbReplaceFonts.Size = New System.Drawing.Size(632, 24)
            Me.cbReplaceFonts.TabIndex = 50
            Me.cbReplaceFonts.Text = "Replace all fonts with Arial"
            '
            ' panel13
            '
            Me.panel13.Anchor = (CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.panel13.BackColor = System.Drawing.Color.FromArgb((CInt((CByte(224)))), (CInt((CByte(224)))), (CInt((CByte(224)))))
            Me.panel13.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
            Me.panel13.Controls.Add(Me.edBodyStart)
            Me.panel13.Controls.Add(Me.label10)
            Me.panel13.Location = New System.Drawing.Point(32, 562)
            Me.panel13.Name = "panel13"
            Me.panel13.Size = New System.Drawing.Size(704, 64)
            Me.panel13.TabIndex = 49
            '
            ' edBodyStart
            '
            Me.edBodyStart.Anchor = (CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.edBodyStart.Location = New System.Drawing.Point(16, 32)
            Me.edBodyStart.Name = "edBodyStart"
            Me.edBodyStart.Size = New System.Drawing.Size(664, 20)
            Me.edBodyStart.TabIndex = 20
            Me.edBodyStart.Text = "<h1>Created with FlexCel</h1>"
            '
            ' label10
            '
            Me.label10.Font = New System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (CByte(0)))
            Me.label10.Location = New System.Drawing.Point(8, 8)
            Me.label10.Name = "label10"
            Me.label10.Size = New System.Drawing.Size(584, 16)
            Me.label10.TabIndex = 19
            Me.label10.Text = "Text to add at the beginning of the file:"
            '
            ' panel12
            '
            Me.panel12.Anchor = (CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.panel12.BackColor = System.Drawing.Color.FromArgb((CInt((CByte(224)))), (CInt((CByte(224)))), (CInt((CByte(224)))))
            Me.panel12.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
            Me.panel12.Controls.Add(Me.cbCss)
            Me.panel12.Controls.Add(Me.edCss)
            Me.panel12.Location = New System.Drawing.Point(32, 490)
            Me.panel12.Name = "panel12"
            Me.panel12.Size = New System.Drawing.Size(704, 64)
            Me.panel12.TabIndex = 48
            '
            ' cbCss
            '
            Me.cbCss.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (CByte(0)))
            Me.cbCss.Location = New System.Drawing.Point(16, 8)
            Me.cbCss.Name = "cbCss"
            Me.cbCss.Size = New System.Drawing.Size(632, 24)
            Me.cbCss.TabIndex = 21
            Me.cbCss.Text = "Save CSS to an external file (path relative to where the html file is)"
'           Me.cbCss.CheckedChanged += New System.EventHandler(Me.cbCss_CheckedChanged)
            '
            ' edCss
            '
            Me.edCss.Anchor = (CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.edCss.Enabled = False
            Me.edCss.Location = New System.Drawing.Point(16, 32)
            Me.edCss.Name = "edCss"
            Me.edCss.Size = New System.Drawing.Size(664, 20)
            Me.edCss.TabIndex = 20
            Me.edCss.Text = "css\test.css"
            '
            ' panel11
            '
            Me.panel11.Anchor = (CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.panel11.BackColor = System.Drawing.Color.FromArgb((CInt((CByte(224)))), (CInt((CByte(224)))), (CInt((CByte(224)))))
            Me.panel11.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
            Me.panel11.Controls.Add(Me.edImages)
            Me.panel11.Controls.Add(Me.label8)
            Me.panel11.Location = New System.Drawing.Point(32, 418)
            Me.panel11.Name = "panel11"
            Me.panel11.Size = New System.Drawing.Size(704, 64)
            Me.panel11.TabIndex = 47
            '
            ' edImages
            '
            Me.edImages.Anchor = (CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.edImages.Location = New System.Drawing.Point(16, 32)
            Me.edImages.Name = "edImages"
            Me.edImages.Size = New System.Drawing.Size(664, 20)
            Me.edImages.TabIndex = 20
            Me.edImages.Text = "images"
            '
            ' label8
            '
            Me.label8.Font = New System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (CByte(0)))
            Me.label8.Location = New System.Drawing.Point(8, 8)
            Me.label8.Name = "label8"
            Me.label8.Size = New System.Drawing.Size(584, 16)
            Me.label8.TabIndex = 19
            Me.label8.Text = "Relative path for images (make it empty to save the images in the same folder as " & "the html file)"
            '
            ' panel10
            '
            Me.panel10.Anchor = (CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.panel10.BackColor = System.Drawing.Color.FromArgb((CInt((CByte(224)))), (CInt((CByte(224)))), (CInt((CByte(224)))))
            Me.panel10.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
            Me.panel10.Controls.Add(Me.edSheetSeparator)
            Me.panel10.Controls.Add(Me.label7)
            Me.panel10.Location = New System.Drawing.Point(224, 338)
            Me.panel10.Name = "panel10"
            Me.panel10.Size = New System.Drawing.Size(512, 72)
            Me.panel10.TabIndex = 46
            '
            ' edSheetSeparator
            '
            Me.edSheetSeparator.Anchor = (CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.edSheetSeparator.Location = New System.Drawing.Point(16, 32)
            Me.edSheetSeparator.Name = "edSheetSeparator"
            Me.edSheetSeparator.Size = New System.Drawing.Size(472, 20)
            Me.edSheetSeparator.TabIndex = 20
            Me.edSheetSeparator.Text = "<p><hr />Sheet <#SheetName>  (<#SheetPos> of <#SheetCount>)"
            '
            ' label7
            '
            Me.label7.Font = New System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (CByte(0)))
            Me.label7.Location = New System.Drawing.Point(8, 8)
            Me.label7.Name = "label7"
            Me.label7.Size = New System.Drawing.Size(480, 16)
            Me.label7.TabIndex = 19
            Me.label7.Text = "Sheet separator (When exporting all sheets in one file)"
            '
            ' panel9
            '
            Me.panel9.BackColor = System.Drawing.Color.FromArgb((CInt((CByte(224)))), (CInt((CByte(224)))), (CInt((CByte(224)))))
            Me.panel9.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
            Me.panel9.Controls.Add(Me.cbBottom)
            Me.panel9.Controls.Add(Me.cbRight)
            Me.panel9.Controls.Add(Me.cbLeft)
            Me.panel9.Controls.Add(Me.cbTop)
            Me.panel9.Controls.Add(Me.label3)
            Me.panel9.Location = New System.Drawing.Point(224, 266)
            Me.panel9.Name = "panel9"
            Me.panel9.Size = New System.Drawing.Size(288, 64)
            Me.panel9.TabIndex = 45
            '
            ' cbBottom
            '
            Me.cbBottom.Location = New System.Drawing.Point(216, 32)
            Me.cbBottom.Name = "cbBottom"
            Me.cbBottom.Size = New System.Drawing.Size(64, 16)
            Me.cbBottom.TabIndex = 23
            Me.cbBottom.Text = "Bottom"
            '
            ' cbRight
            '
            Me.cbRight.Location = New System.Drawing.Point(144, 32)
            Me.cbRight.Name = "cbRight"
            Me.cbRight.Size = New System.Drawing.Size(64, 16)
            Me.cbRight.TabIndex = 22
            Me.cbRight.Text = "Right"
            '
            ' cbLeft
            '
            Me.cbLeft.Location = New System.Drawing.Point(24, 32)
            Me.cbLeft.Name = "cbLeft"
            Me.cbLeft.Size = New System.Drawing.Size(48, 16)
            Me.cbLeft.TabIndex = 21
            Me.cbLeft.Text = "Left"
            '
            ' cbTop
            '
            Me.cbTop.Checked = True
            Me.cbTop.CheckState = System.Windows.Forms.CheckState.Checked
            Me.cbTop.Location = New System.Drawing.Point(88, 32)
            Me.cbTop.Name = "cbTop"
            Me.cbTop.Size = New System.Drawing.Size(48, 16)
            Me.cbTop.TabIndex = 20
            Me.cbTop.Text = "Top"
            '
            ' label3
            '
            Me.label3.Font = New System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (CByte(0)))
            Me.label3.Location = New System.Drawing.Point(8, 8)
            Me.label3.Name = "label3"
            Me.label3.Size = New System.Drawing.Size(192, 16)
            Me.label3.TabIndex = 19
            Me.label3.Text = "Tabs:"
            '
            ' panel7
            '
            Me.panel7.Anchor = (CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.panel7.BackColor = System.Drawing.Color.FromArgb((CInt((CByte(224)))), (CInt((CByte(224)))), (CInt((CByte(224)))))
            Me.panel7.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
            Me.panel7.Controls.Add(Me.cbExportObject)
            Me.panel7.Controls.Add(Me.lblSheetToExport)
            Me.panel7.Controls.Add(Me.cbSheet)
            Me.panel7.Controls.Add(Me.label2)
            Me.panel7.Location = New System.Drawing.Point(32, 52)
            Me.panel7.Name = "panel7"
            Me.panel7.Size = New System.Drawing.Size(704, 72)
            Me.panel7.TabIndex = 44
            '
            ' cbExportObject
            '
            Me.cbExportObject.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
            Me.cbExportObject.Items.AddRange(New Object() { "All sheets as Tabs", "All sheets as a single file", "Active Sheet:"})
            Me.cbExportObject.Location = New System.Drawing.Point(8, 32)
            Me.cbExportObject.Name = "cbExportObject"
            Me.cbExportObject.Size = New System.Drawing.Size(248, 21)
            Me.cbExportObject.TabIndex = 46
'           Me.cbExportObject.SelectedIndexChanged += New System.EventHandler(Me.cbExportObject_SelectedIndexChanged)
            '
            ' lblSheetToExport
            '
            Me.lblSheetToExport.Font = New System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (CByte(0)))
            Me.lblSheetToExport.Location = New System.Drawing.Point(304, 8)
            Me.lblSheetToExport.Name = "lblSheetToExport"
            Me.lblSheetToExport.Size = New System.Drawing.Size(96, 16)
            Me.lblSheetToExport.TabIndex = 45
            Me.lblSheetToExport.Text = "Sheet to export:"
            '
            ' cbSheet
            '
            Me.cbSheet.Anchor = (CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.cbSheet.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
            Me.cbSheet.Location = New System.Drawing.Point(304, 32)
            Me.cbSheet.Name = "cbSheet"
            Me.cbSheet.Size = New System.Drawing.Size(360, 21)
            Me.cbSheet.TabIndex = 44
            '
            ' label2
            '
            Me.label2.Font = New System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (CByte(0)))
            Me.label2.Location = New System.Drawing.Point(8, 8)
            Me.label2.Name = "label2"
            Me.label2.Size = New System.Drawing.Size(192, 16)
            Me.label2.TabIndex = 19
            Me.label2.Text = "What to Export:"
            '
            ' panel6
            '
            Me.panel6.BackColor = System.Drawing.Color.FromArgb((CInt((CByte(224)))), (CInt((CByte(224)))), (CInt((CByte(224)))))
            Me.panel6.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
            Me.panel6.Controls.Add(Me.cbHeadersFooters)
            Me.panel6.Controls.Add(Me.cbImages)
            Me.panel6.Controls.Add(Me.cbHyperlinks)
            Me.panel6.Controls.Add(Me.cbComments)
            Me.panel6.Controls.Add(Me.label6)
            Me.panel6.Location = New System.Drawing.Point(32, 226)
            Me.panel6.Name = "panel6"
            Me.panel6.Size = New System.Drawing.Size(176, 104)
            Me.panel6.TabIndex = 42
            '
            ' cbHeadersFooters
            '
            Me.cbHeadersFooters.Location = New System.Drawing.Point(96, 40)
            Me.cbHeadersFooters.Name = "cbHeadersFooters"
            Me.cbHeadersFooters.Size = New System.Drawing.Size(72, 44)
            Me.cbHeadersFooters.TabIndex = 23
            Me.cbHeadersFooters.Text = "Headers / Footers"
            '
            ' cbImages
            '
            Me.cbImages.Checked = True
            Me.cbImages.CheckState = System.Windows.Forms.CheckState.Checked
            Me.cbImages.Location = New System.Drawing.Point(16, 32)
            Me.cbImages.Name = "cbImages"
            Me.cbImages.Size = New System.Drawing.Size(72, 24)
            Me.cbImages.TabIndex = 22
            Me.cbImages.Text = "Images"
            '
            ' cbHyperlinks
            '
            Me.cbHyperlinks.Checked = True
            Me.cbHyperlinks.CheckState = System.Windows.Forms.CheckState.Checked
            Me.cbHyperlinks.Location = New System.Drawing.Point(16, 80)
            Me.cbHyperlinks.Name = "cbHyperlinks"
            Me.cbHyperlinks.Size = New System.Drawing.Size(80, 24)
            Me.cbHyperlinks.TabIndex = 21
            Me.cbHyperlinks.Text = "HyperLinks"
            '
            ' cbComments
            '
            Me.cbComments.Checked = True
            Me.cbComments.CheckState = System.Windows.Forms.CheckState.Checked
            Me.cbComments.Location = New System.Drawing.Point(16, 56)
            Me.cbComments.Name = "cbComments"
            Me.cbComments.Size = New System.Drawing.Size(80, 24)
            Me.cbComments.TabIndex = 20
            Me.cbComments.Text = "Comments"
            '
            ' label6
            '
            Me.label6.Font = New System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (CByte(0)))
            Me.label6.Location = New System.Drawing.Point(8, 16)
            Me.label6.Name = "label6"
            Me.label6.Size = New System.Drawing.Size(192, 16)
            Me.label6.TabIndex = 19
            Me.label6.Text = "Objects to Export:"
            '
            ' panel5
            '
            Me.panel5.BackColor = System.Drawing.Color.FromArgb((CInt((CByte(224)))), (CInt((CByte(224)))), (CInt((CByte(224)))))
            Me.panel5.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
            Me.panel5.Controls.Add(Me.cbIe6Png)
            Me.panel5.Controls.Add(Me.label5)
            Me.panel5.Controls.Add(Me.cbOutlook2007)
            Me.panel5.Location = New System.Drawing.Point(32, 338)
            Me.panel5.Name = "panel5"
            Me.panel5.Size = New System.Drawing.Size(176, 72)
            Me.panel5.TabIndex = 41
            '
            ' cbIe6Png
            '
            Me.cbIe6Png.Location = New System.Drawing.Point(16, 40)
            Me.cbIe6Png.Name = "cbIe6Png"
            Me.cbIe6Png.Size = New System.Drawing.Size(153, 24)
            Me.cbIe6Png.TabIndex = 20
            Me.cbIe6Png.Text = "Fix for IE6 support"
            '
            ' label5
            '
            Me.label5.Font = New System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (CByte(0)))
            Me.label5.Location = New System.Drawing.Point(8, 8)
            Me.label5.Name = "label5"
            Me.label5.Size = New System.Drawing.Size(192, 16)
            Me.label5.TabIndex = 19
            Me.label5.Text = "Browser Fixes"
            '
            ' cbOutlook2007
            '
            Me.cbOutlook2007.Location = New System.Drawing.Point(16, 24)
            Me.cbOutlook2007.Name = "cbOutlook2007"
            Me.cbOutlook2007.Size = New System.Drawing.Size(128, 16)
            Me.cbOutlook2007.TabIndex = 16
            Me.cbOutlook2007.Text = "Fix for Outlook2007"
            '
            ' panel4
            '
            Me.panel4.BackColor = System.Drawing.Color.FromArgb((CInt((CByte(224)))), (CInt((CByte(224)))), (CInt((CByte(224)))))
            Me.panel4.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
            Me.panel4.Controls.Add(Me.cbEmbedImages)
            Me.panel4.Controls.Add(Me.sbSVG)
            Me.panel4.Controls.Add(Me.label9)
            Me.panel4.Controls.Add(Me.cbFileFormat)
            Me.panel4.Controls.Add(Me.cbHtmlVersion)
            Me.panel4.Controls.Add(Me.label4)
            Me.panel4.Location = New System.Drawing.Point(224, 130)
            Me.panel4.Name = "panel4"
            Me.panel4.Size = New System.Drawing.Size(288, 128)
            Me.panel4.TabIndex = 40
            '
            ' cbEmbedImages
            '
            Me.cbEmbedImages.Location = New System.Drawing.Point(8, 91)
            Me.cbEmbedImages.Name = "cbEmbedImages"
            Me.cbEmbedImages.Size = New System.Drawing.Size(128, 28)
            Me.cbEmbedImages.TabIndex = 51
            Me.cbEmbedImages.Text = "Embed images"
            '
            ' sbSVG
            '
            Me.sbSVG.Location = New System.Drawing.Point(141, 91)
            Me.sbSVG.Name = "sbSVG"
            Me.sbSVG.Size = New System.Drawing.Size(139, 28)
            Me.sbSVG.TabIndex = 50
            Me.sbSVG.Text = "Export images as SVG"
            '
            ' label9
            '
            Me.label9.Font = New System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (CByte(0)))
            Me.label9.Location = New System.Drawing.Point(8, 8)
            Me.label9.Name = "label9"
            Me.label9.Size = New System.Drawing.Size(192, 16)
            Me.label9.TabIndex = 49
            Me.label9.Text = "HTML Version"
            '
            ' cbFileFormat
            '
            Me.cbFileFormat.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
            Me.cbFileFormat.Items.AddRange(New Object() { "HTML", "MHTML"})
            Me.cbFileFormat.Location = New System.Drawing.Point(8, 64)
            Me.cbFileFormat.Name = "cbFileFormat"
            Me.cbFileFormat.Size = New System.Drawing.Size(272, 21)
            Me.cbFileFormat.TabIndex = 48
            '
            ' cbHtmlVersion
            '
            Me.cbHtmlVersion.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
            Me.cbHtmlVersion.Items.AddRange(New Object() { "HTML 3.2", "HTML 4.01", "XHTML 1.1", "HTML 5"})
            Me.cbHtmlVersion.Location = New System.Drawing.Point(8, 24)
            Me.cbHtmlVersion.Name = "cbHtmlVersion"
            Me.cbHtmlVersion.Size = New System.Drawing.Size(272, 21)
            Me.cbHtmlVersion.TabIndex = 47
            '
            ' label4
            '
            Me.label4.Font = New System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (CByte(0)))
            Me.label4.Location = New System.Drawing.Point(5, 48)
            Me.label4.Name = "label4"
            Me.label4.Size = New System.Drawing.Size(192, 16)
            Me.label4.TabIndex = 19
            Me.label4.Text = "File Format:"
            '
            ' panel3
            '
            Me.panel3.Anchor = (CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.panel3.BackColor = System.Drawing.Color.FromArgb((CInt((CByte(255)))), (CInt((CByte(255)))), (CInt((CByte(192)))))
            Me.panel3.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
            Me.panel3.Controls.Add(Me.edBottom)
            Me.panel3.Controls.Add(Me.label17)
            Me.panel3.Controls.Add(Me.edRight)
            Me.panel3.Controls.Add(Me.label16)
            Me.panel3.Controls.Add(Me.edLeft)
            Me.panel3.Controls.Add(Me.label15)
            Me.panel3.Controls.Add(Me.edTop)
            Me.panel3.Controls.Add(Me.label14)
            Me.panel3.Controls.Add(Me.label13)
            Me.panel3.Controls.Add(Me.label12)
            Me.panel3.Location = New System.Drawing.Point(528, 130)
            Me.panel3.Name = "panel3"
            Me.panel3.Size = New System.Drawing.Size(208, 200)
            Me.panel3.TabIndex = 30
            '
            ' edBottom
            '
            Me.edBottom.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
            Me.edBottom.Location = New System.Drawing.Point(80, 136)
            Me.edBottom.Name = "edBottom"
            Me.edBottom.Size = New System.Drawing.Size(48, 20)
            Me.edBottom.TabIndex = 26
            Me.edBottom.Text = "0"
            '
            ' label17
            '
            Me.label17.Font = New System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (CByte(0)))
            Me.label17.Location = New System.Drawing.Point(16, 160)
            Me.label17.Name = "label17"
            Me.label17.Size = New System.Drawing.Size(56, 16)
            Me.label17.TabIndex = 25
            Me.label17.Text = "Last Col:"
            '
            ' edRight
            '
            Me.edRight.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
            Me.edRight.Location = New System.Drawing.Point(80, 160)
            Me.edRight.Name = "edRight"
            Me.edRight.Size = New System.Drawing.Size(48, 20)
            Me.edRight.TabIndex = 24
            Me.edRight.Text = "0"
            '
            ' label16
            '
            Me.label16.Font = New System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (CByte(0)))
            Me.label16.Location = New System.Drawing.Point(16, 136)
            Me.label16.Name = "label16"
            Me.label16.Size = New System.Drawing.Size(85, 16)
            Me.label16.TabIndex = 23
            Me.label16.Text = "Last Row:"
            '
            ' edLeft
            '
            Me.edLeft.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
            Me.edLeft.Location = New System.Drawing.Point(80, 112)
            Me.edLeft.Name = "edLeft"
            Me.edLeft.Size = New System.Drawing.Size(48, 20)
            Me.edLeft.TabIndex = 22
            Me.edLeft.Text = "0"
            '
            ' label15
            '
            Me.label15.Font = New System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (CByte(0)))
            Me.label15.Location = New System.Drawing.Point(16, 112)
            Me.label15.Name = "label15"
            Me.label15.Size = New System.Drawing.Size(85, 16)
            Me.label15.TabIndex = 21
            Me.label15.Text = "First Col:"
            '
            ' edTop
            '
            Me.edTop.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
            Me.edTop.Location = New System.Drawing.Point(80, 88)
            Me.edTop.Name = "edTop"
            Me.edTop.Size = New System.Drawing.Size(48, 20)
            Me.edTop.TabIndex = 20
            Me.edTop.Text = "0"
            '
            ' label14
            '
            Me.label14.Font = New System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (CByte(0)))
            Me.label14.Location = New System.Drawing.Point(16, 88)
            Me.label14.Name = "label14"
            Me.label14.Size = New System.Drawing.Size(85, 16)
            Me.label14.TabIndex = 3
            Me.label14.Text = "First Row:"
            '
            ' label13
            '
            Me.label13.Anchor = (CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.label13.Font = New System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, (CByte(0)))
            Me.label13.Location = New System.Drawing.Point(8, 32)
            Me.label13.Name = "label13"
            Me.label13.Size = New System.Drawing.Size(184, 32)
            Me.label13.TabIndex = 2
            Me.label13.Text = "If any value is <=0 all print_range will be printed"
            '
            ' label12
            '
            Me.label12.Font = New System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (CByte(0)))
            Me.label12.Location = New System.Drawing.Point(8, 16)
            Me.label12.Name = "label12"
            Me.label12.Size = New System.Drawing.Size(192, 16)
            Me.label12.TabIndex = 1
            Me.label12.Text = "Range to Export:"
            '
            ' label1
            '
            Me.label1.Font = New System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (CByte(0)))
            Me.label1.Location = New System.Drawing.Point(40, 16)
            Me.label1.Name = "label1"
            Me.label1.Size = New System.Drawing.Size(80, 16)
            Me.label1.TabIndex = 0
            Me.label1.Text = "File to export:"
            '
            ' panel8
            '
            Me.panel8.BackColor = System.Drawing.Color.FromArgb((CInt((CByte(224)))), (CInt((CByte(224)))), (CInt((CByte(224)))))
            Me.panel8.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
            Me.panel8.Controls.Add(Me.chPrintHeadings)
            Me.panel8.Controls.Add(Me.label24)
            Me.panel8.Controls.Add(Me.chFormulaText)
            Me.panel8.Controls.Add(Me.chGridLines)
            Me.panel8.Location = New System.Drawing.Point(32, 130)
            Me.panel8.Name = "panel8"
            Me.panel8.Size = New System.Drawing.Size(176, 88)
            Me.panel8.TabIndex = 37
            '
            ' chPrintHeadings
            '
            Me.chPrintHeadings.Location = New System.Drawing.Point(16, 44)
            Me.chPrintHeadings.Name = "chPrintHeadings"
            Me.chPrintHeadings.Size = New System.Drawing.Size(144, 16)
            Me.chPrintHeadings.TabIndex = 20
            Me.chPrintHeadings.Text = "Print Headings"
            '
            ' label24
            '
            Me.label24.Font = New System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (CByte(0)))
            Me.label24.Location = New System.Drawing.Point(8, 8)
            Me.label24.Name = "label24"
            Me.label24.Size = New System.Drawing.Size(192, 16)
            Me.label24.TabIndex = 19
            Me.label24.Text = "Export Options:"
            '
            ' chFormulaText
            '
            Me.chFormulaText.Location = New System.Drawing.Point(16, 64)
            Me.chFormulaText.Name = "chFormulaText"
            Me.chFormulaText.Size = New System.Drawing.Size(136, 16)
            Me.chFormulaText.TabIndex = 17
            Me.chFormulaText.Text = "Print Formula Text"
            '
            ' chGridLines
            '
            Me.chGridLines.Location = New System.Drawing.Point(16, 24)
            Me.chGridLines.Name = "chGridLines"
            Me.chGridLines.Size = New System.Drawing.Size(128, 16)
            Me.chGridLines.TabIndex = 16
            Me.chGridLines.Text = "Print Grid Lines"
            '
            ' checkBox4
            '
            Me.checkBox4.Location = New System.Drawing.Point(0, 0)
            Me.checkBox4.Name = "checkBox4"
            Me.checkBox4.Size = New System.Drawing.Size(104, 24)
            Me.checkBox4.TabIndex = 0
            '
            ' exportDialog
            '
            Me.exportDialog.DefaultExt = "htm"
            Me.exportDialog.Filter = "HTML files|*.htm|MHTML files|*.mht"
            '
            ' flexCelHtmlExport1
            '
            Me.flexCelHtmlExport1.HeadingWidth = 50R
            Me.flexCelHtmlExport1.ImageResolution = 96R
            Me.flexCelHtmlExport1.UsePrintScale = False
            Me.flexCelHtmlExport1.Workbook = Nothing
'           Me.flexCelHtmlExport1.HtmlFont += New FlexCel.Core.HtmlFontEventHandler(Me.flexCelHtmlExport1_HtmlFont)
            '
            ' mainToolbar
            '
            Me.mainToolbar.ImageScalingSize = New System.Drawing.Size(24, 24)
            Me.mainToolbar.Items.AddRange(New System.Windows.Forms.ToolStripItem() { Me.openFile, Me.export, Me.btnEmail, Me.toolStripSeparator1, Me.btnClose})
            Me.mainToolbar.Location = New System.Drawing.Point(0, 0)
            Me.mainToolbar.Name = "mainToolbar"
            Me.mainToolbar.Size = New System.Drawing.Size(768, 31)
            Me.mainToolbar.TabIndex = 8
            '
            ' openFile
            '
            Me.openFile.Image = (CType(resources.GetObject("openFile.Image"), System.Drawing.Image))
            Me.openFile.ImageTransparentColor = System.Drawing.Color.Magenta
            Me.openFile.Name = "openFile"
            Me.openFile.Size = New System.Drawing.Size(85, 28)
            Me.openFile.Text = "Open File"
'           Me.openFile.Click += New System.EventHandler(Me.openFile_Click)
            '
            ' export
            '
            Me.export.Image = (CType(resources.GetObject("export.Image"), System.Drawing.Image))
            Me.export.ImageTransparentColor = System.Drawing.Color.Magenta
            Me.export.Name = "export"
            Me.export.Size = New System.Drawing.Size(118, 28)
            Me.export.Text = "Export as HTML"
'           Me.export.Click += New System.EventHandler(Me.export_Click)
            '
            ' btnEmail
            '
            Me.btnEmail.Image = (CType(resources.GetObject("btnEmail.Image"), System.Drawing.Image))
            Me.btnEmail.ImageTransparentColor = System.Drawing.Color.Magenta
            Me.btnEmail.Name = "btnEmail"
            Me.btnEmail.Size = New System.Drawing.Size(133, 28)
            Me.btnEmail.Text = "Email (as MHTML)"
'           Me.btnEmail.Click += New System.EventHandler(Me.btnEmail_Click)
            '
            ' toolStripSeparator1
            '
            Me.toolStripSeparator1.Name = "toolStripSeparator1"
            Me.toolStripSeparator1.Size = New System.Drawing.Size(6, 31)
            '
            ' btnClose
            '
            Me.btnClose.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right
            Me.btnClose.Image = (CType(resources.GetObject("btnClose.Image"), System.Drawing.Image))
            Me.btnClose.ImageTransparentColor = System.Drawing.Color.Magenta
            Me.btnClose.Name = "btnClose"
            Me.btnClose.Size = New System.Drawing.Size(53, 28)
            Me.btnClose.Text = "Exit"
'           Me.btnClose.Click += New System.EventHandler(Me.button2_Click)
            '
            ' mainForm
            '
            Me.AutoScaleDimensions = New System.Drawing.SizeF(6F, 13F)
            Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
            Me.ClientSize = New System.Drawing.Size(768, 696)
            Me.Controls.Add(Me.mainToolbar)
            Me.Controls.Add(Me.panel1)
            Me.Name = "mainForm"
            Me.Text = "Export an Excel file to HTML"
'           Me.Load += New System.EventHandler(Me.mainForm_Load)
            Me.panel1.ResumeLayout(False)
            Me.panel13.ResumeLayout(False)
            Me.panel13.PerformLayout()
            Me.panel12.ResumeLayout(False)
            Me.panel12.PerformLayout()
            Me.panel11.ResumeLayout(False)
            Me.panel11.PerformLayout()
            Me.panel10.ResumeLayout(False)
            Me.panel10.PerformLayout()
            Me.panel9.ResumeLayout(False)
            Me.panel7.ResumeLayout(False)
            Me.panel6.ResumeLayout(False)
            Me.panel5.ResumeLayout(False)
            Me.panel4.ResumeLayout(False)
            Me.panel3.ResumeLayout(False)
            Me.panel3.PerformLayout()
            Me.panel8.ResumeLayout(False)
            Me.mainToolbar.ResumeLayout(False)
            Me.mainToolbar.PerformLayout()
            Me.ResumeLayout(False)
            Me.PerformLayout()

        End Sub
        #End Region

        Private mainToolbar As ToolStrip
        Private WithEvents openFile As ToolStripButton
        Private WithEvents export As ToolStripButton
        Private WithEvents btnEmail As ToolStripButton
        Private toolStripSeparator1 As ToolStripSeparator
        Private WithEvents btnClose As ToolStripButton
        Private sbSVG As CheckBox
        Private cbEmbedImages As CheckBox
    End Class
End Namespace

Form1.vb

Imports System.Collections
Imports System.ComponentModel
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports FlexCel.Render
Imports System.IO

Imports System.Text

Namespace ExportHTML
    ''' <summary>
    ''' An Example on how to export to HTML.
    ''' </summary>
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Private WithEvents flexCelHtmlExport1 As FlexCel.Render.FlexCelHtmlExport

        Public Sub New()
            InitializeComponent()
        End Sub

        Private MailDialog As Mailform

        Private Sub button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnClose.Click
            Close()
        End Sub

        Private Sub LoadSheetConfig()
            Dim Xls As ExcelFile = flexCelHtmlExport1.Workbook

            chGridLines.Checked = Xls.PrintGridLines
            chPrintHeadings.Checked = Xls.PrintHeadings
            chFormulaText.Checked = Xls.ShowFormulaText
        End Sub

        Private Sub openFile_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles openFile.Click
            If openFileDialog1.ShowDialog() <> System.Windows.Forms.DialogResult.OK Then
                Return
            End If
            flexCelHtmlExport1.Workbook = New XlsFile()

            flexCelHtmlExport1.Workbook.Open(openFileDialog1.FileName)

            Text = "Export: " & openFileDialog1.FileName

            Dim Xls As ExcelFile = flexCelHtmlExport1.Workbook

            cbSheet.Items.Clear()
            For i As Integer = 1 To Xls.SheetCount
                cbSheet.Items.Add(Xls.GetSheetName(i))
            Next i
            cbSheet.SelectedIndex = Xls.ActiveSheet - 1

            LoadSheetConfig()
        End Sub

        Private Function HasFileOpen() As Boolean
            If flexCelHtmlExport1.Workbook Is Nothing Then
                MessageBox.Show("You need to open a file first.")
                Return False
            End If
            Return True
        End Function

        Private Function LoadPreferences() As Boolean
            'NOTE: THERE SHOULD BE *A LOT* MORE VALIDATION OF VALUES ON THIS METHOD. (For example, validate that margins are between bounds)
            ' As this is a simple demo, they are not included.
            Try
                Dim Xls As ExcelFile = flexCelHtmlExport1.Workbook

                'Note: In this demo we will only apply this things to the active sheet.
                'If you want to apply the settings to all the sheets, you should loop in the sheets and change them here.
                Xls.PrintGridLines = chGridLines.Checked
                Xls.PrintHeadings = chPrintHeadings.Checked
                Xls.ShowFormulaText = chFormulaText.Checked

                flexCelHtmlExport1.PrintRangeLeft = Convert.ToInt32(edLeft.Text)
                flexCelHtmlExport1.PrintRangeTop = Convert.ToInt32(edTop.Text)
                flexCelHtmlExport1.PrintRangeRight = Convert.ToInt32(edRight.Text)
                flexCelHtmlExport1.PrintRangeBottom = Convert.ToInt32(edBottom.Text)

                If sbSVG.Checked Then
                    flexCelHtmlExport1.SavedImagesFormat = THtmlImageFormat.Svg
                Else
                    flexCelHtmlExport1.SavedImagesFormat = THtmlImageFormat.Png
                End If
                flexCelHtmlExport1.EmbedImages = cbEmbedImages.Checked

                flexCelHtmlExport1.FixOutlook2007CssSupport = cbOutlook2007.Checked
                flexCelHtmlExport1.FixIE6TransparentPngSupport = cbIe6Png.Checked

                flexCelHtmlExport1.HidePrintObjects = THidePrintObjects.None
                If Not cbImages.Checked Then
                    flexCelHtmlExport1.HidePrintObjects = flexCelHtmlExport1.HidePrintObjects Or THidePrintObjects.Images
                End If
                If Not cbHyperlinks.Checked Then
                    flexCelHtmlExport1.HidePrintObjects = flexCelHtmlExport1.HidePrintObjects Or THidePrintObjects.Hyperlynks
                End If
                If Not cbComments.Checked Then
                    flexCelHtmlExport1.HidePrintObjects = flexCelHtmlExport1.HidePrintObjects Or THidePrintObjects.Comments
                End If
                If Not cbHeadersFooters.Checked Then
                    flexCelHtmlExport1.HidePrintObjects = flexCelHtmlExport1.HidePrintObjects Or THidePrintObjects.HeadersAndFooters
                End If

            Catch e As Exception
                MessageBox.Show("Error: " & e.Message)
                Return False
            End Try
            Return True
        End Function

        Private Sub cbSheet_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs)
            flexCelHtmlExport1.Workbook.ActiveSheet = cbSheet.SelectedIndex + 1
            LoadSheetConfig()
        End Sub

        Private Sub export_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles export.Click
            If Not HasFileOpen() Then
                Return
            End If
            If Not LoadPreferences() Then
                Return
            End If

            If cbFileFormat.SelectedIndex = 1 Then
                flexCelHtmlExport1.HtmlFileFormat = THtmlFileFormat.MHtml
                exportDialog.FilterIndex = 2
            Else
                flexCelHtmlExport1.HtmlFileFormat = THtmlFileFormat.Html
                exportDialog.FilterIndex = 1
            End If

            If exportDialog.ShowDialog() <> System.Windows.Forms.DialogResult.OK Then
                Return
            End If

            flexCelHtmlExport1.AllowOverwritingFiles = True

            Dim CssFileName As String = Nothing
            If cbCss.Checked Then
                CssFileName = edCss.Text
            End If

            Dim FileNameToOpen As String = exportDialog.FileName

            Select Case cbHtmlVersion.SelectedIndex
                Case 0
                    flexCelHtmlExport1.HtmlVersion = THtmlVersion.Html_32
                Case 2
                    flexCelHtmlExport1.HtmlVersion = THtmlVersion.XHTML_10
                Case 3
                    flexCelHtmlExport1.HtmlVersion = THtmlVersion.Html_5
                Case Else
                    flexCelHtmlExport1.HtmlVersion = THtmlVersion.Html_401
            End Select

            If edBodyStart.Text IsNot Nothing Then
                flexCelHtmlExport1.ExtraInfo.BodyStart = New String() { edBodyStart.Text }
            End If

            Select Case cbExportObject.SelectedIndex
                Case 0
                    Dim SelectorPosition As TSheetSelectorPosition = TSheetSelectorPosition.None

                    'If in VB.NET or Delphi.NET, use "if cbTop.Checked then SelectorPosition = SelectorPosition or TSheetSelectorPosition.Top"
                    If cbTop.Checked Then
                        SelectorPosition = SelectorPosition Or TSheetSelectorPosition.Top
                    End If
                    If cbLeft.Checked Then
                        SelectorPosition = SelectorPosition Or TSheetSelectorPosition.Left
                    End If
                    If cbBottom.Checked Then
                        SelectorPosition = SelectorPosition Or TSheetSelectorPosition.Bottom
                    End If
                    If cbRight.Checked Then
                        SelectorPosition = SelectorPosition Or TSheetSelectorPosition.Right
                    End If

                    flexCelHtmlExport1.ExportAllVisibleSheetsAsTabs(Path.GetDirectoryName(exportDialog.FileName), Path.GetFileNameWithoutExtension(exportDialog.FileName), Path.GetExtension(exportDialog.FileName), edImages.Text, CssFileName, New TStandardSheetSelector(SelectorPosition))

                    FileNameToOpen = Path.Combine(Path.GetDirectoryName(exportDialog.FileName), Path.GetFileNameWithoutExtension(exportDialog.FileName))
                    FileNameToOpen = Path.Combine(FileNameToOpen, flexCelHtmlExport1.Workbook.SheetName)
                    FileNameToOpen = Path.Combine(FileNameToOpen, Path.GetExtension(exportDialog.FileName))

                Case 1
                    flexCelHtmlExport1.ExportAllVisibleSheetsAsOneHtmlFile(exportDialog.FileName, edImages.Text, CssFileName, edSheetSeparator.Text)

                Case 2
                        flexCelHtmlExport1.Export(exportDialog.FileName, edImages.Text, CssFileName)
                        Exit Select
            End Select

            Dim GeneratedFiles() As String = flexCelHtmlExport1.GeneratedFiles.GetHtmlFiles()
            If GeneratedFiles.Length = 0 Then
                MessageBox.Show("Error: No file has been generated")
            Else
                If MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) = System.Windows.Forms.DialogResult.Yes Then
                    Process.Start(GeneratedFiles(0))
                End If
            End If
        End Sub

        Private Sub btnEmail_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnEmail.Click
            If Not HasFileOpen() Then
                Return
            End If
            If MailDialog Is Nothing Then
                MailDialog = New Mailform()
            End If
            MailDialog.MainForm = Me

            If Not flexCelHtmlExport1.FixOutlook2007CssSupport Then
                Dim dr As DialogResult = MessageBox.Show("You have not checked ""Outlook 2007 support"". If any of your clients has Outlook express, you should turn this on." & vbLf & vbLf & "Use Outlook 2007 fix?", "Warning", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Warning)

                If dr = System.Windows.Forms.DialogResult.Cancel Then
                    Return
                End If
                If dr = System.Windows.Forms.DialogResult.Yes Then
                    cbOutlook2007.Checked = True
                    flexCelHtmlExport1.FixOutlook2007CssSupport = True
                End If
            End If

            MailDialog.ShowDialog()

        End Sub

        Public Function GenerateMHTML() As Byte()
            LoadPreferences()
            flexCelHtmlExport1.HtmlFileFormat = THtmlFileFormat.MHtml

            flexCelHtmlExport1.AllowOverwritingFiles = True

            flexCelHtmlExport1.HtmlVersion = THtmlVersion.Html_401

            If edBodyStart.Text IsNot Nothing Then
                flexCelHtmlExport1.ExtraInfo.BodyStart = New String() { edBodyStart.Text }
            End If

            Using ms As New MemoryStream()
                Using writer As New StreamWriter(ms, Encoding.UTF8)
                    flexCelHtmlExport1.Export(writer, flexCelHtmlExport1.Workbook.ActiveFileName, Nothing)
                End Using
                Return ms.ToArray()
            End Using
        End Function

        Private Sub mainForm_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
            cbExportObject.SelectedIndex = 0
            cbHtmlVersion.SelectedIndex = 3
            cbFileFormat.SelectedIndex = 0
        End Sub

        Private Sub cbExportObject_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles cbExportObject.SelectedIndexChanged
            edSheetSeparator.Enabled = cbExportObject.SelectedIndex = 1
            cbTop.Enabled = cbExportObject.SelectedIndex = 0
            cbLeft.Enabled = cbExportObject.SelectedIndex = 0
            cbRight.Enabled = cbExportObject.SelectedIndex = 0
            cbBottom.Enabled = cbExportObject.SelectedIndex = 0
            cbSheet.Enabled = cbExportObject.SelectedIndex = 2
        End Sub

        Private Sub cbCss_CheckedChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles cbCss.CheckedChanged
            edCss.Enabled = cbCss.Checked
        End Sub

        Private Sub flexCelHtmlExport1_HtmlFont(ByVal sender As Object, ByVal e As FlexCel.Core.HtmlFontEventArgs) Handles flexCelHtmlExport1.HtmlFont
            If cbReplaceFonts.Checked Then
                e.FontFamily = "arial, sans-serif"
            End If
        End Sub

    End Class
End Namespace

Mailform.Designer.vb

Imports System.Collections
Imports System.ComponentModel
Imports FlexCel.Core
Imports System.Text
Namespace ExportHTML
    Partial Public Class Mailform
        Inherits System.Windows.Forms.Form

        Private WithEvents btnEmail As System.Windows.Forms.Button
        Private edOutServer As System.Windows.Forms.TextBox
        Private label2 As System.Windows.Forms.Label
        Private WithEvents edTo As System.Windows.Forms.TextBox
        Private label3 As System.Windows.Forms.Label
        Private WithEvents edFrom As System.Windows.Forms.TextBox
        Private label4 As System.Windows.Forms.Label
        Private edSubject As System.Windows.Forms.TextBox
        Private label5 As System.Windows.Forms.Label
        ''' <summary>
        ''' Required designer variable.
        ''' </summary>
        Private components As System.ComponentModel.Container = Nothing

        ''' <summary>
        ''' Clean up any resources being used.
        ''' </summary>
        Protected Overrides Sub Dispose(ByVal disposing As Boolean)
            If disposing Then
                If components IsNot Nothing Then
                    components.Dispose()
                End If
            End If
            MyBase.Dispose(disposing)
        End Sub

        #Region "Windows Form Designer generated code"
        ''' <summary>
        ''' Required method for Designer support - do not modify
        ''' the contents of this method with the code editor.
        ''' </summary>
        Private Sub InitializeComponent()
            Dim resources As New System.ComponentModel.ComponentResourceManager(GetType(Mailform))
            Me.btnEmail = New System.Windows.Forms.Button()
            Me.edOutServer = New System.Windows.Forms.TextBox()
            Me.label2 = New System.Windows.Forms.Label()
            Me.edTo = New System.Windows.Forms.TextBox()
            Me.label3 = New System.Windows.Forms.Label()
            Me.edFrom = New System.Windows.Forms.TextBox()
            Me.label4 = New System.Windows.Forms.Label()
            Me.edSubject = New System.Windows.Forms.TextBox()
            Me.label5 = New System.Windows.Forms.Label()
            Me.SuspendLayout()
            '
            ' btnEmail
            '
            Me.btnEmail.BackColor = System.Drawing.SystemColors.Control
            Me.btnEmail.Image = (CType(resources.GetObject("btnEmail.Image"), System.Drawing.Image))
            Me.btnEmail.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft
            Me.btnEmail.Location = New System.Drawing.Point(200, 200)
            Me.btnEmail.Name = "btnEmail"
            Me.btnEmail.Size = New System.Drawing.Size(70, 30)
            Me.btnEmail.TabIndex = 4
            Me.btnEmail.Text = "e-mail!"
            Me.btnEmail.TextAlign = System.Drawing.ContentAlignment.MiddleRight
            Me.btnEmail.UseVisualStyleBackColor = False
'           Me.btnEmail.Click += New System.EventHandler(Me.btnEmail_Click)
            '
            ' edOutServer
            '
            Me.edOutServer.Anchor = (CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.edOutServer.Location = New System.Drawing.Point(136, 144)
            Me.edOutServer.Name = "edOutServer"
            Me.edOutServer.Size = New System.Drawing.Size(304, 20)
            Me.edOutServer.TabIndex = 3
            Me.edOutServer.Text = "pop.mycompany.com"
            '
            ' label2
            '
            Me.label2.Location = New System.Drawing.Point(8, 152)
            Me.label2.Name = "label2"
            Me.label2.Size = New System.Drawing.Size(128, 16)
            Me.label2.TabIndex = 10
            Me.label2.Text = "Outgoing Mail Server:"
            '
            ' edTo
            '
            Me.edTo.Anchor = (CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.edTo.Location = New System.Drawing.Point(136, 40)
            Me.edTo.Name = "edTo"
            Me.edTo.Size = New System.Drawing.Size(304, 20)
            Me.edTo.TabIndex = 1
            Me.edTo.Text = "user@hiscompany.com"
'           Me.edTo.Leave += New System.EventHandler(Me.edTo_Leave)
            '
            ' label3
            '
            Me.label3.Location = New System.Drawing.Point(16, 40)
            Me.label3.Name = "label3"
            Me.label3.Size = New System.Drawing.Size(128, 16)
            Me.label3.TabIndex = 14
            Me.label3.Text = "To:"
            '
            ' edFrom
            '
            Me.edFrom.Anchor = (CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.edFrom.Location = New System.Drawing.Point(136, 8)
            Me.edFrom.Name = "edFrom"
            Me.edFrom.Size = New System.Drawing.Size(304, 20)
            Me.edFrom.TabIndex = 0
            Me.edFrom.Text = "myname@mycompany.com"
'           Me.edFrom.Leave += New System.EventHandler(Me.edFrom_Leave)
            '
            ' label4
            '
            Me.label4.Location = New System.Drawing.Point(16, 16)
            Me.label4.Name = "label4"
            Me.label4.Size = New System.Drawing.Size(120, 16)
            Me.label4.TabIndex = 12
            Me.label4.Text = "From:"
            '
            ' edSubject
            '
            Me.edSubject.Anchor = (CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.edSubject.Location = New System.Drawing.Point(136, 80)
            Me.edSubject.Name = "edSubject"
            Me.edSubject.Size = New System.Drawing.Size(304, 20)
            Me.edSubject.TabIndex = 2
            Me.edSubject.Text = "A test from FlexCel"
            '
            ' label5
            '
            Me.label5.Location = New System.Drawing.Point(16, 80)
            Me.label5.Name = "label5"
            Me.label5.Size = New System.Drawing.Size(128, 16)
            Me.label5.TabIndex = 16
            Me.label5.Text = "Subject:"
            '
            ' Mailform
            '
            Me.AutoScaleDimensions = New System.Drawing.SizeF(6F, 13F)
            Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
            Me.ClientSize = New System.Drawing.Size(472, 246)
            Me.Controls.Add(Me.edSubject)
            Me.Controls.Add(Me.edTo)
            Me.Controls.Add(Me.edFrom)
            Me.Controls.Add(Me.edOutServer)
            Me.Controls.Add(Me.label5)
            Me.Controls.Add(Me.label3)
            Me.Controls.Add(Me.label4)
            Me.Controls.Add(Me.label2)
            Me.Controls.Add(Me.btnEmail)
            Me.Name = "Mailform"
            Me.ShowInTaskbar = False
            Me.Text = "Send email..."
            Me.ResumeLayout(False)
            Me.PerformLayout()

        End Sub
        #End Region
    End Class
End Namespace

Mailform.vb

Imports System.Collections
Imports System.ComponentModel

Imports FlexCel.Core
Imports System.Text

Namespace ExportHTML
    ''' <summary>
    ''' Used for mailing.
    ''' </summary>
    Partial Public Class Mailform
        Inherits System.Windows.Forms.Form

        Private OriginalTo As String
        Private OriginalFrom As String
        Private OriginalServer As String

        Public Sub New()
            InitializeComponent()

            OriginalTo = edTo.Text
            OriginalFrom = edFrom.Text
            OriginalServer = edOutServer.Text
        End Sub

        Public MainForm As mainForm

        Private Function ValidateFields() As Boolean
            If OriginalTo = edTo.Text Then
                MessageBox.Show("Please change the 'TO' field to the user you want to send the email")
                edTo.Focus()
                Return False
            End If

            If OriginalFrom = edFrom.Text Then
                MessageBox.Show("Please change the 'From' field to the user you are using to send the email")
                edFrom.Focus()
                Return False
            End If

            If OriginalServer = edOutServer.Text Then
                MessageBox.Show("Please change the 'Outgoing Mail Server' field to the pop3 server you will use to send the email.")
                edOutServer.Focus()
                Return False
            End If

            Return True

        End Function

        Private Sub btnEmail_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnEmail.Click
            If Not ValidateFields() Then
                Return
            End If

            If MessageBox.Show("Now we will try to send the email using the server '" & edOutServer.Text & "'" & vbLf & "Note that this is a very simple implementation, and it will not work if the SMTP server needs to login." & vbLf & "For this to work, you need a mail server that authenticates when reading the email, and then login into your normal account with your normal mail reader." & vbLf & vbLf & "If you need to authenticate in order to send mail, you will need to modify this code.", "Information", MessageBoxButtons.OKCancel, MessageBoxIcon.Information) <> System.Windows.Forms.DialogResult.OK Then
                Return
            End If

            Dim Mailer As New SimpleMailer()

            Mailer.FromAddress = edFrom.Text
            Mailer.ToAddress = edTo.Text
            Mailer.Subject = edSubject.Text
            Mailer.HostName = edOutServer.Text
            Mailer.Port = 25

            Try
                Mailer.SendMail(MainForm.GenerateMHTML())
            Catch ex As Exception
                MessageBox.Show("Error trying to send the message: " & ex.Message)
                Return
            End Try

            MessageBox.Show("Message has been sent. Please verify your JUNK folder or any filters, since it might be filtered as spam")
            Close()
        End Sub

        Private Sub edFrom_Leave(ByVal sender As Object, ByVal e As System.EventArgs) Handles edFrom.Leave
            If OriginalTo = edTo.Text AndAlso OriginalFrom <> edFrom.Text Then
                edTo.Text = edFrom.Text
            End If
            FillServer()
        End Sub

        Private Sub FillServer()
            If OriginalServer = edOutServer.Text AndAlso OriginalFrom <> edFrom.Text Then
                Dim AtPos As Integer = edFrom.Text.IndexOf("@")
                If AtPos > 0 Then
                    Dim Server As String = edFrom.Text.Substring(AtPos + 1)
                    edOutServer.Text = "mail." & Server
                End If
            End If
        End Sub
        Private Sub edTo_Leave(ByVal sender As Object, ByVal e As System.EventArgs) Handles edTo.Leave
            If OriginalFrom = edFrom.Text AndAlso OriginalTo <> edTo.Text Then
                edFrom.Text = edTo.Text
            End If
            FillServer()

        End Sub

    End Class
End Namespace

Program.vb

Namespace ExportHTML
    Friend NotInheritable Class Program

        Private Sub New()
        End Sub

        ''' <summary>
        ''' The main entry point for the application.
        ''' </summary>
       <STAThread> _
        Shared Sub Main()
            Application.EnableVisualStyles()
            Application.SetCompatibleTextRenderingDefault(False)
            Application.Run(New mainForm())
        End Sub
    End Class
End Namespace

SimpleMailer.vb

Imports System.Net.Sockets
Imports System.IO
Imports System.Threading

Imports System.Globalization
Imports System.Text

Namespace ExportHTML
    ''' <summary>
    ''' IMPORTANT: This is a really simple SMTP implementation, and it is not indented to be used in production.
    ''' It is just mean to be use on this simple demo, as we cannot use third party solutions here.
    ''' You are advised to get a third party solution if you want to implement this in your application.
    ''' This code is based directly in RFC 2821: http://www.faqs.org/rfcs/rfc2821.html
    ''' </summary>
    Public Class SimpleMailer
        #Region "privates"
        Private FHostName As String
        Private FPort As Integer

        Private FToAddress As String
        Private FFromAddress As String
        Private FSubject As String
        #End Region

        #Region "Public properties"
        Public Property HostName() As String
            Get
                Return FHostName
            End Get
            Set(ByVal value As String)
                FHostName = value
            End Set
        End Property
        Public Property Port() As Integer
            Get
                Return FPort
            End Get
            Set(ByVal value As Integer)
                FPort = value
            End Set
        End Property
        Public Property ToAddress() As String
            Get
                Return FToAddress
            End Get
            Set(ByVal value As String)
                FToAddress = value
            End Set
        End Property
        Public Property FromAddress() As String
            Get
                Return FFromAddress
            End Get
            Set(ByVal value As String)
                FFromAddress = value
            End Set
        End Property
        Public Property Subject() As String
            Get
                Return FSubject
            End Get
            Set(ByVal value As String)
                FSubject = value
            End Set
        End Property
        #End Region

        Public Sub New()
            Port = 25
        End Sub

        Public Sub SendMail(ByVal MessageData() As Byte)
            Using Tcp As New TcpClient(HostName, Port)
                Using Channel As NetworkStream = Tcp.GetStream()
                    Try
                        WaitForAnswer(Channel, 220)
                        WriteCommand(Channel, "EHLO " & HostName)
                        WaitForAnswer(Channel, 250)

                        WriteCommand(Channel, "MAIL FROM:<" & FromAddress & ">")
                        WaitForAnswer(Channel, 250)
                        WriteCommand(Channel, "RCPT TO:<" & ToAddress & ">")
                        WaitForAnswer(Channel, 250)

                        WriteCommand(Channel, "DATA")
                        WaitForAnswer(Channel, 354)
                        SendMessage(Channel, MessageData)
                        WaitForAnswer(Channel, 250)

                    Catch e1 As SimpleMailerException
                        'Quit must always be performed.
                        WriteCommand(Channel, "QUIT")
                        WaitForAnswer(Channel, 221)
                        Return
                    End Try

                    WriteCommand(Channel, "QUIT")
                    WaitForAnswer(Channel, 221)

                End Using
            End Using
        End Sub

        Public Sub WaitForAnswer(ByVal Channel As NetworkStream, ByVal AnswerCode As Integer)
            Dim ReadBuffer(1023) As Byte
            Dim Message As String = ""
            Dim numberOfBytesRead As Integer = 0

            ' Incoming message may be larger than the buffer size.
            Do
                numberOfBytesRead = Channel.Read(ReadBuffer, 0, ReadBuffer.Length)
                Message &= Encoding.ASCII.GetString(ReadBuffer, 0, numberOfBytesRead)
            Loop While Channel.DataAvailable

            If Message.StartsWith(AnswerCode.ToString(CultureInfo.InvariantCulture)) Then
                Return
            End If

            Throw New SimpleMailerException("Error sending email. Answer from the server: " & Message)
        End Sub

        Public Sub WriteCommand(ByVal Channel As NetworkStream, ByVal Command As String)
            Dim WriteBuffer() As Byte = Encoding.ASCII.GetBytes(Command & vbCrLf) 'do not use Environment.NewLine here, since this is invariant and defined in the RFC
            Channel.Write(WriteBuffer, 0, WriteBuffer.Length)
        End Sub

        Public Sub SendMessage(ByVal Channel As NetworkStream, ByVal MessageData() As Byte)
            WriteCommand(Channel, "From: " & FromAddress)
            WriteCommand(Channel, "To: " & ToAddress)
            WriteCommand(Channel, "Subject: " & Subject)
            WriteCommand(Channel, "Date: " & Date.Now.ToUniversalTime().ToString("r", CultureInfo.InvariantCulture))

            WriteEscapedData(Channel, MessageData)
            WriteCommand(Channel, vbCrLf & ".") 'do not use Environment.NewLine here, since this is invariant and defined in the RFC
        End Sub

        ''' <summary>
        ''' In order to send the data trough the channel, we need to detect any dot at the start of a line and replace it by ".."
        ''' If not, it might be interpreted as an EOF sign. We can easily loop in the MessageData array, since it only contains ASCII characters, so there are no
        ''' unicode colation issues.
        ''' </summary>
        ''' <param name="Channel"></param>
        ''' <param name="MessageData"></param>
        Public Sub WriteEscapedData(ByVal Channel As NetworkStream, ByVal MessageData() As Byte)
            If MessageData.Length > 0 Then
                If MessageData(0) = AscW("."c) Then
                    Channel.WriteByte(AscW("."c))
                End If
                Channel.WriteByte(MessageData(0))
            End If

            For i As Integer = 1 To MessageData.Length - 1
                    If MessageData(i - 1) = AscW(ControlChars.Lf) AndAlso MessageData(i) = AscW("."c) Then
                    Channel.WriteByte(AscW("."c))
                End If
                Channel.WriteByte(MessageData(i))
            Next i
        End Sub

    End Class

    Public Class SimpleMailerException
        Inherits IOException

        Public Sub New(ByVal Message As String)
            MyBase.New(Message)

        End Sub
    End Class
End Namespace


Exporting Excel files to SVG (VB.Net / netframework) | FlexCel Studio for the .NET Framework documentation

Exporting Excel files to SVG (VB.Net / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\vb\VS2022\netframework\25.Printing and Exporting\42.Export SVG and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​vb/​VS2022/​netframework/​Modules/​25.​Printing and Exporting/42.Export SVG

Overview

FlexCel can natively export an Excel file to SVG (Scalar Vector Graphics)

Concepts

  • When exporting to SVG you are going to get an image per page exported, so we use an action to notify the correct filename for each page.

Files

AssemblyInfo.vb

Imports System.Reflection
Imports System.Runtime.CompilerServices

'
' General Information about an assembly is controlled through the following
' set of attributes. Change these attribute values to modify the information
' associated with an assembly.
'
<Assembly: AssemblyTitle("")>
<Assembly: AssemblyDescription("")>
<Assembly: AssemblyConfiguration("")>
<Assembly: AssemblyCompany("")>
<Assembly: AssemblyProduct("")>
<Assembly: AssemblyCopyright("(c) 2002 - 2014 TMS Software")>
<Assembly: AssemblyTrademark("")>
<Assembly: AssemblyCulture("")>

'
' Version information for an assembly consists of the following four values:
'
'      Major Version
'      Minor Version
'      Build Number
'      Revision
'
' You can specify all the values or you can default the Revision and Build Numbers
' by using the '*' as shown below:

<Assembly: AssemblyVersion("6.2.1.0")>

'
' In order to sign your assembly you must specify a key to use. Refer to the
' Microsoft .NET Framework documentation for more information on assembly signing.
'
' Use the attributes below to control which key is used for signing.
'
' Notes:
'   (*) If no key is specified, the assembly is not signed.
'   (*) KeyName refers to a key that has been installed in the Crypto Service
'       Provider (CSP) on your machine. KeyFile refers to a file which contains
'       a key.
'   (*) If the KeyFile and the KeyName values are both specified, the
'       following processing occurs:
'       (1) If the KeyName can be found in the CSP, that key is used.
'       (2) If the KeyName does not exist and the KeyFile does exist, the key
'           in the KeyFile is installed into the CSP and used.
'   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
'       When specifying the KeyFile, the location of the KeyFile should be
'       relative to the project output directory which is
'       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
'       located in the project directory, you would specify the AssemblyKeyFile
'       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
'   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
'       documentation for more information on this.
'
<Assembly: AssemblyDelaySign(False)>
<Assembly: AssemblyKeyFile("")>
<Assembly: AssemblyKeyName("")>

Form1.Designer.vb

Imports System.Collections
Imports System.ComponentModel
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports FlexCel.Render
Imports System.IO
Imports System.Text
Namespace ExportSVG
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Private openFileDialog1 As System.Windows.Forms.OpenFileDialog
        Private panel1 As System.Windows.Forms.Panel
        Private label1 As System.Windows.Forms.Label
        Private panel3 As System.Windows.Forms.Panel
        Private label12 As System.Windows.Forms.Label
        Private label13 As System.Windows.Forms.Label
        Private label14 As System.Windows.Forms.Label
        Private edTop As System.Windows.Forms.TextBox
        Private edLeft As System.Windows.Forms.TextBox
        Private label15 As System.Windows.Forms.Label
        Private edRight As System.Windows.Forms.TextBox
        Private label16 As System.Windows.Forms.Label
        Private edBottom As System.Windows.Forms.TextBox
        Private label17 As System.Windows.Forms.Label
        Private exportDialog As System.Windows.Forms.SaveFileDialog
        Private panel8 As System.Windows.Forms.Panel
        Private chFormulaText As System.Windows.Forms.CheckBox
        Private chGridLines As System.Windows.Forms.CheckBox
        Private label24 As System.Windows.Forms.Label
        Private panel6 As System.Windows.Forms.Panel
        Private label6 As System.Windows.Forms.Label
        Private checkBox4 As System.Windows.Forms.CheckBox
        Private cbComments As System.Windows.Forms.CheckBox
        Private cbHyperlinks As System.Windows.Forms.CheckBox
        Private cbImages As System.Windows.Forms.CheckBox
        Private panel7 As System.Windows.Forms.Panel
        Private label2 As System.Windows.Forms.Label
        Private WithEvents cbExportObject As System.Windows.Forms.ComboBox
        Private lblSheetToExport As System.Windows.Forms.Label
        Private cbSheet As System.Windows.Forms.ComboBox
        Private chPrintHeadings As System.Windows.Forms.CheckBox
        Private cbHeadersFooters As System.Windows.Forms.CheckBox
        Private components As System.ComponentModel.IContainer = Nothing

        ''' <summary>
        ''' Clean up any resources being used.
        ''' </summary>
        Protected Overrides Sub Dispose(ByVal disposing As Boolean)
            If disposing Then
                If components IsNot Nothing Then
                    components.Dispose()
                End If
            End If
            MyBase.Dispose(disposing)
        End Sub

        #Region "Windows Form Designer generated code"
        ''' <summary>
        ''' Required method for Designer support - do not modify
        ''' the contents of this method with the code editor.
        ''' </summary>
        Private Sub InitializeComponent()
            Dim resources As New System.ComponentModel.ComponentResourceManager(GetType(mainForm))
            Me.openFileDialog1 = New System.Windows.Forms.OpenFileDialog()
            Me.panel1 = New System.Windows.Forms.Panel()
            Me.panel7 = New System.Windows.Forms.Panel()
            Me.cbExportObject = New System.Windows.Forms.ComboBox()
            Me.lblSheetToExport = New System.Windows.Forms.Label()
            Me.cbSheet = New System.Windows.Forms.ComboBox()
            Me.label2 = New System.Windows.Forms.Label()
            Me.panel6 = New System.Windows.Forms.Panel()
            Me.cbHeadersFooters = New System.Windows.Forms.CheckBox()
            Me.cbImages = New System.Windows.Forms.CheckBox()
            Me.cbHyperlinks = New System.Windows.Forms.CheckBox()
            Me.cbComments = New System.Windows.Forms.CheckBox()
            Me.label6 = New System.Windows.Forms.Label()
            Me.panel3 = New System.Windows.Forms.Panel()
            Me.edBottom = New System.Windows.Forms.TextBox()
            Me.label17 = New System.Windows.Forms.Label()
            Me.edRight = New System.Windows.Forms.TextBox()
            Me.label16 = New System.Windows.Forms.Label()
            Me.edLeft = New System.Windows.Forms.TextBox()
            Me.label15 = New System.Windows.Forms.Label()
            Me.edTop = New System.Windows.Forms.TextBox()
            Me.label14 = New System.Windows.Forms.Label()
            Me.label13 = New System.Windows.Forms.Label()
            Me.label12 = New System.Windows.Forms.Label()
            Me.label1 = New System.Windows.Forms.Label()
            Me.panel8 = New System.Windows.Forms.Panel()
            Me.chPrintHeadings = New System.Windows.Forms.CheckBox()
            Me.label24 = New System.Windows.Forms.Label()
            Me.chFormulaText = New System.Windows.Forms.CheckBox()
            Me.chGridLines = New System.Windows.Forms.CheckBox()
            Me.checkBox4 = New System.Windows.Forms.CheckBox()
            Me.exportDialog = New System.Windows.Forms.SaveFileDialog()
            Me.mainToolbar = New System.Windows.Forms.ToolStrip()
            Me.openFile = New System.Windows.Forms.ToolStripButton()
            Me.export = New System.Windows.Forms.ToolStripButton()
            Me.btnClose = New System.Windows.Forms.ToolStripButton()
            Me.panel1.SuspendLayout()
            Me.panel7.SuspendLayout()
            Me.panel6.SuspendLayout()
            Me.panel3.SuspendLayout()
            Me.panel8.SuspendLayout()
            Me.mainToolbar.SuspendLayout()
            Me.SuspendLayout()
            '
            ' openFileDialog1
            '
            Me.openFileDialog1.DefaultExt = "xls"
            Me.openFileDialog1.Filter = "Excel Files|*.xls;*.xlsx;*.xlsm|Excel 97/2003|*.xls|Excel 2007|*.xlsx;*.xlsm|All " & "files|*.*"
            Me.openFileDialog1.Title = "Open an Excel File"
            '
            ' panel1
            '
            Me.panel1.BackColor = System.Drawing.Color.White
            Me.panel1.Controls.Add(Me.panel7)
            Me.panel1.Controls.Add(Me.panel6)
            Me.panel1.Controls.Add(Me.panel3)
            Me.panel1.Controls.Add(Me.label1)
            Me.panel1.Controls.Add(Me.panel8)
            Me.panel1.Dock = System.Windows.Forms.DockStyle.Fill
            Me.panel1.Location = New System.Drawing.Point(0, 0)
            Me.panel1.Name = "panel1"
            Me.panel1.Size = New System.Drawing.Size(768, 268)
            Me.panel1.TabIndex = 3
            '
            ' panel7
            '
            Me.panel7.Anchor = (CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.panel7.BackColor = System.Drawing.Color.FromArgb((CInt((CByte(224)))), (CInt((CByte(224)))), (CInt((CByte(224)))))
            Me.panel7.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
            Me.panel7.Controls.Add(Me.cbExportObject)
            Me.panel7.Controls.Add(Me.lblSheetToExport)
            Me.panel7.Controls.Add(Me.cbSheet)
            Me.panel7.Controls.Add(Me.label2)
            Me.panel7.Location = New System.Drawing.Point(32, 52)
            Me.panel7.Name = "panel7"
            Me.panel7.Size = New System.Drawing.Size(328, 200)
            Me.panel7.TabIndex = 44
            '
            ' cbExportObject
            '
            Me.cbExportObject.Anchor = (CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.cbExportObject.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
            Me.cbExportObject.Items.AddRange(New Object() { "All sheets", "Active Sheet:"})
            Me.cbExportObject.Location = New System.Drawing.Point(8, 32)
            Me.cbExportObject.Name = "cbExportObject"
            Me.cbExportObject.Size = New System.Drawing.Size(293, 21)
            Me.cbExportObject.TabIndex = 46
'           Me.cbExportObject.SelectedIndexChanged += New System.EventHandler(Me.cbExportObject_SelectedIndexChanged)
            '
            ' lblSheetToExport
            '
            Me.lblSheetToExport.Font = New System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (CByte(0)))
            Me.lblSheetToExport.Location = New System.Drawing.Point(8, 66)
            Me.lblSheetToExport.Name = "lblSheetToExport"
            Me.lblSheetToExport.Size = New System.Drawing.Size(96, 16)
            Me.lblSheetToExport.TabIndex = 45
            Me.lblSheetToExport.Text = "Sheet to export:"
            '
            ' cbSheet
            '
            Me.cbSheet.Anchor = (CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.cbSheet.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
            Me.cbSheet.Location = New System.Drawing.Point(8, 82)
            Me.cbSheet.Name = "cbSheet"
            Me.cbSheet.Size = New System.Drawing.Size(294, 21)
            Me.cbSheet.TabIndex = 44
            '
            ' label2
            '
            Me.label2.Font = New System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (CByte(0)))
            Me.label2.Location = New System.Drawing.Point(8, 8)
            Me.label2.Name = "label2"
            Me.label2.Size = New System.Drawing.Size(192, 16)
            Me.label2.TabIndex = 19
            Me.label2.Text = "What to Export:"
            '
            ' panel6
            '
            Me.panel6.Anchor = (CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.panel6.BackColor = System.Drawing.Color.FromArgb((CInt((CByte(224)))), (CInt((CByte(224)))), (CInt((CByte(224)))))
            Me.panel6.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
            Me.panel6.Controls.Add(Me.cbHeadersFooters)
            Me.panel6.Controls.Add(Me.cbImages)
            Me.panel6.Controls.Add(Me.cbHyperlinks)
            Me.panel6.Controls.Add(Me.cbComments)
            Me.panel6.Controls.Add(Me.label6)
            Me.panel6.Location = New System.Drawing.Point(366, 148)
            Me.panel6.Name = "panel6"
            Me.panel6.Size = New System.Drawing.Size(176, 104)
            Me.panel6.TabIndex = 42
            '
            ' cbHeadersFooters
            '
            Me.cbHeadersFooters.Location = New System.Drawing.Point(96, 40)
            Me.cbHeadersFooters.Name = "cbHeadersFooters"
            Me.cbHeadersFooters.Size = New System.Drawing.Size(72, 44)
            Me.cbHeadersFooters.TabIndex = 23
            Me.cbHeadersFooters.Text = "Headers / Footers"
            '
            ' cbImages
            '
            Me.cbImages.Checked = True
            Me.cbImages.CheckState = System.Windows.Forms.CheckState.Checked
            Me.cbImages.Location = New System.Drawing.Point(16, 32)
            Me.cbImages.Name = "cbImages"
            Me.cbImages.Size = New System.Drawing.Size(72, 24)
            Me.cbImages.TabIndex = 22
            Me.cbImages.Text = "Images"
            '
            ' cbHyperlinks
            '
            Me.cbHyperlinks.Checked = True
            Me.cbHyperlinks.CheckState = System.Windows.Forms.CheckState.Checked
            Me.cbHyperlinks.Location = New System.Drawing.Point(16, 80)
            Me.cbHyperlinks.Name = "cbHyperlinks"
            Me.cbHyperlinks.Size = New System.Drawing.Size(80, 24)
            Me.cbHyperlinks.TabIndex = 21
            Me.cbHyperlinks.Text = "HyperLinks"
            '
            ' cbComments
            '
            Me.cbComments.Checked = True
            Me.cbComments.CheckState = System.Windows.Forms.CheckState.Checked
            Me.cbComments.Location = New System.Drawing.Point(16, 56)
            Me.cbComments.Name = "cbComments"
            Me.cbComments.Size = New System.Drawing.Size(80, 24)
            Me.cbComments.TabIndex = 20
            Me.cbComments.Text = "Comments"
            '
            ' label6
            '
            Me.label6.Font = New System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (CByte(0)))
            Me.label6.Location = New System.Drawing.Point(8, 16)
            Me.label6.Name = "label6"
            Me.label6.Size = New System.Drawing.Size(192, 16)
            Me.label6.TabIndex = 19
            Me.label6.Text = "Objects to Export:"
            '
            ' panel3
            '
            Me.panel3.Anchor = (CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.panel3.BackColor = System.Drawing.Color.FromArgb((CInt((CByte(255)))), (CInt((CByte(255)))), (CInt((CByte(192)))))
            Me.panel3.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
            Me.panel3.Controls.Add(Me.edBottom)
            Me.panel3.Controls.Add(Me.label17)
            Me.panel3.Controls.Add(Me.edRight)
            Me.panel3.Controls.Add(Me.label16)
            Me.panel3.Controls.Add(Me.edLeft)
            Me.panel3.Controls.Add(Me.label15)
            Me.panel3.Controls.Add(Me.edTop)
            Me.panel3.Controls.Add(Me.label14)
            Me.panel3.Controls.Add(Me.label13)
            Me.panel3.Controls.Add(Me.label12)
            Me.panel3.Location = New System.Drawing.Point(548, 52)
            Me.panel3.Name = "panel3"
            Me.panel3.Size = New System.Drawing.Size(208, 200)
            Me.panel3.TabIndex = 30
            '
            ' edBottom
            '
            Me.edBottom.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
            Me.edBottom.Location = New System.Drawing.Point(80, 136)
            Me.edBottom.Name = "edBottom"
            Me.edBottom.Size = New System.Drawing.Size(48, 20)
            Me.edBottom.TabIndex = 26
            Me.edBottom.Text = "0"
            '
            ' label17
            '
            Me.label17.Font = New System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (CByte(0)))
            Me.label17.Location = New System.Drawing.Point(16, 160)
            Me.label17.Name = "label17"
            Me.label17.Size = New System.Drawing.Size(56, 16)
            Me.label17.TabIndex = 25
            Me.label17.Text = "Last Col:"
            '
            ' edRight
            '
            Me.edRight.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
            Me.edRight.Location = New System.Drawing.Point(80, 160)
            Me.edRight.Name = "edRight"
            Me.edRight.Size = New System.Drawing.Size(48, 20)
            Me.edRight.TabIndex = 24
            Me.edRight.Text = "0"
            '
            ' label16
            '
            Me.label16.Font = New System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (CByte(0)))
            Me.label16.Location = New System.Drawing.Point(16, 136)
            Me.label16.Name = "label16"
            Me.label16.Size = New System.Drawing.Size(85, 16)
            Me.label16.TabIndex = 23
            Me.label16.Text = "Last Row:"
            '
            ' edLeft
            '
            Me.edLeft.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
            Me.edLeft.Location = New System.Drawing.Point(80, 112)
            Me.edLeft.Name = "edLeft"
            Me.edLeft.Size = New System.Drawing.Size(48, 20)
            Me.edLeft.TabIndex = 22
            Me.edLeft.Text = "0"
            '
            ' label15
            '
            Me.label15.Font = New System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (CByte(0)))
            Me.label15.Location = New System.Drawing.Point(16, 112)
            Me.label15.Name = "label15"
            Me.label15.Size = New System.Drawing.Size(85, 16)
            Me.label15.TabIndex = 21
            Me.label15.Text = "First Col:"
            '
            ' edTop
            '
            Me.edTop.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
            Me.edTop.Location = New System.Drawing.Point(80, 88)
            Me.edTop.Name = "edTop"
            Me.edTop.Size = New System.Drawing.Size(48, 20)
            Me.edTop.TabIndex = 20
            Me.edTop.Text = "0"
            '
            ' label14
            '
            Me.label14.Font = New System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (CByte(0)))
            Me.label14.Location = New System.Drawing.Point(16, 88)
            Me.label14.Name = "label14"
            Me.label14.Size = New System.Drawing.Size(85, 16)
            Me.label14.TabIndex = 3
            Me.label14.Text = "First Row:"
            '
            ' label13
            '
            Me.label13.Anchor = (CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.label13.Font = New System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, (CByte(0)))
            Me.label13.Location = New System.Drawing.Point(8, 32)
            Me.label13.Name = "label13"
            Me.label13.Size = New System.Drawing.Size(184, 32)
            Me.label13.TabIndex = 2
            Me.label13.Text = "If any value is <=0 all print_range will be printed"
            '
            ' label12
            '
            Me.label12.Font = New System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (CByte(0)))
            Me.label12.Location = New System.Drawing.Point(8, 16)
            Me.label12.Name = "label12"
            Me.label12.Size = New System.Drawing.Size(192, 16)
            Me.label12.TabIndex = 1
            Me.label12.Text = "Range to Export:"
            '
            ' label1
            '
            Me.label1.Font = New System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (CByte(0)))
            Me.label1.Location = New System.Drawing.Point(40, 16)
            Me.label1.Name = "label1"
            Me.label1.Size = New System.Drawing.Size(80, 16)
            Me.label1.TabIndex = 0
            Me.label1.Text = "File to export:"
            '
            ' panel8
            '
            Me.panel8.Anchor = (CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.panel8.BackColor = System.Drawing.Color.FromArgb((CInt((CByte(224)))), (CInt((CByte(224)))), (CInt((CByte(224)))))
            Me.panel8.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
            Me.panel8.Controls.Add(Me.chPrintHeadings)
            Me.panel8.Controls.Add(Me.label24)
            Me.panel8.Controls.Add(Me.chFormulaText)
            Me.panel8.Controls.Add(Me.chGridLines)
            Me.panel8.Location = New System.Drawing.Point(366, 52)
            Me.panel8.Name = "panel8"
            Me.panel8.Size = New System.Drawing.Size(176, 88)
            Me.panel8.TabIndex = 37
            '
            ' chPrintHeadings
            '
            Me.chPrintHeadings.Location = New System.Drawing.Point(16, 44)
            Me.chPrintHeadings.Name = "chPrintHeadings"
            Me.chPrintHeadings.Size = New System.Drawing.Size(144, 16)
            Me.chPrintHeadings.TabIndex = 20
            Me.chPrintHeadings.Text = "Print Headings"
            '
            ' label24
            '
            Me.label24.Font = New System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (CByte(0)))
            Me.label24.Location = New System.Drawing.Point(8, 8)
            Me.label24.Name = "label24"
            Me.label24.Size = New System.Drawing.Size(192, 16)
            Me.label24.TabIndex = 19
            Me.label24.Text = "Export Options:"
            '
            ' chFormulaText
            '
            Me.chFormulaText.Location = New System.Drawing.Point(16, 64)
            Me.chFormulaText.Name = "chFormulaText"
            Me.chFormulaText.Size = New System.Drawing.Size(136, 16)
            Me.chFormulaText.TabIndex = 17
            Me.chFormulaText.Text = "Print Formula Text"
            '
            ' chGridLines
            '
            Me.chGridLines.Location = New System.Drawing.Point(16, 24)
            Me.chGridLines.Name = "chGridLines"
            Me.chGridLines.Size = New System.Drawing.Size(128, 16)
            Me.chGridLines.TabIndex = 16
            Me.chGridLines.Text = "Print Grid Lines"
            '
            ' checkBox4
            '
            Me.checkBox4.Location = New System.Drawing.Point(0, 0)
            Me.checkBox4.Name = "checkBox4"
            Me.checkBox4.Size = New System.Drawing.Size(104, 24)
            Me.checkBox4.TabIndex = 0
            '
            ' exportDialog
            '
            Me.exportDialog.DefaultExt = "svg"
            Me.exportDialog.Filter = "SVG Files|*.svg"
            Me.exportDialog.Title = "Files will be saved as Filename_sheetname_pagenumber.svg"
            '
            ' mainToolbar
            '
            Me.mainToolbar.ImageScalingSize = New System.Drawing.Size(24, 24)
            Me.mainToolbar.Items.AddRange(New System.Windows.Forms.ToolStripItem() { Me.openFile, Me.export, Me.btnClose})
            Me.mainToolbar.Location = New System.Drawing.Point(0, 0)
            Me.mainToolbar.Name = "mainToolbar"
            Me.mainToolbar.Size = New System.Drawing.Size(768, 31)
            Me.mainToolbar.TabIndex = 8
            '
            ' openFile
            '
            Me.openFile.Image = (CType(resources.GetObject("openFile.Image"), System.Drawing.Image))
            Me.openFile.ImageTransparentColor = System.Drawing.Color.Magenta
            Me.openFile.Name = "openFile"
            Me.openFile.Size = New System.Drawing.Size(85, 28)
            Me.openFile.Text = "Open File"
'           Me.openFile.Click += New System.EventHandler(Me.openFile_Click)
            '
            ' export
            '
            Me.export.Image = (CType(resources.GetObject("export.Image"), System.Drawing.Image))
            Me.export.ImageTransparentColor = System.Drawing.Color.Magenta
            Me.export.Name = "export"
            Me.export.Size = New System.Drawing.Size(106, 28)
            Me.export.Text = "Export as SVG"
'           Me.export.Click += New System.EventHandler(Me.export_Click)
            '
            ' btnClose
            '
            Me.btnClose.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right
            Me.btnClose.Image = (CType(resources.GetObject("btnClose.Image"), System.Drawing.Image))
            Me.btnClose.ImageTransparentColor = System.Drawing.Color.Magenta
            Me.btnClose.Name = "btnClose"
            Me.btnClose.Size = New System.Drawing.Size(53, 28)
            Me.btnClose.Text = "Exit"
'           Me.btnClose.Click += New System.EventHandler(Me.btnClose_Click)
            '
            ' mainForm
            '
            Me.AutoScaleDimensions = New System.Drawing.SizeF(6F, 13F)
            Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
            Me.ClientSize = New System.Drawing.Size(768, 268)
            Me.Controls.Add(Me.mainToolbar)
            Me.Controls.Add(Me.panel1)
            Me.Name = "mainForm"
            Me.Text = "Export an Excel file to SVG"
'           Me.Load += New System.EventHandler(Me.mainForm_Load)
            Me.panel1.ResumeLayout(False)
            Me.panel7.ResumeLayout(False)
            Me.panel6.ResumeLayout(False)
            Me.panel3.ResumeLayout(False)
            Me.panel3.PerformLayout()
            Me.panel8.ResumeLayout(False)
            Me.mainToolbar.ResumeLayout(False)
            Me.mainToolbar.PerformLayout()
            Me.ResumeLayout(False)
            Me.PerformLayout()

        End Sub
        #End Region

        Private mainToolbar As ToolStrip
        Private WithEvents openFile As ToolStripButton
        Private WithEvents export As ToolStripButton
        Private WithEvents btnClose As ToolStripButton
    End Class
End Namespace

Form1.vb

Imports System.Collections
Imports System.ComponentModel
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports FlexCel.Render
Imports System.IO

Imports System.Text

Namespace ExportSVG
    ''' <summary>
    ''' An Example on how to export to SVG.
    ''' </summary>
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Private SVG As New FlexCelSVGExport()
        Public Sub New()
            InitializeComponent()
            ResizeToolbar(mainToolbar)
        End Sub

        Private Sub ResizeToolbar(ByVal toolbar As ToolStrip)

            Using gr As Graphics = CreateGraphics()
                Dim xFactor As Double = gr.DpiX / 96.0
                Dim yFactor As Double = gr.DpiY / 96.0
                toolbar.ImageScalingSize = New Size(CInt(Fix(24 * xFactor)), CInt(Fix(24 * yFactor)))
                toolbar.Width = 0 'force a recalc of the buttons.
            End Using
        End Sub

        Private Sub btnClose_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnClose.Click
            Close()
        End Sub

        Private Sub LoadSheetConfig()
            Dim Xls As ExcelFile = SVG.Workbook

            chGridLines.Checked = Xls.PrintGridLines
            chPrintHeadings.Checked = Xls.PrintHeadings
            chFormulaText.Checked = Xls.ShowFormulaText
        End Sub

        Private Sub openFile_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles openFile.Click
            If openFileDialog1.ShowDialog() <> System.Windows.Forms.DialogResult.OK Then
                Return
            End If
            SVG.Workbook = New XlsFile()

            SVG.Workbook.Open(openFileDialog1.FileName)

            Text = "Export: " & openFileDialog1.FileName

            Dim Xls As ExcelFile = SVG.Workbook

            cbSheet.Items.Clear()
            For i As Integer = 1 To Xls.SheetCount
                cbSheet.Items.Add(Xls.GetSheetName(i))
            Next i
            cbSheet.SelectedIndex = Xls.ActiveSheet - 1

            LoadSheetConfig()
        End Sub

        Private Function CheckFileOpen() As Boolean
            If SVG.Workbook Is Nothing Then
                MessageBox.Show("You need to open a file first.")
                Return False
            End If
            Return True
        End Function

        Private Function LoadPreferences() As Boolean
            'NOTE: THERE SHOULD BE *A LOT* MORE VALIDATION OF VALUES ON THIS METHOD. (For example, validate that margins are between bounds)
            ' As this is a simple demo, they are not included.
            Try
                Dim Xls As ExcelFile = SVG.Workbook

                'Note: In this demo we will only apply this things to the active sheet.
                'If you want to apply the settings to all the sheets, you should loop in the sheets and change them here.
                Xls.PrintGridLines = chGridLines.Checked
                Xls.PrintHeadings = chPrintHeadings.Checked
                Xls.ShowFormulaText = chFormulaText.Checked

                SVG.PrintRangeLeft = Convert.ToInt32(edLeft.Text)
                SVG.PrintRangeTop = Convert.ToInt32(edTop.Text)
                SVG.PrintRangeRight = Convert.ToInt32(edRight.Text)
                SVG.PrintRangeBottom = Convert.ToInt32(edBottom.Text)

                SVG.HidePrintObjects = THidePrintObjects.None
                If Not cbImages.Checked Then
                    SVG.HidePrintObjects = SVG.HidePrintObjects Or THidePrintObjects.Images
                End If
                If Not cbHyperlinks.Checked Then
                    SVG.HidePrintObjects = SVG.HidePrintObjects Or THidePrintObjects.Hyperlynks
                End If
                If Not cbComments.Checked Then
                    SVG.HidePrintObjects = SVG.HidePrintObjects Or THidePrintObjects.Comments
                End If
                If Not cbHeadersFooters.Checked Then
                    SVG.HidePrintObjects = SVG.HidePrintObjects Or THidePrintObjects.HeadersAndFooters
                End If

            Catch e As Exception
                MessageBox.Show("Error: " & e.Message)
                Return False
            End Try
            Return True
        End Function

        Private Sub cbSheet_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs)
            SVG.Workbook.ActiveSheet = cbSheet.SelectedIndex + 1
            LoadSheetConfig()
        End Sub

        Private Sub export_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles export.Click
            If Not CheckFileOpen() Then
                Return
            End If
            If Not LoadPreferences() Then
                Return
            End If

            If exportDialog.ShowDialog() <> System.Windows.Forms.DialogResult.OK Then
                Return
            End If

            SVG.AllowOverwritingFiles = True

            SVG.AllVisibleSheets = cbExportObject.SelectedIndex = 0

                       SVG.SaveAsImage(Sub(x) x.FileName = Path.ChangeExtension(exportDialog.FileName, "") & "_" & x.Workbook.SheetName & "_" & x.SheetPageNumber.ToString() & ".svg")

            If MessageBox.Show("Do you want to open the folder with the generated files?", "Confirm", MessageBoxButtons.YesNo) = System.Windows.Forms.DialogResult.Yes Then
                Process.Start(Path.GetDirectoryName(exportDialog.FileName))
            End If

        End Sub

        Private Sub mainForm_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
            cbExportObject.SelectedIndex = 0
        End Sub

        Private Sub cbExportObject_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles cbExportObject.SelectedIndexChanged
            cbSheet.Enabled = cbExportObject.SelectedIndex = 1
        End Sub
    End Class
End Namespace

Program.vb

Namespace ExportSVG
    Friend NotInheritable Class Program

        Private Sub New()
        End Sub

        ''' <summary>
        ''' The main entry point for the application.
        ''' </summary>
       <STAThread> _
        Shared Sub Main()
            Application.EnableVisualStyles()
            Application.SetCompatibleTextRenderingDefault(False)
            Application.Run(New mainForm())
        End Sub
    End Class
End Namespace


Rendering standalone objects (VB.Net / netframework) | FlexCel Studio for the .NET Framework documentation

Rendering standalone objects (VB.Net / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\vb\VS2022\netframework\25.Printing and Exporting\45.Render Objects and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​vb/​VS2022/​netframework/​Modules/​25.​Printing and Exporting/45.Render Objects

Overview

While you might normally want to render a full sheet (or a range of cells), you can also use FlexCel to render specific objects in the workbook.

Concepts

  • This is a simple application where we periodically update a number, and use FlexCel to recalculate the formulas and render a chart of the values. While you would normally not use FlexCel this way (and it is probably better to use a separate chart package), it gives a nice tasting on FlexCel capabilities.

  • How to use RenderObject to render a simple object in a sheet. In this demo, we are rendering the object named "datachart".

  • As the chart and the calculations are defined in the spreadsheet, you can add new themes to the application or modify the existing ones by creating and modifying the xls files in the templates folders, without needing to recompile the application. You can even do it in real time. Have a template open in Excel, make changes, save, and reload the template in the application by selecting it again in the listbox. Changes will appear instantly without needing to close the main application. This technique can be quite useful to let users customize your application.

  • In this example, we named the chart "DataChart", so we can identify it from the application. In order to name a chart object, ctrl-click in the chart (it should show white handles, not black), and then change the name in the name box at the top left in Excel.

Files

AssemblyInfo.vb

Imports System.Reflection
Imports System.Runtime.CompilerServices

'
' General Information about an assembly is controlled through the following
' set of attributes. Change these attribute values to modify the information
' associated with an assembly.
'
<Assembly: AssemblyTitle("")>
<Assembly: AssemblyDescription("")>
<Assembly: AssemblyConfiguration("")>
<Assembly: AssemblyCompany("")>
<Assembly: AssemblyProduct("")>
<Assembly: AssemblyCopyright("(c) 2002 - 2014 TMS Software")>
<Assembly: AssemblyTrademark("")>
<Assembly: AssemblyCulture("")>

'
' Version information for an assembly consists of the following four values:
'
'      Major Version
'      Minor Version
'      Build Number
'      Revision
'
' You can specify all the values or you can default the Revision and Build Numbers
' by using the '*' as shown below:

<Assembly: AssemblyVersion("6.2.1.0")>

'
' In order to sign your assembly you must specify a key to use. Refer to the
' Microsoft .NET Framework documentation for more information on assembly signing.
'
' Use the attributes below to control which key is used for signing.
'
' Notes:
'   (*) If no key is specified, the assembly is not signed.
'   (*) KeyName refers to a key that has been installed in the Crypto Service
'       Provider (CSP) on your machine. KeyFile refers to a file which contains
'       a key.
'   (*) If the KeyFile and the KeyName values are both specified, the
'       following processing occurs:
'       (1) If the KeyName can be found in the CSP, that key is used.
'       (2) If the KeyName does not exist and the KeyFile does exist, the key
'           in the KeyFile is installed into the CSP and used.
'   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
'       When specifying the KeyFile, the location of the KeyFile should be
'       relative to the project output directory which is
'       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
'       located in the project directory, you would specify the AssemblyKeyFile
'       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
'   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
'       documentation for more information on this.
'
<Assembly: AssemblyDelaySign(False)>
<Assembly: AssemblyKeyFile("")>
<Assembly: AssemblyKeyName("")>

Form1.Designer.vb

Imports System.Drawing.Drawing2D
Imports System.Collections
Imports System.ComponentModel
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports FlexCel.Render
Imports System.IO
Imports System.Reflection
Imports System.Text
Namespace RenderObjects
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Private components As System.ComponentModel.IContainer = Nothing

        ''' <summary>
        ''' Clean up any resources being used.
        ''' </summary>
        Protected Overrides Sub Dispose(ByVal disposing As Boolean)
            If disposing Then
                If components IsNot Nothing Then
                    components.Dispose()
                End If
            End If
            MyBase.Dispose(disposing)
        End Sub

        #Region "Windows Form Designer generated code"
        ''' <summary>
        ''' Required method for Designer support - do not modify
        ''' the contents of this method with the code editor.
        ''' </summary>
        Private Sub InitializeComponent()
            Me.components = New System.ComponentModel.Container()
            Dim resources As New System.ComponentModel.ComponentResourceManager(GetType(mainForm))
            Me.panel1 = New System.Windows.Forms.Panel()
            Me.panelError = New System.Windows.Forms.Panel()
            Me.labelError = New System.Windows.Forms.Label()
            Me.chartBox = New System.Windows.Forms.PictureBox()
            Me.panel7 = New System.Windows.Forms.Panel()
            Me.cbTheme = New System.Windows.Forms.ComboBox()
            Me.label2 = New System.Windows.Forms.Label()
            Me.checkBox4 = New System.Windows.Forms.CheckBox()
            Me.updater = New System.Windows.Forms.Timer(Me.components)
            Me.mainToolbar = New System.Windows.Forms.ToolStrip()
            Me.btnRun = New System.Windows.Forms.ToolStripButton()
            Me.toolStripSeparator1 = New System.Windows.Forms.ToolStripSeparator()
            Me.btnExit = New System.Windows.Forms.ToolStripButton()
            Me.btnCancel = New System.Windows.Forms.ToolStripButton()
            Me.panel1.SuspendLayout()
            Me.panelError.SuspendLayout()
            CType(Me.chartBox, System.ComponentModel.ISupportInitialize).BeginInit()
            Me.panel7.SuspendLayout()
            Me.mainToolbar.SuspendLayout()
            Me.SuspendLayout()
            '
            ' panel1
            '
            Me.panel1.BackColor = System.Drawing.Color.White
            Me.panel1.Controls.Add(Me.panelError)
            Me.panel1.Controls.Add(Me.chartBox)
            Me.panel1.Controls.Add(Me.panel7)
            Me.panel1.Dock = System.Windows.Forms.DockStyle.Fill
            Me.panel1.Location = New System.Drawing.Point(0, 38)
            Me.panel1.Name = "panel1"
            Me.panel1.Size = New System.Drawing.Size(464, 392)
            Me.panel1.TabIndex = 3
            '
            ' panelError
            '
            Me.panelError.Controls.Add(Me.labelError)
            Me.panelError.Location = New System.Drawing.Point(136, 128)
            Me.panelError.Name = "panelError"
            Me.panelError.Size = New System.Drawing.Size(200, 100)
            Me.panelError.TabIndex = 52
            Me.panelError.Visible = False
            '
            ' labelError
            '
            Me.labelError.Location = New System.Drawing.Point(8, 16)
            Me.labelError.Name = "labelError"
            Me.labelError.Size = New System.Drawing.Size(100, 23)
            Me.labelError.TabIndex = 0
            '
            ' chartBox
            '
            Me.chartBox.Anchor = (CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) Or System.Windows.Forms.AnchorStyles.Left) Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.chartBox.Location = New System.Drawing.Point(24, 120)
            Me.chartBox.Name = "chartBox"
            Me.chartBox.Size = New System.Drawing.Size(416, 250)
            Me.chartBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage
            Me.chartBox.TabIndex = 51
            Me.chartBox.TabStop = False
            '
            ' panel7
            '
            Me.panel7.Anchor = (CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
            Me.panel7.BackColor = System.Drawing.Color.FromArgb((CInt((CByte(224)))), (CInt((CByte(224)))), (CInt((CByte(224)))))
            Me.panel7.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
            Me.panel7.Controls.Add(Me.cbTheme)
            Me.panel7.Controls.Add(Me.label2)
            Me.panel7.Location = New System.Drawing.Point(16, 16)
            Me.panel7.Name = "panel7"
            Me.panel7.Size = New System.Drawing.Size(432, 72)
            Me.panel7.TabIndex = 44
            '
            ' cbTheme
            '
            Me.cbTheme.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
            Me.cbTheme.Location = New System.Drawing.Point(8, 32)
            Me.cbTheme.Name = "cbTheme"
            Me.cbTheme.Size = New System.Drawing.Size(248, 21)
            Me.cbTheme.TabIndex = 46
'           Me.cbTheme.SelectedIndexChanged += New System.EventHandler(Me.cbTheme_SelectedIndexChanged)
            '
            ' label2
            '
            Me.label2.Font = New System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (CByte(0)))
            Me.label2.Location = New System.Drawing.Point(8, 8)
            Me.label2.Name = "label2"
            Me.label2.Size = New System.Drawing.Size(192, 16)
            Me.label2.TabIndex = 19
            Me.label2.Text = "Select Theme:"
            '
            ' checkBox4
            '
            Me.checkBox4.Location = New System.Drawing.Point(0, 0)
            Me.checkBox4.Name = "checkBox4"
            Me.checkBox4.Size = New System.Drawing.Size(104, 24)
            Me.checkBox4.TabIndex = 0
            '
            ' updater
            '
'           Me.updater.Tick += New System.EventHandler(Me.updater_Tick)
            '
            ' mainToolbar
            '
            Me.mainToolbar.Items.AddRange(New System.Windows.Forms.ToolStripItem() { Me.btnRun, Me.toolStripSeparator1, Me.btnExit, Me.btnCancel})
            Me.mainToolbar.Location = New System.Drawing.Point(0, 0)
            Me.mainToolbar.Name = "mainToolbar"
            Me.mainToolbar.Size = New System.Drawing.Size(464, 38)
            Me.mainToolbar.TabIndex = 11
            Me.mainToolbar.Text = "toolStrip1"
            '
            ' btnRun
            '
            Me.btnRun.Image = (CType(resources.GetObject("btnRun.Image"), System.Drawing.Image))
            Me.btnRun.ImageTransparentColor = System.Drawing.Color.Magenta
            Me.btnRun.Name = "btnRun"
            Me.btnRun.Size = New System.Drawing.Size(35, 35)
            Me.btnRun.Text = "Run!"
            Me.btnRun.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText
'           Me.btnRun.Click += New System.EventHandler(Me.btnRun_Click)
            '
            ' toolStripSeparator1
            '
            Me.toolStripSeparator1.Name = "toolStripSeparator1"
            Me.toolStripSeparator1.Size = New System.Drawing.Size(6, 38)
            '
            ' btnExit
            '
            Me.btnExit.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right
            Me.btnExit.Image = (CType(resources.GetObject("btnExit.Image"), System.Drawing.Image))
            Me.btnExit.ImageTransparentColor = System.Drawing.Color.Magenta
            Me.btnExit.Name = "btnExit"
            Me.btnExit.Size = New System.Drawing.Size(59, 35)
            Me.btnExit.Text = "     E&xit     "
            Me.btnExit.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText
'           Me.btnExit.Click += New System.EventHandler(Me.button2_Click)
            '
            ' btnCancel
            '
            Me.btnCancel.Enabled = False
            Me.btnCancel.Image = (CType(resources.GetObject("btnCancel.Image"), System.Drawing.Image))
            Me.btnCancel.ImageTransparentColor = System.Drawing.Color.Magenta
            Me.btnCancel.Name = "btnCancel"
            Me.btnCancel.Size = New System.Drawing.Size(47, 35)
            Me.btnCancel.Text = "Cancel"
            Me.btnCancel.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText
'           Me.btnCancel.Click += New System.EventHandler(Me.btnCancel_Click)
            '
            ' mainForm
            '
            Me.AutoScaleDimensions = New System.Drawing.SizeF(6F, 13F)
            Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
            Me.ClientSize = New System.Drawing.Size(464, 430)
            Me.Controls.Add(Me.panel1)
            Me.Controls.Add(Me.mainToolbar)
            Me.MaximumSize = New System.Drawing.Size(800, 800)
            Me.Name = "mainForm"
            Me.Text = "Using FlexCel to render just a part of a spreadshet"
            Me.panel1.ResumeLayout(False)
            Me.panelError.ResumeLayout(False)
            CType(Me.chartBox, System.ComponentModel.ISupportInitialize).EndInit()
            Me.panel7.ResumeLayout(False)
            Me.mainToolbar.ResumeLayout(False)
            Me.mainToolbar.PerformLayout()
            Me.ResumeLayout(False)
            Me.PerformLayout()

        End Sub
        #End Region

        Private panel1 As System.Windows.Forms.Panel
        Private checkBox4 As System.Windows.Forms.CheckBox
        Private panel7 As System.Windows.Forms.Panel
        Private label2 As System.Windows.Forms.Label
        Private chartBox As System.Windows.Forms.PictureBox
        Private WithEvents updater As System.Windows.Forms.Timer
        Private WithEvents cbTheme As System.Windows.Forms.ComboBox
        Private panelError As System.Windows.Forms.Panel
        Private labelError As System.Windows.Forms.Label
        Private mainToolbar As ToolStrip
        Private WithEvents btnRun As ToolStripButton
        Private toolStripSeparator1 As ToolStripSeparator
        Private WithEvents btnExit As ToolStripButton
        Private WithEvents btnCancel As ToolStripButton
    End Class
End Namespace

Form1.vb

Imports System.Drawing.Drawing2D
Imports System.Collections
Imports System.ComponentModel
Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports FlexCel.Render
Imports System.IO
Imports System.Reflection

Imports System.Text

Namespace RenderObjects
    ''' <summary>
    ''' An Example on how to render a chart.
    ''' </summary>
    Partial Public Class mainForm
        Inherits System.Windows.Forms.Form

        Public Sub New()
            InitializeComponent()
            ResizeToolbar(mainToolbar)
        End Sub

        Private Sub ResizeToolbar(ByVal toolbar As ToolStrip)

            Using gr As Graphics = CreateGraphics()
                Dim xFactor As Double = gr.DpiX / 96.0
                Dim yFactor As Double = gr.DpiY / 96.0
                toolbar.ImageScalingSize = New Size(CInt(Fix(24 * xFactor)), CInt(Fix(24 * yFactor)))
                toolbar.Width = 0 'force a recalc of the buttons.
            End Using
        End Sub

        #Region "Global variables"
        Private Xls As XlsFile
        Private ValueRange As TXlsNamedRange
        Private MinValue As Double
        Private MaxValue As Double
        Private StepValue As Double
        Private ActualValue As Double

        Private ChartIndex As Integer
        Private ChartProps As TShapeProperties
        #End Region

        Private Sub InitApp()
            Xls = New XlsFile()

            Dim TemplatePath As String = Path.Combine(Path.Combine(Path.Combine(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), ".."), ".."), "templates") & Path.DirectorySeparatorChar
            Dim di As New DirectoryInfo(TemplatePath)
            Dim fi() As FileInfo = di.GetFiles("*.xls")
            If fi.Length = 0 Then
                Throw New Exception("Sorry, no templates found in the templates folder.")
            End If

            cbTheme.Items.Clear()
            For Each f As FileInfo In fi
                cbTheme.Items.Add(New FileHolder(f.FullName))
            Next f

            cbTheme.SelectedIndex = 0
        End Sub

        Private Sub LoadFile(ByVal FileName As String)
            Xls.Open(FileName)

            ActualValue = 0

            ValueRange = Xls.GetNamedRange("Value", 0)
            If ValueRange Is Nothing Then
                Throw New Exception("There is no range named ""value"" in the template")
            End If

            MinValue = ReadDoubleName("Minimum")
            MaxValue = ReadDoubleName("Maximum")
            StepValue = ReadDoubleName("Step")

            ChartIndex = -1
            For i As Integer = 1 To Xls.ObjectCount
                Dim ObjName As String = Xls.GetObjectName(i)
                If String.Compare(ObjName, "DataChart", True) = 0 Then
                    ChartIndex = i
                    Exit For
                End If
            Next i

            If ChartIndex < 0 Then
                Throw New Exception("There is no object named ""DataChart"" in the template")
            End If
            ChartProps = Xls.GetObjectProperties(ChartIndex, True)
        End Sub

        Private Function ReadDoubleName(ByVal Name As String) As Double
            Dim Range As TXlsCellRange = Xls.GetNamedRange(Name, 0)
            If Range Is Nothing Then
                Throw New Exception("There is no range named " & Name & " in the template")
            End If

            Dim val As Object = Xls.GetCellValue(Range.Top, Range.Left)
            If Not(TypeOf val Is Double) Then
                Throw New Exception("The range named " & Name & " does not contain a number")
            End If
            Return CDbl(val)
        End Function

        Private Sub button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnExit.Click
            Close()
        End Sub

        Private Sub updater_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles updater.Tick
            Try
                ActualValue += StepValue
                If ActualValue > MaxValue Then
                    ActualValue = MinValue
                End If
                Xls.SetCellValue(ValueRange.Top, ValueRange.Left, ActualValue)
                Xls.Recalc()

                If chartBox.Image IsNot Nothing Then
                    chartBox.Image.Dispose()
                End If
                chartBox.Image = GetChart()
            Catch ex As Exception 'We don't want any dialog popping up every second.
                labelError.Text = ex.Message
                labelError.Dock = DockStyle.Fill
                panelError.Dock = DockStyle.Fill
                panelError.Visible = True
                updater.Enabled = False

            End Try
        End Sub

        Private Function GetChart() As Image
            'We could get the chart with the following command,
            'but it would be fixed size. In this example we are going to be a little more complex.

            'Xls.RenderObject(ChartIndex);

            'A more complex way to retrieve the chart, to show how to use
            'all parameters in renderobject.

            Dim ImageDimensions As TUIRectangle
            Dim Origin As TPointF
            Dim SizePixels As TUISize

            'First calculate the chart dimensions without actually rendering it. This is fast.
            Xls.RenderObject(ChartIndex, 96, ChartProps, SmoothingMode.AntiAlias, InterpolationMode.HighQualityBicubic, True, False, Origin, ImageDimensions, SizePixels)

            Dim dpi As Double = 96 'default screen resolution
            If SizePixels.Height > 0 AndAlso SizePixels.Width > 0 Then
                Dim AspectX As Double = CDbl(chartBox.Width) / SizePixels.Width
                Dim AspectY As Double = CDbl(chartBox.Height) / SizePixels.Height

                Dim Aspect As Double = Math.Max(AspectX, AspectY)
                'Make the dpi adjust the screen resolution and the size of the form.
                dpi = CDbl(96 * Aspect)
                If dpi < 20 Then
                    dpi = 20
                End If
                If dpi > 500 Then
                    dpi = 500
                End If
            End If

            Return Xls.RenderObject(ChartIndex, dpi, ChartProps, SmoothingMode.AntiAlias, InterpolationMode.HighQualityBicubic, True, True, Origin, ImageDimensions, SizePixels)

        End Function

        Private Sub cbTheme_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles cbTheme.SelectedIndexChanged
            If cbTheme.SelectedItem Is Nothing Then
                Return
            End If
            LoadFile((TryCast(cbTheme.SelectedItem, FileHolder)).FullName)
        End Sub

        Private Sub btnRun_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnRun.Click
            If Xls Is Nothing Then
                InitApp()
            End If
            updater.Enabled = True
            btnRun.Enabled = False
            btnCancel.Enabled = True
        End Sub

        Private Sub btnCancel_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnCancel.Click
            updater.Enabled = False
            btnRun.Enabled = True
            btnCancel.Enabled = False
            panelError.Visible = False
        End Sub

    End Class

    Friend Class FileHolder
        Friend FullName As String
        Private Caption As String

        Friend Sub New(ByVal aFullName As String)
            FullName = aFullName
            Caption = Path.GetFileNameWithoutExtension(aFullName)
        End Sub

        Public Overrides Function ToString() As String
            Return Caption
        End Function

    End Class
End Namespace

Program.vb

Namespace RenderObjects
    Friend NotInheritable Class Program

        Private Sub New()
        End Sub

        ''' <summary>
        ''' The main entry point for the application.
        ''' </summary>
       <STAThread> _
        Shared Sub Main()
            Application.EnableVisualStyles()
            Application.SetCompatibleTextRenderingDefault(False)
            Application.Run(New mainForm())
        End Sub
    End Class
End Namespace


Using the FlexCel ASP viewer component (VB.Net / netframework) | FlexCel Studio for the .NET Framework documentation

Using the FlexCel ASP viewer component (VB.Net / netframework)

Note

This demo is available in your FlexCel installation at <FlexCel Install Folder>\samples\vb\VS2022\netframework\25.Printing and Exporting\50.ASP.NET HTML Viewer and also at https:​//​github.​com/​tmssoftware/​TMS-​FlexCel.​NET-​demos/​tree/​master/​vb/​VS2022/​netframework/​Modules/​25.​Printing and Exporting/50.ASP.NET HTML Viewer

Overview

A simple example on how to use the component FlexCelAspViewer to display xls files as html in a web browser.

Note

This demo does not run from MainDemo and it needs **.NET 2.0 or newer.

In order to run this demo, open the website from Visual Studio 2005 or newer, by doing: Menu->File->Open->Website

and pointing to the Modules\25.Printing and Exporting\50.ASP.NET HTML Viewer folder.

Concepts

  • In this demo we will use .TemporaryFiles to create the images. This will create all images as GUIDs in the "images" folder. Images older than 15 minutes will be deleted when a new page is requested, and there is an "overflow guard" that prevents having more than 5000 images in the images folder.

  • If you wanted to use HttpHandlers to return the images, you would need to add the following lines to web.config:

      <httpHandlers>
  <add verb="*" path="flexcelviewer.ashx"
    type="FlexCel.AspNet.UniqueTemporaryFilesImageHandler,FlexCel.AspNet"/>
  </httpHandlers>

This has already been done in the example, so you just need to switch the image mode to use UniqueTemporaryFiles.

  • In order to delete the temporary images once the timeout has happened, we use ImageTimeout and MaxTemporaryImages. Make sure you have rights to delete images in the image folders for this to work. You could also manually delete the images with a script on the server.

  • FlexCelAspViewer is great for small sites, but due to the way it handles images, (make sure you read the [

    ) it might not scale enough if you do not provide a custom image handler. ](~/guides/html-exporting-guide.md# -----it-might-not-scale-enough-if-you-do-not-provide --a-custom-image-handler )

Files

Default.aspx.vb

Imports System
Imports System.Data
Imports System.Configuration
Imports System.Web
Imports System.Web.Security
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Web.UI.WebControls.WebParts
Imports System.Web.UI.HtmlControls

Imports FlexCel.Core
Imports FlexCel.XlsAdapter
Imports FlexCel.Render
Imports FlexCel.AspNet

Partial Public Class _Default
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
        Dim xls As New XlsFile()

        Dim DefaultFile As String = Server.MapPath("~/default.xls")
        If IsPostBack Then
            If Uploader.HasFile Then
                xls.Open(Uploader.FileContent)
            Else
                xls.Open(DefaultFile)
            End If
        Else
            xls.Open(DefaultFile)
        End If

        Viewer.HtmlExport.ImageNaming = TImageNaming.Guid
        Viewer.HtmlExport.Workbook = xls
        Viewer.RelativeImagePath = "images"
        Viewer.HtmlExport.FixIE6TransparentPngSupport = True 'This is only needed if you are using IE and there are transparent png files.
        Viewer.ImageExportMode = TImageExportMode.TemporaryFiles

    End Sub
End Class


Thanks (VB.Net / netframework) | FlexCel Studio for the .NET Framework documentation

Thanks (VB.Net / netframework)

Overview

Last but not least, we would like to thank all the people that contributed with this project. They are too many to be mentioned here, because FlexCel is built on the help of many people, but here there are some:

  • Frédérick Jacquet for his implementation of the MD5 code for running on Compact Framework.

  • People of the Mono project for providing such an amazing implementation of the .NET framework.

  • People at Juice Analitics for their ideas on "infographics" we used on the "VIRTUAL DATASETS" demo ([http://www.juiceanalytics.com/weblog/?p=236]{.underline})

  • Scott Hanselman for his implementation of a custom http handler at [http://www.hanselman.com/blog/PermaLink,guid,5c59d662-b250-4eb2-96e4-f274295bd52e.aspx]{.underline}

  • Everybody who is mentioned in the file copyright.txt.

  • You.

  • And everybody else we forgot.


About | FlexCel Studio for the .NET Framework documentation

About

This documentation is for FlexCel Studio for the .NET Framework v7.21.0.0

Copyright (c) 2002 - 2024 tmssoftware.com

In this section:

What's new

Everything that changed in FlexCel since the last time!

Supported Excel functions

A list with all the built-in Excel functions that FlexCel can recalculate. Remember that for used defined functions, you can write your own implementation too.

Supported Excel charts

A list with all the Excel charts that FlexCel can render.

Copyright information

Information about the third party copyrights and licenses of code used by FlexCel.

Licensing information

Single developer license

A license for a single developer. Non transferable.

Site license

A license for all developers in a single company.


What's new in FlexCel Studio for .NET | FlexCel Studio for the .NET Framework documentation

What's new in FlexCel Studio for .NET

New in v 7.21 - February 2024

  • Support for exporting Persian to PDF. FlexCel supported arabic but not persian when exporting to PDF. Now both are supported.

  • Bug Fix. Reviewed bidi algorithm because some arabic numbers could be written in the wrong order when exporting to PDF

  • Bug Fix. Data labels in scatter chart were incorrect when the axis was reversed.

  • Bug Fix. When rendering charts that had labels linked to "Value from Cells" FlexCel could fail to render the labels if they weren't manually specified.

  • Bug Fix. There was an error when rendering PDF Khmer text in some corner cases.

  • Bug Fix. Header images wouldn't be copied when calling the InsertAndCopySheets overload that takes an array of integers for the sheets to copy.

  • Bug Fix. SetCellFromHtml could raise an exception with some surrogated unicode characters.

  • Bug Fix. Charts with hidden series could raise an exception when drawing trendlines.

New in v 7.20 - December 2023

  • Support for .NET 8. We now provide packages optimized for .NET 8

  • Updated SKIASharp. SkiaSharp 2.88.3 had a serious vulnerability, we have updated FlexCel to require at least 2.88.6

  • Support for creating your own cultures when rendering Excel files. Now you can override the dates returned by your app so they look exactly like Excel. For more information read the tip localized month names

  • Better support for subnormal numbers. Excel doesn't support subnormal floating point numbers and instead converts them to 0. Now FlexCel does the same, instead of saving those numbers to the files.

  • FlexCel is more forgiving with too long data validation formulas. FlexCel used to raise an error if a formula in a Data Validation is longer than 255 characters, because that is what the spec says and what Excel allows you to enter in its Data Validation Dialog. But, if you save a longer formula by manually editing the xlsx file, Excel won't complain, and the formula will still work. It won't work well, since you won't be able to edit the formula with the UI (and you might be corrupting Excel memory), but Excel won't complain. In order to let you edit those files, now FlexCel won't complain either when you open a file with a longer formula, and it will preserve the formula when you save the file back. But it still will throw an Exception if you try to manually enter that formula, so you know it is invalid. You can still enter the invalid formula manually by turning Recovery Mode on.

  • New setting FlexCelConfig.LocalizedTEXTFunction allows you to fine tune how FlexCel recalculates the "=TEXT()" function. The setting FlexCelConfig.LocalizedTEXTFunction allows to change the way the =TEXT() function behaves in FlexCel. Look at the link above for more information.

  • Improved Label rendering when drawing charts. Now we allow to show the fields "X Value" and "Y Value" in labels of scatter charts. Sometimes the marker if the label was set to show markers was drawn left-aligned, not centered.

  • Removed canvas.getMatrix calls in Android as they are deprecated. FlexCel now keeps internal track of its Matrix, to avoid calling canvas.getMatrix which was deprecated in Android 16.

  • Bug Fix. If the column names of a table had a format like "@_@" or similar, FlexCel would apply them and the column name would be wrong. Now the names are the same as in Excel. Some other improvements in handling of column names.

  • Bug Fix. The XLOOKUP function would return "not found" when searching for a value bigger than any on the list and the match mode was "Exact match or next larger item", when there were empty entries in the list. This is the logical way to do it, it is how Google Sheets does it, and it is how Excel itself behaves in the other match modes. But for this match mode, Excel returns the first empty item in the list, not "not found". Now FlexCel mimics this behavior.

  • Bug Fix. The SINGLE function could return wrong results in very special cases.

  • Bug Fix. When autofitting rows FlexCel ignored empty columns formatted with big fonts.

  • Bug Fix. When parsing some PNGs FlexCel could raise an arithmetic overflow.

  • Bug Fix. FlexCel could fail to detect circular references in some corner cases, causing a Stack Overflow.

  • Bug Fix. When drawing Error Bars in charts, if there was no line color assigned, FlexCel would not draw the lines instead of drawing them in Black.

  • Bug Fix. Some files could show the error: "Value was either too large or too small for an Int32" when opened.

New in v 7.19.1 - September 2023

  • Bug Fix. InsertAndCopyRange failed to copy cells in some corner cases

New in v 7.19 - September 2023

  • New property FlexCelSVGExport.Encoding allows you to change the encoding when generating SVG files. Now you can change the Encoding of generated SVG files by using the new property FlexCelSVGExport.Encoding

  • Breaking Change: Now FlexCel will default the encoding when to exporting to CSV or SVG to UTF-8 without BOM. FlexCel used to use UTF-8 with BOM to save CSV or SVG files if you didn't specify an encoding. Now the default encoding is UTF-8 with BOM, which is more common. You can still specify an explicit Encoding as UTF-8 with BOM when saving those files if you want to, but if you are not specifying a default, the generated text files will change.

  • Now FlexCel will write the xml inside xlsx files as UTF-8 without BOM. FlexCel used to write the xml inside xlsx files as UTF-8 with BOM, which is valid and works fine, but some third party tools could have issues reading those files. Excel writes the xml as UTF-8 without BOM itself, so this is not a breaking change. See https://support.tmssoftware.com/t/save-utf-8-without-bom/21577

  • Bug Fix. In some rare cases when you entered #N/A as a parameter in a formula, the full formula would become #N/A. See https://support.tmssoftware.com/t/handling-of-n-a-in-formuals-on-loading-excel-file/21425

  • Bug Fix. Page numbers in headers and footers were invalid when exporting to SVG.

  • Bug Fix. FlexCel could write some invalid DXF records when saving table styles to xls files.

  • Bug Fix. InsertAndCopyRange could fail to copy cells in some corner cases

New in v 7.18 - August 2023

  • Support for the new Excel2023 default format including the default aptos font. Now when calling ExcelFile.NewFile there is a new option to create a file with the new office 2023 theme and fonts.

  • FlexCelPreview now is available for .NET 6+ Winform apps. The FlexCel.Winforms nuget package now includes FlexCelPreview, and you can now use it from .NET 6 and newer Winform apps.

  • New property TExcelFile.PrintComments allows to directly manipulate how to print the comments. The new property ExcelFile.PrintComments allows you to directly change how comments are printed without having to use TExcelFile.PrintOptions.

  • FlexCel can now render comments "As displayed". When ExcelFile.PrintComments is "As Displayed", FlexCel will now print and export to PDF/HTML/SVG the comments as they are displayed. See https://support.tmssoftware.com/t/excel-with-comments-export-to-pdf-with-comments-showing/19377

  • New property TExcelFile.PrintErrors allows to directly manipulate how to print the errors in formulas inside the sheet. The new property ExcelFile.PrintErrors allows you to change how the errors in the sheet will be printed.

  • FlexCel can now render error in formulas according to the printer settings. When ExcelFile.PrintErrors is not "As Displayed", FlexCel will now print and export to PDF/HTML/SVG the correct values.

  • New properties TExcelFile.PrintOptionsInitializedFromPrinter, TExcelFile.PrintOverThenDown and TExcelFile.PrintDraftQuality. The new properties ExcelFile.PrintOptionsInitializedFromPrinter, ExcelFile.PrintOverThenDown and ExcelFile.PrintDraftQuality allow to change the TExcelFile.PrintOptions in a simpler way. Now there are properties to change every one of the individual PrintOptions, and so APIMate won't suggest changing PrintOptions, but the standalone properties instead. APIMate will still show the code to change PrintOptions, but commented out.

  • ApiMate won't show PrinterDriverSettings by default. PrinterDriverSettings are a huge binary blob which can make the output of APIMate much harder to read. It was already commented out, but now it is not shown at all by default. There is a checkbox to show it if you need it.

  • Bug Fix. When rendering charts inside xlsx files, sometimes FlexCel could fail to render the correct colors of some series, using black instead.

  • Bug Fix. Formatted numbers inside cells with "Shrink to fit" didn't shrink when exporting to HTML

  • Bug Fix. <#if> tag in reports would consider the condition true if it evaluated to NAN or a number.

  • Bug Fix. <#ref> tag in reports now returns a real reference instead of a string with the cell reference. While for most uses it is the same, in some cases like in the "Cell" function, the old <#ref> tag wouldn't work.

New in v 7.17 - June 2023

  • Optimized support for .NET 7. We include now packages compiled against .NET 7

  • SkiaSharp updated to 2.88.3. The minimum SkiaSharp now required is 2.88.3.

  • Removed support for .NET Core 3.1 and 5.0. As .NET Core 3.1 and 5.0 reached EOL, now the minimum .NET Core version supported is 6

  • Improved API for defining columns in tables. Now you can define a totals formula or a column formula for the columns in the table, if needed. As usual, APIMate will show you how to do it.

  • Now FlexCel preserves digital signatures in macros. When you have digitally signed macros in a file, now FlexCel will preserve them when opening and saving that file

  • New property DeleteEmptyBandsFixed in FlexCelReport controls what to do with empty fixed bands. The new function DeleteEmptyBandsFixed lets you define what happens if a fixed band has zero records.

  • Bug Fix. When recreating a table by calling AddTable and SetTable, the cell references could become invalid

  • Bug Fix. The functions IFERROR, ISERROR and ISERR could sometimes return the error instead of the result of the function.

  • Bug Fix. The functions COUNTIF, SUMIF and similar could behave wrong in some cases where you used wildcards. See https://support.tmssoftware.com/t/countif-formula-with-wildcard-failing-after-recalc-method-is-called/19266

  • Bug Fix. The function TRIM in Excel removes double spaces in the middle of a text, while FlexCel's implementation would remove only spaces at the beginning at end. Also Excel's TRIM only removes spaces (character 32) and not other whitespace like tabs. FlexCel's implementation now does the same.

  • Bug Fix. The function =NUMBERVALUE() could throw an Exception in some border cases

New in v 7.16 - September 2022

  • Support for using .NET 6 directly in iOS and Android, instead of Xamarin. Now we support the new multi-target packages in .NET 6, which replace Xamarin.

  • Breaking Change: The default for the GraphicFramework property is now Native. The property GraphicFramework now defaults to use the native framework if not manually specified. The native graphic frameworks normally work better than Skia, and don't require SkiaSharp.

  • Support for using native graphics engine in .NET 6 for Android, macOS and iOS. In Nov 2020 FlexCel 7.8 added support for switching graphics engines in Windows. Now when in .NET 6 you can also switch graphics engines in macOS, iOS (you can use CoreGraphics or Skia) and Android (you can use Native or Skia). To select between native or SkiaSharp in any platform, use the property GraphicFramework

  • SkiaSharp updated to 2.88.1. The minimum SkiaSharp now required is 2.88.1. This was needed to support multi-targeting in .NET 6

  • Support for different numeric systems in cell formatting. Now if you format a cell with a different numeric system like for example "[$-2000000]#,##0.00", FlexCel will render those numbers correctly. (see https://ansarichat.wordpress.com/2018/02/20/how-to-type-arabic-numerals-in-excel/ )

  • Bug Fix. When rendering charts that used =Offset to define the data, and some columns or rows were hidden, FlexCel could fail to hide the values when the chart was set to not plot hidden cells.

  • Bug Fix. In some rare cases when there was merged cells whose first cell was hidden the background might not be exported to pdf.

  • Bug Fix. If printing gridlines and there were hidden columns or rows, the gridlines could be printed over the real borders of a cell.

  • Bug Fix. When exporting to CSV, there could be errors if you manually set cell values to NaN.

  • Bug Fix. If exporting to PDF and the "normal" font of the spreadsheet was Calibri 9 columns could be wider than expected.

  • Bug Fix. FlexCel could hang while loading some invalid third-party files.

New in v 7.15 - July 2022

  • Support for functions FILTER, SORT, SORTBY, and UNIQUE. There is now support for the functions introduced in office 2021 : FILTER, SORT, SORTBY, and UNIQUE.

  • Support for functions MAP, REDUCE, SCAN, MAKEARRAY, BYROW, and BYCOL. There is now support for the functions introduced in office 365 : MAP, REDUCE, SCAN, MAKEARRAY, BYROW, and BYCOL.

  • Support for functions TEXTBEFORE, TEXTAFTER, TEXTSPLIT, HSTACK, VSTACK, TOROW, TOCOL, WRAPROWS, WRAPCOLS, TAKE, DROP, CHOOSEROWS, CHOOSECOLS, and EXPAND. There is now support for the new functions introduced in office 365 beta : TEXTBEFORE, TEXTAFTER, TEXTSPLIT, HSTACK, VSTACK, TOROW, TOCOL, WRAPROWS, WRAPCOLS, TAKE, DROP, CHOOSEROWS, CHOOSECOLS, and EXPAND.

  • New SHEET VISIBLE tag that allows to change the visibility of a sheet in a report. You can now use the new Sheet Visible tag to hide or unhide sheets. See https://support.tmssoftware.com/t/hide-worksheet-in-report-tags/18336/2

  • You can now run reports on List<primitive> like List<double>. Now you can use a list of a primitive type like List<string> in reports. You have to write <#list.Value> in the template for it to work. See the modified example of using lists as datasets. See https://support.tmssoftware.com/t/using-list-as-datasource/18513/4

  • Ability to change the newline separator when exporting to CSV or Fixed-lenght text files. By default FlexCel exports to CSV or fixed length using the newline separator from the OS. (that's CR/LF in Windows and LF in Unix/macOS). Now you can explicitly define the newline string when calling Export See https://support.tmssoftware.com/t/settings-for-new-line-character-when-saving-texcelfile-to-csv/17886/3

  • Support for Array formulas, UDFs, external names and Lambda names in Tokens. Tokens now support Array formulas, user-defined functions (UDF), names that refer to external files, and Lambda names (like if you write in a formula "=MyName(4)" and MyName is a lambda function.). Standalone lambda functions (without using names) were already supported. The only thing not supported in tokens right now is what-if tables.

  • Function "INDEX" is now array-enabled. Now you can pass arrays in the col and row parameters of the INDEX function and FlexCel will return an array of results.

  • Improved behavior when inside Docker containers. Now when you try to run FlexCel in a Docker container without any fonts installed, FlexCel will tell you the problem and how to fix it. There is also a new tip explaining how to handle fonts inside docker containers.

  • FlexCelReport.AddConnection now supports adding IDbCommand directly. There is a new overload of AddConnection that takes a IDbCommand instead of a IDbDataAdapter. This allows you to use DirectSQL in reports when the data framework doesn't has DataAdapters (as is currently the case with Microsoft.Data.SQLite)

  • Bug Fix. The functions SWITCH and IFS could fail is some border cases.

  • Bug Fix. Bubble charts could render bubbles of the wrong size if there were empty points in the chart data with bubble size different from 0.

  • Bug Fix. Negative dates now show empty instead of "########" when they are labels of charts. This is the behavior Excel has too.

  • Bug Fix. Cells with diagonal borders, but borders style set to none could be rendered by FlexCel in some cases.

  • Bug Fix. Some files containing khmer characters (or other complex scripts) could raise an exception when exporting to pdf.

  • Bug Fix. Sometimes RenderObjects would not render the images. See https://support.tmssoftware.com/t/images-disappear-sometimes/18567/6

  • Bug Fix. There could be errors in some specific cases when copying sheets from one file to another which had linked formulas.

  • Bug Fix. The limit for custom formats in xls files was in 4000 when it really is 4050. We've updated FlexCel to allow 4050 custom formats when saving as xls.

  • Bug Fix. The TYPE function didn't return 128 for lambda functions.

  • Bug Fix. When third-party files had invalid modify/creation dates, FlexCel would refuse to open them. Now it will just ignore invalid dates and let those properties empty.

New in v 7.14 - January 2022

  • Improved floating point handing in .NET Core 3.0 or newer, .NET 5 or newer. .Net 3.0 completely rewrote the floating point parsing and formatting and this lead to many small but noticeable changes in how FlexCel rendered files. For example, in .NET Core 3 the code Console.WriteLine((-1.0/3.0).ToString("0")); will write "-0" instead of "0" as before. Or Console.WriteLine((4.5).ToString("F0")); will write "4" instead of "5" as before. There are many other similar changes. We've done a big review of the code to try to ensure we behave like Excel, not like .NET Core 3 when rendering a file.

  • Removed support for .NET framework 2.0. Now the minimum .NET version supported is 3.5

  • Support for bubble charts. Now FlexCel can render Bubble charts. You can also enter them with the API and APIMate will show you the code to do it.

  • New <#Swap Series> tag for reports. The new <#Swap Series> tag allows you to create charts that grow or decrease their number of series according to the data available.

  • New CustomizeChart event for reports. The new CustomizeChart event allows you to further customize the charts in the report once they have been generated.

  • Support for optional lambda parameters. There is now full support for the new optional lambda parameters in Excel.

  • IsOmitted function support. There is now full support for the new IsOmitted function.

  • Improved recovery mode. RecoveryMode can now load more types of invalid files.

  • Support for localized versions of the CELL function. Now you can write the first argument of function CELL in 24 languages, and FlexCel will understand them anyway. Before only English was understood. The languages added are Catalan, Croatian, Czech, Danish, Dutch, Finnish, French, Galician, German, Hungarian, Italian, Kazakh, Korean, Norwegian, Polish, Portuguese-Brazil, Portuguese-Portugal, Russian, Slovak, Slovenian, Spanish, Swedish, Turkish and Ukrainian

  • Bug Fix. Now FlexCel will throw an exception if you try to save a chart with more than 255 series. Before this release, FlexCel would just save the file, but a file with more than 255 series crashes Excel.

  • Bug Fix. APIMate wouldn't report deleted chart titles, which could lead to chart titles appearing when there was a series with a name.

  • Bug Fix. It was impossible to manually enter lambda formulas referring to names if AllowEnteringUnknownFunctionsAndNames was false.

  • Bug Fix. A horizontal fixed band in a report would insert columns if using more than the fixed space, instead of just overwriting the cells.

  • Bug Fix. Sometimes it was not possible to read properties from xls files.

New in v 7.13 - December 2021

  • Support for office 2021. While we already supported it since we support Office 365, we added enumerations to create files with office 2021 defaults, and identify the file as being created by Excel 2021.

  • Support for Radar charts. Now FlexCel can render Radar (Spider) charts. You can also enter them with the API and APIMate will show you the code to do it.

  • Support for .NET 6. While we already supported .NET 6 beta, now that it is officially released,we tested and compiled FlexCel against the RTM release.

  • Breaking Change: Removed support for .NET Core 2.1. .NET Core 2.1 is out of support and will not receive security updates in the future.

  • Support for the "Black and white" printing option in Excel. Now when exporting to pdf, html, or printing, FlexCel will honor the "Black and White" option in the print options. Note that Black and White priniting in Excel doesn't mean to print in grayscale, but printing all backgrounds white and all lines black no matter the actual colors. It also depends in what you render, for example colors in a chart bar will be replaced by patterns. There is also a new convenience method PrintBlackAndWhite that will let you modify the PrintOptions directly to print in black and white.

  • Ability to set the bottom row when specifying an autofilter. Now SetAutoFilter can have an extra parameter to specify the bottom row of the Autofilter. Note that if there are more rows after the bottom row, those will be included anyway. Setting the bottom row is only useful to ensure that rows up to bottom rows are included, no matter if there are blank cells in the middle.

  • New convenience method LoopOverUsedRange that can be used to loop over a range of cells. There is a new method LoopOverUsedRange which will let you loop over a range of cells in a simple and efficient way.

  • New properties TextHorizontalOverflow and TextVerticalOverflow in TShapeProperties. The new properties TextHorizontalOverflow and TextVerticalOverflow allow you to set how the text overflows a shape. This corresponds to the checkbox in Excel "Allow text to overflow shape"

  • New convenience properties TextRotated, TextVerticalAlignment, TextHorizontalAlignment and LockText in TShapeProperties. The new properties LockText, TextVerticalAlignment and TextHorizontalAlignment allow to set or get TextFlags in a simpler way. The new property TextRotated allows to set TextRotation in a simpler way. APIMate now shows those properties instead of TextFlags and TextRotation. Read more in the tip about xlsx and xls approaches to text rotation.

  • New method SetObjectProperties to set all the object properties in one step. There is a new method SetObjectProperties that will allow to easily change the properties of an object. You just call GetObjectProperties, modify the values you want and then call SetObjectProperties.

  • New property IsLocked in TShapeOptions. There is a new property IsLocked which controls how if the shape is locked or not.

  • New overloaded version of SetObjectProperty for booleans. There is a new overload of SetObjectProperty that will allow you to set the property directly, without calculating the position in the set.

  • Improved legend drawing in charts. Legends items in charts should render better now when some items are empty, and multiline items were improved too.

  • Bug Fix. In iOS or Android you could get an error when saving files

  • Bug Fix. Background of Axis text set by the API was ignored.

  • Bug Fix. Rotation of Axis text set by the API was ignored.

  • Bug Fix. When setting an Axis position in a chart to cross in the max value with the API, the value was ignored and it always used the manual crossing point.

  • Bug Fix. Some hidden fills in files could be read as normal fills and so would appear if reading and saving a file.

  • Android demos now use AndroidX instead of Support Library. The Android Support Library is deprecated and replaced by AndroidX. So we've modified the demos using the old Support library to use AndroidX instead. Also the documentation has been updated to use AndroidX.

New in v 7.12.1 - October 2021

  • Bug Fix. Workarounded bug in SkiaSharp: https://github.com/mono/SkiaSharp/issues/1551 We also now require a minimum of SkiaSharp 2.80.2 instead of 2.80.3, since 2.80.2 doesn't has the bug.

New in v 7.12 - October 2021

  • PowerBI Data models are now preserved. FlexCel will now preserve the spreadsheet data models used by Power BI technologies (PowerPivot, PowerMap, etc) inside xlsx files.

  • Bug Fix. GetImageProperties could return an index out of bounds when passed a valid imageindex but there were grouped images.

New in v 7.11 - September 2021

  • Support for .NET 6 and Visual Studio 2022. Official support for .NET 6 and Visual Studio 2022

  • New overloads of methods for getting image information that take objectIndexes instead of imageIndexes. The methods GetImageProperties, GetImageName, SetImageProperties, DeleteImage and ClearImage now have overloads taking an objectIndex/objectPath pair instead of an imageIndex.

  • New methods to convert between imageindexes and objectindexes with support for grouped shapes. The new methods ImageIndexToObjectPath and ObjectPathToImageIndex can convert between imageIndexes and objectIndexes taking care of nested objects. The existing methods would only work in non-grouped objects.

  • You can now read and write the links of a camera object. The methods GetShapeLinkedCell and SetShapeLinkedCell now work in picures too, allowing to read or create camera objects besides to shapes with their text linked.

  • Improved loading of Excel 3, 4 and 95 files. Now FlexCel can load camera objects in Excel 3, 4 and 95 files. It will also load the image names for images in Excel 95 files (Excel 4 and older don't store an image name)

  • SkiaSharp updated to 2.80.3. The SkiaSharp library was updated from 2.80.2 to 2.80.3.

New in v 7.10 - August 2021

  • Support for SVG images embedded in xlsx files. Excel has recently started allowing SVG images inside xlsx files. This releases adds full support for adding and reading SVG images to/from xlsx files. Note that we don't currently have a SVG renderer, so to add a SVG image you need to provide both an SVG and a PNG image. you can get more details in this tip

  • Breaking Change: Now when exporting to HTML and SVG, the SVG images stored inside the file will be embedded as SVG. Before, FlexCel would always embed the PNG fallback image. To keep the old behavior, there are 2 new properties: FlexCelHtmlExport.RasterizeSVGImages and FlexCelSvgExport.RasterizeSVGImages

  • Ability to add chart sheets with the API. There is a new method AddChartSheet which will allow you to add chart sheets with the API. As usual, APIMate will show you the code needed to add a chart sheet.

  • Ability to link shape text to cells via the API. The new methods GetShapeLinkedCell, SetShapeLinkedCell in ExcelFile and GetShapeLinkedCell, SetShapeLinkedCell in ExcelChart allow you to read and write linked text in shapes.

  • Full Window management via API. There is a new property ActiveWindow which allows you to select the window you are working on. You can then set the zoom, selected cells, etc. for that window, leaving the other windows unaffected. The new commands AddWindow and DeleteWindow allow you to add or delete windows. WindowCount will let you know how many windows you have in the file. ActiveSheetForActiveWindow will let you select an active sheet for each window, even if the ActiveSheet for FlexCel won't change.

  • Includes in reports can now be FIXED. Now you can use the word FIXED in the "Shift type" parameter of the include tag . Fixed includes won't insert rows or columns, just overwriting the cells in the main report.

  • Support for recalculation of function NUMBERVALUE. Now FlexCel can recalculate the NUMBERVALUE function introduced in Excel2013. As usual, the list of supported Excel functions is at supported-excel-functions.html in the docs

  • Ability to set shape effects like glow or shadow with the API. Now you can set shape effects with the API, and APIMate will tell you the code to do it.

  • Improved recalculation speed. We've implemented caches for some common formula patterns which should make your recalculations go much faster if your files use those patterns.

  • Improved support for Tiff and Gif images. FlexCel used to convert tiff and giff images to png when loading them, so they could be saved inside xls files (xls files don't support those formats). Now FlexCel will preserve the file formats, and only convert them to pngs if you are saving in xls format.

  • Improved HTML5 exporting. We've made the html5 files generated by FlexCel more compliant with html5 validators.

  • Improved drawing of shape shadows for xlsx files. FlexCel will now render better the shadows in shapes inside xlsx files.

  • Improved drawing of log-chart gridlines. Now the gridlines in logarithmic charts behave more similar to Excel in border cases

  • Comments added with the API won't include a shadow. Now when you add a comment with the API, it won't include a shadow, same as modern Excel doesn't when you add a note. You can always use SetCommentProperties to add a shadow if you want to, and APIMate will show you the code.

  • Bug Fix. Excel could crash with files including charts with Soft edges effect.

  • Improved handling of linked text in autoshapes. Now FlexCel will preserve the properties of empty linked text in autoshapes. It will also handle better shapes with text linked to names that reference different sheets.

  • Bug Fix. Sometimes FlexCel could fail to parse formulas with hard-coded arrays which had strings inside.

  • Bug Fix. Conditional formats with iconsets where some values of the iconset were "No icon" could be saved wrong.

  • Bug Fix. Comments could lose or gain a shadow when converting from xls to xlsx or xlsx-strict. Also colors in the comments could be wrong in border cases.

  • Bug Fix. When renaming tables FlexCel wasn't renaming references in column formulas

  • Bug Fix. FlexCel could crash when rendering chart labels with "Value from cells" if the range existed but was null.

  • Bug Fix. Accessing some Conditional formats with inner borders could cause an Exception.

  • Bug Fix. FlexCel would not export to pdf 3rd-party files which had unreadable file properties.

  • Bug Fix. When using <#database.#rowcount> in expressions outside the sheet, you could get an exception.

  • Bug Fix. FlexCel could throw an exception when inserting columns in xls files with invalid external references

  • Bug Fix. FlexCel could throw an Exception when manually adding an autoshape to a chart that was created via the API.

  • Bug Fix. Better compatibility with files generated by FastReports. Excel ignores border style 0 and fill styles 0 and 1, and now FlexCel ignores those too.

  • Better handling of third-party xls files. Now FlexCel will convert the deprecated labels in biff8 xls files to sstlabels instead of keeping them as-is, allowing for much decreased memory usage when reading those files, and smaller result files.

  • Bug Fix. Text to autoshapes added with the API would always be left-aligned.

  • Bug Fix. FlexCel could report the BOM when reading custom XML parts inside xlsx files. Now the BOM is stripped out as it should.

New in v 7.9 - April 2021

  • Support for functions LAMBDA and LET. We've reworked the recalculation engine to add support for LAMBDA and LET functions. With Lambda, the calculation engine is now turing-complete.

  • Support for functions SINGLE, VALUETOTEXT and VALUETOARRAY. Added support for SINGLE, VALUETOTEXT and ARRAYTOTEXT functions.

  • Breaking Change: Deprecated Android support in Visual Studio 2017. As google Play is now requiring a target framework of Android 10, we can't ship Android support in VS 2017 since it supports up to Android 9. To deploy FlexCel to android, you will need to upgrade to Visual Studio 2019 or compile it manually with an older target framework.

  • Support for rendering multi-level labels in category axis. In Excel you can set a category axis to have more than one row/column, and Excel will render those multi-level ranges in a different way than normal ranges. Now FlexCel will behave the same.

  • Support for legend keys in chart labels. Now when exporting to PDF/HTML, if the option "Legend key" is enabled in the label options of a chart, FlexCel will render them.

  • Support for "Label contains Value from range" option in charts. Now FlexCel will correctly handle the "Label Contains: " "Value from Cells" options for chart labels available in newer Excel versions. They will be exported to PDF/HTML and APIMate will show the code to create them in your programs.

  • Improved drawing of x-axis in charts. Now FlexCel will automatically adjust the x-axis labels to 45 degrees if needed, and also take the space from near labels if those are empty.

  • TXls3DRange now supports an external filename. The object TXls3DRange now has a property with the filename, in case that the range is from another file. This allows to use external files in user-defined functions.

  • Hyperlink Base support. Now FlexCel will correctly preserve Hyperlink Base in xlsx files (it was already preserved in xls). Now the hyperlink base is also used when exporting to HTML, SVG or PDF.

  • Support for using an expression like <#joinedtable.tablejoined.*> to make a generic report in only one of the joined tables. Now when you join tables in the template you can use <#joinedtable.tablejoined.*> or <#joinedtable.tablejoined.**> to create a generic report only in the fields of that subtable.

  • The <#ref> tag can now use tags in its parameters. Now you can write something like <#ref(<#dataset.#rowcount>,3)>. Before this version tags were not allowed as parameters.

  • New property "IsCameraObject" in TImageProperties. The new property IsCameraObject lets you know if an image is a camera object or not.

  • Improved compatibility with xlsx files created by SoftMarker Office. SoftMaker office adds many extensibility points in places of the xlsx where they are not allowed. FlexCel complained about that, but in the new version we ignore the ones we could identify.

  • Axis labels will now render with a background color if they have one. Now the axis labels will render the background color if you assign a color to them.

  • Bug Fix. FlexCel would always render labels in the category axis as not "linked to source" even if they were.

  • Bug Fix. Labels which come from cells that are formatted to show negative values in different colors show with that color in Excel, except in pie charts. FlexCel used to ignore that color, not it will display it.

  • Bug Fix. When rendering xlsx charts, labels which were manually positioned would ignore the default numeric formatting.

  • Bug Fix. Structured references with text formatting could be saved wrong to new xlsx files.

  • Bug Fix. Rotated labels in charts could a little below or above from where they should go.

  • Bug Fix. FlexCel could fail to parse a formula where the sheet name started with some Unicode characters, like for example "※MySheet"

  • Bug Fix. When reading structured references in Virtual Mode, the structure reference text would be wrong since it wasn't calculated until after the sheet was loaded.

  • Bug Fix. FlexCel didn't preserve or render text linked to cells in shapes inside charts.

  • Bug Fix. FlexCel would allow you to name a sheet starting with a single quote ('), and that would cause an invalid file. Now the quote at the start of the name will be replaced by a "_" as other invalid characters do.

New in v 7.8 - November 2020

  • .NET 5 Support. The codebase has been updated to support .NET 5. Important : To use FlexCel in .NET 5, please update to at least this FlexCel version. .NET 5 changed string handing in Windows to use ICU, and that causes problems with older versions of FlexCel in Windows. See https://github.com/dotnet/runtime/issues/43736

  • Breaking Change: Removed support for .NET Core 2.0 and 3.0. We removed support for .NET Core 2.0 and 3.0 as both reached end of life. We keep supporting .NET Core 2.1 and 3.1. See https://dotnet.microsoft.com/platform/support/policy/dotnet-core

  • Support for switching Graphics engines in .NET Core or .NET 5. There is a new property in FlexCelConfig: GraphicFramework which allows you to select between using GDI+ in Windows (native) or SKIA (better compatibility with other platforms which use SKIA)

  • Support for reading fonts from the disk even if the graphics library returns that information. There is a new property in FlexCelConfig: ForcePdfFontsFromDisk which allows you to select if FlexCel should use the font data returned by the graphics library if possible, or always scan a folder with fonts.

  • Improved performance in the SKIA graphics backend for .NET 5. Now SKIA is faster than GDI+ in windows if you use it as the graphics library.

  • Improved compatibility with invalid xls files. Now FlexCel can ignore invalid ministreams when reading corrupt/invalid xls files.

New in v 7.7 - October 2020

  • SkiaSharp used by .NET Core updated to 2.80.2. We've updated the .NET Core code so it uses SkiaSharp 2.80.2

  • Improved handling of unknown parts inside xlsx files and improved Google sheets compatibility. Now FlexCel has a more solid implementation for preserving unknown parts and relationships inside xlsx files. This fixes issues that could happen when editing xlsx files generated by google sheets.

  • Bug Fix. When copying a sheet to a different file, ImageCount in the target file would return 0 even if there were images.

  • Bug Fix. FlexCel wouldn't allow some unicode characters in 3d formulas, while Excel would allow them.

  • Bug Fix. Improved support for camera objects. A new property MaxNestedCameraObjects allows to specify how many times a camera object can recursively draw itself.

  • Bug Fix. FlexCel could not read some files with deleted what-if tables.

New in v 7.6.4 - July 2020

  • New syntax for ALIAS DataSets. The ALIAS syntax introduced in FlexCel 7.1.1 could only be used in simple bands. The new "..ALIAS.." syntax doesn't have those limitations and can be used in all cases. Note that the old ALIAS syntax is still supported and you can use it for simple cases, but we recommend the new syntax for new development. Take a look at Alias bands in the report designer's guide

  • New "COUNT" parameter in <#Aggregate> tag. The Aggregate Tag now accepts "Count" as aggregating method.

  • Bug Fix. Now nested <#aggregate> and <#list> tags will be put in master-detail if they are related.

  • Bug Fix. When inserting cell ranges with multiple rows used as data by pivot tables, the pivot table might not adapt correctly.

  • Bug Fix. Sometimes when copying only format from cells, and the cells had only a column or row format, the format wouldn't be copied.

  • Bug Fix. When exporting to HTML both headers and footers would be ignored if you specified THidePrintObjects.Header, and THidePrintObjects.Footer was ignored. Now footers will work with THidePrintObjects.Footer and THidePrintObjects.Header will only hide the headers.

  • Bug Fix. Fixed issues with <#evaluate> tag when it evaluates recursively

  • Bug Fix. Some invalid third party xls files could fail to load.

New in v 7.6.2 - June 2020

  • SkiaSharp used by .NET Core updated to 1.68.3. We've updated the .NET Core code so it uses SkiaSharp 1.68.3

  • Bug Fix. When adding a chart to a file via the API and immediately rendering it to PDF without saving it, the chart might not be rendered in the PDF file.

  • Bug Fix. Previously the last row in "X" Bands in reports was deleted before the detail bands were inserted. This could cause unwanted behavior if the details shared the same rows as the master. Now last rows in X Bands will be removed after the details are inserted.

  • Bug Fix. A fixed band inside a master-detail bidirectional report would behave as non fixed.

New in v 7.6.1 - May 2020

  • Improved conversion from strings to numbers. Now FlexCel will behave more like Excel when converting strings to numbers, and convert for example the string "(1)" to the number -1.

  • Bug Fix. Deeply nested array formulas could return N/A results in some corner cases

New in v 7.6 - May 2020

  • Support for rendering logarithmic charts. Now FlexCel will render logarithmic charts to PDF or HTML.

  • When rendering pages to PDF and PNG, if an image or chart goes over the columns or rows in a page, now it won't overflow. In previous FlexCel versions, if an image spilled over to the next page, it would also go over the last cell in the current page.

  • SkiaSharp used by .NET Core updated to 1.68.2.1. We've updated the .NET Core code so it uses SkiaSharp 1.68.2.1

  • Now FlexCel will search in c:\Windows\Fonts and %localappdata%\Microsoft\Windows\Fonts for fonts when exporting to PDF. Windows 10 version 1809 introduced the concept of "local fonts", that is fonts that are installed for the current user only. (see https://blogs.windows.com/windowsexperience/2018/06/27/announcing-windows-10-insider-preview-build-17704/ ) So now FlexCel will search in the traditional Windows fonts folder and the current-user-font-folder by default. You can always change the behavior with the GetFontFolder event. See the new section about fonts in Windows inside the PDF exporting guide

  • Now FlexCel won't throw an Exception if a Font folder in the PDF FontFolder path doesn't exist. Now when you specify multiple paths in the GetFontFolder event, FlexCel won't show an error unless none of those paths exist. In previous version, if you returned for example "c:\mypath1;c:\mypath2" and mypath2 didn't exist, FlexCel would shown an error. Now it will only show an error if both mypath1 and mypath2 don't exist. You can change this behavior with the new property OnFontFolderNotFound

  • Improved handling of chart gaps when there are null values. In Excel 2003, an area chart would never have a gap: Null values would be considered 0. After Excel 2007, area charts can have gaps. FlexCel behaved like Excel 2003, never showing gaps for area charts. Now FlexCel will behave like Excel 2007 when reading newer xls/x files, while still behaving like 2003 when reading old xls files.

  • Bug Fix. Sometimes when calling RenderObjects the border of a chart would not be exported to PDF or PNG.

  • Bug Fix. Leader lines in stacked bar charts were wrong when the axis was reversed

  • Bug Fix. Manually positioned labels in stacked bar charts were a little offset from their manual position.

  • Bug Fix. Now FlexCel will draw a maximum of 10000 ticks per axis in charts, to avoid taking too long drawing too many ticks that aren't visible anyway.

  • Bug Fix. Xlsm files containing macros and with sheet names starting with a number and bigger than 24 characters, could generate invalid files when saved in FlexCel.

  • Bug Fix. Now FlexCel will validate when manually setting a sheet codename, that the name is ASCII and starts with a letter.

  • Bug Fix. Bidirectional reports could fail to delete rows or columns in complex reports.

  • Bug Fix. FlexCel would consider a protected range title containing a "?" invalid. This would prevent it from loading files that used "?" in protected ranges.

New in v 7.5 - April 2020

  • Support for adding charts to a sheet with the API (xlsx files only). A new method AddChart will allow you to add a chart to a sheet in xlsx files, which you can then customize with other methods like AddSeries. There is a new demo Chart API, and as usual, APIMate will show how to add a chart similar to one in Excel. Note that this method will work only in xlsx files, not xls.

  • New methods SetTitle, SetOptions, SetChartLegend, SubchartCount, GetSeriesInSubchart, SetSeriesInSubchart and AddSubchart in ExcelChart. The new method SetTitle will allow you to set the title of a chart. SetOptions will allow you to customize the properties of the chart. SetChartLegend customizes the legend or adds a new one. SubchartCount will tell you how many subcharts there are in the main chart. GetSeriesInSubchart and SetSeriesInSubchart allow you to read or set one series of one subchart. AddSubchart adds a new subchart to the chart. Note that the methods are only for xlsx files.

  • New set method in the properties PlotArea, Background in ExcelChart. PlotArea can now change the properties of the plot area like the position or fill color. Background can now change the background of the chart. Note that all the methods here will only work in xlsx files.

  • Now SetSeries and AddSeries, DeleteSeries work also in xlsx charts. SetSeries, AddSeries and DeleteSeries now work in xlsx charts the same as they work in xls charts.

  • Support for calculating the upcoming XLookup, XMatch, RandArray and Sequence functions. FlexCel can now calculate the functions XLookup, XMatch, RandArray and Sequence which are coming to Excel in July 2020.

  • Better chart rendering when there are date axis. Now in some cases of date axis, FlexCel should render them better.

  • Support for .NET Core 3.1. Now there is a specific dll for .NET Core 3.1.

  • Breaking Change: Removed support for .NET Core 1.0 and .NET Standard 1.5. We've deprecated support for .NET Core 1.0 and .NET Standard 1.5 as both reached end of life.

  • Support for importing bullet lists when importing html. Now when calling SetCellFromHtml, doing reports from html strings, or in general when importing html into a cell, FlexCel will import ordered and unordered bullet lists (<ol> and <ul>).

  • Preserving and adapting single cell mappings in XML Maps in xlsx files. Now FlexCel will preserve and modify the references to single cells in an XML map inside an xlsx file.

  • Improved compatibility with invalid third party files. Now FlexCel will ignore some parts of the xlsx file that should exist but might not when the xlsx files are manually edited. This will allow you to open those files anyway if there are no more errors besides that one.

  • Bug Fix. FlexCel wasn't calculating conditional formats if the formulas defining the conditions were array formulas.

  • Bug Fix. FlexCel could fail to process some files where a shape had an ending coordinate smaller than the starting coordinate.

  • Bug Fix. When rendering charts you could get an index out of bounds in some corner cases.

  • FlexCel will ignore invalid themes when reading xls files. Now when an xls file has an invalid theme, FlexCel will ignore it and just use the default theme instead of throwing an exception. This is the way Excel behaves.

New in v 7.1.1 - January 2020

  • New __ALIAS postfix in named ranges allows multiple ranges to the same database. Now if you need to define 2 names to the same dataset in the same sheet, you can name them like "__dataset1__ALIAS_SomeUniqueId" and "__dataset1__ALIAS_OtherUniqueId". Take a look at Alias bands in the report designer's guide

  • Bug Fix. Effects for an image in the background of an image could be incorrectly saved. In some cases, this could cause Excel to crash.

  • Bug Fix. When using a not standard row height for the whole sheet, FlexCel would create new rows to have automatic height, instead of having the standard row height for the sheet. This could confuse Excel.

  • Bug Fix. FlexCel will now check that font sizes saved are between 1 and 409 points. Before it would let you save any font size, and invalid font sizes would crash Excel when opening the file.

  • Bug Fix. The report designer failed to start.

  • Bug Fix. In some corner cases charts saved by FlexCel inside xlsx files would fail to load.

New in v 7.1 - December 2019

  • Support for .NET Core 3. While the dll for .NET core 3 preview still works in the final .NET core, we have now tested and released an official .NET core 3 build.

  • Improved chart rendering. Many small tweaks. We now support different line cap and join styles. The chart axis now goes above bar charts but below line charts. There is support for arrows at the end of lines in charts. The legend items draw a little larger to be more like Excel. And many more details.

  • Reports can now use nested properties in Aggregates, Filters, Sort and Master-details relationships. Now in the config sheet you can filter or sort by a nested property, like for example sorting in the value of field1.field2.field3. Also you can use nested properties in relationships and in aggregates like <#aggregate(max;table.field1.field2.field3)>

  • Now for reports you can set semi-absolute references in the config sheet. Besides the old way to set semi-absolute references with SemiAbsoluteReferences, now you can change the setting directly in the config sheet. There is also a new tip on what semi-absolute references are.

  • Now you can use report expressions that call themselves recursively, as long as the recursion converges. Now you can have a <#tag> that depends on other <#tag2> which at the end depends on <#tag1> again, as long as it is not an infinite recursion. FlexCel now limits the number of recursions via the new property ExpressionRecursionLimit

  • Improved recalculation speed and decreased memory usage. We've fine tuned the calculation engine so it is faster and uses a less memory. We've also added 2 new methods: StartBatchRecalcCells and EndBatchRecalcCells. When you are doing multiple calls to RecalcCell you can speed up the recalculation by writing the calls between Start/EndBatchRecalcCell calls.

  • Breaking Change: Removed overload method ExcelFile.GetImage(Integer, string, TXlsImgType, TStream). The method ExcelFile.GetImage(Integer, string, TXlsImgType, TStream) was confusing, because the ObjectPath (the second parameter), was always ignored. To use the objectPath, you needed to use GetImage(Int32, String, TXlsImgType, Stream, Boolean) and set the last parameter to true. If you were passing an empty object path, then you could just call GetImage(Int32, TXlsImgType, Stream)

  • The HTML engine can now parse <font style> tags. When setting a cell or a RichString from an HTML string, the old FlexCel could parse HTML like font color="red" or font size=3 but not font style="color:red;size:16px" Now both ways are supported.

  • Support for calculating BAHTTEXT function. Now FlexCel can calculate BAHTTEXT.

  • Improved compatibility with invalid xlsx files. Now FlexCel will ignore some missing parts in a corrupt xlsx file the same way Excel ignores them.

  • Bug Fix. FlexCel might not preserve comment backgrounds in xlsx files if the background was an image or texture.

  • Bug Fix. FlexCel would nor correctly read or write left and right cell borders in strict xlsx files.

  • Bug Fix. FlexCel was failing to render images which had an image filled background.

  • Bug Fix. FlexCel could fail to open some files which didn't completely implement the xlsx spec but which Excel could open.

New in v 7.0 - August 2019

  • Breaking Change: Support for rendering charts inside xlsx files. We have fully rewritten the charting engine so it can now render charts inside xlsx files too. As charts inside xlsx files are completely different from charts inside xls files, this support meant that we had to modify some of the APIs to retrieve the chart information. If you are manually retrieving chart information like the color of the plot area or the title of a chart, some methods might have been moved or changed, so this is why this is a breaking change. But for most uses, nothing should break.

  • Support for Visual Studio 2019, .NET Framework 4.8 and .NET Core 3 preview. Now FlexCel supports .NET core 3 and .NET Framework 4.8. And the setup will offer integration with visual studio 2019.

  • Removed FlexCel-Portable for windows 8.1. As Windows 8.1 reached end-of-life support in January 8, 2018, and the reason we kept FlexCel-Portable81 was to target Windows 8.1, we decided to remove it. Due to lack of sync APIs in Win8.1, FlexCel-Portable was a completely different API from all the other FlexCel versions, which made it more difficult to share code, both for us and for you. For UWP apps you should now use FlexCel-UWP or FlexCel for .NET Core.

  • UWP Support updated to version 6. We updated the dependency in FlexCel-UWP to version 6, and now the minimum required Windows version is Windows 10 "Fall Creators Update"

  • Breaking Change: Improved compatibility with "Autosave" in Excel 2019. When OptionsCheckCompatibility is set in a file, Excel disables the Autosave function. To avoid accidentally writing this setting and thus diabling the Autosave function, now FlexCel will ignore this option by default and not write it to xlsx files. If you really want to save this setting to the file, you now also have to set ForceUseOptionsCheckCompatibility to true.

  • FlexCel will now generate "faux" bold and italics when exporting to PDF. When exporting to pdf and the used font doesn't have italics or bold variants, FlexCel tries to simulate the styles by making the pen wider (for bold) or slanting the characters (for italics). The method used in older FlexCel versions only worked when not embedding the fonts, but today most fonts are (and should be) embedded. This new FlexCel version creates "faux" italics or bold variants even when the fonts are embedded. To turn this feature off, you can use the property UseFauxStyles property in FlexCelPdfExport .

  • Ability to specify different fallback fonts for italic, bold or bold-italic variants when exporting to PDF. In addition to the existing FallBackFonts property in FlexCelPdfExport we have now added 3 new properties: FallBackFontsBold, FallBackFontsItalic and FallBackFontsBoldItalic. If set to empty (the default) then FlexCel will keep looking for fonts in the usual way with FallBackFonts. But if you have fonts that have only regular, bold, italic or bold-italic variants, now you can specify different fall back fonts for each. So for example, you could use "Font1Bold" as a bold fallback, and "Font3Regular" as the regular fallback.

  • GetHtmlFromCell now can add the cell formatting to the resulting string. The old version of GetHtmlFromCell would return only the format of the rich string inside the cell, but not include the format of the cell itself. So if a cell was formatted as bold, but inside there was a plain "text" string, GetHtmlFromCell would return "text", and expect the text was hosted inside a table cell with style bold (<td style="bold">text</td>). Now there is a new parameter "includeCellFormatting" that when true, FlexCel will return "<b>text</b>" so you can use it outside formatted td tags.

  • Breaking Change: Support for semantic theme colors. We added 4 new values for TThemeColor : Dark1, Light1, Dark2 and Light2. In the xlsx specification, there are 12 theme colors, which include "Dark1/2" and "Light1/2" variants. In Excel cells, the text color is "Dark" and the background color is "Light". But in drawings or charts, you can use 4 semantic colors: "Text1", "Text2", "Background1" and "Background2". While those colors are mapped Text->Dark and Background->Light, it is possible to manually edit an xlsx file and change the mapping. So now FlexCel differences between TThemeColor (which now includes semantic colors) and TPrimaryThemeColor which includes only the 12 real theme colors and no semantic colors. Most of your code should stay the same, but if you are changing themes in code, you might need to replace some instances of TThemeColor by TPrimaryThemeColor. This is a compile-time breaking change: If your code compiles then nothing is broken. If your code doesn't compile anymore, you need to change TThemeColor by TPrimaryThemeColor where the compiler complains, and the code will keep working like before.

  • Breaking Change: Most properties in TDrawingRichString are now nullable. Properties like bold or italics in a TDrawingRichString now can have a null value, which means that the value of the parent should be used. This change shouldn't affect most uses of TDrawingRichString, but if you were manually parsing DrawingRichStrings, you might now need to check if the nullable properties have a value before using them.

  • The <#evaluate> tag in reports can now evaluate a string multiple times. There is a new optional parameter in the evaluate tag in reports that allows you to evaluate a string multiple times. This is useful if you store tags in the database itself. For example, if you have a field in the database named "Expression" with value "<#other tag>", then <#evaluate(<#db.expression>;2>)> will evaluate first the value of expression, find out it is <#other tag>, then evaluate again <#other tag> and write the value of other tag in the cell.

  • Support for creating or reading xlsx files with uncompressed size bigger than 4 Gb. FlexCel now uses the Zip64 file format automatically when creating xlsx files which won't fit in a standard zip container. It also can now read xlsx files saved with Zip64 file format.

  • New overloads for DeleteSheet allow to delete a sheet by its name or index. There are now 2 new variants of DeleteSheet. The first variant will let you delete a sheet given its name -- DeleteSheet("sheet1") --, and the other will let you delete n sheets since some index -- DeleteSheet(SheetIndex, NumberOfSheetsToDelete)

  • Improved bidirectional text handling. We updated the Unicode bidi algorithm to the latest version, and added support for glyph mirroring and bracket matching algorithm. This should render right-to-left text in a way that is more compliant with the Unicode standard.

  • Improved drawing of autoshapes. Excel 2007 changed the way in which it draws autoshapes in many small but visible ways. We made some tweaks in the autoshape algorithms and color handling routines to make autoshapes render even more like Excel 2007 and not Excel 2003.

  • Improved drawing of gradients and conversions from xls to xlsx. We did a big rewrite of the gradient-handling code to better support the newer gradient styles in xlsx.

  • Improved drawing of patterns and conversions from xls to xlsx. All pattern rendering code was reviewed and updated to better match Excel. Now every pattern style is exported to pdf/html/printed/etc.

  • Improved rendering in iOS, macOS, Android and .NET Core. The rendering engines for CoreGraphics (used in iOS and macOS), SKIA (used in .NET Core) and Android have been updated to generate more accurate rendering of Excel files.

  • Improved support for Excel themes. We've improved the theme engine to better handle files with wrong data in the themes. Now FlexCel can fix those files when you save them.

  • Improved compatibility when saving strict xlsx files. While the strict xlsx files FlexCel created before were valid, now we create files that are more similar to what Excel creates when you save as strict xlsx.

  • Improved compatibility with invalid files created by third-party tools. Now FlexCel can read files which have invalid cell references in the cell table, ignoring the reference completely as Excel does.

  • Improved conversion between strict and transitional xlsx files. Now when preserving full parts of the xml of a strict or transitional file, FlexCel will convert the namespaces accordingly if you save as transitional or strict respectively.

  • Function Cell("filename") now returns the filename. Now FlexCel can recalculate cell with Cell("filename"), which can be used to know the sheet where a cell is. Note that for security reasons, FlexCel won't return the folder there the file is, only the filename.

  • Breaking word in hyphens. Now FlexCel will break words in hyphens when it has to fit multiple lines of text, same as Excel does.

  • Breaking Change: The Links property of TSheetSelector now is a readonly list of TSheetSelectorLink. Now Links in TSheetSelector contains not only the name of the html sheet but also the name of the corresponding excel sheet. If you were using this property, you will need to use Links[index].HtmlSheetName instead of Links[index]. Anew method GetHtmlSheetNameFromExcel allows you to easily find the associated html sheet name from an Excel sheet name.

  • Bug Fix. Some non visual characters like "right to left mark" were exported to pdf, even when they are invisible. Now they don't show in the generated pdfs.

  • Bug Fix. FlexCel won't let you save files where tables have 0 rows of data, since that would become an invalid xlsx file. Now it will raise an exception if trying to save such file.

  • Bug Fix. FlexCel won't let you enter empty array members anymore, like in the formula ={1,,2} which would create an xlsx file which could crash Excel. It will also automatically remove spaces before and after the element, so the formula ={ 1, 2, 3 } will be entered as {1,2,3}. Before this version, the formula ={ 1, 2, 3 } would be considered invalid.

  • Bug Fix. When autofitting columns with line feeds (character 10) inside, FlexCel might fail to recognize them and try to fit everything in one line.

  • Bug Fix. Arrows in lines were not scaling when printed or exported at a zoom different from 100%.

  • Bug Fix. In html exporting, a cell which expanded over adjacent cells could cause the output to shift if there were hidden columns in the middle.

  • Bug Fix. When exporting a file as HTML with tabs for sheets and there were hidden sheets between sheets, the links in cells to a different tab could be incorrect.

  • Bug Fix. FlexCel for .NET core would fail to create PDF/A files.

  • Bug Fix. Some hyperlinks in xls files could return an empty string when read, even if they had data.

  • Bug Fix. Lines with 0 width were not showing in SVG files.

  • Bug Fix. Sometimes when copying cells between files the indexed colors could be converted to similar but not equal RGB colors.

  • Bug Fix. When using the SKIA/Android graphic stack some lines in the charts could appear not connected.

New in v 6.26 - March 2019

  • In Reports now you can reference tables which include dots by writing <#[db.something].field>. Now you can use square brackets in both the table name or field name to reference tables or fields which include dots. This is useful especially for reports from classes as shown in the new Advanced LINQ example.

  • SkiaSharp used by .NET Core updated to v1.68. We've updated the .NET Core code so it uses SkiaSharp 1.68

  • Improved compatibility with LibreOffice/OpenOffice. LibreOffice/OpenOffice can't at the time of this writing understand indexed colors inside xlsx files. Now we introduce a new property (false by default) named XlsxCompatibilityConvertIndexedColorsToRGB which when true, will make FlexCel convert the indexed colors to RGB colors when saving xlsx files. Set it to true if you have xlsx files with indexed colors and you want them to be compatible with Libre/OpenOffice.

  • Now FlexCel won't throw an exception when reading custom properties in an xls file if the values of the property aren't defined. Either because of corruption or because they were created with a tool that created wrong files, some xls files might end up having a custom property but no value associated with them. FlexCel was throwing exceptions when you tried to read the properties of those files, but that didn't allow you to get other properties which might be set correctly. So now FlexCel will just ignore those errors.

  • Bug Fix. FlexCel would fail to read xlsx files with formulas that contained unknown user-defined functions that returned a reference type.

  • Bug Fix. FlexCel will now render labels in a 100% stacked chart as the values, not the percent in the charts.

  • Bug Fix. If an xlsx file contained negative offsets to a shape, FlexCel could render the shape incorrectly.

  • Bug Fix. FlexCel will now render labels in stacked charts more like Excel renders them.

  • Bug Fix. When rendering charts, if the axis was reversed and the labels were aligned to the right, FlexCel would render them to the left and vice-versa.

New in v 6.25 - February 2019

  • New parameter in ATLEAST tag in reports allows for the number of rows of a dataset to be multiple of a number. Now when using ATLEAST you can specify that the number of rows must be a multiple of some number. That is, that the dataset must have for example 20, 40, 60... rows but not 30 or 45. Take a look at the new Fixed Footer demo

  • Improved handling of invalid "," in numeric formats. A comma in a numeric format means "thousands separator" if it goes after the 3rd digit, like in "#,000". But when a comma is at the end of the format, it means scale: A format like "0," means divide the number by 1000. FlexCel already handled those cases correctly, but there are some "impossible" cases like "0,0" which are not actually valid but might be saved to xlsx files. FlexCel was interpreting that the "," in some of those cases meant scale, while for the same cases Excel was interpreting "thousands separator". Now we should behave like Excel even in the invalid cases.

  • FlexCel could fail when rendering cells with more than 32000 characters. A cell in Excel is limited to 32767 characters, but a string in GDI+ is limited to 32000 characters. So if a cell had between 32000 and 32767 characters, FlexCel would raise an Exception when rendering the file because GDI+ would fail to render the string. Now it should render correctly.

New in v 6.24 - January 2019

  • The INDIRECT function can now understand structured references in tables. Now FlexCel can calculate formulas where INDIRECT references a table. For example if you have a table named "Table1", FlexCel will now understand a formula like =SUM(INDIRECT("Table1[Column1]"))

  • Breaking Change: Cell indent is now printed and rendered to pdf/images proportional to the print scale. Before this version, FlexCel behaved just like Excel and kept the cell indent always the same no matter the print scale. Now we behave in a more logical way, and if the print scale is 50%, the cell indents will be 50% smaller. If you want to revert to the old behavior (which is how Excel behaves), there is a new property CellIndentationRendering which allows to control this behavior and revert it back to what it was. For more information read the new section about cell indentation in the API guide.

  • The examples for Android show a newer way to share the documents. The revised examples for Android now use a sharing method that is compatible with Android Nougat or newer. There is new documentation available at the Android guide

  • New methods SetRange3DRef and TrySetRange3DRef in TXls3DRange. The new methods SetRange3DRef and TrySetRange3DRef allow you to set a 3D range from a string like "=Sheet1:Sheet2!A1:A3"

  • DbValue in reports now supports fields with dots. DbValue tag in reports will now work with fields with dots like "data.value"

  • Bug Fix. When deleting columns the data validations formulas could be adapted wrong.

  • Bug Fix. When a line in rich text inside a text box had a length 0 (an empty line), the font might not be preserved for that line.

  • Bug Fix. FlexCel considered some special characters like "°" in a name to be invalid when they are not. This could cause that opening and saving an xlsx file with names like that would make Excel crash opening the file.

New in v 6.23 - November 2018

  • Updated minimum Required Android version to 8.0 Oreo. As required by Xamarin and Google Play, now the minimum supported Android version is 8.0 (API Level 26). We removed calls to deprecated methods and now require methods only available in API Level 26 or newer.

  • New methods UnshareWorkbook and IsSharedWorkbook in ExcelFile. The method UnshareWorkbook allows you to remove all tracking changes from an xls file. (FlexCel doesn't preserve tracking changes in xlsx files). IsSharedWorkbook allows you to know if an xls file is a shared workbook.

  • New method PivotTableCountInSheet in ExcelFile. The method PivotTableCountInSheet returns the number of pivot tables in the active sheet.

  • Support for calculating function RANK.AVG. Added support to calculate the Excel function Rank.AVG which was introduced in Excel 2010. See supported excel functions.

  • Now you can find see the call stack in circular formula references when you call RecalcAndVerify. Now RecalcAndVerify will report the call stack that lead to a cell recursively calling itself, making it simpler for you to track those down in complex spreadsheets. Take a look at the modified Validate Recalc demo with a file with circular references to see how it works.

  • Bug Fix. Some xlsx files with legacy headers could fail to load.

  • Bug Fix. The function IFNA could in very rare corner cases return #N/A if its first parameter was #N/A instead of returning the second parameter.

  • Bug Fix. There could be an error when copying sheets between workbooks and the sheet copied had a shape with a gradient.

  • Bug Fix. Floating point numbers that were either infinity or not-a-number were saved wrong in the files and Excel would complain when opening them. Now they will be saved as #NUM! errors. Note that this only happened if you set a cell value explicitly to Double.NAN or Double.Infinity. Formula results which were infinity or nan were already handled fine.

New in v 6.22 - October 2018

  • Support for Excel 2019. Because we support Excel 365 and changes in Excel 2019 are a recollection from the changes in office 365 from 2016 up to now, FlexCel already supported Excel 2019. For example, support for recalculating the new functions introduced in Excel 2019 was introduced by FlexCel 6.7.16 back in march 2016. But this new FlexCel version adds a new TRecalcVersion.Excel2019 enumeration which will avoid the question about saving for changes when closing the file. It also adds a "v2019" enumeration to TFileFormats, which allows you to specify you want the file to identify itself as office 2019 and comes with empty 2019 files to be created with NewFile. Empty 2019 files are virtually identical to empty 2016 files, but the colors "Accent1" and "Accent5" in Excel 2016 are swapped to correspond to "Accent5" and "Accent1" respectively in Excel 2019.

  • Reports now can use tables as datasources. Now you can use Excel tables as sources for reports. Take a look at the new Tables as datasources demo and the section about excel tables in the Report designers guide.

  • New method to rename tables. The new method RenameTable can rename a table to a newer name, changing all references in formulas to the new name.

  • New Debug mode for Intelligent Page Breaks. Now you can use the property DebugIntelligentPageBreaks in a report, or the methods DumpKeepRowsTogetherLevels and DumpKeepColsTogetherLevels in the API to debug how intelligent page breaks are working. Look at intelligent page breaks in the API Guide for more information on how to use the feature.

  • Better drawing of conditional formats at very low or high zoom levels. Now icons and databars in conditional formats dynamically adjust the margins to look better at high or low zoom levels.

  • Bug Fix. Cell indent was not being considered when autofitting rows or columns.

  • Bug Fix. FlexCel wouldn't let you rename a sheet to the same name but with different upper or lower cases.

  • Bug Fix. CountIF, CountIFs and similar xIf/xIfs functions could return ERRNA if one of the conditions was an unknown user function, instead of returning 0 as Excel does.

  • Bug Fix. The function Rank.EQ was ignoring cells with errors while Excel returns the first cell with error if any cell in the range has an error.

  • Bug Fix. Inside a <#preprocess> section of a report a <#delete row> or <#delete column> tag could end up deleting the wrong column.

  • Bug Fix. Error when calculating What-If tables that had their variables in a different sheet.

  • Bug Fix. When deleting rows in reports with multiple levels of intelligent page breaks the engine could calculate more page breaks than necessary.

  • Bug Fix. FlexCel will now validate that a table isn't named the same as a defined name or vice-versa, to avoid creating invalid Excel files.

  • Bug Fix. When rendering a file to pdf or images FlexCel could pick the wrong normal font in very rare cases.

  • Bug Fix. APIMate could report code that wouldn't compile for embedded xml content.

New in v 6.21.6 - September 2018

  • Updated SkiaSharp to 1.60.3. FlexCel will now use SkiaSharp 1.60.3

  • Improved Linux support. Many small bug fixes and updates to the Delphi Linux support.

  • Bug Fix. FlexCel would fail to load "Strict Open XML files" with formulas which returned dates.

  • Bug Fix. FlexCel could crash when rendering xls files with rare images.

New in v 6.21.5 - August 2018

  • Bug Fix. FlexCel could fail to parse complex structured references in tables.

  • Bug Fix. Formulas that referred to different files could refer to the wrong sheet on those linked files in some rare cases.

  • Bug Fix. the IFERROR function could give a #VALUE! error in some cases when used chained with other functions.

New in v 6.21 - July 2018

  • Bug Fix. If a "rows to repeat at top" or "columns to repeat at left" range was outside the print area, FlexCel would ignore it, while Excel will use it anyway. Now FlexCel behaves like Excel and uses the repeating range even if it is outside the print area.

  • Bug Fix. When in R1C1 mode, full ranges expanding more than 1 row or column like for example Sheet1!3:5 could be returned as Sheet1!5 only.

  • Bug Fix. Sometimes cells formatted as "center on selection" were not rendered when exporting them to pdf or html.

  • Bug Fix. When hiding a column without a given width and the default column width was different from the Excel default, the column wouldn't be hidden when saving as xls.

  • Bug Fix. There could be an error in ClearSheet with some special images.

  • ApiMate now reports hidden sheets. ApiMate will now tell you how to hide sheets.

  • Improved chm help. The chm help shipped with FlexCel could show javascript errors in some Windows versions.

New in v 6.20 - June 2018

  • Full support for reading and writing Data Connections in xlsx files. Now you can use the new methods GetDataConnections and SetDataConnections for reading and writing the data connections in xlsx files. As usual, APIMate will show you the commands needed to enter new DataConnections. Note that the new methods only work in xlsx files, not xls, and there is no support for refreshing data queries from FlexCel. Only to read or write connections.

  • Improved performance with thousands of merged cells. We rewrote the merged cell handling engine to make it faster and work better when there are thousands of merged cells.

  • Breaking Change: Improved chart rendering. Now FlexCel recalculates the size of the legends of the charts if those are docked to the top, bottom, right, left or top-right. So if the size of the series change, the legend box and the rest of the chart will adapt. There are also other small tweaks in the chart rendering engine to make xls charts more faithful to what Excel shows. Note: The Excel chart engine has changed a lot since the Excel 2003 times, and Excel 2003 doesn't display charts exactly as Excel 2016. We can't make it work both ways, so this update makes the chart rendering more like Excel 2016. If you were rendering old files and relied in the exact position of the legend, this update might move the position of the legend a little, to position it how Excel 2016 would and not how Excel 2003 would. This is why it is a breaking change.

  • New overloads for methods SetCellFromString and GetStringFromCell now accept cell references. The methods SetCellFromString and GetStringFromCell now can use references like A1 or "Sheet1!B3". This is a shortcut in using a TCellAddress object to get the row and column from the reference.

  • New overload for method TPartialExportStart.SaveCss which allows to save the css without the <style> and </style> tags. There is now an overload of TPartialExportState.SaveCss with a parameter that allows to get the inner html of the classes definition, without the <style> and </style> enclosing tags.

New in v 6.19.5 - May 2018

  • Now functions CUMIPMT and CUMPRINC are supported when recalculating. Now FlexCel can recalculate the functions CUMIPMT and CUMPRINC

  • New methods GetTokens and SetTokens in ExcelFile allow you to parse arbitrary text. The new methods GetTokens and SetTokens allow you to parse any text into tokens and then convert those tokens back into a string. Those methods complement the existing GetFormulaTokens and SetFormulaTokens

  • The XlsChart object now returns the 3D properties for xls charts. Now you can read the 3D properties in charts inside xls files.

  • Improved Excel 95 compatibility. Now FlexCel can read some Excel 95 files which would throw errors before.

  • Now FlexCel preserves "new style" sheet and workbook protections in xlsx files. Both FlexCel and Excel use an old algorithm to compute sheet and workbook protections, and they both keep doing it this way as it is the only way to port the protections between xlsx and xls files. But some third-party generated files could have a newer style of protections which are incompatible with xls and FlexCel wasn't understanding them. Now FlexCel will preserve those new style protections in xlsx files too. The new style protections will be lost if you save as xls, but that happens in Excel too.

  • When wrapping text, now FlexCel recognizes different kind of unicode spaces. Now other spaces in addition of character 32 are used as separators when rendering the file and wrapping the text. Note that not breaking spaces (char 160) are still not used as separators as they aren't supposed to break a line.

  • Bug Fix. SetCellFormat with ApplyFormat could format the cells wrong if the cells were empty and there was column or row format applied.

  • Bug Fix. Sometimes when copying sheets form different files, some named ranges would not be copied.

  • Bug Fix. Khmer text could be rendered wrong is some rare cases.

  • Bug Fix. When exporting to pdf you could get an error if a character didn't exist and fallbackfonts was empty.

New in v 6.19.0 - March 2018

  • Support for Khmer language when exporting to pdf. The PDF engine in FlexCel now includes a Khmer shaper which is able to correctly create Khmer documents, as long as the Khmer fonts you are using are OpenType (that is they contain GSUB and GPOS tables).

  • Reduced memory usage when exporting. Exporting to PDF and SVG were tweaked to consume less memory in high-performance environments where many threads are exporting at the same time. Also the performance of the pdf engine was improved.

  • Updated the SkiaSharp library used in .NET Core to the latest. SkiaSharp used is now 1.60, and code was adapted to remove LockPixels/UnlockPixels which don't exist anymore. Note that due to this changes, FlexCel won't work anymore correctly with SkiaSharp 1.59.

  • Images made transparent with Excel now are converted between xls and xlsx files. Now FlexCel will convert the transparent color parameter between xls and xlsx files.

  • Bug Fix. In some cases after copying rows, then deleting sheets and then inserting or deleting rows, the formula bounds cache could be invalid and formulas would fail to update in the lase deleting of the rows.

  • Bug Fix. The round function now behaves more like Excel and not like C# in some border cases.

  • Bug Fix. Formulas with intersections of a name with a 3d range would be interpreted as #name instead of the correct formula.

  • Bug Fix. In some invalid cases the indirect function would throw exceptions that would be later processed. While the result was still ok, those exceptions could slow down a lot recalculation in a file with thousands of formulas.

New in v 6.18.5.0 - January 2018

  • New convenience methods SetCellValue(cellRef, value) and GetCellValue(cellRef). The new methods SetCellValue(cellRef, value) and GetCellValue(cellRef) allow you to set or get a cell value directly from a text reference like "A1" without having to use a TCellAddress class.

  • Support for shape connectors in xlsx. Now FlexCel will preserve connections between shapes in xlsx, and convert them from xls to xlsx and viceversa. We've also added the properties IsConnector StartShapeConnection and EndShapeConnection to allow you to enter connections with the API. As usual, APIMate will tell you the code needed to add a connector from an Excel file.

  • Bug Fix. The VLOOKUP and HLOOKUP functions now support wildcards (* and ?) in search strings.

  • Improved compatibility with invalid files generated by third-party tools. Some xlsx generators can write invalid column widths. Now when exporting to html/pdf, FlexCel will consider those widths as default (like Excel does) and not 0 (as it used to do).

  • Bug Fix. FlexCel could fail to parse some structured references in tables.

  • Bug Fix. When calculating UDFs and there were errors in the arguments, FlexCel could in some cases return #ERRNAME! instead of evaluating the UDF.

  • Bug Fix. In some files the calculated height for items inside Forms Listboxes was too big.

  • Bug Fix. FlexCel failed to read custom document properties saved in UTF16.

  • Bug Fix. Reports with DeleteEmptyBands = TDeleteEmptyBands.ClearDataOnly would not clear text inside textboxes or hyperlinks.

  • Bug Fix. In some bidirectional reports with report.DeleteEmptyBands = TDeleteEmptyBands.MoveRangeUp the tag text was not erased.

New in v 6.18.0.0 - December 2017

  • Support for default CryptoAPI xls encrypted files. Now FlexCel can read and write xls files encrypted with the CryptoAPI encryption. This is the default encryption algorithm for files created by Excel 2003 or newer. With this addition, all modes and encryption algorithms in both xls and xlsx are now supported.

  • Full support for manipulating XML Mappings in xlsx files. Now XML Mappings will be preserved when opening and saving xlsx/m files, and there are two new commands in the API to set them or read them with code. The new commands are GetXmlMap and SetXmlMap . As usual, APIMate will show how to use SetXmlMap. Note: The new API only works in xlsx/x files, not xls. Xml mappings inside xls files will still be preserved when opening and saving xls files, but not converted between xls and xlsx.

  • Bug Fix. Images made transparent with Excel tools might not preserve their transparency when saved as xlsx.

  • Bug Fix. in .NET Core 2.0 Exceptions thrown by FlexCel would display the message 'Secure binary serialization is not supported on this platform' instead of the actual error message.

  • Bug Fix. When rendering shapes with semi-transparent gradients to PDF or SVG the gradients were exported as fully opaque.

  • Bug Fix. Files with table slicers saved by FlexCel might not open in Excel 2013. (They already worked fine in Excel 2016, and Excel 2010 doesn't support table slicers).

  • Bug Fix. Rotated shapes inside groups in xlsx files could be rendered wrong.

  • Bug Fix. Groups that were flipped horizontally or vertically weren't flipped when rendering. Objects inside were flipped, but the groups themselves weren't.

  • Bug Fix. Filled polygons could be exported wrong to PDF in some border cases.

  • Bug Fix. Filled polygons could be exported wrong to images with the SKIA backend used in .NET Core and Android.

  • Bug Fix. Legacy system colors in drawings inside xls files could be rendered as transparent instead of the correct color in border cases.

  • Bug Fix. Xlsx files with complex gradients where the stops were not sorted could cause invalid PDF files.

  • Bug Fix. Textboxes with more than 8224 characters would corrupt the file when saved as xls.

  • Updated SkiaSharp to 1.59.2 for .NET Core. Now FlexCel will require SkiaSharp 1.59.2 when using it in .NET Core.

New in v 6.17.4.0 - November 2017

  • Breaking Change: Subtotal command allows more customization. Now the Subtotal command provides more parameters in the callbacks to allow for more customization. In addition, by default it will write a better text for non sum aggregates (like for example "Customers Average" instead of "Customers Total" if you are using the Average to aggregate). There is also a new example on how to use the command. Note: This is a breaking change if you are using the callbacks since now the callbacks have more parameters. But it is easy to fix at compile time, just add those parameters to the callbacks and recompile.

  • New SubtotalDefaultEnglishString command. Now the SubtotalDefaultEnglishString provides the string used by the different aggregate functions used in Subtotal . You can use this method as a parameter to subtotal to calculate the grand total and subtotal labels.

  • Ability to copy OLE objects between different files while using xlsx file format. Now the restriction that you can't copy sheets from one file to another if they have embedded OLE object has been removed for xlsx files. It is still not possible to copy sheets between different files with embedded OLE objects in xls.

  • Ability to read custom document properties in xls files. Up to now FlexCel could only read custom document properties in xlsx files. Now it can also read them in xls files. And now custom properties are migrated from xls files to xlsx too.

  • Better handling of URL encoding when encoding some filenames. Now some filenames containing some characters like "#" will be correctly encoded when linked from FlexCel. The events that allow you to manually define the links have a new parameter "UrlNeedsEncoding" which you can set to false to avoid all encoding by FlexCel if you provide an already encoded URL to the event.

  • Bug Fix. The Last print time document property wasn't read in xlsx files.

  • Bug Fix. When copying cells from one file to another autofilters would be copied even if they were not in the range being copied.

  • Bug Fix. Formulas referencing sheets which could be interpreted like a R1C1 cell reference (like "R3C5") were saved without quotes in the sheet name, and thus became invalid formulas.

  • Bug Fix. Modified and creation time were read in UTC, but saved in local time which would result in a different date being saved back. Now it is all handled in UTC.

  • Bug Fix. In some very complex bidirectional reports with sorting in the template the fields might end up not being sorted correctly, and some might appear twice.

New in v 6.17.3.0 - October 2017

  • New TFlxNumberFormat.PercentCount method. The new method TFlxNumberFormat.PercentCount allows you to know how many non escaped % symbols are in a format string.

  • Better display of negative zero numbers. Now a negative number that displays as zero like "-0.001" formatted with a "0.0" format string will display as "0.0" and not "-0.0"

  • iOS demos updated to require iOS 8 or later so they can be compiled with XCode 9. iOS demos targeted iOS 6, which isn't supported in XCode 9. Now we target iOS 8.

New in v 6.17.2.0 - October 2017

  • Better support of machine locale formats. Before this version, whenever you used a "machine dependent" date numeric format (those shown with * in Excel), FlexCel would use always 2-digit months, 2-digit days and 4-digit years. (as in 01/02/2000). Now it can use single digits for days and months, and 2 digits for years (as in 1/2/00) if your machine locale is set to a format that uses those.

  • Improved xls chart rendering. Now series which are in hidden columns or rows won't count as series at the moment of drawing the chart, to better copy Excel behavior. Before this version those series would appear empty, but still take space in the chart.

  • Improved compatibility with invalid 3rd party xlsx files. Now FlexCel can open files where the case of the files inside the container is incorrect. This happens with files generated by "1C" database and might happen with other 3rd party files.

New in v 6.17.0.0 - September 2017

  • Full Support for Excel tables in xlsx files. This release completes the support for tables in the FlexCel API introduced in 6.11.

    • Tables are now exported to PDF/HTML/SVG/Images and printed with all the table formatting including banded columns and rows, etc. All formatting is supported.
    • Now FlexCel can recalculate the structured references used in tables. Everything is supported, from simple references like Table1[@column] to references in tables from another file. (for external table references you need to create a Workspace )
    • Complete API for adding, deleting or modifying tables with code. APIMate was modified to show how to use the new things in the API.
    • API for adding, deleting or modifying custom table styles. APIMate shows how to enter table styles with code.

  • Support for reading and writing Strict Open Xml files. Now FlexCel can read and write Strict Open XML spreadsheets. The default is to save to strict xml only if you opened a strict xlsx file and saved it, in the other cases we fall back to the standard transitional xlsx. There is a new property StrictOpenXml which you can set to force saving as strict xlsx, and read to know if the file you opened was strict xlsx.

  • Support for .NET Standard 1.5, 2.0 and .NET Core 2.0. FlexCel nuget package contains a .NET Core 2.0 assembly, and .NET standard assemblies. The .NET standard assemblies can be referenced in multiplatform projects and they will be replaced by the corresponding native assembly.

  • Ability to add autoshapes to charts. Now the existing method ExcelFile.AddAutoShape works also in chart sheets, and there is a new method ExcelChart.AddAutoShape that allows to add shapes to charts embedded inside a sheet.

  • FlexCel will now preserve embedded OLE objects in xlsx files. Now FlexCel will preserve embedded OLE documents (like for example a word document) in xlsx files.

  • Improved performance in reports with thousands of hyperlinks. Now FlexCel is much faster dealing with thousands of hyperlinks in reports.

  • <#row height> and <#column width> tags in reports now accept expressions. Now you can write something like <#row height(<#someexpression>)> where expression will be calculated at the moment of running the report.

  • Now FlexCel converts strings with timestamps to dates more like Excel. In Excel you can write a string with an invalid timestamp like "3:61" (3 hours 61 minutes, which is 4 hours 1 minute) and it will be accepted by the system. FlexCel was rejecting those timestamps, but now it accepts them just like Excel.

  • Support for #GETTING_DATA error in TFlxFormulaErrorValue. The enumeration TFlxFormulaErrorValue now contains a new ErrGettingData member which corresponds to the type in Excel. Also Error.Type function will return 8 for this error. Note that Excel doesn't save this error in xlsx files (it saves #N/A instead), but it does save it in xls files. FlexCel preserves it in both.

  • Better support for comments in xlsx file in high dpi. The size of the comments is preserved better now when ScreenScaling is > 0

  • Now ExcelFile.RenderObject can render shapes inside groups and use an objectPath parameter to specify the name of the object to render. There are new overloads in ExcelFile.RenderObjects and ExcelFile.RenderObjectAsSVG that take an objectPath parameter. This allows you to render an individual shape inside a group instead of the full group, and also to specify directly the name of the shape to render as in xls.RenderObject(1,"@objectname")

  • Reduced memory usage when loading fonts for exporting to PDF. We've optimized the pdf font engine so it uses less memory when loading the fonts.

  • Support for returning arrays with the INDIRECT function. When doing a Sum, SumIf or N of an Indirect function which returned an array, FlexCel worked like Excel 2003 or older and only used the first value of the array. Now it uses the full array in SumIf and N like Excel 2007 or newer, and in Sum, like Excel 2010 or newer. This allows you to write formulas like the ones mentioned here: https://www.pcreview.co.uk/threads/indirect-function-limitations.1750391/ Note that this formula behavior is exclusive to Excel 2010 or newer: Neither LibreOffice or Google docs implement it.

  • All examples available in Github. Now besides being available with the setup and at the documentation site the examples are also available on Github

New in v 6.16.0.0 - August 2017

  • User defined formats in reports. Now you can define a function in code that will format the cells depending on complex rules. Take a look at the new User Defined Formats demo to see an example on how to use them.

  • Now when signing PDFs, FlexCel will mark the generated files as requiring Acrobat 8. Due to known vulnerabilities in SHA1, signing with SHA1 is deprecated. So now the FlexCel signing demos have been modified to use SHA512. As SHA512 requires Acrobat 8 or newer, now the files will be marked as requiring Acrobat 8 or newer. Note that older acrobat versions will still be able to see the file, but they won't validate the signatures.

  • Added recalculation support for new functions. Added support for CEILING.MATH , FLOOR.MATH functions added in Excel 2013.

  • Improved behavior of CEILING/FLOOR functions. Now the existing CEILING, FLOOR, ISO.CEILING, CEILING.PRECISE and FLOOR.PRECISE functions are calculated more in the way Excel uses them, with a higher precision to prevent rounding errors like 1.00000...00001 to be rounded up to 2.

  • Breaking Change: Support for double underlines when exporting to pdf and refactored TUIFont. Now double underlines will be exported to pdf. In order to support this we had to remove the Underline and Strikeout parameters from the TUIFont definition, and put them in a separate TUITextDecoration structure. So now the DrawString methods in PdfWriter require a new TextDecoration parameter, and you don't specify the underline or strikeout anymore in TUIFont. Also as now TUIFont is different from GDI+ Font by not having underline into it, now you can't convert automatically between a Font and a TUIFont.

This change can break some code if you are using TUIFont and DrawString directly, but it should break at compile time and be straightforward to fix. Just create the TUIFonts without underline, and specify a text decoration when calling drawstring with those fonts. Take a look at the updated Creating pdf files with pdf api demo to see how it works now.

  • New methods TUIFont.CreateFromMemory and TUIFont.CreateFromFile. The new methods TUIFont.CreateFromMemory and TUIFont.CreateFromFile allow you to create TUIFonts from fonts not installed in the system.

  • Improved conversion of control points in autoshapes between xls and xlsx files. Now for some shapes like a roundrect or a smiley face are converted better to xlsx when read from xls files. The default control points for those shapes weren't converted correctly.

  • Now you can enter macros that refer to other files with the API. Now when you call AddButton or similar methods, you can use a macro that refers to a different file like file2!macro1. As usual APIMate will report the exact syntax to link to a different file.

  • Breaking Change: Added a new parameter to ExcelFile.RecalcRange. Now when you call RecalcRange you need to specify if the formula has relative references (as is the case in conditional formats, data validations and names) or if the references in the formula are absolute (as it is the case in normal spreadsheet formulas). Before this version RecalcRange assumed absolute references, so if you are updating existing code and want to keep the exact behavior just add ", false)" as last parameter. But make sure to review that the formula is not a relative formula.

  • Breaking Change: Bug Fix. The parameters MaxWidth and MinWidth of the <#column width> and <#row height> tags weren't working properly when autofitting. Now they work according to the docs. If you were using MaxWidth and MinWidth in <row height(autofit...)> or <column width(autofit...)> please review those tags and make sure minwidth and maxwidth are in the correct positions.

  • FlexCel will now check names of tables are valid when you create a table with the API. Now FlexCel won't let you name a table with an invalid name (like for example a name containing spaces).

  • Bug Fix. When the print zoom was bigger than 100% the maximum column to print could be calculated wrong.

  • Bug Fix. When evaluating data validations with CheckDataValidation introduced in FlexCel 6.15, INDIRECT functions using RC notation were evaluated wrong.

  • Bug Fix. When doing bidirectional reports with multiple horizontal master detail X ranges, the rows for the vertical ranges could be wrong.

  • Bug Fix. When a SPLIT tag was used inside a multiple master-detail relationship in a report the results could be wrong.

  • SKIA library updated to the latest. We have updated the code that uses the SKIA library in .NET Core to the latest version of the library. We removed calls to deprecated methods and replaced them with equivalent methods.

  • Bug Fix. When exporting arabic rich text with multiple formats in the same cell and a scale factor different from 1 to pdf the results could have the wrong font sizes.

  • Bug Fix. Row() and Col() functions would return 1 when called from <#Format range> or <#Delete range> tags. Now they return the row and column of the cell where the tag is written.

  • Examples and demos now use SQLite. The database used in the examples was migrated from SQL Server CE to SQLite. This was because SQL Server CE is deprecated by Microsoft.

  • Bug Fix. Setup wasn't correctly registering the .NET 4 and newer assemblies in Visual Studio, so those wouldn't appear in the "Add reference" dialog as Extensions. (They were still available if you browsed for them)

New in v 6.15.0.0 - May 2017

  • Ability to check and evaluate data validations. The new methods CheckDataValidation , CheckDataValidationsInSheet and CheckDataValidationsInWorkbook allow you to check if the values of a cell, sheet or workbook are in conformance with the data validations in those cells. You can also check if a value would be valid when entered into a cell with CheckDataValidation

  • Improved tagging of PDF Files. Now repeated columns and rows are tagged as artifacts and not real content. This will also fix a rare bug that could happen when exporting a file with "Columns to Repeat at left" to tagged pdf.

  • Improved HTML5 exporting. Updated the HTML5 exporting to comply with the latest HTML5 standard.

  • Improved bidirectional reports. Now you can make a bidirectional report where the vertical range doesn't cross the horizontal range, but just is contained exactly in the top and bottom coordinates of the horizontal range.

  • Improved unicode Bidi Algorithm. Updated the bid algorithm from version 3.0 to 6.3. Fixed errors that could happen when using invalid unicode characters.

  • Improved compatibility with invalid files. Now FlexCel won't throw an exception by default when the file has invalid hyperlinks. You can change this behavior by setting the new "ErrorOnXlsxInvalidHyperlink" property in ExcelFile.ErrorActions

  • Bug Fix. FlexCel failed to open some encrypted Xlsx files saved in Excel 2013 or newer where the key size in the algorithm to encrypt the file was different from the key size in the algorithm to encrypt the key.

  • Bug Fix. When exporting to html a merged cell which had columns or rows not hidden but with zero width or height could render wrong.

  • Bug Fix. Now you can query if a page break at row 0 exists. A page break at row 0 would mean a page break before the first row, and Excel doesn't obey it, but you might end up with such a page break when deleting rows. Now you can check if there is a page break on that row.

New in v 6.14.0.0 - April 2017

  • New documentation center. We've completely redesigned the documentation, including lots of new code examples, a tips and tricks section and much more. We've manually reviewed all the user guides to make sure they are up to date with the latest information. You can find the new documentation center at our website Note: This version removes support for integrating help in Visual Studio 2012 or older. For those versions you can't use F1 to get help and will have to manually search in the web or in the included chm file. Also, when you press F1 in FlexCel types you will be redirected to the FlexCel online help. Setup won't integrate the offline help anymore for any Visual Studio version.

  • Official support for .NET Core including graphics. Now FlexCel for .NET Core is out of the beta and fully functional. It now also supports creating pdf files, html, etc., using SkiaSharp for the graphics support.

  • Support for .NET 4.7. There is a new FlexCel.dll targeting .NET 4.7.

  • Improved Setup. Now the setup.exe for Windows will include .NET Core and Xamarin libraries and examples, so there is nothing extra to add. The nuget package flexcel-dnx for .NET Core has been now replaced by FlexCel.nupkg which supports all platforms that FlexCel supports. The setup will now automatically register the FlexCel NuGet package folder so you can just add it from Visual Studio.

  • Breaking Change: Deprecated Xamarin Components. Now we don't distribute FlexCel anymore via Xamarin Components. Those have been replaced by the TMS.FlexCel NuGet package. If your apps used Xamarin Components, remove them and add a reference to the TMS.FlexCel NuGet package.

  • Support for Web Addins, either of Content or Task pane types. Now FlexCel will preserve Web addins in xlsx files. There are 2 new methods in the API: ExcelFile.HasWebAddinTaskPanes and ExcelFile.RemoveWebAddinTaskPanes which you can use to know if there are any task pane addins in the file and remove them. The content addins are just objects and you can remove them with DeleteObject. You can find if an object is a Web Add-in by calling the new property TObjectProperties.IsWebAddin

  • Support for Table Slicers. Now FlexCel will preserve Table Slicers in xlsx files (xls files don't support them). Note that Pivot Table Slicers where already preserved, this refers to the new Table Slicers in Excel 2013.

  • New static method CreateKeepingAspectRatio in TClientAndhor allows you to fit an image inside a range of cells maintaining the aspect ratio of the image. You can either specify the 4 coordinates of the range where you want the image inside, and have the image centered or aligned inside that range, or you can leave one of the coordinates at -1. If you set Row2 or Col2 at -1, then this method will create an image that fits in the other Col1-Col2 or Row1-Row2 respectively, and keeps the aspect ratio.

  • New method SetTable allows to modify existing Tables. While you could modify existing tables by using RemoveTable and AddTable, now you can modify them directly with SetTable.

  • New DrawBorders method in ExcelFile allows to quickly draw a border around a range of cells. This new method is just a shortcut for calling SetCellFormat but it is a little easier to discover and use.

  • Now you can specify multiple folders with fonts when exporting to pdf. Now in the OnGetFontFolder event of a FlexCelPdfExport you can return a list of strings separated by semicolons. So you can return a string like "c:\font1folder;c:\font2folder" and FlexCel will search for the fonts inside font1folder and font2folder.

  • Now <#includes> in reports will balance in the containing band. Now when you include a subreport in a report, the main parent will be balanced as it is with ranges inside ranges.

  • Bug Fix. When "Precision as displayed" was set to true in the file options, the recalculation engine could calculate some values with a different precision than the one in the cell.

  • Bug fix. When a file with dates starting in 1900 had a linked formula to another file with dates stating in 1904 the value of the dates in the 1904 file would be considered to be at 1900. Similar for a 1900 file linking to a 1904.

  • Bug fix. In some rare cases when changing a style an exception could be thrown.

New in v 6.13.2.0 - February 2017

  • New method XlsFile.AddAutoShape to add autoshapes with the API. The new method allows you to add an autoshape to a file. As usual APIMate will provide you with the needed code.

  • Support for Visual Studio 2017 RC. Setup now installs in Visual Studio 2017.

  • Support for .NET Core 1.1. Project.json was changed to a csproj in order to build in 1.1.

  • Support for drawing mirrored images when rendering. Now when a bitmap is flipped vertically or horizontally, FlexCel will also draw it like this when exporting it.

  • New method TCellAddress.DecodeColumn. This method is provided for symmetry with the existing TCellAddress.EncodeColumn, but it is normally not required as you can use TCellAddress to get the full cell address string for a row and a column. This method could be used in the rare case you only wanted the column string and not the full cell address.

  • Breaking Change: Support for losslessly rotated JPEG images. Now when inserting JPEG images that are rotated via the "orientation" attribute in the JPEG file, FlexCel will automatically rotate the image so it appears with the desired orientation in Excel. Before FlexCel behaved as Excel 2010 or older, just entering the image as is, so Excel would show it rotated. Now it works like Excel 2013 or newer, where we rotate the image in Excel to compensate. All orientation values are supported, included mirrors. Note that this change might be breaking if you were manually rotating the images before entering so they would show fine. If you ware rotating the images manually, you should remove the code as now it will be done automatically. There is also a new method ImageUtils.GetJPEGOrientation which you can use to tell if a JPEG image is rotated or not.

  • Bug Fix. When autofitting a column which contained multiple lines but the cell was set to not wrap, FlexCel would consider that the cell could wrap and so end up with a smaller column width than needed.

  • Bug Fix. Xml declarations when writing custom xml parts could be duplicated.

  • Bug Fix. When replacing hyperlinks in a shape with a report there could be an exception.

  • Bug Fix. Support for reading xlsx files with custom properties with repeated names or empty names.

New in v 6.13.0.0 - January 2017

  • Support for rendering Right-To-Left sheets. Now FlexCel can export sheets where A1 is at the right side of the page and the cells grow to the left instead of to the right. A new property XlsFile.SheetIsRightToLeft allows you to read or write the right to left state of the sheet directly without needing to use SheetOptions. APIMate will now also suggest SheetIsRightToLeft instead of SheetOptions for RTL sheets.

  • Improved right to left support for text. Now FlexCel will support mixed right to left and left to right text more as the Unicode BIDI algorithm defines it. The Context property of the cell is now also used to figure out if it is rtl text embedded in ltr text or ltr text embedded in rtl text.

  • New static properties ExcelFile.CompressionLevel, FlexCelConfig.XlsxCompressionLevel and FlexCelConfig.PdfPngCompressionLevel. Properties ExcelFile.CompressionLevel and FlexCelConfig.XlsxCompressionLevel are the same and control the zip compression level used to creating xlsx files. FlexCelConfig.PdfPngCompressionLevel controls the compression level for pdf and png files. FlexCel uses "zcDefault" zlib compression level, which normally gives the best ratio between speed and size. But note that Excel itself uses zcFastest when saving xlsx files, resulting in faster saves but also bigger files. While you won't probably want to change the defaults, now you can. Note: We require .NET 4.5 or newer for this property to work.

  • New static property FlexCelConfig.DpiForReadingImages. This new property FlexCelConfig.DpiForReadingImages allows you to force a resolution in the images you are loading. Normally FlexCel will use the resolution stored in the images to calculate the desired width in inches, but now you can override whatever is saved in the file by changing this property.

  • New implementation of wildcard matching for all functions that use them. The new algorithm to match patterns like * or ? and used in functions like MATCH or COUNTIF is now much faster and can use much less memory in pathological cases.

  • New method FlexCelReport.Run(Stream templateStream, Stream outStream, TFileFormats fileFormat). This method allows you to specify the resulting file format when running a report to a stream.

  • Better handling of expressions or formats defined both in an included report and the master report. Now when an included report has the same expressions or formats defined in the config sheet as the master, those local definitions will be used, instead of raising an error of repeated formats/expressions.

  • Breaking Change: Better handling of image resolution in reports. Now when adding an image to a report and resizing it, FlexCel will take in account the image resolution if it is saved in the image. If the image doesn't have a resolution saved, FlexCel will use the screen resolution. You can revert to the old way of assuming a resolution of 96 dpi for all images by changing FlexCelConfig.DpiForReadingImages

  • Bug Fix. When exporting to HTML and a merged cell covered hidden rows or columns, the resulting html could be wrong.

  • Bug Fix. When exporting to HTML with embedded SVG images, the fill colors in the SVG images would be wrong if there were gradients.

  • Bug Fix. When exporting to SVG, text in controls or shapes could go a little lower than it should.

  • Bug Fix. The formula parser would fail to detect some unicode characters as valid characters for a sheet name or named range.

  • Better display of complex numeric formats. Now we handle some complex formatting the same as Excel does, handling also invalid formats which Excel doesn't allow better.

  • Bug Fix. Now FlexCel allows names with spaces as macro identifiers when loading files. While those aren't valid names and Excel won't let you enter them directly, you can enter them with VBA code, and FlexCel was refusing to read those files. Now FlexCel will open them correctly.

  • Bug Fix. In .NET Core we could fail to read formulas

  • Bug Fix. When a file had "Precision as displayed" set and there were cell formats including percentage signs, the numbers might be rounded wrong.

  • Bug Fix. There could be an stack overflow when a camera object rendered a range of cells which included the cells where the camera object was.

New in v 6.12.0.0 - October 2016

  • Improved compatibility with Windows Phone devices. Some windows 8.1 devices have a bug that doesn't let them read resource files (resx). This means that FlexCel would fail when deployed to those devices, even if it would work in the simulator. To fix it, now FlexCel for Windows Phone and Windows RT doesn't use resource files.

  • Improved performance when creating tens of thousands of names in a file. Now when creating a file with tens of thousands of names FlexCel will be much faster.

  • Breaking Change: Bug Fix. In xls files, setting SheetProtection.Scenarios and SheetProtection.Objects had the reverse effect as in xlsx files. Now xls files behave the same as xlsx files. If you are changing the protection of xls files, review the calls to SheetProtectionOptions.Objects and SheetProtectionOptions.Scenarios as they might be reversed. If you are saving as xlsx files, then there is no need to change anything, as xlsx already worked as expected.

  • Better drawing of labels in charts. Now the labels inside charts draw more like Excel when exporting xls files to pdf or html. If multiple labels would overlap, now FlexCel tries to separate them. The leader lines in pie charts from the slices to the legends render better too.

  • APIMate will now suggest to use new TSheetProtection(TProtectionType.All/None) instead of new TSheetProtection(true/false). The constructors using true and false can be confusing, because while they work, they will set all the protection to true and false, and some protections work when the property is true (contents, objects and scenarios) while the others work when the property is false (all the other properties). The constructors using TProtectionType will set some values to true and some to false as needed to have all the sheet protected or unprotected.

  • Bug Fix. When copying sheets in a file, some conditional formats could raise a null reference exception.

  • Improved compatibility with third-party created files. Specifically, we now can read spreadsheets created with google docs which contain pivot tables. Those generate invalid xlsx files lacking required attributes, and FlexCel would complain about them missing. Now it will ignore them, and fix the files if you open and save them in FlexCel.

New in v 6.11.0.0 - September 2016

  • Support for Excel tables in xlsx files. There is partial support for tables in the FlexCel API.

    • Tables are preserved when editing xlsx files. Note that we refer to the tables introduced in Excel 2007: Other tables like "what-if" tables were already preserved.
    • Tables will be copied and modified when you insert or copy ranges.
    • API for reading tables
    • Preview API for writing tables. Note that this API is not complete yet and might fail in some cases. APIMate will show you how to add a table with the API.
    • There is no rendering yet (exporting tables to pdf, etc), and no calculation of table references like =SUM(@Table1[column2]

  • New properties FullRecalcOnLoad and FullRecalcOnLoadMode in XlsFile. FullRecalcOnLoad will tell you if the xlsx file opened with FlexCel had the property "Full Recalc on Load" true. When it is true, normally the file doesn't have the values of the calculated formulas and you need to do a manual XlsFile.Recalc() to get the values. FullRecalcOnLoadMode allows you to tell FlexCel how it should mark the files it creates. In the default mode it will mark them as not needing full calculation id they were calculated on save by FlexCel (the default) and mark them as needing recalc on open in other case. Note that those 2 properties only apply to xlsx files: xls files don't have this property and the value returned by those properties will always be false.

  • Some repeated function results are now calculated only once for better recalculation speed. Now FlexCel can detect repeated subexpressions inside a formula and calculate them only once. So for example if you have a thousand formulas like =If(A1,2,3... = Sum($B$1:$E$1000),1,Sum($B$1:$E$1000)) then the Sum($B$1:$E$1000) will be calculated only once for all the formulas. This can have significant speed improvements if you have formulas with this pattern.

  • Performance improvements in function calculations. Some of the most used functions like SUM, COUNT, AVERAGE, SUMIF, COUNTIF, etc have been optimized to work at a higher speed.

  • Performance improvements in formula parsing. Now the formula parser is a little faster and that can lead to faster loading of xlsx files with thousands of formulas.

  • Performance improvements loading xlsx files with thousands of comments. Now xlsx files with thousands of comments should load much faster.

  • Improved rendering of numbers which don't fit inside a cell. When a number doesn't fit inside a cell, Excel shows #### instead. But it will always show at least one #, if it can't fit a complete # into the cell, then it will display it empty. FlexCel was showing part of a # sign when a full # sign wouldn't fit, not it behaves as Excel and shows the cell empty.

  • Bug Fix. In form objects like checkboxes or listboxes saved by Excel 2007 in xlsx files, the resulting coordinates could be wrong if the value of the anchor took more than one cell. FlexCel would move the anchor to the next cell, but Excel just ignores the extra width or height. Note that this only applies to xlsx files saved by Excel 2007, xls files or xlsx files saved by Excel 2010 or later would be correctly read by FlexCel.

  • Bug Fix. When deleting sheets with locally stored defined names and you had multiple references to those names in a single formula, FlexCel could fail to update the names.

  • Bug Fix. When setting a column format for many columns at the same time and reset cells true, some cells might not be reset.

  • Bug Fix. Now FlexCel won't let you enter formulas with unions ranges of numeric or string values. Before it would allow you to enter a formula like "=1, 2" and it would be interpreted as the union of the reference "1" and "2". Excel would read it if saved as xls, but would fail to parse the formula when saved as xlsx. So now we don't allow those formulas anymore.

  • Bug Fix. While it is invalid to write a file with conditional formats or data validations with formulas that refer to other sheets, Excel can load them (but you won't be able to modify them). Now FlexCel can read those too without reporting an error.

  • Bug Fix. FlexCel could raise an exception when deleting ranges with conditional formats.

New in v 6.10.0.0 - August 2016

  • Support for converting conditional formats between xls and xlsx files. Together with the support for conditional formats in xlsx files introduced in 6.9, this completes full support for conditional formats in xls or xlsx files. Now the APIs to read and write conditional formats will work in both xls and xlsx, and conditional formats will convert seamlessly between xls and xlsx files, even formats not supported in the original xls97 spec.

  • Support for using formulas in "Text" conditional formats. Formulas weren't allowed in Excel 2007, and FlexCel 6.9 didn't allowed them either. Now they are fully supported, for Excel 2010 and newer.

  • Fixed small validation issues in the xml generated for xlsx files. Some xlsx files generated by FlexCel could have xml that would not validate against the xlsx reference files. Excel would still open those files, but the spec wasn't correctly implemented.

  • Breaking Change: Removed "IsPercent" property from Iconset Conditional Format definitions. IsPercent had no effect in IconSet rules and it is deprecated in Excel. As IsPercent was introduced in the previous version 6.9, it made sense to remove it before it got into wide use.

  • Bug Fix. Sometimes with very complex groups of conditional format rules, some could be ignored when exporting to pdf.

  • Bug Fix. Reversed iconsets were exported not reversed to pdf.

  • Bug Fix. When copying cells with conditional formats from one xlsx file to another, the borders wouldn't be copied.

New in v 6.9.0.0 - August 2016

  • Conditional Format support for xlsx files. We've added support for conditional format in xlsx files:

    • All xlsx conditional formats including the new ones added to xlsx in Excel 2010 are fully parsed and preserved. When you insert and copy ranges, conditional formats will adapt and be copied too.
    • Full support to read and write them with the API. APIMate also fully supports them and will show you the code you need to enter a conditional format into a file.
    • Full support for exporting all conditional formats to pdf or html. All formats are exported to pdf. When exporting to html, iconsets and databars are not exported, but they aren't exported either when you save as html in Excel. Different from Excel, we export the iconsets to pdf as vectors, so they will look nice in any zoom level.

  • Perfomance improvements in exporting. Exporting files to pdf or images is now faster. Depending in your files, you might see a visible improvement.

  • Performance improvements in CSV exporting. CSV exporting is now up to 2 times faster.

  • Breaking Change: Removed "classic" OSX and iOS components for Xamarin. Classic iOS and OSX components are no longer supported by Xamarin packaging and they are deprecated, so we aren't shipping them anymore.

  • Font could be wrong in linked shapes. When you had a shape whose text was linked to a cell and the value of the cell changed, the font of the shape text would be reset.

New in v 6.8.8.0 - August 2016

  • Bug Fix. When rendering superscripts in multiline cells, the distance between lines could be wrong.

New in v 6.8.7.0 - July 2016

  • Unknown root parts preserved in xlsx/m files. Now root parts which do not conform to the xlsx spec like ribbon customization or arbitrary parts are preserved when editing xlsx/m files.

New in v 6.8.6.0 - July 2016

  • User Customization parts preserved in xlsx/m files. Now the buttons that you add to the Quick access toolbar in the ribbon for only a specific document will be preserved when you edit the document with FlexCel.

  • Support for latest version of Xamarin Android. A change in Xamarin now requires a reference to Java.Interop: http://stackoverflow.com/questions/37788326/c-sharp-xamarin-java-interop-error

  • Bug fix. Some invalid png files could cause exporting to pdf to hang.

  • Bug fix. Fixed issues with resources in .NET Core

  • Bug fix. A chart with an empty array as range would throw an Exception when saving in xlsx files.

New in v 6.8.5.0 - June 2016

  • Controls and drawings in xlsx now are stored in the same hierarchy and a control can be below a shape. The xlsx file format introduced in Excel 2007 had controls and drawings in separate parts, so all controls were always above any drawing, and also it wasn't possible to group controls and images. Since Excel 2010 shapes and controls are also stored in a common stream so you can group them or put images above controls. Now FlexCel reads and writes the Excel 2010 parts if available, and correctly puts the controls below the images or grouped if needed. Note that this applies only to xlsx, it was always possible to group controls and images in xls.

  • Bug fix. Grouped shapes with more than 2,147,483,647 emus height (approximately 38,000 rows with standard row heights) would be truncated in xlsx files (xls files are always truncated anyway since that is a limitation of the file format).

  • Bug fix. External links could fail to load in xlsx files in Excel 2007. (Excel 2010 and up were already ok)

New in v 6.8.4.0 - June 2016

  • New XlsFile.RenderCells overload which allows to render objects and borders. Now RenderCells can render also the objects which are in the group of cells.

  • Support for rendering linked images (camera tool) to pdf/html/etc. Now FlexCel will update the linked images when rendering to show the correct image.

New in v 6.8.2.0 - June 2016

  • Support for preserving ActiveX controls in xlsx files. Now FlexCel will preserve ActiveX controls when you open, modify and save xlsx/m files. ActiveX objects are not converted between xls and xlsx files.

  • Form controls are now read from and written to the Excel 2010 stream besides the Excel 2007 stream. FlexCel now reads the Excel 2010 stream for Form controls and uses it if available instead of the Excel 2007 stream. It also now writes both an Excel 2007 and 2010 stream. The Excel 2010 stream is better because it saves the coordinates in device independent units, so controls will look fine when opened in High DPI displays. Excel 2007 on the other hand uses real pixels, which results in different dimensions for the controls when opened in high dpi mode.

  • Files created with NewFile will now not have printer settings, and the locale of them all will be English. Depending in the Excel version passed to NewFile, FlexCel could add some printer settings to the empty file, and some versions had different locales. Now all locales for files created by NewFile are US English, and there are never printer settings.

  • Support for camera tool (linked images) in xlsx files. Now "camera tool" pictures will be preserved when saving to xlsx, and converted between xls and xlsx. They will also update when you insert rows or columns. Note that FlexCel won't update camera tool images if the cells change, but they will be updated by Excel when you open the file.

  • New global variables TSmoothingMode.FlexCelDefault and TInterpolationMode.FlexCelDefault. Those new variables let you decide what is the default antialiasing and interpolation mode used when rendering images.

  • Breaking Change: Autoshapes in xls files are now rendered using the xlsx definition of them if it is stored in the file. Excel 2007 and newer save the autoshapes in two different places inside an xls (not xlsx) file: One that is read by Excel 2003 or older, and the other which is read by Excel 2007 or newer. FlexCel used to read the section of Excel 2003 or older to render the autoshapes, now it is using the section of Excel 2007 or newer. While in general this should improve autoshape rendering, note that this change is potentially breaking if you have files with the correct definition in the xls section and incorrect in the xlsx section. For more information, please see: https://tmssoftware.com/site/blog.asp?post=347

  • Recovery mode can now open files with invalid format strings. Now when XlsFile.RecoveryMode = true and the file has invalid format strings, FlexCel will open the file anyway and report the errors in FlexCelTrace.

  • Bug Fix. In some border cases when opening and saving a file multiple times and adding the same format every time, the format could be added each time instead of detecting it already existed.

  • Bug Fix. Some autoshapes with holes inside could be rendered as fully filled.

  • Bug Fix. Improved rendering of custom xls autoshapes

  • Bug Fix. There could be an error when saving pivot cache slicers or timelines in multiple sheets.

  • Bug Fix. Some colors in controls or shapes in xls files could be read wrong.

  • Bug Fix. Improved compatibility when opening invalid xlsx files.

New in v 6.8.1.0 - May 2016

  • Bug Fix. Some xlsx files manually edited could fail to load in .NET 2, 3.5, pcl or .netcore.

  • Added support for .NET Core RC2. Now the FlexCel for .NET core version supports (and requires) .NET Core RC2 (.NET Core SDK 1.0 Preview 1)

  • Bug Fix. Fixed error when exporting images to pdf in UWP 10 apps.

New in v 6.8.0.0 - April 2016

  • Support for Windows 10 Universal Apps. The dll FlexCelPortable 81 can now be used from Windows 10 Universal apps.

  • Full support of Hyperlinks in autoshapes in xlsx files. Now hyperlinks in shapes inside xlsx files are fully preserved as they were in xls files. They also will convert between xls and xlsx, and you can change the hyperlinks of the shapes with xls.SetObjectProperty. Links are exported to pdf, html and svg.

  • Full support for "Allow users to Edit ranges" in the API. The new methods XlsFile.Protection.AddProtectedRange, XlsFile.Protection.DeleteProtectedRange, XlsFile.Protection.ProtectedRangeCount and XlsFile.Protection.ClearProtectedRanges allow you to read and modify protected ranges. Note that for simple protection you can still just lock or unlock the cells in the cell formatting. APIMate should report now how to enter Protected Ranges too.

  • New <#Switch> and <#IFS> tags in FlexCel reports. Those tags behave like the IFS and SWITCH functions added in Excel 2016 january update. They can eliminate "if chains" and make the expressions simpler. For example &lt;#ifs(&lt;#value> &lt; 10;&lt;#format cell(red)>;&lt;#value> &lt; 20;&lt;#format cell(yellow)>;true;&lt;#format cell(green)>)>

  • Autosize of chart axis when rendering charts. Now when exporting xls charts to pdf/html/etc, the axis of the chart will move to fit the data in the axis so it doesn't get cut out.

  • New parameter convertFormulasToValues added to PasteFromXlsClipboardFormat. This parameter will allow you to paste the formulas as values from the clipboard. This is useful specially if the formulas you are pasting reference other books, so they won't reference the correct cells when pasted.

  • New parameter recalcBeforeConverting added to ConvertFormulasToValues and ConvertExternalNamesToRefErrors. This parameter will allow you to convert formulas to values without first having FlexCel recalculating the file (which was the default before). So if your file can't be recalculated by FlexCel because for example it contains links to other files that don't exist anymore, you can still convert the formulas to the latest calculated values.

  • New overload of FlexCelPdfExport.ExportAllVisibleSheets taking a filename. This overload is a shortcut for creating a filestream, calling BeginExport on the stream, then calling ExportAllVisibleSheets and then calling EndExport.

  • Support for ShrinkToFit attribute in cells when exporting to pdf/html/svg/images/printing/previewing. Now the ShrinkToFit attribute of cells is rendered when exporting, and will show in printing, previewing and exporting.

  • Support for adding horizontal scrollbars with the API. There is a new property in TSpinProperties which allows to specify if the scrollbar is horizontal. APIMate will report how to do it from a horizontal scrollbar in Excel.

  • <#IF> tag in reports can now omit the false section. You can now write a tag like <#if(true;hi)> instead of <#if(true;hi;)>

  • Better chart rendering for xls files. Now the labels overflow in a way similar to Excel, and FlexCel calculates the chart axis positions so t won't overflow.

  • The file created by XlsFile.NewFile(n, TExcelFileFormat.v2016) now is in the Excel "January update" format. The "January update" of Excel 2016 added some new fonts to the themes and changed the build id of a default empty file. Now the empty files that FlexCel generates when you specify v2016 include those new fonts in the themes. The build id had already been updated in a previous FlexCel release.

  • Bug Fix. When exporting xls bar and column charts with a single data series and "Vary colors per point" = true, FlexCel was not changing the colors on each point.

  • Bug Fix. When copying sheets with data validations to other files, and the data validations would refer to a list in a different sheet, the data validation would be copied wrong.

  • Bug Fix. When rendering conditional formats in xls files sometimes the background color could be ignored.

  • Bug Fix. The constructor of TBlipFill wasn't public.

  • Bug Fix. TXlsFile.DpiForImages would be ignored in some metafiles.

New in v 6.7.16.0 - March 2016

  • Support for the new functions introduced in the Excel 2016 January Update. Now FlexCel can recalculate and recognize the 6 new functions introduced in the Excel 2016 January Update : TEXTJOIN, CONCAT, IFS, SWITCH, MINIFS, MAXIFS.

  • Updated the RecalcVersion for Excel 2016 to the Excel 2016 January Update. The january update of Excel 2016 changed the RecalcVersion id saved in the xls and xlsx files. This means that xls or xlsx files saved with Excel 2016 "pre-january-update" would ask for saving when opened and closed in Excel 2016 "post january update". Now when you choose the RecalcVersion in FlexCel to be 2016, FlexCel will identify the file as saved by "post-january-update" Excel 2016. This will avoid the save dialog when opening in Excel 2016 with all the updates.

  • New value in TRecalcVersion: "TRecalcVersion.LatestKnownExcelVersion" will identify the file saved by FlexCel as the latest Excel version that FlexCel knows about. If you set xls.RecalcVersion to be TXlsRecalcVersion.LatestKnownExcelVersion then FlexCel will identify the file as saved by the latest Excel version it is aware of. Currently this means the files will be identified as saved by Excel 2016 january update. When newer Excel versions appear and FlexCel is updated to support them, then this version will automatically increase to the latest without needing to modify your source code.

  • New property UsedZoom in TOneImgExportInfo. The property UsedZoom will tell you the actual zoom that is going to be used when printing or exporting the sheet. So you now can call FlexCelImgExport.GetFirstPageExportInfo() and get the zoom of the pages that will be printed, including the zoom calculated for print to fit if set.

  • Improved compatibility with invalid xls and xlsx files. Now FlexCel will fix files which have an invalid active sheet stored, and set the active sheet to the first in those cases.

  • Improved compatibility with thid party xlsx files. FlexCel will now understand xlsx files which use absolute references like $A$3 in cell value addresses. Note that Excel never writes absolute references in the cell values addresses, but some third parties might. Now you will be able to read those files too.

  • Bug Fix. COLUMNS DataSet would not work inside a filter.

  • Bug Fix. When exporting sheets with multiple print ranges, and those print ranges had different zoom (due to having a PrintToFit zoom), FlexCel could raise an error. Now, similar to Excel, it will calculate the smallest zoom needed for all the ranges, and use that in all the print ranges.

  • Bug Fix. Rendering of images in headers and footers in xlsx files could be wrong if the sizes in the file were in mm.

New in v 6.7.12.0 - February 2016

  • New properties ExcelFile.HeadingRowHeight and ExcelFile.HeadingColWidth. Those properties allow you to specify the width of the heading column and the height of the heading row when printing headings or exporting them to pdf via FlexCel. The "Custom preview" demo now sets those properties so the sizes are automatic.

New in v 6.7.10.0 - February 2016

  • BugFix. When using TFlexCelImgExport.ExportNext to save to a file without transparency (like JPEG), the background would be black. Now it should be transparent if the format supports Alpha channels, and white otherwise.

New in v 6.7.9.0 - February 2016

  • New static events TUIFont.FontCreating and TUIFont.FontCreated. Those events allow you to customize the font replacements in your system. For example, if you have Excel files that have a font "MyDeprecatedFont" and you would want to replace it by "MyNewCoolFont" when exporting to pdf, you can use the FontCreatingEvent to do so. You can use the FontCreated event to catch fonts where the original wasn't present in the machine and were substituted by the operating system into something else. You can then provide a different substitute font.

New in v 6.7.8.0 - February 2016

  • Experimental support for .NET Core 1.0 and ASP.NET Core 1.0. There is a new nuget package included which can be used in .net core. As .net core doesn't have a graphics library yet, this package can only deal with xls and xlsx files, and has no graphics capabilities like exporting to pdf or html.

  • New methods OffsetRelativeFormula and RecalcRelativeFormula in ExcelFile. Those new methods allow you to know the real value of a relative formula, such as those returned by names and data validations. Relative formulas depend on the cell the cursor is, so if the cursor moves the formula changes. As FlexCel doesn't have a cursor, it always returns the formulas considering the cursor at A1. With OffsetRelativeFormula you can get how the formula would look like when the cursor is at for example B3, and with RecalcRelativeFormula you can recalculate the formula and get the result when the cursor is at B3.

  • Support for quoted column names in reports. Now you can quote a column name inside a tag in a report, like <#"db.column ) "> This can be useful if you have column names with for example unbalanced parenthesis. Note that you don't need to quote the name if it has balanced parenthesis.

  • Bug Fix. In some cases when opening an xls file with existing formats, and calling AddFormat for a format already present in the file, FlexCel would fail to realize the format already existed and create a new one. This could lead to having more formats than the number allowed by Excel if you opened a file, added existing formats and save it a lot of times.

  • Bug Fix. When <#including> subreports inside FlexCel Reports with the RC option, empty row formats would be copied to non empty row formats.

  • Bug Fix. ActiveX controls with a size larger than an Int32 would raise an Exception when loading.

  • Bug Fix. Bidirectional reports could fill some wrong cells when using multiple master-details in the rows.

  • Bug Fix. Xlsx files with autofilters could become invalid if you deleted the range which contained the autofilter.

  • Bug Fix. VLookup and HLookup would return a match if you searched for a blank string ("") and the cell was empty. Excel doesn't return a match in those cases, and now FlexCel doesn't either.

  • Bug Fix. Double bordered lines could render wrong when the zoom was big (about 200% or more)

  • Bug Fix. Some invalid formulas including more than one "=" sign in a not valid location, like "=1 + =1" didn't throw an Exception when you tried to manually enter them, and would raise the exception later when trying to save. Now FlexCel will report those formulas as invalid when you try to enter them.

New in v 6.7.3.0 - January 2016

  • New JOIN and UNION commands for reports. Those commands are written in the config sheet and allow you to either JOIN the columns of multiple tables into a single table, or to do an UNION of the rows of multiple tables into a single one. See the new "Join and Union" demo.

  • Improved bidirectional reports. Now bidirectional reports can work with rows in master detail and they also will delete empty column bands if none of the columns has records.

  • Improved preservation of timelines in xlsx. Timelines are a feature introduced in Excel 2013, which allow you to graphically navigate a timeline in a data source. Now FlexCel should preserve timelines for pivot tables.

  • Bug Fix. Fixed order of records specific for Excel 2010 to workaround a bug in Excel 2010. Some very complex files could raise an error when opened in Excel 2010, even when they were correct by the xlsx spec.

New in v 6.7.2.0 - December 2015

  • Copy to the clipboard now supports html. Now there is an extra option in the formats to be copied to the clipboard: In addition to native xls (best for copying from one spreadsheet to another) and text (for apps that don't understand anything else), now you can also copy as html, which gives the best results when pasting a spreadsheet in Microsoft Word or PowerPoint. You can copy to html either using XlsFile.CopyToClipboardFormat or FlexCelHtmlExport.ExportToClipboardFormat.

  • Bidirectional Reports. Now you can create ranges in shape of a cross that expand to the right and down at the same time. While you could do this before by splitting one of the ranges in 3, now you can directly intersect the ranges and get the correct result. Take a look at the new Bidirectional Reports demo and the documentation in the report designer guide.

  • Changed default fallback fonts in pdf. Windows 10 doesn't come with MS Mincho or MS Gothic installed by default (you need to manually install the language packs to get the fonts). So now FlexCel looks for both MS Mincho/Gothic (for windows older than 10), and YuMincho/Gothic for Windows 10.

  • The tags <#List>, <#DbValue> and <#Aggregate> can now work inside nested Array/Linq datasets. Now when you have a master detail relationship where the detail is a property of the master, FlexCel can find the master dataset for the <#List>, <#DbValue> and <#Aggregate> even when they are not added with AddTable.

  • New property XlsFile.DocumentProperties.PreserveModifiedDate. FlexCel by default sets the modified date of the files it saves to the date when the file was saved. But if you want to change this date to an arbitrary date, then you can set PreserveModifiedDate to true.

  • FlexCel will now set the creation and modification date in xls files too. Now Creation and Modification dates are stored in xls files, same as they already were in xlsx.

  • FlexCel will now allow you to set the file creator for xlsx files. By default, files created by FlexCel are identified as created by FlexCel in the document properties. Now you can change the application creator by writing xls.DocumentProperties.SetStandardProperty(TPropertyId.NameOfCreatingApplication, "SomeNewCreator")

  • Bug fix. LastModifiedDateTime wasn't returned correctly for xlsx files.

  • Bug fix. Macros converted from xls files to xlsx could fail to open in Excel 2016 in some border cases.

  • Improved Getting Started document. Now GettingStarted shows actual code examples on how to do simple tasks and contains links to all documentation.

New in v 6.7.1.0 - November 2015

  • Support for new Excel 2016 features. While old FlexCel versions will still work fine with Excel 2016 (as expected), FlexCel now provides support for new extra features in Excel 2016. Now XlsFile.NewFile allows to create files like Excel 2016 creates by default. Also XlsFile.RecalcVersion has a 2016 option to tag your files as created by Excel 2016 so Excel 2016 doesn't ask for saving when closing them.

  • Improved support for DataValidations that have lists with cells from other sheets. DataValidations with lists of cells from other lists were introduced in Excel 2010, and while FlexCel preserved them, it wouldn't modify them when inserting or deleting ranges. They wouldn't either be reported by the API. Now they are modified and also reported by the API, just like all the other data validations.

  • Slicers for Pivot Tables are now preserved in xlsx. Now FlexCel will preserve the slicers for pivot tables present in xlsx files. This is a feature available only in Excel 2010 or newer, so you won't see them in older Excel versions, but the generated files will still open without errors.

  • Excel 2010 equations are now preserved in xlsx. Now FlexCel will preserve the new equations in Excel 2010 (Ribbon->Insert->Equation)

  • Center across selection cells are now exported to html. Now html export will export cells marked as "center across selection", same as exporting to pdf or other exports already did.

  • Improved exporting of superscripts and subscripts to html. Now superscripts and subscripts are exported better to html files.

  • Full support for formulas attached to textboxes or autoshapes. Now FlexCel will preserve and convert betwen xls and xlsx textboxes or shapes which have their text linked to a formula. If you modify the linked cell, the text in the textbox will change.

  • New methods XlsFile.SheetID and XlsFile.GetSheetIndexFromID. Those new methods can be used to identify a sheet in a FlexCel session and get it back later. Note that as this ID is not saved in the file, it will change every time you load a new file and so it can only be used in a single session.

  • New static property "UseLegacyLookup" in FlexCelReport. If you set this property to true, FlexCel will use DataViews to do lookups in DataSets instead of the new and faster internal lookup, Set this property to true only if your existing reports rely in bugs in the DataView implementation.

  • Data validations entered manually in xls files could fail to work when opened in Excel. In some border cases, Excel would report all values as invalid for a data validation entered with FlexCel, even if the values were valid. This only applied to xls files.

  • Now FlexCel can open xlsx files with images with the wrong image type. If an xlsx file now contains for example a png but it is declared as jpg, now FlexCel will open it as a png anyway. This will only happen with corrupt files or files generated by incorrect third-party products.

  • Error when deleting rows in a pivot table. When deleting rows in a pivot table in an xlsx file, the rows could go negative creating invalid files.

  • Improved compatibility with third-party tools. Workaround for some tags not understood by other third-party tools, and now we can read files missing some required records.

New in v 6.7.0.0 - September 2015

  • Support for opening xls versions from 2 to 4. As FlexCel already supported xls 5 and up and Excel 1 doesn't exist for Windows, this completes the support for all versions of xls. While xls versions from 2 to 4 aren't in wide use, they are still used by other third-party libraries.

  • Enhanced High DPI Support in FlexCelPreview. Now FlexCelPreview supports High DPI in Windows, besides iOS or OSX as it already did.

  • Breaking Change: Property Resolution in FlexCelPreview has been removed. The property Resolution of FlexCelPreview has been removed because now FlexCelPreview automatically adjusts to the resolution of the monitor.

  • Full support for background images in a sheet. XlsFile adds two new methods to deal with background images in a sheet: SetSheetBackground and GetSheetBackground. Background images are now converted between xls and xlsx. ApiMate will also report the code to add a background image to a sheet. A new property ExportSheetBackgroundImages allows you to print or export the background images. (note that Excel never prints the background images, so this property is false by default)

  • Full support for manipulating Custom XML parts with XlsFile. The new methods CustomXmlPartCount AddCustomXmlPart, GetCustomXmlPart and RemoveCustomXmlPart in XlsFile allow for reading and writing the custom xml files of an xlsx files, as explained here: https://msdn.microsoft.com/en-us/library/bb608618.aspx ApiMate will now show how to enter custom xml parts in an xlsx file.

  • New property for PDF files: InitialZoomAndView. The new InitialZoomAndView property allows you to specify the initial page and zoom when opening the document.

  • New property for PDF files: PageLayoutDisplay. The new PageLayoutDisplay property allows you to specify if to display one or two pages, and continuous scrolling or one page at a time when opening the document.

  • Two new modes for PDF files PageLayout. Now generated PDF files can use a PageLayout of TPageLayout.OptionalContent to show the optional content panel, or TPageLayout.AttachmentPanel to show the attachments panel.

  • New property ScreenScaling in XlsFile. This new property allows you to workaround Excel bugs when working in high dpi displays. For more information read https://www.tmssoftware.com/site/blog.asp?post=311

  • Better handling of stored numbers in xlsx. Now numbers are saved in xlsx with a roundtrip format, which ensures the number we write in the file is exactly the same number that will be read.

  • Ability to <#insert> empty names in reports. Now when you use the <#include> tag in a report, you can leave the name to include empty. This will mean to insert all the used range in the active sheet.

  • New overload for XlsFile.DeleteRange. There is a new option for XlsFile.DeleteRange, which will clear the cells but not the formats on it: It will behave similar to when you press "Delete" in a range of cells in Excel.

  • New property ExportEmptyBands in FlexCelReport. ExportEmptyBands replaces the existing ExportEmptyRanges property which has been deprecated. It allows you to choose between 3 possibilities when the data table has 0 records: Delete the range and move cells up, clear the data and format of the range, or clear only the data.

  • Bug Fix. Now FlexCel will make sure the xml declaration in the custom xml parts added with AddCustomXmlPart have the same encoding as the encoding being used to store the file.

  • Bug Fix. Xlsx files with external formulas referring to other sheets starting with a number weren't quoted, and Excel would report an error when opening those files.

  • Bug Fix. FlexCel would fail to load files with formulas which pointed to tables in other files with the new table formula syntax.

  • Breaking Change: Improved lookup tag in reports. The <#lookup> tag in reports has been rewritten to be faster and behave better. IF you are defining your own VirtualDataSets and overriding the Lookup function you might need to rewrite it, as parameters changed. But with the new base lookup implementation that is now available for all, you might just remove the override and use the base.

  • Bug Fix. Subtotal function could recalculate wrong in border cases.

  • SPLIT Datasets in Reports can now be used as datasets for sheets. This allows you to overflow a report into multiple sheets. When the data in a sheets reaches the maximum of the split, it will continue in a different sheet. A new sample "Overflow sheets" shows how to do it.

  • Copy to clipboard wasn't working in Excel 2013. We modified the clipboard format so now it is working.

  • Bug Fix. When inserting or deleting columns, array formulas located in other sheets might not update to take in account those changed rows or columns.

  • Bug Fix. Sometimes when moving a range array formulas which pointed to that range might fail to update.

  • Bug Fix. Some functions with array arguments could not be calculated correctly when the formula was not an array formula.

  • Bug Fix. The lookup tag introduced in 6.6.32 could fail if the lookup value was a tag in the template

  • Bug Fix. The functions SumIfs, AverageIfs and CountIfs could give wrong results in some cases.

  • Bug Fix. When rendering a chart with an image inside, there could be an exception.

  • Bug Fix. Images inside charts with negative coordinates weren't rendered.

  • Bug Fix. Now scatter charts behave like Excel, and if any of the x-axis values is a string, it will be rendered as a line chart instead.

  • Bug Fix. XlsFile.SetAutoRowHeigth wouldn't work if the row was empty.

  • Bug Fix. Chart rendering now renders charts where all values are 0.

  • Bug Fix. Chart rendering now respects the label positions next to axis, high and low.

  • Bug Fix. ExportEmptyBands introduced in 6.6.25 wouldn't work in detail reports.

  • Bug Fix. In some cases when generating reports and exporting them to pdf directly without saving them as xls/x, there could be a range check error.

  • Bug Fix. Tabs inside text in autoshapes now will render as 8 spaces. (note that we don't use the tab definitions from the autoshape, so this is an approximation)

  • Bug Fix. When exporting to bitmaps, the bitmaps where a little bigger than the page size

  • Bug Fix. Reports using LINQ could raise an Exception in some cases with null values.

  • Improved compatibility with invalid xlsx files generated by third parties. FlexCel can now read some invalid formulas written in xlsx by other third-party products.

New in v 6.6.23.0 - April 2015

  • Visual Studio 2015 and .NET 4.6 support. Support has been added for the latest Visual Studio and .NET betas.

  • Fix for the latest Xamarin version. Xamarin changed how encodings behave when they don't exist: Before they used to raise an Exception and now they return null. This broke the fallback support in older FlexCel versions, and has been fixed now.

  • Bug Fix. There could be an error when rendering error bars in charts and there were missing values.

New in v 6.6.22.0 - April 2015

  • New property SheetView in XlsFile allows you to set the page view mode and zoom for each mode. Now you can see or set the page view mode in a sheet (normal, page layout or page break preview). You can also specify the zoom for each of the modes. As usual, APIMate will show you the syntax.

  • New property LinksInNewWindow for FlexCelHtmlExport and FlexCelSVGExport. When you set LinksInNewWindow to true, both FlexCelHtmlExport and FlexCelSVGExport will export the hyperlinks in the file to open in a new window.

  • Links to local files and to current workbook are now exported in TFlexCelHtmlExport. Now links to local files or other cells in the current workbook are exported to html. This allows for navigating inside a file. Links in the current workbook work even when exporting to different tabs.

  • Breaking Change: XlsFile.AddImage(row, col, TUIImage) now takes in account the declared image dpi. Now if you are calling AddImage without specifying the dimensions, FlexCel will use the dimensions corrected by the dpi declared by the image. This is the same way Excel works. In previous FlexCel versions we always assumed a 96dpi image.

  • Rendering of error bars in xls charts. Now when exporting to pdf/html/etc, FlexCel will draw error bars. All modes (StdErr, StdDev, fixed, percent, custom) are supported.

  • Improved display of line charts. Now colors and sizes of lines in xls charts will be read from the new xlsx records on it if they exist. This leads to a more faithful rendering, because the xlsx records have extra information, like for example a line width that isn't restricted to 4 sizes.

  • TXlsNamedRange.GetRanges is now public and documented. GetRanges will return an array with the ranges composing a name. So if you for example have a name with the range "1:1, A:A", GetRanges will return an array with 1:1 and A:A. This method can be used to parse the PRINT_TITLES range.

  • Improved display of markers in charts. Now markers in charts render much more alike Excel 2013, with the new options for images, etc.

  • Bug fix. XlsFile.FillPageHeaderOrFooter could return an extra "&" character at the end in some cases.

New in v 6.6.21.0 - January 2015

  • Better Xamarin package for osx. The Xamarin package used to copy the files in the "osx" folder, now it copies to "mac" to comply with the new naming.

  • New UsePrintScale property in FlexCelHtmlExport. If you set the new property FlexCelHtml.UsePrintScale to true, then the exported html will use the scaling of the printed sheet instead of being exported at 100% zoom.

  • Bug fix. Some JPEG images weren't recognized as such.

  • Bug fix. Reports might not read expression values when tags had a default value, like <#value;0>

  • Bug fix. Sometimes FlexCel could fail to load an xlsx file with different images with the same extension but different case (like image1.png and image2.PNG)

  • New parameters in FlexCelPdfExport.AfterGeneratePage and BeforeGeneratePage events. The new parameters are the XlsFile being exported, the FlexCelPdfExport component doing the export, and the current sheet.

  • Improved RecoveryMode. Now FlexCel can recover more types of wrong files when RecoveryMode is true.

  • When drawing xls charts, we now use the options for not plotting empty cells. This option was introduced in Excel 2007, and FlexCel was ignoring it. Now if you choose not to ignore hidden rows or columns, the chart will render as expected.

  • New method XlsFile.RemoveUserDefinedFunction. XlsFile.RemoveUserDefinedFunction allows to unregister a previously registered UDF for recalculation.

  • Breaking Change: Now when drawing chart labels that have N/A! error as result, FlexCel won't draw them. Excel 2003 or older is different in the way it draws #NA! errors in chart labels from Excel 2007 or newer. In older Excel versions, the label would just draw as #NA!. In newer Excel versions, it doesn't draw. To be consistent with more modern Excel versions, now FlexCel won't draw them either when exporting to pdf or html.

  • FlexCelReport can use also arrays besides IEnumerable<T> for detail bands. When using IEnumerable as data source, now you can use a fields which are array<T> instead of an IEnumerable<T> as detail tables.

  • New NOGRAPHICS define. If you define NOGRAPHICS and undefine GDIPLUS in the FlexCel project properties, you'll get a build which doesn't depend on any drawing engine.

  • New DOTNETZIP define. If you define DOTNETZIP in the FlexCel project properties and add a reference to it, you'll get a build which uses dotnetzip instead of System.IO.Compression.

  • Bug fix. In some cases, when pasting a file with autofilters from Excel you could get a range error. This is because Excel copies the filter in its totality and part of the filter might be outside the range copied. Now FlexCel will resize the autofilter if it extends beyond the copied range.

New in v 6.6.11.0 - December 2014

  • Support for recalculating 31 new functions introduced in Excel 2013. Support has been added for: DAYS, ISOWEEKNUM, BITAND, BITOR, BITXOR, BITLSHIFT, BITRSHIFT, PDURATION, RRI, ISFORMULA, SHEET, SHEETS, IFNA, XOR, FORMULATEXT, COT, ACOT, COTH, ACOTH, CSC, CSCH, SEC, SECH, ARABIC, BASE, DECIMAL, COMBINA, PERMUTATIONA, MUNIT, UNICHAR, UNICODE

  • Subtotal command in XlsFile. There is a new command xls.SubTotal(...) which works the same as the command "Subtotal" in the Excel Ribbon, "Data" tab. While you shouldn't use this when creating new files, it can be useful for formatting old files. For new files, it is best to just create the subtotals in place.

  • New option "ExcelLike" in XlsFile.Sort. Now when doing a XlsFile.Sort command you can choose between the correct way to handle formulas (this was the only option before) or the "Excel" way of handling formulas, where references are not updated when a row is moved of place in the sort. The ExcelLike mode doesn't adapt formulas that reference those rows, but it can be much faster for tens of thousands of records.

  • New methods IsRowMarkedForAutofit and IsColMarkedForAutofit in XlsFile. The new methods will return true if a row or column was marked for autofit.

  • New property ExcelFile.AllowEnteringUnknownFunctionsAndNames. If you set this property to true, you will be able to enter unknown functions inside formulas, like "=SomeText()". Excel will show the result as a #NAME! error. When this property is false (the default) FlexCel will raise an Exception if the name is not know, which is better to detect misspells.

  • New properties XlsFile.RecalcVersion and FlexCelReport.RecalcVersion. This new properties allow you to specify the Excel version that last calculated the file. If you set it to for Example Excel 2010, any Excel newer than Excel 2010 will recalculate the file on open, and ask for saving changes when you close the file. Excel 2010 or older won't recalculate the file on open. If you want every version of Excel to recalculate on open set this property to AlwaysRecalc (the default). Look at the API developers guide for more information.

  • Breaking Change: XlsFile.RecalcForced and FlexCelReport.RecalcForced properties have been removed. RecalcForced used a way to make files recalculate on open which has been deprecated in newer versions of Excel, and will cause validation errors with the generated files. For this reason, RecalcForced wasn't doing anything in the last couple of years. Look at the new RecalcVersion property if you were using RecalcForced and want new not deprecated way to create files which Excel will recalculate on open.

  • Improved Xamarin Unified API support. Changed the unified API support to compile in the latest beta.

  • Included reports can now reference the formats of the parent report. Now an included report can reference the formats of the parent report, same way as it can reference the expressions.

  • New overloads of XlsFile.GetObjectProperties and XlsFile.GetObjectAnchor that take an object path. This new methods allow you to access the properties and anchor of an object by specifying its name, as in Xls.GetObjectAnchor(-1, "@MyObject")

  • Autofitting columns with 90 degree rotation would work always as if the column had "Wrap text" enabled. When autofitting columns which had a rotation of 90 degrees, FlexCel would always try to wrap the text so it fitted in many lines, even if the cell wasn't set to wrap. Now it will only do this if the cell has "Wrap text" on.

  • Breaking Change: Removed Xamarin Android 2.2 support. As Froyo (2.2) is now deprecated, we've removed this support in order to avoid deprecated warnings. Now minimum supported is 2.3 (Gingerbread).

  • Bug Fix. When doing reports with Linq, aggregating a double field could raise Exceptions.

  • Pivot tables in xlsx are now copied when you copy sheets. Now if you InsertAndCopySheet(...) a sheet with a pivot table from an xlsx file, the table will be copied. (pivot tables in xls were already copied)

  • Unknown names in formulas now return #NAME! instead of #NA!. Now when a formula references a name that doesn't exist, FlexCel will return #NAME! as the formula result, instead of #NA! as it used to do.

  • Bug fix. When setting the text of an object using SetObjectText the font might not be preserved.

  • Bug fix. When changing the font in HtmlFont event in TFlexCelHtmlExport there could be an Exception.

  • Bug fix. RoundUP and RoundDown functions could return the same number and not the rounded up number in some cases when the number of digits was negative.

  • Bug Fix. Rendering some files with thousands of hidden columns could take too long.

  • Hidden rows could sometimes count when finding the maximum used column in the sheet. When printing or exporting an xls/x file, a hidden row with columns outside the printing range could in some cases cause the maximum column to be that in the hidden row, which wouldn't be printed.

  • Improved compatibility with invalid xls files. Now FlexCel can read some more invalid xls files created by third parties.

  • Sheet names aren't always quoted when returning formula text. In older FlexCel versions, the sheet was always quoted in formulas. So if you retrieved for example the formula in A1, it could be 'Sheet1'!A2. Now we quote the sheet only if needed, same as Excel does. So we would return Sheet1!A2 instead.

  • New convenience constructor for XlsFile which takes a Stream. Now you can create an XlsFile and open a stream in a single operation, without having to first create the XlsFile and then call xls.Open.

  • Improved error message when opening files with 0 bytes. Now when opening files with 0 bytes or streams with the position at the end, FlexCel will say a clear message instead of saying that the file format isn't Excel or newer.

  • New properties FlxConsts.MaxRowCount and FlxConsts.MaxColCount. Those properties return FlxConsts.Max_Rows + 1 and FlxConsts.Max_Columns + 1 respectively. Max_Rows and Max_Columns were zero based, so for example Max_Rows return 65535 for xls and not 65536 which is the row count. The new properties return the one-based maximum, which makes it simpler to work in the one-based FlexCel API.

New in v 6.6.2.0 - October 2014

  • Better rendering of text in rotated shapes. In Excel 2003 or older, text in rotated shapes was shown without rotation and that's how FlexCel would show them. Since Excel 2007 the text can rotate with the shape, using an undocumented record in xls. Now FlexCel can read it and will honor that setting when converting to pdf/html/svg/printing/etc.

  • Bug Fix. A local link in a pdf to a page that wasn't exported could cause an Exception.

  • Bug Fix. Exporting "Center on selection" cells could be too slow in border cases.

  • Bug Fix. XlsFile.SetCommentRow could set the wrong comment in some cases.

New in v 6.6.1.0 - October 2014

  • Generic reports using <#table.*> can now use user defined functions. Now you can apply a user defined function to a <#table.*> tag.

  • Generic reports using <#table.*> can now reference fixed fields in the table. Now you can mix <#table.field> with <#table.*> in the same cell.

  • Better compatibility with files created by third parties. Now FlexCel will load invalid xlsx files with repeated comments.

  • Bug Fix. Generated xlsx files could be invalid when removing frozen panes from an existing file.

New in v 6.6.0.0 - October 2014

  • Breaking Change: Now the result of ShapeOptions.Text is a TDrawingRichString instead of a TRichString. In order to allow more customizability in the text of shapes and objects, we had to move the text property from a TRichString (which is used for cells, and in xls was also used for objects) to a TDrawingRichString (Which in xlsx offers more possibilities to customize the text). As there is an automatic conversion from a TDrawingRichString to a TRichString, most code will just keep working. But there might be some cases (like functions where you pass a var parameter) where you will need to change the types form TRichString to TDrawingRichString in order to compile.

  • Better support for preserving autoshape text in xlsx. Now when you change the text of an autoshape in xlsx, the existing properties of the text will be preserved.

  • Support for reading and writing a cell's text direction (RTL, LTR or Context). Now you can specify the text direction in a cell, and APIMate will show you how to do it. The FlexCel rendering engine also now supports better RTL code (still without providing official RTL support, it is better in this version and usable in most cases)

  • Support reading the number of horizontal and vertical page breaks in a sheet. Two new properties: XlsFile.HPageBreakCount and XlsFile.VPageBreakCount return the count of page breaks in a sheet.

  • Bug Fix. XlsFile.LastFormattedCol returned the last formatted column - 1. Now it is returning the correct number.

  • Bug Fix. Rendered xls charts could show an extra line in some corner cases with missing data.

  • Bug Fix. TOPN datatables didn't inherit their relationships with master datasets.

  • Bug Fix. Macro references in buttons could be copied wrong when copying sheets.

  • Bug fix. When copying a range of cells to another sheet which included formulas introduced in Excel 2007 or newer there could be an error when saving as xls.

  • Bug Fix. FlexCel enforced a maximum of 1023 manual page breaks for xls but not for xlsx. Now We also check that the generated xlsx files don't have more than 1023 manual page breaks, since that would crash Excel.

New in v 6.5.0.0 - September 2014

  • PDF/A support. FlexCel can now export to PDF/A-1, PDF/A-2 and PDF/A-3 files. A new property FlexCelPdfExport.PdfType determines if the file is a standard PDF or the version of PDF/A.

  • Xamarin Unified API Support. FlexCel now includes two new dlls compiled against Xamain.Mac.dll and Xamarin.iOS.dll instead of XamMac.dll and monotouch.dll, in order to support the new Unified API ( http://developer.xamarin.com/guides/cross-platform/macios/newstyle/ ) This means you can now compile 64 bit iOS and OSX applications with FlexCel.

  • Breaking Change: Generated PDF files are now tagged by default. The files generated by FlexCel are now tagged by default, as tagging is an accessibility requirement. Tagged PDF files are bigger than normal files so in order to try to get smaller files FlexCel uses now features available only in Acrobat 7 or newer. To go back to generating untagged files you can set FlexCelPdfExport.TaggedPdf = false. To go back to creating files compatible with Acrobat 5 or newer, set FlexCelPdfExport.PdfVersion = TPdfVersion.v14

  • Breaking Change: Generated PDF files are now compatible with Acrobat 7 or newer. In order to reduce the size of the tagged pdf files that FlexCel now creates by default, FlexCel now generates files that need Acrobat 7 or newer to open. To go back to creating files compatible with Acrobat 5 or newer, set FlexCelPdfExport.PdfVersion = TPdfVersion.v14. Note that as PDF/A-1 requires compatibility with Acrobat 5 or newer, when exporting PDF/A-1 FlexCel will use v14 automatically. PDF/A-2 and 3 don't require v14, so it isn't used by default for those formats.

  • Breaking Change: Generated PDF files now embed the fonts by default. Now the default value of FontEmbed in FlexCelPdfExport and PdfWriter is TFontEmbed.Embed. While this will create slightly bigger files, they will show fine everywhere, including mobile devices which might not have the fonts. You can revert to the old behavior by changing FontEmbed to be TFontEmbed.None.

  • Breaking Change: FlexCel will throw an Exception when trying to embed a font that doesn't have a license allowing embedding. FlexCel will now check that the embedded fonts in PDF have a license that allows embedding. You can revert to the old behavior by setting UnlicensedFontAction = TUnlicensedFontAction.Ignore, in case you have an agreement with the Font author. You can also set UnlicensedFontAction = TUnlicensedFontAction.Replace to replace the unlicensed fonts with a fallback font. FlexCelTrace will alert when replacing or ignoring a font that is not licensed.

  • Ability to embed files inside the PDF. Now you can embed arbitrary files inside the pdf. This allows for example to ship the original xls/x file inside the pdf. This is supported also in PDF/A-3.

  • Ability to set the language of the PDF files. You can now set a FlexCelPdfExport.Properties.Language to specify the language of the generated PDF file. Note that the language will be used by text-to-speech engines to read text out loud, so it is recommended to set this property.

  • PDF properties are now saved in XMP format. PDF properties (like Author, Title, etc.) are now saved in XMP xml format besides the PDF format. XMP is a requirement for PDF/A, and allows other tools that don't understand PDF to read the metadata. Note that the files generated by FlexCel will be now a little bigger due to this metadata, because it can't be compressed.

  • Ability to embed a Color Profile inside the generated pdf files. You can now set a FlexCelPdfExport.EmbedColorProfile property to embed a color profile in the generated files. Note that as a color profile isn't required and it increases the size of the generated files, this option is false by default. But as it is required by PDF/A, a color profile will be embedded in PDF/A files.

  • Breaking Change: Now if you don't specify properties for pdf files in FlexCelPdfExport (like Author, Title, etc.), those will be read from the Excel file being exported. If you want to revert to the old behavior, you can set UseExcelProperties = false in FlexCelPdfExport.

  • New structure StandardMimeType returns the mime types for xls, xlsx, xlsm, pdf, etc. You can use StandardMimeType where you need to specify a mime type for a file generated with FlexCel, instead of having to manually search for the type.

  • Support for <#DBValue> tag in LINQ Reports. DBValue used to work only with datasets, now you can use it also with LINQ data providers like arrays or lists.

  • Breaking Change: VirtualDataTable doesn't have the MoveToRecord virtual method anymore, and instead it has a new GetValue(row, column). In order to provide an efficient support for dbvalue in LINQ reports, we needed to change the way to move to a random record. So we don't use MoveToRecord anymore an use GetValue(row, column) instead. This change is unlikely to affect you, unless you are writing your own VirtualDataTable descendent. If you are, then the compiler will point at the missing method implementation.

  • Improved Search and Replace. Now FlexCel preserves better the format of the cells being replaced. A new overload of XlsFile.Replace allows you to specify the format or the values of the replaced cells in a cell by cell basis.

  • Support for entering names referring to other files using Excel notation. A normal reference to another file has the filename inside brackets, like "[file1.xlsx]Sheet1!A1". But in the case of global names, Excel uses the notation "file1.xlsx!name1", without brackets, which makes it impossible to know if you are entering a name reference to another file (file1.xlsx) or a name reference to the same file, in a sheet named file1.xlsx. FlexCel didn't allow this way to specify the names, and it used to ask for brackets always so you would have to write [file1.xlsx]!name1 to enter the name. Now you can use the same notation as Excel, and FlexCel will allow it as long as you setup a TWorkbook before which includes file1.xlsx.

  • Support for format strings that specify fractions. Now when using a format string like "??/??" the numbers will be displayed as fractions. For example 0.75 will show as 3/4. All Excel formats for fractions are fully supported.

  • New constructor for XlsFile allows to specify the Excel version in one step. Now you can create a new file in for example Excel 2010 file format by writing XlsFile xls = new XlsFile(1, TExcelFileFormat.v2010, true); in C# or xls := XlsFile.Create(1, TExcelFileFormat.v2010, true); in Delphi.

  • New enumeration TExcelFileFormat.v2013. We now provide a specific TExcelFileFormat.v2013 enumeration to create Excel2013 files.

  • iOS and OS/X previewer compatibility improved. Some xlsx files generated by FlexCel that wouldn't show in iOS/OSX previewer will display now. Xlsx charts now update their caches so the previewer will show them correctly.

  • TFlxApplyFont as a new StyleEx property that allows for fine control of which styles are applied. Before this release you could only apply the full style of the font or nothing by changing the Style property. Now you can specify individual styles like bold or italics by changing the StyleEx property.

  • XlsFile.Sort does a stable sort. Now when you sort a range of cells, order will be preserved for items with the same values.

  • Bug Fix. Local named ranges could lose their sheet when inserting sheets from other file.

  • Shapes inside charts are now preserved in xlsx files.. Now xlsx charts will preserve the shapes inside.

  • Ability to preserve modification date in xlsx files. By default, FlexCel will set the modification date to the date the file was saved. But if you are modifying an existing file and want to preserve the original creation date, you can now do it by setting XlsFile.DocumentProperties.PreserveCreationDate to true.

  • Better support for Excel 4.0 macro sheets. Files with Excel 4.0 macros should load better.

  • Bug Fix. XlsFile.Replace might not keep existing cell formats when replacing dates.

  • Bug Fix. Chart.DeleteSeries could break the format of the remaining series when called in a serie at the middle of the chart.

  • Bug Fix. There could be an exception when deleting some ranges of cells with hyperlinks.

  • Bug Fix. Negative dates when in 1904 mode used to display as ####. Now they display as in Excel (see http://support.microsoft.com/kb/182247 ). Note that this is not a logical way to display dates, that is -1 doesn't mean 12/31/1903, but it means "-1/2/1904". Negative dates actually increase as the number get smaller.

  • Support for UTF16 surrogates when exporting to pdf. Now when exporting to pdf, FlexCel will correctly display UTF16 surrogates. FlexCel already was surrogate-aware in the rest of the codebase.

  • Support for space (" ") named styles. While Excel won't let you enter a cell style named " ", it will allow you to use it if you manually edit an xlsx file and create it there. To be able to deal with those files, FlexCel will now support reading and writing styles named with a space.

  • Now when adding controls with linked cells, the linked cells will be modified to match the initial value of the control. Now when adding comboboxes, listboxes or checkboxes linked to a cell, the cell will be modified to match. Note that the change applies to newly created objects, if you change the value of an existing control, the linked cell was always updated in all FlexCel versions that supported changing control states.

  • Bug Fix. Some xlsx files with charts could enter an infinite loop when loading.

  • Bug Fix. When replacing rich strings, the rtf runs could be wrong in border cases.

New in v 6.3.1 - May 2014

  • Improved image rendering. Some files created by third parties could display the images in the wrong position.

New in v 6.3.0.0 - April 2014

  • Windows Phone 8.1 and Windows Store 8.1 Support. Now FlexCel includes a Portable Class Library which will let you create Windows Phone 8.1 and Windows Store 8.1 apps. Note that in order to see it, you need Visual Studio 2013 Update 2 (currently in RC with a go-live license)

  • SVG Exporting. A new component, FlexCelSVGExport allows to export xls/x files to SVG. A new example "Export SVG" is included too. SVG files are now supported by all major browsers, desktop and mobile, so you can use them when exporting to html to have resolution independent images.

  • HTML 5 Exporting. Now FlexCelHtmlExport can export to HTML5/CSS3 as one of the options. When exporting to HTML5 some new capabilities are available.

  • Improved support for document properties. Full support for setting standard or custom properties in xlsx files. (xls is still read only). A new method XlsFile.DocumentProperties.RemoveAllProperties will allow you to remove all properties in the xls or xlsx files, so you can be sure it doesn't contain unwanted information. A new method XlsFile.DocumentProperties.GetUsedStandardProperties will return a list of the used standard properties in the file. A new method XlsFile.DocumentProperties.SetStandardProperty allows to modify standard properties in xlsx. New methods SetCustomProperty, GetCustomProperty and GetAllCustomProperties allow to manage custom properties. Document properties will be preserved when opening xls or xlsx files and saving as xlsx, or when opening and saving as xls. They won't be preserved when opening xlsx and saving as xls.

  • Embed images in HTML files. A new property: FlexCelHtmlExport.EmbedImages allows to embed the images as Data Uris ( http://tools.ietf.org/html/rfc2397 ) inside the html file. When setting this property to true the generated html file can be self contained, and you don't have to deal with managing the external images.

  • SVG images in HTML files. Now FlexCelHtmlExport.SavedImagesFormat allows a new possibility: THtmlImageFormat.Svg. SVG is a standard vector image format supported by most modern browsers, and using svg means that high-dpi/retina devices can zoom smoothly in the vector assets of the file, like charts or autoshapes.

  • TExcelChart.RemoveLegend method. A new method in TExcelChart allows to remove a legend. Note that currently this only works in xls charts, not xlsx.

  • Improved chart rendering. Now charts will have the frame box with rounded corners if you specify so in Excel.

  • Improved performance in VLookup. The implementation of the function VLookup is now much faster when searching in an unsorted range.

  • Improved performance in pdf/html exporting. Many optimizations in the rendering engine.

  • Improved APIMate. APIMate now shows how to autofit a comment box to the text size, and also how to set properties in xlsx.

  • New property DisableSQLValidation in FlexCelReport. Now FlexCelReport has a new property "DisableSQLValidation" which will allow to send arbitrary SQL commands from the config sheet. It will allow for example to execute stored procedures in SQL Server. If you decide to disable the SQL validation, please take a look at the remarks in DisableSQLValidation documentation.

  • Bug fix. Some cells with automatic background colors in xls files could be saved with the wrong color when converting to xlsx.

  • Bug fix. XlsFile.Find could keep returning the same values in corner cases.

  • Bug fix. When Inserting an empty sheet locally defined ranges wouldn't update the sheet where they were defined. This happened only with empty sheets, if you inserted a sheet with data it would work fine.

  • Bug fix. FlexCelPreview could show text as underlined in some third-party generated xlsx files.

New in v 6.2.1.0 - March 2014

  • Improved default font in Headers and footers. In previous versions if no font was specified for the headers or footers, FlexCel would default to Arial. Now it defaults to the normal font in the file.

  • iOS and Android pdf encoding handling. Now FlexCel will create pdf files without using Win1252 encoding, which isn't included by default in Xamarin for iOS or Android.

New in v 6.2.0.0 - February 2014

  • Support for preserving PowerPivot tables in xlsx. Now PowerPivot tables will be preserved in xlsx.

  • Improved Excel 2013 support. FlexCel could fail to open some complex Excel 2013 xlsx files.

  • Improved handling of dates between 1900-1-1 and 1900-2-28. Excel considers 1900 to be a leap year, even when it wasn't. ( look at http://support.microsoft.com/kb/214326 ) As FlexCel uses the .NET DateTime which correctly assumes 1900 wasn't a leap year, dates between 1900-1-1 and 1900-2-28 would appear in FlexCel as one day before the dates in Excel. Now FlexCel corrects those dates so they look as in Excel, but the DateTime datatype still doesn't have Feb-29-1900, so that date will still be wrong. It is still advised to not use dates before march-1-1900 when working in Excel.

  • Support for running in machines with FIPS 140 enabled. Now FlexCel can be used in machines with FIPS 140 policies enforced. ( see http://support.microsoft.com/kb/811833 )

  • New static events in TPdfWriter. There are 3 new static events: GetFontDataGlobal, GetFontFolderGlobal, OnFontEmbedGlobal. Those work like the already existing GetFontData, GetFontFolder and OnFontEmbed, but being static, they work an application level. If you set them, you don't need to set them for every TPdfWriter or TFlexCelPdfExport instance you create.

  • Improved rendering of formatted numbers. Some formatting strings (for example "general;-general") were not rendered like Excel.

  • Support for forcing codepage in Excel95. Now you can force a codepage when opening an Excel 95 file with xls.Open(..., Encoding). While normally you don't need to specify a codepage for xls95 since it is specified in the file, if the file doesn't have a codepage record or has it wrong, you can now specify it here.

  • Support for displaying numbers in Engineering notation. When displaying numbers in Scientific notation, FlexCel would always use normalized notation ( http://en.wikipedia.org/wiki/Scientific_notation#Normalized_notation ). Now it can also use Engineering notation if the format string specifies it ( http://en.wikipedia.org/wiki/Engineering_notation )

  • SheetProtection is copied when copying sheets from one file to another. Now FlexCel will copy the sheet protection when you are copying sheets from other file object.

  • Bug fix. The rendering engine could fail to draw the top gridline in pages after the first when PrintGridLines was true and you were repeating rows at the top.

  • Bug fix. When opening xls files with data validations and saving them as xlsx, some relative ranges could point to an incorrect cell range in the xlsx file.

  • Bug fix. Charts in xlsx files didn't preserve textures.

  • Bug fix. There was an error when recalculating the =LARGE and =SMALL functions in non contiguous ranges of cells.

  • Bug fix. Sometimes AddFormat() could repeat a format twice in the file.

  • Bug fix. In certain cases when a macro name had a dot "." on it, FlexCel could fail to open the file.

  • Improved 3rd party compatibility. Improved generated xls files so they can be loaded by some 3rd party tools.

New in v 6.1.0.0 - September 2013

  • Improved chart rendering. While the chart engine still can only draw charts in xls files at the moment, it can now read some embedded xlsx records in the xls file so the chart will display like Excel 2007 or newer, not like Excel 2003.

  • Improved xlsx autoshape rendering and conversion. Now autoshapes in xlsx files are converted better to xls, and also render more faithfully.

  • Improved rendering in iOS and Android. Now texture bitmaps are also supported in iOS and Android besides Windows.

  • iOS7 support. Changes to better support iOS7.Some records in xlsx files have been changed so the iOS7 viewer can show the files.

  • Visual Studio 2013 RC support. VS 2013 RC is now supported.

  • Improved mobile documentation. New demos added for Android and iOS. Reviewed and improved the documentation.

  • Bug fixes. Small bugfixes.

New in v 6.0.0.0 - August 2013

  • Cross Platform support. FlexCel has gone through a big review to make it cross platform. It now runs in Xamarin.iOS, Xamarin.Android and Xamarin.Mac. Read, write, modify and export to pdf or html your Excel files from any iOS, Android or OSX device.

  • Support for the new Excel 2013 xlsx encryption. Xlsx files encrypted with Excel 2013 can now be opened.

  • Reduced Memory usage. FlexCel 6 will use from about 1/2 to 1/4 of the memory FlexCel 5 used. We've done a big rearchitecture of the code to ensure it runs fine in memory-limited devices, and this improvement is also available for Windows.

  • More conformant xls files. All xls files created by FlexCel now pass the Microsoft Office validator if the original file passed it. Note that not all xls files created by Excel pass the Office validator.

  • In OSX and iOS the pdf engine doesn't need more access to the "Fonts" folder. Now the pdf engine in OSX and iOS an get the fonts directly from memory.

  • Support for changing how FlexCel displays the internal numeric formats. Excel has some internal numeric formats that aren't stored in the file, and different versions of Excel in different languages might show them different. For example format 37 is defined in some Excel versions as "#,##0 $;-#,##0 $" while in others is defined as "#,##0 $;(#,##0) $", (showing negative numbers in parenthesis instead of with a minus sign). The best is not to use those formats that will display different depending on the Excel version, but if you need to make FlexCel behave like one specific localized version, you can change those formats with the static method XlsFile.SetBuiltInFormat(...)

  • Support for recalculating XIRR and XNPV functions. XIRR and XNPV are now recalculated.

  • New startPageToExport and totalPagesToExport parameters in TFlexCelPdfExport.ExportSheet. Those methods allow to control how many pages are exported.

  • Many improvements and small bug fixes. There are too many small changes to be mentioned here, but there is hardly any aspect of the library that hasn't been improved.

  • Breaking Change: Compact framework is no longer supported. Due to all the work to support the new platforms, we had to so some cleaning. Compact framework required a lot of effort to maintain because it lacked too many features, and it isn't being developed Anymore by Microsoft.

  • Breaking Change: System.Drawing classes have been replaced by internal TUIClasses in the API. This means for example that System.Drawing.Color is now TUIColor. This change shouldn't break much code since those classes weren't used much in the API, and also because there is an implicit conversion between System.Drawing.Color and TUIColor. We've made a lot of effort to try to minimize code changes, and chances are that you won't need to change a line of code, but some corner cases might still happen. This change was necessary because most of the newer .NET variations don't include a System.Drawing namespace, or it is incomplete.

New in v 5.7.18.0

  • Bug fix. Images could become invalid when copying sheets between different files.

New in v 5.7.17.0

  • Improvements in FlexCelPreview. New AutofitPreview property automatically resizes the preview so if fits to width, height or page. See the "Custom Preview" demo for more information. Now by default the preview scrolls past the last page, enough to allow you to select any page. You can go back to old behavior by setting the "EndPreviewAtLastPage" property to true. New AutofitPreviewOnce method allows you to autofit the preview just once. New method MaxPageSize will return the maximum width and height of the pages in the preview.

  • Bug fix. Sometimes when changing some printoptions with the API, number of copies might be undefined. It will be 1 now in those cases.

  • Bug fix. Now FlexCel can read xlsx files with invalid timestamps.

New in v 5.7.16.0

  • Support for xltx and xltm files. Now you can save xltx and xltm "template" files as you could save xlt. The property TExcelFile.IsXltTemplate will tell you if the file you opened was or not a template and you can change it in order to save templates. Note: FlexCel will automatically save the files as templates when you save to a file with extension xlt, xltx or xltm, no matter the value of the IsXltTemplate property. You only need to set it when saving to streams.

  • New method TExcelFile.RecalcRange. RecalcRange can take any formula that evaluates to a range of cells and return the array of rectangular ranges.

  • New overload for GetDataValidation. The method TExcelFile.GetDataValidation can now also return the range where the data validation is applied. You can use this range as an offset to call the new TExcelFile.RecalcRange method and convert the text formula in a data validation to a range of cells.

New in v 5.7.14.0

  • New properties in FlexCel preview. FlexCelPreview has new properties for customizing how the page looks like: ShowThumbsPageNumber, PageShadowSize, PageShadowColor, PageBorderColor, PageBorderWidth, PageBorderStyle, PageNumberBgColor, PageNumberSelectedBgColor, PageNumberTextColor, PageNumberSelectedTextColor, Resolution.

  • New methods GetSheetSelected and SetSheetSelected in XlsFile. These two new methods allow you to know or set which sheets are selected in a file. Different from XlsFile.ActiveSheet, you can select multiple sheets in a single file.

  • Small improvements. RoundUp and RoundDown functions now ignore roundtrip digits like Excel. Names that evaluate to rectangular coordinates now can show top, left, right and bottom coordinates even if they are formulas that evaluate to rectangles, and not direct ranges.

  • Bug fixes. The preview rectangle representing the page was a little larger than what it should be. Html exporting bug when trying to export some files with 16384 columns. Improved compatibility with xlsx files created by third parties.

New in v 5.7.10.0

  • Performance improvements. Rendering a file with thousands of merged cells is much faster now.

New in v 5.7.9.0

  • Bug Fix. Fixed a bug in the preview component. Bug was introduced in 5.7.6.0.

New in v 5.7.8.0

  • Bug Fix. References to external files when saving complex xlsx files which were converted from xls or manually created could be invalid.

New in v 5.7.6.0 - May 2012

  • Improved virtual mode. Virtual mode now can skip sheets you don't need to read, and also stop reading the file as soon as you have read all the values you need. Look at the improved "Virtual Mode" demo for more information.

  • New Recovery Mode. A new property in XlsFile, "RecoveryMode", tells FlexCel to try to ignore many common errors in corrupt files so you might be able to open them.

  • Buf fixes. Improved compatibility with complex and third party created files, fixes in the preview component and many other small fixes and improvements.

New in v 5.7.2.0

  • Bug fix. TRangeCopyMode.OnlyFormulasAndNoObjects would copy objects when copying from one file to another.

  • Bug fix. Offset function would return error when recalculating if you used missing arguments in the 2 last parameters.

New in v 5.7.1.0

  • Bug fix. Some complex merged/span cells could cause wrong results when exporting to HTML.

  • Bug fix. XlsFile.AddSheet added a sheet before the last position, not after the last one. Now it behaves as expected.

New in v 5.7.0.0 - March 2012

  • Replaced System.IO.Packaging by fully managed native implementation. The new classes are faster than System.IO.Packaging and also fix some bugs present on it. For example, it doesn't use IsolatedStorage, so it is thread safe for xlsx files bigger than 10 mb and doesn't require special permissions to access IsolatedStorage. Also it fixes many issues in the Mono System.IO.Packaging implementation, allowing FlexCel to officially support xlsx under Mono.

    IMPORTANT: If you are creating very big xlsx file in threads, please make sure to update to this version.

  • Support for xlsx in mono and .NET 2.0. Now xlsx is fully supported in both Mono and .NET 2.0.

  • ATLEAST tag for the config sheet in reports. AtLeast ensures a datasource has at least n records, and if it hasn't it will return a default value for the records between Count(Datasource) and n. See the documentation in "Using FlexCel Report" pdf.

  • Master detail reports can now be defined with 2 ranges that expand to the same range. Now if you need for example a Master range and a Detail range in the same row, you can make the Master range bigger than Detail (for example Master = A1:B1 and Detail = A1). While both ranges are the same (both A1:XFE1), FlexCel now can realize the bigger range is the master and use it to know the master-detail relationship. Before you would get a "ranges intersect" message if Master wasn't actually bigger than detail.

  • New "Text Qualifier" parameter when importing csv files. Now when using XlsFile.Import(...) to import a text file, you can define a text qualifier different from a double quote ("). The text qualifier is used when the delimiter is part of the field and so it must be quoted.

  • New property ExcelFile.PrintLandscape. Allows for setting landscape printing easier than with PrintOptions.

  • Bug fixes. When exporting to PDF and dpi wasn't 96 and using "XP Style dpi scale" the resulting PDF might be wrong. Issues when printing all sheets in a workbook and skipping the first pages. Allowed to read duplicated row records so some invalid files can be read.

  • Bug Fixes. Now recalculation works more like in Excel in Lookup and Match functions.

  • Bug Fixes. Now FlexCel can read invalid xls files which have wrong strings. PdfExport could raise an Exception rendering 0 pixel width metafiles.

  • Bug Fix. Some numbers near the maximum possible in Excel (1e308) could be stored with reduced precision.

  • Bug fixes. Small issues in chart preserving. Speed issues when rendering big metafiles.

New in v 5.6.0.0 - November 2011

  • Chart preserving in xlsx. Now xlsx charts are preserved and updated when you insert or copy rows, copied when you copy ranges, etc. Charts aren't converted between xls and xlsx file formats, so in order to use xlsx charts you need to start from an xlsx file.

  • Support for reading Excel 5 and 95 xls files. While Excel 95 is not in mainstream use, many third party libraries produce xls 95 files today, and now you can read those files directly with FlexCel. After opening them, they must be saved as xls 97 or xlsx.

  • Support for accessing nested properties when using LINQ in reports. Now when using LINQ in reports you can access nested properties from the template. If for example you have a class "Orders" and this class has a nested class "Customer", you can write in the template "<#Orders.Customer.Name>". You can use as many nesting dots as needed, as long as the properties have a single value.

  • Support for calculating circular references. Now FlexCel can calculate iterative workbooks. The new properties "OptionsRecalcCircularReferences", "OptionsRecalcMaxIterations" and "OptionsRecalcMaxChange" in XlsFile allow you to control the iterative recalculation. As always, the APIMate tool will show how to set those properties in a sheet.

  • APIMate improvements. APIMate will now show the schema of the fonts when using themed fonts (Excel 2007).

  • Bug fix. There could be an error when manually copying formulas that included named ranges from a workbook to another.

  • Bug fixes. <#delete range> tags could work wrong in nested reports. Xlsx files could be invalid after copying cells from other workbook. Better compatibility with xls files generated by other 3rd party tools.

  • Bug fix. .NET 3.5 XMLReader can hang when reading some malformed xlsx files. Now FlexCel will throw and Exception when reading those files in .NET 3.5. Note that .NET 4 already worked fine and keeps doing so.

  • Bug fix. Xlsx files could save the same image more than once when used in many places. Now only one copy of every unique image is stored.

  • Bug fix. Xlsx files without printer information could default to landscape instead of portrait.

  • Bug fix. Problem when saving xlsx files with more than one pivot table in different sheets.

  • Performance enhancements. When reading 2007/2010 xls files with thousands of manual styles.

  • Performance enhancements. Improved xls saving performance.

New in v 5.5.1.0 - August 2011

  • Bug fixes. Manual page breaks in xlsx could be ignored by Excel. Improved compatibility with invalid xls files.

  • Performance improvements. Exporting to html/mhtml now is faster for some files.

  • Support for rendering non contiguous print areas. Now when exporting to Pdf/Html/Images/etc. FlexCel will honor print areas that have many different sections, like "=Sheet1!$A$1:$B$4,Sheet1!$D$5:$F$7".

  • Bug fix. In some cases, after copying a chart from one sheet to another, you wouldn't be able to select the chart anymore from FlexCel to continue working with it.

  • Performance improvements. Exporting to pdf now is faster for some particular files. A new property "IgnoreFormulaText" in XlsFile allows you to ignore the formula text when reading the cells in a file, speeding up the reading. Look at the "Performance" pdf for more information.

  • Bug fix. Malformed hyperlinks now can be read. FlexCel can now read xlsx files with malformed hyperlinks.

  • Added a new ErrorAction TExcelFileErrorActions.OnXlsxMissingPart. A new ErrorAction member has been added to allow reading corrupted xlsx files that lack some parts. This is off by default, you need to explicitly call XlsFile.ErrorActions &= !TExcelFileErrorActions.OnXlsxMissingPart for it to work. As with all other errors, when it happens it will be logged to FlexCelTrace.

  • Bug fixes. Fixed problem that could rarely happen with nested relationships inside ADO.NET tables in a report.

  • Bug fixes. Support for reading [this row] tokens in formulas inside Excel 2007 tables. We don't still process them and they will be imported s #REF!, but at least you can read the file.

  • Bug fixes. Issue when copying data validations and conditional formats by columns.

  • Bug fixes. When sorting a cell range formulas referring to that range could be offset by one.

New in v 5.5.0.0 - May 2011

  • Breaking Change: Native support for LINQ and Entity Framework as data sources for reports. Now you can use any IQueryable iterator to create a report, besides DataSets. Breaking Change: VirtualDataTable and VirtualDataTableState objects had to be modified to allow the best performance when using IQueryable. If you have defined your own VirtualDataTable/State descendants, you will have to make some changes in the code to compile.

  • New "Virtual Mode" for reading xls and xlsx files on demand. The new "Virtual Mode" allows you to read huge xls/xlsx files on demand, without loading the full file into memory. If you are importing big files with FlexCel, this new mode can make a big difference. Look at the "Virtual Mode" demo for more information.

  • Support for reading and writing encrypted xlsx files. Reading and writing encrypted xlsx files is fully supported, both Excel 2007 (Standard Encryption) and Excel 2010 (Agile Encryption)

  • Support for protected xlsx files. Full support for protected xlsx workbooks and sheets, including password protection.

  • Pivot Table preservation in xlsx files. Pivot tables are now preserved when saving xlsx files, and they can be used in reports, and copied between sheets or files.

  • Macro preservation in xlsx files. Macros are now preserved when when opening xls files and saving as xls or xlsx, or when opening xlsx files and saving as xlsx.

  • Full support for R1C1 formulas. Now you can use the R1C1 notation besides A1 when entering or reading formulas. You can change the cell reference mode with the property XlsFile.FormulaReferenceStyle.

  • Full support for all objects in the Forms palette (radio buttons/group boxes/comboboxes/listboxes/spins/labels/scrollbars/buttons) in the API, rendering, and xlsx. The new methods allow you to add and modify any object in the forms toolbar. Also now all those objects will be printed/exported to pdf/html/images, and they are fully supported in xlsx too.

  • Support for buttons/checkboxes/readio buttons/group boxes/comboboxes/listboxes/spins/labels/scrollbars in APIMate. Now APIMate will show how to add/modify checkboxes and all objects in the forms palette.

  • Support for Autoshapes in xlsx. Now autoshapes in xlsx are preserved, converted between xls and xlsx, and rendered.

  • Header and footer images support in xlsx files. Images in headers and footers are now fully supported in xlsx.

  • Exporting named ranges to html. A new property "ExportNamedRanges" in FlexCelHTMLExport allows you to export the names in the sheet as span ids that you can use later to modify those cells with javascript. A new event, "NamedRangeExport" allows you to customize how those names are exported.

  • XlsFile now implements IEnumerable. You can now loop though the cells in an Excel file with a foreach loop.

  • New overload of XlsFile. NewFile allows to specify the version of Excel used to create the file. Now you can specify the version of the blank xls or xlsx files created by FlexCel. Different versions fo Excel have different default fornts, columns widths, etc, and now you can specify exactly which version you are creating. This is specially useful for APIMate, since in older FlexCel versions it would always create a 2003 xls file, and modify it with code to match the newer versions. Now it creates the correct file, and code needed is much less.

  • Fixed length text exporting now exports merged cells and cells that span to the right. When exporting Excel files to fixed length text, now merged cells and cells spanning to the right will use the full length available instead of cutting at the cell end.

  • Breaking Change: Deprecated Get/SetCheckboxLinkedCell methods in the API. While those methods will still work, we have introduced a generic Get/SetObjectLinkedCell method that should be used instead.

  • Bug fixes and performance optimizations. Xlsx files now load and save much faster, and performance was improved also for xls files. Pdf files are faster too. A new document in how to get the best performance in FlexCel is also included.

  • Experimental MonoTouch support. FlexCel can now be compiled for MonoTouch. With it, you can read, write and recalculate xls files in iPhone apps. Note that this support is basic and not fully tested, even when it looks to be working fine. Xlsx file format and rendering (exporting to pdf/html/printing) are not supported. Search for "MonoTouch.sln" in the distribution.

New in v 5.3.0.0 - August 2010

  • Support for Recalculation of 49 built in functions new to Excel 2007. Includes support for: AverageIf, AverageIfs, Bin2Dec, Bin2Hex, Bin2Oct, Convert, CountIfs, CoupDayBs, CoupDays, CoupDaysNc, CoupNcd, CoupNum, CoupPcd, Dec2Bin, Dec2Hex, Dec2Oct, Delta, DollarDe, DollarFr, Duration, EDate, Effect, EoMonth, FactDouble, Gcd, GeStep, Hex2Bin, Hex2Dec, Hex2Oct, IfError, IsEven, IsOdd, Lcm, MDuration, MRound, MultiNomial, NetworkDays, Nominal, Oct2Bin, Oct2Dec, Oct2Hex, Quotient, RandBetween, SeriesSum, SqrtPi, SumIfs, WeekNumn, WorkDay, YearFrac. Some of the functions are new to Excel 2007 (like AverageIf), and others were previously available in Add-ins. Look at SupportedFunctions.xls in documentation for more details.

  • Support for Recalculation of 8 built in functions new to Excel 2010. Includes support for: NETWORKDAYS.INTL, WORKDAY.INTL, AGGREGATE, CEILING.PRECISE, ISO.CEILING, FLOOR.PRECISE, PERCENTILE.EXC, QUARTILE.EXC Look at SupportedFunctions.xls in documentation for more details.

  • Support for all Excel 2010's "Renamed Functions". Now you can enter any of the Excel 2010 renamed functions in FlexCel, and those functions whose previous name was previously recalculated in FlexCel (and have the same paramters) will also recalculate now in FlexCel. Renamed functions: BETA.DIST, BETA.INV, BINOM.DIST, BINOM.INV, CHISQ.DIST.RT, CHISQ.INV.RT, CHISQ.TEST, CONFIDENCE.NORM, COVARIANCE.P, EXPON.DIST, F.DIST.RT, F.INV.RT, F.TEST, GAMMA.DIST, GAMMA.INV, HYPGEOM.DIST, LOGNORM.DIST, LOGNORM.INV, MODE.SNGL, NEGBINOM.DIST, NORM.DIST, NORM.INV, NORM.S.DIST, NORM.S.INV, PERCENTILE.INC PERCENTRANK.INC, POISSON.DIST, QUARTILE.INC, RANK.EQ, STDEV.P, STDEV.ST.DIST.2T, T.DIST.RT, T.INV.2T, T.TEST, VAR.P, VAR.S, WEIBULL.DIST, Z.TEST Look at SupportedFunctions.xls in documentation for more details.

  • New "BALANCED COLUMNS" mode for reports. Now you can do parallel column reports where all columns stay balanced and cells are automatically added to pad the columns with less records. Look at the new "Balanced Columns" demo for an example in how to use it.

  • New FIXEDN ranges for reports. FixedN ranges will behave as "FIXED" ranges for the first n records, and then behave as normal "__" ranges. For example the name "__db__FIXED2" will overwrite the 2 first records in the template, and then insert the rest. Look at the new "Balanced Columns" demo for an example in how to use it.

  • New ROWS function for reports. Allows to create datasources in the fly from the template with a defined number of rows. Look at the new "Balanced Columns" demo for an example in how to use it.

  • New TCopyRangeMode.Formats to copy formats from a block of cells to another. Now you can call InsertAndCopyRange with TRangeCopyMode.Formats to copy the cell formats from one place to another.

  • Improved Medium trust support. Our obfuscation tool was having issues when running in Medium Trust, now it should be fixed. This allows for deployment in shared hosting like godaddy.

  • Many small fixes and enhancements. As always, a lot of small fixes and improvements have been done.

New in v 5.2.0.0 - April 2010

  • Breaking Change: Support for .NET 4.0. Includes support for the new 4.0 security model.

  • Breaking Change: Deprecated support for .NET 1.1. In order to move faster to the new technologies, we had to deprecate .NET 1.1 support for this version.

  • Full Comment support in xlsx. Now comments are fully supported in xlsx besides xls. You can also set extended properties like the comment color directly from the API.

  • Full Data Validation support in xlsx. Now data validation is fully supported in xlsx besides xls.

  • Full Hyperlink support in xlsx. Now Hyperlinks are fully supported in xlsx besides xls.

  • Full Checkbox support in the API, rendering, and xlsx. The new methods: Get/SetCheckboxState, Get/SetCheckboxLinkedCell and AddCheckbox allow you to add and modify checkboxes states and linked cells. Also now checkboxes will be printed/exported to pdf/html/images, and they are fully supported in xlsx too.

  • New "DateFormats" parameter supported when opening or importing CSV files, and also when setting cells from string. This parameter allows you to specify only a subset of supported datetime formats when importing, to ensure .NET won't interpret invalid strings as dates. For example, calling: xls.Open("test.csv", TFileFormats.Text, ';', 1, 1, null, new string[] { "d/M/yyyy", "hh:mm" }, Encoding.Default, true); will only import dates in format "d/m/yyyy" or times in format "hh:mm".

  • New "FirstSheetVisible" property in XlsFile. This property controls what is the first sheet tab that is shown in the sheet bar at the bottom of Excel.

  • New "CenteredPreview" property in FlexCelPreview. When true, previews will render centered in the window, as they do in Excel.

  • Added support for new functions in recalculation. Added support for FREQUENCY.

  • Performance Improvements and bug fixes. The move away from .NET 1.1 allowed us to switch to generics much more of the code, with up to 10% speed up. Together with other performance improvements, 5.2 can be up to 30% faster in some cases.

  • Database in all demos migrated from Access to SQL Server compact. As Microsoft still doesn't support the JET driver in 64 bits, we changed the demos to use SQL Server Compact Edition instead. This way you will be able to test the database demos in pure 64 bits.

  • Tested against Office 2010 RTM. Generated files have been tested against the release version of Office 2010.

New in v 5.1.0.0 - January 2010

  • Excel 2010 XLS file support. Excel 2010 introduced a new "Protected View" that will flag old FlexCel xls files as "unsafe". This release fixes this so files will open in 2010 without warnings. It is important to update to this version as soon as possible, so when Excel 2010 is released your files will keep on working without warnings.

  • BASIC IMAGE SUPPORT IN XLSX. Simple images are now fully supported in xlsx besides xls. They will be converted and preserved when you open an xls file and save as xlsx or viceversa, and also rendered to pdf, etc. Grouped images and autoshapes are still not supported in xlsx, but coming soon.

  • THEME SUPPORT. Now the rendering engine will use other themes besides the standard office theme, and you are also able to modify the themes in a sheet.

  • BETTER INDEXED COLOR SUPPORT. The new method "OptimizeColorPalette" will modify the Excel 97-2003 color palette in an xls file so it includes the colors used in the sheet. Excel 2007 or newer don't need this as they support RGB colors.

  • MISC IMPROVEMENTS IN XLSX FILE SUPPORT. Support for autofilters, selections, printer driver settings, showing gridlines/headers and many small window properties when loading or saving xlsx. Macros are preserved when reading an xls file and saving as xlsx.

  • IMPROVED MEDIUM-TRUST SUPPORT. Improved fallback in Exceptions when running in Medium Trust. As before, FlexCel can be compiled with "FULLYMANAGED" conditional define to not only be 100% safe but also 100% managed code. But now even the dlls compiled without "FULLYMANAGED" will work fine in medium trust.

  • NEW METHODS IN XLSFILE FOR EXPORTING AND IMPORTING FROM TEXT FILES. The new methods XlsFile.Import and XlsFile.Export provide more flexibility when working with text files than the existing XlsFile.Open/XlsFile.Save methods. Now you can specify a "fixed length" file besides a text delimited file, and you can also import a text file in the middle of an existing file.

  • NEW COPY MODE ALLOWS TO COPY OBJECTS MARKED AS "DON'T COPY" when copying ranges or sheets. TRangeCopyMode.AllIncludingDontMoveAndSizeObjects will copy everything when used in InserAndCopyRange. InserAndCopySheets will use this mode now by default.

  • NEW METHOD GETUSEDNAMEDRANGES IN THE API. Returns which ranges are being used in formulas inside the sheet and which aren't.

  • NEW METHOD CELLRANGEDIMENSIONS IN THE API. Returns the dimensions a range of cells would use when rendered. Can be used when rendering to a bitmap to calculate the size of the bitmap what will hold the cells.

  • TOOLS ARE NOW PRECOMPILED WITH .NET 3.5. The tools like ApiMate and FlexCelDesigner used to come precompiled with .NET 1.1, so you can use them no matter which .NET version you have in your development machine. But as .NET 1.1 doesn't support xlsx, now they come with 3.5.

  • BUG FIXES. Small fixes and improvements.

New in v 5.0.1.0 - October 2009

  • IMPROVED PERFORMANCE INSERTING ROWS WITH MANY IMAGES. This will also speed up reports with lots of images too.

  • NEW FUNCTION SUPPORT FOR RECALCULATION. PercentRank is implemented now too.

  • IMPROVED SUPPORT FOR OTHER THIRD PARTY EXCEL GENERATED FILES. While we support virtually every xls file Excel generates (and we are not aware of any file we can't retrieve if it has been saved with Excel and it is in xls 97 or up), some third party apps create files with wrong information, that rely in bugs (and sometimes even in buffer overflows) in Excel to work. In this release we implemented support for many of those files, including files generated by SAP

  • BUG FIXES. This is primary a maineneance release, and there are many bug fixes and small improvements, mainly in the Excel 2007 support (both xlsx and "Excel 2007 xls") It is recommended that you update from 5.0.

New in v 5.0.0.0 - October 2009

  • EXCEL 2007/2010 SUPPORT. Included support for new features in Excel 2007/2010:

    •Basic support for reading and writing xlsx file format. Note that due to framework limitations, you need .NET 3.5 for xlsx support. •Expanded the rows to 1048576 and the columns to 16384. A compatibility mode still lets you work with the smaller grid should you need to do so. •Support for Excel's 2007 true color and themes. Breaking change: ColorIndex properties don't exist anymore and now are just Color. You can still access the color indexes with Color.Index. •Support for gradients in cell backgrounds; to get/set them or to export them to pdf/images/print. •Support for a different header and footer for the first page and for even pages; to get/set them or to export them to pdf/images/print. •Support for comments in named ranges. •Cell indentation can go up to 250 characters instead of the old 15. •Methods OptionsMultithreadRecalc, OptionsForceFullRecalc, OptionsAutoCompressPictures, OptionsBackup, OptionsCheckCompatibility in XlsFile class allow to configure the corresponding settings in an Excel file.

Please note that xlsx file format support in 5.0 doesn't include objects/charts/images or conditional formats. That will be added along the 5.n series.

Except for the bigger number of rows and columns (which can't be retrofitted to xls), all new properties will be saved even to the old xls files. They won't be available when opening the files in Excel 2003, but they will show in Excel 2007. And they will be used by FlexCel when printing or exporting to pdf/html, etc.

Take a look at the new section "Considerations about Excel 2007 support" in the API Guide for more information about updating to xlsx support.

  • NEW HTML 3.2 SIMPLE EXPORTING MODE. This new exporting mode won't use CSS or floating images, and most settings will be done through simple tags. While some style tags are still used when there is no other option, they are mostly not used either. This mode isn't as faithful reproducing Excel files as the existing ones, and it doesn't validate either, but it can be very useful when you need simple HTML more than exact representation of the xls file. It can be used with devices or browsers that don't support CSS, or in places where you can't change the existing CSS definitions (for example if you are adding a table in a blog post, where you can't change the page headers to include other CSS file).

  • WHAT-IF TABLES. Now FlexCel can recalculate What-if tables, and you can add or read the What-if tables in a file. APIMate also supports What-if tables now, and will show the syntax to create them.

  • ADDED RECALCCELL METHOD TO THE API. This method allows you to calculate only a cell and its dependencies, not the whole workbook. It can be useful if you are using FlexCel as a calculator and making thousands of recalculations where you are only interested in the value of one cell.

  • ADDED RECALCEXPRESSION METHOD TO THE API. With this method you can calculate any formula that is not in the file. For example, if you want to know the sum of the cells in column a of a worksheet, you can use xls.RecalcExpression("=sum(A:A)").

  • SUPPORT FOR ENTERING MULTICELL FORMULAS WITH THE API. Now you can not only enter array formulas with the API as you could before, but also enter array formulas that span over more than one cell. We only added the ability to add them from the API, FlexCel was already fully aware of multicell array formulas and could recalculate them too. ApiMate will show you the syntax to enter them.

  • IMPROVED SUPPORT FOR DATE AXIS IN CHARTS. Now date axis in charts behave exactly the same way they do in Excel.

  • IMPROVED SUPPORT FOR NUMERIC FORMATS. Now "*", "_" and "?" characters in format strings are fully supported when rendering files, and will show exactly as they do in Excel.

  • IMPROVED RENDERING. Support for diagonal borders. A new "Linespace" property in XlsFile object allows you to fine tune the linespace between 2 lines in multiline cells.

  • IMPROVED COLOR MATCHING ALGORITHM FOR CONVERTING TO INDEXED COLORS. Now NearestColorIndex will use the Euclidean distance in L*a*b* color space instead or RGB, for improved color matching.

  • NEW SAVEFORHASHING METHOD. This method will save the file in a file format that will remain the same if the file didn't change, ignoring the timestamps present in the xls file format. So you can hash this value and use the hash to compare it to a new file, and know if something changed. Cell selections and sheet selections are not saved by default, but they can be included.

  • ADDED ABILITY TO READ AND WRITE "SHARED WORKBOOK" PROTECTION OPTIONS. Now you can change the shared workbook protections options in any file, xls or xlsx.

  • IMPROVED PERFORMANCE. FlexCel 5 has been a big rewrite that allowed use to tweak many places for even better performance.

New in v 4.9.6.2

  • IMPROVED AUTOFIT OF MERGED CELLS. Now when autofitting rows and a merged cell has more than one row, you can select which one of the rows from the merged cell will be updated. Same for autofitting columns and merged cells with more than one column. This applies to both reports and API. See "Autofitting Merged Cells" section in the API Guide for more information.

  • SYNTAX HIGHLIGHT WHEN DEBUGGING REPORTS. Now when in debug mode, strings will be maroon, booleans blue and errors red.

New in v 4.9.6.0 - November 2008

  • DELPHI PRISM SUPPORT. All demos have been converted to Delphi Prism, installation now installs into Delphi prism, and APIMate can generate Delphi Prism code.

  • ABILITY TO MODIFY CHART SERIES FROM THE API. Now you can directly modify chart series from the API.

  • FULL SUPPORT FOR WORKING WITH NAMED STYLES FROM THE API. Now you can create, modify or remove named styles in the Excel file. Also apply styles or find our which styles are applied to a cell.

  • TTC FONT SUPPORT WHEN EXPORTING TO PDF. Now TTC (True Type Collection) fonts are fully supported when exporting to PDF. This includes subsetting.

  • NEW SETEXPRESSION METHOD IN FLEXCEL REPORT. Now you can use the SetExpression method in FlexCelReport to dynamically add formulas to a report. For example, you might have an edit box where the user enters an expression like "<#evaluate(<#Order.Amount> * <#Order.Vat>)>", and this expression will be used in the final report. With this method you can reuse the same template to evaluate different formulas.

  • IMPROVED HTML RENDERING. Fixed small browser incompatibilities. Chart sheets now are exported too. Now FlexCelViewer renders by default in XHTML 1.1, to be compatible with the designer.

  • IMPROVED SPEED RENDERING CONDITIONAL FORMATS. Applies if you have thousands of conditional formats defined in a sheet, speed of rendering will be much faster.

  • IMPROVED SPEED IN FORMULA RECALCULATION. Now formula recalc is faster if you are using full sheet ranges (like A:IV).

  • SMALL BUG FIXES. Autofilters now are updated when inserting or deleting columns.

New in v 4.9.5.0

  • FONT SUBSTITUTION IN PDF. A new Property "FallbackFonts" in FlexCelPdfExport allows you to specify a list of "Fallback" fonts that FlexCel will use when the character to print is not in the main font. See "Dealing with missing fonts and glyphs" in UsingFlexCelPdfExport.pdf for more information.

  • NEW DBVALUE TAG FOR REPORTS. Allows you to know the value of any record of a data table, for example to merge similar cells. See the new "Merging Similar Cells" demo.

  • IMPROVED NAMED RANGE SUPPORT. New methods DeleteNamedRange and ConvertExternalNamesToRefErrors will let you delete a range or convert all ranges with external references in a file to #REF! errors.

  • NEW TRYTOCONVERTSTRINGS PROPERTY IN FLEXCELREPORT. When your data is stored as strings in your database, this property will make FlexCel enter the correct datatype for the contents into the cells.

New in v 4.9.2.0 - June 2008

  • NEW LIST TAG FOR REPORTS. The <#List()> tag allows to agregate a dataset into a list that can be dropped into a single cell, or also to use other tags without being inside a named range.

  • NEW SEMIABSOLUTEREFERENCES properties in the API and in Reports. Now you can control how to change absolute references in formulas referring to cells inside the block being copied. For example in Excel, if you have Cell A1: 1, Cell B1: =$A$1, and copy the row down, the new row will be Cell A2: 1, Cell B2: =$A$1. If you set this new property to true, Cell B2 will be =$A$2, since A2 is inside the block being copied. You can use this on the API when copying blocks with absolute references you would like to change, or in multi master detail reports, to ensure absolute references point to the right place.

  • SHEET TAB COLOR SUPPORT. Now you can read or set the color of a sheet tab using the new SheetTabColorIndex property in XlsFile. (This feature is supported in Excel XP or newer)

  • SHEET TAB COLOR EXPORTED TO HTML. Now by default if a sheet has a tab color, it will be shown in the resulting HTML file. You can change this by setting the new "UseSheetTabColors" property in the StandardSheetSelector class to false.

  • BUG FIXES. Fixed an error when subsetting complex true type fonts when exporting to pdf. Fixed an error when entering bmp image in compact framework.

New in v 4.9.1.0

  • Breaking Change: SUPPORT FOR EMBEDDING FONT SUBSETS IN PDF. Now FlexCel can embed only the subset of characters being used from a font into a PDF file, allowing smaller PDF files when embedding unicode fonts. NOTE: This is a BREAKING change, since font subsetting is enabled now by default. If you want to keep the old behavior (for example to have editable PDF files) you need to set FontSubset property to DontSubset in the PDF export components.

  • GLOBAL ERROR HANDLER FOR NON-FATAL ERRORS. There is a new FlexCelTrace global class where you can hook a listener to get notified of all non-fatal errors while working with FlexCel. You can use it for example to know when a font is not installed in the system and is being replaced by other in a pdf file, or when a character is not present in a font and so it will show as a blank square. See the new "Error Handling" demo and the PDF documentation in the PDF export guide.

  • ADDED TOP(N) FILTER FOR REPORTS. With this new filter you can get the top n items from a table directly from the template without touching the code. See the modified "Fixed Forms With Datasets" demo.

  • IMPROVED HTML RENDERING. Improved how exported HTML files are generated.

  • IMPROVED PDF EXPORT. Added a new event allowing to control whether to embed or not and individual font. See the modified "Export PDF" demo.

  • BUG FIXES. Fixed bug with some functions when recalculating linked files. Fixed overflow exception when creating charts with very large values.

New in v 4.9.0.0

  • RECALCULATION OF LINKED FILES. Now FlexCel can recalculate across linked files, even files with circular links. See the new section about Workspaces in the PDF API Guide.

  • AGGREGATE SUPPORT IN REPORTS. The new tag "Aggregate" allows to sum, average or find the minimum or maximum value in a dataset from the template. You can use it when you can't modify the data layer. See the new "Aggregates" demo.

  • SUPPORT FOR HTML TAGS WHEN REPLACING TEXT IN AUTOSHAPES. Now you can use html inside autoshapes as you could use inside normal cells.

  • IMPROVED RENDERING. Fixed small issues when rendering Excel spreadsheets.

New in v 4.8.0.1

  • IMPROVED RECALCULATION. Fixed a bug that might cause a file not to be recalculated in the second time you call recalc with complex files. Small performance improvements.

  • IMPROVED FORMAT DISPLAY. Added support for [mm], [hh] and [ss] format specifiers for elapsed time.

  • IMPROVED MONO COMPATIBILITY. Changed internal compression routines in pdf so they work under mono

New in v 4.8.0.0

  • PDF SIGNING. Now you can digitally sign the generated pdfs, with both a visible or non visible signature.

  • NEW APIMATE TOOL. This new tool can convert an Excel file to code, so you can see how to call the FlexCel APIs. Code can be generated in C#, VB.NET or Delphi.NET. A flash demo showing how to use it is available at http://www.tmssoftware.com/flexcel/tutorial.htm

  • IMPROVED HTML GENERATION. Includes the ability to export headers and footers as blocks above and below the spreadsheet, and fixes to workaround internet explorer bugs. Exporting headers and footers to HTML is off by default, but you can turn it on. (Look at the Export to HTML demo)

  • BUG FIXES. Small fix with formulas in Data Validation, and support for [>n] tags in numeric formatting expressions.

New in v 4.7.0.1

  • FLEXCEL DESIGNER BUG FIX. FlexCel designer could raise an Exception when started.

New in v 4.7.0.0

  • INTELLIGENT PAGE BREAKS. Even when there is no direct support for widow/orphan lines in Excel, FlexCel now provides a way to keep rows and columns together avoiding page breaks in the middle of important data. You tell FlexCel which rows you want to keep together, and it will automatically add page breaks at the needed points in the file so it prints as you want to. This new feature can be used both from the API or from the reports. For more information, look at the "Intelligent Page Breaks" demos in the Report and API sections.

  • BETTER ERROR HANDLING OF PAGE BREAK ERRORS. In previous FlexCel versions you could choose whether to raise an Exception or silently ignore errors when trying to insert more than the maximum allowed number of manual page breaks (1026). In this version you can insert as many Page Breaks as you want, and the error or silent ignore will be done at save time. This allows to have more than 1026 manual page breaks when exporting to PDF without saving as xls.

  • <#DEFINED FORMAT> TAG FOR REPORTS. Allows to know if a user defined format is defined or not. Look at the Intelligent Page Breaks demo in the report section.

  • NEW <#IMGPOS> AND <#IMGFIT> <#IMGDELETE> TAGS FOR REPORTS. You can use ImgPos to center or align an image dynamically inside a cell. ImgFit will resize the rows and columns below the image so the image is fit in one cell, and ImgDelete will delete an image. Take a look at the modified Images demo or at the new Features Page demo.

  • IMPROVED AUTOFIT IN API AND <#AUTOFIT> TAG FOR REPORTS. Now you can Autofit rows and columns setting a maximum and a minimum height/width for the autofit.

  • IMPROVED <#IMGSIZE> TAG FOR REPORTS. Now the ImageSize tag can do a "Best Fit" resize. You define the maximum size of the image in the template, and ImageSize will resize the image so it is as big as possible keeping the aspect ratio and inside the bounds you select. Look at the modified Images demo.

  • IMPROVED <#FORMAT RANGE>, <#DELETE RANGE> AND <#MERGE RANGE> TAGS FOR REPORTS. Now you can use named ranges instead of strings like "a1:a2" to define the ranges to format, merge or delete. It is recommended that you use this new way, so the ranges will adapt when you insert rows in your template. (A tag <#FORMAT RANGE(a1:a3;blue)> will not change to A2:A4 if you insert a new row at A1. A tag using a named range will.)

  • NEW IMAGEBACKGROUND PROPERTY WHEN EXPORTING TO HTML. Allows you to define a background color like white for images in html files, so they are not transparent and they show fine in Internet Explorer 6 without needing to use the FixIE6TransparentPngSupport to true or using gif images instead of png.

  • BUG FIXES. Small bug fix for border cases when inserting columns. AND function now can AND over a range of cells. Report Expressions now can use named ranges.

New in v 4.6.0.0

  • SUPPORT FOR VISUAL STUDIO 2008 AND .NET 3.5 FRAMEWORK. Also updated Setup with the option for installing into VS2008.

  • NATIVE DEMOS FOR VISUAL BASIC.NET. All more than 50 demos have been converted to Visual Basic .NET, allowing for easier study for vb users.

  • SUPPORT FOR CUSTOM EXCEL FORMULA FUNCTIONS. Now you can define your own classes that implement Excel custom formula functions (like for example the ones in the Analisis Toolpack Addin, or any function you define using a macro). You can read formulas using those functions from Excel, write them or calculate them. See the "Custom Excel Formula Functions" demo for more information.

  • SUPPORT FOR AUTOFILTERS IN API. Now you can read or write autofilters in a sheet using the API.

  • IMPROVED COPYING FROM ONE FILE TO ANOTHER. Now when copying between files Charts will be copied too, and all external references will be converted to the new file. Also Autofilters will be copied when there are no autofilters in the destination sheet.

  • IMPROVED GENERIC REPORTS. Now you can write expressions in a cell with a <#DataSet.*> tag, leading to much more powerful generic reports. Also now if the cell with the <#DataSet.**> tag has an autofilter, the autofilter will be propagated to the following columns. See the improved Generic Reports demo for more information.

  • MORE CUSTOMIZATION IN THE <#INCLUDE> TAG. Now you can include files in your reports without running a report on the include, and also specify if you want to copy the column widths and row heights from the included report into the parent. See the documentation in the Include tag.

  • BUG FIXES. Small bug fixes and optimizations.

New in v 4.5.1.0 - October 2007

  • DEBUG MODE IN FLEXCELREPORT. A new property in FlexCelReport, DebugExpressions, allows to output the full stack trace of the report tags to the cells where they are, instead of the tag value. Other property, ErrorsInResultFile allows to log the error messages to the generated file instead of raising exceptions. See the new Debugging Reports demo and the Debugging Reports section in the pdf user guide for more information.

  • DATA VALIDATION SUPPORT. Added methods to add, delete, change or get information about the Data Validation of a cell.

  • IMPROVED OUTLINE SUPPORT. Added methods to collapse or expand the outlines in a sheet to a specified level, to collapse and expand individual nodes, or to find out if a row or column is an outline node (contains a "+" sign).

  • IMPROVED XLS COMPATIBILITY WITH EXCEL 2007. Some really complex image manipulations could cause Excel 2007 to fail to load the generated xls files. It has been fixed now.

  • IMPROVED COMPATIBILITY WITH MONO. Tested with .NET 2.0 implementation of Mono and workarounded MONO issues.

  • NEW OBJECT EXPLORER AND ADVANCED API DEMOS. The first shows how objects in a sheet are nested, and the second shows how to use different methods in the API.

New in v 4.5.0.0 - September 2007

  • HTML EXPORTING ENGINE. A new component TFlexCelHtmlExport can export Excel files to html, in HTML 4.01 strict or XTHML 1.1 and fully standards compliant, with the quality you have come to expect from us. Most things, like images, charts, merged cells, conditional formats, wordart, etc. are exported. Multiple sheets can be exported in tabs or as a single file. Support for ie 6/7, Firefox, Opera and Safari.

  • FLEXCELASPVIEWER. Allows viewing Excel files as html directly from any ASP.NET application. Just drop the component in a WebForm, and assign it to an xls file. (only ASP.NET 2.0 supported)

  • META TEMPLATES. The new <#PREPROCESS> tag allows a template to modify itself before creating a report. You can now for example create reports that will automatically delete a column from the report template if the dataset does not have the field. See the "Meta Templates" demo for more information.

  • PARTIAL FORMAT DEFINITIONS IN REPORTS. Now you can define formats in the config sheet that will apply only a part of the cell format. For example, if you name a format "Header(background)" it will only apply the background of the cell and not all the other properties. See EndUserGuide.pdf for more information, and the Multiple Sheet Report demo for an example.

  • API IMPROVEMENTS. New method XlsFile.RenderObject allows exporting any image/chart/autoshape into an image. New method XlsFile.RenderCells allows exporting a range of cells (without objects) into an image. You can still export full spreadsheets to images with FlexCelImgExport, but these methods provide lower level access.

  • FULL TEXT SEARCH IN DEMOS. Now you can easily find the demo that shows a feature you are interested in by typing in the Search box in MainDemo.

  • BUG FIXES AND SPEED IMPROVEMENTS. Small fixes in rendering and overall speed enhancements.

New in v 4.0.0.3 - May 2007

  • BUG FIXES. Locales like Turkish where I (uppercase) is not the same as i (lowercase) had problems. When printing/exporting to pdf more than one sheet, sometimes the "print to fit" size for the second sheet could be calculated wrong. Rotated transparent shapes exported to pdf could be exported wrong.

New in v 4.0.0.2 - April 2007

  • IMPROVED CSV IMPORT/EXPORT. Now supporting Locales.

  • BUG FIXES. Error in border cases when adapting formulas after inserting rows in different sheets.

New in v 4.0.0.0 - December 2006

  • CHART RENDERING. Now most 2d charts are printed and exported as images or pdf. 3d charts are exported as their 2d equivalents. Bubble, Surface and Radar charts are not exported.

  • NEW HTML CAPABILITIES. Now you can directly enter HTML formatted strings into an Excel cell, using TRichString.FromHtml(). Also you can convert the rich text in an Excel cell into an HTML string. A new property "HtmlMode" on FlexCelReport allows you to do reports from HTML data. Also the new <#HTML> tag allows to select which cells you want to use html and which ones you don't no matter the "HtmlMode" value. See the "HTML Reports" demo for more information.

  • SUPPORT FOR WRITING PXL 2.0(POCKET EXCEL) FILES. Now you can not only read but also create native Pxl 2.0 files.

  • READING DOCUMENT PROPERTIES. Now you can read the Author, Title, etc. of any xls document.

  • IMPROVED FLEXCELIMAGEEXPORT. The new method "SaveAsImage" allows creating multipage tiffs, fax, png, gif and jpg images of any xls file with just a method call. See the "PRINT PREVIEW AND EXPORT" demo for more details.

  • IMPROVED PRINTING AND EXPORTING. New properties AllVisibleSheets and ResetPageNumberOnEachSheet on FlexCelImgExport and FlexCelPrintDocument, allow printing all sheets on a workbook, keeping the "page n /m" headers or footers correlative. A method on FlexCelPdfExport allows the same thing. See the exporting demos.

  • AUTOFITTING SUPPORT. Now you can autofit rows or columns with XlsFile.AutoFitRow, XlsFile.AutoFitCol and XlsFile.AutoFitWorkbook methods. On reports, the new tags <#Row Height> and <#Column Width> allow to change the row height / column width in a report, and to hide, show or autofit columns and rows. See the new Autofitting demo on the reports section.

  • VIRTUAL DATASETS. Now you can use any data you like as source for your reports, not only Datasets. See the new Virtual DataSets demo.

  • SUPPORT FOR MANUAL FORMULAS IN REPORTS. New report tags <#Formula> and <#Ref> allow replacing tags inside formulas, creating customizable formulas depending on the report data. (See the new "Manual Formulas" demo).

  • NEW ENTERFORMULAS PROPERTY ON FLEXCELREPORT. Allows to enter any text starting with "=" as a formula instead of text.

  • FIXED BANDS ON REPORTS. Now, by defining "__band__FIXED" ranges you can have bands that don't insert cells when moving down. See Fixed Forms With Datasets demo.

  • IMPROVED TAG REPLACE. Report Tags are replaced now also on WordArt objects and Screen tips inside Hyperlinks.

  • SPLIT TAG ON REPORTS. Allows splitting a datatable every n rows. See Split demo for more information.

  • USER TABLE TAG ON REPORTS. Allows defining the datasets you want to use directly on the template. See User Tables demo for more information.

  • ADDED RECALCULATION FOR FUNCTIONS. DCount, DSum, DAverage, DMin, DMax, DProduct, DCountA, DGet, DVar, DVarP, DStDev, DStDevP, Large, Small, MinA, MaxA, Var, VarP, VarA, VarPA, WeekDay, Product, SumSq, CountBlank, Roman, AverageA, Days360, FV, PV, NPV, DB, DDB, Syd, Sln, PMT, IMPT, PPMT, NPer, NormDist, NormsDist, LogNormDist, NormInv, NormsInv, LogInv, ExponDist, Poisson, Binomdist, NegBinomDist, HypGeomDist, Standardize, GeoMean, HarMean, Rank, GammaDist, GammaInv, GammaLn, ChiDist, ChiInv, IRR, MIRR, Rate, Areas, Rows, Columns, SumX2mY2, SumX2pY2, SumXmY2, Transpose, MMult, ZTest, ChiTest, Weibull, Kurt, Skew, AveDev, DevSQ, Steyx, Rsq, Pearson, Slope, Fisher, FisherInv, Median, Quartile, Percentile, Mode, Intercept. 210 functions supported (see the new SupportedFunctions.xls spreadsheet).

  • IMPROVED ARRAY FORMULA SUPPORT. Now you can enter array formulas with the API (for example "{=Average(if(a1:a3=3;1))}" ). And now FlexCel can calculate array formulas too, including array formulas that cover more than one cell.

  • ADDED BOOKMARKS TO PDF. Now you can automatically add a bookmark on each sheet when exporting to pdf, or manually modify the bookmarks too. See the "Custom Preview" demo, on the button to export to pdf when "All Sheets" is selected.

  • IMPROVED RENDERING. Added support to print and Export to PDF more than 70 Autoshapes: From block arrows to FlowCharts to basic shapes. See the new file SupportedAutoshapes.xls for more information.

  • IMPROVED RENDERING. Now FlexCel can print and export to pdf basic WordArt text. Not all effects or types of WordArt are supported, but text is shown.

  • IMPROVED RENDERING. Improved shadow support for autoshapes, and also gradient, texture, pattern and image fills supported.

  • ADDED MOVERANGE TO THE API. Allows moving a range of cells in a sheet the same way Excel moves them, adapting all formula references as needed. The same as the existing InsertAndCopyRange and DeleteRange methods, this method is fully optimized to perform thousands of moves by second.

  • ADDED Find, Replace and Sort METHODS TO THE API. While you could always do this by code, now it is easier to search inside, replace or sort a range.

  • ADDED XlsFile.Protection.WriteAccess PROPERTY. Lets you know which user has a file opened in Excel. See the modified Getting started demo.

  • NEW READING FILES DEMO. Showing how to import an Excel file into a DataSet /Datagrid.

  • IMPROVED MONO PDF SUPPORT. Now FlexCel will try to automatically find the fonts when running on Linux. Also added a section on UsingFlexCelPdfExport.pdf explaining how to create pdf files from MONO.

  • 1904 DATES SUPPORT. Full support for 1904 based dates, allowing interoperability with xls files created on Apple computers.

  • PRECISION AS DISPLAYED SUPPORT. Now recalculation in files where "Precision as Displayed" is true will honor that setting.

  • IMPROVED PERFORMANCE. Performance improvements in Reporting, rendering and the API.

  • OPTIMIZED PDF FILE SIZE. Now Pdfs are smaller.

  • IMPROVED HELP FILES. Help files are now created with SandCastle, and can be integrated inside the VS IDE.

  • BUG FIXES. Small bug fixes.

New in v 3.7.0.0 - December 2005

  • SUPPORT FOR READING PXL (POCKET EXCEL) FILES. Now you can read both Pxl 1.0 and 2.0 files.

  • COMPACT FRAMEWORK 2.0 SUPPORT. A new project FlexCelCF20 is included for CF 2.0. A new project for .NET 20 (FLEXCEL20.csproj) is included too.

  • DELPHI 2006 (.NET). Support and demos.

  • SUPORT FOR RENDERING MOST USED AUTOSHAPES. Now rectangles, textboxes, ellipses, lines, triangles, arrows will be printed/previewed/exported to pdf. Support for semi-transparent fills, rich text inside, shadows, etc.

  • NEW FUNCTIONS SUPPORTED FOR RECALCULATION. Cell, Lookup, Address, Fact, Combin, Permut, SinH, CosH, TanH, ASinH, ACosH, ATanH, Fixed, Dollar, Code, T, N, Hyperlink, StDev, StDevP, StDevA, StDevPA, Correl, Covar

  • NEW CALCULATED COLUMNS ADDED TO REPORTS. Now you can use <#DataSet.#RowPos> and <#DataSet.#RowCount> inside reports to access the actual position and record count of a band.

  • IMPROVEMENTS ON PDF API. Now you can write transparent text with the API, for example to superimpose a watermark to a FlexCel generated file. (See PDF Export demo)

  • IMPROVEMENTS ON RENDERING. Watermark images on headers/footers now print right.

  • IMPROVEMENTS ON FORMULA PARSING. There were some issues when entering complex formulas with the API, the formulas will be entered correctly but Excel would not calculate them.

  • NEW UTILITY API FUNCTIONS. Added 2 overload to SetCellFormat allowing to set the format to a range of cells and change only one attribute on a range of cells (for example change only the line style, keeping the existing fonts)

  • NEW FEATURED DEMO. FlexCel Image Explorer allows you to see and extract the images you have inside an Excel file.

New in v 3.6.0.0 - August 2005

  • DIRECT SQL ON REPORTS. Now you can write sql against a connection on the server directly from the template. Note that for security reasons, if you don't add any connection to the report, no SQL can be executed. See "Direct SQL" demo for details.

  • RELATIONSHIPS ON THE TEMPLATE. Now you can add data relationships directly on the template, allowing for example to "split" a dataset into master/detail and relate the 2 new datasets. See "Master Detail on one Table" demo for more information.

  • DISTINCT FILTER. Now you can use a "DISTINCT() filter to filter unique values on a dataset. See "Master Detail on one Table" demo for more information.

  • MERGE RANGE TAG. With it you can conditionally merge cells on a band. See "Master Detail on one Table" demo for more information.

  • LOTS OF SMALL IMPROVEMENTS ON THE RENDERING ENGINE. Now Conditional formats are printed and exported to pdf, cell patterns are exported to pdf and print better, Printer hard margins are considered, Subscripts/Superscript show on text, grouped and arbitrary angle rotated images are shown, etc.

  • PARAMETERS ON REPORT EXPRESSIONS. Now you can use parameters when defining report expressions. For more information, see Expression Parameters demo.

  • IMPROVED CF SUPPORT. Better support for CF packages (Registered version only)

  • NEW FEATURED DEMOS. Showing how to access a web service from FlexCel or how to export an AdvWebGrid. Modified the Print/Preview demo to show how to export Multipage tiff files.

  • NEW DEMO ON HOW TO DIRECTLY OPEN THE GENERATED FILES. The "Getting Started" and "Getting Started Reports" demos have been modified to show how to directly open the generated files without asking the user to save the file. (note that for this to work, the user must have excel on his machine).

  • FLEXCEL API. New methods FreezePanes and GetFrozenPanes to freeze/unfreeze or get information about frozen panes. New methods SplitWindow / GetSplitWindow to split a sheet.

  • PERFORMANCE IMPROVEMENTS. Almost 30% faster on some tests.

  • IMPROVED FRAMEWORK 2.0 SUPPORT. Now when FRAMEWORK20 symbol is defined the new compression classes on System.IO.Compression will be used.

  • BUG FIX. A call to StringFormat.SetMeasurableRanges could cause a deadlock when running hundreds of threads at the same time.

New in v 3.5.0.0 - May 2005

  • NATIVE PDF EXPORT. Now you can export your reports to pdf, all on 100% native and managed code, without needing to have Excel or Adobe Acrobat installed.

  • OPTIMIZED PRINTING ENGINE. Much faster and with lots of new features. (like repeating rows/columns, brightness/contrast adjustments on images, printing column and row headers, printing different types of borders and much more)

  • IMPROVED RECALCULATION. More than 100 functions supported, and now much more like Excel. New methods include: Find, Proper, Concatenate, Exact, Rept, Clean, Search, Substitute, Text, Index, Match, RoundUp, RoundDown, Even, Odd, Subtotal, CountA, Value, Sumproduct. Also now supported intersect and union of ranges while recalculating, and arrays as parameters of formulas.

  • BASIC AUTOSHAPES SUPORT. Now you can retrieve all their values and change their text. FlexCelReport will replace text inside Autoshapes also.

  • SUPPORT FOR READING/WRITING HEADER AND FOOTER IMAGES. Now you can access images on headers and footers, and they will be printed and exported to pdf too. Note that images on headers and footers are only supported on Excel XP and newer, older Excel versions will open the file but will not display the graphics.

  • NEW COMPONENT TO PREVIEW WITH THUMBNAILS AND WITHOUT PRINTERS INSTALLED. NEW COMPONENT TO EXPORT TO IMAGES. See Custom preview demo for more information on both.

  • CELL SELECTIONS. Now you can read and write cell selections on a file. A new property on FlexCelReport, "ResetCellSelections", allows you to reset all selections on all sheets to "A1", so you do not need to worry about selection positions when saving the template.

  • SET NAMED RANGES. Now you can add or modify named ranges, including ones as the print area.

  • OPTIMIZED FOR .NET 2.0. If you define the "FRAMEWORK20" conditional define, a lot of 2.0 ONLY features (like Generics) will be used in places where they can improve performance.

  • REGULAR EXPRESSIONS ON REPORTS. You can use the new <#REGEX()> tag to perform regular expression replaces on the reports. See "Regular Expressions" demo for more information.

  • COMPACT FRAMEWORK ASSEMBLIES. While you can still use the same dll for both compact and full framework (as before) now we include a special FlexCelCF solution that will create an assembly specifically targeted to CF.

  • CODENAMES. Now you can read the codenames of the sheets. This is useful because codenames never change, while sheet names can be changed by the user.

  • NEW METHODS. ConvertFormulasToValues allows you to quickly remove formulas form a sheet. RecalcAndVerify() allows to verify you are using supported functions on your template. (See Verify Recalc demo)

  • HYPERLINK SUPPORT ENHANCED. Now empty hyperlinks on report will not show, and also the syntax for tags is changed to "*.tag.*" for Excel2003 compatibility. (old <.tags> still work, but it is recommended to use the new syntax for new development)

New in v 3.1.0.1 - January 2005

  • FORMULA RECALCULATION. Now most used formulas are recalculated before saving the files. (If the new RecalcMode property is not manual). So you can see formula results on any Excel viewer, such as Microsoft Excel viewer or FlexCelPrintDocument.

  • FOUR RECALCULATION MODES. Recalculation can be manual (similar to v3.0), Forced (always recalculate before saving), Smart (Recalculate before saving only if file has been modified) or OnEveryChange (recalculate after changing any cell). Also an new RecalcForced property allows you to specify Excel not to recalculate on open.

  • PROTECTION AND ENCRYPTION. There is a new property "Protection" on XlsFile that allows to both read and write protected and encrypted xls files. See Protect demo for more details.

  • ENHANCED DELPHI.NET SUPPORT. Added a new demo with Delphi.Net, and now all BDP datatypes are supported.

  • NEW FUNCTIONS FOR REPORTING. Now you can use Sum, Average, Round, Abs, Ceiling, Floor, Exp, Int, Ln, Log, Log10, Pi, Power, Rand, Sign, Sqrt, Trunc, Count, Radians, Degrees, Sin, Cos, Tan, ASin, ACos, ATan, ATan2, SumIf, CountIf, Date, DateValue, Day, Month, Year, Time, TimeValue, Hour, Minute, Second, Now, Today, Error.Type, IsBlank, IsErr, IsError, IsLogical, IsNA, IsNonText, IsNumber, IsREF, IsText, Type, Na, Choose, Offset, HLookup and VLookup when creating expressions for a report. All of those functions will be evaluated when recalculating formulas too.For a complete list of supported functions, see EndUserGuide.pdf, "Evaluating Expressions"

  • SMALL PERFORMANCE IMPROVEMENTS. FlexCel 3.1 is even faster than 3.0. Not much, because 3.0 was quite fast, but a little faster.

New in v 3.0.0.5 - August 2004

  • First public FlexCel for .NET version. Based in the FlexCel for Delphi 2.x version, this initial version includes reports and an extensive API to read or write xls files.


Supported Excel functions | FlexCel Studio for the .NET Framework documentation

Supported Excel functions

This is a list of all the standard Excel functions up to Excel 2021.

Functions marked with strikeout are not implemented yet. To know if a specific spreadsheet has all the formulas supported by FlexCel, you can use the Validate Recalc demo

Formulas on column "Array Enabled" mean that you can enter them inside an Array formula with a range argument (for example "if(a1:a10 < 3;…;….)") All formulas can be used inside Array Formulas, but only the ones on this list can be used with array arguments where they would expect a single value. By "Array formulas" we mean formulas you enter with Shift-Ctrl-Enter in Excel

Supported built-in functions

  • Total built-in functions: 455
  • Implemented: 353 (78%)

Built-in functions in 2003

Financial

Name | Implemented | Array enabled
DB | ✓ |
DDB | ✓ |
FV | ✓ |
IPMT | ✓ |
IRR | ✓ |
ISPMT |  |
MIRR | ✓ |
NPER | ✓ |
NPV | ✓ |
PMT | ✓ |
PPMT | ✓ |
PV | ✓ |
RATE | ✓ |
SLN | ✓ |
SYD | ✓ |
VDB |  |

Date & Time

Name | Implemented | Array enabled
DATE | ✓ | ✓
DATEVALUE | ✓ | ✓
DAY | ✓ | ✓
DAYS360 | ✓ |
HOUR | ✓ | ✓
MINUTE | ✓ | ✓
MONTH | ✓ | ✓
NOW | ✓ | ✓
SECOND | ✓ | ✓
TIME | ✓ | ✓
TIMEVALUE | ✓ | ✓
TODAY | ✓ | ✓
WEEKDAY | ✓ | ✓
YEAR | ✓ | ✓
DATEDIF | ✓ | ✓

Math & Trig

Name | Implemented | Array enabled
ABS | ✓ | ✓
ACOS | ✓ | ✓
ACOSH | ✓ | ✓
ASIN | ✓ | ✓
ASINH | ✓ | ✓
ATAN | ✓ | ✓
ATAN2 | ✓ | ✓
ATANH | ✓ | ✓
CEILING | ✓ | ✓
COMBIN | ✓ | ✓
COS | ✓ | ✓
COSH | ✓ | ✓
DEGREES | ✓ | ✓
EVEN | ✓ | ✓
EXP | ✓ | ✓
FACT | ✓ | ✓
FLOOR | ✓ | ✓
INT | ✓ | ✓
LN | ✓ | ✓
LOG | ✓ |
LOG10 | ✓ | ✓
MDETERM |  |
MINVERSE |  |
MMULT | ✓ | ✓
MOD | ✓ | ✓
ODD | ✓ | ✓
PI | ✓ | ✓
POWER | ✓ | ✓
PRODUCT | ✓ | ✓
RADIANS | ✓ | ✓
RAND | ✓ | ✓
ROMAN | ✓ |
ROUND | ✓ | ✓
ROUNDDOWN | ✓ | ✓
ROUNDUP | ✓ | ✓
SIGN | ✓ | ✓
SIN | ✓ | ✓
SINH | ✓ | ✓
SQRT | ✓ | ✓
SUBTOTAL | ✓ |
SUM | ✓ | ✓
SUMX2MY2 | ✓ | ✓
SUMX2PY2 | ✓ | ✓
SUMXMY2 | ✓ | ✓
SUMIF | ✓ | ✓
SUMPRODUCT | ✓ | ✓
SUMSQ | ✓ | ✓
TAN | ✓ | ✓
TANH | ✓ | ✓
TRUNC | ✓ |

Statistical

Name | Implemented | Array enabled
AVEDEV | ✓ | ✓
AVERAGE | ✓ | ✓
AVERAGEA | ✓ | ✓
BETADIST |  |
BETAINV |  |
BINOMDIST | ✓ |
CHIDIST | ✓ |
CHIINV | ✓ |
CHITEST | ✓ | ✓
CONFIDENCE | ✓ |
CORREL | ✓ |
COUNT | ✓ | ✓
COUNTA | ✓ | ✓
COUNTBLANK | ✓ | ✓
COUNTIF | ✓ | ✓
COVAR | ✓ |
CRITBINOM |  |
DEVSQ | ✓ |
EXPONDIST | ✓ |
FDIST |  |
FINV |  |
FISHER | ✓ | ✓
FISHERINV | ✓ | ✓
FORECAST |  |
FREQUENCY | ✓ | ✓
FTEST |  |
GAMMADIST | ✓ |
GAMMAINV | ✓ |
GAMMALN | ✓ | ✓
GEOMEAN | ✓ |
GROWTH |  |
HARMEAN | ✓ |
HYPGEOMDIST | ✓ |
INTERCEPT | ✓ |
KURT | ✓ |
LARGE | ✓ | ✓
LINEST |  |
LOGEST |  |
LOGINV | ✓ |
LOGNORMDIST | ✓ |
MAX | ✓ | ✓
MAXA | ✓ | ✓
MEDIAN | ✓ | ✓
MIN | ✓ | ✓
MINA | ✓ | ✓
MODE | ✓ | ✓
NEGBINOMDIST | ✓ |
NORMDIST | ✓ |
NORMINV | ✓ |
NORMSDIST | ✓ | ✓
NORMSINV | ✓ | ✓
PEARSON | ✓ | ✓
PERCENTILE | ✓ | ✓
PERCENTRANK | ✓ |
PERMUT | ✓ | ✓
POISSON | ✓ |
PROB |  |
QUARTILE | ✓ | ✓
RANK | ✓ |
RSQ | ✓ | ✓
SKEW | ✓ | ✓
SLOPE | ✓ | ✓
SMALL | ✓ | ✓
STANDARDIZE | ✓ | ✓
STDEV | ✓ |
STDEVA | ✓ |
STDEVP | ✓ |
STDEVPA | ✓ |
STEYX | ✓ | ✓
TDIST |  |
TINV |  |
TREND |  |
TRIMMEAN |  |
TTEST |  |
VAR | ✓ |
VARA | ✓ |
VARP | ✓ |
VARPA | ✓ |
WEIBULL | ✓ |
ZTEST | ✓ |

Lookup & Reference

Name | Implemented | Array enabled
ADDRESS | ✓ | ✓
AREAS | ✓ |
CHOOSE | ✓ | ✓
COLUMN | ✓ | ✓
COLUMNS | ✓ | ✓
HLOOKUP | ✓ |
HYPERLINK | ✓ |
INDEX | ✓ | ✓
INDIRECT | ✓ | ✓
LOOKUP | ✓ |
MATCH | ✓ | ✓
OFFSET | ✓ | ✓
ROW | ✓ | ✓
ROWS | ✓ | ✓
TRANSPOSE | ✓ | ✓
VLOOKUP | ✓ |

Database

Name | Implemented | Array enabled
DAVERAGE | ✓ |
DCOUNT | ✓ |
DCOUNTA | ✓ |
DGET | ✓ |
DMAX | ✓ |
DMIN | ✓ |
DPRODUCT | ✓ |
DSTDEV | ✓ |
DSTDEVP | ✓ |
DSUM | ✓ |
DVAR | ✓ |
DVARP | ✓ |
GETPIVOTDATA |  |

Text

Name | Implemented | Array enabled
ASC | ✓ | ✓
BAHTTEXT | ✓ | ✓
CHAR | ✓ | ✓
CLEAN | ✓ | ✓
CODE | ✓ | ✓
CONCATENATE | ✓ | ✓
DOLLAR | ✓ |
EXACT | ✓ |
FIND | ✓ |
FIXED | ✓ |
JIS |  |
LEFT | ✓ | ✓
LEN | ✓ | ✓
LOWER | ✓ | ✓
MID | ✓ | ✓
PHONETIC |  |
PROPER | ✓ | ✓
REPLACE | ✓ | ✓
REPT | ✓ |
RIGHT | ✓ | ✓
SEARCH | ✓ | ✓
SUBSTITUTE | ✓ |
T | ✓ |
TEXT | ✓ |
TRIM | ✓ | ✓
UPPER | ✓ | ✓
VALUE | ✓ | ✓

Logical

Name | Implemented | Array enabled
AND | ✓ | ✓
FALSE | ✓ | ✓
IF | ✓ | ✓
NOT | ✓ | ✓
OR | ✓ | ✓
TRUE | ✓ | ✓

Information

Name | Implemented | Array enabled
CELL | ✓ |
ERROR.TYPE | ✓ | ✓
INFO |  |
ISBLANK | ✓ | ✓
ISERR | ✓ | ✓
ISERROR | ✓ | ✓
ISLOGICAL | ✓ | ✓
ISNA | ✓ | ✓
ISNONTEXT | ✓ | ✓
ISNUMBER | ✓ | ✓
ISREF | ✓ |
ISTEXT | ✓ | ✓
N | ✓ |
NA | ✓ | ✓
TYPE | ✓ | ✓
  • Total: 238
  • Implemented: 214 (90%)

Added functions in Excel 2007

Name | Implemented | Array enabled
ACCRINT | ✓ |
ACCRINTM | ✓ |
AMORDEGRC |  |
AMORLINC |  |
AVERAGEIF | ✓ | ✓
BESSELI |  |
BESSELJ |  |
BESSELK |  |
BESSELY |  |
BIN2DEC | ✓ |
BIN2HEX | ✓ |
BIN2OCT | ✓ |
COMPLEX |  |
CONVERT | ✓ |
COUPDAYBS | ✓ |
COUPDAYS | ✓ |
COUPDAYSNC | ✓ |
COUPNCD | ✓ |
COUPNUM | ✓ |
COUPPCD | ✓ |
CUMIPMT | ✓ |
CUMPRINC | ✓ |
DEC2BIN | ✓ |
DEC2HEX | ✓ |
DEC2OCT | ✓ |
DELTA | ✓ |
DISC |  |
DOLLARDE | ✓ |
DOLLARFR | ✓ |
DURATION | ✓ |
EDATE | ✓ |
EFFECT | ✓ |
EOMONTH | ✓ |
ERF |  |
ERFC |  |
FACTDOUBLE | ✓ |
FVSCHEDULE |  |
GCD | ✓ | ✓
GESTEP | ✓ |
HEX2BIN | ✓ |
HEX2DEC | ✓ |
HEX2OCT | ✓ |
IFERROR | ✓ | ✓
IMABS |  |
IMAGINARY |  |
IMARGUMENT |  |
IMCONJUGATE |  |
IMCOS |  |
IMDIV |  |
IMEXP |  |
IMLN |  |
IMLOG10 |  |
IMLOG2 |  |
IMPOWER |  |
IMPRODUCT |  |
IMREAL |  |
IMSIN |  |
IMSQRT |  |
IMSUB |  |
IMSUM |  |
INTRATE |  |
ISEVEN | ✓ |
ISODD | ✓ |
LCM | ✓ | ✓
MDURATION | ✓ |
MROUND | ✓ |
MULTINOMIAL | ✓ | ✓
NETWORKDAYS | ✓ |
NOMINAL | ✓ |
OCT2BIN | ✓ |
OCT2DEC | ✓ |
OCT2HEX | ✓ |
ODDFPRICE |  |
ODDFYIELD |  |
ODDLPRICE |  |
ODDLYIELD |  |
PRICE |  |
PRICEDISC |  |
PRICEMAT |  |
QUOTIENT | ✓ |
RANDBETWEEN | ✓ |
RECEIVED |  |
SERIESSUM | ✓ |
SQRTPI | ✓ |
TBILLEQ |  |
TBILLPRICE |  |
TBILLYIELD |  |
WEEKNUM | ✓ |
WORKDAY | ✓ |
XIRR | ✓ |
XNPV | ✓ |
YEARFRAC | ✓ |
YIELDDISC |  |
YIELDMAT |  |
  • Total: 94
  • Implemented: 52 (55%)

Added functions in Excel 2010

Name | Implemented | Array enabled
NETWORKDAYS.INTL | ✓ |
WORKDAY.INTL | ✓ |
AGGREGATE | ✓ |
CEILING.PRECISE | ✓ | ✓
ISO.CEILING | ✓ | ✓
CHISQ.DIST |  |
CHISQ.INV |  |
CONFIDENCE.T |  |
COVARIANCE.S |  |
ERF.PRECISE |  |
ERFC.PRECISE |  |
F.DIST |  |
F.INV |  |
FLOOR.PRECISE | ✓ |
GAMMALN.PRECISE |  |
MODE.MULT |  |
PERCENTILE.EXC | ✓ |
PERCENTRANK.EXC |  |
QUARTILE.EXC | ✓ |
RANK.AVG | ✓ | ✓
T.DIST |  |
T.INV |  |
  • Total: 22
  • Implemented: 9 (41%)

Added functions in Excel 2013

Name | Implemented | Array enabled
DAYS | ✓ | ✓
ISOWEEKNUM | ✓ | ✓
BITAND | ✓ | ✓
BITLSHIFT | ✓ | ✓
BITOR | ✓ | ✓
BITRSHIFT | ✓ | ✓
BITXOR | ✓ | ✓
IMCOSH |  |
IMCOT |  |
IMCSC |  |
IMCSCH |  |
IMSEC |  |
IMSECH |  |
IMSINH |  |
IMTAN |  |
PDURATION | ✓ | ✓
RRI | ✓ | ✓
ISFORMULA | ✓ | ✓
SHEET | ✓ |
SHEETS | ✓ | ✓
IFNA | ✓ | ✓
XOR | ✓ | ✓
FORMULATEXT | ✓ | ✓
ACOT | ✓ | ✓
ACOTH | ✓ | ✓
ARABIC | ✓ | ✓
BASE | ✓ | ✓
CEILING.MATH | ✓ | ✓
COMBINA | ✓ | ✓
COT | ✓ | ✓
COTH | ✓ | ✓
CSC | ✓ | ✓
CSCH | ✓ | ✓
DECIMAL | ✓ | ✓
FLOOR.MATH | ✓ | ✓
ISO.CEILING | ✓ | ✓
MUNIT | ✓ | ✓
SEC | ✓ | ✓
SECH | ✓ | ✓
BINOM.DIST.RANGE |  |
GAMMA |  |
GAUSS |  |
PERMUTATIONA | ✓ | ✓
PHI |  |
SKEW.P |  |
NUMBERVALUE | ✓ | ✓
UNICHAR | ✓ | ✓
UNICODE | ✓ | ✓
ENCODEURL |  |
FILTERXML |  |
WEBSERVICE |  |
  • Total: 51
  • Implemented: 35 (69%)

Added functions in Excel 2016

Name | Implemented | Array enabled
FORECAST.LINEAR |  |
FORECAST.ETS |  |
FORECAST.ETS.SEASONALITY |  |
FORECAST.ETS.CONFINT |  |
FORECAST.ETS.STAT |  |
SWITCH | ✓ | ✓
  • Total: 6
  • Implemented: 1 (17%)

Added functions in Excel 2019

Name | Implemented | Array enabled
AVERAGEIFS | ✓ | ✓
COUNTIFS | ✓ | ✓
SUMIFS | ✓ | ✓
TEXTJOIN | ✓ | ✓
CONCAT | ✓ | ✓
IFS | ✓ | ✓
MINIFS | ✓ | ✓
MAXIFS | ✓ | ✓
  • Total: 8
  • Implemented: 8 (100%)

Added functions in Office 2021

Name | Implemented | Array enabled
FILTER | ✓ | ✓
RANDARRAY | ✓ | ✓
SEQUENCE | ✓ | ✓
SORT | ✓ | ✓
SORTBY | ✓ | ✓
UNIQUE | ✓ | ✓
XLOOKUP | ✓ | ✓
XMATCH | ✓ | ✓
LET | ✓ | ✓
SINGLE | ✓ | ✓
  • Total: 10
  • Implemented: 10 (100%)

Added functions in Office 365

Name | Implemented | Array enabled
ARRAYTOTEXT | ✓ | ✓
VALUETOTEXT | ✓ | ✓
BYCOL | ✓ | ✓
BYROW | ✓ | ✓
FIELDVALUE |  |
ISOMITTED | ✓ | ✓
LAMBDA | ✓ | ✓
MAKEARRAY | ✓ | ✓
MAP | ✓ | ✓
REDUCE | ✓ | ✓
SCAN | ✓ | ✓
STOCKHISTORY |  |
TEXTBEFORE | ✓ | ✓
TEXTAFTER | ✓ | ✓
TEXTSPLIT | ✓ | ✓
VSTACK | ✓ | ✓
HSTACK | ✓ | ✓
TOROW | ✓ | ✓
TOCOL | ✓ | ✓
WRAPROWS | ✓ | ✓
WRAPCOLS | ✓ | ✓
TAKE | ✓ | ✓
DROP | ✓ | ✓
CHOOSEROWS | ✓ | ✓
CHOOSECOLS | ✓ | ✓
EXPAND | ✓ | ✓
  • Total: 26
  • Implemented: 24 (92%)

Renamed functions

This is a list of the functions renamed in Excel.

  • Supported means that FlexCel understands the function and you can add it with the API.

  • Implemented for recalc means that FlexCel knows how to calculate the function.

Note

Normally, if a function renamed is implemented for recalc in FlexCel under the old name then it will also be implemented for recalc in the new name.

But some renamed functions like Norm.S.Dist have a different list of parameters. Those might not be implemented for recalc.

Renamed functions in Excel 2010

New name | Old name | Supported | Implemented for recalc
BETA.DIST | BETADIST | ✓ |
BETA.INV | BETAINV | ✓ |
BINOM.DIST | BINOMDIST | ✓ | ✓
BINOM.INV | CRITBINOM | ✓ |
CHISQ.DIST.RT | CHIDIST | ✓ | ✓
CHISQ.INV.RT | CHIINV | ✓ | ✓
CHISQ.TEST | CHITEST | ✓ | ✓
CONFIDENCE.NORM | CONFIDENCE | ✓ | ✓
COVARIANCE.P | COVAR | ✓ | ✓
EXPON.DIST | EXPONDIST | ✓ | ✓
F.DIST.RT | FDIST | ✓ |
F.INV.RT | FINV | ✓ |
F.TEST | FTEST | ✓ |
GAMMA.DIST | GAMMADIST | ✓ | ✓
GAMMA.INV | GAMMAINV | ✓ | ✓
HYPGEOM.DIST | HYPGEOMDIST | ✓ |
LOGNORM.DIST | LOGNORMDIST | ✓ |
LOGNORM.INV | LOGINV | ✓ | ✓
MODE.SNGL | MODE | ✓ | ✓
NEGBINOM.DIST | NEGBINOMDIST | ✓ |
NORM.DIST | NORMDIST | ✓ | ✓
NORM.INV | NORMINV | ✓ | ✓
NORM.S.DIST | NORMSDIST | ✓ |
NORM.S.INV | NORMSINV | ✓ | ✓
PERCENTILE.INC | PERCENTILE | ✓ | ✓
PERCENTRANK.INC | PERCENTRANK | ✓ | ✓
POISSON.DIST | POISSON | ✓ | ✓
QUARTILE.INC | QUARTILE | ✓ | ✓
RANK.EQ | RANK | ✓ | ✓
STDEV.P | STDEVP | ✓ | ✓
STDEV.S | STDEV | ✓ | ✓
T.DIST.2T | TDIST | ✓ |
T.DIST.RT | TDIST | ✓ |
T.INV.2T | TINV | ✓ |
T.TEST | TTEST | ✓ |
VAR.P | VARP | ✓ | ✓
VAR.S | VAR | ✓ | ✓
WEIBULL.DIST | WEIBULL | ✓ | ✓
Z.TEST | ZTEST | ✓ | ✓
  • Total: 39
  • Implemented: 25 (64%)


Supported Excel charts | FlexCel Studio for the .NET Framework documentation

Supported Excel charts

flexcel lines of code

This is a list of all the standard Excel charts. For the chart types that FlexCel can render, we include an screenshot of a basic chart rendered by Excel and by FlexCel.

General features

  • Log charts are fully supported
  • Secondary axis are fully supported
  • Reversed axis are fully supported
  • Error bars are fully supported
  • Up/Down bars are fully supported
  • Datatables are not supported
  • Trendlines are not supported
  • 3-D charts are not supported

Column

Clustered Column

Excel | FlexCel
chart clustered column excel | chart clustered column flexcel

Stacked Column

Excel | FlexCel
chart stacked column excel | chart stacked column flexcel

100% Stacked Column

Excel | FlexCel
chart stacked column 100 excel | chart stacked column 100 flexcel

Line

Line

Excel | FlexCel
chart line excel | chart line flexcel

Stacked Line

Excel | FlexCel
chart stacked line excel | chart stacked line flexcel

100% Stacked Line

Excel | FlexCel
chart stacked line 100 excel | chart stacked line 100 flexcel

Pie

Pie

Excel | FlexCel
chart pie excel | chart pie flexcel

3-D Pie

Not Supported

Pie of Pie

Not Supported

Bar of Pie

Not Supported

Doughnut

Excel | FlexCel
chart doughnut excel | chart doughnut flexcel

Bar

Clustered Bar

Excel | FlexCel
chart clustered bar excel | chart clustered bar flexcel

Stacked Bar

Excel | FlexCel
chart stacked bar excel | chart stacked bar flexcel

100% Stacked Bar

Excel | FlexCel
chart stacked bar 100 excel | chart stacked bar 100 flexcel

Area

Area

Excel | FlexCel
chart area excel | chart area flexcel

Stacked Area

Excel | FlexCel
chart stacked area excel | chart stacked area flexcel

100% Stacked Area

Excel | FlexCel
chart stacked area 100 excel | chart stacked area 100 flexcel

Scatter

Scatter with smooth lines

Excel | FlexCel
chart scatter smooth excel | chart scatter smooth flexcel

Scatter with straight lines

Excel | FlexCel
chart scatter straight excel | chart scatter straight flexcel

Bubble

Excel | FlexCel
chart bubble excel | chart bubble flexcel

3D Bubble

Excel | FlexCel
chart bubble 3d excel | chart bubble 3d flexcel

Map

Not Supported

Stock

Not supported

Surface

Not Supported

Radar

Radar

Excel | FlexCel
chart radar excel | chart radar flexcel

Filled Radar

Excel | FlexCel
chart filled radar excel | chart filled radar flexcel

Treemap

Not Supported

Sunburst

Not Supported

Histogram

Not Supported

Box & Whisker

Not Supported

Waterfall

Not Supported

Funnel

Not Supported

Combo

All combo combinations are supported.

Excel | FlexCel
chart combo line and column excel | chart combo line and column flexcel
Excel | FlexCel
chart combo line bar area and column excel | chart combo line bar area and column flexcel
Excel | FlexCel
chart combo line column and radar excel | chart combo line column and radar flexcel
Excel | FlexCel
chart combo column line and pie excel | chart combo column line and pie flexcel


Copyright information | FlexCel Studio for the .NET Framework documentation

Copyright information

Main Copyright

Unless in the parts specifically mentioned below, all files in this distribution are copyright (c) Adrian Gallero and licensed under the terms detailed in the file license.rtf.

Third party copyrights

This distribution might also contain the following licensed code:

File MD5: MD5 Message-Digest Algorithm.

Parts are Copyright (c) 1990-2, RSA Data Security, Inc.

Those parts are licensed under the following terms:

Copyright (C) 1990-2, RSA Data Security, Inc. Created 1990.
All rights reserved.

RSA Data Security, Inc. makes no representations concerning either
the merchantability of this software or the suitability of this
software for any particular purpose. It is provided ""as is""
without express or implied warranty of any kind.

These notices must be retained in any copies of any part of this
documentation and/or software.

Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991.
All rights reserved.

Parts are Copyright (c) 2002 GL Conseil. All rights reserved.

Those parts are licensed under the following terms:

Copyright 2002 GL Conseil.All rights reserved.
Permission is granted to anyone to use this software for any purpose on
any computer system, and to alter it and redistribute it, subject
to the following restrictions:

1. The author is not responsible for the consequences of use of this
   software, no matter how awful, even if they arise from flaws in it.

2. The origin of this software must not be misrepresented, either by
   explicit claim or by omission.  Since few users ever read sources,
   credits must appear in the documentation.

SHA1 Algorithm.

FlexCel uses the SHA1 algorithm which is Copyright (C) The Internet Society (2001). All Rights Reserved.

SHA1 is licensed under the following terms:

RFC 3174 - US Secure Hash Algorithm 1 (SHA1)

Copyright(C) The Internet Society(2001).  All Rights Reserved.

This document and translations of it may be copied and furnished to
others, and derivative works that comment on or otherwise explain it
or assist in its implementation may be prepared, copied, published
and distributed, in whole or in part, without restriction of any
kind, provided that the above copyright notice and this paragraph are
included on all such copies and derivative works.  However, this
document itself may not be modified in any way, such as by removing
the copyright notice or references to the Internet Society or other
Internet organizations, except as needed for the purpose of
developing Internet standards in which case the procedures for
copyrights defined in the Internet Standards process must be
followed, or as required to translate it into languages other than
English.

The limited permissions granted above are perpetual and will not be
revoked by the Internet Society or its successors or assigns.

This document and the information contained herein is provided on an
"AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION
HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.

Acknowledgement
Funding for the RFC Editor function is currently provided by the
Internet Society.

Files UCompress20: Zlib algorithm implementation.

Parts are Copyright (C) 1995-2004 Jean-loup Gailly and Mark Adler

Those parts are licensed under the following terms:

Copyright (C) 1995-2004 Jean-loup Gailly and Mark Adler

This software is provided 'as-is', without any express or implied
warranty.  In no event will the authors be held liable for any damages
arising from the use of this software.

Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:

1. The origin of this software must not be misrepresented; you must not
   claim that you wrote the original software. If you use this software
   in a product, an acknowledgment in the product documentation would be
   appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
   misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.

Jean-loup Gailly        Mark Adler
jloup@gzip.org          madler@alumni.caltech.edu

File EllipticalArc: Implementation of an arc using Bezier curves.

Parts are Copyright (c) 2003-2004, Luc Maisonobe

Those parts are licensed under the following terms:

// Copyright (c) 2003-2004, Luc Maisonobe
// All rights reserved.
//
// Redistribution and use in source and binary forms, with
// or without modification, are permitted provided that
// the following conditions are met:
//
//    Redistributions of source code must retain the
//    above copyright notice, this list of conditions and
//    the following disclaimer.
//    Redistributions in binary form must reproduce the
//    above copyright notice, this list of conditions and
//    the following disclaimer in the documentation
//    and/or other materials provided with the
//    distribution.
//    Neither the names of spaceroots.org, spaceroots.com
//    nor the names of their contributors may be used to
//    endorse or promote products derived from this
//    software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
// CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
// PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
// THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
// USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
// IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
// USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.

File BidiReference, BidiPBAReference and ArabicShaping: Implementation of arabic shaping algorithm.

Parts are Copyright (c) 1991-2019 Unicode, Inc. All rights reserved. Distributed under the Terms of Use in http://www.unicode.org/copyright.html

Those parts are licensed under the following following terms:

UNICODE, INC. LICENSE AGREEMENT - DATA FILES AND SOFTWARE

Unicode Data Files include all data files under the directories http://www.unicode.org/Public/, http://www.unicode.org/reports/, and http://www.unicode.org/cldr/data/. Unicode Data Files do not include PDF online code charts under the directory http://www.unicode.org/Public/. Software includes any source code published in the Unicode Standard or under the directories http://www.unicode.org/Public/, http://www.unicode.org/reports/, and http://www.unicode.org/cldr/data/.

NOTICE TO USER: Carefully read the following legal agreement. BY DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING UNICODE INC.'S DATA FILES ("DATA FILES"), AND/OR SOFTWARE ("SOFTWARE"), YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU DO NOT AGREE, DO NOT DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE THE DATA FILES OR SOFTWARE.

COPYRIGHT AND PERMISSION NOTICE

Copyright (c) 1991-2019 Unicode, Inc. All rights reserved. Distributed under the Terms of Use in http://www.unicode.org/copyright.html.

Permission is hereby granted, free of charge, to any person obtaining a copy of the Unicode data files and any associated documentation (the "Data Files") or Unicode software and any associated documentation (the "Software") to deal in the Data Files or Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, and/or sell copies of the Data Files or Software, and to permit persons to whom the Data Files or Software are furnished to do so, provided that (a) the above copyright notice(s) and this permission notice appear with all copies of the Data Files or Software, (b) both the above copyright notice(s) and this permission notice appear in associated documentation, and (c) there is clear notice in each modified Data File or in the Software as well as in the documentation associated with the Data File(s) or Software that the data or software has been modified.

THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THE DATA FILES OR SOFTWARE.

Except as contained in this notice, the name of a copyright holder shall not be used in advertising or otherwise to promote the sale, use or other dealings in these Data Files or Software without prior written authorization of the copyright holder

File KhmerShaper: Shaper for Khmer language.

Parts are Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies)

Those parts are licensed under the following following terms:

/*
 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
 *
 * This is part of HarfBuzz, an OpenType Layout engine library.
 *
 * Permission is hereby granted, without written agreement and without
 * license or royalty fees, to use, copy, modify, and distribute this
 * software and its documentation for any purpose, provided that the
 * above copyright notice and the following two paragraphs appear in
 * all copies of this software.
 *
 * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
 * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
 * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
 * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
 * DAMAGE.
 *
 * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
 * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
 * FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
 * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
 * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
 */

Files OctreeQuantizer, OctreeQuantizer, Quantizer: Color Quantizer to convert images to grayscale.

Parts are Copyright (c) Morgan Skinner

Those parts are licensed under the following following terms:

  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
  ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
  THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
  PARTICULAR PURPOSE.

    This is sample code and is freely distributable.

File: sRGB_IEC61966-2-1_black_scaled.icc: Color profile for embedding in PDF/A files.

Copyright International Color Consortium, 2009

This file contains a color profile which will be embedded when you create PDF/A files, or when you set the PDF generation options to embed the color profile. It is licensed on the following terms:

To anyone who acknowledges that the file "sRGB_IEC61966-2-1_black scaled.icc" is provided "AS IS" WITH NO EXPRESS OR IMPLIED WARRANTY, permission to use, copy and distribute these file for any purpose is hereby granted without fee, provided that the file is not changed including the ICC copyright notice tag, and that the name of ICC shall not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. ICC makes no representations about the suitability of this software for any purpose.

File: PdfStandardFontInfo.data.gz: Standard PDF Font data.

Copyright (c) Adobe systems

PdfStandardFontInfo.data.gz contains postcript data for fonts, and data comes from the AFM files published by Adobe, which are distributed under the following license:

 This file and the 14 PostScript(R) AFM files it accompanies may be used, copied, and distributed for any purpose and without charge, with or without modification, provided that all copyright notices are retained; that the AFM files are not distributed without this file; that all modifications to this file or any of the AFM files are prominently noted in the modified file(s); and that this paragraph is not modified. Adobe Systems has no responsibility or obligation to support the use of the AFM files.

File: Northwind.sqlite: Demo database.

Copyright (c) 2008, Microsoft

This file is used in the FlexCel demos (not used in the FlexCel itself) and it is under the following license:

Copyright (c) 2008, Microsoft
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

* Neither the name of Microsoft nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Files: All files in 20.Reports\SharedData\SQLite folder: Embedded DB Server for the Demos.

Public Domain

The SQLite files are used only in the demos (not in used in FlexCel itself). SQLite is in the Public Domain:

All of the code and documentation in SQLite has been dedicated to the public domain by the authors. All code authors, and representatives of the companies they work for, have signed affidavits dedicating their contributions to the public domain and originals of those signed affidavits are stored in a firesafe at the main offices of Hwaci. Anyone is free to copy, modify, publish, use, compile, sell, or distribute the original SQLite code, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means.

Icons in demos and tools.

Some of the icons used in demos and tools are created using objects which are Copyright (c) Axialis Software Corporation

Those objects are used under the following license:

This is a legal agreement between you (the "User") and Axialis Software Corporation ("Axialis"). By downloading this object pack (the "Objects") from Axialis.com, the user agrees to the following:

 License Grant

Axialis grants the User a non-exclusive, non-transferable, royalty-free license to use these objects as indicated herein. The Objects can be assembled together to create icons (the "Icons").

You MAY:(a) assemble the Objects to create Icons using an Axialis product only; (b) use the Objects "as is" in personal or commercial software projects (menus, toolbars, dialog boxes...) as long as you own a licensed version of the associated Axialis Product; (c) use the created Icons in personal or commercial software projects (menus, toolbars, dialog boxes...) as long as you own a licensed version of the associated Axialis Product.

 Restrictions

You MAY NOT:(a) use the Objects without owning a licensed version of the associated Axialis Product; (b) redistribute, loan, rent, sell the Objects "as is" and/or the created Icons as a set of Icons or individually; (c) use the Icons or Objects to illustrate pornographic, immoral, illegal or defamatory material.

 Copyright / Ownership

The Objects are proprietary products of AXIALIS and are protected by copyright and other intellectual property laws. The Objects are licensed and not sold. You acquire only the right to use the Objects and do not acquire any rights, express or implied, in the Software other than those specified in this License.

 Disclaimer of warranties

The Objects is supplied "as is". AXIALIS disclaims all warranties, expressed or implied, including, without limitation, the warranties of merchantability and of fitness for any purpose. The user must assume the entire risk of using the Objects.

 Disclaimer of damages

AXIALIS assumes no liability for damages, direct or consequential, which may result from the use of the Objects, even if AXIALIS has been advised of the possibility of such damages. Any liability of the seller will be limited to refund the purchase price if any.


TMS component single developer license agreement | FlexCel Studio for the .NET Framework documentation

TMS component single developer license agreement

TMS component license agreement between TMS software and holder of the component license.

The license of the component gives you the right to:

  • use the component for development of applications or any type of software module in general by a single developer within the company holding the license.
  • sell any commercial compiled application with the control, published by the company holding the license.
  • make modifications to the source code of component for own use.
  • use the component and source code on all development systems used by the developer assigned by the company holding the license.
  • request future versions of the component during the license period of one year after purchase date. After expiry of the registration TMS software can no longer provide any old version of software, documentation or samples. TMS software is not a backup service and expects backups to be made by the licensed user.
  • access to priority email, web forum support by the single developer assigned by the company holding the license during the license period.
  • sell any number of applications in any quantity without any additional run-time fees required.
  • use the software as-is perpetually.

The license agreement prevents you from:

  • distributing parts or full source code of any component from TMS software.
  • using parts or full source code of components from the TMS software for creating any type of other components that are distributed or sold with or without source code.
  • changing the source code of any component from TMS software and sell or distribute this as a modified product.
  • creating a descendant compiled product such as OCX, ActiveX, .NET, Web, VCL control and sell or distribute this as a product.
  • using the control in applications sold with different publisher name than the company holding the license.
  • transferring the license to another developer.
  • transferring the license to another company.
  • using the components by multiple developers in the company holding the license.
  • installing the components on machines not primarily used by the licensed developer.

The license agreement terminates immediately after violation of any of the terms and conditions described

Disclaimer:

THIS SOFTWARE IS PROVIDED TO YOU "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED INCLUDING BUT NOT LIMITED TO THE APPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. YOU ASSUME THE ENTIRE RISK AS TO THE ACCURACY AND THE USE OF THE SOFTWARE AND ALL OTHER RISK ARISING OUT OF THE USE OR PERFORMANCE OF THIS SOFTWARE AND DOCUMENTATION. tmssoftware.com bvba SHALL NOT BE LIABLE FOR ANY DAMAGES WHATSOEVER ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF tmssoftware.com bvba HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL tmssoftware.com bvba BE LIABLE FOR ANY CONSEQUENTIAL, INCIDENTAL, DIRECT, INDIRECT, SPECIAL, PUNITIVE, OR OTHER DAMAGES WHATSOEVER, INCLUDING BUT NOT LIMITED TO DAMAGES OR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR OTHER PECUNIARY LOSS, EVEN IF tmssoftware.com bvba HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.


TMS component site license agreement | FlexCel Studio for the .NET Framework documentation

TMS component site license agreement

TMS component license agreement between TMS software and holder of the component license.

The license of the component gives you the right to:

  • use the component for development of applications or any type of software module in general by all developers within the company holding the license.
  • sell any commercial compiled application with the control, published by the company holding the license.
  • make modifications to the source code of component for own use.
  • use the component and source code on all development systems used by all developers in the company holding the license.
  • request future versions of the component at any time either through the web or by email for one year after purchase. After expiry of the registration TMS software can no longer provide any old version of software, documentation or samples. TMS software is not a backup service and expects backups to be made by the licensed user.
  • access to priority email, web forum support by all developers in the company holding the license during the license period.
  • sell any number of applications in any quantity without any additional run-time fees required.
  • change at any time the number of developers using the TMS software components within the company holding the license.
  • notify TMS software at any time to allow new developers within the company to access the priority email, web forum support during the license period of one year.
  • allow any number of developers within the company holding the license to access the web based interface for obtaining product updates.
  • use the software as-is perpetually.

The license agreement prevents you from:

  • distributing parts or full source code of any component from TMS software.
  • using parts or full source code of components from the TMS software for creating any type of other components that are distributed or sold with or without source code.
  • changing the source code of any component from TMS software and sell or distribute this as a modified product.
  • creating a descendant compiled product such as OCX, ActiveX, .NET, Web, VCL control and sell or distribute this as a product.
  • using the control in applications sold with different publisher name than the company holding the license.

The license agreement terminates immediately after violation of any of the terms and conditions described

Disclaimer:

THIS SOFTWARE IS PROVIDED TO YOU "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED INCLUDING BUT NOT LIMITED TO THE APPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. YOU ASSUME THE ENTIRE RISK AS TO THE ACCURACY AND THE USE OF THE SOFTWARE AND ALL OTHER RISK ARISING OUT OF THE USE OR PERFORMANCE OF THIS SOFTWARE AND DOCUMENTATION. tmssoftware.com bvba SHALL NOT BE LIABLE FOR ANY DAMAGES WHATSOEVER ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF tmssoftware.com bvba HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL tmssoftware.com bvba BE LIABLE FOR ANY CONSEQUENTIAL, INCIDENTAL, DIRECT, INDIRECT, SPECIAL, PUNITIVE, OR OTHER DAMAGES WHATSOEVER, INCLUDING BUT NOT LIMITED TO DAMAGES OR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR OTHER PECUNIARY LOSS, EVEN IF tmssoftware.com bvba HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.


FlexCel Studio for the .NET Framework documentation. | FlexCel Studio for the .NET Framework documentation

FlexCel Studio for the .NET Framework documentation.